text:
struct ToBool { explicit operator bool(); };

struct B;
struct A {
  A();
  A(const B&); // expected-note 2 {{candidate constructor}}
};
struct B { operator A() const; }; // expected-note 2 {{candidate function}}
struct I { operator int(); };
struct J { operator I(); };
struct K { operator double(); };
typedef void (*vfn)();
struct F { operator vfn(); };
struct G { operator vfn(); };

struct Base {
  int trick();
  A trick() const;
  void fn1();
};
struct Derived : Base {
  void fn2();
};
struct Convertible { operator Base&(); };
struct Priv : private Base {}; // expected-note 4 {{declared private here}}
struct Mid : Base {};
struct Fin : Mid, Derived {};
typedef void (Derived::*DFnPtr)();
struct ToMemPtr { operator DFnPtr(); };

struct BadDerived;
struct BadBase { operator BadDerived&(); };
struct BadDerived : BadBase {};

struct Fields {
  int i1, i2, b1 : 3, b2 : 3;
};
struct MixedFields {
  int i;
  volatile int vi;
  const int ci;
  const volatile int cvi;
};
struct MixedFieldsDerived : MixedFields {
};

enum Enum { EVal };

struct Ambig {
  operator short(); // expected-note 2 {{candidate function}}
  operator signed char(); // expected-note 2 {{candidate function}}
};

struct Abstract {
  virtual ~Abstract() = 0; // expected-note {{unimplemented pure virtual method '~Abstract' in 'Abstract'}}
};

struct Derived1: Abstract {
};

struct Derived2: Abstract {
};

void test()
{
  // This function tests C++0x 5.16

  // p1 (contextually convert to bool)
  int i1 = ToBool() ? 0 : 1;

  // p2 (one or both void, and throwing)
  Fields flds;
  i1 ? throw 0 : throw 1;
  i1 ? test() : throw 1;
  i1 ? throw 0 : test();
  i1 ? test() : test();
  i1 = i1 ? throw 0 : 0;
  i1 = i1 ? 0 : throw 0;
  i1 = i1 ? (throw 0) : 0;
  i1 = i1 ? 0 : (throw 0);
  i1 ? 0 : test(); // expected-error {{right operand to ? is void, but left operand is of type 'int'}}
  i1 ? test() : 0; // expected-error {{left operand to ? is void, but right operand is of type 'int'}}
  (i1 ? throw 0 : i1) = 0;
  (i1 ? i1 : throw 0) = 0;
  (i1 ? (throw 0) : i1) = 0;
  (i1 ? i1 : (throw 0)) = 0;
  (i1 ? (void)(throw 0) : i1) = 0; // expected-error {{left operand to ? is void, but right operand is of type 'int'}}
  (i1 ? i1 : (void)(throw 0)) = 0; // expected-error {{right operand to ? is void, but left operand is of type 'int'}}
  int &throwRef1 = (i1 ? flds.i1 : throw 0);
  int &throwRef2 = (i1 ? throw 0 : flds.i1);
  int &throwRef3 = (i1 ? flds.b1 : throw 0); // expected-error {{non-const reference cannot bind to bit-field}}
  int &throwRef4 = (i1 ? throw 0 : flds.b1); // expected-error {{non-const reference cannot bind to bit-field}}

  // p3 (one or both class type, convert to each other)
  // b1 (lvalues)
  Base base;
  Derived derived;
  Convertible conv;
  Base &bar1 = i1 ? base : derived;
  Base &bar2 = i1 ? derived : base;
  Base &bar3 = i1 ? base : conv;
  Base &bar4 = i1 ? conv : base;
  // these are ambiguous
  BadBase bb;
  BadDerived bd;
  (void)(i1 ? bb : bd); // expected-error {{conditional expression is ambiguous; 'BadBase' can be converted to 'BadDerived' and vice versa}}
  (void)(i1 ? bd : bb); // expected-error {{conditional expression is ambiguous}}
  // curiously enough (and a defect?), these are not
  // for rvalues, hierarchy takes precedence over other conversions
  (void)(i1 ? BadBase() : BadDerived());
  (void)(i1 ? BadDerived() : BadBase());

  // b2.1 (hierarchy stuff)
  extern const Base constret();
  extern const Derived constder();
  // should use const overload
  A a1((i1 ? constret() : Base()).trick());
  A a2((i1 ? Base() : constret()).trick());
  A a3((i1 ? constret() : Derived()).trick());
  A a4((i1 ? Derived() : constret()).trick());
  // should use non-const overload
  i1 = (i1 ? Base() : Base()).trick();
  i1 = (i1 ? Base() : Base()).trick();
  i1 = (i1 ? Base() : Derived()).trick();
  i1 = (i1 ? Derived() : Base()).trick();
  // should fail: const lost
  (void)(i1 ? Base() : constder()); // expected-error {{incompatible operand types ('Base' and 'const Derived')}}
  (void)(i1 ? constder() : Base()); // expected-error {{incompatible operand types ('const Derived' and 'Base')}}

  Priv priv;
  Fin fin;
  (void)(i1 ? Base() : Priv()); // expected-error{{private base class}}
  (void)(i1 ? Priv() : Base()); // expected-error{{private base class}}
  (void)(i1 ? Base() : Fin()); // expected-error{{ambiguous conversion from derived class 'Fin' to base class 'Base':}}
  (void)(i1 ? Fin() : Base()); // expected-error{{ambiguous conversion from derived class 'Fin' to base class 'Base':}}
  (void)(i1 ? base : priv); // expected-error {{private base class}}
  (void)(i1 ? priv : base); // expected-error {{private base class}}
  (void)(i1 ? base : fin); // expected-error {{ambiguous conversion from derived class 'Fin' to base class 'Base':}}
  (void)(i1 ? fin : base); // expected-error {{ambiguous conversion from derived class 'Fin' to base class 'Base':}}

  // b2.2 (non-hierarchy)
  i1 = i1 ? I() : i1;
  i1 = i1 ? i1 : I();
  I i2(i1 ? I() : J());
  I i3(i1 ? J() : I());
  // "the type [it] would have if E2 were converted to an rvalue"
  vfn pfn = i1 ? F() : test;
  pfn = i1 ? test : F();
  (void)(i1 ? A() : B()); // expected-error {{conversion from 'B' to 'A' is ambiguous}}
  (void)(i1 ? B() : A()); // expected-error {{conversion from 'B' to 'A' is ambiguous}}
  (void)(i1 ? 1 : Ambig()); // expected-error {{conversion from 'Ambig' to 'int' is ambiguous}}
  (void)(i1 ? Ambig() : 1); // expected-error {{conversion from 'Ambig' to 'int' is ambiguous}}
  // By the way, this isn't an lvalue:
  &(i1 ? i1 : i2); // expected-error {{cannot take the address of an rvalue}}

  // p4 (lvalue, same type)
  int &ir1 = i1 ? flds.i1 : flds.i2;
  (i1 ? flds.b1 : flds.i2) = 0;
  (i1 ? flds.i1 : flds.b2) = 0;
  (i1 ? flds.b1 : flds.b2) = 0;

  // p5 (conversion to built-in types)
  // GCC 4.3 fails these
  double d1 = i1 ? I() : K();
  pfn = i1 ? F() : G();
  DFnPtr pfm;
  pfm = i1 ? DFnPtr() : &Base::fn1;
  pfm = i1 ? &Base::fn1 : DFnPtr();

  // p6 (final conversions)
  i1 = i1 ? i1 : ir1;
  int *pi1 = i1 ? &i1 : 0;
  pi1 = i1 ? 0 : &i1;
  i1 = i1 ? i1 : EVal;
  i1 = i1 ? EVal : i1;
  d1 = i1 ? 'c' : 4.0;
  d1 = i1 ? 4.0 : 'c';
  Base *pb = i1 ? (Base*)0 : (Derived*)0;
  pb = i1 ? (Derived*)0 : (Base*)0;
  pfm = i1 ? &Base::fn1 : &Derived::fn2;
  pfm = i1 ? &Derived::fn2 : &Base::fn1;
  pfm = i1 ? &Derived::fn2 : 0;
  pfm = i1 ? 0 : &Derived::fn2;
  const int (MixedFieldsDerived::*mp1) =
    i1 ? &MixedFields::ci : &MixedFieldsDerived::i;
  const volatile int (MixedFields::*mp2) =
    i1 ? &MixedFields::ci : &MixedFields::cvi;
  (void)(i1 ? &MixedFields::ci : &MixedFields::vi);
  // Conversion of primitives does not result in an lvalue.
  &(i1 ? i1 : d1); // expected-error {{cannot take the address of an rvalue}}

  (void)&(i1 ? flds.b1 : flds.i1); // expected-error {{address of bit-field requested}}
  (void)&(i1 ? flds.i1 : flds.b1); // expected-error {{address of bit-field requested}}

  unsigned long test0 = 5;
  test0 = test0 ? (long) test0 : test0; // expected-warning {{operand of ? changes signedness: 'long' to 'unsigned long'}}
  test0 = test0 ? (int) test0 : test0; // expected-warning {{operand of ? changes signedness: 'int' to 'unsigned long'}}
  test0 = test0 ? (short) test0 : test0; // expected-warning {{operand of ? changes signedness: 'short' to 'unsigned long'}}
  test0 = test0 ? test0 : (long) test0; // expected-warning {{operand of ? changes signedness: 'long' to 'unsigned long'}}
  test0 = test0 ? test0 : (int) test0; // expected-warning {{operand of ? changes signedness: 'int' to 'unsigned long'}}
  test0 = test0 ? test0 : (short) test0; // expected-warning {{operand of ? changes signedness: 'short' to 'unsigned long'}}
  test0 = test0 ? test0 : (long) 10;
  test0 = test0 ? test0 : (int) 10;
  test0 = test0 ? test0 : (short) 10;
  test0 = test0 ? (long) 10 : test0;
  test0 = test0 ? (int) 10 : test0;
  test0 = test0 ? (short) 10 : test0;

  int test1;
  test0 = test0 ? EVal : test0;
  test1 = test0 ? EVal : (int) test0;

  test0 = test0 ? EVal : test1; // expected-warning {{operand of ? changes signedness: 'int' to 'unsigned long'}}
  test0 = test0 ? test1 : EVal; // expected-warning {{operand of ? changes signedness: 'int' to 'unsigned long'}}

  test1 = test0 ? EVal : (int) test0;
  test1 = test0 ? (int) test0 : EVal;

  // Note the thing that this does not test: since DR446, various situations
  // *must* create a separate temporary copy of class objects. This can only
  // be properly tested at runtime, though.

  const Abstract &abstract1 = true ? static_cast<const Abstract&>(Derived1()) : Derived2(); // expected-error {{allocating an object of abstract class type 'const Abstract'}}
  const Abstract &abstract2 = true ? static_cast<const Abstract&>(Derived1()) : throw 3;
}

namespace PR6595 {
  struct OtherString {
    OtherString();
    OtherString(const char*);
  };

  struct String {
    String(const char *);
    String(const OtherString&);
    operator const char*() const;
  };

  void f(bool Cond, String S, OtherString OS) {
    (void)(Cond? S : "");
    (void)(Cond? "" : S);
    const char a[1] = {'a'};
    (void)(Cond? S : a);
    (void)(Cond? a : S);
    (void)(Cond? OS : S);
  }
}

namespace PR6757 {
  struct Foo1 {
    Foo1();
    Foo1(const Foo1&);
  };

  struct Foo2 { };

  struct Foo3 {
    Foo3(); // expected-note{{requires 0 arguments}}
    Foo3(Foo3&); // expected-note{{would lose const qualifier}}
  };

  struct Bar {
    operator const Foo1&() const;
    operator const Foo2&() const;
    operator const Foo3&() const;
  };

  void f() {
    (void)(true ? Bar() : Foo1()); // okay
    (void)(true ? Bar() : Foo2()); // okay
    (void)(true ? Bar() : Foo3()); // expected-error{{no viable constructor copying temporary}}
  }
}

// Reduced from selfhost.
namespace test1 {
  struct A {
    enum Foo {
      fa, fb, fc, fd, fe, ff
    };

