text:
/*
 * @file peak_finder_proxy.hpp
 * @brief Class that manage the launch of the good algorithm for peak picking each spectrum.
 * @author Marc Dubois marc.dubois@ipbs.fr
 * @author Alexandre Burel alexandre.burel@unistra.fr
 */

#ifndef __PEAKFINDER__
#define __PEAKFINDER__

#include <string>
#include <stdint.h>
#include <stdio.h>
#include <exception>

#include "../utils/mzUtils.hpp"
#include "peak_finder_zero_bounded.hpp"
#include "peak_finder_tof.hpp"
#include "peak_finder_wavelet.hpp"

namespace mzdb {
using namespace std;

/**
 * The mzPeakFinderProxy class
 * ============================
 *
 * Class that manage the launch of the good algorithm for peak picking each spectrum.
 * `Effective mode` are distinguished than `wanted mode` (will be DEPRECATED). For some
 * reasons it will be easier to allow centroid to fit conversion. The resulting HWHMs
 * will be null.
 */
class PWIZ_API_DECL mzPeakFinderProxy {

private:

    template<class mz_t, class int_t> inline static bool detectPeaksAgain(const pwiz::msdata::SpectrumPtr &spectrum, vector<std::shared_ptr<Centroid<mz_t, int_t> > >& centroids) {
        // conditions to force re-peakpeacking are:
        // original data must be PROFILE (therefore centroidable)
        if(spectrum->hasCVParam(pwiz::msdata::MS_profile_spectrum)) {
            // original peakpicking has failed for some reason to produce any centroids at all
            if(centroids.size() == 0)
                return true;
            // original peakpicking fails when there are no zero intensities, in this case all peaks are centroids
            if(spectrum->getIntensityArray()->data.size() == centroids.size())
                return true;
        }
        return false;
    }

    // full width at half-maximum should only be calculated for fitted mode
    inline static bool computeFullWidthAtHalfMaximum(DataMode wantedMode) {
        if(wantedMode == FITTED)
            return true;
        return false;
    }

public:

    inline mzPeakFinderProxy() {}

    template<class mz_t, class int_t> static void computeCentroidsWidths(const pwiz::msdata::SpectrumPtr &spectrum,
                                                                         vector<std::shared_ptr<Centroid<mz_t, int_t> > >& centroids,
                                                                         pwiz::msdata::CVID fileType,
                                                                         mzPeakFinderUtils::PeakPickerParams& peakPickerParams,
                                                                         DataMode wantedMode,
                                                                         map<int, double> resolutions) {
        if (!spectrum || spectrum == nullptr) {
            // do nothing is the spectrum is null
            LOG(ERROR) << "Call to computeCentroidsWidths with a null spectrum";
            return;
        }

        bool computeFWHM = computeFullWidthAtHalfMaximum(wantedMode); // true means that FWHM must be calculated, false means that we want centroid peaks only
        switch (fileType) {
            case pwiz::msdata::MS_ABI_WIFF_format :{
                //bool detectPeaks = true; // re-detect peaks anyway because the default algorithm is not efficient enough
                // default algorithm is fine with MS1 data but not really with other MS levels
                int msLevel = spectrum->cvParam(pwiz::msdata::MS_ms_level).valueAs<int>();
                bool detectPeaks = (msLevel == 1 ? false : true);
                mzPeakFinderQTof::findPeaks<mz_t, int_t>(spectrum, centroids, peakPickerParams, resolutions, detectPeaks, computeFWHM);
                break;
            }
            case pwiz::msdata::MS_Thermo_RAW_format : {
                bool detectPeaks = detectPeaksAgain<mz_t, int_t>(spectrum, centroids); // true means that peaks must be (re)centroided, false means that we use the vendors' centroids
                peakPickerParams.adaptiveBaselineAndNoise = false;
                peakPickerParams.noise = 0;
                peakPickerParams.baseline = 0;
                peakPickerParams.minSNR = 0;
                mzPeakFinderZeroBounded::findPeaks<mz_t, int_t>(spectrum, centroids, peakPickerParams, detectPeaks, computeFWHM);
                break;
            }
            case pwiz::msdata::MS_Bruker_BAF_format : {
                // same as default mode, but always recentroid spectra
                bool detectPeaks = true; // re-detect peaks anyway because the default algorithm is not efficient enough
                peakPickerParams.adaptiveBaselineAndNoise = true;
                peakPickerParams.optimizationOpt = mzPeakFinderUtils::NO_OPTIMIZATION;
                peakPickerParams.minSNR = 0.0;
                peakPickerParams.fwhm = TOF_FWHM;
                mzPeakFinderWavelet::findPeaks<mz_t, int_t>(spectrum, centroids, peakPickerParams, detectPeaks, computeFWHM, mzPeakFinderUtils::CWT_ENABLED);
                break;
            }
            default: {
                // FIXME mzML files will fall into this case, instead of their original mode
                // TODO check how it works when detectPeaks == false
                bool detectPeaks = detectPeaksAgain<mz_t, int_t>(spectrum, centroids); // true means that peaks must be (re)centroided, false means that we use the vendors' centroids
                peakPickerParams.adaptiveBaselineAndNoise = true;
                peakPickerParams.optimizationOpt = mzPeakFinderUtils::NO_OPTIMIZATION;
                peakPickerParams.minSNR = 0.0;
                peakPickerParams.fwhm = TOF_FWHM;
                mzPeakFinderWavelet::findPeaks<mz_t, int_t>(spectrum, centroids, peakPickerParams, detectPeaks, computeFWHM, mzPeakFinderUtils::CWT_ENABLED);
                break;
            }
        }
        // The following code should only be run for test purpose !!
        // we want to check intensities before and after centroiding peaks
        //if(true) {
        //    const vector<double>& mzs = spectrum->getMZArray()->data;
        //    const vector<double>& ints = spectrum->getIntensityArray()->data;
        //    int msLevel = spectrum->cvParam(pwiz::msdata::MS_ms_level).valueAs<int>();
        //    //if(msLevel == 1) {
        //        size_t peakId = 0;
        //        double total = 0;
        //        for(size_t i = 0; i < centroids.size(); i++) {
        //            while(peakId < mzs.size() && mzs[peakId] < centroids[i]->mz) {
        //                peakId++;
        //            }
        //            total += ints[peakId] / centroids[i]->intensity;
        //            //double diff = ints[peakId] > centroids[i]->intensity ? ints[peakId] - centroids[i]->intensity : centroids[i]->intensity - ints[peakId];
        //            //if(peakId < mzs.size() && diff > 10 && ints[peakId] > 10) {
        //            //    LOG(INFO) << "ABU\t" << spectrum->id << "\t" << msLevel << "\t" << mzs[peakId] << "\t" << ints[peakId] << "\t" << centroids[i]->intensity << "\t" << (ints[peakId] / centroids[i]->intensity);
        //            //}
        //        }
        //        LOG(INFO) << "ABU\t" << spectrum->id << "\t" << msLevel << "\t" << total / centroids.size();
        //    //}
        //}
    }
};

} //end namespace
#endif


text:
/**
 * @param fileEntries {Array}
 * @param callback {function}
 * @returns {null}
 * @private
 */
jDoc.engines.OXML.prototype._createParsedFile = function (fileEntries, callback) {
    if (this.isTextDocument()) {
        this._createParsedFileFromTextDocument.apply(this, arguments);
    }

    return null;
};

redpajama_set_name: RedPajamaGithub


text:
namespace frm {

////////////////////////////////////////////////////////////////////////////////
// TextComponent
////////////////////////////////////////////////////////////////////////////////
FRM_COMPONENT_DECLARE(TextComponent)
{
public:

	static void Update(Component** _from, Component** _to, float _dt, World::UpdatePhase _phase);

private:

	String<64> m_text       = "TextComponent";
	float      m_size       = 1.0f;
	vec4       m_colorAlpha = vec4(1.0f);
	vec3       m_offset     = vec3(0.0f);

	bool editImpl() override;
	bool serializeImpl(Serializer& _serializer_) override;
	bool isStatic() override { return true; }
};

} // namespace frm


text:
<!doctype html>

        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>About Us — Ahmia</title>
        <meta name="description" content="A search engine for services accessible on the Tor network.">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet/less" href="less/style.less">

It appears that you are not using the Tor Browser.

Ahmia

            <form id="searchForm" class="searchForm autocomplete" action="/" method="get">
              <input id="id_q" type="search" name="q" placeholder="Search Ahmia">
              <input type="submit" value="Search" style="submitButton">
            </form>

             Collapse Menu

About Ahmia

Directory

Advanced

Statistics

Add your .onion

