text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<context>
    <name>AboutPage</name>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="43"/>
        <source>About LinksBag</source>
        <translation>关于LinksBag</translation>
    </message>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="71"/>
        <source>Unofficial native Pocket client for Sailfish OS</source>
        <translation>非官方原生旗鱼Pocket客户端</translation>
    </message>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="86"/>
        <source>Copyright &#169; 2014-2018 Oleg Linkin</source>
        <translation>版权 &#169; 2014-2018 Oleg Linkin</translation>
    </message>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="135"/>
        <source>License</source>
        <translation>许可</translation>
    </message>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="151"/>
        <source>LinksBag is an open source software which is distributed under the terms of the
 MIT License
The source code is available at GitHub</source>
        <translation>LinksBag 是一个开源软件, 根据
MIT License
的条款分发。源代码可在GitHub获取。</translation>
    </message>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="162"/>
        <source>Donate or Contribute</source>
        <translation>捐赠或贡献</translation>
    </message>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="169"/>
        <source>WebMoney</source>
        <translation>WebMoney</translation>
    </message>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="174"/>
        <source>YandexMoney</source>
        <translation>YandexMoney</translation>
    </message>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="179"/>
        <source>Development</source>
        <translation>开发</translation>
    </message>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="184"/>
        <source>Translations</source>
        <translation>翻译</translation>
    </message>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="190"/>
        <source>Gratitude</source>
        <translation>感激</translation>
    </message>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="196"/>
        <source>Developers</source>
        <translation>开发者</translation>
    </message>
    <message>
        <location filename="../qml/pages/AboutPage.qml" line="201"/>
        <source>Translators</source>
        <translation>译者</translation>
    </message>
</context>
<context>
    <name>ArticleBookmarkView</name>
    <message>
        <location filename="../qml/pages/components/ArticleBookmarkView.qml" line="89"/>
        <source>Reload</source>
        <translation>重新加载</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/ArticleBookmarkView.qml" line="98"/>
        <location filename="../qml/pages/components/ArticleBookmarkView.qml" line="127"/>
        <source>Mark as unread</source>
        <translation>标记为未读</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/ArticleBookmarkView.qml" line="99"/>
        <location filename="../qml/pages/components/ArticleBookmarkView.qml" line="128"/>
        <source>Mark as read</source>
        <translation>标记为已读</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/ArticleBookmarkView.qml" line="108"/>
        <location filename="../qml/pages/components/ArticleBookmarkView.qml" line="139"/>
        <source>Mark as unfavorite</source>
        <translation>取消收藏</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/ArticleBookmarkView.qml" line="109"/>
        <location filename="../qml/pages/components/ArticleBookmarkView.qml" line="140"/>
        <source>Mark as favorite</source>
        <translation>收藏</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/ArticleBookmarkView.qml" line="116"/>
        <source>Open in browser</source>
        <translation>在浏览器打开</translation>
    </message>
</context>
<context>
    <name>ArticleListCover</name>
    <message>
        <location filename="../qml/cover/ArticleListCover.qml" line="45"/>
        <source>%1 bookmarks</source>
        <translation>%1 书签</translation>
    </message>
</context>
<context>
    <name>AuthorizationPage</name>
    <message>
        <location filename="../qml/pages/AuthorizationPage.qml" line="36"/>
        <source>Authorization process...</source>
        <translation>获取授权...</translation>
    </message>
</context>
<context>
    <name>BookmarkDownloadsPage</name>
    <message>
        <location filename="../qml/pages/BookmarkDownloadsPage.qml" line="47"/>
        <location filename="../qml/pages/BookmarkDownloadsPage.qml" line="80"/>
        <source>Downloading</source>
        <translation>下载中</translation>
    </message>
    <message>
        <location filename="../qml/pages/BookmarkDownloadsPage.qml" line="48"/>
        <source>%L1 remaining</source>
        <translation>剩余 %L1</translation>
    </message>
    <message>
        <location filename="../qml/pages/BookmarkDownloadsPage.qml" line="80"/>
        <source>Queued</source>
        <translation>排队</translation>
    </message>
</context>
<context>
    <name>BookmarkItem</name>
    <message>
        <location filename="../qml/pages/components/BookmarkItem.qml" line="49"/>
        <source>Tags</source>
        <translation>标签</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/BookmarkItem.qml" line="63"/>
        <source>Unread</source>
        <translation>未读</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/BookmarkItem.qml" line="63"/>
        <source>Read</source>
        <translation>阅读</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/BookmarkItem.qml" line="75"/>
        <source>Unfavorite</source>
        <translation>取消收藏</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/BookmarkItem.qml" line="75"/>
        <source>Favorite</source>
        <translation>收藏</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/BookmarkItem.qml" line="86"/>
        <location filename="../qml/pages/components/BookmarkItem.qml" line="90"/>
        <source>Remove</source>
        <translation>移除</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/BookmarkItem.qml" line="98"/>
        <source>Copy url</source>
        <translation>复制链接</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/BookmarkItem.qml" line="103"/>
        <source>Url copied into clipboard</source>
        <translation>链接已复制到剪贴板</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/BookmarkItem.qml" line="109"/>
        <source>Browser</source>
        <translation>浏览器</translation>
    </message>
</context>
<context>
    <name>BookmarkRemorsePopup</name>
    <message numerus="yes">
        <location filename="../qml/pages/components/BookmarkRemorsePopup.qml" line="34"/>
        <source>Deleting %Ln bookmark(s)</source>
        <translation>
            <numerusform>正在删除%Ln的书签</numerusform>
        </translation>
    </message>
</context>
<context>
    <name>BookmarksPage</name>
    <message>
        <location filename="../qml/pages/BookmarksPage.qml" line="56"/>
        <source>Bookmarks</source>
        <translation>书签</translation>
    </message>
    <message>
        <location filename="../qml/pages/BookmarksPage.qml" line="69"/>
        <source>Search</source>
        <translation>搜索</translation>
    </message>
    <message>
        <location filename="../qml/pages/BookmarksPage.qml" line="81"/>
        <source>There are no bookmarks. Pull down to refresh.</source>
        <translation>尚未添加书签,下拉以刷新。</translation>
    </message>
    <message>
        <location filename="../qml/pages/BookmarksPage.qml" line="88"/>
        <source>Settings</source>
        <translation>设置</translation>
    </message>
    <message>
        <location filename="../qml/pages/BookmarksPage.qml" line="93"/>
        <source>Select bookmarks</source>
        <translation>选择书签</translation>
    </message>
    <message>
        <location filename="../qml/pages/BookmarksPage.qml" line="104"/>
        <source>Hide search field</source>
        <translation>隐藏搜索字段</translation>
    </message>
    <message>
        <location filename="../qml/pages/BookmarksPage.qml" line="105"/>
        <source>Show search field</source>
        <translation>显示搜索字段</translation>
    </message>
    <message>
        <location filename="../qml/pages/BookmarksPage.qml" line="114"/>
        <source>Filter</source>
        <translation>筛选</translation>
    </message>
    <message>
        <location filename="../qml/pages/BookmarksPage.qml" line="131"/>
        <source>Refresh</source>
        <translation>刷新</translation>
    </message>
</context>
<context>
    <name>DefaultBookmarkView</name>
    <message>
        <location filename="../qml/pages/components/DefaultBookmarkView.qml" line="46"/>
        <source>Reload</source>
        <translation>重新加载</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/DefaultBookmarkView.qml" line="54"/>
        <location filename="../qml/pages/components/DefaultBookmarkView.qml" line="83"/>
        <source>Mark as unread</source>
        <translation>标记为未读</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/DefaultBookmarkView.qml" line="55"/>
        <location filename="../qml/pages/components/DefaultBookmarkView.qml" line="84"/>
        <source>Mark as read</source>
        <translation>标记为已读</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/DefaultBookmarkView.qml" line="64"/>
        <location filename="../qml/pages/components/DefaultBookmarkView.qml" line="95"/>
        <source>Mark as unfavorite</source>
        <translation>取消收藏</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/DefaultBookmarkView.qml" line="65"/>
        <location filename="../qml/pages/components/DefaultBookmarkView.qml" line="96"/>
        <source>Mark as favorite</source>
        <translation>收藏</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/DefaultBookmarkView.qml" line="72"/>
        <source>Open in browser</source>
        <translation>在浏览器打开</translation>
    </message>
</context>
<context>
    <name>DevelopersModel</name>
    <message>
        <location filename="../qml/pages/models/DevelopersModel.qml" line="29"/>
        <source>Developers</source>
        <translation>开发者</translation>
    </message>
</context>
<context>
    <name>DevelopersPage</name>
    <message>
        <location filename="../qml/pages/DevelopersPage.qml" line="14"/>
        <source>Development</source>
        <translation>开发</translation>
    </message>
    <message>
        <location filename="../qml/pages/DevelopersPage.qml" line="19"/>
        <source>Source Code</source>
        <translation>源代码</translation>
    </message>
</context>
<context>
    <name>EditTagDialog</name>
    <message>
        <location filename="../qml/dialogs/EditTagDialog.qml" line="41"/>
        <source>Save</source>
        <translation>保存</translation>
    </message>
    <message>
        <location filename="../qml/dialogs/EditTagDialog.qml" line="42"/>
        <source>Cancel</source>
        <translation>取消</translation>
    </message>
    <message>
        <location filename="../qml/dialogs/EditTagDialog.qml" line="50"/>
        <source>Tags</source>
        <translation>标签</translation>
    </message>
