text:
#include "web_refiner_content_bridge.h"

#include "content/public/browser/android/content_view_core.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/common/child_process_host.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_process_host_observer.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_request_info.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/renderer/render_process_observer.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_view_impl.h"

namespace content {

/************ BrowserThread wrappers **************/
const int BrowserThread_ID_UI = BrowserThread::UI;
const int BrowserThread_ID_DB = BrowserThread::DB;
const int BrowserThread_ID_FILE = BrowserThread::FILE;
const int BrowserThread_ID_IO = BrowserThread::IO;
const int ChildProcessHost_kInvalidUniqueID = ChildProcessHost::kInvalidUniqueID;

void Assert_Currently_On(int id) {
    DCHECK_CURRENTLY_ON(static_cast<content::BrowserThread::ID>(id));
}

void BrowserThread_PostTask(int identifier,
                       const tracked_objects::Location& from_here,
                       const base::Closure& task) {
    BrowserThread::PostTask(static_cast<content::BrowserThread::ID>(identifier), from_here, task);
}

/************ ResourceRequestInfo wrappers **************/
const ResourceRequestInfo* ResourceRequestInfo_ForRequest(const net::URLRequest* request) {
    return ResourceRequestInfo::ForRequest(request);
}

/************ RenderProcessObserver wrappers **************/
class RenderProcessObserverBridge : public content::RenderProcessObserver {
public:
    RenderProcessObserverBridge(RenderProcessObserverExt* ext) : ext_(ext) {}
    ~RenderProcessObserverBridge() override {}
    bool OnControlMessageReceived(const IPC::Message& message) override { return ext_->OnControlMessageReceived(message); };
    void OnRenderProcessShutdown() override { ext_->OnRenderProcessShutdown(); }
    void WebKitInitialized() override { ext_->WebKitInitialized(); }
private:
    RenderProcessObserverExt* ext_;
};

RenderProcessObserverExt::RenderProcessObserverExt(RenderThread* render_thread) {
    bridge_ = new RenderProcessObserverBridge(this);
    render_thread->AddObserver(bridge_);
}

RenderProcessObserverExt::~RenderProcessObserverExt() {
    delete bridge_;
}

/************ RenderProcessHostObserver wrappers **************/

class RenderProcessHostObserverBridge : public RenderProcessHostObserver {
public:
    RenderProcessHostObserverBridge(RenderProcessHostObserverExt* ext) : ext_(ext) {}
    ~RenderProcessHostObserverBridge() override {}
    void RenderProcessWillExit(RenderProcessHost* host) override { ext_->RenderProcessWillExit(host); }
    void RenderProcessExited(RenderProcessHost* host, base::TerminationStatus status,
                                   int exit_code) override { ext_->RenderProcessExited(host, status, exit_code); }
    void RenderProcessHostDestroyed(RenderProcessHost* host) override { ext_->RenderProcessHostDestroyed(host); }
private:
    RenderProcessHostObserverExt* ext_;
};

RenderProcessHostObserverExt::RenderProcessHostObserverExt() {
    bridge_ = new RenderProcessHostObserverBridge(this);
}

RenderProcessHostObserverExt::~RenderProcessHostObserverExt() {
    delete bridge_;;
}

void RenderProcessHostObserverExt::AddAsObserverFor(RenderProcessHost* process_host) {
    process_host->AddObserver(bridge_);
}

int RenderProcessHost_GetID(RenderProcessHost* render_process_host) {
    return render_process_host ? render_process_host->GetID() : ChildProcessHost::kInvalidUniqueID;
}

bool RenderProcessHost_Send(RenderProcessHost* render_process_host, IPC::Message* msg) {
    return render_process_host ? render_process_host->Send(msg) : false;
}

/************ WebContentsObserver wrappers **************/

class WebContentsObserverBridge : public WebContentsObserver {
public:
    WebContentsObserverBridge(WebContents* web_contents, WebContentsObserverExt* ext)
        : WebContentsObserver(web_contents)
        , ext_(ext) {}
    ~WebContentsObserverBridge() override {}
    void DidStartLoading() override { ext_->DidStartLoading(); }
    void DidStopLoading() override { ext_->DidStopLoading(); }
    void DidStartProvisionalLoadForFrame(
        RenderFrameHost* render_frame_host, const GURL& validated_url,
        bool is_error_page, bool is_iframe_srcdoc) override {
        ext_->DidStartProvisionalLoadForFrame(render_frame_host, validated_url, is_error_page, is_iframe_srcdoc);
    }
    void DidFinishLoad(RenderFrameHost* render_frame_host,
                               const GURL& validated_url) override { ext_->DidFinishLoad(render_frame_host, validated_url); }
    void DidFailLoad(RenderFrameHost* render_frame_host,
                             const GURL& validated_url,
                             int error_code, const base::string16& error_description,
                             bool was_ignored_by_handler) override {
        ext_->DidFailLoad(render_frame_host, validated_url, error_code, error_description, was_ignored_by_handler);
    }
    void WebContentsDestroyed() override { ext_->WebContentsDestroyed(); }
private:
    WebContentsObserverExt* ext_;
};

WebContentsObserverExt::WebContentsObserverExt(WebContents* web_contents) {
    bridge_ = new WebContentsObserverBridge(web_contents, this);
}

WebContentsObserverExt::~WebContentsObserverExt() {
    delete bridge_;
}

WebContents* WebContentsObserverExt::web_contents() const {
    return bridge_->web_contents();
}

int WebContentsObserverExt::GetProcessID() const {
    return WebContents_GetProcessID(web_contents());
}

int WebContentsObserverExt::GetRoutingID() const {
    return WebContents_GetRoutingID(web_contents());
}

bool WebContentsObserverExt::IsOffTheRecord() const {
    if (web_contents() && web_contents()->GetBrowserContext())
        return web_contents()->GetBrowserContext()->IsOffTheRecord();

    return false;
}

WebContents* ContentViewCore_GetWebContents(content::ContentViewCore* content_view_core) {
    return content_view_core ? content_view_core->GetWebContents() : 0;
}

int WebContents_GetProcessID(WebContents* web_contents) {
    if (web_contents && web_contents->GetRenderProcessHost())
        return web_contents->GetRenderProcessHost()->GetID();

    return ChildProcessHost::kInvalidUniqueID;
}

int WebContents_GetRoutingID(WebContents* web_contents) {
    return web_contents ? web_contents->GetRoutingID() : MSG_ROUTING_NONE;
}

RenderFrameHost* RenderFrameHost_GetParent(RenderFrameHost* render_frame_host) {
    return render_frame_host ? render_frame_host->GetParent() : 0;
}

/************ RenderViewObserver wrappers **************/
class RenderViewObserverBridge : public RenderViewObserver {
public:
    RenderViewObserverBridge(RenderView* render_view, RenderViewObserverExt* ext)
        : RenderViewObserver(render_view)
        , ext_(ext) {}
    ~RenderViewObserverBridge() override {}
    bool OnMessageReceived(const IPC::Message& message) override { return ext_->OnMessageReceived(message); }
    void DidStartLoading() override { ext_->DidStartLoading(); }
    void DidStopLoading() override { ext_->DidStopLoading(); }
    void DidFailLoad(blink::WebLocalFrame* frame, const blink::WebURLError& error) override { ext_->DidFailLoad(frame, error); }
    void DidFinishLoad(blink::WebLocalFrame* frame) override { ext_->DidFinishLoad(frame); }
    void DidFailProvisionalLoad(blink::WebLocalFrame* frame, const blink::WebURLError& error) override { ext_->DidFailProvisionalLoad(frame, error); }
private:
    RenderViewObserverExt* ext_;
};

RenderViewObserverExt::RenderViewObserverExt(RenderView* render_view) {
    bridge_ = new RenderViewObserverBridge(render_view, this);
    static_cast<RenderViewImpl*>(render_view)->RemoveObserver(bridge_);
    static_cast<RenderViewImpl*>(render_view)->AddObserver(bridge_);
}

RenderViewObserverExt::~RenderViewObserverExt() {
    delete bridge_;
}

} //namespace content