Disclaimer

Contact

            Ahmia blacklists sites containing child abuse material from its index. This list contains
            a masked version of all hidden service .onion addresses that have been added to the Ahmia
            blacklist, and is updated whenever Ahmia blacklists a new .onion site for abuse material.

Blacklist information

            Hidden service names are masked by creating an MD5 sum of the onion name plus a new line.
            For example, if
            the onion is abcdefghijk.onion, the resulting hash would be
            e271dc47fa80ddc9e6590042ad9ed2b7.
            This way it is possible for researchers and administrators to check if a site has been
            blacklisted from the index without making the .onion hostnames easily accessible.

            Ahmia offers an API endpoint for this blacklisting. To check if a site has been blacklisted,
            make a GET request to
            https://ahmia.fi/address/$ONION_SERVICE_NAME/, where
            $ONION_SERVICE_NAME is
            the "abcdefghijk" part of the .onion address. If you have JavaScript enabled, the form below will
            perform a client side confirmation of being blacklisted or not.

            Blacklist hash data is available for raw text download here. You may use this
            in your own search indexes to remove abusive content.

Check For a Banned Service

            <form id="checkBlacklist" method="post" action="#">
              <input type="text" id="blacklistInput" placeholder="Enter your .onion address here">
              <input type="submit" value="Check">
            </form>

info

warn

error

Banned Hidden Services

e271dc47fa80ddc9e6590042ad9ed2b7

cf6833aca0e01fc5510d3bbb5a796f63

d1add0a0e6b421c575ca908cbc9c2b33


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;
using System.Threading;
using STSdb4.General.Compression;
using STSdb4.General.Patches;
using STSdb4.General.Collections;
using STSdb4.General.Comparers;

namespace STSdb4.WaterfallTree
{
    public partial class WTree
    {
        [DebuggerDisplay("Count = {Count}")]
        private class BranchCollection : ListPatch<KeyValuePair<FullKey, Branch>>
        {
            public static readonly KeyValuePairComparer<FullKey, Branch> Comparer = new KeyValuePairComparer<FullKey, Branch>(Comparer<FullKey>.Default);

            public BranchCollection()
            {
            }

            public BranchCollection(int capacity)
                : base(capacity)
            {
            }

            public BranchCollection(params KeyValuePair<FullKey, Branch>[] array)
                : base(array)
            {
            }

            public BranchCollection(IEnumerable<KeyValuePair<FullKey, Branch>> collection)
                : base(collection)
            {
            }

            public int BinarySearch(FullKey locator, int index, int length, IComparer<KeyValuePair<FullKey, Branch>> comparer)
            {
                return BinarySearch(new KeyValuePair<FullKey, Branch>(locator, null), index, length, comparer);
            }

            public int BinarySearch(FullKey locator, int index, int length)
            {
                return BinarySearch(locator, index, length, BranchCollection.Comparer);
            }

            public int BinarySearch(FullKey locator)
            {
                return BinarySearch(locator, 0, Count);
            }

            public void Add(FullKey locator, Branch branch)
            {
                Add(new KeyValuePair<FullKey, Branch>(locator, branch));
            }

            public IEnumerable<KeyValuePair<FullKey, Branch>> Range(int fromIndex, int toIndex)
            {
                for (int i = fromIndex; i <= toIndex; i++)
                    yield return this[i];
            }

            public void Store(WTree tree, BinaryWriter writer)
            {
                CountCompression.Serialize(writer, checked((ulong)Count));

                Debug.Assert(Count > 0);
                writer.Write((byte)this[0].Value.NodeType);

                for (int i = 0; i < Count; i++)
                {
                    var kv = this[i];
                    FullKey fullkey = kv.Key;
                    Branch branch = kv.Value;
                    //lock (branch)
                    //{
                    //}

                    //write locator
                    tree.Serialize(writer, fullkey.Locator);
                    fullkey.Locator.PersistKey.Write(writer, fullkey.Key);

                    //write branch info
                    writer.Write(branch.NodeHandle);
                    writer.Write((int)branch.NodeState);

                    branch.Cache.Store(tree, writer);
                }
            }

            public void Load(WTree tree, BinaryReader reader)
            {
                int count = (int)CountCompression.Deserialize(reader);
                Capacity = count;

                NodeType nodeType = (NodeType)reader.ReadByte();

                for (int i = 0; i < count; i++)
                {
                    //read locator
                    var path = tree.Deserialize(reader);
                    var key = path.PersistKey.Read(reader);
                    var locator = new FullKey(path, key);

                    //read branch info
                    long nodeID = reader.ReadInt64();
                    NodeState nodeState = (NodeState)reader.ReadInt32();

                    Branch branch = new Branch(tree, nodeType, nodeID);
                    branch.NodeState = nodeState;

                    branch.Cache.Load(tree, reader);

                    Add(new KeyValuePair<FullKey, Branch>(locator, branch));
                }
            }
        }
    }
}


text:
using Microsoft.AspNetCore.Authentication.QQ;
using Microsoft.AspNetCore.Authentication.WeChat;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Demo.Data;
using Demo.Models;
using Demo.Services;
using System;

namespace Demo
{
    public class Startup
    {
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                .SetBasePath(env.ContentRootPath)
                .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                .AddEnvironmentVariables()
                .AddUserSecrets<Startup>();

            Configuration = builder.Build();
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext<ApplicationDbContext>(options =>
                options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

            services.AddIdentity<ApplicationUser, IdentityRole>()
                .AddEntityFrameworkStores<ApplicationDbContext>()
                .AddDefaultTokenProviders();

            // Add application services.
            services.AddTransient<IEmailSender, EmailSender>();

            services.AddAuthentication().AddMicrosoftAccount(microsoftOptions =>
            {
                microsoftOptions.ClientId = Configuration["Authentication:Microsoft:ApplicationId"];
                microsoftOptions.ClientSecret = Configuration["Authentication:Microsoft:Password"];
            })/*.AddGoogle(googleOptions => //Google
            {
                googleOptions.ClientId = Configuration["Authentication:Google:ClientId"];
                googleOptions.ClientSecret = Configuration["Authentication:Google:ClientSecret"];
            })*/.AddQQ(qqOptions =>
            {
                qqOptions.AppId = Configuration["Authentication:QQ:AppId"];
                qqOptions.AppKey = Configuration["Authentication:QQ:AppKey"];
            }).AddWeChat(wechatOptions => {
                wechatOptions.AppId = Configuration["Authentication:WeChat:AppId"];
                wechatOptions.AppSecret = Configuration["Authentication:WeChat:AppSecret"];
            }) ;

            services.AddMvc();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                //app.UseBrowserLink();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            //loggerFactory.AddConsole();

            app.UseStaticFiles();

            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }
    }
}


text: a module for finding memory leaks at run time.


text:
from .testproblem import TestProblem
from .cifar10_3c3d import cifar10_3c3d
from .cifar10_vgg16 import cifar10_vgg16
from .cifar10_vgg19 import cifar10_vgg19
from .cifar100_3c3d import cifar100_3c3d
from .cifar100_allcnnc import cifar100_allcnnc
from .cifar100_vgg16 import cifar100_vgg16
from .cifar100_vgg19 import cifar100_vgg19
from .cifar100_wrn404 import cifar100_wrn404
from .fmnist_2c2d import fmnist_2c2d
from .fmnist_logreg import fmnist_logreg
from .fmnist_mlp import fmnist_mlp
from .fmnist_vae import fmnist_vae
from .imagenet_inception_v3 import imagenet_inception_v3
from .imagenet_vgg16 import imagenet_vgg16
from .imagenet_vgg19 import imagenet_vgg19
from .mnist_2c2d import mnist_2c2d
from .mnist_logreg import mnist_logreg
from .mnist_mlp import mnist_mlp
from .mnist_vae import mnist_vae
from .quadratic_deep import quadratic_deep
from .svhn_3c3d import svhn_3c3d
from .svhn_wrn164 import svhn_wrn164
from .tolstoi_char_rnn import tolstoi_char_rnn
from .two_d_beale import two_d_beale
from .two_d_branin import two_d_branin
from .two_d_rosenbrock import two_d_rosenbrock


