code
stringlengths 3
1.01M
| repo_name
stringlengths 5
116
| path
stringlengths 3
311
| language
stringclasses 30
values | license
stringclasses 15
values | size
int64 3
1.01M
|
|---|---|---|---|---|---|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<link rel="shortcut icon" type="image/x-icon" href="../../../favicon.ico" />
<title>Double - Android SDK | Android Developers</title>
<!-- STYLESHEETS -->
<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto">
<link href="../../../assets/css/default.css" rel="stylesheet" type="text/css">
<!-- FULLSCREEN STYLESHEET -->
<link href="../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">
<!-- JAVASCRIPT -->
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script src="../../../assets/js/android_3p-bundle.js" type="text/javascript"></script>
<script type="text/javascript">
var toRoot = "../../../";
var devsite = false;
</script>
<script src="../../../assets/js/docs.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-5831155-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="gc-documentation
develop" itemscope itemtype="http://schema.org/Article">
<div id="doc-api-level" class="1" style="display:none"></div>
<a name="top"></a>
<a name="top"></a>
<!-- Header -->
<div id="header">
<div class="wrap" id="header-wrap">
<div class="col-3 logo">
<a href="../../../index.html">
<img src="../../../assets/images/dac_logo.png" width="123" height="25" alt="Android Developers" />
</a>
<div class="btn-quicknav" id="btn-quicknav">
<a href="#" class="arrow-inactive">Quicknav</a>
<a href="#" class="arrow-active">Quicknav</a>
</div>
</div>
<ul class="nav-x col-9">
<li class="design">
<a href="../../../design/index.html"
zh-tw-lang="設計"
zh-cn-lang="设计"
ru-lang="Проектирование"
ko-lang="디자인"
ja-lang="設計"
es-lang="Diseñar"
>Design</a></li>
<li class="develop"><a href="../../../develop/index.html"
zh-tw-lang="開發"
zh-cn-lang="开发"
ru-lang="Разработка"
ko-lang="개발"
ja-lang="開発"
es-lang="Desarrollar"
>Develop</a></li>
<li class="distribute last"><a href="../../../distribute/index.html"
zh-tw-lang="發佈"
zh-cn-lang="分发"
ru-lang="Распространение"
ko-lang="배포"
ja-lang="配布"
es-lang="Distribuir"
>Distribute</a></li>
</ul>
<!-- New Search -->
<div class="menu-container">
<div class="moremenu">
<div id="more-btn"></div>
</div>
<div class="morehover" id="moremenu">
<div class="top"></div>
<div class="mid">
<div class="header">Links</div>
<ul>
<li><a href="https://play.google.com/apps/publish/">Google Play Developer Console</a></li>
<li><a href="http://android-developers.blogspot.com/">Android Developers Blog</a></li>
<li><a href="../../../about/index.html">About Android</a></li>
</ul>
<div class="header">Android Sites</div>
<ul>
<li><a href="http://www.android.com">Android.com</a></li>
<li class="active"><a>Android Developers</a></li>
<li><a href="http://source.android.com">Android Open Source Project</a></li>
</ul>
<br class="clearfix" />
</div>
<div class="bottom"></div>
</div>
<div class="search" id="search-container">
<div class="search-inner">
<div id="search-btn"></div>
<div class="left"></div>
<form onsubmit="return submit_search()">
<input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '../../../')"
onkeyup="return search_changed(event, false, '../../../')" />
</form>
<div class="right"></div>
<a class="close hide">close</a>
<div class="left"></div>
<div class="right"></div>
</div>
</div>
<div class="search_filtered_wrapper reference">
<div class="suggest-card reference no-display">
<ul class="search_filtered">
</ul>
</div>
</div>
<div class="search_filtered_wrapper docs">
<div class="suggest-card dummy no-display"> </div>
<div class="suggest-card develop no-display">
<ul class="search_filtered">
</ul>
<div class="child-card guides no-display">
</div>
<div class="child-card training no-display">
</div>
</div>
<div class="suggest-card design no-display">
<ul class="search_filtered">
</ul>
</div>
<div class="suggest-card distribute no-display">
<ul class="search_filtered">
</ul>
</div>
</div>
</div>
<!-- /New Search>
<!-- Expanded quicknav -->
<div id="quicknav" class="col-9">
<ul>
<li class="design">
<ul>
<li><a href="../../../design/index.html">Get Started</a></li>
<li><a href="../../../design/style/index.html">Style</a></li>
<li><a href="../../../design/patterns/index.html">Patterns</a></li>
<li><a href="../../../design/building-blocks/index.html">Building Blocks</a></li>
<li><a href="../../../design/downloads/index.html">Downloads</a></li>
<li><a href="../../../design/videos/index.html">Videos</a></li>
</ul>
</li>
<li class="develop">
<ul>
<li><a href="../../../training/index.html"
zh-tw-lang="訓練課程"
zh-cn-lang="培训"
ru-lang="Курсы"
ko-lang="교육"
ja-lang="トレーニング"
es-lang="Capacitación"
>Training</a></li>
<li><a href="../../../guide/components/index.html"
zh-tw-lang="API 指南"
zh-cn-lang="API 指南"
ru-lang="Руководства по API"
ko-lang="API 가이드"
ja-lang="API ガイド"
es-lang="Guías de la API"
>API Guides</a></li>
<li><a href="../../../reference/packages.html"
zh-tw-lang="參考資源"
zh-cn-lang="参考"
ru-lang="Справочник"
ko-lang="참조문서"
ja-lang="リファレンス"
es-lang="Referencia"
>Reference</a></li>
<li><a href="../../../tools/index.html"
zh-tw-lang="相關工具"
zh-cn-lang="工具"
ru-lang="Инструменты"
ko-lang="도구"
ja-lang="ツール"
es-lang="Herramientas"
>Tools</a>
<ul><li><a href="../../../sdk/index.html">Get the SDK</a></li></ul>
</li>
<li><a href="../../../google/index.html">Google Services</a>
</li>
</ul>
</li>
<li class="distribute last">
<ul>
<li><a href="../../../distribute/index.html">Google Play</a></li>
<li><a href="../../../distribute/googleplay/publish/index.html">Publishing</a></li>
<li><a href="../../../distribute/googleplay/promote/index.html">Promoting</a></li>
<li><a href="../../../distribute/googleplay/quality/index.html">App Quality</a></li>
<li><a href="../../../distribute/googleplay/spotlight/index.html">Spotlight</a></li>
<li><a href="../../../distribute/open.html">Open Distribution</a></li>
</ul>
</li>
</ul>
</div>
<!-- /Expanded quicknav -->
</div>
</div>
<!-- /Header -->
<div id="searchResults" class="wrap" style="display:none;">
<h2 id="searchTitle">Results</h2>
<div id="leftSearchControl" class="search-control">Loading...</div>
</div>
<!-- Secondary x-nav -->
<div id="nav-x">
<div class="wrap">
<ul class="nav-x col-9 develop" style="width:100%">
<li class="training"><a href="../../../training/index.html"
zh-tw-lang="訓練課程"
zh-cn-lang="培训"
ru-lang="Курсы"
ko-lang="교육"
ja-lang="トレーニング"
es-lang="Capacitación"
>Training</a></li>
<li class="guide"><a href="../../../guide/components/index.html"
zh-tw-lang="API 指南"
zh-cn-lang="API 指南"
ru-lang="Руководства по API"
ko-lang="API 가이드"
ja-lang="API ガイド"
es-lang="Guías de la API"
>API Guides</a></li>
<li class="reference"><a href="../../../reference/packages.html"
zh-tw-lang="參考資源"
zh-cn-lang="参考"
ru-lang="Справочник"
ko-lang="참조문서"
ja-lang="リファレンス"
es-lang="Referencia"
>Reference</a></li>
<li class="tools"><a href="../../../tools/index.html"
zh-tw-lang="相關工具"
zh-cn-lang="工具"
ru-lang="Инструменты"
ko-lang="도구"
ja-lang="ツール"
es-lang="Herramientas"
>Tools</a></li>
<li class="google"><a href="../../../google/index.html"
>Google Services</a>
</li>
</ul>
</div>
</div>
<!-- /Sendondary x-nav -->
<div class="wrap clearfix" id="body-content">
<div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
<div id="devdoc-nav">
<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
<div id="api-nav-header">
<div id="api-level-toggle">
<label for="apiLevelCheckbox" class="disabled">API level: </label>
<div class="select-wrapper">
<select id="apiLevelSelector">
<!-- option elements added by buildApiLevelSelector() -->
</select>
</div>
</div><!-- end toggle -->
<div id="api-nav-title">Android APIs</div>
</div><!-- end nav header -->
<script>
var SINCE_DATA = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19' ];
buildApiLevelSelector();
</script>
<div id="swapper">
<div id="nav-panels">
<div id="resize-packages-nav">
<div id="packages-nav" class="scroll-pane">
<ul>
<li class="api apilevel-1">
<a href="../../../reference/android/package-summary.html">android</a></li>
<li class="api apilevel-4">
<a href="../../../reference/android/accessibilityservice/package-summary.html">android.accessibilityservice</a></li>
<li class="api apilevel-5">
<a href="../../../reference/android/accounts/package-summary.html">android.accounts</a></li>
<li class="api apilevel-11">
<a href="../../../reference/android/animation/package-summary.html">android.animation</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/app/package-summary.html">android.app</a></li>
<li class="api apilevel-8">
<a href="../../../reference/android/app/admin/package-summary.html">android.app.admin</a></li>
<li class="api apilevel-8">
<a href="../../../reference/android/app/backup/package-summary.html">android.app.backup</a></li>
<li class="api apilevel-3">
<a href="../../../reference/android/appwidget/package-summary.html">android.appwidget</a></li>
<li class="api apilevel-5">
<a href="../../../reference/android/bluetooth/package-summary.html">android.bluetooth</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/content/package-summary.html">android.content</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/content/pm/package-summary.html">android.content.pm</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/content/res/package-summary.html">android.content.res</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/database/package-summary.html">android.database</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/database/sqlite/package-summary.html">android.database.sqlite</a></li>
<li class="api apilevel-11">
<a href="../../../reference/android/drm/package-summary.html">android.drm</a></li>
<li class="api apilevel-4">
<a href="../../../reference/android/gesture/package-summary.html">android.gesture</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/graphics/package-summary.html">android.graphics</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/graphics/drawable/package-summary.html">android.graphics.drawable</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/graphics/drawable/shapes/package-summary.html">android.graphics.drawable.shapes</a></li>
<li class="api apilevel-19">
<a href="../../../reference/android/graphics/pdf/package-summary.html">android.graphics.pdf</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/hardware/package-summary.html">android.hardware</a></li>
<li class="api apilevel-17">
<a href="../../../reference/android/hardware/display/package-summary.html">android.hardware.display</a></li>
<li class="api apilevel-16">
<a href="../../../reference/android/hardware/input/package-summary.html">android.hardware.input</a></li>
<li class="api apilevel-18">
<a href="../../../reference/android/hardware/location/package-summary.html">android.hardware.location</a></li>
<li class="api apilevel-12">
<a href="../../../reference/android/hardware/usb/package-summary.html">android.hardware.usb</a></li>
<li class="api apilevel-3">
<a href="../../../reference/android/inputmethodservice/package-summary.html">android.inputmethodservice</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/location/package-summary.html">android.location</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/media/package-summary.html">android.media</a></li>
<li class="api apilevel-9">
<a href="../../../reference/android/media/audiofx/package-summary.html">android.media.audiofx</a></li>
<li class="api apilevel-14">
<a href="../../../reference/android/media/effect/package-summary.html">android.media.effect</a></li>
<li class="api apilevel-12">
<a href="../../../reference/android/mtp/package-summary.html">android.mtp</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/net/package-summary.html">android.net</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/net/http/package-summary.html">android.net.http</a></li>
<li class="api apilevel-16">
<a href="../../../reference/android/net/nsd/package-summary.html">android.net.nsd</a></li>
<li class="api apilevel-12">
<a href="../../../reference/android/net/rtp/package-summary.html">android.net.rtp</a></li>
<li class="api apilevel-9">
<a href="../../../reference/android/net/sip/package-summary.html">android.net.sip</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/net/wifi/package-summary.html">android.net.wifi</a></li>
<li class="api apilevel-14">
<a href="../../../reference/android/net/wifi/p2p/package-summary.html">android.net.wifi.p2p</a></li>
<li class="api apilevel-16">
<a href="../../../reference/android/net/wifi/p2p/nsd/package-summary.html">android.net.wifi.p2p.nsd</a></li>
<li class="api apilevel-9">
<a href="../../../reference/android/nfc/package-summary.html">android.nfc</a></li>
<li class="api apilevel-19">
<a href="../../../reference/android/nfc/cardemulation/package-summary.html">android.nfc.cardemulation</a></li>
<li class="api apilevel-10">
<a href="../../../reference/android/nfc/tech/package-summary.html">android.nfc.tech</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/opengl/package-summary.html">android.opengl</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/os/package-summary.html">android.os</a></li>
<li class="api apilevel-9">
<a href="../../../reference/android/os/storage/package-summary.html">android.os.storage</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/preference/package-summary.html">android.preference</a></li>
<li class="api apilevel-19">
<a href="../../../reference/android/print/package-summary.html">android.print</a></li>
<li class="api apilevel-19">
<a href="../../../reference/android/print/pdf/package-summary.html">android.print.pdf</a></li>
<li class="api apilevel-19">
<a href="../../../reference/android/printservice/package-summary.html">android.printservice</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/provider/package-summary.html">android.provider</a></li>
<li class="api apilevel-11">
<a href="../../../reference/android/renderscript/package-summary.html">android.renderscript</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/sax/package-summary.html">android.sax</a></li>
<li class="api apilevel-14">
<a href="../../../reference/android/security/package-summary.html">android.security</a></li>
<li class="api apilevel-17">
<a href="../../../reference/android/service/dreams/package-summary.html">android.service.dreams</a></li>
<li class="api apilevel-18">
<a href="../../../reference/android/service/notification/package-summary.html">android.service.notification</a></li>
<li class="api apilevel-14">
<a href="../../../reference/android/service/textservice/package-summary.html">android.service.textservice</a></li>
<li class="api apilevel-7">
<a href="../../../reference/android/service/wallpaper/package-summary.html">android.service.wallpaper</a></li>
<li class="api apilevel-3">
<a href="../../../reference/android/speech/package-summary.html">android.speech</a></li>
<li class="api apilevel-4">
<a href="../../../reference/android/speech/tts/package-summary.html">android.speech.tts</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v13/app/package-summary.html">android.support.v13.app</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/accessibilityservice/package-summary.html">android.support.v4.accessibilityservice</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/app/package-summary.html">android.support.v4.app</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/content/package-summary.html">android.support.v4.content</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/content/pm/package-summary.html">android.support.v4.content.pm</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/database/package-summary.html">android.support.v4.database</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/graphics/drawable/package-summary.html">android.support.v4.graphics.drawable</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/hardware/display/package-summary.html">android.support.v4.hardware.display</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/media/package-summary.html">android.support.v4.media</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/net/package-summary.html">android.support.v4.net</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/os/package-summary.html">android.support.v4.os</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/print/package-summary.html">android.support.v4.print</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/text/package-summary.html">android.support.v4.text</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/util/package-summary.html">android.support.v4.util</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/view/package-summary.html">android.support.v4.view</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/view/accessibility/package-summary.html">android.support.v4.view.accessibility</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v4/widget/package-summary.html">android.support.v4.widget</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v7/app/package-summary.html">android.support.v7.app</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v7/appcompat/package-summary.html">android.support.v7.appcompat</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v7/gridlayout/package-summary.html">android.support.v7.gridlayout</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v7/media/package-summary.html">android.support.v7.media</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v7/mediarouter/package-summary.html">android.support.v7.mediarouter</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v7/view/package-summary.html">android.support.v7.view</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v7/widget/package-summary.html">android.support.v7.widget</a></li>
<li class="api apilevel-">
<a href="../../../reference/android/support/v8/renderscript/package-summary.html">android.support.v8.renderscript</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/telephony/package-summary.html">android.telephony</a></li>
<li class="api apilevel-5">
<a href="../../../reference/android/telephony/cdma/package-summary.html">android.telephony.cdma</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/telephony/gsm/package-summary.html">android.telephony.gsm</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/test/package-summary.html">android.test</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/test/mock/package-summary.html">android.test.mock</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/test/suitebuilder/package-summary.html">android.test.suitebuilder</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/text/package-summary.html">android.text</a></li>
<li class="api apilevel-3">
<a href="../../../reference/android/text/format/package-summary.html">android.text.format</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/text/method/package-summary.html">android.text.method</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/text/style/package-summary.html">android.text.style</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/text/util/package-summary.html">android.text.util</a></li>
<li class="api apilevel-19">
<a href="../../../reference/android/transition/package-summary.html">android.transition</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/util/package-summary.html">android.util</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/view/package-summary.html">android.view</a></li>
<li class="api apilevel-4">
<a href="../../../reference/android/view/accessibility/package-summary.html">android.view.accessibility</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/view/animation/package-summary.html">android.view.animation</a></li>
<li class="api apilevel-3">
<a href="../../../reference/android/view/inputmethod/package-summary.html">android.view.inputmethod</a></li>
<li class="api apilevel-14">
<a href="../../../reference/android/view/textservice/package-summary.html">android.view.textservice</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/webkit/package-summary.html">android.webkit</a></li>
<li class="api apilevel-1">
<a href="../../../reference/android/widget/package-summary.html">android.widget</a></li>
<li class="api apilevel-1">
<a href="../../../reference/dalvik/bytecode/package-summary.html">dalvik.bytecode</a></li>
<li class="api apilevel-1">
<a href="../../../reference/dalvik/system/package-summary.html">dalvik.system</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/awt/font/package-summary.html">java.awt.font</a></li>
<li class="api apilevel-3">
<a href="../../../reference/java/beans/package-summary.html">java.beans</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/io/package-summary.html">java.io</a></li>
<li class="selected api apilevel-1">
<a href="../../../reference/java/lang/package-summary.html">java.lang</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/lang/annotation/package-summary.html">java.lang.annotation</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/lang/ref/package-summary.html">java.lang.ref</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/lang/reflect/package-summary.html">java.lang.reflect</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/math/package-summary.html">java.math</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/net/package-summary.html">java.net</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/nio/package-summary.html">java.nio</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/nio/channels/package-summary.html">java.nio.channels</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/nio/channels/spi/package-summary.html">java.nio.channels.spi</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/nio/charset/package-summary.html">java.nio.charset</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/nio/charset/spi/package-summary.html">java.nio.charset.spi</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/security/package-summary.html">java.security</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/security/acl/package-summary.html">java.security.acl</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/security/cert/package-summary.html">java.security.cert</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/security/interfaces/package-summary.html">java.security.interfaces</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/security/spec/package-summary.html">java.security.spec</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/sql/package-summary.html">java.sql</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/text/package-summary.html">java.text</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/util/package-summary.html">java.util</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/util/concurrent/package-summary.html">java.util.concurrent</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/util/concurrent/atomic/package-summary.html">java.util.concurrent.atomic</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/util/concurrent/locks/package-summary.html">java.util.concurrent.locks</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/util/jar/package-summary.html">java.util.jar</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/util/logging/package-summary.html">java.util.logging</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/util/prefs/package-summary.html">java.util.prefs</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/util/regex/package-summary.html">java.util.regex</a></li>
<li class="api apilevel-1">
<a href="../../../reference/java/util/zip/package-summary.html">java.util.zip</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/crypto/package-summary.html">javax.crypto</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/crypto/interfaces/package-summary.html">javax.crypto.interfaces</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/crypto/spec/package-summary.html">javax.crypto.spec</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/microedition/khronos/egl/package-summary.html">javax.microedition.khronos.egl</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/microedition/khronos/opengles/package-summary.html">javax.microedition.khronos.opengles</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/net/package-summary.html">javax.net</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/net/ssl/package-summary.html">javax.net.ssl</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/security/auth/package-summary.html">javax.security.auth</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/security/auth/callback/package-summary.html">javax.security.auth.callback</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/security/auth/login/package-summary.html">javax.security.auth.login</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/security/auth/x500/package-summary.html">javax.security.auth.x500</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/security/cert/package-summary.html">javax.security.cert</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/sql/package-summary.html">javax.sql</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/xml/package-summary.html">javax.xml</a></li>
<li class="api apilevel-8">
<a href="../../../reference/javax/xml/datatype/package-summary.html">javax.xml.datatype</a></li>
<li class="api apilevel-8">
<a href="../../../reference/javax/xml/namespace/package-summary.html">javax.xml.namespace</a></li>
<li class="api apilevel-1">
<a href="../../../reference/javax/xml/parsers/package-summary.html">javax.xml.parsers</a></li>
<li class="api apilevel-8">
<a href="../../../reference/javax/xml/transform/package-summary.html">javax.xml.transform</a></li>
<li class="api apilevel-8">
<a href="../../../reference/javax/xml/transform/dom/package-summary.html">javax.xml.transform.dom</a></li>
<li class="api apilevel-8">
<a href="../../../reference/javax/xml/transform/sax/package-summary.html">javax.xml.transform.sax</a></li>
<li class="api apilevel-8">
<a href="../../../reference/javax/xml/transform/stream/package-summary.html">javax.xml.transform.stream</a></li>
<li class="api apilevel-8">
<a href="../../../reference/javax/xml/validation/package-summary.html">javax.xml.validation</a></li>
<li class="api apilevel-8">
<a href="../../../reference/javax/xml/xpath/package-summary.html">javax.xml.xpath</a></li>
<li class="api apilevel-1">
<a href="../../../reference/junit/framework/package-summary.html">junit.framework</a></li>
<li class="api apilevel-1">
<a href="../../../reference/junit/runner/package-summary.html">junit.runner</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/package-summary.html">org.apache.http</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/auth/package-summary.html">org.apache.http.auth</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/auth/params/package-summary.html">org.apache.http.auth.params</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/client/package-summary.html">org.apache.http.client</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/client/entity/package-summary.html">org.apache.http.client.entity</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/client/methods/package-summary.html">org.apache.http.client.methods</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/client/params/package-summary.html">org.apache.http.client.params</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/client/protocol/package-summary.html">org.apache.http.client.protocol</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/client/utils/package-summary.html">org.apache.http.client.utils</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/conn/package-summary.html">org.apache.http.conn</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/conn/params/package-summary.html">org.apache.http.conn.params</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/conn/routing/package-summary.html">org.apache.http.conn.routing</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/conn/scheme/package-summary.html">org.apache.http.conn.scheme</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/conn/ssl/package-summary.html">org.apache.http.conn.ssl</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/conn/util/package-summary.html">org.apache.http.conn.util</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/cookie/package-summary.html">org.apache.http.cookie</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/cookie/params/package-summary.html">org.apache.http.cookie.params</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/entity/package-summary.html">org.apache.http.entity</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/impl/package-summary.html">org.apache.http.impl</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/impl/auth/package-summary.html">org.apache.http.impl.auth</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/impl/client/package-summary.html">org.apache.http.impl.client</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/impl/conn/package-summary.html">org.apache.http.impl.conn</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/impl/conn/tsccm/package-summary.html">org.apache.http.impl.conn.tsccm</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/impl/cookie/package-summary.html">org.apache.http.impl.cookie</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/impl/entity/package-summary.html">org.apache.http.impl.entity</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/impl/io/package-summary.html">org.apache.http.impl.io</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/io/package-summary.html">org.apache.http.io</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/message/package-summary.html">org.apache.http.message</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/params/package-summary.html">org.apache.http.params</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/protocol/package-summary.html">org.apache.http.protocol</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/apache/http/util/package-summary.html">org.apache.http.util</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/json/package-summary.html">org.json</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/w3c/dom/package-summary.html">org.w3c.dom</a></li>
<li class="api apilevel-8">
<a href="../../../reference/org/w3c/dom/ls/package-summary.html">org.w3c.dom.ls</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/xml/sax/package-summary.html">org.xml.sax</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/xml/sax/ext/package-summary.html">org.xml.sax.ext</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/xml/sax/helpers/package-summary.html">org.xml.sax.helpers</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/xmlpull/v1/package-summary.html">org.xmlpull.v1</a></li>
<li class="api apilevel-1">
<a href="../../../reference/org/xmlpull/v1/sax2/package-summary.html">org.xmlpull.v1.sax2</a></li>
</ul><br/>
</div> <!-- end packages-nav -->
</div> <!-- end resize-packages -->
<div id="classes-nav" class="scroll-pane">
<ul>
<li><h2>Interfaces</h2>
<ul>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Appendable.html">Appendable</a></li>
<li class="api apilevel-19"><a href="../../../reference/java/lang/AutoCloseable.html">AutoCloseable</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/CharSequence.html">CharSequence</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Cloneable.html">Cloneable</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Comparable.html">Comparable</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Iterable.html">Iterable</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Readable.html">Readable</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Runnable.html">Runnable</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Thread.UncaughtExceptionHandler.html">Thread.UncaughtExceptionHandler</a></li>
</ul>
</li>
<li><h2>Classes</h2>
<ul>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Boolean.html">Boolean</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Byte.html">Byte</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Character.html">Character</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Character.Subset.html">Character.Subset</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Character.UnicodeBlock.html">Character.UnicodeBlock</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Class.html">Class</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ClassLoader.html">ClassLoader</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Compiler.html">Compiler</a></li>
<li class="selected api apilevel-1"><a href="../../../reference/java/lang/Double.html">Double</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Enum.html">Enum</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Float.html">Float</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/InheritableThreadLocal.html">InheritableThreadLocal</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Integer.html">Integer</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Long.html">Long</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Math.html">Math</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Number.html">Number</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Object.html">Object</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Package.html">Package</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Process.html">Process</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ProcessBuilder.html">ProcessBuilder</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Runtime.html">Runtime</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/RuntimePermission.html">RuntimePermission</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/SecurityManager.html">SecurityManager</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Short.html">Short</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/StackTraceElement.html">StackTraceElement</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/StrictMath.html">StrictMath</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/String.html">String</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/StringBuffer.html">StringBuffer</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/System.html">System</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Thread.html">Thread</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ThreadGroup.html">ThreadGroup</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ThreadLocal.html">ThreadLocal</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Throwable.html">Throwable</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Void.html">Void</a></li>
</ul>
</li>
<li><h2>Enums</h2>
<ul>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Thread.State.html">Thread.State</a></li>
</ul>
</li>
<li><h2>Exceptions</h2>
<ul>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ArithmeticException.html">ArithmeticException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ArrayStoreException.html">ArrayStoreException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ClassCastException.html">ClassCastException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ClassNotFoundException.html">ClassNotFoundException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/CloneNotSupportedException.html">CloneNotSupportedException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/EnumConstantNotPresentException.html">EnumConstantNotPresentException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Exception.html">Exception</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/IllegalAccessException.html">IllegalAccessException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/IllegalArgumentException.html">IllegalArgumentException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/IllegalMonitorStateException.html">IllegalMonitorStateException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/IllegalStateException.html">IllegalStateException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/IllegalThreadStateException.html">IllegalThreadStateException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/InstantiationException.html">InstantiationException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/InterruptedException.html">InterruptedException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/NegativeArraySizeException.html">NegativeArraySizeException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/NoSuchFieldException.html">NoSuchFieldException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/NoSuchMethodException.html">NoSuchMethodException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/NullPointerException.html">NullPointerException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/NumberFormatException.html">NumberFormatException</a></li>
<li class="api apilevel-19"><a href="../../../reference/java/lang/ReflectiveOperationException.html">ReflectiveOperationException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/RuntimeException.html">RuntimeException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/SecurityException.html">SecurityException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/TypeNotPresentException.html">TypeNotPresentException</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/UnsupportedOperationException.html">UnsupportedOperationException</a></li>
</ul>
</li>
<li><h2>Errors</h2>
<ul>
<li class="api apilevel-1"><a href="../../../reference/java/lang/AbstractMethodError.html">AbstractMethodError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/AssertionError.html">AssertionError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ClassCircularityError.html">ClassCircularityError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ClassFormatError.html">ClassFormatError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/Error.html">Error</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ExceptionInInitializerError.html">ExceptionInInitializerError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/IllegalAccessError.html">IllegalAccessError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/IncompatibleClassChangeError.html">IncompatibleClassChangeError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/InstantiationError.html">InstantiationError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/InternalError.html">InternalError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/LinkageError.html">LinkageError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/NoClassDefFoundError.html">NoClassDefFoundError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/NoSuchFieldError.html">NoSuchFieldError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/NoSuchMethodError.html">NoSuchMethodError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/OutOfMemoryError.html">OutOfMemoryError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/StackOverflowError.html">StackOverflowError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/ThreadDeath.html">ThreadDeath</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/UnknownError.html">UnknownError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/UnsatisfiedLinkError.html">UnsatisfiedLinkError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/UnsupportedClassVersionError.html">UnsupportedClassVersionError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/VerifyError.html">VerifyError</a></li>
<li class="api apilevel-1"><a href="../../../reference/java/lang/VirtualMachineError.html">VirtualMachineError</a></li>
</ul>
</li>
</ul><br/>
</div><!-- end classes -->
</div><!-- end nav-panels -->
<div id="nav-tree" style="display:none" class="scroll-pane">
<div id="tree-list"></div>
</div><!-- end nav-tree -->
</div><!-- end swapper -->
<div id="nav-swap">
<a class="fullscreen">fullscreen</a>
<a href='#' onclick='swapNav();return false;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>
</div>
</div> <!-- end devdoc-nav -->
</div> <!-- end side-nav -->
<script type="text/javascript">
// init fullscreen based on user pref
var fullscreen = readCookie("fullscreen");
if (fullscreen != 0) {
if (fullscreen == "false") {
toggleFullscreen(false);
} else {
toggleFullscreen(true);
}
}
// init nav version for mobile
if (isMobile) {
swapNav(); // tree view should be used on mobile
$('#nav-swap').hide();
} else {
chooseDefaultNav();
if ($("#nav-tree").is(':visible')) {
init_default_navtree("../../../");
}
}
// scroll the selected page into view
$(document).ready(function() {
scrollIntoView("packages-nav");
scrollIntoView("classes-nav");
});
</script>
<div class="col-12" id="doc-col">
<div id="api-info-block">
<div class="sum-details-links">
Summary:
<a href="#constants">Constants</a>
| <a href="#lfields">Fields</a>
| <a href="#pubctors">Ctors</a>
| <a href="#pubmethods">Methods</a>
| <a href="#inhmethods">Inherited Methods</a>
| <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a>
</div><!-- end sum-details-links -->
<div class="api-level">
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a>
</div>
</div><!-- end api-info-block -->
<!-- ======== START OF CLASS DATA ======== -->
<div id="jd-header">
public
final
class
<h1 itemprop="name">Double</h1>
extends <a href="../../../reference/java/lang/Number.html">Number</a><br/>
implements
<a href="../../../reference/java/lang/Comparable.html">Comparable</a><T>
</div><!-- end header -->
<div id="naMessage"></div>
<div id="jd-content" class="api apilevel-1">
<table class="jd-inheritance-table">
<tr>
<td colspan="3" class="jd-inheritance-class-cell"><a href="../../../reference/java/lang/Object.html">java.lang.Object</a></td>
</tr>
<tr>
<td class="jd-inheritance-space"> ↳</td>
<td colspan="2" class="jd-inheritance-class-cell"><a href="../../../reference/java/lang/Number.html">java.lang.Number</a></td>
</tr>
<tr>
<td class="jd-inheritance-space"> </td>
<td class="jd-inheritance-space"> ↳</td>
<td colspan="1" class="jd-inheritance-class-cell">java.lang.Double</td>
</tr>
</table>
<div class="jd-descr">
<h2>Class Overview</h2>
<p itemprop="articleBody">The wrapper for the primitive type <code>double</code>.</p>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">See Also</h5>
<ul class="nolist"><li><code><a href="../../../reference/java/lang/Number.html">Number</a></code></li>
</ul>
</div>
</div><!-- jd-descr -->
<div class="jd-descr">
<h2>Summary</h2>
<!-- =========== ENUM CONSTANT SUMMARY =========== -->
<table id="constants" class="jd-sumtable"><tr><th colspan="12">Constants</th></tr>
<tr class="alt-color api apilevel-9" >
<td class="jd-typecol">int</td>
<td class="jd-linkcol"><a href="../../../reference/java/lang/Double.html#MAX_EXPONENT">MAX_EXPONENT</a></td>
<td class="jd-descrcol" width="100%">Maximum base-2 exponent that a finite value of the <code>double</code> type may have.</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol">double</td>
<td class="jd-linkcol"><a href="../../../reference/java/lang/Double.html#MAX_VALUE">MAX_VALUE</a></td>
<td class="jd-descrcol" width="100%">Constant for the maximum <code>double</code> value, (2 - 2<sup>-52</sup>) *
2<sup>1023</sup>.</td>
</tr>
<tr class="alt-color api apilevel-9" >
<td class="jd-typecol">int</td>
<td class="jd-linkcol"><a href="../../../reference/java/lang/Double.html#MIN_EXPONENT">MIN_EXPONENT</a></td>
<td class="jd-descrcol" width="100%">Minimum base-2 exponent that a normal value of the <code>double</code> type may have.</td>
</tr>
<tr class=" api apilevel-9" >
<td class="jd-typecol">double</td>
<td class="jd-linkcol"><a href="../../../reference/java/lang/Double.html#MIN_NORMAL">MIN_NORMAL</a></td>
<td class="jd-descrcol" width="100%">Constant for the smallest positive normal value of the <code>double</code> type.</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol">double</td>
<td class="jd-linkcol"><a href="../../../reference/java/lang/Double.html#MIN_VALUE">MIN_VALUE</a></td>
<td class="jd-descrcol" width="100%">Constant for the minimum <code>double</code> value, 2<sup>-1074</sup>.</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol">double</td>
<td class="jd-linkcol"><a href="../../../reference/java/lang/Double.html#NEGATIVE_INFINITY">NEGATIVE_INFINITY</a></td>
<td class="jd-descrcol" width="100%">Constant for the negative infinity value of the <code>double</code> type.</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol">double</td>
<td class="jd-linkcol"><a href="../../../reference/java/lang/Double.html#NaN">NaN</a></td>
<td class="jd-descrcol" width="100%">Constant for the Not-a-Number (NaN) value of the <code>double</code> type.</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol">double</td>
<td class="jd-linkcol"><a href="../../../reference/java/lang/Double.html#POSITIVE_INFINITY">POSITIVE_INFINITY</a></td>
<td class="jd-descrcol" width="100%">Constant for the positive infinity value of the <code>double</code> type.</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol">int</td>
<td class="jd-linkcol"><a href="../../../reference/java/lang/Double.html#SIZE">SIZE</a></td>
<td class="jd-descrcol" width="100%">Constant for the number of bits needed to represent a <code>double</code> in
two's complement form.</td>
</tr>
</table>
<!-- =========== FIELD SUMMARY =========== -->
<table id="lfields" class="jd-sumtable"><tr><th colspan="12">Fields</th></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
public
static
final
<a href="../../../reference/java/lang/Class.html">Class</a><<a href="../../../reference/java/lang/Double.html">Double</a>></nobr></td>
<td class="jd-linkcol"><a href="../../../reference/java/lang/Double.html#TYPE">TYPE</a></td>
<td class="jd-descrcol" width="100%">The <code><a href="../../../reference/java/lang/Class.html">Class</a></code> object that represents the primitive type <code>double</code>.</td>
</tr>
</table>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#Double(double)">Double</a></span>(double value)</nobr>
<div class="jd-descrdiv">Constructs a new <code>Double</code> with the specified primitive double
value.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#Double(java.lang.String)">Double</a></span>(<a href="../../../reference/java/lang/String.html">String</a> string)</nobr>
<div class="jd-descrdiv">Constructs a new <code>Double</code> from the specified string.</div>
</td></tr>
</table>
<!-- ========== METHOD SUMMARY =========== -->
<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
byte</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#byteValue()">byteValue</a></span>()</nobr>
<div class="jd-descrdiv">Returns this object's value as a byte.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
static
int</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#compare(double, double)">compare</a></span>(double double1, double double2)</nobr>
<div class="jd-descrdiv">Compares the two specified double values.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
int</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#compareTo(java.lang.Double)">compareTo</a></span>(<a href="../../../reference/java/lang/Double.html">Double</a> object)</nobr>
<div class="jd-descrdiv">Compares this object to the specified double object to determine their
relative order.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
static
long</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#doubleToLongBits(double)">doubleToLongBits</a></span>(double value)</nobr>
<div class="jd-descrdiv">Returns an integer corresponding to the bits of the given
<a href="http://en.wikipedia.org/wiki/IEEE_754-1985">IEEE 754</a> double precision
<code>value</code>.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
static
long</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#doubleToRawLongBits(double)">doubleToRawLongBits</a></span>(double value)</nobr>
<div class="jd-descrdiv">Returns an integer corresponding to the bits of the given
<a href="http://en.wikipedia.org/wiki/IEEE_754-1985">IEEE 754</a> double precision
<code>value</code>.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
double</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#doubleValue()">doubleValue</a></span>()</nobr>
<div class="jd-descrdiv">Gets the primitive value of this double.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
boolean</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#equals(java.lang.Object)">equals</a></span>(<a href="../../../reference/java/lang/Object.html">Object</a> object)</nobr>
<div class="jd-descrdiv">Tests this double for equality with <code>object</code>.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
float</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#floatValue()">floatValue</a></span>()</nobr>
<div class="jd-descrdiv">Returns this object's value as a float.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
int</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#hashCode()">hashCode</a></span>()</nobr>
<div class="jd-descrdiv">Returns an integer hash code for this object.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
int</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#intValue()">intValue</a></span>()</nobr>
<div class="jd-descrdiv">Returns this object's value as an int.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
static
boolean</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#isInfinite(double)">isInfinite</a></span>(double d)</nobr>
<div class="jd-descrdiv">Indicates whether the specified double represents an infinite value.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
boolean</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#isInfinite()">isInfinite</a></span>()</nobr>
<div class="jd-descrdiv">Indicates whether this object represents an infinite value.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
boolean</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#isNaN()">isNaN</a></span>()</nobr>
<div class="jd-descrdiv">Indicates whether this object is a <em>Not-a-Number (NaN)</em> value.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
static
boolean</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#isNaN(double)">isNaN</a></span>(double d)</nobr>
<div class="jd-descrdiv">Indicates whether the specified double is a <em>Not-a-Number (NaN)</em>
value.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
static
double</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#longBitsToDouble(long)">longBitsToDouble</a></span>(long bits)</nobr>
<div class="jd-descrdiv">Returns the <a href="http://en.wikipedia.org/wiki/IEEE_754-1985">IEEE 754</a>
double precision float corresponding to the given <code>bits</code>.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
long</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#longValue()">longValue</a></span>()</nobr>
<div class="jd-descrdiv">Returns this object's value as a long.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
static
double</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#parseDouble(java.lang.String)">parseDouble</a></span>(<a href="../../../reference/java/lang/String.html">String</a> string)</nobr>
<div class="jd-descrdiv">Parses the specified string as a double value.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
short</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#shortValue()">shortValue</a></span>()</nobr>
<div class="jd-descrdiv">Returns this object's value as a short.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
static
<a href="../../../reference/java/lang/String.html">String</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#toHexString(double)">toHexString</a></span>(double d)</nobr>
<div class="jd-descrdiv">Converts the specified double into its hexadecimal string representation.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
static
<a href="../../../reference/java/lang/String.html">String</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#toString(double)">toString</a></span>(double d)</nobr>
<div class="jd-descrdiv">Returns a string containing a concise, human-readable description of the
specified double value.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
<a href="../../../reference/java/lang/String.html">String</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#toString()">toString</a></span>()</nobr>
<div class="jd-descrdiv">Returns a string containing a concise, human-readable description of this
object.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
static
<a href="../../../reference/java/lang/Double.html">Double</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#valueOf(java.lang.String)">valueOf</a></span>(<a href="../../../reference/java/lang/String.html">String</a> string)</nobr>
<div class="jd-descrdiv">Parses the specified string as a double value.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
static
<a href="../../../reference/java/lang/Double.html">Double</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Double.html#valueOf(double)">valueOf</a></span>(double d)</nobr>
<div class="jd-descrdiv">Returns a <code>Double</code> instance for the specified double value.</div>
</td></tr>
</table>
<!-- ========== METHOD SUMMARY =========== -->
<table id="inhmethods" class="jd-sumtable"><tr><th>
<a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
<div style="clear:left;">Inherited Methods</div></th></tr>
<tr class="api apilevel-" >
<td colspan="12">
<a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Number" class="jd-expando-trigger closed"
><img id="inherited-methods-java.lang.Number-trigger"
src="../../../assets/images/triangle-closed.png"
class="jd-expando-trigger-img" /></a>
From class
<a href="../../../reference/java/lang/Number.html">java.lang.Number</a>
<div id="inherited-methods-java.lang.Number">
<div id="inherited-methods-java.lang.Number-list"
class="jd-inheritedlinks">
</div>
<div id="inherited-methods-java.lang.Number-summary" style="display: none;">
<table class="jd-sumtable-expando">
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
byte</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Number.html#byteValue()">byteValue</a></span>()</nobr>
<div class="jd-descrdiv">Returns this object's value as a byte.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
abstract
double</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Number.html#doubleValue()">doubleValue</a></span>()</nobr>
<div class="jd-descrdiv">Returns this object's value as a double.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
abstract
float</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Number.html#floatValue()">floatValue</a></span>()</nobr>
<div class="jd-descrdiv">Returns this object's value as a float.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
abstract
int</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Number.html#intValue()">intValue</a></span>()</nobr>
<div class="jd-descrdiv">Returns this object's value as an int.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
abstract
long</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Number.html#longValue()">longValue</a></span>()</nobr>
<div class="jd-descrdiv">Returns this object's value as a long.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
short</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Number.html#shortValue()">shortValue</a></span>()</nobr>
<div class="jd-descrdiv">Returns this object's value as a short.</div>
</td></tr>
</table>
</div>
</div>
</td></tr>
<tr class="api apilevel-" >
<td colspan="12">
<a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed"
><img id="inherited-methods-java.lang.Object-trigger"
src="../../../assets/images/triangle-closed.png"
class="jd-expando-trigger-img" /></a>
From class
<a href="../../../reference/java/lang/Object.html">java.lang.Object</a>
<div id="inherited-methods-java.lang.Object">
<div id="inherited-methods-java.lang.Object-list"
class="jd-inheritedlinks">
</div>
<div id="inherited-methods-java.lang.Object-summary" style="display: none;">
<table class="jd-sumtable-expando">
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
<a href="../../../reference/java/lang/Object.html">Object</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Object.html#clone()">clone</a></span>()</nobr>
<div class="jd-descrdiv">Creates and returns a copy of this <code>Object</code>.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
boolean</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Object.html#equals(java.lang.Object)">equals</a></span>(<a href="../../../reference/java/lang/Object.html">Object</a> o)</nobr>
<div class="jd-descrdiv">Compares this instance with the specified object and indicates if they
are equal.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Object.html#finalize()">finalize</a></span>()</nobr>
<div class="jd-descrdiv">Invoked when the garbage collector has detected that this instance is no longer reachable.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
final
<a href="../../../reference/java/lang/Class.html">Class</a><?></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Object.html#getClass()">getClass</a></span>()</nobr>
<div class="jd-descrdiv">Returns the unique instance of <code><a href="../../../reference/java/lang/Class.html">Class</a></code> that represents this
object's class.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
int</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Object.html#hashCode()">hashCode</a></span>()</nobr>
<div class="jd-descrdiv">Returns an integer hash code for this object.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Object.html#notify()">notify</a></span>()</nobr>
<div class="jd-descrdiv">Causes a thread which is waiting on this object's monitor (by means of
calling one of the <code>wait()</code> methods) to be woken up.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Object.html#notifyAll()">notifyAll</a></span>()</nobr>
<div class="jd-descrdiv">Causes all threads which are waiting on this object's monitor (by means
of calling one of the <code>wait()</code> methods) to be woken up.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
<a href="../../../reference/java/lang/String.html">String</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Object.html#toString()">toString</a></span>()</nobr>
<div class="jd-descrdiv">Returns a string containing a concise, human-readable description of this
object.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Object.html#wait()">wait</a></span>()</nobr>
<div class="jd-descrdiv">Causes the calling thread to wait until another thread calls the <code>notify()</code> or <code>notifyAll()</code> method of this object.</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Object.html#wait(long, int)">wait</a></span>(long millis, int nanos)</nobr>
<div class="jd-descrdiv">Causes the calling thread to wait until another thread calls the <code>notify()</code> or <code>notifyAll()</code> method of this object or until the
specified timeout expires.</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Object.html#wait(long)">wait</a></span>(long millis)</nobr>
<div class="jd-descrdiv">Causes the calling thread to wait until another thread calls the <code>notify()</code> or <code>notifyAll()</code> method of this object or until the
specified timeout expires.</div>
</td></tr>
</table>
</div>
</div>
</td></tr>
<tr class="api apilevel-" >
<td colspan="12">
<a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Comparable" class="jd-expando-trigger closed"
><img id="inherited-methods-java.lang.Comparable-trigger"
src="../../../assets/images/triangle-closed.png"
class="jd-expando-trigger-img" /></a>
From interface
<a href="../../../reference/java/lang/Comparable.html">java.lang.Comparable</a>
<div id="inherited-methods-java.lang.Comparable">
<div id="inherited-methods-java.lang.Comparable-list"
class="jd-inheritedlinks">
</div>
<div id="inherited-methods-java.lang.Comparable-summary" style="display: none;">
<table class="jd-sumtable-expando">
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
abstract
int</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../reference/java/lang/Comparable.html#compareTo(T)">compareTo</a></span>(T another)</nobr>
<div class="jd-descrdiv">Compares this object to the specified object to determine their relative
order.</div>
</td></tr>
</table>
</div>
</div>
</td></tr>
</table>
</div><!-- jd-descr (summary) -->
<!-- Details -->
<!-- XML Attributes -->
<!-- Enum Values -->
<!-- Constants -->
<!-- ========= ENUM CONSTANTS DETAIL ======== -->
<h2>Constants</h2>
<A NAME="MAX_EXPONENT"></A>
<div class="jd-details api apilevel-9">
<h4 class="jd-details-title">
<span class="normal">
public
static
final
int
</span>
MAX_EXPONENT
</h4>
<div class="api-level">
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 9</a>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Maximum base-2 exponent that a finite value of the <code>double</code> type may have.
Equal to <code>Math.getExponent(Double.MAX_VALUE)</code>.</p></div>
<div class="jd-tagdata">
<span class="jd-tagtitle">Constant Value: </span>
<span>
1023
(0x000003ff)
</span>
</div>
</div>
</div>
<A NAME="MAX_VALUE"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
final
double
</span>
MAX_VALUE
</h4>
<div class="api-level">
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Constant for the maximum <code>double</code> value, (2 - 2<sup>-52</sup>) *
2<sup>1023</sup>.
</p></div>
<div class="jd-tagdata">
<span class="jd-tagtitle">Constant Value: </span>
<span>
1.7976931348623157E308
</span>
</div>
</div>
</div>
<A NAME="MIN_EXPONENT"></A>
<div class="jd-details api apilevel-9">
<h4 class="jd-details-title">
<span class="normal">
public
static
final
int
</span>
MIN_EXPONENT
</h4>
<div class="api-level">
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 9</a>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Minimum base-2 exponent that a normal value of the <code>double</code> type may have.
Equal to <code>Math.getExponent(Double.MIN_NORMAL)</code>.</p></div>
<div class="jd-tagdata">
<span class="jd-tagtitle">Constant Value: </span>
<span>
-1022
(0xfffffc02)
</span>
</div>
</div>
</div>
<A NAME="MIN_NORMAL"></A>
<div class="jd-details api apilevel-9">
<h4 class="jd-details-title">
<span class="normal">
public
static
final
double
</span>
MIN_NORMAL
</h4>
<div class="api-level">
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 9</a>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Constant for the smallest positive normal value of the <code>double</code> type.</p></div>
<div class="jd-tagdata">
<span class="jd-tagtitle">Constant Value: </span>
<span>
2.2250738585072014E-308
</span>
</div>
</div>
</div>
<A NAME="MIN_VALUE"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
final
double
</span>
MIN_VALUE
</h4>
<div class="api-level">
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Constant for the minimum <code>double</code> value, 2<sup>-1074</sup>.
</p></div>
<div class="jd-tagdata">
<span class="jd-tagtitle">Constant Value: </span>
<span>
4.9E-324
</span>
</div>
</div>
</div>
<A NAME="NEGATIVE_INFINITY"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
final
double
</span>
NEGATIVE_INFINITY
</h4>
<div class="api-level">
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Constant for the negative infinity value of the <code>double</code> type.
</p></div>
<div class="jd-tagdata">
<span class="jd-tagtitle">Constant Value: </span>
<span>
-Infinity
</span>
</div>
</div>
</div>
<A NAME="NaN"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
final
double
</span>
NaN
</h4>
<div class="api-level">
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Constant for the Not-a-Number (NaN) value of the <code>double</code> type.
</p></div>
<div class="jd-tagdata">
<span class="jd-tagtitle">Constant Value: </span>
<span>
NaN
</span>
</div>
</div>
</div>
<A NAME="POSITIVE_INFINITY"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
final
double
</span>
POSITIVE_INFINITY
</h4>
<div class="api-level">
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Constant for the positive infinity value of the <code>double</code> type.
</p></div>
<div class="jd-tagdata">
<span class="jd-tagtitle">Constant Value: </span>
<span>
Infinity
</span>
</div>
</div>
</div>
<A NAME="SIZE"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
final
int
</span>
SIZE
</h4>
<div class="api-level">
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Constant for the number of bits needed to represent a <code>double</code> in
two's complement form.</p></div>
<div class="jd-tagdata">
<span class="jd-tagtitle">Constant Value: </span>
<span>
64
(0x00000040)
</span>
</div>
</div>
</div>
<!-- Fields -->
<!-- ========= FIELD DETAIL ======== -->
<h2>Fields</h2>
<A NAME="TYPE"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
final
<a href="../../../reference/java/lang/Class.html">Class</a><<a href="../../../reference/java/lang/Double.html">Double</a>>
</span>
TYPE
</h4>
<div class="api-level">
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>The <code><a href="../../../reference/java/lang/Class.html">Class</a></code> object that represents the primitive type <code>double</code>.</p></div>
</div>
</div>
<!-- Public ctors -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<h2>Public Constructors</h2>
<A NAME="Double(double)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
</span>
<span class="sympad">Double</span>
<span class="normal">(double value)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Constructs a new <code>Double</code> with the specified primitive double
value.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>value</td>
<td>the primitive double value to store in the new instance.
</td>
</tr>
</table>
</div>
</div>
</div>
<A NAME="Double(java.lang.String)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
</span>
<span class="sympad">Double</span>
<span class="normal">(<a href="../../../reference/java/lang/String.html">String</a> string)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Constructs a new <code>Double</code> from the specified string.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>string</td>
<td>the string representation of a double value.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Throws</h5>
<table class="jd-tagtable">
<tr>
<th><a href="../../../reference/java/lang/NumberFormatException.html">NumberFormatException</a></td>
<td>if <code>string</code> cannot be parsed as a double value.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">See Also</h5>
<ul class="nolist"><li><code><a href="../../../reference/java/lang/Double.html#parseDouble(java.lang.String)">parseDouble(String)</a></code></li>
</ul>
</div>
</div>
</div>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- Protected ctors -->
<!-- ========= METHOD DETAIL ======== -->
<!-- Public methdos -->
<h2>Public Methods</h2>
<A NAME="byteValue()"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
byte
</span>
<span class="sympad">byteValue</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns this object's value as a byte. Might involve rounding and/or
truncating the value, so it fits into a byte.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>the primitive byte value of this object.
</li></ul>
</div>
</div>
</div>
<A NAME="compare(double, double)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
int
</span>
<span class="sympad">compare</span>
<span class="normal">(double double1, double double2)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Compares the two specified double values. There are two special cases:
<ul>
<li><code>Double.NaN</code> is equal to <code>Double.NaN</code> and it is greater
than any other double value, including <code>Double.POSITIVE_INFINITY</code>;</li>
<li>+0.0d is greater than -0.0d</li>
</ul></p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>double1</td>
<td>the first value to compare.</td>
</tr>
<tr>
<th>double2</td>
<td>the second value to compare.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>a negative value if <code>double1</code> is less than <code>double2</code>;
0 if <code>double1</code> and <code>double2</code> are equal; a positive
value if <code>double1</code> is greater than <code>double2</code>.
</li></ul>
</div>
</div>
</div>
<A NAME="compareTo(java.lang.Double)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
int
</span>
<span class="sympad">compareTo</span>
<span class="normal">(<a href="../../../reference/java/lang/Double.html">Double</a> object)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Compares this object to the specified double object to determine their
relative order. There are two special cases:
<ul>
<li><code>Double.NaN</code> is equal to <code>Double.NaN</code> and it is greater
than any other double value, including <code>Double.POSITIVE_INFINITY</code>;</li>
<li>+0.0d is greater than -0.0d</li>
</ul></p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>object</td>
<td>the double object to compare this object to.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>a negative value if the value of this double is less than the
value of <code>object</code>; 0 if the value of this double and the
value of <code>object</code> are equal; a positive value if the value
of this double is greater than the value of <code>object</code>.</li></ul>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Throws</h5>
<table class="jd-tagtable">
<tr>
<th><a href="../../../reference/java/lang/NullPointerException.html">NullPointerException</a></td>
<td>if <code>object</code> is <code>null</code>.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">See Also</h5>
<ul class="nolist"><li><code><a href="../../../reference/java/lang/Comparable.html">Comparable</a></code></li>
</ul>
</div>
</div>
</div>
<A NAME="doubleToLongBits(double)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
long
</span>
<span class="sympad">doubleToLongBits</span>
<span class="normal">(double value)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns an integer corresponding to the bits of the given
<a href="http://en.wikipedia.org/wiki/IEEE_754-1985">IEEE 754</a> double precision
<code>value</code>. All <em>Not-a-Number (NaN)</em> values are converted to a single NaN
representation (<code>0x7ff8000000000000L</code>) (compare to <code><a href="../../../reference/java/lang/Double.html#doubleToRawLongBits(double)">doubleToRawLongBits(double)</a></code>).
</p></div>
</div>
</div>
<A NAME="doubleToRawLongBits(double)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
long
</span>
<span class="sympad">doubleToRawLongBits</span>
<span class="normal">(double value)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns an integer corresponding to the bits of the given
<a href="http://en.wikipedia.org/wiki/IEEE_754-1985">IEEE 754</a> double precision
<code>value</code>. <em>Not-a-Number (NaN)</em> values are preserved (compare
to <code><a href="../../../reference/java/lang/Double.html#doubleToLongBits(double)">doubleToLongBits(double)</a></code>).
</p></div>
</div>
</div>
<A NAME="doubleValue()"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
double
</span>
<span class="sympad">doubleValue</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets the primitive value of this double.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>this object's primitive value.
</li></ul>
</div>
</div>
</div>
<A NAME="equals(java.lang.Object)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
boolean
</span>
<span class="sympad">equals</span>
<span class="normal">(<a href="../../../reference/java/lang/Object.html">Object</a> object)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Tests this double for equality with <code>object</code>.
To be equal, <code>object</code> must be an instance of <code>Double</code> and
<code>doubleToLongBits</code> must give the same value for both objects.
<p>Note that, unlike <code>==</code>, <code>-0.0</code> and <code>+0.0</code> compare
unequal, and <code>NaN</code>s compare equal by this method.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>object</td>
<td>the object to compare this double with.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li><code>true</code> if the specified object is equal to this
<code>Double</code>; <code>false</code> otherwise.
</li></ul>
</div>
</div>
</div>
<A NAME="floatValue()"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
float
</span>
<span class="sympad">floatValue</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns this object's value as a float. Might involve rounding.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>the primitive float value of this object.
</li></ul>
</div>
</div>
</div>
<A NAME="hashCode()"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
int
</span>
<span class="sympad">hashCode</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns an integer hash code for this object. By contract, any two
objects for which <code><a href="../../../reference/java/lang/Object.html#equals(java.lang.Object)">equals(Object)</a></code> returns <code>true</code> must return
the same hash code value. This means that subclasses of <code>Object</code>
usually override both methods or neither method.
<p>Note that hash values must not change over time unless information used in equals
comparisons also changes.
<p>See <a href="../../../reference/java/lang/Object.html#writing_hashCode">Writing a correct
<code>hashCode</code> method</a>
if you intend implementing your own <code>hashCode</code> method.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>this object's hash code.</li></ul>
</div>
</div>
</div>
<A NAME="intValue()"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
int
</span>
<span class="sympad">intValue</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns this object's value as an int. Might involve rounding and/or
truncating the value, so it fits into an int.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>the primitive int value of this object.
</li></ul>
</div>
</div>
</div>
<A NAME="isInfinite(double)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
boolean
</span>
<span class="sympad">isInfinite</span>
<span class="normal">(double d)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Indicates whether the specified double represents an infinite value.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>d</td>
<td>the double to check.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li><code>true</code> if the value of <code>d</code> is positive or negative
infinity; <code>false</code> otherwise.
</li></ul>
</div>
</div>
</div>
<A NAME="isInfinite()"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
boolean
</span>
<span class="sympad">isInfinite</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Indicates whether this object represents an infinite value.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li><code>true</code> if the value of this double is positive or negative
infinity; <code>false</code> otherwise.
</li></ul>
</div>
</div>
</div>
<A NAME="isNaN()"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
boolean
</span>
<span class="sympad">isNaN</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Indicates whether this object is a <em>Not-a-Number (NaN)</em> value.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li><code>true</code> if this double is <em>Not-a-Number</em>;
<code>false</code> if it is a (potentially infinite) double number.
</li></ul>
</div>
</div>
</div>
<A NAME="isNaN(double)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
boolean
</span>
<span class="sympad">isNaN</span>
<span class="normal">(double d)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Indicates whether the specified double is a <em>Not-a-Number (NaN)</em>
value.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>d</td>
<td>the double value to check.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li><code>true</code> if <code>d</code> is <em>Not-a-Number</em>;
<code>false</code> if it is a (potentially infinite) double number.
</li></ul>
</div>
</div>
</div>
<A NAME="longBitsToDouble(long)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
double
</span>
<span class="sympad">longBitsToDouble</span>
<span class="normal">(long bits)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns the <a href="http://en.wikipedia.org/wiki/IEEE_754-1985">IEEE 754</a>
double precision float corresponding to the given <code>bits</code>.
</p></div>
</div>
</div>
<A NAME="longValue()"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
long
</span>
<span class="sympad">longValue</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns this object's value as a long. Might involve rounding and/or
truncating the value, so it fits into a long.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>the primitive long value of this object.
</li></ul>
</div>
</div>
</div>
<A NAME="parseDouble(java.lang.String)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
double
</span>
<span class="sympad">parseDouble</span>
<span class="normal">(<a href="../../../reference/java/lang/String.html">String</a> string)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Parses the specified string as a double value.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>string</td>
<td>the string representation of a double value.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>the primitive double value represented by <code>string</code>.</li></ul>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Throws</h5>
<table class="jd-tagtable">
<tr>
<th><a href="../../../reference/java/lang/NumberFormatException.html">NumberFormatException</a></td>
<td>if <code>string</code> cannot be parsed as a double value.
</td>
</tr>
</table>
</div>
</div>
</div>
<A NAME="shortValue()"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
short
</span>
<span class="sympad">shortValue</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns this object's value as a short. Might involve rounding and/or
truncating the value, so it fits into a short.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>the primitive short value of this object.
</li></ul>
</div>
</div>
</div>
<A NAME="toHexString(double)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../reference/java/lang/String.html">String</a>
</span>
<span class="sympad">toHexString</span>
<span class="normal">(double d)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Converts the specified double into its hexadecimal string representation.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>d</td>
<td>the double to convert.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>the hexadecimal string representation of <code>d</code>.</li></ul>
</div>
</div>
</div>
<A NAME="toString(double)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../reference/java/lang/String.html">String</a>
</span>
<span class="sympad">toString</span>
<span class="normal">(double d)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns a string containing a concise, human-readable description of the
specified double value.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>d</td>
<td>the double to convert to a string.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>a printable representation of <code>d</code>.
</li></ul>
</div>
</div>
</div>
<A NAME="toString()"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
<a href="../../../reference/java/lang/String.html">String</a>
</span>
<span class="sympad">toString</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns a string containing a concise, human-readable description of this
object. Subclasses are encouraged to override this method and provide an
implementation that takes into account the object's type and data. The
default implementation is equivalent to the following expression:
<pre>
getClass().getName() + '@' + Integer.toHexString(hashCode())</pre>
<p>See <a href="../../../reference/java/lang/Object.html#writing_toString">Writing a useful
<code>toString</code> method</a>
if you intend implementing your own <code>toString</code> method.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>a printable representation of this object.
</li></ul>
</div>
</div>
</div>
<A NAME="valueOf(java.lang.String)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../reference/java/lang/Double.html">Double</a>
</span>
<span class="sympad">valueOf</span>
<span class="normal">(<a href="../../../reference/java/lang/String.html">String</a> string)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Parses the specified string as a double value.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>string</td>
<td>the string representation of a double value.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>a <code>Double</code> instance containing the double value represented
by <code>string</code>.</li></ul>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Throws</h5>
<table class="jd-tagtable">
<tr>
<th><a href="../../../reference/java/lang/NumberFormatException.html">NumberFormatException</a></td>
<td>if <code>string</code> cannot be parsed as a double value.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">See Also</h5>
<ul class="nolist"><li><code><a href="../../../reference/java/lang/Double.html#parseDouble(java.lang.String)">parseDouble(String)</a></code></li>
</ul>
</div>
</div>
</div>
<A NAME="valueOf(double)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../reference/java/lang/Double.html">Double</a>
</span>
<span class="sympad">valueOf</span>
<span class="normal">(double d)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns a <code>Double</code> instance for the specified double value.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>d</td>
<td>the double value to store in the instance.</td>
</tr>
</table>
</div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>a <code>Double</code> instance containing <code>d</code>.</li></ul>
</div>
</div>
</div>
<!-- ========= METHOD DETAIL ======== -->
<!-- ========= END OF CLASS DATA ========= -->
<A NAME="navbar_top"></A>
<div id="footer" class="wrap" >
<div id="copyright">
Except as noted, this content is licensed under <a
href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>.
For details and restrictions, see the <a href="../../../license.html">
Content License</a>.
</div>
<div id="build_info">
Android 4.4 r1 —
<script src="../../../timestamp.js" type="text/javascript"></script>
<script>document.write(BUILD_TIMESTAMP)</script>
</div>
<div id="footerlinks">
<p>
<a href="../../../about/index.html">About Android</a> |
<a href="../../../legal.html">Legal</a> |
<a href="../../../support.html">Support</a>
</p>
</div>
</div> <!-- end footer -->
</div> <!-- jd-content -->
</div><!-- end doc-content -->
</div> <!-- end body-content -->
</body>
</html>
|
terrytowne/android-developer-cn
|
reference/java/lang/Double.html
|
HTML
|
mit
| 124,589
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js webvr - video</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<!-- Origin Trial Token, feature = WebVR, origin = https://threejs.org, expires = 2017-06-13 -->
<meta http-equiv="origin-trial" data-feature="WebVR" data-expires="2017-06-13" content="ApAQvHfiHMQB7SmRhfvCUX61adJaTA6pAu0Ry439jjeipa5lGm1RcTQynFoHGGcaSJkWfMOv7qK6pwSUb95ClQgAAABKeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJWUiIsImV4cGlyeSI6MTQ5NzMxMjAwMH0=">
<style>
body {
font-family: Monospace;
background-color: #f0f0f0;
margin: 0px;
overflow: hidden;
}
#info {
position: absolute;
top: 10px;
width: 100%;
color: #fff;
text-align: center;
}
a {
color: #ff0
}
</style>
</head>
<body>
<div id="container"></div>
<div id="info">
<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> webgl - vr video<br />
stereoscopic panoramic render by <a href="http://pedrofe.com/rendering-for-oculus-rift-with-arnold/" target="_blank" rel="noopener">pedrofe</a>. scene from <a href="http://www.meryproject.com/" target="_blank" rel="noopener">mery project</a>.
</div>
<script src="../build/three.js"></script>
<script src="js/controls/VRControls.js"></script>
<script src="js/effects/VREffect.js"></script>
<script src="js/vr/WebVR.js"></script>
<script>
WEBVR.checkAvailability().catch( function( message ) {
document.body.appendChild( WEBVR.getMessageContainer( message ) );
} );
//
var camera, scene, renderer;
var video, texture;
var controls, effect;
init();
animate();
function init() {
var container = document.getElementById( 'container' );
container.addEventListener( 'click', function () {
video.play();
} );
camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 2000 );
camera.layers.enable( 1 ); // render left view when no stereo available
// video
video = document.createElement( 'video' );
video.loop = true;
video.muted = true;
video.src = 'textures/MaryOculus.webm';
video.setAttribute( 'webkit-playsinline', 'webkit-playsinline' );
video.play();
texture = new THREE.VideoTexture( video );
texture.minFilter = THREE.NearestFilter;
texture.maxFilter = THREE.NearestFilter;
texture.format = THREE.RGBFormat;
texture.generateMipmaps = false;
scene = new THREE.Scene();
// left
var geometry = new THREE.SphereGeometry( 500, 60, 40 );
geometry.scale( - 1, 1, 1 );
var uvs = geometry.faceVertexUvs[ 0 ];
for ( var i = 0; i < uvs.length; i ++ ) {
for ( var j = 0; j < 3; j ++ ) {
uvs[ i ][ j ].x *= 0.5;
}
}
var material = new THREE.MeshBasicMaterial( { map: texture } );
var mesh = new THREE.Mesh( geometry, material );
mesh.rotation.y = - Math.PI / 2;
mesh.layers.set( 1 ); // display in left eye only
scene.add( mesh );
// right
var geometry = new THREE.SphereGeometry( 500, 60, 40 );
geometry.scale( - 1, 1, 1 );
var uvs = geometry.faceVertexUvs[ 0 ];
for ( var i = 0; i < uvs.length; i ++ ) {
for ( var j = 0; j < 3; j ++ ) {
uvs[ i ][ j ].x *= 0.5;
uvs[ i ][ j ].x += 0.5;
}
}
var material = new THREE.MeshBasicMaterial( { map: texture } );
var mesh = new THREE.Mesh( geometry, material );
mesh.rotation.y = - Math.PI / 2;
mesh.layers.set( 2 ); // display in right eye only
scene.add( mesh );
//
renderer = new THREE.WebGLRenderer();
renderer.setClearColor( 0x101010 );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );
//
controls = new THREE.VRControls( camera );
effect = new THREE.VREffect( renderer );
effect.scale = 0; // video doesn't need eye separation
effect.setSize( window.innerWidth, window.innerHeight );
WEBVR.getVRDisplay( function ( display ) {
document.body.appendChild( WEBVR.getButton( display, renderer.domElement ) );
} );
//
window.addEventListener( 'resize', onWindowResize, false );
}
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
effect.setSize( window.innerWidth, window.innerHeight );
}
function animate() {
effect.requestAnimationFrame( animate );
render();
}
function render() {
controls.update();
effect.render( scene, camera );
}
</script>
</body>
</html>
|
jostschmithals/three.js
|
examples/webvr_video.html
|
HTML
|
mit
| 4,742
|
---
title: Laravel Forge, Digital Ocean and WebSockets
layout: post
categories: []
tags: []
published: True
image:
featured: 'photo-1436985487860-712a3b558087.jpeg'
---
I recently posted an overview of how to setup Web Sockets using [Laravel and Socket.io](/2016/01/30/laravel-and-websockets/). I wanted to follow it up with a quick post on how to get the Web Sockets functioning correctly on a [Digital Ocean](https://www.digitalocean.com/) server using [Laravel Forge](https://forge.laravel.com/). I a going to assume that you have already gone through the setup process to provision a new server. Also that you have read the first post since the largest amount of work will lie there. I believe these steps should be identically for all hosting providers not Just Digital Ocean but do not quote me on that.
First of all we need to setup some daemons for Redis and Socket.io which forge makes extremely simple. This will allow Redis and Socket.io to run continuously without you having to worry about it, First you need to navigate to Servers > Your Server and then the "Daemons" tab. You will need to add `redis-server --port 3001` in the "Command" text field and click the "Start Daemon" button this will enable Redis. You will also need to add `node /home/forge/mysite.com/socket.js`, make sure to update `mysite.com` with the domain of you site, in the "Command" text field and click the "Start Daemon" button this will enable Socket.io.
You can check on your daemons at any time by clicking on the eye icon in the "Status" column. You will want to make sure that both Redis and Socket.io are running. If you have any issues it is best to SSH onto your server and try running the commands manually to see make sure they are successful. HJst make sure to delete the daemon before you SSH onto your server.
Next we will want to move onto the "Network" tab were we can open port 3000 in the servers firewall so we can access Socket.io. You can set the "Name" to SocketIO, the "Port" to 3000 and I suggest adding the IP Address of your server but thats up to you. Then you just click the "Add Rule" button and you should be good to go. You can test the connection by navigating to http://mysite.com:3000 you should see the message "Cannot GET /". If you see that everything should be working just fine.
|
DHolloran/dholloran.github.io
|
_posts/2016-03-05-laravel-forge-digital-ocean-and-websockets.md
|
Markdown
|
mit
| 2,310
|
require 'nn'
require 'string'
require 'hdf5'
require 'nngraph'
require 'models.lua'
require 'data.lua'
require 'util.lua'
stringx = require('pl.stringx')
cmd = torch.CmdLine()
-- file location
cmd:option('-model', 'seq2seq_lstm_attn.t7.', [[Path to model .t7 file]])
cmd:option('-src_file', '', [[Source sequence to decode (one line per sequence)]])
cmd:option('-targ_file', '', [[True target sequence]])
cmd:option('-output_file', 'pred.txt', [[Path to output the predictions (each line will be the
decoded sequence]])
cmd:option('-src_dict', 'data/demo.src.dict', [[Path to source vocabulary (*.src.dict file)]])
cmd:option('-targ_dict', 'data/demo.targ.dict', [[Path to target vocabulary (*.targ.dict file)]])
cmd:option('-char_dict', 'data/demo.char.dict', [[If using chars, path to character
vocabulary (*.char.dict file)]])
-- beam search options
cmd:option('-max_sent_l', 250, [[Maximum sentence length. If any sequences in srcfile are longer
than this then it will error out]])
cmd:option('-replace_unk', 0, [[Replace the generated UNK tokens with the source token that
had the highest attention weight. If srctarg_dict is provided,
it will lookup the identified source token and give the corresponding
target token. If it is not provided (or the identified source token
does not exist in the table) then it will copy the source token]])
cmd:option('-srctarg_dict', 'data/en-de.dict', [[Path to source-target dictionary to replace UNK
tokens. See README.md for the format this file should be in]])
cmd:option('-gpuid', -1, [[ID of the GPU to use (-1 = use CPU)]])
cmd:option('-gpuid2', -1, [[Second GPU ID]])
cmd:option('-cudnn', 0, [[If using character model, this should be = 1 if the character model
was trained using cudnn]])
opt = cmd:parse(arg)
function copy(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[orig_key] = orig_value
end
else
copy = orig
end
return copy
end
-- Convert a flat index to a row-column tuple.
function flat_to_rc(v, flat_index)
local row = math.floor((flat_index - 1) / v:size(2)) + 1
return row, (flat_index - 1) % v:size(2) + 1
end
function generate_beam(model, initial, max_sent_l, source, gold)
--reset decoder initial states
if opt.gpuid >= 0 and opt.gpuid2 >= 0 then
cutorch.setDevice(opt.gpuid)
end
local n = max_sent_l
local source_l = math.min(source:size(1), opt.max_sent_l)
local source_input
if model_opt.use_chars_enc == 1 then
source_input = source:view(source_l, 1, source:size(2)):contiguous()
else
source_input = source:view(source_l, 1)
end
local rnn_state_enc = {}
for i = 1, #init_fwd_enc do
table.insert(rnn_state_enc, init_fwd_enc[i]:zero())
end
local context = context_proto[{ {}, { 1, source_l } }]:clone() -- 1 x source_l x rnn_size
print("ENCODER POS", saved_encoder_position)
local position_tensor = torch.LongTensor({ saved_encoder_position })
--initial write and then append
if saved_encoder_position == 0 then
encoderfile:write('offsets', position_tensor, offset_options)
else
encoderfile:append('offsets', position_tensor, offset_options)
end
for t = 1, source_l do
local encoder_input = { source_input[t], table.unpack(rnn_state_enc) }
local out = model[1]:forward(encoder_input)
rnn_state_enc = out
if saved_encoder_position == 0 then
print("TEST")
for k = 1, 2 * model_opt.num_layers do
encoderfile:write("states" .. k, out[k], state_options)
end
else
for k = 1, 2 * model_opt.num_layers do
encoderfile:append("states" .. k, out[k], state_options)
end
end
saved_encoder_position = saved_encoder_position + 1
context[{ {}, t }]:copy(out[#out])
end
rnn_state_dec = {}
for i = 1, #init_fwd_dec do
table.insert(rnn_state_dec, init_fwd_dec[i]:zero())
end
if model_opt.init_dec == 1 then
for L = 1, model_opt.num_layers do
rnn_state_dec[L * 2 - 1 + model_opt.input_feed]:copy(rnn_state_enc[L * 2 - 1])
rnn_state_dec[L * 2 + model_opt.input_feed]:copy(rnn_state_enc[L * 2])
end
end
if model_opt.brnn == 1 then
for i = 1, #rnn_state_enc do
rnn_state_enc[i]:zero()
end
for t = source_l, 1, -1 do
local encoder_input = { source_input[t], table.unpack(rnn_state_enc) }
local out = model[4]:forward(encoder_input)
rnn_state_enc = out
context[{ {}, t }]:add(out[#out])
end
if model_opt.init_dec == 1 then
for L = 1, model_opt.num_layers do
rnn_state_dec[L * 2 - 1 + model_opt.input_feed]:add(rnn_state_enc[L * 2 - 1])
rnn_state_dec[L * 2 + model_opt.input_feed]:add(rnn_state_enc[L * 2])
end
end
end
rnn_state_dec_gold = {}
for i = 1, #rnn_state_dec do
table.insert(rnn_state_dec_gold, rnn_state_dec[i][{ { 1 } }]:clone())
end
if opt.gpuid >= 0 and opt.gpuid2 >= 0 then
cutorch.setDevice(opt.gpuid2)
context2:copy(context)
context = context2
end
local gold_score = 0
print("DECODER POS", saved_decoder_position)
--SEB
local position_tensor = torch.LongTensor({ saved_decoder_position })
--initial write and then append
if saved_decoder_position == 0 then
decoderfile:write('offsets', position_tensor, offset_options)
else
decoderfile:append('offsets', position_tensor, offset_options)
end
rnn_state_dec = {}
for i = 1, #init_fwd_dec do
table.insert(rnn_state_dec, init_fwd_dec[i][{ { 1 } }]:zero())
end
if model_opt.init_dec == 1 then
rnn_state_dec = rnn_state_dec_gold
end
local target_l = gold:size(1)
for t = 2, target_l do
local decoder_input1
if model_opt.use_chars_dec == 1 then
decoder_input1 = word2charidx_targ:index(1, gold[{ { t - 1 } }])
else
decoder_input1 = gold[{ { t - 1 } }]
end
local decoder_input
if model_opt.attn == 1 then
decoder_input = { decoder_input1, context[{ { 1 } }], table.unpack(rnn_state_dec) }
else
decoder_input = { decoder_input1, context[{ { 1 }, source_l }], table.unpack(rnn_state_dec) }
end
local out_decoder = model[2]:forward(decoder_input)
local out = model[3]:forward(out_decoder[#out_decoder]) -- K x vocab_size
rnn_state_dec = {} -- to be modified later
if model_opt.input_feed == 1 then
table.insert(rnn_state_dec, out_decoder[#out_decoder])
end
for j = 1, #out_decoder - 1 do
table.insert(rnn_state_dec, out_decoder[j])
end
--save the decoder states and the attention
if saved_decoder_position == 0 then
if model_opt.attn == 1 then
decoderfile:write("attention", decoder_softmax.output, state_options)
end
for k = 1, 2 * model_opt.num_layers do
decoderfile:write("states" .. k, out_decoder[k], state_options)
end
else
if model_opt.attn == 1 then
decoderfile:append("attention", decoder_softmax.output, state_options)
end
for k = 1, 2 * model_opt.num_layers do
decoderfile:append("states" .. k, out_decoder[k], state_options)
end
end
saved_decoder_position = saved_decoder_position + 1
gold_score = gold_score + out[1][gold[t]]
end
return max_score, gold_score
end
function idx2key(file)
local f = io.open(file, 'r')
local t = {}
for line in f:lines() do
local c = {}
for w in line:gmatch '([^%s]+)' do
table.insert(c, w)
end
t[tonumber(c[2])] = c[1]
end
return t
end
function flip_table(u)
local t = {}
for key, value in pairs(u) do
t[value] = key
end
return t
end
function get_layer(layer)
if layer.name ~= nil then
if layer.name == 'decoder_attn' then
decoder_attn = layer
elseif layer.name:sub(1, 3) == 'hop' then
hop_attn = layer
elseif layer.name:sub(1, 7) == 'softmax' then
table.insert(softmax_layers, layer)
elseif layer.name == 'word_vecs_enc' then
word_vecs_enc = layer
elseif layer.name == 'word_vecs_dec' then
word_vecs_dec = layer
end
end
end
function sent2wordidx(sent, word2idx, start_symbol)
local t = {}
local u = {}
if start_symbol == 1 then
table.insert(t, START)
table.insert(u, START_WORD)
end
for word in sent:gmatch '([^%s]+)' do
local idx = word2idx[word] or UNK
table.insert(t, idx)
table.insert(u, word)
end
if start_symbol == 1 then
table.insert(t, END)
table.insert(u, END_WORD)
end
return torch.LongTensor(t), u
end
function sent2charidx(sent, char2idx, max_word_l, start_symbol)
local words = {}
if start_symbol == 1 then
table.insert(words, START_WORD)
end
for word in sent:gmatch '([^%s]+)' do
table.insert(words, word)
end
if start_symbol == 1 then
table.insert(words, END_WORD)
end
local chars = torch.ones(#words, max_word_l)
for i = 1, #words do
chars[i] = word2charidx(words[i], char2idx, max_word_l, chars[i])
end
return chars, words
end
function word2charidx(word, char2idx, max_word_l, t)
t[1] = START
local i = 2
for _, char in utf8.next, word do
char = utf8.char(char)
local char_idx = char2idx[char] or UNK
t[i] = char_idx
i = i + 1
if i >= max_word_l then
t[i] = END
break
end
end
if i < max_word_l then
t[i] = END
end
return t
end
function wordidx2sent(sent, idx2word, source_str, attn, skip_end)
local t = {}
local start_i, end_i
skip_end = skip_start_end or true
if skip_end then
end_i = #sent - 1
else
end_i = #sent
end
for i = 2, end_i do -- skip START and END
if sent[i] == UNK then
if opt.replace_unk == 1 then
local s = source_str[attn[i]]
if phrase_table[s] ~= nil then
print(s .. ':' .. phrase_table[s])
end
local r = phrase_table[s] or s
table.insert(t, r)
else
table.insert(t, idx2word[sent[i]])
end
else
table.insert(t, idx2word[sent[i]])
end
end
return table.concat(t, ' ')
end
function clean_sent(sent)
local s = stringx.replace(sent, UNK_WORD, '')
s = stringx.replace(s, START_WORD, '')
s = stringx.replace(s, END_WORD, '')
s = stringx.replace(s, START_CHAR, '')
s = stringx.replace(s, END_CHAR, '')
return s
end
function strip(s)
return s:gsub("^%s+", ""):gsub("%s+$", "")
end
function main()
-- some globals
PAD = 1; UNK = 2; START = 3; END = 4
PAD_WORD = '<blank>'; UNK_WORD = '<unk>'; START_WORD = '<s>'; END_WORD = '</s>'
START_CHAR = '{'; END_CHAR = '}'
MAX_SENT_L = opt.max_sent_l
assert(path.exists(opt.src_file), 'src_file does not exist')
assert(path.exists(opt.model), 'model does not exist')
-- parse input params
opt = cmd:parse(arg)
if opt.gpuid >= 0 then
require 'cutorch'
require 'cunn'
if opt.cudnn == 1 then
require 'cudnn'
end
end
print('loading ' .. opt.model .. '...')
checkpoint = torch.load(opt.model)
print('done!')
if opt.replace_unk == 1 then
phrase_table = {}
if path.exists(opt.srctarg_dict) then
local f = io.open(opt.srctarg_dict, 'r')
for line in f:lines() do
local c = line:split("|||")
phrase_table[strip(c[1])] = c[2]
end
end
end
-- load model and word2idx/idx2word dictionaries
model, model_opt = checkpoint[1], checkpoint[2]
for i = 1, #model do
model[i]:evaluate()
end
-- for backward compatibility
model_opt.brnn = model_opt.brnn or 0
model_opt.input_feed = model_opt.input_feed or 1
model_opt.attn = model_opt.attn or 1
idx2word_src = idx2key(opt.src_dict)
word2idx_src = flip_table(idx2word_src)
idx2word_targ = idx2key(opt.targ_dict)
word2idx_targ = flip_table(idx2word_targ)
-- load character dictionaries if needed
if model_opt.use_chars_enc == 1 or model_opt.use_chars_dec == 1 then
utf8 = require 'lua-utf8'
char2idx = flip_table(idx2key(opt.char_dict))
model[1]:apply(get_layer)
end
if model_opt.use_chars_dec == 1 then
word2charidx_targ = torch.LongTensor(#idx2word_targ, model_opt.max_word_l):fill(PAD)
for i = 1, #idx2word_targ do
word2charidx_targ[i] = word2charidx(idx2word_targ[i], char2idx,
model_opt.max_word_l, word2charidx_targ[i])
end
end
-- load gold labels if it exists
if path.exists(opt.targ_file) then
print('loading GOLD labels at ' .. opt.targ_file)
gold = {}
local file = io.open(opt.targ_file, 'r')
for line in file:lines() do
table.insert(gold, line)
end
else
print('GOLD label file not found')
os.exit()
end
if opt.gpuid >= 0 then
cutorch.setDevice(opt.gpuid)
for i = 1, #model do
if opt.gpuid2 >= 0 then
if i == 1 or i == 4 then
cutorch.setDevice(opt.gpuid)
else
cutorch.setDevice(opt.gpuid2)
end
end
model[i]:double():cuda()
model[i]:evaluate()
end
end
--options for saving
offset_options = hdf5.DataSetOptions()
offset_options:setChunked(1)
state_options = hdf5.DataSetOptions()
state_options:setChunked(1, 1)
--ensure that file exists and open it in append mode
encoderfile = hdf5.open("encoder.hdf5", "w")
encoderfile:close()
encoderfile = hdf5.open("encoder.hdf5", "r+")
decoderfile = hdf5.open("decoder.hdf5", "w")
decoderfile:close()
decoderfile = hdf5.open("decoder.hdf5", "r+")
saved_encoder_position = 0
saved_decoder_position = 0
softmax_layers = {}
model[2]:apply(get_layer)
if model_opt.attn == 1 then
decoder_attn:apply(get_layer)
decoder_softmax = softmax_layers[1]
end
context_proto = torch.zeros(1, MAX_SENT_L, model_opt.rnn_size)
local h_init_dec = torch.zeros(1, model_opt.rnn_size)
local h_init_enc = torch.zeros(1, model_opt.rnn_size)
if opt.gpuid >= 0 then
h_init_enc = h_init_enc:cuda()
-- h_init_dec = h_init_dec:cuda()
cutorch.setDevice(opt.gpuid)
if opt.gpuid2 >= 0 then
cutorch.setDevice(opt.gpuid)
context_proto = context_proto:cuda()
cutorch.setDevice(opt.gpuid2)
else
context_proto = context_proto:cuda()
end
end
init_fwd_enc = {}
init_fwd_dec = {} -- initial context
if model_opt.input_feed == 1 then
table.insert(init_fwd_dec, h_init_dec:clone())
end
for L = 1, model_opt.num_layers do
table.insert(init_fwd_enc, h_init_enc:clone())
table.insert(init_fwd_enc, h_init_enc:clone())
table.insert(init_fwd_dec, h_init_dec:clone()) -- memory cell
table.insert(init_fwd_dec, h_init_dec:clone()) -- hidden state
end
gold_score_total = 0
gold_words_total = 0
local sent_id = 0
local file = io.open(opt.src_file, "r")
for line in file:lines() do
sent_id = sent_id + 1
line = clean_sent(line)
print('SENT ' .. sent_id .. ': ' .. line)
local source, source_str
if model_opt.use_chars_enc == 0 then
source, source_str = sent2wordidx(line, word2idx_src, model_opt.start_symbol)
else
source, source_str = sent2charidx(line, char2idx, model_opt.max_word_l, model_opt.start_symbol)
end
target, target_str = sent2wordidx(gold[sent_id], word2idx_targ, 1)
print("Sentence", sent_id, source:size(1))
pred_score, gold_score = generate_beam(model, state, MAX_SENT_L, source, target)
if gold ~= nil then
print('GOLD ' .. sent_id .. ': ' .. gold[sent_id])
print(string.format("GOLD SCORE: %.4f", gold_score))
gold_score_total = gold_score_total + gold_score
gold_words_total = gold_words_total + target:size(1) - 1
end
end
print(string.format("GOLD AVG SCORE: %.4f, GOLD PPL: %.4f",
gold_score_total / gold_words_total,
math.exp(-gold_score_total / gold_words_total)))
end
main()
|
harvardnlp/seq2seq-attn
|
s2sa/extract_states.lua
|
Lua
|
mit
| 17,412
|
---
title: Thumbnail
description: Spruce up an image tag with our thumbnail style.
published: false
---
The `.thumbnail` class can be applied directly to an `<img>` element, or an `<a>` that wraps it. Make sure the `<img>` has an alt attribute that describes the contents of the image.
The thumbnail style adds padding and a box shadow to an image. To use it, just add the class `.thumbnail` to an image element.
```inky_example
<img src="http://placehold.it/200x200" class="thumbnail">
```
<!-- <table class="thumbnail">
<tr>
<td><img src="//placehold.it/300x300" class="thumbnail" /></td>
</tr>
</table> -->
|
jsit/foundation-emails
|
docs/pages/thumbnail.md
|
Markdown
|
mit
| 622
|
'use strict'
/*global describe, it, before, after, beforeEach */
var should = require('should')
var thunk = require('thunks')()
var JSONKit = require('jsonkit')
var redis = require('../index')
module.exports = function () {
describe('commands:Set', function () {
var client
before(function () {
client = redis.createClient({
database: 0
})
client.on('error', function (error) {
console.error('redis client:', error)
})
})
beforeEach(function (done) {
client.flushdb()(function (error, res) {
should(error).be.equal(null)
should(res).be.equal('OK')
})(done)
})
after(function () {
client.clientEnd()
})
it('client.sadd, client.scard', function (done) {
client.scard('setA')(function (error, res) {
should(error).be.equal(null)
should(res).be.equal(0)
return thunk.all(this.set('key', 'abc'), this.scard('key'))
})(function (error, res) {
should(error).be.instanceOf(Error)
return this.sadd('key', 'a')
})(function (error, res) {
should(error).be.instanceOf(Error)
return thunk.all(this.sadd('setA', 'a', 'b'), this.sadd('setA', 'b', 'c'), this.sadd('setA', 'a', 'c'), this.scard('setA'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([2, 1, 0, 3])
})(done)
})
it('client.sdiff, client.sdiffstore', function (done) {
client.sdiff('setA')(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([])
return thunk.all(this.sadd('setA', 'a', 'b', 'c'), this.sadd('setB', 'b', 'c', 'd'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([3, 3])
return thunk.all(client.sdiff('setA'), client.sdiff('setA', 'setB'), client.sdiff('setA', 'setC'))
})(function (error, res) {
should(error).be.equal(null)
should(res[0].length).be.equal(3)
should(res[0]).be.containEql('a')
should(res[0]).be.containEql('b')
should(res[0]).be.containEql('c')
should(res[1].length).be.equal(1)
should(res[1]).be.containEql('a')
should(res[2].length).be.equal(3)
should(res[2]).be.containEql('a')
should(res[2]).be.containEql('b')
should(res[2]).be.containEql('c')
return thunk.all(client.sdiffstore('setC', 'setA', 'setB'), client.sdiffstore('setA', 'setA', 'setB'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([1, 1])
return thunk.all(this.scard('setA'), this.scard('setC'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([1, 1])
})(done)
})
it('client.sinter, client.sinterstore', function (done) {
client.sinter('setA')(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([])
return thunk.all(this.sadd('setA', 'a', 'b', 'c'), this.sadd('setB', 'b', 'c', 'd'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([3, 3])
return thunk.all(client.sinter('setA'), client.sinter('setA', 'setB'), client.sinter('setA', 'setC'))
})(function (error, res) {
should(error).be.equal(null)
should(res[0].length).be.equal(3)
should(res[0]).be.containEql('a')
should(res[0]).be.containEql('b')
should(res[0]).be.containEql('c')
should(res[1].length).be.equal(2)
should(res[1]).be.containEql('b')
should(res[1]).be.containEql('c')
should(res[2].length).be.equal(0)
return thunk.all(client.sinterstore('setC', 'setA', 'setB'), client.sinterstore('setA', 'setA', 'setB'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([2, 2])
return thunk.all(this.scard('setA'), this.scard('setC'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([2, 2])
})(done)
})
it('client.sismember, client.smembers', function (done) {
client.smembers('setA')(function (error, res) {
should(error).be.equal(null)
should(res).be.equal([])
return thunk.all(this.set('key', 'abc'), this.smembers('key'))
})(function (error, res) {
should(error).be.instanceOf(Error)
return thunk.all(this.sadd('setA', 'a', 'b', 'c'), this.smembers('setA'))
})(function (error, res) {
should(error).be.equal(null)
should(res[0]).be.equal(3)
should(res[1].length).be.equal(3)
should(res[1]).be.containEql('a')
should(res[1]).be.containEql('b')
should(res[1]).be.containEql('c')
return thunk.all(this.sismember('setA', 'a'), this.sismember('setA', 'd'), this.sismember('setB', 'd'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([1, 0, 0])
})(done)
})
it('client.smove, client.spop', function (done) {
client.smove('setA', 'setB', 'a')(function (error, res) {
should(error).be.equal(null)
should(res).be.equal(0)
return thunk.all(this.sadd('setA', 'a', 'b', 'c'), this.smove('setA', 'setB', 'a'), this.smove('setA', 'setB', 'd'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([3, 1, 0])
return thunk.all(this.sadd('setB', 'b'), this.smove('setA', 'setB', 'b'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([1, 1])
return thunk.all(this.spop('setA'), this.spop('setC'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql(['c', null])
})(done)
})
it('client.srandmember, client.srem', function (done) {
client.srandmember('setA')(function (error, res) {
should(error).be.equal(null)
should(res).be.equal(null)
return thunk.all(this.sadd('setA', 'a', 'b', 'c'), this.srandmember('setA'), this.srandmember('setA', 2))
})(function (error, res) {
should(error).be.equal(null)
should(res[0]).be.eql(3)
should(['a', 'b', 'c']).be.containEql(res[1])
should(res[2].length).be.equal(2)
should(['a', 'b', 'c']).be.containEql(res[2][0])
should(['a', 'b', 'c']).be.containEql(res[2][1])
return thunk.all(this.scard('setA'), this.srem('setA', 'b', 'd'), this.srem('setA', 'b', 'a', 'c'), this.scard('setA'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([3, 1, 2, 0])
})(done)
})
it('client.sunion, client.sunionstore', function (done) {
client.sunion('setA')(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([])
return thunk.all(this.sadd('setA', 'a', 'b', 'c'), this.sadd('setB', 'b', 'c', 'd'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([3, 3])
return thunk.all(client.sunion('setA'), client.sunion('setA', 'setB'), client.sunion('setA', 'setC'))
})(function (error, res) {
should(error).be.equal(null)
should(res[0].length).be.equal(3)
should(res[0]).be.containEql('a')
should(res[0]).be.containEql('b')
should(res[0]).be.containEql('c')
should(res[1].length).be.equal(4)
should(res[1]).be.containEql('a')
should(res[1]).be.containEql('b')
should(res[1]).be.containEql('c')
should(res[1]).be.containEql('d')
should(res[2].length).be.equal(3)
return thunk.all(client.sunionstore('setC', 'setA', 'setB'), client.sunionstore('setA', 'setA', 'setB'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([4, 4])
return thunk.all(this.scard('setA'), this.scard('setC'))
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([4, 4])
})(done)
})
it('client.sscan', function (done) {
var count = 100
var data = []
var scanKeys = []
while (count--) data.push('m' + count)
function fullScan (cursor) {
return client.sscan('set', cursor)(function (error, res) {
should(error).be.equal(null)
scanKeys = scanKeys.concat(res[1])
if (res[0] === '0') return res
return fullScan(res[0])
})
}
client.sscan('set', 0)(function (error, res) {
should(error).be.equal(null)
should(res).be.eql(['0', []])
var args = data.slice()
args.unshift('set')
return this.sadd.apply(this, args)
})(function (error, res) {
should(error).be.equal(null)
should(res).be.equal(100)
return fullScan(0)
})(function (error, res) {
should(error).be.equal(null)
should(scanKeys.length).be.equal(100)
JSONKit.each(data, function (value) {
should(scanKeys).be.containEql(value)
})
return this.sscan('set', 0, 'count', 20)
})(function (error, res) {
should(error).be.equal(null)
should(res[0] > 0).be.equal(true)
should(res[1].length > 0).be.equal(true)
return this.sscan('set', 0, 'count', 200, 'match', '*0')
})(function (error, res) {
should(error).be.equal(null)
should(res[0] === '0').be.equal(true)
should(res[1].length === 10).be.equal(true)
})(done)
})
})
}
|
AlphaStaxLLC/thunk-redis
|
test/commands-set.js
|
JavaScript
|
mit
| 9,593
|
/**
* Custom error types to differentiate eBay response errors and client-level errors.
*
* @see http://developer.ebay.com/devzone/xml/docs/Reference/ebay/Errors/ErrorMessages.htm
*/
var
inherits = require('util').inherits,
_ = require('lodash');
function EbayClientError(message, extraProps) {
Error.apply(this, arguments);
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
_.defaults(this, extraProps);
}
inherits(EbayClientError, Error);
function EbaySystemError(message, extraProps) {
EbayClientError.apply(this, arguments);
this.name = this.constructor.name;
}
inherits(EbaySystemError, EbayClientError);
function EbayRequestError(message) {
EbayClientError.apply(this, arguments);
this.name = this.constructor.name;
}
inherits(EbayRequestError, EbayClientError);
function EbayAuthenticationError(message) {
EbayClientError.apply(this, arguments);
this.name = this.constructor.name;
}
inherits(EbayAuthenticationError, EbayClientError);
module.exports = {
EbayClientError: EbayClientError,
EbaySystemError: EbaySystemError,
EbayRequestError: EbayRequestError,
EbayAuthenticationError: EbayAuthenticationError,
};
|
amitkas/savebuy
|
node_modules/ebay-api/lib/errors.js
|
JavaScript
|
mit
| 1,221
|
<?php
namespace JHWEB\UsuarioBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class JHWEBUsuarioBundle extends Bundle
{
}
|
edosgn/asi-sw
|
src/JHWEB/UsuarioBundle/JHWEBUsuarioBundle.php
|
PHP
|
mit
| 132
|
require_relative "helper"
module Sol
class TestIfNoIf < MiniTest::Test
include SolCompile
def setup
@compiler = compile_main( "unless(@a) ; @a = 5 ; end;return")
@ins = @compiler.slot_instructions.next
end
def test_condition_compiles_to_check
assert_equal TruthCheck , @ins.class , @ins
end
def test_condition_is_slot
assert_equal SlottedMessage , @ins.condition.class , @ins
end
def test_label_after_check
assert_equal Label , @ins.next.class , @ins
end
def test_label_last
assert_equal Label , @ins.last.class , @ins
end
def test_array
check_array [TruthCheck, Label, Jump, Label, SlotLoad ,
Label, SlotLoad, ReturnJump,Label, ReturnSequence, Label] , @ins
end
end
end
|
salama/salama
|
test/sol/test_if_no_if.rb
|
Ruby
|
mit
| 794
|
<!doctype html>
<style>
body{background:rgb(180,180,190)}
body > div{
background:rgb(240,240,255);
margin:20px;
padding:20px;
border:8px solid rgb(150,150,180)
}
h4{margin:0.25em 0}
body{font-family:sans-serif}
h1 a{
color:white;
text-decoration:none
}
.log{
border-radius: 6px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
background:#ddd;
padding:10px;
margin:0px 5px 17px 0;
max-width:600px
}
div span{
margin:0 0.5em;
display:block
}
h1{
margin:-20px -20px 20px -20px;
color:white;
padding:5px 20px;display:block;
-moz-box-shadow: 0 0 5px 5px rgb(80,80,100);
text-shadow: 0 2px 5px rgb(80,80,100);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.25, rgb(165,165,165)),
color-stop(0.63, rgb(198,198,230))
);
background-image: -moz-linear-gradient(
center bottom,
rgb(165,165,164) 25%,
rgb(190,190,210) 63%
);
}
</style>
<body onload=test()>
<div id=main>
<H1>Example Usage</H1>
<p>View the source code of this file to see how things are written. Or head on over to the <a href=test.html>Tests</a></p>
</div>
<div>
<h1>Step 2: The Tests</h1>
<h2><a href=test.html>Go to the tests</a></h2>
</div>
</body>
<script src=../db.js></script>
<script>
var db;
function info(txt) {
document.getElementById('main').innerHTML += '<div class=info>' +
'<i>Notice: ' + arguments[0] + '</i>' +
'</div>';
}
function log(txt) {
document.getElementById('main').innerHTML += '<div class=log>' +
'<h4>' + arguments[0] + ':</h4>' +
'<span>' + arguments[1] + '</span>' +
'</div>';
}
function test() {
var res;
db = DB([{
first: "Peter",
last: "Griffin",
age: 41,
hometown: "Quahog",
job: "Brewer"
}, {
first: "Lois",
last: "Griffin",
age: 40,
hometown: "Newport",
job: "Piano Teacher"
}]),
toInsert = [{
first: "Joseph",
last: "Swanson",
age: 39,
hometown: "Quahog",
job: "Police Officer"
}, {
first: "Glenn",
last: "Quagmire",
age: 41,
hometown: "Quahog",
job: "Pilot"
}];
DB.trace(db);
res = db.find().select('*');
log('Initialized the database with the following data', res.join('<br>'));
db.sync( function(raw) {
info('Running the synchronization function');
});
info('Registered a synchronization function to be run when the database changes');
res = db.insert(toInsert);
log('Inserted more data, got references to the data inserted back', res.join('<br>'));
res = db.select('job');
log('Showing the types of jobs', res.join('<br>'));
res = db.find(db('age', '> 40')).select('first');
log('Listing people with age over 40', res.join('<br>'));
res = db
.order('age', 'asc')
.select('first', 'age')
.each(function(res) { return res[0] + ' is ' + res[1] });
log('Ordering people by age ascending, and emitting output in a formatted way', res.join('<br>'));
db.update('description', function(param) {
return [
param.first,
param.last,
"is from",
param.hometown,
"and is a",
param.age,
"year old",
param.job
].join(' ');
});
res = db.select('description');
log('Created a new field, named description', res.join('<br>'));
var removed = db.find('last', 'Griffin').remove();
res = db.find('last', 'Griffin');
log('Removed people with the last name griffin. Searched for this parameter', res.length);
db.insert(removed);
res = db.find('last', 'Griffin');
log('Reinserted the results previously removed. Searched for the same parameter', res.length);
res = db.find({age: db.isin([41, 40])}).select('description');
log('Searching for people either 41 or 40', res.join('<br>'));
// Not in IE we don't.
if(!window.attachEvent) {
var somenumber = Math.floor(Math.random() * 1000 * 1000 * 1000).toString(16);
log('Using document.getElementsByTagName("*") with a find on the innerHTML value to turn the element below blue', somenumber);
DB.find(
document.getElementsByTagName('*'),
{innerHTML: somenumber})[0].style.color = 'blue';
}
}
</script>
|
kristopolous/bracket
|
examples/index.html
|
HTML
|
mit
| 4,439
|
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-example58-production</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.13/angular.min.js"></script>
<script src="script.js"></script>
</head>
<body ng-app="">
<div ng-controller="Ctrl">
<table class="friend">
<tr>
<th><a href="" ng-click="reverse=false;order('name', false)">Name</a>
(<a href="" ng-click="order('-name',false)">^</a>)</th>
<th><a href="" ng-click="reverse=!reverse;order('phone', reverse)">Phone Number</a></th>
<th><a href="" ng-click="reverse=!reverse;order('age',reverse)">Age</a></th>
</tr>
<tr ng-repeat="friend in friends">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
<td>{{friend.age}}</td>
</tr>
</table>
</div>
</body>
</html>
|
petervyvey/portfolio
|
web/public/app/vendor/angular/lib/docs/examples/example-example58/index-production.html
|
HTML
|
mit
| 886
|
#coding: utf8
import unittest
#from conf import NginxConfig
from blocks import KeyValueOption, KeyOption, Block
'''
s = """server {
nameserver 123;
}"""
s = """server 123;"""
a = NginxConfig()
a.load(s)
print(a.server)
#print(a.server.nameserver)
'''
class NgKVB(Block):
kv = KeyValueOption('kv_value')
class Test(unittest.TestCase):
def test_base(self):
"""
Base tests of Block, KeyValueOption, KeyOption classes functionality
"""
a1 = NgKVB()
a2 = NgKVB()
self.assertEqual(str(a1.kv), 'kv_value')
self.assertEqual(str(a2.kv), 'kv_value')
self.assertEqual('kv' in a1._options, True)
self.assertEqual('kv' in a2._options, True)
self.assertEqual(type(a1.kv), KeyValueOption)
self.assertEqual(type(a2.kv), KeyValueOption)
a1.kv = 'kv_another_value'
self.assertEqual(type(a1.kv), KeyValueOption)
self.assertEqual(id(a1.kv) == id(KeyValueOption), False)
self.assertEqual(id(a2.kv) == id(KeyValueOption), False)
self.assertEqual(str(a1.kv), 'kv_another_value')
self.assertEqual(str(a2.kv), 'kv_value')
def test_block_attribute_inheritance(self):
"""
Tests that base class Block does not take any of child class attributes
"""
a1 = NgKVB()
self.assertEqual(hasattr(Block, '_options'), False)
self.assertEqual(a1._options, ['kv'])
self.assertEqual(hasattr(a1, 'kv'), True)
def test_block_item_assigment(self):
a1 = NgKVB()
a1['kv'] = KeyValueOption('kv_value')
self.assertEqual(a1._options, ['kv'])
self.assertEqual(type(a1['kv']), KeyValueOption)
def test_kv_option(self):
"""
Tests key-value option
"""
kv = KeyValueOption('value')
self.assertEqual(kv.render('kv_name'), '\nkv_name value;')
self.assertEqual(kv.render('kv_name', indent_level=1), '\n kv_name value;')
self.assertEqual(kv.render('kv_name', indent_level=2, indent_char='\t', indent=1), '\n\t\tkv_name value;')
def test_k_option(self):
"""
Tests key option
"""
k = KeyOption()
self.assertEqual(k.render('name'), '\nname;')
self.assertEqual(k.render('name', indent_level=1), '\n name;')
self.assertEqual(k.render('name', indent_level=2, indent_char='\t', indent=1), '\n\t\tname;')
def test_kv_block(self):
"""
Tests key-value option in block
"""
kvb = Block()
kvb.kv = KeyValueOption('value')
self.assertEqual(kvb.render('kbv_name'), '\nkbv_name {\n kv value;\n}')
def test_kv_block_initial(self):
"""
Tests initial values in key-value block and deletions of attributes
"""
kvb = NgKVB()
self.assertEqual(str(kvb.kv), 'kv_value')
self.assertEqual(kvb.kv.render('kv'), '\nkv kv_value;')
self.assertEqual(kvb.render('kvb_name'), '\nkvb_name {\n kv kv_value;\n}')
kvb.kv = 'kv_another_value'
self.assertEqual(type(kvb.kv), KeyValueOption)
self.assertEqual(str(kvb.kv), 'kv_another_value')
self.assertEqual(kvb.kv.render('kv'), '\nkv kv_another_value;')
self.assertEqual(kvb.render('kvb_name'), '\nkvb_name {\n kv kv_another_value;\n}')
del kvb.kv
self.assertEqual(hasattr(kvb, 'kv'), False)
self.assertEqual('kv' in kvb._options, False)
self.assertEqual(kvb.render('kvb_name'), '\nkvb_name {\n}')
kvb2 = NgKVB()
self.assertEqual(str(kvb2.kv), 'kv_value')
self.assertEqual(kvb2.kv.render('kv'), '\nkv kv_value;')
self.assertEqual(kvb2.render('kvb_name'), '\nkvb_name {\n kv kv_value;\n}')
if __name__ == "__main__":
unittest.main()
|
FeroxTL/pynginxconfig
|
test.py
|
Python
|
mit
| 3,830
|
var util = require('util');
var wolfram = require('wolfram');
var BaseTrigger = require('./baseTrigger.js').BaseTrigger;
/*
Trigger that responds to messages using Wolfram Alpha.
command = string - a message must start with this + a space before a response will be given
appId = string - the app ID to use when creating a new client
OR
client = wolfram client - use this as the client if it is passed as an option
*/
var WolframAlphaTrigger = function() {
WolframAlphaTrigger.super_.apply(this, arguments);
};
util.inherits(WolframAlphaTrigger, BaseTrigger);
var type = "WolframAlphaTrigger";
exports.triggerType = type;
exports.create = function(name, chatBot, options) {
var trigger = new WolframAlphaTrigger(type, name, chatBot, options);
trigger.client = trigger.options.client || wolfram.createClient(trigger.options.appId);
return trigger;
};
// Return true if a message was sent
WolframAlphaTrigger.prototype._respondToFriendMessage = function(userId, message) {
return this._respond(userId, message);
}
// Return true if a message was sent
WolframAlphaTrigger.prototype._respondToChatMessage = function(roomId, chatterId, message) {
return this._respond(roomId, message);
}
WolframAlphaTrigger.prototype._respond = function(toId, message) {
var question = this._stripCommand(message);
if (question) {
var that = this;
this.client.query(question, function(err, result) {
if (err) {
that._sendMessageAfterDelay(toId, "¯\\_(ツ)_/¯");
return;
}
var bestResult = that._getBestResult(result);
if (bestResult) {
that._sendMessageAfterDelay(toId, bestResult);
}
else {
that._sendMessageAfterDelay(toId, "¯\\_(ツ)_/¯");
}
});
return true;
}
return false;
}
WolframAlphaTrigger.prototype._stripCommand = function(message) {
if (this.options.command && message && message.toLowerCase().indexOf(this.options.command.toLowerCase() + " ") == 0) {
return message.substring(this.options.command.length + 1);
}
return null;
}
WolframAlphaTrigger.prototype._getBestResult = function(results) {
if (results) {
// Look for primary result first
for (var i=0; i < results.length; i++) {
if (results[i].primary) {
var text = _extractResult(results[i]);
if (text) {
return text;
}
}
}
// Otherwise just get the 2nd result (1st is the input interpretation)
if (results.length > 1) {
var text = _extractResult(results[1]);
if (text) {
return text;
}
}
}
return null;
}
var _extractResult = function(result) {
if (result.subpods[0] && result.subpods[0].value) {
return result.subpods[0].value;
}
else if (result.subpods[0] && result.subpods[0].image) {
return result.subpods[0].image;
}
return null;
}
|
vonmixer/node-steam-chat-bot
|
lib/triggers/wolframAlphaTrigger.js
|
JavaScript
|
mit
| 2,725
|
require 'spec_helper'
module Bldr
describe Node, 'delegating helper methods' do
before do
# mock version of a module of methods that would be attached
# to an ActionView::Base instance
helpers = Module.new do
def my_helper
'my helper'
end
def helper_with_args_and_block(one, two)
yield if block_given?
end
end
# set up a mock ActionView::Base instance
mock_action_view = Struct.new(:helpers)
@view = mock_action_view.new(helpers)
@view.extend(helpers)
@node = Node.new(nil, root: true, parent: @view)
end
it 'delegates the methods to the parent object' do
@view.should_receive(:my_helper)
@node.my_helper
end
it 'gives access to helper methods to child nodes' do
node = Node.new(nil, root: true, parent: @view) do
object(:foo => Object.new) do
attribute(:bar) { my_helper }
end
end
node.result.should == {foo: {bar: 'my helper'}}
end
it 'assigns opts[:parent] as a @view instance variable' do
@node.instance_variable_get(:@view).should == @view
end
it 'delegates arguments and blocks to the parent' do
lam = lambda { }
@view.should_receive(:helper_with_args_and_block).with(1, 2, lam)
@node.helper_with_args_and_block(1, 2, lam)
end
it 'defines helper methods on a per-instance basis' do
@node.methods.should include :my_helper
new_parent = Struct.new(nil).new
Node.new(nil, root: true, parent: new_parent).methods.should_not include :my_helper
end
end
end
|
phoffer/bldr-lite
|
spec/functional/helpers_spec.rb
|
Ruby
|
mit
| 1,623
|
.icon-avatar { background-image: url('png/avatar.png'); background-repeat: no-repeat; }
.icon-calendar { background-image: url('png/calendar.png'); background-repeat: no-repeat; }
.icon-check { background-image: url('png/check.png'); background-repeat: no-repeat; }
.icon-city { background-image: url('png/city.png'); background-repeat: no-repeat; }
.icon-close { background-image: url('png/close.png'); background-repeat: no-repeat; }
.icon-cloud { background-image: url('png/cloud.png'); background-repeat: no-repeat; }
.icon-desktop { background-image: url('png/desktop.png'); background-repeat: no-repeat; }
.icon-document { background-image: url('png/document.png'); background-repeat: no-repeat; }
.icon-down-arrow { background-image: url('png/down-arrow.png'); background-repeat: no-repeat; }
.icon-download { background-image: url('png/download.png'); background-repeat: no-repeat; }
.icon-dribbble { background-image: url('png/dribbble.png'); background-repeat: no-repeat; }
.icon-dropdown { background-image: url('png/dropdown.png'); background-repeat: no-repeat; }
.icon-exclamation { background-image: url('png/exclamation.png'); background-repeat: no-repeat; }
.icon-facebook { background-image: url('png/facebook.png'); background-repeat: no-repeat; }
.icon-globe { background-image: url('png/globe.png'); background-repeat: no-repeat; }
.icon-google { background-image: url('png/google.png'); background-repeat: no-repeat; }
.icon-grabbing { background-image: url('png/grabbing.png'); background-repeat: no-repeat; }
.icon-images { background-image: url('png/images.png'); background-repeat: no-repeat; }
.icon-info { background-image: url('png/info.png'); background-repeat: no-repeat; }
.icon-instagram { background-image: url('png/instagram.png'); background-repeat: no-repeat; }
.icon-left-arrow-white { background-image: url('png/left-arrow-white.png'); background-repeat: no-repeat; }
.icon-left-arrow { background-image: url('png/left-arrow.png'); background-repeat: no-repeat; }
.icon-link { background-image: url('png/link.png'); background-repeat: no-repeat; }
.icon-linkedin { background-image: url('png/linkedin.png'); background-repeat: no-repeat; }
.icon-logo { background-image: url('png/logo.png'); background-repeat: no-repeat; }
.icon-magnify { background-image: url('png/magnify.png'); background-repeat: no-repeat; }
.icon-mail { background-image: url('png/mail.png'); background-repeat: no-repeat; }
.icon-minus { background-image: url('png/minus.png'); background-repeat: no-repeat; }
.icon-next { background-image: url('png/next.png'); background-repeat: no-repeat; }
.icon-phone { background-image: url('png/phone.png'); background-repeat: no-repeat; }
.icon-pinpoint { background-image: url('png/pinpoint.png'); background-repeat: no-repeat; }
.icon-pinterest { background-image: url('png/pinterest.png'); background-repeat: no-repeat; }
.icon-play { background-image: url('png/play.png'); background-repeat: no-repeat; }
.icon-plus { background-image: url('png/plus.png'); background-repeat: no-repeat; }
.icon-prev { background-image: url('png/prev.png'); background-repeat: no-repeat; }
.icon-print { background-image: url('png/print.png'); background-repeat: no-repeat; }
.icon-question { background-image: url('png/question.png'); background-repeat: no-repeat; }
.icon-reddit { background-image: url('png/reddit.png'); background-repeat: no-repeat; }
.icon-right-arrow-white { background-image: url('png/right-arrow-white.png'); background-repeat: no-repeat; }
.icon-right-arrow { background-image: url('png/right-arrow.png'); background-repeat: no-repeat; }
.icon-settings { background-image: url('png/settings.png'); background-repeat: no-repeat; }
.icon-share-arrow { background-image: url('png/share-arrow.png'); background-repeat: no-repeat; }
.icon-skype { background-image: url('png/skype.png'); background-repeat: no-repeat; }
.icon-tablet { background-image: url('png/tablet.png'); background-repeat: no-repeat; }
.icon-tumblr { background-image: url('png/tumblr.png'); background-repeat: no-repeat; }
.icon-twitter { background-image: url('png/twitter.png'); background-repeat: no-repeat; }
.icon-up-arrow { background-image: url('png/up-arrow.png'); background-repeat: no-repeat; }
.icon-upload { background-image: url('png/upload.png'); background-repeat: no-repeat; }
.icon-vcard { background-image: url('png/vcard.png'); background-repeat: no-repeat; }
.icon-vimeo { background-image: url('png/vimeo.png'); background-repeat: no-repeat; }
.icon-write { background-image: url('png/write.png'); background-repeat: no-repeat; }
.icon-youtube { background-image: url('png/youtube.png'); background-repeat: no-repeat; }
|
JustRLax/sonos-dashboard
|
fallbacks/icons.fallback.css
|
CSS
|
mit
| 4,726
|
//
// Person.h
// MVVMWithKVO
//
// Created by Bryan Luby on 10/27/13.
// Copyright (c) 2013 Bryan Luby. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Person : NSObject
@property (copy, nonatomic) NSString *name;
@property (strong, nonatomic) NSDate *birthday;
- (instancetype)initWithName:(NSString *)name;
@end
|
Farteen/XcodeTestProjects
|
MVVMWithKVO/MVVMWithKVO/Person.h
|
C
|
mit
| 343
|
@extends('layouts.auto')
@section('title')
Défis
@endsection
@section('smalltitle')
Formulaire pour ajouter un défi que les différentes équipes pourront réaliser
@endsection
@section('content')
<div class="box box-default">
<div class="box-header with-border">
<h3>Ajouter un défi</h3>
</div>
@component("dashboard.challenges.form", ["challenge" => null])
{{ route("challenges.add") }}
@endcomponent
</div>
@endsection
|
ungdev/integration-UTT
|
resources/views/dashboard/challenges/add.blade.php
|
PHP
|
mit
| 502
|
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module ToDoApp
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
end
end
|
mykia/tts_rails
|
ToDo_app/config/application.rb
|
Ruby
|
mit
| 978
|
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package cloudtrail_test
import (
"bytes"
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudtrail"
)
var _ time.Duration
var _ bytes.Buffer
func ExampleCloudTrail_AddTags() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.AddTagsInput{
ResourceId: aws.String("String"), // Required
TagsList: []*cloudtrail.Tag{
{ // Required
Key: aws.String("String"), // Required
Value: aws.String("String"),
},
// More values...
},
}
resp, err := svc.AddTags(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_CreateTrail() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.CreateTrailInput{
Name: aws.String("String"), // Required
S3BucketName: aws.String("String"), // Required
CloudWatchLogsLogGroupArn: aws.String("String"),
CloudWatchLogsRoleArn: aws.String("String"),
EnableLogFileValidation: aws.Bool(true),
IncludeGlobalServiceEvents: aws.Bool(true),
IsMultiRegionTrail: aws.Bool(true),
KmsKeyId: aws.String("String"),
S3KeyPrefix: aws.String("String"),
SnsTopicName: aws.String("String"),
}
resp, err := svc.CreateTrail(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_DeleteTrail() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.DeleteTrailInput{
Name: aws.String("String"), // Required
}
resp, err := svc.DeleteTrail(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_DescribeTrails() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.DescribeTrailsInput{
IncludeShadowTrails: aws.Bool(true),
TrailNameList: []*string{
aws.String("String"), // Required
// More values...
},
}
resp, err := svc.DescribeTrails(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_GetEventSelectors() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.GetEventSelectorsInput{
TrailName: aws.String("String"), // Required
}
resp, err := svc.GetEventSelectors(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_GetTrailStatus() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.GetTrailStatusInput{
Name: aws.String("String"), // Required
}
resp, err := svc.GetTrailStatus(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_ListPublicKeys() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.ListPublicKeysInput{
EndTime: aws.Time(time.Now()),
NextToken: aws.String("String"),
StartTime: aws.Time(time.Now()),
}
resp, err := svc.ListPublicKeys(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_ListTags() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.ListTagsInput{
ResourceIdList: []*string{ // Required
aws.String("String"), // Required
// More values...
},
NextToken: aws.String("String"),
}
resp, err := svc.ListTags(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_LookupEvents() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.LookupEventsInput{
EndTime: aws.Time(time.Now()),
LookupAttributes: []*cloudtrail.LookupAttribute{
{ // Required
AttributeKey: aws.String("LookupAttributeKey"), // Required
AttributeValue: aws.String("String"), // Required
},
// More values...
},
MaxResults: aws.Int64(1),
NextToken: aws.String("NextToken"),
StartTime: aws.Time(time.Now()),
}
resp, err := svc.LookupEvents(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_PutEventSelectors() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.PutEventSelectorsInput{
EventSelectors: []*cloudtrail.EventSelector{ // Required
{ // Required
DataResources: []*cloudtrail.DataResource{
{ // Required
Type: aws.String("String"),
Values: []*string{
aws.String("String"), // Required
// More values...
},
},
// More values...
},
IncludeManagementEvents: aws.Bool(true),
ReadWriteType: aws.String("ReadWriteType"),
},
// More values...
},
TrailName: aws.String("String"), // Required
}
resp, err := svc.PutEventSelectors(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_RemoveTags() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.RemoveTagsInput{
ResourceId: aws.String("String"), // Required
TagsList: []*cloudtrail.Tag{
{ // Required
Key: aws.String("String"), // Required
Value: aws.String("String"),
},
// More values...
},
}
resp, err := svc.RemoveTags(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_StartLogging() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.StartLoggingInput{
Name: aws.String("String"), // Required
}
resp, err := svc.StartLogging(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_StopLogging() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.StopLoggingInput{
Name: aws.String("String"), // Required
}
resp, err := svc.StopLogging(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudTrail_UpdateTrail() {
sess := session.Must(session.NewSession())
svc := cloudtrail.New(sess)
params := &cloudtrail.UpdateTrailInput{
Name: aws.String("String"), // Required
CloudWatchLogsLogGroupArn: aws.String("String"),
CloudWatchLogsRoleArn: aws.String("String"),
EnableLogFileValidation: aws.Bool(true),
IncludeGlobalServiceEvents: aws.Bool(true),
IsMultiRegionTrail: aws.Bool(true),
KmsKeyId: aws.String("String"),
S3BucketName: aws.String("String"),
S3KeyPrefix: aws.String("String"),
SnsTopicName: aws.String("String"),
}
resp, err := svc.UpdateTrail(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
|
ae6rt/decap
|
web/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/examples_test.go
|
GO
|
mit
| 8,904
|
define(function() {
return {
blank_function: function(){},
};
});
|
bizet/healthy
|
public/javascripts/util/const.js
|
JavaScript
|
mit
| 75
|
<?php
namespace Whizark\DesignPatterns\Uncategorized\NullObject;
use Whizark\DesignPatterns\Uncategorized\NullObject\OperationInterface;
/**
* Class RealOperation
* @package Whizark\DesignPatterns\Uncategorized\NullObject
*/
class RealOperation implements OperationInterface
{
/**
* {@inheritDoc}
*/
public function request()
{
// Do something.
}
}
|
dez-php/php-patterns
|
src/Whizark/DesignPatterns/Uncategorized/NullObject/RealOperation.php
|
PHP
|
mit
| 388
|
.enyo-fittable-rows-layout {
position: relative;
}
.enyo-fittable-rows-layout > * {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
/* float when not stretched */
float: left;
clear: both;
}
/* non-floating when stretched */
.enyo-fittable-rows-layout.enyo-stretch > * {
float: none;
clear: none;
}
/* setting to enforce margin collapsing */
/* NOTE: rows cannot have margin left/right */
.enyo-fittable-rows-layout.enyo-stretch.enyo-margin-expand > * {
float: left;
clear: both;
width: 100%;
/* note: harsh resets */
margin-left: 0 !important;
margin-right: 0 !important;
}
.enyo-fittable-columns-layout {
position: relative;
text-align: left;
white-space: nowrap;
}
.enyo-fittable-columns-layout.enyo-center {
text-align: center;
}
.enyo-fittable-columns-layout > * {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
vertical-align: top;
display: inline-block;
white-space: normal;
}
/* repair clobbered white-space setting for pre, code */
.enyo-fittable-columns-layout > pre, .enyo-fittable-columns-layout > code {
white-space: pre;
}
.enyo-fittable-columns-layout > .enyo-fittable-columns-layout, .enyo-fittable-columns-layout > .onyx-toolbar-inline {
white-space: nowrap;
}
/* NOTE: columns cannot have margin top/bottom */
.enyo-fittable-columns-layout.enyo-stretch > * {
height: 100%;
/* note: harsh resets */
margin-top: 0 !important;
margin-bottom: 0 !important;
}
|
hui-w/misc-fragment
|
tax-calc-cn/www/lib/layout/fittable/source/FittableLayout.css
|
CSS
|
mit
| 1,490
|
<?php
/*
* This file is part of the PHPExifTool package.
*
* (c) Alchemy <support@alchemy.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPExiftool\Driver\Tag\DICOM;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class ZSlopeCalibrationDate extends AbstractTag
{
protected $Id = '0045,101D';
protected $Name = 'ZSlopeCalibrationDate';
protected $FullName = 'DICOM::Main';
protected $GroupName = 'DICOM';
protected $g0 = 'DICOM';
protected $g1 = 'DICOM';
protected $g2 = 'Image';
protected $Type = '?';
protected $Writable = false;
protected $Description = 'Z Slope Calibration Date';
}
|
bburnichon/PHPExiftool
|
lib/PHPExiftool/Driver/Tag/DICOM/ZSlopeCalibrationDate.php
|
PHP
|
mit
| 817
|
---
title: "Jacoco plugin in Jenkins"
layout: single
categories: 'blog'
tags: 'blog'
navigation: True
subclass: 'post tag-speeches'
comments: true
date: 2018-09-18 15:08:33 EDT
---
Jacoco has been used in the project to assure the test coverage. However, I didn't realize that the jacoco job in jenkins is using a different plugin than the one setup in our source code repository.
One thing got my attention was the test coverage failure in our pipeline for one of the service we work on. And it's a surprise because the coverage has been pretty good in the past and suddenly failed in a PR with small changes. By digging into the log, I realized that the coverage report in the pipeline has included the test code itself!! And it's interesting to see that the coverage of the test code is not 100%!! Guess that's because of the test framework code and some of the tests are only enabled/used for some flags. But anyway, that's a separate topic.
So once you know the root cause of the issue, then it's just a matter of finding the right person to help you fix it! Since it worked before, it's apparently caused by some recent changes in the pipeline. And one thing we found during the investigation is that the exclusion rules of the jacoco plugin doesn't work as expected. i.e. it won't exclude the test code as it's supposed to do. We have to make sure the source we specify only contains the source code not the test code (which is where the problem came in.). The [discussion here](https://stackoverflow.com/questions/42265838/how-to-have-code-coverage-in-jenkins-with-jacoco-and-multiple-modules) has an example of the right way to configure the plugin in jenkins. Instead of configuring the exclusion rules, it works better to make sure the `Path to source directories` only contain the source code.
If you are using [Lombok](https://projectlombok.org/) in your project, another thing worthy to note is that the latest version of jacoco and lobmok allow you to ingore the lombok generated code in the coverage report. Here is one article - [Ignoring Lombok Code in Jacoco](https://www.rainerhahnekamp.com/en/ignoring-lombok-code-in-jacoco/) with some of the details. Just be aware that you would need the latest version of jacoco plugin for jenkins if jenkins is used in the pipeline.
|
mingliangguo/mingliangguo.github.com
|
_posts/2018-09-18-jacoco-plugin-in-jenkins.md
|
Markdown
|
mit
| 2,296
|
package com.rajendarreddyj.basics.swing;
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
/**
* This program displays a simple Graphical User Interface (GUI) to demonstrate the Java Swing library. It just pops up
* several buttons and lets us change their color when we click on them.
*
* @author rajendarreddy
*
*/
public class FirstGUI {
private JButton button;
private JButton button2;
private JFrame frame;
// Constructs the GUI and displays it on the screen.
public FirstGUI() {
// create some components (buttons)
this.button = new JButton("Click here to get a 4.0");
this.button.setBackground(Color.RED);
this.button.setFont(new Font("Comic Sans MS", Font.BOLD, 18));
this.button2 = new JButton("Click here to get a 0.0");
this.button2.setBackground(Color.YELLOW);
// attach event listener to handle mouse clicks
MyAwesomeListener listener = new MyAwesomeListener();
this.button.addActionListener(listener);
this.button2.addActionListener(listener);
// create overall window (frame) and put buttons in it
this.frame = new JFrame("First GUI");
this.frame.setLocation(300, 100);
this.frame.setSize(400, 300);
this.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// layout manager decides how to position/size the components in the frame
this.frame.setLayout(new BorderLayout());
this.frame.add(this.button, BorderLayout.NORTH);
this.frame.add(this.button2, BorderLayout.SOUTH);
this.frame.add(new Button("WEST"), BorderLayout.WEST);
this.frame.add(new Button("EAST"), BorderLayout.EAST);
this.frame.setVisible(true);
}
// This class handles "action events", aka mouse clicks, in buttons.
public class MyAwesomeListener implements ActionListener {
@Override
public void actionPerformed(final ActionEvent e) {
if (e.getSource() == FirstGUI.this.button) {
FirstGUI.this.button2.setBackground(Color.BLUE);
} else {
// event source is button2
FirstGUI.this.button.setBackground(Color.BLUE);
}
}
}
/**
* This method just exists to run the overall program and pop up the GUI on the screen.
*
* @param args
*/
public static void main(final String[] args) {
new FirstGUI();
}
}
|
rajendarreddyj/development-java
|
java-projects/basics/src/main/java/com/rajendarreddyj/basics/swing/FirstGUI.java
|
Java
|
mit
| 2,632
|
FROM ubuntu:14.04
MAINTAINER Hector Cordero <hhcordero@gmail.com>
ENV JMETER_VERSION 2.13
ENV JMETER_HOME /usr/local/apache-jmeter-${JMETER_VERSION}
ENV JMETER_BIN $JMETER_HOME/bin
ENV RMI_CLIENT_PORT 1099
ENV RMI_SERVER_PORT 9901
ENV TEST_PLAN test.jmx
ENV ACCESS_KEY XXX
ENV SECRET_KEY XXX
ENV REGION XXX
ENV QUEUE_URL XXX
RUN set -x && \
apt-get update && \
apt-get -y install openjdk-7-jre-headless python unzip wget && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN cd /tmp && \
wget https://s3.amazonaws.com/aws-cli/awscli-bundle.zip && \
unzip awscli-bundle.zip && \
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws && \
wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-${JMETER_VERSION}.tgz && \
tar -xzf apache-jmeter-${JMETER_VERSION}.tgz -C /usr/local && \
rm apache-jmeter-${JMETER_VERSION}.tgz
ENV PATH $PATH:$JMETER_BIN
COPY scripts/$TEST_PLAN $JMETER_HOME/$TEST_PLAN
COPY scripts/run-container /usr/local/bin/run-container
RUN chmod +x /usr/local/bin/run-container
WORKDIR $JMETER_HOME
EXPOSE $RMI_CLIENT_PORT $RMI_SERVER_PORT
CMD ["run-container"]
|
hhcordero/docker-jmeter
|
client/Dockerfile
|
Dockerfile
|
mit
| 1,153
|
@ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. texinfo to make Texinfo files
echo. gettext to make PO message catalogs
echo. changes to make an overview over all changed/added/deprecated items
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\RPython.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\RPython.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "texinfo" (
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
goto end
)
if "%1" == "gettext" (
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
:end
|
oblique-labs/pyVM
|
rpython/doc/make.bat
|
Batchfile
|
mit
| 5,098
|
<?php
namespace Modules\Permissions\Providers;
use Nova\Packages\Support\Providers\ModuleServiceProvider as ServiceProvider;
class ModuleServiceProvider extends ServiceProvider
{
/**
* The additional provider class names.
*
* @var array
*/
protected $providers = array(
'Modules\Permissions\Providers\AuthServiceProvider',
'Modules\Permissions\Providers\EventServiceProvider',
'Modules\Permissions\Providers\RouteServiceProvider',
);
/**
* Bootstrap the Application Events.
*
* @return void
*/
public function boot()
{
$path = realpath(__DIR__ .'/../');
// Configure the Package.
$this->package('Modules/Permissions', 'permissions');
// Bootstrap the Package.
$path = $path .DS .'Bootstrap.php';
$this->bootstrapFrom($path);
}
/**
* Register the Permissions module Service Provider.
*
* This service provider is a convenient place to register your modules
* services in the IoC container. If you wish, you may make additional
* methods or service providers to keep the code more focused and granular.
*
* @return void
*/
public function register()
{
parent::register();
//
}
}
|
nova-framework/framework
|
modules/Permissions/Providers/ModuleServiceProvider.php
|
PHP
|
mit
| 1,301
|
<?php defined('BX_DOL') or die('hack attempt');
/**
* Copyright (c) UNA, Inc - https://una.io
* MIT License - https://opensource.org/licenses/MIT
*
* @defgroup Videos Videos
* @ingroup UnaModules
*
* @{
*/
/**
* Videos module
*/
class BxVideosModule extends BxBaseModTextModule
{
function __construct(&$aModule)
{
parent::__construct($aModule);
}
/**
* @page service Service Calls
* @section bx_videos Videos
* @subsection bx_videos-page_blocks Page Blocks
* @subsubsection bx_videos-entity_video_block entity_video_block
*
* @code bx_srv('bx_videos', 'entity_video_block', [...]); @endcode
*
* Get page block with video player.
*
* @param $iContentId (optional) video ID. If empty value is provided, an attempt to get it from GET/POST arrays will be performed.
* @return HTML string with block content to display on the site or false if there is no enough input data. All necessary CSS and JS files are automatically added to the HEAD section of the site HTML.
*
* @see BxVideosModule::serviceEntityVideoBlock
*/
/**
* @ref bx_videos-entity_video_block "entity_video_block"
*/
public function serviceEntityVideoBlock ($iContentId = 0)
{
$mixedContent = $this->_getContent($iContentId);
if($mixedContent === false)
return false;
list($iContentId, $aContentInfo) = $mixedContent;
return $this->_oTemplate->entryVideo($aContentInfo);
}
/**
* @page service Service Calls
* @section bx_videos Videos
* @subsection bx_videos-page_blocks Page Blocks
* @subsubsection bx_videos-entity_rating entity_rating
*
* @code bx_srv('bx_videos', 'entity_rating', [...]); @endcode
*
* Get page block with Stars based video's rating.
*
* @param $iContentId (optional) video ID. If empty value is provided, an attempt to get it from GET/POST arrays will be performed.
* @return HTML string with block content to display on the site or false if there is no enough input data. All necessary CSS and JS files are automatically added to the HEAD section of the site HTML.
*
* @see BxVideosModule::serviceEntityRating
*/
/**
* @ref bx_videos-entity_rating "entity_rating"
*/
public function serviceEntityRating($iContentId = 0)
{
return $this->_serviceTemplateFunc ('entryRating', $iContentId);
}
protected function _getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams = array())
{
$aResult = parent::_getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams);
if(!empty($aResult['videos']) && is_array($aResult['videos']))
$aResult['images'] = array();
return $aResult;
}
protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
{
list($sImageThumb, $sImageGallery, $sImageCover) = $this->_oTemplate->getUnitImages($aContentInfo);
if(empty($sImageGallery) && !empty($sImageThumb))
$sImageGallery = $sImageThumb;
if(empty($sImageGallery))
return array();
return array(
array('url' => $sUrl, 'src' => $sImageGallery, 'src_orig' => $sImageCover),
);
}
protected function _getVideosForTimelinePost($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
{
$CNF = &$this->_oConfig->CNF;
if(empty($CNF['OBJECT_STORAGE_VIDEOS']) || empty($CNF['OBJECT_VIDEOS_TRANSCODERS']))
return array();
$oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE_VIDEOS']);
$iFile = (int)$aContentInfo[$CNF['FIELD_VIDEO']];
$aFile = $oStorage->getFile($iFile);
if(empty($aFile) || !is_array($aFile) || strncmp('video/', $aFile['mime_type'], 6) !== 0)
return array();
$oTcvPoster = BxDolTranscoder::getObjectInstance($CNF['OBJECT_VIDEOS_TRANSCODERS']['poster']);
$oTciPoster = BxDolTranscoder::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_POSTER']);
$oTcvMp4 = BxDolTranscoder::getObjectInstance($CNF['OBJECT_VIDEOS_TRANSCODERS']['mp4']);
$oTcvMp4Hd = BxDolTranscoder::getObjectInstance($CNF['OBJECT_VIDEOS_TRANSCODERS']['mp4_hd']);
if(!($oTcvPoster || $oTciPoster) || !$oTcvMp4 || !$oTcvMp4Hd)
return array();
$sPosterSrc = !empty($CNF['FIELD_POSTER']) ? $CNF['FIELD_POSTER'] : $CNF['FIELD_THUMB'];
if(!empty($sPosterSrc) && !empty($aContentInfo[$sPosterSrc]) && $oTciPoster)
$sPoster = $oTciPoster->getFileUrl($aContentInfo[$sPosterSrc]);
else
$sPoster = $oTcvPoster->getFileUrl($iFile);
$sVideoUrl = $oStorage->getFileUrlById($iFile);
$aVideoSize = $oTcvMp4Hd->getVideoSize($sVideoUrl);
$sVideoUrlHd = '';
if(!empty($aVideoSize) && is_array($aVideoSize) && (int)$aVideoSize['h'] >= 720)
$sVideoUrlHd = $oTcvMp4Hd->getFileUrl($iFile);
return array(
$iFile => array(
'id' => $iFile,
'src_poster' => $sPoster,
'src_mp4' => $oTcvMp4->getFileUrl($iFile),
'src_mp4_hd' => $sVideoUrlHd
)
);
}
}
/** @} */
|
unaio/una
|
modules/boonex/videos/updates/9.0.4_10.0.0/source/classes/BxVideosModule.php
|
PHP
|
mit
| 5,302
|
import * as strategies from "./strategies"
export declare const defaults : {
labels: string,
css: { [key: string]: string },
strategies: {
selection: Array<string | strategies.selectionStrategy<any>>
click: Array<string | strategies.clickStrategy<any>>,
fold: Array<string | strategies.foldStrategy<any>>
},
display: (Object) => string,
async: (Function) => Promise<any>,
openerOpts: { position?: "none" | "left" | "right" },
draggable: boolean,
dragndrop: {
draggable: boolean,
droppable: boolean,
drag?<Item extends Object>(target: Item, event: DragEvent, ancestors: Array<Item>, neighbours: Array<Item>): void,
drop?<Item extends Object>(target: Item, event: DragEvent): void,
guard?<Item extends Object>(target: Item | null, event: DragEvent, inputs: Object): boolean
}
}
|
elbywan/bosket
|
src/core/defaults.d.ts
|
TypeScript
|
mit
| 894
|
//
// TrackParams.h
// ViSearch
//
// Created by Yaoxuan on 5/12/16.
// Copyright © 2016 Shaohuan Li. All rights reserved.
//
#ifndef TrackParams_h
#define TrackParams_h
#import <Foundation/Foundation.h>
#import "BaseSearchParams.h"
@interface TrackParams : BaseSearchParams
@property (nonatomic, readonly) NSString * action;
@property (nonatomic) NSString * imName;
@property (nonatomic, readonly) NSString * reqId;
@property (nonatomic, readonly) NSString * cid; // set to access key
@property (nonatomic) NSString * cuid;
- (id) init __unavailable;
- (TrackParams *)withImName:(NSString *)imName;
+ (TrackParams *)createWithCID:(NSString *)cid ReqId:(NSString *)reqId andAction:(NSString *)action __deprecated_msg("use createWithAccessKey:accessKey:reqId:andAction method instead");
+ (TrackParams *)createWithAccessKey:(NSString *)accessKey reqId:(NSString *)reqId andAction:(NSString *)action;
@end
#endif /* TrackParams_h */
|
yulu/visearch-sdk-ios
|
ViSearchSDK/ViSearchAPISource/TrackParams.h
|
C
|
mit
| 946
|
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.apimanagement.v2018_06_01_preview.implementation;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Get User Token response details.
*/
public class UserTokenResultInner {
/**
* Shared Access Authorization token for the User.
*/
@JsonProperty(value = "value")
private String value;
/**
* Get shared Access Authorization token for the User.
*
* @return the value value
*/
public String value() {
return this.value;
}
/**
* Set shared Access Authorization token for the User.
*
* @param value the value value to set
* @return the UserTokenResultInner object itself.
*/
public UserTokenResultInner withValue(String value) {
this.value = value;
return this;
}
}
|
selvasingh/azure-sdk-for-java
|
sdk/apimanagement/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/apimanagement/v2018_06_01_preview/implementation/UserTokenResultInner.java
|
Java
|
mit
| 1,061
|
<?php
namespace Richpolis\PublicidadBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Richpolis\PublicidadBundle\Entity\Publicidad;
use Richpolis\PublicidadBundle\Form\PublicidadType;
use Richpolis\BackendBundle\Utils\Richsys as RpsStms;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Publicidad controller.
*
* @Route("/publicidad")
*/
class PublicidadController extends Controller
{
private $tipos = null;
protected function getFilters() {
return $this->get('session')->get('filters', array());
}
protected function setFilters($filtros) {
$this->get('session')->set('filters', $filtros);
}
protected function getTipoPublicidadDefault() {
$filters = $this->getFilters();
$tipoPublicidad = null;
if (isset($filters['tipoPublicidad'])) {
$this->tipos = Publicidad::getArrayTipoPublicidad();
foreach ($this->tipos as $key => $value) {
if ($key == $filters['tipoPublicidad']) {
$tipoPublicidad = $key;
break;
}
}
} else {
$this->tipos = Publicidad::getArrayTipoPublicidad();
$keys = array_keys($this->tipos);
$this->setFilters(array('tipoPublicidad' => $keys[0]));
$tipoPublicidad = $keys[0];
}
return $tipoPublicidad;
}
/**
* Lists all Publicidad entities.
*
* @Route("/", name="publicidad")
* @Method("GET")
* @Template()
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$tipoPublicidad = $this->getTipoPublicidadDefault();
$entities = $em->getRepository('PublicidadBundle:Publicidad')
->getPublicidadPorTipo($tipoPublicidad);
return array(
'entities' => $entities,
'tipos'=> Publicidad::getArrayTipoPublicidad(),
'tipo_publicidad' => $tipoPublicidad,
);
}
/**
* Lists all Publicidad entities for tipo de publicidad.
*
* @Route("/tipo/{tipoPublicidad}", name="publicidad_por_tipo",requirements={"tipoPublicidad" = "\d+"})
* @Method("GET")
* @Template("PublicidadBundle:Publicidad:index.html.twig")
*/
public function tipoPublicidadAction($tipoPublicidad) {
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('PublicidadBundle:Publicidad')
->getPublicidadPorTipo($tipoPublicidad);
$filters = $this->getFilters();
$filters['tipoPublicidad'] = $tipoPublicidad;
$this->setFilters($filters);
return array(
'entities' => $entities,
'tipos'=> Publicidad::getArrayTipoPublicidad(),
'tipo_publicidad' => $tipoPublicidad,
);
}
/**
* Get list tipos de publicidad.
*
* @Route("/ul", name="publicidad_lista_ul")
* @Method("GET")
* @Template("PublicidadBundle:Publicidad:ul.html.twig")
*/
public function ulAction() {
return array(
'tipos' => Publicidad::getArrayTipoPublicidad(),
);
}
/**
* Creates a new Publicidad entity.
*
* @Route("/", name="publicidad_create")
* @Method("POST")
* @Template("PublicidadBundle:Publicidad:new.html.twig")
*/
public function createAction(Request $request)
{
$entity = new Publicidad();
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('publicidad_show', array('id' => $entity->getId())));
}
return array(
'entity' => $entity,
'form' => $form->createView(),
'errores' => RpsStms::getErrorMessages($form)
);
}
/**
* Creates a form to create a Publicidad entity.
*
* @param Publicidad $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(Publicidad $entity)
{
$form = $this->createForm(new PublicidadType(), $entity, array(
'action' => $this->generateUrl('publicidad_create'),
'method' => 'POST',
));
//$form->add('submit', 'submit', array('label' => 'Create'));
return $form;
}
/**
* Displays a form to create a new Publicidad entity.
*
* @Route("/new", name="publicidad_new")
* @Method("GET")
* @Template()
*/
public function newAction()
{
$entity = new Publicidad();
$max = $this->getDoctrine()->getRepository('PublicidadBundle:Publicidad')
->getMaxPosicion();
$tipoPublicidad = $this->getTipoPublicidadDefault();
if (!is_null($max)) {
$entity->setPosition($max + 1);
} else {
$entity->setPosition(1);
}
$entity->setTipoPublicidad($tipoPublicidad);
$form = $this->createCreateForm($entity);
return array(
'entity' => $entity,
'form' => $form->createView(),
'errores' => RpsStms::getErrorMessages($form)
);
}
/**
* Finds and displays a Publicidad entity.
*
* @Route("/{id}", name="publicidad_show")
* @Method("GET")
* @Template()
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('PublicidadBundle:Publicidad')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Publicidad entity.');
}
$deleteForm = $this->createDeleteForm($id);
return array(
'entity' => $entity,
'delete_form' => $deleteForm->createView(),
);
}
/**
* Displays a form to edit an existing Publicidad entity.
*
* @Route("/{id}/edit", name="publicidad_edit")
* @Method("GET")
* @Template()
*/
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('PublicidadBundle:Publicidad')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Publicidad entity.');
}
$editForm = $this->createEditForm($entity);
$deleteForm = $this->createDeleteForm($id);
return array(
'entity' => $entity,
'form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
'errores' => RpsStms::getErrorMessages($editForm)
);
}
/**
* Creates a form to edit a Publicidad entity.
*
* @param Publicidad $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(Publicidad $entity)
{
$form = $this->createForm(new PublicidadType(), $entity, array(
'action' => $this->generateUrl('publicidad_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
//$form->add('submit', 'submit', array('label' => 'Update'));
return $form;
}
/**
* Edits an existing Publicidad entity.
*
* @Route("/{id}", name="publicidad_update")
* @Method("PUT")
* @Template("PublicidadBundle:Publicidad:edit.html.twig")
*/
public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('PublicidadBundle:Publicidad')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Publicidad entity.');
}
$deleteForm = $this->createDeleteForm($id);
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl('publicidad_edit', array('id' => $id)));
}
return array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
'errores' => RpsStms::getErrorMessages($editForm)
);
}
/**
* Deletes a Publicidad entity.
*
* @Route("/{id}", name="publicidad_delete")
* @Method("DELETE")
*/
public function deleteAction(Request $request, $id)
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
//if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('PublicidadBundle:Publicidad')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Publicidad entity.');
}
$em->remove($entity);
$em->flush();
//}
return $this->redirect($this->generateUrl('publicidad'));
}
/**
* Creates a form to delete a Publicidad entity by id.
*
* @param mixed $id The entity id
*
* @return \Symfony\Component\Form\Form The form
*/
private function createDeleteForm($id)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('publicidad_delete', array('id' => $id)))
->setMethod('DELETE')
//->add('submit', 'submit', array('label' => 'Delete'))
->getForm()
;
}
/**
* Ordenar las posiciones de los autobuses.
*
* @Route("/ordenar/registros", name="publicidad_ordenar")
* @Method("PATCH")
*/
public function ordenarRegistrosAction(Request $request) {
if ($request->isXmlHttpRequest()) {
$registro_order = $request->query->get('registro');
$em = $this->getDoctrine()->getManager();
$result['ok'] = true;
foreach ($registro_order as $order => $id) {
$registro = $em->getRepository('PublicidadBundle:Publicidad')->find($id);
if ($registro->getPosition() != ($order + 1)) {
try {
$registro->setPosition($order + 1);
$em->flush();
} catch (Exception $e) {
$result['mensaje'] = $e->getMessage();
$result['ok'] = false;
}
}
}
$response = new \Symfony\Component\HttpFoundation\JsonResponse();
$response->setData($result);
return $response;
} else {
$response = new \Symfony\Component\HttpFoundation\JsonResponse();
$response->setData(array('ok' => false));
return $response;
}
}
/**
* Activa o inactiva si una publicidad.
*
* @Route("/{id}/is/active", name="publicidad_is_active", requirements={"id" = "\d+"})
* @Method("PATCH")
*/
public function isActiveAction($id)
{
$em = $this->getDoctrine()->getManager();
$publicidad = $em->getRepository('PublicidadBundle:Publicidad')->find($id);
if (!$publicidad) {
throw $this->createNotFoundException('Unable to find publicidad entity.');
}
$publicidad->setIsActive(!$publicidad->getIsActive());
$em->flush();
return $this->render("PublicidadBundle:Publicidad:item.html.twig",array(
'entity'=>$publicidad
));
}
}
|
richpolis/sf2HeraldoToluca
|
src/Richpolis/PublicidadBundle/Controller/PublicidadController.php
|
PHP
|
mit
| 11,989
|
// Copyright (c) 2011-2013 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
//
// Unit tests for block-chain checkpoints
//
#include "checkpoints.h"
#include "uint256.h"
#include "test/test_bitcoin.h"
#include "chainparams.h"
#include <boost/test/unit_test.hpp>
using namespace std;
BOOST_FIXTURE_TEST_SUITE(Checkpoints_tests, BasicTestingSetup)
// TODO: checkpoints have been removed for now.
/*
BOOST_AUTO_TEST_CASE(sanity)
{
const CCheckpointData& checkpoints = Params(CBaseChainParams::MAIN).Checkpoints();
BOOST_CHECK(Checkpoints::GetTotalBlocksEstimate(checkpoints) >= 134444);
}
*/
BOOST_AUTO_TEST_SUITE_END()
|
litecoinz-project/litecoinz
|
src/test/Checkpoints_tests.cpp
|
C++
|
mit
| 750
|
'use strict';
angular.module('nachosSettingsApp')
.controller('Packages', function ($scope, $timeout, $state) {
var packages = require('nachos-packages');
var _ = require('lodash');
$scope.types = packages.Packages.TYPES;
$scope.view = function (item) {
$state.go('main.package-settings', {item: item})
};
$scope.getItems = function (type) {
return $scope[type];
};
packages.getAll(true)
.then(function (packages) {
$timeout(function () {
var packageTypes = Object.keys(packages);
packageTypes.forEach(function (type) {
packages[type] = _.filter(packages[type], function (pkg) {
return pkg.config.settings;
});
});
_.merge($scope, packages);
});
});
});
|
nachos/settings-burrito
|
client/app/main/packages/packages.controller.js
|
JavaScript
|
mit
| 813
|
<div class="ui text container">
<h1 class="ui inverted header">{{ site.title }}</h1>
<h2>{{ site.description }}</h2>
<div class="badges">
<a id="github-watch" href="{{ site.repository_url }}/watchers" target="_blank"><img src="https://img.shields.io/github/watchers/{{ site.repository }}.svg?style=social&label=Watch" alt="GitHub Watchers"></a>
<a id="github-star" href="{{ site.repository_url }}/stargazers" target="_blank"><img src="https://img.shields.io/github/stars/{{ site.repository }}.svg?style=social&label=Star" alt="GitHub Stargazers"></a>
<a id="github-fork" href="{{ site.repository_url }}/network/members" target="_blank"><img src="https://img.shields.io/github/forks/{{ site.repository }}.svg?style=social&label=Fork" alt="GitHub Forks"></a>
<a id="version" href="{{ site.repository_url }}/commits" target="_blank" data-update-at="{{ site.time | date_to_xmlschema }}"><img src="https://img.shields.io/badge/Updated-loading-orange.svg" alt="Update Time"></a>
</div>
<a class="ui huge inverted yellow basic button" href="{{ '/' | relative_url }}#get-started">Get Started<i class="arrow right icon"></i></a>
</div>
|
iROCKBUNNY/N-Back
|
_includes/home_header.html
|
HTML
|
mit
| 1,178
|
//
// RequestManager.h
// Organic
//
// Created by Mike on 1/18/15.
// Copyright (c) 2015 Mike Amaral. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface RequestManager : NSObject
+ (id)sharedInstance;
- (void)getGitHubDetailsForUser:(NSString *)user handler:(void (^)(NSError *error, NSDictionary *user, NSArray *repos))handler;
@end
|
gabrielPeart/Organic
|
Organic/Misc/Utils for demo/Random/RequestManager.h
|
C
|
mit
| 362
|
package de.kdml.bigdatalab.spark_and_flink.spark_project.examples;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.PairFunction;
import org.apache.spark.streaming.Durations;
import org.apache.spark.streaming.api.java.JavaInputDStream;
import org.apache.spark.streaming.api.java.JavaPairDStream;
import org.apache.spark.streaming.api.java.JavaStreamingContext;
import org.apache.spark.streaming.kafka010.ConsumerStrategies;
import org.apache.spark.streaming.kafka010.KafkaUtils;
import org.apache.spark.streaming.kafka010.LocationStrategies;
import de.kdml.bigdatalab.spark_and_flink.common_utils.Configs;
import de.kdml.bigdatalab.spark_and_flink.spark_project.SparkConfigsUtils;
import scala.Tuple2;
public class KafkaDirectMultipleReceivers {
private static Configs configs = Configs.getInstance();
public static void main(String[] args) {
// Create context with a 3 seconds batch interval
JavaSparkContext sc = SparkConfigsUtils.getSparkContext("Java DirectKafkaWordCount with update state by key");
JavaStreamingContext jssc = new JavaStreamingContext(sc,
Durations.seconds(configs.getIntProp("batchDuration")));
Set<String> topicsSet = new HashSet<>(Arrays.asList(configs.getStringProp("topics").split(",")));
Map<String, Object> kafkaParams = new HashMap<>();
kafkaParams.put("bootstrap.servers", configs.getStringProp("brokers"));
kafkaParams.put("key.deserializer", StringDeserializer.class);
kafkaParams.put("value.deserializer", StringDeserializer.class);
kafkaParams.put("group.id", configs.getStringProp("kafkaGroupId"));
kafkaParams.put("auto.offset.reset", "latest");
kafkaParams.put("enable.auto.commit", false);
//create two re
// Create direct kafka stream with brokers and topics
JavaInputDStream<ConsumerRecord<String, String>> stream = KafkaUtils.createDirectStream(
jssc,
LocationStrategies.PreferConsistent(),
ConsumerStrategies.<String, String>Subscribe(topicsSet, kafkaParams)
);
JavaInputDStream<ConsumerRecord<String, String>> stream1 = KafkaUtils.createDirectStream(
jssc,
LocationStrategies.PreferConsistent(),
ConsumerStrategies.<String, String>Subscribe(topicsSet, kafkaParams)
);
JavaPairDStream<String, String> messages = stream.mapToPair(
new PairFunction<ConsumerRecord<String, String>, String, String>() {
@Override
public Tuple2<String, String> call(ConsumerRecord<String, String> record) {
return new Tuple2<>(record.key(), record.value());
}
});
JavaPairDStream<String, String> messages1 = stream1.mapToPair(
new PairFunction<ConsumerRecord<String, String>, String, String>() {
@Override
public Tuple2<String, String> call(ConsumerRecord<String, String> record) {
return new Tuple2<>(record.key(), record.value());
}
});
messages.foreachRDD((rdd,time) -> {
System.out.println(time+"stream data:" + rdd.collect());
});
messages1.foreachRDD((rdd,time) -> {
System.out.println(time+"stream1 data:" + rdd.collect());
});
JavaPairDStream<String, String> unionStream = messages.union(messages1);
unionStream.print();
// Start the computation
jssc.start();
try {
jssc.awaitTermination();
} catch (InterruptedException e) {
System.out.println("error:" + e.getMessage());
}
}
}
|
ehabqadah/Spark_vs_Flink
|
spark_project/src/main/java/de/kdml/bigdatalab/spark_and_flink/spark_project/examples/KafkaDirectMultipleReceivers.java
|
Java
|
mit
| 3,658
|
using System;
using System.Configuration;
namespace StaticService.Configuration
{
public static class AppSettings
{
private static readonly GlobalSection Global;
static AppSettings()
{
Global = (GlobalSection)ConfigurationManager.GetSection("global");
Urls = Global.Url.Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
CultureResources = Global.CultureResources.Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
}
public static string Description => Global.Description;
public static string DisplayName => Global.DisplayName;
public static string ServiceName => Global.ServiceName;
public static string Root => Global.Root;
public static string[] Urls { get; }
public static string[] CultureResources { get; }
}
}
|
Apozhidaev/StaticService
|
StaticService/Configuration/AppSettings.cs
|
C#
|
mit
| 885
|
<?php
namespace Clarify\Exceptions;
class InvalidJSONException extends \Exception
{
}
|
caseysoftware/clarify-video-demo
|
vendor/clarify/clarify-helper/src/Clarify/Exceptions/InvalidJSONException.php
|
PHP
|
mit
| 88
|
/*
* JScript Render - Javascript renderization tools
* http://www.pleets.org
* Copyright 2014, Pleets Apps
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Date: 2015-01-22
*/
/* JScriptRender alias */
if (!window.hasOwnProperty('JScriptRender'))
JScriptRender = {};
/* relative path to the element whose script is currently being processed.*/
if (typeof document.currentScript != "undefined" && document.currentScript != null)
{
var str = document.currentScript.src;
JScriptRender.PATH = (str.lastIndexOf("/") == -1) ? "." : str.substring(0, str.lastIndexOf("/"));
}
else {
/* alternative method to get the currentScript (older browsers) */
// ...
/* else get the URL path */
JScriptRender.PATH = '.';
}
JScriptRender.STATE = 'loading';
/* Standard class */
JScriptRender.StdClass =
{
include: function(url, ajax, callback)
{
callback = callback || new Function();
url = JScriptRender.PATH + '/' + url;
if (typeof ajax == "undefined" || ajax == false)
{
var script = document.createElement("script");
script.src = url;
script.type = 'text/javascript';
script.id = 'JScriptRender-module';
/* IE */
if (script.readyState)
{
script.onreadystatechange = function()
{
if (this.readyState == 'complete') {
var scriptTag = document.querySelector('#' + script.id);
scriptTag.parentNode.removeChild(scriptTag);
callback();
}
}
}
/* Others */
else {
script.onload = function() {
var scriptTag = document.querySelector('#' + script.id);
scriptTag.parentNode.removeChild(scriptTag);
callback();
}
}
var head = document.querySelector('head');
head.appendChild(script);
}
else {
var xhr = new XMLHttpRequest();
// To prevent 412 (Precondition Failed) use GET method instead of POST
// Set async to false to can use xhr.status after xhr.send()
xhr.open("GET", url, false);
xhr.onreadystatechange = function()
{
if (xhr.readyState == 4 && xhr.status == 200)
eval(xhr.responseText);
if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 404)) {
callback();
}
}
xhr.send();
if (xhr.status == 404)
return false;
}
return true;
},
require: function(url, callback)
{
if (!this.include(url, true, callback))
alert('The resource ' + url + ' probably does not exists');
},
array_include: function(urlArray, callback)
{
var that = this;
var resource = urlArray[0];
callback = callback || new Function();
if (urlArray.length > 0)
this.include(resource, false, function(){
urlArray = urlArray.splice(1, urlArray.length);
that.array_include(urlArray, callback);
});
else
callback();
},
ready: function(handler)
{
handler = handler || new Function();
var libReady = function(handler)
{
setTimeout(function(){
if (JScriptRender.STATE == "complete")
handler();
else
return libReady(handler);
}, 100);
}
if (document.readyState == "complete")
libReady(handler);
else {
document.onreadystatechange = function () {
if (document.readyState == "complete") {
libReady(handler);
}
}
}
}
}
/* Short alias */
var $jS = JScriptRender;
for (var f in $jS.StdClass) {
$jS[f] = $jS.StdClass[f];
};
/* Load classes */
try {
$jS.array_include([
// Languages
'language/en_US.js',
'language/es_ES.js',
// General settings
'settings/general.js',
// Validators
'validator/MathExpression.js',
'validator/StringLength.js',
'validator/Digits.js',
'validator/Alnum.js',
'validator/Date.js',
'validator/FileFormat.js',
// Filters
'filter/InputFilter.js',
// Html
'html/Overlay.js',
'html/Loader.js',
'html/Dialog.js',
'html/Form.js',
'html/FormValidator.js',
// Exceptions
'exception/Exception.js',
// Readers
'readers/File.js',
// jQuery utils
'jquery/Ajax.js',
'jquery/UI.js',
'jquery/Debug.js',
'jquery/Animation.js',
// Utils
'utils/DateControl.js',
], function(){
JScriptRender.STATE = 'complete';
});
}
catch (e) {
JScriptRender.STATE = 'error';
}
|
PleetsApps/Talker-Town
|
public/libs/JScript-Render/JScriptRender.js
|
JavaScript
|
mit
| 5,223
|
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "Unnamed: 0": 0, "Incident Number": 103340050, "Date": "11\/30\/2010", "Time": "10:11 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.141234, -87.955480 ], "Address": "3432 W GREEN TREE RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 0, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 1, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 6, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.95547972300767, 43.141234471579239 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 1, "Incident Number": 103330075, "Date": "11\/29\/2010", "Time": "12:29 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.142692, -87.956732 ], "Address": "6864 N DARIEN ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 0, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 1, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 6, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.95673217897118, 43.14269243167027 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 2, "Incident Number": 103310054, "Date": "11\/27\/2010", "Time": "11:54 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.111108, -87.951570 ], "Address": "5163 N 31ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 2, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.951570132003951, 43.111107586733226 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 3, "Incident Number": 103280154, "Date": "11\/24\/2010", "Time": "09:32 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.094825, -87.925830 ], "Address": "4240 N GREEN BAY AV", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.925830436263183, 43.094825077442394 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 4, "Incident Number": 103270046, "Date": "11\/23\/2010", "Time": "10:04 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.111995, -87.960129 ], "Address": "3800 W VILLARD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.960129274719549, 43.111995274719554 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 5, "Incident Number": 103260018, "Date": "11\/22\/2010", "Time": "01:26 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.092135, -87.946872 ], "Address": "4120 N 27TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.946872393531265, 43.092134884817369 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 6, "Incident Number": 103260064, "Date": "11\/22\/2010", "Time": "11:41 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.104746, -87.976893 ], "Address": "5110 W HAMPTON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.976892755756253, 43.104746460470757 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 7, "Incident Number": 103260086, "Date": "11\/22\/2010", "Time": "01:39 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.100316, -87.938238 ], "Address": "4565 N 21ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.938238124790587, 43.100315528449414 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 8, "Incident Number": 103260176, "Date": "11\/22\/2010", "Time": "08:59 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.105059, -87.944159 ], "Address": "4825 N 25TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.944159150325802, 43.105058947544592 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 9, "Incident Number": 103250131, "Date": "11\/21\/2010", "Time": "07:30 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.104476, -87.937241 ], "Address": "2000 W HAMPTON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.9372405, 43.104476460470757 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 10, "Incident Number": 103250172, "Date": "11\/21\/2010", "Time": "11:28 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.105290, -87.939211 ], "Address": "4852 N 22ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.93921073740357, 43.105290212410488 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 11, "Incident Number": 103230067, "Date": "11\/19\/2010", "Time": "11:38 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.102962, -87.945780 ], "Address": "4730 N TEUTONIA AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.945780053234827, 43.10296169499096 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 12, "Incident Number": 103220010, "Date": "11\/18\/2010", "Time": "01:32 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.104476, -87.937843 ], "Address": "2030 W HAMPTON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.937843080904841, 43.104476460470757 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 13, "Incident Number": 103210075, "Date": "11\/17\/2010", "Time": "01:58 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.100323, -87.938096 ], "Address": "2040 W CORNELL ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.938095767413031, 43.100322848779207 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 14, "Incident Number": 103200098, "Date": "11\/16\/2010", "Time": "03:14 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.145527, -87.965702 ], "Address": "7027 N 43RD ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 0, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 0, "g_clusterK7": 6, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.965701665329448, 43.145527096860782 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 15, "Incident Number": 103180174, "Date": "11\/14\/2010", "Time": "10:22 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.096257, -87.930569 ], "Address": "4365 N 16TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.930568569824999, 43.096257199001684 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 16, "Incident Number": 103180180, "Date": "11\/14\/2010", "Time": "11:05 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.108794, -87.942799 ], "Address": "5019 N 24TH PL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.942799092041994, 43.108794031363601 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 17, "Incident Number": 103170018, "Date": "11\/13\/2010", "Time": "02:27 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.097195, -87.927469 ], "Address": "4401 N GREEN BAY AV", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.927469290062717, 43.097194729384334 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 18, "Incident Number": 103170054, "Date": "11\/13\/2010", "Time": "07:39 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.089634, -87.934653 ], "Address": "1902 W CAPITOL DR", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 3, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.934653471550575, 43.089634486005963 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 19, "Incident Number": 103160084, "Date": "11\/12\/2010", "Time": "02:34 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.104802, -87.952823 ], "Address": "4810 N 32ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.952823455522804, 43.104801791156483 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 20, "Incident Number": 103160128, "Date": "11\/12\/2010", "Time": "06:47 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.092414, -87.943404 ], "Address": "4142 N 24TH PL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.943404407957999, 43.092414220093502 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 21, "Incident Number": 103170002, "Date": "11\/12\/2010", "Time": "11:45 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.095346, -87.944578 ], "Address": "4305 N 25TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.944577588146871, 43.095346082434041 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 22, "Incident Number": 103140026, "Date": "11\/10\/2010", "Time": "06:05 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.107292, -87.949732 ], "Address": "2918 W CAMERON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.949732080904838, 43.107292486005974 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 23, "Incident Number": 103140168, "Date": "11\/10\/2010", "Time": "08:42 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.111189, -87.939034 ], "Address": "5160 N 22ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.939034037289346, 43.111189169452551 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 24, "Incident Number": 103120072, "Date": "11\/08\/2010", "Time": "09:17 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.113977, -87.957553 ], "Address": "5304 N 36TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.957553360782697, 43.113977413266781 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 25, "Incident Number": 103110152, "Date": "11\/07\/2010", "Time": "09:45 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.119022, -87.955285 ], "Address": "3415 W SILVER SPRING DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.955285440147009, 43.119022432909269 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 26, "Incident Number": 103090010, "Date": "11\/05\/2010", "Time": "01:36 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.113977, -87.957553 ], "Address": "5304 N 36TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.957553360782697, 43.113977413266781 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 27, "Incident Number": 103090044, "Date": "11\/05\/2010", "Time": "10:45 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.147729, -87.964301 ], "Address": "7155 N 42ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 0, "m_clusterK5": 2, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 0, "g_clusterK7": 6, "m_clusterK7": 0, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.964301363996938, 43.147728870349326 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 28, "Incident Number": 103050099, "Date": "11\/01\/2010", "Time": "01:12 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.098136, -87.948059 ], "Address": "2800 W ATKINSON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.948058735931809, 43.098135998143093 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 29, "Incident Number": 103340142, "Date": "11\/30\/2010", "Time": "06:04 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.089878, -87.999093 ], "Address": "6927 W CAPITOL DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.999093167638065, 43.089878495672174 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 30, "Incident Number": 103340153, "Date": "11\/30\/2010", "Time": "07:28 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.068555, -87.977424 ], "Address": "2722 N 51ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.977423867996052, 43.068555136274455 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 31, "Incident Number": 103330217, "Date": "11\/29\/2010", "Time": "11:33 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.069913, -87.977392 ], "Address": "2802 N 51ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.977392367996046, 43.069913413266789 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 32, "Incident Number": 103300035, "Date": "11\/26\/2010", "Time": "05:40 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.045996, -87.981956 ], "Address": "5425 W MARTIN DR", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 5, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 5, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 3, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.981956246725233, 43.045995973051141 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 33, "Incident Number": 103300076, "Date": "11\/26\/2010", "Time": "11:39 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.085024, -88.007175 ], "Address": "3722 N 76TH ST #9", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 2, "m_clusterK5": 0, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.007175400744643, 43.08502385789717 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 34, "Incident Number": 103300168, "Date": "11\/26\/2010", "Time": "08:50 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.062354, -87.981961 ], "Address": "2377 N 55TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.981960580933503, 43.062354 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 35, "Incident Number": 103280015, "Date": "11\/24\/2010", "Time": "04:06 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.073954, -87.983024 ], "Address": "3020 N 56TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.98302387910455, 43.07395441326679 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 36, "Incident Number": 103280028, "Date": "11\/24\/2010", "Time": "09:14 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.088723, -88.003318 ], "Address": "7311 W APPLETON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.003317751608236, 43.088722588322163 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 37, "Incident Number": 103280091, "Date": "11\/24\/2010", "Time": "03:41 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.038912, -87.970039 ], "Address": "4500 W WISCONSIN AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.970038791890119, 43.038911973541886 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 38, "Incident Number": 103250141, "Date": "11\/21\/2010", "Time": "07:52 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.073236, -87.980911 ], "Address": "2971 N 54TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.980911106468724, 43.073235586733233 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 39, "Incident Number": 103240091, "Date": "11\/20\/2010", "Time": "01:17 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.065394, -87.978616 ], "Address": "2560 N 52ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.978616315170925, 43.065393850726934 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 40, "Incident Number": 103220044, "Date": "11\/18\/2010", "Time": "10:05 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.075403, -88.003383 ], "Address": "7240 W BURLEIGH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.003382642102835, 43.075402500432702 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 41, "Incident Number": 103170186, "Date": "11\/13\/2010", "Time": "11:28 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.076691, -87.974859 ], "Address": "3167 N 49TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.974858606468729, 43.076690612268465 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 42, "Incident Number": 103140132, "Date": "11\/10\/2010", "Time": "04:50 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.075403, -88.003383 ], "Address": "7240 W BURLEIGH ST #3", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.003382642102835, 43.075402500432702 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 43, "Incident Number": 103100021, "Date": "11\/06\/2010", "Time": "06:21 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.063647, -87.978983 ], "Address": "5211 W LISBON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.978983426048714, 43.063647266980347 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 44, "Incident Number": 103100022, "Date": "11\/06\/2010", "Time": "12:52 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.063647, -87.978983 ], "Address": "5211 W LISBON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.978983426048714, 43.063647266980347 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 45, "Incident Number": 103080047, "Date": "11\/04\/2010", "Time": "11:08 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.033702, -88.007136 ], "Address": "304 N 76TH ST", "e_clusterK2": 1, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 0, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 5, "g_clusterK6": 3, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 2, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 6, "m_clusterK8": 3, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -88.007135651856203, 43.033702164796935 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 46, "Incident Number": 103060147, "Date": "11\/02\/2010", "Time": "08:53 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.067921, -87.980195 ], "Address": "5325 W CENTER ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.980195396162443, 43.067920832932757 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 47, "Incident Number": 103050061, "Date": "11\/01\/2010", "Time": "10:37 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.068082, -87.987110 ], "Address": "5920 W CENTER ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.987110223007676, 43.068082471579245 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 48, "Incident Number": 103320012, "Date": "11\/28\/2010", "Time": "01:54 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.974111, -87.953210 ], "Address": "3894 S MINER ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.953209515557759, 42.974111082226777 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 49, "Incident Number": 103310151, "Date": "11\/27\/2010", "Time": "10:31 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.988278, -87.985380 ], "Address": "5703 W OKLAHOMA AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 4, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.985379540535376, 42.988277882245292 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 50, "Incident Number": 103310163, "Date": "11\/27\/2010", "Time": "11:39 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.982712, -87.947021 ], "Address": "3413 S 26TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.947020548184923, 42.982712276992316 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 51, "Incident Number": 103300088, "Date": "11\/26\/2010", "Time": "01:11 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.985736, -87.955408 ], "Address": "3267 W LAKEFIELD DR", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.955408265912467, 42.985735943360986 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 52, "Incident Number": 103290046, "Date": "11\/25\/2010", "Time": "01:38 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.987418, -88.003066 ], "Address": "7230 W LAKEFIELD DR", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 4, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -88.003065794044772, 42.987418437705479 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 53, "Incident Number": 103280155, "Date": "11\/24\/2010", "Time": "08:51 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.004194, -87.959015 ], "Address": "2222 S 36TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.959014970136948, 43.004194187344922 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 54, "Incident Number": 103250015, "Date": "11\/21\/2010", "Time": "02:09 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.984535, -87.952299 ], "Address": "3330 S 30TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.952298651361332, 42.984534995994537 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 55, "Incident Number": 103190149, "Date": "11\/15\/2010", "Time": "06:46 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.984705, -87.948466 ], "Address": "3333 S 27TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.948466383970114, 42.984705397388694 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 56, "Incident Number": 103070089, "Date": "11\/03\/2010", "Time": "02:17 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.981738, -87.956894 ], "Address": "3454 S 34TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.956893652238705, 42.981738311327483 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 57, "Incident Number": 103070111, "Date": "11\/03\/2010", "Time": "04:23 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.984891, -87.948438 ], "Address": "3355 S 27TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.948437518897848, 42.984890912488318 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 58, "Incident Number": 103070174, "Date": "11\/03\/2010", "Time": "09:38 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.981120, -87.949373 ], "Address": "2701 W MORGAN AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.949373470973669, 42.981119531738969 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 59, "Incident Number": 103330034, "Date": "11\/29\/2010", "Time": "07:30 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.998959, -87.928611 ], "Address": "2501 S 13TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 3, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.928611048184919, 42.998958922009365 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 60, "Incident Number": 103320120, "Date": "11\/28\/2010", "Time": "05:01 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.001281, -87.929010 ], "Address": "1314 W HAYES AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.929009580904832, 43.001281486005979 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 61, "Incident Number": 103320154, "Date": "11\/28\/2010", "Time": "08:33 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.007463, -87.917706 ], "Address": "2034 S 5TH PL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.91770592296163, 43.007462664723874 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 62, "Incident Number": 103310120, "Date": "11\/27\/2010", "Time": "07:19 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.017300, -87.919733 ], "Address": "1332 S 7TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.919733455133297, 43.0173 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 63, "Incident Number": 103280004, "Date": "11\/24\/2010", "Time": "01:11 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.997663, -87.930590 ], "Address": "1416 W HARRISON AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.930589887731543, 42.997662511541193 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 64, "Incident Number": 103280072, "Date": "11\/24\/2010", "Time": "01:09 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.014082, -87.923354 ], "Address": "921 W LAPHAM BL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.9233535, 43.014081532315899 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 65, "Incident Number": 103260017, "Date": "11\/22\/2010", "Time": "01:42 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.008064, -87.928214 ], "Address": "2004 S 13TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.928213528420756, 43.008064155981316 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 66, "Incident Number": 103250047, "Date": "11\/21\/2010", "Time": "06:57 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.020087, -87.936520 ], "Address": "1829 W WASHINGTON ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 0, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.936520080904842, 43.020086543424412 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 67, "Incident Number": 103240126, "Date": "11\/20\/2010", "Time": "06:15 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.000802, -87.931194 ], "Address": "2420 S 15TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.931194477350303, 43.0008024970858 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 68, "Incident Number": 103220135, "Date": "11\/18\/2010", "Time": "08:25 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.007360, -87.922271 ], "Address": "825 W ALMA ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.922270948929551, 43.007359506780681 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 69, "Incident Number": 103220143, "Date": "11\/18\/2010", "Time": "09:12 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.024137, -87.915354 ], "Address": "700 S 4TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.915353651758195, 43.024136651758219 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 70, "Incident Number": 103210032, "Date": "11\/17\/2010", "Time": "08:19 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.015807, -87.925432 ], "Address": "1505 S 11TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.92543151875455, 43.015807005828378 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 71, "Incident Number": 103210090, "Date": "11\/17\/2010", "Time": "03:54 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.006678, -87.918672 ], "Address": "2072 S 6TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.918672470136954, 43.006678491257446 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 72, "Incident Number": 103210094, "Date": "11\/17\/2010", "Time": "04:05 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.016595, -87.938028 ], "Address": "1440 S 20TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.938028419574266, 43.016594857320229 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 73, "Incident Number": 103200040, "Date": "11\/16\/2010", "Time": "08:47 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.004678, -87.928771 ], "Address": "1314 W GRANT ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.928771164723869, 43.004677514859424 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 74, "Incident Number": 103190043, "Date": "11\/15\/2010", "Time": "09:13 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": "THEFT FROM MOTOR VEHICLE", "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.006843, -87.920049 ], "Address": "2063 S 7TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.920049062611639, 43.006842754371291 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 75, "Incident Number": 103190069, "Date": "11\/15\/2010", "Time": "11:39 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.018090, -87.926004 ], "Address": "1116 W MADISON ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.926003664723865, 43.018089504327826 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 76, "Incident Number": 103190123, "Date": "11\/15\/2010", "Time": "04:49 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.017003, -87.928321 ], "Address": "1315 W GREENFIELD AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.928320776992322, 43.017002510098898 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 77, "Incident Number": 103190158, "Date": "11\/15\/2010", "Time": "07:31 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.008957, -87.933749 ], "Address": "1645 W FOREST HOME AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.933749320284264, 43.008956801538439 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 78, "Incident Number": 103170091, "Date": "11\/13\/2010", "Time": "01:11 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.021755, -87.930496 ], "Address": "914 S 15TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.930495959605366, 43.021755 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 79, "Incident Number": 103160067, "Date": "11\/12\/2010", "Time": "01:22 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.009154, -87.926976 ], "Address": "1946 S 12TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.926976484563667, 43.009153826533549 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 80, "Incident Number": 103160114, "Date": "11\/12\/2010", "Time": "05:09 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.013709, -87.934199 ], "Address": "1611 S 17TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.934199011541182, 43.013709366639745 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 81, "Incident Number": 103150161, "Date": "11\/11\/2010", "Time": "09:42 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.017064, -87.929694 ], "Address": "1408-B W GREENFIELD AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.929693832361934, 43.01706350432783 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 82, "Incident Number": 103110033, "Date": "11\/07\/2010", "Time": "08:25 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.018897, -87.919806 ], "Address": "1213 S 7TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.91980628309301, 43.018896580485922 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 83, "Incident Number": 103090114, "Date": "11\/05\/2010", "Time": "03:39 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.019139, -87.925821 ], "Address": "1132 W SCOTT ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.925821032301869, 43.01913904167106 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 84, "Incident Number": 103090116, "Date": "11\/05\/2010", "Time": "04:01 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.014082, -87.923354 ], "Address": "921 W LAPHAM BL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.9233535, 43.014081532315899 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 85, "Incident Number": 103060069, "Date": "11\/02\/2010", "Time": "12:10 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.016986, -87.927183 ], "Address": "1209 W GREENFIELD AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.927183167638063, 43.016985546742632 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 86, "Incident Number": 103050046, "Date": "11\/01\/2010", "Time": "09:38 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.023242, -87.906702 ], "Address": "354 E NATIONAL AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.906701923394323, 43.023242482110845 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 87, "Incident Number": 103340029, "Date": "11\/30\/2010", "Time": "08:02 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.001414, -87.934474 ], "Address": "2370 S 17TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.934474499567315, 43.001413742714533 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 88, "Incident Number": 103340043, "Date": "11\/30\/2010", "Time": "08:25 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.999107, -87.937060 ], "Address": "2508 S 19TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.937060093625988, 42.999107139820858 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 89, "Incident Number": 103320128, "Date": "11\/28\/2010", "Time": "05:39 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.979579, -87.946904 ], "Address": "2536 W WARNIMONT AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.946904251197296, 42.979579016417269 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 90, "Incident Number": 103320177, "Date": "11\/28\/2010", "Time": "10:11 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.930484, -87.942770 ], "Address": "2210 W COLLEGE AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.942769819180043, 42.930484270096592 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 91, "Incident Number": 103320179, "Date": "11\/28\/2010", "Time": "10:48 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.003557, -87.934480 ], "Address": "2251 S 17TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.934480022649694, 43.003557282820708 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 92, "Incident Number": 103310145, "Date": "11\/27\/2010", "Time": "09:53 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.960886, -87.943756 ], "Address": "4575 S 23RD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.943755831842338, 42.960886174880095 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 93, "Incident Number": 103280170, "Date": "11\/24\/2010", "Time": "11:16 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.973874, -87.931773 ], "Address": "1508 W HOWARD AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.931772832361929, 42.973874474897478 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 94, "Incident Number": 103270148, "Date": "11\/23\/2010", "Time": "02:28 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.006571, -87.936615 ], "Address": "1837 W BECHER ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.936614863725538, 43.006570513994035 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 95, "Incident Number": 103270174, "Date": "11\/23\/2010", "Time": "08:50 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.980992, -87.922359 ], "Address": "821 W MORGAN AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.922359220093483, 42.980991539529263 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 96, "Incident Number": 103270190, "Date": "11\/23\/2010", "Time": "09:49 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.985224, -87.933860 ], "Address": "3257 S 16TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.933859848632579, 42.985224 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 97, "Incident Number": 103260115, "Date": "11\/22\/2010", "Time": "04:32 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.003043, -87.935598 ], "Address": "1800 W LINCOLN AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.935598006443271, 43.003042705318954 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 98, "Incident Number": 103260130, "Date": "11\/22\/2010", "Time": "05:42 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.996727, -87.937880 ], "Address": "1920 W WINDLAKE AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 1, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.937879552455428, 42.996727486005966 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 99, "Incident Number": 103190017, "Date": "11\/15\/2010", "Time": "07:11 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.998625, -87.937084 ], "Address": "2526 S 19TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.937083940706572, 42.998625303912519 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 100, "Incident Number": 103180018, "Date": "11\/14\/2010", "Time": "03:34 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.981081, -87.933464 ], "Address": "1577 W MORGAN AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.933464444630388, 42.981080502885547 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 101, "Incident Number": 103160102, "Date": "11\/12\/2010", "Time": "05:09 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.935381, -87.936735 ], "Address": "6038 S 18TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.93673499509525, 42.935381413266782 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 102, "Incident Number": 103100049, "Date": "11\/06\/2010", "Time": "09:25 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.997698, -87.937179 ], "Address": "2575 S 19TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.937179048184916, 42.997697696087471 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 103, "Incident Number": 103320009, "Date": "11\/28\/2010", "Time": "01:25 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.988324, -87.920654 ], "Address": "702 W OKLAHOMA AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.920653667638064, 42.988323518754562 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 104, "Incident Number": 103310086, "Date": "11\/27\/2010", "Time": "03:20 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.997293, -87.899369 ], "Address": "2611 S KINNICKINNIC AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.899369126871633, 42.99729321697685 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 105, "Incident Number": 103300159, "Date": "11\/26\/2010", "Time": "08:22 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.002911, -87.900440 ], "Address": "711 E LINCOLN AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 3, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.900439803912519, 43.00291052120739 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 106, "Incident Number": 103280024, "Date": "11\/24\/2010", "Time": "08:23 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.004368, -87.901572 ], "Address": "2201 S WINCHESTER ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 3, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.901571541548464, 43.004367838190319 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 107, "Incident Number": 103280038, "Date": "11\/24\/2010", "Time": "10:05 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.989783, -87.878429 ], "Address": "3000 S WENTWORTH AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.878429325408376, 42.989782765768254 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 108, "Incident Number": 103270038, "Date": "11\/23\/2010", "Time": "09:11 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.997239, -87.920032 ], "Address": "2610 S 7TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.920032466241807, 42.9972387171793 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 109, "Incident Number": 103260053, "Date": "11\/22\/2010", "Time": "09:43 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.983864, -87.894390 ], "Address": "3333 S CLEMENT AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.894389538807175, 42.983864308355912 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 110, "Incident Number": 103260138, "Date": "11\/22\/2010", "Time": "05:28 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.003990, -87.905155 ], "Address": "2223 S KINNICKINNIC AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 3, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.905155262854052, 43.003989660828744 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 111, "Incident Number": 103230077, "Date": "11\/19\/2010", "Time": "01:34 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.997051, -87.898601 ], "Address": "2640 S KINNICKINNIC AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.89860108817139, 42.997051077258753 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 112, "Incident Number": 103200146, "Date": "11\/16\/2010", "Time": "07:37 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.987735, -87.902803 ], "Address": "3120 S ADAMS AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.902803437388357, 42.987734832361951 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 113, "Incident Number": 103180001, "Date": "11\/14\/2010", "Time": "12:01 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.002643, -87.903979 ], "Address": "2306 S KINNICKINNIC AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 3, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.903978670667826, 43.002642656125531 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 114, "Incident Number": 103170013, "Date": "11\/13\/2010", "Time": "01:33 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.001914, -87.903457 ], "Address": "2353 S KINNICKINNIC AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 3, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 1, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.903456829332171, 43.001914391049787 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 115, "Incident Number": 103170036, "Date": "11\/13\/2010", "Time": "06:01 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.997012, -87.914135 ], "Address": "2624 S 3RD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.914135495672156, 42.997012239800341 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 116, "Incident Number": 103160132, "Date": "11\/12\/2010", "Time": "07:25 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.991478, -87.928703 ], "Address": "2916 S 13TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.928703426279853, 42.991478245628713 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 117, "Incident Number": 103130048, "Date": "11\/09\/2010", "Time": "10:09 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.995597, -87.901182 ], "Address": "609 E RUSSELL AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.901182167638055, 42.995597481245447 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 118, "Incident Number": 103120182, "Date": "11\/08\/2010", "Time": "08:41 PM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.979586, -87.908500 ], "Address": "3555 S HOWELL AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.908499887904441, 42.979585607853714 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 119, "Incident Number": 103110031, "Date": "11\/07\/2010", "Time": "07:44 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.994287, -87.932628 ], "Address": "2763 S 15TH PL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.932627537076414, 42.994286612268439 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 120, "Incident Number": 103060033, "Date": "11\/02\/2010", "Time": "08:58 AM", "Police District": 6.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.986647, -87.919178 ], "Address": "3173 S 6TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 4, "g_clusterK7": 4, "m_clusterK7": 4, "e_clusterK8": 2, "g_clusterK8": 2, "m_clusterK8": 2, "e_clusterK9": 0, "g_clusterK9": 0, "m_clusterK9": 0, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.919177555398278, 42.986646838190325 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 121, "Incident Number": 103340079, "Date": "11\/30\/2010", "Time": "12:19 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.069477, -87.923002 ], "Address": "908 W HADLEY ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.923001829447742, 43.069477493219331 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 122, "Incident Number": 103340197, "Date": "11\/30\/2010", "Time": "11:43 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.067981, -87.964474 ], "Address": "2700 N 41ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 4, "g_clusterK9": 1, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.964474063472991, 43.067980735036656 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 123, "Incident Number": 103350144, "Date": "11\/30\/2010", "Time": "09:45 PM", "Police District": 3.0, "Offense 1": "DISORDERLY CONDUCT", "Offense 2": "MOTOR VEHICLE THEFT", "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.052354, -87.962243 ], "Address": "3819 W WALNUT ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.9622425, 43.052354488458803 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 124, "Incident Number": 103330160, "Date": "11\/29\/2010", "Time": "06:05 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.054303, -87.926952 ], "Address": "1808 N 12TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.926951502502973, 43.054302664108967 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 125, "Incident Number": 103310012, "Date": "11\/27\/2010", "Time": "02:22 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.063271, -87.938724 ], "Address": "2440 N 21ST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.938724386317915, 43.06327141326679 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 126, "Incident Number": 103310074, "Date": "11\/27\/2010", "Time": "01:43 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.070760, -87.921449 ], "Address": "2859 N 8TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.921449080933499, 43.07076 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 127, "Incident Number": 103300032, "Date": "11\/26\/2010", "Time": "04:07 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.064295, -87.949991 ], "Address": "2900 W WRIGHT ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.949990714006134, 43.064295214006151 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 128, "Incident Number": 103300039, "Date": "11\/26\/2010", "Time": "07:44 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.062570, -87.961023 ], "Address": "2402 N 38TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.961022860782691, 43.06256983236193 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 129, "Incident Number": 103300043, "Date": "11\/26\/2010", "Time": "08:35 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.059300, -87.957632 ], "Address": "3500 W GARFIELD AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.957631707657015, 43.059300207657017 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 130, "Incident Number": 103280039, "Date": "11\/24\/2010", "Time": "08:02 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.051452, -87.961697 ], "Address": "3851 W GALENA ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.961697370507565, 43.051452447283289 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 131, "Incident Number": 103280171, "Date": "11\/24\/2010", "Time": "11:17 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.058744, -87.925559 ], "Address": "2137 N 11TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.925558617577224, 43.058744360811346 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 132, "Incident Number": 103270058, "Date": "11\/23\/2010", "Time": "11:02 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.057880, -87.953451 ], "Address": "3132 W LLOYD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.953450642102837, 43.057879500432691 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 133, "Incident Number": 103270113, "Date": "11\/23\/2010", "Time": "04:26 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.064139, -87.950495 ], "Address": "2995 W WRIGHT ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.950495404747784, 43.064138785993876 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 134, "Incident Number": 103260032, "Date": "11\/22\/2010", "Time": "08:43 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.053985, -87.945158 ], "Address": "1835 N 25TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.945157632003955, 43.053984670552268 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 135, "Incident Number": 103250149, "Date": "11\/21\/2010", "Time": "08:56 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.052712, -87.944261 ], "Address": "2459 W WALNUT ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.944260667638062, 43.052711543424408 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 136, "Incident Number": 103250177, "Date": "11\/21\/2010", "Time": "11:50 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.067646, -87.968801 ], "Address": "2673 N 44TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.968800632003948, 43.067646335276123 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 137, "Incident Number": 103240077, "Date": "11\/20\/2010", "Time": "12:08 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.064073, -87.976196 ], "Address": "2476 N 50TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.976196364100915, 43.064073 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 138, "Incident Number": 103240119, "Date": "11\/20\/2010", "Time": "03:17 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.067561, -87.924226 ], "Address": "1011 W CENTER ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.924225954582923, 43.067561455570122 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 139, "Incident Number": 103220099, "Date": "11\/18\/2010", "Time": "03:55 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.063983, -87.942422 ], "Address": "2474 N 24TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.942421765597373, 43.063983237280631 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 140, "Incident Number": 103210012, "Date": "11\/17\/2010", "Time": "01:01 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.059699, -87.962266 ], "Address": "2216 N 39TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.962265919066496, 43.059698664723868 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 141, "Incident Number": 103190028, "Date": "11\/15\/2010", "Time": "08:13 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.071339, -87.937862 ], "Address": "2011 W LOCUST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 4, "g_clusterK6": 3, "m_clusterK6": 4, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 4, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.93786185122606, 43.071338776839099 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 142, "Incident Number": 103190178, "Date": "11\/15\/2010", "Time": "08:05 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.044466, -87.961931 ], "Address": "3939 W HIGHLAND BL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.961931481678135, 43.044465535057199 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 143, "Incident Number": 103180060, "Date": "11\/14\/2010", "Time": "11:21 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.053524, -87.954046 ], "Address": "1730 N 32ND ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.954046389636133, 43.053524497085817 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 144, "Incident Number": 103170057, "Date": "11\/13\/2010", "Time": "09:55 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.069256, -87.960914 ], "Address": "2762 N 38TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 5, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 3, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 1, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.960913886317911, 43.069255742714518 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 145, "Incident Number": 103170076, "Date": "11\/13\/2010", "Time": "11:50 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.061078, -87.945047 ], "Address": "2323 N 25TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.945046972720689, 43.061078080097658 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 146, "Incident Number": 103170164, "Date": "11\/13\/2010", "Time": "09:56 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.052354, -87.962243 ], "Address": "3819 W WALNUT ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.9622425, 43.052354488458803 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 147, "Incident Number": 103160026, "Date": "11\/12\/2010", "Time": "08:44 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.059420, -87.972418 ], "Address": "2207 N 47TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 5, "g_clusterK6": 3, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 3, "g_clusterK8": 6, "m_clusterK8": 3, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.972417573720136, 43.059419580904859 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 148, "Incident Number": 103160038, "Date": "11\/12\/2010", "Time": "09:55 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.067087, -87.968811 ], "Address": "2645 N 44TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.968810606468722, 43.067087444630374 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 149, "Incident Number": 103150051, "Date": "11\/11\/2010", "Time": "10:55 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.060741, -87.945071 ], "Address": "2500 W NORTH AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.945071085722603, 43.060741304016787 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 150, "Incident Number": 103120139, "Date": "11\/08\/2010", "Time": "05:21 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.062913, -87.959901 ], "Address": "2419 N 37TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.959900606468722, 43.062912586733233 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 151, "Incident Number": 103110084, "Date": "11\/07\/2010", "Time": "12:36 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.067947, -87.956990 ], "Address": "3420 W CENTER ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.956990497085812, 43.06794651875456 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 152, "Incident Number": 103100074, "Date": "11\/06\/2010", "Time": "09:09 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.055568, -87.946275 ], "Address": "1926 N 26TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.946275386317922, 43.0555684715506 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 153, "Incident Number": 103100154, "Date": "11\/06\/2010", "Time": "08:34 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.051788, -87.957596 ], "Address": "1610 N 35TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.957595893531277, 43.051788 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 154, "Incident Number": 103090054, "Date": "11\/05\/2010", "Time": "11:16 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.059276, -87.965786 ], "Address": "2202 N 42ND ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.965785915171367, 43.059276115182655 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 155, "Incident Number": 103080060, "Date": "11\/04\/2010", "Time": "12:30 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.059179, -87.931349 ], "Address": "2200 N 15TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.931348669271742, 43.05917912059661 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 156, "Incident Number": 103080106, "Date": "11\/04\/2010", "Time": "05:37 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.063721, -87.977455 ], "Address": "2462 N 51ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.977455389636134, 43.063721497085822 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 157, "Incident Number": 103070119, "Date": "11\/03\/2010", "Time": "05:14 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.057418, -87.966919 ], "Address": "4238 W LISBON AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.966918749783645, 43.057417598130186 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 158, "Incident Number": 103060146, "Date": "11\/02\/2010", "Time": "05:52 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.060371, -87.932835 ], "Address": "1613 W NORTH AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.932835212306358, 43.060370869066936 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 159, "Incident Number": 103060172, "Date": "11\/02\/2010", "Time": "11:29 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.069267, -87.937520 ], "Address": "2769 N 20TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 2, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.937519555398268, 43.06926700582838 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 160, "Incident Number": 103050082, "Date": "11\/01\/2010", "Time": "11:58 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.060495, -87.934513 ], "Address": "1730 W NORTH AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.9345135, 43.06049451875456 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 161, "Incident Number": 103050083, "Date": "11\/01\/2010", "Time": "11:59 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.060495, -87.934513 ], "Address": "1730 W NORTH AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.9345135, 43.06049451875456 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 162, "Incident Number": 103050087, "Date": "11\/01\/2010", "Time": "12:19 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.058025, -87.956296 ], "Address": "2100 N 34TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.956295911853132, 43.05802474854292 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 163, "Incident Number": 103330138, "Date": "11\/29\/2010", "Time": "03:45 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.133425, -88.015532 ], "Address": "6352 N 84TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.015532400167714, 43.133425103525894 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 164, "Incident Number": 103310003, "Date": "11\/27\/2010", "Time": "12:19 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.100146, -88.001864 ], "Address": "4544 N 72ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 2, "m_clusterK5": 0, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.001863886317921, 43.10014558673322 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 165, "Incident Number": 103310100, "Date": "11\/27\/2010", "Time": "04:34 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.122903, -88.030706 ], "Address": "5772 N 95TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.030706419066505, 43.122903432973629 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 166, "Incident Number": 103310138, "Date": "11\/27\/2010", "Time": "08:58 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.090027, -87.977129 ], "Address": "5100 W CAPITOL DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.977129146132881, 43.090027319263378 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 167, "Incident Number": 103310148, "Date": "11\/27\/2010", "Time": "10:09 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.112266, -88.012480 ], "Address": "8120 W VILLARD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.0124805, 43.11226550432783 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 168, "Incident Number": 103300149, "Date": "11\/26\/2010", "Time": "06:59 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.105769, -88.008679 ], "Address": "7661 W LUSCHER AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.008679097709916, 43.105768584392813 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 169, "Incident Number": 103300154, "Date": "11\/26\/2010", "Time": "07:02 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.105081, -88.009222 ], "Address": "7724 W HAMPTON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.009222416180961, 43.105081493219338 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 170, "Incident Number": 103280096, "Date": "11\/24\/2010", "Time": "04:02 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.090066, -87.988433 ], "Address": "6100 W CAPITOL DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.9884325, 43.090066486005981 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 171, "Incident Number": 103270194, "Date": "11\/23\/2010", "Time": "10:06 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.090065, -87.982037 ], "Address": "5500 W CAPITOL DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 3, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.982036682574247, 43.090065102462006 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 172, "Incident Number": 103260016, "Date": "11\/22\/2010", "Time": "02:06 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.099299, -87.995586 ], "Address": "4502 N 67TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.995586386317925, 43.099298884817358 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 173, "Incident Number": 103260031, "Date": "11\/22\/2010", "Time": "07:44 AM", "Police District": 7.0, "Offense 1": "THEFT FROM MOTOR VEHICLE", "Offense 2": "MOTOR VEHICLE THEFT", "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.108490, -88.010131 ], "Address": "7922 W GRANTOSA DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.010130686392614, 43.108490282560908 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 174, "Incident Number": 103260194, "Date": "11\/22\/2010", "Time": "09:36 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.122601, -88.030790 ], "Address": "5759 N 95TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.030789540971554, 43.122600701915871 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 175, "Incident Number": 103250063, "Date": "11\/21\/2010", "Time": "11:34 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.111674, -88.006212 ], "Address": "5153 N 76TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.006211599255352, 43.111674419095152 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 176, "Incident Number": 103250091, "Date": "11\/21\/2010", "Time": "02:31 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.120691, -88.008117 ], "Address": "5644 N 78TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.008117413526577, 43.120690596716535 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 177, "Incident Number": 103250130, "Date": "11\/21\/2010", "Time": "03:30 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.091413, -87.978483 ], "Address": "5241 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 3, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.978483420720352, 43.091412647593977 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 178, "Incident Number": 103250162, "Date": "11\/21\/2010", "Time": "10:23 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.106517, -88.002001 ], "Address": "4871 N 72ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.00200065753917, 43.106516832361933 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 179, "Incident Number": 103240042, "Date": "11\/20\/2010", "Time": "07:53 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.091504, -87.973416 ], "Address": "4070 N 48TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.973416379104549, 43.091503742714536 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 180, "Incident Number": 103230111, "Date": "11\/19\/2010", "Time": "04:18 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.095581, -87.995655 ], "Address": "4302 N 67TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.995654860782693, 43.095581413266785 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 181, "Incident Number": 103230124, "Date": "11\/19\/2010", "Time": "05:44 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.105823, -88.010349 ], "Address": "7833 W LUSCHER AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.010348652922886, 43.105822743811053 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 182, "Incident Number": 103230127, "Date": "11\/19\/2010", "Time": "05:28 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.108227, -88.015948 ], "Address": "4977 N 84TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.015947650325813, 43.108226580904841 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 183, "Incident Number": 103220038, "Date": "11\/18\/2010", "Time": "08:58 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.098093, -87.993103 ], "Address": "4436 N 65TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.993103360782698, 43.098092832361942 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 184, "Incident Number": 103220041, "Date": "11\/18\/2010", "Time": "09:24 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.097227, -88.004780 ], "Address": "7408 W CONGRESS ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 2, "m_clusterK5": 0, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.004780276992321, 43.097226504327828 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 185, "Incident Number": 103220083, "Date": "11\/18\/2010", "Time": "02:09 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.123050, -88.005856 ], "Address": "5772 N 76TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.005855842460818, 43.123049580904848 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 186, "Incident Number": 103220100, "Date": "11\/18\/2010", "Time": "04:26 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.090129, -87.984044 ], "Address": "5670 W CAPITOL DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.984044406341383, 43.090129294285902 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 187, "Incident Number": 103200027, "Date": "11\/16\/2010", "Time": "06:35 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.132311, -88.015566 ], "Address": "6300 N 84TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.015565867996045, 43.132311471550594 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 188, "Incident Number": 103200111, "Date": "11\/16\/2010", "Time": "04:56 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.114355, -88.003519 ], "Address": "5297 N 74TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.003518671965892, 43.114355444630377 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 189, "Incident Number": 103190012, "Date": "11\/15\/2010", "Time": "04:02 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.100484, -87.989521 ], "Address": "6222 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.989520888683842, 43.100483677505814 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 190, "Incident Number": 103190015, "Date": "11\/15\/2010", "Time": "07:00 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.091577, -87.988220 ], "Address": "4071 N 61ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.988219624790574, 43.091577419095159 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 191, "Incident Number": 103190053, "Date": "11\/15\/2010", "Time": "10:20 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.102118, -87.993432 ], "Address": "6518 W MEDFORD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.993431671767027, 43.102117760126411 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 192, "Incident Number": 103190096, "Date": "11\/15\/2010", "Time": "03:18 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.119285, -87.998310 ], "Address": "6929 W SILVER SPRING DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.998310167638067, 43.119284524525632 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 193, "Incident Number": 103190183, "Date": "11\/15\/2010", "Time": "11:01 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.121352, -88.003071 ], "Address": "7329 W THURSTON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.003071167638055, 43.121351538952347 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 194, "Incident Number": 103180075, "Date": "11\/14\/2010", "Time": "12:35 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.115588, -87.993612 ], "Address": "5375 N 66TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.99361159925536, 43.115588245628715 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 195, "Incident Number": 103180141, "Date": "11\/14\/2010", "Time": "06:35 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.124887, -88.009711 ], "Address": "5877 N 79TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.009711106468728, 43.124886586733226 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 196, "Incident Number": 103160029, "Date": "11\/12\/2010", "Time": "07:52 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.133882, -88.022204 ], "Address": "8821 W MILL RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.022204025535217, 43.133881528420758 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 197, "Incident Number": 103150041, "Date": "11\/11\/2010", "Time": "09:03 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.099784, -88.005690 ], "Address": "4529 N 75TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 5, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 5, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.005689599255362, 43.099784413266775 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 198, "Incident Number": 103150135, "Date": "11\/11\/2010", "Time": "07:23 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.098241, -87.987050 ], "Address": "6003 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.987050096889433, 43.098241296958953 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 199, "Incident Number": 103140029, "Date": "11\/10\/2010", "Time": "07:50 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.115365, -88.024798 ], "Address": "9021 W CUSTER AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.024797995343633, 43.115364582430779 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 200, "Incident Number": 103140178, "Date": "11\/10\/2010", "Time": "09:33 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.090134, -87.984393 ], "Address": "5700 W CAPITOL DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.984392972630985, 43.090134401484285 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 201, "Incident Number": 103130018, "Date": "11\/09\/2010", "Time": "01:56 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.112222, -88.009471 ], "Address": "7829 W VILLARD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.009470806826712, 43.112222488458826 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 202, "Incident Number": 103120156, "Date": "11\/08\/2010", "Time": "06:16 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.118503, -88.030454 ], "Address": "9426 W SHERIDAN AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.030453583819025, 43.118502525967912 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 203, "Incident Number": 103100087, "Date": "11\/06\/2010", "Time": "01:55 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.113187, -87.984968 ], "Address": "5253 N 58TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 0, "e_clusterK6": 5, "g_clusterK6": 1, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 6, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 7, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 8, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.984968157539171, 43.113186502914203 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 204, "Incident Number": 103080036, "Date": "11\/04\/2010", "Time": "09:27 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.132331, -88.012134 ], "Address": "8110 W BENDER AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.012134, 43.132331460470745 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 205, "Incident Number": 103070032, "Date": "11\/03\/2010", "Time": "07:38 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.114669, -88.028344 ], "Address": "9316 W APPLETON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.028344421432436, 43.114668735789614 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 206, "Incident Number": 103050011, "Date": "11\/01\/2010", "Time": "01:47 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.098036, -87.988364 ], "Address": "6114 W MEDFORD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.988363749495193, 43.09803584514389 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 207, "Incident Number": 103320086, "Date": "11\/28\/2010", "Time": "11:24 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.070954, -87.886531 ], "Address": "1909 E LOCUST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.886530859445756, 43.070954189562201 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 208, "Incident Number": 103300064, "Date": "11\/26\/2010", "Time": "11:10 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.062957, -87.899252 ], "Address": "2441 N WEIL ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.899251639217297, 43.062957 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 209, "Incident Number": 103300072, "Date": "11\/26\/2010", "Time": "12:25 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.065937, -87.904161 ], "Address": "2609 N BOOTH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.904161055398276, 43.065936754371279 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 210, "Incident Number": 103280080, "Date": "11\/24\/2010", "Time": "01:42 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.074757, -87.901884 ], "Address": "722 E BURLEIGH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.901883580904837, 43.074756533181265 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 211, "Incident Number": 103280168, "Date": "11\/24\/2010", "Time": "11:13 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.062822, -87.885629 ], "Address": "2461 N MURRAY AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.885628847848949, 43.062822077911889 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 212, "Incident Number": 103270009, "Date": "11\/23\/2010", "Time": "12:14 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.063596, -87.896603 ], "Address": "2472 N DOUSMAN ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.896602893531266, 43.063595580904831 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 213, "Incident Number": 103270048, "Date": "11\/23\/2010", "Time": "10:05 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.068781, -87.888370 ], "Address": "1721 E RIVERSIDE PL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.888370248542898, 43.06878054674263 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 214, "Incident Number": 103270094, "Date": "11\/23\/2010", "Time": "03:08 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.075449, -87.901474 ], "Address": "3128 N FRATNEY ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.901473926279849, 43.075448968636408 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 215, "Incident Number": 103260169, "Date": "11\/22\/2010", "Time": "08:28 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.081850, -87.876516 ], "Address": "2701 E EDGEWOOD AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.876516369566787, 43.081850165994183 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 216, "Incident Number": 103210011, "Date": "11\/17\/2010", "Time": "12:22 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.050222, -87.900863 ], "Address": "1538 N MARSHALL ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 2, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.900862879104551, 43.050222052455439 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 217, "Incident Number": 103210085, "Date": "11\/17\/2010", "Time": "03:10 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.064942, -87.881512 ], "Address": "2302 E WEBSTER PL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.881512080904841, 43.064942489324189 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 218, "Incident Number": 103210171, "Date": "11\/17\/2010", "Time": "08:46 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.072595, -87.886633 ], "Address": "2972 N CRAMER ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.886632926279859, 43.072595413266782 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 219, "Incident Number": 103190112, "Date": "11\/15\/2010", "Time": "04:11 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.077696, -87.882753 ], "Address": "2200 E HARTFORD AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.882752768951846, 43.077696231048144 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 220, "Incident Number": 103190154, "Date": "11\/15\/2010", "Time": "07:12 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.070806, -87.878048 ], "Address": "2863 N DOWNER AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.878048073720137, 43.070806341104515 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 221, "Incident Number": 103190160, "Date": "11\/15\/2010", "Time": "08:06 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.072956, -87.885469 ], "Address": "3001 N MURRAY AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.885468573720146, 43.072956167638068 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 222, "Incident Number": 103180013, "Date": "11\/14\/2010", "Time": "02:07 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.067355, -87.886242 ], "Address": "1909 E PARK PL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.886242167638059, 43.067354502885522 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 223, "Incident Number": 103180166, "Date": "11\/14\/2010", "Time": "09:24 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.067602, -87.900447 ], "Address": "2705 N BREMEN ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.900446719348693, 43.067602153976225 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 224, "Incident Number": 103170144, "Date": "11\/13\/2010", "Time": "07:07 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.065099, -87.881870 ], "Address": "2555 N FARWELL AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.881869632003955, 43.065099251457099 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 225, "Incident Number": 103170191, "Date": "11\/13\/2010", "Time": "11:53 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.075456, -87.900281 ], "Address": "3129 N BREMEN ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.900280584251718, 43.075456082434066 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 226, "Incident Number": 103150091, "Date": "11\/11\/2010", "Time": "03:20 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.074721, -87.891493 ], "Address": "3100 N CAMBRIDGE AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.891492818891393, 43.074721482289341 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 227, "Incident Number": 103140028, "Date": "11\/10\/2010", "Time": "07:48 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.071308, -87.901550 ], "Address": "2907 N FRATNEY ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.901549540971544, 43.071307742714538 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 228, "Incident Number": 103140052, "Date": "11\/10\/2010", "Time": "09:58 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.080135, -87.895840 ], "Address": "1212 E TOWNSEND ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.895839913266769, 43.080135442148887 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 229, "Incident Number": 103140066, "Date": "11\/10\/2010", "Time": "11:12 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.081101, -87.886488 ], "Address": "3469 N CRAMER ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.886487606468719, 43.081101282820697 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 230, "Incident Number": 103070029, "Date": "11\/03\/2010", "Time": "07:22 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.054516, -87.898052 ], "Address": "1802 N HUMBOLDT AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.898051967554011, 43.054516423166497 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 231, "Incident Number": 103060047, "Date": "11\/02\/2010", "Time": "10:16 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.047150, -87.908552 ], "Address": "1310 N BROADWAY", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.9085516374777, 43.047149846931731 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 232, "Incident Number": 103060145, "Date": "11\/02\/2010", "Time": "07:24 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.076609, -87.890233 ], "Address": "3242 N NEWHALL ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.89023292627985, 43.076609077990668 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 233, "Incident Number": 103050040, "Date": "11\/01\/2010", "Time": "09:08 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.068032, -87.883014 ], "Address": "2728 N MARYLAND AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.883014407958001, 43.068032413266792 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 234, "Incident Number": 103330035, "Date": "11\/29\/2010", "Time": "08:14 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.048989, -87.946280 ], "Address": "1413 N 26TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.946280102573581, 43.048988863725555 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 235, "Incident Number": 103320085, "Date": "11\/28\/2010", "Time": "01:32 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.043002, -87.914521 ], "Address": "300 W STATE ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 3, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 2, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 6, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.914521217594213, 43.043001651138887 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 236, "Incident Number": 103310038, "Date": "11\/27\/2010", "Time": "09:47 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.044615, -87.933865 ], "Address": "1110 N 17TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 2, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.933865441647669, 43.044614541540604 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 237, "Incident Number": 103310039, "Date": "11\/27\/2010", "Time": "09:48 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.048617, -87.951702 ], "Address": "3035 W VLIET ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.951701955537757, 43.048617116587081 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 238, "Incident Number": 103300093, "Date": "11\/26\/2010", "Time": "01:21 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.044615, -87.933865 ], "Address": "1110 N 17TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 2, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.933865441647669, 43.044614541540604 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 239, "Incident Number": 103300152, "Date": "11\/26\/2010", "Time": "07:32 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.043225, -87.943284 ], "Address": "2419 W STATE ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 2, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.943284, 43.043224528420765 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 240, "Incident Number": 103290014, "Date": "11\/25\/2010", "Time": "03:33 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.047692, -87.952416 ], "Address": "1318 N 31ST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.952416393531266, 43.047692497085819 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 241, "Incident Number": 103290021, "Date": "11\/25\/2010", "Time": "08:18 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.049168, -87.952488 ], "Address": "1419 N 31ST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.952487613682081, 43.049167522621048 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 242, "Incident Number": 103270200, "Date": "11\/23\/2010", "Time": "08:05 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.044958, -87.910863 ], "Address": "1114 N WATER ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.910863272664486, 43.044958016100161 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 243, "Incident Number": 103260083, "Date": "11\/22\/2010", "Time": "01:27 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.038629, -87.948922 ], "Address": "2733 W WISCONSIN AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 2, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.9489225, 43.038628513994041 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 244, "Incident Number": 103260201, "Date": "11\/22\/2010", "Time": "11:47 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.037418, -87.938263 ], "Address": "1215 W MICHIGAN ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.9382625689001, 43.037417819939883 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 245, "Incident Number": 103250062, "Date": "11\/21\/2010", "Time": "11:25 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.045863, -87.955533 ], "Address": "3303 W JUNEAU AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.955533167638066, 43.045862543424391 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 246, "Incident Number": 103230035, "Date": "11\/19\/2010", "Time": "10:17 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.040356, -87.949099 ], "Address": "2800 W WELLS ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.949099264561838, 43.040355598498159 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 247, "Incident Number": 103230094, "Date": "11\/19\/2010", "Time": "02:59 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.045105, -87.932336 ], "Address": "1145 N CALLAHAN PL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 2, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.932336011277329, 43.045105168465533 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 248, "Incident Number": 103200010, "Date": "11\/16\/2010", "Time": "01:13 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.049375, -87.957614 ], "Address": "1426 N 35TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.957613893531274, 43.049375497085805 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 249, "Incident Number": 103180019, "Date": "11\/14\/2010", "Time": "03:43 AM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.044586, -87.910789 ], "Address": "101 E HIGHLAND BL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.910788825289259, 43.044585612252284 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 250, "Incident Number": 103180031, "Date": "11\/14\/2010", "Time": "06:31 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.044463, -87.927831 ], "Address": "1218 W HIGHLAND AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 2, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.927831419095156, 43.044462511541184 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 251, "Incident Number": 103180072, "Date": "11\/14\/2010", "Time": "12:28 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.043859, -87.941590 ], "Address": "1035 N 23RD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 2, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.9415901281088, 43.043859335276125 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 252, "Incident Number": 103180107, "Date": "11\/14\/2010", "Time": "03:31 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.049448, -87.956416 ], "Address": "1430 N 34TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.956415919066501, 43.049447748542917 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 253, "Incident Number": 103170030, "Date": "11\/13\/2010", "Time": "03:27 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.044445, -87.936573 ], "Address": "1924 W HIGHLAND AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 2, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.93657280252755, 43.044445461624591 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 254, "Incident Number": 103120083, "Date": "11\/08\/2010", "Time": "12:20 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.044427, -87.948453 ], "Address": "2725 W HIGHLAND BL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.948452750072121, 43.044426568382697 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 255, "Incident Number": 103120115, "Date": "11\/08\/2010", "Time": "01:38 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.044489, -87.930187 ], "Address": "1400 W HIGHLAND AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 2, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.930187404700263, 43.044489234674941 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 256, "Incident Number": 103110005, "Date": "11\/07\/2010", "Time": "12:20 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.033650, -87.953004 ], "Address": "3109 W MT VERNON AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.953004, 43.033650477350321 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 257, "Incident Number": 103110029, "Date": "11\/07\/2010", "Time": "05:10 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.040311, -87.954153 ], "Address": "3130 W WELLS ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.954152725921873, 43.040311478792596 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 258, "Incident Number": 103110036, "Date": "11\/07\/2010", "Time": "08:58 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.045894, -87.944603 ], "Address": "2464 W JUNEAU AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.9446025, 43.04589351154118 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 259, "Incident Number": 103110044, "Date": "11\/07\/2010", "Time": "09:13 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.045903, -87.950691 ], "Address": "2924 W JUNEAU AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.950691, 43.04590253318127 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 260, "Incident Number": 103110067, "Date": "11\/07\/2010", "Time": "11:22 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.040329, -87.956112 ], "Address": "3330 W WELLS ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.956112463356263, 43.040329478792607 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 261, "Incident Number": 103100026, "Date": "11\/06\/2010", "Time": "02:01 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.043212, -87.946123 ], "Address": "2537 W STATE ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.9461235, 43.043211546742612 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 262, "Incident Number": 103070034, "Date": "11\/03\/2010", "Time": "08:23 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.047275, -87.941650 ], "Address": "2306 W MC KINLEY AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.941650332361931, 43.0472754893242 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 263, "Incident Number": 103060076, "Date": "11\/02\/2010", "Time": "01:05 PM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.040256, -87.951654 ], "Address": "2937 W WELLS ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.951654083819022, 43.040256498990381 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 264, "Incident Number": 103340034, "Date": "11\/30\/2010", "Time": "08:46 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.102434, -88.021615 ], "Address": "8652 W GRANTOSA DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.021615346673087, 43.102434120751226 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 265, "Incident Number": 103340098, "Date": "11\/30\/2010", "Time": "01:52 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.137184, -88.039744 ], "Address": "6605 N BOURBON ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.039744038404066, 43.137184353655321 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 266, "Incident Number": 103330027, "Date": "11\/29\/2010", "Time": "06:01 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.135959, -88.037602 ], "Address": "6524 N BEALE ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.037601915257127, 43.135958969888961 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 267, "Incident Number": 103310154, "Date": "11\/27\/2010", "Time": "10:58 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.115831, -88.055563 ], "Address": "5356 N LOVERS LANE RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.055562858908644, 43.11583055398463 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 268, "Incident Number": 103270025, "Date": "11\/23\/2010", "Time": "06:41 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.104727, -88.051550 ], "Address": "11101 W HAMPTON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.051550139188649, 43.104726546742626 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 269, "Incident Number": 103270052, "Date": "11\/23\/2010", "Time": "10:49 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.119565, -88.041196 ], "Address": "10332 W SILVER SPRING DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.041196105633858, 43.119565409832241 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 270, "Incident Number": 103250089, "Date": "11\/21\/2010", "Time": "02:25 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.096347, -88.026378 ], "Address": "4361 N 91ST ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.026377635322163, 43.096347335276135 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 271, "Incident Number": 103240113, "Date": "11\/20\/2010", "Time": "04:34 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.104846, -88.025149 ], "Address": "9033 W HAMPTON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.025149347321644, 43.104845734190583 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 272, "Incident Number": 103240124, "Date": "11\/20\/2010", "Time": "05:56 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.134705, -88.041474 ], "Address": "6432 N 104TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.041474379104557, 43.134704528449419 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 273, "Incident Number": 103240164, "Date": "11\/20\/2010", "Time": "10:03 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.100597, -88.011155 ], "Address": "7881 W BECKETT AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.011155329332169, 43.100597358301201 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 274, "Incident Number": 103220057, "Date": "11\/18\/2010", "Time": "11:20 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.074206, -88.014863 ], "Address": "3034 N 82ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 3, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 2, "m_clusterK5": 0, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.014862893531273, 43.074206276992328 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 275, "Incident Number": 103210162, "Date": "11\/17\/2010", "Time": "09:19 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.097197, -88.009030 ], "Address": "7716 W CONGRESS ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 5, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 5, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.009029974464767, 43.097197471579236 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 276, "Incident Number": 103200019, "Date": "11\/16\/2010", "Time": "04:29 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.108975, -88.023127 ], "Address": "8875 N POTOMAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.023127226198667, 43.108974848804472 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 277, "Incident Number": 103180175, "Date": "11\/14\/2010", "Time": "10:10 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.117352, -88.054176 ], "Address": "11400 W SILVER SPRING DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.054176231894473, 43.117352391078434 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 278, "Incident Number": 103170111, "Date": "11\/13\/2010", "Time": "02:54 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.137621, -88.038576 ], "Address": "6626 N BOURBON ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.038575519822416, 43.137621286658515 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 279, "Incident Number": 103170173, "Date": "11\/13\/2010", "Time": "10:22 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.089780, -88.007555 ], "Address": "7603 W CAPITOL DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 2, "m_clusterK5": 0, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -88.007555082207986, 43.089779753376021 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 280, "Incident Number": 103140053, "Date": "11\/10\/2010", "Time": "10:06 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.140602, -88.041153 ], "Address": "10406 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.041152700357983, 43.140602260920808 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 281, "Incident Number": 103130148, "Date": "11\/09\/2010", "Time": "07:21 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.068031, -88.009392 ], "Address": "7718 W CENTER ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 0, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 6, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -88.009392221622704, 43.068030504327844 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 282, "Incident Number": 103110056, "Date": "11\/07\/2010", "Time": "10:37 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.092306, -88.042122 ], "Address": "4135 N 104TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.042121599255353, 43.092306 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 283, "Incident Number": 103110146, "Date": "11\/07\/2010", "Time": "09:02 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.096485, -88.041638 ], "Address": "4355 N 104TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.041638078423333, 43.096485451641279 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 284, "Incident Number": 103100152, "Date": "11\/06\/2010", "Time": "09:07 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.137351, -88.042521 ], "Address": "6606 N 105TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.042520951266823, 43.137351469905816 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 285, "Incident Number": 103090165, "Date": "11\/05\/2010", "Time": "10:15 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.119523, -88.039642 ], "Address": "10202 W SILVER SPRING DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.039641525535217, 43.119523461624581 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 286, "Incident Number": 103100025, "Date": "11\/05\/2010", "Time": "11:42 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.139832, -88.040291 ], "Address": "10311 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.04029136237591, 43.139831665387298 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 287, "Incident Number": 103060051, "Date": "11\/02\/2010", "Time": "10:35 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.097317, -88.022476 ], "Address": "4408 N 88TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.022475897426403, 43.097317407438396 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 288, "Incident Number": 103050053, "Date": "11\/01\/2010", "Time": "10:11 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.088090, -88.035017 ], "Address": "9844 W LISBON AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 5, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 5, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 4, "g_clusterK10": 4, "m_clusterK10": 4 }, "geometry": { "type": "Point", "coordinates": [ -88.03501737512083, 43.088090411592567 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 289, "Incident Number": 103340017, "Date": "11\/30\/2010", "Time": "02:09 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.084831, -87.935022 ], "Address": "1914 W NASH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.935021580904845, 43.084831493219333 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 290, "Incident Number": 103340066, "Date": "11\/30\/2010", "Time": "11:11 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.086007, -87.938141 ], "Address": "2033 W VIENNA AV", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.938140919095162, 43.086007499567316 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 291, "Incident Number": 103340152, "Date": "11\/30\/2010", "Time": "07:09 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.075665, -87.918622 ], "Address": "3139 N 6TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.918621588146863, 43.075665167638078 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 292, "Incident Number": 103310075, "Date": "11\/27\/2010", "Time": "01:50 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.088364, -87.917162 ], "Address": "3900 N PORT WASHINGTON AV", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 1, "g_clusterK7": 0, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.917162335247468, 43.088364 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 293, "Incident Number": 103310128, "Date": "11\/27\/2010", "Time": "06:42 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.049296, -87.919250 ], "Address": "619 W KNEELAND ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 4, "e_clusterK6": 2, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 1, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 0, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.91924978265267, 43.049295980795478 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 294, "Incident Number": 103300005, "Date": "11\/26\/2010", "Time": "01:26 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.091433, -87.918398 ], "Address": "4095 N 6TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 0, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.918398164752531, 43.091433 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 295, "Incident Number": 103300007, "Date": "11\/26\/2010", "Time": "01:26 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.067846, -87.913977 ], "Address": "2712 N MARTIN L KING JR DR", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.913976652199935, 43.067846180768456 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 296, "Incident Number": 103300008, "Date": "11\/26\/2010", "Time": "01:09 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.063245, -87.917062 ], "Address": "2449 N 5TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.917061643112447, 43.063245167638058 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 297, "Incident Number": 103290004, "Date": "11\/25\/2010", "Time": "01:17 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.084322, -87.916026 ], "Address": "3716 N 5TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.916026386317924, 43.084321826533568 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 298, "Incident Number": 103290063, "Date": "11\/25\/2010", "Time": "05:43 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.073066, -87.918961 ], "Address": "616 W CHAMBERS ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.918960997085804, 43.073066460470763 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 299, "Incident Number": 103280074, "Date": "11\/24\/2010", "Time": "01:14 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.086133, -87.895154 ], "Address": "1237 E VIENNA AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.895154305845764, 43.086132546742618 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 300, "Incident Number": 103280079, "Date": "11\/24\/2010", "Time": "12:22 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.076773, -87.903989 ], "Address": "3205 N BOOTH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.903989080933499, 43.076773424923545 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 301, "Incident Number": 103280081, "Date": "11\/24\/2010", "Time": "01:48 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.072720, -87.910945 ], "Address": "2966 N 1ST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.91094456116933, 43.072720376074784 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 302, "Incident Number": 103270080, "Date": "11\/23\/2010", "Time": "01:30 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.089191, -87.919933 ], "Address": "715 W CAPITOL DR", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 0, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.919932953785192, 43.089190815519132 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 303, "Incident Number": 103270137, "Date": "11\/23\/2010", "Time": "06:08 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.089123, -87.901290 ], "Address": "709 E CAPITOL DR", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.901290391972481, 43.089122501154783 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 304, "Incident Number": 103270203, "Date": "11\/23\/2010", "Time": "10:47 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.079720, -87.942215 ], "Address": "2400 W HOPKINS ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 2, "m_clusterK5": 4, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.942214570546113, 43.079720134914979 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 305, "Incident Number": 103260167, "Date": "11\/22\/2010", "Time": "08:17 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.104095, -87.913634 ], "Address": "306 W HAMPTON AV", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 0, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.9136335, 43.104095453257401 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 306, "Incident Number": 103250060, "Date": "11\/21\/2010", "Time": "10:01 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.080039, -87.909430 ], "Address": "3379 N PALMER ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.909429624213658, 43.080038968636387 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 307, "Incident Number": 103240096, "Date": "11\/20\/2010", "Time": "01:28 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.091710, -87.919525 ], "Address": "4102 N 7TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 0, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.919525086704567, 43.091710208436723 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 308, "Incident Number": 103240171, "Date": "11\/20\/2010", "Time": "11:15 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.071341, -87.928321 ], "Address": "1324 W LOCUST ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 4, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 2, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 5, "g_clusterK10": 0, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.928321332361932, 43.071341467684121 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 309, "Incident Number": 103230013, "Date": "11\/19\/2010", "Time": "05:23 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.087839, -87.898432 ], "Address": "3869 N HUMBOLDT BL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.898431889433652, 43.087839361071147 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 310, "Incident Number": 103210036, "Date": "11\/17\/2010", "Time": "09:03 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.087104, -87.935633 ], "Address": "3850 N 19TH PL", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 3, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.935633404639773, 43.087104387731557 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 311, "Incident Number": 103200164, "Date": "11\/16\/2010", "Time": "04:34 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.087905, -87.900824 ], "Address": "3888 N FRATNEY ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.900824349674195, 43.087904580904848 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 312, "Incident Number": 103180042, "Date": "11\/14\/2010", "Time": "08:05 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.090559, -87.920813 ], "Address": "4050 N 8TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 0, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.920812893531277, 43.090558826533567 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 313, "Incident Number": 103180043, "Date": "11\/14\/2010", "Time": "08:58 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.078085, -87.903863 ], "Address": "3270 N BOOTH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.903862886317924, 43.078084575076474 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 314, "Incident Number": 103170105, "Date": "11\/13\/2010", "Time": "02:13 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.056472, -87.907690 ], "Address": "318 E BROWN ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.907689974464773, 43.056472493219339 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 315, "Incident Number": 103160089, "Date": "11\/12\/2010", "Time": "03:50 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.092363, -87.917074 ], "Address": "4160 N PORT WASHINGTON AV", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 0, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.917073928300951, 43.092362640573619 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 316, "Incident Number": 103160104, "Date": "11\/12\/2010", "Time": "05:14 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.065396, -87.919866 ], "Address": "2566 N 7TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.919865882422769, 43.065395580904834 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 317, "Incident Number": 103160181, "Date": "11\/12\/2010", "Time": "11:49 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.077220, -87.916610 ], "Address": "3240 N JULIA ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.916609510935615, 43.077220155433039 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 318, "Incident Number": 103150149, "Date": "11\/11\/2010", "Time": "04:50 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.066296, -87.907790 ], "Address": "2625 N RICHARDS ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.907789632003954, 43.066296167638058 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 319, "Incident Number": 103140045, "Date": "11\/10\/2010", "Time": "08:00 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.054832, -87.906103 ], "Address": "1858 N COMMERCE ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.90610335204012, 43.054832318858864 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 320, "Incident Number": 103140199, "Date": "11\/10\/2010", "Time": "11:46 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.085813, -87.897911 ], "Address": "1002 E VIENNA AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.897911018321849, 43.085812514859413 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 321, "Incident Number": 103130017, "Date": "11\/09\/2010", "Time": "02:25 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.049831, -87.922850 ], "Address": "849 W SOMERS ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.922850194856579, 43.049831132650738 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 322, "Incident Number": 103120021, "Date": "11\/08\/2010", "Time": "04:58 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.087176, -87.934413 ], "Address": "3854 N 19TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.934413386317914, 43.087175968636387 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 323, "Incident Number": 103120104, "Date": "11\/08\/2010", "Time": "02:24 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.079437, -87.923659 ], "Address": "3321 N 10TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 4, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 2, "g_clusterK9": 7, "m_clusterK9": 2, "e_clusterK10": 5, "g_clusterK10": 0, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.92365909925536, 43.079436922009364 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 324, "Incident Number": 103110153, "Date": "11\/07\/2010", "Time": "10:05 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.084730, -87.935024 ], "Address": "1925 W NASH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.935023908867862, 43.08472991271028 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 325, "Incident Number": 103100083, "Date": "11\/06\/2010", "Time": "12:36 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.084088, -87.945783 ], "Address": "3618 N 26TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.945783371891196, 43.084088497085816 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 326, "Incident Number": 103100120, "Date": "11\/06\/2010", "Time": "05:53 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.076945, -87.940611 ], "Address": "2218 W AUER AV", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.940611, 43.07694548211083 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 327, "Incident Number": 103070036, "Date": "11\/03\/2010", "Time": "08:50 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.085157, -87.895101 ], "Address": "1201 E SINGER CR", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 0, "g_clusterK4": 0, "m_clusterK4": 0, "e_clusterK5": 3, "g_clusterK5": 3, "m_clusterK5": 3, "e_clusterK6": 2, "g_clusterK6": 2, "m_clusterK6": 2, "e_clusterK7": 1, "g_clusterK7": 1, "m_clusterK7": 1, "e_clusterK8": 0, "g_clusterK8": 0, "m_clusterK8": 0, "e_clusterK9": 3, "g_clusterK9": 3, "m_clusterK9": 3, "e_clusterK10": 0, "g_clusterK10": 0, "m_clusterK10": 0 }, "geometry": { "type": "Point", "coordinates": [ -87.895100801028846, 43.085156557667723 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 328, "Incident Number": 103070076, "Date": "11\/03\/2010", "Time": "12:44 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.075611, -87.937398 ], "Address": "3121 N 20TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 5 }, "geometry": { "type": "Point", "coordinates": [ -87.937398055398276, 43.075611115182653 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 329, "Incident Number": 103340046, "Date": "11\/30\/2010", "Time": "09:41 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.077691, -87.949719 ], "Address": "3229 N 29TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 2, "m_clusterK5": 4, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 2, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.949718599255348, 43.077690838190307 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 330, "Incident Number": 103340071, "Date": "11\/30\/2010", "Time": "11:48 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.093547, -87.969238 ], "Address": "4207 N 44TH PL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.969237674223137, 43.09354723277692 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 331, "Incident Number": 103340087, "Date": "11\/30\/2010", "Time": "01:01 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.088872, -87.974851 ], "Address": "4906 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.974851391598023, 43.088871896214314 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 332, "Incident Number": 103330002, "Date": "11\/29\/2010", "Time": "12:17 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.084476, -87.960783 ], "Address": "3700 N 38TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 4, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.960783386317914, 43.084475580904837 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 333, "Incident Number": 103330024, "Date": "11\/29\/2010", "Time": "05:35 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.088841, -87.967258 ], "Address": "3945 N SHERMAN BL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.967258106468719, 43.088840947544583 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 334, "Incident Number": 103320114, "Date": "11\/28\/2010", "Time": "04:37 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.077084, -87.949784 ], "Address": "2900 W AUER AV", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 2, "m_clusterK5": 4, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 3, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 2, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.949783730269601, 43.077084230269627 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 335, "Incident Number": 103320140, "Date": "11\/28\/2010", "Time": "07:07 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.100504, -87.975576 ], "Address": "4574 N 50TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.975575944601729, 43.100503742714523 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 336, "Incident Number": 103300037, "Date": "11\/26\/2010", "Time": "05:53 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.084467, -87.963131 ], "Address": "3703 N 40TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.963130632003953, 43.084467419095148 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 337, "Incident Number": 103280064, "Date": "11\/24\/2010", "Time": "12:12 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.079174, -87.962589 ], "Address": "3900 W CONCORDIA AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.962588639222915, 43.07917422723488 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 338, "Incident Number": 103270164, "Date": "11\/23\/2010", "Time": "08:14 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.077733, -87.965694 ], "Address": "4200 W BONNY PL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.965694, 43.077732525967903 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 339, "Incident Number": 103260026, "Date": "11\/22\/2010", "Time": "07:34 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.087322, -87.972854 ], "Address": "4732 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.972854176784665, 43.087321801286812 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 340, "Incident Number": 103260028, "Date": "11\/22\/2010", "Time": "07:45 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.076358, -87.966642 ], "Address": "3152 N 42ND PL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.966642386317915, 43.076357664723872 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 341, "Incident Number": 103260111, "Date": "11\/22\/2010", "Time": "03:46 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.097533, -87.959274 ], "Address": "4414 N 37TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 5, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.959274042847483, 43.097533459893839 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 342, "Incident Number": 103260193, "Date": "11\/22\/2010", "Time": "10:21 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.099038, -87.983022 ], "Address": "4485 N 56TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 1, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.983021606468725, 43.099038199001683 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 343, "Incident Number": 103250008, "Date": "11\/21\/2010", "Time": "12:57 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.079697, -87.974705 ], "Address": "3322 N 49TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.974704871891191, 43.079696664723883 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 344, "Incident Number": 103250147, "Date": "11\/21\/2010", "Time": "08:37 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.093710, -87.970146 ], "Address": "4210 N 45TH PL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.970146350251099, 43.09371 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 345, "Incident Number": 103250148, "Date": "11\/21\/2010", "Time": "08:42 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.086997, -87.947071 ], "Address": "3835 N 27TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.947070566506781, 43.086997089647411 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 346, "Incident Number": 103240173, "Date": "11\/20\/2010", "Time": "11:33 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.076929, -87.959440 ], "Address": "3626 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 4, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.959440458480188, 43.076929451583958 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 347, "Incident Number": 103230010, "Date": "11\/19\/2010", "Time": "04:03 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.084762, -87.948354 ], "Address": "2800 W HOPKINS ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.948354166900941, 43.084762191072357 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 348, "Incident Number": 103230163, "Date": "11\/19\/2010", "Time": "09:29 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.071345, -87.973651 ], "Address": "2873 N 48TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.97365057372015, 43.07134503136362 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 349, "Incident Number": 103220113, "Date": "11\/18\/2010", "Time": "05:34 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.085583, -87.958362 ], "Address": "3756 N 36TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 5, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 5, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 3, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.958362386317916, 43.085582832361951 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 350, "Incident Number": 103210009, "Date": "11\/17\/2010", "Time": "12:36 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.080436, -87.962252 ], "Address": "3361 N 39TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.9622516392173, 43.080435838190311 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 351, "Incident Number": 103210055, "Date": "11\/17\/2010", "Time": "11:45 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.074072, -87.948505 ], "Address": "3028 N 28TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 0, "m_clusterK7": 2, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 6, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.948504919066494, 43.074071832361938 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 352, "Incident Number": 103200048, "Date": "11\/16\/2010", "Time": "09:21 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.081619, -87.965472 ], "Address": "4200 W FOND DU LAC AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.965472146031914, 43.08161943310791 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 353, "Incident Number": 103180168, "Date": "11\/14\/2010", "Time": "09:00 PM", "Police District": 5.0, "Offense 1": "BURGLARY\/BREAKING AND ENTERING", "Offense 2": "MOTOR VEHICLE THEFT", "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.071776, -87.948546 ], "Address": "2904 N 28TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 7, "g_clusterK9": 2, "m_clusterK9": 4, "e_clusterK10": 7, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.948546393531274, 43.071776245628712 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 354, "Incident Number": 103170048, "Date": "11\/13\/2010", "Time": "09:07 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.085042, -87.959583 ], "Address": "3728 N 37TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 0, "m_clusterK7": 5, "e_clusterK8": 4, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 7, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.959582860782689, 43.085042329447759 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 355, "Incident Number": 103170050, "Date": "11\/13\/2010", "Time": "08:34 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.070868, -87.969874 ], "Address": "2850 N 45TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.969874360782697, 43.070867664723863 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 356, "Incident Number": 103170063, "Date": "11\/13\/2010", "Time": "10:24 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.069428, -87.965771 ], "Address": "2771 N GRANT BL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.96577059593713, 43.06942816763808 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 357, "Incident Number": 103170086, "Date": "11\/13\/2010", "Time": "12:43 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.094583, -87.962918 ], "Address": "4251 N 40TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 1, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.962918073720147, 43.094583115182644 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 358, "Incident Number": 103160027, "Date": "11\/12\/2010", "Time": "08:47 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.087321, -87.963012 ], "Address": "3927 W ROOSEVELT DR", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 4, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.963012347192688, 43.087320661925247 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 359, "Incident Number": 103160168, "Date": "11\/12\/2010", "Time": "10:27 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.073911, -87.949802 ], "Address": "3023 N 29TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 0, "m_clusterK7": 2, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 6, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.949801632003954, 43.073910754371298 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 360, "Incident Number": 103150100, "Date": "11\/11\/2010", "Time": "03:54 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.072075, -87.969928 ], "Address": "2925 N 45TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.969927602573591, 43.072074586733237 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 361, "Incident Number": 103150146, "Date": "11\/11\/2010", "Time": "08:34 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.072605, -87.972285 ], "Address": "2944 N 47TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 6, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.972285386317921, 43.072604832361947 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 362, "Incident Number": 103140034, "Date": "11\/10\/2010", "Time": "08:15 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.077067, -87.946061 ], "Address": "2600 W AUER AV", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 2, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.946061114191565, 43.077067317454194 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 363, "Incident Number": 103140096, "Date": "11\/10\/2010", "Time": "01:46 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.087407, -87.968392 ], "Address": "3878 N 44TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.968392218885612, 43.087407216159576 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 364, "Incident Number": 103140108, "Date": "11\/10\/2010", "Time": "02:36 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.069696, -87.942780 ], "Address": "2410 W HADLEY ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 2, "m_clusterK7": 2, "e_clusterK8": 6, "g_clusterK8": 6, "m_clusterK8": 6, "e_clusterK9": 2, "g_clusterK9": 2, "m_clusterK9": 7, "e_clusterK10": 7, "g_clusterK10": 2, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.942779832361936, 43.06969552596793 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 365, "Incident Number": 103130011, "Date": "11\/09\/2010", "Time": "01:31 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.075187, -87.950583 ], "Address": "2925 W BURLEIGH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 4, "m_clusterK5": 4, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 3, "e_clusterK7": 2, "g_clusterK7": 0, "m_clusterK7": 2, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 6, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.950583167638058, 43.07518746681874 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 366, "Incident Number": 103130114, "Date": "11\/09\/2010", "Time": "04:38 PM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.078447, -87.948501 ], "Address": "3265 N 28TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 2, "m_clusterK5": 4, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 2, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.948501132003955, 43.078447005828394 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 367, "Incident Number": 103120042, "Date": "11\/08\/2010", "Time": "09:06 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.095339, -87.960830 ], "Address": "3826 W MARION ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 0, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.960830104565048, 43.095338911302065 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 368, "Incident Number": 103120140, "Date": "11\/08\/2010", "Time": "05:21 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.098166, -87.970668 ], "Address": "4443 N 46TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.970668132003951, 43.098166089647407 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 369, "Incident Number": 103110022, "Date": "11\/07\/2010", "Time": "03:52 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.078024, -87.970946 ], "Address": "3244 N 46TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.970946419066493, 43.078023639188643 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 370, "Incident Number": 103100057, "Date": "11\/06\/2010", "Time": "09:54 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.085286, -87.978336 ], "Address": "3740 N 52ND ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.97833585356932, 43.08528566472387 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 371, "Incident Number": 103100173, "Date": "11\/06\/2010", "Time": "11:18 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.075962, -87.966642 ], "Address": "3134 N 42ND PL", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 6 }, "geometry": { "type": "Point", "coordinates": [ -87.966642386317915, 43.075961664723877 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 372, "Incident Number": 103080017, "Date": "11\/04\/2010", "Time": "05:01 AM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.085106, -87.960851 ], "Address": "3735 N 38TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 4, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 2, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.960850624790581, 43.085106419095155 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 373, "Incident Number": 103080117, "Date": "11\/04\/2010", "Time": "06:08 PM", "Police District": 7.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.105366, -87.983861 ], "Address": "4825 N 57TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 5, "g_clusterK6": 5, "m_clusterK6": 5, "e_clusterK7": 5, "g_clusterK7": 5, "m_clusterK7": 5, "e_clusterK8": 3, "g_clusterK8": 3, "m_clusterK8": 3, "e_clusterK9": 1, "g_clusterK9": 1, "m_clusterK9": 1, "e_clusterK10": 3, "g_clusterK10": 3, "m_clusterK10": 3 }, "geometry": { "type": "Point", "coordinates": [ -87.983861157539181, 43.105365502914196 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 374, "Incident Number": 103060013, "Date": "11\/02\/2010", "Time": "01:49 AM", "Police District": 5.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.080346, -87.949669 ], "Address": "3355 N 29TH ST", "e_clusterK2": 0, "g_clusterK2": 1, "m_clusterK2": 0, "e_clusterK3": 1, "g_clusterK3": 1, "m_clusterK3": 1, "e_clusterK4": 3, "g_clusterK4": 3, "m_clusterK4": 3, "e_clusterK5": 4, "g_clusterK5": 2, "m_clusterK5": 2, "e_clusterK6": 4, "g_clusterK6": 4, "m_clusterK6": 4, "e_clusterK7": 0, "g_clusterK7": 0, "m_clusterK7": 2, "e_clusterK8": 4, "g_clusterK8": 4, "m_clusterK8": 4, "e_clusterK9": 7, "g_clusterK9": 7, "m_clusterK9": 7, "e_clusterK10": 5, "g_clusterK10": 2, "m_clusterK10": 2 }, "geometry": { "type": "Point", "coordinates": [ -87.94966909925536, 43.080345502914184 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 375, "Incident Number": 103340117, "Date": "11\/30\/2010", "Time": "03:49 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.022612, -87.942286 ], "Address": "2300 W NATIONAL AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.942286063909251, 43.022611857518335 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 376, "Incident Number": 103330063, "Date": "11\/29\/2010", "Time": "09:42 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.018778, -87.953826 ], "Address": "1212 S 32ND ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 4, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.953825568343461, 43.018778199600071 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 377, "Incident Number": 103330195, "Date": "11\/29\/2010", "Time": "08:55 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.009324, -87.943798 ], "Address": "2400 W LEGION ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.943797596654164, 43.009324166362994 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 378, "Incident Number": 103330209, "Date": "11\/29\/2010", "Time": "10:38 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.019105, -87.947953 ], "Address": "2700 W SCOTT ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.947953306726035, 43.019104974175271 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 379, "Incident Number": 103320095, "Date": "11\/28\/2010", "Time": "02:17 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.018127, -87.942175 ], "Address": "1238 S 23RD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.942175451815075, 43.018126857897158 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 380, "Incident Number": 103320142, "Date": "11\/28\/2010", "Time": "07:12 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.006266, -87.949300 ], "Address": "2119 S 28TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.949300099255353, 43.006266167638074 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 381, "Incident Number": 103310130, "Date": "11\/27\/2010", "Time": "08:07 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.005600, -87.946558 ], "Address": "2151 S 26TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.946558084828638, 43.005599612268441 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 382, "Incident Number": 103300003, "Date": "11\/26\/2010", "Time": "12:26 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.019676, -87.942156 ], "Address": "1100 S 23RD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.942155651712582, 43.019675504443128 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 383, "Incident Number": 103300079, "Date": "11\/26\/2010", "Time": "12:45 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.016848, -87.961361 ], "Address": "3735 W GREENFIELD AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.96136058381903, 43.016848492353951 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 384, "Incident Number": 103290034, "Date": "11\/25\/2010", "Time": "11:07 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.017890, -87.946305 ], "Address": "1310 S 26TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.946304651697048, 43.017890372033662 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 385, "Incident Number": 103280071, "Date": "11\/22\/2010", "Time": "06:30 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.016201, -87.942203 ], "Address": "1434 S 23RD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.942202948496856, 43.016201329447739 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 386, "Incident Number": 103250133, "Date": "11\/21\/2010", "Time": "07:35 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.008228, -87.948071 ], "Address": "2009 S LAYTON BL", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.948071102573593, 43.008228335276129 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 387, "Incident Number": 103250155, "Date": "11\/21\/2010", "Time": "09:49 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.022574, -87.953834 ], "Address": "804 S 32ND ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 0, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 4, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.953833893531268, 43.022574167638055 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 388, "Incident Number": 103210027, "Date": "11\/17\/2010", "Time": "06:55 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.014529, -87.957639 ], "Address": "1565 S 35TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.957639055398275, 43.01452883819033 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 389, "Incident Number": 103210107, "Date": "11\/17\/2010", "Time": "04:56 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.022772, -87.953835 ], "Address": "736 S 32ND ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 0, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 4, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.953834951815082, 43.022772167638067 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 390, "Incident Number": 103190021, "Date": "11\/15\/2010", "Time": "07:41 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 42.999038, -87.950492 ], "Address": "2516 S 29TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.950492404639775, 42.999037774078147 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 391, "Incident Number": 103170038, "Date": "11\/13\/2010", "Time": "07:03 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.012525, -87.954083 ], "Address": "3200 W MITCHELL ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.954082766236311, 43.012525465564487 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 392, "Incident Number": 103170133, "Date": "11\/13\/2010", "Time": "05:35 PM", "Police District": 1.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.010416, -87.939934 ], "Address": "1829 S MUSKEGO AV", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.939934085925159, 43.010416496826011 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 393, "Incident Number": 103160115, "Date": "11\/12\/2010", "Time": "06:04 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.010199, -87.956898 ], "Address": "3435 W BURNHAM ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.956897643419893, 43.010198943606028 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 394, "Incident Number": 103150029, "Date": "11\/11\/2010", "Time": "09:00 AM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.019567, -87.943542 ], "Address": "1118 S 24TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.943542393531274, 43.019566690259097 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 395, "Incident Number": 103150049, "Date": "11\/11\/2010", "Time": "09:26 AM", "Police District": 3.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.031358, -87.935133 ], "Address": "1721 W CANAL ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 4, "m_clusterK5": 1, "e_clusterK6": 3, "g_clusterK6": 3, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 4, "g_clusterK9": 4, "m_clusterK9": 2, "e_clusterK10": 7, "g_clusterK10": 7, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.935133444457492, 43.031358468406182 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 396, "Incident Number": 103120161, "Date": "11\/08\/2010", "Time": "06:01 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.016020, -87.941394 ], "Address": "2212 W ORCHARD ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 1, "e_clusterK6": 0, "g_clusterK6": 0, "m_clusterK6": 0, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 1 }, "geometry": { "type": "Point", "coordinates": [ -87.941394, 43.016020478792619 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 397, "Incident Number": 103060071, "Date": "11\/02\/2010", "Time": "12:16 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.022617, -87.951409 ], "Address": "836 S 30TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 0, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.951408991679315, 43.022617428225821 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 398, "Incident Number": 103060110, "Date": "11\/02\/2010", "Time": "04:56 PM", "Police District": 2.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.023105, -87.950226 ], "Address": "738-A S 29TH ST", "e_clusterK2": 0, "g_clusterK2": 0, "m_clusterK2": 0, "e_clusterK3": 0, "g_clusterK3": 0, "m_clusterK3": 0, "e_clusterK4": 2, "g_clusterK4": 2, "m_clusterK4": 2, "e_clusterK5": 1, "g_clusterK5": 1, "m_clusterK5": 4, "e_clusterK6": 3, "g_clusterK6": 0, "m_clusterK6": 3, "e_clusterK7": 3, "g_clusterK7": 3, "m_clusterK7": 3, "e_clusterK8": 1, "g_clusterK8": 1, "m_clusterK8": 1, "e_clusterK9": 5, "g_clusterK9": 5, "m_clusterK9": 5, "e_clusterK10": 1, "g_clusterK10": 1, "m_clusterK10": 7 }, "geometry": { "type": "Point", "coordinates": [ -87.950226386317922, 43.023104664723888 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 399, "Incident Number": 103330064, "Date": "11\/29\/2010", "Time": "11:38 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.136304, -88.014707 ], "Address": "6513 N 83RD ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.014707117432991, 43.136304098245759 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 400, "Incident Number": 103320034, "Date": "11\/28\/2010", "Time": "06:03 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.136209, -87.982039 ], "Address": "6515 N 56TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.982038676437952, 43.136208754371296 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 401, "Incident Number": 103310113, "Date": "11\/27\/2010", "Time": "05:33 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.134270, -88.018511 ], "Address": "8534 W MILL RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.018510583819022, 43.134269508222985 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 402, "Incident Number": 103300083, "Date": "11\/26\/2010", "Time": "12:52 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.136940, -88.005562 ], "Address": "6550 N 76TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.005562376219956, 43.13694042576028 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 403, "Incident Number": 103290044, "Date": "11\/25\/2010", "Time": "12:28 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.134261, -88.021112 ], "Address": "8750 W MILL RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.02111239064574, 43.13426050822298 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 404, "Incident Number": 103280131, "Date": "11\/24\/2010", "Time": "07:00 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.177620, -87.995689 ], "Address": "6841 W BROWN DEER RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.995688834123513, 43.177620146505738 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 405, "Incident Number": 103270032, "Date": "11\/23\/2010", "Time": "06:46 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.138585, -87.980762 ], "Address": "6643 N 55TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.980761632003947, 43.138584838190326 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 406, "Incident Number": 103270097, "Date": "11\/23\/2010", "Time": "03:28 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.142318, -88.006914 ], "Address": "7713 W BEECHWOOD AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.006913916180963, 43.142317513994044 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 407, "Incident Number": 103250105, "Date": "11\/21\/2010", "Time": "04:17 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.187295, -88.002731 ], "Address": "9217 N 75TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.00273116694683, 43.187294836764423 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 408, "Incident Number": 103210066, "Date": "11\/17\/2010", "Time": "12:49 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.184292, -88.002890 ], "Address": "9099 N 75TH ST", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.002889846630268, 43.184291653369741 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 409, "Incident Number": 103210176, "Date": "11\/17\/2010", "Time": "08:06 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.177231, -88.057391 ], "Address": "11800 W BROWN DEER RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 8, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.057391090224328, 43.177230511250862 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 410, "Incident Number": 103200127, "Date": "11\/16\/2010", "Time": "06:12 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.141488, -88.010511 ], "Address": "8000 W GREEN TREE RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.010511312333279, 43.14148831233328 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 411, "Incident Number": 103200159, "Date": "11\/16\/2010", "Time": "08:42 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.177582, -88.026562 ], "Address": "9301 W BROWN DEER RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.026561974464769, 43.177581527843849 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 412, "Incident Number": 103160175, "Date": "11\/12\/2010", "Time": "10:57 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.148877, -88.001995 ], "Address": "7300 W GOOD HOPE RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -88.001994814936054, 43.148877321765724 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 413, "Incident Number": 103120177, "Date": "11\/08\/2010", "Time": "08:14 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.148725, -87.985549 ], "Address": "6000 W GOOD HOPE RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.985549375496419, 43.148724762966474 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 414, "Incident Number": 103110069, "Date": "11\/07\/2010", "Time": "11:26 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.134261, -88.023700 ], "Address": "8924 W MILL RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 7, "g_clusterK8": 7, "m_clusterK8": 7, "e_clusterK9": 8, "g_clusterK9": 8, "m_clusterK9": 8, "e_clusterK10": 8, "g_clusterK10": 8, "m_clusterK10": 8 }, "geometry": { "type": "Point", "coordinates": [ -88.023700393559935, 43.134261482687748 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 415, "Incident Number": 103090027, "Date": "11\/05\/2010", "Time": "03:25 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.134127, -87.990859 ], "Address": "6400 W MILL RD", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 0, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.99085880768402, 43.134127275217885 ] } },
{ "type": "Feature", "properties": { "Unnamed: 0": 416, "Incident Number": 103090135, "Date": "11\/05\/2010", "Time": "06:20 PM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "Offense 2": null, "Offense 3": null, "Offense 4": null, "Offense 5": null, "Location": [ 43.126571, -87.981450 ], "Address": "5515 W FLORIST AV", "e_clusterK2": 1, "g_clusterK2": 1, "m_clusterK2": 1, "e_clusterK3": 2, "g_clusterK3": 2, "m_clusterK3": 2, "e_clusterK4": 1, "g_clusterK4": 1, "m_clusterK4": 1, "e_clusterK5": 2, "g_clusterK5": 0, "m_clusterK5": 0, "e_clusterK6": 1, "g_clusterK6": 1, "m_clusterK6": 1, "e_clusterK7": 6, "g_clusterK7": 6, "m_clusterK7": 6, "e_clusterK8": 5, "g_clusterK8": 5, "m_clusterK8": 5, "e_clusterK9": 6, "g_clusterK9": 6, "m_clusterK9": 6, "e_clusterK10": 9, "g_clusterK10": 9, "m_clusterK10": 9 }, "geometry": { "type": "Point", "coordinates": [ -87.981450076605668, 43.126570542847475 ] } }
]
}
|
marquettecomputationalsocialscience/clusteredcrimemaps
|
individual_work/marielle/KMeans/datamound/data_2010-m_theft_nov.js
|
JavaScript
|
mit
| 384,077
|
# Baked Potato
## Ingredients
- russet potatoes
- olive oil
- kosher salt
- cheddar cheese, grated
- sour cream
- bacon, chopped fine and well browned
- green onion, chopped fine
- black pepper
## Instructions
1. Preheat oven to 350°F.
2. Scrub potatoes and pierce skin several times with a knife. Rub skin with olive oil and salt.
3. Bake potatoes on a foil-lined baking sheet until you can easily pierce them with a fork, about 60-90 minutes.
4. Let potatoes cool slightly, then halve and top with cheese, sour cream, bacon, green onion, and pepper.
|
rlucioni/recipes
|
recipes/baked-potato.md
|
Markdown
|
mit
| 557
|
<?php
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;
/**
* appDevUrlMatcher
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class appDevUrlMatcher extends Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher
{
/**
* Constructor.
*/
public function __construct(RequestContext $context)
{
$this->context = $context;
}
public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
$context = $this->context;
$request = $this->request;
if (0 === strpos($pathinfo, '/_')) {
// _wdt
if (0 === strpos($pathinfo, '/_wdt') && preg_match('#^/_wdt/(?P<token>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => '_wdt')), array ( '_controller' => 'web_profiler.controller.profiler:toolbarAction',));
}
if (0 === strpos($pathinfo, '/_profiler')) {
// _profiler_home
if (rtrim($pathinfo, '/') === '/_profiler') {
if (substr($pathinfo, -1) !== '/') {
return $this->redirect($pathinfo.'/', '_profiler_home');
}
return array ( '_controller' => 'web_profiler.controller.profiler:homeAction', '_route' => '_profiler_home',);
}
if (0 === strpos($pathinfo, '/_profiler/search')) {
// _profiler_search
if ($pathinfo === '/_profiler/search') {
return array ( '_controller' => 'web_profiler.controller.profiler:searchAction', '_route' => '_profiler_search',);
}
// _profiler_search_bar
if ($pathinfo === '/_profiler/search_bar') {
return array ( '_controller' => 'web_profiler.controller.profiler:searchBarAction', '_route' => '_profiler_search_bar',);
}
}
// _profiler_purge
if ($pathinfo === '/_profiler/purge') {
return array ( '_controller' => 'web_profiler.controller.profiler:purgeAction', '_route' => '_profiler_purge',);
}
if (0 === strpos($pathinfo, '/_profiler/i')) {
// _profiler_info
if (0 === strpos($pathinfo, '/_profiler/info') && preg_match('#^/_profiler/info/(?P<about>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_info')), array ( '_controller' => 'web_profiler.controller.profiler:infoAction',));
}
// _profiler_import
if ($pathinfo === '/_profiler/import') {
return array ( '_controller' => 'web_profiler.controller.profiler:importAction', '_route' => '_profiler_import',);
}
}
// _profiler_export
if (0 === strpos($pathinfo, '/_profiler/export') && preg_match('#^/_profiler/export/(?P<token>[^/\\.]++)\\.txt$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_export')), array ( '_controller' => 'web_profiler.controller.profiler:exportAction',));
}
// _profiler_phpinfo
if ($pathinfo === '/_profiler/phpinfo') {
return array ( '_controller' => 'web_profiler.controller.profiler:phpinfoAction', '_route' => '_profiler_phpinfo',);
}
// _profiler_search_results
if (preg_match('#^/_profiler/(?P<token>[^/]++)/search/results$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_search_results')), array ( '_controller' => 'web_profiler.controller.profiler:searchResultsAction',));
}
// _profiler
if (preg_match('#^/_profiler/(?P<token>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler')), array ( '_controller' => 'web_profiler.controller.profiler:panelAction',));
}
// _profiler_router
if (preg_match('#^/_profiler/(?P<token>[^/]++)/router$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_router')), array ( '_controller' => 'web_profiler.controller.router:panelAction',));
}
// _profiler_exception
if (preg_match('#^/_profiler/(?P<token>[^/]++)/exception$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_exception')), array ( '_controller' => 'web_profiler.controller.exception:showAction',));
}
// _profiler_exception_css
if (preg_match('#^/_profiler/(?P<token>[^/]++)/exception\\.css$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_exception_css')), array ( '_controller' => 'web_profiler.controller.exception:cssAction',));
}
}
if (0 === strpos($pathinfo, '/_configurator')) {
// _configurator_home
if (rtrim($pathinfo, '/') === '/_configurator') {
if (substr($pathinfo, -1) !== '/') {
return $this->redirect($pathinfo.'/', '_configurator_home');
}
return array ( '_controller' => 'Sensio\\Bundle\\DistributionBundle\\Controller\\ConfiguratorController::checkAction', '_route' => '_configurator_home',);
}
// _configurator_step
if (0 === strpos($pathinfo, '/_configurator/step') && preg_match('#^/_configurator/step/(?P<index>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => '_configurator_step')), array ( '_controller' => 'Sensio\\Bundle\\DistributionBundle\\Controller\\ConfiguratorController::stepAction',));
}
// _configurator_final
if ($pathinfo === '/_configurator/final') {
return array ( '_controller' => 'Sensio\\Bundle\\DistributionBundle\\Controller\\ConfiguratorController::finalAction', '_route' => '_configurator_final',);
}
}
}
if (0 === strpos($pathinfo, '/alumno')) {
// alumno
if (rtrim($pathinfo, '/') === '/alumno') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_alumno;
}
if (substr($pathinfo, -1) !== '/') {
return $this->redirect($pathinfo.'/', 'alumno');
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\AlumnoController::indexAction', '_route' => 'alumno',);
}
not_alumno:
// alumno_create
if ($pathinfo === '/alumno/') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_alumno_create;
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\AlumnoController::createAction', '_route' => 'alumno_create',);
}
not_alumno_create:
// alumno_new
if ($pathinfo === '/alumno/new') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_alumno_new;
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\AlumnoController::newAction', '_route' => 'alumno_new',);
}
not_alumno_new:
// alumno_show
if (preg_match('#^/alumno/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_alumno_show;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'alumno_show')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\AlumnoController::showAction',));
}
not_alumno_show:
// alumno_edit
if (preg_match('#^/alumno/(?P<id>[^/]++)/edit$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_alumno_edit;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'alumno_edit')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\AlumnoController::editAction',));
}
not_alumno_edit:
// alumno_update
if (preg_match('#^/alumno/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if ($this->context->getMethod() != 'PUT') {
$allow[] = 'PUT';
goto not_alumno_update;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'alumno_update')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\AlumnoController::updateAction',));
}
not_alumno_update:
// alumno_delete
if (preg_match('#^/alumno/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if ($this->context->getMethod() != 'DELETE') {
$allow[] = 'DELETE';
goto not_alumno_delete;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'alumno_delete')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\AlumnoController::deleteAction',));
}
not_alumno_delete:
}
// _index
if (rtrim($pathinfo, '/') === '') {
if (substr($pathinfo, -1) !== '/') {
return $this->redirect($pathinfo.'/', '_index');
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\DefaultController::indexAction', '_route' => '_index',);
}
if (0 === strpos($pathinfo, '/grupo')) {
// grupo
if (rtrim($pathinfo, '/') === '/grupo') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_grupo;
}
if (substr($pathinfo, -1) !== '/') {
return $this->redirect($pathinfo.'/', 'grupo');
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\GrupoController::indexAction', '_route' => 'grupo',);
}
not_grupo:
// grupo_create
if ($pathinfo === '/grupo/') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_grupo_create;
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\GrupoController::createAction', '_route' => 'grupo_create',);
}
not_grupo_create:
// grupo_new
if ($pathinfo === '/grupo/new') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_grupo_new;
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\GrupoController::newAction', '_route' => 'grupo_new',);
}
not_grupo_new:
// grupo_show
if (preg_match('#^/grupo/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_grupo_show;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'grupo_show')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\GrupoController::showAction',));
}
not_grupo_show:
// grupo_edit
if (preg_match('#^/grupo/(?P<id>[^/]++)/edit$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_grupo_edit;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'grupo_edit')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\GrupoController::editAction',));
}
not_grupo_edit:
// grupo_update
if (preg_match('#^/grupo/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if ($this->context->getMethod() != 'PUT') {
$allow[] = 'PUT';
goto not_grupo_update;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'grupo_update')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\GrupoController::updateAction',));
}
not_grupo_update:
// grupo_delete
if (preg_match('#^/grupo/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if ($this->context->getMethod() != 'DELETE') {
$allow[] = 'DELETE';
goto not_grupo_delete;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'grupo_delete')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\GrupoController::deleteAction',));
}
not_grupo_delete:
}
if (0 === strpos($pathinfo, '/horario')) {
// horario
if (rtrim($pathinfo, '/') === '/horario') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_horario;
}
if (substr($pathinfo, -1) !== '/') {
return $this->redirect($pathinfo.'/', 'horario');
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\HorarioController::indexAction', '_route' => 'horario',);
}
not_horario:
// horario_create
if ($pathinfo === '/horario/') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_horario_create;
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\HorarioController::createAction', '_route' => 'horario_create',);
}
not_horario_create:
// horario_new
if ($pathinfo === '/horario/new') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_horario_new;
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\HorarioController::newAction', '_route' => 'horario_new',);
}
not_horario_new:
// horario_show
if (preg_match('#^/horario/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_horario_show;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'horario_show')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\HorarioController::showAction',));
}
not_horario_show:
// horario_edit
if (preg_match('#^/horario/(?P<id>[^/]++)/edit$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_horario_edit;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'horario_edit')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\HorarioController::editAction',));
}
not_horario_edit:
// horario_update
if (preg_match('#^/horario/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if ($this->context->getMethod() != 'PUT') {
$allow[] = 'PUT';
goto not_horario_update;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'horario_update')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\HorarioController::updateAction',));
}
not_horario_update:
// horario_delete
if (preg_match('#^/horario/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if ($this->context->getMethod() != 'DELETE') {
$allow[] = 'DELETE';
goto not_horario_delete;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'horario_delete')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\HorarioController::deleteAction',));
}
not_horario_delete:
}
if (0 === strpos($pathinfo, '/ma')) {
if (0 === strpos($pathinfo, '/maestro')) {
// maestro
if (rtrim($pathinfo, '/') === '/maestro') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_maestro;
}
if (substr($pathinfo, -1) !== '/') {
return $this->redirect($pathinfo.'/', 'maestro');
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MaestroController::indexAction', '_route' => 'maestro',);
}
not_maestro:
// maestro_create
if ($pathinfo === '/maestro/') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_maestro_create;
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MaestroController::createAction', '_route' => 'maestro_create',);
}
not_maestro_create:
// maestro_new
if ($pathinfo === '/maestro/new') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_maestro_new;
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MaestroController::newAction', '_route' => 'maestro_new',);
}
not_maestro_new:
// maestro_show
if (preg_match('#^/maestro/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_maestro_show;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'maestro_show')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MaestroController::showAction',));
}
not_maestro_show:
// maestro_edit
if (preg_match('#^/maestro/(?P<id>[^/]++)/edit$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_maestro_edit;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'maestro_edit')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MaestroController::editAction',));
}
not_maestro_edit:
// maestro_update
if (preg_match('#^/maestro/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if ($this->context->getMethod() != 'PUT') {
$allow[] = 'PUT';
goto not_maestro_update;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'maestro_update')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MaestroController::updateAction',));
}
not_maestro_update:
// maestro_delete
if (preg_match('#^/maestro/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if ($this->context->getMethod() != 'DELETE') {
$allow[] = 'DELETE';
goto not_maestro_delete;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'maestro_delete')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MaestroController::deleteAction',));
}
not_maestro_delete:
}
if (0 === strpos($pathinfo, '/materia')) {
// materia
if (rtrim($pathinfo, '/') === '/materia') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_materia;
}
if (substr($pathinfo, -1) !== '/') {
return $this->redirect($pathinfo.'/', 'materia');
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MateriaController::indexAction', '_route' => 'materia',);
}
not_materia:
// materia_create
if ($pathinfo === '/materia/') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_materia_create;
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MateriaController::createAction', '_route' => 'materia_create',);
}
not_materia_create:
// materia_new
if ($pathinfo === '/materia/new') {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_materia_new;
}
return array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MateriaController::newAction', '_route' => 'materia_new',);
}
not_materia_new:
// materia_show
if (preg_match('#^/materia/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_materia_show;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'materia_show')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MateriaController::showAction',));
}
not_materia_show:
// materia_edit
if (preg_match('#^/materia/(?P<id>[^/]++)/edit$#s', $pathinfo, $matches)) {
if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
$allow = array_merge($allow, array('GET', 'HEAD'));
goto not_materia_edit;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'materia_edit')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MateriaController::editAction',));
}
not_materia_edit:
// materia_update
if (preg_match('#^/materia/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if ($this->context->getMethod() != 'PUT') {
$allow[] = 'PUT';
goto not_materia_update;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'materia_update')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MateriaController::updateAction',));
}
not_materia_update:
// materia_delete
if (preg_match('#^/materia/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
if ($this->context->getMethod() != 'DELETE') {
$allow[] = 'DELETE';
goto not_materia_delete;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'materia_delete')), array ( '_controller' => 'Omar\\EscuelaBundle\\Controller\\MateriaController::deleteAction',));
}
not_materia_delete:
}
}
// _welcome
if (rtrim($pathinfo, '/') === '') {
if (substr($pathinfo, -1) !== '/') {
return $this->redirect($pathinfo.'/', '_welcome');
}
return array ( '_controller' => 'Acme\\DemoBundle\\Controller\\WelcomeController::indexAction', '_route' => '_welcome',);
}
if (0 === strpos($pathinfo, '/demo')) {
if (0 === strpos($pathinfo, '/demo/secured')) {
if (0 === strpos($pathinfo, '/demo/secured/log')) {
if (0 === strpos($pathinfo, '/demo/secured/login')) {
// _demo_login
if ($pathinfo === '/demo/secured/login') {
return array ( '_controller' => 'Acme\\DemoBundle\\Controller\\SecuredController::loginAction', '_route' => '_demo_login',);
}
// _security_check
if ($pathinfo === '/demo/secured/login_check') {
return array ( '_controller' => 'Acme\\DemoBundle\\Controller\\SecuredController::securityCheckAction', '_route' => '_security_check',);
}
}
// _demo_logout
if ($pathinfo === '/demo/secured/logout') {
return array ( '_controller' => 'Acme\\DemoBundle\\Controller\\SecuredController::logoutAction', '_route' => '_demo_logout',);
}
}
if (0 === strpos($pathinfo, '/demo/secured/hello')) {
// acme_demo_secured_hello
if ($pathinfo === '/demo/secured/hello') {
return array ( 'name' => 'World', '_controller' => 'Acme\\DemoBundle\\Controller\\SecuredController::helloAction', '_route' => 'acme_demo_secured_hello',);
}
// _demo_secured_hello
if (preg_match('#^/demo/secured/hello/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => '_demo_secured_hello')), array ( '_controller' => 'Acme\\DemoBundle\\Controller\\SecuredController::helloAction',));
}
// _demo_secured_hello_admin
if (0 === strpos($pathinfo, '/demo/secured/hello/admin') && preg_match('#^/demo/secured/hello/admin/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => '_demo_secured_hello_admin')), array ( '_controller' => 'Acme\\DemoBundle\\Controller\\SecuredController::helloadminAction',));
}
}
}
// _demo
if (rtrim($pathinfo, '/') === '/demo') {
if (substr($pathinfo, -1) !== '/') {
return $this->redirect($pathinfo.'/', '_demo');
}
return array ( '_controller' => 'Acme\\DemoBundle\\Controller\\DemoController::indexAction', '_route' => '_demo',);
}
// _demo_hello
if (0 === strpos($pathinfo, '/demo/hello') && preg_match('#^/demo/hello/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => '_demo_hello')), array ( '_controller' => 'Acme\\DemoBundle\\Controller\\DemoController::helloAction',));
}
// _demo_contact
if ($pathinfo === '/demo/contact') {
return array ( '_controller' => 'Acme\\DemoBundle\\Controller\\DemoController::contactAction', '_route' => '_demo_contact',);
}
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}
|
0marBonifacio/Escuela
|
app/cache/dev_old/appDevUrlMatcher.php
|
PHP
|
mit
| 30,575
|
const React = require('react')
const { shell } = require('electron')
const ModalOKCancel = require('./modal-ok-cancel')
const { dispatch } = require('../lib/dispatcher')
module.exports = class UpdateAvailableModal extends React.Component {
render () {
const state = this.props.state
return (
<div className='update-available-modal'>
<p><strong>A new version of WebTorrent is available: v{state.modal.version}</strong></p>
<p>
We have an auto-updater for Windows and Mac.
We don't have one for Linux yet, so you'll have to download the new version manually.
</p>
<ModalOKCancel
cancelText='SKIP THIS RELEASE'
onCancel={handleSkip}
okText='SHOW DOWNLOAD PAGE'
onOK={handleShow}
/>
</div>
)
function handleShow () {
// TODO: use the GitHub urls from config.js
shell.openExternal('https://github.com/webtorrent/webtorrent-desktop/releases')
dispatch('exitModal')
}
function handleSkip () {
dispatch('skipVersion', state.modal.version)
dispatch('exitModal')
}
}
}
|
webtorrent/webtorrent-desktop
|
src/renderer/components/update-available-modal.js
|
JavaScript
|
mit
| 1,137
|
shared_examples 'creating an issue for a discussion' do
it 'shows an issue with the title filled in' do
title_field = page.find_field('issue[title]')
expect(title_field.value).to include(merge_request.title)
end
it 'has a mention of the discussion in the description' do
description_field = page.find_field('issue[description]')
expect(description_field.value).to include(discussion.first_note.note)
end
it 'can create a new issue for the project' do
expect { click_button 'Submit issue' }.to change { project.issues.reload.size }.by(1)
end
it 'resolves the discussion in the merge request' do
click_button 'Submit issue'
discussion.first_note.reload
expect(discussion.resolved?).to eq(true)
end
it 'shows a flash messaage after resolving a discussion' do
click_button 'Submit issue'
page.within '.flash-notice' do
# Only check for the word 'Resolved' since the spec might have resolved
# multiple discussions
expect(page).to have_content('Resolved')
end
end
it 'has a hidden field for the merge request' do
merge_request_field = find('#merge_request_to_resolve_discussions_of', visible: false)
expect(merge_request_field.value).to eq(merge_request.iid.to_s)
end
end
|
iiet/iiet-git
|
spec/support/features/resolving_discussions_in_issues_shared_examples.rb
|
Ruby
|
mit
| 1,272
|
package io.keen.client.java;
import java.io.IOException;
/**
* Interface which provides an abstraction layer around how attempt counts are stored.
*
* @author Simon Murtha Smith
* @since 2.0.2
*/
public interface KeenAttemptCountingEventStore extends KeenEventStore {
/**
* Gets the stored attempts String for a given project and collection.
*
* @param projectId the project id
* @param eventCollection the collection name
* @return a String that was previously stored for this project and collection or null
* @throws java.io.IOException exception
*/
public String getAttempts(String projectId, String eventCollection) throws IOException;
/**
* Set and stores the attempts String for a given project and collection.
* @param projectId the project id
* @param eventCollection the collection name
* @param attemptsString the String to stored for this project and collection
* @throws java.io.IOException exception
* */
public void setAttempts(String projectId, String eventCollection, String attemptsString) throws IOException;
}
|
keenlabs/KeenClient-Java
|
core/src/main/java/io/keen/client/java/KeenAttemptCountingEventStore.java
|
Java
|
mit
| 1,120
|
'use strict'
/**
* OAuth 2.0 Authentication Protocol
*
* OAuth 2.0 is the successor to OAuth 1.0, and is designed to overcome
* perceived shortcomings in the earlier version. The authentication flow is
* essentially the same. The user is first redirected to the service provider
* to authorize access. After authorization has been granted, the user is
* redirected back to the application with a code that can be exchanged for an
* access token. The application requesting access, known as a client, is iden-
* tified by an ID and secret.
*
* For more information on OAuth in Passport.js, check out:
* http://passportjs.org/guide/oauth/
*
* @param {Object} req
* @param {string} accessToken
* @param {string} refreshToken
* @param {Object} profile
* @param {Function} next
*/
module.exports = module.exports = (app) => {
const passport = app.services.PassportService.passport
return (req, accessToken, refreshToken, profile, next) => {
const query = {
identifier: profile.id,
protocol: 'oauth2',
tokens: {accessToken: accessToken}
}
if (refreshToken !== undefined) {
query.tokens.refreshToken = refreshToken
}
passport.connect(req, query, profile, next)
}
}
|
jaumard/trailpack-passport
|
api/services/protocols/oauth2.js
|
JavaScript
|
mit
| 1,238
|
/**
* @license
* lodash 4.0.0 <https://lodash.com/>
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/
;(function() {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/** Used as the semantic version number. */
var VERSION = '4.0.0';
/** Used to compose bitmasks for wrapper metadata. */
var BIND_FLAG = 1,
BIND_KEY_FLAG = 2,
CURRY_BOUND_FLAG = 4,
CURRY_FLAG = 8,
CURRY_RIGHT_FLAG = 16,
PARTIAL_FLAG = 32,
PARTIAL_RIGHT_FLAG = 64,
ARY_FLAG = 128,
REARG_FLAG = 256,
FLIP_FLAG = 512;
/** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1,
PARTIAL_COMPARE_FLAG = 2;
/** Used as default options for `_.truncate`. */
var DEFAULT_TRUNC_LENGTH = 30,
DEFAULT_TRUNC_OMISSION = '...';
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 150,
HOT_SPAN = 16;
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/** Used to indicate the type of lazy iteratees. */
var LAZY_FILTER_FLAG = 1,
LAZY_MAP_FLAG = 2,
LAZY_WHILE_FLAG = 3;
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_SAFE_INTEGER = 9007199254740991,
MAX_INTEGER = 1.7976931348623157e+308,
NAN = 0 / 0;
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295,
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to match empty string literals in compiled template source. */
var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
/** Used to match HTML entities and HTML characters. */
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
reUnescapedHtml = /[&<>"'`]/g,
reHasEscapedHtml = RegExp(reEscapedHtml.source),
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
/** Used to match template delimiters. */
var reEscape = /<%-([\s\S]+?)%>/g,
reEvaluate = /<%([\s\S]+?)%>/g,
reInterpolate = /<%=([\s\S]+?)%>/g;
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g;
/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
reHasRegExpChar = RegExp(reRegExpChar.source);
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g,
reTrimStart = /^\s+/,
reTrimEnd = /\s+$/;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/** Used to detect hexadecimal string values. */
var reHasHexPrefix = /^0x/i;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect host constructors (Safari > 5). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Used to match latin-1 supplementary letters (excluding mathematical operators). */
var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
/** Used to ensure capturing order of template delimiters. */
var reNoMatch = /($^)/;
/** Used to match unescaped characters in compiled string literals. */
var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
rsDingbatRange = '\\u2700-\\u27bf',
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
rsQuoteRange = '\\u2018\\u2019\\u201c\\u201d',
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
rsVarRange = '\\ufe0e\\ufe0f',
rsBreakRange = rsMathOpRange + rsNonCharRange + rsQuoteRange + rsSpaceRange;
/** Used to compose unicode capture groups. */
var rsAstral = '[' + rsAstralRange + ']',
rsBreak = '[' + rsBreakRange + ']',
rsCombo = '[' + rsComboRange + ']',
rsDigits = '\\d+',
rsDingbat = '[' + rsDingbatRange + ']',
rsLower = '[' + rsLowerRange + ']',
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
rsModifier = '(?:\\ud83c[\\udffb-\\udfff])',
rsNonAstral = '[^' + rsAstralRange + ']',
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
rsUpper = '[' + rsUpperRange + ']',
rsZWJ = '\\u200d';
/** Used to compose unicode regexes. */
var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')',
rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')',
reOptMod = rsModifier + '?',
rsOptVar = '[' + rsVarRange + ']?',
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsSeq = rsOptVar + reOptMod + rsOptJoin,
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
/** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */
var reComboMark = RegExp(rsCombo, 'g');
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
var reComplexSymbol = RegExp(rsSymbol + rsSeq, 'g');
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
/** Used to match non-compound words composed of alphanumeric characters. */
var reBasicWord = /[a-zA-Z0-9]+/g;
/** Used to match complex or compound words. */
var reComplexWord = RegExp([
rsUpper + '?' + rsLower + '+(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
rsUpperMisc + '+(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')',
rsUpper + '?' + rsLowerMisc + '+',
rsDigits + '(?:' + rsLowerMisc + '+)?',
rsEmoji
].join('|'), 'g');
/** Used to detect strings that need a more robust regexp to match words. */
var reHasComplexWord = /[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
/** Used to assign default `context` object properties. */
var contextProps = [
'Array', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function',
'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_',
'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
];
/** Used to make template sourceURLs easier to identify. */
var templateCounter = -1;
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dateTag] = typedArrayTags[errorTag] =
typedArrayTags[funcTag] = typedArrayTags[mapTag] =
typedArrayTags[numberTag] = typedArrayTags[objectTag] =
typedArrayTags[regexpTag] = typedArrayTags[setTag] =
typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
/** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
cloneableTags[dateTag] = cloneableTags[float32Tag] =
cloneableTags[float64Tag] = cloneableTags[int8Tag] =
cloneableTags[int16Tag] = cloneableTags[int32Tag] =
cloneableTags[mapTag] = cloneableTags[numberTag] =
cloneableTags[objectTag] = cloneableTags[regexpTag] =
cloneableTags[setTag] = cloneableTags[stringTag] =
cloneableTags[symbolTag] = cloneableTags[uint8Tag] =
cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] =
cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false;
/** Used to map latin-1 supplementary letters to basic latin letters. */
var deburredLetters = {
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
'\xc7': 'C', '\xe7': 'c',
'\xd0': 'D', '\xf0': 'd',
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
'\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
'\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
'\xd1': 'N', '\xf1': 'n',
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
'\xc6': 'Ae', '\xe6': 'ae',
'\xde': 'Th', '\xfe': 'th',
'\xdf': 'ss'
};
/** Used to map characters to HTML entities. */
var htmlEscapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
'`': '`'
};
/** Used to map HTML entities to characters. */
var htmlUnescapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
''': "'",
'`': '`'
};
/** Used to determine if values are of the language type `Object`. */
var objectTypes = {
'function': true,
'object': true
};
/** Used to escape characters for inclusion in compiled string literals. */
var stringEscapes = {
'\\': '\\',
"'": "'",
'\n': 'n',
'\r': 'r',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
/** Built-in method references without a dependency on `root`. */
var freeParseFloat = parseFloat,
freeParseInt = parseInt;
/** Detect free variable `exports`. */
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
/** Detect free variable `module`. */
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
/** Detect free variable `global` from Node.js. */
var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
/** Detect free variable `self`. */
var freeSelf = checkGlobal(objectTypes[typeof self] && self);
/** Detect free variable `window`. */
var freeWindow = checkGlobal(objectTypes[typeof window] && window);
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
/** Detect `this` as the global object. */
var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
/**
* Used as a reference to the global object.
*
* The `this` value is used if it's the global object to avoid Greasemonkey's
* restricted `window` object, otherwise the `window` object is used.
*/
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();
/*--------------------------------------------------------------------------*/
/**
* Adds the key-value `pair` to `map`.
*
* @private
* @param {Object} map The map to modify.
* @param {Array} pair The key-value pair to add.
* @returns {Object} Returns `map`.
*/
function addMapEntry(map, pair) {
map.set(pair[0], pair[1]);
return map;
}
/**
* Adds `value` to `set`.
*
* @private
* @param {Object} set The set to modify.
* @param {*} value The value to add.
* @returns {Object} Returns `set`.
*/
function addSetEntry(set, value) {
set.add(value);
return set;
}
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
*
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`.
*/
function apply(func, thisArg, args) {
var length = args ? args.length : 0;
switch (length) {
case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]);
case 2: return func.call(thisArg, args[0], args[1]);
case 3: return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
/**
* Creates a new array concatenating `array` with `other`.
*
* @private
* @param {Array} array The first array to concatenate.
* @param {Array} other The second array to concatenate.
* @returns {Array} Returns the new concatenated array.
*/
function arrayConcat(array, other) {
var index = -1,
length = array.length,
othIndex = -1,
othLength = other.length,
result = Array(length + othLength);
while (++index < length) {
result[index] = array[index];
}
while (++othIndex < othLength) {
result[index++] = other[othIndex];
}
return result;
}
/**
* A specialized version of `_.forEach` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEach(array, iteratee) {
var index = -1,
length = array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
/**
* A specialized version of `_.forEachRight` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEachRight(array, iteratee) {
var length = array.length;
while (length--) {
if (iteratee(array[length], length, array) === false) {
break;
}
}
return array;
}
/**
* A specialized version of `_.every` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`.
*/
function arrayEvery(array, predicate) {
var index = -1,
length = array.length;
while (++index < length) {
if (!predicate(array[index], index, array)) {
return false;
}
}
return true;
}
/**
* A specialized version of `_.filter` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
var index = -1,
length = array.length,
resIndex = -1,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[++resIndex] = value;
}
}
return result;
}
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} array The array to search.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
return !!array.length && baseIndexOf(array, value, 0) > -1;
}
/**
* A specialized version of `_.includesWith` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} array The array to search.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array.length;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
/**
* A specialized version of `_.reduce` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initFromArray] Specify using the first element of `array` as the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduce(array, iteratee, accumulator, initFromArray) {
var index = -1,
length = array.length;
if (initFromArray && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
/**
* A specialized version of `_.reduceRight` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initFromArray] Specify using the last element of `array` as the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
var length = array.length;
if (initFromArray && length) {
accumulator = array[--length];
}
while (length--) {
accumulator = iteratee(accumulator, array[length], length, array);
}
return accumulator;
}
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array.length;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
/**
* The base implementation of methods like `_.max` and `_.min` which accepts a
* `comparator` to determine the extremum value.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The iteratee invoked per iteration.
* @param {Function} comparator The comparator used to compare values.
* @returns {*} Returns the extremum value.
*/
function baseExtremum(array, iteratee, comparator) {
var index = -1,
length = array.length;
while (++index < length) {
var value = array[index],
current = iteratee(value);
if (current != null && (computed === undefined
? current === current
: comparator(current, computed)
)) {
var computed = current,
result = value;
}
}
return result;
}
/**
* The base implementation of methods like `_.find` and `_.findKey`, without
* support for iteratee shorthands, which iterates over `collection` using
* the provided `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to search.
* @param {Function} predicate The function invoked per iteration.
* @param {Function} eachFunc The function to iterate over `collection`.
* @param {boolean} [retKey] Specify returning the key of the found element instead of the element itself.
* @returns {*} Returns the found element or its key, else `undefined`.
*/
function baseFind(collection, predicate, eachFunc, retKey) {
var result;
eachFunc(collection, function(value, key, collection) {
if (predicate(value, key, collection)) {
result = retKey ? key : value;
return false;
}
});
return result;
}
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to search.
* @param {Function} predicate The function invoked per iteration.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromRight) {
var length = array.length,
index = fromRight ? length : -1;
while ((fromRight ? index-- : ++index < length)) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
if (value !== value) {
return indexOfNaN(array, fromIndex);
}
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.reduce` and `_.reduceRight`, without support
* for iteratee shorthands, which iterates over `collection` using the provided
* `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} accumulator The initial value.
* @param {boolean} initFromCollection Specify using the first or last element of `collection` as the initial value.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the accumulated value.
*/
function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
eachFunc(collection, function(value, index, collection) {
accumulator = initFromCollection
? (initFromCollection = false, value)
: iteratee(accumulator, value, index, collection);
});
return accumulator;
}
/**
* The base implementation of `_.sortBy` which uses `comparer` to define
* the sort order of `array` and replaces criteria objects with their
* corresponding values.
*
* @private
* @param {Array} array The array to sort.
* @param {Function} comparer The function to define sort order.
* @returns {Array} Returns `array`.
*/
function baseSortBy(array, comparer) {
var length = array.length;
array.sort(comparer);
while (length--) {
array[length] = array[length].value;
}
return array;
}
/**
* The base implementation of `_.sum` without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the sum.
*/
function baseSum(array, iteratee) {
var result,
index = -1,
length = array.length;
while (++index < length) {
var current = iteratee(array[index]);
if (current !== undefined) {
result = result === undefined ? current : (result + current);
}
}
return result;
}
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
/**
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
* of key-value pairs for `object` corresponding to the property names of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the new array of key-value pairs.
*/
function baseToPairs(object, props) {
return arrayMap(props, function(key) {
return [key, object[key]];
});
}
/**
* The base implementation of `_.unary` without support for storing wrapper metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new function.
*/
function baseUnary(func) {
return function(value) {
return func(value);
};
}
/**
* The base implementation of `_.values` and `_.valuesIn` which creates an
* array of `object` property values corresponding to the property names
* of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the array of property values.
*/
function baseValues(object, props) {
return arrayMap(props, function(key) {
return object[key];
});
}
/**
* Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
* that is not found in the character symbols.
*
* @private
* @param {Array} strSymbols The string symbols to inspect.
* @param {Array} chrSymbols The character symbols to find.
* @returns {number} Returns the index of the first unmatched string symbol.
*/
function charsStartIndex(strSymbols, chrSymbols) {
var index = -1,
length = strSymbols.length;
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
/**
* Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
* that is not found in the character symbols.
*
* @private
* @param {Array} strSymbols The string symbols to inspect.
* @param {Array} chrSymbols The character symbols to find.
* @returns {number} Returns the index of the last unmatched string symbol.
*/
function charsEndIndex(strSymbols, chrSymbols) {
var index = strSymbols.length;
while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
/**
* Checks if `value` is a global object.
*
* @private
* @param {*} value The value to check.
* @returns {null|Object} Returns `value` if it's a global object, else `null`.
*/
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
/**
* Compares values to sort them in ascending order.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {number} Returns the sort order indicator for `value`.
*/
function compareAscending(value, other) {
if (value !== other) {
var valIsNull = value === null,
valIsUndef = value === undefined,
valIsReflexive = value === value;
var othIsNull = other === null,
othIsUndef = other === undefined,
othIsReflexive = other === other;
if ((value > other && !othIsNull) || !valIsReflexive ||
(valIsNull && !othIsUndef && othIsReflexive) ||
(valIsUndef && othIsReflexive)) {
return 1;
}
if ((value < other && !valIsNull) || !othIsReflexive ||
(othIsNull && !valIsUndef && valIsReflexive) ||
(othIsUndef && valIsReflexive)) {
return -1;
}
}
return 0;
}
/**
* Used by `_.orderBy` to compare multiple properties of a value to another
* and stable sort them.
*
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
* specify an order of "desc" for descending or "asc" for ascending sort order
* of corresponding values.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {boolean[]|string[]} orders The order to sort by for each property.
* @returns {number} Returns the sort order indicator for `object`.
*/
function compareMultiple(object, other, orders) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length,
ordersLength = orders.length;
while (++index < length) {
var result = compareAscending(objCriteria[index], othCriteria[index]);
if (result) {
if (index >= ordersLength) {
return result;
}
var order = orders[index];
return result * (order == 'desc' ? -1 : 1);
}
}
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
// that causes it, under certain circumstances, to provide the same value for
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
// for more details.
//
// This also ensures a stable sort in V8 and other engines.
// See https://code.google.com/p/v8/issues/detail?id=90 for more details.
return object.index - other.index;
}
/**
* Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
*
* @private
* @param {string} letter The matched letter to deburr.
* @returns {string} Returns the deburred letter.
*/
function deburrLetter(letter) {
return deburredLetters[letter];
}
/**
* Used by `_.escape` to convert characters to HTML entities.
*
* @private
* @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character.
*/
function escapeHtmlChar(chr) {
return htmlEscapes[chr];
}
/**
* Used by `_.template` to escape characters for inclusion in compiled string literals.
*
* @private
* @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character.
*/
function escapeStringChar(chr) {
return '\\' + stringEscapes[chr];
}
/**
* Gets the index at which the first occurrence of `NaN` is found in `array`.
*
* @private
* @param {Array} array The array to search.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched `NaN`, else `-1`.
*/
function indexOfNaN(array, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 0 : -1);
while ((fromRight ? index-- : ++index < length)) {
var other = array[index];
if (other !== other) {
return index;
}
}
return -1;
}
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
length = length == null ? MAX_SAFE_INTEGER : length;
return value > -1 && value % 1 == 0 && value < length;
}
/**
* Converts `iterator` to an array.
*
* @private
* @param {Object} iterator The iterator to convert.
* @returns {Array} Returns the converted array.
*/
function iteratorToArray(iterator) {
var data,
result = [];
while (!(data = iterator.next()).done) {
result.push(data.value);
}
return result;
}
/**
* Converts `map` to an array.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the converted array.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
/**
* Replaces all `placeholder` elements in `array` with an internal placeholder
* and returns an array of their indexes.
*
* @private
* @param {Array} array The array to modify.
* @param {*} placeholder The placeholder to replace.
* @returns {Array} Returns the new array of placeholder indexes.
*/
function replaceHolders(array, placeholder) {
var index = -1,
length = array.length,
resIndex = -1,
result = [];
while (++index < length) {
if (array[index] === placeholder) {
array[index] = PLACEHOLDER;
result[++resIndex] = index;
}
}
return result;
}
/**
* Converts `set` to an array.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the converted array.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
/**
* Gets the number of symbols in `string`.
*
* @param {string} string The string to inspect.
* @returns {number} Returns the string size.
*/
function stringSize(string) {
if (!(string && reHasComplexSymbol.test(string))) {
return string.length;
}
var result = reComplexSymbol.lastIndex = 0;
while (reComplexSymbol.test(string)) {
result++;
}
return result;
}
/**
* Converts `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function stringToArray(string) {
return string.match(reComplexSymbol);
}
/**
* Used by `_.unescape` to convert HTML entities to characters.
*
* @private
* @param {string} chr The matched character to unescape.
* @returns {string} Returns the unescaped character.
*/
function unescapeHtmlChar(chr) {
return htmlUnescapes[chr];
}
/*--------------------------------------------------------------------------*/
/**
* Create a new pristine `lodash` function using the `context` object.
*
* @static
* @memberOf _
* @category Utility
* @param {Object} [context=root] The context object.
* @returns {Function} Returns a new `lodash` function.
* @example
*
* _.mixin({ 'foo': _.constant('foo') });
*
* var lodash = _.runInContext();
* lodash.mixin({ 'bar': lodash.constant('bar') });
*
* _.isFunction(_.foo);
* // => true
* _.isFunction(_.bar);
* // => false
*
* lodash.isFunction(lodash.foo);
* // => false
* lodash.isFunction(lodash.bar);
* // => true
*
* // using `context` to mock `Date#getTime` use in `_.now`
* var mock = _.runInContext({
* 'Date': function() {
* return { 'getTime': getTimeMock };
* }
* });
*
* // or creating a suped-up `defer` in Node.js
* var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
*/
function runInContext(context) {
context = context ? _.defaults({}, context, _.pick(root, contextProps)) : root;
/** Built-in constructor references. */
var Date = context.Date,
Error = context.Error,
Math = context.Math,
RegExp = context.RegExp,
TypeError = context.TypeError;
/** Used for built-in method references. */
var arrayProto = context.Array.prototype,
objectProto = context.Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = context.Function.prototype.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to generate unique IDs. */
var idCounter = 0;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to restore the original `_` reference in `_.noConflict`. */
var oldDash = root._;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var _Symbol = context.Symbol,
Reflect = context.Reflect,
Uint8Array = context.Uint8Array,
clearTimeout = context.clearTimeout,
enumerate = Reflect ? Reflect.enumerate : undefined,
getPrototypeOf = Object.getPrototypeOf,
getOwnPropertySymbols = Object.getOwnPropertySymbols,
iteratorSymbol = typeof (iteratorSymbol = _Symbol && _Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
setTimeout = context.setTimeout,
splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
nativeFloor = Math.floor,
nativeIsFinite = context.isFinite,
nativeJoin = arrayProto.join,
nativeKeys = Object.keys,
nativeMax = Math.max,
nativeMin = Math.min,
nativeParseInt = context.parseInt,
nativeRandom = Math.random,
nativeReverse = arrayProto.reverse;
/* Built-in method references that are verified to be native. */
var Map = getNative(context, 'Map'),
Set = getNative(context, 'Set'),
WeakMap = getNative(context, 'WeakMap'),
nativeCreate = getNative(Object, 'create');
/** Used to store function metadata. */
var metaMap = WeakMap && new WeakMap;
/** Used to detect maps and sets. */
var mapCtorString = Map ? funcToString.call(Map) : '',
setCtorString = Set ? funcToString.call(Set) : '';
/** Used to convert symbols to primitives and strings. */
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
symbolValueOf = _Symbol ? symbolProto.valueOf : undefined,
symbolToString = _Symbol ? symbolProto.toString : undefined;
/** Used to lookup unminified function names. */
var realNames = {};
/*------------------------------------------------------------------------*/
/**
* Creates a `lodash` object which wraps `value` to enable implicit method
* chaining. Methods that operate on and return arrays, collections, and
* functions can be chained together. Methods that retrieve a single value or
* may return a primitive value will automatically end the chain sequence and
* return the unwrapped value. Otherwise, the value must be unwrapped with
* `_#value`.
*
* Explicit chaining, which must be unwrapped with `_#value` in all cases,
* may be enabled using `_.chain`.
*
* The execution of chained methods is lazy, that is, it's deferred until
* `_#value` is implicitly or explicitly called.
*
* Lazy evaluation allows several methods to support shortcut fusion. Shortcut
* fusion is an optimization to merge iteratee calls; this avoids the creation
* of intermediate arrays and can greatly reduce the number of iteratee executions.
* Sections of a chain sequence qualify for shortcut fusion if the section is
* applied to an array of at least two hundred elements and any iteratees
* accept only one argument. The heuristic for whether a section qualifies
* for shortcut fusion is subject to change.
*
* Chaining is supported in custom builds as long as the `_#value` method is
* directly or indirectly included in the build.
*
* In addition to lodash methods, wrappers have `Array` and `String` methods.
*
* The wrapper `Array` methods are:
* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
*
* The wrapper `String` methods are:
* `replace` and `split`
*
* The wrapper methods that support shortcut fusion are:
* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
*
* The chainable wrapper methods are:
* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`,
* `at`, `before`, `bind`, `bindAll`, `bindKey`, `chain`, `chunk`, `commit`,
* `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`,
* `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`,
* `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`,
* `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`,
* `flowRight`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`,
* `forOwnRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`,
* `intersection`, `intersectionBy`, `intersectionWith`, invert`, `invokeMap`,
* `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`,
* `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`,
* `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`,
* `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`,
* `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`,
* `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`,
* `reject`, `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`,
* `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`,
* `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`,
* `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`,
* `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`,
* `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `without`,
* `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, and `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`,
* `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`,
* `findLast`, `findLastIndex`, `findLastKey`, `floor`, `get`, `gt`, `gte`,
* `has`, `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`,
* `invoke`, `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`,
* `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`,
* `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`,
* `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`,
* `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`,
* `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`, `last`,
* `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`,
* `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`, `padEnd`,
* `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`,
* `result`, `round`, `runInContext`, `sample`, `shift`, `size`, `snakeCase`,
* `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`,
* `startCase`, `startsWith`, `subtract`, `sum`, sumBy`, `template`, `times`,
* `toLower`, `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, toString`,
* `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`,
* `upperCase`, `upperFirst`, `value`, and `words`
*
* @name _
* @constructor
* @category Chain
* @param {*} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2, 3]);
*
* // returns an unwrapped value
* wrapped.reduce(_.add);
* // => 6
*
* // returns a wrapped value
* var squares = wrapped.map(square);
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/
function lodash(value) {
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
if (value instanceof LodashWrapper) {
return value;
}
if (hasOwnProperty.call(value, '__wrapped__')) {
return wrapperClone(value);
}
}
return new LodashWrapper(value);
}
/**
* The function whose prototype all chaining wrappers inherit from.
*
* @private
*/
function baseLodash() {
// No operation performed.
}
/**
* The base constructor for creating `lodash` wrapper objects.
*
* @private
* @param {*} value The value to wrap.
* @param {boolean} [chainAll] Enable chaining for all wrapper methods.
*/
function LodashWrapper(value, chainAll) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__chain__ = !!chainAll;
this.__index__ = 0;
this.__values__ = undefined;
}
/**
* By default, the template delimiters used by lodash are like those in
* embedded Ruby (ERB). Change the following template settings to use
* alternative delimiters.
*
* @static
* @memberOf _
* @type Object
*/
lodash.templateSettings = {
/**
* Used to detect `data` property values to be HTML-escaped.
*
* @memberOf _.templateSettings
* @type RegExp
*/
'escape': reEscape,
/**
* Used to detect code to be evaluated.
*
* @memberOf _.templateSettings
* @type RegExp
*/
'evaluate': reEvaluate,
/**
* Used to detect `data` property values to inject.
*
* @memberOf _.templateSettings
* @type RegExp
*/
'interpolate': reInterpolate,
/**
* Used to reference the data object in the template text.
*
* @memberOf _.templateSettings
* @type string
*/
'variable': '',
/**
* Used to import variables into the compiled template.
*
* @memberOf _.templateSettings
* @type Object
*/
'imports': {
/**
* A reference to the `lodash` function.
*
* @memberOf _.templateSettings.imports
* @type Function
*/
'_': lodash
}
};
/*------------------------------------------------------------------------*/
/**
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
*
* @private
* @param {*} value The value to wrap.
*/
function LazyWrapper(value) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__dir__ = 1;
this.__filtered__ = false;
this.__iteratees__ = [];
this.__takeCount__ = MAX_ARRAY_LENGTH;
this.__views__ = [];
}
/**
* Creates a clone of the lazy wrapper object.
*
* @private
* @name clone
* @memberOf LazyWrapper
* @returns {Object} Returns the cloned `LazyWrapper` object.
*/
function lazyClone() {
var result = new LazyWrapper(this.__wrapped__);
result.__actions__ = copyArray(this.__actions__);
result.__dir__ = this.__dir__;
result.__filtered__ = this.__filtered__;
result.__iteratees__ = copyArray(this.__iteratees__);
result.__takeCount__ = this.__takeCount__;
result.__views__ = copyArray(this.__views__);
return result;
}
/**
* Reverses the direction of lazy iteration.
*
* @private
* @name reverse
* @memberOf LazyWrapper
* @returns {Object} Returns the new reversed `LazyWrapper` object.
*/
function lazyReverse() {
if (this.__filtered__) {
var result = new LazyWrapper(this);
result.__dir__ = -1;
result.__filtered__ = true;
} else {
result = this.clone();
result.__dir__ *= -1;
}
return result;
}
/**
* Extracts the unwrapped value from its lazy wrapper.
*
* @private
* @name value
* @memberOf LazyWrapper
* @returns {*} Returns the unwrapped value.
*/
function lazyValue() {
var array = this.__wrapped__.value(),
dir = this.__dir__,
isArr = isArray(array),
isRight = dir < 0,
arrLength = isArr ? array.length : 0,
view = getView(0, arrLength, this.__views__),
start = view.start,
end = view.end,
length = end - start,
index = isRight ? end : (start - 1),
iteratees = this.__iteratees__,
iterLength = iteratees.length,
resIndex = 0,
takeCount = nativeMin(length, this.__takeCount__);
if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {
return baseWrapperValue(array, this.__actions__);
}
var result = [];
outer:
while (length-- && resIndex < takeCount) {
index += dir;
var iterIndex = -1,
value = array[index];
while (++iterIndex < iterLength) {
var data = iteratees[iterIndex],
iteratee = data.iteratee,
type = data.type,
computed = iteratee(value);
if (type == LAZY_MAP_FLAG) {
value = computed;
} else if (!computed) {
if (type == LAZY_FILTER_FLAG) {
continue outer;
} else {
break outer;
}
}
}
result[resIndex++] = value;
}
return result;
}
/*------------------------------------------------------------------------*/
/**
* Creates an hash object.
*
* @private
* @returns {Object} Returns the new hash object.
*/
function Hash() {}
/**
* Removes `key` and its value from the hash.
*
* @private
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(hash, key) {
return hashHas(hash, key) && delete hash[key];
}
/**
* Gets the hash value for `key`.
*
* @private
* @param {Object} hash The hash to query.
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(hash, key) {
if (nativeCreate) {
var result = hash[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(hash, key) ? hash[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @param {Object} hash The hash to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(hash, key) {
return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
*/
function hashSet(hash, key, value) {
hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
}
/*------------------------------------------------------------------------*/
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @param {Array} [values] The values to cache.
*/
function MapCache(values) {
var index = -1,
length = values ? values.length : 0;
this.clear();
while (++index < length) {
var entry = values[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapClear() {
this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapDelete(key) {
var data = this.__data__;
if (isKeyable(key)) {
return hashDelete(typeof key == 'string' ? data.string : data.hash, key);
}
return Map ? data.map['delete'](key) : assocDelete(data.map, key);
}
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapGet(key) {
var data = this.__data__;
if (isKeyable(key)) {
return hashGet(typeof key == 'string' ? data.string : data.hash, key);
}
return Map ? data.map.get(key) : assocGet(data.map, key);
}
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapHas(key) {
var data = this.__data__;
if (isKeyable(key)) {
return hashHas(typeof key == 'string' ? data.string : data.hash, key);
}
return Map ? data.map.has(key) : assocHas(data.map, key);
}
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache object.
*/
function mapSet(key, value) {
var data = this.__data__;
if (isKeyable(key)) {
hashSet(typeof key == 'string' ? data.string : data.hash, key, value);
} else if (Map) {
data.map.set(key, value);
} else {
assocSet(data.map, key, value);
}
return this;
}
/*------------------------------------------------------------------------*/
/**
*
* Creates a set cache object to store unique values.
*
* @private
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values ? values.length : 0;
this.__data__ = new MapCache;
while (++index < length) {
this.push(values[index]);
}
}
/**
* Checks if `value` is in `cache`.
*
* @private
* @param {Object} cache The set cache to search.
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function cacheHas(cache, value) {
var map = cache.__data__;
if (isKeyable(value)) {
var data = map.__data__,
hash = typeof value == 'string' ? data.string : data.hash;
return hash[value] === HASH_UNDEFINED;
}
return map.has(value);
}
/**
* Adds `value` to the set cache.
*
* @private
* @name push
* @memberOf SetCache
* @param {*} value The value to cache.
*/
function cachePush(value) {
var map = this.__data__;
if (isKeyable(value)) {
var data = map.__data__,
hash = typeof value == 'string' ? data.string : data.hash;
hash[value] = HASH_UNDEFINED;
}
else {
map.set(value, HASH_UNDEFINED);
}
}
/*------------------------------------------------------------------------*/
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @param {Array} [values] The values to cache.
*/
function Stack(values) {
var index = -1,
length = values ? values.length : 0;
this.clear();
while (++index < length) {
var entry = values[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = { 'array': [], 'map': null };
}
/**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
var data = this.__data__,
array = data.array;
return array ? assocDelete(array, key) : data.map['delete'](key);
}
/**
* Gets the stack value for `key`.
*
* @private
* @name get
* @memberOf Stack
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function stackGet(key) {
var data = this.__data__,
array = data.array;
return array ? assocGet(array, key) : data.map.get(key);
}
/**
* Checks if a stack value for `key` exists.
*
* @private
* @name has
* @memberOf Stack
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function stackHas(key) {
var data = this.__data__,
array = data.array;
return array ? assocHas(array, key) : data.map.has(key);
}
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache object.
*/
function stackSet(key, value) {
var data = this.__data__,
array = data.array;
if (array) {
if (array.length < (LARGE_ARRAY_SIZE - 1)) {
assocSet(array, key, value);
} else {
data.array = null;
data.map = new MapCache(array);
}
}
var map = data.map;
if (map) {
map.set(key, value);
}
return this;
}
/*------------------------------------------------------------------------*/
/**
* Removes `key` and its value from the associative array.
*
* @private
* @param {Array} array The array to query.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function assocDelete(array, key) {
var index = assocIndexOf(array, key);
if (index < 0) {
return false;
}
var lastIndex = array.length - 1;
if (index == lastIndex) {
array.pop();
} else {
splice.call(array, index, 1);
}
return true;
}
/**
* Gets the associative array value for `key`.
*
* @private
* @param {Array} array The array to query.
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function assocGet(array, key) {
var index = assocIndexOf(array, key);
return index < 0 ? undefined : array[index][1];
}
/**
* Checks if an associative array value for `key` exists.
*
* @private
* @param {Array} array The array to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function assocHas(array, key) {
return assocIndexOf(array, key) > -1;
}
/**
* Gets the index at which the first occurrence of `key` is found in `array`
* of key-value pairs.
*
* @private
* @param {Array} array The array to search.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
/**
* Sets the associative array `key` to `value`.
*
* @private
* @param {Array} array The array to modify.
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
*/
function assocSet(array, key, value) {
var index = assocIndexOf(array, key);
if (index < 0) {
array.push([key, value]);
} else {
array[index][1] = value;
}
}
/*------------------------------------------------------------------------*/
/**
* Used by `_.defaults` to customize its `_.assignIn` use.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to assign.
* @param {Object} object The parent object of `objValue`.
* @returns {*} Returns the value to assign.
*/
function assignInDefaults(objValue, srcValue, key, object) {
if (objValue === undefined ||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
return srcValue;
}
return objValue;
}
/**
* This function is like `assignValue` except that it doesn't assign `undefined` values.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignMergeValue(object, key, value) {
if ((value !== undefined && !eq(object[key], value)) ||
(typeof key == 'number' && value === undefined && !(key in object))) {
object[key] = value;
}
}
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if ((!eq(objValue, value) ||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||
(value === undefined && !(key in object))) {
object[key] = value;
}
}
/**
* The base implementation of `_.assign` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return object && copyObject(source, keys(source), object);
}
/**
* The base implementation of `_.at` without support for individual paths.
*
* @private
* @param {Object} object The object to iterate over.
* @param {string[]} paths The property paths of elements to pick.
* @returns {Array} Returns the new array of picked elements.
*/
function baseAt(object, paths) {
var index = -1,
isNil = object == null,
length = paths.length,
result = Array(length);
while (++index < length) {
result[index] = isNil ? undefined : get(object, paths[index]);
}
return result;
}
/**
* The base implementation of `_.clamp` which doesn't coerce arguments to numbers.
*
* @private
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
*/
function baseClamp(number, lower, upper) {
if (number === number) {
if (upper !== undefined) {
number = number <= upper ? number : upper;
}
if (lower !== undefined) {
number = number >= lower ? number : lower;
}
}
return number;
}
/**
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
* traversed objects.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value.
*/
function baseClone(value, isDeep, customizer, key, object, stack) {
var result;
if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value);
}
if (result !== undefined) {
return result;
}
if (!isObject(value)) {
return value;
}
var isArr = isArray(value);
if (isArr) {
result = initCloneArray(value);
if (!isDeep) {
return copyArray(value, result);
}
} else {
var tag = getTag(value),
isFunc = tag == funcTag || tag == genTag;
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
if (isHostObject(value)) {
return object ? value : {};
}
result = initCloneObject(isFunc ? {} : value);
if (!isDeep) {
return copySymbols(value, baseAssign(result, value));
}
} else {
return cloneableTags[tag]
? initCloneByTag(value, tag, isDeep)
: (object ? value : {});
}
}
// Check for circular references and return its corresponding clone.
stack || (stack = new Stack);
var stacked = stack.get(value);
if (stacked) {
return stacked;
}
stack.set(value, result);
// Recursively populate clone (susceptible to call stack limits).
(isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
assignValue(result, key, baseClone(subValue, isDeep, customizer, key, value, stack));
});
return isArr ? result : copySymbols(value, result);
}
/**
* The base implementation of `_.conforms` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property predicates to conform to.
* @returns {Function} Returns the new function.
*/
function baseConforms(source) {
var props = keys(source),
length = props.length;
return function(object) {
if (object == null) {
return !length;
}
var index = length;
while (index--) {
var key = props[index],
predicate = source[key],
value = object[key];
if ((value === undefined && !(key in Object(object))) || !predicate(value)) {
return false;
}
}
return true;
};
}
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} prototype The object to inherit from.
* @returns {Object} Returns the new object.
*/
var baseCreate = (function() {
function object() {}
return function(prototype) {
if (isObject(prototype)) {
object.prototype = prototype;
var result = new object;
object.prototype = undefined;
}
return result || {};
};
}());
/**
* The base implementation of `_.delay` and `_.defer` which accepts an array
* of `func` arguments.
*
* @private
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @param {Object} args The arguments provide to `func`.
* @returns {number} Returns the timer id.
*/
function baseDelay(func, wait, args) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return setTimeout(function() { func.apply(undefined, args); }, wait);
}
/**
* The base implementation of methods like `_.difference` without support for
* excluding multiple arrays or iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Array} values The values to exclude.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
*/
function baseDifference(array, values, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
isCommon = true,
length = array.length,
result = [],
valuesLength = values.length;
if (!length) {
return result;
}
if (iteratee) {
values = arrayMap(values, baseUnary(iteratee));
}
if (comparator) {
includes = arrayIncludesWith;
isCommon = false;
}
else if (values.length >= LARGE_ARRAY_SIZE) {
includes = cacheHas;
isCommon = false;
values = new SetCache(values);
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
if (isCommon && computed === computed) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values[valuesIndex] === computed) {
continue outer;
}
}
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.forEach` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEach = createBaseEach(baseForOwn);
/**
* The base implementation of `_.forEachRight` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEachRight = createBaseEach(baseForOwnRight, true);
/**
* The base implementation of `_.every` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`
*/
function baseEvery(collection, predicate) {
var result = true;
baseEach(collection, function(value, index, collection) {
result = !!predicate(value, index, collection);
return result;
});
return result;
}
/**
* The base implementation of `_.fill` without an iteratee call guard.
*
* @private
* @param {Array} array The array to fill.
* @param {*} value The value to fill `array` with.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns `array`.
*/
function baseFill(array, value, start, end) {
var length = array.length;
start = toInteger(start);
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = (end === undefined || end > length) ? length : toInteger(end);
if (end < 0) {
end += length;
}
end = start > end ? 0 : toLength(end);
while (start < end) {
array[start++] = value;
}
return array;
}
/**
* The base implementation of `_.filter` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function baseFilter(collection, predicate) {
var result = [];
baseEach(collection, function(value, index, collection) {
if (predicate(value, index, collection)) {
result.push(value);
}
});
return result;
}
/**
* The base implementation of `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {boolean} [isDeep] Specify a deep flatten.
* @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, isDeep, isStrict, result) {
result || (result = []);
var index = -1,
length = array.length;
while (++index < length) {
var value = array[index];
if (isArrayLikeObject(value) &&
(isStrict || isArray(value) || isArguments(value))) {
if (isDeep) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, isDeep, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
/**
* The base implementation of `baseForIn` and `baseForOwn` which iterates
* over `object` properties returned by `keysFunc` invoking `iteratee` for
* each property. Iteratee functions may exit iteration early by explicitly
* returning `false`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseFor = createBaseFor();
/**
* This function is like `baseFor` except that it iterates over properties
* in the opposite order.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseForRight = createBaseFor(true);
/**
* The base implementation of `_.forIn` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForIn(object, iteratee) {
return object == null ? object : baseFor(object, iteratee, keysIn);
}
/**
* The base implementation of `_.forOwn` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwn(object, iteratee) {
return object && baseFor(object, iteratee, keys);
}
/**
* The base implementation of `_.forOwnRight` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwnRight(object, iteratee) {
return object && baseForRight(object, iteratee, keys);
}
/**
* The base implementation of `_.functions` which creates an array of
* `object` function property names filtered from those provided.
*
* @private
* @param {Object} object The object to inspect.
* @param {Array} props The property names to filter.
* @returns {Array} Returns the new array of filtered property names.
*/
function baseFunctions(object, props) {
return arrayFilter(props, function(key) {
return isFunction(object[key]);
});
}
/**
* The base implementation of `_.get` without support for default values.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = isKey(path, object) ? [path + ''] : baseToPath(path);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[path[index++]];
}
return (index && index == length) ? object : undefined;
}
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototypeOf(object) === null);
}
/**
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn(object, key) {
return key in Object(object);
}
/**
* The base implementation of `_.inRange` which doesn't coerce arguments to numbers.
*
* @private
* @param {number} number The number to check.
* @param {number} start The start of the range.
* @param {number} end The end of the range.
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
*/
function baseInRange(number, start, end) {
return number >= nativeMin(start, end) && number < nativeMax(start, end);
}
/**
* The base implementation of methods like `_.intersection`, without support
* for iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of shared values.
*/
function baseIntersection(arrays, iteratee, comparator) {
var includes = comparator ? arrayIncludesWith : arrayIncludes,
othLength = arrays.length,
othIndex = othLength,
caches = Array(othLength),
result = [];
while (othIndex--) {
var array = arrays[othIndex];
if (othIndex && iteratee) {
array = arrayMap(array, baseUnary(iteratee));
}
caches[othIndex] = !comparator && (iteratee || array.length >= 120)
? new SetCache(othIndex && array)
: undefined;
}
array = arrays[0];
var index = -1,
length = array.length,
seen = caches[0];
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) {
var othIndex = othLength;
while (--othIndex) {
var cache = caches[othIndex];
if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) {
continue outer;
}
}
if (seen) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.invoke` without support for individual
* method arguments.
*
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {Array} args The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
*/
function baseInvoke(object, path, args) {
if (!isKey(path, object)) {
path = baseToPath(path);
object = parent(object, path);
path = last(path);
}
var func = object == null ? object : object[path];
return func == null ? undefined : apply(func, object, args);
}
/**
* The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [customizer] The function to customize comparisons.
* @param {boolean} [bitmask] The bitmask of comparison flags.
* The bitmask may be composed of the following flags:
* 1 - Unordered comparison
* 2 - Partial comparison
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, customizer, bitmask, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
}
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} [customizer] The function to customize comparisons.
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = arrayTag,
othTag = arrayTag;
if (!objIsArr) {
objTag = getTag(object);
if (objTag == argsTag) {
objTag = objectTag;
} else if (objTag != objectTag) {
objIsArr = isTypedArray(object);
}
}
if (!othIsArr) {
othTag = getTag(other);
if (othTag == argsTag) {
othTag = objectTag;
} else if (othTag != objectTag) {
othIsArr = isTypedArray(other);
}
}
var objIsObj = objTag == objectTag && !isHostObject(object),
othIsObj = othTag == objectTag && !isHostObject(other),
isSameTag = objTag == othTag;
if (isSameTag && !(objIsArr || objIsObj)) {
return equalByTag(object, other, objTag, equalFunc, customizer, bitmask);
}
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
if (!isPartial) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack);
return (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, bitmask, stack);
}
/**
* The base implementation of `_.isMatch` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Array} matchData The property names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
function baseIsMatch(object, source, matchData, customizer) {
var index = matchData.length,
length = index,
noCustomizer = !customizer;
if (object == null) {
return !length;
}
object = Object(object);
while (index--) {
var data = matchData[index];
if ((noCustomizer && data[2])
? data[1] !== object[data[0]]
: !(data[0] in object)
) {
return false;
}
}
while (++index < length) {
data = matchData[index];
var key = data[0],
objValue = object[key],
srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === undefined && !(key in object)) {
return false;
}
} else {
var stack = new Stack,
result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined;
if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
return false;
}
}
}
return true;
}
/**
* The base implementation of `_.iteratee`.
*
* @private
* @param {*} [value=_.identity] The value to convert to an iteratee.
* @returns {Function} Returns the iteratee.
*/
function baseIteratee(value) {
var type = typeof value;
if (type == 'function') {
return value;
}
if (value == null) {
return identity;
}
if (type == 'object') {
return isArray(value)
? baseMatchesProperty(value[0], value[1])
: baseMatches(value);
}
return property(value);
}
/**
* The base implementation of `_.keys` which doesn't skip the constructor
* property of prototypes or treat sparse arrays as dense.
*
* @private
* @type Function
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
return nativeKeys(Object(object));
}
/**
* The base implementation of `_.keysIn` which doesn't skip the constructor
* property of prototypes or treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
object = object == null ? object : Object(object);
var result = [];
for (var key in object) {
result.push(key);
}
return result;
}
// Fallback for IE < 9 with es6-shim.
if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) {
baseKeysIn = function(object) {
return iteratorToArray(enumerate(object));
};
}
/**
* The base implementation of `_.map` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function baseMap(collection, iteratee) {
var index = -1,
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value, key, collection) {
result[++index] = iteratee(value, key, collection);
});
return result;
}
/**
* The base implementation of `_.matches` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new function.
*/
function baseMatches(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
var key = matchData[0][0],
value = matchData[0][1];
return function(object) {
if (object == null) {
return false;
}
return object[key] === value &&
(value !== undefined || (key in Object(object)));
};
}
return function(object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
/**
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new function.
*/
function baseMatchesProperty(path, srcValue) {
return function(object) {
var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue)
? hasIn(object, path)
: baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
};
}
/**
* The base implementation of `_.merge` without support for multiple sources.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {Function} [customizer] The function to customize merged values.
* @param {Object} [stack] Tracks traversed source values and their merged counterparts.
*/
function baseMerge(object, source, customizer, stack) {
if (object === source) {
return;
}
var props = (isArray(source) || isTypedArray(source)) ? undefined : keysIn(source);
arrayEach(props || source, function(srcValue, key) {
if (props) {
key = srcValue;
srcValue = source[key];
}
if (isObject(srcValue)) {
stack || (stack = new Stack);
baseMergeDeep(object, source, key, baseMerge, customizer, stack);
}
else {
var newValue = customizer ? customizer(object[key], srcValue, (key + ''), object, source, stack) : undefined;
if (newValue === undefined) {
newValue = srcValue;
}
assignMergeValue(object, key, newValue);
}
});
}
/**
* A specialized version of `baseMerge` for arrays and objects which performs
* deep merges and tracks traversed objects enabling objects with circular
* references to be merged.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {string} key The key of the value to merge.
* @param {Function} mergeFunc The function to merge values.
* @param {Function} [customizer] The function to customize assigned values.
* @param {Object} [stack] Tracks traversed source values and their merged counterparts.
*/
function baseMergeDeep(object, source, key, mergeFunc, customizer, stack) {
var objValue = object[key],
srcValue = source[key],
stacked = stack.get(srcValue) || stack.get(objValue);
if (stacked) {
assignMergeValue(object, key, stacked);
return;
}
var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined,
isCommon = newValue === undefined;
if (isCommon) {
newValue = srcValue;
if (isArray(srcValue) || isTypedArray(srcValue)) {
newValue = isArray(objValue)
? objValue
: ((isArrayLikeObject(objValue)) ? copyArray(objValue) : baseClone(srcValue));
}
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
newValue = isArguments(objValue)
? toPlainObject(objValue)
: (isObject(objValue) ? objValue : baseClone(srcValue));
}
else {
isCommon = isFunction(srcValue);
}
}
stack.set(srcValue, newValue);
if (isCommon) {
// Recursively merge objects and arrays (susceptible to call stack limits).
mergeFunc(newValue, srcValue, customizer, stack);
}
assignMergeValue(object, key, newValue);
}
/**
* The base implementation of `_.orderBy` without param guards.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
* @param {string[]} orders The sort orders of `iteratees`.
* @returns {Array} Returns the new sorted array.
*/
function baseOrderBy(collection, iteratees, orders) {
var index = -1,
toIteratee = getIteratee();
iteratees = arrayMap(iteratees.length ? iteratees : Array(1), function(iteratee) {
return toIteratee(iteratee);
});
var result = baseMap(collection, function(value, key, collection) {
var criteria = arrayMap(iteratees, function(iteratee) {
return iteratee(value);
});
return { 'criteria': criteria, 'index': ++index, 'value': value };
});
return baseSortBy(result, function(object, other) {
return compareMultiple(object, other, orders);
});
}
/**
* The base implementation of `_.pick` without support for individual
* property names.
*
* @private
* @param {Object} object The source object.
* @param {string[]} props The property names to pick.
* @returns {Object} Returns the new object.
*/
function basePick(object, props) {
object = Object(object);
return arrayReduce(props, function(result, key) {
if (key in object) {
result[key] = object[key];
}
return result;
}, {});
}
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.
*
* @private
* @param {Object} object The source object.
* @param {Function} predicate The function invoked per property.
* @returns {Object} Returns the new object.
*/
function basePickBy(object, predicate) {
var result = {};
baseForIn(object, function(value, key) {
if (predicate(value)) {
result[key] = value;
}
});
return result;
}
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new function.
*/
function basePropertyDeep(path) {
return function(object) {
return baseGet(object, path);
};
}
/**
* The base implementation of `_.pullAll`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @returns {Array} Returns `array`.
*/
function basePullAll(array, values) {
return basePullAllBy(array, values);
}
/**
* The base implementation of `_.pullAllBy` without support for iteratee
* shorthands.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns `array`.
*/
function basePullAllBy(array, values, iteratee) {
var index = -1,
length = values.length,
seen = array;
if (iteratee) {
seen = arrayMap(array, function(value) { return iteratee(value); });
}
while (++index < length) {
var fromIndex = 0,
value = values[index],
computed = iteratee ? iteratee(value) : value;
while ((fromIndex = baseIndexOf(seen, computed, fromIndex)) > -1) {
if (seen !== array) {
splice.call(seen, fromIndex, 1);
}
splice.call(array, fromIndex, 1);
}
}
return array;
}
/**
* The base implementation of `_.pullAt` without support for individual
* indexes or capturing the removed elements.
*
* @private
* @param {Array} array The array to modify.
* @param {number[]} indexes The indexes of elements to remove.
* @returns {Array} Returns `array`.
*/
function basePullAt(array, indexes) {
var length = array ? indexes.length : 0,
lastIndex = length - 1;
while (length--) {
var index = indexes[length];
if (lastIndex == length || index != previous) {
var previous = index;
if (isIndex(index)) {
splice.call(array, index, 1);
}
else if (!isKey(index, array)) {
var path = baseToPath(index),
object = parent(array, path);
if (object != null) {
delete object[last(path)];
}
}
else {
delete array[index];
}
}
}
return array;
}
/**
* The base implementation of `_.random` without support for returning
* floating-point numbers.
*
* @private
* @param {number} lower The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the random number.
*/
function baseRandom(lower, upper) {
return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
}
/**
* The base implementation of `_.range` and `_.rangeRight` which doesn't
* coerce arguments to numbers.
*
* @private
* @param {number} start The start of the range.
* @param {number} end The end of the range.
* @param {number} step The value to increment or decrement by.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Array} Returns the new array of numbers.
*/
function baseRange(start, end, step, fromRight) {
var index = -1,
length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
result = Array(length);
while (length--) {
result[fromRight ? length : ++index] = start;
start += step;
}
return result;
}
/**
* The base implementation of `_.set`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
path = isKey(path, object) ? [path + ''] : baseToPath(path);
var index = -1,
length = path.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = path[index];
if (isObject(nested)) {
var newValue = value;
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
newValue = objValue == null ? (isIndex(path[index + 1]) ? [] : {}) : objValue;
}
}
assignValue(nested, key, newValue);
}
nested = nested[key];
}
return object;
}
/**
* The base implementation of `setData` without support for hot loop detection.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var baseSetData = !metaMap ? identity : function(func, data) {
metaMap.set(func, data);
return func;
};
/**
* The base implementation of `_.slice` without an iteratee call guard.
*
* @private
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function baseSlice(array, start, end) {
var index = -1,
length = array.length;
start = start == null ? 0 : toInteger(start);
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = (end === undefined || end > length) ? length : toInteger(end);
if (end < 0) {
end += length;
}
length = start > end ? 0 : ((end - start) >>> 0);
start >>>= 0;
var result = Array(length);
while (++index < length) {
result[index] = array[index + start];
}
return result;
}
/**
* The base implementation of `_.some` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.
*/
function baseSome(collection, predicate) {
var result;
baseEach(collection, function(value, index, collection) {
result = predicate(value, index, collection);
return !result;
});
return !!result;
}
/**
* The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
* performs a binary search of `array` to determine the index at which `value`
* should be inserted into `array` in order to maintain its sort order.
*
* @private
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {boolean} [retHighest] Specify returning the highest qualified index.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
*/
function baseSortedIndex(array, value, retHighest) {
var low = 0,
high = array ? array.length : low;
if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
while (low < high) {
var mid = (low + high) >>> 1,
computed = array[mid];
if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
low = mid + 1;
} else {
high = mid;
}
}
return high;
}
return baseSortedIndexBy(array, value, identity, retHighest);
}
/**
* The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
* which invokes `iteratee` for `value` and each element of `array` to compute
* their sort ranking. The iteratee is invoked with one argument; (value).
*
* @private
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} iteratee The iteratee invoked per element.
* @param {boolean} [retHighest] Specify returning the highest qualified index.
* @returns {number} Returns the index at which `value` should be inserted into `array`.
*/
function baseSortedIndexBy(array, value, iteratee, retHighest) {
value = iteratee(value);
var low = 0,
high = array ? array.length : 0,
valIsNaN = value !== value,
valIsNull = value === null,
valIsUndef = value === undefined;
while (low < high) {
var mid = nativeFloor((low + high) / 2),
computed = iteratee(array[mid]),
isDef = computed !== undefined,
isReflexive = computed === computed;
if (valIsNaN) {
var setLow = isReflexive || retHighest;
} else if (valIsNull) {
setLow = isReflexive && isDef && (retHighest || computed != null);
} else if (valIsUndef) {
setLow = isReflexive && (retHighest || isDef);
} else if (computed == null) {
setLow = false;
} else {
setLow = retHighest ? (computed <= value) : (computed < value);
}
if (setLow) {
low = mid + 1;
} else {
high = mid;
}
}
return nativeMin(high, MAX_ARRAY_INDEX);
}
/**
* The base implementation of `_.sortedUniq`.
*
* @private
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
*/
function baseSortedUniq(array) {
return baseSortedUniqBy(array);
}
/**
* The base implementation of `_.sortedUniqBy` without support for iteratee
* shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseSortedUniqBy(array, iteratee) {
var index = 0,
length = array.length,
value = array[0],
computed = iteratee ? iteratee(value) : value,
seen = computed,
resIndex = 0,
result = [value];
while (++index < length) {
value = array[index],
computed = iteratee ? iteratee(value) : value;
if (!eq(computed, seen)) {
seen = computed;
result[++resIndex] = value;
}
}
return result;
}
/**
* The base implementation of `_.toPath` which only converts `value` to a
* path if it's not one.
*
* @private
* @param {*} value The value to process.
* @returns {Array} Returns the property path array.
*/
function baseToPath(value) {
return isArray(value) ? value : stringToPath(value);
}
/**
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseUniq(array, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
length = array.length,
isCommon = true,
result = [],
seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
}
else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache;
}
else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = isKey(path, object) ? [path + ''] : baseToPath(path);
object = parent(object, path);
var key = last(path);
return (object != null && has(object, key)) ? delete object[key] : true;
}
/**
* The base implementation of methods like `_.dropWhile` and `_.takeWhile`
* without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to query.
* @param {Function} predicate The function invoked per iteration.
* @param {boolean} [isDrop] Specify dropping elements instead of taking them.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Array} Returns the slice of `array`.
*/
function baseWhile(array, predicate, isDrop, fromRight) {
var length = array.length,
index = fromRight ? length : -1;
while ((fromRight ? index-- : ++index < length) &&
predicate(array[index], index, array)) {}
return isDrop
? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
: baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
}
/**
* The base implementation of `wrapperValue` which returns the result of
* performing a sequence of actions on the unwrapped `value`, where each
* successive action is supplied the return value of the previous.
*
* @private
* @param {*} value The unwrapped value.
* @param {Array} actions Actions to perform to resolve the unwrapped value.
* @returns {*} Returns the resolved value.
*/
function baseWrapperValue(value, actions) {
var result = value;
if (result instanceof LazyWrapper) {
result = result.value();
}
return arrayReduce(actions, function(result, action) {
return action.func.apply(action.thisArg, arrayPush([result], action.args));
}, result);
}
/**
* The base implementation of methods like `_.xor`, without support for
* iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of values.
*/
function baseXor(arrays, iteratee, comparator) {
var index = -1,
length = arrays.length;
while (++index < length) {
var result = result
? arrayPush(
baseDifference(result, arrays[index], iteratee, comparator),
baseDifference(arrays[index], result, iteratee, comparator)
)
: arrays[index];
}
return (result && result.length) ? baseUniq(result, iteratee, comparator) : [];
}
/**
* Creates a clone of `buffer`.
*
* @private
* @param {ArrayBuffer} buffer The array buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer.
*/
function cloneBuffer(buffer) {
var Ctor = buffer.constructor,
result = new Ctor(buffer.byteLength),
view = new Uint8Array(result);
view.set(new Uint8Array(buffer));
return result;
}
/**
* Creates a clone of `map`.
*
* @private
* @param {Object} map The map to clone.
* @returns {Object} Returns the cloned map.
*/
function cloneMap(map) {
var Ctor = map.constructor;
return arrayReduce(mapToArray(map), addMapEntry, new Ctor);
}
/**
* Creates a clone of `regexp`.
*
* @private
* @param {Object} regexp The regexp to clone.
* @returns {Object} Returns the cloned regexp.
*/
function cloneRegExp(regexp) {
var Ctor = regexp.constructor,
result = new Ctor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
/**
* Creates a clone of `set`.
*
* @private
* @param {Object} set The set to clone.
* @returns {Object} Returns the cloned set.
*/
function cloneSet(set) {
var Ctor = set.constructor;
return arrayReduce(setToArray(set), addSetEntry, new Ctor);
}
/**
* Creates a clone of the `symbol` object.
*
* @private
* @param {Object} symbol The symbol object to clone.
* @returns {Object} Returns the cloned symbol object.
*/
function cloneSymbol(symbol) {
return _Symbol ? Object(symbolValueOf.call(symbol)) : {};
}
/**
* Creates a clone of `typedArray`.
*
* @private
* @param {Object} typedArray The typed array to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned typed array.
*/
function cloneTypedArray(typedArray, isDeep) {
var buffer = typedArray.buffer,
Ctor = typedArray.constructor;
return new Ctor(isDeep ? cloneBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length);
}
/**
* Creates an array that is the composition of partially applied arguments,
* placeholders, and provided arguments into a single array of arguments.
*
* @private
* @param {Array|Object} args The provided arguments.
* @param {Array} partials The arguments to prepend to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgs(args, partials, holders) {
var holdersLength = holders.length,
argsIndex = -1,
argsLength = nativeMax(args.length - holdersLength, 0),
leftIndex = -1,
leftLength = partials.length,
result = Array(leftLength + argsLength);
while (++leftIndex < leftLength) {
result[leftIndex] = partials[leftIndex];
}
while (++argsIndex < holdersLength) {
result[holders[argsIndex]] = args[argsIndex];
}
while (argsLength--) {
result[leftIndex++] = args[argsIndex++];
}
return result;
}
/**
* This function is like `composeArgs` except that the arguments composition
* is tailored for `_.partialRight`.
*
* @private
* @param {Array|Object} args The provided arguments.
* @param {Array} partials The arguments to append to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgsRight(args, partials, holders) {
var holdersIndex = -1,
holdersLength = holders.length,
argsIndex = -1,
argsLength = nativeMax(args.length - holdersLength, 0),
rightIndex = -1,
rightLength = partials.length,
result = Array(argsLength + rightLength);
while (++argsIndex < argsLength) {
result[argsIndex] = args[argsIndex];
}
var offset = argsIndex;
while (++rightIndex < rightLength) {
result[offset + rightIndex] = partials[rightIndex];
}
while (++holdersIndex < holdersLength) {
result[offset + holders[holdersIndex]] = args[argsIndex++];
}
return result;
}
/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
function copyArray(source, array) {
var index = -1,
length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property names to copy.
* @param {Object} [object={}] The object to copy properties to.
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object) {
return copyObjectWith(source, props, object);
}
/**
* This function is like `copyObject` except that it accepts a function to
* customize copied values.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property names to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObjectWith(source, props, object, customizer) {
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index],
newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key];
assignValue(object, key, newValue);
}
return object;
}
/**
* Copies own symbol properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbols(source, object) {
return copyObject(source, getSymbols(source), object);
}
/**
* Creates a function like `_.groupBy`.
*
* @private
* @param {Function} setter The function to set keys and values of the accumulator object.
* @param {Function} [initializer] The function to initialize the accumulator object.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter, initializer) {
return function(collection, iteratee) {
var result = initializer ? initializer() : {};
iteratee = getIteratee(iteratee);
if (isArray(collection)) {
var index = -1,
length = collection.length;
while (++index < length) {
var value = collection[index];
setter(result, value, iteratee(value), collection);
}
} else {
baseEach(collection, function(value, key, collection) {
setter(result, value, iteratee(value), collection);
});
}
return result;
};
}
/**
* Creates a function like `_.assign`.
*
* @private
* @param {Function} assigner The function to assign values.
* @returns {Function} Returns the new assigner function.
*/
function createAssigner(assigner) {
return rest(function(object, sources) {
var index = -1,
length = sources.length,
customizer = length > 1 ? sources[length - 1] : undefined,
guard = length > 2 ? sources[2] : undefined;
customizer = typeof customizer == 'function' ? (length--, customizer) : undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer;
length = 1;
}
object = Object(object);
while (++index < length) {
var source = sources[index];
if (source) {
assigner(object, source, customizer);
}
}
return object;
});
}
/**
* Creates a `baseEach` or `baseEachRight` function.
*
* @private
* @param {Function} eachFunc The function to iterate over a collection.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseEach(eachFunc, fromRight) {
return function(collection, iteratee) {
if (collection == null) {
return collection;
}
if (!isArrayLike(collection)) {
return eachFunc(collection, iteratee);
}
var length = collection.length,
index = fromRight ? length : -1,
iterable = Object(collection);
while ((fromRight ? index-- : ++index < length)) {
if (iteratee(iterable[index], index, iterable) === false) {
break;
}
}
return collection;
};
}
/**
* Creates a base function for methods like `_.forIn`.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseFor(fromRight) {
return function(object, iteratee, keysFunc) {
var index = -1,
iterable = Object(object),
props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[fromRight ? length : ++index];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object;
};
}
/**
* Creates a function that wraps `func` to invoke it with the optional `this`
* binding of `thisArg`.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createBaseWrapper(func, bitmask, thisArg) {
var isBind = bitmask & BIND_FLAG,
Ctor = createCtorWrapper(func);
function wrapper() {
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return fn.apply(isBind ? thisArg : this, arguments);
}
return wrapper;
}
/**
* Creates a function like `_.lowerFirst`.
*
* @private
* @param {string} methodName The name of the `String` case method to use.
* @returns {Function} Returns the new function.
*/
function createCaseFirst(methodName) {
return function(string) {
string = toString(string);
var strSymbols = reHasComplexSymbol.test(string) ? stringToArray(string) : undefined,
chr = strSymbols ? strSymbols[0] : string.charAt(0),
trailing = strSymbols ? strSymbols.slice(1).join('') : string.slice(1);
return chr[methodName]() + trailing;
};
}
/**
* Creates a function like `_.camelCase`.
*
* @private
* @param {Function} callback The function to combine each word.
* @returns {Function} Returns the new compounder function.
*/
function createCompounder(callback) {
return function(string) {
return arrayReduce(words(deburr(string)), callback, '');
};
}
/**
* Creates a function that produces an instance of `Ctor` regardless of
* whether it was invoked as part of a `new` expression or by `call` or `apply`.
*
* @private
* @param {Function} Ctor The constructor to wrap.
* @returns {Function} Returns the new wrapped function.
*/
function createCtorWrapper(Ctor) {
return function() {
// Use a `switch` statement to work with class constructors.
// See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
// for more details.
var args = arguments;
switch (args.length) {
case 0: return new Ctor;
case 1: return new Ctor(args[0]);
case 2: return new Ctor(args[0], args[1]);
case 3: return new Ctor(args[0], args[1], args[2]);
case 4: return new Ctor(args[0], args[1], args[2], args[3]);
case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
}
var thisBinding = baseCreate(Ctor.prototype),
result = Ctor.apply(thisBinding, args);
// Mimic the constructor's `return` behavior.
// See https://es5.github.io/#x13.2.2 for more details.
return isObject(result) ? result : thisBinding;
};
}
/**
* Creates a function that wraps `func` to enable currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details.
* @param {number} arity The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createCurryWrapper(func, bitmask, arity) {
var Ctor = createCtorWrapper(func);
function wrapper() {
var length = arguments.length,
index = length,
args = Array(length),
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func,
placeholder = wrapper.placeholder;
while (index--) {
args[index] = arguments[index];
}
var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
? []
: replaceHolders(args, placeholder);
length -= holders.length;
return length < arity
? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length)
: apply(fn, this, args);
}
return wrapper;
}
/**
* Creates a `_.flow` or `_.flowRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new flow function.
*/
function createFlow(fromRight) {
return rest(function(funcs) {
funcs = baseFlatten(funcs);
var length = funcs.length,
index = length,
prereq = LodashWrapper.prototype.thru;
if (fromRight) {
funcs.reverse();
}
while (index--) {
var func = funcs[index];
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
var wrapper = new LodashWrapper([], true);
}
}
index = wrapper ? index : length;
while (++index < length) {
func = funcs[index];
var funcName = getFuncName(func),
data = funcName == 'wrapper' ? getData(func) : undefined;
if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
} else {
wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
}
}
return function() {
var args = arguments,
value = args[0];
if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
return wrapper.plant(value).value();
}
var index = 0,
result = length ? funcs[index].apply(this, args) : value;
while (++index < length) {
result = funcs[index].call(this, result);
}
return result;
};
});
}
/**
* Creates a function that wraps `func` to invoke it with optional `this`
* binding of `thisArg`, partial application, and currying.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [partialsRight] The arguments to append to those provided to the new function.
* @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
var isAry = bitmask & ARY_FLAG,
isBind = bitmask & BIND_FLAG,
isBindKey = bitmask & BIND_KEY_FLAG,
isCurry = bitmask & CURRY_FLAG,
isCurryRight = bitmask & CURRY_RIGHT_FLAG,
isFlip = bitmask & FLIP_FLAG,
Ctor = isBindKey ? undefined : createCtorWrapper(func);
function wrapper() {
var length = arguments.length,
index = length,
args = Array(length);
while (index--) {
args[index] = arguments[index];
}
if (partials) {
args = composeArgs(args, partials, holders);
}
if (partialsRight) {
args = composeArgsRight(args, partialsRight, holdersRight);
}
if (isCurry || isCurryRight) {
var placeholder = wrapper.placeholder,
argsHolders = replaceHolders(args, placeholder);
length -= argsHolders.length;
if (length < arity) {
return createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, thisArg, args, argsHolders, argPos, ary, arity - length);
}
}
var thisBinding = isBind ? thisArg : this,
fn = isBindKey ? thisBinding[func] : func;
if (argPos) {
args = reorder(args, argPos);
} else if (isFlip && args.length > 1) {
args.reverse();
}
if (isAry && ary < args.length) {
args.length = ary;
}
if (this && this !== root && this instanceof wrapper) {
fn = Ctor || createCtorWrapper(fn);
}
return fn.apply(thisBinding, args);
}
return wrapper;
}
/**
* Creates a function like `_.over`.
*
* @private
* @param {Function} arrayFunc The function to iterate over iteratees.
* @returns {Function} Returns the new invoker function.
*/
function createOver(arrayFunc) {
return rest(function(iteratees) {
iteratees = arrayMap(baseFlatten(iteratees), getIteratee());
return rest(function(args) {
var thisArg = this;
return arrayFunc(iteratees, function(iteratee) {
return apply(iteratee, thisArg, args);
});
});
});
}
/**
* Creates the padding for `string` based on `length`. The `chars` string
* is truncated if the number of characters exceeds `length`.
*
* @private
* @param {string} string The string to create padding for.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padding for `string`.
*/
function createPadding(string, length, chars) {
length = toInteger(length);
var strLength = stringSize(string);
if (!length || strLength >= length) {
return '';
}
var padLength = length - strLength;
chars = chars === undefined ? ' ' : (chars + '');
var result = repeat(chars, nativeCeil(padLength / stringSize(chars)));
return reHasComplexSymbol.test(chars)
? stringToArray(result).slice(0, padLength).join('')
: result.slice(0, padLength);
}
/**
* Creates a function that wraps `func` to invoke it with the optional `this`
* binding of `thisArg` and the `partials` prepended to those provided to
* the wrapper.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} partials The arguments to prepend to those provided to the new function.
* @returns {Function} Returns the new wrapped function.
*/
function createPartialWrapper(func, bitmask, thisArg, partials) {
var isBind = bitmask & BIND_FLAG,
Ctor = createCtorWrapper(func);
function wrapper() {
var argsIndex = -1,
argsLength = arguments.length,
leftIndex = -1,
leftLength = partials.length,
args = Array(leftLength + argsLength),
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
while (++leftIndex < leftLength) {
args[leftIndex] = partials[leftIndex];
}
while (argsLength--) {
args[leftIndex++] = arguments[++argsIndex];
}
return apply(fn, isBind ? thisArg : this, args);
}
return wrapper;
}
/**
* Creates a `_.range` or `_.rangeRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new range function.
*/
function createRange(fromRight) {
return function(start, end, step) {
if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
end = step = undefined;
}
// Ensure the sign of `-0` is preserved.
start = toNumber(start);
start = start === start ? start : 0;
if (end === undefined) {
end = start;
start = 0;
} else {
end = toNumber(end) || 0;
}
step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);
return baseRange(start, end, step, fromRight);
};
}
/**
* Creates a function that wraps `func` to continue currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details.
* @param {Function} wrapFunc The function to create the `func` wrapper.
* @param {*} placeholder The placeholder to replace.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
var isCurry = bitmask & CURRY_FLAG,
newArgPos = argPos ? copyArray(argPos) : undefined,
newsHolders = isCurry ? holders : undefined,
newHoldersRight = isCurry ? undefined : holders,
newPartials = isCurry ? partials : undefined,
newPartialsRight = isCurry ? undefined : partials;
bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
if (!(bitmask & CURRY_BOUND_FLAG)) {
bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
}
var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, arity],
result = wrapFunc.apply(undefined, newData);
if (isLaziable(func)) {
setData(result, newData);
}
result.placeholder = placeholder;
return result;
}
/**
* Creates a function like `_.round`.
*
* @private
* @param {string} methodName The name of the `Math` method to use when rounding.
* @returns {Function} Returns the new round function.
*/
function createRound(methodName) {
var func = Math[methodName];
return function(number, precision) {
number = toNumber(number);
precision = toInteger(precision);
if (precision) {
// Shift with exponential notation to avoid floating-point issues.
// See [MDN](https://mdn.io/round#Examples) for more details.
var pair = (toString(number) + 'e').split('e'),
value = func(pair[0] + 'e' + (+pair[1] + precision));
pair = (toString(value) + 'e').split('e');
return +(pair[0] + 'e' + (+pair[1] - precision));
}
return func(number);
};
}
/**
* Creates a set of `values`.
*
* @private
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
var createSet = !(Set && new Set([1, 2]).size === 2) ? noop : function(values) {
return new Set(values);
};
/**
* Creates a function that either curries or invokes `func` with optional
* `this` binding and partially applied arguments.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask of wrapper flags.
* The bitmask may be composed of the following flags:
* 1 - `_.bind`
* 2 - `_.bindKey`
* 4 - `_.curry` or `_.curryRight` of a bound function
* 8 - `_.curry`
* 16 - `_.curryRight`
* 32 - `_.partial`
* 64 - `_.partialRight`
* 128 - `_.rearg`
* 256 - `_.ary`
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to be partially applied.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
var isBindKey = bitmask & BIND_KEY_FLAG;
if (!isBindKey && typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
var length = partials ? partials.length : 0;
if (!length) {
bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
partials = holders = undefined;
}
ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
arity = arity === undefined ? arity : toInteger(arity);
length -= holders ? holders.length : 0;
if (bitmask & PARTIAL_RIGHT_FLAG) {
var partialsRight = partials,
holdersRight = holders;
partials = holders = undefined;
}
var data = isBindKey ? undefined : getData(func),
newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
if (data) {
mergeData(newData, data);
}
func = newData[0];
bitmask = newData[1];
thisArg = newData[2];
partials = newData[3];
holders = newData[4];
arity = newData[9] = newData[9] == null
? (isBindKey ? 0 : func.length)
: nativeMax(newData[9] - length, 0);
if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) {
bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG);
}
if (!bitmask || bitmask == BIND_FLAG) {
var result = createBaseWrapper(func, bitmask, thisArg);
} else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) {
result = createCurryWrapper(func, bitmask, arity);
} else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) {
result = createPartialWrapper(func, bitmask, thisArg, partials);
} else {
result = createHybridWrapper.apply(undefined, newData);
}
var setter = data ? baseSetData : setData;
return setter(result, newData);
}
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
*
* @private
* @param {Array} array The array to compare.
* @param {Array} other The other array to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} [customizer] The function to customize comparisons.
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.
* @param {Object} [stack] Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/
function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
var index = -1,
isPartial = bitmask & PARTIAL_COMPARE_FLAG,
isUnordered = bitmask & UNORDERED_COMPARE_FLAG,
arrLength = array.length,
othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(array);
if (stacked) {
return stacked == other;
}
var result = true;
stack.set(array, other);
// Ignore non-index properties.
while (++index < arrLength) {
var arrValue = array[index],
othValue = other[index];
if (customizer) {
var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== undefined) {
if (compared) {
continue;
}
result = false;
break;
}
// Recursively compare arrays (susceptible to call stack limits).
if (isUnordered) {
if (!arraySome(other, function(othValue) {
return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack);
})) {
result = false;
break;
}
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
result = false;
break;
}
}
stack['delete'](array);
return result;
}
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} [customizer] The function to customize comparisons.
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, equalFunc, customizer, bitmask) {
switch (tag) {
case arrayBufferTag:
if ((object.byteLength != other.byteLength) ||
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
// Coerce dates and booleans to numbers, dates to milliseconds and booleans
// to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
return +object == +other;
case errorTag:
return object.name == other.name && object.message == other.message;
case numberTag:
// Treat `NaN` vs. `NaN` as equal.
return (object != +object) ? other != +other : object == +other;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings primitives and string
// objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
return object == (other + '');
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
convert || (convert = setToArray);
// Recursively compare objects (susceptible to call stack limits).
return (isPartial || object.size == other.size) &&
equalFunc(convert(object), convert(other), customizer, bitmask | UNORDERED_COMPARE_FLAG);
case symbolTag:
return !!_Symbol && (symbolValueOf.call(object) == symbolValueOf.call(other));
}
return false;
}
/**
* A specialized version of `baseIsEqualDeep` for objects with support for
* partial deep comparisons.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} [customizer] The function to customize comparisons.
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
isUnordered = bitmask & UNORDERED_COMPARE_FLAG,
objProps = keys(object),
objLength = objProps.length,
othProps = keys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key)) ||
!(isUnordered || key == othProps[index])) {
return false;
}
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
var result = true;
stack.set(object, other);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key],
othValue = other[key];
if (customizer) {
var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack);
}
// Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))
: compared
)) {
result = false;
break;
}
skipCtor || (skipCtor = key == 'constructor');
}
if (result && !skipCtor) {
var objCtor = object.constructor,
othCtor = other.constructor;
// Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false;
}
}
stack['delete'](object);
return result;
}
/**
* Gets metadata for `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {*} Returns the metadata for `func`.
*/
var getData = !metaMap ? noop : function(func) {
return metaMap.get(func);
};
/**
* Gets the name of `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {string} Returns the function name.
*/
function getFuncName(func) {
var result = (func.name + ''),
array = realNames[result],
length = array ? array.length : 0;
while (length--) {
var data = array[length],
otherFunc = data.func;
if (otherFunc == null || otherFunc == func) {
return data.name;
}
}
return result;
}
/**
* Gets the appropriate "iteratee" function. If the `_.iteratee` method is
* customized this function returns the custom method, otherwise it returns
* `baseIteratee`. If arguments are provided the chosen function is invoked
* with them and its result is returned.
*
* @private
* @param {*} [value] The value to convert to an iteratee.
* @param {number} [arity] The arity of the created iteratee.
* @returns {Function} Returns the chosen function or its result.
*/
function getIteratee() {
var result = lodash.iteratee || iteratee;
result = result === iteratee ? baseIteratee : result;
return arguments.length ? result(arguments[0], arguments[1]) : result;
}
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
* that affects Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/**
* Gets the property names, values, and compare flags of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the match data of `object`.
*/
function getMatchData(object) {
var result = toPairs(object),
length = result.length;
while (length--) {
result[length][2] = isStrictComparable(result[length][1]);
}
return result;
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = object == null ? undefined : object[key];
return isNative(value) ? value : undefined;
}
/**
* Creates an array of the own symbol properties of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbols = getOwnPropertySymbols || function() {
return [];
};
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function getTag(value) {
return objectToString.call(value);
}
// Fallback for IE 11 providing `toStringTag` values for maps and sets.
if ((Map && getTag(new Map) != mapTag) || (Set && getTag(new Set) != setTag)) {
getTag = function(value) {
var result = objectToString.call(value),
Ctor = result == objectTag ? value.constructor : null,
ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : '';
if (ctorString) {
if (ctorString == mapCtorString) {
return mapTag;
}
if (ctorString == setCtorString) {
return setTag;
}
}
return result;
};
}
/**
* Gets the view, applying any `transforms` to the `start` and `end` positions.
*
* @private
* @param {number} start The start of the view.
* @param {number} end The end of the view.
* @param {Array} transforms The transformations to apply to the view.
* @returns {Object} Returns an object containing the `start` and `end`
* positions of the view.
*/
function getView(start, end, transforms) {
var index = -1,
length = transforms.length;
while (++index < length) {
var data = transforms[index],
size = data.size;
switch (data.type) {
case 'drop': start += size; break;
case 'dropRight': end -= size; break;
case 'take': end = nativeMin(end, start + size); break;
case 'takeRight': start = nativeMax(start, end - size); break;
}
}
return { 'start': start, 'end': end };
}
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
if (object == null) {
return false;
}
var result = hasFunc(object, path);
if (!result && !isKey(path)) {
path = baseToPath(path);
object = parent(object, path);
if (object != null) {
path = last(path);
result = hasFunc(object, path);
}
}
return result || (isLength(object && object.length) && isIndex(path, object.length) &&
(isArray(object) || isString(object) || isArguments(object)));
}
/**
* Initializes an array clone.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the initialized clone.
*/
function initCloneArray(array) {
var length = array.length,
result = array.constructor(length);
// Add properties assigned by `RegExp#exec`.
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
result.index = array.index;
result.input = array.input;
}
return result;
}
/**
* Initializes an object clone.
*
* @private
* @param {Object} object The object to clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
var Ctor = object.constructor;
return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
}
/**
* Initializes an object clone based on its `toStringTag`.
*
* **Note:** This function only supports cloning values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneByTag(object, tag, isDeep) {
var Ctor = object.constructor;
switch (tag) {
case arrayBufferTag:
return cloneBuffer(object);
case boolTag:
case dateTag:
return new Ctor(+object);
case float32Tag: case float64Tag:
case int8Tag: case int16Tag: case int32Tag:
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
return cloneTypedArray(object, isDeep);
case mapTag:
return cloneMap(object);
case numberTag:
case stringTag:
return new Ctor(object);
case regexpTag:
return cloneRegExp(object);
case setTag:
return cloneSet(object);
case symbolTag:
return cloneSymbol(object);
}
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
return (isLength(length) && (isArray(object) || isString(object) || isArguments(object)))
? baseTimes(length, String)
: null;
}
/**
* Checks if the provided arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)) {
return eq(object[index], value);
}
return false;
}
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (typeof value == 'number') {
return true;
}
return !isArray(value) &&
(reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object)));
}
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return type == 'number' || type == 'boolean' ||
(type == 'string' && value !== '__proto__') || value == null;
}
/**
* Checks if `func` has a lazy counterpart.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
*/
function isLaziable(func) {
var funcName = getFuncName(func),
other = lodash[funcName];
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
return false;
}
if (func === other) {
return true;
}
var data = getData(other);
return !!data && func === data[0];
}
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
/**
* Merges the function metadata of `source` into `data`.
*
* Merging metadata reduces the number of wrappers used to invoke a function.
* This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
* may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`
* modify function arguments, making the order in which they are executed important,
* preventing the merging of metadata. However, we make an exception for a safe
* combined case where curried functions have `_.ary` and or `_.rearg` applied.
*
* @private
* @param {Array} data The destination metadata.
* @param {Array} source The source metadata.
* @returns {Array} Returns `data`.
*/
function mergeData(data, source) {
var bitmask = data[1],
srcBitmask = source[1],
newBitmask = bitmask | srcBitmask,
isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG);
var isCombo =
(srcBitmask == ARY_FLAG && (bitmask == CURRY_FLAG)) ||
(srcBitmask == ARY_FLAG && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
(srcBitmask == (ARY_FLAG | REARG_FLAG) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
// Exit early if metadata can't be merged.
if (!(isCommon || isCombo)) {
return data;
}
// Use source `thisArg` if available.
if (srcBitmask & BIND_FLAG) {
data[2] = source[2];
// Set when currying a bound function.
newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
}
// Compose partial arguments.
var value = source[3];
if (value) {
var partials = data[3];
data[3] = partials ? composeArgs(partials, value, source[4]) : copyArray(value);
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : copyArray(source[4]);
}
// Compose partial right arguments.
value = source[5];
if (value) {
partials = data[5];
data[5] = partials ? composeArgsRight(partials, value, source[6]) : copyArray(value);
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : copyArray(source[6]);
}
// Use source `argPos` if available.
value = source[7];
if (value) {
data[7] = copyArray(value);
}
// Use source `ary` if it's smaller.
if (srcBitmask & ARY_FLAG) {
data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
}
// Use source `arity` if one is not provided.
if (data[9] == null) {
data[9] = source[9];
}
// Use source `func` and merge bitmasks.
data[0] = source[0];
data[1] = newBitmask;
return data;
}
/**
* Used by `_.defaultsDeep` to customize its `_.merge` use.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to merge.
* @param {Object} object The parent object of `objValue`.
* @param {Object} source The parent object of `srcValue`.
* @param {Object} [stack] Tracks traversed source values and their merged counterparts.
* @returns {*} Returns the value to assign.
*/
function mergeDefaults(objValue, srcValue, key, object, source, stack) {
if (isObject(objValue) && isObject(srcValue)) {
stack.set(srcValue, objValue);
baseMerge(objValue, srcValue, mergeDefaults, stack);
}
return objValue === undefined ? baseClone(srcValue) : objValue;
}
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length == 1 ? object : get(object, baseSlice(path, 0, -1));
}
/**
* Reorder `array` according to the specified indexes where the element at
* the first index is assigned as the first element, the element at
* the second index is assigned as the second element, and so on.
*
* @private
* @param {Array} array The array to reorder.
* @param {Array} indexes The arranged array indexes.
* @returns {Array} Returns `array`.
*/
function reorder(array, indexes) {
var arrLength = array.length,
length = nativeMin(indexes.length, arrLength),
oldArray = copyArray(array);
while (length--) {
var index = indexes[length];
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
}
return array;
}
/**
* Sets metadata for `func`.
*
* **Note:** If this function becomes hot, i.e. is invoked a lot in a short
* period of time, it will trip its breaker and transition to an identity function
* to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
* for more details.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var setData = (function() {
var count = 0,
lastCalled = 0;
return function(key, value) {
var stamp = now(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return key;
}
} else {
count = 0;
}
return baseSetData(key, value);
};
}());
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
function stringToPath(string) {
var result = [];
toString(string).replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
}
/**
* Converts `value` to an array-like object if it's not one.
*
* @private
* @param {*} value The value to process.
* @returns {Array} Returns the array-like object.
*/
function toArrayLikeObject(value) {
return isArrayLikeObject(value) ? value : [];
}
/**
* Converts `value` to a function if it's not one.
*
* @private
* @param {*} value The value to process.
* @returns {Function} Returns the function.
*/
function toFunction(value) {
return typeof value == 'function' ? value : identity;
}
/**
* Creates a clone of `wrapper`.
*
* @private
* @param {Object} wrapper The wrapper to clone.
* @returns {Object} Returns the cloned wrapper.
*/
function wrapperClone(wrapper) {
if (wrapper instanceof LazyWrapper) {
return wrapper.clone();
}
var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
result.__actions__ = copyArray(wrapper.__actions__);
result.__index__ = wrapper.__index__;
result.__values__ = wrapper.__values__;
return result;
}
/*------------------------------------------------------------------------*/
/**
* Creates an array of elements split into groups the length of `size`.
* If `array` can't be split evenly, the final chunk will be the remaining
* elements.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to process.
* @param {number} [size=0] The length of each chunk.
* @returns {Array} Returns the new array containing chunks.
* @example
*
* _.chunk(['a', 'b', 'c', 'd'], 2);
* // => [['a', 'b'], ['c', 'd']]
*
* _.chunk(['a', 'b', 'c', 'd'], 3);
* // => [['a', 'b', 'c'], ['d']]
*/
function chunk(array, size) {
size = nativeMax(toInteger(size), 0);
var length = array ? array.length : 0;
if (!length || size < 1) {
return [];
}
var index = 0,
resIndex = -1,
result = Array(nativeCeil(length / size));
while (index < length) {
result[++resIndex] = baseSlice(array, index, (index += size));
}
return result;
}
/**
* Creates an array with all falsey values removed. The values `false`, `null`,
* `0`, `""`, `undefined`, and `NaN` are falsey.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to compact.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.compact([0, 1, false, 2, '', 3]);
* // => [1, 2, 3]
*/
function compact(array) {
var index = -1,
length = array ? array.length : 0,
resIndex = -1,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result[++resIndex] = value;
}
}
return result;
}
/**
* Creates a new array concatenating `array` with any additional arrays
* and/or values.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to concatenate.
* @param {...*} [values] The values to concatenate.
* @returns {Array} Returns the new concatenated array.
* @example
*
* var array = [1];
* var other = _.concat(array, 2, [3], [[4]]);
*
* console.log(other);
* // => [1, 2, 3, [4]]
*
* console.log(array);
* // => [1]
*/
var concat = rest(function(array, values) {
values = baseFlatten(values);
return arrayConcat(isArray(array) ? array : [Object(array)], values);
});
/**
* Creates an array of unique `array` values not included in the other
* provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.difference([3, 2, 1], [4, 2]);
* // => [3, 1]
*/
var difference = rest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, false, true))
: [];
});
/**
* This method is like `_.difference` except that it accepts `iteratee` which
* is invoked for each element of `array` and `values` to generate the criterion
* by which uniqueness is computed. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);
* // => [3.1, 1.3]
*
* // using the `_.property` iteratee shorthand
* _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
* // => [{ 'x': 2 }]
*/
var differenceBy = rest(function(array, values) {
var iteratee = last(values);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, false, true), getIteratee(iteratee))
: [];
});
/**
* This method is like `_.difference` except that it accepts `comparator`
* which is invoked to compare elements of `array` to `values`. The comparator
* is invoked with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
*
* _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
* // => [{ 'x': 2, 'y': 1 }]
*/
var differenceWith = rest(function(array, values) {
var comparator = last(values);
if (isArrayLikeObject(comparator)) {
comparator = undefined;
}
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, false, true), undefined, comparator)
: [];
});
/**
* Creates a slice of `array` with `n` elements dropped from the beginning.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.drop([1, 2, 3]);
* // => [2, 3]
*
* _.drop([1, 2, 3], 2);
* // => [3]
*
* _.drop([1, 2, 3], 5);
* // => []
*
* _.drop([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function drop(array, n, guard) {
if (!(array && array.length)) {
return [];
}
n = (guard || n === undefined) ? 1 : n;
return baseSlice(array, n < 0 ? 0 : n);
}
/**
* Creates a slice of `array` with `n` elements dropped from the end.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.dropRight([1, 2, 3]);
* // => [1, 2]
*
* _.dropRight([1, 2, 3], 2);
* // => [1]
*
* _.dropRight([1, 2, 3], 5);
* // => []
*
* _.dropRight([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function dropRight(array, n, guard) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
n = length - n;
return baseSlice(array, 0, n < 0 ? 0 : n);
}
/**
* Creates a slice of `array` excluding elements dropped from the end.
* Elements are dropped until `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index, array).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var resolve = _.partial(_.map, _, 'user');
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* resolve( _.dropRightWhile(users, function(o) { return !o.active; }) );
* // => ['barney']
*
* // using the `_.matches` iteratee shorthand
* resolve( _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }) );
* // => ['barney', 'fred']
*
* // using the `_.matchesProperty` iteratee shorthand
* resolve( _.dropRightWhile(users, ['active', false]) );
* // => ['barney']
*
* // using the `_.property` iteratee shorthand
* resolve( _.dropRightWhile(users, 'active') );
* // => ['barney', 'fred', 'pebbles']
*/
function dropRightWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3), true, true)
: [];
}
/**
* Creates a slice of `array` excluding elements dropped from the beginning.
* Elements are dropped until `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index, array).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var resolve = _.partial(_.map, _, 'user');
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* resolve( _.dropWhile(users, function(o) { return !o.active; }) );
* // => ['pebbles']
*
* // using the `_.matches` iteratee shorthand
* resolve( _.dropWhile(users, { 'user': 'barney', 'active': false }) );
* // => ['fred', 'pebbles']
*
* // using the `_.matchesProperty` iteratee shorthand
* resolve( _.dropWhile(users, ['active', false]) );
* // => ['pebbles']
*
* // using the `_.property` iteratee shorthand
* resolve( _.dropWhile(users, 'active') );
* // => ['barney', 'fred', 'pebbles']
*/
function dropWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3), true)
: [];
}
/**
* Fills elements of `array` with `value` from `start` up to, but not
* including, `end`.
*
* **Note:** This method mutates `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to fill.
* @param {*} value The value to fill `array` with.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3];
*
* _.fill(array, 'a');
* console.log(array);
* // => ['a', 'a', 'a']
*
* _.fill(Array(3), 2);
* // => [2, 2, 2]
*
* _.fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*/
function fill(array, value, start, end) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
start = 0;
end = length;
}
return baseFill(array, value, start, end);
}
/**
* This method is like `_.find` except that it returns the index of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to search.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.findIndex(users, function(o) { return o.user == 'barney'; });
* // => 0
*
* // using the `_.matches` iteratee shorthand
* _.findIndex(users, { 'user': 'fred', 'active': false });
* // => 1
*
* // using the `_.matchesProperty` iteratee shorthand
* _.findIndex(users, ['active', false]);
* // => 0
*
* // using the `_.property` iteratee shorthand
* _.findIndex(users, 'active');
* // => 2
*/
function findIndex(array, predicate) {
return (array && array.length)
? baseFindIndex(array, getIteratee(predicate, 3))
: -1;
}
/**
* This method is like `_.findIndex` except that it iterates over elements
* of `collection` from right to left.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to search.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
* // => 2
*
* // using the `_.matches` iteratee shorthand
* _.findLastIndex(users, { 'user': 'barney', 'active': true });
* // => 0
*
* // using the `_.matchesProperty` iteratee shorthand
* _.findLastIndex(users, ['active', false]);
* // => 2
*
* // using the `_.property` iteratee shorthand
* _.findLastIndex(users, 'active');
* // => 0
*/
function findLastIndex(array, predicate) {
return (array && array.length)
? baseFindIndex(array, getIteratee(predicate, 3), true)
: -1;
}
/**
* Creates an array of flattened values by running each element in `array`
* through `iteratee` and concating its result to the other mapped values.
* The iteratee is invoked with three arguments: (value, index|key, array).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to iterate over.
* @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new array.
* @example
*
* function duplicate(n) {
* return [n, n];
* }
*
* _.flatMap([1, 2], duplicate);
* // => [1, 1, 2, 2]
*/
function flatMap(array, iteratee) {
var length = array ? array.length : 0;
return length ? baseFlatten(arrayMap(array, getIteratee(iteratee, 3))) : [];
}
/**
* Flattens `array` a single level.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, 3, [4]]]);
* // => [1, 2, 3, [4]]
*/
function flatten(array) {
var length = array ? array.length : 0;
return length ? baseFlatten(array) : [];
}
/**
* This method is like `_.flatten` except that it recursively flattens `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to recursively flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flattenDeep([1, [2, 3, [4]]]);
* // => [1, 2, 3, 4]
*/
function flattenDeep(array) {
var length = array ? array.length : 0;
return length ? baseFlatten(array, true) : [];
}
/**
* The inverse of `_.toPairs`; this method returns an object composed
* from key-value `pairs`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} pairs The key-value pairs.
* @returns {Object} Returns the new object.
* @example
*
* _.fromPairs([['fred', 30], ['barney', 40]]);
* // => { 'fred': 30, 'barney': 40 }
*/
function fromPairs(pairs) {
var index = -1,
length = pairs ? pairs.length : 0,
result = {};
while (++index < length) {
var pair = pairs[index];
baseSet(result, pair[0], pair[1]);
}
return result;
}
/**
* Gets the first element of `array`.
*
* @static
* @memberOf _
* @alias first
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the first element of `array`.
* @example
*
* _.head([1, 2, 3]);
* // => 1
*
* _.head([]);
* // => undefined
*/
function head(array) {
return array ? array[0] : undefined;
}
/**
* Gets the index at which the first occurrence of `value` is found in `array`
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons. If `fromIndex` is negative, it's used as the offset
* from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
* performs a faster binary search.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.indexOf([1, 2, 1, 2], 2);
* // => 1
*
* // using `fromIndex`
* _.indexOf([1, 2, 1, 2], 2, 2);
* // => 3
*/
function indexOf(array, value, fromIndex) {
var length = array ? array.length : 0;
if (!length) {
return -1;
}
fromIndex = toInteger(fromIndex);
if (fromIndex < 0) {
fromIndex = nativeMax(length + fromIndex, 0);
}
return baseIndexOf(array, value, fromIndex);
}
/**
* Gets all but the last element of `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.initial([1, 2, 3]);
* // => [1, 2]
*/
function initial(array) {
return dropRight(array, 1);
}
/**
* Creates an array of unique values that are included in all of the provided
* arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of shared values.
* @example
* _.intersection([2, 1], [4, 2], [1, 2]);
* // => [2]
*/
var intersection = rest(function(arrays) {
var mapped = arrayMap(arrays, toArrayLikeObject);
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped)
: [];
});
/**
* This method is like `_.intersection` except that it accepts `iteratee`
* which is invoked for each element of each `arrays` to generate the criterion
* by which uniqueness is computed. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of shared values.
* @example
*
* _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
* // => [2.1]
*
* // using the `_.property` iteratee shorthand
* _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }]
*/
var intersectionBy = rest(function(arrays) {
var iteratee = last(arrays),
mapped = arrayMap(arrays, toArrayLikeObject);
if (iteratee === last(mapped)) {
iteratee = undefined;
} else {
mapped.pop();
}
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped, getIteratee(iteratee))
: [];
});
/**
* This method is like `_.intersection` except that it accepts `comparator`
* which is invoked to compare elements of `arrays`. The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of shared values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.intersectionWith(objects, others, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }]
*/
var intersectionWith = rest(function(arrays) {
var comparator = last(arrays),
mapped = arrayMap(arrays, toArrayLikeObject);
if (comparator === last(mapped)) {
comparator = undefined;
} else {
mapped.pop();
}
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped, undefined, comparator)
: [];
});
/**
* Converts all elements in `array` into a string separated by `separator`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to convert.
* @param {string} [separator=','] The element separator.
* @returns {string} Returns the joined string.
* @example
*
* _.join(['a', 'b', 'c'], '~');
* // => 'a~b~c'
*/
function join(array, separator) {
return array ? nativeJoin.call(array, separator) : '';
}
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last(array) {
var length = array ? array.length : 0;
return length ? array[length - 1] : undefined;
}
/**
* This method is like `_.indexOf` except that it iterates over elements of
* `array` from right to left.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {number} [fromIndex=array.length-1] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.lastIndexOf([1, 2, 1, 2], 2);
* // => 3
*
* // using `fromIndex`
* _.lastIndexOf([1, 2, 1, 2], 2, 2);
* // => 1
*/
function lastIndexOf(array, value, fromIndex) {
var length = array ? array.length : 0;
if (!length) {
return -1;
}
var index = length;
if (fromIndex !== undefined) {
index = toInteger(fromIndex);
index = (index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1)) + 1;
}
if (value !== value) {
return indexOfNaN(array, index, true);
}
while (index--) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* Removes all provided values from `array` using
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.without`, this method mutates `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to modify.
* @param {...*} [values] The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3, 1, 2, 3];
*
* _.pull(array, 2, 3);
* console.log(array);
* // => [1, 1]
*/
var pull = rest(pullAll);
/**
* This method is like `_.pull` except that it accepts an array of values to remove.
*
* **Note:** Unlike `_.difference`, this method mutates `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3, 1, 2, 3];
*
* _.pull(array, [2, 3]);
* console.log(array);
* // => [1, 1]
*/
function pullAll(array, values) {
return (array && array.length && values && values.length)
? basePullAll(array, values)
: array;
}
/**
* This method is like `_.pullAll` except that it accepts `iteratee` which is
* invoked for each element of `array` and `values` to to generate the criterion
* by which uniqueness is computed. The iteratee is invoked with one argument: (value).
*
* **Note:** Unlike `_.differenceBy`, this method mutates `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns `array`.
* @example
*
* var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
*
* _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
* console.log(array);
* // => [{ 'x': 2 }]
*/
function pullAllBy(array, values, iteratee) {
return (array && array.length && values && values.length)
? basePullAllBy(array, values, getIteratee(iteratee))
: array;
}
/**
* Removes elements from `array` corresponding to `indexes` and returns an
* array of removed elements.
*
* **Note:** Unlike `_.at`, this method mutates `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to modify.
* @param {...(number|number[])} [indexes] The indexes of elements to remove,
* specified individually or in arrays.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = [5, 10, 15, 20];
* var evens = _.pullAt(array, 1, 3);
*
* console.log(array);
* // => [5, 15]
*
* console.log(evens);
* // => [10, 20]
*/
var pullAt = rest(function(array, indexes) {
indexes = arrayMap(baseFlatten(indexes), String);
var result = baseAt(array, indexes);
basePullAt(array, indexes.sort(compareAscending));
return result;
});
/**
* Removes all elements from `array` that `predicate` returns truthy for
* and returns an array of the removed elements. The predicate is invoked with
* three arguments: (value, index, array).
*
* **Note:** Unlike `_.filter`, this method mutates `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to modify.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = [1, 2, 3, 4];
* var evens = _.remove(array, function(n) {
* return n % 2 == 0;
* });
*
* console.log(array);
* // => [1, 3]
*
* console.log(evens);
* // => [2, 4]
*/
function remove(array, predicate) {
var result = [];
if (!(array && array.length)) {
return result;
}
var index = -1,
indexes = [],
length = array.length;
predicate = getIteratee(predicate, 3);
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result.push(value);
indexes.push(index);
}
}
basePullAt(array, indexes);
return result;
}
/**
* Reverses `array` so that the first element becomes the last, the second
* element becomes the second to last, and so on.
*
* **Note:** This method mutates `array` and is based on
* [`Array#reverse`](https://mdn.io/Array/reverse).
*
* @memberOf _
* @category Array
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3];
*
* _.reverse(array);
* // => [3, 2, 1]
*
* console.log(array);
* // => [3, 2, 1]
*/
function reverse(array) {
return array ? nativeReverse.call(array) : array;
}
/**
* Creates a slice of `array` from `start` up to, but not including, `end`.
*
* **Note:** This method is used instead of [`Array#slice`](https://mdn.io/Array/slice)
* to ensure dense arrays are returned.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function slice(array, start, end) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
start = 0;
end = length;
}
return baseSlice(array, start, end);
}
/**
* Uses a binary search to determine the lowest index at which `value` should
* be inserted into `array` in order to maintain its sort order.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @returns {number} Returns the index at which `value` should be inserted into `array`.
* @example
*
* _.sortedIndex([30, 50], 40);
* // => 1
*
* _.sortedIndex([4, 5], 4);
* // => 0
*/
function sortedIndex(array, value) {
return baseSortedIndex(array, value);
}
/**
* This method is like `_.sortedIndex` except that it accepts `iteratee`
* which is invoked for `value` and each element of `array` to compute their
* sort ranking. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the index at which `value` should be inserted into `array`.
* @example
*
* var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
*
* _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
* // => 1
*
* // using the `_.property` iteratee shorthand
* _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
* // => 0
*/
function sortedIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, getIteratee(iteratee));
}
/**
* This method is like `_.indexOf` except that it performs a binary
* search on a sorted `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.sortedIndexOf([1, 1, 2, 2], 2);
* // => 2
*/
function sortedIndexOf(array, value) {
var length = array ? array.length : 0;
if (length) {
var index = baseSortedIndex(array, value);
if (index < length && eq(array[index], value)) {
return index;
}
}
return -1;
}
/**
* This method is like `_.sortedIndex` except that it returns the highest
* index at which `value` should be inserted into `array` in order to
* maintain its sort order.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @returns {number} Returns the index at which `value` should be inserted into `array`.
* @example
*
* _.sortedLastIndex([4, 5], 4);
* // => 1
*/
function sortedLastIndex(array, value) {
return baseSortedIndex(array, value, true);
}
/**
* This method is like `_.sortedLastIndex` except that it accepts `iteratee`
* which is invoked for `value` and each element of `array` to compute their
* sort ranking. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the index at which `value` should be inserted into `array`.
* @example
*
* // using the `_.property` iteratee shorthand
* _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
* // => 1
*/
function sortedLastIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, getIteratee(iteratee), true);
}
/**
* This method is like `_.lastIndexOf` except that it performs a binary
* search on a sorted `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.sortedLastIndexOf([1, 1, 2, 2], 2);
* // => 3
*/
function sortedLastIndexOf(array, value) {
var length = array ? array.length : 0;
if (length) {
var index = baseSortedIndex(array, value, true) - 1;
if (eq(array[index], value)) {
return index;
}
}
return -1;
}
/**
* This method is like `_.uniq` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniq([1, 1, 2]);
* // => [1, 2]
*/
function sortedUniq(array) {
return (array && array.length)
? baseSortedUniq(array)
: [];
}
/**
* This method is like `_.uniqBy` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
* // => [1.1, 2.2]
*/
function sortedUniqBy(array, iteratee) {
return (array && array.length)
? baseSortedUniqBy(array, getIteratee(iteratee))
: [];
}
/**
* Gets all but the first element of `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.tail([1, 2, 3]);
* // => [2, 3]
*/
function tail(array) {
return drop(array, 1);
}
/**
* Creates a slice of `array` with `n` elements taken from the beginning.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.take([1, 2, 3]);
* // => [1]
*
* _.take([1, 2, 3], 2);
* // => [1, 2]
*
* _.take([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.take([1, 2, 3], 0);
* // => []
*/
function take(array, n, guard) {
if (!(array && array.length)) {
return [];
}
n = (guard || n === undefined) ? 1 : n;
return baseSlice(array, 0, n < 0 ? 0 : n);
}
/**
* Creates a slice of `array` with `n` elements taken from the end.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.takeRight([1, 2, 3]);
* // => [3]
*
* _.takeRight([1, 2, 3], 2);
* // => [2, 3]
*
* _.takeRight([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.takeRight([1, 2, 3], 0);
* // => []
*/
function takeRight(array, n, guard) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
n = length - n;
return baseSlice(array, n < 0 ? 0 : n);
}
/**
* Creates a slice of `array` with elements taken from the end. Elements are
* taken until `predicate` returns falsey. The predicate is invoked with three
* arguments: (value, index, array).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var resolve = _.partial(_.map, _, 'user');
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* resolve( _.takeRightWhile(users, function(o) { return !o.active; }) );
* // => ['fred', 'pebbles']
*
* // using the `_.matches` iteratee shorthand
* resolve( _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }) );
* // => ['pebbles']
*
* // using the `_.matchesProperty` iteratee shorthand
* resolve( _.takeRightWhile(users, ['active', false]) );
* // => ['fred', 'pebbles']
*
* // using the `_.property` iteratee shorthand
* resolve( _.takeRightWhile(users, 'active') );
* // => []
*/
function takeRightWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3), false, true)
: [];
}
/**
* Creates a slice of `array` with elements taken from the beginning. Elements
* are taken until `predicate` returns falsey. The predicate is invoked with
* three arguments: (value, index, array).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var resolve = _.partial(_.map, _, 'user');
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false},
* { 'user': 'pebbles', 'active': true }
* ];
*
* resolve( _.takeWhile(users, function(o) { return !o.active; }) );
* // => ['barney', 'fred']
*
* // using the `_.matches` iteratee shorthand
* resolve( _.takeWhile(users, { 'user': 'barney', 'active': false }) );
* // => ['barney']
*
* // using the `_.matchesProperty` iteratee shorthand
* resolve( _.takeWhile(users, ['active', false]) );
* // => ['barney', 'fred']
*
* // using the `_.property` iteratee shorthand
* resolve( _.takeWhile(users, 'active') );
* // => []
*/
function takeWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3))
: [];
}
/**
* Creates an array of unique values, in order, from all of the provided arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.union([2, 1], [4, 2], [1, 2]);
* // => [2, 1, 4]
*/
var union = rest(function(arrays) {
return baseUniq(baseFlatten(arrays, false, true));
});
/**
* This method is like `_.union` except that it accepts `iteratee` which is
* invoked for each element of each `arrays` to generate the criterion by which
* uniqueness is computed. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
* // => [2.1, 1.2, 4.3]
*
* // using the `_.property` iteratee shorthand
* _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
var unionBy = rest(function(arrays) {
var iteratee = last(arrays);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return baseUniq(baseFlatten(arrays, false, true), getIteratee(iteratee));
});
/**
* This method is like `_.union` except that it accepts `comparator` which
* is invoked to compare elements of `arrays`. The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of combined values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.unionWith(objects, others, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
*/
var unionWith = rest(function(arrays) {
var comparator = last(arrays);
if (isArrayLikeObject(comparator)) {
comparator = undefined;
}
return baseUniq(baseFlatten(arrays, false, true), undefined, comparator);
});
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons, in which only the first occurrence of each element
* is kept.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniq([2, 1, 2]);
* // => [2, 1]
*/
function uniq(array) {
return (array && array.length)
? baseUniq(array)
: [];
}
/**
* This method is like `_.uniq` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* uniqueness is computed. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to inspect.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniqBy([2.1, 1.2, 2.3], Math.floor);
* // => [2.1, 1.2]
*
* // using the `_.property` iteratee shorthand
* _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
function uniqBy(array, iteratee) {
return (array && array.length)
? baseUniq(array, getIteratee(iteratee))
: [];
}
/**
* This method is like `_.uniq` except that it accepts `comparator` which
* is invoked to compare elements of `array`. The comparator is invoked with
* two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.uniqWith(objects, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
*/
function uniqWith(array, comparator) {
return (array && array.length)
? baseUniq(array, undefined, comparator)
: [];
}
/**
* This method is like `_.zip` except that it accepts an array of grouped
* elements and creates an array regrouping the elements to their pre-zip
* configuration.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array of grouped elements to process.
* @returns {Array} Returns the new array of regrouped elements.
* @example
*
* var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
* // => [['fred', 30, true], ['barney', 40, false]]
*
* _.unzip(zipped);
* // => [['fred', 'barney'], [30, 40], [true, false]]
*/
function unzip(array) {
if (!(array && array.length)) {
return [];
}
var length = 0;
array = arrayFilter(array, function(group) {
if (isArrayLikeObject(group)) {
length = nativeMax(group.length, length);
return true;
}
});
return baseTimes(length, function(index) {
return arrayMap(array, baseProperty(index));
});
}
/**
* This method is like `_.unzip` except that it accepts `iteratee` to specify
* how regrouped values should be combined. The iteratee is invoked with the
* elements of each group: (...group).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array of grouped elements to process.
* @param {Function} [iteratee=_.identity] The function to combine regrouped values.
* @returns {Array} Returns the new array of regrouped elements.
* @example
*
* var zipped = _.zip([1, 2], [10, 20], [100, 200]);
* // => [[1, 10, 100], [2, 20, 200]]
*
* _.unzipWith(zipped, _.add);
* // => [3, 30, 300]
*/
function unzipWith(array, iteratee) {
if (!(array && array.length)) {
return [];
}
var result = unzip(array);
if (iteratee == null) {
return result;
}
return arrayMap(result, function(group) {
return apply(iteratee, undefined, group);
});
}
/**
* Creates an array excluding all provided values using
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to filter.
* @param {...*} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.without([1, 2, 1, 3], 1, 2);
* // => [3]
*/
var without = rest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, values)
: [];
});
/**
* Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
* of the provided arrays.
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of values.
* @example
*
* _.xor([2, 1], [4, 2]);
* // => [1, 4]
*/
var xor = rest(function(arrays) {
return baseXor(arrayFilter(arrays, isArrayLikeObject));
});
/**
* This method is like `_.xor` except that it accepts `iteratee` which is
* invoked for each element of each `arrays` to generate the criterion by which
* uniqueness is computed. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of values.
* @example
*
* _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);
* // => [1.2, 4.3]
*
* // using the `_.property` iteratee shorthand
* _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 2 }]
*/
var xorBy = rest(function(arrays) {
var iteratee = last(arrays);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee));
});
/**
* This method is like `_.xor` except that it accepts `comparator` which is
* invoked to compare elements of `arrays`. The comparator is invoked with
* two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.xorWith(objects, others, _.isEqual);
* // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
*/
var xorWith = rest(function(arrays) {
var comparator = last(arrays);
if (isArrayLikeObject(comparator)) {
comparator = undefined;
}
return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
});
/**
* Creates an array of grouped elements, the first of which contains the first
* elements of the given arrays, the second of which contains the second elements
* of the given arrays, and so on.
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to process.
* @returns {Array} Returns the new array of grouped elements.
* @example
*
* _.zip(['fred', 'barney'], [30, 40], [true, false]);
* // => [['fred', 30, true], ['barney', 40, false]]
*/
var zip = rest(unzip);
/**
* This method is like `_.fromPairs` except that it accepts two arrays,
* one of property names and one of corresponding values.
*
* @static
* @memberOf _
* @category Array
* @param {Array} [props=[]] The property names.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObject(['fred', 'barney'], [30, 40]);
* // => { 'fred': 30, 'barney': 40 }
*/
function zipObject(props, values) {
var index = -1,
length = props ? props.length : 0,
valsLength = values ? values.length : 0,
result = {};
while (++index < length) {
baseSet(result, props[index], index < valsLength ? values[index] : undefined);
}
return result;
}
/**
* This method is like `_.zip` except that it accepts `iteratee` to specify
* how grouped values should be combined. The iteratee is invoked with the
* elements of each group: (...group).
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to process.
* @param {Function} [iteratee=_.identity] The function to combine grouped values.
* @returns {Array} Returns the new array of grouped elements.
* @example
*
* _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
* return a + b + c;
* });
* // => [111, 222]
*/
var zipWith = rest(function(arrays) {
var length = arrays.length,
iteratee = length > 1 ? arrays[length - 1] : undefined;
iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
return unzipWith(arrays, iteratee);
});
/*------------------------------------------------------------------------*/
/**
* Creates a `lodash` object that wraps `value` with explicit method chaining enabled.
* The result of such method chaining must be unwrapped with `_#value`.
*
* @static
* @memberOf _
* @category Chain
* @param {*} value The value to wrap.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'pebbles', 'age': 1 }
* ];
*
* var youngest = _
* .chain(users)
* .sortBy('age')
* .map(function(o) {
* return o.user + ' is ' + o.age;
* })
* .head()
* .value();
* // => 'pebbles is 1'
*/
function chain(value) {
var result = lodash(value);
result.__chain__ = true;
return result;
}
/**
* This method invokes `interceptor` and returns `value`. The interceptor is
* invoked with one argument; (value). The purpose of this method is to "tap into"
* a method chain in order to perform operations on intermediate results within
* the chain.
*
* @static
* @memberOf _
* @category Chain
* @param {*} value The value to provide to `interceptor`.
* @param {Function} interceptor The function to invoke.
* @returns {*} Returns `value`.
* @example
*
* _([1, 2, 3])
* .tap(function(array) {
* array.pop();
* })
* .reverse()
* .value();
* // => [2, 1]
*/
function tap(value, interceptor) {
interceptor(value);
return value;
}
/**
* This method is like `_.tap` except that it returns the result of `interceptor`.
*
* @static
* @memberOf _
* @category Chain
* @param {*} value The value to provide to `interceptor`.
* @param {Function} interceptor The function to invoke.
* @returns {*} Returns the result of `interceptor`.
* @example
*
* _(' abc ')
* .chain()
* .trim()
* .thru(function(value) {
* return [value];
* })
* .value();
* // => ['abc']
*/
function thru(value, interceptor) {
return interceptor(value);
}
/**
* This method is the wrapper version of `_.at`.
*
* @name at
* @memberOf _
* @category Chain
* @param {...(string|string[])} [paths] The property paths of elements to pick,
* specified individually or in arrays.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
*
* _(object).at(['a[0].b.c', 'a[1]']).value();
* // => [3, 4]
*
* _(['a', 'b', 'c']).at(0, 2).value();
* // => ['a', 'c']
*/
var wrapperAt = rest(function(paths) {
paths = baseFlatten(paths);
var length = paths.length,
start = length ? paths[0] : 0,
value = this.__wrapped__,
interceptor = function(object) { return baseAt(object, paths); };
if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
return this.thru(interceptor);
}
value = value.slice(start, +start + (length ? 1 : 0));
value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
return new LodashWrapper(value, this.__chain__).thru(function(array) {
if (length && !array.length) {
array.push(undefined);
}
return array;
});
});
/**
* Enables explicit method chaining on the wrapper object.
*
* @name chain
* @memberOf _
* @category Chain
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 }
* ];
*
* // without explicit chaining
* _(users).head();
* // => { 'user': 'barney', 'age': 36 }
*
* // with explicit chaining
* _(users)
* .chain()
* .head()
* .pick('user')
* .value();
* // => { 'user': 'barney' }
*/
function wrapperChain() {
return chain(this);
}
/**
* Executes the chained sequence and returns the wrapped result.
*
* @name commit
* @memberOf _
* @category Chain
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var array = [1, 2];
* var wrapped = _(array).push(3);
*
* console.log(array);
* // => [1, 2]
*
* wrapped = wrapped.commit();
* console.log(array);
* // => [1, 2, 3]
*
* wrapped.last();
* // => 3
*
* console.log(array);
* // => [1, 2, 3]
*/
function wrapperCommit() {
return new LodashWrapper(this.value(), this.__chain__);
}
/**
* This method is the wrapper version of `_.flatMap`.
*
* @static
* @memberOf _
* @category Chain
* @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function duplicate(n) {
* return [n, n];
* }
*
* _([1, 2]).flatMap(duplicate).value();
* // => [1, 1, 2, 2]
*/
function wrapperFlatMap(iteratee) {
return this.map(iteratee).flatten();
}
/**
* Gets the next value on a wrapped object following the
* [iterator protocol](https://mdn.io/iteration_protocols#iterator).
*
* @name next
* @memberOf _
* @category Chain
* @returns {Object} Returns the next iterator value.
* @example
*
* var wrapped = _([1, 2]);
*
* wrapped.next();
* // => { 'done': false, 'value': 1 }
*
* wrapped.next();
* // => { 'done': false, 'value': 2 }
*
* wrapped.next();
* // => { 'done': true, 'value': undefined }
*/
function wrapperNext() {
if (this.__values__ === undefined) {
this.__values__ = toArray(this.value());
}
var done = this.__index__ >= this.__values__.length,
value = done ? undefined : this.__values__[this.__index__++];
return { 'done': done, 'value': value };
}
/**
* Enables the wrapper to be iterable.
*
* @name Symbol.iterator
* @memberOf _
* @category Chain
* @returns {Object} Returns the wrapper object.
* @example
*
* var wrapped = _([1, 2]);
*
* wrapped[Symbol.iterator]() === wrapped;
* // => true
*
* Array.from(wrapped);
* // => [1, 2]
*/
function wrapperToIterator() {
return this;
}
/**
* Creates a clone of the chained sequence planting `value` as the wrapped value.
*
* @name plant
* @memberOf _
* @category Chain
* @param {*} value The value to plant.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2]).map(square);
* var other = wrapped.plant([3, 4]);
*
* other.value();
* // => [9, 16]
*
* wrapped.value();
* // => [1, 4]
*/
function wrapperPlant(value) {
var result,
parent = this;
while (parent instanceof baseLodash) {
var clone = wrapperClone(parent);
clone.__index__ = 0;
clone.__values__ = undefined;
if (result) {
previous.__wrapped__ = clone;
} else {
result = clone;
}
var previous = clone;
parent = parent.__wrapped__;
}
previous.__wrapped__ = value;
return result;
}
/**
* This method is the wrapper version of `_.reverse`.
*
* **Note:** This method mutates the wrapped array.
*
* @name reverse
* @memberOf _
* @category Chain
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var array = [1, 2, 3];
*
* _(array).reverse().value()
* // => [3, 2, 1]
*
* console.log(array);
* // => [3, 2, 1]
*/
function wrapperReverse() {
var value = this.__wrapped__;
if (value instanceof LazyWrapper) {
var wrapped = value;
if (this.__actions__.length) {
wrapped = new LazyWrapper(this);
}
wrapped = wrapped.reverse();
wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined });
return new LodashWrapper(wrapped, this.__chain__);
}
return this.thru(reverse);
}
/**
* Executes the chained sequence to extract the unwrapped value.
*
* @name value
* @memberOf _
* @alias run, toJSON, valueOf
* @category Chain
* @returns {*} Returns the resolved unwrapped value.
* @example
*
* _([1, 2, 3]).value();
* // => [1, 2, 3]
*/
function wrapperValue() {
return baseWrapperValue(this.__wrapped__, this.__actions__);
}
/*------------------------------------------------------------------------*/
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` through `iteratee`. The corresponding value
* of each key is the number of times the key was returned by `iteratee`.
* The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.countBy([6.1, 4.2, 6.3], Math.floor);
* // => { '4': 1, '6': 2 }
*
* _.countBy(['one', 'two', 'three'], 'length');
* // => { '3': 2, '5': 1 }
*/
var countBy = createAggregator(function(result, value, key) {
hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
});
/**
* Checks if `predicate` returns truthy for **all** elements of `collection`.
* Iteration is stopped once `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`.
* @example
*
* _.every([true, 1, null, 'yes'], Boolean);
* // => false
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false }
* ];
*
* // using the `_.matches` iteratee shorthand
* _.every(users, { 'user': 'barney', 'active': false });
* // => false
*
* // using the `_.matchesProperty` iteratee shorthand
* _.every(users, ['active', false]);
* // => true
*
* // using the `_.property` iteratee shorthand
* _.every(users, 'active');
* // => false
*/
function every(collection, predicate, guard) {
var func = isArray(collection) ? arrayEvery : baseEvery;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, getIteratee(predicate, 3));
}
/**
* Iterates over elements of `collection`, returning an array of all elements
* `predicate` returns truthy for. The predicate is invoked with three arguments:
* (value, index|key, collection).
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
* @example
*
* var resolve = _.partial(_.map, _, 'user');
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* resolve( _.filter(users, function(o) { return !o.active; }) );
* // => ['fred']
*
* // using the `_.matches` iteratee shorthand
* resolve( _.filter(users, { 'age': 36, 'active': true }) );
* // => ['barney']
*
* // using the `_.matchesProperty` iteratee shorthand
* resolve( _.filter(users, ['active', false]) );
* // => ['fred']
*
* // using the `_.property` iteratee shorthand
* resolve( _.filter(users, 'active') );
* // => ['barney']
*/
function filter(collection, predicate) {
var func = isArray(collection) ? arrayFilter : baseFilter;
return func(collection, getIteratee(predicate, 3));
}
/**
* Iterates over elements of `collection`, returning the first element
* `predicate` returns truthy for. The predicate is invoked with three arguments:
* (value, index|key, collection).
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to search.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var resolve = _.partial(_.result, _, 'user');
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false },
* { 'user': 'pebbles', 'age': 1, 'active': true }
* ];
*
* resolve( _.find(users, function(o) { return o.age < 40; }) );
* // => 'barney'
*
* // using the `_.matches` iteratee shorthand
* resolve( _.find(users, { 'age': 1, 'active': true }) );
* // => 'pebbles'
*
* // using the `_.matchesProperty` iteratee shorthand
* resolve( _.find(users, ['active', false]) );
* // => 'fred'
*
* // using the `_.property` iteratee shorthand
* resolve( _.find(users, 'active') );
* // => 'barney'
*/
function find(collection, predicate) {
predicate = getIteratee(predicate, 3);
if (isArray(collection)) {
var index = baseFindIndex(collection, predicate);
return index > -1 ? collection[index] : undefined;
}
return baseFind(collection, predicate, baseEach);
}
/**
* This method is like `_.find` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to search.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* _.findLast([1, 2, 3, 4], function(n) {
* return n % 2 == 1;
* });
* // => 3
*/
function findLast(collection, predicate) {
predicate = getIteratee(predicate, 3);
if (isArray(collection)) {
var index = baseFindIndex(collection, predicate, true);
return index > -1 ? collection[index] : undefined;
}
return baseFind(collection, predicate, baseEachRight);
}
/**
* Iterates over elements of `collection` invoking `iteratee` for each element.
* The iteratee is invoked with three arguments: (value, index|key, collection).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* **Note:** As with other "Collections" methods, objects with a "length" property
* are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn`
* for object iteration.
*
* @static
* @memberOf _
* @alias each
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @example
*
* _([1, 2]).forEach(function(value) {
* console.log(value);
* });
* // => logs `1` then `2`
*
* _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
* console.log(key);
* });
* // => logs 'a' then 'b' (iteration order is not guaranteed)
*/
function forEach(collection, iteratee) {
return (typeof iteratee == 'function' && isArray(collection))
? arrayEach(collection, iteratee)
: baseEach(collection, toFunction(iteratee));
}
/**
* This method is like `_.forEach` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @alias eachRight
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @example
*
* _.forEachRight([1, 2], function(value) {
* console.log(value);
* });
* // => logs `2` then `1`
*/
function forEachRight(collection, iteratee) {
return (typeof iteratee == 'function' && isArray(collection))
? arrayEachRight(collection, iteratee)
: baseEachRight(collection, toFunction(iteratee));
}
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` through `iteratee`. The corresponding value
* of each key is an array of the elements responsible for generating the key.
* The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.groupBy([6.1, 4.2, 6.3], Math.floor);
* // => { '4': [4.2], '6': [6.1, 6.3] }
*
* // using the `_.property` iteratee shorthand
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
var groupBy = createAggregator(function(result, value, key) {
if (hasOwnProperty.call(result, key)) {
result[key].push(value);
} else {
result[key] = [value];
}
});
/**
* Checks if `value` is in `collection`. If `collection` is a string it's checked
* for a substring of `value`, otherwise [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* is used for equality comparisons. If `fromIndex` is negative, it's used as
* the offset from the end of `collection`.
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object|string} collection The collection to search.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`.
* @returns {boolean} Returns `true` if `value` is found, else `false`.
* @example
*
* _.includes([1, 2, 3], 1);
* // => true
*
* _.includes([1, 2, 3], 1, 2);
* // => false
*
* _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
* // => true
*
* _.includes('pebbles', 'eb');
* // => true
*/
function includes(collection, value, fromIndex, guard) {
collection = isArrayLike(collection) ? collection : values(collection);
fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
var length = collection.length;
if (fromIndex < 0) {
fromIndex = nativeMax(length + fromIndex, 0);
}
return isString(collection)
? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
: (!!length && baseIndexOf(collection, value, fromIndex) > -1);
}
/**
* Invokes the method at `path` of each element in `collection`, returning
* an array of the results of each invoked method. Any additional arguments
* are provided to each invoked method. If `methodName` is a function it's
* invoked for, and `this` bound to, each element in `collection`.
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Array|Function|string} path The path of the method to invoke or
* the function invoked per iteration.
* @param {...*} [args] The arguments to invoke each method with.
* @returns {Array} Returns the array of results.
* @example
*
* _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
* // => [[1, 5, 7], [1, 2, 3]]
*
* _.invokeMap([123, 456], String.prototype.split, '');
* // => [['1', '2', '3'], ['4', '5', '6']]
*/
var invokeMap = rest(function(collection, path, args) {
var index = -1,
isFunc = typeof path == 'function',
isProp = isKey(path),
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value) {
var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
result[++index] = func ? apply(func, value, args) : baseInvoke(value, path, args);
});
return result;
});
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` through `iteratee`. The corresponding value
* of each key is the last element responsible for generating the key. The
* iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* var keyData = [
* { 'dir': 'left', 'code': 97 },
* { 'dir': 'right', 'code': 100 }
* ];
*
* _.keyBy(keyData, 'dir');
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
*
* _.keyBy(keyData, function(o) {
* return String.fromCharCode(o.code);
* });
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*/
var keyBy = createAggregator(function(result, value, key) {
result[key] = value;
});
/**
* Creates an array of values by running each element in `collection` through
* `iteratee`. The iteratee is invoked with three arguments:
* (value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
*
* The guarded methods are:
* `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`,
* `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`,
* `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`,
* and `words`
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
* @example
*
* function square(n) {
* return n * n;
* }
*
* _.map([1, 2], square);
* // => [3, 6]
*
* _.map({ 'a': 1, 'b': 2 }, square);
* // => [3, 6] (iteration order is not guaranteed)
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' }
* ];
*
* // using the `_.property` iteratee shorthand
* _.map(users, 'user');
* // => ['barney', 'fred']
*/
function map(collection, iteratee) {
var func = isArray(collection) ? arrayMap : baseMap;
return func(collection, getIteratee(iteratee, 3));
}
/**
* This method is like `_.sortBy` except that it allows specifying the sort
* orders of the iteratees to sort by. If `orders` is unspecified, all values
* are sorted in ascending order. Otherwise, specify an order of "desc" for
* descending or "asc" for ascending sort order of corresponding values.
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function[]|Object[]|string[]} [iteratees=[_.identity]] The iteratees to sort by.
* @param {string[]} [orders] The sort orders of `iteratees`.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`.
* @returns {Array} Returns the new sorted array.
* @example
*
* var resolve = _.partial(_.map, _, _.values);
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 34 },
* { 'user': 'fred', 'age': 42 },
* { 'user': 'barney', 'age': 36 }
* ];
*
* // sort by `user` in ascending order and by `age` in descending order
* resolve( _.orderBy(users, ['user', 'age'], ['asc', 'desc']) );
* // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
*/
function orderBy(collection, iteratees, orders, guard) {
if (collection == null) {
return [];
}
if (!isArray(iteratees)) {
iteratees = iteratees == null ? [] : [iteratees];
}
orders = guard ? undefined : orders;
if (!isArray(orders)) {
orders = orders == null ? [] : [orders];
}
return baseOrderBy(collection, iteratees, orders);
}
/**
* Creates an array of elements split into two groups, the first of which
* contains elements `predicate` returns truthy for, while the second of which
* contains elements `predicate` returns falsey for. The predicate is invoked
* with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of grouped elements.
* @example
*
* var resolve = function(result) {
* return _.map(result, function(array) { return _.map(array, 'user'); });
* };
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': true },
* { 'user': 'pebbles', 'age': 1, 'active': false }
* ];
*
* resolve( _.partition(users, function(o) { return o.active; }) );
* // => [['fred'], ['barney', 'pebbles']]
*
* // using the `_.matches` iteratee shorthand
* resolve( _.partition(users, { 'age': 1, 'active': false }) );
* // => [['pebbles'], ['barney', 'fred']]
*
* // using the `_.matchesProperty` iteratee shorthand
* resolve( _.partition(users, ['active', false]) );
* // => [['barney', 'pebbles'], ['fred']]
*
* // using the `_.property` iteratee shorthand
* resolve( _.partition(users, 'active') );
* // => [['fred'], ['barney', 'pebbles']]
*/
var partition = createAggregator(function(result, value, key) {
result[key ? 0 : 1].push(value);
}, function() { return [[], []]; });
/**
* Reduces `collection` to a value which is the accumulated result of running
* each element in `collection` through `iteratee`, where each successive
* invocation is supplied the return value of the previous. If `accumulator`
* is not provided the first element of `collection` is used as the initial
* value. The iteratee is invoked with four arguments:
* (accumulator, value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.reduce`, `_.reduceRight`, and `_.transform`.
*
* The guarded methods are:
* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
* and `sortBy`
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @example
*
* _.reduce([1, 2], function(sum, n) {
* return sum + n;
* });
* // => 3
*
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* return result;
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
*/
function reduce(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduce : baseReduce,
initFromCollection = arguments.length < 3;
return func(collection, getIteratee(iteratee, 4), accumulator, initFromCollection, baseEach);
}
/**
* This method is like `_.reduce` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @example
*
* var array = [[0, 1], [2, 3], [4, 5]];
*
* _.reduceRight(array, function(flattened, other) {
* return flattened.concat(other);
* }, []);
* // => [4, 5, 2, 3, 0, 1]
*/
function reduceRight(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduceRight : baseReduce,
initFromCollection = arguments.length < 3;
return func(collection, getIteratee(iteratee, 4), accumulator, initFromCollection, baseEachRight);
}
/**
* The opposite of `_.filter`; this method returns the elements of `collection`
* that `predicate` does **not** return truthy for.
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
* @example
*
* var resolve = _.partial(_.map, _, 'user');
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': true }
* ];
*
* resolve( _.reject(users, function(o) { return !o.active; }) );
* // => ['fred']
*
* // using the `_.matches` iteratee shorthand
* resolve( _.reject(users, { 'age': 40, 'active': true }) );
* // => ['barney']
*
* // using the `_.matchesProperty` iteratee shorthand
* resolve( _.reject(users, ['active', false]) );
* // => ['fred']
*
* // using the `_.property` iteratee shorthand
* resolve( _.reject(users, 'active') );
* // => ['barney']
*/
function reject(collection, predicate) {
var func = isArray(collection) ? arrayFilter : baseFilter;
predicate = getIteratee(predicate, 3);
return func(collection, function(value, index, collection) {
return !predicate(value, index, collection);
});
}
/**
* Gets a random element from `collection`.
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to sample.
* @returns {*} Returns the random element.
* @example
*
* _.sample([1, 2, 3, 4]);
* // => 2
*/
function sample(collection) {
var array = isArrayLike(collection) ? collection : values(collection),
length = array.length;
return length > 0 ? array[baseRandom(0, length - 1)] : undefined;
}
/**
* Gets `n` random elements from `collection`.
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to sample.
* @param {number} [n=0] The number of elements to sample.
* @returns {Array} Returns the random elements.
* @example
*
* _.sampleSize([1, 2, 3, 4], 2);
* // => [3, 1]
*/
function sampleSize(collection, n) {
var index = -1,
result = toArray(collection),
length = result.length,
lastIndex = length - 1;
n = baseClamp(toInteger(n), 0, length);
while (++index < n) {
var rand = baseRandom(index, lastIndex),
value = result[rand];
result[rand] = result[index];
result[index] = value;
}
result.length = n;
return result;
}
/**
* Creates an array of shuffled values, using a version of the
* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to shuffle.
* @returns {Array} Returns the new shuffled array.
* @example
*
* _.shuffle([1, 2, 3, 4]);
* // => [4, 1, 3, 2]
*/
function shuffle(collection) {
return sampleSize(collection, MAX_ARRAY_LENGTH);
}
/**
* Gets the size of `collection` by returning its length for array-like
* values or the number of own enumerable properties for objects.
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @returns {number} Returns the collection size.
* @example
*
* _.size([1, 2, 3]);
* // => 3
*
* _.size({ 'a': 1, 'b': 2 });
* // => 2
*
* _.size('pebbles');
* // => 7
*/
function size(collection) {
if (collection == null) {
return 0;
}
if (isArrayLike(collection)) {
var result = collection.length;
return (result && isString(collection)) ? stringSize(collection) : result;
}
return keys(collection).length;
}
/**
* Checks if `predicate` returns truthy for **any** element of `collection`.
* Iteration is stopped once `predicate` returns truthy. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.
* @example
*
* _.some([null, 0, 'yes', false], Boolean);
* // => true
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false }
* ];
*
* // using the `_.matches` iteratee shorthand
* _.some(users, { 'user': 'barney', 'active': false });
* // => false
*
* // using the `_.matchesProperty` iteratee shorthand
* _.some(users, ['active', false]);
* // => true
*
* // using the `_.property` iteratee shorthand
* _.some(users, 'active');
* // => true
*/
function some(collection, predicate, guard) {
var func = isArray(collection) ? arraySome : baseSome;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, getIteratee(predicate, 3));
}
/**
* Creates an array of elements, sorted in ascending order by the results of
* running each element in a collection through each iteratee. This method
* performs a stable sort, that is, it preserves the original sort order of
* equal elements. The iteratees are invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {...(Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]]
* The iteratees to sort by, specified individually or in arrays.
* @returns {Array} Returns the new sorted array.
* @example
*
* var resolve = _.partial(_.map, _, _.values);
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 42 },
* { 'user': 'barney', 'age': 34 }
* ];
*
* resolve( _.sortBy(users, function(o) { return o.user; }) );
* // => // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
*
* resolve( _.sortBy(users, ['user', 'age']) );
* // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]
*
* resolve( _.sortBy(users, 'user', function(o) {
* return Math.floor(o.age / 10);
* }) );
* // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
*/
var sortBy = rest(function(collection, iteratees) {
if (collection == null) {
return [];
}
var length = iteratees.length;
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
iteratees = [];
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
iteratees.length = 1;
}
return baseOrderBy(collection, baseFlatten(iteratees), []);
});
/*------------------------------------------------------------------------*/
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @type Function
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp) {
* console.log(_.now() - stamp);
* }, _.now());
* // => logs the number of milliseconds it took for the deferred function to be invoked
*/
var now = Date.now;
/*------------------------------------------------------------------------*/
/**
* The opposite of `_.before`; this method creates a function that invokes
* `func` once it's called `n` or more times.
*
* @static
* @memberOf _
* @category Function
* @param {number} n The number of calls before `func` is invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var saves = ['profile', 'settings'];
*
* var done = _.after(saves.length, function() {
* console.log('done saving!');
* });
*
* _.forEach(saves, function(type) {
* asyncSave({ 'type': type, 'complete': done });
* });
* // => logs 'done saving!' after the two async saves have completed
*/
function after(n, func) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
return function() {
if (--n < 1) {
return func.apply(this, arguments);
}
};
}
/**
* Creates a function that accepts up to `n` arguments, ignoring any
* additional arguments.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to cap arguments for.
* @param {number} [n=func.length] The arity cap.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {Function} Returns the new function.
* @example
*
* _.map(['6', '8', '10'], _.ary(parseInt, 1));
* // => [6, 8, 10]
*/
function ary(func, n, guard) {
n = guard ? undefined : n;
n = (func && n == null) ? func.length : n;
return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
}
/**
* Creates a function that invokes `func`, with the `this` binding and arguments
* of the created function, while it's called less than `n` times. Subsequent
* calls to the created function return the result of the last `func` invocation.
*
* @static
* @memberOf _
* @category Function
* @param {number} n The number of calls at which `func` is no longer invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* jQuery(element).on('click', _.before(5, addContactToList));
* // => allows adding up to 4 contacts to the list
*/
function before(n, func) {
var result;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
return function() {
if (--n > 0) {
result = func.apply(this, arguments);
}
if (n <= 1) {
func = undefined;
}
return result;
};
}
/**
* Creates a function that invokes `func` with the `this` binding of `thisArg`
* and prepends any additional `_.bind` arguments to those provided to the
* bound function.
*
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for partially applied arguments.
*
* **Note:** Unlike native `Function#bind` this method doesn't set the "length"
* property of bound functions.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to bind.
* @param {*} thisArg The `this` binding of `func`.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* var greet = function(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation;
* };
*
* var object = { 'user': 'fred' };
*
* var bound = _.bind(greet, object, 'hi');
* bound('!');
* // => 'hi fred!'
*
* // using placeholders
* var bound = _.bind(greet, object, _, '!');
* bound('hi');
* // => 'hi fred!'
*/
var bind = rest(function(func, thisArg, partials) {
var bitmask = BIND_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, bind.placeholder);
bitmask |= PARTIAL_FLAG;
}
return createWrapper(func, bitmask, thisArg, partials, holders);
});
/**
* Creates a function that invokes the method at `object[key]` and prepends
* any additional `_.bindKey` arguments to those provided to the bound function.
*
* This method differs from `_.bind` by allowing bound functions to reference
* methods that may be redefined or don't yet exist.
* See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
* for more details.
*
* The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* @static
* @memberOf _
* @category Function
* @param {Object} object The object to invoke the method on.
* @param {string} key The key of the method.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* var object = {
* 'user': 'fred',
* 'greet': function(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation;
* }
* };
*
* var bound = _.bindKey(object, 'greet', 'hi');
* bound('!');
* // => 'hi fred!'
*
* object.greet = function(greeting, punctuation) {
* return greeting + 'ya ' + this.user + punctuation;
* };
*
* bound('!');
* // => 'hiya fred!'
*
* // using placeholders
* var bound = _.bindKey(object, 'greet', _, '!');
* bound('hi');
* // => 'hiya fred!'
*/
var bindKey = rest(function(object, key, partials) {
var bitmask = BIND_FLAG | BIND_KEY_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, bindKey.placeholder);
bitmask |= PARTIAL_FLAG;
}
return createWrapper(key, bitmask, object, partials, holders);
});
/**
* Creates a function that accepts arguments of `func` and either invokes
* `func` returning its result, if at least `arity` number of arguments have
* been provided, or returns a function that accepts the remaining `func`
* arguments, and so on. The arity of `func` may be specified if `func.length`
* is not sufficient.
*
* The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curry(abc);
*
* curried(1)(2)(3);
* // => [1, 2, 3]
*
* curried(1, 2)(3);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // using placeholders
* curried(1)(_, 3)(2);
* // => [1, 2, 3]
*/
function curry(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curry.placeholder;
return result;
}
/**
* This method is like `_.curry` except that arguments are applied to `func`
* in the manner of `_.partialRight` instead of `_.partial`.
*
* The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curryRight(abc);
*
* curried(3)(2)(1);
* // => [1, 2, 3]
*
* curried(2, 3)(1);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // using placeholders
* curried(3)(1, _)(2);
* // => [1, 2, 3]
*/
function curryRight(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curryRight.placeholder;
return result;
}
/**
* Creates a debounced function that delays invoking `func` until after `wait`
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide an options object to indicate whether `func` should be invoked on
* the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent calls
* to the debounced function return the result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the the debounced function is
* invoked more than once during the `wait` timeout.
*
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
* for details over the differences between `_.debounce` and `_.throttle`.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to debounce.
* @param {number} [wait=0] The number of milliseconds to delay.
* @param {Object} [options] The options object.
* @param {boolean} [options.leading=false] Specify invoking on the leading
* edge of the timeout.
* @param {number} [options.maxWait] The maximum time `func` is allowed to be
* delayed before it's invoked.
* @param {boolean} [options.trailing=true] Specify invoking on the trailing
* edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // avoid costly calculations while the window size is in flux
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // invoke `sendMail` when clicked, debouncing subsequent calls
* jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* }));
*
* // ensure `batchLog` is invoked once after 1 second of debounced calls
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream');
* jQuery(source).on('message', debounced);
*
* // cancel a trailing debounced invocation
* jQuery(window).on('popstate', debounced.cancel);
*/
function debounce(func, wait, options) {
var args,
maxTimeoutId,
result,
stamp,
thisArg,
timeoutId,
trailingCall,
lastCalled = 0,
leading = false,
maxWait = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxWait = 'maxWait' in options && nativeMax(toNumber(options.maxWait) || 0, wait);
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
function cancel() {
if (timeoutId) {
clearTimeout(timeoutId);
}
if (maxTimeoutId) {
clearTimeout(maxTimeoutId);
}
lastCalled = 0;
args = maxTimeoutId = thisArg = timeoutId = trailingCall = undefined;
}
function complete(isCalled, id) {
if (id) {
clearTimeout(id);
}
maxTimeoutId = timeoutId = trailingCall = undefined;
if (isCalled) {
lastCalled = now();
result = func.apply(thisArg, args);
if (!timeoutId && !maxTimeoutId) {
args = thisArg = undefined;
}
}
}
function delayed() {
var remaining = wait - (now() - stamp);
if (remaining <= 0 || remaining > wait) {
complete(trailingCall, maxTimeoutId);
} else {
timeoutId = setTimeout(delayed, remaining);
}
}
function flush() {
if ((timeoutId && trailingCall) || (maxTimeoutId && trailing)) {
result = func.apply(thisArg, args);
}
cancel();
return result;
}
function maxDelayed() {
complete(trailing, timeoutId);
}
function debounced() {
args = arguments;
stamp = now();
thisArg = this;
trailingCall = trailing && (timeoutId || !leading);
if (maxWait === false) {
var leadingCall = leading && !timeoutId;
} else {
if (!maxTimeoutId && !leading) {
lastCalled = stamp;
}
var remaining = maxWait - (stamp - lastCalled),
isCalled = remaining <= 0 || remaining > maxWait;
if (isCalled) {
if (maxTimeoutId) {
maxTimeoutId = clearTimeout(maxTimeoutId);
}
lastCalled = stamp;
result = func.apply(thisArg, args);
}
else if (!maxTimeoutId) {
maxTimeoutId = setTimeout(maxDelayed, remaining);
}
}
if (isCalled && timeoutId) {
timeoutId = clearTimeout(timeoutId);
}
else if (!timeoutId && wait !== maxWait) {
timeoutId = setTimeout(delayed, wait);
}
if (leadingCall) {
isCalled = true;
result = func.apply(thisArg, args);
}
if (isCalled && !timeoutId && !maxTimeoutId) {
args = thisArg = undefined;
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
/**
* Defers invoking the `func` until the current call stack has cleared. Any
* additional arguments are provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to defer.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {number} Returns the timer id.
* @example
*
* _.defer(function(text) {
* console.log(text);
* }, 'deferred');
* // logs 'deferred' after one or more milliseconds
*/
var defer = rest(function(func, args) {
return baseDelay(func, 1, args);
});
/**
* Invokes `func` after `wait` milliseconds. Any additional arguments are
* provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {number} Returns the timer id.
* @example
*
* _.delay(function(text) {
* console.log(text);
* }, 1000, 'later');
* // => logs 'later' after one second
*/
var delay = rest(function(func, wait, args) {
return baseDelay(func, toNumber(wait) || 0, args);
});
/**
* Creates a function that invokes `func` with arguments reversed.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to flip arguments for.
* @returns {Function} Returns the new function.
* @example
*
* var flipped = _.flip(function() {
* return _.toArray(arguments);
* });
*
* flipped('a', 'b', 'c', 'd');
* // => ['d', 'c', 'b', 'a']
*/
function flip(func) {
return createWrapper(func, FLIP_FLAG);
}
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoizing function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // modifying the result cache
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // replacing `_.memoize.Cache`
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result);
return result;
};
memoized.cache = new memoize.Cache;
return memoized;
}
/**
* Creates a function that negates the result of the predicate `func`. The
* `func` predicate is invoked with the `this` binding and arguments of the
* created function.
*
* @static
* @memberOf _
* @category Function
* @param {Function} predicate The predicate to negate.
* @returns {Function} Returns the new function.
* @example
*
* function isEven(n) {
* return n % 2 == 0;
* }
*
* _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
* // => [1, 3, 5]
*/
function negate(predicate) {
if (typeof predicate != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return function() {
return !predicate.apply(this, arguments);
};
}
/**
* Creates a function that is restricted to invoking `func` once. Repeat calls
* to the function return the value of the first invocation. The `func` is
* invoked with the `this` binding and arguments of the created function.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var initialize = _.once(createApplication);
* initialize();
* initialize();
* // `initialize` invokes `createApplication` once
*/
function once(func) {
return before(2, func);
}
/**
* Creates a function that invokes `func` with arguments transformed by
* corresponding `transforms`.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to wrap.
* @param {...(Function|Function[])} [transforms] The functions to transform
* arguments, specified individually or in arrays.
* @returns {Function} Returns the new function.
* @example
*
* function doubled(n) {
* return n * 2;
* }
*
* function square(n) {
* return n * n;
* }
*
* var func = _.overArgs(function(x, y) {
* return [x, y];
* }, square, doubled);
*
* func(9, 3);
* // => [81, 6]
*
* func(10, 5);
* // => [100, 10]
*/
var overArgs = rest(function(func, transforms) {
transforms = arrayMap(baseFlatten(transforms), getIteratee());
var funcsLength = transforms.length;
return rest(function(args) {
var index = -1,
length = nativeMin(args.length, funcsLength);
while (++index < length) {
args[index] = transforms[index].call(this, args[index]);
}
return apply(func, this, args);
});
});
/**
* Creates a function that invokes `func` with `partial` arguments prepended
* to those provided to the new function. This method is like `_.bind` except
* it does **not** alter the `this` binding.
*
* The `_.partial.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* **Note:** This method doesn't set the "length" property of partially
* applied functions.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* var greet = function(greeting, name) {
* return greeting + ' ' + name;
* };
*
* var sayHelloTo = _.partial(greet, 'hello');
* sayHelloTo('fred');
* // => 'hello fred'
*
* // using placeholders
* var greetFred = _.partial(greet, _, 'fred');
* greetFred('hi');
* // => 'hi fred'
*/
var partial = rest(function(func, partials) {
var holders = replaceHolders(partials, partial.placeholder);
return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders);
});
/**
* This method is like `_.partial` except that partially applied arguments
* are appended to those provided to the new function.
*
* The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* **Note:** This method doesn't set the "length" property of partially
* applied functions.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* var greet = function(greeting, name) {
* return greeting + ' ' + name;
* };
*
* var greetFred = _.partialRight(greet, 'fred');
* greetFred('hi');
* // => 'hi fred'
*
* // using placeholders
* var sayHelloTo = _.partialRight(greet, 'hello', _);
* sayHelloTo('fred');
* // => 'hello fred'
*/
var partialRight = rest(function(func, partials) {
var holders = replaceHolders(partials, partialRight.placeholder);
return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
});
/**
* Creates a function that invokes `func` with arguments arranged according
* to the specified indexes where the argument value at the first index is
* provided as the first argument, the argument value at the second index is
* provided as the second argument, and so on.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to rearrange arguments for.
* @param {...(number|number[])} indexes The arranged argument indexes,
* specified individually or in arrays.
* @returns {Function} Returns the new function.
* @example
*
* var rearged = _.rearg(function(a, b, c) {
* return [a, b, c];
* }, 2, 0, 1);
*
* rearged('b', 'c', 'a')
* // => ['a', 'b', 'c']
*/
var rearg = rest(function(func, indexes) {
return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
});
/**
* Creates a function that invokes `func` with the `this` binding of the
* created function and arguments from `start` and beyond provided as an array.
*
* **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters).
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.rest(function(what, names) {
* return what + ' ' + _.initial(names).join(', ') +
* (_.size(names) > 1 ? ', & ' : '') + _.last(names);
* });
*
* say('hello', 'fred', 'barney', 'pebbles');
* // => 'hello fred, barney, & pebbles'
*/
function rest(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
switch (start) {
case 0: return func.call(this, array);
case 1: return func.call(this, args[0], array);
case 2: return func.call(this, args[0], args[1], array);
}
var otherArgs = Array(start + 1);
index = -1;
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = array;
return apply(func, this, otherArgs);
};
}
/**
* Creates a function that invokes `func` with the `this` binding of the created
* function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
*
* **Note:** This method is based on the [spread operator](https://mdn.io/spread_operator).
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to spread arguments over.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.spread(function(who, what) {
* return who + ' says ' + what;
* });
*
* say(['fred', 'hello']);
* // => 'fred says hello'
*
* // with a Promise
* var numbers = Promise.all([
* Promise.resolve(40),
* Promise.resolve(36)
* ]);
*
* numbers.then(_.spread(function(x, y) {
* return x + y;
* }));
* // => a Promise of 76
*/
function spread(func) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return function(array) {
return apply(func, this, array);
};
}
/**
* Creates a throttled function that only invokes `func` at most once per
* every `wait` milliseconds. The throttled function comes with a `cancel`
* method to cancel delayed `func` invocations and a `flush` method to
* immediately invoke them. Provide an options object to indicate whether
* `func` should be invoked on the leading and/or trailing edge of the `wait`
* timeout. The `func` is invoked with the last arguments provided to the
* throttled function. Subsequent calls to the throttled function return the
* result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the the throttled function is
* invoked more than once during the `wait` timeout.
*
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
* for details over the differences between `_.throttle` and `_.debounce`.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to throttle.
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
* @param {Object} [options] The options object.
* @param {boolean} [options.leading=true] Specify invoking on the leading
* edge of the timeout.
* @param {boolean} [options.trailing=true] Specify invoking on the trailing
* edge of the timeout.
* @returns {Function} Returns the new throttled function.
* @example
*
* // avoid excessively updating the position while scrolling
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
*
* // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
* jQuery(element).on('click', throttled);
*
* // cancel a trailing throttled invocation
* jQuery(window).on('popstate', throttled.cancel);
*/
function throttle(func, wait, options) {
var leading = true,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (isObject(options)) {
leading = 'leading' in options ? !!options.leading : leading;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing });
}
/**
* Creates a function that accepts up to one argument, ignoring any
* additional arguments.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new function.
* @example
*
* _.map(['6', '8', '10'], _.unary(parseInt));
* // => [6, 8, 10]
*/
function unary(func) {
return ary(func, 1);
}
/**
* Creates a function that provides `value` to the wrapper function as its
* first argument. Any additional arguments provided to the function are
* appended to those provided to the wrapper function. The wrapper is invoked
* with the `this` binding of the created function.
*
* @static
* @memberOf _
* @category Function
* @param {*} value The value to wrap.
* @param {Function} wrapper The wrapper function.
* @returns {Function} Returns the new function.
* @example
*
* var p = _.wrap(_.escape, function(func, text) {
* return '<p>' + func(text) + '</p>';
* });
*
* p('fred, barney, & pebbles');
* // => '<p>fred, barney, & pebbles</p>'
*/
function wrap(value, wrapper) {
wrapper = wrapper == null ? identity : wrapper;
return partial(wrapper, value);
}
/*------------------------------------------------------------------------*/
/**
* Creates a shallow clone of `value`.
*
* **Note:** This method is loosely based on the
* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
* and supports cloning arrays, array buffers, booleans, date objects, maps,
* numbers, `Object` objects, regexes, sets, strings, symbols, and typed
* arrays. The own enumerable properties of `arguments` objects are cloned
* as plain objects. An empty object is returned for uncloneable values such
* as error objects, functions, DOM nodes, and WeakMaps.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to clone.
* @returns {*} Returns the cloned value.
* @example
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' }
* ];
*
* var shallow = _.clone(users);
* console.log(shallow[0] === users[0]);
* // => true
*/
function clone(value) {
return baseClone(value);
}
/**
* This method is like `_.clone` except that it accepts `customizer` which
* is invoked to produce the cloned value. If `customizer` returns `undefined`
* cloning is handled by the method instead. The `customizer` is invoked with
* up to five arguments; (value [, index|key, object, stack]).
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to clone.
* @param {Function} [customizer] The function to customize cloning.
* @returns {*} Returns the cloned value.
* @example
*
* function customizer(value) {
* if (_.isElement(value)) {
* return value.cloneNode(false);
* }
* }
*
* var el = _.clone(document.body, customizer);
*
* console.log(el === document.body);
* // => false
* console.log(el.nodeName);
* // => BODY
* console.log(el.childNodes.length);
* // => 0
*/
function cloneWith(value, customizer) {
return baseClone(value, false, customizer);
}
/**
* This method is like `_.clone` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to recursively clone.
* @returns {*} Returns the deep cloned value.
* @example
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' }
* ];
*
* var deep = _.cloneDeep(users);
* console.log(deep[0] === users[0]);
* // => false
*/
function cloneDeep(value) {
return baseClone(value, true);
}
/**
* This method is like `_.cloneWith` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to recursively clone.
* @param {Function} [customizer] The function to customize cloning.
* @returns {*} Returns the deep cloned value.
* @example
*
* function customizer(value) {
* if (_.isElement(value)) {
* return value.cloneNode(true);
* }
* }
*
* var el = _.cloneDeep(document.body, customizer);
*
* console.log(el === document.body);
* // => false
* console.log(el.nodeName);
* // => BODY
* console.log(el.childNodes.length);
* // => 20
*/
function cloneDeepWith(value, customizer) {
return baseClone(value, true, customizer);
}
/**
* Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'user': 'fred' };
* var other = { 'user': 'fred' };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is greater than `other`.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`.
* @example
*
* _.gt(3, 1);
* // => true
*
* _.gt(3, 3);
* // => false
*
* _.gt(1, 3);
* // => false
*/
function gt(value, other) {
return value > other;
}
/**
* Checks if `value` is greater than or equal to `other`.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`.
* @example
*
* _.gte(3, 1);
* // => true
*
* _.gte(3, 3);
* // => true
*
* _.gte(1, 3);
* // => false
*/
function gte(value, other) {
return value >= other;
}
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @type Function
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @type Function
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null &&
!(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));
}
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @type Function
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
/**
* Checks if `value` is classified as a boolean primitive or object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isBoolean(false);
* // => true
*
* _.isBoolean(null);
* // => false
*/
function isBoolean(value) {
return value === true || value === false ||
(isObjectLike(value) && objectToString.call(value) == boolTag);
}
/**
* Checks if `value` is classified as a `Date` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isDate(new Date);
* // => true
*
* _.isDate('Mon April 23 2012');
* // => false
*/
function isDate(value) {
return isObjectLike(value) && objectToString.call(value) == dateTag;
}
/**
* Checks if `value` is likely a DOM element.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
* @example
*
* _.isElement(document.body);
* // => true
*
* _.isElement('<body>');
* // => false
*/
function isElement(value) {
return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
}
/**
* Checks if `value` is empty. A value is considered empty unless it's an
* `arguments` object, array, string, or jQuery-like collection with a length
* greater than `0` or an object with own enumerable properties.
*
* @static
* @memberOf _
* @category Lang
* @param {Array|Object|string} value The value to inspect.
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
* @example
*
* _.isEmpty(null);
* // => true
*
* _.isEmpty(true);
* // => true
*
* _.isEmpty(1);
* // => true
*
* _.isEmpty([1, 2, 3]);
* // => false
*
* _.isEmpty({ 'a': 1 });
* // => false
*/
function isEmpty(value) {
return (!isObjectLike(value) || isFunction(value.splice))
? !size(value)
: !keys(value).length;
}
/**
* Performs a deep comparison between two values to determine if they are
* equivalent.
*
* **Note:** This method supports comparing arrays, array buffers, booleans,
* date objects, error objects, maps, numbers, `Object` objects, regexes,
* sets, strings, symbols, and typed arrays. `Object` objects are compared
* by their own, not inherited, enumerable properties. Functions and DOM
* nodes are **not** supported.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'user': 'fred' };
* var other = { 'user': 'fred' };
*
* _.isEqual(object, other);
* // => true
*
* object === other;
* // => false
*/
function isEqual(value, other) {
return baseIsEqual(value, other);
}
/**
* This method is like `_.isEqual` except that it accepts `customizer` which is
* invoked to compare values. If `customizer` returns `undefined` comparisons are
* handled by the method instead. The `customizer` is invoked with up to seven arguments:
* (objValue, othValue [, index|key, object, other, stack]).
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* function isGreeting(value) {
* return /^h(?:i|ello)$/.test(value);
* }
*
* function customizer(objValue, othValue) {
* if (isGreeting(objValue) && isGreeting(othValue)) {
* return true;
* }
* }
*
* var array = ['hello', 'goodbye'];
* var other = ['hi', 'goodbye'];
*
* _.isEqualWith(array, other, customizer);
* // => true
*/
function isEqualWith(value, other, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
var result = customizer ? customizer(value, other) : undefined;
return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
}
/**
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
* `SyntaxError`, `TypeError`, or `URIError` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an error object, else `false`.
* @example
*
* _.isError(new Error);
* // => true
*
* _.isError(Error);
* // => false
*/
function isError(value) {
return isObjectLike(value) &&
typeof value.message == 'string' && objectToString.call(value) == errorTag;
}
/**
* Checks if `value` is a finite primitive number.
*
* **Note:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite).
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
* @example
*
* _.isFinite(3);
* // => true
*
* _.isFinite(Number.MAX_VALUE);
* // => true
*
* _.isFinite(3.14);
* // => true
*
* _.isFinite(Infinity);
* // => false
*/
function isFinite(value) {
return typeof value == 'number' && nativeIsFinite(value);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array constructors, and
// PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is an integer.
*
* **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger).
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an integer, else `false`.
* @example
*
* _.isInteger(3);
* // => true
*
* _.isInteger(Number.MIN_VALUE);
* // => false
*
* _.isInteger(Infinity);
* // => false
*
* _.isInteger('3');
* // => false
*/
function isInteger(value) {
return typeof value == 'number' && value == toInteger(value);
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/**
* Performs a deep comparison between `object` and `source` to determine if
* `object` contains equivalent property values.
*
* **Note:** This method supports comparing the same values as `_.isEqual`.
*
* @static
* @memberOf _
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
* @example
*
* var object = { 'user': 'fred', 'age': 40 };
*
* _.isMatch(object, { 'age': 40 });
* // => true
*
* _.isMatch(object, { 'age': 36 });
* // => false
*/
function isMatch(object, source) {
return object === source || baseIsMatch(object, source, getMatchData(source));
}
/**
* This method is like `_.isMatch` except that it accepts `customizer` which
* is invoked to compare values. If `customizer` returns `undefined` comparisons
* are handled by the method instead. The `customizer` is invoked with three
* arguments: (objValue, srcValue, index|key, object, source).
*
* @static
* @memberOf _
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
* @example
*
* function isGreeting(value) {
* return /^h(?:i|ello)$/.test(value);
* }
*
* function customizer(objValue, srcValue) {
* if (isGreeting(objValue) && isGreeting(srcValue)) {
* return true;
* }
* }
*
* var object = { 'greeting': 'hello' };
* var source = { 'greeting': 'hi' };
*
* _.isMatchWith(object, source, customizer);
* // => true
*/
function isMatchWith(object, source, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return baseIsMatch(object, source, getMatchData(source), customizer);
}
/**
* Checks if `value` is `NaN`.
*
* **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)
* which returns `true` for `undefined` and other non-numeric values.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
* @example
*
* _.isNaN(NaN);
* // => true
*
* _.isNaN(new Number(NaN));
* // => true
*
* isNaN(undefined);
* // => true
*
* _.isNaN(undefined);
* // => false
*/
function isNaN(value) {
// An `NaN` primitive is the only value that is not equal to itself.
// Perform the `toStringTag` check first to avoid errors with some ActiveX objects in IE.
return isNumber(value) && value != +value;
}
/**
* Checks if `value` is a native function.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function, else `false`.
* @example
*
* _.isNative(Array.prototype.push);
* // => true
*
* _.isNative(_);
* // => false
*/
function isNative(value) {
if (value == null) {
return false;
}
if (isFunction(value)) {
return reIsNative.test(funcToString.call(value));
}
return isObjectLike(value) &&
(isHostObject(value) ? reIsNative : reIsHostCtor).test(value);
}
/**
* Checks if `value` is `null`.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `null`, else `false`.
* @example
*
* _.isNull(null);
* // => true
*
* _.isNull(void 0);
* // => false
*/
function isNull(value) {
return value === null;
}
/**
* Checks if `value` is `null` or `undefined`.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is nullish, else `false`.
* @example
*
* _.isNil(null);
* // => true
*
* _.isNil(void 0);
* // => true
*
* _.isNil(NaN);
* // => false
*/
function isNil(value) {
return value == null;
}
/**
* Checks if `value` is classified as a `Number` primitive or object.
*
* **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
* as numbers, use the `_.isFinite` method.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isNumber(3);
* // => true
*
* _.isNumber(Number.MIN_VALUE);
* // => true
*
* _.isNumber(Infinity);
* // => true
*
* _.isNumber('3');
* // => false
*/
function isNumber(value) {
return typeof value == 'number' ||
(isObjectLike(value) && objectToString.call(value) == numberTag);
}
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) {
return false;
}
var proto = objectProto;
if (typeof value.constructor == 'function') {
proto = getPrototypeOf(value);
}
if (proto === null) {
return true;
}
var Ctor = proto.constructor;
return (typeof Ctor == 'function' &&
Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
}
/**
* Checks if `value` is classified as a `RegExp` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isRegExp(/abc/);
* // => true
*
* _.isRegExp('/abc/');
* // => false
*/
function isRegExp(value) {
return isObject(value) && objectToString.call(value) == regexpTag;
}
/**
* Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
* double precision number which isn't the result of a rounded unsafe integer.
*
* **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
* @example
*
* _.isSafeInteger(3);
* // => true
*
* _.isSafeInteger(Number.MIN_VALUE);
* // => false
*
* _.isSafeInteger(Infinity);
* // => false
*
* _.isSafeInteger('3');
* // => false
*/
function isSafeInteger(value) {
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
}
/**
* Checks if `value` is classified as a typed array.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isTypedArray(new Uint8Array);
* // => true
*
* _.isTypedArray([]);
* // => false
*/
function isTypedArray(value) {
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
}
/**
* Checks if `value` is `undefined`.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
* @example
*
* _.isUndefined(void 0);
* // => true
*
* _.isUndefined(null);
* // => false
*/
function isUndefined(value) {
return value === undefined;
}
/**
* Checks if `value` is less than `other`.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.
* @example
*
* _.lt(1, 3);
* // => true
*
* _.lt(3, 3);
* // => false
*
* _.lt(3, 1);
* // => false
*/
function lt(value, other) {
return value < other;
}
/**
* Checks if `value` is less than or equal to `other`.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`.
* @example
*
* _.lte(1, 3);
* // => true
*
* _.lte(3, 3);
* // => true
*
* _.lte(3, 1);
* // => false
*/
function lte(value, other) {
return value <= other;
}
/**
* Converts `value` to an array.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to convert.
* @returns {Array} Returns the converted array.
* @example
*
* (function() {
* return _.toArray(arguments).slice(1);
* }(1, 2, 3));
* // => [2, 3]
*/
function toArray(value) {
if (!value) {
return [];
}
if (isArrayLike(value)) {
return isString(value) ? stringToArray(value) : copyArray(value);
}
if (iteratorSymbol && value[iteratorSymbol]) {
return iteratorToArray(value[iteratorSymbol]());
}
var tag = getTag(value),
func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
return func(value);
}
/**
* Converts `value` to an integer.
*
* **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3');
* // => 3
*/
function toInteger(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
var remainder = value % 1;
return value === value ? (remainder ? value - remainder : value) : 0;
}
/**
* Converts `value` to an integer suitable for use as the length of an
* array-like object.
*
* **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to convert.
* @return {number} Returns the converted integer.
* @example
*
* _.toLength(3);
* // => 3
*
* _.toLength(Number.MIN_VALUE);
* // => 0
*
* _.toLength(Infinity);
* // => 4294967295
*
* _.toLength('3');
* // => 3
*/
function toLength(value) {
return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
}
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3);
* // => 3
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3');
* // => 3
*/
function toNumber(value) {
if (isObject(value)) {
var other = isFunction(value.valueOf) ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
/**
* Converts `value` to a plain object flattening inherited enumerable
* properties of `value` to own properties of the plain object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to convert.
* @returns {Object} Returns the converted plain object.
* @example
*
* function Foo() {
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.assign({ 'a': 1 }, new Foo);
* // => { 'a': 1, 'b': 2 }
*
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
* // => { 'a': 1, 'b': 2, 'c': 3 }
*/
function toPlainObject(value) {
return copyObject(value, keysIn(value));
}
/**
* Converts `value` to a safe integer. A safe integer can be compared and
* represented correctly.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toSafeInteger(3);
* // => 3
*
* _.toSafeInteger(Number.MIN_VALUE);
* // => 0
*
* _.toSafeInteger(Infinity);
* // => 9007199254740991
*
* _.toSafeInteger('3');
* // => 3
*/
function toSafeInteger(value) {
return baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
}
/**
* Converts `value` to a string if it's not one. An empty string is returned
* for `null` and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to process.
* @returns {string} Returns the string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (value == null) {
return '';
}
if (isSymbol(value)) {
return _Symbol ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/*------------------------------------------------------------------------*/
/**
* Assigns own enumerable properties of source objects to the destination
* object. Source objects are applied from left to right. Subsequent sources
* overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object` and is loosely based on
* [`Object.assign`](https://mdn.io/Object/assign).
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* function Foo() {
* this.c = 3;
* }
*
* function Bar() {
* this.e = 5;
* }
*
* Foo.prototype.d = 4;
* Bar.prototype.f = 6;
*
* _.assign({ 'a': 1 }, new Foo, new Bar);
* // => { 'a': 1, 'c': 3, 'e': 5 }
*/
var assign = createAssigner(function(object, source) {
copyObject(source, keys(source), object);
});
/**
* This method is like `_.assign` except that it iterates over own and
* inherited source properties.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @alias extend
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* function Foo() {
* this.b = 2;
* }
*
* function Bar() {
* this.d = 4;
* }
*
* Foo.prototype.c = 3;
* Bar.prototype.e = 5;
*
* _.assignIn({ 'a': 1 }, new Foo, new Bar);
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
*/
var assignIn = createAssigner(function(object, source) {
copyObject(source, keysIn(source), object);
});
/**
* This method is like `_.assignIn` except that it accepts `customizer` which
* is invoked to produce the assigned values. If `customizer` returns `undefined`
* assignment is handled by the method instead. The `customizer` is invoked
* with five arguments: (objValue, srcValue, key, object, source).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @alias extendWith
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* function customizer(objValue, srcValue) {
* return _.isUndefined(objValue) ? srcValue : objValue;
* }
*
* var defaults = _.partialRight(_.assignInWith, customizer);
*
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var assignInWith = createAssigner(function(object, source, customizer) {
copyObjectWith(source, keysIn(source), object, customizer);
});
/**
* This method is like `_.assign` except that it accepts `customizer` which
* is invoked to produce the assigned values. If `customizer` returns `undefined`
* assignment is handled by the method instead. The `customizer` is invoked
* with five arguments: (objValue, srcValue, key, object, source).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* function customizer(objValue, srcValue) {
* return _.isUndefined(objValue) ? srcValue : objValue;
* }
*
* var defaults = _.partialRight(_.assignWith, customizer);
*
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var assignWith = createAssigner(function(object, source, customizer) {
copyObjectWith(source, keys(source), object, customizer);
});
/**
* Creates an array of values corresponding to `paths` of `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {...(string|string[])} [paths] The property paths of elements to pick,
* specified individually or in arrays.
* @returns {Array} Returns the new array of picked elements.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
*
* _.at(object, ['a[0].b.c', 'a[1]']);
* // => [3, 4]
*
* _.at(['a', 'b', 'c'], 0, 2);
* // => ['a', 'c']
*/
var at = rest(function(object, paths) {
return baseAt(object, baseFlatten(paths));
});
/**
* Creates an object that inherits from the `prototype` object. If a `properties`
* object is provided its own enumerable properties are assigned to the created object.
*
* @static
* @memberOf _
* @category Object
* @param {Object} prototype The object to inherit from.
* @param {Object} [properties] The properties to assign to the object.
* @returns {Object} Returns the new object.
* @example
*
* function Shape() {
* this.x = 0;
* this.y = 0;
* }
*
* function Circle() {
* Shape.call(this);
* }
*
* Circle.prototype = _.create(Shape.prototype, {
* 'constructor': Circle
* });
*
* var circle = new Circle;
* circle instanceof Circle;
* // => true
*
* circle instanceof Shape;
* // => true
*/
function create(prototype, properties) {
var result = baseCreate(prototype);
return properties ? baseAssign(result, properties) : result;
}
/**
* Assigns own and inherited enumerable properties of source objects to the
* destination object for all destination properties that resolve to `undefined`.
* Source objects are applied from left to right. Once a property is set,
* additional values of the same property are ignored.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
* // => { 'user': 'barney', 'age': 36 }
*/
var defaults = rest(function(args) {
args.push(undefined, assignInDefaults);
return apply(assignInWith, undefined, args);
});
/**
* This method is like `_.defaults` except that it recursively assigns
* default properties.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
* // => { 'user': { 'name': 'barney', 'age': 36 } }
*
*/
var defaultsDeep = rest(function(args) {
args.push(undefined, mergeDefaults);
return apply(mergeWith, undefined, args);
});
/**
* This method is like `_.find` except that it returns the key of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to search.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element, else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findKey(users, function(o) { return o.age < 40; });
* // => 'barney' (iteration order is not guaranteed)
*
* // using the `_.matches` iteratee shorthand
* _.findKey(users, { 'age': 1, 'active': true });
* // => 'pebbles'
*
* // using the `_.matchesProperty` iteratee shorthand
* _.findKey(users, ['active', false]);
* // => 'fred'
*
* // using the `_.property` iteratee shorthand
* _.findKey(users, 'active');
* // => 'barney'
*/
function findKey(object, predicate) {
return baseFind(object, getIteratee(predicate, 3), baseForOwn, true);
}
/**
* This method is like `_.findKey` except that it iterates over elements of
* a collection in the opposite order.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to search.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element, else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findLastKey(users, function(o) { return o.age < 40; });
* // => returns 'pebbles' assuming `_.findKey` returns 'barney'
*
* // using the `_.matches` iteratee shorthand
* _.findLastKey(users, { 'age': 36, 'active': true });
* // => 'barney'
*
* // using the `_.matchesProperty` iteratee shorthand
* _.findLastKey(users, ['active', false]);
* // => 'fred'
*
* // using the `_.property` iteratee shorthand
* _.findLastKey(users, 'active');
* // => 'pebbles'
*/
function findLastKey(object, predicate) {
return baseFind(object, getIteratee(predicate, 3), baseForOwnRight, true);
}
/**
* Iterates over own and inherited enumerable properties of an object invoking
* `iteratee` for each property. The iteratee is invoked with three arguments:
* (value, key, object). Iteratee functions may exit iteration early by explicitly
* returning `false`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forIn(new Foo, function(value, key) {
* console.log(key);
* });
* // => logs 'a', 'b', then 'c' (iteration order is not guaranteed)
*/
function forIn(object, iteratee) {
return object == null ? object : baseFor(object, toFunction(iteratee), keysIn);
}
/**
* This method is like `_.forIn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forInRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'
*/
function forInRight(object, iteratee) {
return object == null ? object : baseForRight(object, toFunction(iteratee), keysIn);
}
/**
* Iterates over own enumerable properties of an object invoking `iteratee`
* for each property. The iteratee is invoked with three arguments:
* (value, key, object). Iteratee functions may exit iteration early by
* explicitly returning `false`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwn(new Foo, function(value, key) {
* console.log(key);
* });
* // => logs 'a' then 'b' (iteration order is not guaranteed)
*/
function forOwn(object, iteratee) {
return object && baseForOwn(object, toFunction(iteratee));
}
/**
* This method is like `_.forOwn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwnRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'
*/
function forOwnRight(object, iteratee) {
return object && baseForOwnRight(object, toFunction(iteratee));
}
/**
* Creates an array of function property names from own enumerable properties
* of `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to inspect.
* @returns {Array} Returns the new array of property names.
* @example
*
* function Foo() {
* this.a = _.constant('a');
* this.b = _.constant('b');
* }
*
* Foo.prototype.c = _.constant('c');
*
* _.functions(new Foo);
* // => ['a', 'b']
*/
function functions(object) {
return object == null ? [] : baseFunctions(object, keys(object));
}
/**
* Creates an array of function property names from own and inherited
* enumerable properties of `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to inspect.
* @returns {Array} Returns the new array of property names.
* @example
*
* function Foo() {
* this.a = _.constant('a');
* this.b = _.constant('b');
* }
*
* Foo.prototype.c = _.constant('c');
*
* _.functionsIn(new Foo);
* // => ['a', 'b', 'c']
*/
function functionsIn(object) {
return object == null ? [] : baseFunctions(object, keysIn(object));
}
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined` the `defaultValue` is used in its place.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
/**
* Checks if `path` is a direct property of `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = { 'a': { 'b': { 'c': 3 } } };
* var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
*
* _.has(object, 'a');
* // => true
*
* _.has(object, 'a.b.c');
* // => true
*
* _.has(object, ['a', 'b', 'c']);
* // => true
*
* _.has(other, 'a');
* // => false
*/
function has(object, path) {
return hasPath(object, path, baseHas);
}
/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b.c');
* // => true
*
* _.hasIn(object, ['a', 'b', 'c']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return hasPath(object, path, baseHasIn);
}
/**
* Creates an object composed of the inverted keys and values of `object`.
* If `object` contains duplicate values, subsequent values overwrite property
* assignments of previous values unless `multiVal` is `true`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to invert.
* @param {boolean} [multiVal] Allow multiple values per key.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invert(object);
* // => { '1': 'c', '2': 'b' }
*
* // with `multiVal`
* _.invert(object, true);
* // => { '1': ['a', 'c'], '2': ['b'] }
*/
function invert(object, multiVal, guard) {
return arrayReduce(keys(object), function(result, key) {
var value = object[key];
if (multiVal && !guard) {
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}
else {
result[value] = key;
}
return result;
}, {});
}
/**
* Invokes the method at `path` of `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
* @example
*
* var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
*
* _.invoke(object, 'a[0].b.c.slice', 1, 3);
* // => [2, 3]
*/
var invoke = rest(baseInvoke);
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
* for more details.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys(object) {
var isProto = isPrototype(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
}
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
var index = -1,
isProto = isPrototype(object),
props = baseKeysIn(object),
propsLength = props.length,
indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
while (++index < propsLength) {
var key = props[index];
if (!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
/**
* The opposite of `_.mapValues`; this method creates an object with the
* same values as `object` and keys generated by running each own enumerable
* property of `object` through `iteratee`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @example
*
* _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
* return key + value;
* });
* // => { 'a1': 1, 'b2': 2 }
*/
function mapKeys(object, iteratee) {
var result = {};
iteratee = getIteratee(iteratee, 3);
baseForOwn(object, function(value, key, object) {
result[iteratee(value, key, object)] = value;
});
return result;
}
/**
* Creates an object with the same keys as `object` and values generated by
* running each own enumerable property of `object` through `iteratee`. The
* iteratee function is invoked with three arguments: (value, key, object).
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @example
*
* var users = {
* 'fred': { 'user': 'fred', 'age': 40 },
* 'pebbles': { 'user': 'pebbles', 'age': 1 }
* };
*
* _.mapValues(users, function(o) { return o.age; });
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*
* // using the `_.property` iteratee shorthand
* _.mapValues(users, 'age');
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*/
function mapValues(object, iteratee) {
var result = {};
iteratee = getIteratee(iteratee, 3);
baseForOwn(object, function(value, key, object) {
result[key] = iteratee(value, key, object);
});
return result;
}
/**
* Recursively merges own and inherited enumerable properties of source
* objects into the destination object, skipping source properties that resolve
* to `undefined`. Array and plain object properties are merged recursively.
* Other objects and value types are overridden by assignment. Source objects
* are applied from left to right. Subsequent sources overwrite property
* assignments of previous sources.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* var users = {
* 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
* };
*
* var ages = {
* 'data': [{ 'age': 36 }, { 'age': 40 }]
* };
*
* _.merge(users, ages);
* // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
*/
var merge = createAssigner(function(object, source) {
baseMerge(object, source);
});
/**
* This method is like `_.merge` except that it accepts `customizer` which
* is invoked to produce the merged values of the destination and source
* properties. If `customizer` returns `undefined` merging is handled by the
* method instead. The `customizer` is invoked with seven arguments:
* (objValue, srcValue, key, object, source, stack).
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} customizer The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* function customizer(objValue, srcValue) {
* if (_.isArray(objValue)) {
* return objValue.concat(srcValue);
* }
* }
*
* var object = {
* 'fruits': ['apple'],
* 'vegetables': ['beet']
* };
*
* var other = {
* 'fruits': ['banana'],
* 'vegetables': ['carrot']
* };
*
* _.mergeWith(object, other, customizer);
* // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
*/
var mergeWith = createAssigner(function(object, source, customizer) {
baseMerge(object, source, customizer);
});
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable properties of `object` that are not omitted.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [props] The property names to omit, specified
* individually or in arrays..
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 3 };
*
* _.omit(object, ['a', 'c']);
* // => { 'b': 2 }
*/
var omit = rest(function(object, props) {
if (object == null) {
return {};
}
props = arrayMap(baseFlatten(props), String);
return basePick(object, baseDifference(keysIn(object), props));
});
/**
* The opposite of `_.pickBy`; this method creates an object composed of the
* own and inherited enumerable properties of `object` that `predicate`
* doesn't return truthy for.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per property.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2' };
*
* _.omitBy(object, _.isNumber);
* // => { 'b': '2' }
*/
function omitBy(object, predicate) {
predicate = getIteratee(predicate);
return basePickBy(object, function(value) {
return !predicate(value);
});
}
/**
* Creates an object composed of the picked `object` properties.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [props] The property names to pick, specified
* individually or in arrays.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 3 };
*
* _.pick(object, ['a', 'c']);
* // => { 'a': 1, 'c': 3 }
*/
var pick = rest(function(object, props) {
return object == null ? {} : basePick(object, baseFlatten(props));
});
/**
* Creates an object composed of the `object` properties `predicate` returns
* truthy for. The predicate is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {Function|Object|string} [predicate=_.identity] The function invoked per property.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2' };
*
* _.pickBy(object, _.isNumber);
* // => { 'a': 1 }
*/
function pickBy(object, predicate) {
return object == null ? {} : basePickBy(object, getIteratee(predicate));
}
/**
* This method is like `_.get` except that if the resolved value is a function
* it's invoked with the `this` binding of its parent object and its result
* is returned.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to resolve.
* @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
*
* _.result(object, 'a[0].b.c1');
* // => 3
*
* _.result(object, 'a[0].b.c2');
* // => 4
*
* _.result(object, 'a[0].b.c3', 'default');
* // => 'default'
*
* _.result(object, 'a[0].b.c3', _.constant('default'));
* // => 'default'
*/
function result(object, path, defaultValue) {
if (!isKey(path, object)) {
path = baseToPath(path);
var result = get(object, path);
object = parent(object, path);
} else {
result = object == null ? undefined : object[path];
}
if (result === undefined) {
result = defaultValue;
}
return isFunction(result) ? result.call(object) : result;
}
/**
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist
* it's created. Arrays are created for missing index properties while objects
* are created for all other missing properties. Use `_.setWith` to customize
* `path` creation.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.set(object, 'a[0].b.c', 4);
* console.log(object.a[0].b.c);
* // => 4
*
* _.set(object, 'x[0].y.z', 5);
* console.log(object.x[0].y.z);
* // => 5
*/
function set(object, path, value) {
return object == null ? object : baseSet(object, path, value);
}
/**
* This method is like `_.set` except that it accepts `customizer` which is
* invoked to produce the objects of `path`. If `customizer` returns `undefined`
* path creation is handled by the method instead. The `customizer` is invoked
* with three arguments: (nsValue, key, nsObject).
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* _.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object);
* // => { '0': { '1': { '2': 3 }, 'length': 2 } }
*/
function setWith(object, path, value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseSet(object, path, value, customizer);
}
/**
* Creates an array of own enumerable key-value pairs for `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the new array of key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairs(new Foo);
* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
*/
function toPairs(object) {
return baseToPairs(object, keys(object));
}
/**
* Creates an array of own and inherited enumerable key-value pairs for `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the new array of key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairsIn(new Foo);
* // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed)
*/
function toPairsIn(object) {
return baseToPairs(object, keysIn(object));
}
/**
* An alternative to `_.reduce`; this method transforms `object` to a new
* `accumulator` object which is the result of running each of its own enumerable
* properties through `iteratee`, with each invocation potentially mutating
* the `accumulator` object. The iteratee is invoked with four arguments:
* (accumulator, value, key, object). Iteratee functions may exit iteration
* early by explicitly returning `false`.
*
* @static
* @memberOf _
* @category Object
* @param {Array|Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The custom accumulator value.
* @returns {*} Returns the accumulated value.
* @example
*
* _.transform([2, 3, 4], function(result, n) {
* result.push(n *= n);
* return n % 2 == 0;
* });
* // => [4, 9]
*
* _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* });
* // => { '1': ['a', 'c'], '2': ['b'] }
*/
function transform(object, iteratee, accumulator) {
var isArr = isArray(object) || isTypedArray(object);
iteratee = getIteratee(iteratee, 4);
if (accumulator == null) {
if (isArr || isObject(object)) {
var Ctor = object.constructor;
if (isArr) {
accumulator = isArray(object) ? new Ctor : [];
} else {
accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
}
} else {
accumulator = {};
}
}
(isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
return iteratee(accumulator, value, index, object);
});
return accumulator;
}
/**
* Removes the property at `path` of `object`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 7 } }] };
* _.unset(object, 'a[0].b.c');
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*
* _.unset(object, 'a[0].b.c');
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*/
function unset(object, path) {
return object == null ? true : baseUnset(object, path);
}
/**
* Creates an array of the own enumerable property values of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.values(new Foo);
* // => [1, 2] (iteration order is not guaranteed)
*
* _.values('hi');
* // => ['h', 'i']
*/
function values(object) {
return object ? baseValues(object, keys(object)) : [];
}
/**
* Creates an array of the own and inherited enumerable property values of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.valuesIn(new Foo);
* // => [1, 2, 3] (iteration order is not guaranteed)
*/
function valuesIn(object) {
return object == null ? baseValues(object, keysIn(object)) : [];
}
/*------------------------------------------------------------------------*/
/**
* Clamps `number` within the inclusive `lower` and `upper` bounds.
*
* @static
* @memberOf _
* @category Number
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
* @example
*
* _.clamp(-10, -5, 5);
* // => -5
*
* _.clamp(10, -5, 5);
* // => 5
*/
function clamp(number, lower, upper) {
if (upper === undefined) {
upper = lower;
lower = undefined;
}
if (upper !== undefined) {
upper = toNumber(upper);
upper = upper === upper ? upper : 0;
}
if (lower !== undefined) {
lower = toNumber(lower);
lower = lower === lower ? lower : 0;
}
return baseClamp(toNumber(number), lower, upper);
}
/**
* Checks if `n` is between `start` and up to but not including, `end`. If
* `end` is not specified it's set to `start` with `start` then set to `0`.
* If `start` is greater than `end` the params are swapped to support
* negative ranges.
*
* @static
* @memberOf _
* @category Number
* @param {number} number The number to check.
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
* @example
*
* _.inRange(3, 2, 4);
* // => true
*
* _.inRange(4, 8);
* // => true
*
* _.inRange(4, 2);
* // => false
*
* _.inRange(2, 2);
* // => false
*
* _.inRange(1.2, 2);
* // => true
*
* _.inRange(5.2, 4);
* // => false
*
* _.inRange(-3, -2, -6);
* // => true
*/
function inRange(number, start, end) {
start = toNumber(start) || 0;
if (end === undefined) {
end = start;
start = 0;
} else {
end = toNumber(end) || 0;
}
number = toNumber(number);
return baseInRange(number, start, end);
}
/**
* Produces a random number between the inclusive `lower` and `upper` bounds.
* If only one argument is provided a number between `0` and the given number
* is returned. If `floating` is `true`, or either `lower` or `upper` are floats,
* a floating-point number is returned instead of an integer.
*
* **Note:** JavaScript follows the IEEE-754 standard for resolving
* floating-point values which can produce unexpected results.
*
* @static
* @memberOf _
* @category Number
* @param {number} [lower=0] The lower bound.
* @param {number} [upper=1] The upper bound.
* @param {boolean} [floating] Specify returning a floating-point number.
* @returns {number} Returns the random number.
* @example
*
* _.random(0, 5);
* // => an integer between 0 and 5
*
* _.random(5);
* // => also an integer between 0 and 5
*
* _.random(5, true);
* // => a floating-point number between 0 and 5
*
* _.random(1.2, 5.2);
* // => a floating-point number between 1.2 and 5.2
*/
function random(lower, upper, floating) {
if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
upper = floating = undefined;
}
if (floating === undefined) {
if (typeof upper == 'boolean') {
floating = upper;
upper = undefined;
}
else if (typeof lower == 'boolean') {
floating = lower;
lower = undefined;
}
}
if (lower === undefined && upper === undefined) {
lower = 0;
upper = 1;
}
else {
lower = toNumber(lower) || 0;
if (upper === undefined) {
upper = lower;
lower = 0;
} else {
upper = toNumber(upper) || 0;
}
}
if (lower > upper) {
var temp = lower;
lower = upper;
upper = temp;
}
if (floating || lower % 1 || upper % 1) {
var rand = nativeRandom();
return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
}
return baseRandom(lower, upper);
}
/*------------------------------------------------------------------------*/
/**
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the camel cased string.
* @example
*
* _.camelCase('Foo Bar');
* // => 'fooBar'
*
* _.camelCase('--foo-bar');
* // => 'fooBar'
*
* _.camelCase('__foo_bar__');
* // => 'fooBar'
*/
var camelCase = createCompounder(function(result, word, index) {
word = word.toLowerCase();
return result + (index ? capitalize(word) : word);
});
/**
* Converts the first character of `string` to upper case and the remaining
* to lower case.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to capitalize.
* @returns {string} Returns the capitalized string.
* @example
*
* _.capitalize('FRED');
* // => 'Fred'
*/
function capitalize(string) {
return upperFirst(toString(string).toLowerCase());
}
/**
* Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
* to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to deburr.
* @returns {string} Returns the deburred string.
* @example
*
* _.deburr('déjà vu');
* // => 'deja vu'
*/
function deburr(string) {
string = toString(string);
return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
}
/**
* Checks if `string` ends with the given target string.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to search.
* @param {string} [target] The string to search for.
* @param {number} [position=string.length] The position to search from.
* @returns {boolean} Returns `true` if `string` ends with `target`, else `false`.
* @example
*
* _.endsWith('abc', 'c');
* // => true
*
* _.endsWith('abc', 'b');
* // => false
*
* _.endsWith('abc', 'b', 2);
* // => true
*/
function endsWith(string, target, position) {
string = toString(string);
target = typeof target == 'string' ? target : (target + '');
var length = string.length;
position = position === undefined
? length
: baseClamp(toInteger(position), 0, length);
position -= target.length;
return position >= 0 && string.indexOf(target, position) == position;
}
/**
* Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
* their corresponding HTML entities.
*
* **Note:** No other characters are escaped. To escape additional
* characters use a third-party library like [_he_](https://mths.be/he).
*
* Though the ">" character is escaped for symmetry, characters like
* ">" and "/" don't need escaping in HTML and have no special meaning
* unless they're part of a tag or unquoted attribute value.
* See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
* (under "semi-related fun fact") for more details.
*
* Backticks are escaped because in IE < 9, they can break out of
* attribute values or HTML comments. See [#59](https://html5sec.org/#59),
* [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
* [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)
* for more details.
*
* When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)
* to reduce XSS vectors.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escape('fred, barney, & pebbles');
* // => 'fred, barney, & pebbles'
*/
function escape(string) {
string = toString(string);
return (string && reHasUnescapedHtml.test(string))
? string.replace(reUnescapedHtml, escapeHtmlChar)
: string;
}
/**
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escapeRegExp('[lodash](https://lodash.com/)');
* // => '\[lodash\]\(https://lodash\.com/\)'
*/
function escapeRegExp(string) {
string = toString(string);
return (string && reHasRegExpChar.test(string))
? string.replace(reRegExpChar, '\\$&')
: string;
}
/**
* Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the kebab cased string.
* @example
*
* _.kebabCase('Foo Bar');
* // => 'foo-bar'
*
* _.kebabCase('fooBar');
* // => 'foo-bar'
*
* _.kebabCase('__foo_bar__');
* // => 'foo-bar'
*/
var kebabCase = createCompounder(function(result, word, index) {
return result + (index ? '-' : '') + word.toLowerCase();
});
/**
* Converts `string`, as space separated words, to lower case.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the lower cased string.
* @example
*
* _.lowerCase('--Foo-Bar');
* // => 'foo bar'
*
* _.lowerCase('fooBar');
* // => 'foo bar'
*
* _.lowerCase('__FOO_BAR__');
* // => 'foo bar'
*/
var lowerCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + word.toLowerCase();
});
/**
* Converts the first character of `string` to lower case.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.lowerFirst('Fred');
* // => 'fred'
*
* _.lowerFirst('FRED');
* // => 'fRED'
*/
var lowerFirst = createCaseFirst('toLowerCase');
/**
* Converts the first character of `string` to upper case.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.upperFirst('fred');
* // => 'Fred'
*
* _.upperFirst('FRED');
* // => 'FRED'
*/
var upperFirst = createCaseFirst('toUpperCase');
/**
* Pads `string` on the left and right sides if it's shorter than `length`.
* Padding characters are truncated if they can't be evenly divided by `length`.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.pad('abc', 8);
* // => ' abc '
*
* _.pad('abc', 8, '_-');
* // => '_-abc_-_'
*
* _.pad('abc', 3);
* // => 'abc'
*/
function pad(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = stringSize(string);
if (!length || strLength >= length) {
return string;
}
var mid = (length - strLength) / 2,
leftLength = nativeFloor(mid),
rightLength = nativeCeil(mid);
return createPadding('', leftLength, chars) + string + createPadding('', rightLength, chars);
}
/**
* Pads `string` on the right side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.padEnd('abc', 6);
* // => 'abc '
*
* _.padEnd('abc', 6, '_-');
* // => 'abc_-_'
*
* _.padEnd('abc', 3);
* // => 'abc'
*/
function padEnd(string, length, chars) {
string = toString(string);
return string + createPadding(string, length, chars);
}
/**
* Pads `string` on the left side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.padStart('abc', 6);
* // => ' abc'
*
* _.padStart('abc', 6, '_-');
* // => '_-_abc'
*
* _.padStart('abc', 3);
* // => 'abc'
*/
function padStart(string, length, chars) {
string = toString(string);
return createPadding(string, length, chars) + string;
}
/**
* Converts `string` to an integer of the specified radix. If `radix` is
* `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,
* in which case a `radix` of `16` is used.
*
* **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E)
* of `parseInt`.
*
* @static
* @memberOf _
* @category String
* @param {string} string The string to convert.
* @param {number} [radix] The radix to interpret `value` by.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {number} Returns the converted integer.
* @example
*
* _.parseInt('08');
* // => 8
*
* _.map(['6', '08', '10'], _.parseInt);
* // => [6, 8, 10]
*/
function parseInt(string, radix, guard) {
// Chrome fails to trim leading <BOM> whitespace characters.
// See https://code.google.com/p/v8/issues/detail?id=3109 for more details.
if (guard || radix == null) {
radix = 0;
} else if (radix) {
radix = +radix;
}
string = toString(string).replace(reTrim, '');
return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
}
/**
* Repeats the given string `n` times.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to repeat.
* @param {number} [n=0] The number of times to repeat the string.
* @returns {string} Returns the repeated string.
* @example
*
* _.repeat('*', 3);
* // => '***'
*
* _.repeat('abc', 2);
* // => 'abcabc'
*
* _.repeat('abc', 0);
* // => ''
*/
function repeat(string, n) {
string = toString(string);
n = toInteger(n);
var result = '';
if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
return result;
}
// Leverage the exponentiation by squaring algorithm for a faster repeat.
// See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
do {
if (n % 2) {
result += string;
}
n = nativeFloor(n / 2);
string += string;
} while (n);
return result;
}
/**
* Replaces matches for `pattern` in `string` with `replacement`.
*
* **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace).
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to modify.
* @param {RegExp|string} pattern The pattern to replace.
* @param {Function|string} replacement The match replacement.
* @returns {string} Returns the modified string.
* @example
*
* _.replace('Hi Fred', 'Fred', 'Barney');
* // => 'Hi Barney'
*/
function replace() {
var args = arguments,
string = toString(args[0]);
return args.length < 3 ? string : string.replace(args[1], args[2]);
}
/**
* Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the snake cased string.
* @example
*
* _.snakeCase('Foo Bar');
* // => 'foo_bar'
*
* _.snakeCase('fooBar');
* // => 'foo_bar'
*
* _.snakeCase('--foo-bar');
* // => 'foo_bar'
*/
var snakeCase = createCompounder(function(result, word, index) {
return result + (index ? '_' : '') + word.toLowerCase();
});
/**
* Splits `string` by `separator`.
*
* **Note:** This method is based on [`String#split`](https://mdn.io/String/split).
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to split.
* @param {RegExp|string} separator The separator pattern to split by.
* @param {number} [limit] The length to truncate results to.
* @returns {Array} Returns the new array of string segments.
* @example
*
* _.split('a-b-c', '-', 2);
* // => ['a', 'b']
*/
function split(string, separator, limit) {
return toString(string).split(separator, limit);
}
/**
* Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the start cased string.
* @example
*
* _.startCase('--foo-bar');
* // => 'Foo Bar'
*
* _.startCase('fooBar');
* // => 'Foo Bar'
*
* _.startCase('__foo_bar__');
* // => 'Foo Bar'
*/
var startCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + capitalize(word);
});
/**
* Checks if `string` starts with the given target string.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to search.
* @param {string} [target] The string to search for.
* @param {number} [position=0] The position to search from.
* @returns {boolean} Returns `true` if `string` starts with `target`, else `false`.
* @example
*
* _.startsWith('abc', 'a');
* // => true
*
* _.startsWith('abc', 'b');
* // => false
*
* _.startsWith('abc', 'b', 1);
* // => true
*/
function startsWith(string, target, position) {
string = toString(string);
position = baseClamp(toInteger(position), 0, string.length);
return string.lastIndexOf(target, position) == position;
}
/**
* Creates a compiled template function that can interpolate data properties
* in "interpolate" delimiters, HTML-escape interpolated data properties in
* "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
* properties may be accessed as free variables in the template. If a setting
* object is provided it takes precedence over `_.templateSettings` values.
*
* **Note:** In the development build `_.template` utilizes
* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
* for easier debugging.
*
* For more information on precompiling templates see
* [lodash's custom builds documentation](https://lodash.com/custom-builds).
*
* For more information on Chrome extension sandboxes see
* [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The template string.
* @param {Object} [options] The options object.
* @param {RegExp} [options.escape] The HTML "escape" delimiter.
* @param {RegExp} [options.evaluate] The "evaluate" delimiter.
* @param {Object} [options.imports] An object to import into the template as free variables.
* @param {RegExp} [options.interpolate] The "interpolate" delimiter.
* @param {string} [options.sourceURL] The sourceURL of the template's compiled source.
* @param {string} [options.variable] The data object variable name.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {Function} Returns the compiled template function.
* @example
*
* // using the "interpolate" delimiter to create a compiled template
* var compiled = _.template('hello <%= user %>!');
* compiled({ 'user': 'fred' });
* // => 'hello fred!'
*
* // using the HTML "escape" delimiter to escape data property values
* var compiled = _.template('<b><%- value %></b>');
* compiled({ 'value': '<script>' });
* // => '<b><script></b>'
*
* // using the "evaluate" delimiter to execute JavaScript and generate HTML
* var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
* compiled({ 'users': ['fred', 'barney'] });
* // => '<li>fred</li><li>barney</li>'
*
* // using the internal `print` function in "evaluate" delimiters
* var compiled = _.template('<% print("hello " + user); %>!');
* compiled({ 'user': 'barney' });
* // => 'hello barney!'
*
* // using the ES delimiter as an alternative to the default "interpolate" delimiter
* var compiled = _.template('hello ${ user }!');
* compiled({ 'user': 'pebbles' });
* // => 'hello pebbles!'
*
* // using custom template delimiters
* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
* var compiled = _.template('hello {{ user }}!');
* compiled({ 'user': 'mustache' });
* // => 'hello mustache!'
*
* // using backslashes to treat delimiters as plain text
* var compiled = _.template('<%= "\\<%- value %\\>" %>');
* compiled({ 'value': 'ignored' });
* // => '<%- value %>'
*
* // using the `imports` option to import `jQuery` as `jq`
* var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
* var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
* compiled({ 'users': ['fred', 'barney'] });
* // => '<li>fred</li><li>barney</li>'
*
* // using the `sourceURL` option to specify a custom sourceURL for the template
* var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
* compiled(data);
* // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
*
* // using the `variable` option to ensure a with-statement isn't used in the compiled template
* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
* compiled.source;
* // => function(data) {
* // var __t, __p = '';
* // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
* // return __p;
* // }
*
* // using the `source` property to inline compiled templates for meaningful
* // line numbers in error messages and a stack trace
* fs.writeFileSync(path.join(cwd, 'jst.js'), '\
* var JST = {\
* "main": ' + _.template(mainText).source + '\
* };\
* ');
*/
function template(string, options, guard) {
// Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)
// and Laura Doktorova's doT.js (https://github.com/olado/doT).
var settings = lodash.templateSettings;
if (guard && isIterateeCall(string, options, guard)) {
options = undefined;
}
string = toString(string);
options = assignInWith({}, options, settings, assignInDefaults);
var imports = assignInWith({}, options.imports, settings.imports, assignInDefaults),
importsKeys = keys(imports),
importsValues = baseValues(imports, importsKeys);
var isEscaping,
isEvaluating,
index = 0,
interpolate = options.interpolate || reNoMatch,
source = "__p += '";
// Compile the regexp to match each delimiter.
var reDelimiters = RegExp(
(options.escape || reNoMatch).source + '|' +
interpolate.source + '|' +
(interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
(options.evaluate || reNoMatch).source + '|$'
, 'g');
// Use a sourceURL for easier debugging.
var sourceURL = '//# sourceURL=' +
('sourceURL' in options
? options.sourceURL
: ('lodash.templateSources[' + (++templateCounter) + ']')
) + '\n';
string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
interpolateValue || (interpolateValue = esTemplateValue);
// Escape characters that can't be included in string literals.
source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
// Replace delimiters with snippets.
if (escapeValue) {
isEscaping = true;
source += "' +\n__e(" + escapeValue + ") +\n'";
}
if (evaluateValue) {
isEvaluating = true;
source += "';\n" + evaluateValue + ";\n__p += '";
}
if (interpolateValue) {
source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
}
index = offset + match.length;
// The JS engine embedded in Adobe products needs `match` returned in
// order to produce the correct `offset` value.
return match;
});
source += "';\n";
// If `variable` is not specified wrap a with-statement around the generated
// code to add the data object to the top of the scope chain.
var variable = options.variable;
if (!variable) {
source = 'with (obj) {\n' + source + '\n}\n';
}
// Cleanup code by stripping empty strings.
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
.replace(reEmptyStringMiddle, '$1')
.replace(reEmptyStringTrailing, '$1;');
// Frame code as the function body.
source = 'function(' + (variable || 'obj') + ') {\n' +
(variable
? ''
: 'obj || (obj = {});\n'
) +
"var __t, __p = ''" +
(isEscaping
? ', __e = _.escape'
: ''
) +
(isEvaluating
? ', __j = Array.prototype.join;\n' +
"function print() { __p += __j.call(arguments, '') }\n"
: ';\n'
) +
source +
'return __p\n}';
var result = attempt(function() {
return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
});
// Provide the compiled function's source by its `toString` method or
// the `source` property as a convenience for inlining compiled templates.
result.source = source;
if (isError(result)) {
throw result;
}
return result;
}
/**
* Converts `string`, as a whole, to lower case.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the lower cased string.
* @example
*
* _.toLower('--Foo-Bar');
* // => '--foo-bar'
*
* _.toLower('fooBar');
* // => 'foobar'
*
* _.toLower('__FOO_BAR__');
* // => '__foo_bar__'
*/
function toLower(value) {
return toString(value).toLowerCase();
}
/**
* Converts `string`, as a whole, to upper case.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.toUpper('--foo-bar');
* // => '--FOO-BAR'
*
* _.toUpper('fooBar');
* // => 'FOOBAR'
*
* _.toUpper('__foo_bar__');
* // => '__FOO_BAR__'
*/
function toUpper(value) {
return toString(value).toUpperCase();
}
/**
* Removes leading and trailing whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trim(' abc ');
* // => 'abc'
*
* _.trim('-_-abc-_-', '_-');
* // => 'abc'
*
* _.map([' foo ', ' bar '], _.trim);
* // => ['foo', 'bar']
*/
function trim(string, chars, guard) {
string = toString(string);
if (!string) {
return string;
}
if (guard || chars === undefined) {
return string.replace(reTrim, '');
}
chars = (chars + '');
if (!chars) {
return string;
}
var strSymbols = stringToArray(string),
chrSymbols = stringToArray(chars);
return strSymbols.slice(charsStartIndex(strSymbols, chrSymbols), charsEndIndex(strSymbols, chrSymbols) + 1).join('');
}
/**
* Removes trailing whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trimEnd(' abc ');
* // => ' abc'
*
* _.trimEnd('-_-abc-_-', '_-');
* // => '-_-abc'
*/
function trimEnd(string, chars, guard) {
string = toString(string);
if (!string) {
return string;
}
if (guard || chars === undefined) {
return string.replace(reTrimEnd, '');
}
chars = (chars + '');
if (!chars) {
return string;
}
var strSymbols = stringToArray(string);
return strSymbols.slice(0, charsEndIndex(strSymbols, stringToArray(chars)) + 1).join('');
}
/**
* Removes leading whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trimStart(' abc ');
* // => 'abc '
*
* _.trimStart('-_-abc-_-', '_-');
* // => 'abc-_-'
*/
function trimStart(string, chars, guard) {
string = toString(string);
if (!string) {
return string;
}
if (guard || chars === undefined) {
return string.replace(reTrimStart, '');
}
chars = (chars + '');
if (!chars) {
return string;
}
var strSymbols = stringToArray(string);
return strSymbols.slice(charsStartIndex(strSymbols, stringToArray(chars))).join('');
}
/**
* Truncates `string` if it's longer than the given maximum string length.
* The last characters of the truncated string are replaced with the omission
* string which defaults to "...".
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to truncate.
* @param {Object} [options] The options object.
* @param {number} [options.length=30] The maximum string length.
* @param {string} [options.omission='...'] The string to indicate text is omitted.
* @param {RegExp|string} [options.separator] The separator pattern to truncate to.
* @returns {string} Returns the truncated string.
* @example
*
* _.truncate('hi-diddly-ho there, neighborino');
* // => 'hi-diddly-ho there, neighbo...'
*
* _.truncate('hi-diddly-ho there, neighborino', {
* 'length': 24,
* 'separator': ' '
* });
* // => 'hi-diddly-ho there,...'
*
* _.truncate('hi-diddly-ho there, neighborino', {
* 'length': 24,
* 'separator': /,? +/
* });
* // => 'hi-diddly-ho there...'
*
* _.truncate('hi-diddly-ho there, neighborino', {
* 'omission': ' [...]'
* });
* // => 'hi-diddly-ho there, neig [...]'
*/
function truncate(string, options) {
var length = DEFAULT_TRUNC_LENGTH,
omission = DEFAULT_TRUNC_OMISSION;
if (isObject(options)) {
var separator = 'separator' in options ? options.separator : separator;
length = 'length' in options ? toInteger(options.length) : length;
omission = 'omission' in options ? toString(options.omission) : omission;
}
string = toString(string);
var strLength = string.length;
if (reHasComplexSymbol.test(string)) {
var strSymbols = stringToArray(string);
strLength = strSymbols.length;
}
if (length >= strLength) {
return string;
}
var end = length - stringSize(omission);
if (end < 1) {
return omission;
}
var result = strSymbols
? strSymbols.slice(0, end).join('')
: string.slice(0, end);
if (separator === undefined) {
return result + omission;
}
if (strSymbols) {
end += (result.length - end);
}
if (isRegExp(separator)) {
if (string.slice(end).search(separator)) {
var match,
substring = result;
if (!separator.global) {
separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
}
separator.lastIndex = 0;
while ((match = separator.exec(substring))) {
var newEnd = match.index;
}
result = result.slice(0, newEnd === undefined ? end : newEnd);
}
} else if (string.indexOf(separator, end) != end) {
var index = result.lastIndexOf(separator);
if (index > -1) {
result = result.slice(0, index);
}
}
return result + omission;
}
/**
* The inverse of `_.escape`; this method converts the HTML entities
* `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their
* corresponding characters.
*
* **Note:** No other HTML entities are unescaped. To unescape additional HTML
* entities use a third-party library like [_he_](https://mths.be/he).
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to unescape.
* @returns {string} Returns the unescaped string.
* @example
*
* _.unescape('fred, barney, & pebbles');
* // => 'fred, barney, & pebbles'
*/
function unescape(string) {
string = toString(string);
return (string && reHasEscapedHtml.test(string))
? string.replace(reEscapedHtml, unescapeHtmlChar)
: string;
}
/**
* Converts `string`, as space separated words, to upper case.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.upperCase('--foo-bar');
* // => 'FOO BAR'
*
* _.upperCase('fooBar');
* // => 'FOO BAR'
*
* _.upperCase('__foo_bar__');
* // => 'FOO BAR'
*/
var upperCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + word.toUpperCase();
});
/**
* Splits `string` into an array of its words.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to inspect.
* @param {RegExp|string} [pattern] The pattern to match words.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {Array} Returns the words of `string`.
* @example
*
* _.words('fred, barney, & pebbles');
* // => ['fred', 'barney', 'pebbles']
*
* _.words('fred, barney, & pebbles', /[^, ]+/g);
* // => ['fred', 'barney', '&', 'pebbles']
*/
function words(string, pattern, guard) {
string = toString(string);
pattern = guard ? undefined : pattern;
if (pattern === undefined) {
pattern = reHasComplexWord.test(string) ? reComplexWord : reBasicWord;
}
return string.match(pattern) || [];
}
/*------------------------------------------------------------------------*/
/**
* Attempts to invoke `func`, returning either the result or the caught error
* object. Any additional arguments are provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @category Utility
* @param {Function} func The function to attempt.
* @returns {*} Returns the `func` result or error object.
* @example
*
* // avoid throwing errors for invalid selectors
* var elements = _.attempt(function(selector) {
* return document.querySelectorAll(selector);
* }, '>_>');
*
* if (_.isError(elements)) {
* elements = [];
* }
*/
var attempt = rest(function(func, args) {
try {
return apply(func, undefined, args);
} catch (e) {
return isError(e) ? e : new Error(e);
}
});
/**
* Binds methods of an object to the object itself, overwriting the existing
* method.
*
* **Note:** This method doesn't set the "length" property of bound functions.
*
* @static
* @memberOf _
* @category Utility
* @param {Object} object The object to bind and assign the bound methods to.
* @param {...(string|string[])} methodNames The object method names to bind,
* specified individually or in arrays.
* @returns {Object} Returns `object`.
* @example
*
* var view = {
* 'label': 'docs',
* 'onClick': function() {
* console.log('clicked ' + this.label);
* }
* };
*
* _.bindAll(view, 'onClick');
* jQuery(element).on('click', view.onClick);
* // => logs 'clicked docs' when clicked
*/
var bindAll = rest(function(object, methodNames) {
arrayEach(baseFlatten(methodNames), function(key) {
object[key] = bind(object[key], object);
});
return object;
});
/**
* Creates a function that iterates over `pairs` invoking the corresponding
* function of the first predicate to return truthy. The predicate-function
* pairs are invoked with the `this` binding and arguments of the created
* function.
*
* @static
* @memberOf _
* @category Utility
* @param {Array} pairs The predicate-function pairs.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.cond([
* [_.matches({ 'a': 1 }), _.constant('matches A')],
* [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
* [_.constant(true), _.constant('no match')]
* ])
*
* func({ 'a': 1, 'b': 2 });
* // => 'matches A'
*
* func({ 'a': 0, 'b': 1 });
* // => 'matches B'
*
* func({ 'a': '1', 'b': '2' });
* // => 'no match'
*/
function cond(pairs) {
var length = pairs ? pairs.length : 0,
toIteratee = getIteratee();
pairs = !length ? [] : arrayMap(pairs, function(pair) {
if (typeof pair[1] != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return [toIteratee(pair[0]), pair[1]];
});
return rest(function(args) {
var index = -1;
while (++index < length) {
var pair = pairs[index];
if (apply(pair[0], this, args)) {
return apply(pair[1], this, args);
}
}
});
}
/**
* Creates a function that invokes the predicate properties of `source` with
* the corresponding property values of a given object, returning `true` if
* all predicates return truthy, else `false`.
*
* @static
* @memberOf _
* @category Utility
* @param {Object} source The object of property predicates to conform to.
* @returns {Function} Returns the new function.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 }
* ];
*
* _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) }));
* // => [{ 'user': 'fred', 'age': 40 }]
*/
function conforms(source) {
return baseConforms(baseClone(source, true));
}
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @category Utility
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new function.
* @example
*
* var object = { 'user': 'fred' };
* var getter = _.constant(object);
*
* getter() === object;
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
/**
* Creates a function that returns the result of invoking the provided
* functions with the `this` binding of the created function, where each
* successive invocation is supplied the return value of the previous.
*
* @static
* @memberOf _
* @category Utility
* @param {...(Function|Function[])} [funcs] Functions to invoke.
* @returns {Function} Returns the new function.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var addSquare = _.flow(_.add, square);
* addSquare(1, 2);
* // => 9
*/
var flow = createFlow();
/**
* This method is like `_.flow` except that it creates a function that
* invokes the provided functions from right to left.
*
* @static
* @memberOf _
* @category Utility
* @param {...(Function|Function[])} [funcs] Functions to invoke.
* @returns {Function} Returns the new function.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var addSquare = _.flowRight(square, _.add);
* addSquare(1, 2);
* // => 9
*/
var flowRight = createFlow(true);
/**
* This method returns the first argument provided to it.
*
* @static
* @memberOf _
* @category Utility
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'user': 'fred' };
*
* _.identity(object) === object;
* // => true
*/
function identity(value) {
return value;
}
/**
* Creates a function that invokes `func` with the arguments of the created
* function. If `func` is a property name the created callback returns the
* property value for a given element. If `func` is an object the created
* callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`.
*
* @static
* @memberOf _
* @category Utility
* @param {*} [func=_.identity] The value to convert to a callback.
* @returns {Function} Returns the callback.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 }
* ];
*
* // wrap to create custom iteratee shorthands
* _.iteratee = _.wrap(_.iteratee, function(callback, func, thisArg) {
* var match = /^(.+?)__([gl]t)(.+)$/.exec(func);
* if (!match) {
* return callback(func, thisArg);
* }
* return function(object) {
* return match[2] == 'gt'
* ? object[match[1]] > match[3]
* : object[match[1]] < match[3];
* };
* });
*
* _.filter(users, 'age__gt36');
* // => [{ 'user': 'fred', 'age': 40 }]
*/
function iteratee(func) {
return (isObjectLike(func) && !isArray(func))
? matches(func)
: baseIteratee(func);
}
/**
* Creates a function that performs a deep partial comparison between a given
* object and `source`, returning `true` if the given object has equivalent
* property values, else `false`.
*
* **Note:** This method supports comparing the same values as `_.isEqual`.
*
* @static
* @memberOf _
* @category Utility
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new function.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* _.filter(users, _.matches({ 'age': 40, 'active': false }));
* // => [{ 'user': 'fred', 'age': 40, 'active': false }]
*/
function matches(source) {
return baseMatches(baseClone(source, true));
}
/**
* Creates a function that performs a deep partial comparison between the
* value at `path` of a given object to `srcValue`, returning `true` if the
* object value is equivalent, else `false`.
*
* **Note:** This method supports comparing the same values as `_.isEqual`.
*
* @static
* @memberOf _
* @category Utility
* @param {Array|string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new function.
* @example
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' }
* ];
*
* _.find(users, _.matchesProperty('user', 'fred'));
* // => { 'user': 'fred' }
*/
function matchesProperty(path, srcValue) {
return baseMatchesProperty(path, baseClone(srcValue, true));
}
/**
* Creates a function that invokes the method at `path` of a given object.
* Any additional arguments are provided to the invoked method.
*
* @static
* @memberOf _
* @category Utility
* @param {Array|string} path The path of the method to invoke.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {Function} Returns the new function.
* @example
*
* var objects = [
* { 'a': { 'b': { 'c': _.constant(2) } } },
* { 'a': { 'b': { 'c': _.constant(1) } } }
* ];
*
* _.map(objects, _.method('a.b.c'));
* // => [2, 1]
*
* _.invokeMap(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');
* // => [1, 2]
*/
var method = rest(function(path, args) {
return function(object) {
return baseInvoke(object, path, args);
};
});
/**
* The opposite of `_.method`; this method creates a function that invokes
* the method at a given path of `object`. Any additional arguments are
* provided to the invoked method.
*
* @static
* @memberOf _
* @category Utility
* @param {Object} object The object to query.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {Function} Returns the new function.
* @example
*
* var array = _.times(3, _.constant),
* object = { 'a': array, 'b': array, 'c': array };
*
* _.map(['a[2]', 'c[0]'], _.methodOf(object));
* // => [2, 0]
*
* _.map([['a', '2'], ['c', '0']], _.methodOf(object));
* // => [2, 0]
*/
var methodOf = rest(function(object, args) {
return function(path) {
return baseInvoke(object, path, args);
};
});
/**
* Adds all own enumerable function properties of a source object to the
* destination object. If `object` is a function then methods are added to
* its prototype as well.
*
* **Note:** Use `_.runInContext` to create a pristine `lodash` function to
* avoid conflicts caused by modifying the original.
*
* @static
* @memberOf _
* @category Utility
* @param {Function|Object} [object=lodash] The destination object.
* @param {Object} source The object of functions to add.
* @param {Object} [options] The options object.
* @param {boolean} [options.chain=true] Specify whether the functions added
* are chainable.
* @returns {Function|Object} Returns `object`.
* @example
*
* function vowels(string) {
* return _.filter(string, function(v) {
* return /[aeiou]/i.test(v);
* });
* }
*
* _.mixin({ 'vowels': vowels });
* _.vowels('fred');
* // => ['e']
*
* _('fred').vowels().value();
* // => ['e']
*
* _.mixin({ 'vowels': vowels }, { 'chain': false });
* _('fred').vowels();
* // => ['e']
*/
function mixin(object, source, options) {
var props = keys(source),
methodNames = baseFunctions(source, props);
if (options == null &&
!(isObject(source) && (methodNames.length || !props.length))) {
options = source;
source = object;
object = this;
methodNames = baseFunctions(source, keys(source));
}
var chain = (isObject(options) && 'chain' in options) ? options.chain : true,
isFunc = isFunction(object);
arrayEach(methodNames, function(methodName) {
var func = source[methodName];
object[methodName] = func;
if (isFunc) {
object.prototype[methodName] = function() {
var chainAll = this.__chain__;
if (chain || chainAll) {
var result = object(this.__wrapped__),
actions = result.__actions__ = copyArray(this.__actions__);
actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
result.__chain__ = chainAll;
return result;
}
return func.apply(object, arrayPush([this.value()], arguments));
};
}
});
return object;
}
/**
* Reverts the `_` variable to its previous value and returns a reference to
* the `lodash` function.
*
* @static
* @memberOf _
* @category Utility
* @returns {Function} Returns the `lodash` function.
* @example
*
* var lodash = _.noConflict();
*/
function noConflict() {
root._ = oldDash;
return this;
}
/**
* A no-operation function that returns `undefined` regardless of the
* arguments it receives.
*
* @static
* @memberOf _
* @category Utility
* @example
*
* var object = { 'user': 'fred' };
*
* _.noop(object) === undefined;
* // => true
*/
function noop() {
// No operation performed.
}
/**
* Creates a function that returns its nth argument.
*
* @static
* @memberOf _
* @category Utility
* @param {number} [n=0] The index of the argument to return.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.nthArg(1);
*
* func('a', 'b', 'c');
* // => 'b'
*/
function nthArg(n) {
n = toInteger(n);
return function() {
return arguments[n];
};
}
/**
* Creates a function that invokes `iteratees` with the arguments provided
* to the created function and returns their results.
*
* @static
* @memberOf _
* @category Utility
* @param {...(Function|Function[])} iteratees The iteratees to invoke.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.over(Math.max, Math.min);
*
* func(1, 2, 3, 4);
* // => [4, 1]
*/
var over = createOver(arrayMap);
/**
* Creates a function that checks if **all** of the `predicates` return
* truthy when invoked with the arguments provided to the created function.
*
* @static
* @memberOf _
* @category Utility
* @param {...(Function|Function[])} predicates The predicates to check.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.overEvery(Boolean, isFinite);
*
* func('1');
* // => true
*
* func(null);
* // => false
*
* func(NaN);
* // => false
*/
var overEvery = createOver(arrayEvery);
/**
* Creates a function that checks if **any** of the `predicates` return
* truthy when invoked with the arguments provided to the created function.
*
* @static
* @memberOf _
* @category Utility
* @param {...(Function|Function[])} predicates The predicates to check.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.overSome(Boolean, isFinite);
*
* func('1');
* // => true
*
* func(null);
* // => true
*
* func(NaN);
* // => false
*/
var overSome = createOver(arraySome);
/**
* Creates a function that returns the value at `path` of a given object.
*
* @static
* @memberOf _
* @category Utility
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new function.
* @example
*
* var objects = [
* { 'a': { 'b': { 'c': 2 } } },
* { 'a': { 'b': { 'c': 1 } } }
* ];
*
* _.map(objects, _.property('a.b.c'));
* // => [2, 1]
*
* _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
}
/**
* The opposite of `_.property`; this method creates a function that returns
* the value at a given path of `object`.
*
* @static
* @memberOf _
* @category Utility
* @param {Object} object The object to query.
* @returns {Function} Returns the new function.
* @example
*
* var array = [0, 1, 2],
* object = { 'a': array, 'b': array, 'c': array };
*
* _.map(['a[2]', 'c[0]'], _.propertyOf(object));
* // => [2, 0]
*
* _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
* // => [2, 0]
*/
function propertyOf(object) {
return function(path) {
return object == null ? undefined : baseGet(object, path);
};
}
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to, but not including, `end`. A step of `-1` is used if a negative
* `start` is specified without an `end` or `step`. If `end` is not specified
* it's set to `start` with `start` then set to `0`. If `end` is less than
* `start` a zero-length range is created unless a negative `step` is specified.
*
* **Note:** JavaScript follows the IEEE-754 standard for resolving
* floating-point values which can produce unexpected results.
*
* @static
* @memberOf _
* @category Utility
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @param {number} [step=1] The value to increment or decrement by.
* @returns {Array} Returns the new array of numbers.
* @example
*
* _.range(4);
* // => [0, 1, 2, 3]
*
* _.range(-4);
* // => [0, -1, -2, -3]
*
* _.range(1, 5);
* // => [1, 2, 3, 4]
*
* _.range(0, 20, 5);
* // => [0, 5, 10, 15]
*
* _.range(0, -4, -1);
* // => [0, -1, -2, -3]
*
* _.range(1, 4, 0);
* // => [1, 1, 1]
*
* _.range(0);
* // => []
*/
var range = createRange();
/**
* This method is like `_.range` except that it populates values in
* descending order.
*
* @static
* @memberOf _
* @category Utility
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @param {number} [step=1] The value to increment or decrement by.
* @returns {Array} Returns the new array of numbers.
* @example
*
* _.rangeRight(4);
* // => [3, 2, 1, 0]
*
* _.rangeRight(-4);
* // => [-3, -2, -1, 0]
*
* _.rangeRight(1, 5);
* // => [4, 3, 2, 1]
*
* _.rangeRight(0, 20, 5);
* // => [15, 10, 5, 0]
*
* _.rangeRight(0, -4, -1);
* // => [-3, -2, -1, 0]
*
* _.rangeRight(1, 4, 0);
* // => [1, 1, 1]
*
* _.rangeRight(0);
* // => []
*/
var rangeRight = createRange(true);
/**
* Invokes the iteratee function `n` times, returning an array of the results
* of each invocation. The iteratee is invoked with one argument; (index).
*
* @static
* @memberOf _
* @category Utility
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of results.
* @example
*
* _.times(3, String);
* // => ['0', '1', '2']
*
* _.times(4, _.constant(true));
* // => [true, true, true, true]
*/
function times(n, iteratee) {
n = toInteger(n);
if (n < 1 || n > MAX_SAFE_INTEGER) {
return [];
}
var index = MAX_ARRAY_LENGTH,
length = nativeMin(n, MAX_ARRAY_LENGTH);
iteratee = toFunction(iteratee);
n -= MAX_ARRAY_LENGTH;
var result = baseTimes(length, iteratee);
while (++index < n) {
iteratee(index);
}
return result;
}
/**
* Converts `value` to a property path array.
*
* @static
* @memberOf _
* @category Utility
* @param {*} value The value to convert.
* @returns {Array} Returns the new property path array.
* @example
*
* _.toPath('a.b.c');
* // => ['a', 'b', 'c']
*
* _.toPath('a[0].b.c');
* // => ['a', '0', 'b', 'c']
*
* var path = ['a', 'b', 'c'],
* newPath = _.toPath(path);
*
* console.log(newPath);
* // => ['a', 'b', 'c']
*
* console.log(path === newPath);
* // => false
*/
function toPath(value) {
return isArray(value) ? arrayMap(value, String) : stringToPath(value);
}
/**
* Generates a unique ID. If `prefix` is provided the ID is appended to it.
*
* @static
* @memberOf _
* @category Utility
* @param {string} [prefix] The value to prefix the ID with.
* @returns {string} Returns the unique ID.
* @example
*
* _.uniqueId('contact_');
* // => 'contact_104'
*
* _.uniqueId();
* // => '105'
*/
function uniqueId(prefix) {
var id = ++idCounter;
return toString(prefix) + id;
}
/*------------------------------------------------------------------------*/
/**
* Adds two numbers.
*
* @static
* @memberOf _
* @category Math
* @param {number} augend The first number in an addition.
* @param {number} addend The second number in an addition.
* @returns {number} Returns the total.
* @example
*
* _.add(6, 4);
* // => 10
*/
function add(augend, addend) {
var result;
if (augend !== undefined) {
result = augend;
}
if (addend !== undefined) {
result = result === undefined ? addend : (result + addend);
}
return result;
}
/**
* Computes `number` rounded up to `precision`.
*
* @static
* @memberOf _
* @category Math
* @param {number} number The number to round up.
* @param {number} [precision=0] The precision to round up to.
* @returns {number} Returns the rounded up number.
* @example
*
* _.ceil(4.006);
* // => 5
*
* _.ceil(6.004, 2);
* // => 6.01
*
* _.ceil(6040, -2);
* // => 6100
*/
var ceil = createRound('ceil');
/**
* Computes `number` rounded down to `precision`.
*
* @static
* @memberOf _
* @category Math
* @param {number} number The number to round down.
* @param {number} [precision=0] The precision to round down to.
* @returns {number} Returns the rounded down number.
* @example
*
* _.floor(4.006);
* // => 4
*
* _.floor(0.046, 2);
* // => 0.04
*
* _.floor(4060, -2);
* // => 4000
*/
var floor = createRound('floor');
/**
* Computes the maximum value of `array`. If `array` is empty or falsey
* `undefined` is returned.
*
* @static
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @returns {*} Returns the maximum value.
* @example
*
* _.max([4, 2, 8, 6]);
* // => 8
*
* _.max([]);
* // => undefined
*/
function max(array) {
return (array && array.length)
? baseExtremum(array, identity, gt)
: undefined;
}
/**
* This method is like `_.max` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* the value is ranked. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {*} Returns the maximum value.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 }
* ];
*
* _.maxBy(users, function(o) { return o.age; });
* // => { 'user': 'fred', 'age': 40 }
*
* // using the `_.property` iteratee shorthand
* _.maxBy(users, 'age');
* // => { 'user': 'fred', 'age': 40 }
*/
function maxBy(array, iteratee) {
return (array && array.length)
? baseExtremum(array, getIteratee(iteratee), gt)
: undefined;
}
/**
* Computes the mean of the values in `array`.
*
* @static
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @returns {number} Returns the mean.
* @example
*
* _.mean([4, 2, 8, 6]);
* // => 5
*/
function mean(array) {
return sum(array) / (array ? array.length : 0);
}
/**
* Computes the minimum value of `array`. If `array` is empty or falsey
* `undefined` is returned.
*
* @static
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @returns {*} Returns the minimum value.
* @example
*
* _.min([4, 2, 8, 6]);
* // => 2
*
* _.min([]);
* // => undefined
*/
function min(array) {
return (array && array.length)
? baseExtremum(array, identity, lt)
: undefined;
}
/**
* This method is like `_.min` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* the value is ranked. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {*} Returns the minimum value.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 }
* ];
*
* _.minBy(users, function(o) { return o.age; });
* // => { 'user': 'barney', 'age': 36 }
*
* // using the `_.property` iteratee shorthand
* _.minBy(users, 'age');
* // => { 'user': 'barney', 'age': 36 }
*/
function minBy(array, iteratee) {
return (array && array.length)
? baseExtremum(array, getIteratee(iteratee), lt)
: undefined;
}
/**
* Computes `number` rounded to `precision`.
*
* @static
* @memberOf _
* @category Math
* @param {number} number The number to round.
* @param {number} [precision=0] The precision to round to.
* @returns {number} Returns the rounded number.
* @example
*
* _.round(4.006);
* // => 4
*
* _.round(4.006, 2);
* // => 4.01
*
* _.round(4060, -2);
* // => 4100
*/
var round = createRound('round');
/**
* Subtract two numbers.
*
* @static
* @memberOf _
* @category Math
* @param {number} minuend The first number in a subtraction.
* @param {number} subtrahend The second number in a subtraction.
* @returns {number} Returns the difference.
* @example
*
* _.subtract(6, 4);
* // => 2
*/
function subtract(minuend, subtrahend) {
var result;
if (minuend !== undefined) {
result = minuend;
}
if (subtrahend !== undefined) {
result = result === undefined ? subtrahend : (result - subtrahend);
}
return result;
}
/**
* Computes the sum of the values in `array`.
*
* @static
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @returns {number} Returns the sum.
* @example
*
* _.sum([4, 2, 8, 6]);
* // => 20
*/
function sum(array) {
return (array && array.length)
? baseSum(array, identity)
: undefined;
}
/**
* This method is like `_.sum` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the value to be summed.
* The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the sum.
* @example
*
* var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
*
* _.sumBy(objects, function(o) { return o.n; });
* // => 20
*
* // using the `_.property` iteratee shorthand
* _.sumBy(objects, 'n');
* // => 20
*/
function sumBy(array, iteratee) {
return (array && array.length)
? baseSum(array, getIteratee(iteratee))
: undefined;
}
/*------------------------------------------------------------------------*/
// Ensure wrappers are instances of `baseLodash`.
lodash.prototype = baseLodash.prototype;
LodashWrapper.prototype = baseCreate(baseLodash.prototype);
LodashWrapper.prototype.constructor = LodashWrapper;
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
LazyWrapper.prototype.constructor = LazyWrapper;
// Avoid inheriting from `Object.prototype` when possible.
Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;
// Add functions to the `MapCache`.
MapCache.prototype.clear = mapClear;
MapCache.prototype['delete'] = mapDelete;
MapCache.prototype.get = mapGet;
MapCache.prototype.has = mapHas;
MapCache.prototype.set = mapSet;
// Add functions to the `SetCache`.
SetCache.prototype.push = cachePush;
// Add functions to the `Stack` cache.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
// Assign cache to `_.memoize`.
memoize.Cache = MapCache;
// Add functions that return wrapped values when chaining.
lodash.after = after;
lodash.ary = ary;
lodash.assign = assign;
lodash.assignIn = assignIn;
lodash.assignInWith = assignInWith;
lodash.assignWith = assignWith;
lodash.at = at;
lodash.before = before;
lodash.bind = bind;
lodash.bindAll = bindAll;
lodash.bindKey = bindKey;
lodash.chain = chain;
lodash.chunk = chunk;
lodash.compact = compact;
lodash.concat = concat;
lodash.cond = cond;
lodash.conforms = conforms;
lodash.constant = constant;
lodash.countBy = countBy;
lodash.create = create;
lodash.curry = curry;
lodash.curryRight = curryRight;
lodash.debounce = debounce;
lodash.defaults = defaults;
lodash.defaultsDeep = defaultsDeep;
lodash.defer = defer;
lodash.delay = delay;
lodash.difference = difference;
lodash.differenceBy = differenceBy;
lodash.differenceWith = differenceWith;
lodash.drop = drop;
lodash.dropRight = dropRight;
lodash.dropRightWhile = dropRightWhile;
lodash.dropWhile = dropWhile;
lodash.fill = fill;
lodash.filter = filter;
lodash.flatMap = flatMap;
lodash.flatten = flatten;
lodash.flattenDeep = flattenDeep;
lodash.flip = flip;
lodash.flow = flow;
lodash.flowRight = flowRight;
lodash.fromPairs = fromPairs;
lodash.functions = functions;
lodash.functionsIn = functionsIn;
lodash.groupBy = groupBy;
lodash.initial = initial;
lodash.intersection = intersection;
lodash.intersectionBy = intersectionBy;
lodash.intersectionWith = intersectionWith;
lodash.invert = invert;
lodash.invokeMap = invokeMap;
lodash.iteratee = iteratee;
lodash.keyBy = keyBy;
lodash.keys = keys;
lodash.keysIn = keysIn;
lodash.map = map;
lodash.mapKeys = mapKeys;
lodash.mapValues = mapValues;
lodash.matches = matches;
lodash.matchesProperty = matchesProperty;
lodash.memoize = memoize;
lodash.merge = merge;
lodash.mergeWith = mergeWith;
lodash.method = method;
lodash.methodOf = methodOf;
lodash.mixin = mixin;
lodash.negate = negate;
lodash.nthArg = nthArg;
lodash.omit = omit;
lodash.omitBy = omitBy;
lodash.once = once;
lodash.orderBy = orderBy;
lodash.over = over;
lodash.overArgs = overArgs;
lodash.overEvery = overEvery;
lodash.overSome = overSome;
lodash.partial = partial;
lodash.partialRight = partialRight;
lodash.partition = partition;
lodash.pick = pick;
lodash.pickBy = pickBy;
lodash.property = property;
lodash.propertyOf = propertyOf;
lodash.pull = pull;
lodash.pullAll = pullAll;
lodash.pullAllBy = pullAllBy;
lodash.pullAt = pullAt;
lodash.range = range;
lodash.rangeRight = rangeRight;
lodash.rearg = rearg;
lodash.reject = reject;
lodash.remove = remove;
lodash.rest = rest;
lodash.reverse = reverse;
lodash.sampleSize = sampleSize;
lodash.set = set;
lodash.setWith = setWith;
lodash.shuffle = shuffle;
lodash.slice = slice;
lodash.sortBy = sortBy;
lodash.sortedUniq = sortedUniq;
lodash.sortedUniqBy = sortedUniqBy;
lodash.split = split;
lodash.spread = spread;
lodash.tail = tail;
lodash.take = take;
lodash.takeRight = takeRight;
lodash.takeRightWhile = takeRightWhile;
lodash.takeWhile = takeWhile;
lodash.tap = tap;
lodash.throttle = throttle;
lodash.thru = thru;
lodash.toArray = toArray;
lodash.toPairs = toPairs;
lodash.toPairsIn = toPairsIn;
lodash.toPath = toPath;
lodash.toPlainObject = toPlainObject;
lodash.transform = transform;
lodash.unary = unary;
lodash.union = union;
lodash.unionBy = unionBy;
lodash.unionWith = unionWith;
lodash.uniq = uniq;
lodash.uniqBy = uniqBy;
lodash.uniqWith = uniqWith;
lodash.unset = unset;
lodash.unzip = unzip;
lodash.unzipWith = unzipWith;
lodash.values = values;
lodash.valuesIn = valuesIn;
lodash.without = without;
lodash.words = words;
lodash.wrap = wrap;
lodash.xor = xor;
lodash.xorBy = xorBy;
lodash.xorWith = xorWith;
lodash.zip = zip;
lodash.zipObject = zipObject;
lodash.zipWith = zipWith;
// Add aliases.
lodash.each = forEach;
lodash.eachRight = forEachRight;
lodash.extend = assignIn;
lodash.extendWith = assignInWith;
// Add functions to `lodash.prototype`.
mixin(lodash, lodash);
/*------------------------------------------------------------------------*/
// Add functions that return unwrapped values when chaining.
lodash.add = add;
lodash.attempt = attempt;
lodash.camelCase = camelCase;
lodash.capitalize = capitalize;
lodash.ceil = ceil;
lodash.clamp = clamp;
lodash.clone = clone;
lodash.cloneDeep = cloneDeep;
lodash.cloneDeepWith = cloneDeepWith;
lodash.cloneWith = cloneWith;
lodash.deburr = deburr;
lodash.endsWith = endsWith;
lodash.eq = eq;
lodash.escape = escape;
lodash.escapeRegExp = escapeRegExp;
lodash.every = every;
lodash.find = find;
lodash.findIndex = findIndex;
lodash.findKey = findKey;
lodash.findLast = findLast;
lodash.findLastIndex = findLastIndex;
lodash.findLastKey = findLastKey;
lodash.floor = floor;
lodash.forEach = forEach;
lodash.forEachRight = forEachRight;
lodash.forIn = forIn;
lodash.forInRight = forInRight;
lodash.forOwn = forOwn;
lodash.forOwnRight = forOwnRight;
lodash.get = get;
lodash.gt = gt;
lodash.gte = gte;
lodash.has = has;
lodash.hasIn = hasIn;
lodash.head = head;
lodash.identity = identity;
lodash.includes = includes;
lodash.indexOf = indexOf;
lodash.inRange = inRange;
lodash.invoke = invoke;
lodash.isArguments = isArguments;
lodash.isArray = isArray;
lodash.isArrayLike = isArrayLike;
lodash.isArrayLikeObject = isArrayLikeObject;
lodash.isBoolean = isBoolean;
lodash.isDate = isDate;
lodash.isElement = isElement;
lodash.isEmpty = isEmpty;
lodash.isEqual = isEqual;
lodash.isEqualWith = isEqualWith;
lodash.isError = isError;
lodash.isFinite = isFinite;
lodash.isFunction = isFunction;
lodash.isInteger = isInteger;
lodash.isLength = isLength;
lodash.isMatch = isMatch;
lodash.isMatchWith = isMatchWith;
lodash.isNaN = isNaN;
lodash.isNative = isNative;
lodash.isNil = isNil;
lodash.isNull = isNull;
lodash.isNumber = isNumber;
lodash.isObject = isObject;
lodash.isObjectLike = isObjectLike;
lodash.isPlainObject = isPlainObject;
lodash.isRegExp = isRegExp;
lodash.isSafeInteger = isSafeInteger;
lodash.isString = isString;
lodash.isSymbol = isSymbol;
lodash.isTypedArray = isTypedArray;
lodash.isUndefined = isUndefined;
lodash.join = join;
lodash.kebabCase = kebabCase;
lodash.last = last;
lodash.lastIndexOf = lastIndexOf;
lodash.lowerCase = lowerCase;
lodash.lowerFirst = lowerFirst;
lodash.lt = lt;
lodash.lte = lte;
lodash.max = max;
lodash.maxBy = maxBy;
lodash.mean = mean;
lodash.min = min;
lodash.minBy = minBy;
lodash.noConflict = noConflict;
lodash.noop = noop;
lodash.now = now;
lodash.pad = pad;
lodash.padEnd = padEnd;
lodash.padStart = padStart;
lodash.parseInt = parseInt;
lodash.random = random;
lodash.reduce = reduce;
lodash.reduceRight = reduceRight;
lodash.repeat = repeat;
lodash.replace = replace;
lodash.result = result;
lodash.round = round;
lodash.runInContext = runInContext;
lodash.sample = sample;
lodash.size = size;
lodash.snakeCase = snakeCase;
lodash.some = some;
lodash.sortedIndex = sortedIndex;
lodash.sortedIndexBy = sortedIndexBy;
lodash.sortedIndexOf = sortedIndexOf;
lodash.sortedLastIndex = sortedLastIndex;
lodash.sortedLastIndexBy = sortedLastIndexBy;
lodash.sortedLastIndexOf = sortedLastIndexOf;
lodash.startCase = startCase;
lodash.startsWith = startsWith;
lodash.subtract = subtract;
lodash.sum = sum;
lodash.sumBy = sumBy;
lodash.template = template;
lodash.times = times;
lodash.toInteger = toInteger;
lodash.toLength = toLength;
lodash.toLower = toLower;
lodash.toNumber = toNumber;
lodash.toSafeInteger = toSafeInteger;
lodash.toString = toString;
lodash.toUpper = toUpper;
lodash.trim = trim;
lodash.trimEnd = trimEnd;
lodash.trimStart = trimStart;
lodash.truncate = truncate;
lodash.unescape = unescape;
lodash.uniqueId = uniqueId;
lodash.upperCase = upperCase;
lodash.upperFirst = upperFirst;
// Add aliases.
lodash.first = head;
mixin(lodash, (function() {
var source = {};
baseForOwn(lodash, function(func, methodName) {
if (!hasOwnProperty.call(lodash.prototype, methodName)) {
source[methodName] = func;
}
});
return source;
}()), { 'chain': false });
/*------------------------------------------------------------------------*/
/**
* The semantic version number.
*
* @static
* @memberOf _
* @type string
*/
lodash.VERSION = VERSION;
// Assign default placeholders.
arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
lodash[methodName].placeholder = lodash;
});
// Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
arrayEach(['drop', 'take'], function(methodName, index) {
LazyWrapper.prototype[methodName] = function(n) {
var filtered = this.__filtered__;
if (filtered && !index) {
return new LazyWrapper(this);
}
n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
var result = this.clone();
if (filtered) {
result.__takeCount__ = nativeMin(n, result.__takeCount__);
} else {
result.__views__.push({ 'size': nativeMin(n, MAX_ARRAY_LENGTH), 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') });
}
return result;
};
LazyWrapper.prototype[methodName + 'Right'] = function(n) {
return this.reverse()[methodName](n).reverse();
};
});
// Add `LazyWrapper` methods that accept an `iteratee` value.
arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
var type = index + 1,
isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
LazyWrapper.prototype[methodName] = function(iteratee) {
var result = this.clone();
result.__iteratees__.push({ 'iteratee': getIteratee(iteratee, 3), 'type': type });
result.__filtered__ = result.__filtered__ || isFilter;
return result;
};
});
// Add `LazyWrapper` methods for `_.head` and `_.last`.
arrayEach(['head', 'last'], function(methodName, index) {
var takeName = 'take' + (index ? 'Right' : '');
LazyWrapper.prototype[methodName] = function() {
return this[takeName](1).value()[0];
};
});
// Add `LazyWrapper` methods for `_.initial` and `_.tail`.
arrayEach(['initial', 'tail'], function(methodName, index) {
var dropName = 'drop' + (index ? '' : 'Right');
LazyWrapper.prototype[methodName] = function() {
return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
};
});
LazyWrapper.prototype.compact = function() {
return this.filter(identity);
};
LazyWrapper.prototype.find = function(predicate) {
return this.filter(predicate).head();
};
LazyWrapper.prototype.findLast = function(predicate) {
return this.reverse().find(predicate);
};
LazyWrapper.prototype.invokeMap = rest(function(path, args) {
if (typeof path == 'function') {
return new LazyWrapper(this);
}
return this.map(function(value) {
return baseInvoke(value, path, args);
});
});
LazyWrapper.prototype.reject = function(predicate) {
predicate = getIteratee(predicate, 3);
return this.filter(function(value) {
return !predicate(value);
});
};
LazyWrapper.prototype.slice = function(start, end) {
start = toInteger(start);
var result = this;
if (result.__filtered__ && (start > 0 || end < 0)) {
return new LazyWrapper(result);
}
if (start < 0) {
result = result.takeRight(-start);
} else if (start) {
result = result.drop(start);
}
if (end !== undefined) {
end = toInteger(end);
result = end < 0 ? result.dropRight(-end) : result.take(end - start);
}
return result;
};
LazyWrapper.prototype.takeRightWhile = function(predicate) {
return this.reverse().takeWhile(predicate).reverse();
};
LazyWrapper.prototype.toArray = function() {
return this.take(MAX_ARRAY_LENGTH);
};
// Add `LazyWrapper` methods to `lodash.prototype`.
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
isTaker = /^(?:head|last)$/.test(methodName),
lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
retUnwrapped = isTaker || /^find/.test(methodName);
if (!lodashFunc) {
return;
}
lodash.prototype[methodName] = function() {
var value = this.__wrapped__,
args = isTaker ? [1] : arguments,
isLazy = value instanceof LazyWrapper,
iteratee = args[0],
useLazy = isLazy || isArray(value);
var interceptor = function(value) {
var result = lodashFunc.apply(lodash, arrayPush([value], args));
return (isTaker && chainAll) ? result[0] : result;
};
if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
// Avoid lazy use if the iteratee has a "length" value other than `1`.
isLazy = useLazy = false;
}
var chainAll = this.__chain__,
isHybrid = !!this.__actions__.length,
isUnwrapped = retUnwrapped && !chainAll,
onlyLazy = isLazy && !isHybrid;
if (!retUnwrapped && useLazy) {
value = onlyLazy ? value : new LazyWrapper(this);
var result = func.apply(value, args);
result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
return new LodashWrapper(result, chainAll);
}
if (isUnwrapped && onlyLazy) {
return func.apply(this, args);
}
result = this.thru(interceptor);
return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
};
});
// Add `Array` and `String` methods to `lodash.prototype`.
arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
var func = arrayProto[methodName],
chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
retUnwrapped = /^(?:pop|shift)$/.test(methodName);
lodash.prototype[methodName] = function() {
var args = arguments;
if (retUnwrapped && !this.__chain__) {
return func.apply(this.value(), args);
}
return this[chainName](function(value) {
return func.apply(value, args);
});
};
});
// Map minified function names to their real names.
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
var lodashFunc = lodash[methodName];
if (lodashFunc) {
var key = (lodashFunc.name + ''),
names = realNames[key] || (realNames[key] = []);
names.push({ 'name': methodName, 'func': lodashFunc });
}
});
realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }];
// Add functions to the lazy wrapper.
LazyWrapper.prototype.clone = lazyClone;
LazyWrapper.prototype.reverse = lazyReverse;
LazyWrapper.prototype.value = lazyValue;
// Add chaining functions to the `lodash` wrapper.
lodash.prototype.at = wrapperAt;
lodash.prototype.chain = wrapperChain;
lodash.prototype.commit = wrapperCommit;
lodash.prototype.flatMap = wrapperFlatMap;
lodash.prototype.next = wrapperNext;
lodash.prototype.plant = wrapperPlant;
lodash.prototype.reverse = wrapperReverse;
lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
if (iteratorSymbol) {
lodash.prototype[iteratorSymbol] = wrapperToIterator;
}
return lodash;
}
/*--------------------------------------------------------------------------*/
// Export lodash.
var _ = runInContext();
// Expose lodash on the free variable `window` or `self` when available. This
// prevents errors in cases where lodash is loaded by a script tag in the presence
// of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch for more details.
(freeWindow || freeSelf || {})._ = _;
// Some AMD build optimizers like r.js check for condition patterns like the following:
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
// Define as an anonymous module so, through path mapping, it can be
// referenced as the "underscore" module.
define(function() {
return _;
});
}
// Check for `exports` after `define` in case a build optimizer adds an `exports` object.
else if (freeExports && freeModule) {
// Export for Node.js.
if (moduleExports) {
(freeModule.exports = _)._ = _;
}
// Export for CommonJS support.
freeExports._ = _;
}
else {
// Export to the global object.
root._ = _;
}
}.call(this));
|
ttjinhuo/adminEx
|
public/lib/lodash.js
|
JavaScript
|
mit
| 460,339
|
#!/usr/bin/env python3
import os
bundleFilesDir = 'tmp/bundleSizeDownloads'
yarnLockFile = 'yarn.lock'
packagesFile = 'package.json'
def isDividerLine(line):
# At least 80 chars, all slashes except the last (which is newline). The number is inconsistent for some reason.
return (len(line)>=80
and line.endswith("\n")
and all([c=='/' for c in line[0:-1]]))
def isSpacerLine(line):
# At least 80 chars, starting with "//", ending with "//\n", otherwise all spaces
return (len(line)>=80
and line.startswith("//") and line.endswith("//\n")
and all([c==' ' for c in line[2:-3]]))
assert isDividerLine("////////////////////////////////////////////////////////////////////////////////////\n")
assert isSpacerLine("// //\n")
def readFileLines(filename):
f = open(filename, 'r')
lines = f.readlines()
f.close()
return lines
def bundleFilesToSizeMap():
sizesByFilename = {}
for filename in os.listdir(bundleFilesDir):
lines = readFileLines('%s/%s' % (bundleFilesDir, filename))
sizesByFilename = {**unpackFile(lines), **sizesByFilename}
return sizesByFilename
def unpackFile(lines):
sizes = {}
currentFileStart = None
currentFileName = None
for i in range(0,len(lines)):
if i+4<len(lines) and isDividerLine(lines[i]) and isSpacerLine(lines[i+1]) and isSpacerLine(lines[i+3]) and isDividerLine(lines[i+4]):
if currentFileName:
fileContents = '\n'.join(lines[currentFileStart:i])
sizes[currentFileName] = len(fileContents)
currentFileStart = i+5
currentFileName = lines[i+2].strip()[2:-2].strip()
if currentFileName:
fileContents = '\n'.join(lines[currentFileStart:i])
sizes[currentFileName] = len(fileContents)
return sizes
def ancestorPaths(filename):
pathComponents = filename.split('/')
return ['.']+['/'.join(pathComponents[0:i]) for i in range(1,len(pathComponents))]
def sumSizesInDirectories(sizesByFilename):
sizesByDirectory = {}
for filename in sizesByFilename:
for path in ancestorPaths(filename):
sizesByDirectory[path] = sizesByDirectory[path]+sizesByFilename[filename] if path in sizesByDirectory else sizesByFilename[filename]
return sizesByDirectory
# Given the name of a yarn lockfile (yarn.lock), produce a dictionary from
# package -> array of dependencies of that package.
# The idea of this is to be able to identify when a package is depended on by
# only one other package, so that we can attribute the size of the depended-on
# package to the package that imported it.
#
#def yarnLockToDependencyGraph(lockfileName):
# dependenciesByPackage = {}
# lockfileLines = readFileLines(lockfileName)
#
# def backtrackToPackageName(lines, i):
# #TODO
# pass
# def forwardOverDependencies(lines, i):
# #TODO
# pass
#
# for i in range(0,len(lines)):
# if lockfileLines[0].strip()=='dependencies:':
# packageName = backtrackToPackageName(lines, i)
# dependencies = forwardOverDependencies(lines, i)
# if packageName in dependencies:
# dependenciesByPackage[packageName] = {**dependencies[packageName], **dependencies}
# else:
# dependenciesByPackage[packageName] = dependencies
def packagesFileToDependencyRoots(packagesFileName):
f = open(packagesFileName, 'r')
packagesJson = json.loads(f.read())
f.close()
return packagesJson[dependencies]
def rightalign(num, width):
return (' ' * (width-len(str(num)))) + str(num)
#def getAdjustedPackageSizes(sizesByDirectory, dependencyRoots, dependencyGraph):
# #TODO
# return {}
sizesByFilename = bundleFilesToSizeMap()
sizesByDirectory = sumSizesInDirectories(sizesByFilename)
for path in sorted(list(sizesByDirectory.keys())):
print("%s %s" % (rightalign(sizesByDirectory[path], 10), path))
|
Discordius/Telescope
|
scripts/analyzeBundle.py
|
Python
|
mit
| 4,048
|
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_tatooine_evil_nomad_small2.iff"
result.attribute_template_id = -1
result.stfName("poi_n","base_poi_building")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result
|
anhstudios/swganh
|
data/scripts/templates/object/building/poi/shared_tatooine_evil_nomad_small2.py
|
Python
|
mit
| 457
|
/*
* spa.shell.js
* Shell module for SPA
*/
/*jslint browser : true, continue : true,
devel : true, indent : 2, maxerr : 50,
newcap : true, nomen : true, plusplus : true,
regexp : true, sloppy : true, vars : false,
white : true
*/
/*global $, spa */
spa.shell = (function () {
'use strict';
//---------------- BEGIN MODULE SCOPE VARIABLES --------------
var
configMap = {
anchor_schema_map : {
chat : { opened : true, closed : true }
},
resize_interval : 200,
main_html : String()
+ '<div class="spa-shell-head">'
+ '<div class="spa-shell-head-logo">'
+ '<h1>SPA</h1>'
+ '<p>javascript end to end</p>'
+ '</div>'
+ '<div class="spa-shell-head-acct"></div>'
+ '</div>'
+ '<div class="spa-shell-main">'
+ '<div class="spa-shell-main-nav"></div>'
+ '<div class="spa-shell-main-content"></div>'
+ '</div>'
+ '<div class="spa-shell-foot"></div>'
+ '<div class="spa-shell-modal"></div>'
},
stateMap = {
$container : undefined,
anchor_map : {},
resize_idto : undefined
},
jqueryMap = {},
copyAnchorMap, setJqueryMap, changeAnchorPart,
onResize, onHashchange,
onTapAcct, onLogin, onLogout,
setChatAnchor, initModule;
//----------------- END MODULE SCOPE VARIABLES ---------------
//------------------- BEGIN UTILITY METHODS ------------------
// Returns copy of stored anchor map; minimizes overhead
copyAnchorMap = function () {
return $.extend( true, {}, stateMap.anchor_map );
};
//-------------------- END UTILITY METHODS -------------------
//--------------------- BEGIN DOM METHODS --------------------
// Begin DOM method /setJqueryMap/
setJqueryMap = function () {
var $container = stateMap.$container;
jqueryMap = {
$container : $container,
$acct : $container.find('.spa-shell-head-acct'),
$nav : $container.find('.spa-shell-main-nav')
};
};
// End DOM method /setJqueryMap/
// Begin DOM method /changeAnchorPart/
// Purpose : Changes part of the URI anchor component
// Arguments :
// * arg_map - The map describing what part of the URI anchor
// we want changed.
// Returns :
// * true - the Anchor portion of the URI was updated
// * false - the Anchor portion of the URI could not be updated
// Actions :
// The current anchor rep stored in stateMap.anchor_map.
// See uriAnchor for a discussion of encoding.
// This method
// * Creates a copy of this map using copyAnchorMap().
// * Modifies the key-values using arg_map.
// * Manages the distinction between independent
// and dependent values in the encoding.
// * Attempts to change the URI using uriAnchor.
// * Returns true on success, and false on failure.
//
changeAnchorPart = function ( arg_map ) {
var
anchor_map_revise = copyAnchorMap(),
bool_return = true,
key_name, key_name_dep;
// Begin merge changes into anchor map
KEYVAL:
for ( key_name in arg_map ) {
if ( arg_map.hasOwnProperty( key_name ) ) {
// skip dependent keys during iteration
if ( key_name.indexOf( '_' ) === 0 ) { continue KEYVAL; }
// update independent key value
anchor_map_revise[key_name] = arg_map[key_name];
// update matching dependent key
key_name_dep = '_' + key_name;
if ( arg_map[key_name_dep] ) {
anchor_map_revise[key_name_dep] = arg_map[key_name_dep];
}
else {
delete anchor_map_revise[key_name_dep];
delete anchor_map_revise['_s' + key_name_dep];
}
}
}
// End merge changes into anchor map
// Begin attempt to update URI; revert if not successful
try {
$.uriAnchor.setAnchor( anchor_map_revise );
}
catch ( error ) {
// replace URI with existing state
$.uriAnchor.setAnchor( stateMap.anchor_map,null,true );
bool_return = false;
}
// End attempt to update URI...
return bool_return;
};
// End DOM method /changeAnchorPart/
//--------------------- END DOM METHODS ----------------------
//------------------- BEGIN EVENT HANDLERS -------------------
// Begin Event handler /onHashchange/
// Purpose : Handles the hashchange event
// Arguments :
// * event - jQuery event object.
// Settings : none
// Returns : false
// Actions :
// * Parses the URI anchor component
// * Compares proposed application state with current
// * Adjust the application only where proposed state
// differs from existing and is allowed by anchor schema
//
onHashchange = function ( event ) {
var
_s_chat_previous, _s_chat_proposed, s_chat_proposed,
anchor_map_proposed,
is_ok = true,
anchor_map_previous = copyAnchorMap();
// attempt to parse anchor
try { anchor_map_proposed = $.uriAnchor.makeAnchorMap(); }
catch ( error ) {
$.uriAnchor.setAnchor( anchor_map_previous, null, true );
return false;
}
stateMap.anchor_map = anchor_map_proposed;
// convenience vars
_s_chat_previous = anchor_map_previous._s_chat;
_s_chat_proposed = anchor_map_proposed._s_chat;
// Begin adjust chat component if changed
if ( ! anchor_map_previous
|| _s_chat_previous !== _s_chat_proposed
) {
s_chat_proposed = anchor_map_proposed.chat;
switch ( s_chat_proposed ) {
case 'opened' :
is_ok = spa.chat.setSliderPosition( 'opened' );
break;
case 'closed' :
is_ok = spa.chat.setSliderPosition( 'closed' );
break;
default :
spa.chat.setSliderPosition( 'closed' );
delete anchor_map_proposed.chat;
$.uriAnchor.setAnchor( anchor_map_proposed, null, true );
}
}
// End adjust chat component if changed
// Begin revert anchor if slider change denied
if ( ! is_ok ) {
if ( anchor_map_previous ) {
$.uriAnchor.setAnchor( anchor_map_previous, null, true );
stateMap.anchor_map = anchor_map_previous;
}
else {
delete anchor_map_proposed.chat;
$.uriAnchor.setAnchor( anchor_map_proposed, null, true );
}
}
// End revert anchor if slider change denied
return false;
};
// End Event handler /onHashchange/
// Begin Event handler /onResize/
onResize = function () {
if ( stateMap.resize_idto ) { return true; }
spa.chat.handleResize();
stateMap.resize_idto = setTimeout(
function () { stateMap.resize_idto = undefined; },
configMap.resize_interval
);
return true;
};
// End Event handler /onResize/
onTapAcct = function ( event ) {
var acct_text, user_name, user = spa.model.people.get_user();
if ( user.get_is_anon() ) {
user_name = prompt( 'Please sign-in' );
spa.model.people.login( user_name );
jqueryMap.$acct.text( '... processing ...' );
}
else {
spa.model.people.logout();
}
return false;
};
onLogin = function ( event, login_user ) {
jqueryMap.$acct.text( login_user.name );
};
onLogout = function ( event, logout_user ) {
jqueryMap.$acct.text( 'Please sign-in' );
};
//-------------------- END EVENT HANDLERS --------------------
//---------------------- BEGIN CALLBACKS ---------------------
// Begin callback method /setChatAnchor/
// Example : setChatAnchor( 'closed' );
// Purpose : Change the chat component of the anchor
// Arguments:
// * position_type - may be 'closed' or 'opened'
// Action :
// Changes the URI anchor parameter 'chat' to the requested
// value if possible.
// Returns :
// * true - requested anchor part was updated
// * false - requested anchor part was not updated
// Throws : none
//
setChatAnchor = function ( position_type ) {
return changeAnchorPart({ chat : position_type });
};
// End callback method /setChatAnchor/
//----------------------- END CALLBACKS ----------------------
//------------------- BEGIN PUBLIC METHODS -------------------
// Begin Public method /initModule/
// Example : spa.shell.initModule( $('#app_div_id') );
// Purpose :
// Directs the Shell to offer its capability to the user
// Arguments :
// * $container (example: $('#app_div_id')).
// A jQuery collection that should represent
// a single DOM container
// Action :
// Populates $container with the shell of the UI
// and then configures and initializes feature modules.
// The Shell is also responsible for browser-wide issues
// such as URI anchor and cookie management
// Returns : none
// Throws : none
//
initModule = function ( $container ) {
// load HTML and map jQuery collections
stateMap.$container = $container;
$container.html( configMap.main_html );
setJqueryMap();
// configure uriAnchor to use our schema
$.uriAnchor.configModule({
schema_map : configMap.anchor_schema_map
});
// configure and initialize feature modules
spa.chat.configModule({
set_chat_anchor : setChatAnchor,
chat_model : spa.model.chat,
people_model : spa.model.people
});
spa.chat.initModule( jqueryMap.$container );
spa.avtr.configModule({
chat_model : spa.model.chat,
people_model : spa.model.people
});
spa.avtr.initModule( jqueryMap.$nav );
// Handle URI anchor change events.
// This is done /after/ all feature modules are configured
// and initialized, otherwise they will not be ready to handle
// the trigger event, which is used to ensure the anchor
// is considered on-load
//
$(window)
.bind( 'resize', onResize )
.bind( 'hashchange', onHashchange )
.trigger( 'hashchange' );
$.gevent.subscribe( $container, 'spa-login', onLogin );
$.gevent.subscribe( $container, 'spa-logout', onLogout );
jqueryMap.$acct
.text( 'Please sign-in')
.bind( 'utap', onTapAcct );
};
// End PUBLIC method /initModule/
return { initModule : initModule };
//------------------- END PUBLIC METHODS ---------------------
}());
|
txemis/txemis.github.io
|
spa/spa/js/spa.shell.js
|
JavaScript
|
mit
| 10,378
|
/*!
* CanJS - 2.0.4
* http://canjs.us/
* Copyright (c) 2013 Bitovi
* Mon, 23 Dec 2013 19:49:14 GMT
* Licensed MIT
* Includes: CanJS default build
* Download from: http://canjs.us/
*/
steal('can/util','can/construct', function( can ) {
// ## control.js
// `can.Control`
// _Controller_
// Binds an element, returns a function that unbinds.
var bind = function( el, ev, callback ) {
can.bind.call( el, ev, callback );
return function() {
can.unbind.call(el, ev, callback);
};
},
isFunction = can.isFunction,
extend = can.extend,
each = can.each,
slice = [].slice,
paramReplacer = /\{([^\}]+)\}/g,
special = can.getObject("$.event.special", [can]) || {},
// Binds an element, returns a function that unbinds.
delegate = function( el, selector, ev, callback ) {
can.delegate.call(el, selector, ev, callback);
return function() {
can.undelegate.call(el, selector, ev, callback);
};
},
// Calls bind or unbind depending if there is a selector.
binder = function( el, ev, callback, selector ) {
return selector ?
delegate( el, can.trim( selector ), ev, callback ) :
bind( el, ev, callback );
},
basicProcessor;
var Control = can.Control = can.Construct(
/**
* @add can.Control
*/
//
/**
* @static
*/
{
// Setup pre-processes which methods are event listeners.
/**
* @hide
*
* Setup pre-process which methods are event listeners.
*
*/
setup: function() {
// Allow contollers to inherit "defaults" from super-classes as it
// done in `can.Construct`
can.Construct.setup.apply( this, arguments );
// If you didn't provide a name, or are `control`, don't do anything.
if ( can.Control ) {
// Cache the underscored names.
var control = this,
funcName;
// Calculate and cache actions.
control.actions = {};
for ( funcName in control.prototype ) {
if ( control._isAction(funcName) ) {
control.actions[funcName] = control._action(funcName);
}
}
}
},
// Moves `this` to the first argument, wraps it with `jQuery` if it's an element
_shifter : function( context, name ) {
var method = typeof name == "string" ? context[name] : name;
if ( ! isFunction( method )) {
method = context[ method ];
}
return function() {
context.called = name;
return method.apply(context, [this.nodeName ? can.$(this) : this].concat( slice.call(arguments, 0)));
};
},
// Return `true` if is an action.
/**
* @hide
* @param {String} methodName a prototype function
* @return {Boolean} truthy if an action or not
*/
_isAction: function( methodName ) {
var val = this.prototype[methodName],
type = typeof val;
// if not the constructor
return (methodName !== 'constructor') &&
// and is a function or links to a function
( type == "function" || (type == "string" && isFunction(this.prototype[val] ) ) ) &&
// and is in special, a processor, or has a funny character
!! ( special[methodName] || processors[methodName] || /[^\w]/.test(methodName) );
},
// Takes a method name and the options passed to a control
// and tries to return the data necessary to pass to a processor
// (something that binds things).
/**
* @hide
* Takes a method name and the options passed to a control
* and tries to return the data necessary to pass to a processor
* (something that binds things).
*
* For performance reasons, this called twice. First, it is called when
* the Control class is created. If the methodName is templated
* like: "{window} foo", it returns null. If it is not templated
* it returns event binding data.
*
* The resulting data is added to this.actions.
*
* When a control instance is created, _action is called again, but only
* on templated actions.
*
* @param {Object} methodName the method that will be bound
* @param {Object} [options] first param merged with class default options
* @return {Object} null or the processor and pre-split parts.
* The processor is what does the binding/subscribing.
*/
_action: function( methodName, options ) {
// If we don't have options (a `control` instance), we'll run this
// later.
paramReplacer.lastIndex = 0;
if ( options || ! paramReplacer.test( methodName )) {
// If we have options, run sub to replace templates `{}` with a
// value from the options or the window
var convertedName = options ? can.sub(methodName, this._lookup(options)) : methodName;
if(!convertedName) {
return null;
}
// If a `{}` template resolves to an object, `convertedName` will be
// an array
var arr = can.isArray(convertedName),
// Get the name
name = arr ? convertedName[1] : convertedName,
// Grab the event off the end
parts = name.split(/\s+/g),
event = parts.pop();
return {
processor: processors[event] || basicProcessor,
parts: [name, parts.join(" "), event],
delegate : arr ? convertedName[0] : undefined
};
}
},
_lookup: function(options){
return [options, window]
},
// An object of `{eventName : function}` pairs that Control uses to
// hook up events auto-magically.
/**
* @property {Object.<can.Control.processor>} can.Control.processors processors
* @parent can.Control.static
*
* @description A collection of hookups for custom events on Controls.
*
* @body
* `processors` is an object that allows you to add new events to bind
* to on a control, or to change how existent events are bound. Each
* key-value pair of `processors` is a specification that pertains to
* an event where the key is the name of the event, and the value is
* a function that processes calls to bind to the event.
*
* The processor function takes five arguments:
*
* - _el_: The Control's element.
* - _event_: The event type.
* - _selector_: The selector preceding the event in the binding used on the Control.
* - _callback_: The callback function being bound.
* - _control_: The Control the event is bound on.
*
* Inside your processor function, you should bind _callback_ to the event, and
* return a function for can.Control to call when _callback_ needs to be unbound.
* (If _selector_ is defined, you will likely want to use some form of delegation
* to bind the event.)
*
* Here is a Control with a custom event processor set and two callbacks bound
* to that event:
*
* @codestart
* can.Control.processors.birthday = function(el, ev, selector, callback, control) {
* if(selector) {
* myFramework.delegate(ev, el, selector, callback);
* return function() { myFramework.undelegate(ev, el, selector, callback); };
* } else {
* myFramework.bind(ev, el, callback);
* return function() { myFramework.unbind(ev, el, callback); };
* }
* };
*
* can.Control("EventTarget", { }, {
* 'birthday': function(el, ev) {
* // do something appropriate for the occasion
* },
* '.grandchild birthday': function(el, ev) {
* // do something appropriate for the occasion
* }
* });
*
* var target = new EventTarget('#person');
* @codeend
*
* When `target` is initialized, can.Control will call `can.Control.processors.birthday`
* twice (because there are two event hookups for the _birthday_ event). The first
* time it's called, the arguments will be:
*
* - _el_: A NodeList that wraps the element with id 'person'.
* - _ev_: `'birthday'`
* - _selector_: `''`
* - _callback_: The function assigned to `' birthday'` in the prototype section of `EventTarget`'s
* definition.
* - _control_: `target` itself.
*
* The second time, the arguments are slightly different:
*
* - _el_: A NodeList that wraps the element with id 'person'.
* - _ev_: `'birthday'`
* - _selector_: `'.grandchild'`
* - _callback_: The function assigned to `'.grandchild birthday'` in the prototype section of `EventTarget`'s
* definition.
* - _control_: `target` itself.
*
* can.Control already has processors for these events:
*
* - change
* - click
* - contextmenu
* - dblclick
* - focusin
* - focusout
* - keydown
* - keyup
* - keypress
* - mousedown
* - mouseenter
* - mouseleave
* - mousemove
* - mouseout
* - mouseover
* - mouseup
* - reset
* - resize
* - scroll
* - select
* - submit
*/
processors: {},
// A object of name-value pairs that act as default values for a
// control instance
defaults: {}
/**
* @property {Object} can.Control.defaults defaults
* @parent can.Control.static
* @description Default values for the Control's options.
*
* @body
* `defaults` provides default values for a Control's options.
* Options passed into the constructor function will be shallowly merged
* into the values from defaults in [can.Control::setup], and
* the result will be stored in [can.Control::options this.options].
*
* Message = can.Control.extend({
* defaults: {
* message: "Hello World"
* }
* }, {
* init: function(){
* this.element.text( this.options.message );
* }
* });
*
* new Message( "#el1" ); //writes "Hello World"
* new Message( "#el12", { message: "hi" } ); //writes hi
*/
},
{
/**
* @prototype
*/
// Sets `this.element`, saves the control in `data, binds event
// handlers.
/**
* @property {NodeList} can.Control.prototype.element element
* @parent can.Control.prototype
* @description The element associated with this control.
*
* @body
* The library-wrapped element this control is associated with,
* as passed into the constructor. If you want to change the element
* that a Control will attach to, you should do it in [can.Control::setup setup].
* If you change the element later, make sure to call [can.Control::on on]
* to rebind all the bindings.
*
* If `element` is removed from the DOM, [can.Control::destroy] will
* be called and the Control will be destroyed.
*/
//
/**
* @function can.Control.prototype.setup setup
* @parent can.Control.prototype
* @description Perform pre-initialization logic.
* @signature `control.setup(element, options)`
* @param {HTMLElement|NodeList|String} element The element as passed to the constructor.
* @param {Object} [options] option values for the control. These get added to
* this.options and merged with [can.Control.static.defaults defaults].
* @return {undefined|Array} return an array if you want to change what init is called with. By
* default it is called with the element and options passed to the control.
*
* @body
* Setup is where most of control's magic happens. It does the following:
*
* ### Sets this.element
*
* The first parameter passed to new Control( el, options ) is expected to be
* an element. This gets converted to a Wrapped NodeList element and set as
* [can.Control.prototype.element this.element].
*
* ### Adds the control's name to the element's className
*
* Control adds it's plugin name to the element's className for easier
* debugging. For example, if your Control is named "Foo.Bar", it adds
* "foo_bar" to the className.
*
* ### Saves the control in $.data
*
* A reference to the control instance is saved in $.data. You can find
* instances of "Foo.Bar" like:
*
* $( '#el' ).data( 'controls' )[ 'foo_bar' ]
*
* ### Merges Options
* Merges the default options with optional user-supplied ones.
* Additionally, default values are exposed in the static [can.Control.static.defaults defaults]
* so that users can change them.
*
* ### Binds event handlers
*
* Setup does the event binding described in [can.Control].
*/
setup: function( element, options ) {
var cls = this.constructor,
pluginname = cls.pluginName || cls._fullName,
arr;
// Want the raw element here.
this.element = can.$(element)
if ( pluginname && pluginname !== 'can_control') {
// Set element and `className` on element.
this.element.addClass(pluginname);
}
(arr = can.data(this.element,"controls")) || can.data(this.element,"controls",arr = []);
arr.push(this);
// Option merging.
/**
* @property {Object} can.Control.prototype.options options
* @parent can.Control.prototype
*
* @description
*
* Options used to configure a control.
*
* @body
*
* The `this.options` property is an Object that contains
* configuration data passed to a control when it is
* created (`new can.Control(element, options)`).
*
* In the following example, an options object with
* a message is passed to a `Greeting` control. The
* `Greeting` control changes the text of its [can.Control::element element]
* to the options' message value.
*
* var Greeting = can.Control.extend({
* init: function(){
* this.element.text( this.options.message )
* }
* })
*
* new Greeting("#greeting",{message: "I understand this.options"})
*
* The options argument passed when creating the control
* is merged with [can.Control.defaults defaults] in
* [can.Control.prototype.setup setup].
*
* In the following example, if no message property is provided,
* the defaults' message property is used.
*
* var Greeting = can.Control.extend({
* defaults: {
* message: "Defaults merged into this.options"
* }
* },{
* init: function(){
* this.element.text( this.options.message )
* }
* })
*
* new Greeting("#greeting")
*
*/
this.options = extend({}, cls.defaults, options);
// Bind all event handlers.
this.on();
// Gets passed into `init`.
/**
* @property {can.NodeList} can.Control.prototype.element element
*
* @description The element the Control is associated with.
*
* @parent can.Control.prototype
*
* @body
*
* The control instance's HTMLElement (or window) wrapped by the
* util library for ease of use. It is set by the first
* parameter to `new can.Construct( element, options )`
* in [can.Control::setup]. By default, a control listens to events on `this.element`.
*
* ### Quick Example
*
* The following `HelloWorld` control sets the control`s text to "Hello World":
*
* HelloWorld = can.Control({
* init: function(){
* this.element.text( 'Hello World' );
* }
* });
*
* // create the controller on the element
* new HelloWorld( document.getElementById( '#helloworld' ) );
*
* ## Wrapped NodeList
*
* `this.element` is a wrapped NodeList of one HTMLELement (or window). This
* is for convenience in libraries like jQuery where all methods operate only on a
* NodeList. To get the raw HTMLElement, write:
*
* this.element[0] //-> HTMLElement
*
* The following details the NodeList used by each library with
* an example of updating its text:
*
* __jQuery__ `jQuery( HTMLElement )`
*
* this.element.text("Hello World")
*
* __Zepto__ `Zepto( HTMLElement )`
*
* this.element.text("Hello World")
*
* __Dojo__ `new dojo.NodeList( HTMLElement )`
*
* this.element.text("Hello World")
*
* __Mootools__ `$$( HTMLElement )`
*
* this.element.empty().appendText("Hello World")
*
* __YUI__
*
* this.element.set("text", "Hello World")
*
*
* ## Changing `this.element`
*
* Sometimes you don't want what's passed to `new can.Control`
* to be this.element. You can change this by overwriting
* setup or by unbinding, setting this.element, and rebinding.
*
* ### Overwriting Setup
*
* The following Combobox overwrites setup to wrap a
* select element with a div. That div is used
* as `this.element`. Notice how `destroy` sets back the
* original element.
*
* Combobox = can.Control({
* setup: function( el, options ) {
* this.oldElement = $( el );
* var newEl = $( '<div/>' );
* this.oldElement.wrap( newEl );
* can.Control.prototype.setup.call( this, newEl, options );
* },
* init: function() {
* this.element //-> the div
* },
* ".option click": function() {
* // event handler bound on the div
* },
* destroy: function() {
* var div = this.element; //save reference
* can.Control.prototype.destroy.call( this );
* div.replaceWith( this.oldElement );
* }
* });
*
* ### unbinding, setting, and rebinding.
*
* You could also change this.element by calling
* [can.Control::off], setting this.element, and
* then calling [can.Control::on] like:
*
* move: function( newElement ) {
* this.off();
* this.element = $( newElement );
* this.on();
* }
*/
return [this.element, this.options];
},
/**
* @function can.Control.prototype.on on
* @parent can.Control.prototype
*
* @description Bind an event handler to a Control, or rebind all event handlers on a Control.
*
* @signature `control.on([el,] selector, eventName, func)`
* @param {HTMLElement|jQuery collection|Object} [el=this.element]
* The element to be bound. If no element is provided, the control's element is used instead.
* @param {CSSSelectorString} selector A css selector for event delegation.
* @param {String} eventName The event to listen for.
* @param {Function|String} func A callback function or the String name of a control function. If a control
* function name is given, the control function is called back with the bound element and event as the first
* and second parameter. Otherwise the function is called back like a normal bind.
* @return {Number} The id of the binding in this._bindings
*
* @body
* `on(el, selector, eventName, func)` binds an event handler for an event to a selector under the scope of the given element.
*
* @signature `control.on()`
*
* Rebind all of a control's event handlers.
*
* @return {Number} The number of handlers bound to this Control.
*
* @body
* `this.on()` is used to rebind
* all event handlers when [can.Control::options this.options] has changed. It
* can also be used to bind or delegate from other elements or objects.
*
* ## Rebinding
*
* By using templated event handlers, a control can listen to objects outside
* `this.element`. This is extremely common in MVC programming. For example,
* the following control might listen to a task model's `completed` property and
* toggle a strike className like:
*
* TaskStriker = can.Control({
* "{task} completed": function(){
* this.update();
* },
* update: function(){
* if ( this.options.task.completed ) {
* this.element.addClass( 'strike' );
* } else {
* this.element.removeClass( 'strike' );
* }
* }
* });
*
* var taskstriker = new TaskStriker({
* task: new Task({ completed: 'true' })
* });
*
* To update the `taskstriker`'s task, add a task method that updates
* this.options and rebinds the event handlers for the new task like:
*
* TaskStriker = can.Control({
* "{task} completed": function(){
* this.update();
* },
* update: function() {
* if ( this.options.task.completed ) {
* this.element.addClass( 'strike' );
* } else {
* this.element.removeClass( 'strike' );
* }
* },
* task: function( newTask ) {
* this.options.task = newTask;
* this.on();
* this.update();
* }
* });
*
* var taskstriker = new TaskStriker({
* task: new Task({ completed: true })
* });
* taskstriker.task( new TaskStriker({
* task: new Task({ completed: false })
* }));
*
* ## Adding new events
*
* If events need to be bound to outside of the control and templated event handlers
* are not sufficient, you can call this.on to bind or delegate programmatically:
*
* init: function() {
* // calls somethingClicked( el, ev )
* this.on( 'click', 'somethingClicked' );
*
* // calls function when the window is clicked
* this.on( window, 'click', function( ev ) {
* //do something
* });
* },
* somethingClicked: function( el, ev ) {
*
* }
*/
on: function( el, selector, eventName, func ) {
if ( ! el ) {
// Adds bindings.
this.off();
// Go through the cached list of actions and use the processor
// to bind
var cls = this.constructor,
bindings = this._bindings,
actions = cls.actions,
element = this.element,
destroyCB = can.Control._shifter(this,"destroy"),
funcName, ready;
for ( funcName in actions ) {
// Only push if we have the action and no option is `undefined`
if ( actions.hasOwnProperty( funcName ) &&
(ready = actions[funcName] || cls._action(funcName, this.options))) {
bindings.push(ready.processor(ready.delegate || element,
ready.parts[2], ready.parts[1], funcName, this));
}
}
// Setup to be destroyed...
// don't bind because we don't want to remove it.
can.bind.call(element,"removed", destroyCB);
bindings.push(function( el ) {
can.unbind.call(el,"removed", destroyCB);
});
return bindings.length;
}
if ( typeof el == 'string' ) {
func = eventName;
eventName = selector;
selector = el;
el = this.element;
}
if(func === undefined) {
func = eventName;
eventName = selector;
selector = null;
}
if ( typeof func == 'string' ) {
func = can.Control._shifter(this,func);
}
this._bindings.push( binder( el, eventName, func, selector ));
return this._bindings.length;
},
// Unbinds all event handlers on the controller.
/**
* @hide
* Unbinds all event handlers on the controller. You should never
* be calling this unless in use with [can.Control::on].
*/
off : function(){
var el = this.element[0];
each(this._bindings || [], function( value ) {
value(el);
});
// Adds bindings.
this._bindings = [];
},
// Prepares a `control` for garbage collection
/**
* @description Remove a Control from an element and clean up the Control.
* @signature `control.destroy()`
*
* Prepares a control for garbage collection and is a place to
* reset any changes the control has made.
*
* @function can.Control.prototype.destroy destroy
* @parent can.Control.prototype
*
* @body
*
*
* ## Allowing Garbage Collection
*
* Destroy is called whenever a control's element is removed from the page using
* the library's standard HTML modifier methods. This means that you
* don't have to call destroy yourself and it
* will be called automatically when appropriate.
*
* The following `Clicker` widget listens on the window for clicks and updates
* its element's innerHTML. If we remove the element, the window's event handler
* is removed auto-magically:
*
*
* Clickr = can.Control({
* "{window} click": function() {
* this.element.html( this.count ?
* this.count++ : this.count = 0 );
* }
* });
*
* // create a clicker on an element
* new Clicker( "#clickme" );
*
* // remove the element
* $( '#clickme' ).remove();
*
*
* The methods you can use that will destroy controls automatically by library:
*
* __jQuery and Zepto__
*
* - $.fn.remove
* - $.fn.html
* - $.fn.replaceWith
* - $.fn.empty
*
* __Dojo__
*
* - dojo.destroy
* - dojo.empty
* - dojo.place (with the replace option)
*
* __Mootools__
*
* - Element.prototype.destroy
*
* __YUI__
*
* - Y.Node.prototype.remove
* - Y.Node.prototype.destroy
*
*
* ## Teardown in Destroy
*
* Sometimes, you want to reset a controlled element back to its
* original state when the control is destroyed. Overwriting destroy
* lets you write teardown code of this manner. __When overwriting
* destroy, make sure you call Control's base functionality__.
*
* The following example changes an element's text when the control is
* created and sets it back when the control is removed:
*
* Changer = can.Control.extend({
* init: function() {
* this.oldText = this.element.text();
* this.element.text( "Changed!!!" );
* },
* destroy: function() {
* this.element.text( this.oldText );
* can.Control.prototype.destroy.call( this );
* }
* });
*
* // create a changer which changes #myel's text
* var changer = new Changer( '#myel' );
*
* // destroy changer which will reset it
* changer.destroy();
*
* ## Base Functionality
*
* Control prepares the control for garbage collection by:
*
* - unbinding all event handlers
* - clearing references to this.element and this.options
* - clearing the element's reference to the control
* - removing it's [can.Control.pluginName] from the element's className
*
*/
destroy: function() {
//Control already destroyed
if(this.element === null) {
//!steal-remove-start
steal.dev.warn("Control.js - Control already destroyed");
//!steal-remove-end
return;
}
var Class = this.constructor,
pluginName = Class.pluginName || Class._fullName,
controls;
// Unbind bindings.
this.off();
if(pluginName && pluginName !== 'can_control'){
// Remove the `className`.
this.element.removeClass(pluginName);
}
// Remove from `data`.
controls = can.data(this.element,"controls");
controls.splice(can.inArray(this, controls),1);
can.trigger( this, "destroyed"); // In case we want to know if the `control` is removed.
this.element = null;
}
});
var processors = can.Control.processors,
// Processors do the binding.
// They return a function that unbinds when called.
//
// The basic processor that binds events.
basicProcessor = function( el, event, selector, methodName, control ) {
return binder( el, event, can.Control._shifter(control, methodName), selector);
};
// Set common events to be processed as a `basicProcessor`
each(["change", "click", "contextmenu", "dblclick", "keydown", "keyup",
"keypress", "mousedown", "mousemove", "mouseout", "mouseover",
"mouseup", "reset", "resize", "scroll", "select", "submit", "focusin",
"focusout", "mouseenter", "mouseleave",
// #104 - Add touch events as default processors
// TOOD feature detect?
"touchstart", "touchmove", "touchcancel", "touchend", "touchleave"
], function( v ) {
processors[v] = basicProcessor;
});
return Control;
});
|
shiftplanning/foxydb
|
public/can/control/control.js
|
JavaScript
|
mit
| 27,976
|
#ifndef wren_h
#define wren_h
#include <stdlib.h>
#include <stdint.h>
typedef struct WrenVM WrenVM;
// A generic allocation function that handles all explicit memory management
// used by Wren. It's used like so:
//
// - To allocate new memory, [memory] is NULL and [oldSize] is zero. It should
// return the allocated memory or NULL on failure.
//
// - To attempt to grow an existing allocation, [memory] is the memory,
// [oldSize] is its previous size, and [newSize] is the desired size.
// It should return [memory] if it was able to grow it in place, or a new
// pointer if it had to move it.
//
// - To shrink memory, [memory], [oldSize], and [newSize] are the same as above
// but it will always return [memory].
//
// - To free memory, [memory] will be the memory to free and [newSize] and
// [oldSize] will be zero. It should return NULL.
typedef void* (*WrenReallocateFn)(void* memory, size_t oldSize, size_t newSize);
typedef void (*WrenForeignMethodFn)(WrenVM* vm);
typedef struct
{
// The callback Wren will use to allocate, reallocate, and deallocate memory.
//
// If `NULL`, defaults to a built-in function that uses `realloc` and `free`.
WrenReallocateFn reallocateFn;
// The number of bytes Wren will allocate before triggering the first garbage
// collection.
//
// If zero, defaults to 10MB.
size_t initialHeapSize;
// After a collection occurs, the threshold for the next collection is
// determined based on the number of bytes remaining in use. This allows Wren
// to shrink its memory usage automatically after reclaiming a large amount
// of memory.
//
// This can be used to ensure that the heap does not get too small, which can
// in turn lead to a large number of collections afterwards as the heap grows
// back to a usable size.
//
// If zero, defaults to 1MB.
size_t minHeapSize;
// Wren will grow (and shrink) the heap automatically as the number of bytes
// remaining in use after a collection changes. This number determines the
// amount of additional memory Wren will use after a collection, as a
// percentage of the current heap size.
//
// For example, say that this is 50. After a garbage collection, Wren there
// are 400 bytes of memory still in use. That means the next collection will
// be triggered after a total of 600 bytes are allocated (including the 400
// already in use.
//
// Setting this to a smaller number wastes less memory, but triggers more
// frequent garbage collections.
//
// If zero, defaults to 50.
int heapGrowthPercent;
} WrenConfiguration;
typedef enum {
WREN_RESULT_SUCCESS,
WREN_RESULT_COMPILE_ERROR,
WREN_RESULT_RUNTIME_ERROR
} WrenInterpretResult;
// Creates a new Wren virtual machine using the given [configuration]. Wren
// will copy the configuration data, so the argument passed to this can be
// freed after calling this. If [configuration] is `NULL`, uses a default
// configuration.
WrenVM* wrenNewVM(WrenConfiguration* configuration);
// Disposes of all resources is use by [vm], which was previously created by a
// call to [wrenNewVM].
void wrenFreeVM(WrenVM* vm);
// Runs [source], a string of Wren source code in a new fiber in [vm].
WrenInterpretResult wrenInterpret(WrenVM* vm, const char* sourcePath,
const char* source);
// Defines a foreign method implemented by the host application. Looks for a
// global class named [className] to bind the method to. If not found, it will
// be created automatically.
//
// Defines a method on that class named [methodName] accepting [numParams]
// parameters. If a method already exists with that name and arity, it will be
// replaced. When invoked, the method will call [method].
void wrenDefineMethod(WrenVM* vm, const char* className,
const char* methodName, int numParams,
WrenForeignMethodFn method);
// Defines a static foreign method implemented by the host application. Looks
// for a global class named [className] to bind the method to. If not found, it
// will be created automatically.
//
// Defines a static method on that class named [methodName] accepting
// [numParams] parameters. If a method already exists with that name and arity,
// it will be replaced. When invoked, the method will call [method].
void wrenDefineStaticMethod(WrenVM* vm, const char* className,
const char* methodName, int numParams,
WrenForeignMethodFn method);
// Reads an numeric argument for a foreign call. This must only be called within
// a function provided to [wrenDefineMethod]. Retrieves the argument at [index]
// which ranges from 0 to the number of parameters the method expects - 1.
double wrenGetArgumentDouble(WrenVM* vm, int index);
// Reads an string argument for a foreign call. This must only be called within
// a function provided to [wrenDefineMethod]. Retrieves the argument at [index]
// which ranges from 0 to the number of parameters the method expects - 1.
//
// The memory for the returned string is owned by Wren. You can inspect it
// while in your foreign function, but cannot keep a pointer to it after the
// function returns, since the garbage collector may reclaim it.
const char* wrenGetArgumentString(WrenVM* vm, int index);
// Provides a numeric return value for a foreign call. This must only be called
// within a function provided to [wrenDefineMethod]. Once this is called, the
// foreign call is done, and no more arguments can be read or return calls made.
void wrenReturnDouble(WrenVM* vm, double value);
// Provides a null return value for a foreign call. This must only be called
// within a function provided to [wrenDefineMethod]. Once this is called, the
// foreign call is done, and no more arguments can be read or return calls made.
void wrenReturnNull(WrenVM* vm);
// Provides a string return value for a foreign call. This must only be called
// within a function provided to [wrenDefineMethod]. Once this is called, the
// foreign call is done, and no more arguments can be read or return calls made.
//
// The [text] will be copied to a new string within Wren's heap, so you can
// free memory used by it after this is called. If [length] is non-zero, Wren
// will copy that many bytes from [text]. If it is -1, then the length of
// [text] will be calculated using `strlen()`.
void wrenReturnString(WrenVM* vm, const char* text, int length);
#endif
|
1100110/wren
|
include/wren.h
|
C
|
mit
| 6,470
|
package de.university.neueVersion.exceptions;
/**
* @author Anastasia Baron
* @author Dmitry Petrov
*/
public class NotEnoughMoneyException extends MeineException {
public NotEnoughMoneyException() {
System.out.println("");
System.out.println("Sie haben nicht genug Geld zum abheben");
}
}
|
dmpe/Homeworks2
|
Aufgabe1/src/de/university/neueVersion/exceptions/NotEnoughMoneyException.java
|
Java
|
mit
| 305
|
# timecoco
##项目概况
timecoco 是一个针对 iOS 手机平台开发的轻量级的__纯文字__日记 App 项目,timecoco 项目的目标是:作为一个纯文字日记 App,尽可能的让操作简化、界面简单、运行稳定、性能良好的同时,也提供一些确实可以带来方便但是不会显得太过笨重的功能。而这其中有不少的功能点(比如跨时区支持等)是类似彩蛋一般的存在,也许只有在长期的使用中才会发现,当然,如果你看源代码可以很早就发现。
timecoco 支持的 iOS 系统版本最低为 iOS 8.0。
##当前版本与进度
1.0版本的主要功能划分以及进度列表:
功能|进度
:----------- | :-----------:
添加和展示日记|完成
编辑和删除日记|完成
通知中心控件|完成
日记备份功能|取消
标签的支持|完成
用于社交分享用的当日日记图片生成导出功能|完成
搜索功能|完成
活跃日历|取消
设置中心|暂停
公司项目忙碌,加上可能要针对目前的功能做比较大的改动,这个库可能采用分支更新新功能。
请期待新版!
|
chd123456/timecoco
|
README.md
|
Markdown
|
mit
| 1,138
|
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import pageComponent from 'code-corps-ember/tests/pages/components/submittable-textarea';
import PageObject from 'ember-cli-page-object';
let page = PageObject.create(pageComponent);
function setHandler(context, modifiedSubmitHandler = () => {}) {
context.set('modifiedSubmitHandler', modifiedSubmitHandler);
}
moduleForComponent('submittable-textarea', 'Integration | Component | submittable textarea', {
integration: true,
beforeEach() {
page.setContext(this);
setHandler(this);
},
afterEach() {
page.removeContext();
}
});
// This test is necessary because a new line after yield in the file will
// cause a new line in the textarea itself
test('it has no extra content when created', function(assert) {
this.render(hbs`{{submittable-textarea modifiedSubmit=modifiedSubmitHandler}}`);
assert.equal(page.value, '', 'Element is blank.');
});
test('it sends the modifiedSubmit action on command/ctrl + enter', function(assert) {
assert.expect(1);
setHandler(this, () => {
assert.equal(page.value, '', 'Action was called. Input content was unchanged.');
});
this.render(hbs`{{submittable-textarea modifiedSubmit=modifiedSubmitHandler}}`);
page.keySubmit();
});
|
code-corps/code-corps-ember
|
tests/integration/components/submittable-textarea-test.js
|
JavaScript
|
mit
| 1,312
|
"use strict";
var patient = (function () {
function patient() {
}
return patient;
}());
exports.patient = patient;
//# sourceMappingURL=character.model.js.map
|
vicqs/ne
|
src/app/models/character.model.js
|
JavaScript
|
mit
| 170
|
package com.example.boot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* The Spring Boot Foody Application.
* <p>
* This class provides the main method to launch the Spring Boot Foody
* Application. The default configuration:
* <ol>
* <li>Launches Server on Port 8083</li>
* <li>Searches for a ZooKeeper instance on Port 2181</li>
* <li>Registers the Services on this Application with ZooKeeper under the name
* <b>foody</b></li>
* </p>
* <p>
* The Foody Application launches a simple REST<i>ful</i> service to indicate
* whether or not the foody's favorite diner is open on a day.
* </p>
*
* @author sumiyapathak
*
*/
@SpringBootApplication
public class FoodyApplication {
/**
* Launch the Foody Application.
*
* @param args
*/
public static void main(String[] args) {
SpringApplication.run(FoodyApplication.class, args);
}
}
|
psumiya/spring-boot-zookeeper-example
|
foody/src/main/java/com/example/boot/FoodyApplication.java
|
Java
|
mit
| 944
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using AutoPoco.Configuration;
namespace AutoPoco.Tests.Integration.Configuration
{
[TestFixture]
public class ConfigurationBaseTest
{
public EngineConfigurationBuilder Builder
{
get;
private set;
}
[SetUp]
public void CreateBuilder()
{
this.Builder = new EngineConfigurationBuilder();
}
}
}
|
KCL5South/KCLAutoPoco
|
AutoPoco.Tests.Integration/Configuration/ConfigurationBaseTest.cs
|
C#
|
mit
| 519
|
/**
* @author Chong-U Lim <me@chongdashu.com>
* @copyright 2015 Chong-U Lim
* @module Core
*/
this.chongdashu = this.chongdashu||{};
(function() {
"use strict";
/**
* System represents a System of the Entity-Component-System Design
* paradigm.
*
* @class Core.System
* @constructor
**/
var System = function(nodeType) {
this.init(nodeType);
};
var p = System.prototype;
System.prototype.constructor = System;
/**
* Indicates if the system is currently enabled or not.
* If not enabled, no system or node updates will be performed.
* @property enabled
*
* @type boolean
* @default true
*/
p.enabled = false;
/**
* The priority of the current system. This is used by the
* {{#crossLink "Core.Engine"}}{{/crossLink}} to order the sequence of systems
* that it processes. Lower priority numbers are executed first.
*
* @property priority
* @type {integer}
* @default 0
*/
p.priority = 0;
/**
* An array of {{#crossLink "Core.Node"}}{{/crossLink}} objects that
* this system manages based on the {{#crossLink "Core.Node/Core.Node.TYPE:property"}}{{/crossLink}}
* @property nodes
* @type {Array}
*/
p.nodes = null;
/**
* The {{#crossLink "Core.Node/Core.Node.TYPE:property"}}{{/crossLink}} that this system
* will be responsible for.
* @property String
* @type Core.Node.TYPE
*/
p.nodeType = null;
p.engine = null;
/**
* The initialization method is called when the object is constructor.
*
* @method init
* @param {string} nodeType The type of the node. See {{#crossLink "Core.Node/Core.Node.TYPE:property"}}{{/crossLink}}.
*/
p.init = function(nodeType)
{
// console.log("[System], init()");
this.priority = 0;
this.enabled = true;
this.nodeType = nodeType;
};
/**
* The update loop of this system, as called by a given
* {{#crossLink "Core.Engine"}}{{/crossLink}}'s update loop.
* All related {{#crossLink "Core.Node"}}{{/crossLink}} objects are
* updated. Handling of each node individually can be performed
* by overriding the {{#crossLink "Core.System/updateNode:method"}}{{/crossLink}} method.
*
*
* @method update
*/
p.update = function(elapsed) {
var nodes = this.engine.getNodes(this.nodeType);
if (nodes) {
for (var i=0; i < nodes.length; i++) {
this.updateNode(nodes[i], elapsed);
}
}
};
/**
* @method updateNode
* @param {Core.Node} node The node to be updated
*/
p.updateNode = function(node) {
};
/**
* Callback method when this system is added to the engine.
*
* @method onEngineAdd
* @param {Core.Engine} engine reference to the {{#crossLink "Core.Engine"}}{{/crossLink}} object.
*/
p.onEngineAdd = function(engine) {
this.engine = engine;
};
/**
* Callback method when this system is removed from the engine.
*
* @method onEngineRemove
* @param {Core.Engine} engine reference to the {{#crossLink "Core.Engine"}}{{/crossLink}} object.
*/
p.onEngineRemove = function(engine) {
this.engine = null;
};
p.getType = function() {
return this.constructor.name;
};
// Link
// ----
chongdashu.System = System;
}());
|
chongdashu/phaser-game-template
|
src/chongdashu/Core/System.js
|
JavaScript
|
mit
| 3,417
|
/*******************************************************************************
* Copyright (c) 2013-2016 LAAS-CNRS (www.laas.fr)
* 7 Colonel Roche 31077 Toulouse - France
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* Thierry Monteil : Project manager, technical co-manager
* Mahdi Ben Alaya : Technical co-manager
* Samir Medjiah : Technical co-manager
* Khalil Drira : Strategy expert
* Guillaume Garzone : Developer
* François Aïssaoui : Developer
*
* New contributors :
*******************************************************************************/
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.04.15 at 03:56:27 PM CEST
//
package org.eclipse.om2m.commons.resource;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.eclipse.om2m.commons.constants.ShortName;
/**
* <p>
* Java class for scheduleEntries complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within
* this class.
*
* <pre>
* <complexType name="scheduleEntries">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="scheduleEntry" type="{http://www.onem2m.org/xml/protocols}scheduleEntry" maxOccurs="unbounded"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "scheduleEntries")
public class ScheduleEntries {
@XmlElement(required = true, name = ShortName.SCHEDULE_ENTRY)
protected List<String> scheduleEntry;
/**
* Gets the value of the scheduleEntry property.
*
* <p>
* This accessor method returns a reference to the live list, not a
* snapshot. Therefore any modification you make to the returned list will
* be present inside the JAXB object. This is why there is not a
* <CODE>set</CODE> method for the scheduleEntry property.
*
* <p>
* For example, to add a new item, do as follows:
*
* <pre>
* getScheduleEntry().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list {@link String }
*
*
*/
public List<String> getScheduleEntry() {
if (scheduleEntry == null) {
scheduleEntry = new ArrayList<String>();
}
return this.scheduleEntry;
}
}
|
huanpc/IoT-1
|
docker/oneM2M/CSE_IPE/org.eclipse.om2m/org.eclipse.om2m.commons/src/main/java/org/eclipse/om2m/commons/resource/ScheduleEntries.java
|
Java
|
mit
| 3,026
|
---
id: version-v6.0.0-local-state-management
title: Local State Management
original_id: local-state-management
---
Relay can be used to read and write local data, and act as a single source of truth for *all* data in your client application.
The Relay Compiler fully supports client-side extensions of the schema, which allows you to define local fields and types.
Table of Contents:
- [Extending the client schema](#extending-the-client-schema)
- [Querying local state](#querying-local-state)
- [Mutating local state](#mutating-local-state)
- [Initial local state](#initial-local-state)
## Extending the client schema
To extend the server schema, create a new `.graphql` file inside your `--src` directory.
Let's call it `./src/clientSchema.graphql`.
This schema describes what local data can be queried on the client.
It can even be used to extend an existing server schema.
For example, we can create a new type called `Note`:
```graphql
type Note {
ID: ID!
title: String
body: String
}
```
And then extend the server schema type `User`, with a list of `Note`, called `notes`.
```graphql
extend type User {
notes: [Note]
}
```
## Querying local state
Accessing local data is no different from querying your GraphQL server, although you are required to include atleast one server field in the query.
The field can be from the server schema, or it can be schema agnostic, like an introspection field (i.e. `__typename`).
Here, we use a [QueryRenderer](./query-renderer) to get the current `User` via the `viewer` field, along with their id, name and the local list of notes.
```javascript
// Example.js
import React from 'react';
import { QueryRenderer, graphql } from 'react-relay';
const renderQuery = ({error, props}) => {
if (error) {
return <div>{error.message}</div>;
} else if (props) {
return (
<div>
{props.viewer.notes.map(({id, title, body}) => (
<div key={id}>
{title}
</div>
<div key={id}>
{body}
</div>
))}
</div>
);
}
return <div>Loading</div>;
}
const Example = (props) => {
return (
<QueryRenderer
render={renderQuery}
environment={environment}
query={graphql`
query ExampleQuery {
viewer {
id
name
notes {
id
title
body
}
}
}
`}
/>
);
}
```
## Mutating local state
All local data lives in the [Relay Store](./relay-store).
Updating local state can be done with any `updater` function.
The `commitLocalUpdate` function is especially ideal for this, because writes to local state are usually executed outside of a mutation.
To build upon the previous example, let's try creating, updating and deleting a `Note` from the list of `notes` on `User`.
### Create
```javascript
import {commitLocalUpdate} from 'react-relay';
let tempID = 0;
function createUserNote() {
commitLocalUpdate(environment, store => {
const user = store.getRoot().getLinkedRecord('viewer');
const userNoteRecords = user.getLinkedRecords('notes') || [];
// Create a unique ID.
const dataID = `client:Note:${tempID++}`;
//Create a new note record.
const newNoteRecord = store.create(dataID, 'Note');
// Add the record to the user's list of notes.
user.setLinkedRecords([...userNoteRecords, newNoteRecord], 'notes');
});
}
```
Note that since this record will be rendered by the `ExampleQuery` in our `QueryRenderer`, the QueryRenderer will automatically retain this data so it isn't garbage collected.
If no component is rendering the local data and you want to manually retain it, you can do so by calling `environment.retain()`:
```javascript
// Tell Relay to retain the record so it isn't garbage collected
environment.retain({
dataID,
variables: {},
node: { selections: [] }
});
```
### Update
```javascript
import {commitLocalUpdate} from 'react-relay';
function updateUserNote(dataID, body, title) {
commitLocalUpdate(environment, store => {
const note = store.get(dataID);
note.setValue(body, 'body');
note.setValue(title, 'title')
});
}
```
### Delete
```javascript
import {commitLocalUpdate} from 'react-relay';
function deleteUserNote(dataID) {
commitLocalUpdate(environment, store => {
const user = store.getRoot().getLinkedRecord('viewer');
const userNoteRecords = user.getLinkedRecords('notes');
// Remove the note from the list of user notes.
const newUserNoteRecords = userNoteRecords.filter(x => x.getDataID() !== dataID);
// Delete the note from the store.
store.delete(dataID);
// Set the new list of notes.
user.setLinkedRecords(newUserNoteRecords, 'notes');
});
}
```
## Initial local state
All new client-side schema fields default to `undefined` value. Often however, you will want to set the initial state before querying local data.
You can use an updater function via `commitLocalUpdate` to prime local state.
```javascript
import {commitLocalUpdate} from 'react-relay';
commitLocalUpdate(environment, store => {
const user = store.getRoot().getLinkedRecord('viewer');
// initialize user notes to an empty array.
user.setLinkedRecords([], 'notes');
});
```
|
cpojer/relay
|
website/versioned_docs/version-v6.0.0/Modern-LocalStateManagement.md
|
Markdown
|
mit
| 5,304
|
. $PSScriptRoot\CommonServerPowerShell.ps1
$script:INTEGRATION_NAME = "EWS extension"
$script:COMMAND_PREFIX = "ews"
$script:INTEGRATION_ENTRY_CONTEXT = "EWS"
$script:JUNK_RULE_ENTRY_CONTEXT = "$script:INTEGRATION_ENTRY_CONTEXT.Rule.Junk(val.Email && val.Email == obj.Email)"
$script:MESSAGE_TRACE_ENTRY_CONTEXT = "$script:INTEGRATION_ENTRY_CONTEXT.MessageTrace(val.MessageId && val.MessageId == obj.MessageId)"
#### HELPER FUNCTIONS ####
function UpdateIntegrationContext([OAuth2DeviceCodeClient]$client) {
$integration_context = @{
"DeviceCode" = $client.device_code
"DeviceCodeExpiresIn" = $client.device_code_expires_in
"DeviceCodeCreationTime" = $client.device_code_creation_time
"AccessToken" = $client.access_token
"RefreshToken" = $client.refresh_token
"AccessTokenExpiresIn" = $client.access_token_expires_in
"AccessTokenCreationTime" = $client.access_token_creation_time
}
$Demisto.setIntegrationContext($integration_context)
<#
.DESCRIPTION
Update integration context from OAuth2DeviceCodeClient client
.EXAMPLE
UpdateIntegrationContext $client
.PARAMETER search_name
OAuth2DeviceCodeClient client.
#>
}
function CreateNewSession {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '', Scope = 'Function')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '', Scope = 'Function')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '', Scope = 'Function')]
param([string]$url, [string]$upn, [string]$password, [string]$bearer_token, [bool]$insecure, [bool]$proxy)
if ($password) {
$url = "$url/powershell-liveid"
}
else {
$url = "$url/powershell-liveid?BasicAuthToOAuthConversion=true"
}
if ($password) {
$credential = ConvertTo-SecureString "$password" -AsPlainText -Force
}
else {
$credential = ConvertTo-SecureString "Bearer $bearer_token" -AsPlainText -Force
}
$credential = New-Object System.Management.Automation.PSCredential($upn, $credential)
$session_option_params = @{
"SkipCACheck" = $insecure
"SkipCNCheck" = $insecure
}
$session_options = New-PSSessionOption @session_option_params
$sessions_params = @{
"ConfigurationName" = "Microsoft.Exchange"
"ConnectionUri" = $url
"Credential" = $credential
"Authentication" = "Basic"
"AllowRedirection" = $true
"SessionOption" = $session_options
}
$session = New-PSSession @sessions_params -WarningAction:SilentlyContinue
if (!$session) {
throw "Fail - establishing session to $url"
}
return $session
<#
.DESCRIPTION
Creates new PSSession using Oauth2.0 method.
.PARAMETER url
Exchange Online url.
.PARAMETER upn
User Principal Name (UPN) is the name of a system user in an email address format.
.PARAMETER password
Password is filled only if authentication method is basic auth.
.PARAMETER bearer_token
Valid bearer token value.
.EXAMPLE proxy
Wheter to user system proxy configuration or not.
.PARAMETER insecure
Wheter to trust any TLS/SSL Certificate) or not.
.EXAMPLE
CreateNewSession("outlook.com", "user@microsoft.com", "dfhsdkjhkjhvkdvbihsgiu")
.OUTPUTS
PSSession - PSSession object.
.LINK
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/new-pssession?view=powershell-7
https://docs.microsoft.com/en-us/powershell/partnercenter/multi-factor-auth?view=partnercenterps-3.0#exchange-online-powershell
#>
}
function ParseJunkRulesToEntryContext([PSObject]$raw_response) {
return @{
$script:JUNK_RULE_ENTRY_CONTEXT = @{
"MailboxOwnerId" = $raw_response.MailboxOwnerId
"Identity" = $raw_response.Identity
"BlockedSendersAndDomains" = $raw_response.BlockedSendersAndDomains
"TrustedRecipientsAndDomains" = $raw_response.TrustedRecipientsAndDomains
"TrustedSendersAndDomains" = $raw_response.TrustedSendersAndDomains
"TrustedListsOnly" = $raw_response.TrustedListsOnly
"ContactsTrusted" = $raw_response.ContactsTrusted
"Enabled" = $raw_response.Enabled
}
}
<#
.DESCRIPTION
Parse junk rules raw response.
.PARAMETER raw_response
Junk rules raw response.
.EXAMPLE
ParseJunkRulesToEntryContext $raw_response
.OUTPUTS
PSObject - entry context.
#>
}
function ParseMessageTraceToEntryContext([PSObject]$raw_response) {
$entry_context = @{}
if ($raw_response) {
$entry_context = @{
$script:MESSAGE_TRACE_ENTRY_CONTEXT = $raw_response | ForEach-Object {
@{
"MessageId" = $_.MessageId
"MessageTraceId" = $_.MessageTraceId
"Organization" = $_.Organization
"Received" = $_.Received
"RecipientAddress" = $_.RecipientAddress
"SenderAddress" = $_.SenderAddress
"Size" = $_.Size
"StartDate" = $_.StartDate
"EndDate" = $_.EndDate
"Status" = $_.Status
"Subject" = $_.Subject
"ToIP" = $_.ToIP
"FromIP" = $_.FromIP
"Index" = $_.Index
}
}
}
}
return $entry_context
<#
.DESCRIPTION
Parse message trace raw response.
.PARAMETER raw_response
Message trace raw response.
.EXAMPLE
ParseMessageTraceToEntryContext $raw_response
.OUTPUTS
PSObject - entry context.
#>
}
#### OAUTH2.0 CLIENT - DEVICE CODE FLOW #####
class OAuth2DeviceCodeClient {
[string]$application_id = "a0c73c16-a7e3-4564-9a95-2bdf47383716"
[string]$application_scope = "offline_access%20https%3A//outlook.office365.com/.default"
[string]$device_code
[int]$device_code_expires_in
[int]$device_code_creation_time
[string]$access_token
[string]$refresh_token
[int]$access_token_expires_in
[int]$access_token_creation_time
[bool]$insecure
[bool]$proxy
OAuth2DeviceCodeClient([string]$device_code, [string]$device_code_expires_in, [string]$device_code_creation_time, [string]$access_token,
[string]$refresh_token, [string]$access_token_expires_in, [string]$access_token_creation_time, [bool]$insecure, [bool]$proxy) {
$this.device_code = $device_code
$this.device_code_expires_in = $device_code_expires_in
$this.device_code_creation_time = $device_code_creation_time
$this.access_token = $access_token
$this.refresh_token = $refresh_token
$this.access_token_expires_in = $access_token_expires_in
$this.access_token_creation_time = $access_token_creation_time
$this.insecure = $insecure
$this.proxy = $proxy
<#
.DESCRIPTION
OAuth2DeviceCodeClient manage state of OAuth2.0 device-code flow described in https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-device-code.
.DESCRIPTION
Its not recommended to create an object using the constructor, Use static method CreateClientFromIntegrationContext() instead.
OAuth2DeviceCodeClient states are:
1. Getting device-code (Will be used in stage 2) and user-code (Will be used by the user to authorize permissions) from Microsoft application.
2. Getting access-token and refresh-token - after use authorize (Using stage 1 - device code)
3. Refresh access-token if access-token is expired.
.PARAMETER device_code
A long string used to verify the session between the client and the authorization server.
The client uses this parameter to request the access token from the authorization server.
.PARAMETER device_code_expires_in
The number of seconds before the device_code and user_code expire. (15 minutes)
.PARAMETER access_token
Opaque string, Issued for the scopes that were requested.
.PARAMETER refresh_token
Opaque string, Issued if the original scope parameter included offline_access. (Valid for 90 days)
.PARAMETER access_token_expires_in
Number of seconds before the included access token is valid for. (Usually - 60 minutes)
.PARAMETER access_token_creation_time
Unix time of access token creation (Used for knowing when to refresh the token).
.PARAMETER access_token_expires_in
Number of seconds before the included access token is valid for. (Usually - 60 minutes)
.PARAMETER insecure
Whether to trust any TLS/SSL Certificate) or not.
.PARAMETER proxy
Whether to user system proxy configuration or not.
.NOTES
1. Application id - a0c73c16-a7e3-4564-9a95-2bdf47383716 , This is well-known application publicly managed by Microsoft and will not work in on-premise environment.
.LINK
https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-device-code
#>
}
static [OAuth2DeviceCodeClient]CreateClientFromIntegrationContext([bool]$insecure, [bool]$proxy) {
$ic = $script:Demisto.getIntegrationContext()
$client = [OAuth2DeviceCodeClient]::new($ic.DeviceCode, $ic.DeviceCodeExpiresIn, $ic.DeviceCodeCreationTime, $ic.AccessToken, $ic.RefreshToken,
$ic.AccessTokenExpiresIn, $ic.AccessTokenCreationTime, $insecure, $proxy)
return $client
<#
.DESCRIPTION
Static method which create object (factory method) from populated values in integration context.
.EXAMPLE
[OAuth2DeviceCodeClient]::CreateClientFromIntegrationContext()
.OUTPUTS
OAuth2DeviceCodeClient initialized object.
#>
}
[PSObject]AuthorizationRequest() {
# Reset object-properties
$this.device_code = $null
$this.device_code_expires_in = $null
$this.device_code_creation_time = $null
# Get device-code and user-code
$params = @{
"URI" = "https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode"
"Method" = "Post"
"Headers" = (New-Object "System.Collections.Generic.Dictionary[[String],[String]]").Add("Content-Type", "application/x-www-form-urlencoded")
"Body" = "client_id=$($this.application_id)&scope=$($this.application_scope)"
"NoProxy" = !$this.proxy
"SkipCertificateCheck" = $this.insecure
}
$response = Invoke-WebRequest @params
$response_body = ConvertFrom-Json $response.Content
# Update object properties
$this.device_code = $response_body.device_code
$this.device_code_creation_time = [int][double]::Parse((Get-Date -UFormat %s))
$this.device_code_expires_in = [int]::Parse($response_body.expires_in)
return $response_body
<#
.DESCRIPTION
Reset values populated in instance context and getting new device-code and user-code.
.EXAMPLE
$client.AuthorizationRequest()
.OUTPUTS
psobject - Raw body response.
.LINK
https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-device-code#device-authorization-request
#>
}
[psobject]AccessTokenRequest() {
# Get new token using device-code
try {
$params = @{
"URI" = "https://login.microsoftonline.com/organizations/oauth2/v2.0/token"
"Method" = "Post"
"Headers" = (New-Object "System.Collections.Generic.Dictionary[[String],[String]]").Add("Content-Type", "application/x-www-form-urlencoded")
"Body" = "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code&code=$($this.device_code)&client_id=$($this.application_id)"
"NoProxy" = !$this.proxy
"SkipCertificateCheck" = $this.insecure
}
$response = Invoke-WebRequest @params
$response_body = ConvertFrom-Json $response.Content
}
catch {
$response_body = ConvertFrom-Json $_.ErrorDetails.Message
if ($response_body.error -eq "authorization_pending" -or $response_body.error -eq "invalid_grant") {
$error_details = "Please run command !$script:COMMAND_PREFIX-auth-start , before running this command."
}
elseif ($response_body.error -eq "expired_token") {
$error_details = "At least $($this.access_token_expires_in) seconds have passed from executing !$script:COMMAND_PREFIX-auth-start, Please run the ***$script:COMMAND_PREFIX-auth-start*** command again."
}
else {
$error_details = $response_body
}
throw "Unable to get access token for your account, $error_details"
}
# Update object properties
$this.access_token = $response_body.access_token
$this.refresh_token = $response_body.refresh_token
$this.access_token_expires_in = [int]::Parse($response_body.expires_in)
$this.access_token_creation_time = [int][double]::Parse((Get-Date -UFormat %s))
return $response_body
<#
.DESCRIPTION
Getting access-token and refresh-token from Microsoft application based on the device-code we go from AuthorizationRequest() method.
.EXAMPLE
$client.AccessTokenRequest()
.OUTPUTS
psobject - Raw body response.
.LINK
https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-device-code#authenticating-the-user
#>
}
[psobject]RefreshTokenRequest() {
# Get new token using refresh token
try {
$params = @{
"URI" = "https://login.microsoftonline.com/organizations/oauth2/v2.0/token"
"Method" = "Post"
"Headers" = (New-Object "System.Collections.Generic.Dictionary[[String],[String]]").Add("Content-Type", "application/x-www-form-urlencoded")
"Body" = "grant_type=refresh_token&client_id=$($this.application_id)&refresh_token=$($this.refresh_token)&scope=$($this.application_scope)"
"NoProxy" = !$this.proxy
"SkipCertificateCheck" = $this.insecure
}
$response = Invoke-WebRequest @params
$response_body = ConvertFrom-Json $response.Content
}
catch {
$response_body = ConvertFrom-Json $_.ErrorDetails.Message
if ($response_body.error -eq "invalid_grant") {
$error_details = "Please login to grant account permissions (After 90 days grant is expired) !$script:COMMAND_PREFIX-auth-start."
}
else {
$error_details = $response_body
}
throw "Unable to refresh access token for your account, $error_details"
}
# Update object properties
$this.access_token = $response_body.access_token
$this.refresh_token = $response_body.refresh_token
$this.access_token_expires_in = [int]::Parse($response_body.expires_in)
$this.access_token_creation_time = [int][double]::Parse((Get-Date -UFormat %s))
return $response_body
<#
.DESCRIPTION
Getting new access-token and refresh-token from Microsoft application based on the refresh-token we got from AccessTokenRequest() method.
.EXAMPLE
$client.RefreshTokenRequest()
.OUTPUTS
PSObject - Raw body response.
.LINK
https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-implicit-grant-flow#refreshing-tokens
#>
}
[bool]IsDeviceCodeExpired() {
if (!$this.device_code) {
return $true
}
$current_time = [int][double]::Parse((Get-Date -UFormat %s)) - 30
$valid_until = $this.device_code_creation_time + $this.access_token_expires_in
return $current_time -gt $valid_until
<#
.DESCRIPTION
Check if device-code expired.
.EXAMPLE
$client.IsDeviceCodeExpired()
.OUTPUTS
bool - True If device-code expired else False.
.LINK
https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-configurable-token-lifetimes#configurable-token-lifetime-properties-after-the-retirement
#>
}
[bool]IsAccessTokenExpired() {
if (!$this.access_token) {
return $true
}
$current_time = [int][double]::Parse((Get-Date -UFormat %s)) - 30
$valid_until = $this.access_token_creation_time + $this.access_token_expires_in
return $current_time -gt $valid_until
<#
.DESCRIPTION
Check if access-token expired.
.EXAMPLE
$client.IsAccessTokenExpired()
.OUTPUTS
bool - True If access-token expired else False.
.LINK
https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-configurable-token-lifetimes#configurable-token-lifetime-properties-after-the-retirement
#>
}
RefreshTokenIfExpired() {
if ($this.access_token -and $this.IsAccessTokenExpired()) {
$this.RefreshTokenRequest()
}
<#
.DESCRIPTION
Refresh access token if expired, with offset of 30 seconds.
.EXAMPLE
$client.RefreshTokenIfExpired()
#>
}
}
#### Security And Compliance client - OAUTH2.0 ####
class ExchangeOnlineClient {
[string]$url
[string]$upn
[string]$password
[string]$bearer_token
[psobject]$session
[bool]$insecure
[bool]$proxy
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '', Scope = 'Function')]
ExchangeOnlineClient(
[string]$url,
[string]$upn,
[string]$password,
[string]$bearer_token,
[bool]$insecure,
[bool]$proxy
) {
$this.upn = $upn
$this.password = $password
$this.bearer_token = $bearer_token
$this.insecure = $insecure
$this.proxy = $proxy
$this.url = $url
<#
.DESCRIPTION
ExchangeOnlineClient connect to Exchange Online using power-shell session (OAuth2.0) and allow interact with it.
.PARAMETER url
Exchange online url.
.PARAMETER upn
User Principal Name (UPN) is the name of a system user in an email address format.
.PARAMETER password
Password is filled only if authentication method is basic auth.
.PARAMETER bearer_token
Valid bearer token value.
.PARAMETER insecure
Whether to trust any TLS/SSL Certificate) or not.
.EXAMPLE proxy
Whether to user system proxy configuration or not.
.EXAMPLE
$exo_client = [ExchangeOnlineClient]::new("outlook.com", "user@microsoft.com", "dfhsdkjhkjhvkdvbihsgiu")
#>
}
CreateSession() {
$this.session = CreateNewSession -url $this.url -upn $this.upn -password $this.password -bearer_token $this.bearer_token -insecure $this.insecure -proxy $this.proxy
<#
.DESCRIPTION
This method is for internal use. It creates session to Exchange Online.
.EXAMPLE
$client.CreateSession()
.LINK
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/new-pssession?view=powershell-7
https://docs.microsoft.com/en-us/powershell/partnercenter/multi-factor-auth?view=partnercenterps-3.0#exchange-online-powershell
#>
}
CreateSessionEXOPowershell2() {
$this.session = CreateNewSession -url $this.url -upn $this.upn -password $this.password -bearer_token $this.bearer_token -insecure $this.insecure -proxy $this.proxy
<#
.DESCRIPTION
This method is for internal use. It creates session to Exchange Online.
.EXAMPLE
$client.CreateSession()
.LINK
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/new-pssession?view=powershell-7
https://docs.microsoft.com/en-us/powershell/partnercenter/multi-factor-auth?view=partnercenterps-3.0#exchange-online-powershell
#>
}
CloseSession() {
if ($this.session) {
Remove-PSSession $this.session
}
<#
.DESCRIPTION
This method is for internal use. It creates session to Exchange Online.
.EXAMPLE
$client.CloseSession()
.LINK
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/remove-pssession?view=powershell-7
https://docs.microsoft.com/en-us/powershell/partnercenter/multi-factor-auth?view=partnercenterps-3.0#exchange-online-powershell
#>
}
[psobject]GetJunkRules([string]$mailbox) {
$response = ''
try {
# Establish session to remote
$this.CreateSession()
# Import and Execute command
Import-PSSession -Session $this.session -CommandName Get-MailboxJunkEmailConfiguration -AllowClobber
$cmd_params = @{
"Identity" = $mailbox
}
$response = Get-MailboxJunkEmailConfiguration @cmd_params
}
finally {
# Close session to remote
$this.CloseSession()
}
return $response
<#
.DESCRIPTION
Get junk rules in mailbox.
.PARAMETER mailbox
Mailbox ID.
.EXAMPLE
$client.GetJunkRules("test@microsoft.com")
.OUTPUTS
psobject - Raw response.
.LINK
https://docs.microsoft.com/en-us/powershell/module/exchange/get-mailboxjunkemailconfiguration?view=exchange-ps
#>
}
SetJunkRules([string]$mailbox, [string[]]$add_blocked_senders_and_domains, [string[]]$remove_blocked_senders_and_domains,
[string[]]$add_trusted_senders_and_domains, [string[]]$remove_trusted_senders_and_domains,
[bool]$trusted_lists_only, [bool]$contacts_trusted, [bool]$enabled) {
try {
# Establish session to remote
$this.CreateSession()
# Import and Execute command
Import-PSSession -Session $this.session -CommandName Set-MailboxJunkEmailConfiguration -AllowClobber
$cmd_params = @{
"Identity" = $mailbox
"BlockedSendersAndDomains" = @{Add = $add_blocked_senders_and_domains
Remove = $remove_blocked_senders_and_domains
}
"TrustedSendersAndDomains" = @{Add = $add_trusted_senders_and_domains
Remove = $remove_trusted_senders_and_domains
}
"TrustedListsOnly" = $trusted_lists_only
"ContactsTrusted" = $contacts_trusted
"Enabled" = $enabled
"Confirm" = $false
}
Set-MailboxJunkEmailConfiguration @cmd_params
}
finally {
# Close session to remote
$this.CloseSession()
}
<#
.DESCRIPTION
Set junk rules in mailbox.
.PARAMETER mailbox
Mailbox ID.
.PARAMETER add_blocked_senders_and_domains
Blocked senders and domains (Comma separated).
.PARAMETER remove_blocked_senders_and_domains
Blocked senders and domains (Comma separated) to remove.
.PARAMETER add_trusted_senders_and_domains
Trusted senders and domains (Comma separated).
.PARAMETER remove_trusted_senders_and_domains
Trusted senders and domains (Comma separated) to remove.
.PARAMETER trusted_lists_only
Whether to trust only list of defined in trusted lists.
.PARAMETER contacts_trusted
Whether contacts trusted by default.
.PARAMETER enabled
Whether junk rule is enabled.
.OUTPUTS
psobject - Raw response.
.LINK
https://docs.microsoft.com/en-us/powershell/module/exchange/set-mailboxjunkemailconfiguration?view=exchange-ps
#>
}
SetGlobalJunkRules([string]$mailbox, [string[]]$add_blocked_senders_and_domains, [string[]]$remove_blocked_senders_and_domains,
[string[]]$add_trusted_senders_and_domains, [string[]]$remove_trusted_senders_and_domains,
[bool]$trusted_lists_only, [bool]$contacts_trusted, [bool]$enabled) {
try {
# Establish session to remote
$this.CreateSession()
# Import and Execute command
Import-PSSession -Session $this.session -CommandName Set-MailboxJunkEmailConfiguration -AllowClobber
Import-PSSession -Session $this.session -CommandName Get-Mailbox -AllowClobber
$cmd_params = @{
"BlockedSendersAndDomains" = @{Add = $add_blocked_senders_and_domains
Remove = $remove_blocked_senders_and_domains
}
"TrustedSendersAndDomains" = @{Add = $add_trusted_senders_and_domains
Remove = $remove_trusted_senders_and_domains
}
"TrustedListsOnly" = $trusted_lists_only
"ContactsTrusted" = $contacts_trusted
"Enabled" = $enabled
"Confirm" = $false
}
Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited | ForEach-Object {
Set-MailboxJunkEmailConfiguration -Identity $_.Name @cmd_params
}
}
finally {
# Close session to remote
$this.CloseSession()
}
<#
.DESCRIPTION
Set junk rules in all managed accounts.
.PARAMETER add_blocked_senders_and_domains
Blocked senders and domains (Comma separated).
.PARAMETER remove_blocked_senders_and_domains
Blocked senders and domains (Comma separated) to remove.
.PARAMETER add_trusted_senders_and_domains
Trusted senders and domains (Comma separated).
.PARAMETER remove_trusted_senders_and_domains
Trusted senders and domains (Comma separated) to remove.
.PARAMETER trusted_lists_only
Whether to trust only list of defined in trusted lists.
.PARAMETER contacts_trusted
Whether contacts trusted by default.
.PARAMETER enabled
Whether junk rule is enabled.
.OUTPUTS
psobject - Raw response.
.LINK
https://docs.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/configure-antispam-settings?view=exchserver-2019
#>
}
[PSObject]GetMessageTrace([string[]]$sender_address, [string[]]$recipient_address, [string[]]$from_ip, [string[]]$to_ip, [string[]]$message_id,
[string]$message_trace_id, [int32]$page, [int32]$page_size, [String]$start_date, [String]$end_date, [string]$status) {
$response = ""
try {
# Establish session to remote
$this.CreateSession()
# Import and Execute command
Import-PSSession -Session $this.session -CommandName Get-MessageTrace -AllowClobber
$cmd_params = @{
"SenderAddress" = $sender_address
"RecipientAddress" = $recipient_address
"Page" = $page
"PageSize" = $page_size
}
if ($status) {
$cmd_params.Status = $status
}
if ($start_date) {
$cmd_params.StartDate = $start_date
if ($end_date) {
$cmd_params.EndDate = $end_date
}
else {
$cmd_params.EndDate = Get-Date -UFormat "%D %I:%M %p"
}
}
if ($from_ip) {
$cmd_params.FromIP = $from_ip
}
if ($to_ip) {
$cmd_params.ToIP = $to_ip
}
if ($message_id) {
$cmd_params.MessageId = $message_id
}
if ($message_trace_id) {
$cmd_params.MessageTraceId = $message_trace_id
}
$response = Get-MessageTrace @cmd_params
}
finally {
# Close session to remote
$this.CloseSession()
}
return $response
<#
.DESCRIPTION
Search message data for the last 10 days.
.PARAMETER sender_address
The sender_address parameter filters the results by the sender's email address.
.PARAMETER recipient_address
The recipient_address parameter filters the results by the recipient's email address. You can specify multiple values separated by commas.
.PARAMETER from_ip
The from_ip parameter filters the results by the source IP address.
For incoming messages, the value of from_ip is the public IP address of the SMTP email server that sent the message.
For outgoing messages from Exchange Online, the value is blank.
.PARAMETER to_ip
The to_ip parameter filters the results by the destination IP address.
For outgoing messages, the value of to_ip is the public IP address in the resolved MX record for the destination domain.
For incoming messages to Exchange Online, the value is blank.
.PARAMETER message_id
The message_id parameter filters the results by the Message-ID header field of the message.
This value is also known as the Client ID. The format of the Message-ID depends on the messaging server that sent the message.
The value should be unique for each message. However, not all messaging servers create values for the Message-ID in the same way.
Besure to include the full Message ID string (which may include angle brackets) and enclose the value in quotation marks (for example,"d9683b4c-127b-413a-ae2e-fa7dfb32c69d@DM3NAM06BG401.Eop-nam06.prod.protection.outlook.com").
.PARAMETER message_trace_id
The message_trace_id parameter can be used with the recipient address to uniquely identify a message trace and obtain more details.
A message trace ID is generated for every message that's processed by the system.
.PARAMETER page
The page parameter specifies the page number of the results you want to view.
Valid input for this parameter is an integer between 1 and 1000. The default value is 1.
.PARAMETER page_size
The page_size parameter specifies the maximum number of entries per page.
Valid input for this parameter is an integer between 1 and 5000. The default value is 100.
.PARAMETER start_date
The start_date parameter specifies the start date of the date range.
Use the short date format that's defined in the Regional Options settings on the computer where you're running the command. For example, if the computer is configured to use the short date format mm/dd/yyyy,
enter 09/01/2018 to specify September 1, 2018. You can enter the date only, or you can enter the date and time of day.
If you enter the date and time of day, enclose the value in quotation marks ("), for example, "09/01/2018 5:00 PM".
Valid input for this parameter is from 10 days - now ago. The default value is 48 hours ago.
.PARAMETER end_date
The end_date parameter specifies the end date of the date range.
Use the short date format that's defined in the Regional Options settings on the computer where you're running the command.
For example, if the computer is configured to use the short date format mm/dd/yyyy, enter 09/01/2018 to specify September 1, 2018.
You can enter the date only, or you can enter the date and time of day.
If you enter the date and time of day, enclose the value in quotation marks ("), for example, "09/01/2018 5:00 PM".
Valid input for this parameter is from start_date - now. The default value is now.
.PARAMETER status
* GettingStatus: The message is waiting for status update.
* Failed: Message delivery was attempted and it failed or the message was filtered as spam or malware, or by transport rules.
* Pending: Message delivery is underway or was deferred and is being retried.
* Delivered: The message was delivered to its destination.
* Expanded: There was no message delivery because the message was addressed to a distribution group and the membership of the distribution was expanded.
* Quarantined: The message was quarantined.
* FilteredAsSpam: The message was marked as spam.
.OUTPUTS
psobject - Raw response.
.LINK
https://docs.microsoft.com/en-us/powershell/module/exchange/get-messagetrace?view=exchange-ps
#>
}
[PSObject]GetFederationTrust(
[string]$domain_controller,
[string]$identity
)
{
$response = ""
try {
# Establish session to remote
$this.CreateSession()
# Import and Execute command
Import-PSSession -Session $this.session -CommandName Get-FederationTrust -AllowClobber
$cmd_params = @{}
if ($identity) {
$cmd_params.Identity = $identity
}
if ($domain_controller) {
$cmd_params.DomainController = $domain_controller
}
$response = Get-FederationTrust @cmd_params
}
finally {
$this.CloseSession()
}
return $response
<#
.DESCRIPTION
Use the Get-FederationTrust cmdlet to view the federation trust configured for the Exchange organization.
.PARAMETER domain_controller
This parameter is available only in on-premises Exchange.
The DomainController parameter specifies the domain controller that's used by this
cmdlet to read data from or write data to Active Directory. You identify the domain
controller by its fully qualified domain name (FQDN).
For example, dc01.contoso.com.
.PARAMETER identity
The Identity parameter specifies a federation trust ID. If not specified, the cmdlet returns
all federation trusts configured for the Exchange organization.
.EXAMPLE
GetFederationTrust("dc01.contoso.com", "1254y894-feae-9yn7-a3e1-f2483a154tft")
.OUTPUTS
PSObject - Raw response
.LINK
https://docs.microsoft.com/en-us/powershell/module/exchange/get-federationtrust?view=exchange-ps
#>
}
[PSObject]GetFederationConfiguration(
[string]$domain_controller,
[string]$identity,
[bool]$include_extended_domain_info
) {
$response = ""
try {
# Establish session to remote
$this.CreateSession()
# Import and Execute command
Import-PSSession -Session $this.session -CommandName Get-FederatedOrganizationIdentifier -AllowClobber
$cmd_params = @{}
if ($identity) {
$cmd_params.Identity = $identity
}
if ($domain_controller) {
$cmd_params.DomainController = $domain_controller
}
if ($include_extended_domain_info) {
$cmd_params.IncludeExtendedDomainInfo = $include_extended_domain_info
}
$response = Get-FederatedOrganizationIdentifier @cmd_params
}
finally {
$this.CloseSession()
}
return $response
<#
.DESCRIPTION
Use the Get-FederatedOrganizationIdentifier cmdlet to retrieve the Exchange organization's federated
organization identifier and related details, such as federated domains, organization contact and status.
.PARAMETER domain_controller
This parameter is available only in on-premises Exchange.
The DomainController parameter specifies the domain controller that's used by this
cmdlet to read data from or write data to Active Directory. You identify the domain
controller by its fully qualified domain name (FQDN).
For example, dc01.contoso.com.
.PARAMETER identity
The Identity parameter specifies a federation trust ID. If not specified, the cmdlet returns
all federation trusts configured for the Exchange organization.
.PARAMETER include_extended_domain_info
The IncludeExtendedDomainInfo switch specifies that the command query Microsoft Federation Gateway for the status of each
accepted domain that's federated. The status is returned with each domain in the Domains property.
.EXAMPLE
GetFederationConfiguration("dc01.contoso.com", "1254y894-feae-9yn7-a3e1-f2483a154tft", $true)
.OUTPUTS
PSObject - Raw response
.LINK
https://docs.microsoft.com/en-us/powershell/module/exchange/get-federatedorganizationidentifier?view=exchange-ps
#>
}
[PSObject]GetUser(
[string]$identity,
[string]$organizational_unit,
[int]$limit
) {
$response = ""
try
{
# Establish session to remote
$this.CreateSession()
# Import and Execute command
Import-PSSession -Session $this.session -CommandName Get-User -AllowClobber
$cmd_params = @{ }
if ($identity)
{
$cmd_params.Identity = $identity
}
if ($organizational_unit)
{
$cmd_params.OrganizationalUnit = $organizational_unit
}
if ($limit -gt 0)
{
$response = Get-User @cmd_params -ResultSize $limit -WarningAction:SilentlyContinue
}
else
{
$response = Get-User @cmd_params -ResultSize Unlimited
}
} finally {
$this.CloseSession()
}
return $response
<#
.DESCRIPTION
Use the Get-User command to view existing user objects in your organization.
.PARAMETER identity
The Identity parameter the user that you want to view. You can use any value that uniquely identifies the user
.PARAMETER orgranizational_unit
The OrganizationalUnit parameter filters the results based on the object's location in Active Directory.
.EXAMPLE
GetUser("user@microsoft.com")
.OUTPUTS
PSObject - Raw response
.LINK
https://docs.microsoft.com/en-us/powershell/module/exchange/get-user?view=exchange-ps #>
}
[PSObject]GetMailboxAuditBypassAssociation(
[string]$identity,
[string]$domain_controller,
[int]$limit
)
{
$response = ""
try {
# Establish session to remote
$this.CreateSession()
# Import and Execute command
Import-PSSession -Session $this.session -CommandName Get-MailboxAuditBypassAssociation -AllowClobber
$cmd_params = @{ }
if ($identity) {
$cmd_params.Identity = $identity
}
if ($domain_controller) {
$cmd_params.DomainController = $domain_controller
}
if ($limit -gt 0){
$cmd_params.ResultSize = $limit
}
$response = Get-MailboxAuditBypassAssociation @cmd_params -WarningAction:SilentlyContinue
} finally {
$this.CloseSession()
}
return $response
<#
.DESCRIPTION
Retrieve information about the AuditBypassEnabled property value for user accounts
(on-premises Exchange and the cloud) and computer accounts (on-premises Exchange only).
.PARAMETER identity
The Identity parameter the user that you want to view. You can use any value that uniquely identifies the user
.PARAMETER domain_controller
The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from
or write data to Active Directory. You identify the domain controller by its fully qualified domain name (FQDN).
.EXAMPLE
.OUTPUTS
PSObject - Raw response
.LINK
https://docs.microsoft.com/en-us/powershell/module/exchange/get-mailboxauditbypassassociation?view=exchange-ps
#>
}
[PSCustomObject]GetRemoteDomain(
[string]$domain_controller,
[string]$identity
) {
$response = ""
try {
# Establish session to remote
$this.CreateSession()
# Import and Execute command
Import-PSSession -Session $this.session -CommandName Get-RemoteDomain -AllowClobber
$cmd_params = @{}
if ($identity) {
$cmd_params.Identity = $identity
}
if ($domain_controller) {
$cmd_params.DomainController = $domain_controller
}
return Get-RemoteDomain @cmd_params -WarningAction:SilentlyContinue
}
finally {
$this.CloseSession()
}
return $response
<#
.DESCRIPTION
Use the Get-RemoteDomain cmdlet to view the configuration information for the remote domains configured in
your organization.
.PARAMETER domain_controller
This parameter is available only in on-premises Exchange.
The DomainController parameter specifies the domain controller that's used by this
cmdlet to read data from or write data to Active Directory. You identify the domain
controller by its fully qualified domain name (FQDN).
For example, dc01.contoso.com.
.PARAMETER identity
The Identity parameter specifies a federation trust ID. If not specified, the cmdlet returns
all federation trusts configured for the Exchange organization.
.EXAMPLE
GetRemoteDomain("1254y894-feae-9yn7-a3e1-f2483a154tft")
.OUTPUTS
PSObject - Raw response
.LINK
https://docs.microsoft.com/en-us/powershell/module/exchange/get-remotedomain?view=exchange-ps
#>
}
}
#### COMMAND FUNCTIONS ####
function TestModuleCommand ([OAuth2DeviceCodeClient]$oclient, [ExchangeOnlineClient]$exo_client) {
try {
$exo_client.CreateSession()
}
finally {
$exo_client.CloseSession()
}
$raw_response = $null
$human_readable = "ok"
$entry_context = $null
return $human_readable, $entry_context, $raw_response
}
function StartAuthCommand ([OAuth2DeviceCodeClient]$client) {
$raw_response = $client.AuthorizationRequest()
$human_readable = "## $script:INTEGRATION_NAME - Authorize instructions
1. To sign in, use a web browser to open the page [https://microsoft.com/devicelogin](https://microsoft.com/devicelogin) and enter the code **$($raw_response.user_code)** to authenticate.
2. Run the following command **!$script:COMMAND_PREFIX-auth-complete** in the War Room."
$entry_context = @{}
return $human_readable, $entry_context, $raw_response
}
function CompleteAuthCommand ([OAuth2DeviceCodeClient]$client) {
# Verify that user run start before complete
if (!$client.device_code) {
throw "Please run !ews-auth-start and follow the command instructions"
}
$raw_response = $client.AccessTokenRequest()
$human_readable = "Your account **successfully** authorized!"
$entry_context = @{}
return $human_readable, $entry_context, $raw_response
}
function TestAuthCommand ([OAuth2DeviceCodeClient]$oclient, [ExchangeOnlineClient]$exo_client) {
$raw_response = $oclient.RefreshTokenRequest()
$human_readable = "**Test ok!**"
$entry_context = @{}
try {
$exo_client.CreateSession()
}
finally {
$exo_client.CloseSession()
}
return $human_readable, $entry_context, $raw_response
}
function GetJunkRulesCommand([ExchangeOnlineClient]$client, [hashtable]$kwargs) {
$raw_response = $client.GetJunkRules($kwargs.mailbox)
$md_columns = $raw_response | Select-Object -Property BlockedSendersAndDomains, TrustedSendersAndDomains, ContactsTrusted, TrustedListsOnly, Enabled
$human_readable = TableToMarkdown $md_columns "$script:INTEGRATION_NAME - '$($kwargs.mailbox)' Junk rules"
$entry_context = ParseJunkRulesToEntryContext $raw_response $kwargs.mailbox
return $human_readable, $entry_context, $raw_response
}
function SetJunkRulesCommand([ExchangeOnlineClient]$client, [hashtable]$kwargs) {
# Parse arguments
$add_blocked_senders_and_domains = ArgToList $kwargs.add_blocked_senders_and_domains
$remove_blocked_senders_and_domains = ArgToList $kwargs.remove_blocked_senders_and_domains
$add_trusted_senders_and_domains = ArgToList $kwargs.add_trusted_senders_and_domains
$remove_trusted_senders_and_domains = ArgToList $kwargs.remove_trusted_senders_and_domains
if ($kwargs.trusted_lists_only) {
$trusted_lists_only = ConvertTo-Boolean $kwargs.trusted_lists_only
}
if ($kwargs.contacts_trusted) {
$contacts_trusted = ConvertTo-Boolean $kwargs.contacts_trusted
}
if ($kwargs.enabled) {
$kwargs.enabled = ConvertTo-Boolean $kwargs.enabled
}
# Execute commands - No output for the command
$client.SetJunkRules($kwargs.mailbox, $add_blocked_senders_and_domains, $remove_blocked_senders_and_domains,
$add_trusted_senders_and_domains, $remove_trusted_senders_and_domains,
$trusted_lists_only, $contacts_trusted, $enabled)
$raw_response = @{}
$human_readable = "$script:INTEGRATION_NAME - '$($kwargs.mailbox)' Junk rules **modified**!"
$entry_context = @{}
return $human_readable, $entry_context, $raw_response
}
function SetGlobalJunkRulesCommand([ExchangeOnlineClient]$client, [hashtable]$kwargs) {
# Parse arguments
$add_blocked_senders_and_domains = ArgToList $kwargs.add_blocked_senders_and_domains
$remove_blocked_senders_and_domains = ArgToList $kwargs.remove_blocked_senders_and_domains
$add_trusted_senders_and_domains = ArgToList $kwargs.add_trusted_senders_and_domains
$remove_trusted_senders_and_domains = ArgToList $kwargs.remove_trusted_senders_and_domains
if ($kwargs.trusted_lists_only) {
$trusted_lists_only = ConvertTo-Boolean $kwargs.trusted_lists_only
}
if ($kwargs.contacts_trusted) {
$contacts_trusted = ConvertTo-Boolean $kwargs.contacts_trusted
}
if ($kwargs.enabled) {
$kwargs.enabled = ConvertTo-Boolean $kwargs.enabled
}
# Execute commands - No output for the command
$client.SetGlobalJunkRules($kwargs.mailbox, $add_blocked_senders_and_domains, $remove_blocked_senders_and_domains,
$add_trusted_senders_and_domains, $remove_trusted_senders_and_domains,
$trusted_lists_only, $contacts_trusted, $enabled)
$raw_response = @{}
$human_readable = "$script:INTEGRATION_NAME - Junk rules globally **modified**!"
$entry_context = @{}
return $human_readable, $entry_context, $raw_response
}
function GetMessageTraceCommand([ExchangeOnlineClient]$client, [hashtable]$kwargs) {
# Parse arguments
$sender_address = ArgToList $kwargs.sender_address
$recipient_address = ArgToList $kwargs.recipient_address
$from_ip = ArgToList $kwargs.from_ip
$to_ip = ArgToList $kwargs.to_ip
$raw_response = $client.GetMessageTrace($sender_address, $recipient_address, $from_ip, $to_ip, $kwargs.message_id,
$kwargs.message_trace_id, $kwargs.page, $kwargs.page_size, $kwargs.start_date,
$kwargs.end_date, $kwargs.status)
$entry_context = ParseMessageTraceToEntryContext $raw_response
if ($entry_context.($script:MESSAGE_TRACE_ENTRY_CONTEXT)) {
$human_readable = TableToMarkdown $entry_context.($script:MESSAGE_TRACE_ENTRY_CONTEXT) "$script:INTEGRATION_NAME - Messages trace"
}
else {
$human_readable = "**No messages trace found**"
}
return $human_readable, $entry_context, $raw_response
}
function GetFederationTrustCommand([ExchangeOnlineClient]$client, [hashtable]$kwargs) {
[CmdletBinding()]
# parse arguments
$domain_controller = $kwargs.domain_controller
$identity = $kwargs.identity
$raw_response = $client.GetFederationTrust(
$domain_controller, $identity
)
$human_readable = TableToMarkdown $raw_response "Results of $command"
$entry_context = @{
"$script:INTEGRATION_ENTRY_CONTEXT.FederationTrust(obj.ApplicationIdentifier === val.ApplicationIdentifier)" = $raw_response
}
Write-Output $human_readable, $entry_context, $raw_response
}
function GetFederationConfigurationCommand {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[ExchangeOnlineClient]$client,
[hashtable]$kwargs
)
# parse arguments
$domain_controller = $kwargs.domain_controller
$identity = $kwargs.identity
$include_extended_domain_info = ConvertTo-Boolean $kwargs.include_extended_domain_info
$raw_response = $client.GetFederationConfiguration(
$domain_controller,
$identity,
$include_extended_domain_info
)
$human_readable = TableToMarkdown $raw_response "Results of $command"
$entry_context = @{
"$script:INTEGRATION_ENTRY_CONTEXT.FederationConfiguration(obj.Guid === val.Guid)" = $raw_response
}
Write-Output $human_readable, $entry_context, $raw_response
}
function GetRemoteDomainCommand {
[CmdletBinding()]
param (
[Parameter(Mandatory)][ExchangeOnlineClient]$client,
[hashtable]$kwargs
)
$identity = $kwargs.identity
$domain_controller = $kwargs.domain_controller
$raw_response = $client.GetRemoteDomain($domain_controller, $identity)
$human_readable = TableToMarkdown $raw_response "Results of $command"
$entry_context = @{"$script:INTEGRATION_ENTRY_CONTEXT.RemoteDomain(obj.Guid === val.Guid)" = $raw_response }
Write-Output $human_readable, $entry_context, $raw_response
}
function GetUserCommand {
[CmdletBinding()]
param (
[Parameter(Mandatory)][ExchangeOnlineClient]$client,
[hashtable]$kwargs
)
$identity = $kwargs.identity
$organizational_unit = $kwargs.organizational_unit
$limit = ($kwargs.limit -as [int])
$raw_response = $client.GetUser($identity, $organizational_unit, $limit)
$human_readable = TableToMarkdown $raw_response "Results of $command"
$entry_context = @{"$script:INTEGRATION_ENTRY_CONTEXT.User(obj.Guid === val.Guid)" = $raw_response}
Write-Output $human_readable, $entry_context, $raw_response
}
function GetMailboxAuditBypassAssociationCommand {
[CmdletBinding()]
param (
[Parameter(Mandatory)][ExchangeOnlineClient]$client,
[hashtable]$kwargs
)
$identity = $kwargs.identity
$domain_controller = $kwargs.domain_controller
$limit = ($kwargs.limit -as [int])
$raw_response = $client.GetMailboxAuditBypassAssociation($identity, $domain_controller, $limit)
$human_readable = TableToMarkdown $raw_response "Results of $command"
$entry_context = @{"$script:INTEGRATION_ENTRY_CONTEXT.MailboxAuditBypassAssociation(obj.Guid === val.Guid)" = $raw_response }
Write-Output $human_readable, $entry_context, $raw_response
}
#### INTEGRATION COMMANDS MANAGER ####
function Main {
$command = $Demisto.GetCommand()
$command_arguments = $Demisto.Args()
$integration_params = $Demisto.Params()
$insecure = (ConvertTo-Boolean $integration_params.insecure)
$proxy = (ConvertTo-Boolean $integration_params.proxy)
try {
# Creating Compliance and search client
$oauth2_client = [OAuth2DeviceCodeClient]::CreateClientFromIntegrationContext($insecure, $no_proxy)
# Refreshing tokens if expired
$oauth2_client.RefreshTokenIfExpired()
# Creating ExchangeOnline client
$exo_client = [ExchangeOnlineClient]::new(
$integration_params.url,
$integration_params.credentials.identifier,
$integration_params.credentials.password,
$oauth2_client.access_token,
$insecure,
$proxy
)
# Executing command
$Demisto.Debug("Command being called is $Command")
switch ($command) {
"test-module" {
($human_readable, $entry_context, $raw_response) = TestModuleCommand $oauth2_client $exo_client
}
"$script:COMMAND_PREFIX-auth-start" {
($human_readable, $entry_context, $raw_response) = StartAuthCommand $oauth2_client
}
"$script:COMMAND_PREFIX-auth-complete" {
($human_readable, $entry_context, $raw_response) = CompleteAuthCommand $oauth2_client
}
"$script:COMMAND_PREFIX-auth-test" {
($human_readable, $entry_context, $raw_response) = TestAuthCommand $oauth2_client $exo_client
}
"$script:COMMAND_PREFIX-junk-rules-get" {
($human_readable, $entry_context, $raw_response) = GetJunkRulesCommand $exo_client $command_arguments
}
"$script:COMMAND_PREFIX-junk-rules-set" {
($human_readable, $entry_context, $raw_response) = SetJunkRulesCommand $exo_client $command_arguments
}
"$script:COMMAND_PREFIX-global-junk-rules-set" {
($human_readable, $entry_context, $raw_response) = SetGlobalJunkRulesCommand $exo_client $command_arguments
}
"$script:COMMAND_PREFIX-message-trace-get" {
($human_readable, $entry_context, $raw_response) = GetMessageTraceCommand $exo_client $command_arguments
}
"$script:COMMAND_PREFIX-federation-trust-get" {
($human_readable, $entry_context, $raw_response) = GetFederationTrustCommand $exo_client $command_arguments
}
"$script:COMMAND_PREFIX-federation-configuration-get" {
($human_readable, $entry_context, $raw_response) = GetFederationConfigurationCommand $exo_client $command_arguments
}
"$script:COMMAND_PREFIX-remote-domain-get" {
($human_readable, $entry_context, $raw_response) = GetRemoteDomainCommand $exo_client $command_arguments
}
"$script:COMMAND_PREFIX-user-list" {
($human_readable, $entry_context, $raw_response) = GetUserCommand $exo_client $command_arguments
}
"$script:COMMAND_PREFIX-mailbox-audit-bypass-association-list" {
($human_readable, $entry_context, $raw_response) = GetMailboxAuditBypassAssociationCommand $exo_client $command_arguments
}
default {
ReturnError "Could not recognize $command"
}
}
# Updating integration context if access token changed
UpdateIntegrationContext $oauth2_client
# Return results to Demisto Server
ReturnOutputs $human_readable $entry_context $raw_response | Out-Null
}
catch {
$Demisto.debug("Integration: $script:INTEGRATION_NAME
Command: $command
Arguments: $($command_arguments | ConvertTo-Json)
Error: $($_.Exception.Message)")
if ($command -ne "test-module") {
ReturnError "Error:
Integration: $script:INTEGRATION_NAME
Command: $command
Arguments: $($command_arguments | ConvertTo-Json)
Error: $($_.Exception)" | Out-Null
}
else {
ReturnError $_.Exception.Message
}
}
}
# Execute Main when not in Tests
if ($MyInvocation.ScriptName -notlike "*.tests.ps1" -AND -NOT $Test) {
Main
}
|
demisto/content
|
Packs/EWS/Integrations/EwsExtension/EwsExtension.ps1
|
PowerShell
|
mit
| 58,006
|
import {Seq, Map, List} from "immutable";
import {
LOAD_PROJECT,
NEW_PROJECT,
OPEN_CATALOG,
MODE_VIEWING_CATALOG,
MODE_CONFIGURING_PROJECT,
SELECT_TOOL_EDIT,
MODE_IDLE,
UNSELECT_ALL,
SET_PROPERTIES,
SET_ITEMS_ATTRIBUTES,
SET_LINES_ATTRIBUTES,
SET_HOLES_ATTRIBUTES,
REMOVE,
UNDO,
ROLLBACK,
SET_PROJECT_PROPERTIES,
OPEN_PROJECT_CONFIGURATOR,
INIT_CATALOG,
UPDATE_MOUSE_COORDS,
UPDATE_ZOOM_SCALE,
TOGGLE_SNAP,
CHANGE_CATALOG_PAGE,
GO_BACK_TO_CATALOG_PAGE,
THROW_ERROR,
THROW_WARNING,
COPY_PROPERTIES,
PASTE_PROPERTIES
} from '../constants';
import {State, Scene, Guide, Catalog} from "../models";
import {
removeLine,
removeHole,
detectAndUpdateAreas,
setProperties as setPropertiesOp,
setItemsAttributes as setItemsAttributesOp,
setLinesAttributes as setLinesAttributesOp,
setHolesAttributes as setHolesAttributesOp,
select,
unselect,
unselectAll as unselectAllOp,
removeItem,
loadLayerFromJSON,
setPropertiesOnSelected,
updatePropertiesOnSelected,
setAttributesOnSelected
} from '../utils/layer-operations';
export default function (state, action) {
switch (action.type) {
case NEW_PROJECT:
return newProject(state);
case LOAD_PROJECT:
return loadProject(state, action.sceneJSON);
case OPEN_CATALOG:
return openCatalog(state);
case CHANGE_CATALOG_PAGE:
return state.setIn(['catalog', 'page'], action.newPage)
.updateIn(['catalog', 'path'], path => path.push(action.oldPage));
case GO_BACK_TO_CATALOG_PAGE:
let path = state.catalog.path;
let pageIndex = state.catalog.path.findIndex(page => page === action.newPage);
return state.setIn(['catalog', 'page'], action.newPage)
.updateIn(['catalog', 'path'], path => path.take(pageIndex));
case SELECT_TOOL_EDIT:
return state.set('mode', MODE_IDLE);
case UNSELECT_ALL:
return unselectAll(state);
case SET_PROPERTIES:
return setProperties(state, action.properties);
case SET_ITEMS_ATTRIBUTES:
return setItemsAttributes(state, action.itemsAttributes);
case SET_LINES_ATTRIBUTES:
return setLinesAttributes(state, action.linesAttributes);
case SET_HOLES_ATTRIBUTES:
return setHolesAttributes(state, action.holesAttributes);
case REMOVE:
return remove(state);
case UNDO:
return undo(state);
case ROLLBACK:
return rollback(state);
case SET_PROJECT_PROPERTIES:
return setProjectProperties(state, action.properties);
case OPEN_PROJECT_CONFIGURATOR:
return openProjectConfigurator(state);
case INIT_CATALOG:
return initCatalog(state, action.catalog);
case UPDATE_MOUSE_COORDS:
return updateMouseCoord(state, action.coords);
case UPDATE_ZOOM_SCALE:
return updateZoomScale(state, action.scale);
case TOGGLE_SNAP:
return toggleSnap(state, action.mask);
case THROW_ERROR:
return throwError(state, action.error);
case THROW_WARNING:
return throwWarning(state, action.warning);
case COPY_PROPERTIES:
return copyProperties(state, action.properties);
case PASTE_PROPERTIES:
return pasteProperties(state);
default:
return state;
}
}
function openCatalog(state) {
return rollback(state)
.set('mode', MODE_VIEWING_CATALOG);
}
function newProject(state) {
return new State();
}
function loadProject(state, sceneJSON) {
return new State({scene: sceneJSON, catalog: state.catalog.toJS()});
}
function setProperties(state, properties) {
let scene = state.scene;
scene = scene.set('layers', scene.layers.map(layer => setPropertiesOnSelected(layer, properties)));
return state.merge({
scene,
sceneHistory: state.sceneHistory.push(scene)
})
}
function updateProperties(state, properties) {
let scene = state.scene;
scene = scene.set('layers', scene.layers.map(layer => updatePropertiesOnSelected(layer, properties)));
return state.merge({
scene,
sceneHistory: state.sceneHistory.push(scene)
})
}
function setItemsAttributes(state, attributes) {
let scene = state.scene;
scene = scene.set('layers', scene.layers.map(layer => setAttributesOnSelected(layer, attributes, state.catalog)));
return state.merge({
scene,
sceneHistory: state.sceneHistory.push(scene)
});
}
function setLinesAttributes(state, attributes) {
let scene = state.scene;
scene = scene.set('layers', scene.layers.map(layer => setAttributesOnSelected(layer, attributes, state.catalog)));
return state.merge({
scene,
sceneHistory: state.sceneHistory.push(scene)
});
}
function setHolesAttributes(state, attributes) {
let scene = state.scene;
scene = scene.set('layers', scene.layers.map(layer => setAttributesOnSelected(layer, attributes, state.catalog)));
return state.merge({
scene,
sceneHistory: state.sceneHistory.push(scene)
});
}
function unselectAll(state) {
let scene = state.scene;
scene = scene.update('layers', layer => layer.map(unselectAllOp));
return state.merge({
scene,
sceneHistory: state.sceneHistory.push(scene)
})
}
function remove(state) {
let scene = state.scene;
let catalog = state.catalog;
scene = scene.updateIn(['layers', scene.selectedLayer], layer => layer.withMutations(layer => {
let {lines: selectedLines, holes: selectedHoles, items: selectedItems} = layer.selected;
unselectAllOp(layer);
selectedLines.forEach(lineID => removeLine(layer, lineID));
selectedHoles.forEach(holeID => removeHole(layer, holeID));
selectedItems.forEach(itemID => removeItem(layer, itemID));
detectAndUpdateAreas(layer, catalog);
}));
return state.merge({
scene,
sceneHistory: state.sceneHistory.push(scene)
})
}
function undo(state) {
let sceneHistory = state.sceneHistory;
if (state.scene === sceneHistory.last() && !sceneHistory.size > 1)
sceneHistory = sceneHistory.pop();
switch (sceneHistory.size) {
case 0:
return state;
case 1:
return state.merge({
mode: MODE_IDLE,
scene: sceneHistory.last(),
});
default:
return state.merge({
mode: MODE_IDLE,
scene: sceneHistory.last(),
sceneHistory: sceneHistory.pop()
});
}
}
export function rollback(state) {
let sceneHistory = state.sceneHistory;
if (sceneHistory.isEmpty()) return state;
let scene = sceneHistory
.last()
.update('layers', layer => layer.map(unselectAllOp));
return state.merge({
mode: MODE_IDLE,
scene,
sceneHistory: state.sceneHistory.push(scene),
snapElements: new List(),
activeSnapElement: null,
drawingSupport: new Map(),
draggingSupport: new Map(),
rotatingSupport: new Map(),
});
}
function setProjectProperties(state, properties) {
let scene = state.scene.merge(properties);
return state.merge({
mode: MODE_IDLE,
scene,
sceneHistory: state.sceneHistory.push(scene)
});
}
function openProjectConfigurator(state) {
return state.merge({
mode: MODE_CONFIGURING_PROJECT,
});
}
function initCatalog(state, catalog) {
return state.set('catalog', new Catalog(catalog));
}
function updateMouseCoord(state, coords) {
return state.set('mouse', new Map(coords));
}
function updateZoomScale(state, scale) {
return state.set('zoom', scale);
}
function toggleSnap(state, mask) {
return state.set('snapMask', mask);
}
function throwError(state, error) {
return state.set('errors', state.get('errors').push({
date: Date.now(),
error
}));
}
const throwWarning = (state, warning) => state.set('warnings', state.get('warnings').push({
date: Date.now(),
warning
}));
const copyProperties = (state, properties) => state.set('clipboardProperties', properties.toJS());
const pasteProperties = (state) => updateProperties(state, state.get('clipboardProperties'));
|
vovance/3d-demo
|
src/reducers/project-reducer.js
|
JavaScript
|
mit
| 7,875
|
/*
**********************************************************************
* Copyright (C) 1998-2008, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*
* File ustring.h
*
* Modification History:
*
* Date Name Description
* 12/07/98 bertrand Creation.
******************************************************************************
*/
#ifndef USTRING_H
#define USTRING_H
#include "unicode/utypes.h"
#include "unicode/putil.h"
#include "unicode/uiter.h"
/** Simple declaration for u_strToTitle() to avoid including unicode/ubrk.h. @stable ICU 2.1*/
#ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
# define UBRK_TYPEDEF_UBREAK_ITERATOR
typedef void UBreakIterator;
#endif
/**
* \file
* \brief C API: Unicode string handling functions
*
* These C API functions provide general Unicode string handling.
*
* Some functions are equivalent in name, signature, and behavior to the ANSI C <string.h>
* functions. (For example, they do not check for bad arguments like NULL string pointers.)
* In some cases, only the thread-safe variant of such a function is implemented here
* (see u_strtok_r()).
*
* Other functions provide more Unicode-specific functionality like locale-specific
* upper/lower-casing and string comparison in code point order.
*
* ICU uses 16-bit Unicode (UTF-16) in the form of arrays of UChar code units.
* UTF-16 encodes each Unicode code point with either one or two UChar code units.
* (This is the default form of Unicode, and a forward-compatible extension of the original,
* fixed-width form that was known as UCS-2. UTF-16 superseded UCS-2 with Unicode 2.0
* in 1996.)
*
* Some APIs accept a 32-bit UChar32 value for a single code point.
*
* ICU also handles 16-bit Unicode text with unpaired surrogates.
* Such text is not well-formed UTF-16.
* Code-point-related functions treat unpaired surrogates as surrogate code points,
* i.e., as separate units.
*
* Although UTF-16 is a variable-width encoding form (like some legacy multi-byte encodings),
* it is much more efficient even for random access because the code unit values
* for single-unit characters vs. lead units vs. trail units are completely disjoint.
* This means that it is easy to determine character (code point) boundaries from
* random offsets in the string.
*
* Unicode (UTF-16) string processing is optimized for the single-unit case.
* Although it is important to support supplementary characters
* (which use pairs of lead/trail code units called "surrogates"),
* their occurrence is rare. Almost all characters in modern use require only
* a single UChar code unit (i.e., their code point values are <=0xffff).
*
* For more details see the User Guide Strings chapter (http://icu-project.org/userguide/strings.html).
* For a discussion of the handling of unpaired surrogates see also
* Jitterbug 2145 and its icu mailing list proposal on 2002-sep-18.
*/
/**
* \defgroup ustring_ustrlen String Length
* \ingroup ustring_strlen
*/
/*@{*/
/**
* Determine the length of an array of UChar.
*
* @param s The array of UChars, NULL (U+0000) terminated.
* @return The number of UChars in <code>chars</code>, minus the terminator.
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_strlen(const UChar *s);
/*@}*/
/**
* Count Unicode code points in the length UChar code units of the string.
* A code point may occupy either one or two UChar code units.
* Counting code points involves reading all code units.
*
* This functions is basically the inverse of the U16_FWD_N() macro (see utf.h).
*
* @param s The input string.
* @param length The number of UChar code units to be checked, or -1 to count all
* code points before the first NUL (U+0000).
* @return The number of code points in the specified code units.
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_countChar32(const UChar *s, int32_t length);
/**
* Check if the string contains more Unicode code points than a certain number.
* This is more efficient than counting all code points in the entire string
* and comparing that number with a threshold.
* This function may not need to scan the string at all if the length is known
* (not -1 for NUL-termination) and falls within a certain range, and
* never needs to count more than 'number+1' code points.
* Logically equivalent to (u_countChar32(s, length)>number).
* A Unicode code point may occupy either one or two UChar code units.
*
* @param s The input string.
* @param length The length of the string, or -1 if it is NUL-terminated.
* @param number The number of code points in the string is compared against
* the 'number' parameter.
* @return Boolean value for whether the string contains more Unicode code points
* than 'number'. Same as (u_countChar32(s, length)>number).
* @stable ICU 2.4
*/
U_STABLE UBool U_EXPORT2
u_strHasMoreChar32Than(const UChar *s, int32_t length, int32_t number);
/**
* Concatenate two ustrings. Appends a copy of <code>src</code>,
* including the null terminator, to <code>dst</code>. The initial copied
* character from <code>src</code> overwrites the null terminator in <code>dst</code>.
*
* @param dst The destination string.
* @param src The source string.
* @return A pointer to <code>dst</code>.
* @stable ICU 2.0
*/
U_STABLE UChar* U_EXPORT2
u_strcat(UChar *dst,
const UChar *src);
/**
* Concatenate two ustrings.
* Appends at most <code>n</code> characters from <code>src</code> to <code>dst</code>.
* Adds a terminating NUL.
* If src is too long, then only <code>n-1</code> characters will be copied
* before the terminating NUL.
* If <code>n<=0</code> then dst is not modified.
*
* @param dst The destination string.
* @param src The source string.
* @param n The maximum number of characters to compare.
* @return A pointer to <code>dst</code>.
* @stable ICU 2.0
*/
U_STABLE UChar* U_EXPORT2
u_strncat(UChar *dst,
const UChar *src,
int32_t n);
/**
* Find the first occurrence of a substring in a string.
* The substring is found at code point boundaries.
* That means that if the substring begins with
* a trail surrogate or ends with a lead surrogate,
* then it is found only if these surrogates stand alone in the text.
* Otherwise, the substring edge units would be matched against
* halves of surrogate pairs.
*
* @param s The string to search (NUL-terminated).
* @param substring The substring to find (NUL-terminated).
* @return A pointer to the first occurrence of <code>substring</code> in <code>s</code>,
* or <code>s</code> itself if the <code>substring</code> is empty,
* or <code>NULL</code> if <code>substring</code> is not in <code>s</code>.
* @stable ICU 2.0
*
* @see u_strrstr
* @see u_strFindFirst
* @see u_strFindLast
*/
U_STABLE UChar * U_EXPORT2
u_strstr(const UChar *s, const UChar *substring);
/**
* Find the first occurrence of a substring in a string.
* The substring is found at code point boundaries.
* That means that if the substring begins with
* a trail surrogate or ends with a lead surrogate,
* then it is found only if these surrogates stand alone in the text.
* Otherwise, the substring edge units would be matched against
* halves of surrogate pairs.
*
* @param s The string to search.
* @param length The length of s (number of UChars), or -1 if it is NUL-terminated.
* @param substring The substring to find (NUL-terminated).
* @param subLength The length of substring (number of UChars), or -1 if it is NUL-terminated.
* @return A pointer to the first occurrence of <code>substring</code> in <code>s</code>,
* or <code>s</code> itself if the <code>substring</code> is empty,
* or <code>NULL</code> if <code>substring</code> is not in <code>s</code>.
* @stable ICU 2.4
*
* @see u_strstr
* @see u_strFindLast
*/
U_STABLE UChar * U_EXPORT2
u_strFindFirst(const UChar *s, int32_t length, const UChar *substring, int32_t subLength);
/**
* Find the first occurrence of a BMP code point in a string.
* A surrogate code point is found only if its match in the text is not
* part of a surrogate pair.
* A NUL character is found at the string terminator.
*
* @param s The string to search (NUL-terminated).
* @param c The BMP code point to find.
* @return A pointer to the first occurrence of <code>c</code> in <code>s</code>
* or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
* @stable ICU 2.0
*
* @see u_strchr32
* @see u_memchr
* @see u_strstr
* @see u_strFindFirst
*/
U_STABLE UChar * U_EXPORT2
u_strchr(const UChar *s, UChar c);
/**
* Find the first occurrence of a code point in a string.
* A surrogate code point is found only if its match in the text is not
* part of a surrogate pair.
* A NUL character is found at the string terminator.
*
* @param s The string to search (NUL-terminated).
* @param c The code point to find.
* @return A pointer to the first occurrence of <code>c</code> in <code>s</code>
* or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
* @stable ICU 2.0
*
* @see u_strchr
* @see u_memchr32
* @see u_strstr
* @see u_strFindFirst
*/
U_STABLE UChar * U_EXPORT2
u_strchr32(const UChar *s, UChar32 c);
/**
* Find the last occurrence of a substring in a string.
* The substring is found at code point boundaries.
* That means that if the substring begins with
* a trail surrogate or ends with a lead surrogate,
* then it is found only if these surrogates stand alone in the text.
* Otherwise, the substring edge units would be matched against
* halves of surrogate pairs.
*
* @param s The string to search (NUL-terminated).
* @param substring The substring to find (NUL-terminated).
* @return A pointer to the last occurrence of <code>substring</code> in <code>s</code>,
* or <code>s</code> itself if the <code>substring</code> is empty,
* or <code>NULL</code> if <code>substring</code> is not in <code>s</code>.
* @stable ICU 2.4
*
* @see u_strstr
* @see u_strFindFirst
* @see u_strFindLast
*/
U_STABLE UChar * U_EXPORT2
u_strrstr(const UChar *s, const UChar *substring);
/**
* Find the last occurrence of a substring in a string.
* The substring is found at code point boundaries.
* That means that if the substring begins with
* a trail surrogate or ends with a lead surrogate,
* then it is found only if these surrogates stand alone in the text.
* Otherwise, the substring edge units would be matched against
* halves of surrogate pairs.
*
* @param s The string to search.
* @param length The length of s (number of UChars), or -1 if it is NUL-terminated.
* @param substring The substring to find (NUL-terminated).
* @param subLength The length of substring (number of UChars), or -1 if it is NUL-terminated.
* @return A pointer to the last occurrence of <code>substring</code> in <code>s</code>,
* or <code>s</code> itself if the <code>substring</code> is empty,
* or <code>NULL</code> if <code>substring</code> is not in <code>s</code>.
* @stable ICU 2.4
*
* @see u_strstr
* @see u_strFindLast
*/
U_STABLE UChar * U_EXPORT2
u_strFindLast(const UChar *s, int32_t length, const UChar *substring, int32_t subLength);
/**
* Find the last occurrence of a BMP code point in a string.
* A surrogate code point is found only if its match in the text is not
* part of a surrogate pair.
* A NUL character is found at the string terminator.
*
* @param s The string to search (NUL-terminated).
* @param c The BMP code point to find.
* @return A pointer to the last occurrence of <code>c</code> in <code>s</code>
* or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
* @stable ICU 2.4
*
* @see u_strrchr32
* @see u_memrchr
* @see u_strrstr
* @see u_strFindLast
*/
U_STABLE UChar * U_EXPORT2
u_strrchr(const UChar *s, UChar c);
/**
* Find the last occurrence of a code point in a string.
* A surrogate code point is found only if its match in the text is not
* part of a surrogate pair.
* A NUL character is found at the string terminator.
*
* @param s The string to search (NUL-terminated).
* @param c The code point to find.
* @return A pointer to the last occurrence of <code>c</code> in <code>s</code>
* or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
* @stable ICU 2.4
*
* @see u_strrchr
* @see u_memchr32
* @see u_strrstr
* @see u_strFindLast
*/
U_STABLE UChar * U_EXPORT2
u_strrchr32(const UChar *s, UChar32 c);
/**
* Locates the first occurrence in the string <code>string</code> of any of the characters
* in the string <code>matchSet</code>.
* Works just like C's strpbrk but with Unicode.
*
* @param string The string in which to search, NUL-terminated.
* @param matchSet A NUL-terminated string defining a set of code points
* for which to search in the text string.
* @return A pointer to the character in <code>string</code> that matches one of the
* characters in <code>matchSet</code>, or NULL if no such character is found.
* @stable ICU 2.0
*/
U_STABLE UChar * U_EXPORT2
u_strpbrk(const UChar *string, const UChar *matchSet);
/**
* Returns the number of consecutive characters in <code>string</code>,
* beginning with the first, that do not occur somewhere in <code>matchSet</code>.
* Works just like C's strcspn but with Unicode.
*
* @param string The string in which to search, NUL-terminated.
* @param matchSet A NUL-terminated string defining a set of code points
* for which to search in the text string.
* @return The number of initial characters in <code>string</code> that do not
* occur in <code>matchSet</code>.
* @see u_strspn
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_strcspn(const UChar *string, const UChar *matchSet);
/**
* Returns the number of consecutive characters in <code>string</code>,
* beginning with the first, that occur somewhere in <code>matchSet</code>.
* Works just like C's strspn but with Unicode.
*
* @param string The string in which to search, NUL-terminated.
* @param matchSet A NUL-terminated string defining a set of code points
* for which to search in the text string.
* @return The number of initial characters in <code>string</code> that do
* occur in <code>matchSet</code>.
* @see u_strcspn
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_strspn(const UChar *string, const UChar *matchSet);
/**
* The string tokenizer API allows an application to break a string into
* tokens. Unlike strtok(), the saveState (the current pointer within the
* original string) is maintained in saveState. In the first call, the
* argument src is a pointer to the string. In subsequent calls to
* return successive tokens of that string, src must be specified as
* NULL. The value saveState is set by this function to maintain the
* function's position within the string, and on each subsequent call
* you must give this argument the same variable. This function does
* handle surrogate pairs. This function is similar to the strtok_r()
* the POSIX Threads Extension (1003.1c-1995) version.
*
* @param src String containing token(s). This string will be modified.
* After the first call to u_strtok_r(), this argument must
* be NULL to get to the next token.
* @param delim Set of delimiter characters (Unicode code points).
* @param saveState The current pointer within the original string,
* which is set by this function. The saveState
* parameter should the address of a local variable of type
* UChar *. (i.e. defined "Uhar *myLocalSaveState" and use
* &myLocalSaveState for this parameter).
* @return A pointer to the next token found in src, or NULL
* when there are no more tokens.
* @stable ICU 2.0
*/
U_STABLE UChar * U_EXPORT2
u_strtok_r(UChar *src,
const UChar *delim,
UChar **saveState);
/**
* Compare two Unicode strings for bitwise equality (code unit order).
*
* @param s1 A string to compare.
* @param s2 A string to compare.
* @return 0 if <code>s1</code> and <code>s2</code> are bitwise equal; a negative
* value if <code>s1</code> is bitwise less than <code>s2,</code>; a positive
* value if <code>s1</code> is bitwise greater than <code>s2</code>.
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_strcmp(const UChar *s1,
const UChar *s2);
/**
* Compare two Unicode strings in code point order.
* See u_strCompare for details.
*
* @param s1 A string to compare.
* @param s2 A string to compare.
* @return a negative/zero/positive integer corresponding to whether
* the first string is less than/equal to/greater than the second one
* in code point order
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_strcmpCodePointOrder(const UChar *s1, const UChar *s2);
/**
* Compare two Unicode strings (binary order).
*
* The comparison can be done in code unit order or in code point order.
* They differ only in UTF-16 when
* comparing supplementary code points (U+10000..U+10ffff)
* to BMP code points near the end of the BMP (i.e., U+e000..U+ffff).
* In code unit order, high BMP code points sort after supplementary code points
* because they are stored as pairs of surrogates which are at U+d800..U+dfff.
*
* This functions works with strings of different explicitly specified lengths
* unlike the ANSI C-like u_strcmp() and u_memcmp() etc.
* NUL-terminated strings are possible with length arguments of -1.
*
* @param s1 First source string.
* @param length1 Length of first source string, or -1 if NUL-terminated.
*
* @param s2 Second source string.
* @param length2 Length of second source string, or -1 if NUL-terminated.
*
* @param codePointOrder Choose between code unit order (FALSE)
* and code point order (TRUE).
*
* @return <0 or 0 or >0 as usual for string comparisons
*
* @stable ICU 2.2
*/
U_STABLE int32_t U_EXPORT2
u_strCompare(const UChar *s1, int32_t length1,
const UChar *s2, int32_t length2,
UBool codePointOrder);
/**
* Compare two Unicode strings (binary order)
* as presented by UCharIterator objects.
* Works otherwise just like u_strCompare().
*
* Both iterators are reset to their start positions.
* When the function returns, it is undefined where the iterators
* have stopped.
*
* @param iter1 First source string iterator.
* @param iter2 Second source string iterator.
* @param codePointOrder Choose between code unit order (FALSE)
* and code point order (TRUE).
*
* @return <0 or 0 or >0 as usual for string comparisons
*
* @see u_strCompare
*
* @stable ICU 2.6
*/
U_STABLE int32_t U_EXPORT2
u_strCompareIter(UCharIterator *iter1, UCharIterator *iter2, UBool codePointOrder);
#ifndef U_COMPARE_CODE_POINT_ORDER
/* see also unistr.h and unorm.h */
/**
* Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc:
* Compare strings in code point order instead of code unit order.
* @stable ICU 2.2
*/
#define U_COMPARE_CODE_POINT_ORDER 0x8000
#endif
/**
* Compare two strings case-insensitively using full case folding.
* This is equivalent to
* u_strCompare(u_strFoldCase(s1, options),
* u_strFoldCase(s2, options),
* (options&U_COMPARE_CODE_POINT_ORDER)!=0).
*
* The comparison can be done in UTF-16 code unit order or in code point order.
* They differ only when comparing supplementary code points (U+10000..U+10ffff)
* to BMP code points near the end of the BMP (i.e., U+e000..U+ffff).
* In code unit order, high BMP code points sort after supplementary code points
* because they are stored as pairs of surrogates which are at U+d800..U+dfff.
*
* This functions works with strings of different explicitly specified lengths
* unlike the ANSI C-like u_strcmp() and u_memcmp() etc.
* NUL-terminated strings are possible with length arguments of -1.
*
* @param s1 First source string.
* @param length1 Length of first source string, or -1 if NUL-terminated.
*
* @param s2 Second source string.
* @param length2 Length of second source string, or -1 if NUL-terminated.
*
* @param options A bit set of options:
* - U_FOLD_CASE_DEFAULT or 0 is used for default options:
* Comparison in code unit order with default case folding.
*
* - U_COMPARE_CODE_POINT_ORDER
* Set to choose code point order instead of code unit order
* (see u_strCompare for details).
*
* - U_FOLD_CASE_EXCLUDE_SPECIAL_I
*
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
*
* @return <0 or 0 or >0 as usual for string comparisons
*
* @stable ICU 2.2
*/
U_STABLE int32_t U_EXPORT2
u_strCaseCompare(const UChar *s1, int32_t length1,
const UChar *s2, int32_t length2,
uint32_t options,
UErrorCode *pErrorCode);
/**
* Compare two ustrings for bitwise equality.
* Compares at most <code>n</code> characters.
*
* @param ucs1 A string to compare.
* @param ucs2 A string to compare.
* @param n The maximum number of characters to compare.
* @return 0 if <code>s1</code> and <code>s2</code> are bitwise equal; a negative
* value if <code>s1</code> is bitwise less than <code>s2</code>; a positive
* value if <code>s1</code> is bitwise greater than <code>s2</code>.
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_strncmp(const UChar *ucs1,
const UChar *ucs2,
int32_t n);
/**
* Compare two Unicode strings in code point order.
* This is different in UTF-16 from u_strncmp() if supplementary characters are present.
* For details, see u_strCompare().
*
* @param s1 A string to compare.
* @param s2 A string to compare.
* @param n The maximum number of characters to compare.
* @return a negative/zero/positive integer corresponding to whether
* the first string is less than/equal to/greater than the second one
* in code point order
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_strncmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t n);
/**
* Compare two strings case-insensitively using full case folding.
* This is equivalent to u_strcmp(u_strFoldCase(s1, options), u_strFoldCase(s2, options)).
*
* @param s1 A string to compare.
* @param s2 A string to compare.
* @param options A bit set of options:
* - U_FOLD_CASE_DEFAULT or 0 is used for default options:
* Comparison in code unit order with default case folding.
*
* - U_COMPARE_CODE_POINT_ORDER
* Set to choose code point order instead of code unit order
* (see u_strCompare for details).
*
* - U_FOLD_CASE_EXCLUDE_SPECIAL_I
*
* @return A negative, zero, or positive integer indicating the comparison result.
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_strcasecmp(const UChar *s1, const UChar *s2, uint32_t options);
/**
* Compare two strings case-insensitively using full case folding.
* This is equivalent to u_strcmp(u_strFoldCase(s1, at most n, options),
* u_strFoldCase(s2, at most n, options)).
*
* @param s1 A string to compare.
* @param s2 A string to compare.
* @param n The maximum number of characters each string to case-fold and then compare.
* @param options A bit set of options:
* - U_FOLD_CASE_DEFAULT or 0 is used for default options:
* Comparison in code unit order with default case folding.
*
* - U_COMPARE_CODE_POINT_ORDER
* Set to choose code point order instead of code unit order
* (see u_strCompare for details).
*
* - U_FOLD_CASE_EXCLUDE_SPECIAL_I
*
* @return A negative, zero, or positive integer indicating the comparison result.
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_strncasecmp(const UChar *s1, const UChar *s2, int32_t n, uint32_t options);
/**
* Compare two strings case-insensitively using full case folding.
* This is equivalent to u_strcmp(u_strFoldCase(s1, n, options),
* u_strFoldCase(s2, n, options)).
*
* @param s1 A string to compare.
* @param s2 A string to compare.
* @param length The number of characters in each string to case-fold and then compare.
* @param options A bit set of options:
* - U_FOLD_CASE_DEFAULT or 0 is used for default options:
* Comparison in code unit order with default case folding.
*
* - U_COMPARE_CODE_POINT_ORDER
* Set to choose code point order instead of code unit order
* (see u_strCompare for details).
*
* - U_FOLD_CASE_EXCLUDE_SPECIAL_I
*
* @return A negative, zero, or positive integer indicating the comparison result.
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_memcasecmp(const UChar *s1, const UChar *s2, int32_t length, uint32_t options);
/**
* Copy a ustring. Adds a null terminator.
*
* @param dst The destination string.
* @param src The source string.
* @return A pointer to <code>dst</code>.
* @stable ICU 2.0
*/
U_STABLE UChar* U_EXPORT2
u_strcpy(UChar *dst,
const UChar *src);
/**
* Copy a ustring.
* Copies at most <code>n</code> characters. The result will be null terminated
* if the length of <code>src</code> is less than <code>n</code>.
*
* @param dst The destination string.
* @param src The source string.
* @param n The maximum number of characters to copy.
* @return A pointer to <code>dst</code>.
* @stable ICU 2.0
*/
U_STABLE UChar* U_EXPORT2
u_strncpy(UChar *dst,
const UChar *src,
int32_t n);
#if !UCONFIG_NO_CONVERSION
/**
* Copy a byte string encoded in the default codepage to a ustring.
* Adds a null terminator.
* Performs a host byte to UChar conversion
*
* @param dst The destination string.
* @param src The source string.
* @return A pointer to <code>dst</code>.
* @stable ICU 2.0
*/
U_STABLE UChar* U_EXPORT2 u_uastrcpy(UChar *dst,
const char *src );
/**
* Copy a byte string encoded in the default codepage to a ustring.
* Copies at most <code>n</code> characters. The result will be null terminated
* if the length of <code>src</code> is less than <code>n</code>.
* Performs a host byte to UChar conversion
*
* @param dst The destination string.
* @param src The source string.
* @param n The maximum number of characters to copy.
* @return A pointer to <code>dst</code>.
* @stable ICU 2.0
*/
U_STABLE UChar* U_EXPORT2 u_uastrncpy(UChar *dst,
const char *src,
int32_t n);
/**
* Copy ustring to a byte string encoded in the default codepage.
* Adds a null terminator.
* Performs a UChar to host byte conversion
*
* @param dst The destination string.
* @param src The source string.
* @return A pointer to <code>dst</code>.
* @stable ICU 2.0
*/
U_STABLE char* U_EXPORT2 u_austrcpy(char *dst,
const UChar *src );
/**
* Copy ustring to a byte string encoded in the default codepage.
* Copies at most <code>n</code> characters. The result will be null terminated
* if the length of <code>src</code> is less than <code>n</code>.
* Performs a UChar to host byte conversion
*
* @param dst The destination string.
* @param src The source string.
* @param n The maximum number of characters to copy.
* @return A pointer to <code>dst</code>.
* @stable ICU 2.0
*/
U_STABLE char* U_EXPORT2 u_austrncpy(char *dst,
const UChar *src,
int32_t n );
#endif
/**
* Synonym for memcpy(), but with UChars only.
* @param dest The destination string
* @param src The source string
* @param count The number of characters to copy
* @return A pointer to <code>dest</code>
* @stable ICU 2.0
*/
U_STABLE UChar* U_EXPORT2
u_memcpy(UChar *dest, const UChar *src, int32_t count);
/**
* Synonym for memmove(), but with UChars only.
* @param dest The destination string
* @param src The source string
* @param count The number of characters to move
* @return A pointer to <code>dest</code>
* @stable ICU 2.0
*/
U_STABLE UChar* U_EXPORT2
u_memmove(UChar *dest, const UChar *src, int32_t count);
/**
* Initialize <code>count</code> characters of <code>dest</code> to <code>c</code>.
*
* @param dest The destination string.
* @param c The character to initialize the string.
* @param count The maximum number of characters to set.
* @return A pointer to <code>dest</code>.
* @stable ICU 2.0
*/
U_STABLE UChar* U_EXPORT2
u_memset(UChar *dest, UChar c, int32_t count);
/**
* Compare the first <code>count</code> UChars of each buffer.
*
* @param buf1 The first string to compare.
* @param buf2 The second string to compare.
* @param count The maximum number of UChars to compare.
* @return When buf1 < buf2, a negative number is returned.
* When buf1 == buf2, 0 is returned.
* When buf1 > buf2, a positive number is returned.
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_memcmp(const UChar *buf1, const UChar *buf2, int32_t count);
/**
* Compare two Unicode strings in code point order.
* This is different in UTF-16 from u_memcmp() if supplementary characters are present.
* For details, see u_strCompare().
*
* @param s1 A string to compare.
* @param s2 A string to compare.
* @param count The maximum number of characters to compare.
* @return a negative/zero/positive integer corresponding to whether
* the first string is less than/equal to/greater than the second one
* in code point order
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_memcmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t count);
/**
* Find the first occurrence of a BMP code point in a string.
* A surrogate code point is found only if its match in the text is not
* part of a surrogate pair.
* A NUL character is found at the string terminator.
*
* @param s The string to search (contains <code>count</code> UChars).
* @param c The BMP code point to find.
* @param count The length of the string.
* @return A pointer to the first occurrence of <code>c</code> in <code>s</code>
* or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
* @stable ICU 2.0
*
* @see u_strchr
* @see u_memchr32
* @see u_strFindFirst
*/
U_STABLE UChar* U_EXPORT2
u_memchr(const UChar *s, UChar c, int32_t count);
/**
* Find the first occurrence of a code point in a string.
* A surrogate code point is found only if its match in the text is not
* part of a surrogate pair.
* A NUL character is found at the string terminator.
*
* @param s The string to search (contains <code>count</code> UChars).
* @param c The code point to find.
* @param count The length of the string.
* @return A pointer to the first occurrence of <code>c</code> in <code>s</code>
* or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
* @stable ICU 2.0
*
* @see u_strchr32
* @see u_memchr
* @see u_strFindFirst
*/
U_STABLE UChar* U_EXPORT2
u_memchr32(const UChar *s, UChar32 c, int32_t count);
/**
* Find the last occurrence of a BMP code point in a string.
* A surrogate code point is found only if its match in the text is not
* part of a surrogate pair.
* A NUL character is found at the string terminator.
*
* @param s The string to search (contains <code>count</code> UChars).
* @param c The BMP code point to find.
* @param count The length of the string.
* @return A pointer to the last occurrence of <code>c</code> in <code>s</code>
* or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
* @stable ICU 2.4
*
* @see u_strrchr
* @see u_memrchr32
* @see u_strFindLast
*/
U_STABLE UChar* U_EXPORT2
u_memrchr(const UChar *s, UChar c, int32_t count);
/**
* Find the last occurrence of a code point in a string.
* A surrogate code point is found only if its match in the text is not
* part of a surrogate pair.
* A NUL character is found at the string terminator.
*
* @param s The string to search (contains <code>count</code> UChars).
* @param c The code point to find.
* @param count The length of the string.
* @return A pointer to the last occurrence of <code>c</code> in <code>s</code>
* or <code>NULL</code> if <code>c</code> is not in <code>s</code>.
* @stable ICU 2.4
*
* @see u_strrchr32
* @see u_memrchr
* @see u_strFindLast
*/
U_STABLE UChar* U_EXPORT2
u_memrchr32(const UChar *s, UChar32 c, int32_t count);
/**
* Unicode String literals in C.
* We need one macro to declare a variable for the string
* and to statically preinitialize it if possible,
* and a second macro to dynamically intialize such a string variable if necessary.
*
* The macros are defined for maximum performance.
* They work only for strings that contain "invariant characters", i.e.,
* only latin letters, digits, and some punctuation.
* See utypes.h for details.
*
* A pair of macros for a single string must be used with the same
* parameters.
* The string parameter must be a C string literal.
* The length of the string, not including the terminating
* <code>NUL</code>, must be specified as a constant.
* The U_STRING_DECL macro should be invoked exactly once for one
* such string variable before it is used.
*
* Usage:
* <pre>
* U_STRING_DECL(ustringVar1, "Quick-Fox 2", 11);
* U_STRING_DECL(ustringVar2, "jumps 5%", 8);
* static UBool didInit=FALSE;
*
* int32_t function() {
* if(!didInit) {
* U_STRING_INIT(ustringVar1, "Quick-Fox 2", 11);
* U_STRING_INIT(ustringVar2, "jumps 5%", 8);
* didInit=TRUE;
* }
* return u_strcmp(ustringVar1, ustringVar2);
* }
* </pre>
* @stable ICU 2.0
*/
#if defined(U_DECLARE_UTF16)
# define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]=U_DECLARE_UTF16(cs)
/**@stable ICU 2.0 */
# define U_STRING_INIT(var, cs, length)
#elif U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && (U_CHARSET_FAMILY==U_ASCII_FAMILY || (U_SIZEOF_UCHAR == 2 && defined(U_WCHAR_IS_UTF16)))
# define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]=L ## cs
/**@stable ICU 2.0 */
# define U_STRING_INIT(var, cs, length)
#elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
# define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]=cs
/**@stable ICU 2.0 */
# define U_STRING_INIT(var, cs, length)
#else
# define U_STRING_DECL(var, cs, length) static UChar var[(length)+1]
/**@stable ICU 2.0 */
# define U_STRING_INIT(var, cs, length) u_charsToUChars(cs, var, length+1)
#endif
/**
* Unescape a string of characters and write the resulting
* Unicode characters to the destination buffer. The following escape
* sequences are recognized:
*
* \\uhhhh 4 hex digits; h in [0-9A-Fa-f]
* \\Uhhhhhhhh 8 hex digits
* \\xhh 1-2 hex digits
* \\x{h...} 1-8 hex digits
* \\ooo 1-3 octal digits; o in [0-7]
* \\cX control-X; X is masked with 0x1F
*
* as well as the standard ANSI C escapes:
*
* \\a => U+0007, \\b => U+0008, \\t => U+0009, \\n => U+000A,
* \\v => U+000B, \\f => U+000C, \\r => U+000D, \\e => U+001B,
* \\" => U+0022, \\' => U+0027, \\? => U+003F, \\\\ => U+005C
*
* Anything else following a backslash is generically escaped. For
* example, "[a\\-z]" returns "[a-z]".
*
* If an escape sequence is ill-formed, this method returns an empty
* string. An example of an ill-formed sequence is "\\u" followed by
* fewer than 4 hex digits.
*
* The above characters are recognized in the compiler's codepage,
* that is, they are coded as 'u', '\\', etc. Characters that are
* not parts of escape sequences are converted using u_charsToUChars().
*
* This function is similar to UnicodeString::unescape() but not
* identical to it. The latter takes a source UnicodeString, so it
* does escape recognition but no conversion.
*
* @param src a zero-terminated string of invariant characters
* @param dest pointer to buffer to receive converted and unescaped
* text and, if there is room, a zero terminator. May be NULL for
* preflighting, in which case no UChars will be written, but the
* return value will still be valid. On error, an empty string is
* stored here (if possible).
* @param destCapacity the number of UChars that may be written at
* dest. Ignored if dest == NULL.
* @return the length of unescaped string.
* @see u_unescapeAt
* @see UnicodeString#unescape()
* @see UnicodeString#unescapeAt()
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_unescape(const char *src,
UChar *dest, int32_t destCapacity);
U_CDECL_BEGIN
/**
* Callback function for u_unescapeAt() that returns a character of
* the source text given an offset and a context pointer. The context
* pointer will be whatever is passed into u_unescapeAt().
*
* @param offset pointer to the offset that will be passed to u_unescapeAt().
* @param context an opaque pointer passed directly into u_unescapeAt()
* @return the character represented by the escape sequence at
* offset
* @see u_unescapeAt
* @stable ICU 2.0
*/
typedef UChar (U_CALLCONV *UNESCAPE_CHAR_AT)(int32_t offset, void *context);
U_CDECL_END
/**
* Unescape a single sequence. The character at offset-1 is assumed
* (without checking) to be a backslash. This method takes a callback
* pointer to a function that returns the UChar at a given offset. By
* varying this callback, ICU functions are able to unescape char*
* strings, UnicodeString objects, and UFILE pointers.
*
* If offset is out of range, or if the escape sequence is ill-formed,
* (UChar32)0xFFFFFFFF is returned. See documentation of u_unescape()
* for a list of recognized sequences.
*
* @param charAt callback function that returns a UChar of the source
* text given an offset and a context pointer.
* @param offset pointer to the offset that will be passed to charAt.
* The offset value will be updated upon return to point after the
* last parsed character of the escape sequence. On error the offset
* is unchanged.
* @param length the number of characters in the source text. The
* last character of the source text is considered to be at offset
* length-1.
* @param context an opaque pointer passed directly into charAt.
* @return the character represented by the escape sequence at
* offset, or (UChar32)0xFFFFFFFF on error.
* @see u_unescape()
* @see UnicodeString#unescape()
* @see UnicodeString#unescapeAt()
* @stable ICU 2.0
*/
U_STABLE UChar32 U_EXPORT2
u_unescapeAt(UNESCAPE_CHAR_AT charAt,
int32_t *offset,
int32_t length,
void *context);
/**
* Uppercase the characters in a string.
* Casing is locale-dependent and context-sensitive.
* The result may be longer or shorter than the original.
* The source string and the destination buffer are allowed to overlap.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of UChars). If it is 0, then
* dest may be NULL and the function will only return the length of the result
* without writing any of the result string.
* @param src The original string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param locale The locale to consider, or "" for the root locale or NULL for the default locale.
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
* @return The length of the result string. It may be greater than destCapacity. In that case,
* only some of the result was written to the destination buffer.
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_strToUpper(UChar *dest, int32_t destCapacity,
const UChar *src, int32_t srcLength,
const char *locale,
UErrorCode *pErrorCode);
/**
* Lowercase the characters in a string.
* Casing is locale-dependent and context-sensitive.
* The result may be longer or shorter than the original.
* The source string and the destination buffer are allowed to overlap.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of UChars). If it is 0, then
* dest may be NULL and the function will only return the length of the result
* without writing any of the result string.
* @param src The original string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param locale The locale to consider, or "" for the root locale or NULL for the default locale.
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
* @return The length of the result string. It may be greater than destCapacity. In that case,
* only some of the result was written to the destination buffer.
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_strToLower(UChar *dest, int32_t destCapacity,
const UChar *src, int32_t srcLength,
const char *locale,
UErrorCode *pErrorCode);
#if !UCONFIG_NO_BREAK_ITERATION
/**
* Titlecase a string.
* Casing is locale-dependent and context-sensitive.
* Titlecasing uses a break iterator to find the first characters of words
* that are to be titlecased. It titlecases those characters and lowercases
* all others.
*
* The titlecase break iterator can be provided to customize for arbitrary
* styles, using rules and dictionaries beyond the standard iterators.
* It may be more efficient to always provide an iterator to avoid
* opening and closing one for each string.
* The standard titlecase iterator for the root locale implements the
* algorithm of Unicode TR 21.
*
* This function uses only the setText(), first() and next() methods of the
* provided break iterator.
*
* The result may be longer or shorter than the original.
* The source string and the destination buffer are allowed to overlap.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of UChars). If it is 0, then
* dest may be NULL and the function will only return the length of the result
* without writing any of the result string.
* @param src The original string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param titleIter A break iterator to find the first characters of words
* that are to be titlecased.
* If none is provided (NULL), then a standard titlecase
* break iterator is opened.
* @param locale The locale to consider, or "" for the root locale or NULL for the default locale.
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
* @return The length of the result string. It may be greater than destCapacity. In that case,
* only some of the result was written to the destination buffer.
* @stable ICU 2.1
*/
U_STABLE int32_t U_EXPORT2
u_strToTitle(UChar *dest, int32_t destCapacity,
const UChar *src, int32_t srcLength,
UBreakIterator *titleIter,
const char *locale,
UErrorCode *pErrorCode);
#endif
/**
* Case-fold the characters in a string.
* Case-folding is locale-independent and not context-sensitive,
* but there is an option for whether to include or exclude mappings for dotted I
* and dotless i that are marked with 'I' in CaseFolding.txt.
* The result may be longer or shorter than the original.
* The source string and the destination buffer are allowed to overlap.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of UChars). If it is 0, then
* dest may be NULL and the function will only return the length of the result
* without writing any of the result string.
* @param src The original string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param options Either U_FOLD_CASE_DEFAULT or U_FOLD_CASE_EXCLUDE_SPECIAL_I
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
* @return The length of the result string. It may be greater than destCapacity. In that case,
* only some of the result was written to the destination buffer.
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
u_strFoldCase(UChar *dest, int32_t destCapacity,
const UChar *src, int32_t srcLength,
uint32_t options,
UErrorCode *pErrorCode);
#if defined(U_WCHAR_IS_UTF16) || defined(U_WCHAR_IS_UTF32) || !UCONFIG_NO_CONVERSION
/**
* Converts a sequence of UChars to wchar_t units.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of wchar_t's). If it is 0, then
* dest may be NULL and the function will only return the length of the
* result without writing any of the result string (pre-flighting).
* @param pDestLength A pointer to receive the number of units written to the destination. If
* pDestLength!=NULL then *pDestLength is always set to the
* number of output units corresponding to the transformation of
* all the input units, even in case of a buffer overflow.
* @param src The original source string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
* @return The pointer to destination buffer.
* @stable ICU 2.0
*/
U_STABLE wchar_t* U_EXPORT2
u_strToWCS(wchar_t *dest,
int32_t destCapacity,
int32_t *pDestLength,
const UChar *src,
int32_t srcLength,
UErrorCode *pErrorCode);
/**
* Converts a sequence of wchar_t units to UChars
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of UChars). If it is 0, then
* dest may be NULL and the function will only return the length of the
* result without writing any of the result string (pre-flighting).
* @param pDestLength A pointer to receive the number of units written to the destination. If
* pDestLength!=NULL then *pDestLength is always set to the
* number of output units corresponding to the transformation of
* all the input units, even in case of a buffer overflow.
* @param src The original source string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
* @return The pointer to destination buffer.
* @stable ICU 2.0
*/
U_STABLE UChar* U_EXPORT2
u_strFromWCS(UChar *dest,
int32_t destCapacity,
int32_t *pDestLength,
const wchar_t *src,
int32_t srcLength,
UErrorCode *pErrorCode);
#endif /* defined(U_WCHAR_IS_UTF16) || defined(U_WCHAR_IS_UTF32) || !UCONFIG_NO_CONVERSION */
/**
* Converts a sequence of UChars (UTF-16) to UTF-8 bytes
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of chars). If it is 0, then
* dest may be NULL and the function will only return the length of the
* result without writing any of the result string (pre-flighting).
* @param pDestLength A pointer to receive the number of units written to the destination. If
* pDestLength!=NULL then *pDestLength is always set to the
* number of output units corresponding to the transformation of
* all the input units, even in case of a buffer overflow.
* @param src The original source string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
* @return The pointer to destination buffer.
* @stable ICU 2.0
* @see u_strToUTF8WithSub
* @see u_strFromUTF8
*/
U_STABLE char* U_EXPORT2
u_strToUTF8(char *dest,
int32_t destCapacity,
int32_t *pDestLength,
const UChar *src,
int32_t srcLength,
UErrorCode *pErrorCode);
/**
* Converts a sequence of UTF-8 bytes to UChars (UTF-16).
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of UChars). If it is 0, then
* dest may be NULL and the function will only return the length of the
* result without writing any of the result string (pre-flighting).
* @param pDestLength A pointer to receive the number of units written to the destination. If
* pDestLength!=NULL then *pDestLength is always set to the
* number of output units corresponding to the transformation of
* all the input units, even in case of a buffer overflow.
* @param src The original source string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
* @return The pointer to destination buffer.
* @stable ICU 2.0
* @see u_strFromUTF8WithSub
* @see u_strFromUTF8Lenient
*/
U_STABLE UChar* U_EXPORT2
u_strFromUTF8(UChar *dest,
int32_t destCapacity,
int32_t *pDestLength,
const char *src,
int32_t srcLength,
UErrorCode *pErrorCode);
/**
* Converts a sequence of UChars (UTF-16) to UTF-8 bytes.
* Same as u_strToUTF8() except for the additional subchar which is output for
* illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOUND error code.
* With subchar==U_SENTINEL, this function behaves exactly like u_strToUTF8().
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of chars). If it is 0, then
* dest may be NULL and the function will only return the length of the
* result without writing any of the result string (pre-flighting).
* @param pDestLength A pointer to receive the number of units written to the destination. If
* pDestLength!=NULL then *pDestLength is always set to the
* number of output units corresponding to the transformation of
* all the input units, even in case of a buffer overflow.
* @param src The original source string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param subchar The substitution character to use in place of an illegal input sequence,
* or U_SENTINEL if the function is to return with U_INVALID_CHAR_FOUND instead.
* A substitution character can be any valid Unicode code point (up to U+10FFFF)
* except for surrogate code points (U+D800..U+DFFF).
* The recommended value is U+FFFD "REPLACEMENT CHARACTER".
* @param pNumSubstitutions Output parameter receiving the number of substitutions if subchar>=0.
* Set to 0 if no substitutions occur or subchar<0.
* pNumSubstitutions can be NULL.
* @param pErrorCode Pointer to a standard ICU error code. Its input value must
* pass the U_SUCCESS() test, or else the function returns
* immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.)
* @return The pointer to destination buffer.
* @see u_strToUTF8
* @see u_strFromUTF8WithSub
* @stable ICU 3.6
*/
U_STABLE char* U_EXPORT2
u_strToUTF8WithSub(char *dest,
int32_t destCapacity,
int32_t *pDestLength,
const UChar *src,
int32_t srcLength,
UChar32 subchar, int32_t *pNumSubstitutions,
UErrorCode *pErrorCode);
/**
* Converts a sequence of UTF-8 bytes to UChars (UTF-16).
* Same as u_strFromUTF8() except for the additional subchar which is output for
* illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOUND error code.
* With subchar==U_SENTINEL, this function behaves exactly like u_strFromUTF8().
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of UChars). If it is 0, then
* dest may be NULL and the function will only return the length of the
* result without writing any of the result string (pre-flighting).
* @param pDestLength A pointer to receive the number of units written to the destination. If
* pDestLength!=NULL then *pDestLength is always set to the
* number of output units corresponding to the transformation of
* all the input units, even in case of a buffer overflow.
* @param src The original source string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param subchar The substitution character to use in place of an illegal input sequence,
* or U_SENTINEL if the function is to return with U_INVALID_CHAR_FOUND instead.
* A substitution character can be any valid Unicode code point (up to U+10FFFF)
* except for surrogate code points (U+D800..U+DFFF).
* The recommended value is U+FFFD "REPLACEMENT CHARACTER".
* @param pNumSubstitutions Output parameter receiving the number of substitutions if subchar>=0.
* Set to 0 if no substitutions occur or subchar<0.
* pNumSubstitutions can be NULL.
* @param pErrorCode Pointer to a standard ICU error code. Its input value must
* pass the U_SUCCESS() test, or else the function returns
* immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.)
* @return The pointer to destination buffer.
* @see u_strFromUTF8
* @see u_strFromUTF8Lenient
* @see u_strToUTF8WithSub
* @stable ICU 3.6
*/
U_STABLE UChar* U_EXPORT2
u_strFromUTF8WithSub(UChar *dest,
int32_t destCapacity,
int32_t *pDestLength,
const char *src,
int32_t srcLength,
UChar32 subchar, int32_t *pNumSubstitutions,
UErrorCode *pErrorCode);
/**
* Converts a sequence of UTF-8 bytes to UChars (UTF-16).
* Same as u_strFromUTF8() except that this function is designed to be very fast,
* which it achieves by being lenient about malformed UTF-8 sequences.
* This function is intended for use in environments where UTF-8 text is
* expected to be well-formed.
*
* Its semantics are:
* - Well-formed UTF-8 text is correctly converted to well-formed UTF-16 text.
* - The function will not read beyond the input string, nor write beyond
* the destCapacity.
* - Malformed UTF-8 results in "garbage" 16-bit Unicode strings which may not
* be well-formed UTF-16.
* The function will resynchronize to valid code point boundaries
* within a small number of code points after an illegal sequence.
* - Non-shortest forms are not detected and will result in "spoofing" output.
*
* For further performance improvement, if srcLength is given (>=0),
* then it must be destCapacity>=srcLength.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of UChars). If it is 0, then
* dest may be NULL and the function will only return the length of the
* result without writing any of the result string (pre-flighting).
* Unlike for other ICU functions, if srcLength>=0 then it
* must be destCapacity>=srcLength.
* @param pDestLength A pointer to receive the number of units written to the destination. If
* pDestLength!=NULL then *pDestLength is always set to the
* number of output units corresponding to the transformation of
* all the input units, even in case of a buffer overflow.
* Unlike for other ICU functions, if srcLength>=0 but
* destCapacity<srcLength, then *pDestLength will be set to srcLength
* (and U_BUFFER_OVERFLOW_ERROR will be set)
* regardless of the actual result length.
* @param src The original source string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param pErrorCode Pointer to a standard ICU error code. Its input value must
* pass the U_SUCCESS() test, or else the function returns
* immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.)
* @return The pointer to destination buffer.
* @see u_strFromUTF8
* @see u_strFromUTF8WithSub
* @see u_strToUTF8WithSub
* @stable ICU 3.6
*/
U_STABLE UChar * U_EXPORT2
u_strFromUTF8Lenient(UChar *dest,
int32_t destCapacity,
int32_t *pDestLength,
const char *src,
int32_t srcLength,
UErrorCode *pErrorCode);
/**
* Converts a sequence of UChars (UTF-16) to UTF32 units.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of UChar32s). If it is 0, then
* dest may be NULL and the function will only return the length of the
* result without writing any of the result string (pre-flighting).
* @param pDestLength A pointer to receive the number of units written to the destination. If
* pDestLength!=NULL then *pDestLength is always set to the
* number of output units corresponding to the transformation of
* all the input units, even in case of a buffer overflow.
* @param src The original source string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
* @return The pointer to destination buffer.
* @stable ICU 2.0
*/
U_STABLE UChar32* U_EXPORT2
u_strToUTF32(UChar32 *dest,
int32_t destCapacity,
int32_t *pDestLength,
const UChar *src,
int32_t srcLength,
UErrorCode *pErrorCode);
/**
* Converts a sequence of UTF32 units to UChars (UTF-16)
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
* @param destCapacity The size of the buffer (number of UChars). If it is 0, then
* dest may be NULL and the function will only return the length of the
* result without writing any of the result string (pre-flighting).
* @param pDestLength A pointer to receive the number of units written to the destination. If
* pDestLength!=NULL then *pDestLength is always set to the
* number of output units corresponding to the transformation of
* all the input units, even in case of a buffer overflow.
* @param src The original source string
* @param srcLength The length of the original string. If -1, then src must be zero-terminated.
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
* @return The pointer to destination buffer.
* @stable ICU 2.0
*/
U_STABLE UChar* U_EXPORT2
u_strFromUTF32(UChar *dest,
int32_t destCapacity,
int32_t *pDestLength,
const UChar32 *src,
int32_t srcLength,
UErrorCode *pErrorCode);
#endif
|
refuge/ucol_nif
|
c_src/platform/osx/icu/unicode/ustring.h
|
C
|
mit
| 62,424
|
package org.shipkit.internal.notes.format;
import org.shipkit.internal.notes.model.Improvement;
/**
* Shared formatting
*/
class CommonFormatting {
static String format(Improvement improvement) {
return improvement.getTitle() + " [(#" + improvement.getId() + ")](" + improvement.getUrl() + ")";
}
}
|
mockito/mockito-release-tools
|
subprojects/shipkit/src/main/groovy/org/shipkit/internal/notes/format/CommonFormatting.java
|
Java
|
mit
| 320
|
/*
* Copyright (c) 2014-2015 Jakub Białek
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.google.code.ssm.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import org.apache.commons.lang.RandomStringUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import com.google.code.ssm.test.dao.TestDAO;
/**
* Check if data larger than 1MB can be cached.
*
* @author Jakub Białek
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@TestExecutionListeners({ DependencyInjectionTestExecutionListener.class })
@ContextConfiguration(locations = { "classpath*:META-INF/test-context.xml", "classpath*:simplesm-context.xml" })
public class LargeDataTest {
// data larger than 1MB
private static final int STRING_LENGTH = 2* 1024 *1024;
@Autowired
private TestDAO testDao;
@Test
public void test() throws InterruptedException {
final String key = "abc123";
final String data = getLargeData();
String value = testDao.getValue(key);
assertNotEquals(data, value);
testDao.updateValue(key, data);
String cachedResult = testDao.getValue(key);
/*testDao.updateAssignStrings(0, data);
Thread.sleep(30000);
final List<String> cachedResult = testDao.getAssignStrings();*/
assertNotNull(cachedResult);
assertEquals(data, cachedResult);
}
private String getLargeData() {
return RandomStringUtils.random(STRING_LENGTH);
}
}
|
amuzhou/simple-spring-memcached
|
integration-test/src/test/java/com/google/code/ssm/test/LargeDataTest.java
|
Java
|
mit
| 2,949
|
module Herohook
class ConfigMissing < StandardError
attr_accessor :key
def initialize(key)
self.key = key
super
end
def message
"#{key} missing from config file"
end
end
end
|
evanwhalen/herohook
|
lib/herohook/config_missing.rb
|
Ruby
|
mit
| 221
|
package de.slikey.effectlib.effect;
import de.slikey.effectlib.Effect;
import de.slikey.effectlib.EffectManager;
import de.slikey.effectlib.EffectType;
import de.slikey.effectlib.util.ParticleEffect;
import de.slikey.effectlib.util.RandomUtils;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
public class LoveEffect extends Effect {
/**
* Particle to display
*/
public ParticleEffect particle = ParticleEffect.HEART;
public LoveEffect(EffectManager effectManager) {
super(effectManager);
type = EffectType.REPEATING;
period = 2;
iterations = 600;
}
@Override
public void onRun() {
Location location = getLocation();
location.add(RandomUtils.getRandomCircleVector().multiply(RandomUtils.random.nextDouble() * 0.6d));
location.add(0, RandomUtils.random.nextFloat() * 2, 0);
display(particle, location);
}
}
|
stormtrooper28/EffectLib
|
src/main/java/de/slikey/effectlib/effect/LoveEffect.java
|
Java
|
mit
| 927
|
#!/bin/sh
# Use the exec command to start the app you want to run in this container.
# Don't let the app daemonize itself.
# `/sbin/setuser memcache` runs the given command as the user `memcache`.
# If you omit that part, the command will be run as root.
# Read more here: https://github.com/phusion/baseimage-docker#adding-additional-daemons
# exec /sbin/setuser postgres /usr/lib/postgresql/9.3/bin/postgres -D /usr/local/pgsql/data
export PYTHONPATH=$PYTHONPATH:/var/www/django/sd_sample_project/sd_sample_project
export DJANGO_SETTINGS_MODULE='settings.production'
export SECRET_KEY='no-so-secret' # Fix for your own site!
# chdir /var/www/django/sd_sample_project/sd_sample_project
exec /var/www/venv/bin/gunicorn wsgi:application \
--bind 0.0.0.0:80 \
--access-logfile /var/log/gunicorn/access.log \
--error-logfile /var/log/gunicorn/error.log
|
intlabs/cannyos-backend-dashboard
|
run_gunicorn.sh
|
Shell
|
mit
| 864
|
# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
require 'newrelic_rpm'
class HarvestTimestampsTest < Minitest::Test
include MultiverseHelpers
setup_and_teardown_agent
def test_resets_metric_data_timestamps_after_forking
freeze_time
t1 = advance_time 10
simulate_fork
NewRelic::Agent.after_fork
t2 = advance_time 10
trigger_metric_data_post
metric_data_post = $collector.calls_for('metric_data').first
start_ts, end_ts = metric_data_post[1..2]
assert_equal(t1.to_f, start_ts)
assert_equal(t2.to_f, end_ts)
end
def test_start_timestamp_maintained_on_harvest_failure
t0 = freeze_time.to_f
simulate_fork
NewRelic::Agent.after_fork
$collector.stub('metric_data', {}, 503)
t1 = advance_time(10).to_f
trigger_metric_data_post
first_post = last_metric_data_post
$collector.reset
t2 = advance_time(10).to_f
trigger_metric_data_post
second_post = last_metric_data_post
assert_equal([t0, t1], first_post[1..2])
assert_equal([t0, t2], second_post[1..2])
end
def test_timestamps_updated_even_if_filling_metric_id_cache_fails
t0 = freeze_time.to_f
simulate_fork
NewRelic::Agent.after_fork
# Induce a failure in filling the metric ID cache by handing back a bogus
# response to the first metric_data post.
$collector.stub('metric_data', [[[[]]]], 200)
t1 = advance_time(10).to_f
trigger_metric_data_post
first_post = last_metric_data_post
$collector.reset
t2 = advance_time(10).to_f
trigger_metric_data_post
second_post = last_metric_data_post
assert_equal([t0, t1], first_post[1..2])
assert_equal([t1, t2], second_post[1..2])
end
def trigger_metric_data_post
NewRelic::Agent.agent.send(:transmit_data)
end
def last_metric_data_post
$collector.calls_for('metric_data').last
end
def simulate_fork
NewRelic::Agent.instance.harvester.instance_variable_set(:@starting_pid, nil)
end
end
|
sho-wtag/catarse-2.0
|
vendor/bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.0.288/test/multiverse/suites/agent_only/harvest_timestamps_test.rb
|
Ruby
|
mit
| 2,091
|
<!DOCTYPE html>
<html ng-app="demo-icon">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js"></script>
<script type="text/javascript" src="/dist/angular-webicon.js"></script>
<script type="text/javascript">
angular
.module('demo-icon', ['webicon'])
.config([
'$webiconProvider',
function($webiconProvider) {
$webiconProvider
.svgSet('symbol', 'assets/icon-sets/symbol/about,home.svg')
.defaultSvgSetUrl('assets/icon-sets/group/about,home.svg')
.icon('clock', 'assets/icons/clock.svg')
.preload(['$promise', '$rootScope', function($promise, $rootScope) {
var
promises,
resolved = {};
promises = $promise.iconSets;
Object.keys(promises).forEach(function(key) {
resolved[key] = false;
promises[key].then(function() {
resolved[key] = true;
});
});
$rootScope.resolved = resolved;
}])
.icon('calendar', 'assets/icons/calendar.svg')
;
}
])
;
</script>
<style type="text/css">
.svg-webicon {
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div>
Status:
<div ng-repeat="(name, status) in resolved track by name">
"{{name}}":
<span ng-show="status">Loaded</span>
<span ng-hide="status">Loading</span>
</div>
</div>
<webicon icon="home"></webicon>
<webicon icon="clock"></webicon>
</body>
</html>
|
princesust/webicon
|
demo/angular/demoPreload/index.html
|
HTML
|
mit
| 1,694
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cake.Common.Tools.DotCover.Cover;
using Cake.Core;
using Cake.Core.Diagnostics;
using Cake.Core.IO;
using NSubstitute;
namespace Cake.Common.Tests.Fixtures.Tools.DotCover.Cover
{
internal sealed class DotCoverCovererFixture : DotCoverFixture<DotCoverCoverSettings>
{
public ICakeContext Context { get; set; }
public Action<ICakeContext> Action { get; set; }
public FilePath OutputPath { get; set; }
public DotCoverCovererFixture()
{
// Set the output file.
OutputPath = new FilePath("./result.dcvr");
// Setup the Cake Context.
Context = Substitute.For<ICakeContext>();
Context.FileSystem.Returns(FileSystem);
Context.Arguments.Returns(Substitute.For<ICakeArguments>());
Context.Environment.Returns(Environment);
Context.Globber.Returns(Globber);
Context.Log.Returns(Substitute.For<ICakeLog>());
Context.Registry.Returns(Substitute.For<IRegistry>());
Context.ProcessRunner.Returns((IProcessRunner)null);
// Set up the default action that intercepts.
Action = context =>
{
context.ProcessRunner.Start(
new FilePath("/Working/tools/Test.exe"),
new ProcessSettings()
{
Arguments = "-argument"
});
};
}
protected override void RunTool()
{
var tool = new DotCoverCoverer(FileSystem, Environment, ProcessRunner, Globber);
tool.Cover(Context, Action, OutputPath, Settings);
}
}
}
|
andycmaj/cake
|
src/Cake.Common.Tests/Fixtures/Tools/DotCover/Cover/DotCoverCovererFixture.cs
|
C#
|
mit
| 1,811
|
using System.Collections.Generic;
using System.Linq;
namespace KitchenPC.Context
{
public class ConnectorVertex
{
readonly List<IngredientNode> connections;
public ConnectorVertex()
{
connections = new List<IngredientNode>();
}
public IEnumerable<IngredientNode> Connections
{
get
{
return connections.AsEnumerable();
}
}
public void AddConnection(IngredientNode node)
{
connections.Add(node);
}
public bool HasConnection(IngredientNode node)
{
return connections.Contains<IngredientNode>(node);
}
}
}
|
KitchenPC/core
|
src/Core/Context/ConnectorVertex.cs
|
C#
|
mit
| 694
|
require 'spec_helper'
require 'mspec/mocks/proxy'
RSpec.describe MockObject, ".new" do
it "creates a new mock object" do
m = MockObject.new('not a null object')
expect { m.not_a_method }.to raise_error(NoMethodError)
end
it "creates a new mock object that follows the NullObject pattern" do
m = MockObject.new('null object', :null_object => true)
expect(m.not_really_a_method).to equal(m)
end
end
RSpec.describe MockProxy, ".new" do
it "creates a mock proxy by default" do
expect(MockProxy.new.mock?).to be_truthy
end
it "creates a stub proxy by request" do
expect(MockProxy.new(:stub).stub?).to be_truthy
end
it "sets the call expectation to 1 call for a mock" do
expect(MockProxy.new.count).to eq([:exactly, 1])
end
it "sets the call expectation to any number of times for a stub" do
expect(MockProxy.new(:stub).count).to eq([:any_number_of_times, 0])
end
end
RSpec.describe MockProxy, "#count" do
before :each do
@proxy = MockProxy.new
end
it "returns the expected number of calls the mock should receive" do
expect(@proxy.count).to eq([:exactly, 1])
expect(@proxy.at_least(3).count).to eq([:at_least, 3])
end
end
RSpec.describe MockProxy, "#arguments" do
before :each do
@proxy = MockProxy.new
end
it "returns the expected arguments" do
expect(@proxy.arguments).to eq(:any_args)
end
end
RSpec.describe MockProxy, "#with" do
before :each do
@proxy = MockProxy.new
end
it "returns self" do
expect(@proxy.with(:a)).to be_equal(@proxy)
end
it "raises an ArgumentError if no arguments are given" do
expect { @proxy.with }.to raise_error(ArgumentError)
end
it "accepts any number of arguments" do
expect(@proxy.with(1, 2, 3)).to be_an_instance_of(MockProxy)
expect(@proxy.arguments).to eq([1,2,3])
end
end
RSpec.describe MockProxy, "#once" do
before :each do
@proxy = MockProxy.new
end
it "returns self" do
expect(@proxy.once).to be_equal(@proxy)
end
it "sets the expected calls to 1" do
@proxy.once
expect(@proxy.count).to eq([:exactly, 1])
end
it "accepts no arguments" do
expect { @proxy.once(:a) }.to raise_error
end
end
RSpec.describe MockProxy, "#twice" do
before :each do
@proxy = MockProxy.new
end
it "returns self" do
expect(@proxy.twice).to be_equal(@proxy)
end
it "sets the expected calls to 2" do
@proxy.twice
expect(@proxy.count).to eq([:exactly, 2])
end
it "accepts no arguments" do
expect { @proxy.twice(:b) }.to raise_error
end
end
RSpec.describe MockProxy, "#exactly" do
before :each do
@proxy = MockProxy.new
end
it "returns self" do
expect(@proxy.exactly(2)).to be_equal(@proxy)
end
it "sets the expected calls to exactly n" do
@proxy.exactly(5)
expect(@proxy.count).to eq([:exactly, 5])
end
it "does not accept an argument that Integer() cannot convert" do
expect { @proxy.exactly('x') }.to raise_error
end
end
RSpec.describe MockProxy, "#at_least" do
before :each do
@proxy = MockProxy.new
end
it "returns self" do
expect(@proxy.at_least(3)).to be_equal(@proxy)
end
it "sets the expected calls to at least n" do
@proxy.at_least(3)
expect(@proxy.count).to eq([:at_least, 3])
end
it "accepts :once :twice" do
@proxy.at_least(:once)
expect(@proxy.count).to eq([:at_least, 1])
@proxy.at_least(:twice)
expect(@proxy.count).to eq([:at_least, 2])
end
it "does not accept an argument that Integer() cannot convert" do
expect { @proxy.at_least('x') }.to raise_error
end
end
RSpec.describe MockProxy, "#at_most" do
before :each do
@proxy = MockProxy.new
end
it "returns self" do
expect(@proxy.at_most(2)).to be_equal(@proxy)
end
it "sets the expected calls to at most n" do
@proxy.at_most(2)
expect(@proxy.count).to eq([:at_most, 2])
end
it "accepts :once, :twice" do
@proxy.at_most(:once)
expect(@proxy.count).to eq([:at_most, 1])
@proxy.at_most(:twice)
expect(@proxy.count).to eq([:at_most, 2])
end
it "does not accept an argument that Integer() cannot convert" do
expect { @proxy.at_most('x') }.to raise_error
end
end
RSpec.describe MockProxy, "#any_number_of_times" do
before :each do
@proxy = MockProxy.new
end
it "returns self" do
expect(@proxy.any_number_of_times).to be_equal(@proxy)
end
it "sets the expected calls to any number of times" do
@proxy.any_number_of_times
expect(@proxy.count).to eq([:any_number_of_times, 0])
end
it "does not accept an argument" do
expect { @proxy.any_number_of_times(2) }.to raise_error
end
end
RSpec.describe MockProxy, "#and_return" do
before :each do
@proxy = MockProxy.new
end
it "returns self" do
expect(@proxy.and_return(false)).to equal(@proxy)
end
it "sets the expected return value" do
@proxy.and_return(false)
expect(@proxy.returning).to eq(false)
end
it "accepts any number of return values" do
@proxy.and_return(1, 2, 3)
expect(@proxy.returning).to eq(1)
expect(@proxy.returning).to eq(2)
expect(@proxy.returning).to eq(3)
end
it "implicitly sets the expected number of calls" do
@proxy.and_return(1, 2, 3)
expect(@proxy.count).to eq([:exactly, 3])
end
it "only sets the expected number of calls if it is higher than what is already set" do
@proxy.at_least(5).times.and_return(1, 2, 3)
expect(@proxy.count).to eq([:at_least, 5])
@proxy.at_least(2).times.and_return(1, 2, 3)
expect(@proxy.count).to eq([:at_least, 3])
end
end
RSpec.describe MockProxy, "#returning" do
before :each do
@proxy = MockProxy.new
end
it "returns nil by default" do
expect(@proxy.returning).to be_nil
end
it "returns the value set by #and_return" do
@proxy.and_return(2)
expect(@proxy.returning).to eq(2)
expect(@proxy.returning).to eq(2)
end
it "returns a sequence of values set by #and_return" do
@proxy.and_return(1,2,3,4)
expect(@proxy.returning).to eq(1)
expect(@proxy.returning).to eq(2)
expect(@proxy.returning).to eq(3)
expect(@proxy.returning).to eq(4)
expect(@proxy.returning).to eq(4)
expect(@proxy.returning).to eq(4)
end
end
RSpec.describe MockProxy, "#calls" do
before :each do
@proxy = MockProxy.new
end
it "returns the number of times the proxy is called" do
expect(@proxy.calls).to eq(0)
end
end
RSpec.describe MockProxy, "#called" do
before :each do
@proxy = MockProxy.new
end
it "increments the number of times the proxy is called" do
@proxy.called
@proxy.called
expect(@proxy.calls).to eq(2)
end
end
RSpec.describe MockProxy, "#times" do
before :each do
@proxy = MockProxy.new
end
it "is a no-op" do
expect(@proxy.times).to eq(@proxy)
end
end
RSpec.describe MockProxy, "#stub?" do
it "returns true if the proxy is created as a stub" do
expect(MockProxy.new(:stub).stub?).to be_truthy
end
it "returns false if the proxy is created as a mock" do
expect(MockProxy.new(:mock).stub?).to be_falsey
end
end
RSpec.describe MockProxy, "#mock?" do
it "returns true if the proxy is created as a mock" do
expect(MockProxy.new(:mock).mock?).to be_truthy
end
it "returns false if the proxy is created as a stub" do
expect(MockProxy.new(:stub).mock?).to be_falsey
end
end
RSpec.describe MockProxy, "#and_yield" do
before :each do
@proxy = MockProxy.new
end
it "returns self" do
expect(@proxy.and_yield(false)).to equal(@proxy)
end
it "sets the expected values to yield" do
expect(@proxy.and_yield(1).yielding).to eq([[1]])
end
it "accepts multiple values to yield" do
expect(@proxy.and_yield(1, 2, 3).yielding).to eq([[1, 2, 3]])
end
end
RSpec.describe MockProxy, "#raising" do
before :each do
@proxy = MockProxy.new
end
it "returns nil by default" do
expect(@proxy.raising).to be_nil
end
it "returns the exception object passed to #and_raise" do
exc = double("exception")
@proxy.and_raise(exc)
expect(@proxy.raising).to equal(exc)
end
it "returns an instance of RuntimeError when a String is passed to #and_raise" do
@proxy.and_raise("an error")
exc = @proxy.raising
expect(exc).to be_an_instance_of(RuntimeError)
expect(exc.message).to eq("an error")
end
end
RSpec.describe MockProxy, "#yielding" do
before :each do
@proxy = MockProxy.new
end
it "returns an empty array by default" do
expect(@proxy.yielding).to eq([])
end
it "returns an array of arrays of values the proxy should yield" do
@proxy.and_yield(3)
expect(@proxy.yielding).to eq([[3]])
end
it "returns an accumulation of arrays of values the proxy should yield" do
@proxy.and_yield(1).and_yield(2, 3)
expect(@proxy.yielding).to eq([[1], [2, 3]])
end
end
RSpec.describe MockProxy, "#yielding?" do
before :each do
@proxy = MockProxy.new
end
it "returns false if the proxy is not yielding" do
expect(@proxy.yielding?).to be_falsey
end
it "returns true if the proxy is yielding" do
@proxy.and_yield(1)
expect(@proxy.yielding?).to be_truthy
end
end
RSpec.describe MockIntObject, "#to_int" do
before :each do
@int = MockIntObject.new(10)
end
it "returns the number if to_int is called" do
expect(@int.to_int).to eq(10)
expect(@int.count).to eq([:at_least, 1])
end
it "tries to convert the target to int if to_int is called" do
expect(MockIntObject.new(@int).to_int).to eq(10)
expect(@int.count).to eq([:at_least, 1])
end
end
|
ruby/mspec
|
spec/mocks/proxy_spec.rb
|
Ruby
|
mit
| 9,604
|
namespace Mapbox.Unity.MeshGeneration.Modifiers
{
using Mapbox.Unity.MeshGeneration.Data;
using UnityEngine;
using Mapbox.Unity.MeshGeneration.Components;
[CreateAssetMenu(menuName = "Mapbox/Modifiers/Collider Modifier")]
public class ColliderModifier : GameObjectModifier
{
[SerializeField]
private ColliderType _colliderType;
public override void Run(FeatureBehaviour fb, UnityTile tile)
{
switch (_colliderType)
{
case ColliderType.BoxCollider:
fb.gameObject.AddComponent<BoxCollider>();
break;
case ColliderType.MeshCollider:
fb.gameObject.AddComponent<MeshCollider>();
break;
case ColliderType.SphereCollider:
fb.gameObject.AddComponent<SphereCollider>();
break;
default:
break;
}
}
public enum ColliderType
{
None,
BoxCollider,
MeshCollider,
SphereCollider
}
}
}
|
binakot/Fleet-And-Staff-Location-Visualizer
|
FleetAndStaffLocationVisualizer/Assets/Mapbox/Unity/MeshGeneration/Modifiers/GameObjectModifiers/ColliderModifier.cs
|
C#
|
mit
| 1,149
|
var CoreObject = require('core-object');
var Promise = require('ember-cli/lib/ext/promise');
var SilentError = require('silent-error');
var chalk = require('chalk');
var white = chalk.white;
var green = chalk.green;
var EXPIRE_IN_2030 = new Date('2030');
var TWO_YEAR_CACHE_PERIOD_IN_SEC = 60 * 60 * 24 * 365 * 2;
module.exports = CoreObject.extend({
init: function() {
if (!this.config) {
return Promise.reject(new SilentError('You have to pass a config!'));
}
this.s3 = this.s3 || require('s3');
this.client = this.s3.createClient({
maxAsyncS3: 1,
s3Options: this.config.assets
});
},
upload: function() {
var client = this.client;
var _this = this;
if (!this.ui) {
var message = 'You have to pass a UI to an adapter.';
return Promise.reject(new SilentError(message));
}
this.ui.pleasantProgress.start(green('Uploading assets'), green('.'));
return new Promise(function(resolve, reject) {
var uploader = client.uploadDir(_this.getUploadParams());
uploader.on('error', _this.logUploadError.bind(_this, reject));
uploader.on('end', _this.logUploadSuccess.bind(_this, resolve));
uploader.on('fileUploadStart', _this.logFileUpload.bind(_this));
uploader.on('fileUploadEnd', _this.logFileUploadEnd.bind(_this, resolve));
});
},
getUploadParams: function() {
return {
localDir: 'tmp/assets-sync',
s3Params: {
ACL: 'public-read',
Bucket: this.config.assets.bucket,
Prefix: this.config.assets.prefix || '',
CacheControl: 'max-age='+TWO_YEAR_CACHE_PERIOD_IN_SEC+', public',
Expires: EXPIRE_IN_2030
},
getS3Params: this.getS3Params.bind(this)
}
},
getS3Params: function(localFile, stat, callback) {
if (this.config.assets.gzip === false) {
return callback(null, {});
}
var gzipExtensions = this.config.assets.gzipExtensions ? this.config.assets.gzipExtensions : ['js', 'css', 'svg'];
var ext = localFile.replace(/.*[\.\/\\]/, '').toLowerCase();
var isGzippedContent = gzipExtensions.indexOf(ext) != -1;
var additionalParams = isGzippedContent ? { ContentEncoding: 'gzip' } : {};
callback(null, additionalParams);
},
logFileUpload: function(fullPath, _) {
var fileNameMatches = fullPath.match(/\/((\w*[-]\w*||\w*)[.]\w*)/);
if (fileNameMatches) {
this.ui.writeLine('Uploading: ' + green(fileNameMatches[1]));
}
this.fileUploadPending = true;
},
logFileUploadEnd: function(resolve, localFilePath, _s3Key) {
this.fileUploadPending = false;
if (this.s3ThinksWeAreFinished) {
this.printEndMessage();
resolve();
}
},
logUploadError: function(reject, error) {
var errorMessage = 'Unable to sync: ' + error.stack;
reject(new SilentError(errorMessage));
},
logUploadSuccess: function(resolve) {
if (this.fileUploadPending) {
// s3 screws up some times when only uploading one image
this.s3ThinksWeAreFinished = true;
}
else {
this.printEndMessage();
resolve();
}
},
printEndMessage: function() {
this.ui.writeLine('Assets upload successful. Done uploading.');
this.ui.pleasantProgress.stop();
}
});
|
tobymarsden/ember-deploy-s3
|
lib/s3.js
|
JavaScript
|
mit
| 3,271
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Original Code: Copyright (c) 2009-2014 The Bitcoin Core Developers
// Modified Code: Copyright (c) 2014 Project Bitmark
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITMARK_MAIN_H
#define BITMARK_MAIN_H
#if defined(HAVE_CONFIG_H)
#include "bitmark-config.h"
#endif
#include "bignum.h"
#include "chainparams.h"
#include "coins.h"
#include "core.h"
#include "net.h"
#include "script.h"
#include "sync.h"
#include "txmempool.h"
#include "uint256.h"
#include <algorithm>
#include <exception>
#include <map>
#include <set>
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>
class CBlockIndex;
class CBloomFilter;
class CInv;
/** The maximum allowed size for a serialized block, in bytes (network rule) */
static const unsigned int MAX_BLOCK_SIZE = 1000000;
/** Default for -blockmaxsize and -blockminsize, which control the range of sizes the mining code will create **/
static const unsigned int DEFAULT_BLOCK_MAX_SIZE = 750000;
static const unsigned int DEFAULT_BLOCK_MIN_SIZE = 0;
/** Default for -blockprioritysize, maximum space for zero/low-fee transactions **/
static const unsigned int DEFAULT_BLOCK_PRIORITY_SIZE = 50000;
/** The maximum size for transactions we're willing to relay/mine */
static const unsigned int MAX_STANDARD_TX_SIZE = 100000;
/** The maximum allowed number of signature check operations in a block (network rule) */
static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
/** Default for -maxorphanblocks, maximum number of orphan blocks kept in memory */
static const unsigned int DEFAULT_MAX_ORPHAN_BLOCKS = 750;
/** The maximum size of a blk?????.dat file (since 0.8) */
static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB
/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */
static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB
/** The pre-allocation chunk size for rev?????.dat files (since 0.8) */
static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
static const int COINBASE_MATURITY = 720;
/** Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp. */
static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC
/** Maximum number of script-checking threads allowed */
static const int MAX_SCRIPTCHECK_THREADS = 16;
/** -par default (number of script-checking threads, 0 = auto) */
static const int DEFAULT_SCRIPTCHECK_THREADS = 0;
/** Number of blocks that can be requested at any given time from a single peer. */
static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 128;
/** Timeout in seconds before considering a block download peer unresponsive. */
static const unsigned int BLOCK_DOWNLOAD_TIMEOUT = 60;
#ifdef USE_UPNP
static const int fHaveUPnP = true;
#else
static const int fHaveUPnP = false;
#endif
/** "reject" message codes **/
static const unsigned char REJECT_MALFORMED = 0x01;
static const unsigned char REJECT_INVALID = 0x10;
static const unsigned char REJECT_OBSOLETE = 0x11;
static const unsigned char REJECT_DUPLICATE = 0x12;
static const unsigned char REJECT_NONSTANDARD = 0x40;
static const unsigned char REJECT_DUST = 0x41;
static const unsigned char REJECT_INSUFFICIENTFEE = 0x42;
static const unsigned char REJECT_CHECKPOINT = 0x43;
extern CScript COINBASE_FLAGS;
extern CCriticalSection cs_main;
extern CTxMemPool mempool;
extern std::map<uint256, CBlockIndex*> mapBlockIndex;
extern uint64_t nLastBlockTx;
extern uint64_t nLastBlockSize;
extern const std::string strMessageMagic;
extern int64_t nTimeBestReceived;
extern bool fImporting;
extern bool fReindex;
extern bool fBenchmark;
extern int nScriptCheckThreads;
extern bool fTxIndex;
extern unsigned int nCoinCacheSize;
// Minimum disk space required - used in CheckDiskSpace()
static const uint64_t nMinDiskSpace = 52428800;
class CCoinsDB;
class CBlockTreeDB;
struct CDiskBlockPos;
class CTxUndo;
class CScriptCheck;
class CValidationState;
class CWalletInterface;
struct CNodeStateStats;
struct CBlockTemplate;
/** Register a wallet to receive updates from core */
void RegisterWallet(CWalletInterface* pwalletIn);
/** Unregister a wallet from core */
void UnregisterWallet(CWalletInterface* pwalletIn);
/** Unregister all wallets from core */
void UnregisterAllWallets();
/** Push an updated transaction to all registered wallets */
void SyncWithWallets(const uint256 &hash, const CTransaction& tx, const CBlock* pblock = NULL);
/** Register with a network node to receive its signals */
void RegisterNodeSignals(CNodeSignals& nodeSignals);
/** Unregister a network node */
void UnregisterNodeSignals(CNodeSignals& nodeSignals);
void PushGetBlocks(CNode* pnode, CBlockIndex* pindexBegin, uint256 hashEnd);
/** Process an incoming block */
bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp = NULL);
/** Check whether enough disk space is available for an incoming block */
bool CheckDiskSpace(uint64_t nAdditionalBytes = 0);
/** Open a block file (blk?????.dat) */
FILE* OpenBlockFile(const CDiskBlockPos &pos, bool fReadOnly = false);
/** Open an undo file (rev?????.dat) */
FILE* OpenUndoFile(const CDiskBlockPos &pos, bool fReadOnly = false);
/** Import blocks from an external file */
bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp = NULL);
/** Initialize a new block tree database + block data on disk */
bool InitBlockIndex();
/** Load the block tree and coins database from disk */
bool LoadBlockIndex();
/** Unload database information */
void UnloadBlockIndex();
/** Verify consistency of the block and coin databases */
bool VerifyDB(int nCheckLevel, int nCheckDepth);
/** Print the loaded block tree */
void PrintBlockTree();
/** Process protocol messages received from a given node */
bool ProcessMessages(CNode* pfrom);
/** Send queued protocol messages to be sent to a give node */
bool SendMessages(CNode* pto, bool fSendTrickle);
/** Run an instance of the script checking thread */
void ThreadScriptCheck();
/** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */
bool CheckProofOfWork(uint256 hash, unsigned int nBits);
/** Calculate the minimum amount of work a received block needs, without knowing its direct parent */
unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime);
/** Check whether we are doing an initial block download (synchronizing from disk or network) */
bool IsInitialBlockDownload();
/** Format a string that describes several potential problems detected by the core */
std::string GetWarnings(std::string strFor);
/** Retrieve a transaction (from memory pool, or from disk, if possible) */
bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock, bool fAllowSlow = false);
/** Find the best known block, and make it the tip of the block chain */
bool ActivateBestChain(CValidationState &state);
int64_t GetBlockValue(int nHeight, int64_t nFees);
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock);
void UpdateTime(CBlockHeader& block, const CBlockIndex* pindexPrev);
/** Create a new block index entry for a given block hash */
CBlockIndex * InsertBlockIndex(uint256 hash);
/** Verify a signature */
bool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType);
/** Abort with a message */
bool AbortNode(const std::string &msg);
/** Get statistics from node state */
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats);
/** Increase a node's misbehavior score. */
void Misbehaving(NodeId nodeid, int howmuch);
/** (try to) add transaction to memory pool **/
bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree,
bool* pfMissingInputs, bool fRejectInsaneFee=false);
struct CNodeStateStats {
int nMisbehavior;
};
struct CDiskBlockPos
{
int nFile;
unsigned int nPos;
IMPLEMENT_SERIALIZE(
READWRITE(VARINT(nFile));
READWRITE(VARINT(nPos));
)
CDiskBlockPos() {
SetNull();
}
CDiskBlockPos(int nFileIn, unsigned int nPosIn) {
nFile = nFileIn;
nPos = nPosIn;
}
friend bool operator==(const CDiskBlockPos &a, const CDiskBlockPos &b) {
return (a.nFile == b.nFile && a.nPos == b.nPos);
}
friend bool operator!=(const CDiskBlockPos &a, const CDiskBlockPos &b) {
return !(a == b);
}
void SetNull() { nFile = -1; nPos = 0; }
bool IsNull() const { return (nFile == -1); }
};
struct CDiskTxPos : public CDiskBlockPos
{
unsigned int nTxOffset; // after header
IMPLEMENT_SERIALIZE(
READWRITE(*(CDiskBlockPos*)this);
READWRITE(VARINT(nTxOffset));
)
CDiskTxPos(const CDiskBlockPos &blockIn, unsigned int nTxOffsetIn) : CDiskBlockPos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) {
}
CDiskTxPos() {
SetNull();
}
void SetNull() {
CDiskBlockPos::SetNull();
nTxOffset = 0;
}
};
enum GetMinFee_mode
{
GMF_RELAY,
GMF_SEND,
};
int64_t GetMinFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree, enum GetMinFee_mode mode);
//
// Check transaction inputs, and make sure any
// pay-to-script-hash transactions are evaluating IsStandard scripts
//
// Why bother? To avoid denial-of-service attacks; an attacker
// can submit a standard HASH... OP_EQUAL transaction,
// which will get accepted into blocks. The redemption
// script can be anything; an attacker could use a very
// expensive-to-check-upon-redemption script like:
// DUP CHECKSIG DROP ... repeated 100 times... OP_1
//
/** Check for standard transaction types
@param[in] mapInputs Map of previous transactions that have outputs we're spending
@return True if all inputs (scriptSigs) use only standard transaction forms
*/
bool AreInputsStandard(const CTransaction& tx, CCoinsViewCache& mapInputs);
/** Count ECDSA signature operations the old-fashioned (pre-0.6) way
@return number of sigops this transaction's outputs will produce when spent
@see CTransaction::FetchInputs
*/
unsigned int GetLegacySigOpCount(const CTransaction& tx);
/** Count ECDSA signature operations in pay-to-script-hash inputs.
@param[in] mapInputs Map of previous transactions that have outputs we're spending
@return maximum number of sigops required to validate this transaction's inputs
@see CTransaction::FetchInputs
*/
unsigned int GetP2SHSigOpCount(const CTransaction& tx, CCoinsViewCache& mapInputs);
inline bool AllowFree(double dPriority)
{
// Large (in bytes) low-priority (new, small-coin) transactions
// need a fee.
return dPriority > COIN * 720 / 250;
}
// Check whether all inputs of this transaction are valid (no double spends, scripts & sigs, amounts)
// This does not modify the UTXO set. If pvChecks is not NULL, script checks are pushed onto it
// instead of being performed inline.
bool CheckInputs(const CTransaction& tx, CValidationState &state, CCoinsViewCache &view, bool fScriptChecks = true,
unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC,
std::vector<CScriptCheck> *pvChecks = NULL);
// Apply the effects of this transaction on the UTXO set represented by view
void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight, const uint256 &txhash);
// Context-independent validity checks
bool CheckTransaction(const CTransaction& tx, CValidationState& state);
/** Check for standard transaction types
@return True if all outputs (scriptPubKeys) use only standard transaction forms
*/
bool IsStandardTx(const CTransaction& tx, std::string& reason);
bool IsFinalTx(const CTransaction &tx, int nBlockHeight = 0, int64_t nBlockTime = 0);
/** Undo information for a CBlock */
class CBlockUndo
{
public:
std::vector<CTxUndo> vtxundo; // for all but the coinbase
IMPLEMENT_SERIALIZE(
READWRITE(vtxundo);
)
bool WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock)
{
// Open history file to append
CAutoFile fileout = CAutoFile(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION);
if (!fileout)
return error("CBlockUndo::WriteToDisk : OpenUndoFile failed");
// Write index header
unsigned int nSize = fileout.GetSerializeSize(*this);
fileout << FLATDATA(Params().MessageStart()) << nSize;
// Write undo data
long fileOutPos = ftell(fileout);
if (fileOutPos < 0)
return error("CBlockUndo::WriteToDisk : ftell failed");
pos.nPos = (unsigned int)fileOutPos;
fileout << *this;
// calculate & write checksum
CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION);
hasher << hashBlock;
hasher << *this;
fileout << hasher.GetHash();
// Flush stdio buffers and commit to disk before returning
fflush(fileout);
if (!IsInitialBlockDownload())
FileCommit(fileout);
return true;
}
bool ReadFromDisk(const CDiskBlockPos &pos, const uint256 &hashBlock)
{
// Open history file to read
CAutoFile filein = CAutoFile(OpenUndoFile(pos, true), SER_DISK, CLIENT_VERSION);
if (!filein)
return error("CBlockUndo::ReadFromDisk : OpenBlockFile failed");
// Read block
uint256 hashChecksum;
try {
filein >> *this;
filein >> hashChecksum;
}
catch (std::exception &e) {
return error("%s : Deserialize or I/O error - %s", __func__, e.what());
}
// Verify checksum
CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION);
hasher << hashBlock;
hasher << *this;
if (hashChecksum != hasher.GetHash())
return error("CBlockUndo::ReadFromDisk : Checksum mismatch");
return true;
}
};
/** Closure representing one script verification
* Note that this stores references to the spending transaction */
class CScriptCheck
{
private:
CScript scriptPubKey;
const CTransaction *ptxTo;
unsigned int nIn;
unsigned int nFlags;
int nHashType;
public:
CScriptCheck() {}
CScriptCheck(const CCoins& txFromIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, int nHashTypeIn) :
scriptPubKey(txFromIn.vout[txToIn.vin[nInIn].prevout.n].scriptPubKey),
ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), nHashType(nHashTypeIn) { }
bool operator()() const;
void swap(CScriptCheck &check) {
scriptPubKey.swap(check.scriptPubKey);
std::swap(ptxTo, check.ptxTo);
std::swap(nIn, check.nIn);
std::swap(nFlags, check.nFlags);
std::swap(nHashType, check.nHashType);
}
};
/** A transaction with a merkle branch linking it to the block chain. */
class CMerkleTx : public CTransaction
{
private:
int GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const;
public:
uint256 hashBlock;
std::vector<uint256> vMerkleBranch;
int nIndex;
// memory only
mutable bool fMerkleVerified;
CMerkleTx()
{
Init();
}
CMerkleTx(const CTransaction& txIn) : CTransaction(txIn)
{
Init();
}
void Init()
{
hashBlock = 0;
nIndex = -1;
fMerkleVerified = false;
}
IMPLEMENT_SERIALIZE
(
nSerSize += SerReadWrite(s, *(CTransaction*)this, nType, nVersion, ser_action);
nVersion = this->nVersion;
READWRITE(hashBlock);
READWRITE(vMerkleBranch);
READWRITE(nIndex);
)
int SetMerkleBranch(const CBlock* pblock=NULL);
// Return depth of transaction in blockchain:
// -1 : not in blockchain, and not in memory pool (conflicted transaction)
// 0 : in memory pool, waiting to be included in a block
// >=1 : this many blocks deep in the main chain
int GetDepthInMainChain(CBlockIndex* &pindexRet) const;
int GetDepthInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); }
bool IsInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChainINTERNAL(pindexRet) > 0; }
int GetBlocksToMaturity() const;
bool AcceptToMemoryPool(bool fLimitFree=true);
};
/** Data structure that represents a partial merkle tree.
*
* It respresents a subset of the txid's of a known block, in a way that
* allows recovery of the list of txid's and the merkle root, in an
* authenticated way.
*
* The encoding works as follows: we traverse the tree in depth-first order,
* storing a bit for each traversed node, signifying whether the node is the
* parent of at least one matched leaf txid (or a matched txid itself). In
* case we are at the leaf level, or this bit is 0, its merkle node hash is
* stored, and its children are not explorer further. Otherwise, no hash is
* stored, but we recurse into both (or the only) child branch. During
* decoding, the same depth-first traversal is performed, consuming bits and
* hashes as they written during encoding.
*
* The serialization is fixed and provides a hard guarantee about the
* encoded size:
*
* SIZE <= 10 + ceil(32.25*N)
*
* Where N represents the number of leaf nodes of the partial tree. N itself
* is bounded by:
*
* N <= total_transactions
* N <= 1 + matched_transactions*tree_height
*
* The serialization format:
* - uint32 total_transactions (4 bytes)
* - varint number of hashes (1-3 bytes)
* - uint256[] hashes in depth-first order (<= 32*N bytes)
* - varint number of bytes of flag bits (1-3 bytes)
* - byte[] flag bits, packed per 8 in a byte, least significant bit first (<= 2*N-1 bits)
* The size constraints follow from this.
*/
class CPartialMerkleTree
{
protected:
// the total number of transactions in the block
unsigned int nTransactions;
// node-is-parent-of-matched-txid bits
std::vector<bool> vBits;
// txids and internal hashes
std::vector<uint256> vHash;
// flag set when encountering invalid data
bool fBad;
// helper function to efficiently calculate the number of nodes at given height in the merkle tree
unsigned int CalcTreeWidth(int height) {
return (nTransactions+(1 << height)-1) >> height;
}
// calculate the hash of a node in the merkle tree (at leaf level: the txid's themself)
uint256 CalcHash(int height, unsigned int pos, const std::vector<uint256> &vTxid);
// recursive function that traverses tree nodes, storing the data as bits and hashes
void TraverseAndBuild(int height, unsigned int pos, const std::vector<uint256> &vTxid, const std::vector<bool> &vMatch);
// recursive function that traverses tree nodes, consuming the bits and hashes produced by TraverseAndBuild.
// it returns the hash of the respective node.
uint256 TraverseAndExtract(int height, unsigned int pos, unsigned int &nBitsUsed, unsigned int &nHashUsed, std::vector<uint256> &vMatch);
public:
// serialization implementation
IMPLEMENT_SERIALIZE(
READWRITE(nTransactions);
READWRITE(vHash);
std::vector<unsigned char> vBytes;
if (fRead) {
READWRITE(vBytes);
CPartialMerkleTree &us = *(const_cast<CPartialMerkleTree*>(this));
us.vBits.resize(vBytes.size() * 8);
for (unsigned int p = 0; p < us.vBits.size(); p++)
us.vBits[p] = (vBytes[p / 8] & (1 << (p % 8))) != 0;
us.fBad = false;
} else {
vBytes.resize((vBits.size()+7)/8);
for (unsigned int p = 0; p < vBits.size(); p++)
vBytes[p / 8] |= vBits[p] << (p % 8);
READWRITE(vBytes);
}
)
// Construct a partial merkle tree from a list of transaction id's, and a mask that selects a subset of them
CPartialMerkleTree(const std::vector<uint256> &vTxid, const std::vector<bool> &vMatch);
CPartialMerkleTree();
// extract the matching txid's represented by this partial merkle tree.
// returns the merkle root, or 0 in case of failure
uint256 ExtractMatches(std::vector<uint256> &vMatch);
};
/** Functions for disk access for blocks */
bool WriteBlockToDisk(CBlock& block, CDiskBlockPos& pos);
bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos);
bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex);
/** Functions for validating blocks and updating the block tree */
/** Undo the effects of this block (with given index) on the UTXO set represented by coins.
* In case pfClean is provided, operation will try to be tolerant about errors, and *pfClean
* will be true if no problems were found. Otherwise, the return value will be false in case
* of problems. Note that in any case, coins may be modified. */
bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool* pfClean = NULL);
// Apply the effects of this block (with given index) on the UTXO set represented by coins
bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool fJustCheck = false);
// Add this block to the block index, and if necessary, switch the active block chain to this
bool AddToBlockIndex(CBlock& block, CValidationState& state, const CDiskBlockPos& pos);
// Context-independent validity checks
bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW = true, bool fCheckMerkleRoot = true);
// Store block on disk
// if dbp is provided, the file is known to already reside on disk
bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp = NULL);
class CBlockFileInfo
{
public:
unsigned int nBlocks; // number of blocks stored in file
unsigned int nSize; // number of used bytes of block file
unsigned int nUndoSize; // number of used bytes in the undo file
unsigned int nHeightFirst; // lowest height of block in file
unsigned int nHeightLast; // highest height of block in file
uint64_t nTimeFirst; // earliest time of block in file
uint64_t nTimeLast; // latest time of block in file
IMPLEMENT_SERIALIZE(
READWRITE(VARINT(nBlocks));
READWRITE(VARINT(nSize));
READWRITE(VARINT(nUndoSize));
READWRITE(VARINT(nHeightFirst));
READWRITE(VARINT(nHeightLast));
READWRITE(VARINT(nTimeFirst));
READWRITE(VARINT(nTimeLast));
)
void SetNull() {
nBlocks = 0;
nSize = 0;
nUndoSize = 0;
nHeightFirst = 0;
nHeightLast = 0;
nTimeFirst = 0;
nTimeLast = 0;
}
CBlockFileInfo() {
SetNull();
}
std::string ToString() const {
return strprintf("CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)", nBlocks, nSize, nHeightFirst, nHeightLast, DateTimeStrFormat("%Y-%m-%d", nTimeFirst).c_str(), DateTimeStrFormat("%Y-%m-%d", nTimeLast).c_str());
}
// update statistics (does not update nSize)
void AddBlock(unsigned int nHeightIn, uint64_t nTimeIn) {
if (nBlocks==0 || nHeightFirst > nHeightIn)
nHeightFirst = nHeightIn;
if (nBlocks==0 || nTimeFirst > nTimeIn)
nTimeFirst = nTimeIn;
nBlocks++;
if (nHeightIn > nHeightLast)
nHeightLast = nHeightIn;
if (nTimeIn > nTimeLast)
nTimeLast = nTimeIn;
}
};
enum BlockStatus {
BLOCK_VALID_UNKNOWN = 0,
BLOCK_VALID_HEADER = 1, // parsed, version ok, hash satisfies claimed PoW, 1 <= vtx count <= max, timestamp not in future
BLOCK_VALID_TREE = 2, // parent found, difficulty matches, timestamp >= median previous, checkpoint
BLOCK_VALID_TRANSACTIONS = 3, // only first tx is coinbase, 2 <= coinbase input script length <= 100, transactions valid, no duplicate txids, sigops, size, merkle root
BLOCK_VALID_CHAIN = 4, // outputs do not overspend inputs, no double spends, coinbase output ok, immature coinbase spends, BIP30
BLOCK_VALID_SCRIPTS = 5, // scripts/signatures ok
BLOCK_VALID_MASK = 7,
BLOCK_HAVE_DATA = 8, // full block available in blk*.dat
BLOCK_HAVE_UNDO = 16, // undo data available in rev*.dat
BLOCK_HAVE_MASK = 24,
BLOCK_FAILED_VALID = 32, // stage after last reached validness failed
BLOCK_FAILED_CHILD = 64, // descends from failed block
BLOCK_FAILED_MASK = 96
};
/** The block chain is a tree shaped structure starting with the
* genesis block at the root, with each block potentially having multiple
* candidates to be the next block. A blockindex may have multiple pprev pointing
* to it, but at most one of them can be part of the currently active branch.
*/
class CBlockIndex
{
public:
// pointer to the hash of the block, if any. memory is owned by this CBlockIndex
const uint256* phashBlock;
// pointer to the index of the predecessor of this block
CBlockIndex* pprev;
// height of the entry in the chain. The genesis block has height 0
int nHeight;
// Which # file this block is stored in (blk?????.dat)
int nFile;
// Byte offset within blk?????.dat where this block's data is stored
unsigned int nDataPos;
// Byte offset within rev?????.dat where this block's undo data is stored
unsigned int nUndoPos;
// (memory only) Total amount of work (expected number of hashes) in the chain up to and including this block
uint256 nChainWork;
// Number of transactions in this block.
// Note: in a potential headers-first mode, this number cannot be relied upon
unsigned int nTx;
// (memory only) Number of transactions in the chain up to and including this block
unsigned int nChainTx; // change to 64-bit type when necessary; won't happen before 2030
// Verification status of this block. See enum BlockStatus
unsigned int nStatus;
// block header
int nVersion;
uint256 hashMerkleRoot;
unsigned int nTime;
unsigned int nBits;
unsigned int nNonce;
// (memory only) Sequencial id assigned to distinguish order in which blocks are received.
uint32_t nSequenceId;
CBlockIndex()
{
phashBlock = NULL;
pprev = NULL;
nHeight = 0;
nFile = 0;
nDataPos = 0;
nUndoPos = 0;
nChainWork = 0;
nTx = 0;
nChainTx = 0;
nStatus = 0;
nSequenceId = 0;
nVersion = 0;
hashMerkleRoot = 0;
nTime = 0;
nBits = 0;
nNonce = 0;
}
CBlockIndex(CBlockHeader& block)
{
phashBlock = NULL;
pprev = NULL;
nHeight = 0;
nFile = 0;
nDataPos = 0;
nUndoPos = 0;
nChainWork = 0;
nTx = 0;
nChainTx = 0;
nStatus = 0;
nSequenceId = 0;
nVersion = block.nVersion;
hashMerkleRoot = block.hashMerkleRoot;
nTime = block.nTime;
nBits = block.nBits;
nNonce = block.nNonce;
}
CDiskBlockPos GetBlockPos() const {
CDiskBlockPos ret;
if (nStatus & BLOCK_HAVE_DATA) {
ret.nFile = nFile;
ret.nPos = nDataPos;
}
return ret;
}
CDiskBlockPos GetUndoPos() const {
CDiskBlockPos ret;
if (nStatus & BLOCK_HAVE_UNDO) {
ret.nFile = nFile;
ret.nPos = nUndoPos;
}
return ret;
}
CBlockHeader GetBlockHeader() const
{
CBlockHeader block;
block.nVersion = nVersion;
if (pprev)
block.hashPrevBlock = pprev->GetBlockHash();
block.hashMerkleRoot = hashMerkleRoot;
block.nTime = nTime;
block.nBits = nBits;
block.nNonce = nNonce;
return block;
}
uint256 GetBlockHash() const
{
return *phashBlock;
}
int64_t GetBlockTime() const
{
return (int64_t)nTime;
}
CBigNum GetBlockWork() const
{
CBigNum bnTarget;
bnTarget.SetCompact(nBits);
if (bnTarget <= 0)
return 0;
return (CBigNum(1)<<256) / (bnTarget+1);
}
bool CheckIndex() const
{
return true;
}
enum { nMedianTimeSpan=11 };
int64_t GetMedianTimePast() const
{
int64_t pmedian[nMedianTimeSpan];
int64_t* pbegin = &pmedian[nMedianTimeSpan];
int64_t* pend = &pmedian[nMedianTimeSpan];
const CBlockIndex* pindex = this;
for (int i = 0; i < nMedianTimeSpan && pindex; i++, pindex = pindex->pprev)
*(--pbegin) = pindex->GetBlockTime();
std::sort(pbegin, pend);
return pbegin[(pend - pbegin)/2];
}
int64_t GetMedianTime() const;
/**
* Returns true if there are nRequired or more blocks of minVersion or above
* in the last nToCheck blocks, starting at pstart and going backwards.
*/
static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart,
unsigned int nRequired, unsigned int nToCheck);
std::string ToString() const
{
return strprintf("CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)",
pprev, nHeight,
hashMerkleRoot.ToString().c_str(),
GetBlockHash().ToString().c_str());
}
void print() const
{
LogPrintf("%s\n", ToString().c_str());
}
};
/** Used to marshal pointers into hashes for db storage. */
class CDiskBlockIndex : public CBlockIndex
{
public:
uint256 hashPrev;
CDiskBlockIndex() {
hashPrev = 0;
}
explicit CDiskBlockIndex(CBlockIndex* pindex) : CBlockIndex(*pindex) {
hashPrev = (pprev ? pprev->GetBlockHash() : 0);
}
IMPLEMENT_SERIALIZE
(
if (!(nType & SER_GETHASH))
READWRITE(VARINT(nVersion));
READWRITE(VARINT(nHeight));
READWRITE(VARINT(nStatus));
READWRITE(VARINT(nTx));
if (nStatus & (BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO))
READWRITE(VARINT(nFile));
if (nStatus & BLOCK_HAVE_DATA)
READWRITE(VARINT(nDataPos));
if (nStatus & BLOCK_HAVE_UNDO)
READWRITE(VARINT(nUndoPos));
// block header
READWRITE(this->nVersion);
READWRITE(hashPrev);
READWRITE(hashMerkleRoot);
READWRITE(nTime);
READWRITE(nBits);
READWRITE(nNonce);
)
uint256 GetBlockHash() const
{
CBlockHeader block;
block.nVersion = nVersion;
block.hashPrevBlock = hashPrev;
block.hashMerkleRoot = hashMerkleRoot;
block.nTime = nTime;
block.nBits = nBits;
block.nNonce = nNonce;
return block.GetHash();
}
std::string ToString() const
{
std::string str = "CDiskBlockIndex(";
str += CBlockIndex::ToString();
str += strprintf("\n hashBlock=%s, hashPrev=%s)",
GetBlockHash().ToString().c_str(),
hashPrev.ToString().c_str());
return str;
}
void print() const
{
LogPrintf("%s\n", ToString().c_str());
}
};
/** Capture information about block/transaction validation */
class CValidationState {
private:
enum mode_state {
MODE_VALID, // everything ok
MODE_INVALID, // network rule violation (DoS value may be set)
MODE_ERROR, // run-time error
} mode;
int nDoS;
std::string strRejectReason;
unsigned char chRejectCode;
bool corruptionPossible;
public:
CValidationState() : mode(MODE_VALID), nDoS(0), corruptionPossible(false) {}
bool DoS(int level, bool ret = false,
unsigned char chRejectCodeIn=0, std::string strRejectReasonIn="",
bool corruptionIn=false) {
chRejectCode = chRejectCodeIn;
strRejectReason = strRejectReasonIn;
corruptionPossible = corruptionIn;
if (mode == MODE_ERROR)
return ret;
nDoS += level;
mode = MODE_INVALID;
return ret;
}
bool Invalid(bool ret = false,
unsigned char _chRejectCode=0, std::string _strRejectReason="") {
return DoS(0, ret, _chRejectCode, _strRejectReason);
}
bool Error(std::string strRejectReasonIn="") {
if (mode == MODE_VALID)
strRejectReason = strRejectReasonIn;
mode = MODE_ERROR;
return false;
}
bool Abort(const std::string &msg) {
AbortNode(msg);
return Error(msg);
}
bool IsValid() const {
return mode == MODE_VALID;
}
bool IsInvalid() const {
return mode == MODE_INVALID;
}
bool IsError() const {
return mode == MODE_ERROR;
}
bool IsInvalid(int &nDoSOut) const {
if (IsInvalid()) {
nDoSOut = nDoS;
return true;
}
return false;
}
bool CorruptionPossible() const {
return corruptionPossible;
}
unsigned char GetRejectCode() const { return chRejectCode; }
std::string GetRejectReason() const { return strRejectReason; }
};
/** An in-memory indexed chain of blocks. */
class CChain {
private:
std::vector<CBlockIndex*> vChain;
public:
/** Returns the index entry for the genesis block of this chain, or NULL if none. */
CBlockIndex *Genesis() const {
return vChain.size() > 0 ? vChain[0] : NULL;
}
/** Returns the index entry for the tip of this chain, or NULL if none. */
CBlockIndex *Tip() const {
return vChain.size() > 0 ? vChain[vChain.size() - 1] : NULL;
}
/** Returns the index entry at a particular height in this chain, or NULL if no such height exists. */
CBlockIndex *operator[](int nHeight) const {
if (nHeight < 0 || nHeight >= (int)vChain.size())
return NULL;
return vChain[nHeight];
}
/** Compare two chains efficiently. */
friend bool operator==(const CChain &a, const CChain &b) {
return a.vChain.size() == b.vChain.size() &&
a.vChain[a.vChain.size() - 1] == b.vChain[b.vChain.size() - 1];
}
/** Efficiently check whether a block is present in this chain. */
bool Contains(const CBlockIndex *pindex) const {
return (*this)[pindex->nHeight] == pindex;
}
/** Find the successor of a block in this chain, or NULL if the given index is not found or is the tip. */
CBlockIndex *Next(const CBlockIndex *pindex) const {
if (Contains(pindex))
return (*this)[pindex->nHeight + 1];
else
return NULL;
}
/** Return the maximal height in the chain. Is equal to chain.Tip() ? chain.Tip()->nHeight : -1. */
int Height() const {
return vChain.size() - 1;
}
/** Set/initialize a chain with a given tip. Returns the forking point. */
CBlockIndex *SetTip(CBlockIndex *pindex);
/** Return a CBlockLocator that refers to a block in this chain (by default the tip). */
CBlockLocator GetLocator(const CBlockIndex *pindex = NULL) const;
/** Find the last common block between this chain and a locator. */
CBlockIndex *FindFork(const CBlockLocator &locator) const;
};
/** The currently-connected chain of blocks. */
extern CChain chainActive;
/** The currently best known chain of headers (some of which may be invalid). */
extern CChain chainMostWork;
/** Global variable that points to the active CCoinsView (protected by cs_main) */
extern CCoinsViewCache *pcoinsTip;
/** Global variable that points to the active block tree (protected by cs_main) */
extern CBlockTreeDB *pblocktree;
struct CBlockTemplate
{
CBlock block;
std::vector<int64_t> vTxFees;
std::vector<int64_t> vTxSigOps;
};
/** Used to relay blocks as header + vector<merkle branch>
* to filtered nodes.
*/
class CMerkleBlock
{
public:
// Public only for unit testing
CBlockHeader header;
CPartialMerkleTree txn;
public:
// Public only for unit testing and relay testing
// (not relayed)
std::vector<std::pair<unsigned int, uint256> > vMatchedTxn;
// Create from a CBlock, filtering transactions according to filter
// Note that this will call IsRelevantAndUpdate on the filter for each transaction,
// thus the filter will likely be modified.
CMerkleBlock(const CBlock& block, CBloomFilter& filter);
IMPLEMENT_SERIALIZE
(
READWRITE(header);
READWRITE(txn);
)
};
class CWalletInterface {
protected:
virtual void SyncTransaction(const uint256 &hash, const CTransaction &tx, const CBlock *pblock) =0;
virtual void EraseFromWallet(const uint256 &hash) =0;
virtual void SetBestChain(const CBlockLocator &locator) =0;
virtual void UpdatedTransaction(const uint256 &hash) =0;
virtual void Inventory(const uint256 &hash) =0;
virtual void ResendWalletTransactions() =0;
friend void ::RegisterWallet(CWalletInterface*);
friend void ::UnregisterWallet(CWalletInterface*);
friend void ::UnregisterAllWallets();
};
#endif
|
project-bitmark/pfennig
|
src/main.h
|
C
|
mit
| 37,765
|
# This file is generated by /tmp/pip-kUGBJh-build/-c
# It contains system_info results at the time of building this package.
__all__ = ["get_info","show"]
lapack_opt_info={'libraries': ['openblas', 'openblas'], 'library_dirs': ['/usr/local/lib'], 'language': 'c', 'define_macros': [('HAVE_CBLAS', None)]}
blas_opt_info={'libraries': ['openblas', 'openblas'], 'library_dirs': ['/usr/local/lib'], 'language': 'c', 'define_macros': [('HAVE_CBLAS', None)]}
blis_info={}
openblas_info={'libraries': ['openblas', 'openblas'], 'library_dirs': ['/usr/local/lib'], 'language': 'c', 'define_macros': [('HAVE_CBLAS', None)]}
openblas_lapack_info={'libraries': ['openblas', 'openblas'], 'library_dirs': ['/usr/local/lib'], 'language': 'c', 'define_macros': [('HAVE_CBLAS', None)]}
lapack_mkl_info={}
blas_mkl_info={}
def get_info(name):
g = globals()
return g.get(name, g.get(name + "_info", {}))
def show():
for name,info_dict in globals().items():
if name[0] == "_" or type(info_dict) is not type({}): continue
print(name + ":")
if not info_dict:
print(" NOT AVAILABLE")
for k,v in info_dict.items():
v = str(v)
if k == "sources" and len(v) > 200:
v = v[:60] + " ...\n... " + v[-60:]
print(" %s = %s" % (k,v))
|
ryfeus/lambda-packs
|
Shapely_numpy/source/numpy/distutils/__config__.py
|
Python
|
mit
| 1,319
|
## Install
```
npm i cli-mid-error
```
|
freeformsystems/cli-mid-error
|
doc/readme/install.md
|
Markdown
|
mit
| 40
|
'use strict';
exports.xmlns = 'http://www.w3.org/2000/xmlns/';
exports.svg = 'http://www.w3.org/2000/svg';
exports.xlink = 'http://www.w3.org/1999/xlink';
// the 'old' d3 quirk got fix in v3.5.7
// https://github.com/mbostock/d3/commit/a6f66e9dd37f764403fc7c1f26be09ab4af24fed
exports.svgAttrs = {
xmlns: exports.svg,
'xmlns:xlink': exports.xlink
};
|
etpinard/plotly.js
|
src/constants/xmlns_namespaces.js
|
JavaScript
|
mit
| 361
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block page_title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/app.css">
{% block html_head %}{% endblock %}
</head>
<body class="{% block body_css_classes %}{% endblock %}">
<script>document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');</script>
{% include '_includes/service-alert.html' %}
{% include '_includes/masthead.html' %}
<main id="content" role="main" class="content">
<div class="grid-row">
<div class="grid-3-3">
<h1 style="font-weight:bold;">{% block pageTitle %}{% endblock %}</h1>
</div>
<div class="grid-2-3">
{% block surgeryInfo %}{% endblock surgeryInfo %}
</div>
</div>
<!-- Page content goes here -->
<div class="grid-row">
<div class="grid-2-3">
{% block content %}{% endblock %}
</div>
</div>
</main>
{% include '_includes/footer.html' %}
<script src="/scripts/jquery-1.12.4.min.js"></script>
<script src="/scripts/selection-buttons.js"></script>
<!-- additional scripts etc -->
{% block body_after %}{% endblock %}
</body>
</html>
|
ballzy/local-demonstrators
|
app/views/_layouts/archive/layout_2-3_1-3_v4.html
|
HTML
|
mit
| 1,406
|
import { window, document } from 'ssr-window';
import $ from '../../utils/dom';
import Utils from '../../utils/utils';
const HashNavigation = {
onHashCange() {
const swiper = this;
const newHash = document.location.hash.replace('#', '');
const activeSlideHash = swiper.slides.eq(swiper.activeIndex).attr('data-hash');
if (newHash !== activeSlideHash) {
const newIndex = swiper.$wrapperEl.children(`.${swiper.params.slideClass}[data-hash="${newHash}"]`).index();
if (typeof newIndex === 'undefined') return;
swiper.slideTo(newIndex);
}
},
setHash() {
const swiper = this;
if (!swiper.hashNavigation.initialized || !swiper.params.hashNavigation.enabled) return;
if (swiper.params.hashNavigation.replaceState && window.history && window.history.replaceState) {
window.history.replaceState(null, null, (`#${swiper.slides.eq(swiper.activeIndex).attr('data-hash')}` || ''));
} else {
const slide = swiper.slides.eq(swiper.activeIndex);
const hash = slide.attr('data-hash') || slide.attr('data-history');
document.location.hash = hash || '';
}
},
init() {
const swiper = this;
if (!swiper.params.hashNavigation.enabled || (swiper.params.history && swiper.params.history.enabled)) return;
swiper.hashNavigation.initialized = true;
const hash = document.location.hash.replace('#', '');
if (hash) {
const speed = 0;
for (let i = 0, length = swiper.slides.length; i < length; i += 1) {
const slide = swiper.slides.eq(i);
const slideHash = slide.attr('data-hash') || slide.attr('data-history');
if (slideHash === hash && !slide.hasClass(swiper.params.slideDuplicateClass)) {
const index = slide.index();
swiper.slideTo(index, speed, swiper.params.runCallbacksOnInit, true);
}
}
}
if (swiper.params.hashNavigation.watchState) {
$(window).on('hashchange', swiper.hashNavigation.onHashCange);
}
},
destroy() {
const swiper = this;
if (swiper.params.hashNavigation.watchState) {
$(window).off('hashchange', swiper.hashNavigation.onHashCange);
}
},
};
export default {
name: 'hash-navigation',
params: {
hashNavigation: {
enabled: false,
replaceState: false,
watchState: false,
},
},
create() {
const swiper = this;
Utils.extend(swiper, {
hashNavigation: {
initialized: false,
init: HashNavigation.init.bind(swiper),
destroy: HashNavigation.destroy.bind(swiper),
setHash: HashNavigation.setHash.bind(swiper),
onHashCange: HashNavigation.onHashCange.bind(swiper),
},
});
},
on: {
init() {
const swiper = this;
if (swiper.params.hashNavigation.enabled) {
swiper.hashNavigation.init();
}
},
destroy() {
const swiper = this;
if (swiper.params.hashNavigation.enabled) {
swiper.hashNavigation.destroy();
}
},
transitionEnd() {
const swiper = this;
if (swiper.hashNavigation.initialized) {
swiper.hashNavigation.setHash();
}
},
},
};
|
dantefung/Front-End
|
code/swiper-demo/swiper-4.4.6/src/components/hash-navigation/hash-navigation.js
|
JavaScript
|
mit
| 3,141
|
class Solution {
public:
int singleNonDuplicate(vector<int>& nums)
{
int len = nums.size();
int ret = 0;
for (int i = 0; i < len; i++) {
if (i + 1 < len && (nums[i] != nums[i + 1] && nums[i] != nums[i - 1])) {
return nums[i];
}
else if (i + 1 >= len && (nums[i] != nums[i - 1])) {
return nums[i];
}
}
return ret;
}
};
|
Vaibhav/InterviewPrep
|
LeetCode/Medium/540-Single-Element-Sorted-Array.cpp
|
C++
|
mit
| 453
|
class IDObject():
"""
Base class for all objects having unique id within the application
"""
def __init__(self, objectId):
"""
Constructor method for building IDObject
objectId - the unique objectId of the object in the application
"""
self._objectId = objectId
def getId(self):
"""
Return the object's unique id
"""
return self._objectId
def testIDObject():
obj = IDObject(133)
assert obj.getId() == 133
|
rusucosmin/courses
|
ubb/fop/2015.Seminar.09/domain/IDObject.py
|
Python
|
mit
| 514
|
<!DOCTYPE html>
<html>
<head>
<title>Arduino and text to speech</title>
<script src='https://code.responsivevoice.org/responsivevoice.js'></script>
<script src="/js/jquery-2.1.1.min.js"></script>
<script src="/js/demo.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/css/style.css">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<div class="col-sm-12">
<h2>Text to speech</h1>
<textarea id="text"></textarea>
</div>
<div class="col-sm-6">
<input
onclick="responsiveVoice.speak($('#text').val(), 'Serbian Male', {pitch: 2, rate: 0.2});"
type="button"
value="Play"
class="button green"
/>
</div>
<div class="col-sm-6">
<input
onclick="responsiveVoice.cancel()"
type="button"
value="Stop"
class="button red"
/>
</div>
<div class="col-sm-6" style="margin-top: 20px">
<input
onclick="responsiveVoice.resume()"
type="button"
value="Continue"
class="button green"
/>
</div>
<div class="col-sm-6" style="margin-top: 20px">
<input
onclick="responsiveVoice.pause()"
type="button"
value="Pause"
class="button red"
/>
</div>
<div class="col-sm-12">
<h2>Fast response</h1>
<div class="row">
<div class="col-sm-12">
<input type="radio" onclick="responsiveVoice.speak(('Hello'), 'Serbian Male', {pitch: 2, rate: 0.2});" name="fast-response">
<label>Hello</label>
</div>
<div class="col-sm-12">
<input type="radio" onclick="responsiveVoice.speak(('How are you?'), 'Serbian Male', {pitch: 2, rate: 0.2});" name="fast-response">
<label>How are you?</label>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="col-sm-12">
<h2>LED CONTROL</h1>
<h4>Eye #1</h4>
</div>
<div class="col-sm-3">
<input type="radio" name="led" id="ledOnLeftEye">
<label>All</label>
</div>
<div class="col-sm-3">
<input type="radio" name="led" id="ledBlinkLeftEye">
<label>Blink</label>
</div>
<div class="col-sm-3">
<input type="radio" name="led" id="offLeftEye">
<label>Off</label>
</div>
<div class="col-sm-12">
<h4>Eye #2</h4>
</div>
<div class="col-sm-3">
<input type="radio" name="led2" id="ledOnRightEye">
<label>All</label>
</div>
<div class="col-sm-3">
<input type="radio" name="led2" id="ledRandomRightEye">
<label>Random</label>
</div>
<div class="col-sm-3">
<input type="radio" name="led2" id="offRightEye">
<label>Off</label>
</div>
<div class="col-sm-12">
<h4>Mouth</h4>
</div>
<div class="col-sm-3">
<input type="radio" name="led3" id="mouthAll">
<label>All</label>
</div>
<div class="col-sm-3">
<input type="radio" name="led3" id="happyMouth">
<label>Happy</label>
</div>
<div class="col-sm-3">
<input type="radio" name="led3" id="sadMouth">
<label>Sad</label>
</div>
<div class="col-sm-3">
<input type="radio" name="led3" id="offMouth">
<label>Off</label>
</div>
<div class="col-sm-12">
<h2>Eyebrows (motor control)</h1>
</div>
<div class="col-sm-3">
<input type="radio" name="eyebrows" id="happyEyebrows">
<label>Happy</label>
</div>
<div class="col-sm-3">
<input type="radio" name="eyebrows" id="sadEyebrows">
<label>Sad</label>
</div>
</div>
</div>
</div>
</body>
</html>
|
valerijaspasojevic/Text-to-speech-and-led-control-
|
views/dashboard.html
|
HTML
|
mit
| 4,246
|
'use strict';
describe("Schema.SchemaDefinition", function () {
var SchemaDefinition = Divhide.SubModules.Schema.SchemaDefinition;
beforeEach(function () {
jasmine.addMatchers(window.JasmineCustomMatchers);
});
it(".ctor(Array)", function () {
var c = new SchemaDefinition({
schema : [ 1, 2 ],
default: [],
required: true,
repeatable: false
});
var schema = new SchemaDefinition({
schema : [
new SchemaDefinition({ schema: 2, required: true }),
new SchemaDefinition({ schema: 1, required: true })
],
default: [],
required: true,
repeatable: false
});
expect(schema).equals(c);
});
it(".ctor(Object)", function () {
var c = new SchemaDefinition({
schema : { one: 1, two: 2 },
required: true,
repeatable: false
});
var schema = new SchemaDefinition({
schema : {
"one": new SchemaDefinition({ schema: 0, required: true }),
"two": new SchemaDefinition({ schema: 0, required: true })
},
required: true,
repeatable: false
});
expect(schema).equals(c);
});
it(".ctor(String)", function () {
var expected = new SchemaDefinition({
schema : '',
required: true,
repeatable: false
});
var schema = new SchemaDefinition({ schema: '0' });
expect(schema).equals(expected);
});
it(".ctor(Number)", function () {
var expected = new SchemaDefinition({
schema : 0,
required: true,
repeatable: false
});
var schema = new SchemaDefinition({ schema: 1 });
expect(schema).equals(expected);
});
});
|
divhide/node-divhide
|
src/Common/Schema/SchemaDefinitionJasmineSpec.js
|
JavaScript
|
mit
| 1,930
|
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Chat\V1;
use Twilio\Options;
use Twilio\Values;
abstract class CredentialOptions {
/**
* @param string $friendlyName A string to describe the resource
* @param string $certificate [APN only] The URL encoded representation of the
* certificate
* @param string $privateKey [APN only] The URL encoded representation of the
* private key
* @param bool $sandbox [APN only] Whether to send the credential to sandbox
* APNs
* @param string $apiKey [GCM only] The API key for the project that was
* obtained from the Google Developer console for your
* GCM Service application credential
* @param string $secret [FCM only] The Server key of your project from
* Firebase console
* @return CreateCredentialOptions Options builder
*/
public static function create($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) {
return new CreateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret);
}
/**
* @param string $friendlyName A string to describe the resource
* @param string $certificate [APN only] The URL encoded representation of the
* certificate
* @param string $privateKey [APN only] The URL encoded representation of the
* private key
* @param bool $sandbox [APN only] Whether to send the credential to sandbox
* APNs
* @param string $apiKey [GCM only] The API key for the project that was
* obtained from the Google Developer console for your
* GCM Service application credential
* @param string $secret [FCM only] The Server key of your project from
* Firebase console
* @return UpdateCredentialOptions Options builder
*/
public static function update($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) {
return new UpdateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret);
}
}
class CreateCredentialOptions extends Options {
/**
* @param string $friendlyName A string to describe the resource
* @param string $certificate [APN only] The URL encoded representation of the
* certificate
* @param string $privateKey [APN only] The URL encoded representation of the
* private key
* @param bool $sandbox [APN only] Whether to send the credential to sandbox
* APNs
* @param string $apiKey [GCM only] The API key for the project that was
* obtained from the Google Developer console for your
* GCM Service application credential
* @param string $secret [FCM only] The Server key of your project from
* Firebase console
*/
public function __construct($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) {
$this->options['friendlyName'] = $friendlyName;
$this->options['certificate'] = $certificate;
$this->options['privateKey'] = $privateKey;
$this->options['sandbox'] = $sandbox;
$this->options['apiKey'] = $apiKey;
$this->options['secret'] = $secret;
}
/**
* A descriptive string that you create to describe the new resource. It can be up to 64 characters long.
*
* @param string $friendlyName A string to describe the resource
* @return $this Fluent Builder
*/
public function setFriendlyName($friendlyName) {
$this->options['friendlyName'] = $friendlyName;
return $this;
}
/**
* [APN only] The URL encoded representation of the certificate. For example,
`-----BEGIN CERTIFICATE-----
MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==
-----END CERTIFICATE-----`
*
* @param string $certificate [APN only] The URL encoded representation of the
* certificate
* @return $this Fluent Builder
*/
public function setCertificate($certificate) {
$this->options['certificate'] = $certificate;
return $this;
}
/**
* [APN only] The URL encoded representation of the private key. For example,
`-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR.
-----END RSA PRIVATE KEY-----`
*
* @param string $privateKey [APN only] The URL encoded representation of the
* private key
* @return $this Fluent Builder
*/
public function setPrivateKey($privateKey) {
$this->options['privateKey'] = $privateKey;
return $this;
}
/**
* [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production.
*
* @param bool $sandbox [APN only] Whether to send the credential to sandbox
* APNs
* @return $this Fluent Builder
*/
public function setSandbox($sandbox) {
$this->options['sandbox'] = $sandbox;
return $this;
}
/**
* [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential.
*
* @param string $apiKey [GCM only] The API key for the project that was
* obtained from the Google Developer console for your
* GCM Service application credential
* @return $this Fluent Builder
*/
public function setApiKey($apiKey) {
$this->options['apiKey'] = $apiKey;
return $this;
}
/**
* [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging.
*
* @param string $secret [FCM only] The Server key of your project from
* Firebase console
* @return $this Fluent Builder
*/
public function setSecret($secret) {
$this->options['secret'] = $secret;
return $this;
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
$options = array();
foreach ($this->options as $key => $value) {
if ($value != Values::NONE) {
$options[] = "$key=$value";
}
}
return '[Twilio.Chat.V1.CreateCredentialOptions ' . \implode(' ', $options) . ']';
}
}
class UpdateCredentialOptions extends Options {
/**
* @param string $friendlyName A string to describe the resource
* @param string $certificate [APN only] The URL encoded representation of the
* certificate
* @param string $privateKey [APN only] The URL encoded representation of the
* private key
* @param bool $sandbox [APN only] Whether to send the credential to sandbox
* APNs
* @param string $apiKey [GCM only] The API key for the project that was
* obtained from the Google Developer console for your
* GCM Service application credential
* @param string $secret [FCM only] The Server key of your project from
* Firebase console
*/
public function __construct($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) {
$this->options['friendlyName'] = $friendlyName;
$this->options['certificate'] = $certificate;
$this->options['privateKey'] = $privateKey;
$this->options['sandbox'] = $sandbox;
$this->options['apiKey'] = $apiKey;
$this->options['secret'] = $secret;
}
/**
* A descriptive string that you create to describe the resource. It can be up to 64 characters long.
*
* @param string $friendlyName A string to describe the resource
* @return $this Fluent Builder
*/
public function setFriendlyName($friendlyName) {
$this->options['friendlyName'] = $friendlyName;
return $this;
}
/**
* [APN only] The URL encoded representation of the certificate. For example,
`-----BEGIN CERTIFICATE-----
MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==
-----END CERTIFICATE-----`
*
* @param string $certificate [APN only] The URL encoded representation of the
* certificate
* @return $this Fluent Builder
*/
public function setCertificate($certificate) {
$this->options['certificate'] = $certificate;
return $this;
}
/**
* [APN only] The URL encoded representation of the private key. For example,
`-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR.
-----END RSA PRIVATE KEY-----`
*
* @param string $privateKey [APN only] The URL encoded representation of the
* private key
* @return $this Fluent Builder
*/
public function setPrivateKey($privateKey) {
$this->options['privateKey'] = $privateKey;
return $this;
}
/**
* [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production.
*
* @param bool $sandbox [APN only] Whether to send the credential to sandbox
* APNs
* @return $this Fluent Builder
*/
public function setSandbox($sandbox) {
$this->options['sandbox'] = $sandbox;
return $this;
}
/**
* [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential.
*
* @param string $apiKey [GCM only] The API key for the project that was
* obtained from the Google Developer console for your
* GCM Service application credential
* @return $this Fluent Builder
*/
public function setApiKey($apiKey) {
$this->options['apiKey'] = $apiKey;
return $this;
}
/**
* [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging.
*
* @param string $secret [FCM only] The Server key of your project from
* Firebase console
* @return $this Fluent Builder
*/
public function setSecret($secret) {
$this->options['secret'] = $secret;
return $this;
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
$options = array();
foreach ($this->options as $key => $value) {
if ($value != Values::NONE) {
$options[] = "$key=$value";
}
}
return '[Twilio.Chat.V1.UpdateCredentialOptions ' . \implode(' ', $options) . ']';
}
}
|
unaio/una
|
upgrade/files/12.1.0-13.0.0.A1/files/plugins/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialOptions.php
|
PHP
|
mit
| 11,824
|
---
title: "3 Col Portfolio"
slug: 3-col-portfolio
src: /template-overviews/3-col-portfolio
categories: template portfolios unstyled
description: "A simple, three column, portfolio page template perfect for showcasing a larger group of projects."
bump: "A three column portfolio template."
img-src: /img/templates/3-col-portfolio.jpg
img-desc: "Free Bootstrap 4 Portfolio Template"
layout: template-overview
meta-title: "Three Column Portfolio - Free Bootstrap Template"
meta-description: "A three column portfolio page template for Bootstrap 4. All Start Bootstrap templates are free to use and open source."
features:
- Three column portfolio layout
- Item heading and description areas
long-description: "3 Col Portfolio is a simple, three column portfolio page grid that is ideal for showcasing a larger group of projects with minor details."
alt-version: "no"
user-version: "no"
v4-version: "yes"
alt-v4: "https://github.com/BlackrockDigital/startbootstrap-3-col-portfolio/archive/v4-dev.zip"
redirect_from:
- /3-col-portfolio/
- /3-col-portfolio.php/
- /templates/3-col-portfolio.html/
- /templates/3-col-portfolio.htm/
- /templates/3-col-portfolio/
- /templates/3-col-portfolio/index.html
- /downloads/3-col-portfolio.zip/
---
|
Erin-Denton/flpy.github.io
|
_templates/2013-09-24-template-3-col-portfolio.md
|
Markdown
|
mit
| 1,277
|
//
// LayoutExample.cpp
// Pods
//
// Created by Leif Shackelford on 6/19/15.
//
//
#include "simpleSynth.h"
//#include "leif/audio/Audio.h"
void SimpleSynth::moveToView() {
setLayoutMethod(Layout::Method::Vertical);
addChild(View::view())->setBackgroundColor(Color("red"));
addChild(View::view())->setBackgroundColor(Color("orange"));
addChild(View::view())->setBackgroundColor(Color("yellow"));
addChild(View::view())->setBackgroundColor(Color("green"));
addChild(View::view())->setBackgroundColor(Color("blue"));
auto row = addChild(View::view())->setBackgroundColor(Color("violet"));
row->setLayoutMethod(Layout::Method::Horizontal);
row->addChild(View::view())->setBackgroundColor(Color("red"));
row->addChild(View::view())->setBackgroundColor(Color("orange"));
row->addChild(View::view())->setBackgroundColor(Color("yellow"));
row->addChild(View::view())->setBackgroundColor(Color("green"));
row->addChild(View::view())->setBackgroundColor(Color("blue"));
auto col = row->addChild(View::view())->setBackgroundColor(Color("violet"));
col->setLayoutMethod(Layout::Method::Vertical);
col->addChild(View::view())->setBackgroundColor(Color("red"));
col->addChild(View::view())->setBackgroundColor(Color("orange"));
col->addChild(View::view())->setBackgroundColor(Color("yellow"));
col->addChild(View::view())->setBackgroundColor(Color("green"));
col->addChild(View::view())->setBackgroundColor(Color("blue"));
col->addChild(View::view())->setBackgroundColor(Color("violet"));
}
void SimpleSynth::handleUXEvent(shared_ptr<UXEvent> event){
}
|
structuresound/NodeKittenX
|
examples/archive/simpleSynth.cpp
|
C++
|
mit
| 1,593
|
//
// AppDelegate.h
// FFPickerView
//
// Created by Felix Ayala on 6/18/15.
// Copyright (c) 2015 Pandorga. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
rockbarato/FFPickerView
|
FFPickerView/AppDelegate.h
|
C
|
mit
| 281
|
module AuthlogicConnect::Oauth
# This module is responsible for adding oauth
# to the Authlogic::Session::Base class.
module Session
def self.included(base)
base.class_eval do
include InstanceMethods
end
end
module InstanceMethods
include Process
def self.included(klass)
klass.class_eval do
validate :validate_by_oauth, :if => :authenticating_with_oauth?
end
end
# Hooks into credentials so that you can pass a user who has already has an oauth access token.
def credentials=(value)
super
values = value.is_a?(Array) ? value : [value]
hash = values.first.is_a?(Hash) ? values.first.with_indifferent_access : nil
self.record = hash[:priority_record] if !hash.nil? && hash.key?(:priority_record)
end
def record=(record)
@record = record
end
private
def complete_oauth_transaction
if @record
self.attempted_record = record
else
# this generated token is always the same for a user!
# this is searching with User.find ...
# attempted_record is part of AuthLogic
hash = oauth_token_and_secret
token = token_class.find_by_key_or_token(hash[:key], hash[:token], :include => [:user]) # some weird error if I leave out the include)
if token
self.attempted_record = token.user
elsif auto_register?
self.attempted_record = klass.new
self.attempted_record.access_tokens << token_class.new(hash)
self.attempted_record.save
else
auth_session[:_key] = hash[:key]
auth_session[:_token] = hash[:token]
auth_session[:_secret] = hash[:secret]
end
end
if !attempted_record
errors.add(:user, "Could not find user in our database, have you registered with your oauth account?")
end
end
end
end
end
|
oelmekki/authlogic-connect
|
lib/authlogic_connect/oauth/session.rb
|
Ruby
|
mit
| 2,008
|
package com.chatt.demo;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.chatt.demo.custom.CustomActivity;
import com.chatt.demo.utils.Utils;
import com.parse.LogInCallback;
import com.parse.ParseException;
import com.parse.ParseUser;
import org.wire.arvdroid.R;
/**
* The Class Login is an Activity class that shows the login screen to users.
* The current implementation simply includes the options for Login and button
* for Register. On login button click, it sends the Login details to Parse
* server to verify user.
*/
public class Login extends CustomActivity
{
/** The username edittext. */
private EditText user;
/** The password edittext. */
private EditText pwd;
/* (non-Javadoc)
* @see com.chatt.custom.CustomActivity#onCreate(android.os.Bundle)
*/
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
setTouchNClick(R.id.btnLogin);
setTouchNClick(R.id.btnReg);
user = (EditText) findViewById(R.id.user);
pwd = (EditText) findViewById(R.id.pwd);
}
/* (non-Javadoc)
* @see com.chatt.custom.CustomActivity#onClick(android.view.View)
*/
@Override
public void onClick(View v)
{
super.onClick(v);
if (v.getId() == R.id.btnReg)
{
startActivityForResult(new Intent(this, Register.class), 10);
}
else
{
String u = user.getText().toString();
String p = pwd.getText().toString();
if (u.length() == 0 || p.length() == 0)
{
Utils.showDialog(this, R.string.err_fields_empty);
return;
}
final ProgressDialog dia = ProgressDialog.show(this, null,
getString(R.string.alert_wait));
ParseUser.logInInBackground(u, p, new LogInCallback() {
@Override
public void done(ParseUser pu, ParseException e)
{
dia.dismiss();
if (pu != null)
{
UserList.user = pu;
startActivity(new Intent(Login.this, UserList.class));
finish();
}
else
{
Utils.showDialog(
Login.this,
getString(R.string.err_login) + " "
+ e.getMessage());
e.printStackTrace();
}
}
});
}
}
/* (non-Javadoc)
* @see android.support.v4.app.FragmentActivity#onActivityResult(int, int, android.content.Intent)
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 10 && resultCode == RESULT_OK)
finish();
}
}
|
arjunvijayvargiya/CoffeeConnect
|
src/com/chatt/demo/Login.java
|
Java
|
mit
| 2,585
|
/*
Ionize Editor mode CSS
Used by Base_Controller->render() to display the "connected" marker on the website side
when the user is connected to the Admin panel as Editor.
*/
#ionizeLoggedAsEditorFlag{
width:80px;
height:80px;
position: absolute;
z-index: 10001;
top:0;
left:0;
background: url(../images/flag_edit_mode.png) no-repeat top left;
cursor: pointer;
}
#ionizeLoggedAsEditorFlag a{
display:block;
width:80px;
height:80px;
border:none;
text-decoration: none;
background: none;
}
|
zoearthmoon/codeigniter_ionize
|
themes/admin/styles/original/css/logged-as-editor.css
|
CSS
|
mit
| 507
|
[coffeescripted-sbt](http://github.com/softprops/coffeescripted-sbt#readme) compiles your CoffeeScripts so you don't have to.
|
sbt/coffeescripted-sbt
|
notes/about.markdown
|
Markdown
|
mit
| 126
|
'use strict';
const gulp = require('gulp');
const gulpif = require('gulp-if');
const jscs = require('gulp-jscs');
const stylish = require('jscs-stylish');
module.exports = (src, opts) => {
opts = Object.assign({
configPath: './node_modules/habanero-code-style/js/.jscsrc',
reporter: stylish.path,
watch: false
}, opts);
return gulp.src(src)
.pipe(jscs(opts))
.pipe(jscs.reporter())
.pipe(gulpif(!opts.watch, jscs.reporter('fail')));
};
|
cwparsons/cwparsonsca
|
gulp/jscs.js
|
JavaScript
|
mit
| 454
|
$(document).ready(function() {
vis.createBreadcrumbs($(".container.full").first());
});
// namespace
var vis = {};
/**
* Adds a breadcrumb as first child to the specified container.
*
* @author felixhayashi
*/
vis.createBreadcrumbs = function(container) {
// use the url to infer the path
var crumbs = location.pathname.split('/');
// number of ancestor directories
var stepbackIndex = crumbs.length-1;
var breadcrumbs = $.map(crumbs, function(crumb, i) {
// first and last element of the split
if(!crumb) return;
stepbackIndex--;
if(/\.html$/.test(crumb)) {
// strip the .html to make it look prettier
return "<span>" + crumb.replace(/\.html$/, "") + "</span>";
} else {
// calculate the relative url
for(var ref=crumb+"/", j=0; j<stepbackIndex; j++, ref="../"+ref);
return "<a href='" + ref + "'>" + crumb + "</a>";
}
}).join("") || "Home";
// insert into the container at the beginning.
$(container).prepend("<div id=\"breadcrumbs\">" + breadcrumbs + "</div>");
};
|
reshak/angular-dashboard-framework
|
sample/widgets/topology/sample/components/vis/docs/js/main.js
|
JavaScript
|
mit
| 1,111
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Baseline;
using Marten.Events;
using Marten.Linq;
using Marten.Linq.Model;
using Marten.Linq.QueryHandlers;
using Marten.Schema;
using Npgsql;
namespace Marten.Services.BatchQuerying
{
public class BatchedQuery : IBatchedQuery, IBatchEvents
{
private static readonly MartenQueryParser QueryParser = new MartenQueryParser();
private readonly NpgsqlCommand _command = new NpgsqlCommand();
private readonly IIdentityMap _identityMap;
private readonly IList<IBatchQueryItem> _items = new List<IBatchQueryItem>();
private readonly QuerySession _parent;
private readonly IManagedConnection _runner;
private readonly IDocumentSchema _schema;
private readonly ISerializer _serializer;
public BatchedQuery(IManagedConnection runner, IDocumentSchema schema, IIdentityMap identityMap,
QuerySession parent, ISerializer serializer)
{
_runner = runner;
_schema = schema;
_identityMap = identityMap;
_parent = parent;
_serializer = serializer;
}
public IBatchEvents Events => this;
public Task<T> Load<T>(string id) where T : class
{
return load<T>(id);
}
public Task<T> Load<T>(ValueType id) where T : class
{
return load<T>(id);
}
public IBatchLoadByKeys<TDoc> LoadMany<TDoc>() where TDoc : class
{
return new BatchLoadByKeys<TDoc>(this);
}
public Task<IList<T>> Query<T>(string sql, params object[] parameters) where T : class
{
return AddItem(new UserSuppliedQueryHandler<T>(_schema, _serializer, sql, parameters), null);
}
public IBatchedQueryable<T> Query<T>() where T : class
{
return new BatchedQueryable<T>(this, _parent.Query<T>());
}
public async Task Execute(CancellationToken token = default(CancellationToken))
{
var map = _identityMap.ForQuery();
if (!_items.Any()) return;
await _runner.ExecuteAsync(_command, async (cmd, tk) =>
{
using (var reader = await _command.ExecuteReaderAsync(tk).ConfigureAwait(false))
{
await _items[0].Read(reader, map, token).ConfigureAwait(false);
var others = _items.Skip(1).ToArray();
foreach (var item in others)
{
var hasNext = await reader.NextResultAsync(token).ConfigureAwait(false);
if (!hasNext)
throw new InvalidOperationException("There is no next result to read over.");
await item.Read(reader, map, token).ConfigureAwait(false);
}
}
return 0;
}, token).ConfigureAwait(false);
}
public void ExecuteSynchronously()
{
var map = _identityMap.ForQuery();
if (!_items.Any()) return;
_runner.Execute(_command, cmd =>
{
using (var reader = _command.ExecuteReader())
{
_items[0].Read(reader, map);
_items.Skip(1).Each(item =>
{
var hasNext = reader.NextResult();
if (!hasNext)
throw new InvalidOperationException("There is no next result to read over.");
item.Read(reader, map);
});
}
});
}
public Task<TResult> Query<TDoc, TResult>(ICompiledQuery<TDoc, TResult> query)
{
QueryStatistics stats;
var handler = _schema.HandlerFactory.HandlerFor(query, out stats);
return AddItem(handler, stats);
}
public Task<T> AggregateStream<T>(Guid streamId, int version = 0, DateTime? timestamp = null)
where T : class, new()
{
var inner = new EventQueryHandler(new EventSelector(_schema.Events, _serializer), streamId, version,
timestamp);
var aggregator = _schema.Events.AggregateFor<T>();
var handler = new AggregationQueryHandler<T>(aggregator, inner);
return AddItem(handler, null);
}
public Task<IEvent> Load(Guid id)
{
var handler = new SingleEventQueryHandler(id, _schema.Events, _serializer);
return AddItem(handler, null);
}
public Task<StreamState> FetchStreamState(Guid streamId)
{
var handler = new StreamStateHandler(_schema.Events, streamId);
return AddItem(handler, null);
}
public Task<IList<IEvent>> FetchStream(Guid streamId, int version = 0, DateTime? timestamp = null)
{
var selector = new EventSelector(_schema.Events, _serializer);
var handler = new EventQueryHandler(selector, streamId, version, timestamp);
return AddItem(handler, null);
}
public Task<T> AddItem<T>(IQueryHandler<T> handler, QueryStatistics stats)
{
_schema.EnsureStorageExists(handler.SourceType);
var item = new BatchQueryItem<T>(handler, stats);
_items.Add(item);
item.Configure(_schema, _command);
return item.Result;
}
private Task<T> load<T>(object id) where T : class
{
if (_identityMap.Has<T>(id))
return Task.FromResult(_identityMap.Retrieve<T>(id));
var mapping = _schema.MappingFor(typeof(T)).ToQueryableDocument();
return AddItem(new LoadByIdHandler<T>(_schema.ResolverFor<T>(), mapping, id), null);
}
public Task<bool> Any<TDoc>(IMartenQueryable<TDoc> queryable)
{
return AddItem(queryable.ToLinqQuery().ToAny(), null);
}
public Task<long> Count<TDoc>(IMartenQueryable<TDoc> queryable)
{
return AddItem(queryable.ToLinqQuery().ToCount<long>(), null);
}
internal Task<IList<T>> Query<T>(IMartenQueryable<T> queryable)
{
var expression = queryable.Expression;
var query = QueryParser.GetParsedQuery(expression);
return AddItem(new LinqQuery<T>(_schema, query, queryable.Includes.ToArray(), queryable.Statistics).ToList(), queryable.Statistics);
}
public Task<T> First<T>(IMartenQueryable<T> queryable)
{
var query = queryable.ToLinqQuery();
return AddItem(OneResultHandler<T>.First(query), queryable.Statistics);
}
public Task<T> FirstOrDefault<T>(IMartenQueryable<T> queryable)
{
var query = queryable.ToLinqQuery();
return AddItem(OneResultHandler<T>.FirstOrDefault(query), queryable.Statistics);
}
public Task<T> Single<T>(IMartenQueryable<T> queryable)
{
var query = queryable.ToLinqQuery();
return AddItem(OneResultHandler<T>.Single(query), queryable.Statistics);
}
public Task<T> SingleOrDefault<T>(IMartenQueryable<T> queryable)
{
var query = queryable.ToLinqQuery();
return AddItem(OneResultHandler<T>.SingleOrDefault(query), queryable.Statistics);
}
public Task<TResult> Min<TResult>(IQueryable<TResult> queryable)
{
var linqQuery = queryable.As<IMartenQueryable<TResult>>().ToLinqQuery();
return AddItem(AggregateQueryHandler<TResult>.Min(linqQuery), null);
}
public Task<TResult> Max<TResult>(IQueryable<TResult> queryable)
{
var linqQuery = queryable.As<IMartenQueryable<TResult>>().ToLinqQuery();
return AddItem(AggregateQueryHandler<TResult>.Max(linqQuery), null);
}
public Task<TResult> Sum<TResult>(IQueryable<TResult> queryable)
{
var linqQuery = queryable.As<IMartenQueryable<TResult>>().ToLinqQuery();
return AddItem(AggregateQueryHandler<TResult>.Sum(linqQuery), null);
}
public Task<double> Average<T>(IQueryable<T> queryable)
{
var linqQuery = queryable.As<IMartenQueryable<T>>().ToLinqQuery();
return AddItem(AggregateQueryHandler<double>.Average(linqQuery), null);
}
public class BatchLoadByKeys<TDoc> : IBatchLoadByKeys<TDoc> where TDoc : class
{
private readonly BatchedQuery _parent;
public BatchLoadByKeys(BatchedQuery parent)
{
_parent = parent;
}
public Task<IList<TDoc>> ById<TKey>(params TKey[] keys)
{
return load(keys);
}
public Task<IList<TDoc>> ByIdList<TKey>(IEnumerable<TKey> keys)
{
return load(keys.ToArray());
}
private Task<IList<TDoc>> load<TKey>(TKey[] keys)
{
var resolver = _parent._schema.ResolverFor<TDoc>();
var mapping = _parent._schema.MappingFor(typeof(TDoc)).ToQueryableDocument();
return _parent.AddItem(new LoadByIdArrayHandler<TDoc, TKey>(resolver, mapping, keys), null);
}
}
}
}
|
tim-cools/Marten
|
src/Marten/Services/BatchQuerying/BatchedQuery.cs
|
C#
|
mit
| 9,822
|
package unit.kernel.serial_ports.rxtx_port_configuration;
import kernel.serial_ports.PortConfiguration;
import kernel.serial_ports.RXTXPortConfiguration;
import org.junit.Before;
import unit.kernel.serial_ports.SerialPortsTestCase;
/**
* Base class for tests involving
* {@link kernel.serial_ports.RXTXPortConfiguration}
*/
public abstract class RXTXPortConfigurationTestCase extends
SerialPortsTestCase {
protected final int baudRate = PortConfiguration.BAUD_RATE_9600;
protected final int stopBits = PortConfiguration.STOPBITS_1;
protected final int dataBits = PortConfiguration.DATABITS_8;
protected final int parityBits = PortConfiguration.PARITY_NONE;
protected RXTXPortConfiguration portConfiguration;
@Before
public void setUpPortConfiguration(){
this.portConfiguration = new RXTXPortConfiguration(
baudRate, stopBits, dataBits, parityBits
);
}
}
|
OmicronProject/BakeoutController
|
src/test/java/unit/kernel/serial_ports/rxtx_port_configuration/RXTXPortConfigurationTestCase.java
|
Java
|
mit
| 931
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.