text:
<?xml version="1.0" encoding="utf-8" ?>
<Configuration>

    <LocalDirectory>./repos</LocalDirectory>
    <PollIntervalInSeconds>10</PollIntervalInSeconds>

    <VersionOneConnection>
        <Path>https://www14.v1host.com/v1sdktesting/</Path>
        <UserName>admin</UserName>
        <Password>admin</Password>
        <!-- true - not use UserName and Password data in authentication-->
        <IntegratedAuth>false</IntegratedAuth>
        <ProxySettings>
            <UseProxy>false</UseProxy>
            <Path>http://proxyserver:3128/</Path>
            <UserName>proxyUser</UserName>
            <Password>proxyUserPass</Password>
        </ProxySettings>
    </VersionOneConnection>

    <GitConnections>
        <GitConnection>
            <Path>git://github.com/edkennard/Integration.Git.Test1.git</Path>
            <Password></Password>
            <SshPassphrase></SshPassphrase>

            <!-- Specify a single branch to watch, or leave blank to watch all branches -->
            <WatchedBranchName></WatchedBranchName>

            <!--
                Set UseBranchName to true to enable parsing the branch name as a VersionOne item ID.
                Should only be enabled when a specific branch has been set in WatchedBranchName above,
                otherwise when watching all branches commits will be incorrectly associated with
                workitems they don't belong to
            -->
            <UseBranchName>false</UseBranchName>

            <!--
            	Set BranchFilter to filter out branch name that contains the text configured. For
            	example, having the value set to "personal" all personal branches will be filtered.
            	If no filter should apply to this connection, simply leave blank.
            -->
            <BranchFilter></BranchFilter>

            <Link>
                <!-- Add {0} where you want the commit ID to be inserted -->
                <NameTemplate>ChangeSet: {0}</NameTemplate>
                <UrlTemplate>https://github.com/edkennard/Integration.Git.Test1/commit/{0}</UrlTemplate>
                <OnMenu>true</OnMenu>
            </Link>
        </GitConnection>
        <GitConnection>
            <Path>git://github.com/edkennard/Integration.Git.Test2.git</Path>
            <Password></Password>
            <SshPassphrase></SshPassphrase>
            <WatchedBranchName></WatchedBranchName>
            <UseBranchName>false</UseBranchName>
            <BranchFilter></BranchFilter>
            <Link>
                <NameTemplate>ChangeSet: {0}</NameTemplate>
                <UrlTemplate>https://github.com/edkennard/Integration.Git.Test2/commit/{0}</UrlTemplate>
                <OnMenu>true</OnMenu>
            </Link>
        </GitConnection>
        <GitConnection>
            <Path>git://github.com/edkennard/Integration.Git.Test3.git</Path>
            <Password></Password>
            <SshPassphrase></SshPassphrase>
            <WatchedBranchName></WatchedBranchName>
            <UseBranchName>false</UseBranchName>
            <BranchFilter></BranchFilter>
            <Link>
                <NameTemplate>ChangeSet: {0}</NameTemplate>
                <UrlTemplate>https://github.com/account/repo/commit/{0}</UrlTemplate>
                <OnMenu>true</OnMenu>
            </Link>
        </GitConnection>
    </GitConnections>

    <ChangeSet>
        <AlwaysCreate>false</AlwaysCreate>
        <NameTemplate>{0} by {1} in {2}</NameTemplate>
        <NameTemplateDateFormat>yyyy-MM-dd HH:mm:ss</NameTemplateDateFormat>
        <NameTemplateRepositoryFormat>NameOnly</NameTemplateRepositoryFormat>
        <ChangeComment>Updated by Git</ChangeComment>
        <ReferenceAttribute>Number</ReferenceAttribute>
        <!--
            === Sample Regexes ===
            To Match S-01001 (Matches "S-01001"):					[A-Z]{1,2}-[0-9]+
            To match #Reference (matches only "Reference"):			(?<=#)[a-zA-Z]+\b
            To match "V1:Reference"  (matches only "Reference"):	(?<=V1:)[a-zA-Z]+\b
        -->
        <ReferenceExpression><![CDATA[[A-Z]{1,2}-[0-9]+]]></ReferenceExpression>
    </ChangeSet>