text:
[![Codacy Badge](https://api.codacy.com/project/badge/grade/e48173d1a215408cb0088fd70260857e)](https://www.codacy.com/app/artemnikitin/android-go-example)
Example Android app that used Go mobile

### Prerequisites
You should have valid credentials to use HERE REST API. If you don't have it register on https://developer.here.com/

### Setup
1. Setup https://github.com/artemnikitin/android-go-shared as described in readme
2. Clone this repo
3. Put HERE credentials in AndroidManifest.xml
4. Run ```./gradlew clean assembleDebug``` to build an apk
Warning! Due to fact that tools are not yet fully ready for gomobile you can't run project from Android Studio.


text:
namespace JustCli.TestAppNetCore
{
   class Program
   {
      static int Main(string[] args)
      {
         return CommandLineParser.Default.ParseAndExecuteCommand(args);
      }
   }
}


text:
using System.Collections.Generic;
using Microsoft.Xrm.Sdk;

namespace Adxstudio.Xrm.Commerce
{
	/// <summary>
	/// Represents a potential purchase, backed by a Quote (quote).
	/// </summary>
	public interface IPurchasable
	{
		IPurchaseAddress BillToAddress { get; }

		decimal DiscountAmount { get; }

		IEnumerable<IDiscount> Discounts { get; }

		bool HasOptions { get; }

		IEnumerable<IPurchasableItem> Items { get; }

		EntityReference PriceList { get; }

		EntityReference Quote { get; }

		bool RequiresShipping { get; }

		IPurchaseAddress ShipToAddress { get; }

		decimal ShippingAmount { get; }

		bool SupportsQuantities { get; }

		decimal TotalAmount { get; }

		decimal TotalDiscount { get; }

		decimal TotalDiscountAmount { get; }

		decimal TotalLineItemAmount { get; }

		decimal TotalLineItemDiscountAmount { get; }

		decimal TotalPreShippingAmount { get; }

		decimal TotalTax { get; }
	}

	public interface IPurchaseAddress
	{
		string City { get; }

		string Country { get; }

		string Name { get; }

		string PostalCode { get; }

		string StateOrProvince { get; }

		string Line1 { get; }

		string Line2 { get; }

		string Line3 { get; }
	}

	public class PurchaseAddress : IPurchaseAddress
	{
		public string City { get; set; }

		public string Country { get; set; }

		public string Name { get; set; }

		public string PostalCode { get; set; }

		public string StateOrProvince { get; set; }

		public string Line1 { get; set; }

		public string Line2 { get; set; }

		public string Line3 { get; set; }
	}
}


text:
package org.spongepowered.common.mixin.api.mcp.item;

import static com.google.common.base.Preconditions.checkState;

import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import org.spongepowered.api.block.BlockType;
import org.spongepowered.api.data.Property;
import org.spongepowered.api.item.ItemType;
import org.spongepowered.api.text.translation.Translation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.common.SpongeImpl;
import org.spongepowered.common.SpongeImplHooks;
import org.spongepowered.common.item.inventory.util.ItemStackUtil;
import org.spongepowered.common.text.translation.SpongeTranslation;

import java.util.Optional;

import javax.annotation.Nullable;

@Mixin(Item.class)
public abstract class ItemMixin_API implements ItemType {

    @Shadow public abstract int getItemStackLimit();
    @Shadow public abstract String getTranslationKey();
    @Shadow private Item containerItem;

    @Nullable protected BlockType blockType = null;
    @Nullable private org.spongepowered.api.item.inventory.ItemStack propertyItemStack;

    @Override
    public final String getId() {
        final ResourceLocation resourceLocation = SpongeImplHooks.getItemResourceLocation((Item) (Object) this);
        checkState(resourceLocation != null, "Attempted to access the id before the Item is registered.");
        return resourceLocation.toString();
    }

    @Override
    public String getName() {
        return getId();
    }

    @Override
    public <T extends Property<?, ?>> Optional<T> getDefaultProperty(Class<T> propertyClass) {
        if (this.propertyItemStack == null) {
            this.propertyItemStack = ItemStackUtil.fromNative(new ItemStack((Item) (Object) this));
        }
        return SpongeImpl.getPropertyRegistry().getStore(propertyClass).flatMap(store -> store.getFor(this.propertyItemStack));
    }

    @Override
    public Translation getTranslation() {
        return new SpongeTranslation(getTranslationKey() + ".name");
    }

    @Override
    public int getMaxStackQuantity() {
        return getItemStackLimit();
    }

    @Override
    public Optional<BlockType> getBlock() {
        return Optional.ofNullable(this.blockType);
    }

    @Override
    public Optional<ItemType> getContainer() {
        return Optional.ofNullable((ItemType) this.containerItem);
    }

}


text:
<?php

namespace Emayk\Ics\Repo\Warehouse;
use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;
use \Response;
use \Input;

class WarehouseEloquent implements WarehouseInterface{
    protected $warehouse;
    function __construct(Warehouse $warehouse)
    {
        $this->warehouse = $warehouse;
    }

    /**
    *
    * Mendapatkan Record Warehouse berdasarkan ID yang diberikan
    * @param  int $id ID Record
    * @return Model Record Warehouse
    **/

    public function find($id){
        return $this->warehouse->find($id);
    }

    /**
     * Mendapatkan Semua Warehouse
     * @return mixed
     */
    public function all()
    {
        $page = \Input::get('page');
			 $limit = \Input::get('limit',1);
			 $start = \Input::get('start',1);

        if (Input::has('selected'))
        {
            $id = Input::get('selected');
            $record = $this->warehouse->findOrFail($id);
            return Response::json([
                'success' => true, 'error' => false,
                'results' => $record->toArray()
            ]);
        }

        $warehouse = $this->warehouse
            ->with('city','category')
            ->orderBy('id','DESC')
            ->skip($start)
            ->take($limit)
            ->get()->toArray();
        $total = $this->warehouse
            ->all()->count();

        $warehouses = array(
            'success' => true,
            'results' => $warehouse,
            'total' => $total
        );

        return Response::json($warehouses)
            ->setCallback(\Input::get('callback'));

    }

    /**
     *
     * Proses Simpan Warehouse
     *
     * @return mixed
     */
    public function store()
    {
        if (!$this->hasAccess()) {
            return Response::json(
                      array(
                        'success' => false,
                        'reason'  => 'Action Need Login First',
                        'results' => null
                        ))->setCallback();
        }
        /*==========  Sesuaikan dengan Field di table  ==========*/
         $this->warehouse->name = Input::get('name');
         $this->warehouse->address = Input::get('address');
         $this->warehouse->cat_id = Input::get('cat_id');
         $this->warehouse->city_id = Input::get('city_id');
         $this->warehouse->uuid = uniqid('New_');
         $this->warehouse->createby_id = \Auth::user()->id;
         $this->warehouse->lastupdateby_id = \Auth::user()->id;
         $this->warehouse->created_at = new Carbon();
         $this->warehouse->updated_at = new Carbon();
        $saved = $this->warehouse->save() ? true : false ;
        return Response::json(array(
            'success' => $saved,
            'results' => $this->warehouse->toArray()
        ))->setCallback();
    }

    /**
     * Menghapus Warehouse
     *
     * @param $id
     * @return mixed
     *
     */
    public function delete($id)
    {

        if ($this->hasAccess())
        {
            $deleted = $this->warehouse
                ->find($id)
                ->delete();

            return \Icsoutput::toJson(array(
                'results' => $deleted
            ),$deleted);

        }else{
            return \Icsoutput::toJson(array(
                'results' => false,
                'reason' => 'Dont Have Access to Delete '
            ),false);
        }
    }

    /**
     * Update Informasi [[cName]]
     *
     * @param $id
     * @return mixed
     */
    public function update($id)
    {
        $db = $this->warehouse->find($id);
        /*==========  Sesuaikan  ==========*/
        $db->address = Input::get('address');
        $db->cat_id = Input::get('cat_id');
        $db->city_id = Input::get('city_id');
        $db->lastupdateby_id = \Auth::user()->id;
//        $db->name = Input::get('name');
        $db->updated_at = new Carbon();
        $db->uuid = uniqid('Update_');
        return ($db->save()) ?
            \Icsoutput::msgSuccess( $db->toArray() )
            : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
    }

    /**
    *
    * Apakah Sudah Login
    *
    * @return boolean
    *
    **/
    protected function  hasAccess()
    {
        return (!Auth::guest());
    }

    /**
    *
    * Menampilkan Page Create data Warehouse
    *
    **/

   public function create()
    {
        // TODO: Implement create() method.
    }

    /**
     * Menampilkan Resource
     *
     * @param  int  $id
     * @return Response
     */
   public function show($id)
    {

					$db = $this->warehouse->find($id);
			 return (!$db)
				 ? \Icsoutput::msgError(array('reason' => 'Cannot Found'))
				 : \Icsoutput::msgSuccess($db->toArray());
    }
    /**
     * Menampilkan Data Untuk di edit
     *
     * @param  int  $id
     * @return Response
     */
    public function edit($id)
    {
        // TODO: Implement edit() method.
    }

    public function destroy($id)
    {
       return $this->delete($id);
    }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>VM Infrastructure: Member List</title>
<link href="hydoxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">

Main Page

Packages

Classes

Files

Related Pages

Class List

Class Hierarchy

Class Members

Encoder_128 Member List
This is the complete list of members for Encoder_128, including all inherited members.

_char_value	Encoder_128	 [protected]

_offset	Encoder_128	 [protected]

code_emit(unsigned char *code)	Encoder_128

Encoder_128(unsigned init_offset)	Encoder_128	 [protected]

get_offset()	Encoder_128

reset()	Encoder_128	 [protected, virtual]

set_stop_bit()	Encoder_128	 [protected]

slot_encode(int slot_num, unsigned bits, int offset, int bit_length=32)	Encoder_128	 [protected]

slot_reset(int slot_num, int offset, int bit_length=32)	Encoder_128	 [protected]

slot_rewrite(int slot_num, unsigned bits, int offset, int bit_length=32)	Encoder_128	 [protected]

template_encode(unsigned char bits)	Encoder_128	 [protected]

<address style="text-align: center;">

Genereated on Tue Mar 11 19:26:01 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.

</address>


text:
\hypertarget{classSebastianBergmann_1_1Money_1_1NGN}{}\section{Sebastian\+Bergmann\textbackslash{}Money\textbackslash{}N\+G\+N Class Reference}
\label{classSebastianBergmann_1_1Money_1_1NGN}\index{Sebastian\+Bergmann\textbackslash{}\+Money\textbackslash{}\+N\+G\+N@{Sebastian\+Bergmann\textbackslash{}\+Money\textbackslash{}\+N\+G\+N}}
Inheritance diagram for Sebastian\+Bergmann\textbackslash{}Money\textbackslash{}N\+G\+N\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classSebastianBergmann_1_1Money_1_1NGN}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\hypertarget{classSebastianBergmann_1_1Money_1_1NGN_a1e9f65658fab63d1b82fd9ecd8917186}{}{\bfseries \+\_\+\+\_\+construct} (\$amount)\label{classSebastianBergmann_1_1Money_1_1NGN_a1e9f65658fab63d1b82fd9ecd8917186}

\end{DoxyCompactItemize}
\subsection*{Additional Inherited Members}

\subsection{Detailed Description}

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
src/currency/N\+G\+N.\+php\end{DoxyCompactItemize}


text:
Aria.classDefinition({
    $classpath : "test.aria.widgets.wai.WaiTestSuite",
    $extends : "aria.jsunit.TestSuite",
    $constructor : function () {
        this.$TestSuite.constructor.call(this);

        this.addTests("test.aria.widgets.wai.dropdown.DropdownTestSuite");
        this.addTests("test.aria.widgets.wai.autoComplete.WaiAutoCompleteTestSuite");
        this.addTests("test.aria.widgets.wai.datePicker.DatePickerTest");
        this.addTests("test.aria.widgets.wai.textInputBased.WaiTextInputBasedTestSuite");
        this.addTests("test.aria.widgets.wai.input.WaiInputTestSuite");
        this.addTests("test.aria.widgets.wai.popup.WaiPopupTestSuite");
        this.addTests("test.aria.widgets.wai.errorlist.ListErrorTestCase");
        this.addTests("test.aria.widgets.wai.icon.IconTest");
        this.addTests("test.aria.widgets.wai.tabs.Suite");
    }
});


text:
namespace android.os
{
	[global::MonoJavaBridge.JavaClass(typeof(global::android.os.CountDownTimer_))]
	public abstract partial class CountDownTimer : java.lang.Object
	{
		internal new static global::MonoJavaBridge.JniGlobalHandle staticClass;
		protected CountDownTimer(global::MonoJavaBridge.JNIEnv @__env) : base(@__env)
		{
		}
		private static global::MonoJavaBridge.MethodId _m0;
		public virtual global::android.os.CountDownTimer start()
		{
			return global::MonoJavaBridge.JavaBridge.CallObjectMethod(this, global::android.os.CountDownTimer.staticClass, "start", "()Landroid/os/CountDownTimer;", ref global::android.os.CountDownTimer._m0) as android.os.CountDownTimer;
		}
		private static global::MonoJavaBridge.MethodId _m1;
		public virtual void cancel()
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.os.CountDownTimer.staticClass, "cancel", "()V", ref global::android.os.CountDownTimer._m1);
		}
		private static global::MonoJavaBridge.MethodId _m2;
		public abstract void onTick(long arg0);
		private static global::MonoJavaBridge.MethodId _m3;
		public abstract void onFinish();
		private static global::MonoJavaBridge.MethodId _m4;
		public CountDownTimer(long arg0, long arg1) : base(global::MonoJavaBridge.JNIEnv.ThreadEnv)
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			if (global::android.os.CountDownTimer._m4.native == global::System.IntPtr.Zero)
				global::android.os.CountDownTimer._m4 = @__env.GetMethodIDNoThrow(global::android.os.CountDownTimer.staticClass, "<init>", "(JJ)V");
			global::MonoJavaBridge.JniLocalHandle handle = @__env.NewObject(android.os.CountDownTimer.staticClass, global::android.os.CountDownTimer._m4, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
			Init(@__env, handle);
		}
		static CountDownTimer()
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			global::android.os.CountDownTimer.staticClass = @__env.NewGlobalRef(@__env.FindClass("android/os/CountDownTimer"));
		}
	}

	[global::MonoJavaBridge.JavaProxy(typeof(global::android.os.CountDownTimer))]
	internal sealed partial class CountDownTimer_ : android.os.CountDownTimer
	{
		internal new static global::MonoJavaBridge.JniGlobalHandle staticClass;
		internal CountDownTimer_(global::MonoJavaBridge.JNIEnv @__env) : base(@__env)
		{
		}
		private static global::MonoJavaBridge.MethodId _m0;
		public override void onTick(long arg0)
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.os.CountDownTimer_.staticClass, "onTick", "(J)V", ref global::android.os.CountDownTimer_._m0, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
		}
		private static global::MonoJavaBridge.MethodId _m1;
		public override void onFinish()
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.os.CountDownTimer_.staticClass, "onFinish", "()V", ref global::android.os.CountDownTimer_._m1);
		}
		static CountDownTimer_()
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			global::android.os.CountDownTimer_.staticClass = @__env.NewGlobalRef(@__env.FindClass("android/os/CountDownTimer"));
		}
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

  <title>testing</title>
  <meta name="date" content="2016-04-28">
  <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