</context>
<context>
    <name>FilterBookmarksDialog</name>
    <message>
        <location filename="../qml/dialogs/FilterBookmarksDialog.qml" line="39"/>
        <source>Filter</source>
        <translation>筛选</translation>
    </message>
    <message>
        <location filename="../qml/dialogs/FilterBookmarksDialog.qml" line="40"/>
        <source>Cancel</source>
        <translation>取消</translation>
    </message>
    <message>
        <location filename="../qml/dialogs/FilterBookmarksDialog.qml" line="63"/>
        <source>Status</source>
        <translation>状态</translation>
    </message>
    <message>
        <location filename="../qml/dialogs/FilterBookmarksDialog.qml" line="68"/>
        <location filename="../qml/dialogs/FilterBookmarksDialog.qml" line="107"/>
        <source>All</source>
        <translation>全部</translation>
    </message>
    <message>
        <location filename="../qml/dialogs/FilterBookmarksDialog.qml" line="71"/>
        <source>Read</source>
        <translation>阅读</translation>
    </message>
    <message>
        <location filename="../qml/dialogs/FilterBookmarksDialog.qml" line="74"/>
        <source>Unread</source>
        <translation>未读</translation>
    </message>
    <message>
        <location filename="../qml/dialogs/FilterBookmarksDialog.qml" line="77"/>
        <source>Favorite</source>
        <translation>收藏</translation>
    </message>
    <message>
        <location filename="../qml/dialogs/FilterBookmarksDialog.qml" line="102"/>
        <source>Content type</source>
        <translation>内容分类</translation>
    </message>
    <message>
        <location filename="../qml/dialogs/FilterBookmarksDialog.qml" line="110"/>
        <source>Articles</source>
        <translation>文章</translation>
    </message>
    <message>
        <location filename="../qml/dialogs/FilterBookmarksDialog.qml" line="113"/>
        <source>Images</source>
        <translation>图片</translation>
    </message>
    <message>
        <location filename="../qml/dialogs/FilterBookmarksDialog.qml" line="116"/>
        <source>Videos</source>
        <translation>视频</translation>
    </message>
</context>
<context>
    <name>ImageBookmarkView</name>
    <message>
        <location filename="../qml/pages/components/ImageBookmarkView.qml" line="282"/>
        <source>Oops, can't display the image</source>
        <translation>出错,不能显示图片。</translation>
    </message>
    <message>
        <location filename="../qml/pages/components/ImageBookmarkView.qml" line="299"/>
        <source>Deleting</source>
        <translation>删除中</translation>
    </message>
</context>
<context>
    <name>ImageOverlay</name>
    <message>
        <location filename="../qml/pages/components/ImageOverlay.qml" line="128"/>
        <source>Url copied into clipboard</source>
        <translation>链接已复制到剪贴板</translation>
    </message>
</context>
<context>
    <name>LinksBag::Application</name>
    <message>
        <location filename="../src/application.cpp" line="124"/>
        <source>Authorized</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../src/application.cpp" line="124"/>
        <source>Not authorized</source>
        <translation type="unfinished"></translation>
    </message>
</context>
<context>
    <name>LinksBag::GetPocketApi</name>
    <message>
        <location filename="../src/getpocketapi.cpp" line="239"/>
        <location filename="../src/getpocketapi.cpp" line="309"/>
        <source>General error</source>
        <translation>常规错误</translation>
    </message>
    <message>
        <location filename="../src/getpocketapi.cpp" line="256"/>
        <location filename="../src/getpocketapi.cpp" line="326"/>
        <source>Network error: %1</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../src/getpocketapi.cpp" line="277"/>
        <location filename="../src/getpocketapi.cpp" line="344"/>
        <source>Reply data is corrupted</source>
        <translation>答复数据已损坏</translation>
    </message>
    <message>
        <location filename="../src/getpocketapi.cpp" line="474"/>
        <source>Unable to remove bookamark</source>
        <translation>移除书签失败</translation>
    </message>
    <message>
        <location filename="../src/getpocketapi.cpp" line="497"/>
        <location filename="../src/getpocketapi.cpp" line="521"/>
        <source>Unable to mark bookamark as %1</source>
        <translation>无法标记书签% 1</translation>
    </message>
    <message>
        <location filename="../src/getpocketapi.cpp" line="498"/>
        <source>favorite</source>
        <translation>收藏</translation>
    </message>
    <message>
        <location filename="../src/getpocketapi.cpp" line="498"/>
        <source>unfavorite</source>
        <translation>取消收藏</translation>
    </message>
    <message>
        <location filename="../src/getpocketapi.cpp" line="522"/>
        <source>read</source>
        <translation>阅读</translation>
    </message>
    <message>
        <location filename="../src/getpocketapi.cpp" line="522"/>
        <source>unread</source>
        <translation>未读</translation>
    </message>
    <message>
        <location filename="../src/getpocketapi.cpp" line="545"/>
        <source>Unable to update tags</source>
        <translation>无法更新标签</translation>
    </message>
</context>
<context>
    <name>LinksBag::LinksBagManager</name>
    <message>
        <location filename="../src/linksbagmanager.cpp" line="201"/>
        <source>GetPocket error (%1): </source>
        <translation>Pocket 服务错误 (%1): </translation>
    </message>
</context>
<context>
    <name>LoginPage</name>
    <message>
        <location filename="../qml/pages/LoginPage.qml" line="51"/>
        <source>Welcome to LinksBag</source>
        <translation>欢迎来到LinksBag</translation>
    </message>
    <message>
        <location filename="../qml/pages/LoginPage.qml" line="59"/>
        <source>Before we begin, please log into your GetPocket.com account</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../qml/pages/LoginPage.qml" line="64"/>
        <source>Login</source>
        <translation type="unfinished"></translation>
    </message>
</context>
<context>
    <name>MultiSelectionPage</name>
    <message>
        <location filename="../qml/pages/MultiSelectionPage.qml" line="73"/>
        <source>Selected %L1</source>
        <translation>已选择%L1</translation>
    </message>
    <message>
        <location filename="../qml/pages/MultiSelectionPage.qml" line="74"/>
        <source>Selected</source>
        <translation>已选择</translation>
    </message>
</context>
<context>
    <name>SettingsPage</name>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="43"/>
        <source>Settings</source>
        <translation>设置</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="48"/>
        <source>About</source>
        <translation>关于</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="55"/>
        <source>User interface</source>
        <translation>用户界面</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="77"/>
        <source>Item size</source>
        <translation>内容大小</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="82"/>
        <source>Small</source>
        <translation>小号</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="85"/>
        <source>Medium</source>
        <translation>中号</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="88"/>
        <source>Large</source>
        <translation>大号</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="91"/>
        <source>Extra Large</source>
        <translation>特大号</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="168"/>
        <source>Reading view</source>
        <translation>阅读视图</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="174"/>
        <source>All articles will be opened in articles(reader-mode) view</source>
        <translation>所有文章都将在文章 (只读模式) 视图中打开</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="185"/>
        <source>Best view</source>
        <translation>最佳视图</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="188"/>
        <source>Web view</source>
        <translation>网页视图</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="191"/>
        <source>Article view</source>
        <translation>文章视图</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="97"/>
        <source>Show bookmark content type</source>
        <translation>显示书签内容类型</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="105"/>
        <source>Show background image</source>
        <translation>显示背景图片</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="112"/>
        <source>Sync</source>
        <translation>同步</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="115"/>
        <source>Sync on startup</source>
        <translation>启动时同步</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="118"/>
        <source>App will try to sync with Pocket on startup.</source>
        <translation>应用将尝试在启动时与 Pocket  同步。</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="146"/>
        <source>Reading</source>
        <translation>阅读</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="172"/>
        <source>LinksBag automatically select the best view(article, webview, image)</source>
        <translation> LinksBag 自动选择最佳视图 (文章、网页、图像)</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="177"/>
        <source>All articles will be opened in embeded webview</source>
        <translation>所有文章将在嵌入的 web 视图中打开</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="204"/>
        <source>Parser</source>
        <translation>解析器</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="214"/>
        <source>Mercury is faster and lighter on your device but if you want articles to be processed on your device, you can use Readability instead.</source>
        <translation>Mercury在你的设备上更快、更轻, 但如果你想在你的设备上处理文章, 你可以使用Readability来替代。</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="230"/>
        <source>Mobile browser</source>
        <translation>移动设备浏览器</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="233"/>
        <source>Try to open mobile version of web pages</source>
        <translation>尝试打开网页的移动设备版本</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="142"/>
        <source>In case something gone really, really wrong, this button will make app forget that it ever synced. Good luck.</source>
        <translation>万一出了什么问题, 真的出了问题, 这个按钮会让应用忘记它曾经同步过。祝你好运。</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="236"/>
        <source>Offline reading</source>
        <translation>离线阅读</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="247"/>
        <source>The best practice for offline reading - using it with ArticlesView reading mode</source>
        <translation>离线阅读的最佳实践-将其与艺术家视图阅读模式一起使用</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="252"/>
        <source>Download articles for offline reading</source>
        <translation>为离线阅读下载文章</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="264"/>
        <source>Download only using wifi</source>
        <translation>仅用WiFi下载</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="274"/>
        <source>Download only unread</source>
        <translation>僅下載未讀</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="283"/>
        <source>Cache</source>
        <translation>缓存</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="286"/>
        <source>Remove saved articles</source>
        <translation>移除所有文章</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="287"/>
        <source>Removing saved articles</source>
        <translation>正在移除所有保存的文章</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="292"/>
        <source>Clear thumbnail cache</source>
        <translation>清除缩略图缓存</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="293"/>
        <source>Clearing thumbnail cache</source>
        <translation>正在清除缩略图缓存</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="123"/>
        <source>Force full refresh</source>
        <translation>强制全部刷新</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="125"/>
        <source>Reloading bookmarks</source>
        <translation>读取书签</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="253"/>
        <source>Downloaded: %L1/%L2</source>
        <translation>已下载: %L1/%L2</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="297"/>
        <source>Account</source>
        <translation>账户</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="307"/>
        <source>You're logged in as %1.</source>
        <translation>已登录 %1.。</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="314"/>
        <source>Logout</source>
        <translation>登出</translation>
    </message>
    <message>
        <location filename="../qml/pages/SettingsPage.qml" line="315"/>
        <source>Logging out</source>
        <translation>登出中</translation>
    </message>
</context>
<context>
    <name>TranslatorsPage</name>
    <message>
        <location filename="../qml/pages/TranslatorsPage.qml" line="14"/>
        <source>Translations</source>
        <translation>翻译</translation>
    </message>
    <message>
        <location filename="../qml/pages/TranslatorsPage.qml" line="52"/>
        <source>Coordinators</source>
        <translation>协作者</translation>
    </message>
    <message>
        <location filename="../qml/pages/TranslatorsPage.qml" line="57"/>
        <source>Translators</source>
        <translation>译者</translation>
    </message>
    <message>
        <location filename="../qml/pages/TranslatorsPage.qml" line="62"/>
        <source>Reviewers</source>
        <translation>评论者</translation>
    </message>