</Configuration>

redpajama_set_name: RedPajamaGithub


text:
class Gem::Ext::BuildError < Gem::InstallError
end


text:
<TITLE>
[Chapter 8] Additional Samba Information </title><META NAME="DC.title" CONTENT=""><META NAME="DC.creator" CONTENT=""><META NAME="DC.publisher" CONTENT="O'Reilly & Associates, Inc."><META NAME="DC.date" CONTENT="1999-11-05T21:35:49Z"><META NAME="DC.type" CONTENT="Text.Monograph"><META NAME="DC.format" CONTENT="text/html" SCHEME="MIME"><META NAME="DC.source" CONTENT="" SCHEME="ISBN"><META NAME="DC.language" CONTENT="en-US"><META NAME="generator" CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0">

Using Samba

Robert Eckstein, David Collier-Brown, Peter Kelly

1st Edition November 1999

1-56592-449-5, Order Number: 4495

416 pages, $34.95

 Buy the hardcopy

Table of Contents

Chapter 8

8. Additional Samba Information

Contents:

Supporting Programmers

Magic Scripts

Internationalization

WinPopup Messages

Recently Added Options

Miscellaneous Options

Backups with smbtar

This chapter wraps up our coverage of the
smb.conf configuration file with some miscellaneous options that can perform a variety of tasks. We will talk briefly about options for supporting programmers, internationalization, messages, and common Windows bugs. For the most part, you will use these options only in isolated circumstances. We also cover performing automated backups with the
smbtar command at the end of this chapter. So without further ado, let's jump into our first subject: options to help programmers.

8.1 Supporting Programmers

If you have programmers accessing your Samba server, you'll want to be aware of the special options listed in
Table 8.1.

Table 8.1: Programming Configuration Options

Option

Parameters

Function

Default

Scope

time server

boolean

If
yes,
nmbd announces itself as a SMB time service to Windows clients.

no

Global

time offset

numerical (number of minutes)

Adds a specified number of minutes to the reported time.

0

Global

dos filetimes

boolean

Allows non-owners of a file to change its time if they can write to it.

no

Share

dos filetime

resolution

boolean

Causes file times to be rounded to the next even second.

no

Share

fake directory create times

boolean

Sets directory times to avoid a MS
nmake bug.

no

Share

8.1.1 Time Synchronization

Time synchronization can be very important to programmers. Consider the following options:

time service = yes
dos filetimes = yes
fake directory create times = yes
dos filetime resolution = yes
delete readonly = yes

If you set these options, Samba shares will provide the kind of compatible file times that Visual C++,
nmake, and other Microsoft programming tools require. Otherwise, PC
make programs will tend to think that all the files in a directory need to be recompiled every time. Obviously, this is not the behavior you want.

8.1.1.1 time server

If your Samba server has an accurate clock, or if it's a client of one of the Unix network time servers, you can instruct it to advertise itself as an SMB time server by setting the
time
server option as follows:

[global]
	time service = yes

The client will still have to request the correct time with the following DOS command, substituting the Samba server name in at the appropriate point:

C:\NET TIME \\server /YES /SET

This command can be placed in a Windows logon script (see Chapter 6, Users, Security, and Domains ).

By default, the
time
server option is normally set to
no. If you turn this service on, you can use the command above to keep the client clocks from drifting. Time synchronization is important to clients using programs such as
make, which compile based on the last time the file was changed. Incorrectly synchronized times can cause such programs to either remake all files in a directory, which wastes time, or not recompile a source file that was just modified because of a slight clock drift.

8.1.1.2 time offset

To deal with clients that don't process daylight savings time properly, Samba provides the
time
offset option. If set, it adds the specified number of minutes to the current time. This is handy if you're in Newfoundland and Windows doesn't know about the 30-minute time difference there:

[global]
	time offset = 30

8.1.1.3 dos filetimes

Traditionally, only the root user and the owner of a file can change its last-modified date on a Unix system. The share-level
dos
filetimes option allows the Samba server to mimic the characteristics of a DOS/Windows machine: any user can change the last modified date on a file in that share if he or she has write permission to it. In order to do this, Samba uses its root privileges to modify the timestamp on the file.

By default, this option is disabled. Setting this option to
yes is often necessary to allow PC
make programs to work properly. Without it, they cannot change the last-modified date themselves. This often results in the program thinking
all files need recompiling when they really don't.

8.1.1.4 dos filetime resolution

dos
filetime
resolution is share-level option. If set to
yes, Samba will arrange to have the file times rounded to the closest two-second boundary. This option exists primarily to satisfy a quirk in Windows that prevents Visual C++ from correctly recognizing that a file has not changed. You can enable it as follows:

[data]
	dos filetime resolution = yes