testing

Interfaces

Tester

Classes

AnaimationTesting

BenTest

BenTestGroovy

BrunaTesting

CloneTest

DragList

EditorTesting

EntityTest

GroovyTesting

GuavaTester

ImagePathWriteTest

MoveEntityTest

ScriptTest


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using System.Text;
using FluentAssertions.Formatting;

namespace Microsoft.Common.Core.Test.Match {
    [ExcludeFromCodeCoverage]
    public class MatchMembers<T> : IEquatable<T> {
        private readonly MatchMembers<T> _next;
        private readonly string _memberName;
        private readonly object _expected;
        private readonly Func<T, bool> _equals;

        static MatchMembers() {
            FluentAssertions.Formatting.Formatter.AddFormatter(new Formatter());
        }

        public MatchMembers() {
            _equals = x => true;
        }

        private MatchMembers(MatchMembers<T> next, LambdaExpression memberSelector, object expected, Func<T, bool> equals) {
            if (memberSelector == null) {
                throw new ArgumentNullException("memberSelector");
            }

            // If selector is of the form x => x.Member, which is the most common kind, then shorten it to Member.
            // Otherwise, just use the whole body of the lambda.
            var member = memberSelector.Body as MemberExpression;
            if (member != null && member.Expression is ParameterExpression) {
                _memberName = member.Member.Name;
            } else {
                _memberName = memberSelector.ToString();
            }

            _next = next;
            _expected = expected;
            _equals = equals;
        }

        private static bool Matches(object expected, object actual) {
            if (expected == null) {
                return actual == null;
            } else {
                return expected.Equals(actual);
            }
        }

        public MatchMembers<T> Matching<TMember>(Expression<Func<T, TMember>> memberSelector, IEquatable<TMember> expected) =>
            new MatchMembers<T>(this, memberSelector, expected, x => Matches(expected, memberSelector.Compile()(x)));

        public MatchMembers<T> Matching<TMember>(Expression<Func<T, TMember>> memberSelector, IComparable<TMember> from, IComparable<TMember> to)
            where TMember : IComparable<TMember> =>
            Matching(memberSelector, new MatchRange<TMember>(from, to));