</context>
<context>
    <name>harbour-linksbag</name>
    <message>
        <location filename="../qml/harbour-linksbag.qml" line="140"/>
        <source>%1, %2</source>
        <translation>%1, %2</translation>
    </message>
    <message>
        <location filename="../qml/harbour-linksbag.qml" line="145"/>
        <location filename="../qml/harbour-linksbag.qml" line="158"/>
        <location filename="../qml/harbour-linksbag.qml" line="165"/>
        <location filename="../qml/harbour-linksbag.qml" line="178"/>
        <source>All</source>
        <translation>全部</translation>
    </message>
    <message>
        <location filename="../qml/harbour-linksbag.qml" line="148"/>
        <source>Read</source>
        <translation>阅读</translation>
    </message>
    <message>
        <location filename="../qml/harbour-linksbag.qml" line="151"/>
        <source>Unread</source>
        <translation>未读</translation>
    </message>
    <message>
        <location filename="../qml/harbour-linksbag.qml" line="154"/>
        <source>Favorite</source>
        <translation>收藏</translation>
    </message>
    <message>
        <location filename="../qml/harbour-linksbag.qml" line="168"/>
        <source>Articles</source>
        <translation>文章</translation>
    </message>
    <message>
        <location filename="../qml/harbour-linksbag.qml" line="171"/>
        <source>Images</source>
        <translation>图片</translation>
    </message>
    <message>
        <location filename="../qml/harbour-linksbag.qml" line="174"/>
        <source>Videos</source>
        <translation>视频</translation>
    </message>
</context>
</TS>


text:
using System.Collections.Generic;

namespace Microsoft.Build.Framework
{
    /// <summary>
    /// Provides a way to efficiently enumerate item metadata
    /// </summary>
    internal interface IMetadataContainer
    {
        /// <summary>
        /// Returns a list of metadata names and unescaped values, including
        /// metadata from item definition groups, but not including built-in
        /// metadata. Implementations should be low-overhead as the method
        /// is used for serialization (in node packet translator) as well as
        /// in the binary logger.
        /// </summary>
        IEnumerable<KeyValuePair<string, string>> EnumerateMetadata();
    }
}

redpajama_set_name: RedPajamaGithub


text:
/**
 *
 */
package gov.va.med.imaging;

import java.text.*;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * A date formatter for DICOM date-time data elements (DT).
 *
 * =============================================================================================================================================
 * From the DICOM Spec (06.05 pg.26):
 * "The Date Time common data type. Indicates a concatenated date-time ASCII string in the format: YYYYMMDDHHMMSS.FFFFFF&ZZZZ
 * The components of this string, from left to right, are
 * YYYY = Year,
 * MM = Month,
 * DD = Day,
 * HH = Hour,
 * MM = Minute,
 * SS = Second,
 * FFFFFF = Fractional Second,
 * & = "+" or "-", and
 * ZZZZ = Hours and Minutes of offset.
 * &ZZZZ is an optional suffix for plus/minus offset from Coordinated Universal Time. A component that is omitted from the string is
 * termed a null component. Trailing null components of Date Time are ignored. Nontrailing null components are prohibited, given
 * that the optional suffix is not considered as a component.
 * Note: For reasons of backward compatibility with versions of this standard prior to V3.0, many existing DICOM Data
 * Elements use the separate DA and TM VRs. Standard and Private Data Elements defined in the future should use DT, when
 * appropriate, to be more compliant with ANSI HISPP MSDS."
 * =============================================================================================================================================
 *
 * NOTES
 * 1.) This class DOES NOT support the backward compatibility mentioned above for versions before 3.0.
 * 2.) The DICOM specification does not specify the calendar used for date interpretation.  This class
 * always uses a Gregorian calendar.
 * 3.) The timezone is defaulted to the default timezone for the VM if it is not specified.
 * 4.) DICOM uses 1-indexing for months.
 * =============================================================================================================================================
 *
 * @author VHAISWBECKEC
 */
public class DicomDateFormat
extends SimpleDateFormat
{
	private static final long serialVersionUID = -1381461230116366880L;

	// YYYYMMDDHHMMSS.FFFFFF+ZZZZ
	// The components of this string, from left to right, are
	// YYYY = Year,
	// MM = Month,
	// DD = Day,
	// HH = Hour,
	// MM = Minute,
	// SS = Second,
	// FFFFFF = milliseconds
	// ZZZZZ - timezone offset (first digit is + or -
	private final static String dicomDateFormat = "yyyyMMddHHmmss.SSSSSSZZZZZ";

	// The regulare expression pattern should read as:
	//	required   4 digits (the year)
	//	optionally 2 digit (the month of the year)
	//	optionally 2 digit (the day of the month)
	//	optionally 2 digits (for each of the hour, minute and seconds)
	//	optionally 1 decimal point followed by 4 or 6 digits (for the milliseconds)
	//	optionally 1 '+' or '-' followed by 4 digits, 2 for hours and 2 for minutes (for the offset from UCT)
	private final static String dicomDateRegex = "(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\.(\\d{4}|\\d{6}))?(([+|-]\\d{4}))?";

	private static final int yearGroupIndex = 1;
	private static final int monthGroupIndex = 2;
	private static final int dayGroupIndex = 3;
	private static final int hourGroupIndex = 4;
	private static final int minuteGroupIndex = 5;
	private static final int secondGroupIndex = 6;
	private static final int millisecondGroupIndex = 8;
	private static final int timezoneGroupIndex = 9;

	// during processing it may be necessary to calculate a date to use for timezone
	// determination, this is NOT the DateFormat used to do our formatting or parsing
	private DateFormat utilityDateFormat = new SimpleDateFormat("yyyyMMddhhmmss.SSSSSS");

	// a NumberFormat used to build timezone formatted strings
	private NumberFormat timezoneNumberFormat = new DecimalFormat("+0000;-0000");

	/**
	 * Construct a DicomDateFormat instance using the default locale.
	 *
	 */
	public DicomDateFormat()
	{
		super(dicomDateFormat);
		super.setCalendar(new GregorianCalendar());
	}

	/**
	 * Construct a DicomDateFormat instance specifying a locale.
	 *
	 * @param locale
	 */
	public DicomDateFormat(Locale locale)
	{
		super(dicomDateFormat, locale);
		super.setCalendar(new GregorianCalendar());
	}

	/**
	 * Method does nothing, the date format pattern is defined by the class.
	 *
	 * @see java.text.SimpleDateFormat#applyLocalizedPattern(java.lang.String)
	 */
	@Override
	public void applyLocalizedPattern(String pattern) {}

	/**
	 * Method does nothing, the date format pattern is defined by the class.
	 *
	 * @see java.text.SimpleDateFormat#applyPattern(java.lang.String)
	 */
	@Override
	public void applyPattern(String pattern){}

	/**
	 * Method does nothing, the Calendar is defined by the class as a Gregorian calendar instance.
	 *
	 * @see java.text.DateFormat#setCalendar(java.util.Calendar)
	 */
	@Override
	public void setCalendar(Calendar newCalendar){}

	/**
	 * @throws ParseException
	 *
	 */
	@Override
	public Date parse(String dicomFormattedDate)
	throws ParseException
	{
		String year = null;
		String month = null;
		String day = null;
		String hour = null;
		String minute = null;
		String second = null;
		String millisecond = null;
		String timezoneOffset = null;

		Pattern dicomPattern = Pattern.compile(dicomDateRegex);

		Matcher matcher = dicomPattern.matcher(dicomFormattedDate);
		if( ! matcher.matches() )
			throw new ParseException("'" + dicomFormattedDate + "' is not a valid DICOM date.", 0);

		year = matcher.group(yearGroupIndex);

		month  = matcher.group(monthGroupIndex);
		month = (month == null ? "01" : month);
		int monthInt = Integer.parseInt(month);
		if(monthInt < 1 || monthInt > 12)
			throw new ParseException("Month must be between 01 and 11", 3);

		day  = matcher.group(dayGroupIndex);
		day = (day == null ? "01" : day);

		hour  = matcher.group(hourGroupIndex);
		hour = (hour == null ? "00" : hour);

		minute = matcher.group(minuteGroupIndex);
		minute = (minute == null ? "00" : minute);

		second  = matcher.group(secondGroupIndex);
		second = (second == null ? "00" : second);

		millisecond  = matcher.group(millisecondGroupIndex);
		millisecond = (millisecond == null ? "000000" : millisecond);

		timezoneOffset  = matcher.group(timezoneGroupIndex);
		if(timezoneOffset == null)
		{
			Date date = utilityDateFormat.parse(year + month + day + hour + minute + second + "." + millisecond);

			// getOffset() returns the amount of time in milliseconds to add to UTC to get local time.
			int offset = TimeZone.getDefault().getOffset(date.getTime());

			int offsetMinutes = offset / (1000 * 60);
			int offsetHours = offsetMinutes / 60;
			offsetMinutes %= 60;

			timezoneOffset = timezoneNumberFormat.format(offsetHours * 100 + offsetMinutes);
		}

		//for(int groupIndex=0; groupIndex < matcher.groupCount(); ++groupIndex)
		//{
		//	String group = matcher.group(groupIndex);
		//	System.out.println("\tGroup [" + groupIndex + "] = '" + group + "'");
		//}
		String concatenatedTime = year + month + day + hour + minute + second + "." + millisecond + timezoneOffset;

		Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Parsing concatenated time '" + concatenatedTime + "'.");
		return super.parse(concatenatedTime);
	}

	/**
	 * @see java.text.SimpleDateFormat#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj)
	{
		return obj instanceof DicomDateFormat && super.equals(obj);
	}

	/**
	 * This is simply a test driver for development.
	 *
	 * @param argv
	 */
	public static void main(String [] argv)
	{
		DateFormat outputDf = new SimpleDateFormat("dd-MMM-yyyy @ hh:mm:ss.SSSS ZZZZZ");
		try
		{
			System.out.println( "Result is '" + outputDf.format(parseDate("2007")) ); // year
			System.out.println( "Result is '" + outputDf.format(parseDate("200712")) ); // year, month
			System.out.println( "Result is '" + outputDf.format(parseDate("20071230")) ); // year, month, day
			System.out.println( "Result is '" + outputDf.format(parseDate("2007123012")) ); // year, month, day, hour
			System.out.println( "Result is '" + outputDf.format(parseDate("200712301234")) ); // year, month, day, hour, minute
			System.out.println( "Result is '" + outputDf.format(parseDate("20071230123456")) ); // year, month, day, hour, minute, second
			System.out.println( "Result is '" + outputDf.format(parseDate("20071230123456.9999")) ); // year, month, day, hour, minute, second, millisecond
			System.out.println( "Result is '" + outputDf.format(parseDate("20071230123456.999999")) ); // year, month, day, hour, minute, second, millisecond

			// repeat all of the above with positive timezone
			System.out.println( "Result is '" + outputDf.format(parseDate("2007+0500")) ); // year
			System.out.println( "Result is '" + outputDf.format(parseDate("200712+0500")) ); // year, month
			System.out.println( "Result is '" + outputDf.format(parseDate("20071230+0500")) ); // year, month, day
			System.out.println( "Result is '" + outputDf.format(parseDate("2007123012+0500")) ); // year, month, day, hour
			System.out.println( "Result is '" + outputDf.format(parseDate("200712301234+0500")) ); // year, month, day, hour, minute
			System.out.println( "Result is '" + outputDf.format(parseDate("20071230123456+0500")) ); // year, month, day, hour, minute, second
			System.out.println( "Result is '" + outputDf.format(parseDate("20071230123456.9999+0500")) ); // year, month, day, hour, minute, second, millisecond
			System.out.println( "Result is '" + outputDf.format(parseDate("20071230123456.999999+0500")) ); // year, month, day, hour, minute, second, millisecond

			// repeat all of the above with negative timezone
			System.out.println( "Result is '" + outputDf.format(parseDate("2007-0500")) ); // year
			System.out.println( "Result is '" + outputDf.format(parseDate("200712-0500")) ); // year, month
			System.out.println( "Result is '" + outputDf.format(parseDate("20071230-0500")) ); // year, month, day
			System.out.println( "Result is '" + outputDf.format(parseDate("2007123012-0500")) ); // year, month, day, hour
			System.out.println( "Result is '" + outputDf.format(parseDate("200712301234-0500")) ); // year, month, day, hour, minute
			System.out.println( "Result is '" + outputDf.format(parseDate("20071230123456-0500")) ); // year, month, day, hour, minute, second
			System.out.println( "Result is '" + outputDf.format(parseDate("20071230123456.9999-0500")) ); // year, month, day, hour, minute, second, millisecond
			System.out.println( "Result is '" + outputDf.format(parseDate("20071230123456.999999-0500")) ); // year, month, day, hour, minute, second, millisecond
		}
		catch(Exception x)
		{
			x.printStackTrace();
		}
	}
	private static Date parseDate(String dateString)
	throws ParseException
	{
		DicomDateFormat df = new DicomDateFormat();

		System.out.println("Parsing '" + dateString + "'.");
		return df.parse(dateString);
	}
}


