text:
namespace chromeos {
namespace onc {

Normalizer::Normalizer(bool remove_recommended_fields)
    : remove_recommended_fields_(remove_recommended_fields) {
}

Normalizer::~Normalizer() {
}

scoped_ptr<base::DictionaryValue> Normalizer::NormalizeObject(
    const OncValueSignature* object_signature,
    const base::DictionaryValue& onc_object) {
  CHECK(object_signature != NULL);
  bool error = false;
  scoped_ptr<base::DictionaryValue> result =
      MapObject(*object_signature, onc_object, &error);
  DCHECK(!error);
  return result.Pass();
}

scoped_ptr<base::DictionaryValue> Normalizer::MapObject(
    const OncValueSignature& signature,
    const base::DictionaryValue& onc_object,
    bool* error) {
  scoped_ptr<base::DictionaryValue> normalized =
      Mapper::MapObject(signature, onc_object, error);

  if (normalized.get() == NULL)
    return scoped_ptr<base::DictionaryValue>();

  if (remove_recommended_fields_)
    normalized->RemoveWithoutPathExpansion(::onc::kRecommended, NULL);

  if (&signature == &kCertificateSignature)
    NormalizeCertificate(normalized.get());
  else if (&signature == &kEAPSignature)
    NormalizeEAP(normalized.get());
  else if (&signature == &kEthernetSignature)
    NormalizeEthernet(normalized.get());
  else if (&signature == &kIPsecSignature)
    NormalizeIPsec(normalized.get());
  else if (&signature == &kNetworkConfigurationSignature)
    NormalizeNetworkConfiguration(normalized.get());
  else if (&signature == &kOpenVPNSignature)
    NormalizeOpenVPN(normalized.get());
  else if (&signature == &kProxySettingsSignature)
    NormalizeProxySettings(normalized.get());
  else if (&signature == &kVPNSignature)
    NormalizeVPN(normalized.get());
  else if (&signature == &kWiFiSignature)
    NormalizeWiFi(normalized.get());

  return normalized.Pass();
}

namespace {

void RemoveEntryUnless(base::DictionaryValue* dict,
                       const std::string& path,
                       bool condition) {
  if (!condition)
    dict->RemoveWithoutPathExpansion(path, NULL);
}

}  // namespace

void Normalizer::NormalizeCertificate(base::DictionaryValue* cert) {
  using namespace ::onc::certificate;

  std::string type;
  cert->GetStringWithoutPathExpansion(::onc::certificate::kType, &type);
  RemoveEntryUnless(cert, kPKCS12, type == kClient);
  RemoveEntryUnless(cert, kTrustBits, type == kServer || type == kAuthority);
  RemoveEntryUnless(cert, kX509, type == kServer || type == kAuthority);
}

void Normalizer::NormalizeEthernet(base::DictionaryValue* ethernet) {
  using namespace ::onc::ethernet;

  std::string auth;
  ethernet->GetStringWithoutPathExpansion(kAuthentication, &auth);
  RemoveEntryUnless(ethernet, kEAP, auth == k8021X);
}

void Normalizer::NormalizeEAP(base::DictionaryValue* eap) {
  using namespace ::onc::eap;

  std::string clientcert_type;
  eap->GetStringWithoutPathExpansion(::onc::client_cert::kClientCertType,
                                     &clientcert_type);
  RemoveEntryUnless(eap,
                    ::onc::client_cert::kClientCertPattern,
                    clientcert_type == ::onc::client_cert::kPattern);
  RemoveEntryUnless(eap,
                    ::onc::client_cert::kClientCertRef,
                    clientcert_type == ::onc::client_cert::kRef);

  std::string outer;
  eap->GetStringWithoutPathExpansion(kOuter, &outer);
  RemoveEntryUnless(eap, kAnonymousIdentity,
                    outer == kPEAP || outer == kEAP_TTLS);
  RemoveEntryUnless(eap, kInner,
                    outer == kPEAP || outer == kEAP_TTLS || outer == kEAP_FAST);
}

void Normalizer::NormalizeIPsec(base::DictionaryValue* ipsec) {
  using namespace ::onc::ipsec;

  std::string auth_type;
  ipsec->GetStringWithoutPathExpansion(kAuthenticationType, &auth_type);
  RemoveEntryUnless(
      ipsec, ::onc::client_cert::kClientCertType, auth_type == kCert);
  RemoveEntryUnless(ipsec, kServerCARef, auth_type == kCert);
  RemoveEntryUnless(ipsec, kPSK, auth_type == kPSK);
  RemoveEntryUnless(ipsec, ::onc::vpn::kSaveCredentials, auth_type == kPSK);

  std::string clientcert_type;
  ipsec->GetStringWithoutPathExpansion(::onc::client_cert::kClientCertType,
                                       &clientcert_type);
  RemoveEntryUnless(ipsec,
                    ::onc::client_cert::kClientCertPattern,
                    clientcert_type == ::onc::client_cert::kPattern);
  RemoveEntryUnless(ipsec,
                    ::onc::client_cert::kClientCertRef,
                    clientcert_type == ::onc::client_cert::kRef);

  int ike_version = -1;
  ipsec->GetIntegerWithoutPathExpansion(kIKEVersion, &ike_version);
  RemoveEntryUnless(ipsec, kEAP, ike_version == 2);
  RemoveEntryUnless(ipsec, kGroup, ike_version == 1);
  RemoveEntryUnless(ipsec, kXAUTH, ike_version == 1);
}

void Normalizer::NormalizeNetworkConfiguration(base::DictionaryValue* network) {
  bool remove = false;
  network->GetBooleanWithoutPathExpansion(::onc::kRemove, &remove);
  if (remove) {
    network->RemoveWithoutPathExpansion(::onc::network_config::kStaticIPConfig,
                                        NULL);
    network->RemoveWithoutPathExpansion(::onc::network_config::kName, NULL);
    network->RemoveWithoutPathExpansion(::onc::network_config::kProxySettings,
                                        NULL);
    network->RemoveWithoutPathExpansion(::onc::network_config::kType, NULL);
    // Fields dependent on kType are removed afterwards, too.
  }

  std::string type;
  network->GetStringWithoutPathExpansion(::onc::network_config::kType, &type);
  RemoveEntryUnless(network,
                    ::onc::network_config::kEthernet,
                    type == ::onc::network_type::kEthernet);
  RemoveEntryUnless(
      network, ::onc::network_config::kVPN, type == ::onc::network_type::kVPN);
  RemoveEntryUnless(network,
                    ::onc::network_config::kWiFi,
                    type == ::onc::network_type::kWiFi);

  std::string ip_address_config_type, name_servers_config_type;
  network->GetStringWithoutPathExpansion(
      ::onc::network_config::kIPAddressConfigType, &ip_address_config_type);
  network->GetStringWithoutPathExpansion(
      ::onc::network_config::kNameServersConfigType, &name_servers_config_type);
  RemoveEntryUnless(
      network, ::onc::network_config::kStaticIPConfig,
      (ip_address_config_type == ::onc::network_config::kIPConfigTypeStatic) ||
          (name_servers_config_type ==
           ::onc::network_config::kIPConfigTypeStatic));
  // TODO(pneubeck): Remove fields from StaticIPConfig not specified by
  // IP[Address|Nameservers]ConfigType.
}

void Normalizer::NormalizeOpenVPN(base::DictionaryValue* openvpn) {
  std::string clientcert_type;
  openvpn->GetStringWithoutPathExpansion(::onc::client_cert::kClientCertType,
                                         &clientcert_type);
  RemoveEntryUnless(openvpn,
                    ::onc::client_cert::kClientCertPattern,
                    clientcert_type == ::onc::client_cert::kPattern);
  RemoveEntryUnless(openvpn,
                    ::onc::client_cert::kClientCertRef,
                    clientcert_type == ::onc::client_cert::kRef);

  std::string user_auth_type;
  openvpn->GetStringWithoutPathExpansion(
      ::onc::openvpn::kUserAuthenticationType, &user_auth_type);
  RemoveEntryUnless(
      openvpn,
      ::onc::openvpn::kPassword,
      user_auth_type == ::onc::openvpn_user_auth_type::kPassword ||
          user_auth_type == ::onc::openvpn_user_auth_type::kPasswordAndOTP);
  RemoveEntryUnless(
      openvpn,
      ::onc::openvpn::kOTP,
      user_auth_type == ::onc::openvpn_user_auth_type::kOTP ||
          user_auth_type == ::onc::openvpn_user_auth_type::kPasswordAndOTP);
}

void Normalizer::NormalizeProxySettings(base::DictionaryValue* proxy) {
  using namespace ::onc::proxy;

  std::string type;
  proxy->GetStringWithoutPathExpansion(::onc::proxy::kType, &type);
  RemoveEntryUnless(proxy, kManual, type == kManual);
  RemoveEntryUnless(proxy, kExcludeDomains, type == kManual);
  RemoveEntryUnless(proxy, kPAC, type == kPAC);
}

void Normalizer::NormalizeVPN(base::DictionaryValue* vpn) {
  using namespace ::onc::vpn;

  std::string type;
  vpn->GetStringWithoutPathExpansion(::onc::vpn::kType, &type);
  RemoveEntryUnless(vpn, kOpenVPN, type == kOpenVPN);
  RemoveEntryUnless(vpn, kIPsec, type == kIPsec || type == kTypeL2TP_IPsec);
  RemoveEntryUnless(vpn, kL2TP, type == kTypeL2TP_IPsec);
  RemoveEntryUnless(vpn, kThirdPartyVpn, type == kThirdPartyVpn);
}

void Normalizer::NormalizeWiFi(base::DictionaryValue* wifi) {
  using namespace ::onc::wifi;

  std::string security;
  wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security);
  RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP);
  RemoveEntryUnless(wifi, kPassphrase,
                    security == kWEP_PSK || security == kWPA_PSK);
  FillInHexSSIDField(wifi);
}

}  // namespace onc
}  // namespace chromeos

redpajama_set_name: RedPajamaGithub


text:
package com.jmb.springfactory.controller.api;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jmb.springfactory.exceptions.NotFoundException;
import com.jmb.springfactory.exceptions.ServiceLayerException;
import com.jmb.springfactory.model.dto.IssueDto;
import com.jmb.springfactory.service.issue.IssueService;

@RestController
@RequestMapping("/issue")
public class IssueController {

  @Autowired
  private IssueService issueService;

  @PostMapping
  public IssueDto create(@Valid @RequestBody IssueDto dto) throws ServiceLayerException {
    String username = "";
    return issueService.save(dto, username);
  }

  @PutMapping("/{id}")
  public void update(@Valid @RequestBody IssueDto dto, @PathVariable("id") Integer id) throws ServiceLayerException {
    issueService.update(dto, id);
  }

  @DeleteMapping("/{id}")
  public void delete(@PathVariable("id") Integer id) {
    issueService.delete(id);
  }

  @GetMapping("/{id}")
  public IssueDto findOne(@PathVariable("id") Integer id) throws NotFoundException {
    return issueService.findOne(id);
  }
}


text:
Champaign-Urbana's unofficial CUMTD Android app!

