text:
<% breadcrumb :tos_appendix %>
#### Załącznik nr 1 do [Regulaminu](/regulamin):

# Ogłoszenia i usługi w In Jobs.pl

## Ogłoszenia dla Pracodawcy

### Darmowe ogłoszenia

Jako Pracodawca, po rejestracji w serwisie
[*www.injobs.pl*](http://www.injobs.pl) dodasz nielimitowanie i
bezterminowe ogłoszenia o pracę. Twoje oferty będą widoczne w wielu
kategoriach. Wyszukanie ich przez kandydatów jest wyjątkowo proste. Aby
publikować oferty pracy wystarczy, że założysz bezpłatne konto. Po
podaniu podstawowych informacji o firmie możesz zacząć publikacje swoich
ofert pracy.

Zamieszczane w serwisie oferty pracy są dodatkowo promowane w naszych
serwisach partnerskich. Twoje ogłoszenie będzie więc widoczne nie tylko
na [*www.injobs.pl*](http://www.injobs.pl) ale także na innych stronach
z ofertami pracy. Podsumowując – twoje ogłoszenie zobaczy o wiele więcej
osób.

### Panel dla Pracodawcy

Po założeniu bezpłatnego Konta Pracodawcy otrzymasz dostęp do Panelu Pracodawcy z
prostą i funkcjonalną strukturą, w którym możesz zarządzać swoimi
ogłoszeniami.

Oprócz tego proponujemy:

- Wizytówka Pracodawcy: Udostępniamy Ci zupełnie za darmo rozbudowany
profil Pracodawcy! Dodaj opis swojej firmy, zdjęcia, dokumenty
rejestrowe i ciesz się pozytywną opinią kandydatów.

- Wyróżnieni Pracodawcy: Promuj swoją firmę i buduj markę zaufanego
Pracodawcy. Dodaj logo firmy, aby zwiększyć rozpoznawalność swojego przedsiębiorstwa.

Wszelkie sprawy związane z funkcjonowaniem serwisu, dodawaniem ofert,
indywidulanymi pakietami staramy się rozwiązywać tak szybko, jak to możliwe. Wszelkie pytania i sugestie odnośnie funkcjonowania Serwisu prosimy kierować na adres e-mail:
[kontakt@injobs.pl](mailto:kontakt@injobs.pl) .

Z okazji uruchomienia serwisu www.injobs.pl oferujemy atrakcyjne ceny
usług dodatkowych i wyróżnień.
 Promocja jest ważna do odwołania.

Pozdrawiamy – Zespół InJobs.pl

### Płatne ogłoszenia w Injobs.pl

#### 1\. Promowany Pracodawca

- ogłoszenie wyświetlane w dużym formacie na stronie głównej Serwisu
[*www.injobs.pl*](http://www.injobs.pl) w sekcji "Wyróżnieni Pracodawcy"

- przekierowanie bezpośrednie na Profil Pracodawcy z wyłącznie jego
ofertami pracy

Czas promowania - 30 dni (promocja)

Cena promocyjna - 39,99 PLN lub 10€ netto za miesiąc / 49,19 PLN lub
12,3€ brutto

#### 2\. Wyróżnienie Premium Pro („Najciekawsze Oferty”).

- ogłoszenie wyświetlane w dużym formacie na stronie głównej Serwisu
[*www.injobs.pl*](http://www.injobs.pl)

Czas promowania 30 dni (promocja)

Cena promocyjna - 29,99 PLN lub 8€ netto za miesiąc / 36,89 PLN lub
9,84€ brutto

#### 3\. Wyróżnienie Premium

- ogłoszenie na pierwszej podstronie

- pierwsze miejsce w kategorii "Praca w Polsce" lub "Praca za granicą" '
w serwisie [*www.injobs.pl*](http://www.injobs.pl)

Czas promowania 30 dni (promocja)

Cena promocyjna - 10,98 PLN lub 3€ netto za miesiąc / 13,51 PLN lub
3,69€ brutto

#### 4\. Wyróżnienie Standard

- ogłoszenie podświetlone (żółtym kolorem) na liście ogłoszeń w serwisie
[*www.injobs.pl*](http://www.injobs.pl)

Czas promowania 30 dni (promocja)

Cena promocyjna - 5 PLN lub 1,5€ netto za miesiąc / 6,15 PLN lub 1,85€
brutto

#### 5\. Promowanie na Facebooku

- publikacja postu na fanpage 'u IN JOBS z linkiem do oferty pracy w
naszym serwisie

Czas promowania – bezterminowa widoczność ogłoszenia na fanpage 'u.

Cena promocyjna - 39,99 PLN lub 10€ netto za miesiąc / 49,19 PLN lub
12,3€ brutto

### Płatności (opcjonalne)

Użytkownik ma prawo do wykupienia reklamy - promocji poszczególnych
ofert.

1\. Przelewy za usługi płatne prosimy dokonywać na konto spółki :

InJobs.pl Sp. z o.o ul. Sobczyńskiego 2c 11-700 Mrągowo

NIP 742-22-56-702 KRS 0000685786

ING Bank Śląski Spółka Akcyjna, ul. Sokolska 34, 40-086 Katowice

Konto złotówkowe : 41 1050 1764 1000 0090 8020 2782

Konto walutowe € (euro) : 19 1050 1764 1000 0090 8020 2790

2\. Płatności przez Serwis [www.injobs.pl](http://www.injobs.pl)obsługiwane są przez firmy:

- Dotpay S.A. z  siedzibą w Krakowie, przy ul. Wielickiej 72, 30-552
Kraków, NIP 6342661860, REGON 240770255,  wpisaną do rejestru
przedsiębiorców pod numerem KRS 0000296790, prowadzonego przez Sąd
Rejonowy Kraków Śródmieście w Krakowie, Wydział XI Gospodarczy Krajowego
Rejestru Sądowego.

- Firma PayPal (Europe) S.à r.l. & Cie, S.C.A z siedzibą pod adresem
L-1150 w Luksemburgu dysponuje ważną licencją jako luksemburska
instytucja kredytowa w rozumieniu artykułu 2 ustawy o sektorze
finansowym z 5 kwietnia 1993 roku w wersji poprawionej i podlega
ścisłemu nadzorowi luksemburskiej instytucji nadzorczej, Commission de
Surveillance du Secteur Financier (Komisji Nadzoru Sektora Finansowego).

3\. Dane transakcyjne, w tym dane osobowe, mogą zostać przekazane na
rzecz Dotpay S.A oraz PayPal w zakresie niezbędnym do obsługi płatności
za zamówienie.


text:
namespace Extractor.iOS.Entity
{
    internal sealed class DbAttachment
    {
        public int attachment_id { get; set; }

        public string filename { get; set; }

        public int message_id { get; set; }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
/*------------------------------------*\
	ShortCode Functions
\*------------------------------------*/

// Shortcode: [column]
function shortcode_column($atts, $content)
{
extract( shortcode_atts( array(
    	'class' => '',
	), $atts ) );

return ("
". do_shortcode($content) . "
");
}
add_shortcode('column', 'shortcode_column');
add_shortcode('col', 'shortcode_column');

?>


text:
module Spree
  class ReferredRecord < Spree::Base
    belongs_to :referral
    belongs_to :user, class_name: Spree.user_class.to_s
    belongs_to :affiliate
    belongs_to :store_credit

    validates_presence_of :user
  end
end


text:
<?php

class DatabaseSeeder extends Seeder {

	/**
	 * Run the database seeds.
	 *
	 * @return void
	 */
	public function run()
	{
		Eloquent::unguard();

		// $this->call('UserTableSeeder');
		$this->call('AdministratorSeeder');
	}

}

class AdministratorSeeder extends Seeder {

	public function run()
	{
		DB::table('administrators')->delete();
		$data = array(
			'email' 	=> 'elrafael123@gmail.com',
			'name'		=> 'Rafael V. de Oliveira',
			'password'	=> Hash::make('paprika')
		);
		App\Modules\Site\Models\Site::create($data);
	}
}


text:
class ReflectionsController < AuthenticatedController
  include ApplicationHelper

  def new
    @reflection = Reflection.new
    @todo_list = current_user.todo_lists.daily.find_by(date: params[:date]) ||
                 TodoList.today(current_user)

    @daily_snapshot = @todo_list.daily_snapshot
    set_link_text_and_url

    if Reflection.today(current_user).present? && reflecting_on_today?
      flash[:error] = 'You already wrote your reflection for today.'
      redirect_to dashboard_path
    elsif TodoList.today(current_user).blank? && reflecting_on_today?
      flash[:error] = 'You must start your tasks for today before writing a reflection.'
      redirect_to dashboard_path
    end
  end

  def create
    @reflection = Reflection.new(reflection_params)
    @reflection.user = current_user

    @todo_list = current_user.todo_lists.daily.find_by(date: reflection_params[:date])
    @todo_list.daily_snapshot&.destroy

    if @reflection.save
      @daily_snapshot = DailySnapshot.create_from_todo_list(@todo_list)

      Todo.where(id: params[:add_to_week]).each do |todo|
        todo.update(
          weekly_todo_list_id: current_week_plan.id,
          daily_todo_list_id: nil
        )
      end

      redirect_to after_create_path
    else
      set_link_text_and_url
      render :new
    end
  end

  private

  def after_create_path
    if @reflection.date != Date.current
      day_path(@daily_snapshot.date)
    elsif tomorrow_is_trackable?
      tomorrow_path
    else
      flash[:success] = 'Nice job today! Get some rest.'
      dashboard_path
    end
  end

  def reflection_params
    params.require(:reflection).permit(
      :rating,
      :positive,
      :negative,
      :undone,
      :date
    )
  end

  def reflecting_on_today?
    @todo_list == TodoList.today(current_user)
  end

  def set_link_text_and_url
    @link_text, @link_url = if reflecting_on_today?
                              ["Go back to today's tasks", today_path]
                            else
                              ["Go back", day_path(@daily_snapshot.date)]
                            end
  end
end


text:
#include "Gpufit/gpufit.h"

#include <mex.h>

#include <cstring>
#include <string>

#if (defined _MSC_VER && _MSC_VER <= 1800)
#define PRINT_MSG _snprintf_s
#else
#define PRINT_MSG snprintf
#endif

#ifdef GPUFIT_DOUBLE
#define MX_REAL mxDOUBLE_CLASS
#define TOLERANCE_PRECISION_MESSAGE()\
    mexErrMsgIdAndTxt("Gpufit:Mex", "tolerance is not a double");
#else
#define MX_REAL mxSINGLE_CLASS
#define TOLERANCE_PRECISION_MESSAGE()\
    mexErrMsgIdAndTxt("Gpufit:Mex", "tolerance is not a single");
#endif // GPUFIT_DOUBLE

/*
	Get a arbitrary scalar (non complex) and check for class id.
	https://www.mathworks.com/help/matlab/apiref/mxclassid.html
*/
template<class T> inline bool get_scalar(const mxArray *p, T &v, const mxClassID id)
{
	if (mxIsNumeric(p) && !mxIsComplex(p) && mxGetNumberOfElements(p) == 1 && mxGetClassID(p) == id)
	{
		v = *static_cast<T *>(mxGetData(p));
		return true;
	}
	else {
		return false;
	}
}

void mexFunction(
    int          nlhs,
    mxArray      *plhs[],
    int          nrhs,
    mxArray const *prhs[])
{
    int expected_nrhs = 0;
    int expected_nlhs = 0;
    bool wrong_nrhs = false;
    bool wrong_nlhs = false;

    // expects a certain number of input (nrhs) and output (nlhs) arguments
    expected_nrhs = 13;
    expected_nlhs = 4;

    if (nrhs != expected_nrhs)
    {
        char msg[50];
        PRINT_MSG(msg, 50, "%d input arguments required.", expected_nrhs);
        mexErrMsgIdAndTxt("Gpufit:Mex", msg);
    }

    if (nlhs != expected_nlhs)
    {
        char msg[50];
        PRINT_MSG(msg, 50, "%d output arguments required.", expected_nlhs);
        mexErrMsgIdAndTxt("Gpufit:Mex", msg);
	}

	// input parameters
	REAL * data = (REAL*)mxGetPr(prhs[0]);
	REAL * weights = (REAL*)mxGetPr(prhs[1]);
    std::size_t n_fits = (std::size_t)*mxGetPr(prhs[2]);
    std::size_t n_points = (std::size_t)*mxGetPr(prhs[3]);

	// tolerance
	REAL tolerance = 0;
	if (!get_scalar(prhs[4], tolerance, MX_REAL))
	{
        TOLERANCE_PRECISION_MESSAGE();
	}

	// max_n_iterations
	int max_n_iterations = 0;
	if (!get_scalar(prhs[5], max_n_iterations, mxINT32_CLASS))
	{
		mexErrMsgIdAndTxt("Gpufit:Mex", "max_n_iteration is not int32");
	}

    int estimator_id = (int)*mxGetPr(prhs[6]);
	REAL * initial_parameters = (REAL*)mxGetPr(prhs[7]);
	int * parameters_to_fit = (int*)mxGetPr(prhs[8]);
    int model_id = (int)*mxGetPr(prhs[9]);
    int n_parameters = (int)*mxGetPr(prhs[10]);
	int * user_info = (int*)mxGetPr(prhs[11]);
    std::size_t user_info_size = (std::size_t)*mxGetPr(prhs[12]);

	// output parameters
    REAL * output_parameters;
	mxArray * mx_parameters;
	mx_parameters = mxCreateNumericMatrix(1, n_fits*n_parameters, MX_REAL, mxREAL);
	output_parameters = (REAL*)mxGetData(mx_parameters);
	plhs[0] = mx_parameters;

    int * output_states;
	mxArray * mx_states;
	mx_states = mxCreateNumericMatrix(1, n_fits, mxINT32_CLASS, mxREAL);
	output_states = (int*)mxGetData(mx_states);
	plhs[1] = mx_states;

    REAL * output_chi_squares;
	mxArray * mx_chi_squares;
	mx_chi_squares = mxCreateNumericMatrix(1, n_fits, MX_REAL, mxREAL);
	output_chi_squares = (REAL*)mxGetData(mx_chi_squares);
	plhs[2] = mx_chi_squares;

    int * output_n_iterations;
    mxArray * mx_n_iterations;
    mx_n_iterations = mxCreateNumericMatrix(1, n_fits, mxINT32_CLASS, mxREAL);
    output_n_iterations = (int*)mxGetData(mx_n_iterations);
    plhs[3] = mx_n_iterations;

	// call to gpufit
    int const status
            = gpufit
            (
                n_fits,
                n_points,
                data,
                weights,
                model_id,
                initial_parameters,
                tolerance,
                max_n_iterations,
                parameters_to_fit,
                estimator_id,
                user_info_size,
                reinterpret_cast< char * >( user_info ),
                output_parameters,
                output_states,
                output_chi_squares,
                output_n_iterations
            ) ;

	// check status
    if (status != ReturnState::OK)
    {
        std::string const error = gpufit_get_last_error() ;
        mexErrMsgIdAndTxt( "Gpufit:Mex", error.c_str() ) ;
    }
}


text:
#ifndef _OBJC_CONFIG_H_
#define _OBJC_CONFIG_H_

#include <TargetConditionals.h>

// Define SUPPORT_GC=1 to enable garbage collection.
// Be sure to edit OBJC_NO_GC in objc-auto.h as well.
#if TARGET_OS_EMBEDDED  ||  TARGET_OS_IPHONE  ||  TARGET_OS_WIN32
#   define SUPPORT_GC 0
#else
#   define SUPPORT_GC 1
#endif

// Define SUPPORT_ZONES=1 to enable malloc zone support in NXHashTable.
#if TARGET_OS_EMBEDDED  ||  TARGET_OS_IPHONE
#   define SUPPORT_ZONES 0
#else
#   define SUPPORT_ZONES 1
#endif

// Define SUPPORT_MOD=1 to use the mod operator in NXHashTable and objc-sel-set
#if defined(__arm__)
#   define SUPPORT_MOD 0
#else
#   define SUPPORT_MOD 1
#endif

// Define SUPPORT_PREOPT=1 to enable dyld shared cache optimizations
#if TARGET_OS_WIN32  ||  TARGET_IPHONE_SIMULATOR
#   define SUPPORT_PREOPT 0
#else
#   define SUPPORT_PREOPT 1
#endif

// Define SUPPORT_TAGGED_POINTERS=1 to enable tagged pointer objects
// Be sure to edit tagged pointer SPI in objc-internal.h as well.
#if !(__OBJC2__  &&  __LP64__)
#   define SUPPORT_TAGGED_POINTERS 0
#else
#   define SUPPORT_TAGGED_POINTERS 1
#endif

// Define SUPPORT_MSB_TAGGED_POINTERS to use the MSB
// as the tagged pointer marker instead of the LSB.
// Be sure to edit tagged pointer SPI in objc-internal.h as well.
#if !SUPPORT_TAGGED_POINTERS  ||  !TARGET_OS_IPHONE
#   define SUPPORT_MSB_TAGGED_POINTERS 0
#else
#   define SUPPORT_MSB_TAGGED_POINTERS 1
#endif

// Define SUPPORT_NONPOINTER_ISA=1 to enable extra data in the isa field.
#if !__LP64__  ||  TARGET_OS_WIN32  ||  TARGET_IPHONE_SIMULATOR  ||  __x86_64__
#   define SUPPORT_NONPOINTER_ISA 0
#else
#   define SUPPORT_NONPOINTER_ISA 1
#endif

// Define SUPPORT_FIXUP=1 to repair calls sites for fixup dispatch.
// Fixup messaging itself is no longer supported.
// Be sure to edit objc-abi.h as well (objc_msgSend*_fixup)
// Note TARGET_OS_MAC is also set for iOS simulator.
#if !__x86_64__  ||  !TARGET_OS_MAC
#   define SUPPORT_FIXUP 0
#else
#   define SUPPORT_FIXUP 1
#endif

// Define SUPPORT_IGNORED_SELECTOR_CONSTANT to remap GC-ignored selectors.
// Good: fast ignore in objc_msgSend. Bad: disable shared cache optimizations
// Now used only for old-ABI GC.
// This is required for binary compatibility on 32-bit Mac: rdar://13757938
#if __OBJC2__  ||  !SUPPORT_GC
#   define SUPPORT_IGNORED_SELECTOR_CONSTANT 0
#else
#   define SUPPORT_IGNORED_SELECTOR_CONSTANT 1
#   if defined(__i386__)
#       define kIgnore 0xfffeb010
#   else
#       error unknown architecture
#   endif
#endif

// Define SUPPORT_ZEROCOST_EXCEPTIONS to use "zero-cost" exceptions for OBJC2.
// Be sure to edit objc-exception.h as well (objc_add/removeExceptionHandler)
#if !__OBJC2__  ||  defined(__arm__)
#   define SUPPORT_ZEROCOST_EXCEPTIONS 0
#else
#   define SUPPORT_ZEROCOST_EXCEPTIONS 1
#endif

// Define SUPPORT_ALT_HANDLERS if you're using zero-cost exceptions
// but also need to support AppKit's alt-handler scheme
// Be sure to edit objc-exception.h as well (objc_add/removeExceptionHandler)
#if !SUPPORT_ZEROCOST_EXCEPTIONS  ||  TARGET_OS_IPHONE  ||  TARGET_OS_EMBEDDED
#   define SUPPORT_ALT_HANDLERS 0
#else
#   define SUPPORT_ALT_HANDLERS 1
#endif

// Define SUPPORT_RETURN_AUTORELEASE to optimize autoreleased return values
#if !__OBJC2__  ||  TARGET_OS_WIN32
#   define SUPPORT_RETURN_AUTORELEASE 0
#else
#   define SUPPORT_RETURN_AUTORELEASE 1
#endif

// Define SUPPORT_STRET on architectures that need separate struct-return ABI.
#if defined(__arm64__)
#   define SUPPORT_STRET 0
#else
#   define SUPPORT_STRET 1
#endif

// Define SUPPORT_MESSAGE_LOGGING to enable NSObjCMessageLoggingEnabled
#if TARGET_OS_WIN32  ||  TARGET_OS_EMBEDDED
#   define SUPPORT_MESSAGE_LOGGING 0
#else
#   define SUPPORT_MESSAGE_LOGGING 1
#endif

// Define SUPPORT_QOS_HACK to work around deadlocks due to QoS bugs.
#if !__OBJC2__  ||  TARGET_OS_WIN32
#   define SUPPORT_QOS_HACK 0
#else
#   define SUPPORT_QOS_HACK 1
#endif

// OBJC_INSTRUMENTED controls whether message dispatching is dynamically
// monitored.  Monitoring introduces substantial overhead.
// NOTE: To define this condition, do so in the build command, NOT by
// uncommenting the line here.  This is because objc-class.h heeds this
// condition, but objc-class.h can not #include this file (objc-config.h)
// because objc-class.h is public and objc-config.h is not.
//#define OBJC_INSTRUMENTED

#endif


text:
/*
using System;
using System.Collections;
using System.Reflection;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Serialization.Formatters;

using Alphora.Dataphor.DAE;
using Alphora.Dataphor.DAE.Contracts;

namespace Alphora.Dataphor.DAE.Server
{
    public static class ServerFactory
    {
		public static IServer Connect(string AServerURI, string AClientHostName)
		{
			return Connect(AServerURI, false, AClientHostName);
		}

		/// <summary> Connect to a remote server by it's URI. </summary>
		/// <returns> An IServer interface representing a server instance. </returns>
        public static IServer Connect(string AServerURI, bool AClientSideLoggingEnabled, string AClientHostName)
        {
			RemotingUtility.EnsureClientChannel();
			IServer LServer = (IServer)Activator.GetObject(typeof(IRemoteServer), AServerURI);
			if (LServer == null)
				throw new ServerException(ServerException.Codes.UnableToConnectToServer, AServerURI);
			if (!RemotingServices.IsTransparentProxy(LServer))
				return LServer;
			else
				return new LocalServer((IRemoteServer)LServer, AClientSideLoggingEnabled, AClientHostName);
        }

        /// <summary> Dereferences a server object </summary>
        public static void Disconnect(IServer AServer)
        {
			LocalServer LServer = AServer as LocalServer;
			if (LServer != null)
				LServer.RemoveReference();
        }
	}
}
*/


text:
Problem State
=============

Given a linked list, determine if it has a cycle in it.

Follow up:
Can you solve it without using extra space?


text:
package de.kaiserpfalzedv.office.tenant.api.replies;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import de.kaiserpfalzedv.office.tenant.api.Tenant;
import de.kaiserpfalzedv.office.tenant.api.TenantImpl;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotNull;
import java.util.UUID;

import static com.fasterxml.jackson.annotation.JsonTypeInfo.As.PROPERTY;

/**
 * @author klenkes {@literal <rlichti@kaiserpfalz-edv.de>}
 * @version 1.0.0
 * @since 2016-09-25
 */
public abstract class TenantContainingBaseReply extends TenantBaseReply {
    private static final long serialVersionUID = 298502452426137159L;

    @JsonTypeInfo(defaultImpl = TenantImpl.class, use = JsonTypeInfo.Id.NAME, include = PROPERTY)
    private Tenant tenant;

    public TenantContainingBaseReply(
            @NotNull final UUID source,
            @NotNull final UUID commandId,
            @NotNull final UUID replyId,
            @NotNull final Tenant tenant
    ) {
        super(source, commandId, replyId);

        this.tenant = tenant;
    }

    public Tenant getTenant() {
        return tenant;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
                .appendSuper(super.toString())
                .append("tenant", tenant.getId())
                .toString();
    }
}


text:
DELIMITER $$
DROP FUNCTION IF EXISTS `ptopoint` $$
CREATE FUNCTION `ptopoint` (p1 TEXT) RETURNS POINT
BEGIN
	DECLARE po POINT;
	DECLARE x TEXT;
	DECLARE y TEXT;
	SET x = substring(p1, 1, locate(',', p1)-1);
	SET y = substring(p1, locate(',', p1)+1);
	SET po = geomfromtext(concat('Point(', x, ' ', y, ')'));
	RETURN po;
END $$
DELIMITER ;


text:
package de.schwedt.weightlifting.app.buli;

import de.schwedt.weightlifting.app.UpdateableItem;

public class TeamMember extends UpdateableItem {

    private String name;
    private String year;
    private String snatching;
    private String jerking;
    private String max_score;
    private String imageURL;

    public TeamMember() {

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getSnatching() {
        return snatching;
    }

    public void setSnatching(String snatching) {
        this.snatching = snatching;
    }

    public String getJerking() {
        return jerking;
    }

    public void setJerking(String jerking) {
        this.jerking = jerking;
    }

    public String getMaxScore() {
        return max_score;
    }

    public void setMaxScore(String max_score) {
        this.max_score = max_score;
    }

    public String getImageURL() {
        return imageURL;
    }

    public void setImageURL(String imageURL) {
        this.imageURL = imageURL;
    }

    public boolean equals(TeamMember item2) {
        return name.equals(item2.getName()) && year.equals(item2.getYear())
                && snatching.equals(item2.getSnatching()) && jerking.equals(item2.getJerking())
                && max_score.equals(item2.getMaxScore()) && imageURL.equals(item2.getImageURL());
    }
}


text:
<!DOCTYPE html>
<title>Canvas test: 2d.path.rect.selfintersect</title>

<link rel="stylesheet" href="../tests.css">
<link rel="prev" href="2d.path.rect.winding.html" title="2d.path.rect.winding">
<link rel="next" href="2d.path.rect.nonfinite.html" title="2d.path.rect.nonfinite">

 <
 [index]
 >

2d.path.rect.selfintersect

References:

Actual output:

<canvas id="c" class="output" width="100" height="50">
FAIL (fallback content)
</canvas>

Expected output:


text:
#import "APLBaseTableViewController.h"

@interface APLResultsTableController : APLBaseTableViewController

@property (nonatomic, strong) NSArray *filteredProducts;

@end


text:
layout: post
title:  "Octopress? No Thanks."
date:   2014-10-20 22:00:00
categories: jekyll ruby octopress
image: 'http://i.imgur.com/8gtUvb1.jpg'
---

### Keep it Simple Stupid
When I went down the path of using Jekyll for blogging, I really liked how in control I was of my content.  The source was exactly as I had wrote it, WYWIWYG (what you write is what you get), and every post I wrote in markdown would be pushed to GitHub in its original format.  I was able to edit posts easily from any device right on GitHub.  However, when I switched over to Octopress, for the fancy plugins, I would lose that flexibility and it would ultimately bite me in the ass.

### Managing Two Repos
Using plain jane Jekyll you push markdown files to your GitHub Pages repo and GitHub knows how to do the rest to generate viewable HTML files.  Octopress is sort of counter intuitive, in that it generates HTML out of your Markdown files and puts that into a deploy folder that will be pushed to your GitHub pages repo.  You then have to create a second repo for the source code Octopress uses to generate the HTML.  Now you are managing two repos for the same content.

Since Octopress has to generate HTML files out of your markdown, this makes editing or adding new posts more cumbersome.  You can no longer use the power of markdown or liquit templates on the fly. No more going to your GitHub repo and editing the files remotely, or adding files remotely.  You now have clone your Octopress source repo and generate the content from there and deploy from there....

Needless to say, I am no longer using Octopress.

### Conclusion
Now I know there are all sorts of ways around the described problem above, but it's so much overhead for such a little gain.  Jekyll is lightweight, fast and easy.   Why complicate it with such a bloated framework like Octopress? The answer is, you shouldn't.


text:
class PokerHand:
  """Hand in a game of poker: an ordered list of 5 PokerCard
    objects."""

  def __init__(self, cards):
    """Main constructor. Takes a list of 5 PokerCard objects."""
    def get_symbol_value(card):
      return card.symbol_value
    self.cards = sorted(cards, key = get_symbol_value)

  def symbol_counts(self):
    """Return a dictionary associating each card symbol to the number of
      occurrences of that card in the hand."""
    dictionary = {}
    for card in self.cards:
      if card.symbol in dictionary:
        dictionary[card.symbol] += 1
      else:
        dictionary[card.symbol] = 1
    return dictionary

  def is_royal_flush(self):
    """Return True iff this is a royal flush (a straight flush with an
      ace)."""
    if not self.is_flush():
      return False
    return self.is_straight() and self.cards[-1].symbol == 'A'

  def is_straight_flush(self):
    """Returns True iff this is a straight flush (both a straight and a
      flush)."""
    return self.is_straight() and self.is_flush()

  def is_four_of_a_kind(self):
    """Return True iff this hand has 4 cards with the same symbol."""
    counts = self.symbol_counts()
    return 4 in counts.values()

  def is_full_house(self):
    """Return True iff this hand has both three-of-a-kind and
      two-of-a-kind."""
    counts = self.symbol_counts()
    return 3 in counts.values() and 2 in counts.values()

  def is_flush(self):
    """Return True iff all cards are of the same suit."""
    for card in self.cards:
      if card.suit != self.cards[0].suit:
        return False
    return True

  def is_straight(self):
    """Return True iff all cards are consecutive."""
    for offset,card in enumerate(self.cards):
      if card.symbol_value != self.cards[0].symbol_value + offset:
        return False
    return True

  def is_three_of_a_kind(self):
    """Return True iff there are exactly 3 occurrences of a card."""
    counts = self.symbol_counts()
    return 3 in counts.values()

  def is_two_pairs(self):
    """Return True iff there are exactly 2 occurrences of two cards."""
    counts = self.symbol_counts()
    pair_count = 0
    for count in counts.values():
      if count == 2:
        pair_count += 1
    return pair_count == 2

  def is_one_pair(self):
    """Return True iff there are exactly 2 occurrences of a card."""
    counts = self.symbol_counts()
    return 2 in counts.values()

class PokerCard:
  """Card from a poker game: has a symbol and a suit, both a
    single character."""

  def __init__(self, symbol, suit):
    """Main constructor."""
    self.symbol = symbol.upper()
    self.suit = suit

  @property
  def symbol_value(self):
    """Wrapper for `value_of_symbol' or the `symbol' field."""
    return value_of_symbol(self.symbol)

def value_of_symbol(symbol):
  """Return an integer representing the "rank" of a card's symbol.

  For instance, '2' maps to 2, and 'J' maps to 11.

  Consecutive cards have consecutive integers."""
  if symbol in '23456789':
    return int(symbol)
  else:
    return ({
        'T': 10,
        'J': 11,
        'Q': 12,
        'K': 13,
        'A': 14
      })[symbol]

def read_poker_line(line_string):
  """Return a PokerHand object corresponding to the line from the file
    `poker.txt'."""
  # list of all the cards
  card_names = line_string.split(" ")
  cards = list(PokerCard(card_name[:-1], card_name[-1:]) \
      for card_name in card_names)
  # lists of hands for the players
  player_1_hand_list = cards[:5]
  player_2_hand_list = cards[5:]
  # hands for the players
  player_1_hand = PokerHand(player_1_hand_list)
  player_2_hand = PokerHand(player_2_hand_list)
  # return a tuple with the hands for the two players
  return (player_1_hand, player_2_hand)

def is_winner_player_1(hand_1, hand_2):
  """Return True iff player 1 (hand_1) wins over player 2 (hand_2).

  hand_1 and hand_2 should be PokerHand objects."""
  hands = (hand_1, hand_2)
  symbol_counts = (hand_1.symbol_counts(), hand_2.symbol_counts())
  # royal flush
  if hand_1.is_royal_flush():
    return True
  if hand_2.is_royal_flush():
    return False
  # straight flush
  if hand_1.is_straight_flush():
    if not hand_2.is_straight_flush():
      return True
    elif hand_1.cards[-1].symbol_value != hand_2.cards[-1].symbol_value:
      return hand_1.cards[-1].symbol_value > hand_2.cards[-1].symbol_value
  elif hand_2.is_straight_flush():
    return False
  # four-of-a-kind
  if hand_1.is_four_of_a_kind():
    if not hand_2.is_four_of_a_kind():
      return True
    elif hand_1.cards[1].symbol_value != hand_2.cards[1].symbol_value:
      return hand_1.cards[1].symbol_value > hand_2.cards[1].symbol_value
  elif hand_2.is_four_of_a_kind():
    return False
  # full house
  if hand_1.is_full_house():
    if not hand_2.is_full_house():
      return True
    else:
      twos = []
      threes = []
      for counts in symbol_counts:
        for symbol,count in counts.items():
          if count == 3:
            threes.append(value_of_symbol(symbol))
          if count == 2:
            twos.append(value_of_symbol(symbol))
      if threes[0] > threes[1]:
        return True
      elif threes[0] < threes[1]:
        return False
      else:
        if twos[0] > twos[1]:
          return True
        elif twos[1] > twos[2]:
          return False
  elif hand_2.is_full_house():
    return False
  # flush
  if hand_1.is_flush():
    if not hand_2.is_flush():
      return True
  elif hand_2.is_flush():
    return False
  # straight
  if hand_1.is_straight():
    if not hand_2.is_straight():
      return True
    elif hand_1.cards[-1].symbol_value != hand_2.cards[-1].symbol_value:
      return hand_1.cards[-1].symbol_value > hand_2.cards[-1].symbol_value
  elif hand_2.is_straight():
    return False
  # three of a kind
  if hand_1.is_three_of_a_kind():
    if not hand_2.is_three_of_a_kind():
      return True
    else:
      threes = []
      for counts in symbol_counts:
        for symbol,count in counts.items():
          if count == 3:
            threes.append(value_of_symbol(symbol))
      if threes[0] > threes[1]:
        return True
      elif threes[0] < threes[1]:
        return False
  elif hand_2.is_three_of_a_kind():
    return False
  # two pairs
  if hand_1.is_two_pairs():
    if not hand_2.is_two_pairs():
      return True
    else:
      twos = [[], []]
      i = 0
      for counts in symbol_counts:
        for symbol,count in counts.items():
          if count == 2:
            twos[i].append(value_of_symbol(symbol))
        i += 1
      twos = [sorted(xs) for xs in twos]
      if twos[0][1] > twos[1][1]:
        return True
      elif twos[0][1] < twos[1][1]:
        return False
      elif twos[0][0] > twos[1][0]:
        return True
      elif twos[0][0] < twos[1][0]:
        return False
  elif hand_2.is_two_pairs():
    return False
  # pair
  if hand_1.is_one_pair():
    if not hand_2.is_one_pair():
      return True
    else:
      twos = []
      for counts in symbol_counts:
        for symbol,count in counts.items():
          if count == 2:
            twos.append(value_of_symbol(symbol))
      if twos[0] > twos[1]:
        return True
      if twos[0] < twos[1]:
        return False
  elif hand_2.is_one_pair():
    return False
  # highest card
  for i in range (-1, -6, -1):
    if hand_1.cards[i].symbol_value > hand_2.cards[i].symbol_value:
      return True
    elif hand_1.cards[i].symbol_value < hand_2.cards[i].symbol_value:
      return False


text:
<?php

namespace ServiceCivique\Bundle\CoreBundle\Behat;

use Behat\Gherkin\Node\TableNode;

class TaxonomyContext extends DefaultContext
{
    /**
     * @Given /^I created taxonomy "([^""]*)"$/
     */
    public function thereIsTaxonomy($name, $flush = true)
    {
        $taxonomy = $this->getRepository('taxonomy')->createNew();
        $taxonomy->setName($name);

        $this->getEntityManager()->persist($taxonomy);
        if ($flush) {
            $this->getEntityManager()->flush();
        }
    }

    /**
     * @Given /^there are following taxonomies defined:$/
     */
    public function thereAreFollowingTaxonomies(TableNode $table)
    {
        foreach ($table->getHash() as $data) {
            $this->thereIsTaxonomy($data['name'], false);
        }

        $this->getEntityManager()->flush();
    }

    /**
     * @Given /^taxonomy "([^""]*)" has following taxons:$/
     */
    public function taxonomyHasFollowingTaxons($taxonomyName, TableNode $taxonsTable)
    {
        $taxonomy = $this->findOneByName('taxonomy', $taxonomyName);
        $manager = $this->getEntityManager();

        $taxons = array();

        foreach ($taxonsTable->getRows() as $node) {
            $taxonList = explode('>', $node[0]);
            $parent = null;

            foreach ($taxonList as $taxonName) {
                $taxonName = trim($taxonName);

                if (!isset($taxons[$taxonName])) {
                    /* @var $taxon TaxonInterface */
                    $taxon = $this->getRepository('taxon')->createNew();
                    $taxon->setName($taxonName);

                    $taxons[$taxonName] = $taxon;
                }

                $taxon = $taxons[$taxonName];

                if (null !== $parent) {
                    $parent->addChild($taxon);
                } else {
                    $taxonomy->addTaxon($taxon);
                }

                $parent = $taxon;
            }
        }

        $manager->persist($taxonomy);
        $manager->flush();
    }
}


text:
var assert = require('assert');
var util = require('util');
var OAuth = require('oauth');
var OAuthError = require('../index.js');

var throwFromSample1 = require('./oauth-error-samples/sample01.js');
var throwFromSample2 = require('./oauth-error-samples/sample02.js');
var throwFromNoDataSample = require('./oauth-error-samples/sampleNoDataProp.js');

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
// Test the Error() object returned from the known
// oauth error object sample with: `data.error`
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
try {
	throwFromSample1();
} catch (err) {
	assert(err.name = 'OAuthError');
	assert(err instanceof OAuthError);
	assert(err instanceof Error);
	assert(util.isError(err));
	assert(err.stack);
	assert.strictEqual(err.toString(), 'OAuthError: Not authorized.');
	assert.strictEqual(err.stack.split('\n')[0], 'OAuthError: Not authorized.');
	assert.strictEqual(err.stack.split('\n')[1].indexOf('throw01'), 7);
	assert.strictEqual(err.statusCode, 401);
	assert.strictEqual(err.url, '/1.1/statuses/user_timeline.json');
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
// Test the Error() object returned from the known
// oauth error object sample with: `data.errors[]`
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
try {
	throwFromSample2();
} catch (err) {
	assert(err.name = 'OAuthError');
	assert(err instanceof OAuthError);
	assert(err instanceof Error);
	assert(util.isError(err));
	assert(err.stack);
	assert.strictEqual(err.toString(), 'OAuthError: Invalid or expired token.');
	assert.strictEqual(err.stack.split('\n')[0], 'OAuthError: Invalid or expired token.');
	assert.strictEqual(err.stack.split('\n')[1].indexOf('throw02'), 7);
	assert.strictEqual(err.statusCode, 401);
	assert.strictEqual(err.url, '');
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
// Unspecified message when no message data is present
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
try {
	throwFromNoDataSample();
} catch (err) {
	assert.strictEqual(err.message, 'unspecified OAuthError.');
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
// Actually test the Error output against a real
// oauth (node-oauth) instance using invalid credentials.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
var oauth = new OAuth.OAuth(
	'https://api.twitter.com/oauth/request_token',
	'https://api.twitter.com/oauth/access_token',
	'invalidConsumerKey',
	'invalidConsumerSecret',
	'1.0A',
	null,
	'HMAC-SHA1'
);

oauth.get(
	'https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=screenname&include_rts=1&count=200',
	'invalidAccessToken',
	'invalidAccessTokenSecret',
	function (err, data) {
		if (err) {
			try {
				throw new OAuthError(err);
			} catch (err) {
				assert(data);
				assert(err.name = 'OAuthError');
				assert(err instanceof OAuthError);
				assert(err instanceof Error);
				assert(util.isError(err));
				assert(err.stack);
				assert.strictEqual(err.toString(), 'OAuthError: Invalid or expired token.');
				assert.strictEqual(err.stack.split('\n')[0], 'OAuthError: Invalid or expired token.');
				assert.strictEqual(err.statusCode, 401);
				assert.strictEqual(err.url, '');
			}
		}
	}
);


text:
<!doctype html>
	<meta charset="utf-8">
	<title> veneer demo </title>
	<meta name=author content="dandavis">
	<meta name=description content="">
	<link rel=stylesheet href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">

Attrib tag to alter attributes and extend buttons

<fieldset>
	<legend> Fill a form input value from a drop-down list of pre-selected values </legend>

	The input <input id=inp1>

	<veneer-attrib target=#inp1 >
		<select>
			<option value="">Choose a Default</option>
			<option>Abc</option>
			<option>123</option>
			<option>Xyz</option>
		</select>
	</veneer-attrib>

</fieldset>

<fieldset>
	<legend> Fire methods on any tag </legend>
	The input <input id=inp2 value=12345 />

	<veneer-attrib target=#inp2 prop=focus ><button>Focus</button></veneer-attrib>
	<veneer-attrib target=#inp2 prop=blur ><button>Blur</button></veneer-attrib>
	<veneer-attrib target=#inp2  prop=select ><button>Select</button></veneer-attrib>
	<veneer-attrib target=#inp2  prop=selectionStart ><button value=6>Un-Select (not a method)</button></veneer-attrib>

</fieldset>

<fieldset>
	<legend>Chaining several inputs together </legend>

	The input <input id=inp3 subscribed="veneer-attrib[target='#inp3'] input">

	<veneer-attrib target=#inp3 id=va1><input></veneer-attrib>
	<veneer-attrib target=#inp3 id=va2><input></veneer-attrib>
	<veneer-attrib target=#inp3 id=va3><input></veneer-attrib>
	<veneer-attrib target=#inp3 id=va4><input></veneer-attrib>
	<veneer-attrib target=#inp3 id=va5><input></veneer-attrib>
	<veneer-attrib target=#inp3 id=va6><input></veneer-attrib>

</fieldset>

  Back to gists


text:
title: WIZEYE 접속 방법 및 로그인
keywords: "validation, titles, page titles, inconsistency, errors"
last_updated: "November 30, 2016"
summary: "The title checker page helps ensure that the titles in your pages match the titles in your TOC."
sidebar: mydoc_sidebar
permalink: /mydoc_login/
---


text:
namespace boost {

template<class charT, class Traits = BOOST_IO_STD char_traits<charT> > class basic_format;

typedef basic_format<char >     format;

#if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_STD_WSTREAMBUF)
typedef basic_format<wchar_t >  wformat;
#endif

namespace io {
enum format_error_bits { bad_format_string_bit = 1,
                         too_few_args_bit = 2, too_many_args_bit = 4,
                         out_of_range_bit = 8,
                         all_error_bits = 255, no_error_bits=0 };

// Convertion:  format   to   string
template<class Ch, class Tr>
std::basic_string<Ch, Tr>     str(const basic_format<Ch, Tr>& ) ;

} // namespace io

template< class Ch, class Tr>
BOOST_IO_STD basic_ostream<Ch, Tr>&
operator<<( BOOST_IO_STD basic_ostream<Ch, Tr>&, const basic_format<Ch, Tr>&);

} // namespace boost

#endif // BOOST_FORMAT_FWD_HPP


text:
import { Component, OnInit, ViewChild, ElementRef, OnDestroy } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { LoginService } from './login.service';
import { SharedService } from '../shared/services/shared.service';
import { NavbarComponent } from '../shared/navbar/navbar.component';
import { Specialities } from '../shared/database/speciality';
import { PasswordValidation } from './password.validator';
import { Subject } from 'rxjs/Subject';
/**
 * This class represents the lazy loaded RegisterComponent.
 */
@Component({
    moduleId: module.id,
    selector: 'mm-doctor-register',
    templateUrl: 'doctor-register.component.html',
    styleUrls: ['doctor-register.component.css'],
})
export class DoctorRegisterComponent implements OnInit, OnDestroy {

    @ViewChild('msg') msg: ElementRef;
    registerDoctorProfiles: FormGroup;
    message = '';
    otpMessage = '';
    otpFlag: boolean;
    phoneNo: number;
    loader: boolean;
    number: Array<number> = [];
    specialityDropdownSettings:Object;
    specialitiesDropdownList:Array<any>=[];
    @ViewChild(NavbarComponent) navbarComponent: NavbarComponent;
    @ViewChild('otpButton') otpButton: ElementRef;
    @ViewChild('phoneNum') phoneNum: ElementRef;
    private unsubscribeObservables = new Subject();

    constructor(
        private fb: FormBuilder,
        private loginService: LoginService,
        private sharedService: SharedService
    ) {
    }

    /**
     * initialising form group
     * @memberOf RegisterComponent
     */
    ngOnInit(): void {
        this.sharedService.getSpecialities()
        .takeUntil(this.unsubscribeObservables)
        .subscribe((specialities:Specialities[])=> {
            let specialitiesList:Array<any> = [];
          specialities.map((speciality:Specialities)=> {
              specialitiesList.push(speciality.name);
          });
          this.specialitiesDropdownList = specialitiesList;
        });
        this.registerDoctorProfiles = this.fb.group({
            id: null,
            userId: null,
            socketId: null,
            firstname: ['', Validators.required],
            lastname: ['', Validators.required],
            email: ['', Validators.required],
            password: ['', Validators.required],
            confirmPassword: ['', Validators.required],
            phoneNo: ['', Validators.required],
            picUrl: null,
            role: null,
            regNo: ['', Validators.required],
            speciality: ['', Validators.required],
            experience: ['', Validators.required],
            description: [''],
            status: null,
            waitingTime: null,
            ratingValue: null,
            ratingCount: null,
            videoUrl: null,
            appearUrl: null,
            token: null,
            type: null,
            activate: null,
            termsAccepted: ['', Validators.required],
            createdTime: '',
            createdBy: null,
            updatedTime: '',
            updatedBy: null
        }, {
                validator: PasswordValidation.matchPassword // your validation method
            });
        this.navbarComponent.navbarColor(0, '#6960FF');
        this.specialityDropdownSettings = {
            singleSelection: false,
            enableCheckAll:false,
            itemsShowLimit: 2,
            allowSearchFilter: true
          };
    }

    ngOnDestroy() {
        this.unsubscribeObservables.next();
        this.unsubscribeObservables.complete();
    }

    register({ value, valid }: { value: any, valid: boolean }) {
        if (this.otpFlag === false) {
            const name = value.firstname + ' ' + value.lastname;
            const split = name.split(' ');
            value.appearUrl = `https://appear.in/${split[0]}-${split[1]}`;
            value.createdBy = value.id;
            value.updatedBy = value.id;
            value.role = 'doctor';
            this.loginService.createNewDoctor(value)
            .takeUntil(this.unsubscribeObservables)
                .subscribe((res) => {
                    window.scroll({top: 0, left: 0, behavior: 'smooth'});
                    breakloop: if (res.error === 'DUP_ENTRY') {
                        this.message = res.message;
                        break breakloop;
                    } else if (res) {
                        this.message = `Thank you for registering with us!
                    We will get in touch with you to complete registration process.
                    Kindly check inbox/spam folder for more details.`;
                        this.registerDoctorProfiles.reset();
                    }
                });
        } else {
            this.message = 'Verify your phone number before registering';
            window.scroll({top: 0, left: 0, behavior: 'smooth'});
        }
    }

    checkPhoneNumber(value: any) {
        if (value.length === 10) {
            this.otpButton.nativeElement.style.visibility = 'visible';
            this.otpButton.nativeElement.style.opacity = 1;
        } else {
            this.otpButton.nativeElement.style.visibility = 'hidden';
            this.otpButton.nativeElement.style.opacity = 0;
        }
    }

    sendOtp(phoneNo: any) {
        if (phoneNo.length === 10) {
            this.loader = true;
            this.sharedService.sendOtp(Number('91'+phoneNo))
            .takeUntil(this.unsubscribeObservables)
                .subscribe(res => {
                    if (res.type === 'success') {
                        this.loader = false;
                        this.otpFlag = true;
                        this.phoneNo = phoneNo;
                        this.otpMessage = 'OTP sent successfully!';
                    }
                });
        }
    }

    resendOtp() {
        this.loader =true;
        this.sharedService.resendOtp(Number('91'+this.phoneNo))
        .takeUntil(this.unsubscribeObservables)
            .subscribe(res => {
                if (res.type === 'success') {
                    this.loader = false;
                    this.otpFlag = true;
                    this.otpMessage = 'OTP re-sent successfully!';
                }
            });
    }

    confirmOtp(otp: number) {
        this.loader = true;
        this.sharedService.verifyOtp(Number('91'+this.phoneNo), otp)
        .takeUntil(this.unsubscribeObservables)
            .subscribe(res => {
                if (res.type === 'success') {
                    this.loader = false;
                    this.otpFlag = false;
                    this.otpButton.nativeElement.style.visibility = 'hidden';
                    this.otpButton.nativeElement.style.opacity = 0;
                    this.phoneNum.nativeElement.disabled = true;
                }
            });
    }
}


text:
package wikidata.hashtaginclude.com.wikidataexplorer.models;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

/**
 * Created by mmichaud on 4/3/15.
 */
public class ClaimQueryModel {

    @Expose
    @SerializedName("status")
    Status status;

    @Expose
    @SerializedName("items")
    int[] items;

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public int[] getItems() {
        return items;
    }

    public void setItems(int[] items) {
        this.items = items;
    }

    public class Status {
        @Expose
        @SerializedName("error")
        String error;

        @Expose
        @SerializedName("items")
        int items;

        @Expose
        @SerializedName("querytime")
        String queryTime;

        @Expose
        @SerializedName("parsed_query")
        String parsedQuery;

        public String getError() {
            return error;
        }

        public void setError(String error) {
            this.error = error;
        }

        public int getItems() {
            return items;
        }

        public void setItems(int items) {
            this.items = items;
        }

        public String getQueryTime() {
            return queryTime;
        }

        public void setQueryTime(String queryTime) {
            this.queryTime = queryTime;
        }

        public String getParsedQuery() {
            return parsedQuery;
        }

        public void setParsedQuery(String parsedQuery) {
            this.parsedQuery = parsedQuery;
        }
    }
}


text:
namespace BugLogger.Api
{
    using System.Reflection;
    using System.Web.Http;

    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            DatabaseConfig.Initialize();
            AutoMapperConfig.RegisterMappings(Assembly.Load("BugLogger.Api"));
            GlobalConfiguration.Configure(WebApiConfig.Register);
        }
    }
}


text:
.class synthetic Landroid/graphics/drawable/GradientDrawable$1;
.super Ljava/lang/Object;
.source "GradientDrawable.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/graphics/drawable/GradientDrawable;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1008
    name = null
.end annotation

# static fields
.field static final synthetic $SwitchMap$android$graphics$drawable$GradientDrawable$Orientation:[I

# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    .line 903
    invoke-static {}, Landroid/graphics/drawable/GradientDrawable$Orientation;->values()[Landroid/graphics/drawable/GradientDrawable$Orientation;

    move-result-object v0

    array-length v0, v0

    new-array v0, v0, [I

    sput-object v0, Landroid/graphics/drawable/GradientDrawable$1;->$SwitchMap$android$graphics$drawable$GradientDrawable$Orientation:[I

    :try_start_0
    sget-object v0, Landroid/graphics/drawable/GradientDrawable$1;->$SwitchMap$android$graphics$drawable$GradientDrawable$Orientation:[I

    sget-object v1, Landroid/graphics/drawable/GradientDrawable$Orientation;->TOP_BOTTOM:Landroid/graphics/drawable/GradientDrawable$Orientation;

    invoke-virtual {v1}, Landroid/graphics/drawable/GradientDrawable$Orientation;->ordinal()I

    move-result v1

    const/4 v2, 0x1

    aput v2, v0, v1
    :try_end_0
    .catch Ljava/lang/NoSuchFieldError; {:try_start_0 .. :try_end_0} :catch_6

    :goto_0
    :try_start_1
    sget-object v0, Landroid/graphics/drawable/GradientDrawable$1;->$SwitchMap$android$graphics$drawable$GradientDrawable$Orientation:[I

    sget-object v1, Landroid/graphics/drawable/GradientDrawable$Orientation;->TR_BL:Landroid/graphics/drawable/GradientDrawable$Orientation;

    invoke-virtual {v1}, Landroid/graphics/drawable/GradientDrawable$Orientation;->ordinal()I

    move-result v1

    const/4 v2, 0x2

    aput v2, v0, v1
    :try_end_1
    .catch Ljava/lang/NoSuchFieldError; {:try_start_1 .. :try_end_1} :catch_5

    :goto_1
    :try_start_2
    sget-object v0, Landroid/graphics/drawable/GradientDrawable$1;->$SwitchMap$android$graphics$drawable$GradientDrawable$Orientation:[I

    sget-object v1, Landroid/graphics/drawable/GradientDrawable$Orientation;->RIGHT_LEFT:Landroid/graphics/drawable/GradientDrawable$Orientation;

    invoke-virtual {v1}, Landroid/graphics/drawable/GradientDrawable$Orientation;->ordinal()I

    move-result v1

    const/4 v2, 0x3

    aput v2, v0, v1
    :try_end_2
    .catch Ljava/lang/NoSuchFieldError; {:try_start_2 .. :try_end_2} :catch_4

    :goto_2
    :try_start_3
    sget-object v0, Landroid/graphics/drawable/GradientDrawable$1;->$SwitchMap$android$graphics$drawable$GradientDrawable$Orientation:[I

    sget-object v1, Landroid/graphics/drawable/GradientDrawable$Orientation;->BR_TL:Landroid/graphics/drawable/GradientDrawable$Orientation;

    invoke-virtual {v1}, Landroid/graphics/drawable/GradientDrawable$Orientation;->ordinal()I

    move-result v1

    const/4 v2, 0x4

    aput v2, v0, v1
    :try_end_3
    .catch Ljava/lang/NoSuchFieldError; {:try_start_3 .. :try_end_3} :catch_3

    :goto_3
    :try_start_4
    sget-object v0, Landroid/graphics/drawable/GradientDrawable$1;->$SwitchMap$android$graphics$drawable$GradientDrawable$Orientation:[I

    sget-object v1, Landroid/graphics/drawable/GradientDrawable$Orientation;->BOTTOM_TOP:Landroid/graphics/drawable/GradientDrawable$Orientation;

    invoke-virtual {v1}, Landroid/graphics/drawable/GradientDrawable$Orientation;->ordinal()I

    move-result v1

    const/4 v2, 0x5

    aput v2, v0, v1
    :try_end_4
    .catch Ljava/lang/NoSuchFieldError; {:try_start_4 .. :try_end_4} :catch_2

    :goto_4
    :try_start_5
    sget-object v0, Landroid/graphics/drawable/GradientDrawable$1;->$SwitchMap$android$graphics$drawable$GradientDrawable$Orientation:[I

    sget-object v1, Landroid/graphics/drawable/GradientDrawable$Orientation;->BL_TR:Landroid/graphics/drawable/GradientDrawable$Orientation;

    invoke-virtual {v1}, Landroid/graphics/drawable/GradientDrawable$Orientation;->ordinal()I

    move-result v1

    const/4 v2, 0x6

    aput v2, v0, v1
    :try_end_5
    .catch Ljava/lang/NoSuchFieldError; {:try_start_5 .. :try_end_5} :catch_1

    :goto_5
    :try_start_6
    sget-object v0, Landroid/graphics/drawable/GradientDrawable$1;->$SwitchMap$android$graphics$drawable$GradientDrawable$Orientation:[I

    sget-object v1, Landroid/graphics/drawable/GradientDrawable$Orientation;->LEFT_RIGHT:Landroid/graphics/drawable/GradientDrawable$Orientation;

    invoke-virtual {v1}, Landroid/graphics/drawable/GradientDrawable$Orientation;->ordinal()I

    move-result v1

    const/4 v2, 0x7

    aput v2, v0, v1
    :try_end_6
    .catch Ljava/lang/NoSuchFieldError; {:try_start_6 .. :try_end_6} :catch_0

    :goto_6
    return-void

    :catch_0
    move-exception v0

    goto :goto_6

    :catch_1
    move-exception v0

    goto :goto_5

    :catch_2
    move-exception v0

    goto :goto_4

    :catch_3
    move-exception v0

    goto :goto_3

    :catch_4
    move-exception v0

    goto :goto_2

    :catch_5
    move-exception v0

    goto :goto_1

    :catch_6
    move-exception v0

    goto :goto_0
.end method


text:
//
//  NSObject+Notifications.m
//
//  Created by Sebastian Skuse on 26/02/2013.
//  Copyright (c) 2013 Seb Skuse. All rights reserved.
//

#import <objc/runtime.h>
#import "NSObject+Notifications.h"

static void *DHNotificationStoreObject = &DHNotificationStoreObject;

@implementation NSObject (Notifications)

- (DHNotificationStore *)dh_notificationStore {
    @synchronized(self) {
        DHNotificationStore *store = objc_getAssociatedObject(self, DHNotificationStoreObject);

        if (store == nil) {
            store = [[DHNotificationStore alloc] init];
            objc_setAssociatedObject(self, DHNotificationStoreObject, store, OBJC_ASSOCIATION_RETAIN);
        }

        return store;
    }
}

@end


text:
package rosetta

import (
	"runtime"
)

func Enabled() bool {
	return false
}

func NativeArch() string {
	return runtime.GOARCH
}


text:
<?php
namespace frontend\controllers\photo;

use Yii;
use yii\helpers\Url;
use frontend\controllers\BaseFront;
use yii\data\Pagination;
use app\models\sections\Sections;
use app\models\photo\SectionPhotogaleryCategory;
use app\models\photo\SectionPhotogaleryImg;

/**
 * PageController
 */
class PhotoController extends BaseFront
{
    use \common\traits\PageHelper;

    private $pageSize = 6;//кол-во материалов на странице пагинации
    private $section;

    public function beforeAction($action)
    {
        $this->section = Sections::getSectionFromName(Sections::SEC_PHOTOGALERY);

        if ($action->id === 'index' || $action->id == 'category') {
            $this->layout = '@app/views/layouts/tpl/photogalery';
        }
        return parent::beforeAction($action);
    }

    /**
     * Print home page.
     */
    public function actionIndex($pageNum = null)
    {
        //построение постраничной навигации
        $query = SectionPhotogaleryCategory::getAllCatsPagin();
        $redirectFromNum1 = Url::toRoute(['/photo/index'], true);
        list($pagination, $paginCategories, $totalCount) = static::buildPagination($query, $this->pageSize, $pageNum, $redirectFromNum1);

        static::buildMetaTags($this->section->title, $this->section->description, $this->section->keywords, $pageNum);

        return $this->render('index',[
                                        'section'           => $this->section,
                                        'pageNum'           => $pageNum,
                                        'paginCategories'   => $paginCategories,
                                        'pagination'        => $pagination,
                                        'totalCount'        => $totalCount

                                ]);
    }

    public function actionCategory($alias = null)
    {
        $category = SectionPhotogaleryCategory::getCategoryFromAlias($alias);
        $pics = $category->sectionPhotogaleryImgs;

        return $this->render('category',[
                                            'section'  => $this->section,
                                            'category'  => $category,
                                            'pics'  => $pics,

                                ]);
    }

    public function actionPic($alias = null)
    {
        $pic = SectionPhotogaleryImg::getPageFromAlias($alias);

        $category = $pic->category;

        return $this->render('pic',[
                                            'section'  => $this->section,
                                            'category' => $category,
                                            'pic'      => $pic,

                                ]);
    }
}


text:
const {
  assertSyntaxError
} = Assert;

// 12.1.5: "yield" should be allowed in Object Initialisers
// https://bugs.ecmascript.org/show_bug.cgi?id=1968

function f() {
  let obj = ({yield});
}

assertSyntaxError(`"use strict"; let obj = ({yield});`);


text:
namespace IGCS::GameSpecific
{
	// Mandatory constants to define for a game
	#define GAME_NAME									"Watch_Dogs 1.06.329"
	#define CAMERA_VERSION								"1.0.2"
	#define CAMERA_CREDITS								"Otis_Inf, Jim2Point0"
	#define GAME_WINDOW_TITLE							"Watch_Dogs"
	#define INITIAL_PITCH_RADIANS						0.0f
	#define INITIAL_YAW_RADIANS							0.0f
	#define INITIAL_ROLL_RADIANS						(-90.0f * XM_PI) / 180.f	// world coords are ... messed up in this game, so we have to correct for that!
	#define CONTROLLER_Y_INVERT							true
	#define FASTER_MULTIPLIER							3.0f
	#define SLOWER_MULTIPLIER							0.15f
	#define MOUSE_SPEED_CORRECTION						0.2f	// to correct for the mouse-deltas related to normal rotation.
	#define DEFAULT_MOVEMENT_SPEED						0.03f
	#define DEFAULT_ROTATION_SPEED						0.01f
	#define DEFAULT_FOV_RADIANS							1.31f
	#define DEFAULT_FOV_DEGREES							40.0f
	#define DEFAULT_FOV_SPEED							0.002f
	#define DEFAULT_Z_MOVEMENT_MULTIPLIER				0.5f
	#define DEFAULT_GAME_SPEED							1.875f
	#define DEFAULT_MIN_GAME_SPEED						0.1f
	#define DEFAULT_MAX_GAME_SPEED						10.0f
	// End Mandatory constants

	// Offsets for camera intercept code. Used in interceptor.
	// Game uses 2 camera objects with the same data, one is used for calculations and the contents is then copied to the other, and vice versa.
	// So our camera has to update both at the same time as we never know which one is active.
	#define CAMERA_ADDRESS_INTERCEPT_START_OFFSET		0x17BCDA4
	#define CAMERA_ADDRESS_INTERCEPT_CONTINUE_OFFSET	0x17BCDB4

	#define	CAMERA_WRITE_INTERCEPT1_START_OFFSET		0x85B9E0
	#define CAMERA_WRITE_INTERCEPT1_CONTINUE_OFFSET		0x85B9F1
	#define	CAMERA_WRITE_INTERCEPT2_START_OFFSET		0x86847E
	#define CAMERA_WRITE_INTERCEPT2_CONTINUE_OFFSET		0x8684D5
	#define	CAMERA_WRITE_INTERCEPT3_START_OFFSET		0x1BA9E0
	#define CAMERA_WRITE_INTERCEPT3_CONTINUE_OFFSET		0x1BAA8D

	#define GAMESPEED_ADDRESS_INTERCEPT_START_OFFSET	0x47FBB3
	#define GAMESPEED_ADDRESS_INTERCEPT_CONTINUE_OFFSET 0x47FBC6
	#define TOD_ADDRESS_INTERCEPT_START_OFFSET			0x685844
	#define TOD_ADDRESS_INTERCEPT_CONTINUE_OFFSET		0x685854

	#define FOV_WRITE_INTERCEPT1_START_OFFSET			0x862220
	#define FOV_WRITE_INTERCEPT1_CONTINUE_OFFSET		0x86222E

	// Indices in the structures read by interceptors
	#define LOOK_DATA_IN_CAMERA_STRUCT_OFFSET			0x44
	#define CAMERA_COORDS_IN_CAMERA_STRUCT_OFFSET		0x4
	#define FOV_IN_CAMERA_STRUCT_OFFSET					0x24
	#define GAMESPEED_IN_STRUCT_OFFSET					0x74
	#define TOD_IN_STRUCT_OFFSET						0x758
}


text:
{% extends 'base/base.html' %}
{% block css %}
    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap-social.css"/>
    <link rel="stylesheet" href="/static/font-awesome-4.2.0/css/font-awesome.min.css"/>
{% endblock %}
{% block body %}

                {% block titulo_noticia %} {% endblock %}

                {% block sub_titulo_noticia %} {% endblock %}

                {% block foto_noticia %}
                {% endblock %}

                {% block noticia %}
                {% endblock %}

{% endblock %}


text:
require 'rails'

module Frontend
  module Generators
    class InstallGenerator < ::Rails::Generators::Base

      desc "This generator installs the necessary config files, for all your services and base site meta tags."
      source_root File.expand_path('../../../../../', __FILE__)

      def copy_services
        say_status("copying", "Blank Services File", :green)
        copy_file "config/services.yml", "config/services.yml"
      end

      def copy_settings
        say_status("copying", "Blank Settings File", :green)
        copy_file "config/settings.yml", "config/settings.yml"
      end

      def copy_variables
        say_status("copying", "Blank Variables File", :green)
        copy_file "vendor/assets/stylesheets/variables.css.sass", "app/assets/stylesheets/variables.css.sass"
      end

      def copy_email_template
        say_status("copying", "Email Template", :green)
        copy_file "app/views/layouts/mail.html.haml", "app/views/layouts/mail.html.haml"
      end

    end
  end
end


text:
<!DOCTYPE html>

    <title>Documentation - {{title}}</title>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <link type="text/css" rel="stylesheet" href="{{asset 'reset.css'}}" />
    <link type="text/css" rel="stylesheet" href="{{asset 'grid.css'}}" />
    <link type="text/css" rel="stylesheet" href="{{asset 'styles.css'}}" />
    <link type="text/css" rel="stylesheet" href="{{asset 'octicons.css'}}"/>
    <link type="text/css" rel="stylesheet" href="{{asset 'pilcrow.css'}}" />
    <link type="text/css" rel="stylesheet" href="{{asset 'hljs-github.min.css'}}" />
    <link type="text/css" rel="stylesheet" href="{{asset 'assert.css'}}"/>
    <link type="text/css" rel="stylesheet" href="{{asset 'sunburst.css'}}"/>

                {{#if repoUrl}}
                View on Github
                {{/if}}

{{~> content}}

{{~> toc}}

                {{#if repoUrl}}
                View on Github
                {{/if}}


text:
import logging
import os

from file_system import FileNotFoundError
import compiled_file_system as compiled_fs
import third_party.json_schema_compiler.model as model
from docs_server_utils import SanitizeAPIName

# These files are special cases that shouldn't be in the API list.
IGNORED_FILES = [
  'devtools'
]

class APIListDataSource(object):
  """ This class creates a list of chrome.* APIs and chrome.experimental.* APIs
  that are used in the api_index.html and experimental.html pages.
  """
  class Factory(object):
    def __init__(self, cache_factory, file_system, api_path, public_path):
      self._cache = cache_factory.Create(self._ListAPIs, compiled_fs.LIST)
      self._file_system = file_system
      def Normalize(string):
        return string if string.endswith('/') else (string + '/')
      self._api_path = Normalize(api_path)
      self._public_path = Normalize(public_path)

    def _GetAPIsInSubdirectory(self, api_names, doc_type):
      public_templates = self._file_system.ReadSingle(
          self._public_path + doc_type + '/')
      template_names = [os.path.splitext(name)[0]
                        for name in public_templates]
      experimental_apis = []
      chrome_apis = []
      for template_name in sorted(template_names):
        if template_name in IGNORED_FILES:
          continue
        if model.UnixName(template_name) in api_names:
          if template_name.startswith('experimental'):
            experimental_apis.append({
              'name': template_name.replace('_', '.')
            })
          else:
            chrome_apis.append({ 'name': template_name.replace('_', '.') })
      if len(chrome_apis):
        chrome_apis[-1]['last'] = True
      if len(experimental_apis):
        experimental_apis[-1]['last'] = True
      return {
        'chrome': chrome_apis,
        'experimental': experimental_apis
      }

    def _ListAPIs(self, base_dir, apis):
      api_names = set(SanitizeAPIName(name, self._api_path) for name in apis)
      return {
        'apps': self._GetAPIsInSubdirectory(api_names, 'apps'),
        'extensions': self._GetAPIsInSubdirectory(api_names, 'extensions')
      }

    def Create(self):
      return APIListDataSource(self._cache, self._api_path)

  def __init__(self, cache, api_path):
    self._cache = cache
    self._api_path = api_path

  def GetAllNames(self):
    names = []
    for i in ['apps', 'extensions']:
      for j in ['chrome', 'experimental']:
       names.extend(self.get(i).get(j))
    return [api_name['name'] for api_name in names]

  def get(self, key):
    try:
      return self._cache.GetFromFileListing(self._api_path)[key]
    except FileNotFoundError as e:
      raise ValueError('%s: Error listing files for "%s".' % (e, key))


text:
import json
import logging

from flask import Flask
from flask import request
from flask import Response

app = Flask(__name__)
log = logging.getLogger(__name__)

# NOTE: A class isn't required here per se, but including one to stay
#       semi-consitent with other engines.

class MainHandler(object):
    """ Single content generating resource that takes a function as input """
    @classmethod
    def apply_content(cls, func):
        cls.process_request = func

    @staticmethod
    def process_request():
        pass

@app.route("/", methods=["POST"])
def post():
    data = request.get_data()
    try:
        result = MainHandler.process_request(body=data)
    except TypeError as e:
        return json.dumps(str(e)), 400, {'content-type': 'application/json'}
    return Response(result, mimetype='application/json')

def main(port, func):
    """ This function starts up the flask web server """
    MainHandler.apply_content(func)
    app.run(port=int(port))

if __name__ == "__main__":
    main(8888, lambda *args, **kwargs: "IT WORKS!")


text:
package azure

import (
	"bytes"
	"testing"
)

func Test_zeroFillWrite_AppendNoGap(t *testing.T) {
	s := NewStorageSimulator()
	bw := newRandomBlobWriter(&s, 1024*1)
	zw := newZeroFillWriter(&bw)
	if err := s.CreateBlockBlob("a", "b"); err != nil {
		t.Fatal(err)
	}

	firstChunk := randomContents(1024*3 + 512)
	if nn, err := zw.Write("a", "b", 0, bytes.NewReader(firstChunk)); err != nil {
		t.Fatal(err)
	} else if expected := int64(len(firstChunk)); expected != nn {
		t.Fatalf("wrong written bytes count: %v, expected: %v", nn, expected)
	}
	if out, err := s.GetBlob("a", "b"); err != nil {
		t.Fatal(err)
	} else {
		assertBlobContents(t, out, firstChunk)
	}

	secondChunk := randomContents(256)
	if nn, err := zw.Write("a", "b", int64(len(firstChunk)), bytes.NewReader(secondChunk)); err != nil {
		t.Fatal(err)
	} else if expected := int64(len(secondChunk)); expected != nn {
		t.Fatalf("wrong written bytes count: %v, expected: %v", nn, expected)
	}
	if out, err := s.GetBlob("a", "b"); err != nil {
		t.Fatal(err)
	} else {
		assertBlobContents(t, out, append(firstChunk, secondChunk...))
	}

}

func Test_zeroFillWrite_StartWithGap(t *testing.T) {
	s := NewStorageSimulator()
	bw := newRandomBlobWriter(&s, 1024*2)
	zw := newZeroFillWriter(&bw)
	if err := s.CreateBlockBlob("a", "b"); err != nil {
		t.Fatal(err)
	}

	chunk := randomContents(1024 * 5)
	padding := int64(1024*2 + 256)
	if nn, err := zw.Write("a", "b", padding, bytes.NewReader(chunk)); err != nil {
		t.Fatal(err)
	} else if expected := int64(len(chunk)); expected != nn {
		t.Fatalf("wrong written bytes count: %v, expected: %v", nn, expected)
	}
	if out, err := s.GetBlob("a", "b"); err != nil {
		t.Fatal(err)
	} else {
		assertBlobContents(t, out, append(make([]byte, padding), chunk...))
	}
}

func Test_zeroFillWrite_AppendWithGap(t *testing.T) {
	s := NewStorageSimulator()
	bw := newRandomBlobWriter(&s, 1024*2)
	zw := newZeroFillWriter(&bw)
	if err := s.CreateBlockBlob("a", "b"); err != nil {
		t.Fatal(err)
	}

	firstChunk := randomContents(1024*3 + 512)
	if _, err := zw.Write("a", "b", 0, bytes.NewReader(firstChunk)); err != nil {
		t.Fatal(err)
	}
	if out, err := s.GetBlob("a", "b"); err != nil {
		t.Fatal(err)
	} else {
		assertBlobContents(t, out, firstChunk)
	}

	secondChunk := randomContents(256)
	padding := int64(1024 * 4)
	if nn, err := zw.Write("a", "b", int64(len(firstChunk))+padding, bytes.NewReader(secondChunk)); err != nil {
		t.Fatal(err)
	} else if expected := int64(len(secondChunk)); expected != nn {
		t.Fatalf("wrong written bytes count: %v, expected: %v", nn, expected)
	}
	if out, err := s.GetBlob("a", "b"); err != nil {
		t.Fatal(err)
	} else {
		assertBlobContents(t, out, append(firstChunk, append(make([]byte, padding), secondChunk...)...))
	}
}

func Test_zeroFillWrite_LiesWithinSize(t *testing.T) {
	s := NewStorageSimulator()
	bw := newRandomBlobWriter(&s, 1024*2)
	zw := newZeroFillWriter(&bw)
	if err := s.CreateBlockBlob("a", "b"); err != nil {
		t.Fatal(err)
	}

	firstChunk := randomContents(1024 * 3)
	if _, err := zw.Write("a", "b", 0, bytes.NewReader(firstChunk)); err != nil {
		t.Fatal(err)
	}
	if out, err := s.GetBlob("a", "b"); err != nil {
		t.Fatal(err)
	} else {
		assertBlobContents(t, out, firstChunk)
	}

	// in this case, zerofill won't be used
	secondChunk := randomContents(256)
	if nn, err := zw.Write("a", "b", 0, bytes.NewReader(secondChunk)); err != nil {
		t.Fatal(err)
	} else if expected := int64(len(secondChunk)); expected != nn {
		t.Fatalf("wrong written bytes count: %v, expected: %v", nn, expected)
	}
	if out, err := s.GetBlob("a", "b"); err != nil {
		t.Fatal(err)
	} else {
		assertBlobContents(t, out, append(secondChunk, firstChunk[len(secondChunk):]...))
	}
}


text:
package org.apache.storm.kafka.spout;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.common.PartitionInfo;
import org.apache.kafka.common.TopicPartition;
import org.apache.storm.kafka.spout.internal.KafkaConsumerFactory;
import org.apache.storm.spout.SpoutOutputCollector;
import org.apache.storm.task.TopologyContext;

public class SpoutWithMockedConsumerSetupHelper {

    /**
     * Creates, opens and activates a KafkaSpout using a mocked consumer.
     * @param <K> The Kafka key type
     * @param <V> The Kafka value type
     * @param spoutConfig The spout config to use
     * @param topoConf The topo conf to pass to the spout
     * @param contextMock The topo context to pass to the spout
     * @param collectorMock The mocked collector to pass to the spout
     * @param consumerMock The mocked consumer
     * @param assignedPartitions The partitions to assign to this spout. The consumer will act like these partitions are assigned to it.
     * @return The spout
     */
    public static <K, V> KafkaSpout<K, V> setupSpout(KafkaSpoutConfig<K, V> spoutConfig, Map<String, Object> topoConf,
        TopologyContext contextMock, SpoutOutputCollector collectorMock, KafkaConsumer<K, V> consumerMock, Set<TopicPartition> assignedPartitions) {

        Map<String, List<PartitionInfo>> partitionInfos = assignedPartitions.stream()
            .map(tp -> new PartitionInfo(tp.topic(), tp.partition(), null, null, null))
            .collect(Collectors.groupingBy(info -> info.topic()));
        partitionInfos.keySet()
            .forEach(key -> when(consumerMock.partitionsFor(key))
                .thenReturn(partitionInfos.get(key)));
        KafkaConsumerFactory<K, V> consumerFactory = (kafkaSpoutConfig) -> consumerMock;

        KafkaSpout<K, V> spout = new KafkaSpout<>(spoutConfig, consumerFactory);

        when(contextMock.getComponentTasks(any())).thenReturn(Collections.singletonList(0));
        when(contextMock.getThisTaskIndex()).thenReturn(0);

        spout.open(topoConf, contextMock, collectorMock);
        spout.activate();

        verify(consumerMock).assign(assignedPartitions);

        return spout;
    }

}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sba.lib.gui;

import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Window;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import javax.swing.AbstractAction;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.KeyStroke;
import sba.lib.DLibTimeUtils;
import sba.lib.DLibUtils;

/**
 *
 * @author Sergio Flores
 */
public abstract class DGuiUtils {

    public static void setCursorWait(final DGuiClient client) {
        client.getFrame().setCursor(new Cursor(Cursor.WAIT_CURSOR));
    }

    public static void setCursorDefault(final DGuiClient client) {
        client.getFrame().setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    }

    public static void setWindowBounds(final Window window, final int width, final int height) {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        window.setBounds((screenSize.width - width) / 2, (screenSize.height - height) / 2, width, height);
    }

    /**
     * @param pattern The following characters can be specified:
     *  y   Any number (Character.isDigit).
     *  M   Any number (Character.isDigit).
     *  d   Any number (Character.isDigit).
     *  H   Any number (Character.isDigit).
     *  m   Any number (Character.isDigit).
     *  s   Any number (Character.isDigit).
     */
    public static String createMaskFormatterDatetime(final String pattern) {
        String maskFormatter = DLibUtils.textTrim(pattern);

        maskFormatter = maskFormatter.replaceAll("y", "#");
        maskFormatter = maskFormatter.replaceAll("M", "#");
        maskFormatter = maskFormatter.replaceAll("d", "#");
        maskFormatter = maskFormatter.replaceAll("H", "#");
        maskFormatter = maskFormatter.replaceAll("m", "#");
        maskFormatter = maskFormatter.replaceAll("s", "#");

        return maskFormatter;
    }

    public static void locateItem(final JComboBox comboBox, final int[] key) {
        boolean located = false;
        DGuiItem guiItem = null;

        if (comboBox.getItemCount() > 0) {
            if (key != null) {
                for (int i = 0; i < comboBox.getItemCount(); i++) {
                    guiItem = (DGuiItem) comboBox.getItemAt(i);

                    if (DLibUtils.compareKeys(key, guiItem.getPrimaryKey())) {
                        comboBox.setSelectedIndex(i);
                        located = true;
                        break;
                    }
                }
            }

            if (!located) {
                comboBox.setSelectedIndex(0);
            }
        }
    }

    public static void locateItem(final JComboBox comboBox, final String item) {
        boolean located = false;
        DGuiItem guiItem = null;

        if (comboBox.getItemCount() > 0) {
            if (!item.isEmpty()) {
                for (int i = 0; i < comboBox.getItemCount(); i++) {
                    guiItem = (DGuiItem) comboBox.getItemAt(i);

                    if (item.compareTo(guiItem.getItem()) == 0) {
                        comboBox.setSelectedIndex(i);
                        located = true;
                        break;
                    }
                }
            }

            if (!located) {
                comboBox.setSelectedIndex(0);
            }
        }
    }

    public static void locateItemByCode(final JComboBox comboBox, final String code) {
        boolean located = false;
        DGuiItem guiItem = null;

        if (comboBox.getItemCount() > 0) {
            if (!code.isEmpty()) {
                for (int i = 0; i < comboBox.getItemCount(); i++) {
                    guiItem = (DGuiItem) comboBox.getItemAt(i);

                    if (code.compareTo(guiItem.getCode()) == 0) {
                        comboBox.setSelectedIndex(i);
                        located = true;
                        break;
                    }
                }
            }

            if (!located) {
                comboBox.setSelectedIndex(0);
            }
        }
    }

    public static void locateItem(final JList list, final int[] key) {
        boolean located = false;
        DGuiItem guiItem = null;

        if (list.getModel().getSize() > 0) {
            if (key != null) {
                for (int i = 0; i < list.getModel().getSize(); i++) {
                    guiItem = (DGuiItem) list.getModel().getElementAt(i);

                    if (DLibUtils.compareKeys(key, guiItem.getPrimaryKey())) {
                        list.setSelectedIndex(i);
                        located = true;
                        break;
                    }
                }
            }

            if (!located) {
                list.setSelectedIndex(0);
            }
        }
    }

    /**
     * Maps provided action in component.
     *
     * @param component Root component.
     * @param action Action to be mapped. Must implement actionPerformed(ActionEvent e) method.
     * @param map Map's name.
     * @param keyCode Key code.
     */
    public static void putActionMap(final JComponent component, final AbstractAction action, final String map, final int keyCode) {
        putActionMap(component, action, map, keyCode, 0);
    }

    /**
     * Maps provided action in component.
     *
     * @param component Root component.
     * @param action Action to be mapped. Must implement actionPerformed(ActionEvent e) method.
     * @param map Map's name.
     * @param keyCode Key code.
     * @param modifiers Key code's modifiers.
     */
    public static void putActionMap(final JComponent component, final AbstractAction action, final String map, final int keyCode, final int modifiers) {
        component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(keyCode, modifiers), map);
        component.getActionMap().put(map, action);
    }

    /**
     * Creates and maps action in component.
     *
     * @param component Root component.
     * @param target Target object that will be used for method invocation.
     * @param method Method's name.
     * @param map Map's name.
     * @param keyCode Key code.
     */
    public static void createActionMap(final JComponent component, final Object target, final String method, final String map, final int keyCode) {
        createActionMap(component, target, method, null, null, map, keyCode, 0);
    }

    /**
     * Creates and maps action in component.
     *
     * @param component Root component.
     * @param target Target object that will be used for method invocation.
     * @param method Method's name.
     * @param map Map's name.
     * @param keyCode Key code.
     * @param modifiers Key code's modifiers.
     */
    public static void createActionMap(final JComponent component, final Object target, final String method, final String map, final int keyCode, final int modifiers) {
        createActionMap(component, target, method, null, null, map, keyCode, modifiers);
    }

    /**
     * Creates and maps action in panel.
     *
     * @param component Root component.
     * @param target Target object that will be used for method invocation.
     * @param method Method's name.
     * @param argClass Argument class (when not needed provide null).
     * @param arg Argument (when not needed provide null).
     * @param map Map's name.
     * @param keyCode Key code.
     */
    public static void createActionMap(final JComponent component, final Object target, final String method, final Class<?> argClass, final Object arg, final String map, final int keyCode) {
        createActionMap(component, target, method, argClass, arg, map, keyCode, 0);
    }

    /**
     * Creates and maps action in panel.
     *
     * @param component Root component.
     * @param target Target object that will be used for method invocation.
     * @param method Method's name.
     * @param argClass Argument class (when not needed provide null).
     * @param arg Argument (when not needed provide null).
     * @param map Map's name.
     * @param keyCode Key code.
     * @param modifiers Key code's modifiers.
     */
    public static void createActionMap(final JComponent component, final Object target, final String method, final Class<?> argClass, final Object arg, final String map, final int keyCode, final int modifiers) {
        AbstractAction action = new AbstractAction() {
            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                try {
                    if (argClass == null) {
                        target.getClass().getMethod(method).invoke(target);
                    }
                    else {
                        target.getClass().getMethod(method, argClass).invoke(target, arg);
                    }
                }
                catch (NoSuchMethodException exc) {
                    DLibUtils.printException(this.getClass().getName(), exc);
                }
                catch (SecurityException exc) {
                    DLibUtils.printException(this.getClass().getName(), exc);
                }
                catch (IllegalAccessException exc) {
                    DLibUtils.printException(this.getClass().getName(), exc);
                }
                catch (IllegalArgumentException exc) {
                    DLibUtils.printException(this.getClass().getName(), exc);
                }
                catch (InvocationTargetException exc) {
                    DLibUtils.printException(this.getClass().getName(), exc);
                }
                catch (Exception exc) {
                    DLibUtils.printException(this.getClass().getName(), exc);
                }
            }
        };

        putActionMap(component, action, map, keyCode, modifiers);
    }

    public static String getLabelDatetime(final int guiType) {
        String label = "";

        switch (guiType) {
            case DGuiConsts.GUI_TYPE_DATE:
                label = "fecha";
                break;
            case DGuiConsts.GUI_TYPE_DATE_DATETIME:
                label = "fecha-hora";
                break;
            case DGuiConsts.GUI_TYPE_DATE_TIME:
                label = "hora";
                break;
            default:
                label = "?";
        }

        return label;
    }

    public static String getLabelName(final JLabel label) {
        return getLabelName(label.getText());
    }

    public static String getLabelName(final String label) {
        String name = label.toLowerCase();

        if (name.endsWith(":")) {
            name = name.substring(0, name.length() - 1);
        }
        else if (name.endsWith(":*")) {
            name = name.substring(0, name.length() - 2);
        }
        else if (name.endsWith(": *")) {
            name = name.substring(0, name.length() - 3);
        }

        return name;
    }

    public static void pickDate(final DGuiDatePicker picker, final Date date, final DGuiFieldDate field) {
        picker.resetPicker();
        picker.setOption(date);
        picker.setPickerVisible(true);

        if (picker.getPickerResult() == DGuiConsts.FORM_RESULT_OK) {
            field.setValue(picker.getOption());
            field.getComponent().requestFocus();
        }
    }

    private static DGuiValidation validateDateRange(final DGuiFieldDate fieldDateStart, final DGuiFieldDate fieldDateEnd, final boolean validateYears) {
        Date dateStart = fieldDateStart.getValue();
        Date dateEnd = fieldDateEnd.getValue();
        DGuiValidation validation = new DGuiValidation();

        if (dateStart == null) {
            validation.setMessage("No se ha especificado un valor para la fecha inicial.");
            validation.setComponent(fieldDateStart.getComponent());
        }
        else if (dateEnd == null) {
            validation.setMessage("No se ha especificado un valor para la fecha final.");
            validation.setComponent(fieldDateEnd.getComponent());
        }
        else if (validateYears && DLibTimeUtils.digestYear(dateStart)[0] != DLibTimeUtils.digestYear(dateEnd)[0]) {
            validation.setMessage("El año de las fechas inicial y final debe ser el mismo.");
            validation.setComponent(fieldDateStart.getComponent());
        }
        else if (dateEnd.before(dateStart)) {
            validation.setMessage("La fecha inicial debe ser anterior a la fecha final.");
            validation.setComponent(fieldDateStart.getComponent());
        }

        return validation;
    }

    public static DGuiValidation validateDateRange(final DGuiFieldDate fieldDateStart, final DGuiFieldDate fieldDateEnd) {
        return validateDateRange(fieldDateStart, fieldDateEnd, true);
    }

    public static DGuiValidation validateDateRangeIgnoreYears(final DGuiFieldDate fieldDateStart, final DGuiFieldDate fieldDateEnd) {
        return validateDateRange(fieldDateStart, fieldDateEnd, false);
    }

    public static boolean computeValidation(final DGuiClient client, final DGuiValidation validation) {
        if (!validation.isValid()) {
            client.showMsgBoxWarning(validation.getMessage());

            if (validation.getComponent() != null) {
                if (validation.getTabbedPane() != null && validation.getTab() != -1) {
                    validation.getTabbedPane().setSelectedIndex(validation.getTab());
                }
                validation.getComponent().requestFocus();
            }
        }

        return validation.isValid();
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Startup Challenge Update: Delegating design with Elance — Brian Wheeler</title>
    <link href="https://fonts.googleapis.com/css?family=Droid+Sans:400,700" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="/assets/main.css">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="apple-touch-icon" href="/images/headshot.jpeg"/>
    <link href="/feed.xml" rel="alternate" type="application/rss+xml" title="Brian Wheeler" />
    <meta name="title" content="Startup Challenge Update: Delegating design with Elance ">
    <link rel="canonical" href="http://brianw.io/blog/2014/03/28/startup-challenge-update-delegating-design-with-elance">

    <meta property="og:title" content="Startup Challenge Update: Delegating design with Elance "/>
    <meta property="og:url" content="http://brianw.io/blog/2014/03/28/startup-challenge-update-delegating-design-with-elance"/>

    <meta property="og:description" content="So... I'm bad at sales. I can't sell things, and it's a problem for me. This is why I've started a challenge for myself I'm calling the Startup Challenge. I'm going to sell a simple..."/>
    <meta name="description" content="So... I'm bad at sales. I can't sell things, and it's a problem for me. This is why I've started a challenge for myself I'm calling the Startup Challenge. I'm going to sell a simple..."/>

    <meta property="og:site_name" content="Brian Wheeler">

            Home

            About

            Thoughts and stuff

                By <address>Brian Wheeler</address> —
                <time pubdate datetime="2014-28-March" title="March 28, 2014">March 28, 2014</time>

Startup Challenge Update: Delegating design with Elance

So... I'm bad at sales. I can't sell things, and it's a problem for me. This is why I've
started a challenge for myself I'm calling the "Startup Challenge". I'm going to sell a simple
website builder that creates a full domain name to website service for small businesses. Kind of
like what launch rock does for startups.

Anyways... this is a brief update on the process, hiring a designer through Elance.
At first I was skeptical, I got bids from some people who clearly did not know what I was looking
for. For example I had a pakistani design firm send me a fully buzzword-compliant bid on the project
that included

"professional and all browsers compatible / mobile compatible design"

So clearly right at the beginning I was a little skeptical. Then I looked into their portfolio
and while they looked like they had a decent eye for design, but their implementation was subpar.

It did not feel like Elance was coming through. I kindly rejected their bid and moved on to other
proposals. Then the same designer offered to cut there price in half.

At this point, I was ready to move on to Odesk, which to be honest has a far sexier look to it, but
later that day I got a bid on a design from Marmon Creations, a U.S.
based designer. I had a quick Skype call with him and accepted his bid.

This all happened yesterday (with reference to the time of this writing obviously) so I'm
excited to see what designs he comes up with. More to come!

        Tweet

            <address>

Written by Brian Wheeler

                Programmer, Entrepreneur, Startup Enthusiast

            </address>

        © 2015

            Brian Wheeler
            Blog ·

            About

Incorporated theme by Inc


text:
shoom is a small C++11 library for creating & opening shared memory on Windows, Linux and macOS.

## License

shoom is released under the MIT license, see the `LICENSE` file.


text:
class BrowserSwitchUI : public content::WebUIController {
 public:
  explicit BrowserSwitchUI(content::WebUI* web_ui);

  BrowserSwitchUI(const BrowserSwitchUI&) = delete;
  BrowserSwitchUI& operator=(const BrowserSwitchUI&) = delete;
};

#endif  // CHROME_BROWSER_UI_WEBUI_BROWSER_SWITCH_BROWSER_SWITCH_UI_H_


text:
'use strict';

let angular = require('angular');

module.exports = angular.module('spinnaker.core.loadBalancer.controller', [
  require('angular-ui-bootstrap'),
  require('../cloudProvider/providerSelection/providerSelection.service.js'),
  require('./filter/loadBalancer.filter.service.js'),
  require('./filter/loadBalancer.filter.model.js'),
  require('../utils/lodash.js'),
  require('../cache/deckCacheFactory.js'),
  require('../filterModel/filter.tags.directive.js'),
  require('../cloudProvider/cloudProvider.registry.js'),
])
  .controller('AllLoadBalancersCtrl', function($scope, $uibModal, _, $timeout,
                                               providerSelectionService, cloudProviderRegistry,
                                               LoadBalancerFilterModel, loadBalancerFilterService, app ) {

    LoadBalancerFilterModel.activate();
    this.initialized = false;

    $scope.application = app;

    $scope.sortFilter = LoadBalancerFilterModel.sortFilter;

    this.groupingsTemplate = require('./groupings.html');

    function addSearchFields() {
      app.loadBalancers.forEach(function(loadBalancer) {
        if (!loadBalancer.searchField) {
          loadBalancer.searchField = [
            loadBalancer.name,
            loadBalancer.region.toLowerCase(),
            loadBalancer.account,
            _.pluck(loadBalancer.serverGroups, 'name').join(' '),
            _.pluck(loadBalancer.instances, 'id').join(' '),
          ].join(' ');
        }
      });
    }

    this.clearFilters = function() {
      loadBalancerFilterService.clearFilters();
      updateLoadBalancerGroups();
    };

    let updateLoadBalancerGroups = () => {
      LoadBalancerFilterModel.applyParamsToUrl();
      $scope.$evalAsync(() => {
        loadBalancerFilterService.updateLoadBalancerGroups(app);
        $scope.groups = LoadBalancerFilterModel.groups;
        $scope.tags = LoadBalancerFilterModel.tags;
        // Timeout because the updateLoadBalancerGroups method is debounced by 25ms
        $timeout(() => { this.initialized = true; }, 50);
      });
    };

    this.createLoadBalancer = function createLoadBalancer() {
      providerSelectionService.selectProvider(app, 'loadBalancer').then(function(selectedProvider) {
        let provider = cloudProviderRegistry.getValue(selectedProvider, 'loadBalancer');
        $uibModal.open({
          templateUrl: provider.createLoadBalancerTemplateUrl,
          controller: `${provider.createLoadBalancerController} as ctrl`,
          resolve: {
            application: function() { return app; },
            loadBalancer: function() { return null; },
            isNew: function() { return true; }
          }
        });
      });
    };

    this.updateLoadBalancerGroups = _.debounce(updateLoadBalancerGroups, 200);

    function autoRefreshHandler() {
      addSearchFields();
      updateLoadBalancerGroups();
    }

    autoRefreshHandler();

    app.registerAutoRefreshHandler(autoRefreshHandler, $scope);
  }
).name;