text:
[![Travis build status](https://travis-ci.org/donami/ctable.png?branch=master)](https://travis-ci.org/donami/ctable)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/donami/ctable/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/donami/ctable/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/donami/ctable/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/donami/ctable/?branch=master)

# CTable - Table module for Anax

CTable is a module for Anax used for creating HTML Tables in an easy manner.

## How to:
Install CTable by using composer:
```
composer require donami/ctable
```

## Usage:
### Create a HTML table from array

Use an array to create the table:
```php

$di->set('HTMLTable', 'donami\CTable\CTable');

$data = array(
  array('First', 'Second', 'Third'),
  array('Fourth', 'Fifth', 'Sixth')
);

echo $app->HTMLTable->generate($data);
```

Will output:
```html
<table>
  <tr>
    <td>First</td>
    <td>Second</td>
    <td>Third</td>
  </tr>
  <tr>
    <td>Fourth</td>
    <td>Fifth</td>
    <td>Sixth</td>
  </tr>
</table>
```
### One by one
This is useful when looping through data

```php
$di->set('HTMLTable', 'donami\CTable\CTable');

$app->HTMLTable->create_row(array('First', 'Second', 'Third'));
$app->HTMLTable->create_row(array('Fourth', 'Fifth', 'Sixth'));
echo $app->HTMLTable->generate();
```

### Defining tags:
Used for customizing the style of the table.

Example: Set the background of the table to purple

```php
$app->HTMLTable->defineTags(array('table_start' => '<table style="background: purple">'));
```

Links:
Packagist: https://packagist.org/packages/donami/ctable


text:
A PHP wrapper for the Amazon Mechanical Turk REST API. You'll need an Amazon Web Services account to use it (you can get one from http://aws.amazon.com)

Here's an example of how to use the class.

	<?php
	require_once('MechanicalTurk.class.php');
	$mturk = new MechanicalTurk(YOUR_ACCESS_KEY_HERE, YOUR_SECRET_KEY_HERE);

	$my_question = 'my question properly formed as a QuestionForm datastructure';
	$response = $mturk->createHit($my_question);

	$another_question = 'another question formed as a QuestionForm datastructure';
	$params = array(
		'title' => 'a custom title',
		'reward' => '1.00',
		'reward_currency' => 'EUR'
	);
	$response = $mturk->createHit($another_question, $params);

	$hits = $mturk->getReviewableHITs();

	$account_balance = $mturk->getAccountBalance();
	?>

You can change the default settings by editing the $default variable at the top of the class. These values will be used when creating HITs if no other values are provided.

This class doesn't provide full access to all of the API, just a limited subset - enough to create, manage and delete hits.


text:
package io.undertow.servlet.core;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import io.undertow.io.BlockingSenderImpl;
import io.undertow.io.Sender;
import io.undertow.server.BlockingHttpExchange;
import io.undertow.server.HttpServerExchange;
import io.undertow.servlet.handlers.ServletRequestContext;
import io.undertow.servlet.spec.HttpServletRequestImpl;
import io.undertow.servlet.spec.HttpServletResponseImpl;

/**
 * @author Stuart Douglas
 */
public class ServletBlockingHttpExchange implements BlockingHttpExchange {

    private final HttpServerExchange exchange;

    public ServletBlockingHttpExchange(final HttpServerExchange exchange) {
        this.exchange = exchange;
    }

    @Override
    public InputStream getInputStream() {
        ServletRequest request = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY).getServletRequest();
        try {
            return request.getInputStream();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public OutputStream getOutputStream() {
        ServletResponse response = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY).getServletResponse();
        try {
            return response.getOutputStream();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public Sender getSender() {
        try {
            return new BlockingSenderImpl(exchange, getOutputStream());
        } catch (IllegalStateException e) {
            ServletResponse response = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY).getServletResponse();
            try {
                return new BlockingWriterSenderImpl(exchange, response.getWriter(), response.getCharacterEncoding());
            } catch (IOException e1) {
                throw new RuntimeException(e1);
            }
        }
    }

    @Override
    public void close() throws IOException {
        if (!exchange.isComplete()) {
            ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
            try {
                HttpServletRequestImpl request = servletRequestContext.getOriginalRequest();
                request.closeAndDrainRequest();
            } finally {
                HttpServletResponseImpl response = servletRequestContext.getOriginalResponse();
                response.closeStreamAndWriter();
            }
        }
    }
}


text:
'use strict';

/**
* FUNCTION: getQuantileFunction( m, b )
*	Returns a quantile function for a Cauchy distribution with with location parameter `m` and scale parameter `b`.
*
* @private
* @param {Number} m - location parameter
* @param {Number} b - scale prameter
* @returns {Function} quantile function
*/
function getQuantileFunction( m, b ) {
	/**
	* FUNCTION: quantile( p )
	*	Evaluates the quantile function at input value `p`.
	*
	* @private
	* @param {Number} p - input value
	* @returns {Number} evaluated quantile function
	*/
	return function quantile( p ) {
		return ( 0 <= p && p <= 1 ) ? m  + b * Math.tan( Math.PI * ( p - 0.5 ) ) : NaN;
	};
} // end FUNCTION getQuantileFunction()

// EXPORTS //

module.exports = getQuantileFunction;


text:
CREATE TABLE BATCH_JOB_EXECUTION_PARAMS  (
	JOB_EXECUTION_ID BIGINT NOT NULL ,
	TYPE_CD VARCHAR(6) NOT NULL ,
	KEY_NAME VARCHAR(100) NOT NULL ,
	STRING_VAL VARCHAR(250) NULL,
	DATE_VAL DATETIME DEFAULT NULL NULL,
	LONG_VAL BIGINT NULL,
	DOUBLE_VAL DOUBLE PRECISION NULL,
	IDENTIFYING CHAR(1) NOT NULL ,
	constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)
	references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
) ;

-- insert script that 'copies' existing batch_job_params to batch_job_execution_params
-- sets new params to identifying ones
-- verified on h2,

INSERT INTO BATCH_JOB_EXECUTION_PARAMS
	( JOB_EXECUTION_ID , TYPE_CD, KEY_NAME, STRING_VAL, DATE_VAL, LONG_VAL, DOUBLE_VAL, IDENTIFYING )
SELECT
	JE.JOB_EXECUTION_ID , JP.TYPE_CD , JP.KEY_NAME , JP.STRING_VAL , JP.DATE_VAL , JP.LONG_VAL , JP.DOUBLE_VAL , 'Y'
FROM
	BATCH_JOB_PARAMS JP,BATCH_JOB_EXECUTION JE
WHERE
	JP.JOB_INSTANCE_ID = JE.JOB_INSTANCE_ID;


text:
require 'fog/core'
require 'fog/tasks'

module Fog
  module Wunderlist
    extend Fog::Provider
    service(:tasks, 'wunderlist/tasks', 'Tasks')
  end
end


text:
package org.bitcoins.protocol.rpc.bitcoincore.networking

/**
 * Created by Tom on 1/5/2016.
 */
trait PeerInfo {
  def id : Int
  def addr : String
  def addrLocal : String
  def services : String
  def lastSend : Long
  def lastRecv : Long
  def bytesSent : Long
  def bytesRecv : Long
  def connTime : Long
  def timeOffSet : Int
  def pingTime : Double
  def version : Long
  def subVer : String
  def inbound : Boolean
  def startingHeight : Int
  def banScore : Int
  def syncedHeaders : Int
  def syncedBlocks : Int
  def inFlight : Seq[Int]
  def whiteListed : Boolean
}

case class PeerInfoImpl(id : Int, addr : String, addrLocal : String, services : String, lastSend : Long,
  lastRecv : Long, bytesSent : Long, bytesRecv : Long, connTime : Long, timeOffSet : Int, pingTime : Double,
   version : Long, subVer : String, inbound : Boolean, startingHeight : Int, banScore : Int,
  syncedHeaders : Int, syncedBlocks : Int, inFlight : Seq[Int], whiteListed : Boolean) extends PeerInfo


text:
all:

test:
	python setup.py test

testvers:
	python2.6 testHists.py
	python2.7 -munittest discover

distclean:
	rm -rf ./build ./dist ./*.egg-info
	rm simplehist/*.pyc
	rm simplehist/test/*.pyc

dist:
	python setup.py sdist


text:
<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}

/** @var \TYPO3\CMS\Core\Resource\Driver\DriverRegistry $driverRegistry */
$driverRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\Driver\DriverRegistry::class);
$driverRegistry->registerDriverClass(
    \B3N\AzureStorage\TYPO3\Driver\StorageDriver::class,
    \B3N\AzureStorage\TYPO3\Driver\StorageDriver::class,
    'Azure Storage',
    'FILE:EXT:azurestorage/Configuration/FlexForms/AzureStorage.xml'
);

// Cache configuration, see http://wiki.typo3.org/Caching_Framework
if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['azurestorage'])
    || !is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['azurestorage'])) {
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['azurestorage'] = array(
        'backend' => 'TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend',
        'options' => [
            'defaultLifetime' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::UNLIMITED_LIFETIME
        ],
    );
}
$extractorRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\Index\ExtractorRegistry::class);
$extractorRegistry->registerExtractionService(\B3N\AzureStorage\TYPO3\Index\Extractor::class);