We recommend using this option only if you are using Microsoft Visual C++ on a Samba share that supports opportunistic locking.

8.1.1.5 fake directory create times

The
fake
directory
create
times option exists to keep PC
make programs sane. VFAT and NTFS filesystems record the creation date of a specific directory while Unix does not. Without this option, Samba takes the earliest recorded date it has for the directory (often the last-modified date of a file) and returns it to the client. If this is not sufficient, set the following option under a share definition:

[data]
	fake directory create times = yes

If set, Samba will adjust the directory create time it reports to the hardcoded value January 1st, 1980. This is primarily used to convince the Visual C++
nmake program that any object files in its build directories are indeed younger than the creation date of the directory itself and need to be recompiled.

7.3 Name Resolution with Samba

8.2 Magic Scripts

O'Reilly Home  |

O'Reilly Bookstores  |

How to Order  |

O'Reilly Contacts

International  |

About O'Reilly  |

Affiliated Companies

© 1999, O'Reilly & Associates, Inc.


text:
/* HEADER PART */
body{
	margin:0px; !important;
	padding:0px;
	top:0px;
}

html,
body {
  height:100%;
}

a{
	text-decoration:none;
	color:#000000;
}

a:hover {
	color:#027BF7;
	text-decoration:none;
}

a:visited {
	color:#027BF7;
	text-decoration:none;
}

.fixedHeader {
	position: fixed;
    top:0;
    left:0;
	width:100%;
	background-image:url(../bundles/static/images/header.png);
	background-repeat:repeat-x;
	z-index:20;
}

.searchBarWrapper {
	width:300px;
	float:left;
	position:relative;
	top:15px;
	left:30px;
	display:block;
}
.headerContent {
	margin-left:auto;
	margin-right:auto;
	padding-bottom:6px;
	width:960px;
	height:55px;
}

.headerMenuWraper{
	float:right;
}

.slidesLiveLogo {
	widows:300px;
	position:relative;
	top:13px;
	left:-12px;
	float:left;
}

.slidesLiveLogoImage {
	border:0px;
}

.slidesLiveLogo:hover {
	position:relative;
	top:14px;
}

.headerTopSpace{
	height:55px;
	margin-top:0px;
}

/* FOOTER PART */
.siteFooter {
	position:relative;
	top:-6px;
	width:100%;
	background-image:url(static/images/footer.png);
	background-repeat:repeat-x;
}

.footerContent {
	margin-left:auto;
	margin-right:auto;
	padding-bottom:6px;
	position:relative;
	width:960px;
}

.footerDark {
	padding-top:25px;
	background-color:#000000;
	height:30px;
}

.footerLight {
	background-color:#09101a;
	padding-top:40px;
	height:60px;
}

/* TEXTS*/

.footerText {
	font-family:'Ropa Sans', sans-serif;
	font-weight:normal;
	font-size:15px;
	color:#8896a3;
	position:relative;
	text-decoration:none;
	text-transform:uppercase;
}

.footerText a{
	color:#8896a3;
	text-decoration:none;
}

.footerText a:hover{
	color:#027BF7;
	text-decoration:none;
	position:relative;
	top:1px;
}

.footerSmaller {
	font-size:13px;
	color:#666666;
}

.footerMenuSpace {
	margin-right:50px;
}

.footerMenuRight{
	text-align:right;
	float:right;
}

.footerMenuRight a{
	color:#666666;
	margin-right:15px;
}

.headerMenu a{
	font-family:Arial, Helvetica, sans-serif;
	font-weight:normal;
	text-transform:uppercase;
	font-size:15px;
	color:#999;
	position:relative;
	top:19px;
	text-decoration:none;
}

.headerMenu a:hover{
	top:20px;
	color:#027BF7 !important;
}

.topMenuSpace {
	margin-right:15px;
}

.topMenuDownloadSpecial {
	color:#FFFFFF !important;
}

/*-------------------ACCOUNT BAR----------------------*/
.accountServiceBar{
	position: fixed;
    top:55px;
    left:0;
	background-color:#CCCCCC;
	width:100%;
	height:40px;
	z-index:20;
}

.accountServiceBarTopSpace{
	height:40px;
}

.accountBarThumbnail {
	width:30px;
	height:30px;
	float:left;
	position:relative;
	top: -12px;
	margin-right:15px;
}

.accountBarContent {
	margin-left:auto;
	margin-right:auto;
	margin-top:12px;
	width:960px;
	height:50px;
}

.accountBarMenu, .accountBarMenu a {
	font-family:Arial, Helvetica, sans-serif;
	font-weight:normal;
	text-transform:uppercase;
	font-size:15px;
	color:#000;
	display:inline;
	text-decoration:none;
}

.accountBarMenu a:hover {
	color:#027BF7;
	text-transform:uppercase;
	text-decoration:none;
}

.accountBarMenuSeparator {
	display:inline;
	margin-right:8px;
	margin-left:8px;
}

/*-------------------SPECIAL STUFF----------------------*/
.slidesLiveBlue {
	color:#027BF7 !important;
}

.slidesLiveBlue a{
	color:#027BF7 !important;
}

.globalFont, .globalFont a, .globalFont a:hover{
	font-family:'Ropa Sans', sans-serif !important;
}

.bottomFree {
	margin-bottom:0px !important;
	padding-bottom:0px !important;
}

.topFree {
	margin-top:0px !important;
	padding-top:0px !important;
}