    Foo x();
  };

  void foo(int);

  void test(A *a) {
    foo(a ? a->x() : 0);
  }
}

namespace rdar7998817 {
  class X {
    X(X&); // expected-note{{declared private here}}

    struct ref { };

  public:
    X();
    X(ref);

    operator ref();
  };

  void f(bool B) {
    X x;
    (void)(B? x // expected-error{{calling a private constructor of class 'rdar7998817::X'}}
           : X());
  }
}

namespace PR7598 {
  enum Enum {
    v = 1,
  };

  const Enum g() {
    return v;
  }

  const volatile Enum g2() {
    return v;
  }

  void f() {
    const Enum v2 = v;
    Enum e = false ? g() : v;
    Enum e2 = false ? v2 : v;
    Enum e3 = false ? g2() : v;
  }

}

namespace PR9236 {
#define NULL 0L
  void f() {
    int i;
    (void)(true ? A() : NULL); // expected-error{{non-pointer operand type 'A' incompatible with NULL}}
    (void)(true ? NULL : A()); // expected-error{{non-pointer operand type 'A' incompatible with NULL}}
    (void)(true ? 0 : A()); // expected-error{{incompatible operand types}}
    (void)(true ? nullptr : A()); // expected-error{{non-pointer operand type 'A' incompatible with nullptr}}
    (void)(true ? nullptr : i); // expected-error{{non-pointer operand type 'int' incompatible with nullptr}}
    (void)(true ? __null : A()); // expected-error{{non-pointer operand type 'A' incompatible with NULL}}
    (void)(true ? (void*)0 : A()); // expected-error{{incompatible operand types}}
  }
}

namespace DR587 {
  template<typename T>
  const T *f(bool b) {
    static T t1 = T();
    static const T t2 = T();
    return &(b ? t1 : t2);
  }
  struct S {};
  template const int *f(bool);
  template const S *f(bool);

  extern bool b;
  int i = 0;
  const int ci = 0;
  volatile int vi = 0;
  const volatile int cvi = 0;

  const int &cir = b ? i : ci;
  volatile int &vir = b ? vi : i;
  const volatile int &cvir1 = b ? ci : cvi;
  const volatile int &cvir2 = b ? cvi : vi;
  const volatile int &cvir3 = b ? ci : vi; // expected-error{{volatile lvalue reference to type 'const volatile int' cannot bind to a temporary of type 'int'}}
}

namespace PR17052 {
  struct X {
    int i_;
    bool b_;

    int &test() { return b_ ? i_ : throw 1; }
  };
}

namespace PR26448 {
struct Base {};
struct Derived : Base {};
Base b;
Derived d;
typedef decltype(true ? static_cast<Base&&>(b) : static_cast<Derived&&>(d)) x;
typedef Base &&x;
}

namespace lifetime_extension {
  struct A {};
  struct B : A { B(); ~B(); };
  struct C : A { C(); ~C(); };

  void f(bool b) {
    A &&r = b ? static_cast<A&&>(B()) : static_cast<A&&>(C());
  }

  struct D { A &&a; };
  void f_indirect(bool b) {
    D d = b ? D{B()} : D{C()};
  }
}


text:
<?php

namespace Illuminate\Mail;

use Illuminate\Contracts\Queue\ShouldQueue;

class MailableMailer
{
    /**
     * The mailer instance.
     *
     * @var array
     */
    protected $mailer;

    /**
     * The "to" recipients of the message.
     *
     * @var array
     */
    protected $to = [];

    /**
     * The "cc" recipients of the message.
     *
     * @var array
     */
    protected $cc = [];

    /**
     * The "bcc" recipients of the message.
     *
     * @var array
     */
    protected $bcc = [];

    /**
     * Create a new mailable mailer instance.
     *
     * @param  Mailer  $mailer
     * @return void
     */
    public function __construct(Mailer $mailer)
    {
        $this->mailer = $mailer;
    }

    /**
     * Set the recipients of the message.
     *
     * @param  mixed  $users
     * @return $this
     */
    public function to($users)
    {
        $this->to = $users;

        return $this;
    }

    /**
     * Set the recipients of the message.
     *
     * @param  mixed  $users
     * @return $this
     */
    public function cc($users)
    {
        $this->cc = $users;

        return $this;
    }

    /**
     * Set the recipients of the message.
     *
     * @param  mixed  $users
     * @return $this
     */
    public function bcc($users)
    {
        $this->bcc = $users;

        return $this;
    }

    /**
     * Send a new mailable message instance.
     *
     * @param  Mailable  $mailable
     * @return mixed
     */
    public function send(Mailable $mailable)
    {
        if ($mailable instanceof ShouldQueue) {
            return $this->queue($mailable);
        }

        return $this->mailer->send($this->fill($mailable));
    }

    /**
     * Send a mailable message immediately.
     *
     * @param  Mailable  $mailable
     * @return mixed
     */
    public function sendNow(Mailable $mailable)
    {
        return $this->mailer->send($this->fill($mailable));
    }

    /**
     * Push the given mailable onto the queue.
     *
     * @param  Mailable  $mailable
     * @return mixed
     */
    public function queue(Mailable $mailable)
    {
        $mailable = $this->fill($mailable);

        if (isset($mailable->delay)) {
            return $this->mailer->later($mailable->delay, $mailable);
        }

        return $this->mailer->queue($mailable);
    }

    /**
     * Deliver the queued message after the given delay.
     *
     * @param  \DateTime|int  $delay
     * @param  Mailable  $mailable
     * @return mixed
     */
    public function later($delay, Mailable $mailable)
    {
        return $this->mailer->later($delay, $this->fill($mailable));
    }

    /**
     * Populate the mailable with the addresses.
     *
     * @param  Mailable  $mailable
     * @return Mailable
     */
    protected function fill(Mailable $mailable)
    {
        return $mailable->to($this->to)
                        ->cc($this->cc)
                        ->bcc($this->bcc);
    }
}

redpajama_set_name: RedPajamaGithub