/* @var $signalSlotDispatcher \TYPO3\CMS\Extbase\SignalSlot\Dispatcher */
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
$signalSlotDispatcher->connect(\TYPO3\CMS\Core\Resource\Index\FileIndexRepository::class, 'recordUpdated', \B3N\AzureStorage\TYPO3\Signal\FileIndexRepository::class, 'recordUpdatedOrCreated');
$signalSlotDispatcher->connect(\TYPO3\CMS\Core\Resource\Index\FileIndexRepository::class, 'recordCreated', \B3N\AzureStorage\TYPO3\Signal\FileIndexRepository::class, 'recordUpdatedOrCreated');


text:
import * as AWS from "aws-sdk";
import { StorageEngine } from "multer";

interface Options {
    s3: AWS.S3;
    bucket: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, bucket?: string) => void) => void) | string;
    key?(req: Express.Request, file: Express.Multer.File, callback: (error: any, key?: string) => void): void;
    acl?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, acl?: string) => void) => void) | string;
    contentType?(req: Express.Request, file: Express.Multer.File, callback: (error: any, mime?: string, stream?: NodeJS.ReadableStream) => void): void;
    metadata?(req: Express.Request, file: Express.Multer.File, callback: (error: any, metadata?: string) => void): void;
    cacheControl?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, cacheControl?: string) => void) => void) | string;
}

interface S3Storage {
    (options?: Options): StorageEngine;

    AUTO_CONTENT_TYPE(
        req: Express.Request,
        file: Express.Multer.File,
        callback: (error: any, mime?: string, stream?: NodeJS.ReadableStream) => void): void;
    DEFAULT_CONTENT_TYPE(
        req: Express.Request,
        file: Express.Multer.File,
        callback: (error: any, mime?: string) => void): void;
}

declare const s3Storage: S3Storage;
export = s3Storage;


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.airhacks</groupId>
	<artifactId>ping</artifactId>
	<version>0.0.4-SNAPSHOT</version>
	<packaging>war</packaging>
	<dependencies>
		<dependency>
			<groupId>javax</groupId>
			<artifactId>javaee-api</artifactId>
			<version>7.0</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>
	<build>
		<finalName>ping</finalName>
	</build>
	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<deployment.name>ping</deployment.name>
		<failOnMissingWebXml>false</failOnMissingWebXml>
	</properties>
	<profiles>
		<profile>
			<id>wildfly-development</id>
			<build>
				<finalName>${deployment.name}</finalName>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-war-plugin</artifactId>
						<version>2.3</version>
						<configuration>
							<warName>${deployment.name}</warName>
						</configuration>
					</plugin>
					<plugin>
						<configuration>
							<hostname>ec2-54-86-76-58.compute-1.amazonaws.com</hostname>
							<port>8080</port>
								<username>management</username>
							<password>OSjWAod1i81D</password>
						</configuration>
						<groupId>org.wildfly.plugins</groupId>
						<artifactId>wildfly-maven-plugin</artifactId>
						<version>1.1.0.Alpha7</version>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>


text:
$('#myCarousel').carousel({
  interval: 10000
})

$('.carousel .item').each(function(){
  var next = $(this).next();
  if (!next.length) {
    next = $(this).siblings(':first');
  }
  next.children(':first-child').clone().appendTo($(this));

  if (next.next().length>0) {
    next.next().children(':first-child').clone().appendTo($(this));
  }
  else {
  	$(this).siblings(':first').children(':first-child').clone().appendTo($(this));
  }
});


text:
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

set -e
# if bashrc doesn't exist, fill it in
ls ~/.bashrc || cp $DIR/.bashrc ~/.bashrc
# if bash_profile doesn't exist, fill it in
ls ~/.bash_profile || ln -s ~/.bashrc ~/.bash_profile

# evaluate our (potentially new) bashrc
. ~/.bashrc

installbundle=false
if ! ls ~/.vim/bundle; then
	installbundle=true

	echo "detected bundle..."
fi

if [ "$installbundle" = true ]; then
	echo "installing bundle..."
	mkdir -p  ~/.vim/bundle && \
		git clone \
		--depth 1 \
		http://github.com/zemnmez/Vundle.vim ~/.vim/bundle/Vundle.vim

	echo installing vundle packages
	sed '/vundle#end/{q;}' $DIR/.vimrc > ~/.vimrc
fi

function fnExists {
	command -v $1 > /dev/null 2>&1
}

packages="go npm vim ctags cmake"
if fnExists apacman; then
	apacman_packages="go npm gvim ctags cmake
		i3-wm i3lock i3status-git
		ack calc cloc chromium
		mumble nitrogen redshift rtorrent
		openssh openvpn pavucontrol pulseaudio
		lxappearance ttf-roboto-fontconfig pulseaudio-bluetooth
		adwaita-x-dark-and-light-theme adwaita-icon-theme adwaita-qt5
		adwaita-qt-common adwaita-qt4"
	if ! apacman --noconfirm --needed -S $apacman_packages; then
		echo "apacman seems to have failed, try interactive:"
		apacman --needed -S $apacman_packages
	fi
elif fnExists pacman; then
	echo "please install apacman"
elif fnExists brew; then
	brew install go npm vim ctags cmake
	brew cask install google-chrome iterm2 sublime-text flux
else
	echo "Script doesn't support your package manager :("

	if uname -a | grep "Darwin"; then
		echo Maybe install brew?
	fi
fi

vim -c 'BundleInstall!' +qall

npmpackages="typescript"
npm install -g $npmpackages

gopackages="golang.org/x/tools/cmd/goimports github.com/nsf/gocode golang.org/x/tools/cmd/oracle github.com/golang/lint/golint github.com/rogpeppe/godef golang.org/x/tools/cmd/gorename github.com/kisielk/errcheck github.com/jstemmer/gotags"

if [ -z "$GOPATH" ]; then
	mkdir -p ~/go || true
	export GOPATH=~/go
	echo
fi
go get -u $gopackages

if [ "$installbundle" = true ]; then
	echo "installing ycm..."
	installparams="install.py --omnisharp-completer --gocode-completer --clang-completer"

	function installycm {
		if [[ "$(python -c "import sys;print(sys.version_info[0])")" == "3" ]]; then
			if ! python2 $installparams; then
				echo "can't find python2"
				exit
			fi
		else
			python $installparams
		fi
	}

	( cd ~/.vim/bundle/YouCompleteMe ; installycm ;) # it breaks if you don't end with a winky face

	( cd ~/.vim/bundle/tern_for_vim && npm install ;)

	rm ~/.vimrc
	ln -s $DIR/.vimrc ~/.vimrc
fi


text:
/* global document: true */

const React = require('react')
const Highlight = require('react-highlighter')
const axios = require('axios')
const debounce = require('lodash/debounce')
const guid = require('../lib/guid')
const AriaStatus = require('./ariastatus')

class AutosuggestComponent extends React.Component {
  // Component lifecycle
  constructor (props) {
    super(props)
    this.uuid = guid()

    const state = {
      value: { id: '', name: '' },
      highlightedIndex: null,
      suggestions: [],
      options: [],
      invalidValue: false,
      hasFocus: false,
      changed: false,
      loading: false
    }

    if (props.options) {
      state.options = props.options
    }

    if (props.value) {
      state.value = props.value
    }

    this.state = state

    if (this.props.fetchSuggestions) {
      this.fetcher = this.fetchSuggestionsFromProps
    } else if (this.props.lookupUrl) {
      this.fetcher = debounce(this.fetchSuggestionsFromServer, 200)
    } else {
      this.fetcher = this.fetchSuggestionsFromLocalOptions
    }
  }
  componentDidMount () {
    document.addEventListener('mousedown', this.onDocumentMouseDown)

    if (this.props.optionsUrl && this.props.optionsUrl.length > 0) {
      axios.get(this.props.optionsUrl)
        .then((result) => {
          this.setState({ options: result.data })
        })
    }
  }

  componentWillReceiveProps (nextProps) {
    if (nextProps && nextProps.options) {
      this.setState({ options: nextProps.options })
    }
  }

  componentWillUnmount () {
    document.removeEventListener('mousedown', this.onDocumentMouseDown)
  }

  // event handlers
  // Listen for clicks on the document.
  // If the user clicks outside the autosuggest then clear it
  // otherwise the user clicked on the field or a suggestion, so
  // keep focus on the field.
  onDocumentMouseDown = (event) => {
    let node = (event.detail && event.detail.target) || event.target

    do {
      if (node === this.container) {
        return
      }
      node = node.parentNode
    } while (node !== null && node !== document)

    // Must have been outside the controls, so clear the suggestions
    this.leaveField()
  };
  // When the user types, change any currently selcted value
  // and set the value to just be the text entered
  // reset all the checks then go look for suggestions
  onChange = (event) => {
    const newValue = event.target.value

    this.setState({
      value: {
        id: null,
        name: newValue
      },
      highlightedIndex: null,
      invalidValue: false,
      changed: true
    })

    this.props.onChange({
      name: this.props.name,
      value: {
        id: null,
        name: newValue
      }
    })

    this.fetchSuggestions(newValue)
  };
  // Need to use a combination of keydown and keyup to get
  // keyboard navigation events.
  keydown = (event) => {
    // Tab
    if (event.keyCode === 9) {
      this.leaveField()
    }
  };
  keyup = (event) => {
    event.preventDefault()
    event.stopPropagation()

    switch (event.keyCode) {
      case 13: // enter
        this.selectSuggestion()
        break

      case 27: // escape
        this.clearSuggestions()
        break

      case 38: // up arrow
        this.prev()
        break

      case 40: // down arrow
        this.next()
        break
    }
  };
  // Set a var to say if we currently have focus.
  // If the user types something in and moves off the field
  // before the results come back then this helps decide
  // to throw them away as we are no longer using the field.
  focus = () => {
    this.setState({hasFocus: true})
  };