.center{
	display: block;
	text-align:center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.verticalCenter{
	position:absolute;
	top:50%;
}

.left{
	display: block;
	text-align:left !important;
}

.floatRight {
	text-align:right;
	float:right;
}

.logoBeta {
	float:right;
	font-family:'Ropa Sans', sans-serif;
	font-weight:normal;
	font-size:13px;
	position:relative;
	top:-3px;
	left: -2px;
	color:#FFFFFF;
	text-decoration:none;
	line-height:16px;
	text-align:center;
}

.playerPanel {
	height:331px;
	width:100%;
	text-align:center;
	z-index:18;
}
/* ERRORS */
h2.error{
	font-size:18px;
	font-style:italic;
	color:#000000;
	font-weight:normal;
}

/* universal backgrounds */
.websiteDarkBackground {
	padding-top:40px;
	padding-bottom:40px;
	width:100%;
	background-image:url(static/images/dark-grey-bg.png);
}

/* TILES */
.presentationTitlesHomepage {
	margin-top:50px;
}
.presentationTileBar{
	list-style-type:none;
	margin:0px;
	padding:0px;
	background-color:#1e1e1e;
	width:100%;
	padding-top:5px;
	margin-top:50px;
}

.presentationTile {
	float:left;
	overflow:hidden;
}

.presentationTileImage {
	background-size:cover;
	background-position:top;
	position: relative;
	left: 0px;
	height:100%;
}

.presentationTileImage:hover {
	filter:alpha(opacity=50);
	opacity: 0.5;
}

.presentationTileDescription {
	background-image:url(generalImages/tile_transparent_black.png);
	background-repeat:repeat;
	position:relative;
	top:-66px;
	height:50px;
	padding:8px;
}

.presentationTileTitle {
	font-family:Arial, Helvetica, sans-serif;
	font-size:14px;
	font-weight:bold;
	color:#999999;
	height:34px;
	overflow:hidden;
}

.presentationTileChannel {
	position:absolute;
	bottom:8px;
	font-family:Arial, Helvetica, sans-serif;
	font-size:11px;
	font-weight:normal;
	text-decoration:none;
}

.presentationTileChannel:hover {
	text-decoration:underline;
}

.tile_1_1{
	width:150px;
	height:150px;
	display:block;
	margin-right:6px;
	margin-bottom:6px;
	position: relative;
	float:left;
}

.categoryTile {
	background-color:#027bf7;
}

.categoryTile:hover{
	background-color:#000000;
}
.entireSiteWrapper {
	min-height: 100%;
	height: auto !important;
	height: 100%;
}

.turnBlockOff {
	display:none !important;
}

/*-----CLEARFIX------------*/
.clearfix:after {
	content: ".";
	display: block;
	clear: both;
	visibility: hidden;
	line-height: 0;
	height: 0;
}

.clearfix {
	display: inline-block;
}


text:
unbuffered_sed () {
    while IFS='' read -r buffered_line; do
        printf '%s\n' "$buffered_line" | sed -e "$1"
    done
}

dottle_import_exists () { return 0; }
dottle_import () {
    # import a config file
    # No configuration flags for this yet

    output debug "Flags for import: '$FLAGS'"

    if [ -d "$2" ]; then
        CONFIG_FILE="${2}/install.conf.yml"
    else
        CONFIG_FILE="${2}"
    fi

    if [ -e "$CONFIG_FILE" ]; then
        BASEDIR="$(dirname -- "${CONFIG_FILE}")"
        CONFIG_FILE="$(basename -- "${CONFIG_FILE}")"
    else
        output error "Couldn't import '$CONFIG_FILE'\n"
        return 1
    fi

    cd "$BASEDIR" || { output error "Couldn't cd into config directory.\n" && return 1; }

    if [ "$1" != '__ROOT__' ]; then
        OUTPUT_FILTER='s/^/    /'
    fi

    [ "$1" != '__ROOT__' ] && output running "$1\n"

    case "$ACTION" in
        check)
            if dottle_action_check < "$CONFIG_FILE" | unbuffered_sed "$OUTPUT_FILTER"; then
                output ok "The file doesn't contain any errors\n"
            else
                output error "The file has some serious errors\n"
            fi
            ;;
        install|update)
            if dottle_action_check < "$CONFIG_FILE" | unbuffered_sed "$OUTPUT_FILTER"; then
                if dottle_action_exec < "$CONFIG_FILE" | unbuffered_sed "$OUTPUT_FILTER"; then
                    [ "$1" != '__ROOT__' ] && output ok "$1\n"
                fi
            fi
            ;;
        uninstall)
            output error "not implemented yet D:\n"
            return 1
            ;;
        *)
            output error "Action '$ACTION' not found. Try --help\n"
            return 1
    esac
    return 0
}


text:
title:  "Metal"
description: Metal
---

[Metal]

[Metal]: https://www.objc.io/issues/18-games/metal/