text:
import {FormioComponents} from '../Components';
export class ColumnComponent extends FormioComponents {
    get className() {
        const comp   = this.component;
        const width  = ` col-sm-${comp.width  ? comp.width  : 6}`;
        const offset = ` col-sm-offset-${comp.offset ? comp.offset : 0}`;
        const push   = ` col-sm-push-${comp.push   ? comp.push   : 0}`;
        const pull   = ` col-sm-pull-${comp.pull   ? comp.pull   : 0}`;
        return `col${width}${offset}${push}${pull}`;
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Contact - rikutaka-cafe</title>

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

    <link href="css/rikutaka-cafe.css" rel="stylesheet">

rikutaka-cafe

The Revolution from cafes at RIKUZENTAKATA CITY

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            Toggle navigation

          </button>
          rikutaka-cafe

Home

About

Blog

Contact

Contact rikutaka-cafe

Phone: 03-3570-9151

Email: shin@szk-engineering.com

Address: 2-3-6, Aomi, Koto-ku, Tokyo JP

Contact form

お問い合わせはこちらから

                <form role="form">

                      Name
                      <input type="text" class="form-control">

                      Email Address
                      <input type="email" class="form-control">

                      Phone Number
                      <input type="phone" class="form-control">

                      Message
                      <textarea class="form-control" rows="6"></textarea>

                      <input type="hidden" name="save" value="contact">
                      <button type="submit" class="btn btn-default">Submit</button>

              </form>

Copyright © szk-engineering 2013


text:
package com.example.boardofmessagesapp.ui;

import android.content.Context;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.boardofmessagesapp.R;
import com.example.boardofmessagesapp.databinding.FragmentDeleteBoardBinding;
import com.example.boardofmessagesapp.databinding.FragmentShowMessagesListBinding;
import com.example.boardofmessagesapp.ui.placeholder.PlaceholderContent;

public class ShowMessagesFragment extends Fragment {

    private FragmentShowMessagesListBinding binding;
    private MainViewModel mainViewModel;

    @Override
    public View onCreateView(
            LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState
    ) {
        binding = FragmentShowMessagesListBinding.inflate(inflater, container, false);
        mainViewModel = new ViewModelProvider(requireActivity()).get(MainViewModel.class);

        binding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        binding.recyclerView.addItemDecoration(
                new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
        MessageRecyclerViewAdapter messageAdapter = new MessageRecyclerViewAdapter();
        binding.recyclerView.setAdapter(messageAdapter);

        mainViewModel.getMessages().observe(getViewLifecycleOwner(), messageAdapter::submitList);
        mainViewModel.getCurrentBoardId().observe(getViewLifecycleOwner(), iid -> {
            if (iid != null) {
                binding.boardIdEditText.setText(iid.toString());
            }
        });

        binding.showMessagesButton.setOnClickListener(v -> {
            int iid = Integer.parseInt(binding.boardIdEditText.getText().toString());
            mainViewModel.showMessagesFor(iid);
        });

        return binding.getRoot();
    }

    public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        binding = null;
    }
}


text:
class Profile;
class ProfileSyncService;

class ProfileSyncServiceFactory : public BrowserContextKeyedServiceFactory {
 public:
  static ProfileSyncService* GetForProfile(Profile* profile);
  static bool HasProfileSyncService(Profile* profile);

  static ProfileSyncServiceFactory* GetInstance();

 private:
  friend struct DefaultSingletonTraits<ProfileSyncServiceFactory>;

  ProfileSyncServiceFactory();
  ~ProfileSyncServiceFactory() override;

  // BrowserContextKeyedServiceFactory:
  KeyedService* BuildServiceInstanceFor(
      content::BrowserContext* context) const override;
};

#endif  // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_FACTORY_H_


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class ForgotPassScript : MonoBehaviour {

    Button forgotBut;

	// Use this for initialization
	void Start () {
        forgotBut = this.GetComponent<Button>();
        forgotBut.onClick.AddListener(ForgotAction);
	}

	// Update is called once per frame
	void Update () {

	}

    public void ForgotAction()
    {
        SceneManager.LoadScene("ForgotPassScene");
    }
}


text:
namespace FW1FontWrapper {

// Query interface
HRESULT STDMETHODCALLTYPE CFW1GlyphAtlas::QueryInterface(REFIID riid, void **ppvObject) {
	if(ppvObject == NULL)
		return E_INVALIDARG;

	if(IsEqualIID(riid, __uuidof(IFW1GlyphAtlas))) {
		*ppvObject = static_cast<IFW1GlyphAtlas*>(this);
		AddRef();
		return S_OK;
	}

	return CFW1Object::QueryInterface(riid, ppvObject);
}

// Get the D3D11 device used by this atlas
HRESULT STDMETHODCALLTYPE CFW1GlyphAtlas::GetDevice(ID3D11Device **ppDevice) {
	if(ppDevice == NULL)
		return E_INVALIDARG;

	m_pDevice->AddRef();
	*ppDevice = m_pDevice;

	return S_OK;
}

// Get total glyph count in atlas
UINT STDMETHODCALLTYPE CFW1GlyphAtlas::GetTotalGlyphCount() {
	UINT total = 0;

	for(UINT i=0; i < m_sheetCount; ++i) {
		FW1_GLYPHSHEETDESC desc;
		m_glyphSheets[i]->GetDesc(&desc);

		total += desc.GlyphCount;
	}

	return total;
}

// Get sheet count
UINT STDMETHODCALLTYPE CFW1GlyphAtlas::GetSheetCount() {
	return m_sheetCount;
}

// Get sheet
HRESULT STDMETHODCALLTYPE CFW1GlyphAtlas::GetSheet(UINT SheetIndex, IFW1GlyphSheet **ppGlyphSheet) {
	if(ppGlyphSheet == NULL)
		return E_INVALIDARG;

	if(SheetIndex < m_sheetCount) {
		*ppGlyphSheet = m_glyphSheets[SheetIndex];

		return S_OK;
	}

	*ppGlyphSheet = NULL;

	return E_INVALIDARG;
}

// Get texture coordinates
const FW1_GLYPHCOORDS* STDMETHODCALLTYPE CFW1GlyphAtlas::GetGlyphCoords(UINT SheetIndex) {
	if(SheetIndex < m_sheetCount)
		return m_glyphSheets[SheetIndex]->GetGlyphCoords();

	return 0;
}

// Set sheet shader resources
HRESULT STDMETHODCALLTYPE CFW1GlyphAtlas::BindSheet(ID3D11DeviceContext *pContext, UINT SheetIndex, UINT Flags) {
	if(SheetIndex < m_sheetCount)
		return m_glyphSheets[SheetIndex]->BindSheet(pContext, Flags);

	return E_INVALIDARG;
}

// Insert texture into atlas
UINT STDMETHODCALLTYPE CFW1GlyphAtlas::InsertGlyph(
	const FW1_GLYPHMETRICS *pGlyphMetrics,
	const void *pGlyphData,
	UINT RowPitch,
	UINT PixelStride
) {
	UINT glyphIndex = 0xffffffff;
	UINT sheetIndex = 0;

	// Get open sheet range
	EnterCriticalSection(&m_glyphSheetsCriticalSection);
	UINT start = m_currentSheetIndex;
	UINT end = m_sheetCount;
	LeaveCriticalSection(&m_glyphSheetsCriticalSection);

	// Attempt to insert glyph
	for(UINT i=start; i < end; ++i) {
		IFW1GlyphSheet *pGlyphSheet = m_glyphSheets[i];

		glyphIndex = pGlyphSheet->InsertGlyph(pGlyphMetrics, pGlyphData, RowPitch, PixelStride);
		if(glyphIndex != 0xffffffff) {
			sheetIndex = i;
			break;
		}
	}

	// Try to create a new glyph sheet on failure
	if(glyphIndex == 0xffffffff && m_sheetCount < m_maxSheetCount) {
		IFW1GlyphSheet *pGlyphSheet;
		if(SUCCEEDED(createGlyphSheet(&pGlyphSheet))) {
			glyphIndex = pGlyphSheet->InsertGlyph(pGlyphMetrics, pGlyphData, RowPitch, PixelStride);

			UINT newSheetIndex = InsertSheet(pGlyphSheet);
			if(newSheetIndex != 0xffffffff)
				sheetIndex = newSheetIndex;
			else
				glyphIndex = 0xffffffff;

			pGlyphSheet->Release();
		}
	}

	if(glyphIndex == 0xffffffff)
		return 0xffffffff;

	return (sheetIndex << 16) | glyphIndex;
}

// Insert glyph sheets
UINT STDMETHODCALLTYPE CFW1GlyphAtlas::InsertSheet(IFW1GlyphSheet *pGlyphSheet) {
	if(pGlyphSheet == NULL)
		return 0xffffffff;

	UINT sheetIndex = 0xffffffff;

	EnterCriticalSection(&m_glyphSheetsCriticalSection);
	if(m_sheetCount < m_maxSheetCount) {
		pGlyphSheet->AddRef();

		sheetIndex = m_sheetCount;

		m_glyphSheets[sheetIndex] = pGlyphSheet;

		_WriteBarrier();
		MemoryBarrier();

		++m_sheetCount;

		// Restrict the number of open sheets
		UINT numActiveSheets = 4;

		if(m_sheetCount > m_currentSheetIndex + numActiveSheets) {
			m_glyphSheets[m_currentSheetIndex]->CloseSheet();

			++m_currentSheetIndex;
		}
	}
	LeaveCriticalSection(&m_glyphSheetsCriticalSection);

	return sheetIndex;
}

// Flush all sheets with possible new glyphs
void STDMETHODCALLTYPE CFW1GlyphAtlas::Flush(ID3D11DeviceContext *pContext) {
	UINT first = 0;
	UINT end = 0;

	EnterCriticalSection(&m_glyphSheetsCriticalSection);

	first = m_flushedSheetIndex;
	end = m_sheetCount;

	m_flushedSheetIndex = m_currentSheetIndex;

	LeaveCriticalSection(&m_glyphSheetsCriticalSection);

	for(UINT i=first; i < end; ++i)
		m_glyphSheets[i]->Flush(pContext);
}

}// namespace FW1FontWrapper


text:
@implementation OCSDefaultScopeFactory {
    NSMutableDictionary *_scopeRegistry;

    NSDictionary *_scopeNameToClassMapping;
}

- (id)init {
    self = [super init];
    if (self) {
        _scopeRegistry = [[NSMutableDictionary alloc] init];
        _scopeNameToClassMapping = @{
                @"singleton": [OCSSingletonScope class],
                @"prototype": [OCSPrototypeScope class]
        };
    }
    return self;
}

- (id<OCSScope>)scopeForName:(NSString *)name {
    if (!name) {
        return nil;
    }

    id<OCSScope> scope = _scopeRegistry[name];
    if (!scope) {
        Class scopeClass = _scopeNameToClassMapping[name];
        if (!scopeClass) {
            scopeClass = [OCSSingletonScope class];
        }
        scope = [[scopeClass alloc] init];
        _scopeRegistry[name] = scope;
    }
    return scope;
}

@end


text:
package org.dynamicfactory.swing.classEditors;

import org.dynamicfactory.Creatable;

import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;

/**
 * Created by dmcennis on 4/7/2016.
 */
public interface Renderer extends TableCellRenderer, Creatable<Renderer> {

}


text:
require "spec_helper"

RSpec.describe Spree::Stock::QuantifierWithPending do
  let(:product) { create(:product_in_stock) }
  let(:variant) { product.master }

  before do
    variant.stock_items.first.set_count_on_hand(10)
  end

  describe "#total_on_hand" do
    context "without giving a pending order" do
      it "returns remaining stock including reservations in customers' cart" do
        create_pending_order(quantity: 1)
        create_pending_order(quantity: 2)
        quantifier = Spree::Stock::QuantifierWithPending.new(variant)

        expect(quantifier.total_on_hand).to eq 7
      end

      it "does not return negative number" do
        create_pending_order(quantity: 11)
        quantifier = Spree::Stock::QuantifierWithPending.new(variant)

        expect(quantifier.total_on_hand).to eq 0
      end
    end

    context "with a pending order" do
      it "returns remaining stock with reservation but exclude current order" do
        order = create_pending_order(quantity: 1)
        create_pending_order(quantity: 2)
        quantifier = Spree::Stock::QuantifierWithPending.new(variant, order)

        expect(quantifier.total_on_hand).to eq 8
      end
    end
  end

  def create_pending_order(quantity:)
    create(:order, state: "cart").tap do |order|
      create(:line_item, order: order, product: product, quantity: quantity)
    end
  end
end


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <title>Kleptography in RSA</title>
    <meta name="description" content="" />

    <meta name="HandheldFriendly" content="True" />
    <meta name="MobileOptimized" content="320" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="stylesheet" type="text/css" href="//cothan.github.io/themes/the-shell/assets/highlighter/prettify.css?v=1504402433351" />
    <link rel="stylesheet" type="text/css" href="//cothan.github.io/themes/the-shell/assets/css/screen.css?v=1504402433351" />

    <link rel="canonical" href="https://cothan.github.io/2016/12/30/Kleptography-in-RSA.html" />
    <meta name="referrer" content="origin" />

    <meta property="og:site_name" content="cothan's blog" />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="Kleptography in RSA" />
    <meta property="og:description" content="Constructing Kleptography RSA Here is a RSA key generation I&#8217;ve encountered, re-write it in Python and modify y value. plainRSA.py from hashlib import sha512 import gmpy2 from Crypto.Util.number import * from Crypto.PublicKey import RSA def concat(a,b): 	result = long_to_bytes(a) + long_to_" />
    <meta property="og:url" content="https://cothan.github.io/2016/12/30/Kleptography-in-RSA.html" />
    <meta property="article:published_time" content="2016-12-30T00:00:00.000Z" />
    <meta property="article:tag" content="Kleptography" />
    <meta property="article:tag" content=" backdoor" />
    <meta property="article:tag" content=" RSA" />
    <meta property="article:tag" content=" Cryptography" />

    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Kleptography in RSA" />
    <meta name="twitter:description" content="Constructing Kleptography RSA Here is a RSA key generation I&#8217;ve encountered, re-write it in Python and modify y value. plainRSA.py from hashlib import sha512 import gmpy2 from Crypto.Util.number import * from Crypto.PublicKey import RSA def concat(a,b): 	result = long_to_bytes(a) + long_to_" />
    <meta name="twitter:url" content="https://cothan.github.io/2016/12/30/Kleptography-in-RSA.html" />

    <meta name="generator" content="HubPress" />
    <link rel="alternate" type="application/rss+xml" title="cothan's blog" href="https://cothan.github.io/rss/" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/atom-one-dark.min.css">

        <time datetime="2016-12-30">30 Dec 2016</time> on Kleptography |  backdoor |  RSA |  Cryptography

Kleptography in RSA

Constructing Kleptography RSA

Here is a RSA key generation I’ve encountered, re-write it in Python and modify y value.

plainRSA.py

from hashlib import sha512
import gmpy2
from Crypto.Util.number import *
from Crypto.PublicKey import RSA

def concat(a,b):
	result = long_to_bytes(a) + long_to_bytes(b)
	return bytes_to_long(result)

e = 0x10001L

y = 137958370352159135222115976294090823918813740962370736789718942491361644360661710801758045764079994670487433729509308797593020074821243474927394166892075562520198248534801129806018696876913137340988758741499648826938924777232925036104356182155065679567605819489851037881366651289634969236668620526606365844929L (1)

n = 0
while size(n) != 2048: (2)

    while True:
        s = getRandomNBitInteger(1024)
        p = bytes_to_long(sha512(str(s)).digest()) (3)
        if isPrime(p):
            break

    while True:
        RND = getRandomNBitInteger(1024) (4)
        c = gmpy2.powmod(s, e, y)
        q, r = divmod(concat(c, RND), p)
        if isPrime(q):
            break

    n = p*q

key = RSA.construct((long(n), e))
print key.exportKey('PEM')

f = open('public.key', 'w')
f.write(key.exportKey('PEM'))
f.close()

1
A random 1024 bit number y to be sure it’s strong

2
To make sure we generate 2048 bit for RSA, it’s recommended by everyone

3
One-way hash to be safe

4
An additional random 1024 to make some noise

Here is the PEM key format

public.key

-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmE76aMYkoDCrpWrQ9zNE
Y2ksrognjfmY+kvc5PZ+npqk+hcdTj4sOm/qszSmaOReeYsbjb3ZlfOBjko8QASV
DW9emSHEYV/kAxd5v1WjzrjFw3xa+dAut1WNTIprVUEIQlvxHaRJkqpkAPpRe2LF
luS0/1Hsfi2m0+E0x6MinBmZ4rxopdfA4fdXn2XJ6fKKbgk3jBpM/wylU1Fpl9Iv
BuL3NH5hhIUbyadubrKcp08wWCATEkz/sjFuEqqFAdDUK4Vwles/LfgwTmBZ3wop
LtziCCDg+xe8XYuV9/t+YzC8tZnV/lyhaTdCDo6aVZfe+NGRgfymj4YUbmQa2aDI
YwIDAQAB
-----END PUBLIC KEY-----

You see that prime p is constructed by using hashing function sha512, well, it’s is irreversible, and collision resistant hash function. So p is good.

About q, it’s a number divided from c || RND (where || is string concatenation), c is encrypted by standard exponent e, modulus y is randomed somewhere., RND is random 1024 bits, it’s unguessable.

So that all about the script plainRSA.py

So, in our Public Key, modulus n is 2048 bits, and e is standard 65537, hmm, what could be wrong with it?

The idea is, if you construct a prime, so it’s a backdoor.

Notice carefully, you have c || RND == p*q + r = n + r where r is remainder, well, RND is throw away variable, you know nothing about it, you don’t know r either. All you have here is just modulus n and constant y

Recover p and q in backdoor script

Because size(y) == 1024, turn out it’s infeasible to factor y, since y is composite number.

The one who construct y for sure know private key of y. Because this is an example, so I am the only one know Qy and Py where Qy*Py == y.

Okay, you may say, "yeah, you know private key of y, so what?"

In the script, c || RND == n + r, you don’t know RND and r of course, but you know c. Here is why?

RND is 1024 bit integer, right?

n is 2048 bit integer, right?

So c is about ~1024 bit integer.

Turn out c is ~1024 bit MSB of n: u = int(bin(n).lstrip('0b')[:1024], 2), therefore c = u or c = u + 1 to make sure I cover both cases.

After I have c along with private key of y, I can recover s, because c = gmpy2.powmod(s, e, y). Remember where s is used for? Ha, p = sha512(s)!

Yeah, and now you have p, to find q, simply divide n with p.

recoverBackdoorRSA.py

from Crypto.Util.number import *
from hashlib import sha512
from gmpy2 import invert, powmod
from Crypto.PublicKey import RSA

f = open('public.key').read()
key = RSA.importKey(f)
n = key.n
e = key.e

print '[+] Size of modulus n = {}'.format(size(n))

q_y = 12355393581802517800534756508811844644770761762744186295908600685329573730509217995363674046594250137126798223820380697000389692001480558430110322312081283L (1)
p_y = 11165841819507016188835903178041947896988888542246355832540481196309549787585458313943346644218636346941442788637199475673686977378380840377188017241222763L (2)
y = q_y * p_y
phi_y = (q_y - 1)*(p_y - 1)
d = invert(e, phi_y)

u = int(bin(n).lstrip('0b')[:size(n)/2], 2)

c1 = u
c2 = u + 1

m1 = powmod(c1, d, y)
m2 = powmod(c2, d, y)

m1 = bytes_to_long(sha512(str(m1)).digest())
m2 = bytes_to_long(sha512(str(m2)).digest())

if n % m1 == 0:
    m = m1
elif n % m2 == 0:
    m = m2

p = m
q = n / m

assert p*q == n

print '[+] Private key p = {0:x}'.format(p)
print '[+] Private key p = {0:x}'.format(q)

1
Factored 512 bits prime of backdoored number y

2
Factored 512 bits prime of backdoored number y

output

[+] Size of modulus n = 2048
[+] Private key p = 918bdd10fe8edd09e9aa74bcbbfc73d55015443efa21d0fe4ad6f68c2b53b33ca4af6da91ec20a1e2f85cddb6d720bee9bfb62ad0bcb6ba91a54bd5405eb0105
[+] Private key p = 10be4d712d1560537c972194c25948bbbc70c8de1a42fa9bdb27fb2d4bbef0c26cb2029b9b8686c6713cec5626dad8c7091d570aad65ba80c4961fcc7d68f3c54b99cf451b41ad090d0dd7e7c44760deba44f857dde6ebe84228ab5590ab77cc6591b08385af1e9b3fee02251109ebeb5f63aca8127206d693c1f98e439c4d0a48ef9765d6e5423f3d0d99b6c3b936d325659406512bd2430627d05153e4f8870854558c9906a5f596883d2151ccda1523dd9c4804766ba791ca9577357fd8047

That’s it, that’s how you place a backdoor inside RSA key generation!

Conclusion

This isn’t something new, there is a paper about it, the next part is to construct backdoor inside Diffie-Hellman, I recognize it is a part of Matasano Set 8, so right now I can’t publish it until.. a few years later.

Therefore, I recommend you learn it by yourself.

cothan

DefconUA member / Cryptographer. I love putting backdoor in generator. Science and Mathematics, Computing Performance and Ideas. I am looking for security jobs.

Share this

                    Twitter

                    Facebook

                    Google+

All content copyright cothan's blog © 2017 • All rights reserved.

Proudly published with HubPress in The Shell theme.


text:
@class UIImage;

@interface MRSong (Helper)

+ (NSArray *)songsInContext:(NSManagedObjectContext *)context
               withBpmRange:(NSRange const)range
                      error:(NSError **const)errorPtr;

+ (MRSong *)songInContext:(NSManagedObjectContext *)contextOrNil
                   withID:(NSNumber *)persistentID
                      uri:(NSString *)uri
                    title:(NSString *)title
                  albumID:(NSNumber *)albumPersistentID
               albumTitle:(NSString *)albumTitle
                 artistID:(NSNumber *)artistPersistentID
               artistName:(NSString *)artistName
                    error:(NSError **)errorPtr;

+ (MRSong *)song:(NSManagedObjectID *)objectID
       inContext:(NSManagedObjectContext *)contextOrNil
       withError:(NSError **)errorPtr;

- (MRArtist *)updateWithArtistPersistentID:(NSNumber *)artistPersistentID
                                      name:(NSString *)artistName
                                     error:(NSError **)errorPtr;

- (MRAlbum *)updateWithAlbumPersistentID:(NSNumber *)albumPersistentID
                                   title:(NSString *)albumTitle
                      artistPersistentID:(NSNumber *)artistPersistentID
                                    name:(NSString *)artistName
                                   error:(NSError **)errorPtr;

- (MRArtwork *)updateWithArtworkImage:(UIImage *)image
                                error:(NSError **)errorPtr;

- (MRComposer *)updateWithComposerPersistentID:(NSNumber *)composerPersistentID
                                          name:(NSString *)composerName
                                         error:(NSError **)errorPtr;

- (MRGenre *)updateWithGenrePersistentID:(NSNumber *)genrePersistentID
                                    name:(NSString *)genreName
                                   error:(NSError **)errorPtr;

- (BOOL)isDetectingBpm;

@end


text:
package org.ovirt.engine.core.common.action;

import javax.validation.Valid;

import org.ovirt.engine.core.common.businessentities.profiles.ProfileBase;
import org.ovirt.engine.core.compat.Guid;

public abstract class ProfileParametersBase<T extends ProfileBase> extends VdcActionParametersBase {

    private static final long serialVersionUID = 1303387921254823324L;

    private boolean addPermissions;

    public ProfileParametersBase(boolean addPermissions) {
        this.addPermissions = addPermissions;
    }

    public ProfileParametersBase(T profile, boolean addPermissions) {
        this.profile = profile;
        this.addPermissions = addPermissions;
    }

    public ProfileParametersBase(T profile) {
        this.profile = profile;
    }

    @Valid
    private T profile;

    public ProfileParametersBase() {}

    public T getProfile() {
        return profile;
    }

    public void setProfile(T profile) {
        this.profile = profile;
    }

    public Guid getProfileId() {
        return profile.getId();
    }

    public void setProfileId(Guid profileId) {
        this.profile.setId(profileId);
    }

    public boolean isAddPermissions() {
        return addPermissions;
    }

    public void setAddPermissions(boolean addPermissions) {
        this.addPermissions = addPermissions;
    }

}


text:
/**
 * Description: Core theme for Lara
 */

/**
 * Structure
 */
html{background-color:#eee;}
body{margin:0;padding:0;color:#333;background-color:#fff;
  font: 1em Verdana, Arial, Helvetica, sans-serif;}

#wrap-header {}
#wrap-main {}
#wrap-footer {border-top:1px solid #ccc;background-color:#eee;}

#header,
#main,
#footer {margin:0 auto;width:970px;padding:8px;}
#main,
#footer {margin-bottom:16px;}

#header,
#main {background-color:#fff;}
#main {min-height:300px;}
#footer {font-size:0.80em;color:#666;background-color:#eee;}

/**
 * Banner
 */
#banner {display:table;margin-bottom:10px;}

.site-logo,
.site-title,
.site-slogan {display:table-cell;width:inherit;vertical-align:middle;text-align:left;}

.site-logo {}
.site-title,
.site-slogan {font-family:monospace;line-height:0;padding-left:20px;color:#333;
  text-shadow:#ccc 2px -2px 2px;}
.site-title  {font-size:4em;font-weight:bold;}
.site-slogan {font-size:1.5em;}

/**
 * Links
 */
a         {color:inherit;}
a:link    {}
a:visited {}
a:hover,
a:focus   {text-decoration:none;color:#5C0A0A;}
a:active  {}

/**
 * Headings
 */
h1{border-bottom:3px double #ccc;padding-bottom:4px;}
h2{border-bottom:1px solid #ccc;padding-bottom:4px;}

/**
 * User feedback message wrappers.
 */
.error, .alert, .warning, .notice, .success, .info {
padding: 0.8em; margin-bottom: 1em; border: 2px solid #ddd; }

.error, .alert { background: #fbe3e4; color: #8a1f11; border-color: #fbc2c4; }
.notice, .warning { background: #fff6bf; color: #514721; border-color: #ffd324; }
.success       { background: #e6efc2; color: #264409; border-color: #c6d880; }
.info          { background: #d5edf8; color: #205791; border-color: #92cae4; }
.error a, .alert a { color: #8a1f11; }
.notice a, .warning a { color: #514721; }
.success a         { color: #264409; }
.info a            { color: #205791; }

/**
 * Login navbar
 */

nav.right {
    float: right;
}

/**
 * Forms
 */

.validation-failed{border:2px solid red;}
.validation-message{color:red;font-size:smaller;}

/**
 * Misc
 */


text:
/**
 * ProductChannelExclusivity.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.adwords.axis.v201509.cm;

/**
 * The product channel exclusivity dimension, which limits the availability
 * of an offer between only
 *             local, only online, or both. Only supported by campaigns
 * of
 *             {@link AdvertisingChannelType#SHOPPING}.
 */
public class ProductChannelExclusivity  extends com.google.api.ads.adwords.axis.v201509.cm.ProductDimension  implements java.io.Serializable {
    private com.google.api.ads.adwords.axis.v201509.cm.ShoppingProductChannelExclusivity channelExclusivity;

    public ProductChannelExclusivity() {
    }

    public ProductChannelExclusivity(
           java.lang.String productDimensionType,
           com.google.api.ads.adwords.axis.v201509.cm.ShoppingProductChannelExclusivity channelExclusivity) {
        super(
            productDimensionType);
        this.channelExclusivity = channelExclusivity;
    }

    /**
     * Gets the channelExclusivity value for this ProductChannelExclusivity.
     *
     * @return channelExclusivity
     */
    public com.google.api.ads.adwords.axis.v201509.cm.ShoppingProductChannelExclusivity getChannelExclusivity() {
        return channelExclusivity;
    }

    /**
     * Sets the channelExclusivity value for this ProductChannelExclusivity.
     *
     * @param channelExclusivity
     */
    public void setChannelExclusivity(com.google.api.ads.adwords.axis.v201509.cm.ShoppingProductChannelExclusivity channelExclusivity) {
        this.channelExclusivity = channelExclusivity;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof ProductChannelExclusivity)) return false;
        ProductChannelExclusivity other = (ProductChannelExclusivity) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = super.equals(obj) &&
            ((this.channelExclusivity==null && other.getChannelExclusivity()==null) ||
             (this.channelExclusivity!=null &&
              this.channelExclusivity.equals(other.getChannelExclusivity())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = super.hashCode();
        if (getChannelExclusivity() != null) {
            _hashCode += getChannelExclusivity().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(ProductChannelExclusivity.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201509", "ProductChannelExclusivity"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("channelExclusivity");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201509", "channelExclusivity"));
        elemField.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201509", "ShoppingProductChannelExclusivity"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Help?</title>
		<link>http://bvs.wikidot.com/forum/t-50135/help</link>
		<description>Posts in the discussion thread "Help?"</description>
				<copyright></copyright>
		<lastBuildDate>Sun, 10 Jul 2022 04:38:57 +0000</lastBuildDate>

					<item>
				<guid>http://bvs.wikidot.com/forum/t-50135#post-134535</guid>
				<title>Help?</title>
				<link>http://bvs.wikidot.com/forum/t-50135/help#post-134535</link>
				<description></description>
				<pubDate>Sun, 30 Mar 2008 17:20:00 +0000</pubDate>
				<wikidot:authorName>Anonymous</wikidot:authorName>								<content:encoded>
					<![CDATA[

My account is NikolaSama, but when I try to login, I can't… I enter the needed info and he still doesn't log me in… Is this a bug? He shows that Im logged in only when I press the log in button.

				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>


text:
@font-face {
    font-family: 'SourceSansProBold';
    src: url('../assets/typo/ostrich-bold.ttf');
}

@font-face {
    font-family: 'SourceSansPro';
    src: url('../assets/typo/SourceSansPro-Regular.otf');
}
@-webkit-keyframes rotation {
    0% {
      -webkit-transform: rotate(-30deg);
    }

    50% {
       -webkit-transform: rotate(30deg);
    }

    100% {
      -webkit-transform: rotate(-30deg);
    }
}

body {
    padding: 0;
    margin: 0;
    background-color: white;
    font-size: 16px;
    -webkit-tap-highlight-color:transparent !important;
    -webkit-user-select:none;
}
button {-webkit-appearance: none}
/*a:active, button:active,
a:focus, button:focus {
    background: red !important;
    -webkit-appearance: none;
}*/

#wrapper {position: relative; overflow: hidden}

.btn-open-page {
    width: 100%;
    height: 100%;
    opacity: 0
}

.btn-back, .btn-back-form {
    z-index: 42;
    position: absolute;
    top: 8%;
    left: 6%;
    height: 120px;
    width: 100px;
    border: 0;
    background: url('../assets/images/btn-back.png') no-repeat;
    text-indent: -9999px
}

.btn-back:hover,
.btn-back:active,
.btn-back:focus,
.btn-back-form:hover,
.btn-back-form:active,
.btn-back-form:focus {background-image: url('../assets/images/btn-back-appuie.png')}

[class^="play-"] {border: 0; text-indent: -9999px; background-color: transparent}

#playhome {
    background: url('../assets/images/btn-play-home.png');
    background-size: 115px;
    position: absolute;
    z-index: 42;
    width: 115px;
    height: 179px;
    bottom: 32%;
    right: 25%;
    /*-webkit-transform: rotate(-30deg)*/
    -webkit-transform-origin: top center;
    -webkit-animation : rotation 2.5s ease infinite;
}
#playhome:active, #playhome:focus, #playhome:hover {background-image: url('../assets/images/btn-play-home-appuie.png')}

[class^="page-"], #gameform {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-size: 100% 100%
}
.page-home {background-image: url('../assets/images/background-home.jpg')}
.page-form {background-image: url('../assets/images/background-form.jpg')}
.page-game {background-image: url('../assets/images/background-jeu-non-gratte.jpg')}
.page-lost {background-image: url('../assets/images/background-lost.jpg')}
.page-usb {background-image: url('../assets/images/background-fin-win.jpg')}
.page-register, .page-end {background-image: url('../assets/images/background-fin-win.jpg')}

.page-end::after, .page-end::before {
    display: block;
    width: 0;
    height: 0;
    position: absolute;
    z-index: 55;
    top: 0;
    right: 0;
    -webkit-transform: scale(.5)
}

.page-end::after {
    content: url('../assets/images/right-hand.png');
    width: 350px
}

.page-end::before {
    content: url('../assets/images/left-hand.png');
    left: 0
}

[class^="legend-"] {
    position: absolute;
    z-index: 50;
    height: 164px;
    width: 852px;
    background-size: 100% 100%;
    top: 30%;
    left: 0;
    right: 0;
    margin: auto
}
.legend-step1 {
    background-image: url('../assets/images/sept1.png');
    box-shadow: 0 0 0 500px rgba(0,0,0,.3);
    background-color: rgba(0, 0, 0, 0.3)
}

.legend-step2 {
    background-image: url('../assets/images/step2.png');
    z-index: 55;
    top: 60%
}

#gameform {
    margin: auto;
    width: 80%;
    height: 30%;
    /*margin-top: 30%*/
}

#scratchcard, .page-game canvas {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}
.page-game canvas{ margin: auto auto 4%; left: -15px}

.required-details, .field {color: #3E4651; text-transform: uppercase}

.field {
    display: inline-block;
    vertical-align: top;
    margin-bottom: 1rem;
    width: 49%;
    font-weight: bold;
    font-size: 1.1rem;
    font-family: 'SourceSansPro';
}
.field:nth-child(even) {text-align: right}
.field input {
    width: 50%;
    border: 1px solid #3e4651;
    padding: 0.4rem 0.6rem;
    border-radius: .3rem;
    font-family: 'SourceSansPro';
    font-size: 1.2rem
}
.field label {
    display: inline-block;
    width: 30%;
    text-align: left;
}
span.error:empty{display: none}
.error ::-webkit-input-placeholder, .error-field {
    color: red;
    text-transform: none;
    font-weight: normal;
    font-size: 1rem;
    font-family: 'SourceSansPro';
    font-style: italic
}

.error .error-field {border-color: red}
.field:nth-child(odd) .error { margin-right: 5rem; font-size: 1rem;}

.input-required label::after, .required-details::before {content: "*"}

.required-details {
    position: absolute;
    bottom: 0;
    left: 0;
    font-family: 'SourceSansPro'
}

.error-field:focus {color: black; font-style: normal}

.play-btn-form {
    background: url('../assets/images/btn-play-form.png') 0 -21px;
    -webkit-transform: scale(.9);
    float: right;
    width: 120px;
    height: 130px;
    margin-top: -1.5rem
}

#play:active, #play:focus, #play:hover {background-image: url('../assets/images/btn-play-form-appuie.png')}

.btn-redirect {
    position: absolute;
    bottom: 35%;
    width: 150px;
    height: 170px;
    right: 20%
}

@media screen and (max-device-width: 1024px) {
    #playhome {right: 17%; bottom: 20%}
    .field input, .field label, .required-details {
        font-size: 1.2rem;
        letter-spacing: -1px
    }

    .ipad .field input {
        width: 55%;
        font-size: 1.4rem
    }
    .ipad #playhome {right: 24%}
    .ipad #gameform {top: -10%}
}


text:
search:
   keywords: ['NET', 'C#', 'c sharp', 'OrientDB-NET', 'ODatabase']
---

# OrientDB-NET - `ODatabase`

This class provides an interface and methods for when you need to operate on OrientDB databases from within your C#/.NET application.

Use this interface in cases where you need to retrieve or manage clusters, operate on records or issue scripts, queries and commands to the database.  If you want to operate on the OrientDB Server as a whole or create or delete databases on the server, use the [`OServer`](NET-Server.md) interface.

## Initializing the Database

When you enable the `Orient.Client` namespace through the `using` directive, you can create a database interface for your application by instantiating the `ODatabase` class.

### Syntax

```
// INITIALIZE DATABASE
ODatabase(  string host,
            int port,
            string name,
            ODatabaseType type,
            string user,
            string passwd)

// INITIALIZE DATABASE USING CONNECTION POOL
ODatabase(  string host,
            int port,
            string name,
            ODatabaseType type,
            string user,
            string passwd,
            string poolAlias)
```

- **`host`** Defines the hostname or IP address of the OrientDB Server.
- **`port`** Defines the port to use in connecting to the server.
- **`name`** Defines the database name.
- **`type`** Defines the database type, that is PLocal or Memory.
- **`user`** Defines the user name.
- **`passwd`** Defines the user password.
- **`poolAlias`** Defines the alias to use for the connection pool.

### Example

In the interest of abstraction, you might create a method to handle common OrientDB database operations for your application.

```csharp
using Orient.Client;
using System;
...

// OPEN DATABASE
public ODatabase openDatabase(string _host, int _port,
       string _dbName, string _user, string _passwd)
{

   // CONSOLE LOG
   Console.WriteLine("Opening Database: {0}", _dbname);

   // OPEN DATABASE
   ODatabase database = ODatabase(_host, _port, _dbName,
       ODatabaseType.Graph, _user, _passwd);

   // RETURN ODATABASE INSTANCE
   return database;
}
```

#### Using a Connection Pool

Normally, OrientDB-NET clients operate through a single network connection.  When working with web applications or any situation where network bottlenecks are a concern, it is common to pool these connections to ensure better performance.

To use a connection pool pass a pool alias when you create the `ODatabase` interface.

```csharp
ODatabase database = ODatabase("localhost", 2424,
   "microblog", ODatabaseType.PLocal,
   "guestUser", "guest_passwd",
   "pool123");
```

#### Using Connection Options

In addition to configuring the database interface through arguments passed to the `ODatabase` class, you can also create a configuration object independent of the class, through the `ConnectionOptions` class.  You may find this useful when you need to initialize several database instances with similar configuration.

The `ConnectionOptions` class has seven parameters:

| Parameter | Type | Description |
|---|---|---|
| `HostName` | `string` | Defines the hostname or IP address of the server hosting OrientDB |
| `UserName` | `string` | Defines the name of the database user |
| `Password` | `string` | Defines the password for database user |
| `Port` | `int` | Defines the port number for the connection |
| `DatabaseName` | `string` | Defines the name of the database to use |
| `DatabaseType` | `ODatabaseType` | Defnes the type of database, PLocal or Memory |
| `PoolAlias` | `string` | Defines the connection pool to use. |

If you initialize this object without defining the connection pool, it sets it to `Default`.

```csharp
// INITIALIZE CONNECTION OPTIONS
ConnectionOptions opts = ConnectionOptions();

opts.HostName = "localhost";
opts.UserName = "admin";
opts.Password = "admin_passwd";
opts.Port = 2727;
opts.DatabaseName = "microblog";
opts.DatabaseType = ODatabaseType.PLocal

// Initialize Database
ODatabase database = ODatabase(opts);
```

## Using ODatabase

Once you have instantiated the `ODatabase` class, you can begin to operate on a particular database from within your C#/.NET application.  OrientDB-NET supports a number of database-level operations that you can call through this interface. Additionally, you can issue queries, commands and scripts to the database for those operations that it does not support.

| Method | Return Value | Description |
|---|---|---|
| [**`Close()`**](#closing-databases) | `void` | Disposes of the database instance. |
| [**`Clusters()`**](NET-Database-Clusters.md) | `OClusterQuery` | Creates clusters. |
| [**`Command()`**](NET-Database-Command.md) | `OCommandResult` | Issues commands. |
| [**`CountRecords`**](#size-variables) | `long` | Counts records on database. |
| [**`Dispose()`**](#closing-databases) | `void` | Disposes of the database instance. |
| [**`GetClusterIdFor()`**](NET-Database-GetClusterIdFor.md) | `short` | Retrieves ID for the given cluster name.|
| [**`GetClusterNameFor()`**](NET-Database-GetClusterNameFor.md) | `string` | Retrieves the name for the given Cluster ID. |
| [**`GetClusters()`**](NET-Database-GetClusters.md) | `List<OCluster>` | Retrieves clusters from database. |
| [**`Gremlin()`**](NET-Database-Gremlin.md) | `OCommandResult` | Executes Gremlin commands. |
| [**`Insert()`**](NET-Database-Insert.md) | `IOInsert` | Prepares insertion operations. |
| [**`JavaScript()`**](NET-Database-JS.md) | `OCommamndQuery` | Prepares JavaScript commands. |
| [**`Query()`**](NET-Database-Query.md) | `List<ODocument>` | Queries the database using SQL. |
| [**`Select()`**](NET-Database-Select.md) | `OSqlSelect` | Prepares queries to execute. |
| [**`Size`**](#size-variables) | `long` | Retrieves the size of the database. |
| [**`SqlBatch()`**](NET-Database-SqlBatch.md) | `OCommandQuery` | Executes batch queries. |
| [**`Update()`**](NET-Database-Update.md) | `OSqlUpdate` | Prepares update statements. |

### Size Variables

In addition to the various methods, the `ODatabase` object also supports sizing variables, which you can use to determine the size of the database or the number of records it contains.

- To retrieve the size of the database, use the `Size` variable:

  ```csharp
  long databaseSize = database.Size;
  ```

- To count the number of records on the database, use the `CountRecords` variable:

  ```csharp
  long numberOfRecords = database.CountRecords;
  ```

### Closing Databases

When you are finished using the database instance, you can close it to free up system resources.  The `ODatabase` object provides two methods for closing databases: `Close()` and `Dispose()`.  Given that one is an alias to the other, you can use whichever is more famiiliar to you.

```csharp
// CLOSE DATABSE
database.Close()
```

### Transactions

OrientDB provides support for transactions.  The Insert(), Update() and Query() methods all provide support so that you can execute them as part of a transaction rather than on the database outright.  For more information, see [`OTransaction`](NET-Transactions.md).


text:
package com.asura.monitor.configure.entity;
import com.asura.framework.base.entity.BaseEntity;

/**
 *

 *

 *

 *

 *
-----------------------------------------------
 *

 *

 *
 * @author zhaozq14
 * @version 1.0
 * @date 2016-08-20 09:51:18
 * @since 1.0
 */
public class MonitorTiggerEntity extends BaseEntity{
    /**
     * This field corresponds to the database column monitor_tigger.tigger_id
     * Comment:
     * @param tiggerId the value for monitor_tigger.tigger_id
     */

    private java.lang.Integer tiggerId;

    /**
     * This field corresponds to the database column monitor_tigger.tigger_name
     * Comment: 触发器名字
     * @param tiggerName the value for monitor_tigger.tigger_name
     */

    private java.lang.String tiggerName;

    /**
     * This field corresponds to the database column monitor_tigger.expression
     * Comment: 表达式,监控项  > == < memory.totle > 100
     * @param expression the value for monitor_tigger.expression
     */

    private java.lang.String expression;

    /**
     * This field corresponds to the database column monitor_tigger.is_valid
     * Comment: 是否有效,0无效,1有效
     * @param isValid the value for monitor_tigger.is_valid
     */

    private java.lang.Integer isValid;

    /**
     * This field corresponds to the database column monitor_tigger.last_modify_time
     * Comment: 最近修改时间
     * @param lastModifyTime the value for monitor_tigger.last_modify_time
     */

    private java.sql.Timestamp lastModifyTime;

    /**
     * This field corresponds to the database column monitor_tigger.last_modify_user
     * Comment: 最近修改用户
     * @param lastModifyUser the value for monitor_tigger.last_modify_user
     */

    private java.lang.String lastModifyUser;

    /**
     * This field corresponds to the database column monitor_tigger.severity_id
     * Comment: 参考报警级别ID
     * @param severityId the value for monitor_tigger.severity_id
     */

    private java.lang.Integer severityId;

    /**
     * This field corresponds to the database column monitor_tigger.template_id
     * Comment: 所属模板ID,参考template_id
     * @param templateId the value for monitor_tigger.template_id
     */

    private java.lang.Integer templateId;

    /**
     * This field corresponds to the database column monitor_tigger.tigger_id
     * Comment:
     * @param tiggerId the value for monitor_tigger.tigger_id
     */
    public void setTiggerId(java.lang.Integer tiggerId){
       this.tiggerId = tiggerId;
    }

    /**
     * This field corresponds to the database column monitor_tigger.tigger_name
     * Comment: 触发器名字
     * @param tiggerName the value for monitor_tigger.tigger_name
     */
    public void setTiggerName(java.lang.String tiggerName){
       this.tiggerName = tiggerName;
    }

    /**
     * This field corresponds to the database column monitor_tigger.expression
     * Comment: 表达式,监控项  > == < memory.totle > 100
     * @param expression the value for monitor_tigger.expression
     */
    public void setExpression(java.lang.String expression){
       this.expression = expression;
    }

    /**
     * This field corresponds to the database column monitor_tigger.is_valid
     * Comment: 是否有效,0无效,1有效
     * @param isValid the value for monitor_tigger.is_valid
     */
    public void setIsValid(java.lang.Integer isValid){
       this.isValid = isValid;
    }

    /**
     * This field corresponds to the database column monitor_tigger.last_modify_time
     * Comment: 最近修改时间
     * @param lastModifyTime the value for monitor_tigger.last_modify_time
     */
    public void setLastModifyTime(java.sql.Timestamp lastModifyTime){
       this.lastModifyTime = lastModifyTime;
    }

    /**
     * This field corresponds to the database column monitor_tigger.last_modify_user
     * Comment: 最近修改用户
     * @param lastModifyUser the value for monitor_tigger.last_modify_user
     */
    public void setLastModifyUser(java.lang.String lastModifyUser){
       this.lastModifyUser = lastModifyUser;
    }

    /**
     * This field corresponds to the database column monitor_tigger.severity_id
     * Comment: 参考报警级别ID
     * @param severityId the value for monitor_tigger.severity_id
     */
    public void setSeverityId(java.lang.Integer severityId){
       this.severityId = severityId;
    }

    /**
     * This field corresponds to the database column monitor_tigger.template_id
     * Comment: 所属模板ID,参考template_id
     * @param templateId the value for monitor_tigger.template_id
     */
    public void setTemplateId(java.lang.Integer templateId){
       this.templateId = templateId;
    }

    /**
     * This field corresponds to the database column monitor_tigger.tigger_id
     * Comment:
     * @return the value of monitor_tigger.tigger_id
     */
     public java.lang.Integer getTiggerId() {
        return tiggerId;
    }

    /**
     * This field corresponds to the database column monitor_tigger.tigger_name
     * Comment: 触发器名字
     * @return the value of monitor_tigger.tigger_name
     */
     public java.lang.String getTiggerName() {
        return tiggerName;
    }

    /**
     * This field corresponds to the database column monitor_tigger.expression
     * Comment: 表达式,监控项  > == < memory.totle > 100
     * @return the value of monitor_tigger.expression
     */
     public java.lang.String getExpression() {
        return expression;
    }

    /**
     * This field corresponds to the database column monitor_tigger.is_valid
     * Comment: 是否有效,0无效,1有效
     * @return the value of monitor_tigger.is_valid
     */
     public java.lang.Integer getIsValid() {
        return isValid;
    }

    /**
     * This field corresponds to the database column monitor_tigger.last_modify_time
     * Comment: 最近修改时间
     * @return the value of monitor_tigger.last_modify_time
     */
     public java.sql.Timestamp getLastModifyTime() {
        return lastModifyTime;
    }

    /**
     * This field corresponds to the database column monitor_tigger.last_modify_user
     * Comment: 最近修改用户
     * @return the value of monitor_tigger.last_modify_user
     */
     public java.lang.String getLastModifyUser() {
        return lastModifyUser;
    }

    /**
     * This field corresponds to the database column monitor_tigger.severity_id
     * Comment: 参考报警级别ID
     * @return the value of monitor_tigger.severity_id
     */
     public java.lang.Integer getSeverityId() {
        return severityId;
    }

    /**
     * This field corresponds to the database column monitor_tigger.template_id
     * Comment: 所属模板ID,参考template_id
     * @return the value of monitor_tigger.template_id
     */
     public java.lang.Integer getTemplateId() {
        return templateId;
    }
}


text:
you need to initialize this module with calling mysql or postgresql methods

```javascript
var db = require('dbobject');

// initialize for mysql
db.mysql('database', 'username', 'password', 'host');

// OR initialize for postgresql
db.postgresql('database', 'username', 'password', 'host');

```

### call anywhere

just require dbobject when you need to reach database

```javascript
var db = require('dbobject')
```

### methods
- mysql(database, user, pass, host)
- postgresql(database, user, pass, host)
- query(sql, options)
- exec(sql, options)
- first(sql, options)
- value(sql, options)
- values(sql, options)
- keyValue(sql, options)
- dbobject(tablename, options)
- end()

### dbobject methods
- select(query, options)
- insert(values)
- update(id, values)
- delete(id)

## Usage

- sample usage for database queries

```javascript
var db = require('dbobject')

// initialize
db.mysql('database', 'username', 'password', 'host')

db.query('select * from employee').then(function(result){
    console.log(result)
}).catch(function(err){
    console.log(err)
}).then(function(){
    db.end()
})
```

- Sample usage with dbobject (simplified crud functions for api services)

```javascript
var db = require('dbobject')

db.mysql('database', 'username', 'password', 'host')

var dbo = db.dbobject('tablename')

dbo.search({title: 'manager'}).then(function(result){
    console.log(result)
}).catch(function(err){
    console.log(err)
})
```

- Sample nodejs/express module for api services

```javascript
var express = require('express'),
    router = express.Router(),
    db = require(dbobject),
    dbo = db.dbobject('article')

router.get('/', (req, res, next) => {
	dbo.search(req.query).then(function(result){
		res.json(result)
	}).catch(next)
})

router.get('/:id', (req, res, next) => {
	dbo.get(req.params.id).then(function(result){
		res.json(result)
	}).catch(next)
})

router.post('/', (req, res, next) => {
	dbo.insert(req.body).then(function(result){
		res.json(result)
	}).catch(next)
})

router.put('/:id', (req, res, next) => {
	dbo.update(req.params.id, req.body).then(function(result){
		res.json(result)
	}).catch(next)
})

router.delete('/:id', (req, res, next) => {
	dbo.delete(req.params.id).then(function(result){
		res.json(result)
	}).catch(next)
})

module.exports = router;

```

# ToDo
- PostgreSQL implementation


text:
(function () {
    /* Ejemplo de factoría síncrona */
    var demoApp = angular.module('demoApp'),
        personasFactory = function ($http, servicios) {
            var personas = [],
                factory = {};

            factory.obtenerPersonas = function () {
                //return $http.get('/personas');
                return $http.get(servicios.url + servicios.port + servicios.personas);
            };

            factory.obtenerPersona = function (id) {
               //return $http.get('/personas/' + id);
                return $http.get(servicios.url + servicios.port + servicios.persona + id);
                //return $http.get('http://www.google.com/');
                //return $http.get('http://noexiste');
            };

            return factory;
        };
    personasFactory.$inject = ['$http', 'servicios'];
    demoApp.factory('personasFactory', personasFactory);

})();


text:
AddFriendDialog::AddFriendDialog(CCNode *parent,const ccColor4B &color)
    : BasShowDialog(parent,color)
{
    m_addImg = "buttonbg";
    m_addListener = 0;
    m_addFunc = 0;
    m_idInput = 0;
    m_wordInput = 0;
    m_edgeSize = 20;
}
AddFriendDialog::~AddFriendDialog()
{

}
void AddFriendDialog::setAddImg(const std::string &normal,const std::string &pressed)
{
    m_addImg = normal;
    m_addPressedImg = pressed;
}
void AddFriendDialog::setAddCB(CCNode *listener,SEL_CallFuncND func)
{
    m_addListener = listener;
    m_addFunc = func;
}
void AddFriendDialog::getAskInfo(std::string &id,std::string &word)
{
    if(m_idInput)
        id = m_idInput->getText();
    if(m_wordInput)
        word = m_wordInput->getText();
}
void AddFriendDialog::setAddId(const std::string &id)
{
    m_setId = id;
}
void AddFriendDialog::exec()
{
    finish();
    BasShowDialog::exec();
}
void AddFriendDialog::finish()
{
    LangDef *lang = ResourceMgr::getInstance()->getLangDef();
    BasButton *button = new BasButton;
    button->setButtonInfo(lang->getStringById(StringEnum::Add).data(),"fonts/uifont24.fnt",m_theme,m_addImg,CCSizeMake(0,0));
    button->setClickCB(m_addListener,m_addFunc);
    this->addChild(button);
    button->setRight("parent",uilib::Right);
    button->setBottom("parent",uilib::Bottom);
    button->setRightMargin(m_edgeSize);
    button->setBottomMargin(m_edgeSize);

    BasWidget *inputWidget = new BasWidget;
    this->addChild(inputWidget);
    inputWidget->setTop("parent",uilib::Top);
    inputWidget->setLeft("parent",uilib::Left);
    inputWidget->setRight("parent",uilib::Right);
    inputWidget->setBottom(button->getName(),uilib::Top);
    inputWidget->setLeftMargin(m_edgeSize);
    inputWidget->setRightMargin(m_edgeSize);
    inputWidget->setTopMargin(m_edgeSize);

    VerticalLayout *vlay = new VerticalLayout;
    BasLabel *label1 = new BasLabel;
    label1->setLabelInfo(lang->getStringById(StringEnum::FriendId).data(),"fonts/uifont24.fnt","","",CCSizeMake(0,0));
    BasLabel *label2 = new BasLabel;
    label2->setLabelInfo(lang->getStringById(StringEnum::MsgWord).data(),"fonts/uifont24.fnt","","",CCSizeMake(0,0));

    m_idInput = new InputBox;
    m_idInput->setTheme("default","inputbg");
    m_idInput->setMaxLength(9);
    m_idInput->setText(m_setId);
    m_idInput->setHeight(80);

    m_wordInput = new InputBox;
    m_wordInput->setTheme("default","inputbg");
    m_wordInput->setMaxLength(50);
    m_wordInput->setHeight(80);

    vlay->addWidget(label1);
    vlay->addWidget(m_idInput);
    vlay->addWidget(label2);
    vlay->addWidget(m_wordInput);

    vlay->setAlignChildsSize(false);
    vlay->setAveraged(true);
    vlay->setChildAlign(0,uilib::Left);
    vlay->setChildAlign(2,uilib::Left);
    vlay->setChildAlign(1,uilib::Left);
    vlay->setChildAlign(1,uilib::Right);
    vlay->setChildAlign(3,uilib::Left);
    vlay->setChildAlign(3,uilib::Right);

    inputWidget->setLayout(vlay);
}


text:
package com.bar.foo.wraptree.iterator;

import java.util.Stack;

import com.bar.foo.wraptree.ITree;
import com.bar.foo.wraptree.INode;

public class PreOrderTreeIterator<T> extends TreeIterator<T> {

	/**
	 * A stack used to maintain state information about the position of the
	 * iterator. If empty, there is no remaining tree node to visit.
	 */
	private final Stack<INode<T>> stack = new Stack<INode<T>>();

	/**
	 * The default constructor. Requires a root node. The root node and all
	 * descendants will be traversed in a pre-order traversal (a node is
	 * visited, then its children are visited following the same procedure).
	 *
	 * @param root
	 *            The root of the tree to iteratively traverse. If null, an
	 *            {@link IllegalArgumentException} will be thrown.
	 */
	public PreOrderTreeIterator(INode<T> root) {
		super(root);

		// If the root is not null, we need to start the iteration with it by
		// adding it to the stack.
		if (root != null) {
			stack.push(root);
		}
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.bar.foo.TreeIterator#hasNext()
	 */
	@Override
	public boolean hasNext() {
		return !stack.isEmpty();
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.bar.foo.TreeIterator#next()
	 */
	@Override
	public INode<T> next() {

		// Set the default return value (null).
		INode<T> next = super.next();

		// If we have another tree node to iterate over, proceed.
		next = stack.pop();
		if (next.hasChildren()) {
			ITree<T> tree = (ITree<T>) next;
			for (int i = tree.getNumberOfChildren() - 1; i >= 0; i--) {
				stack.push(tree.getChild(i));
			}
		}

		return next;
	}
}


text:
hitbuttonheroes
===============

An experimental, open source Action Game


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Logger = (function () {
    function Logger(displayProcessors, print) {
        this.displayProcessors = displayProcessors;
        this.print = print;
        this.indent = "  ";
        this.currentIndent = "";
        this.lastWasNewLine = false;
    }
    Logger.prototype.log = function (stuff) {
        var _this = this;
        stuff.split("\n").forEach(function (line) {
            _this.print(line !== "" ? _this.currentIndent + line : line);
        });
        this.lastWasNewLine = false;
    };
    Logger.prototype.process = function (object, processFunction) {
        var log = "";
        this.displayProcessors.forEach(function (displayProcessor) {
            log = processFunction(displayProcessor, object, log);
        });
        this.log(log);
    };
    Logger.prototype.newLine = function () {
        if (!this.lastWasNewLine) {
            this.log("");
            this.lastWasNewLine = true;
        }
    };
    Logger.prototype.resetIndent = function () {
        this.currentIndent = "";
    };
    Logger.prototype.increaseIndent = function () {
        this.currentIndent += this.indent;
    };
    Logger.prototype.decreaseIndent = function () {
        this.currentIndent = this.currentIndent.substr(0, this.currentIndent.length - this.indent.length);
    };
    return Logger;
}());
exports.Logger = Logger;
//# sourceMappingURL=logger.js.map


text:
def extract5IghtBlogspotCom(item):
	'''
	Parser for '5ight.blogspot.com'
	'''

	vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
	if not (chp or vol) or "preview" in item['title'].lower():
		return None

	tagmap = [
		('ffy',       'Far From You',                      'translated'),
		('ffe',       'Four Fourty Eight',                      'translated'),
		('Loiterous', 'Loiterous',                'oel'),
	]

	for tagname, name, tl_type in tagmap:
		if tagname in item['tags']:
			return buildReleaseMessageWithType(item, name, vol, chp, frag=frag, postfix=postfix, tl_type=tl_type)

	return False


text:
using CDTools.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data.OleDb;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CDTools.ViewModel
{
	public class CompanyViewModel
	{
		public ObservableCollection<Company> Companies
		{
			get;
			set;
		}

		public void LoadCompanies(string skipCompanyID = null)
		{
			var connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["visualFox"].ConnectionString;
			var companies = new ObservableCollection<Company>();

			using (OleDbConnection oConn = new OleDbConnection(connectionString))
			{
				try
				{
					oConn.Open();

					using (OleDbCommand oCmd = oConn.CreateCommand())
					{
						oCmd.CommandText = @"SELECT * FROM mcompdir ORDER BY 1";

						using (OleDbDataReader reader = oCmd.ExecuteReader())
						{
							while (reader.Read())
							{
								if (skipCompanyID != null && skipCompanyID != reader.GetString(0))
								{
									companies.Add(new Company { IsSelected = false, CompanyID = reader.GetString(0), CompanyName = reader.GetString(1) });
								}
							}
						}
					}
				}
				finally
				{
					oConn.Close();
				}
			}

			Companies = companies;
		}
	}
}


text:
"""Miscelaneous Cobweb models. Could be a few apps, but why bother..."""

from collections.abc import Iterable
from itertools import chain
from typing import Dict, List, NewType

import reversion
from django.db import models
from django.forms.models import model_to_dict
from django.urls import reverse
from django.utils.functional import cached_property
from django.contrib.auth.models import AbstractUser
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.contrib.contenttypes.models import ContentType
from surt import handyurl
from surt.DefaultIAURLCanonicalizer import canonicalize

import cobweb.types as typ
import help_text

def normalize_url(url: typ.URL) -> typ.NormalizedURL:
    normalized_url = (
        canonicalize(handyurl.parse(url)).geturl()
        .replace('https://', 'http://')
        .replace('sftp://', 'ftp://')
    )
    return normalized_url

class NormalizedURLField(models.URLField):
    """Subclass of URLField that maps https to http and sftp to ftp."""

    def clean(self, value, model_instance):
        return super().clean(normalize_url(value), model_instance)

@reversion.register()
class User(AbstractUser):
    first_name = models.CharField(max_length=200, null=True, blank=False)
    last_name = models.CharField(max_length=200, null=True, blank=False)
    email = models.EmailField(null=True, blank=False)

    organization = models.ForeignKey('Organization', null=True, blank=True,
                                     related_name="affiliated_users",
                                     on_delete=models.SET_NULL)
    professional_title = models.CharField(
        max_length=200, null=True, blank=True)

    url = NormalizedURLField(null=True, blank=True)

    # Preferences
    get_notification_emails = models.BooleanField(default=True)

    terms_accepted = models.BooleanField(default=False)

    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    notes = GenericRelation('Note')

    @property
    def impact_factor(self):
        # TODO: actuall implement functional requirement
        # (this is just a placeholder)
        return self.projects_administered.count()

    @property
    def name(self):
        full_name = self.get_full_name()
        return self.username + (f'\n{full_name}' if full_name else '')

    def __str__(self) -> str:
        return self.get_full_name() or self.username or 'User {}'.format(self.pk)

    def __repr__(self) -> str:
        return f'<User {self.username}>'

    def can_claim(self, organization=None) -> bool:
        if organization:
            return self.organization == organization
        else:
            return self.organization is not None

    def get_absolute_url(self) -> str:
        return reverse('user', kwargs={'username': self.username})

    def get_edit_url(self) -> str:
        return self.get_absolute_url()

@reversion.register()
class Organization(models.Model):

    slug = models.SlugField(max_length=50, null=False, unique=True,
                            help_text=help_text.ORGANIZATION_PROFILE)

    full_name = models.CharField(max_length=2000, unique=True,
                                 verbose_name="full legal name")
    short_name = models.CharField(max_length=200, null=True, blank=True,
                                  verbose_name="short name, nickname, or acronym")

    administrators = models.ManyToManyField(
        User,
        related_name='organizations_administered',
    )

    address = models.TextField(null=True, blank=True)
    telephone_number = models.CharField(max_length=100, null=True, blank=True)
    url = NormalizedURLField(null=True, blank=True)
    email_address = models.EmailField(null=True, blank=True)

    contact = models.ForeignKey(User, on_delete=models.SET_NULL, null=True,
                                blank=True, related_name="contact_for")

    parent_organization = models.ForeignKey('self', on_delete=models.SET_NULL,
                                            null=True, blank=True)

    description = models.TextField(
        null=True, blank=True,
        verbose_name='description of mission and collecting policy',
    )

    identifier = NormalizedURLField(
        "Archive-It.org Identifier",
        null=True, blank=True, unique=True, editable=False
    )

    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    @property
    def name(self):
        return self.short_name or self.full_name

    @property
    def impact_factor(self):
        # TODO: actuall implement functional requirement
        # (this is just a placeholder)
        return self.claims.count() + self.claims.filter(has_holding=True).count()

    @cached_property
    def claims_held(self):
        return self.claims.filter(has_holding=True)

    @cached_property
    def claims_claimed(self):
        return self.claims.filter(has_holding=False)

    @property
    def n_held(self):
        return self.claims_held.count()

    @property
    def n_claimed(self):
        return self.claims_claimed.count()

    def __repr__(self) -> str:
        return f"<Organization '{self.name}'>"

    def __str__(self) -> str:
        return (
            self.name or self.identifier or 'Organization {}'.format(self.pk)
        )

    def get_absolute_url(self):
        return reverse('organization', args=(self.slug,))

    def is_admin(self, user):
        return user in self.administrators.all()

@reversion.register()
class Note(models.Model):
    """A note about an object tracked in Cobweb.

    Fields:
    author : User
    when_created : DateTime
    ref : GenericForeignKey
    visibility : str / enum
        'Public', 'Organizational', or 'Project'
    text : str
    """

    author = models.ForeignKey(User, null=True, blank=False,
                               on_delete=models.SET_NULL, related_name='notes')
    when_created = models.DateTimeField(auto_now_add=True)

    content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
    object_id = models.PositiveIntegerField()
    ref = GenericForeignKey('content_type', 'object_id')

    visibility = models.CharField(max_length=20, default='Public', choices=(
        ('Public', 'Public'),
        # ('Organizational', 'Organizational'),
        ('Project Members', 'Project Members'),
        ('Project Admins', 'Project Administrators'),
    ))

    text = models.TextField()

    @property
    def name(self) -> str:
        return '\n'.join((
            self.author,
            self.when_created,
            're: ' + self.ref,
        ))

@reversion.register()
class Tag(models.Model):
    """A single tag."""
    title = models.CharField(max_length=200, unique=True, db_index=True)

    @property
    def name(self):
        return self.title

    def __str__(self):
        return self.title

    def __repr__(self):
        return f'Tag(title="{self.title}")'

class SubjectHeading(models.Model):
    """A FAST subject heading (cf. https://www.oclc.org/research/themes/data-science/fast.html)."""
    name_fields = ('title',)
    title = models.CharField(max_length=200, unique=True)

    # TODO: Validate based on official list? Pre-load list in migration?

    @property
    def name(self):
        return self.title

    def __str__(self):
        return self.title

    def __repr__(self):
        return f'SubjectHeading(title="{self.title}")'

MDDict = NewType('MDDict', Dict[str, List[str]])
MultiMDDict = NewType('MultiMDDict', Dict[str, MDDict])

class Resource(models.Model):
    # surt =
    url = NormalizedURLField(max_length=1000, null=False, blank=False,
                             unique=True)

    # METADATA RETRIEVED DIRECTLY FROM SITE

    on_date = models.DateTimeField(null=True, blank=True)

    # Status: Replaced the enum from the spec w/ the following
    is_active = models.NullBooleanField(null=True, blank=True)
    redirect_url = models.URLField(null=True, blank=True)
    # STATUS        is_active       redirect_url
    # Unknown:      Null            Null
    # Active:       True            Null
    # Inactive:     False           Null
    # Redirected:   False           [URL]  # TODO: what should is_active be? does it matter?

    title = models.CharField(max_length=200, null=True, blank=True)
    description = models.TextField(null=True, blank=True)
    # crosswalk to <meta name="keywords">
    tags = models.ManyToManyField(Tag, blank=True)
    creator = models.CharField(max_length=200, null=True, blank=True)
    language = models.ForeignKey('languages_plus.Language', null=True, blank=True,
                                 on_delete=models.PROTECT)

    notes = GenericRelation(Note)

    def __repr__(self):
        return f'Resource(url="{self.url}")'

    def __str__(self):
        return self.url

    def get_resource_records(self) -> typ.Iterable:
        return chain(
            self.nominations.all(),
            self.imported_records.all(),
        )

    def get_absolute_url(self) -> str:
        return reverse('resource', kwargs={'url': self.url})

    @property
    def has_metadata(self) -> bool:
        for nomination in self.nominations.all():
            for field in ['title', 'creator', 'language', 'description']:
                value = getattr(nomination, field)
                if value and value != '':
                    return True
            for field in ['tags', 'subject_headings']:
                if getattr(nomination, field).count() > 0:
                    return True

        for imported_record in self.imported_records.all():
            for value_list in imported_record.metadata.values():
                if len(value_list) > 0:
                    return True

        return False

    @property
    def name(self):
        return str(self)

    def resource_record_count(self) -> int:
        return self.nominations.count() + self.imported_records.count()

@reversion.register
class CrawlScope(models.Model):
    class Meta:
        unique_together = ('title', 'organization')

    title = models.CharField(max_length=200)
    organization = models.ForeignKey(Organization, on_delete=models.PROTECT)

    max_time = models.PositiveIntegerField(null=True, blank=True)
    max_size = models.PositiveIntegerField(null=True, blank=True)
    max_resources = models.PositiveIntegerField(null=True, blank=True)

    override_robot_exclusion = models.NullBooleanField(
        null=True, blank=True, default=False)

    boundary_behavior = models.CharField(max_length=200, null=True, blank=True,
                                         choices=(('Page', 'Page'),
                                                  ('Site', 'Site'),
                                                  ('Host', 'Host'),
                                                  ('Domain', 'Domain')))

    max_embedded_links = models.PositiveIntegerField(null=True, blank=True)
    max_content_links = models.PositiveIntegerField(null=True, blank=True)

    format_behavior = models.CharField(
        max_length=200, null=True, blank=True, default='All', choices=(
            ('All', 'All'),
            ('PDF-Only', 'PDF-Only'),
        )
    )

    technology = models.CharField(
        max_length=200, null=True, blank=True,
        choices=[(x, x) for x in ('Archive-It', 'Brozzler', 'Crawler4j', 'Crawljax',
                                  'Heritrix', 'HTTrack', 'NetarchiveSuite', 'Nutch',
                                  'Social Feed Manager', 'WebRecorder', 'Wget', 'Other',
                                  'Unknown')],
        default='Unknown',
    )

    @property
    def name(self):
        return self.title

    def __str__(self):
        return self.title

    def __repr__(self):
        return f'CrawlScope(title="{self.title}")'


text:
use Bin;
use Buildable;
use Container;
use Widget;
use ffi;
use glib::object::Downcast;
use glib::object::IsA;
use glib::translate::*;

glib_wrapper! {
    pub struct Expander(Object<ffi::GtkExpander>): Widget, Container, Bin, Buildable;

    match fn {
        get_type => || ffi::gtk_expander_get_type(),
    }
}

impl Expander {
    pub fn new(label: Option<&str>) -> Expander {
        assert_initialized_main_thread!();
        unsafe {
            Widget::from_glib_none(ffi::gtk_expander_new(label.to_glib_none().0)).downcast_unchecked()
        }
    }

    pub fn new_with_mnemonic(label: &str) -> Expander {
        assert_initialized_main_thread!();
        unsafe {
            Widget::from_glib_none(ffi::gtk_expander_new_with_mnemonic(label.to_glib_none().0)).downcast_unchecked()
        }
    }

    pub fn get_expanded(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_expander_get_expanded(self.to_glib_none().0))
        }
    }

    pub fn get_label(&self) -> Option<String> {
        unsafe {
            from_glib_none(ffi::gtk_expander_get_label(self.to_glib_none().0))
        }
    }

    pub fn get_label_fill(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_expander_get_label_fill(self.to_glib_none().0))
        }
    }

    pub fn get_label_widget(&self) -> Option<Widget> {
        unsafe {
            from_glib_none(ffi::gtk_expander_get_label_widget(self.to_glib_none().0))
        }
    }

    pub fn get_resize_toplevel(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_expander_get_resize_toplevel(self.to_glib_none().0))
        }
    }

    pub fn get_spacing(&self) -> i32 {
        unsafe {
            ffi::gtk_expander_get_spacing(self.to_glib_none().0)
        }
    }

    pub fn get_use_markup(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_expander_get_use_markup(self.to_glib_none().0))
        }
    }

    pub fn get_use_underline(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_expander_get_use_underline(self.to_glib_none().0))
        }
    }

    pub fn set_expanded(&self, expanded: bool) {
        unsafe {
            ffi::gtk_expander_set_expanded(self.to_glib_none().0, expanded.to_glib());
        }
    }

    pub fn set_label(&self, label: Option<&str>) {
        unsafe {
            ffi::gtk_expander_set_label(self.to_glib_none().0, label.to_glib_none().0);
        }
    }

    pub fn set_label_fill(&self, label_fill: bool) {
        unsafe {
            ffi::gtk_expander_set_label_fill(self.to_glib_none().0, label_fill.to_glib());
        }
    }

    pub fn set_label_widget<T: IsA<Widget>>(&self, label_widget: Option<&T>) {
        unsafe {
            ffi::gtk_expander_set_label_widget(self.to_glib_none().0, label_widget.to_glib_none().0);
        }
    }

    pub fn set_resize_toplevel(&self, resize_toplevel: bool) {
        unsafe {
            ffi::gtk_expander_set_resize_toplevel(self.to_glib_none().0, resize_toplevel.to_glib());
        }
    }

    pub fn set_spacing(&self, spacing: i32) {
        unsafe {
            ffi::gtk_expander_set_spacing(self.to_glib_none().0, spacing);
        }
    }

    pub fn set_use_markup(&self, use_markup: bool) {
        unsafe {
            ffi::gtk_expander_set_use_markup(self.to_glib_none().0, use_markup.to_glib());
        }
    }

    pub fn set_use_underline(&self, use_underline: bool) {
        unsafe {
            ffi::gtk_expander_set_use_underline(self.to_glib_none().0, use_underline.to_glib());
        }
    }
}


text:
/* brachy_ipc.h */

/*
 * This file contains definitions of interest in interprocess
 * communications between brachy processes.
 */

/* one-byte header codes for messages from the calculation engine */
#define C_BRACHY_MATRIX 'M'
#define C_BRACHY_VECTOR 'V'
#define C_BRACHY_ERROR 'E'
#define C_BRACHY_ACK 'A'
#define C_BRACHY_NAK 'N'
#define C_BRACHY_STAT 'S'

/* one-byte header codes for messages to the calculation engine */
#define C_BRACHY_GO 'S'
#define C_BRACHY_EXACT 'E'
#define C_BRACHY_ABORT 'X'
#define C_BRACHY_DESC 'D'
#define C_BRACHY_GRID 'G'
#define C_BRACHY_OBJECTS 'O'
#define C_BRACHY_POINTS 'P'
#define C_BRACHY_PATIENT 'W'
#define C_BRACHY_USER 'U'

#define SEND_CODE(a,b) {char foo; foo = b; sock_write (a, &foo, 1);}

/* Not really IPC stuff - but close - operating modes */
#define SIMPLE (1)
#define BACKGROUND (2)
#define JUST_A_DAEMON (3)
#define INETD_DAEMON (4)


text:
#ifndef CPPSORT_DETAIL_SPLIT_SORT_H_
#define CPPSORT_DETAIL_SPLIT_SORT_H_

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <iterator>
#include <utility>
#include <cpp-sort/utility/as_function.h>
#include <cpp-sort/utility/iter_move.h>
#include "inplace_merge.h"

namespace cppsort
{
namespace detail
{
    template<
        typename BidirectionalIterator,
        typename Compare,
        typename Projection,
        typename Sorter
    >
    auto split_sort(BidirectionalIterator first, BidirectionalIterator last,
                    Compare compare, Projection projection, Sorter&& sorter)
        -> void
    {
        // This algorithm tries to isolate an approximate longest
        // non-decreasing subsequence (LNDS) in the left portion
        // of the collection, and the other elements in the right
        // portion of the collection, then to sort the remaining
        // elements and to merge both portions

        if (first == last || std::next(first) == last) {
            return;
        }

        auto&& comp = utility::as_function(compare);
        auto&& proj = utility::as_function(projection);

        // Read and reorganize elements until middle is found
        auto middle = first; // Last element of the LNDS
        for (auto reader_it = std::next(first); reader_it != last; ++reader_it) {
            if (comp(proj(*reader_it), proj(*middle))) {
                // We remove the top of the subsequence as well as the new element
                if (middle != first) {
                    --middle;
                }
            } else {
                // Everything is fine, add the new element to the subsequence
                ++middle;
                using utility::iter_swap;
                iter_swap(middle, reader_it);
            }
        }

        // Sort second part of the collection and merge
        std::forward<Sorter>(sorter)(middle, last, compare, projection);
        inplace_merge(first, middle, last, std::move(compare), std::move(projection));
    }
}}

#endif // CPPSORT_DETAIL_SPLIT_SORT_H_


text:
using System.Windows;

namespace Xceed.Wpf.Toolkit.Panels
{
  public class ChildEnteringEventArgs : RoutedEventArgs
  {
    #region Constructors

    public ChildEnteringEventArgs( UIElement child, Rect? enterFrom, Rect arrangeRect )
    {
      _child = child;
      _enterFrom = enterFrom;
      _arrangeRect = arrangeRect;
    }

    #endregion

    #region ArrangeRect Property

    public Rect ArrangeRect
    {
      get
      {
        return _arrangeRect;
      }
    }

    private readonly Rect _arrangeRect;

    #endregion

    #region Child Property

    public UIElement Child
    {
      get
      {
        return _child;
      }
    }

    private readonly UIElement _child;

    #endregion

    #region EnterFrom Property

    public Rect? EnterFrom
    {
      get
      {
        return _enterFrom;
      }
      set
      {
        _enterFrom = value;
      }
    }

    private Rect? _enterFrom; //null

    #endregion
  }
}


text:
package thymeleafexamples.extrathyme.business.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import thymeleafexamples.extrathyme.business.entities.Team;
import thymeleafexamples.extrathyme.business.entities.repositories.TeamRepository;

@Service
public class TeamService {

    @Autowired
    private TeamRepository teamRepository;

    public TeamService() {
        super();
    }

    public List<Team> findAllTeams() {
        return this.teamRepository.findAllTeams();
    }

}


text:
<<<<<<< HEAD
<<<<<<< HEAD
#!/usr/bin/env python

# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import sys

# TODO(mark): sys.path manipulation is some temporary testing stuff.
try:
  import gyp
except ImportError, e:
  import os.path
  sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
  import gyp

if __name__ == '__main__':
  sys.exit(gyp.script_main())
=======
#!/usr/bin/env python

# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import sys

# TODO(mark): sys.path manipulation is some temporary testing stuff.
try:
  import gyp
except ImportError, e:
  import os.path
  sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
  import gyp

if __name__ == '__main__':
  sys.exit(gyp.script_main())
>>>>>>> b875702c9c06ab5012e52ff4337439b03918f453
=======
#!/usr/bin/env python

# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import sys

# TODO(mark): sys.path manipulation is some temporary testing stuff.
try:
  import gyp
except ImportError, e:
  import os.path
  sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
  import gyp

if __name__ == '__main__':
  sys.exit(gyp.script_main())
>>>>>>> b875702c9c06ab5012e52ff4337439b03918f453