  // Calculate suggestions
  // Decides how to get suggestions, local, remotely or via a provided function
  fetchSuggestions = (value) => {
    const inputValue = value.trim().toLowerCase()
    const inputLength = inputValue.length
    if (inputLength === 0) {
      this.setState({ suggestions: [] })
      return
    }

    this.fetcher(inputValue)
  };
  fetchSuggestionsFromLocalOptions = (value) => {
    const suggestions = this.state.options.filter(suggestion =>
      suggestion.name.toLowerCase().slice(0, value.length) === value
    )

    this.setState({ suggestions })
  };
  fetchSuggestionsFromServer = (value) => {
    this.setState({loading: true})
    let url
    if (typeof this.props.lookupUrl === 'function') {
      url = this.props.lookupUrl(value)
    } else {
      url = `${this.props.lookupUrl}?term=${value}`
    }

    axios.get(url)
      .then(response => {
        if (this.state.hasFocus) {
          this.setState({
            suggestions: response.data,
            loading: false
          })
        }
      })
  };
  fetchSuggestionsFromProps = (value) => {
    this.setState({loading: true})
    this.props.fetchSuggestions(value)
      .then(suggestions => {
        if (this.state.hasFocus) {
          this.setState({ suggestions, loading: false })
        }
      })
  };
  clearSuggestions = () => {
    this.setState({ suggestions: [], highlightedIndex: null })
  };

  // Navigate suggestions
  setSelected (suggestion) {
    this.setState({value: suggestion})
    this.props.onChange({
      name: this.props.name,
      value: suggestion
    })
    this.clearSuggestions()
  }
  leaveField () {
    // If there is a highlighted field, select it, otherwise
    // if the current field value exactly matches the first suggestion
    // then select that
    if (this.state.suggestions.length > 0) {
      if (this.state.highlightedIndex !== null) {
        this.setSelected(this.state.suggestions[this.state.highlightedIndex])
        return
      }

      const currentValue = this.state.value.name.toLocaleLowerCase()
      const firstSuggestionName = this.state.suggestions[0].name.toLocaleLowerCase()

      if (currentValue === firstSuggestionName) {
        this.setSelected(this.state.suggestions[0])
        return
      }
    }

    if (!this.props.allowOwnValue && !this.state.value.id && this.state.changed) {
      this.setState({invalidValue: true})
    }

    this.clearSuggestions()
  }
  next () {
    const length = this.state.suggestions.length - 1
    if (this.state.highlightedIndex === null || this.state.highlightedIndex === length) {
      this.setState({ highlightedIndex: 0 })
    } else {
      this.setState({ highlightedIndex: (this.state.highlightedIndex + 1) })
    }
  }
  prev () {
    const length = this.state.suggestions.length - 1
    if (!this.state.highlightedIndex || this.state.highlightedIndex === 0) {
      this.setState({ highlightedIndex: length })
    } else {
      this.setState({ highlightedIndex: this.state.highlightedIndex - 1 })
    }
  }
  selectSuggestion (suggestion) {
    let selectedSuggestion

    if (suggestion) {
      selectedSuggestion = suggestion
    } else if (this.state.highlightedIndex !== null) {
      selectedSuggestion = this.state.suggestions[this.state.highlightedIndex]
    }

    if (selectedSuggestion) {
      this.setState({ value: selectedSuggestion, changed: true })
      this.props.onChange({name: this.props.name, value: selectedSuggestion})
    }

    this.clearSuggestions()
    this.textInput.focus()
  }

  // stuff
  getAriaMessage (name, suggestions) {
    if (!suggestions || suggestions.length === 0) {
      return `There are no suggestions for ${name}`
    }

    return `There are ${suggestions.length} suggestions for ${name}`
  }

  // Render markup

  renderSuggestion = (suggestion, key) => {
    const id = `${this.uuid}-suggestion-${key}`
    let className = 'autosuggest__suggestion'
    let isSelected

    if (key === this.state.highlightedIndex) {
      className += ' autosuggest__suggestion--active'
      isSelected = true
    } else {
      isSelected = false
    }

    return (

         { this.selectSuggestion(suggestion) }}>
          <Highlight search={this.state.value.name}>{suggestion.name}</Highlight>

    )
  };
  renderSuggestions (suggestions) {
    if (!suggestions || suggestions.length === 0) return null

    const suggestionsMarkup = suggestions.map((suggestion, index) => {
      return this.renderSuggestion(suggestion, index)
    })

    return (
      <ul className='autosuggest__suggestions' role='listbox' id={`${this.uuid}-options`}>
        {suggestionsMarkup}

    )
  }
  renderLoading () {
    return (

        Loading...

)
  }
  render () {
    const { value, suggestions, loading, highlightedIndex } = this.state
    let className = 'form-group autosuggest__container'
    let error
    if (this.props.errors && this.props.errors.length > 0) {
      error = this.props.errors[0]
      className += ' error'
    } else if (this.state.invalidValue) {
      className += ' error'
      error = 'Invalid selection'
    }

    const labelClass = this.props.labelClass || 'form-label-bold'
    const displayValue = (value instanceof Object) ? value.name : value
    const descendant = (highlightedIndex !== null) ? `${this.uuid}-suggestion-${highlightedIndex}` : null
    const owns = (suggestions && suggestions.length > 0) ? `${this.uuid}-options` : null
    const id = `${this.uuid}-input`
    const ariaMessage = this.getAriaMessage(this.props.name, suggestions)

    return (

 { this.container = div }}>
        { this.props.label &&

            {this.props.label}
            { (this.props.searchingFor && !loading) &&
              Please start typing to search for {this.props.searchingFor}
            }
            { (this.props.searchingFor && loading) &&
              Searching for {this.props.searchingFor}...
            }
            { error &&
              {error}
            }

        }
        <input
          id={id}
          className='form-control'
          name={this.props.name}
          value={displayValue}
          onChange={this.onChange}
          onKeyPress={this.keypress}
          onKeyDown={this.keydown}
          onKeyUp={this.keyup}
          onFocus={this.focus}
          autoComplete='off'
          ref={(input) => { this.textInput = input }}
          role='combobox'
          aria-owns={owns}
          aria-autocomplete='both'
          aria-activedescendant={descendant}
        />
        { loading && this.renderLoading() }
        { (suggestions && suggestions.length > 0) && this.renderSuggestions(suggestions)}
        { (displayValue && displayValue.length > 0) &&
          <AriaStatus message={ariaMessage} />
        }

    )
  }

}

AutosuggestComponent.propTypes = {
  onChange: React.PropTypes.func.isRequired,
  label: React.PropTypes.string,
  searchingFor: React.PropTypes.string,
  options: React.PropTypes.array,
  optionsUrl: React.PropTypes.string,
  fetchSuggestions: React.PropTypes.func,
  lookupUrl: React.PropTypes.any,
  value: React.PropTypes.any,
  name: React.PropTypes.string.isRequired,
  allowOwnValue: React.PropTypes.bool,
  errors: React.PropTypes.array,
  labelClass: React.PropTypes.string
}

module.exports = AutosuggestComponent


text:
Writing documentation
=====================

.. rst-class:: intro

Wagtail documentation is written in **four modes** of information delivery.
Each type of information delivery has a purpose and targets a specific audience.

* :ref:`doc-mode-tutorial`, learning-oriented
* :ref:`doc-mode-how-to-guide`, goal-oriented
* :ref:`doc-mode-reference`, information-oriented
* :ref:`doc-mode-explanation`, understanding-oriented

We are following Daniele Procida's `Diátaxis documentation framework <https://diataxis.fr/>`__.

.. _choose-a-writing-mode:

Choose a writing mode
---------------------

Each page of the Wagtail documentation should be written in single mode of information delivery.
Single pages with mixed modes are harder to understand.
If you have documents that mix the types of information delivery,
it's best to split them up. Add links to the first section of each document to cross reference other documents on the same topic.

Writing documentation in a specific mode will help our users to understand and quickly find what they are looking for.

.. _doc-mode-tutorial:

Tutorial
--------

Tutorials are designed to be **learning-oriented** resources which guide newcomers through a specific topic. To help effective learning, tutorials should provide examples to illustrate the subjects they cover.

Tutorials may not necessarily follow best practices. They are designed to make it easier to get started. A tutorial is concrete and particular. It must be repeatable, instil confidence, and should result in success, every time, for every learner.

Do
~~

- Use conversational language
- Use contractions, speak in the first person plural,
  be reassuring. For example: "We're going to do this."
- Use pictures or concrete outputs of code to reassure people that they're on the right track.
  For example: "Your new login page should look like this:" or "Your directory should now have three files".

Don't
~~~~~

- Tell people what they're going to learn.
  Instead, tell them what tasks they're going to complete.
- Use optionality in a tutorial. The word 'if' is a sign of danger!
  For example: "If you want to do this…"
  The expected actions and outcomes should be unambiguous.
- Assume that learners have a prior understanding of the subject.

`More about tutorials <https://diataxis.fr/tutorials/>`__

.. _doc-mode-how-to-guide:

How-to guide
------------

A guide offers advice on how best to achieve a given task.
How-to guides are **task-oriented** with a clear **goal or objective**.

Do
~~

- Name the guide well - ensure that the learner understands what exactly the guide does.
- Focus on actions and outcomes. For example: "If you do X, Y should happen."
- Assume that the learner has a basic understanding of the general concepts
- Point the reader to additional resources

Don't
~~~~~

- Use an unnecessarily strict tone of voice. For example: "You must absolutely NOT do X."

`More about how-to guides <https://diataxis.fr/how-to-guides/>`__