text:
(function() {

  /////////////////////////////////////
  //---------------------------------//
  // Copyright (c) 2017 NullDev Ltd. //
  //---------------------------------//
  /////////////////////////////////////

  var Ball, Brick, Game, Paddle;
  Paddle = (function() {
    function Paddle(config) {
      this.config      = config;
      this.context     = this.config.context;
      this.canvas      = this.config.canvas;
      this.move_amount = this.config.move_amount || (this.canvas.width / 32);
      this.width       = this.config.width  || (this.canvas.width  / 8);
      this.height      = this.config.height || (this.canvas.height / 30);
      this.x           = this.canvas.width / 2;
      this.y           = this.canvas.height - (this.height / 2);
      this.score       = 0;
      this.lives       = 3;
    }

    Paddle.prototype.update = function(leftPressed, rightPressed) {
      if (leftPressed) this.x -= this.move_amount;
      else if (rightPressed) this.x += this.move_amount;
      if (this.x + (this.width / 2) > this.canvas.width) return this.x = this.canvas.width - (this.width / 2);
      else if (this.x - (this.width / 2) < 0) return this.x = 0 + (this.width / 2);
    };

    Paddle.prototype.draw = function() {
      this.context.fillStyle = "rgba(128,128,128,.8)";
      return this.context.fillRect(this.x - (this.width / 2), this.y - (this.height / 2), this.width, this.height);
    };
    return Paddle;

  })();

  Ball = (function() {

    function Ball(config) {

      this.config           = config;
      this.context          = this.config.context;
      this.canvas           = this.config.canvas;
      this.radius           = this.config.radius    || 5;
      this.max_speed        = this.config.max_speed || 8;
      this.max_bounce_angle = this.config.max_bounce_angle || (5 * Math.PI / 12);
      this.x                = this.canvas.width  / 2;
      this.y                = this.canvas.height / 2;
      this.width            = 2 * this.radius;
      this.height           = 2 * this.radius;
      this.use_physics      = this.config.use_physics || 1;
      this.dx               = 0;
      this.dy               = this.max_speed;
      this.was_bad          = false;
      this.is_dead          = false;
    }

    Ball.prototype.update = function(paddle, bricks) {

      var b_y, bottom, bounce_angle, brick, horizontal, is_bad, left, normalized_relative_intersection_x,
      overlap, overlap2d, relative_intersect_x, right, sx, sy, top, vertical, _i, _len, _ref, _ref1, _results;

      if (this.dx > this.max_speed) this.dx = this.max_speed;
      else if (this.dx < 0 && this.dx < -this.max_speed) this.dx = -this.max_speed;
      if (this.dy > this.max_speed) this.dy = this.max_speed;
      else if (this.dy < 0 && this.dy < -this.max_speed) this.dy = -this.max_speed;
      this.x += this.dx;
      this.y += this.dy;
      is_bad = false;
      if (this.x >= this.canvas.width || this.x <= 0) {
        is_bad = true;
        this.x -= 2 * this.dx;
        this.dx = -this.dx;
      }
      if (this.y <= 0) {
        is_bad = true;
        this.y -= 2 * this.dy;
        this.dy = -this.dy;
      }
      if (this.y >= this.canvas.height) {
        this.is_dead = true;
        return true;
      }
      if (is_bad && this.was_bad) {
        this.x       = this.canvas.width  / 2;
        this.y       = this.canvas.height / 2;
        this.dx      = this.max_speed;
        this.dy      = this.max_speed;
        this.was_bad = false;
        this.is_bad  = false;
      }
      this.was_bad = is_bad;

      overlap = function(ax, aw, bx, bw) { return !((ax + aw) <= bx || ax >= (bx + bw)); };

      overlap2d = function(ax, ay, aw, ah, bx, b_y, bw, bh) { return overlap(ax, aw, bx, bw) && overlap(ay, ah, b_y, bh); };

      overlap = overlap2d(this.x, this.y, this.radius, this.radius, paddle.x - (paddle.width / 2), paddle.y - (paddle.height / 2), paddle.width, paddle.height);

      if (overlap) {
        if (this.use_physics === 1) {
          this.y  = 2 * paddle.y - (this.y + this.radius) - this.height;
          this.dy = -this.dy;
          this.dx = ((this.x + (this.radius * 0.5)) - (paddle.x + (paddle.width / 2))) * 4 / paddle.width;
          if (this.x > paddle.x) this.dx = -this.dx;
        }
        else if (this.use_physics === 2) {
          relative_intersect_x = (paddle.x + (paddle.width / 2)) - this.x;
          normalized_relative_intersection_x = relative_intersect_x / (paddle.width / 2);
          bounce_angle = normalized_relative_intersection_x * this.max_bounce_angle;
          this.dx = Math.cos(bounce_angle) * this.max_speed;
          this.dy = -1 * Math.sin(bounce_angle) * this.max_speed;
        }
      }
      _results = [];
      for (_i = 0, _len = bricks.length; _i < _len; _i++) {
        brick = bricks[_i];
        if (!brick.dead) {
          sx         = brick.x;
          left       = sx - (brick.width / 2);
          right      = sx + (brick.width / 2);
          horizontal = (left <= (_ref = this.x) && _ref <= right);
          sy         = brick.y;
          top        = sy - (brick.height / 2);
          bottom     = sy + (brick.height / 2);
          vertical   = (top <= (_ref1 = this.y) && _ref1 <= bottom);
          if (horizontal && vertical) {
            brick.dead = true;
            this.dy = -this.dy;
            b_y = Math.floor((this.y + this.radius * 0.5 - (brick.y - (brick.height / 2))) - brick.height);
            if (b_y === 0) {
              if (this.dy < 0) this.dy = -1 * this.max_speed;
              else this.dy = this.max_speed;
            }
            paddle.score += 100;
            if (this.config.use_NLGame) _results.push(NLGame.score("player", paddle.score));
            else _results.push(void 0);
          }
          else _results.push(void 0);
        }
        else _results.push(void 0);
      }
      return _results;
    };

    Ball.prototype.draw = function() {
      this.context.fillStyle = "rgba(255, 255, 255, 1)";
      this.context.beginPath();
      this.context.arc(this.x, this.y, this.radius, 0, 2 * Math.PI, false);
      this.context.closePath();
      return this.context.fill();
    };

    return Ball;

  })();

  Brick = (function() {

    function Brick(config) {
      this.config  = config;
      this.context = this.config.context;
      this.canvas  = this.config.canvas;
      this.width   = this.config.width;
      this.height  = this.config.height;
      this.color   = this.config.color;
      this.x       = this.config.x;
      this.y       = this.config.y;
      this.dead    = false;
    }

    Brick.prototype.update = function() { if (!this.dead) return true; };

    Brick.prototype.draw = function() {
      if (!this.dead) {
        this.context.fillStyle = this.color;
        return this.context.fillRect(this.x - (this.width / 2), this.y - (this.height / 2), this.width, this.height);
      }
    };

    return Brick;

  })();

  Game = (function() {

    function Game(config) {
      this.config = config;
      this.canvas = null;
      this.bricks = [];
      this.ball   = null;
      this.paddle = null;

      this.spacePressed = this.leftPressed = this.upPressed = this.rightPressed = this.downPressed = this.zPressed = this.aPressed = null;
    }

    Game.prototype.main = function() {
      var moveMouse, _this = this;
      this.create_canvas();
      if (!this.config.use_NLGame || !NLGame.gameIsReplay) {
        this.add_key_observers();
        moveMouse = function(event) {
          var x, y;
          if (!event) {
            event = window.event;
            x = event.event.offsetX;
            y = event.event.offsetY;
          }
          else {
            x = event.pageX - _this.canvas.offsetLeft;
            y = event.pageY - _this.canvas.offsetTop;
          }
          return _this.paddle.x = x;
        };
        document.onmousemove = moveMouse;
      }
      if (this.config.use_NLGame) NLGame.updateMouse = function(x, y) { return _this.paddle.x = x; };
      return this.start_new_game();
    };

    Game.prototype.start_new_game = function() {
      var config;
      delete this.ball;
      delete this.paddle;
      delete this.bricks;
      if (this.config.use_NLGame) {
        NLGame.start();
        NLGame.gameData = {};
        NLGame.gameData.pause = false;
      }
      this.spawn_bricks();
      this.spawn_ball();
      config = { context: this.context, canvas: this.canvas, debug: this.config.debug, use_NLGame: this.config.use_NLGame };
      this.paddle = new Paddle(config);
      return this.update();
    };

    Game.prototype.spawn_bricks = function() {
      var brick, brick_colors, brick_columns, brick_height, brick_rows, brick_start_y, brick_width, config, x, xpos, y, ypos, _i, _results;
      this.bricks   = [];
      brick_start_y = 40;
      brick_width   = 20;
      brick_height  = 20;
      brick_rows    = 5;
      brick_columns = Math.round(this.canvas.width / brick_width);
      brick_colors  = ["hsl(  0, 100%, 50%)", "hsl( 60, 100%, 50%)", "hsl(120, 100%, 50%)", "hsl(180, 100%, 50%)", "hsl(240, 100%, 50%)", "hsl(300, 100%, 50%)"];
      _results      = [];
      for (y = _i = 0; 0 <= brick_rows ? _i <= brick_rows : _i >= brick_rows; y = 0 <= brick_rows ? ++_i : --_i) {
        _results.push((function() {
          var _j, _results1;
          _results1 = [];
          for (x = _j = 0; 0 <= brick_columns ? _j <= brick_columns : _j >= brick_columns; x = 0 <= brick_columns ? ++_j : --_j) {
            xpos = x * brick_width;
            ypos = y * brick_height + brick_start_y;
            config = {
              x: xpos,
              y: ypos,
              width: brick_width,
              height: brick_height,
              color: brick_colors[y],
              context: this.context,
              canvas: this.canvas,
              use_NLGame: this.config.use_NLGame
            };
            brick = new Brick(config);
            _results1.push(this.bricks.push(brick));
          }
          return _results1;
        }).call(this));
      }
      return _results;
    };

    Game.prototype.spawn_ball = function() {
      var config;
      config = {
        context: this.context,
        canvas: this.canvas,
        debug: this.config.debug,
        use_NLGame: this.config.use_NLGame,
        radius: 5,
        max_speed: 8,
        dx: 0,
        dy: 0
      };
      return this.ball = new Ball(config);
    };

    Game.prototype.reset = function() {
      this.terminate_run_loop = true;
      return this.clear_screen();
    };

    Game.prototype.update = function() {
      var callback, _this = this;
      callback = (function() { return _this.update(); });
      if (this.paddle.lives === 0) {
        if (this.config.use_NLGame) NLGame.gameData.pause = true;
        this.context.fillStyle = "rgba(255, 255, 255, 1)";
        this.context.font = "bold 70px sans-serif";
        this.context.fillText("GAME OVER", this.canvas.width / 2 - 210, this.canvas.height / 2 + 50);
        this.context.font = "bold 24px sans-serif";
        this.context.fillText("Press 'z' to play again.", this.canvas.width / 2 - 115, this.canvas.height / 2 + 100);
        if (this.zPressed) {
          this.start_new_game();
          return;
        }
        window.setTimeout(callback, 1000 / 30);
        return;
      }
      this.paddle.update(this.leftPressed, this.rightPressed);
      this.ball.update(this.paddle, this.bricks);
      if (this.ball.is_dead) {
        this.paddle.lives -= 1;
        this.ball.is_dead = false;
        if (this.paddle.lives > 0) {
          if (this.config.use_NLGame) NLGame.score("computer", (this.paddle.config.lives || 3) - this.paddle.lives);
          this.spawn_ball();
        }
      }
      this.draw();
      return window.setTimeout(callback, 1000 / 30);
    };

    Game.prototype.draw = function() {
      var brick, living_bricks, _i, _len, _ref;
      this.clear_screen();
      this.context.fillStyle = "rgba(0, 0, 0,1)";
      this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);
      living_bricks = 0;
      _ref = this.bricks;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        brick = _ref[_i];
        if (!brick.dead) {
          living_bricks += 1;
          brick.draw();
        }
      }
      if (living_bricks === 0) this.spawn_bricks();
      this.ball.draw();
      this.paddle.draw();
      this.context.fillStyle = "rgba(255, 0, 0, 1)";
      this.context.font = "bold 12px sans-serif";
      this.context.fillText("score: " + this.paddle.score, 5, 15);
      return this.context.fillText("lives: " + this.paddle.lives, 100, 15);
    };

    Game.prototype.create_canvas = function() {
      this.canvas = document.getElementsByTagName("canvas")[0];
      return this.context = this.canvas.getContext("2d");
    };

    Game.prototype.clear_screen = function() {
      this.context.fillStyle = "rgba(0, 0, 0, 1)";
      return this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
    };

    Game.prototype.add_key_observers = function() {
      var _this = this;

      document.addEventListener("keydown", function(e) {
        switch (e.keyCode) {
          case 32: return _this.spacePressed = true;
          case 37: return _this.leftPressed  = true;
          case 38: return _this.upPressed    = true;
          case 39: return _this.rightPressed = true;
          case 40: return _this.downPressed  = true;
          case 90: return _this.zPressed     = true;
          case 65: return _this.aPressed     = true;
        }
      }, false);

      return document.addEventListener("keyup", function(e) {
        switch (e.keyCode) {
          case 27: return _this.reset();
          case 32: return _this.spacePressed = false;
          case 37: return _this.leftPressed  = false;
          case 38: return _this.upPressed    = false;
          case 39: return _this.rightPressed = false;
          case 40: return _this.downPressed  = false;
          case 90: return _this.zPressed     = false;
          case 65: return _this.aPressed     = false;
        }
      }, false);
    };

    return Game;

  })();

  $(document).ready(function() {
    var nl_conf, NullDev_x_Konami;
    nl_conf = { debug: false, use_NLGame: typeof NLGame !== "undefined" && NLGame !== null };
    NullDev_x_Konami = new Game(nl_conf);
    return NullDev_x_Konami.main();
  });

}).call(this);