        public MatchMembers<T> Matching<TMember>(Expression<Func<T, TMember?>> memberSelector, IEquatable<TMember> expected)
            where TMember : struct =>
            new MatchMembers<T>(this, memberSelector, expected, x => Matches(expected, memberSelector.Compile()(x)));

        public MatchMembers<T> Matching<TMember>(Expression<Func<T, TMember?>> memberSelector, IComparable<TMember> from, IComparable<TMember> to)
            where TMember : struct, IComparable<TMember> =>
            Matching(memberSelector, new MatchRange<TMember>(from, to));

        public bool Equals(T other) =>
            other != null && _equals(other) && _next?.Equals(other) != false;

        public override int GetHashCode() {
            throw new NotSupportedException(nameof(MatchMembers<T>) + " does not support " + nameof(GetHashCode));
        }

        public override bool Equals(object obj) =>
            obj is T && Equals((T)obj);

        private class Formatter : IValueFormatter {
            private const int IndentSize = 3;

            public bool CanHandle(object value) =>
                value is MatchMembers<T>;

            public string ToString(object value, bool useLineBreaks, IList<object> processedObjects = null, int nestedPropertyLevel = 0) {
                if (processedObjects != null) {
                    if (processedObjects.Contains(value)) {
                        return string.Format("{{Cyclic reference to type {0} detected}}", value.GetType());
                    } else {
                        processedObjects.Add(value);
                    }
                }

                var sb = new StringBuilder();
                if (useLineBreaks) {
                    sb.Append(Environment.NewLine);
                }

                if (nestedPropertyLevel == 0) {
                    sb.AppendLine();
                    sb.AppendLine();
                }

                sb.AppendLine(typeof(T).FullName + " matching ");
                sb.AppendLine(Indent(nestedPropertyLevel) + "{");

                for (var match = (MatchMembers<T>)value; match != null; match = match._next) {
                    if (match._memberName != null) {
                        sb.Append(Indent(nestedPropertyLevel + 1));
                        sb.Append(match._memberName);
                        sb.Append(" = ");
                        sb.AppendLine(FluentAssertions.Formatting.Formatter.ToString(match._expected, false, processedObjects, nestedPropertyLevel + 1));
                    }
                }

                sb.AppendLine(Indent(nestedPropertyLevel) + "}");
                return sb.ToString();
            }

            private static string Indent(int level) {
                return new string(' ', level * IndentSize);
            }
        }
    }
}


text:
gfw.ui.model.CountryHeaderStatus = cdb.core.Model.extend({});

gfw.ui.model.layersOptions = Backbone.Model.extend({

  initialize: function(options) {
    options = options || {};
    var threshold = (config.canopy_choice) ? config.canopy_choice : 30;
    var layers = {
      'forest2000': {
        url: 'http://earthengine.google.org/static/hansen_2013/gfw_tree_loss_year_' + threshold + '/%z/%x/%y.png',
        dataMaxZoom: 12,
        tileSize: [256, 256],
        _filterCanvasImage: function(imageData, w, h) {
          var components = 4; //rgba
          var pixel_pos;

          for(var i=0; i < w; ++i) {
            for(var j=0; j < h; ++j) {
              var pixel_pos = (j*w + i) * components;
              var intensity = imageData[pixel_pos+1];
              imageData[pixel_pos] = 151;
              imageData[pixel_pos + 1] = 189;
              imageData[pixel_pos + 2] = 61;
              imageData[pixel_pos + 3] = intensity*0.8;
            }
          }
        }
      }
    };

    var self = this,
        layer = layers[options.layer];

    if (layer) {
      _.each(layer, function(row, i) {
        self.set(i, row);
      })
    }
  },

});

gfw.ui.view.leafletCanvasLayer = Backbone.View.extend({

  initialize: function(options) {
    var self = this;
    options = options || {layerName: '', mapOptions: {}};

    this.layerOptions = new gfw.ui.model.layersOptions({layer: options.layerName});
    _.extend(this, this.layerOptions.toJSON());

    this.layer = L.tileLayer.canvas(options.mapOptions);

    this.layer.drawTile = function(canvas, tilePoint, zoom) {
      var xhr = new XMLHttpRequest(),
          ctx = canvas.getContext('2d');

      var x = tilePoint.x,
          y = tilePoint.y,
          z = zoom,
          mz = self.dataMaxZoom;

      if (zoom > mz) {
        x = Math.floor(x / (Math.pow(2, zoom - mz)));
        y = Math.floor(y / (Math.pow(2, zoom - mz)));
        z = mz;
      } else {
        y = (y > Math.pow(2, z) ? y % Math.pow(2,z) : y);
        if (x >= Math.pow(2, z)) {
          x = x % Math.pow(2, z);
        } else if (x < 0) {
          x = Math.pow(2,z) - Math.abs(x);
        }
      }

      var url = self.url.replace('%z', z).replace('%x', x).replace('%y', y);

      xhr.onload = function () {
        var url = URL.createObjectURL(this.response),
            image = new Image();

        image.onload = function () {
          image.crossOrigin = '';

          canvas.image = image;
          canvas.coord = {x: tilePoint.x, y: tilePoint.y};
          canvas.coord.z = zoom;

          self._drawImageCanvas(canvas);

          URL.revokeObjectURL(url);
        };

        image.src = url;
      };

      xhr.open('GET', url, true);
      xhr.responseType = 'blob';
      xhr.send();
    }
  },

  _filterCanvasImage: function(imageData, w, h) {
  },

  _drawImageCanvas: function(canvas) {
    var ctx = canvas.getContext('2d'),
        coord = canvas.coord;

    if (canvas.coord) {
      var zsteps = coord.z - this.dataMaxZoom;

      if (zsteps > 0) {
        ctx['imageSmoothingEnabled'] = false;
        ctx['mozImageSmoothingEnabled'] = false;
        ctx['webkitImageSmoothingEnabled'] = false;

        var srcX = 256 / Math.pow(2, zsteps) * (coord.x % Math.pow(2, zsteps)),
            srcY = 256 / Math.pow(2, zsteps) * (coord.y % Math.pow(2, zsteps)),
            srcW = 256 / Math.pow(2, zsteps),
            srcH = 256 / Math.pow(2, zsteps);
        ctx.clearRect(0, 0, 256, 256);
        ctx.drawImage(canvas.image, srcX, srcY, srcW, srcH, 0, 0, 256, 256);

      } else {
        try {
          ctx.drawImage(canvas.image, 0, 0);
        } catch(err) { }
      }

      var I = ctx.getImageData(0, 0, canvas.width, canvas.height);
      this._filterCanvasImage(I.data, canvas.width, canvas.height);
      ctx.putImageData(I, 0, 0);
    }
  },

  getLayer: function() {
    return this.layer;
  }

});