.. _doc-mode-reference:

Reference
---------

Reference material is **information-oriented**.
A reference is well-structured and allows the reader to find information about a specific topic.
They should be short and to the point. Boring is fine! Use an imperative voice.
For example: "Inherit from the Page model".

Most references will be auto-generated based on doc-strings in the Python code.

`More about reference <https://diataxis.fr/reference/>`__

.. _doc-mode-explanation:

Explanation
-----------

Explanations are **understanding-oriented**.
They are high-level and offer context to concepts and design decisions.
There is little or no code involved in explanations,
which are used to deepen the theoretical understanding of a practical draft.
Explanations are used to establish connections and may require some prior knowledge of the principles being explored.

`More about explanation <https://diataxis.fr/explanation/>`__


text:
package com.github.jimcoven.view;

import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION_CODES;
import android.util.AttributeSet;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;

import com.github.jimcoven.jcropimageview.R;

/**
 * JCropImageView provides 11 configurations
 *
 * FitWidth  - 3 configurations - TOP/BOTTOM/CENTER
 * FitHeight - 3 configurations - CENTER/LEFT/RIGHT
 * FitBest   - 5 configurations - TOP/BOTTOM/CENTER/LEFT/RIGHT depending on which scale is used.
 *
 * The configurations for FitWidth + LEFT/RIGHT are correct, but they doesn't show any visual difference.
 * This is because when an image is fit to width, the full width is already within the visible left and right bounds.
 * They are effectively ALWAYS aligned LEFT and RIGHT.
 *
 * Similarly for FitHeight, it is effectively ALWAYS aligned TOP and BOTTOM
 *
 * THe configurations are more visible with FitBest, which will decide which bound to fit to.
 * The default android scaleType=centerCrop is effectively 1 of the above configurations FitBest + CENTER
 *
 */

public class JCropImageView extends ImageView {

    public static final class CropType {
        public static final int FIT_WIDTH = 0;
        public static final int FIT_FILL = 1;
        public static final int FIT_HEIGHT = 2;
    }

    public static final class CropAlign {
        public static final int ALIGN_TOP = 0;
        public static final int ALIGN_BOTTOM = 1;
        public static final int ALIGN_CENTER = 2;
        public static final int ALIGN_LEFT = 3;
        public static final int ALIGN_RIGHT = 4;
    }

    private int mCropType = -1;
    private int mCropAlign = 0;

    public JCropImageView(Context context) {
        super(context);
        initFromAttributes(context, null, 0, 0);
    }

    public JCropImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
        initFromAttributes(context, attrs, 0, 0);
    }

    public JCropImageView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        initFromAttributes(context, attrs, defStyle, 0);
    }

    /**
     * Initialize the attributes for JCropImageView
     *
     * @param context The Context the view is running in, through which it can
     *        access the current theme, resources, etc.
     * @param attrs The attributes of the XML tag that is inflating the view.
     * @param defStyleAttr An attribute in the current theme that contains a
     *        reference to a style resource that supplies default values for
     *        the view. Can be 0 to not look for defaults.
     * @param defStyleRes A resource identifier of a style resource that
     *        supplies default values for the view, used only if
     *        defStyleAttr is 0 or can not be found in the theme. Can be 0
     *        to not look for defaults.
     * @see @link android.view.View(Context, AttributeSet, int)
     */
    private void initFromAttributes(Context context, AttributeSet attrs,
                               int defStyleAttr, int defStyleRes) {
        // Read and apply provided attributes
        TypedArray a = context.obtainStyledAttributes(attrs,
                R.styleable.JCropImageView, defStyleAttr, defStyleRes);
        mCropType = a.getInt(R.styleable.JCropImageView_cropType, mCropType);
        mCropAlign = a.getInt(R.styleable.JCropImageView_cropAlign, mCropAlign);
        a.recycle();

        setCropType(mCropType);
    }

    public void setCropType(int cropType) {
        mCropType = cropType;
        if (mCropType > -1) setScaleType(ScaleType.MATRIX);
    }

    public void setCropAlign(int cropAlign) {
        mCropAlign = cropAlign;
    }

    @TargetApi(VERSION_CODES.JELLY_BEAN)
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        Drawable d = getDrawable();
        if (d != null && mCropType > -1) {

            final int dw = d.getIntrinsicWidth();
            final int dh = d.getIntrinsicHeight();
            int dx = 0, dy = 0;
            int msWidth = 0, msHeight = 0;
            int theoryw = 0, theoryh = 0;
            float scalew = 0, scaleh = 0;
            float scale = 0;

            if (mCropType <= CropType.FIT_FILL) { // fit width || bestfit
                // 1. get anchor by width. constrain to drawablewidth if wrap-content
                msWidth = MeasureSpec.getSize(widthMeasureSpec); // the view width
                if (getLayoutParams().width == LayoutParams.WRAP_CONTENT) { // wrap
                    msWidth = dw < msWidth ? dw : msWidth;
                }

                // 2. compute scale and theoretical height
                scalew = (float) msWidth / dw; // scale_via_width
                theoryh = (int) (dh * scalew); // theoretical = height x scale_via_width
            }

            if (mCropType >= CropType.FIT_FILL) {// fit bestfit || height
                // 1. get anchor by height. constrain to drawableheight if wrap-content
                msHeight = MeasureSpec.getSize(heightMeasureSpec); // the view height
                if (getLayoutParams().height == LayoutParams.WRAP_CONTENT) { // wrap
                    msHeight = dh < msHeight ? dh : msHeight;
                }

                // 2. compute scale and theoretical width
                scaleh = (float) msHeight / dh; // scale_via_height
                theoryw = (int) (dw * scaleh); // theoretical = width x scale_via_height
            }

            if (scalew > scaleh) { // fit width
                scale = scalew;

                // 3. constrain by maxheight
                // if match_parent then additional constraint if viewport < maxheight
                // if wrap_content then anything works even if viewport < or >  maxheight
                int maxHeight = getMaxHeight();
                msHeight = getLayoutParams().height;
                if (msHeight >= LayoutParams.MATCH_PARENT) { // match parent
                    if (msHeight == LayoutParams.MATCH_PARENT) {
                        msHeight = MeasureSpec.getSize(heightMeasureSpec);
                    }
                    maxHeight = msHeight < maxHeight ? msHeight : maxHeight;
                }
                msHeight = theoryh > maxHeight ? maxHeight : theoryh; // limited height

                // 4. translate
                if (mCropAlign >= CropAlign.ALIGN_CENTER) {
                    // AlignTo.ALIGN_CENTER || AlignTo.ALIGN_LEFT || AlignTo.ALIGN_RIGHT
                    // if you want center crop shift it up by 50% aka 0.5f
                    dy = (int)( (msHeight - theoryh) * 0.5f + 0.5f ); // + 0.5f for rounding
                } else if (mCropAlign == CropAlign.ALIGN_BOTTOM) {
                    // AlignTo.ALIGN_BOTTOM
                    // if you want bottom crop shift it up by 100% aka 1.0f
                    dy = (int)( (msHeight - theoryh) * 1.0f + 0.5f ); // + 0.5f for rounding
                }

            } else { // fit height
                scale = scaleh;

                // 3. constrain by maxwidth
                // if match_parent then additional constraint if viewport < maxwidth
                // if wrap_content then anything works even if viewport < or >  maxwidth
                int maxWidth = getMaxWidth();
                msWidth = getLayoutParams().width;
                if (msWidth >= LayoutParams.MATCH_PARENT) { // match parent or is set
                    if (msWidth == LayoutParams.MATCH_PARENT) {
                        msWidth = MeasureSpec.getSize(widthMeasureSpec);
                    }
                    maxWidth = msWidth < maxWidth ? msWidth : maxWidth;
                }
                msWidth = theoryw > maxWidth ? maxWidth : theoryw; // limited width

                if (mCropAlign <= CropAlign.ALIGN_CENTER) {
                    // AlignTo.ALIGN_CENTER || AlignTo.ALIGN_TOP || AlignTo.ALIGN_BOTTOM
                    // if you want center crop shift it left by 50% aka 0.5f
                    dx = (int)( (msWidth - theoryw) * 0.5f + 0.5f ); // + 0.5f for rounding
                } else if (mCropAlign == CropAlign.ALIGN_RIGHT) { //AlignTo.ALIGN_RIGHT
                    // if you want right crop shift right up by 100% aka 1.0f
                    dx = (int)( (msWidth - theoryw) * 1.0f + 0.5f ); // + 0.5f for rounding
                }
            }

            // this is to scale it only by width - the pivot point is at (0,0)
            // for top crop we dont need to translate it
            Matrix matrix = getImageMatrix();
            matrix.setScale(scale, scale);
            matrix.postTranslate(dx, dy);
            setImageMatrix(matrix);
            setMeasuredDimension(msWidth, msHeight);
        }
        else super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }
}


text:
'use strict';

var angular = require('angular');
require('./controllers');
require('./services');