text:
package Amazon::EC2::Model::CreateSubnetRequest;

use base qw (Amazon::EC2::Model);

    #
    # Amazon::EC2::Model::CreateSubnetRequest
    #
    # Properties:
    #
    #
    # VpcId: string
    # CidrBlock: string
    # AvailabilityZone: string
    #
    #
    #
    sub new {
        my ($class, $data) = @_;
        my $self = {};
        $self->{_fields} = {

            VpcId => { FieldValue => undef, FieldType => "string"},
            CidrBlock => { FieldValue => undef, FieldType => "string"},
            AvailabilityZone => { FieldValue => undef, FieldType => "string"},
        };

        bless ($self, $class);
        if (defined $data) {
           $self->_fromHashRef($data);
        }

        return $self;
    }

    sub getVpcId {
        return shift->{_fields}->{VpcId}->{FieldValue};
    }

    sub setVpcId {
        my ($self, $value) = @_;

        $self->{_fields}->{VpcId}->{FieldValue} = $value;
        return $self;
    }

    sub withVpcId {
        my ($self, $value) = @_;
        $self->setVpcId($value);
        return $self;
    }

    sub isSetVpcId {
        return defined (shift->{_fields}->{VpcId}->{FieldValue});
    }

    sub getCidrBlock {
        return shift->{_fields}->{CidrBlock}->{FieldValue};
    }

    sub setCidrBlock {
        my ($self, $value) = @_;

        $self->{_fields}->{CidrBlock}->{FieldValue} = $value;
        return $self;
    }

    sub withCidrBlock {
        my ($self, $value) = @_;
        $self->setCidrBlock($value);
        return $self;
    }

    sub isSetCidrBlock {
        return defined (shift->{_fields}->{CidrBlock}->{FieldValue});
    }

    sub getAvailabilityZone {
        return shift->{_fields}->{AvailabilityZone}->{FieldValue};
    }

    sub setAvailabilityZone {
        my ($self, $value) = @_;

        $self->{_fields}->{AvailabilityZone}->{FieldValue} = $value;
        return $self;
    }

    sub withAvailabilityZone {
        my ($self, $value) = @_;
        $self->setAvailabilityZone($value);
        return $self;
    }

    sub isSetAvailabilityZone {
        return defined (shift->{_fields}->{AvailabilityZone}->{FieldValue});
    }