gfw.ui.view.CountryHeader = cdb.core.View.extend({

  el: $('.country-header, .country-overview-wrapper-coolio'),

  events: {
    'change #areaSelector': '_onSelectArea',
    'click .selector-remove': '_navigateCountry',
    'click .umd_options_control' : '_onClickUMDOptions',
    'click .item.settings' : '_onClickUMDOptions',
    'click .country-header .umdoptions_dialog #canopy_slider':  '_updateMapThreshold',
    'mouseup .country-header .umdoptions_dialog #canopy_slider':  '_updateMapThreshold',
    'click .country-header .umdoptions_dialog ul li':  '_updateMapThreshold'
  },

  initialize: function(options) {
    _.extend(this, options);
    var self = this;

    _.bindAll(this, '_cartodbLayerDone');
    // Cache
    this.$areaSelector = this.$('#areaSelector');
    this.$selectorRemove =  this.$('.selector-remove');
    this.$map = this.$('.map');

    var Router = Backbone.Router.extend({
      routes: {
        'country/:id': 'loadCountry',
        'country/:id/': 'loadCountry',
        'country/:id/:areaId': 'loadArea',
        'country/:id/:areaId/': 'loadArea',
        'embed/country/:id': 'loadCountry',
        'embed/country/:id/': 'loadCountry',
        'embed/country/:id/:areaId': 'loadArea',
        'embed/country/:id/:areaId/': 'loadArea',
        'embed/country_info/:id/:box': 'loadBox',
        'embed/country_info/:id/:box/': 'loadBox'
      },

      initialize: function() {
        //self._drawLossAndGain(); //it's called from _updateData
      },

      loadArea: function(countryId, areaId) {
        var area = self.country.get('areas').where({ id_1: Number(areaId) })[0];
        self.area = area;

        if (!self.map) {
          self._setAreaSelector();
          self._initMap(function() {
            self._displayArea(area);
          });
        } else {
          self._displayArea(area);
        }
        if ($('body').hasClass('embed')) {
          setTimeout(function(){ $('.country-title').find('h1').append(': '+self.$areaSelector.val()) },250);
        }
        self._updateData(areaId);
      },

      loadCountry: function(countryId) {
        if (!self.map) {
          self._setAreaSelector();
          self._initMap(function() {
            self._displayCountry();
          });
        } else {
          self._displayCountry();
        }
        self._updateData();
      },

      loadBox: function(countryId, box) {
        var target = $('.country-' + box);

        target.find('.info').remove();
        target.fadeIn()
      }

    });
    if (this.country){
      this.country.fetch({
        success: function() {
          Backbone.history.start({pushState: true});
        }
      });
      self.router = new Router();
      if ($('body').hasClass('embed')) {
        $('.umd_options_control').on('click', function(){
          self._onClickUMDOptions(null, '.country-preview');
        })
      }
    }
  },

  _setAreaSelector: function() {
    var self = this;

    _.each(this.country.get('areas').models, function(area) {
      if (self.area == area) {
        self.$areaSelector.append('<option value="' + area.get('name_1') + '" selected>' + area.get('name_1') + '</option>')
      } else {
        self.$areaSelector.append('<option value="' + area.get('name_1') + '">' + area.get('name_1') + '</option>')
      }
    });
    ga('send', 'event', 'Countries', 'Click', 'Change Area');
  },

  _onClickUMDOptions: function(e,tar_param) {
    if (typeof ga !== "undefined") ga('send', 'event', 'Country Page', 'Change', 'Threshold');
    e && e.preventDefault();

    if ($(e.currentTarget).data('target')) {
      tar_param = $(e.currentTarget).data('target');
    }
    var $target = $('.umdoptions_dialog'),
        tar_param  = tar_param || '.country-sidenav';
    if ($target.length === 0) UmdOptions = new gfw.ui.view.UmdOptions({ target: tar_param});
    if ($target.is(':visible') ) {
      UmdOptions.hide();
    } else {
      UmdOptions._openUMDoptions();
    }
    ga('send', 'event', 'Countries', 'Click', 'Threshold');
  },

  _updateMapThreshold: function(e) {
    var path = location.pathname.split('/');
    var id = path[path.length -1];
    var self = this;
    this.map.remove();
    if (isNaN(id)) {
      this._initMap(function() {
        self._displayCountry();
      });
      id = false;
    } else {
      var area = this.country.get('areas').where({ id_1: Number(id) })[0];
      this._initMap(function() {
        self._displayArea(area);
      });
    }
    this._updateData(id);
  },

  _onSelectArea: function() {
    var self = this,
        areaName = this.$areaSelector.val(),
        area = this.country.get('areas').where({ name_1: areaName })[0];

    if (area) {
      this.router.navigate('country/' + this.country.get('iso') + '/' + String(area.get('id_1')), {trigger: true});
      this.$el.find('#url_analysis').attr('href', '/map/6/'+ area.attributes.bounds._northEast.lat + '/'+ area.attributes.bounds._northEast.lng + '/'+ area.attributes.iso + '-' + String(area.get('id_1')) +'/grayscale/loss,forestgain?begin=2001-01-01&end=2013-12-30&threshold='+(config.canopy_choice || 30));
    } else {
      this._navigateCountry();
    }
    this._updateData(  (area) ? area.get('id_1') : null )
  },

  _navigateCountry: function() {
    this.router.navigate('country/' + this.country.get('iso'), {trigger: true});
    this.$el.find('#url_analysis').attr('href', '/map/5/0/0/'+ this.country.get('iso') +'/grayscale/loss,forestgain?begin=2001-01-01&end=2012-12-30&threshold='+(config.canopy_choice || 30));
  },

  _initMap: function(callback) {
    var self = this,
        sql = new cartodb.SQL({ user: 'wri-01' });

    sql.execute("SELECT bounds FROM country_mask WHERE code = '" + this.country.get('iso')  + "'")
      .done(function(data) {
        var geojson = L.geoJson(JSON.parse(data.rows[0].bounds)),
            bounds = geojson.getBounds();

        self.country.set('bounds', bounds);
        self._renderMap(callback);
      });
  },

  roundNumbers : function(number){
    var num = parseInt(number.replace(/,/g , ''));
    return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");;
  },

  _updateData: function(area_id) {
    var url     = 'http://beta.gfw-apis.appspot.com/forest-change/umd-loss-gain/admin/' + this.country.get('iso'),
        canopy  = config.canopy_choice || 30,
        $cnp_op = $('.umd_options_control').find('.sidenav-icon'),
        $target = $('.tree-numbers'),
        that    = this;

    if (area_id) {
      url = url + '/' +area_id + '?thresh=' + canopy;
    } else {
      url = url + '?thresh=' + canopy;
    }

    if (canopy != 30) $cnp_op.addClass('no_def');
    else $cnp_op.removeClass('no_def');

    $.ajax({
      url: url,
      dataType: 'json',
      success: function(data) {
        var amount = data.years[0].extent;

        if (amount.toString().length >= 7) {
          amount = Math.round((amount /1000)/1000)
          $target.find('.tree-cover .unit').html( 'MHa' );
        } else if (amount.toString().length >= 4) {
          $target.find('.tree-cover .unit').html( 'KHa' );
          amount = Math.round(amount /1000);
        if (amount % 1 != 0) amount = Math.round(amount)
        } else {
          $target.find('.tree-cover .unit').html( 'Ha' );
        }

        $target.find('.tree-cover .amount').html( amount.toLocaleString() );
        $target.find('.total-area .amount').html(Math.round(data.years[0].extent_perc));

        that._drawLossAndGain(data.years);
        var $link_target = [];
            $link_target[0] = $('.analyze_from_country');
            $link_target[1] = $link_target[0] .attr('href');
        if (isNaN($link_target[1].slice(-2))) {
          $link_target[1] = $link_target[1] + canopy;
        } else {
          $link_target[1] = $link_target[1].substring(0, $link_target[1].length - 2) + canopy;
        }
        $link_target[0].attr('href', $link_target[1]);
      },
      error: function(status, error) {
        $target.find('.tree-cover .amount').html( 'N/A' );
        $target.find('.total-area .amount').html( 'N/A' );

        that._drawLossAndGain();
      }
    });
  },

  _renderMap: function(callback) {
    var self = this;

    this.map = new L.Map('countryMap', {
      center: [0, 0],
      zoom: 3,
      zoomControl: false,
      dragging: false,
      touchZoom: false,
      doubleClickZoom: false,
      scrollWheelZoom: false,
      attributionControl: false,
      zoomAnimation: false,
      fadeAnimation: false,
    });

    this.forestLayer = new gfw.ui.view.leafletCanvasLayer({
      layerName: 'forest2000',
      mapOptions: {
        opacity: 0
      }
    }).getLayer().addTo(this.map);

    callback && callback();
  },

  _removeCartodblayer: function() {
    if (this.cartodbLayer) {
      this.cartodbLayer.remove();
    }
  },

  _displayCountry: function() {
    var self = this;

    this.map.fitBounds(this.country.get('bounds'));
    this._removeCartodblayer();

    this.$selectorRemove.hide();
    this.$areaSelector.val('');

    cartodb.createLayer(this.map, {
      user_name: 'wri-01',
      type: 'cartodb',
      cartodb_logo: false,
      sublayers: [{
        sql: "SELECT * FROM country_mask",
        cartocss: "\
          #country_mask {\
            polygon-fill: #373442;\
            polygon-opacity: 1;\
            line-color: #373442;\
            line-width: 1;\
            line-opacity: 1;\
          }\
          #country_mask[code='" + this.country.get('iso') + "'] {\
            polygon-opacity: 0;\
            line-color: #73707D;\
            line-width: 1;\
            line-opacity: 1;\
          }"
      }]
    })
    .addTo(this.map)
    .done(this._cartodbLayerDone);
  },

  _displayArea: function(area) {
    var self = this;
    this.$el.find('#url_analysis').attr('href', '/map/6/'+ area.attributes.bounds._northEast.lat + '/'+ area.attributes.bounds._northEast.lng + '/'+ area.attributes.iso + '-' + String(area.get('id_1')) +'/grayscale/loss,forestgain?begin=2001-01-01&end=2013-12-30&threshold='+(config.canopy_choice || 30));
    this.map.fitBounds(area.get('bounds'), {reset: true});
    this._removeCartodblayer();

    this.$selectorRemove.show();

    cartodb.createLayer(this.map, {
      user_name: 'wri-01',
      type: 'cartodb',
      cartodb_logo: false,
      sublayers: [{
        sql: "SELECT * FROM country_mask",
        cartocss: "\
          #country_mask {\
            polygon-fill: #373442;\
            polygon-opacity: 1;\
            line-color: #373442;\
            line-width: 1;\
            line-opacity: 1;\
          }\
          #country_mask[code='" + this.country.get('iso') + "'] {\
            polygon-opacity: 0;\
            line-color: #373442;\
            line-width: 1;\
            line-opacity: 1;\
          }"
      }, {
        sql: "SELECT * FROM gadm_1_all",
        cartocss: "\
          #gadm_1_all {\
            polygon-fill: #373442;\
            polygon-opacity: 1;\
            line-color: #373442;\
            line-width: 1;\
            line-opacity: 1;\
            [cartodb_id=" + area.get('cartodb_id') + "]{\
              polygon-opacity: 0;\
            }\
            ::active[cartodb_id=" + area.get('cartodb_id') + "] {\
              polygon-opacity: 0;\
              line-color: #73707D;\
              line-width: 1;\
              line-opacity: 1;\
            }\
          }"
      }]
    })
    .addTo(this.map)
    .done(this._cartodbLayerDone);
  },

  _cartodbLayerDone: function(layer) {
    var self = this;

    this.cartodbLayer = layer;

    this.cartodbLayer.on('loading' , function() {
      self.$map.removeClass('loaded');
      self.forestLayer.setOpacity(0);
    });

    this.cartodbLayer.on('load' , function() {
      self.$map.addClass('loaded');
      self.forestLayer.setOpacity(1);
    });
  },

  _drawLossAndGain: function(years_data) {
    var sql = "SELECT year, loss_gt_0 loss FROM umd WHERE iso='" + this.country.get('iso') + "' ORDER BY year ASC",
        that = this;

    var $graph = this.$('.loss-gain-graph'),
        $comingSoon = $graph.find('.coming-soon'),
        $amount = $graph.find('.graph-amount'),
        $date = $graph.find('.graph-date');

    var width     = 200,
        height    = 90,
        h         = 90, // maxHeight
        radius    = width / 2;

    d3.select(".loss-gain-graph svg")
          .remove(); //clear the d3 object due to allow reprinting
    var graph = d3.select('.loss-gain-graph .graph')
      .append('svg:svg')
      .attr('width', width)
      .attr('height', height);

    $graph.removeClass('ghost');
    var data = years_data;
    var data_ = [];

    _.each(data, function(val, key) {
      if (val.year >= 2001) {
        data_.push({
          'year': val.year,
          'value': val.loss//eval('val.' + options.dataset)
        });
      }
    });

    $amount.html('' + formatNumber(parseInt(data_[data_.length - 1].value, 10)) + '');
    $date.html('Hectares lost in ' + data_[data_.length - 1].year);

    var marginLeft = 5,
        marginTop = 0;

    var y_scale = d3.scale.linear()
      .domain([0, d3.max(data_, function(d) { return parseFloat(d.value); })])
      .range([height, marginTop * 2]);

    var barWidth = 16;

    var bar = graph.selectAll('g')
      .data(data_)
      .enter()
      .append('g')
      .attr('transform', function(d, i) { return 'translate(' + (marginLeft + i * barWidth) + ',' + -marginTop + ')'; });

    bar.append('svg:rect')
      .attr('class', 'bar')
      .attr('y', function(d) { return y_scale(d.value); })
      .attr('height', function(d) { return height - y_scale(d.value); })
      .attr('width', barWidth - 2)
      .style('fill', function(d, i) {
        if (i === 11) {
          return '#9FBA2B';
        } else {
          return '#524F5C';
        }
      })
      .on('mouseover', function(d) {
        d3.selectAll('.bar').style('fill', '#524F5C');
        d3.select(this).style('fill', '#9FBA2B');

        $amount.html('' + formatNumber(parseInt(d.value, 10)) + '');
        $date.html('Hectares lost in ' + d.year);
      });

    // Draw gain line
    var gainAverage = years_data[1].gain;

    var tooltip = d3.select('.loss-gain-graph')
      .append('div')
      .attr('class', 'gain-tooltip')
      .style('visibility', 'hidden')
      .text(formatNumber(parseInt(gainAverage), 10));

    tooltip
      .append('span')
      .text('Average Ha of gain/year');

    var gainLine = graph.append('svg:rect')
      .attr('class', 'gain-line')
      .attr('x', 0)
      .attr('y', Math.abs(y_scale(gainAverage)))
      .attr('height', 1)
      .attr('width', width)
      .style('stroke', 'transparent')
      .style("stroke-width", "3")
      .style('fill', '#ccc');

    gainLine
      .on('mousemove', function() {
        d3.select('.gain-line')
          .style('height', 2)
          .style('fill', 'white');

        tooltip
          .style('visibility', 'visible')
          .style("top", Math.abs(y_scale(gainAverage)) + "px")
          .style("left", (d3.mouse(this)[0] - 58) + "px");
      })
      .on('mouseout', function() {
        d3.select('.gain-line')
          .style('height', 1)
          .style('fill', '#ccc');

        tooltip.style('visibility', 'hidden');
      })
  }

});