angular.module('admin', ['ui.router', 'admin.resources', 'admin.controllers'])
	.run(['$rootScope', '$state', '$stateParams',
		function($rootScope, $state, $stateParams) {
			$rootScope.$state = $state;
			$rootScope.$stateParams = $stateParams;
		}
	])
	.config(['$locationProvider', '$urlRouterProvider', '$stateProvider',
		function($locationProvider, $urlRouterProvider, $stateProvider) {
			$locationProvider.html5Mode(true).hashPrefix('!');
			$urlRouterProvider.otherwise('/admin');

			$stateProvider

				// Users
				.state('users', {
					url: '/admin/users',
					views: {
						'@': {
							templateUrl: '/admin/partials/user_list',
							controller: 'UserListCtrl'
						}
					},
					resolve: {
						users: ['Users', function(Users) {
							return Users.getList().$object;
						}]
					}
				})
				.state('users.create', {
					url: '/new',
					parent: 'users',
					views: {
						'@': {
							templateUrl: '/admin/partials/user_edit',
							controller: 'UserEditCtrl'
						}
					},
					resolve: {
						user: ['Restangular', function(Restangular) {
							return Restangular.restangularizeElement(null, {}, 'users');
						}]
					}
				})
				.state('users.edit', {
					url: '/:userId',
					parent: 'users',
					views: {
						'@': {
							templateUrl: '/admin/partials/user_edit',
							controller: 'UserEditCtrl'
						}
					},
					resolve: {
						user: ['Users', '$stateParams', function(Users, $stateParams) {
							return Users.one($stateParams.userId).get();
						}]
					}
				})

				// Customers
				.state('customers', {
					url: '/admin/customers',
					views: {
						'@': {
							templateUrl: '/admin/partials/customer_list',
							controller: 'CustomerListCtrl'
						}
					},
					resolve: {
						customers: ['Customers', function(Customers) {
							return Customers.getList().$object;
						}]
					}
				})
				.state('customers.create', {
					url: '/new',
					parent: 'customers',
					views: {
						'@': {
							templateUrl: '/admin/partials/customer_edit',
							controller: 'CustomerEditCtrl'
						}
					},
					resolve: {
						customer: ['Restangular', function(Restangular) {
							return Restangular.restangularizeElement(null, {}, 'customers');
						}]
					}
				})
				.state('customers.view', {
					url: '/:customerId',
					parent: 'customers',
					views: {
						'@': {
							templateUrl: '/admin/partials/customer_view',
							controller: 'CustomerEditCtrl'
						}
					},
					resolve: {
						customer: ['Customers', '$stateParams', function(Customers, $stateParams) {
							return Customers.one($stateParams.customerId).get();
						}]
					}
				})
				.state('customers.view.edit', {
					url: '/edit',
					parent: 'customers.view',
					views: {
						'@': {
							templateUrl: '/admin/partials/customer_edit',
							controller: 'CustomerEditCtrl'
						}
					}
				})

				// Tickets
				.state('tickets', {
					url: '/admin/tickets',
					views: {
						'@': {
							templateUrl: '/admin/partials/ticket_list',
							controller: 'TicketListCtrl'
						}
					},
					resolve: {
						tickets: ['Tickets', function(Tickets) {
							return Tickets.getList().$object;
						}]
					}
				})
				.state('tickets.create', {
					url: '/new',
					parent: 'tickets',
					views: {
						'@': {
							templateUrl: '/admin/partials/ticket_edit',
							controller: 'TicketEditCtrl'
						}
					},
					resolve: {
						ticket: ['Restangular', function(Restangular) {
							return Restangular.restangularizeElement(null, {}, 'tickets');
						}]
					}
				})
				.state('tickets.edit', {
					url: '/:ticketId',
					parent: 'tickets',
					views: {
						'@': {
							templateUrl: '/admin/partials/ticket_edit',
							controller: 'TicketEditCtrl'
						}
					},
					resolve: {
						ticket: ['Tickets', '$stateParams', function(Tickets, $stateParams) {
							Tickets.one($stateParams.ticketId).get();
						}]
					}
				});

		}
	]);


text:
import migrate
import migrate.changeset
import sqlalchemy

from nova import log as logging

LOG = logging.getLogger(__name__)

meta = sqlalchemy.MetaData()

def _get_table():
    return sqlalchemy.Table('instance_types', meta, autoload=True)

def upgrade(migrate_engine):
    meta.bind = migrate_engine
    instance_types = _get_table()

    string_column = sqlalchemy.Column('flavorid_str', sqlalchemy.String(255))

    string_column.create(instance_types)

    try:
        # NOTE(bcwaldon): This catches a bug with python-migrate
        # failing to add the unique constraint
        try:
            migrate.UniqueConstraint(string_column).create()
        except migrate.changeset.NotSupportedError:
            LOG.error("Failed to add unique constraint on flavorid")
            pass

        # NOTE(bcwaldon): this is a hack to preserve uniqueness constraint
        # on existing 'name' column
        try:
            migrate.UniqueConstraint(instance_types.c.name).create()
        except Exception:
            pass

        integer_column = instance_types.c.flavorid

        instance_type_rows = list(instance_types.select().execute())
        for instance_type in instance_type_rows:
            flavorid_int = instance_type.flavorid
            instance_types.update()\
                          .where(integer_column == flavorid_int)\
                          .values(flavorid_str=str(flavorid_int))\
                          .execute()
    except Exception:
        string_column.drop()
        raise

    integer_column.alter(name='flavorid_int')
    string_column.alter(name='flavorid')
    integer_column.drop()

def downgrade(migrate_engine):
    meta.bind = migrate_engine
    instance_types = _get_table()

    integer_column = sqlalchemy.Column('flavorid_int',
                                       sqlalchemy.Integer())

    integer_column.create(instance_types)

    try:
        # NOTE(bcwaldon): This catches a bug with python-migrate
        # failing to add the unique constraint
        try:
            migrate.UniqueConstraint(integer_column).create()
        except migrate.changeset.NotSupportedError:
            LOG.info("Failed to add unique constraint on flavorid")
            pass

        string_column = instance_types.c.flavorid

        instance_types_rows = list(instance_types.select().execute())
        for instance_type in instance_types_rows:
            flavorid_str = instance_type.flavorid
            try:
                flavorid_int = int(instance_type.flavorid)
            except ValueError:
                msg = _('Could not cast flavorid to integer: %s. '
                        'Set flavorid to an integer-like string to downgrade.')
                LOG.error(msg % instance_type.flavorid)
                raise

            instance_types.update()\
                          .where(string_column == flavorid_str)\
                          .values(flavorid_int=flavorid_int)\
                          .execute()
    except Exception:
        integer_column.drop()
        raise

    string_column.alter(name='flavorid_str')
    integer_column.alter(name='flavorid')
    string_column.drop()


text:
using System.Windows;

namespace Ironfrost
{
    /// <summary>
    ///   Container for connection information.
    /// </summary>
    public class ConnectionDetails
    {
        /// <summary>
        ///   The host to connect to.
        /// </summary>
        public string Host { get; set; }

        /// <summary>
        ///   The port to connect to.
        /// </summary>
        public int Port { get; set; }

        /// <summary>
        ///   Constructs a new <c>ConnectionDetails</c>.
        /// </summary>
        /// <param name="host">
        ///   The hostname to be connected to.
        /// </param>
        /// <param name="port">
        ///   The TCP port on the hostname to connect to.
        /// </param>
        public ConnectionDetails(string host, int port)
        {
            Host = host;
            Port = port;
        }
    }

    /// <summary>
    /// Interaction logic for ConnectDialog.xaml
    /// </summary>
    public partial class ConnectDialog : Window
    {
        public ConnectionDetails Connection { get; }

        /// <summary>
        ///   Constructs a new <c>ConnectDialog</c>.
        /// </summary>
        /// <param name="defaultHost">
        ///   The initial host to display.
        /// </param>
        /// <param name="defaultPort">
        ///   The initial port to display.
        /// </param>
        public ConnectDialog(string defaultHost, int defaultPort)
        {
            Connection = new ConnectionDetails(defaultHost, defaultPort);
            InitializeComponent();
            DataContext = Connection;
        }

        private void btnConnect_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = true;
        }
    }
}


text:
/**
 * @provides phui-invisible-character-view-css
 */

.invisible-special {
  font-family: monospace;
  color: {$blacktext};
  background: rgba({$alphablue},0.1);
  padding: 1px 4px;
  border-radius: 3px;
  white-space: pre-wrap;
}


text:
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#include <io.h>
#else
#include <unistd.h>
#endif

#ifndef ABTS_H
#define ABTS_H

#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE  1
#endif

struct sub_suite {
    const char *name;
    int num_test;
    int failed;
    int not_run;
    int not_impl;
    struct sub_suite *next;
};
typedef struct sub_suite sub_suite;

struct abts_suite {
    sub_suite *head;
    sub_suite *tail;
};
typedef struct abts_suite abts_suite;

struct abts_case {
    int failed;
    sub_suite *suite;
};
typedef struct abts_case abts_case;

typedef void (*test_func)(abts_case *tc, void *data);

#define ADD_SUITE(suite) abts_add_suite(suite, __FILE__);

abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name);
void abts_run_test(abts_suite *ts, test_func f, void *value);
void abts_log_message(const char *fmt, ...);

void abts_int_equal(abts_case *tc, const int expected, const int actual, int lineno);
void abts_int_nequal(abts_case *tc, const int expected, const int actual, int lineno);
void abts_str_equal(abts_case *tc, const char *expected, const char *actual, int lineno);
void abts_str_nequal(abts_case *tc, const char *expected, const char *actual,
                       size_t n, int lineno);
void abts_ptr_notnull(abts_case *tc, const void *ptr, int lineno);
void abts_ptr_equal(abts_case *tc, const void *expected, const void *actual, int lineno);
void abts_true(abts_case *tc, int condition, int lineno);
void abts_fail(abts_case *tc, const char *message, int lineno);
void abts_not_impl(abts_case *tc, const char *message, int lineno);
void abts_assert(abts_case *tc, const char *message, int condition, int lineno);
void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno);

/* Convenience macros. Ryan hates these! */
#define ABTS_INT_EQUAL(a, b, c)     abts_int_equal(a, b, c, __LINE__)
#define ABTS_INT_NEQUAL(a, b, c)    abts_int_nequal(a, b, c, __LINE__)
#define ABTS_STR_EQUAL(a, b, c)     abts_str_equal(a, b, c, __LINE__)
#define ABTS_STR_NEQUAL(a, b, c, d) abts_str_nequal(a, b, c, d, __LINE__)
#define ABTS_PTR_NOTNULL(a, b)      abts_ptr_notnull(a, b, __LINE__)
#define ABTS_PTR_EQUAL(a, b, c)     abts_ptr_equal(a, b, c, __LINE__)
#define ABTS_TRUE(a, b)             abts_true(a, b, __LINE__);
#define ABTS_FAIL(a, b)             abts_fail(a, b, __LINE__);
#define ABTS_NOT_IMPL(a, b)         abts_not_impl(a, b, __LINE__);
#define ABTS_ASSERT(a, b, c)        abts_assert(a, b, c, __LINE__);

#define ABTS_SIZE_EQUAL(a, b, c)    abts_size_equal(a, b, c, __LINE__)

abts_suite *run_tests(abts_suite *suite);
abts_suite *run_tests1(abts_suite *suite);

#endif


text:
#ifndef _NS_CONSUMER_MQPLUGIN_H_
#define _NS_CONSUMER_MQPLUGIN_H_

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

#ifdef WITH_MQ
#include "NSCommon.h"
#include "NSStructs.h"

/** consumer MQ task processing. */
void NSConsumerMQTaskProcessing(NSTask *);
#endif

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // _NS_CONSUMER_MQPLUGIN_H_