1;


text:
package com.timeyang.amanda.core.jpa.repository;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

/**
 * 持有领域类的类型信息
 *
 * @author chaokunyang
 * @create 2017-04-17
 */
public abstract class AbstractDomainClassAwareRepository<T> {

    protected final Class<T> domainClass;

    public AbstractDomainClassAwareRepository(Class<T> domainClass) {
        this.domainClass = domainClass;
    }

    @SuppressWarnings("unchecked")
    protected AbstractDomainClassAwareRepository() {
        Type genericSuperclass = this.getClass().getGenericSuperclass();
        while (!(genericSuperclass instanceof ParameterizedType)) {
            if(!(genericSuperclass instanceof Class))
                //  If this Class represents either the Object class, an interface, a primitive type, or void, then null is returned.
                throw new IllegalStateException("Unable to determine type arguments, " +
                        "because generic superclass is neither parameterized type nor class.");
            if(genericSuperclass == AbstractDomainClassAwareRepository.class)
                // that is to say, don't specify type when extends AbstractDomainClassAwareRepository
                throw new IllegalStateException("Unable to determine type arguments, " +
                        "because no paramiterized generic superclass found.");

            genericSuperclass = ((Class) genericSuperclass).getGenericSuperclass();
        }

        ParameterizedType type = (ParameterizedType) genericSuperclass;
        Type[] arguments = type.getActualTypeArguments();
        this.domainClass = (Class<T>) arguments[0];
    }

}