**[Install on Google Play](https://play.google.com/store/apps/details?id=com.teamparkin.mtdapp)**

*Note:* Version numbers for Android tools, gradle, etc. were hastily increased before dumping the project to GitHub.
Therefore, some of the functionality of this code may be different/broken compared to the version currently on the Play Store. This will be fixed.

## Development

### API Keys

CU Bus Guide uses several APIs.

- [Google Maps Android API v2](https://developers.google.com/maps/documentation/android/)
- [Google Places API](https://developers.google.com/places/)
- [Google Street View Image API](https://developers.google.com/maps/documentation/streetview/)
- [Champaign-Urbana Mass Transit District API](https://developer.cumtd.com/)

You'll need API keys for each of these APIs to develop.
After obtaining your API keys, you'll need to add them to the project.

1. An example keys file is found in [api_keys.xml.example](api_keys.xml.example).
2. Copy this file to 2 locations:
  1. `main/src/debug/res/values/api_keys.xml`
  2. `main/src/main/res/values/api_keys.xml`
3. Replace the sample keys with your API keys in **each** `api_keys.xml` file.


text:
(function () {

	'use strict';

	var lights;

	QUnit.module( "Lights - DirectionalLight", {

		beforeEach: function() {

			lights = [

				new THREE.DirectionalLight( 0xaaaaaa ),
				new THREE.DirectionalLight( 0xaaaaaa, 0.8 ),

			];

		}

	});

	QUnit.test( "standard light tests", function( assert ) {

		runStdLightTests( assert, lights );

	});

})();


text:
package com.android.cards.view;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;

import java.util.HashMap;

import com.android.cards.R;
import com.android.cards.internal.Card;
import com.android.cards.internal.CardExpand;
import com.android.cards.internal.CardHeader;
import com.android.cards.internal.CardThumbnail;
import com.android.cards.internal.ViewToClickToExpand;
import com.android.cards.view.component.CardHeaderView;
import com.android.cards.view.component.CardThumbnailView;
import com.android.cards.view.listener.SwipeDismissViewTouchListener;

/**
 * Card view
 *

 * Use an XML layout file to display it.
 *

 * First, you need an XML layout that will display the Card.
 *

 *  <com.android.cards.view.CardView
 *     android:id="@+id/carddemo_example_card3"
 *     android:layout_width="match_parent"
 *     android:layout_height="wrap_content"
 *     android:layout_marginLeft="12dp"
 *     android:layout_marginRight="12dp"
 *     android:layout_marginTop="12dp"/>
 *

 * Then create a model:
 *

 *
 *     //Create a Card
 *     Card card = new Card(getContext());
 *
 *     //Create a CardHeader
 *     CardHeader header = new CardHeader(getContext());
 *
 *     //Add Header to card
 *     card.addCardHeader(header);
 *
 *

 * Last get a reference to the `CardView` from your code, and set your `Card.
 *

 *     //Set card in the cardView
 *     CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo);
 *
 *     cardView.setCard(card);
 *

 * You can easily build your layout.
 *

 * The quickest way to start with this would be to copy one of this files and create your layout.
 * Then you can inflate your layout in the `CardView` using the attr: `card:card_layout_resourceID="@layout/my_layout`
 *  Example:
 *

 *      <com.android.cards.view.CardView
 *       android:id="@+id/carddemo_thumb_url"
 *        android:layout_width="match_parent"
 *        android:layout_height="wrap_content"
 *        android:layout_marginLeft="12dp"
 *        android:layout_marginRight="12dp"
 *        card:card_layout_resourceID="@layout/card_thumbnail_layout"
 *        android:layout_marginTop="12dp"/>
 *

 *

 * @author Gabriele Mariotti (gabri.mariotti@gmail.com)
 */
public class CardView extends BaseCardView {

    //--------------------------------------------------------------------------
    //
    //--------------------------------------------------------------------------

    /**
     * {@link CardHeader} model
     */
    protected CardHeader mCardHeader;

    /**
     * {@link CardThumbnail} model
     */
    protected CardThumbnail mCardThumbnail;

    /**
     * {@link CardExpand} model
     */
    protected CardExpand mCardExpand;

    //--------------------------------------------------------------------------
    // Layout
    //--------------------------------------------------------------------------

    /**
     *  Main Layout
     */
    protected View mInternalMainCardLayout;

    /**
     *  Content Layout
     */
    protected View mInternalContentLayout;

    /**
     * Inner View.
     */
    protected View mInternalInnerView;

    /**
     *  Hidden layout used by expand/collapse action
     */
    protected View mInternalExpandLayout;

    /**
     * Expand Inner view
     */
    protected View mInternalExpandInnerView;

    /** Animator to expand/collapse */
    protected Animator mExpandAnimator;

    /**
     * Listener invoked when Expand Animator starts
     * It is used internally
     */
    protected OnExpandListAnimatorListener mOnExpandListAnimatorListener;

    //--------------------------------------------------------------------------
    // Constructor
    //--------------------------------------------------------------------------

    public CardView(Context context) {
        super(context);
    }

    public CardView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CardView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    //--------------------------------------------------------------------------
    // Init
    //--------------------------------------------------------------------------

    /**
     * Init custom attrs.
     *
     * @param attrs
     * @param defStyle
     */
    protected void initAttrs(AttributeSet attrs, int defStyle) {

        card_layout_resourceID = R.layout.card_layout;

        TypedArray a = getContext().getTheme().obtainStyledAttributes(
                attrs, R.styleable.card_options, defStyle, defStyle);

        try {
            card_layout_resourceID = a.getResourceId(R.styleable.card_options_card_layout_resourceID, this.card_layout_resourceID);
        } finally {
            a.recycle();
        }
    }

    //--------------------------------------------------------------------------
    // Card
    //--------------------------------------------------------------------------

    /**
     * Add a {@link Card}.
     * It is very important to set all values and all components before launch this method.
     *
     * @param card {@link Card} model
     */
    @Override
    public void setCard(Card card){

        super.setCard(card);
        if (card!=null){
            mCardHeader=card.getCardHeader();
            mCardThumbnail=card.getCardThumbnail();
            mCardExpand=card.getCardExpand();
        }

        //Retrieve all IDs
        if (!isRecycle()){
            retrieveLayoutIDs();
        }

        //Build UI
        buildUI();
    }

    /**
     * Refreshes the card content (it doesn't inflate layouts again)
     *
     * @param card
     */
    public void refreshCard(Card card) {
        mIsRecycle=true;
        setCard(card);
        mIsRecycle=false;
    }

    /**
     * Refreshes the card content and replaces the inner layout elements (it inflates layouts again!)
     *
     * @param card
     */
    public void replaceCard(Card card) {
        mForceReplaceInnerLayout=true;
        refreshCard(card);
        mForceReplaceInnerLayout=false;
    }

    //--------------------------------------------------------------------------
    // Setup methods
    //--------------------------------------------------------------------------

    @Override
    protected void buildUI() {

        super.buildUI();

        mCard.setCardView(this);

        //Setup Header view
        setupHeaderView();

        //Setup Main View
        setupMainView();

        //setup Thumbnail
        setupThumbnailView();

        //Setup Expand View
        setupExpandView();

        //Setup Listeners
        setupListeners();

        //Setup Expand Action
        setupExpandAction();

        //Setup Drawable Resources
        setupDrawableResources();
    }

    /**
     * Retrieve all Layouts IDs
     */
    @Override
    protected void retrieveLayoutIDs(){

        super.retrieveLayoutIDs();

        //Main Layout
        mInternalMainCardLayout = (View) findViewById(R.id.card_main_layout);

        //Get HeaderLayout
        mInternalHeaderLayout = (CardHeaderView) findViewById(R.id.card_header_layout);

        //Get ExpandHiddenView
        mInternalExpandLayout = (View) findViewById(R.id.card_content_expand_layout);

        //Get ContentLayout
        mInternalContentLayout = (View) findViewById(R.id.card_main_content_layout);

        //Get ThumbnailLayout
        mInternalThumbnailLayout = (CardThumbnailView) findViewById(R.id.card_thumbnail_layout);
    }

    /**
     * Setup Header View
     */
    protected void setupHeaderView(){

        if (mCardHeader!=null){

            if (mInternalHeaderLayout !=null){
                mInternalHeaderLayout.setVisibility(VISIBLE);

                //Set recycle value (very important in a ListView)
                mInternalHeaderLayout.setRecycle(isRecycle());
                mInternalHeaderLayout.setForceReplaceInnerLayout(isForceReplaceInnerLayout());
                //Add Header View
                mInternalHeaderLayout.addCardHeader(mCardHeader);

            }
        }else{
            //No header. Hide layouts
            if (mInternalHeaderLayout !=null){
                mInternalHeaderLayout.setVisibility(GONE);
                //mInternalExpandLayout.setVisibility(View.GONE);

                if (isForceReplaceInnerLayout()){
                    mInternalHeaderLayout.addCardHeader(null);
                    //mInternalHeaderLayout.removeAllViews();
                }
            }
        }
    }

    /**
     * Setup the Main View
     */
    protected void setupMainView(){
        if (mInternalContentLayout !=null){

            ViewGroup mParentGroup=null;
            try{
                mParentGroup = (ViewGroup) mInternalContentLayout;
            }catch (Exception e){
                setRecycle(false);
            }

            //Check if view can be recycled
            //It can happen in a listView, and improves performances
            if (!isRecycle() || isForceReplaceInnerLayout()){

                if (isForceReplaceInnerLayout() && mInternalContentLayout!=null && mInternalInnerView!=null)
                    ((ViewGroup)mInternalContentLayout).removeView(mInternalInnerView);

                mInternalInnerView=mCard.getInnerView(getContext(), (ViewGroup) mInternalContentLayout);
            }else{
                //View can be recycled.
                //Only setup Inner Elements
                if (mCard.getInnerLayout()>-1)
                    mCard.setupInnerViewElements(mParentGroup,mInternalInnerView);
            }
        }
    }

    /**
     * Setup the Thumbnail View
     */
    protected void setupThumbnailView() {
        if (mInternalThumbnailLayout!=null){
            if (mCardThumbnail!=null){
                mInternalThumbnailLayout.setVisibility(VISIBLE);
                mInternalThumbnailLayout.setRecycle(isRecycle());
                mInternalThumbnailLayout.setForceReplaceInnerLayout(isForceReplaceInnerLayout());
                mInternalThumbnailLayout.addCardThumbnail(mCardThumbnail);
            }else{
                mInternalThumbnailLayout.setVisibility(GONE);
            }
        }
    }

    /**
     * Setup Drawable Resources
     */
    protected void setupDrawableResources() {

        //Card
        if (mCard!=null){
            if (mCard.getBackgroundResourceId()!=0){
                changeBackgroundResourceId(mCard.getBackgroundResourceId());
            }else if (mCard.getBackgroundResource()!=null){
                changeBackgroundResource(mCard.getBackgroundResource());
            }
        }
    }

    //--------------------------------------------------------------------------
    // Listeners
    //--------------------------------------------------------------------------

    protected void setupExpandAction(){

        //Config ExpandLayout and its animation
        if ( (mInternalExpandLayout !=null && mCardHeader!=null && mCardHeader.isButtonExpandVisible() ) ||
                mCard.getViewToClickToExpand()!=null  ){

            //Create the expand/collapse animator
            mInternalExpandLayout.getViewTreeObserver().addOnPreDrawListener(
                    new ViewTreeObserver.OnPreDrawListener() {

                        @Override
                        public boolean onPreDraw() {
                            mInternalExpandLayout.getViewTreeObserver().removeOnPreDrawListener(this);
                            //mInternalExpandLayout.setVisibility(View.GONE);

                            View parent = (View) mInternalExpandLayout.getParent();
                            final int widthSpec = View.MeasureSpec.makeMeasureSpec(
                                    parent.getMeasuredWidth() - parent.getPaddingLeft()
                                            - parent.getPaddingRight(), View.MeasureSpec.AT_MOST);
                            final int heightSpec = View.MeasureSpec.makeMeasureSpec(
                                    LayoutParams.WRAP_CONTENT, View.MeasureSpec.AT_MOST);

                            mInternalExpandLayout.measure(widthSpec, heightSpec);

                            final int widthSpecCard = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
                            final int heightSpecCard = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
                            mCollapsedHeight = getMeasuredHeight();

                            mExpandAnimator = createSlideAnimator(0, mInternalExpandLayout.getMeasuredHeight());
                            return true;
                        }
                    });
        }

        //Setup action and callback
        setupExpandCollapseActionListener();
    }

    /**
     * Setup All listeners
     */
    @SuppressWarnings("deprecation")
    @SuppressLint("NewApi")
    protected void setupListeners(){

        //Swipe listener
        if (mCard.isSwipeable()){
            this.setOnTouchListener(new SwipeDismissViewTouchListener(this, mCard,new SwipeDismissViewTouchListener.DismissCallbacks() {
                @Override
                public boolean canDismiss(Card card) {
                    return card.isSwipeable();
                }

                @Override
                public void onDismiss(CardView cardView, Card card) {
                    final ViewGroup vg = (ViewGroup)(cardView.getParent());
                    if (vg!=null){
                        vg.removeView(cardView);
                        card.onSwipeCard();
                    }
                }
            }));
        }else{
            this.setOnTouchListener(null);
        }

        //OnClick listeners and partial listener

        //Reset Partial Listeners
        resetPartialListeners();

        if (mCard.isClickable()){
            //Set the onClickListener
            if(!mCard.isMultiChoiceEnabled()){
                if (mCard.getOnClickListener() != null) {
                    this.setOnClickListener(new OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            if (mCard.getOnClickListener()!=null)
                                mCard.getOnClickListener().onClick(mCard,v);
                        }
                    });

                    //Prevent multiple events
                    //if (!mCard.isSwipeable() && mCard.getOnSwipeListener() == null) {
                    //    this.setClickable(true);
                    //}

                }else{
                    HashMap<Integer,Card.OnCardClickListener> mMultipleOnClickListner=mCard.getMultipleOnClickListener();
                    if (mMultipleOnClickListner!=null && !mMultipleOnClickListner.isEmpty()){

                        for (int key:mMultipleOnClickListner.keySet()){
                            View viewClickable= decodeAreaOnClickListener(key);
                            final Card.OnCardClickListener mListener=mMultipleOnClickListner.get(key);
                            if (viewClickable!=null){
                                //Add listener to this view
                                viewClickable.setOnClickListener(new OnClickListener() {
                                    @Override
                                    public void onClick(View v) {
                                        //Callback to card listener
                                        if (mListener!=null)
                                            mListener.onClick(mCard,v);
                                    }
                                });

                                //Add Selector to this view
                                if (key > Card.CLICK_LISTENER_ALL_VIEW) {
                                    if (Build.VERSION.SDK_INT >= 16){
                                        viewClickable.setBackground(getResources().getDrawable(R.drawable.card_selector));
                                    } else {
                                        viewClickable.setBackgroundDrawable(getResources().getDrawable(R.drawable.card_selector));
                                    }
                                }
                            }
                        }
                    }else{
                        //There aren't listners
                        this.setClickable(false);
                    }
                }
            }
        }else{
            this.setClickable(false);
        }

        //LongClick listener
        if(mCard.isLongClickable()){
            this.setOnLongClickListener(new OnLongClickListener() {
                @Override
                public boolean onLongClick(View v) {
                    if (mCard.getOnLongClickListener()!=null)
                        return mCard.getOnLongClickListener().onLongClick(mCard,v);
                    return false;
                }
            });
        }else{
            this.setLongClickable(false);
        }
    }

    /**
     * Reset all partial listeners
     */
    protected void resetPartialListeners() {
        View viewClickable= decodeAreaOnClickListener(Card.CLICK_LISTENER_HEADER_VIEW);
        if (viewClickable!=null)
            viewClickable.setClickable(false);

        viewClickable= decodeAreaOnClickListener(Card.CLICK_LISTENER_THUMBNAIL_VIEW);
        if (viewClickable!=null)
            viewClickable.setClickable(false);

        viewClickable= decodeAreaOnClickListener(Card.CLICK_LISTENER_CONTENT_VIEW);
        if (viewClickable!=null)
            viewClickable.setClickable(false);
    }

    /**
     *
     * @param area
     * @return
     */
    protected View decodeAreaOnClickListener(int area){

        if (area<Card.CLICK_LISTENER_ALL_VIEW && area>Card.CLICK_LISTENER_CONTENT_VIEW)
            return null;

        View view = null;

        switch (area){
            case Card.CLICK_LISTENER_ALL_VIEW :
                view=this;
                break;
            case Card.CLICK_LISTENER_HEADER_VIEW :
                view=mInternalHeaderLayout;
                break;
            case Card.CLICK_LISTENER_THUMBNAIL_VIEW:
                view=mInternalThumbnailLayout;
                break;
            case Card.CLICK_LISTENER_CONTENT_VIEW:
                view=mInternalContentLayout;
                break;
            default:
                break;
        }
        return view;
    }

    //--------------------------------------------------------------------------
    // Expandable Actions and Listeners
    //--------------------------------------------------------------------------

    protected int mCollapsedHeight;
    protected int mExpandedHeight=-1;

    /**
     * Add ClickListener to expand and collapse hidden view
     */
    protected void setupExpandCollapseActionListener() {
        if (mInternalExpandLayout != null) {
            mInternalExpandLayout.setVisibility(View.GONE);

            ViewToClickToExpand viewToClickToExpand = null;

            if (mCardHeader != null && mCardHeader.isButtonExpandVisible()) {

                viewToClickToExpand = ViewToClickToExpand.builder()
                        .setupView(mInternalHeaderLayout.getImageButtonExpand())
                        .highlightView(true);

            } else if (mCard.getViewToClickToExpand() != null) {

                viewToClickToExpand = mCard.getViewToClickToExpand();
            }

            if (viewToClickToExpand != null) {

                TitleViewOnClickListener titleViewOnClickListener = new TitleViewOnClickListener(mInternalExpandLayout, mCard, viewToClickToExpand.isViewToSelect());

                if (mCardHeader!=null && mCardHeader.isButtonExpandVisible() && mInternalHeaderLayout != null) {
                    mInternalHeaderLayout.setOnClickExpandCollapseActionListener(titleViewOnClickListener);
                }

                View viewToClick = viewToClickToExpand.getViewToClick();
                if (viewToClick != null)
                    viewToClick.setOnClickListener(titleViewOnClickListener);

                if (isExpanded()) {
                    //Make layout visible and button selected
                    mInternalExpandLayout.setVisibility(View.VISIBLE);
                    if (viewToClick != null) {
                        if (viewToClickToExpand.isViewToSelect())
                            viewToClick.setSelected(true);
                    }
                } else {
                    //Make layout hidden and button not selected
                    mInternalExpandLayout.setVisibility(View.GONE);
                    if (viewToClick != null) {
                        if (viewToClickToExpand.isViewToSelect())
                            viewToClick.setSelected(false);
                    }
                }
            }

        }
    }

    /**
     * Setup Expand View
     */
    protected void setupExpandView(){
        if (mInternalExpandLayout!=null && mCardExpand!=null){

            //Check if view can be recycled
            //It can happen in a listView, and improves performances
            if (!isRecycle() || isForceReplaceInnerLayout()){

                if (isForceReplaceInnerLayout() && mInternalExpandLayout!=null && mInternalExpandInnerView!=null)
                    ((ViewGroup)mInternalExpandLayout).removeView(mInternalExpandInnerView);

                mInternalExpandInnerView=mCardExpand.getInnerView(getContext(),(ViewGroup) mInternalExpandLayout);
            }else{
                //View can be recycled.
                //Only setup Inner Elements
                if (mCardExpand.getInnerLayout()>-1)
                    mCardExpand.setupInnerViewElements((ViewGroup)mInternalExpandLayout,mInternalExpandInnerView);
            }

            ViewGroup.LayoutParams layoutParams = mInternalExpandLayout.getLayoutParams();
            layoutParams.height = LayoutParams.WRAP_CONTENT;
            mInternalExpandLayout.setLayoutParams(layoutParams);
        }
    }

    /**
     * Listener to expand/collapse hidden Expand Layout
     * It starts animation
     */
    protected class TitleViewOnClickListener implements View.OnClickListener {

        private View mContentParent;
        private Card mCard;
        private boolean viewToSelect=true;

        private TitleViewOnClickListener(View contentParent,Card card) {
            this (contentParent, card,true);
        }

        private TitleViewOnClickListener(View contentParent,Card card,boolean viewToSelect) {
            this.mContentParent = contentParent;
            this.mCard=card;
            this.viewToSelect=viewToSelect;
        }

        @Override
        public void onClick(View view) {
            boolean isVisible = mContentParent.getVisibility() == View.VISIBLE;
            if (isVisible) {
                animateCollapsing();
                if (viewToSelect)
                    view.setSelected(false);
            } else {
                animateExpanding();
                if (viewToSelect)
                    view.setSelected(true);
            }
        }

        /**
         * Expanding animator.
         */
        private void animateExpanding() {

            if (getOnExpandListAnimatorListener()!=null){
                //List Animator
                getOnExpandListAnimatorListener().onExpandStart(mCard.getCardView(), mContentParent);
            }else{
                //Std animator
                mContentParent.setVisibility(View.VISIBLE);
                mExpandAnimator.addListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        mCard.setExpanded(true);
                        //Callback
                        if (mCard.getOnExpandAnimatorEndListener()!=null)
                            mCard.getOnExpandAnimatorEndListener().onExpandEnd(mCard);
                    }
                });
                mExpandAnimator.start();
            }
        }

        /**
         * Collapse animator
         */
        private void animateCollapsing() {

            if (getOnExpandListAnimatorListener()!=null){
                //There is a List Animator.
                getOnExpandListAnimatorListener().onCollapseStart(mCard.getCardView(), mContentParent);
            }else{
                //Std animator
                int origHeight = mContentParent.getHeight();

                ValueAnimator animator = createSlideAnimator(origHeight, 0);
                animator.addListener(new Animator.AnimatorListener() {
                    @Override
                    public void onAnimationStart(Animator animator) {
                    }

                    @Override
                    public void onAnimationEnd(Animator animator) {
                        mContentParent.setVisibility(View.GONE);
                        mCard.setExpanded(false);
                        //Callback
                        if (mCard.getOnCollapseAnimatorEndListener()!=null)
                            mCard.getOnCollapseAnimatorEndListener().onCollapseEnd(mCard);
                    }

                    @Override
                    public void onAnimationCancel(Animator animator) {
                    }

                    @Override
                    public void onAnimationRepeat(Animator animator) {
                    }
                });
                animator.start();
            }
        }
    }

    /**
     * Create the Slide Animator invoked when the expand/collapse button is clicked
     */
    protected ValueAnimator createSlideAnimator(int start, int end) {
        ValueAnimator animator = ValueAnimator.ofInt(start, end);

        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                int value = (Integer) valueAnimator.getAnimatedValue();

                ViewGroup.LayoutParams layoutParams = mInternalExpandLayout.getLayoutParams();
                layoutParams.height = value;
                mInternalExpandLayout.setLayoutParams(layoutParams);
            }
        });
        return animator;
    }

    @Override
    protected void onSizeChanged(int xNew, int yNew, int xOld, int yOld)
    {
        super.onSizeChanged(xNew, yNew, xOld, yOld);
        mExpandedHeight = yNew;
    }

    // -------------------------------------------------------------
    //  OnExpandListAnimator Interface and Listener
    // -------------------------------------------------------------

    /**
     * Interface to listen any callbacks when expand/collapse animation starts
     */
    public interface OnExpandListAnimatorListener {
        public void onExpandStart(CardView viewCard,View expandingLayout);
        public void onCollapseStart(CardView viewCard,View expandingLayout);
    }

    /**
     * Returns the listener invoked when expand/collpase animation starts
     * It is used internally
     *
     * @return listener
     */
    public OnExpandListAnimatorListener getOnExpandListAnimatorListener() {
        return mOnExpandListAnimatorListener;
    }

    /**
     * Sets the listener invoked when expand/collapse animation starts
     * It is used internally. Don't override it.
     *
     * @param onExpandListAnimatorListener listener
     */
    public void setOnExpandListAnimatorListener(OnExpandListAnimatorListener onExpandListAnimatorListener) {
        this.mOnExpandListAnimatorListener = onExpandListAnimatorListener;
    }

    // -------------------------------------------------------------
    //  Bitmap export
    // -------------------------------------------------------------

    /**
     * Create a {@link android.graphics.Bitmap} from CardView
     * @return
     */
    public Bitmap createBitmap(){

        if (getWidth()<=0 && getHeight()<=0){
            int spec = MeasureSpec.makeMeasureSpec( 0,MeasureSpec.UNSPECIFIED);
            measure(spec,spec);
            layout(0, 0, getMeasuredWidth(), getMeasuredHeight());
        }

        Bitmap b = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
        Canvas c = new Canvas(b);
        draw(c);
        return b;
    }

    // -------------------------------------------------------------
    //  Getter and Setter
    // -------------------------------------------------------------

    /**
     * Returns the view used by Expand Layout
     *
     * @return {@link View} used by Expand Layout
     */
    public View getInternalExpandLayout() {
        return mInternalExpandLayout;
    }

    /**
     * FIXME
     * @return
     */
    public View getInternalContentLayout() {
        return mInternalContentLayout;
    }

    /**
     * FIXME
     * @return
     */
    public View getInternalInnerView() {
        return mInternalInnerView;
    }

    public int getCollapsedHeight() {
        return mCollapsedHeight;
    }

    public void setCollapsedHeight(int collapsedHeight) {
        mCollapsedHeight = collapsedHeight;
    }

    public int getExpandedHeight() {
        return mExpandedHeight;
    }

    public void setExpandedHeight(int expandedHeight) {
        mExpandedHeight = expandedHeight;
    }

    /**
     * Indicates if the card is expanded or collapsed
     *
     * @return true if the card is expanded
     */
    public boolean isExpanded() {
        if (mCard!=null){
               return mCard.isExpanded();
        }else
            return false;
    }

    /**
     * Sets the card as expanded or collapsed
     *
     * @param expanded  true if the card is expanded
     */
    public void setExpanded(boolean expanded) {
        if (mCard!=null){
            mCard.setExpanded(expanded);
        }
    }

    /**
     * Retrieves the InternalMainCardGlobalLayout.
     * Background style is applied here.
     *
     * @return
     */
    public View getInternalMainCardLayout() {
        return mInternalMainCardLayout;
    }

    /**
     * Changes dynamically the drawable resource to override the style of MainLayout.
     *
     * @param drawableResourceId drawable resource Id
     */
    public void changeBackgroundResourceId(int drawableResourceId) {
        if (drawableResourceId!=0){
            if (mInternalMainCardLayout!=null){
                mInternalMainCardLayout.setBackgroundResource(drawableResourceId);
            }
        }
    }

    /**
     * Changes dynamically the drawable resource to override the style of MainLayout.
     *
     * @param drawableResource drawable resource
     */
    public void changeBackgroundResource(Drawable drawableResource) {
        if (drawableResource!=null){
            if (mInternalMainCardLayout!=null){
                if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
                    mInternalMainCardLayout.setBackground(drawableResource);
                else
                    mInternalMainCardLayout.setBackgroundDrawable(drawableResource);
            }
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="/img/beaucoup/icon.ico" type="image/x-icon" />
    <title>Beaucoup Apparel - A Style For Every Journey</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/agency.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Beaucoup Apparel

                        Product

                        How To Order

                        Contact

Original From Bandung, Indonesia

Welcome To Our Workshop!

                Tell Me More

Products

These are our Masterpieces. Every item is crafted with precision

Brun Merveille

Merveille with Brown Colour

Vert Merveille

Merveille with Brown Colour

Bleu Merveille

Merveille with Navy Blue Colour

Gris Merveille

Merveille with Grey Colour

Emballage

Free this Canvas Bag for Every Purchase

How To Order

This is step by step for ordering in Beaucoup.

STEP 1

Select your order

Please kindly choose your order.

STEP 2

Confirm the stock

Please kindly contact us and enquire about your selection. We will confirm whether the item is ready or not.

STEP 3

Payment

After we confirm the item, we will tell you the price and our Bank Account. After you've paid, please kindly tell us and after that we will check the payment.

STEP 4

Shipping

We will ship your item after the payment in same day (if you pay before 12.00 mid day)

So

ORDER

NOW!

Contact

Please kindly contact us via this media

@SUY 1846 O

SUY = Alfabet; 1846 = Angka; O = Alfabet

0813 8038 8254

Either SMS or Whatsapp

bokuapparel@gmail.com

We will respond you as soon as posible

                    Copyright © Beaucoup Apparel 2015

Privacy Policy

Terms of Use

Brun Merveille

Merveille with Brown Colour

Merveille is our premier project. This bag's made from finest quality canvas. We crafted with precision.

                                How about the specification?

 li" >

Material : Cotton Canvas, Faux Leather, Suede Leather

Dimension: 36cm x 48cm x 20cm

Top zip flap close by marget snap and trimmed with double leather buckle

1 Laptop Sleeve, fit up 14 inch

2 Exterior front zip pocket

Leather Patch trimmed on the front

Price IDR 249.000

                            <button type="button" class="btn btn-primary" data-dismiss="modal"> Close</button>

Vert Merveille

Merveille with Green Colour

Merveille is our premier project. This bag's made from finest quality canvas. We crafted with precision.

                                How about the specification?

 li" >

Material : Cotton Canvas, Faux Leather, Suede Leather

Dimension: 36cm x 48cm x 20cm

Top zip flap close by marget snap and trimmed with double leather buckle

1 Laptop Sleeve, fit up 14 inch

2 Exterior front zip pocket

Leather Patch trimmed on the front

Price IDR 249.000

                            <button type="button" class="btn btn-primary" data-dismiss="modal"> Close Project</button>

Bleu Merveille

Merveille with Navy Blue Colour

Merveille is our premier project. This bag's made from finest quality canvas. We crafted with precision.

                                How about the specification?

 li" >

Material : Cotton Canvas, Faux Leather, Suede Leather

Dimension: 36cm x 48cm x 20cm

Top zip flap close by marget snap and trimmed with double leather buckle

1 Laptop Sleeve, fit up 14 inch

2 Exterior front zip pocket

Leather Patch trimmed on the front

Price IDR 249.000

                           <button type="button" class="btn btn-primary" data-dismiss="modal"> Close Project</button>

Gris Merveille

Merveille with Grey Colour

Merveille is our premier project. This bag's made from finest quality canvas. We crafted with precision.

                                How about the specification?

 li" >

Material : Cotton Canvas, Faux Leather, Suede Leather

Dimension: 36cm x 48cm x 20cm

Top zip flap close by marget snap and trimmed with double leather buckle

1 Laptop Sleeve, fit up 14 inch

2 Exterior front zip pocket

Leather Patch trimmed on the front

Price IDR 249.000

                            <button type="button" class="btn btn-primary" data-dismiss="modal"> Close Project</button>

Emballage

Canvas Bag for Packing

Emballage is our packing material. This bag's made from finest quality canvas. We crafted with precision.

                                Free for every purchase!

                            <button type="button" class="btn btn-primary" data-dismiss="modal"> Close Project</button>

Project Name

Lorem ipsum dolor sit amet consectetur.

Dreams is a free PSD web template built by Mathavan Jaya. Dreams is a modern one page web template designed for almost any purpose. It's a beautiful template that's designed with the Bootstrap framework in mind.

You can download the PSD template in this portfolio sample item at FreebiesXpress.com.

                            <button type="button" class="btn btn-primary" data-dismiss="modal"> Close Project</button>


text:
<?php

namespace Ft6k\Bundle\WpDoctrineBundle\EntityRepository;

use Ft6k\Bundle\WpDoctrineBundle\Entity\Term;
use Rb\Specification\Doctrine\SpecificationRepository;

/**
 * @author  Kyle Tucker <kyleatucker@gmail.com>
 */
class TermRepository extends SpecificationRepository
{
    /**
     * Get the parent of the given term.
     *
     * @param   Term  $term
     * @return  Term|null
     */
    public function getParentTerm(Term $term)
    {
        $taxonomy = $term->getTaxonomy();
        if ($taxonomy && $taxonomy->getParentTermId() !== 0) {
            return $this->find($taxonomy->getParentTermId());
        }

        return null;
    }
}


text:
package jp.ats.liverwort.jdbc.impl;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;

import jp.ats.liverwort.internal.U;
import jp.ats.liverwort.jdbc.Configure;
import jp.ats.liverwort.jdbc.LiPreparedStatement;
import jp.ats.liverwort.jdbc.LiResultSet;

/**
 * Liverwort が使用する {@link LiPreparedStatement} の標準実装クラスです。
 *
 * @author 千葉 哲嗣
 */
class ConcretePreparedStatement implements LiPreparedStatement {

	private final Configure config;

	private final PreparedStatement statement;

	/**
	 * インスタンスを生成します。
	 *
	 * @param statement {@link PreparedStatement}
	 */
	ConcretePreparedStatement(Configure config, PreparedStatement statement) {
		this.config = config;
		this.statement = statement;
	}

	@Override
	public void setBoolean(int parameterIndex, boolean x) {
		try {
			statement.setBoolean(parameterIndex, x);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setDouble(int parameterIndex, double x) {
		try {
			statement.setDouble(parameterIndex, x);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setFloat(int parameterIndex, float x) {
		try {
			statement.setFloat(parameterIndex, x);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setInt(int parameterIndex, int x) {
		try {
			statement.setInt(parameterIndex, x);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setLong(int parameterIndex, long x) {
		try {
			statement.setLong(parameterIndex, x);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setString(int parameterIndex, String x) {
		try {
			statement.setString(parameterIndex, x);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setTimestamp(int parameterIndex, Timestamp x) {
		try {
			statement.setTimestamp(parameterIndex, x);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setBigDecimal(int parameterIndex, BigDecimal x) {
		try {
			statement.setBigDecimal(parameterIndex, x);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setObject(int parameterIndex, Object x) {
		try {
			statement.setObject(parameterIndex, x);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setBinaryStream(int parameterIndex, InputStream stream, int length) {
		try {
			statement.setBinaryStream(parameterIndex, stream, length);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setCharacterStream(int parameterIndex, Reader reader, int length) {
		try {
			statement.setCharacterStream(parameterIndex, reader, length);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setBytes(int parameterIndex, byte[] x) {
		try {
			statement.setBytes(parameterIndex, x);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setBlob(int parameterIndex, Blob blob) {
		try {
			statement.setBlob(parameterIndex, blob);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setClob(int parameterIndex, Clob clob) {
		try {
			statement.setClob(parameterIndex, clob);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void setNull(int parameterIndex, int type) {
		try {
			statement.setNull(parameterIndex, type);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public LiResultSet executeQuery() {
		try {
			return new ConcreteResultSet(config, statement.executeQuery(), this);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public int executeUpdate() {
		try {
			return statement.executeUpdate();
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public boolean execute() {
		try {
			return statement.execute();
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public LiResultSet getResultSet() {
		try {
			return new ConcreteResultSet(config, statement.getResultSet(), this);
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public int getUpdateCount() {
		try {
			return statement.getUpdateCount();
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public boolean getMoreResults() {
		try {
			return statement.getMoreResults();
		} catch (SQLException e) {
			throw config.getErrorConverter().convert(e);
		}
	}

	@Override
	public void close() {
		U.close(statement);
	}

	@Override
	protected void finalize() {
		close();
	}
}


text:
<!DOCTYPE html>

	<meta charset="ISO-8859-1">
	<title>CRL Editor</title>
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.10/themes/default/style.min.css" />
	<link rel="stylesheet" href="/css/joint.css">
	<link rel="stylesheet" href="/css/resizable.css">
	<link rel="stylesheet" href="/css/crlEditor.css">
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/StephanWagner/jBox@v0.6.1/dist/jBox.all.min.css">

			<button id="FileMenuButton" class="dropbtn" onclick="crlDropdownMenu('FileDropdown')">
				File
			</button>

				New Domain
				Save Workspace
				Close Workspace
				Clear Workspace
				Open Workspace ...
				User Preferences ...
				Select Concept With ID ...
				Exit

			<button id="EditMenuButton" class="dropbtn" onclick="crlDropdownMenu('EditDropdown')">
				Edit
			</button>

				Undo
				Redo

			<button id="HelpMenuButton" class="dropbtn" onclick="crlDropdownMenu('HelpDropdown')">
				Help
			</button>

				Debug Settings ...
				Display Call Graphs ...

		Current Workspace:
		XXX

				Universe of Discourse

							Property
							Value

			Show Concept in Navigator
			Show Diagram Element in Navigator
			Show Owner
			Show Owned Concepts
			Show Referenced Concept
			Nullify Referenced Concept
			Show Abstract Concept
			Show Refined Concept
			Delete View
			Bring To Front
			Edit Format
			Copy Format
			Paste Format

			Close Diagram


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="Source to the Rust file `/home/jacob/.cargo/registry/src/github.com-1ecc6299db9ec823/ncollide_geometry-0.3.0/query/point_internal/point_support_map.rs`.">
    <meta name="keywords" content="rust, rustlang, rust-lang">

    <title>point_support_map.rs.html -- source</title>

    <link rel="stylesheet" type="text/css" href="../../../../normalize.css">
    <link rel="stylesheet" type="text/css" href="../../../../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../../../../main.css">

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options…"
                       type="search">

        </form>

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

use alga::linear::Translation;

use query::algorithms::gjk;
use query::algorithms::minkowski_sampling;
use query::algorithms::simplex::Simplex;
use query::algorithms::johnson_simplex::JohnsonSimplex;
use query::{PointQuery, PointProjection};
use shape::{SupportMap, Cylinder, Cone, Capsule, ConvexHull};
use math::{Point, Isometry};

/// Projects a point on a shape using the GJK algorithm.
pub fn support_map_point_projection<P, M, S, G>(m:       &M,
                                                shape:   &G,
                                                simplex: &mut S,
                                                point:   &P,
                                                solid:   bool)
                                                -> PointProjection<P>
    where P: Point,
          M: Isometry<P>,
          S: Simplex<P>,
          G: SupportMap<P, M> {
    let m = m.append_translation(&M::Translation::from_vector(-point.coordinates()).unwrap());

    let support_point = shape.support_point(&m, &-point.coordinates());

    simplex.reset(support_point);

    match gjk::project_origin(&m, shape, simplex) {
        Some(p) => {
            PointProjection::new(false, p + point.coordinates())
        },
        None => {
            let proj;

            // Fallback algorithm.
            // FIXME: we use the Minkowski Sampling for now, but this should be changed for the EPA
            // in the future.
            if !solid {
                match minkowski_sampling::project_origin(&m, shape, simplex) {
                    Some(p) => proj = p + point.coordinates(),
                    None    => proj = *point
                }
            }
            else {
                proj = *point
            }

            PointProjection::new(true, proj)
        }
    }
}

impl<P: Point, M: Isometry<P>> PointQuery<P, M> for Cylinder<P::Real> {
    #[inline]
    fn project_point(&self, m: &M, point: &P, solid: bool) -> PointProjection<P> {
        support_map_point_projection(m, self, &mut JohnsonSimplex::<P>::new_w_tls(), point, solid)
    }
}

impl<P: Point, M: Isometry<P>> PointQuery<P, M> for Cone<P::Real> {
    #[inline]
    fn project_point(&self, m: &M, point: &P, solid: bool) -> PointProjection<P> {
        support_map_point_projection(m, self, &mut JohnsonSimplex::<P>::new_w_tls(), point, solid)
    }
}

impl<P: Point, M: Isometry<P>> PointQuery<P, M> for Capsule<P::Real> {
    #[inline]
    fn project_point(&self, m: &M, point: &P, solid: bool) -> PointProjection<P> {
        support_map_point_projection(m, self, &mut JohnsonSimplex::<P>::new_w_tls(), point, solid)
    }
}

impl<P: Point, M: Isometry<P>> PointQuery<P, M> for ConvexHull<P> {
    #[inline]
    fn project_point(&self, m: &M, point: &P, solid: bool) -> PointProjection<P> {
        support_map_point_projection(m, self, &mut JohnsonSimplex::<P>::new_w_tls(), point, solid)
    }
}

Help

Keyboard Shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

+

Collapse/expand all sections

Search Tricks

                    Prefix searches with a type followed by a colon (e.g.
                    fn:) to restrict the search to a given type.

                    Accepted types are: fn, mod,
                    struct, enum,
                    trait, type, macro,
                    and const.

                    Search functions by type signature (e.g.
                    vec -> usize or * -> vec)


text:
const ical = require('ical-generator');
const cal = ical();

const event = cal.createEvent({
    start: new Date(),
    end: new Date(),
    summary: 'Example Event',
    description: 'It works ;)',
    organizer: 'Organizer\'s Name <organizer@example.com>',
    url: 'https://example.com'
});

// update event's description
event.description('It still works ;)');

cal.toString();


text:
namespace Sorting{

	std::vector<int> bubble_sort(std::vector<int> A);
	std::vector<int> selection_sort(std::vector<int> A);
	std::vector<int> insertion_sort(std::vector<int> A);
	std::vector<int> merge_sort(std::vector<int> A);
	std::vector<int> merge(std::vector<int> ALeft, std::vector<int> ARight);
	std::vector<int> quick_sort(std::vector<int> A, int left = 0, int right = -100);
	void quick_sort_in_place(std::vector<int>& A, int left = 0, int right = -100);
	int partition(std::vector<int>& A, int left, int right);
	std::vector<int> counting_sort(std::vector<int> A);
	std::vector<int> radix_sort(std::vector<int> A, int base = 10);
	std::vector<float> bucket_sort(std::vector<float> A);

	template<typename T>
	void print_vector(std::vector<T> A);
	template<typename T>
	void fill_vector(std::vector<T>& A, int length, T lower, T upper);
	template<typename T>
	bool is_sorted(std::vector<T> A);

}

// function to print out contents of the vector A
template<typename T>
void Sorting::print_vector(std::vector<T> A){
	for (int i = 0; i < A.size(); i++){
		std::cout << A[i] << " ";
	}
	std::cout << std::endl;
}

// function to fill a vector with random numbers
template<typename T>
void Sorting::fill_vector(std::vector<T>& A, int length, T lower, T upper){

	A.clear();
	T range = upper - lower;
	for (int i = 0; i < length; i++){
		T num = static_cast<T>( lower + (rand() / (RAND_MAX / range)) );
		A.push_back(num);
	}
}

// function to check if a vector is sorted
template<typename T>
bool Sorting::is_sorted(std::vector<T> A){
	for (int i = 1; i < A.size(); i++){
		if (A[i] < A[i-1]){
			return false;
		}
	}
	return true;
}

#endif


text:
**动态**

## 部署

```bash
$ kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
```

数据存放在 `/opt/local-path-provisioner`

## sc

```bash
$ kubectl get sc

local-path
```


text:
/* NOTE: This file is autogenerated, do not edit this file directly.*/

#import <TRCodegenSupportObjc/Marshaller.hh>
#import <TRChartsObjc/Range.h>
#import <TRCharts/Range.hpp>

namespace TRChartsObjc
{

	class RangeStructMarshaller : public CodegenSupportObjc::Marshaller<Charts::Range, id>
	{
	public:
		virtual Charts::Range marshall(const CodegenSupportObjc::StrongAnyPtr & in) const;

		virtual CodegenSupportObjc::StrongAnyPtr unmarshall(const Charts::Range & in) const;

		virtual Charts::Range marshallBoxed(const id & in) const;

		virtual id unmarshallBoxed(const Charts::Range & in) const;

		virtual void init(void) const;
	private:
	};
}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
	<item android:state_checked="true"
	      android:drawable="@xml/checked" />
	<item android:state_pressed="true"
	      android:drawable="@xml/checked" />
	<item android:drawable="@xml/unchecked" />
</selector>


text:
import React               from 'react';
import * as _authSel       from './state';
import {featureRoute,
        PRIORITY}          from 'feature-router';
import SignInVerifyScreen  from './comp/SignInVerifyScreen';
import SignInScreen        from './comp/SignInScreen';
import SplashScreen        from '../../util/comp/SplashScreen';

// ***
// *** The routes for this feature.
// ***

export default featureRoute({

  priority: PRIORITY.HIGH,

  content({fassets, appState}) {

    const user = _authSel.curUser(appState);

    // when user is FULLY signedIn/verified
    // ... allow down-stream features to route further (i.e. app-specific screens)
    if (user.isUserSignedIn()) {
      return null;
    }

    // when user is signed in BUT unverified
    // ... display email verification screen
    if (user.isUserSignedInUnverified()) {
      return <SignInVerifyScreen/>;
    }

    // ***
    // *** at this point we know user is unauthorized (either signed out, or in-transision)
    // ***

    // display interactive SignIn, when form is active (accomplished by our logic)
    if (_authSel.isSignInFormActive(appState)) {
      return <SignInScreen/>;
    }

    // display interactive SignUp, when form is active (acomplished by our logic)
    // TODO: check for signUpForm (WHEN SUPPORTED)

    // fallback: communicate route transition condition
    // NOTES:
    //  1) we MUST issue a route to prevent downstream feature visualization too early
    //  2) it can occur under the following conditions:
    //     a) a slow server-side sign-in process
    //        ... and so the message wording should NOT convey an error
    //     b) during transition between startup/auth features
    //        ... where logic is in the process of activating one of the auth form screens
    //        ... and so the message wording should NOT convey an error
    //     c) an error condition (say some change that impacts our route logic)
    //        ... this is an unexpected condition
    //        ... SO, we expose the user-status context in the message (for diagnostics)
    const msg = `authorization in progress (${user.getAuthStatus()})`;
    return <SplashScreen msg={msg}/>;
  },

});


text:
const router = require('express').Router()

module.exports = router

router.use((req, res, next) => {
  if (!req.session.pendingOrders) {
    req.session.pendingOrders = []
  }
  next()
})

router.route('/')
.get((req, res, next) => {
  res.json(req.session.pendingOrders)
})
.post((req, res, next) => {
  req.session.pendingOrders = [ req.body.productOrder, ...req.session.pendingOrders ]
  res.json(req.session.pendingOrders[0])
})
.delete((req, res, next) => {
  req.session.pendingOrders = []
  res.sendStatus(204).end()
})


text:
!function(){
  'use strict';

  describe('Testing Backbone Model Plugin', function(){

    Backbone.$.ajaxSetup({
      headers: {
        "Access-Control-Allow-Origin": "*"
      }
    });

    var File = Backbone.Model.extend({
      url: 'http://localhost:8989/',
      fileAttribute: 'fileAttachment'
    });

    var fileModel;
    var simulatedFileObj;
    var simulatedFileObj2;

    beforeEach(function(){

      simulatedFileObj = new Blob(['Hello World'], {type : 'text/html'});
      simulatedFileObj2 = new Blob(['Hello Again, World'], {type : 'text/html'});

      fileModel = new File({
        from: 'sample@email.com',
        subject: 'Hello, friend!',
        body: 'Dear friend, Just saying hello! Love, Yours truly.',
        nestedObject: {
          nest: 'eggs',
          nestier: {
            nestiest: {
              0: 'one',
              1: 'two',
              2: 'three'
            }
          }
        }
      });

    });

    it('should detect the file(blob) save successfully', function(done){

      // Arrange
      fileModel.set({fileAttachment: simulatedFileObj});

      // Listen
      fileModel.on('sync', function(model){

        // Assert
        expect(model.get('from')).toBe('sample@email.com');

        // Assert Blob (phantomJS can't do Blobs so just test minimal attributes)
        expect(model.get('fileAttachment').size).toBe(28);
        expect(model.get('fileAttachment').type).toBe('text/html');
        //expect(model.get('fileAttachment').data).toBe('data:text/html;base64,PHN0cm9uZz5IZWxsbyBXb3JsZDwvc3Ryb25nPg==');

        done();

      });

      // Act
      fileModel.save(null);

    });

    it ('should be able to be saved in as an argument of "save" as object', function(done){

      // Listen
      fileModel.on('sync', function(model){

        // Assert
        expect(model.get('from')).toBe('sample@email.com');

        // Assert Blob (phantomJS can't do Blobs so just test minimal attributes)
        expect(model.get('fileAttachment').size).toBe(28);
        expect(model.get('fileAttachment').type).toBe('text/html');
        //expect(model.get('fileAttachment').data).toBe('data:text/html;base64,PHN0cm9uZz5IZWxsbyBXb3JsZDwvc3Ryb25nPg==');

        done();

      });

      // Act
      fileModel.save({fileAttachment: simulatedFileObj});

    });

    it ('should be able to be saved in as an argument of "save" as key/value argument', function(done){

      // Listen
      fileModel.on('sync', function(model){
        // Assert
        expect(model.get('from')).toBe('sample@email.com');
        // Assert Blob (phantomJS can't do Blobs so just test minimal attributes)
        expect(model.get('fileAttachment').size).toBe(28);
        expect(model.get('fileAttachment').type).toBe('text/html');
        //expect(model.get('fileAttachment').data).toBe('data:text/html;base64,PHN0cm9uZz5IZWxsbyBXb3JsZDwvc3Ryb25nPg==');

        done();

      });

      // Act
      fileModel.save('fileAttachment', simulatedFileObj);

    });

    it ('should be able to save an array of multiple file objects', function(done){
    // Listen
    fileModel.on('sync', function(model){
        // Assert
        expect(model.get('from')).toBe('sample@email.com');

        // Assert Blob (phantomJS can't do Blobs so just test minimal attributes)
        expect(model.get('fileAttachment')[0].size).toBe(28);
        expect(model.get('fileAttachment')[0].type).toBe('text/html');
        //expect(model.get('fileAttachment')[0].data).toBe('data:text/html;base64,PHN0cm9uZz5IZWxsbyBXb3JsZDwvc3Ryb25nPg==')
        expect(model.get('fileAttachment')[1].size).toBe(35);
        expect(model.get('fileAttachment')[1].type).toBe('text/html');
        //expect(model.get('fileAttachment')[1].data).toBe('data:text/html;base64,PHN0cm9uZz5IZWxsbyBBZ2FpbiwgV29ybGQ8L3N0cm9uZz4K=')

        done();

      });

      // Act
      fileModel.save('fileAttachment', [simulatedFileObj, simulatedFileObj2], {formData: true});
    });

    it ('should be able to have "wait" and "validate" option', function(done){

      // Listen
      fileModel.on('sync', function(model){

        // Assert
        expect(model.get('from')).toBe('sample@email.com');
        // Assert Blob (phantomJS can't do Blobs so just test minimal attributes)
        expect(model.get('fileAttachment').size).toBe(28);
        expect(model.get('fileAttachment').type).toBe('text/html');
        //expect(model.get('fileAttachment').data).toBe('data:text/html;base64,PHN0cm9uZz5IZWxsbyBXb3JsZDwvc3Ryb25nPg==');

        done();

      });

      // Act
      fileModel.save({fileAttachment: simulatedFileObj},{wait: true, validate: false});

    });

    it('should still have the option to save normally by setting it and save(null)', function(done){

      // Listen
      fileModel.on('sync', function(model){

        // Assert
        expect(model.get('from')).toBe('somethingelse@email.com');
        //expect(model.get('fileAttachment').data).toBe('data:text/html;base64,PHN0cm9uZz5IZWxsbyBXb3JsZDwvc3Ryb25nPg==');

        done();

      });

      // Act
      fileModel.set({from: 'somethingelse@email.com'});
      fileModel.save();

    });

    it('should still have the option to save normally by save("from","yes")', function(done){

      // Listen
      fileModel.on('sync', function(model){

        // Assert
        expect(model.get('from')).toBe('yes');
        //expect(model.get('fileAttachment').data).toBe('data:text/html;base64,PHN0cm9uZz5IZWxsbyBXb3JsZDwvc3Ryb25nPg==');

        done();

      });

      // Act
      fileModel.save('from','yes');

    });

    it('should still have the option to save normally by save({from: "yes"})', function(done){

      // Listen
      fileModel.on('sync', function(model){

        // Assert
        expect(model.get('from')).toBe('yes');
        //expect(model.get('fileAttachment').data).toBe('data:text/html;base64,PHN0cm9uZz5IZWxsbyBXb3JsZDwvc3Ryb25nPg==');

        done();

      });

      // Act
      fileModel.save({from: "yes"});

    });

    it('should still silent true with file', function(done){

      var changed = false;

      // Listen
      fileModel.on('sync', function(model){

        // Assert
        // Assert Blob (phantomJS can't do Blobs so just test minimal attributes)
        expect(model.get('fileAttachment').size).toBe(28);
        expect(model.get('fileAttachment').type).toBe('text/html');
        //expect(model.get('fileAttachment').data).toBe('data:text/html;base64,PHN0cm9uZz5IZWxsbyBXb3JsZDwvc3Ryb25nPg==');

        setTimeout(function(){
          expect(changed).not.toBeTruthy();
          done();
        },500);

      });

      fileModel.on('change', function(){
        changed = true;
      });

      // Act
      fileModel.save({fileAttachment: simulatedFileObj}, {silent: true});

    });

    it('should still silent true without file', function(done){

      var changed = false;

      // Listen
      fileModel.on('sync', function(model){

        // Assert
        expect(model.get('from')).toBe('yes');

        setTimeout(function(){
          expect(changed).not.toBeTruthy();
          done();
        },500);

      });

      fileModel.on('change', function(){
        changed = true;
      });

      // Act
      fileModel.save({from: "yes"}, {silent: true});

    });

    it('should flatten correctly using a bracket notation', function(){

      // Arrange
      var expected = {
        "from": "sample@email.com",
        "subject": "Hello, friend!",
        "body": "Dear friend, Just saying hello! Love, Yours truly.",
        "nestedObject[nest]": "eggs",
        "nestedObject[nestier[nestiest[0]]]": "one",
        "nestedObject[nestier[nestiest[1]]]": "two",
        "nestedObject[nestier[nestiest[2]]]": "three"
      };

      var flattened = fileModel._flatten(fileModel.toJSON());

      expect(flattened["nestedObject[nest]"]).toBe("eggs")
      expect(flattened["nestedObject[nestier[nestiest[0]]]"]).toBe("one");
      expect(flattened["nestedObject[nestier[nestiest[1]]]"]).toBe("two");
      expect(flattened["nestedObject[nestier[nestiest[2]]]"]).toBe("three");
    });

    it('should unflatten correctly using internal "unflatten" function', function(){

      var flattened = fileModel._flatten(fileModel.toJSON()),
          unflattened = fileModel._unflatten(flattened);

      expect(_.isEqual(unflattened, fileModel.toJSON())).toBeTruthy();

      console.log(JSON.stringify(fileModel._flatten({
        'family': 'The Smiths',
        'grandpa': {
          'name': 'Ole Joe Smith',
          'children': [
            {
              'name': 'Mary Lee',
              'spouse': 'John Lee',
              'children': [
                {
                  'name': 'Tiny Lee'
                }
              ]
            },
            {
              'name': 'Susan Smith'
            }
          ]
        }
      })));

    });

  });

}();


text:
<?php

namespace SchematiconTests;

use Nette\Neon\Neon;
use Schematicon\Validator\Validator;
use Tester\Assert;

require_once __DIR__ . '/../bootstrap.php';

$config = Neon::decode(<<<NEON
basic:
	allOf:
		-
			type: map
			properties:
				name:
					type: string
		-
			type: map
			properties:
				age:
					type: int
					optional: true
NEON
);

$validator = new Validator(prepareSchema($config['basic']));

Assert::same(
	[],
	$validator->validate([
		'name' => 'john'
	])->getErrors()
);

Assert::same(
	[],
	$validator->validate([
		'name' => 'john',
		'age' => 3
	])->getErrors()
);

Assert::same(
	[
		"Wrong data type in '/'; expected validity for all sub-schemas; invalid for:",
		"- 0: Missing 'name' key in '/' path",
	],
	$validator->validate((object) [])->getErrors()
);

Assert::same(
	[
		"Wrong data type in '/'; expected validity for all sub-schemas; invalid for:",
		"- 1: Wrong data type in '/age'; expected 'int'; got 'string'",
	],
	$validator->validate([
		'name' => 'john',
		'age' => '3',
	])->getErrors()
);


text:
<?php
function cURL($url, $post = null, $header = array()) {
	global $C;
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	if (is_array($post)) {
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
	}

	if (is_array($header)) {
		curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
	}
	curl_setopt($ch, CURLOPT_USERAGENT, $C['User-Agent']);

	curl_setopt($ch, CURLOPT_COOKIEFILE, $C['cookiefile']);
	curl_setopt($ch, CURLOPT_COOKIEJAR, $C['cookiefile']);

	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$res = curl_exec($ch);
	curl_close($ch);
	if ($res === false) {
		return false;
	}
	return $res;
}


text:
class Browser;
struct InstantSuggestion;
class PrefRegistrySyncable;
class PrefService;
class Profile;
class ThemeService;

namespace content {
class WebContents;
}

namespace gfx {
class Rect;
}

namespace chrome {

class BrowserInstantController : public content::NotificationObserver,
                                 public search::SearchModelObserver {
 public:
  explicit BrowserInstantController(Browser* browser);
  virtual ~BrowserInstantController();

  // Returns true if Instant is enabled in a visible, preview-showing mode.
  static bool IsInstantEnabled(Profile* profile);

  // Registers Instant related preferences.
  static void RegisterUserPrefs(PrefService* prefs,
                                PrefRegistrySyncable* registry);

  // If |url| is the new tab page URL, set |target_contents| to the preloaded
  // NTP contents from InstantController. If |source_contents| is not NULL, we
  // replace it with the new |target_contents| in the tabstrip and delete
  // |source_contents|. Otherwise, the caller owns |target_contents| and is
  // responsible for inserting it into the tabstrip.
  //
  // Returns true if and only if we update |target_contents|.
  bool MaybeSwapInInstantNTPContents(
      const GURL& url,
      content::WebContents* source_contents,
      content::WebContents** target_contents);

  // Commits the current Instant, returning true on success. This is intended
  // for use from OpenCurrentURL.
  bool OpenInstant(WindowOpenDisposition disposition);

  // Returns the Profile associated with the Browser that owns this object.
  Profile* profile() const;

  // Returns the InstantController or NULL if there is no InstantController for
  // this BrowserInstantController.
  InstantController* instant() { return &instant_; }

  // Invoked by |instant_| to commit the |preview| by merging it into the active
  // tab or adding it as a new tab.
  void CommitInstant(scoped_ptr<content::WebContents> preview, bool in_new_tab);

  // Invoked by |instant_| to autocomplete the |suggestion| into the omnibox.
  void SetInstantSuggestion(const InstantSuggestion& suggestion);

  // Invoked by |instant_| to get the bounds that the preview is placed at,
  // in screen coordinates.
  gfx::Rect GetInstantBounds();

  // Invoked by |instant_| to notify that the preview gained focus, usually due
  // to the user clicking on it.
  void InstantPreviewFocused();

  // Invoked by |instant_| to give the omnibox focus invisibly.
  void FocusOmniboxInvisibly();

  // Invoked by |instant_| to get the currently active tab, over which the
  // preview would be shown.
  content::WebContents* GetActiveWebContents() const;

  // Invoked by |browser_| when the active tab changes.
  void ActiveTabChanged();

  // Invoked by |browser_| when the active tab is about to be deactivated.
  void TabDeactivated(content::WebContents* contents);

  // Invoked by |instant_| or |browser_| to update theme information for NTP.
  // Set |parse_theme_info| to true to force re-parsing of theme information.
  void UpdateThemeInfo(bool parse_theme_info);

  // Invoked by the InstantController when it wants to open a URL.
  void OpenURL(const GURL& url,
               content::PageTransition transition,
               WindowOpenDisposition disposition);

  // Sets the start and end margins of the omnibox text area.
  void SetMarginSize(int start, int end);

 private:
  // Sets the value of |instant_| based on value from profile. Invoked
  // on pref change.
  void ResetInstant();

  // Overridden from search::SearchModelObserver:
  virtual void ModeChanged(const search::Mode& old_mode,
                           const search::Mode& new_mode) OVERRIDE;

  // content::NotificationObserver implementation.
  virtual void Observe(int type,
                       const content::NotificationSource& source,
                       const content::NotificationDetails& details) OVERRIDE;

  // Helper for handling theme change.
  void OnThemeChanged(ThemeService* theme_service);

  // Replaces the contents at tab |index| with |new_contents| and deletes the
  // existing contents.
  void ReplaceWebContentsAt(int index,
                            scoped_ptr<content::WebContents> new_contents);

  Browser* const browser_;

  InstantController instant_;
  InstantUnloadHandler instant_unload_handler_;

  // Theme-related data for NTP preview to adopt themes.
  bool initialized_theme_info_;  // True if theme_info_ has been initialized.
  ThemeBackgroundInfo theme_info_;

  PrefChangeRegistrar profile_pref_registrar_;

  content::NotificationRegistrar registrar_;

  DISALLOW_COPY_AND_ASSIGN(BrowserInstantController);
};

}  // namespace chrome

#endif  // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_


text:
@interface SFCommunicationManager : NSObject
{
    BOOL _isDaemon;

    id _delegate;
}

+ (SFCommunicationManager*)sharedManager;

- (void)setDelegate:(id)delegate;

- (void)startListeners;
- (void)stopListeners;

- (void)quitDaemon;
- (void)requestStatusUpdate;

- (void)moduleWithID:(NSString*)moduleID didChangeParameter:(AudioUnitParameterID)parameterID toValue:(Float32)value;

@end

@interface NSObject (SFCommunicationDelegate)

- (void)moduleWithID:(NSString*)moduleID didChangeParameter:(AudioUnitParameterID)parameterID toValue:(Float32)value;
- (void)requestStatusUpdate;

@end


text:
module JSON
  def self.expand_refs!(json)
      json.tap {
        JSON.recurse_proc json do |item|
          if Hash === item and uri = item['$ref']
            uri = URI.parse(uri)
            source = case uri.scheme
                    when nil then nil
                    when 'file' then ClearElection::Schema.root.join uri.path.sub(%r{^/}, '')
                    else uri
                    end
            if source
              item.delete '$ref'
              item.merge! expand_refs! JSON.parse source.read
            end
          end
        end
      }
  end
end


text:
About

The history of Carleton Stay Late And Make

Fall 2014

Humble Beginnings

Three senior students returned from their summer internships where they participated in weekly project development sessions. Wanting to bring these sessions to Carleton, they started Stay Late And Make - weekly meet-ups where students could get help for and work on whatever projects they wanted. Interest started growing and more students began attending	.

Winter 2015

Rise Above

As the semester began, people were looking to tackle bigger projects. A small group of students worked on the WEATHER BALLOON COMPETITION and managed to secure funding for their project. This culminated in the launching of their weather balloon, which was retreived after rising for five hours through the atmosphere.

Summer 2015

Quiet Times

Although most people were away for the summer, some the SLAM members held a PCB building workshop that was a resounding success. Students designed their boards, printed them off, and soldered all the components on over the course of a few weekends.

Fall 2015

Passing the Torch

With the SLAM founders having graduated last semester, regulars from the previous sessions took over. More workshops were brought to the meetings, including Android app development, web development, and microcontroller programming. The future of SLAM looks bright, and it's just getting better and better.

Be A Part

Of Our

Story!


text:
namespace Chloe.Server.Dtos
{
    public class BlogStoryAddOrUpdateRequestDto: BlogStoryDto
    {
    }
}


text:
Extra Objects: classes, objetos, construtores, atributos, métodos, estado e comportamento
=========================================================================================

* * *

## Implementar usando Orientação a Objetos

#### Prazo: 2018-07-04 Peso: 0.25 pts

### Implementar a classe EBook e projetar seu estado e comportamento

Considere uma classe para modelar/descrever o que seria um leitor de livros digitais. Os objetos da classe `EBook` devem ter pelo menos duas informações básicas: o título do livro e o número de páginas. O título nunca pode ser vazio e a quantidade de páginas deve ser maior que zero até o limite de 5000 páginas. O objeto deve guardar e manter atualizada a página atual sendo lida, começando em 1 e nunca maior que a quantidade de páginas disponíveis no livro. Neste sentido, objetos do tipo `EBook` são mutáveis, já que permitem navegar no livro alterando o estado do objeto, neste caso, a página atual. O título e total de páginas, por outro lado, são imutáveis (`final`).

Dada essa especificação, a implementação deve aderir aos seguintes casos de teste que demonstram a  interação com a `EBook`.

Casos de teste:
```java

    // titulo = "Os inovadores", paginas = 544
    EBook e1 = new EBook("Os inovadores", 544);

    System.out.println(e1.titulo); // Os inovadores
    System.out.println(e1.titulo.equals("Os inovadores")); // true

    // essa linha não deve compilar (comente-a)
    e1.titulo = "Alterando o título";
    System.out.println(e1.paginas); // 544
    System.out.println(e1.paginas == 544); // true

    // essa linha não deve compilar (comente-a)
    e1.paginas = 120

    // página atual sendo lida sempre inicia com 1
    System.out.println(e1.paginaAtual() == 1);

    // essa linha não deve compilar (comente-a)
    System.out.println(e1.paginaAtual); // sem acesso direto à página atual

    // sequência de e-books inválidos
    // as instruções devem lançar uma IllegalArgumentException

    try {
      EBook ebookInvalido = new EBook("", 544); // titulo vazio
      System.out.println(false); // essa linha não deve ser alcançada
    } catch(IllegalArgumentException e) { // a exceção deve ser capturada
      System.out.println(true);
    }

    try {
      EBook ebookInvalido = new EBook("Um titulo", 0); // sem páginas
      System.out.println(false);
    } catch (IllegalArgumentException e) {
      System.out.println(true);
    }

    try {
      EBook ebookInvalido = new EBook("Um titulo", -10); // páginas negativas
      System.out.println(false);
    } catch (IllegalArgumentException e) {
      System.out.println(true);
    }

    try {
      EBook ebookInvalido = new EBook("Um titulo", 6000); // páginas > 5000
      System.out.println(false);
    } catch (IllegalArgumentException e) {
      System.out.println(true);
    }

    EBook e2 = new EBook("A catedral e o bazar", 14);
    // http://www.dominiopublico.gov.br/pesquisa/DetalheObraForm.do?select_action=&co_obra=8679
    System.out.println(e2.titulo.equals("A catedral e o bazar"));
    System.out.println(e2.paginas == 14);
    System.out.println(e2.paginaAtual() == 1);

    EBook e3 = new EBook("O (comovente) guia de Ruby do why", 121);
    // http://why.carlosbrando.com/ https://en.wikipedia.org/wiki/Why_the_lucky_stiff
    System.out.println(e3.titulo.equals("O (comovente) guia de Ruby do why"));
    System.out.println(e3.paginas == 121);
    System.out.println(e3.paginaAtual() == 1);

    e2.virarPagina(); // paginaAtual + 1

    System.out.println(e2.paginaAtual() == 2);

    for (int i = 0; i < 10; i++) e2.virarPagina(); // 10 pag viradas

    System.out.println(e2.paginaAtual() == 12);

    e2.voltarPagina();

    System.out.println(e2.paginaAtual() == 11);

    for (int i = 0; i < 10; i++) e2.voltarPagina(); // 10 pag atrás

    System.out.println(e2.paginaAtual() == 1);

    // tentar voltar página antes do 1 deve ser proibido
    // lançando IllegalStateException, descomente, verifique, comente outra vez

    try {
      e2.voltarPagina(); // deve lançar IllegalStateException
      System.out.println(false);
    } catch (IllegalStateException e) {
      System.out.println(true);
    }

    System.out.println(e2.paginaAtual() == 1);

```

### Regras e restrições

**Restrição: não podem ser usadas as bibliotecas do Java, por exemplo, a classe `Math`, `Scanner`, etc, inclusive os métodos de Integer, como `parseInt` ou métodos de String, exceto `length`, `charAt` e `equals`**


text:
//
//  openGL.cpp
//  HCI 557 homework 3
//
//  Created by Yuanfen Chen on 10/8/15.
//  Copyright (c) 2015 -. All rights reserved.
//

// stl include
#include <iostream>
#include <string>

// GLEW include
#include <GL/glew.h>

// GLM include files
#define GLM_FORCE_INLINE
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/transform.hpp>

// glfw includes
#include <GLFW/glfw3.h>

// include local files
#include "controls.h"
#include "HCI557Common.h"
#include "CoordSystem.h"
#include "GLSphereDirect.h"
#include "GLSphereSpot.h"

using namespace std;

// The handle to the window object
GLFWwindow*         window;

// Define some of the global variables we're using for this sample
GLuint program;

/* A trackball to move and rotate the camera view */
extern Trackball trackball;

int main(int argc, const char * argv[])
{

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //// Init glfw, create a window, and init glew

    // Init the GLFW Window
    window = initWindow();

    // Init the glew api
    initGlew();

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //// Create some models
    GLSpotLightSource spotlight;
	GLLightSource directlight;
	GLMaterial material;
    // coordinate system
    CoordSystem* cs = new CoordSystem(40.0);

    GLSphereDirect* sphere1 = new GLSphereDirect(-12.0, 0.0, 0.0, 3, 90, 50); //create sphere 1
	GLSphereDirect* sphere2 = new GLSphereDirect(-4, 0.0, 0.0, 3, 90, 50);    //create sphere 2
	GLSphereSpot* sphere3 = new GLSphereSpot(4.0, 0.0, 0.0, 3, 90, 50);      //create sphere 3
	GLSphereSpot* sphere4 = new GLSphereSpot(12.0, 0.0, 0.0, 3.0, 90, 50);     //create sphere 4

	// Sphere1 Red set the light position, intensity, and material

	directlight._lightPos = glm::vec4(15.0,0.0,10.0, 0.0); //z was 0;15  y was 15
	directlight._ambient_intensity = 0.3;
    directlight._specular_intensity = 1.0;// was 0.5
    directlight._diffuse_intensity = 1.0; //was 1.0
    directlight._attenuation_coeff = 0.02;// was 0.02
	sphere1-> SetLightSource(directlight);

	material._diffuse_material = glm::vec3(0.7, 0.0, 0.0); // bright red in the front
    material._ambient_material = glm::vec3(0.5, 0.0, 0.0);//dark red in the back
    material._specular_material = glm::vec3(1.0, 1.0, 1.0);
    material._shininess = 70.0;//was 1;50;70
	material._emissive_material=glm::vec3(0.0,0.0,0.0);
	sphere1->set_material(material);
	sphere1->init();

	// Sphere2  blue  set the light position, intensity, and material

	directlight._lightPos = glm::vec4(15,0.0,10.0, 0.0);//z was 0;15 y was 15
	directlight._ambient_intensity = 0.3;//was 0.3
    directlight._specular_intensity = 0.0;//was 0.5
    directlight._diffuse_intensity = 1.0;
    directlight._attenuation_coeff = 0.02;
	sphere2-> SetLightSource(directlight);

	material._diffuse_material = glm::vec3(0.0, 0.0, 0.65); // bright red in the front
    material._ambient_material = glm::vec3(0.0, 0.0, 0.2);//// dark red in the back;
    material._specular_material = glm::vec3(1.0, 1.0, 1.0);
    material._shininess = 1.0;
	sphere2->set_material(material);
	sphere2->init();

	// Sphere3  black  set the light position, intensity, and material

	spotlight._lightPos = glm::vec4(4.0,0.0,9.0,1.0);//was (4.0,0.0,9.0,1.0)
	spotlight._ambient_intensity = 0.3;//was 0.3
    spotlight._specular_intensity = 1.5;// was 0.5;0.7;1.0
    spotlight._diffuse_intensity = 10.0;//was 1.0;2.0
    spotlight._attenuation_coeff = 0.01;//was 0.02; 0.2;0.1;0.01;0.005  0.01
    spotlight._cone_angle = 22.0; // in degree was 90;10;80;30;50;35
	spotlight._smooth_angle = 23.0; // 1 degree smooth angle to get rid of the zipzap edge effect
    spotlight._cone_direction = glm::vec3(0.0, 1.0,-5.0); // was (-1, 1.8,-9) (0.0, 1.0,-5.0)
	sphere3-> SetSpotLightSource(spotlight);

	material._diffuse_material = glm::vec3(0.0, 1.0, 0.0); //(0.5, 1.0, 0.0); green spotlight
    material._ambient_material = glm::vec3(0.0, 0.0, 0.0);//dark ambient
    material._specular_material = glm::vec3(1.0, 1.0, 1.0);
    material._shininess = 40.0;//was 1
	sphere3->set_material(material);
	sphere3->init();

	// Sphere4  milk  set the light position, intensity, and material

	spotlight._lightPos = glm::vec4(12,0.0,9.0, 1.0); //was (12,0.0,9.0, 1.0)
	spotlight._ambient_intensity = 0.5;
    spotlight._specular_intensity = 0.25;
    spotlight._diffuse_intensity = 0.9;
    spotlight._attenuation_coeff = 0.01;
    spotlight._cone_angle = 22.0; // in degree
    spotlight._cone_direction = glm::vec3(0.0, 1.0, -5); // this must be aligned with the object and light position.
	spotlight._smooth_angle = 28.0; // smooth angle in degree
	sphere4-> SetSpotLightSource(spotlight);

	material._diffuse_material = glm::vec3(1.0, 1.0, 0.2); //(0.5, 1.0, 0.0);
    material._ambient_material = glm::vec3(0.953, 0.945, 0.4);//(0.5, 0.5, 0.0);
    material._specular_material = glm::vec3(1.0, 1.0, 1.0);
    material._shininess = 40.0;
	sphere4->set_material(material);
	sphere4->init();

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //// Main render loop

    // Set up our green background color
    static const GLfloat clear_color[] = { 1.0f, 1.0f, 1.0f, 1.0f };
    static const GLfloat clear_depth[] = { 1.0f, 1.0f, 1.0f, 1.0f };

    // This sets the camera to a new location
    // the first parameter is the eye position, the second the center location, and the third the up vector.
    SetViewAsLookAt(glm::vec3(15.6f, 15.6f, 20.15f), glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f)); //move the camera far way to reduce the egg shape

    // Enable depth test
    // ignore this line, it allows us to keep the distance value after we proejct each object to a 2d canvas.
    glEnable(GL_DEPTH_TEST);

    //sphere->enableNormalVectorRenderer();

    // This is our render loop. As long as our window remains open (ESC is not pressed), we'll continue to render things.
    while(!glfwWindowShouldClose(window))
    {

        // Clear the entire buffer with our green color (sets the background to be green).
        glClearBufferfv(GL_COLOR , 0, clear_color);
        glClearBufferfv(GL_DEPTH , 0, clear_depth);

        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //// This renders the objects

        // Set the trackball locatiom
        SetTrackballLocation(trackball.getRotationMatrix());

        // draw the objects
        cs->draw();

        sphere1->draw();
		sphere2->draw();
		sphere3->draw();
		sphere4->draw();

        //// This renders the objects
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        // Swap the buffers so that what we drew will appear on the screen.
        glfwSwapBuffers(window);
        glfwPollEvents();

    }

    delete cs;

}


text:
package org.hisp.dhis.programrule;

/**
 * @author markusbekken
 */
public enum ProgramRuleActionType {
    DISPLAYTEXT( "displaytext" ),
    DISPLAYKEYVALUEPAIR( "displaykeyvaluepair" ),
    HIDEFIELD( "hidefield" ),
    HIDESECTION( "hidesection" ),
    ASSIGNVARIABLE( "assignvariable" ),
    SHOWWARNING( "showwarning" ),
    SHOWERROR( "showerror" );

    final String value;

    private ProgramRuleActionType( String value )
    {
        this.value = value;
    }

    public static ProgramRuleActionType fromValue( String value )
    {
        for ( ProgramRuleActionType type : ProgramRuleActionType.values() )
        {
            if ( type.value.equalsIgnoreCase( value ) )
            {
                return type;
            }
        }

        return null;
    }
}


text:
<?php

namespace Adminaut\Datatype;

/**
 * Class MultiCheckbox
 * @package Adminaut\Datatype
 */
class MultiCheckbox extends \Zend\Form\Element\MultiCheckbox
{
    protected $attributes = [
        'type' => 'datatypeMultiCheckbox'
    ];

    use Datatype {
        setOptions as datatypeSetOptions;
    }

    /**
     * @return array
     */
    public function getAttributes()
    {
        $this->attributes['id'] = $this->attributes['name'];
        return $this->attributes;
    }

    /**
     * @return string
     */
    public function getListedValue()
    {
        return implode(',', $this->getValue());
    }

    public function setValue($value)
    {
        $this->value = $value === "" ? [] : $value;
        return $this;
    }

}