text:
layout: post
date: 2018-03-01
title: "Ellis Bridals Style 11032 Sleeveless Chapel Train Ballgown"
category: Ellis
tags: [Ellis ,Ellis,Ballgown,Strapless,Chapel Train,Sleeveless]
---
### Ellis Bridals Style 11032
Just **$289.99**
###   Sleeveless Chapel Train Ballgown

BRANDS	Ellis

Silhouette	Ballgown

Neckline	Strapless

Hemline/Train	Chapel Train

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/ellis/4710-ellis-bridals-style-11032.html](https://www.readybrides.com/en/ellis/4710-ellis-bridals-style-11032.html)


text:
id: 587d825a367417b2b2512c88
title: Reverse a Doubly Linked List
challengeType: 1
forumTopicId: 301714
localeTitle: Переверните двойной список ссылок
---

## Description

Давайте создадим еще один метод для нашего дважды связанного списка, который называется reverse, который меняет список на месте. Как только метод выполняется, голова должна указывать на предыдущий хвост, а хвост должен указывать на предыдущую голову. Теперь, если мы пересекаем список от головы до хвоста, мы должны встретить узлы в обратном порядке по сравнению с исходным списком. Попытка изменить пустой список должна вернуть значение null.

## Instructions

## Tests

```yml
tests:
  - text: The DoublyLinkedList data structure exists.
    testString: assert((function() { var test = false; if (typeof DoublyLinkedList !== 'undefined') { test = new DoublyLinkedList() }; return (typeof test == 'object')})());
  - text: The DoublyLinkedList has a method called add.
    testString: assert((function() { var test = false; if (typeof DoublyLinkedList !== 'undefined') { test = new DoublyLinkedList() }; if (test.add == undefined) { return false; }; return (typeof test.add == 'function')})());
  - text: The DoublyLinkedList has a method called reverse.
    testString: assert((function() { var test = false; if (typeof DoublyLinkedList !== 'undefined') { test = new DoublyLinkedList() }; if (test.reverse == undefined) { return false; }; return (typeof test.reverse == 'function')})());
  - text: Reversing an empty list returns null.
    testString: assert((function() { var test = false; if (typeof DoublyLinkedList !== 'undefined') { test = new DoublyLinkedList() }; return (test.reverse() == null); })());
  - text: The reverse method reverses the list.
    testString: assert((function() { var test = false; if (typeof DoublyLinkedList !== 'undefined') { test = new DoublyLinkedList() }; test.add(58); test.add(61); test.add(32); test.reverse(); return (test.print().join('') == '326158'); })());
  - text: The next and previous references are correctly maintained when a list is reversed.
    testString: assert((function() { var test = false; if (typeof DoublyLinkedList !== 'undefined') { test = new DoublyLinkedList() }; test.add(11); test.add(22); test.add(33); test.reverse(); return (test.printReverse().join('') == '112233'); })());

```

## Challenge Seed

```js
var Node = function(data, prev) {
  this.data = data;
  this.prev = prev;
  this.next = null;
};
var DoublyLinkedList = function() {
  this.head = null;
  this.tail = null;
  // change code below this line
  // change code above this line
};

```

### After Tests

```js
DoublyLinkedList.prototype = {
  add(data) {
    if (this.head == null) {
      this.head = new Node(data, null);
      this.tail = this.head;
    } else {
      var node = this.head;
      var prev = null;
      while (node.next != null) {
        prev = node;
        node = node.next;
      };
      var newNode = new Node(data, node);
      node.next = newNode;
      this.tail = newNode;
    };
  },
  print() {
    if (this.head == null) {
      return null;
    } else {
      var result = new Array();
      var node = this.head;
      while (node.next != null) {
        result.push(node.data);
        node = node.next;
      };
      result.push(node.data);
      return result;
    };
  },
  printReverse() {
    if (this.tail == null) {
      return null;
    } else {
      var result = new Array();
      var node = this.tail;
      while (node.prev != null) {
        result.push(node.data);
        node = node.prev;
      };
      result.push(node.data);
      return result;
    };
  }
};

```

## Solution

```js
// solution required
```


text: without SourceMap


text:
require "helper"

describe Google::Cloud::Firestore::Transaction, :set, :mock_firestore do

  let(:transaction) do
    Google::Cloud::Firestore::Transaction.from_client(firestore).tap do |b|
      b.instance_variable_set :@transaction_id, transaction_id
    end
  end

  let(:document_path) { "users/alice" }

  let(:commit_time) { Time.now }
  let :set_writes do
    [Google::Cloud::Firestore::V1::Write.new(
      update: Google::Cloud::Firestore::V1::Document.new(
        name: "#{documents_path}/#{document_path}",
        fields: Google::Cloud::Firestore::Convert.hash_to_fields({ name: "Alice" }))
    )]
  end
  let :commit_resp do
    Google::Cloud::Firestore::V1::CommitResponse.new(
      commit_time: Google::Cloud::Firestore::Convert.time_to_timestamp(commit_time),
      write_results: [Google::Cloud::Firestore::V1::WriteResult.new(
        update_time: Google::Cloud::Firestore::Convert.time_to_timestamp(commit_time))]
      )
  end

  it "sets a new document given a string path" do
    firestore_mock.expect :commit, commit_resp, commit_args(writes: set_writes, transaction: transaction_id)

    transaction.set(document_path, { name: "Alice" })
    resp = transaction.commit

    _(resp).must_be_kind_of Google::Cloud::Firestore::CommitResponse
    _(resp.commit_time).must_equal commit_time
  end

  it "sets a new document given a DocumentReference" do
    firestore_mock.expect :commit, commit_resp, commit_args(writes: set_writes, transaction: transaction_id)

    doc = firestore.doc document_path
    _(doc).must_be_kind_of Google::Cloud::Firestore::DocumentReference

    transaction.set(doc, { name: "Alice" })
    resp = transaction.commit

    _(resp).must_be_kind_of Google::Cloud::Firestore::CommitResponse
    _(resp.commit_time).must_equal commit_time
  end

  it "raises if not given a Hash" do
    error = expect do
      transaction.set document_path, "not a hash"
    end.must_raise ArgumentError
    _(error.message).must_equal "data is required"
  end
end


text:
package io.mycat.buffer;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import junit.framework.Assert;
import org.junit.Test;

import sun.nio.ch.DirectBuffer;

public class TestDirectByteBufferPool {

    @Test
    public void testAllocate() {
        int pageSize = 1024 * 1024 * 100;
        int allocTimes = 1024;
        DirectByteBufferPool pool = new DirectByteBufferPool(pageSize, (short) 256, (short) 8,0);
        long start = System.currentTimeMillis();
        for (int i = 0; i < allocTimes; i++) {
            //System.out.println("allocate "+i);
            //long start=System.nanoTime();
            int size = (i % 1024) + 1 ;
            ByteBuffer byteBufer = pool.allocate(size);
            ByteBuffer byteBufer2 = pool.allocate(size);
            ByteBuffer byteBufer3 = pool.allocate(size);
            //System.out.println("alloc "+size+" usage "+(System.nanoTime()-start));
            //start=System.nanoTime();
            pool.recycle(byteBufer);
            pool.recycle(byteBufer3);
            //System.out.println("recycle usage "+(System.nanoTime()-start));
        }
        long used = (System.currentTimeMillis() - start);
        System.out.println("total used time  " + used + " avg speed " + allocTimes / used);
    }

    @Test
    public void testAllocateWithDifferentAddress() {
        int size = 256;
        int pageSize = size * 4;
        int allocTimes = 8;
        DirectByteBufferPool pool = new DirectByteBufferPool(pageSize, (short) 256, (short) 2,0);

        Map<Long, ByteBuffer> buffs = new HashMap<Long, ByteBuffer>(8);
        ByteBuffer byteBuffer = null;
        DirectBuffer directBuffer = null;
        ByteBuffer temp = null;
        long address;
        boolean failure = false;
        for (int i = 0; i < allocTimes; i++) {
            byteBuffer = pool.allocate(size);
            if (byteBuffer == null) {
                Assert.fail("Should have enough memory");
            }
            directBuffer = (DirectBuffer) byteBuffer;
            address = directBuffer.address();
            System.out.println(address);
            temp = buffs.get(address);
            buffs.put(address, byteBuffer);
            if (null != temp) {
                failure = true;
                break;
            }
        }

        for (ByteBuffer buff : buffs.values()) {
            pool.recycle(buff);
        }

        if (failure == true) {
            Assert.fail("Allocate with same address");
        }
    }

    @Test
    public void testAllocateNullWhenOutOfMemory() {
        int size = 256;
        int pageSize = size * 4;
        int allocTimes = 9;
        DirectByteBufferPool pool = new DirectByteBufferPool(pageSize, (short) 256, (short) 2,0);
        long start = System.currentTimeMillis();
        ByteBuffer byteBuffer = null;
        List<ByteBuffer> buffs = new ArrayList<ByteBuffer>();
        int i = 0;
        for (; i < allocTimes; i++) {
            byteBuffer = pool.allocate(size);
            if (byteBuffer == null||!(byteBuffer instanceof DirectBuffer) ) {
                break;
            }
            buffs.add(byteBuffer);
        }
        for (ByteBuffer buff : buffs) {
            pool.recycle(buff);
        }

        Assert.assertEquals("Should out of memory when i = " + 8, i, 8);
    }

    @Test
    public void testAllocateSign() {
        int size = 256;
        int pageSize = size * 4;
        int allocTimes = 9;
        DirectByteBufferPool pool = new DirectByteBufferPool(pageSize, (short) 256, (short) 2,0);
        long start = System.currentTimeMillis();
        ByteBuffer byteBuffer = null;
        List<ByteBuffer> buffs = new ArrayList<ByteBuffer>();
        int i = 0;
        for (; i < allocTimes; i++) {
            byteBuffer = pool.allocate(size);
            if (byteBuffer == null||!(byteBuffer instanceof DirectBuffer) ) {
                break;
            }
            buffs.add(byteBuffer);
        }
        for (ByteBuffer buff : buffs) {
            pool.recycle(buff);
        }

        Assert.assertEquals("Should out of memory when i = " + 8, i, 8);
    }

    @Test
    public  void testExpandBuffer(){
        int size = 512;
        int pageSize = 1024*1024;
        int allocTimes = 9;
        DirectByteBufferPool pool = new DirectByteBufferPool(pageSize, (short) 512, (short) 64,0);
        ByteBuffer byteBuffer = pool.allocate(1024);
        String str = "DirectByteBufferPool pool = new DirectByteBufferPool(pageSize, (short) 256, (short) 8)";
        ByteBuffer newByteBuffer = null;
        int i = 0;
        while (i<10){
            if(byteBuffer.remaining()<str.length()){
                newByteBuffer = pool.expandBuffer(byteBuffer);
                byteBuffer = newByteBuffer;
                i++;
            }else {
                byteBuffer.put(str.getBytes());
            }
            System.out.println("remaining: " +  byteBuffer.remaining() + "capacity: " + byteBuffer.capacity());
        }

        System.out.println("capacity : " + byteBuffer.capacity());
        System.out.println("capacity : " + byteBuffer.position());

        byte [] bytes = new byte[byteBuffer.position()];
        byteBuffer.flip();
        byteBuffer.get(bytes);
        String body = new String(bytes);

        System.out.println(byteBuffer.position());

        System.out.println(body);

        System.out.println("size :" + body.length());
        pool.recycle(byteBuffer);
    }

}


text:
package playground;

import com.google.common.base.Throwables;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.Version;

import java.io.IOException;

public class JoinedSearcher {
    private static final StandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_47);

    public IndexWriter createWriter(Directory index) throws IOException {
        IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_47, analyzer);
        IndexWriter w = new IndexWriter(index, config);

        return w;
    }

    public void addDocuments(IndexWriter w, Iterable<Document> docs) {
        try {
            w.addDocuments(docs, analyzer);
        } catch (IOException e) {
            throw Throwables.propagate(e);
        }
    }
}


text: export { default } from 'supertree-auth/components/users/reset-password/component';