text:
import {NamespaceDefinition, ModuledDefinition, createFile, ClassDefinition, InterfaceDefinition} from "ts-type-info";
import {DefinitionInfo} from "./DefinitionInfo";
import {getValidNameFromPath} from "./getValidNameFromPath";

export interface NamespaceForCreate {
    namespaceDef: NamespaceDefinition;
    namespacePath: string;
}

type SupportedDefinitions = ClassDefinition | InterfaceDefinition;

export class NamespaceForCreateFiller {
    private fileDefinition = createFile();

    fillNamespaceForCreate(defInfo: DefinitionInfo) {
        const fileNamespace = this.getNamespaceFromModuleSpecifier(defInfo.importDef.moduleSpecifier, this.fileDefinition) as NamespaceDefinition;
        const parentNamespace = this.getNamespaceBasedOnParentNamespaceInFile(fileNamespace, defInfo);
        defInfo.namespaceDef = parentNamespace.addNamespace({
            name: defInfo.definition.name,
            isExported: true
        });
        // todo: refactor to not use getNamespacesToDefinition (performance reasons)
        // todo: refactor out the join to get the namespace path since this is done elsewhere
        defInfo.namespacePath = this.fileDefinition.getNamespacesToDefinition(defInfo.namespaceDef).map(n => n.name).join(".") + "." + defInfo.namespaceDef.name;
    }

    getAllNamespaces() {
        return this.fileDefinition.namespaces;
    }

    private getNamespaceFromModuleSpecifier(moduleSpecifier: string, currentDef: ModuledDefinition): ModuledDefinition {
        moduleSpecifier = moduleSpecifier.replace(/^\.?[/\\]*/, "");
        const hasDir = /[\\/]/.test(moduleSpecifier);

        if (hasDir) {
            const currentDir = /^[^\\/]+/.exec(moduleSpecifier)[0];

            currentDef = this.getNamespaceFromName(currentDef, getValidNameFromPath(currentDir));
            moduleSpecifier = moduleSpecifier.replace(/^[^\\/]+[\\/]/, "");

            return this.getNamespaceFromModuleSpecifier(moduleSpecifier, currentDef);
        }
        else {
            return this.getNamespaceFromName(currentDef, getValidNameFromPath(moduleSpecifier));
        }
    }

    private getNamespaceBasedOnParentNamespaceInFile(fileNamespace: NamespaceDefinition, defInfo: DefinitionInfo) {
        const namespaces = defInfo.fileDefinition.getNamespacesToDefinition(defInfo.definition);
        let currentNamespace = fileNamespace;

        namespaces.forEach(n => {
            currentNamespace = this.getNamespaceFromName(currentNamespace, n.name);
        });

        return currentNamespace;
    }

    private getNamespaceFromName(currentDef: ModuledDefinition, name: string) {
        let namespaceDef = currentDef.getNamespace(name);

        if (namespaceDef == null) {
            namespaceDef = currentDef.addNamespace({
                name: name,
                isExported: true
            });
        }

        return namespaceDef;
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Taxon 53(4): 970 (2004)

#### Original name
Neofuscelia scabrosina Elix

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
Template.registerHelper('summarize', function(string) {
  var cleanString = _(string).stripTags();
  return _(cleanString).truncate(80);
});


text:
import java.io.IOException;

import junit.framework.TestCase;
import net.instantcom.keikosniffer.http.HttpUtil;
import net.instantcom.keikosniffer.http.SessionInputBufferMockup;

import org.apache.http.HttpEntity;
import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
import org.apache.http.HttpResponseFactory;
import org.apache.http.impl.DefaultHttpResponseFactory;
import org.apache.http.impl.entity.EntityDeserializer;
import org.apache.http.impl.entity.StrictContentLengthStrategy;
import org.apache.http.impl.io.HttpResponseParser;
import org.apache.http.io.SessionInputBuffer;
import org.apache.http.message.BasicLineParser;
import org.apache.http.message.LineParser;
import org.apache.http.params.BasicHttpParams;

public class TestHttpResponse extends TestCase {

    private static final HttpResponseFactory responseFactory = new DefaultHttpResponseFactory();
    private static final LineParser lineParser = new BasicLineParser();
    private static final EntityDeserializer entityDeserializer =
        new EntityDeserializer(new StrictContentLengthStrategy());

    public void testBodyExtraction() throws HttpException, IOException {
        final String RESPONSE =
            "HTTP/1.0 200 OK\r\nDate: Fri, 31 Dec 1999 23:59:59 GMT\r\n"
                + "Content-Length: 6\r\nContent-Type: text/html\r\n\r\n" + "foobar\r\n";
        HttpResponse response = parse(RESPONSE.getBytes());
        assertNotNull(response);
        HttpEntity body = response.getEntity();
        assertNotNull(body);
        String s = new String(HttpUtil.getBody(response));
        assertEquals("foobar", s);
    }

    // // doesn't work without headers
    // public void testHeaderlessBody() throws HttpException, IOException {
    // final String RESPONSE = "foobar";
    // HttpResponse response = parse(RESPONSE.getBytes());
    // assertNotNull(response);
    // HttpEntity body = response.getEntity();
    // assertNotNull(body);
    // String s = new String(HttpUtil.getBody(response));
    // assertEquals("foobar", s);
    // }

    public void testChunkedResponse() throws HttpException, IOException {
        final String RESPONSE =
            "HTTP/1.1 200 OK\r\n" + "Date: Fri, 31 Dec 1999 23:59:59 GMT\r\n"
                + "Content-Type: text/plain\r\n" + "Transfer-Encoding: chunked\r\n" + "\r\n"
                + "1a; ignore-stuff-here\r\n" + "abcdefghijklmnopqrstuvwxyz\r\n" + "10\r\n"
                + "1234567890abcdef\r\n" + "0\r\n" + "some-footer: some-value\r\n"
                + "another-footer: another-value" + "\r\n";
        HttpResponse response = parse(RESPONSE.getBytes());
        assertNotNull(response);
        HttpEntity body = response.getEntity();
        assertNotNull(body);
        String s = new String(HttpUtil.getBody(response));
        assertEquals("abcdefghijklmnopqrstuvwxyz1234567890abcdef", s);
    }

    private HttpResponse parse(byte[] data) throws HttpException, IOException {
        SessionInputBuffer input = new SessionInputBufferMockup(data);
        HttpResponseParser responseParser =
            new HttpResponseParser(input, lineParser, responseFactory, new BasicHttpParams());
        HttpResponse msg = (HttpResponse) responseParser.parse();
        msg.setEntity(entityDeserializer.deserialize(input, msg));
        return msg;
    }

}


text:
@class NSIndexPath, UITableViewCell;

@interface OriginalRow : NSObject
{
    BOOL _hiddenReal;
    BOOL _hiddenPlanned;
    int _batchOperation;
    UITableViewCell *_cell;
    NSIndexPath *_originalIndexPath;
}

@property(retain, nonatomic) NSIndexPath *originalIndexPath; // @synthesize originalIndexPath=_originalIndexPath;
@property(nonatomic) __weak UITableViewCell *cell; // @synthesize cell=_cell;
@property(nonatomic) int batchOperation; // @synthesize batchOperation=_batchOperation;
@property(nonatomic) BOOL hiddenPlanned; // @synthesize hiddenPlanned=_hiddenPlanned;
@property(nonatomic) BOOL hiddenReal; // @synthesize hiddenReal=_hiddenReal;
- (void).cxx_destruct;
- (void)update;
@property(nonatomic) BOOL hidden;

@end


text:
* [ ] SVN Version checking
* [ ] SFTP Upload / Download Progress
* [x] Generate Page for project
* [ ] UI Design
* [x] Save info for each project
* [ ] Schduled update
* [ ] Check for same commit, warn the user
* [ ] List Configuration, Schema


text:
import React from 'react';
import FlatButton from 'material-ui/FlatButton';

const styles = {
  margin: '0px 0px 0px 50%',
  color: '#5599ff',
};

const NoMatch = () => (

      <FlatButton
        label="go home"
        onTouchTap={() => window.location.replace(`${window.location.origin}${window.location.pathname}#/`)}
        secondary={true} style={styles}
      />

);

module.exports = NoMatch;


text:
$outputPath = Get-Content ..\..\..\Common\BuildActions\OutputPath.txt;

if ([string]::IsNullOrWhiteSpace($outputPath))
{
    "Can't read Common\BuildActions\OutputPath.txt or it's empty."
    return;
}

$managedSubPath = "OxygenNotIncluded_Data\Managed";
$managedFullPath = $outputPath + $managedSubPath;

New-Item $outputPath -ItemType Directory -Force | Out-Null;
New-Item $managedFullPath -ItemType Directory -Force | Out-Null;

Copy-Item Core.dll $managedFullPath -Force;


text:
macro-obfuscate
===============

make code a set of #define [statement]


text:
package me.aatma.languagetologic.nl;

import java.util.List;

import edu.stanford.nlp.trees.Tree;

public interface AnalyzePhrase {

    public List<Object> parse();

}


text:
package libcontainerd

import (
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	goruntime "runtime"
	"strings"
	"time"

	containerd "github.com/docker/containerd/api/grpc/types"
	"github.com/tonistiigi/fifo"
	"golang.org/x/net/context"
	"golang.org/x/sys/unix"
)

var fdNames = map[int]string{
	unix.Stdin:  "stdin",
	unix.Stdout: "stdout",
	unix.Stderr: "stderr",
}

// process keeps the state for both main container process and exec process.
type process struct {
	processCommon

	// Platform specific fields are below here.
	dir string
}

func (p *process) openFifos(terminal bool) (pipe *IOPipe, err error) {
	if err := os.MkdirAll(p.dir, 0700); err != nil {
		return nil, err
	}

	ctx, _ := context.WithTimeout(context.Background(), 15*time.Second)

	io := &IOPipe{}

	io.Stdin, err = fifo.OpenFifo(ctx, p.fifo(unix.Stdin), unix.O_WRONLY|unix.O_CREAT|unix.O_NONBLOCK, 0700)
	if err != nil {
		return nil, err
	}

	defer func() {
		if err != nil {
			io.Stdin.Close()
		}
	}()

	io.Stdout, err = fifo.OpenFifo(ctx, p.fifo(unix.Stdout), unix.O_RDONLY|unix.O_CREAT|unix.O_NONBLOCK, 0700)
	if err != nil {
		return nil, err
	}

	defer func() {
		if err != nil {
			io.Stdout.Close()
		}
	}()

	if goruntime.GOOS == "solaris" || !terminal {
		// For Solaris terminal handling is done exclusively by the runtime therefore we make no distinction
		// in the processing for terminal and !terminal cases.
		io.Stderr, err = fifo.OpenFifo(ctx, p.fifo(unix.Stderr), unix.O_RDONLY|unix.O_CREAT|unix.O_NONBLOCK, 0700)
		if err != nil {
			return nil, err
		}
		defer func() {
			if err != nil {
				io.Stderr.Close()
			}
		}()
	} else {
		io.Stderr = ioutil.NopCloser(emptyReader{})
	}

	return io, nil
}

func (p *process) sendCloseStdin() error {
	_, err := p.client.remote.apiClient.UpdateProcess(context.Background(), &containerd.UpdateProcessRequest{
		Id:         p.containerID,
		Pid:        p.friendlyName,
		CloseStdin: true,
	})
	if err != nil && (strings.Contains(err.Error(), "container not found") || strings.Contains(err.Error(), "process not found")) {
		return nil
	}
	return err
}

func (p *process) closeFifos(io *IOPipe) {
	io.Stdin.Close()
	io.Stdout.Close()
	io.Stderr.Close()
}

type emptyReader struct{}

func (r emptyReader) Read(b []byte) (int, error) {
	return 0, io.EOF
}

func (p *process) fifo(index int) string {
	return filepath.Join(p.dir, p.friendlyName+"-"+fdNames[index])
}


text:
package gudusoft.gsqlparser.sql2xml.model;

public class cursor_sensitivity
{

}


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "fahrer".
 *
 * @property integer $id
 * @property integer $tag
 * @property string $vorname
 * @property string $nachname
 * @property string $nickname
 * @property integer $klasse
 * @property string $telefonnummer
 * @property integer $stuetzpunkt
 * @property string $buero
 * @property string $admin
 * @property string $passwort
 */
class Fahrer extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'fahrer';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['tag', 'klasse', 'stuetzpunkt'], 'integer'],
            [['vorname', 'nachname', 'nickname', 'telefonnummer', 'passwort'], 'string', 'max' => 50],
            [['buero', 'admin'], 'string', 'max' => 1],
            [['telefonnummer'], 'unique'],
            [['tag'], 'unique']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'tag' => 'Tag',
            'vorname' => 'Vorname',
            'nachname' => 'Nachname',
            'nickname' => 'Nickname',
            'klasse' => 'Klasse',
            'telefonnummer' => 'Telefonnummer',
            'stuetzpunkt' => 'Stuetzpunkt',
            'buero' => 'Buero',
            'admin' => 'Admin',
            'passwort' => 'Passwort',
        ];
    }
}


text:
/****************************************************************************

   Http1ServerSession.h

   Description:

 ****************************************************************************/

#pragma once

#include "HttpConnectionCount.h"
#include "HttpProxyAPIEnums.h"
#include "PoolableSession.h"
#include "Http1ServerTransaction.h"

class HttpSM;
class MIOBuffer;
class IOBufferReader;

enum {
  HTTP_SS_MAGIC_ALIVE = 0x0123FEED,
  HTTP_SS_MAGIC_DEAD  = 0xDEADFEED,
};

class Http1ServerSession : public PoolableSession
{
  using self_type  = Http1ServerSession;
  using super_type = PoolableSession;

public:
  Http1ServerSession();
  Http1ServerSession(self_type const &) = delete;
  self_type &operator=(self_type const &) = delete;
  ~Http1ServerSession()                   = default;

  ////////////////////
  // Methods
  void release(ProxyTransaction *) override;
  void destroy() override;
  void release_transaction();

  // VConnection Methods
  void do_io_close(int lerrno = -1) override;

  // ProxySession Methods
  int get_transact_count() const override;
  const char *get_protocol_string() const override;
  void increment_current_active_connections_stat() override;
  void decrement_current_active_connections_stat() override;
  void new_connection(NetVConnection *new_vc, MIOBuffer *iobuf, IOBufferReader *reader) override;
  void start() override;
  void free() override;
  bool is_chunked_encoding_supported() const override;

  IOBufferReader *get_remote_reader() override;
  IpEndpoint const &get_server_ip() const;

  ProxyTransaction *new_transaction() override;

  ////////////////////
  // Variables

  int transact_count = 0;

  // The ServerSession owns the following buffer which use
  //   for parsing the headers.  The server session needs to
  //   own the buffer so we can go from a keep-alive state
  //   to being acquired and parsing the header without
  //   changing the buffer we are doing I/O on.  We can
  //   not change the buffer for I/O without issuing a
  //   an asynchronous cancel on NT
  MIOBuffer *read_buffer = nullptr;

private:
  int magic = HTTP_SS_MAGIC_DEAD;

  IOBufferReader *_reader = nullptr;

  int released_transactions = 0;

  Http1ServerTransaction trans;
};

extern ClassAllocator<Http1ServerSession, true> httpServerSessionAllocator;

////////////////////////////////////////////
// INLINE

inline IOBufferReader *
Http1ServerSession::get_remote_reader()
{
  return _reader;
};


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @name: S11.13.1_A2.1_T3;
 * @section: 11.13.1, 16;
 * @assertion: Operator x = y uses GetValue and PutValue;
 * @description: If Type(LeftHandSideExpression) is not Reference, throw ReferenceError (or SyntaxError);
*  @negative
*/

//CHECK#1
try {
  1 = 1;
  $ERROR('#1.1: 1 = 1 throw ReferenceError (or SyntaxError). Actual: ' + (1 = 1));
}
catch (e) {
  if ((e instanceof ReferenceError) !== true) {
    $ERROR('#1.2: 1 = 1 throw ReferenceError (or SyntaxError). Actual: ' + (e));
  } else {
    1 = 1;
  }
}


text:
package centipe.texteditor;

import javax.swing.JTextArea;
import javax.swing.undo.UndoManager;

import centipe.texteditor.main.ui.TextArea;
import centipe.texteditor.main.utils.DocumentManager;
import centipe.texteditor.main.utils.TextStorage;

public class DocumentManagerStub extends DocumentManager {

	private TextStorage storage;
	private String path;

	public DocumentManagerStub() {

		super();
		storage = new TextStorage();
	}

	public DocumentManagerStub(TextArea area, UndoManager manager) {

		super(area, manager);
		storage = new TextStorage();
	}

	@Override
	public void resetTextArea() {

		super.setTextArea("");

		// Get rid of all UI-related actions
		//textArea.setCaretPosition(0);
		//jWindow.getWindow().setTitle(INITIAL_WINDOW_TITLE + WINDOW_TITLE_POSTFIX);
		//currentDirectory = null;
		//jWindow.toggleUndoMenuItemEnabled(false);
	}

	public void setTestPath(String path) {
		this.path = path;
	}

}


text:
package com.terro;

import com.terro.services.UserService;
import com.terro.services.UserServiceAsync;
import com.terro.services.UserServiceObservable;
import retrofit.RestAdapter;

/**
 * Helper class for easy usage of the RandomUser.me using retrofit.
 *

 * The service methods take care of constructing the required {@link retrofit.RestAdapter} and creating the service. You
 * can customize the {@link retrofit.RestAdapter} by overriding {@link #newRestAdapterBuilder()} and setting e.g.
 * your own HTTP client instance or thread executor.
 *

 * Only one {@link retrofit.RestAdapter} instance is created upon the first and re-used for any consequent service
 * method call.
 */
public class RandomUser {

    // END POINT
    public static final String END_POINT = "http://api.randomuser.me/0.4";

    private boolean isDebug;
    private RestAdapter restAdapter;

    /**
     * Default constructor
     */
    public RandomUser() {}

    /**
     * Set the {@link retrofit.RestAdapter} log level.
     *
     * @param isDebug If true, the log level is set to {@link retrofit.RestAdapter.LogLevel#FULL}.
     *                Otherwise {@link retrofit.RestAdapter.LogLevel#NONE}.
     */
    public RandomUser setIsDebug (boolean isDebug) {
        this.isDebug = isDebug;
        if (restAdapter != null) {
            restAdapter.setLogLevel(isDebug ? RestAdapter.LogLevel.FULL : RestAdapter.LogLevel.NONE);
        }
        return this;
    }

    /**
     * Create a new {@link retrofit.RestAdapter.Builder}. Override this to e.g. set your own client or executor.
     *
     * @return A {@link retrofit.RestAdapter.Builder} with no modifications.
     */
    protected RestAdapter.Builder newRestAdapterBuilder () {
        return new RestAdapter.Builder();
    }

    /**
     * Return the current {@link retrofit.RestAdapter} instance. If none exists builds a new one.
     */
    protected RestAdapter getRestAdapter () {
        if (restAdapter == null) {
            RestAdapter.Builder builder = newRestAdapterBuilder();
            builder.setEndpoint(END_POINT);

            if (isDebug) {
                builder.setLogLevel(RestAdapter.LogLevel.FULL);
            }

            restAdapter = builder.build();
        }

        return restAdapter;
    }

    /**
     * Return the {@link com.terro.services.UserService} instance.
     *
     */
    public UserService userServices () {
        return getRestAdapter().create(UserService.class);
    }

    /**
     * Return the {@link com.terro.services.UserServiceAsync} instance.
     *
     */
    public UserServiceAsync userServicesAsync () {
        return getRestAdapter().create(UserServiceAsync.class);
    }

    /**
     * Return the {@link com.terro.services.UserServiceObservable} instance.
     *
     */
    public UserServiceObservable userServicesObservable () {
        return getRestAdapter().create(UserServiceObservable.class);
    }
}


text:
/**
 * Fullscreen polyfills
 */

let fullscreenHelper = {

  /**
   * Checks if the browser is already in fullscreen mode
   */
  isFullscreen: function () {
    return  (document.fullScreenElement && document.fullScreenElement !== null) ||
            (document.mozFullScreen || document.webkitIsFullScreen);
  },

  /**
   * Enter in fullscreen mode
   */
  enterFullscreen: function () {
    var docElm = document.documentElement;

    if (docElm.requestFullscreen) {
      docElm.requestFullscreen();
    }
    else if (docElm.mozRequestFullScreen) {
      docElm.mozRequestFullScreen();
    }
    else if (docElm.webkitRequestFullScreen) {
      docElm.webkitRequestFullScreen();
    }
  },

  /**
   * Exit the fullscreen mode
   */
  exitFullscreen: function () {
    if (document.documentElement.exitFullscreen) {
      document.documentElement.exitFullscreen();
    }
    else if (document.mozCancelFullScreen) {
      document.mozCancelFullScreen();
    }
    else if (document.webkitExitFullscreen) {
      document.webkitExitFullscreen();
    }
  },

  /**
   * Toggle the fullscreen mode
   */
  toggle: function () {
    if (!fullscreenHelper.isFullscreen()) {
      fullscreenHelper.enterFullscreen();
    }
    else {
      fullscreenHelper.exitFullscreen();
    }
  }
}

export default fullscreenHelper


text:
package com.vaadin.tests.server.component.absolutelayout;

import com.vaadin.event.LayoutEvents.LayoutClickEvent;
import com.vaadin.event.LayoutEvents.LayoutClickListener;
import com.vaadin.tests.server.component.AbstractListenerMethodsTestBase;
import com.vaadin.ui.AbsoluteLayout;

public class AbsoluteLayoutListenersTest extends AbstractListenerMethodsTestBase {
    public void testLayoutClickListenerAddGetRemove() throws Exception {
        testListenerAddGetRemove(AbsoluteLayout.class, LayoutClickEvent.class,
                LayoutClickListener.class);
    }
}


text:
#ifndef BOOST_INTERPROCESS_SEMAPHORE_HPP
#define BOOST_INTERPROCESS_SEMAPHORE_HPP

#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)

#ifndef BOOST_CONFIG_HPP
#  include <boost/config.hpp>
#endif
#
#if defined(BOOST_HAS_PRAGMA_ONCE)
#  pragma once
#endif

#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/detail/workaround.hpp>

#include <boost/interprocess/creation_tags.hpp>
#include <boost/interprocess/exceptions.hpp>
#include <boost/interprocess/detail/posix_time_types_wrk.hpp>

#if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && \
   (defined(BOOST_INTERPROCESS_POSIX_PROCESS_SHARED) && defined(BOOST_INTERPROCESS_POSIX_UNNAMED_SEMAPHORES))
   #include <boost/interprocess/sync/posix/semaphore.hpp>
   #define BOOST_INTERPROCESS_USE_POSIX
//Experimental...
#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
   #include <boost/interprocess/sync/windows/semaphore.hpp>
   #define BOOST_INTERPROCESS_USE_WINDOWS
#elif !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
   #include <boost/interprocess/sync/spin/semaphore.hpp>
   #define BOOST_INTERPROCESS_USE_GENERIC_EMULATION
#endif

#endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED

//!\file
//!Describes a interprocess_semaphore class for inter-process synchronization

namespace boost {
namespace interprocess {

//!Wraps a interprocess_semaphore that can be placed in shared memory and can be
//!shared between processes. Allows timed lock tries
class interprocess_semaphore
{
   #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
   //Non-copyable
   interprocess_semaphore(const interprocess_semaphore &);
   interprocess_semaphore &operator=(const interprocess_semaphore &);
   #endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
   public:
   //!Creates a interprocess_semaphore with the given initial count.
   //!interprocess_exception if there is an error.*/
   interprocess_semaphore(unsigned int initialCount);

   //!Destroys the interprocess_semaphore.
   //!Does not throw
   ~interprocess_semaphore();

   //!Increments the interprocess_semaphore count. If there are processes/threads blocked waiting
   //!for the interprocess_semaphore, then one of these processes will return successfully from
   //!its wait function. If there is an error an interprocess_exception exception is thrown.
   void post();

   //!Decrements the interprocess_semaphore. If the interprocess_semaphore value is not greater than zero,
   //!then the calling process/thread blocks until it can decrement the counter.
   //!If there is an error an interprocess_exception exception is thrown.
   void wait();

   //!Decrements the interprocess_semaphore if the interprocess_semaphore's value is greater than zero
   //!and returns true. If the value is not greater than zero returns false.
   //!If there is an error an interprocess_exception exception is thrown.
   bool try_wait();

   //!Decrements the interprocess_semaphore if the interprocess_semaphore's value is greater
   //!than zero and returns true. Otherwise, waits for the interprocess_semaphore
   //!to the posted or the timeout expires. If the timeout expires, the
   //!function returns false. If the interprocess_semaphore is posted the function
   //!returns true. If there is an error throws sem_exception
   bool timed_wait(const boost::posix_time::ptime &abs_time);

   //!Returns the interprocess_semaphore count
//   int get_count() const;
   #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
   private:
   #if defined(BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
      #undef BOOST_INTERPROCESS_USE_GENERIC_EMULATION
      ipcdetail::spin_semaphore m_sem;
   #elif defined(BOOST_INTERPROCESS_USE_WINDOWS)
      #undef BOOST_INTERPROCESS_USE_WINDOWS
      ipcdetail::windows_semaphore m_sem;
   #else
      #undef BOOST_INTERPROCESS_USE_POSIX
      ipcdetail::posix_semaphore m_sem;
   #endif   //#if defined(BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
   #endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
};

}  //namespace interprocess {
}  //namespace boost {

namespace boost {
namespace interprocess {

inline interprocess_semaphore::interprocess_semaphore(unsigned int initialCount)
   : m_sem(initialCount)
{}

inline interprocess_semaphore::~interprocess_semaphore(){}

inline void interprocess_semaphore::wait()
{
   #ifdef BOOST_INTERPROCESS_ENABLE_TIMEOUT_WHEN_LOCKING
      boost::posix_time::ptime wait_time
         = microsec_clock::universal_time()
         + boost::posix_time::milliseconds(BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS);
      if (!m_sem.timed_wait(wait_time))
      {
         throw interprocess_exception(timeout_when_waiting_error, "Interprocess semaphore timeout when waiting. Possible deadlock: owner died without posting?");
      }
   #else
      m_sem.wait();
   #endif
}
inline bool interprocess_semaphore::try_wait()
{ return m_sem.try_wait(); }

inline bool interprocess_semaphore::timed_wait(const boost::posix_time::ptime &abs_time)
{ return m_sem.timed_wait(abs_time); }

inline void interprocess_semaphore::post()
{ m_sem.post(); }

}  //namespace interprocess {
}  //namespace boost {

#include <boost/interprocess/detail/config_end.hpp>

#endif   //BOOST_INTERPROCESS_SEMAPHORE_HPP


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#8053BA</color>
    <color name="colorPrimaryDark">#694499</color>
    <color name="colorAccent">#FF4081</color>
    <color name="line">#E0E0E0</color>
    <color name="colorPrimary2">#55B7A2</color>
    <color name="colorPrimaryDark2">#469685</color>
    <color name="colorPrimary3">#39D3D1</color>
    <color name="colorPrimaryDark3">#2FADAC</color>
</resources>


text:
class RecipeScrapersExceptions(Exception):
    def __init__(self, message):
        self.message = message
        super().__init__(message)

    def __str__(self):
        return f"recipe-scrapers exception: {self.message}"

class WebsiteNotImplementedError(RecipeScrapersExceptions):
    """Error when website is not supported by this library."""

    def __init__(self, domain):
        self.domain = domain
        message = f"Website ({self.domain}) not supported."
        super().__init__(message)

class NoSchemaFoundInWildMode(RecipeScrapersExceptions):
    """Error when wild_mode fails to locate schema at the url"""

    def __init__(self, url):
        self.url = url
        message = f"No Recipe Schema found at {self.url}."
        super().__init__(message)

class ElementNotFoundInHtml(RecipeScrapersExceptions):
    """Error when we cannot locate the HTML element on the page"""

    def __init__(self, element):
        self.element = element
        message = (
            "Element not found in html (self.soup.find returned None). Check traceback."
        )
        super().__init__(message)

class SchemaOrgException(RecipeScrapersExceptions):
    """Error in parsing or missing portion of the Schema.org data org the page"""

    def __init__(self, message):
        super().__init__(message)


text:
using Kazyx.RemoteApi;
using Kazyx.RemoteApi.Camera;
using Kazyx.Uwpmm.Utility;
using System;
using System.Collections.Generic;

namespace Kazyx.Uwpmm.DataModel
{
    public class CameraStatus : ObservableBase
    {
        private Capability<string> _ExposureMode;
        public Capability<string> ExposureMode
        {
            set
            {
                _ExposureMode = value;
                NotifyChangedOnUI("ExposureMode");
            }
            get { return _ExposureMode; }
        }

        private Capability<string> _ShootMode;
        public Capability<string> ShootMode
        {
            set
            {
                _ShootMode = value;
                NotifyChangedOnUI("ShootMode");
            }
            get { return _ShootMode; }
        }

        private Capability<string> _PostviewSize;
        public Capability<string> PostviewSize
        {
            set
            {
                _PostviewSize = value;
                NotifyChangedOnUI("PostviewSize");
            }
            get { return _PostviewSize; }
        }

        private Capability<string> _BeepMode;
        public Capability<string> BeepMode
        {
            set
            {
                _BeepMode = value;
                NotifyChangedOnUI("BeepMode");
            }
            get { return _BeepMode; }
        }

        private Capability<int> _SelfTimer;
        public Capability<int> SelfTimer
        {
            set
            {
                _SelfTimer = value;
                NotifyChangedOnUI("SelfTimer");
            }
            get { return _SelfTimer; }
        }

        private Capability<StillImageSize> _StillImageSize;
        public Capability<StillImageSize> StillImageSize
        {
            set
            {
                _StillImageSize = value;
                NotifyChangedOnUI("StillImageSize");
            }
            get { return _StillImageSize; }
        }

        private Capability<string> _WhiteBalance;
        public Capability<string> WhiteBalance
        {
            set
            {
                _WhiteBalance = value;
                NotifyChangedOnUI("WhiteBalance");
                NotifyChangedOnUI("ColorTemperture");
            }
            get { return _WhiteBalance; }
        }

        private int _ColorTemperture = -1;
        public int ColorTemperture
        {
            set
            {
                _ColorTemperture = value;
                NotifyChangedOnUI("ColorTemperture");
            }
            get { return _ColorTemperture; }
        }

        private Dictionary<string, int[]> _ColorTempertureCandidates;
        public Dictionary<string, int[]> ColorTempertureCandidates
        {
            set
            {
                _ColorTempertureCandidates = value;
                NotifyChangedOnUI("ColorTemperture");
            }
            get { return _ColorTempertureCandidates; }
        }

        private Capability<string> _ShutterSpeed;
        public Capability<string> ShutterSpeed
        {
            set
            {
                _ShutterSpeed = value;
                NotifyChangedOnUI("ShutterSpeed");
            }
            get { return _ShutterSpeed; }
        }

        private Capability<string> _ISOSpeedRate;
        public Capability<string> ISOSpeedRate
        {
            set
            {
                _ISOSpeedRate = value;
                NotifyChangedOnUI("ISOSpeedRate");
            }
            get { return _ISOSpeedRate; }
        }

        private Capability<string> _FNumber;
        public Capability<string> FNumber
        {
            set
            {
                _FNumber = value;
                NotifyChangedOnUI("FNumber");
            }
            get { return _FNumber; }
        }

        private string _Status = EventParam.NotReady;
        public string Status
        {
            set
            {
                if (value != _Status)
                {
                    _Status = value;
                    NotifyChangedOnUI("Status");
                }
            }
            get { return _Status; }
        }

        private ZoomInfo _ZoomInfo = null;
        public ZoomInfo ZoomInfo
        {
            set
            {
                _ZoomInfo = value;
                NotifyChangedOnUI("ZoomInfo");
            }
            get { return _ZoomInfo; }
        }

        private Capability<string> _FocusMode;
        public Capability<string> FocusMode
        {
            set
            {
                _FocusMode = value;
                NotifyChangedOnUI("FocusMode");
            }
            get { return _FocusMode; }
        }

        private Capability<string> _MovieQuality;
        public Capability<string> MovieQuality
        {
            set
            {
                _MovieQuality = value;
                NotifyChangedOnUI("MovieQuality");
            }
            get { return _MovieQuality; }
        }

        private Capability<string> _SteadyMode;
        public Capability<string> SteadyMode
        {
            set
            {
                _SteadyMode = value;
                NotifyChangedOnUI("SteadyMode");
            }
            get { return _SteadyMode; }
        }

        private Capability<int> _ViewAngle;
        public Capability<int> ViewAngle
        {
            set
            {
                _ViewAngle = value;
                NotifyChangedOnUI("ViewAngle");
            }
            get { return _ViewAngle; }
        }

        private Capability<string> _FlashMode;
        public Capability<string> FlashMode
        {
            set
            {
                _FlashMode = value;
                NotifyChangedOnUI("FlashMode");
            }
            get { return _FlashMode; }
        }

        private TouchFocusStatus _TouchFocusStatus;
        public TouchFocusStatus TouchFocusStatus
        {
            set
            {
                _TouchFocusStatus = value;
                NotifyChangedOnUI("TouchFocusStatus");
            }
            get
            {
                return _TouchFocusStatus;
            }
        }

        private EvCapability _EvInfo;
        public EvCapability EvInfo
        {
            set
            {
                _EvInfo = value;
                NotifyChangedOnUI("EvInfo");
            }
            get { return _EvInfo; }
        }

        private List<StorageInfo> _Storages;
        public List<StorageInfo> Storages
        {
            set
            {
                _Storages = value;
                NotifyChangedOnUI("Storages");
            }
            get { return _Storages; }
        }

#if DEBUG
        public void TestRotate()
        {
            switch (_LiveviewOrientation)
            {
                case RemoteApi.Camera.Orientation.Straight:
                    LiveviewOrientation = "90";
                    break;
                case RemoteApi.Camera.Orientation.Right:
                    LiveviewOrientation = "180";
                    break;
                case RemoteApi.Camera.Orientation.Left:
                    LiveviewOrientation = "0";
                    break;
                case RemoteApi.Camera.Orientation.Opposite:
                    LiveviewOrientation = "270";
                    break;
            }
        }
#endif

        private string _LiveviewOrientation = "";
        public string LiveviewOrientation
        {
            set
            {
                if (_LiveviewOrientation != value)
                {
                    _LiveviewOrientation = value;
                    NotifyChangedOnUI("LiveviewOrientation");
                }
            }
            get { return _LiveviewOrientation == null ? Orientation.Straight : _LiveviewOrientation; }
        }

        public double LiveviewOrientationAsDouble
        {
            get
            {
               switch (_LiveviewOrientation)
                {
                    case RemoteApi.Camera.Orientation.Straight:
                        return 0;
                    case RemoteApi.Camera.Orientation.Right:
                        return 90;
                    case RemoteApi.Camera.Orientation.Left:
                        return 270;
                    case RemoteApi.Camera.Orientation.Opposite:
                        return 180;
                }
                return 0;
            }
        }

        private List<string> _PictureUrls;
        public List<string> PictureUrls
        {
            set
            {
                _PictureUrls = value;
                // NotifyChangedOnUI("PictureUrls");
                // This logic should not be implemented here in DataModel...
                if (value != null && ApplicationSettings.GetInstance().IsPostviewTransferEnabled)
                {
                    foreach (var url in value)
                    {
                        try
                        {
                            MediaDownloader.Instance.EnqueuePostViewImage(new Uri(url, UriKind.Absolute), GeopositionManager.INSTANCE.LatestPosition);
                        }
                        catch (Exception e)
                        {
                            DebugUtil.Log(e.StackTrace);
                        }
                    }
                }
            }
        }

        private bool _ProgramShiftActivated = false;
        public bool ProgramShiftActivated
        {
            set
            {
                if (_ProgramShiftActivated != value)
                {
                    _ProgramShiftActivated = value;
                    NotifyChangedOnUI("ProgramShiftActivated");
                }
            }
            get { return _ProgramShiftActivated; }
        }

        private ProgramShiftRange _ProgramShiftRange;
        public ProgramShiftRange ProgramShiftRange
        {
            set
            {
                _ProgramShiftRange = value;
                NotifyChangedOnUI("ProgramShiftRange");
            }
            get
            {
                return _ProgramShiftRange;
            }
        }

        private string _FocusStatus;
        public string FocusStatus
        {
            set
            {
                if (_FocusStatus != value)
                {
                    _FocusStatus = value;
                    NotifyChangedOnUI("FocusStatus");
                }
            }
            get { return _FocusStatus; }
        }

        private bool _IsLiveviewAvailable = false;
        public bool IsLiveviewAvailable
        {
            set
            {
                if (_IsLiveviewAvailable != value)
                {
                    _IsLiveviewAvailable = value;
                    NotifyChangedOnUI("IsLiveviewAvailable");
                }
            }
            get
            {
                return _IsLiveviewAvailable;
            }
        }

        private bool _IsFocusFrameInfoAvailable = false;
        public bool IsLiveviewFrameInfoAvailable
        {
            set
            {
                if (_IsFocusFrameInfoAvailable != value)
                {
                    _IsFocusFrameInfoAvailable = value;
                    NotifyChangedOnUI("IsFocusFrameInfoAvailable");
                }
            }
            get
            {
                return _IsFocusFrameInfoAvailable;
            }
        }

        public AutoFocusType AfType { get; set; }

        private Capability<string> _ZoomSetting;
        public Capability<string> ZoomSetting
        {
            set
            {
                _ZoomSetting = value;
                NotifyChangedOnUI("ZoomSetting");
            }
            get { return _ZoomSetting; }
        }

        private Capability<string> _StillQuality;
        public Capability<string> StillQuality
        {
            set
            {
                _StillQuality = value;
                NotifyChangedOnUI("StillQuality");
            }
            get { return _StillQuality; }
        }

        private Capability<string> _ContShootingMode;
        public Capability<string> ContShootingMode
        {
            set
            {
                _ContShootingMode = value;
                NotifyChangedOnUI("ContShootingMode");
            }
            get { return _ContShootingMode; }
        }

        private Capability<string> _ContShootingSpeed;
        public Capability<string> ContShootingSpeed
        {
            set
            {
                _ContShootingSpeed = value;
                NotifyChangedOnUI("ContShootingSpeed");
            }
            get { return _ContShootingSpeed; }
        }

        private List<ContShootingResult> _ContShootingResult;
        public List<ContShootingResult> ContShootingResult
        {
            set
            {
                _ContShootingResult = value;
                NotifyChangedOnUI("ContShootingResult");
            }
            get { return _ContShootingResult; }
        }

        private Capability<string> _FlipMode;
        public Capability<string> FlipMode
        {
            set
            {
                _FlipMode = value;
                NotifyChangedOnUI("FlipMode");
            }
            get { return _FlipMode; }
        }

        private Capability<string> _SceneSelection;
        public Capability<string> SceneSelection
        {
            set
            {
                _SceneSelection = value;
                NotifyChangedOnUI("SceneSelection");
            }
            get { return _SceneSelection; }
        }

        private Capability<string> _IntervalTime;
        public Capability<string> IntervalTime
        {
            set
            {
                _IntervalTime = value;
                NotifyChangedOnUI("IntervalTime");
            }
            get { return _IntervalTime; }
        }

        private Capability<string> _ColorSetting;
        public Capability<string> ColorSetting
        {
            set
            {
                _ColorSetting = value;
                NotifyChangedOnUI("ColorSetting");
            }
            get { return _ColorSetting; }
        }

        private Capability<string> _MovieFileFormat;
        public Capability<string> MovieFileFormat
        {
            set
            {
                _MovieFileFormat = value;
                NotifyChangedOnUI("MovieFileFormat");
            }
            get { return _MovieFileFormat; }
        }

        private Capability<string> _InfraredRemoteControl;
        public Capability<string> InfraredRemoteControl
        {
            set
            {
                _InfraredRemoteControl = value;
                NotifyChangedOnUI("InfraredRemoteControl");
            }
            get { return _InfraredRemoteControl; }
        }

        private Capability<string> _TvColorSystem;
        public Capability<string> TvColorSystem
        {
            set
            {
                _TvColorSystem = value;
                NotifyChangedOnUI("TvColorSystem");
            }
            get { return _TvColorSystem; }
        }

        private string _TrackingFocusStatus;
        public string TrackingFocusStatus
        {
            set
            {
                if (_TrackingFocusStatus != value)
                {
                    _TrackingFocusStatus = value;
                    NotifyChangedOnUI("TrackingFocusStatus");
                }
            }
            get { return _TrackingFocusStatus; }
        }

        private Capability<string> _TrackingFocus;
        public Capability<string> TrackingFocus
        {
            set
            {
                _TrackingFocus = value;
                NotifyChangedOnUI("TrackingFocus");
            }
            get { return _TrackingFocus; }
        }

        private List<BatteryInfo> _BatteryInfo;
        public List<BatteryInfo> BatteryInfo
        {
            set
            {
                _BatteryInfo = value;
                NotifyChangedOnUI("BatteryInfo");
            }
            get { return _BatteryInfo; }
        }

        private int _RecordingTimeSec = -1;
        public int RecordingTimeSec
        {
            set
            {
                if (_RecordingTimeSec != value)
                {
                    _RecordingTimeSec = value;
                    NotifyChangedOnUI("RecordingTimeSec");
                }
            }
            get { return _RecordingTimeSec; }
        }

        private int _NumberOfShots = -1;
        public int NumberOfShots
        {
            set
            {
                if (_NumberOfShots != value)
                {
                    _NumberOfShots = value;
                    NotifyChangedOnUI("NumberOfShots");
                }
            }
            get { return _NumberOfShots; }
        }

        private Capability<int> _AutoPowerOff;
        public Capability<int> AutoPowerOff
        {
            set
            {
                _AutoPowerOff = value;
                NotifyChangedOnUI("AutoPowerOff");
            }
            get { return _AutoPowerOff; }
        }

        private Capability<string> _LoopRecTime;
        public Capability<string> LoopRecTime
        {
            set
            {
                _LoopRecTime = value;
                NotifyChangedOnUI("LoopRecTime");
            }
            get { return _LoopRecTime; }
        }

        private Capability<string> _WindNoiseReduction;
        public Capability<string> WindNoiseReduction
        {
            set
            {
                _WindNoiseReduction = value;
                NotifyChangedOnUI("WindNoiseReduction");
            }
            get { return _WindNoiseReduction; }
        }

        private Capability<string> _AudioRecording;
        public Capability<string> AudioRecording
        {
            set
            {
                _AudioRecording = value;
                NotifyChangedOnUI("AudioRecording");
            }
            get { return _AudioRecording; }
        }
    }

    public enum AutoFocusType
    {
        None,
        HalfPress,
        Touch,
    }
}


text:
static MSpan *MHeap_AllocLocked(MHeap*, uintptr, int32);
static bool MHeap_Grow(MHeap*, uintptr);
static void MHeap_FreeLocked(MHeap*, MSpan*);
static MSpan *MHeap_AllocLarge(MHeap*, uintptr);
static MSpan *BestFit(MSpan*, uintptr, MSpan*);

static void
RecordSpan(void *vh, byte *p)
{
	MHeap *h;
	MSpan *s;

	h = vh;
	s = (MSpan*)p;
	s->allnext = h->allspans;
	h->allspans = s;
}

// Initialize the heap; fetch memory using alloc.
void
runtime·MHeap_Init(MHeap *h, void *(*alloc)(uintptr))
{
	uint32 i;

	runtime·FixAlloc_Init(&h->spanalloc, sizeof(MSpan), alloc, RecordSpan, h);
	runtime·FixAlloc_Init(&h->cachealloc, sizeof(MCache), alloc, nil, nil);
	// h->mapcache needs no init
	for(i=0; i<nelem(h->free); i++)
		runtime·MSpanList_Init(&h->free[i]);
	runtime·MSpanList_Init(&h->large);
	for(i=0; i<nelem(h->central); i++)
		runtime·MCentral_Init(&h->central[i], i);
}

// Allocate a new span of npage pages from the heap
// and record its size class in the HeapMap and HeapMapCache.
MSpan*
runtime·MHeap_Alloc(MHeap *h, uintptr npage, int32 sizeclass, int32 acct)
{
	MSpan *s;

	runtime·lock(h);
	runtime·purgecachedstats(m);
	s = MHeap_AllocLocked(h, npage, sizeclass);
	if(s != nil) {
		mstats.heap_inuse += npage<<PageShift;
		if(acct) {
			mstats.heap_objects++;
			mstats.heap_alloc += npage<<PageShift;
		}
	}
	runtime·unlock(h);
	return s;
}

static MSpan*
MHeap_AllocLocked(MHeap *h, uintptr npage, int32 sizeclass)
{
	uintptr n;
	MSpan *s, *t;
	PageID p;

	// Try in fixed-size lists up to max.
	for(n=npage; n < nelem(h->free); n++) {
		if(!runtime·MSpanList_IsEmpty(&h->free[n])) {
			s = h->free[n].next;
			goto HaveSpan;
		}
	}

	// Best fit in list of large spans.
	if((s = MHeap_AllocLarge(h, npage)) == nil) {
		if(!MHeap_Grow(h, npage))
			return nil;
		if((s = MHeap_AllocLarge(h, npage)) == nil)
			return nil;
	}

HaveSpan:
	// Mark span in use.
	if(s->state != MSpanFree)
		runtime·throw("MHeap_AllocLocked - MSpan not free");
	if(s->npages < npage)
		runtime·throw("MHeap_AllocLocked - bad npages");
	runtime·MSpanList_Remove(s);
	s->state = MSpanInUse;

	if(s->npages > npage) {
		// Trim extra and put it back in the heap.
		t = runtime·FixAlloc_Alloc(&h->spanalloc);
		mstats.mspan_inuse = h->spanalloc.inuse;
		mstats.mspan_sys = h->spanalloc.sys;
		runtime·MSpan_Init(t, s->start + npage, s->npages - npage);
		s->npages = npage;
		p = t->start;
		if(sizeof(void*) == 8)
			p -= ((uintptr)h->arena_start>>PageShift);
		if(p > 0)
			h->map[p-1] = s;
		h->map[p] = t;
		h->map[p+t->npages-1] = t;
		*(uintptr*)(t->start<<PageShift) = *(uintptr*)(s->start<<PageShift);  // copy "needs zeroing" mark
		t->state = MSpanInUse;
		MHeap_FreeLocked(h, t);
	}

	if(*(uintptr*)(s->start<<PageShift) != 0)
		runtime·memclr((byte*)(s->start<<PageShift), s->npages<<PageShift);

	// Record span info, because gc needs to be
	// able to map interior pointer to containing span.
	s->sizeclass = sizeclass;
	p = s->start;
	if(sizeof(void*) == 8)
		p -= ((uintptr)h->arena_start>>PageShift);
	for(n=0; n<npage; n++)
		h->map[p+n] = s;
	return s;
}

// Allocate a span of exactly npage pages from the list of large spans.
static MSpan*
MHeap_AllocLarge(MHeap *h, uintptr npage)
{
	return BestFit(&h->large, npage, nil);
}

// Search list for smallest span with >= npage pages.
// If there are multiple smallest spans, take the one
// with the earliest starting address.
static MSpan*
BestFit(MSpan *list, uintptr npage, MSpan *best)
{
	MSpan *s;

	for(s=list->next; s != list; s=s->next) {
		if(s->npages < npage)
			continue;
		if(best == nil
		|| s->npages < best->npages
		|| (s->npages == best->npages && s->start < best->start))
			best = s;
	}
	return best;
}

// Try to add at least npage pages of memory to the heap,
// returning whether it worked.
static bool
MHeap_Grow(MHeap *h, uintptr npage)
{
	uintptr ask;
	void *v;
	MSpan *s;
	PageID p;

	// Ask for a big chunk, to reduce the number of mappings
	// the operating system needs to track; also amortizes
	// the overhead of an operating system mapping.
	// Allocate a multiple of 64kB (16 pages).
	npage = (npage+15)&~15;
	ask = npage<<PageShift;
	if(ask < HeapAllocChunk)
		ask = HeapAllocChunk;

	v = runtime·MHeap_SysAlloc(h, ask);
	if(v == nil) {
		if(ask > (npage<<PageShift)) {
			ask = npage<<PageShift;
			v = runtime·MHeap_SysAlloc(h, ask);
		}
		if(v == nil) {
			runtime·printf("runtime: out of memory: cannot allocate %D-byte block (%D in use)\n", (uint64)ask, mstats.heap_sys);
			return false;
		}
	}
	mstats.heap_sys += ask;

	// Create a fake "in use" span and free it, so that the
	// right coalescing happens.
	s = runtime·FixAlloc_Alloc(&h->spanalloc);
	mstats.mspan_inuse = h->spanalloc.inuse;
	mstats.mspan_sys = h->spanalloc.sys;
	runtime·MSpan_Init(s, (uintptr)v>>PageShift, ask>>PageShift);
	p = s->start;
	if(sizeof(void*) == 8)
		p -= ((uintptr)h->arena_start>>PageShift);
	h->map[p] = s;
	h->map[p + s->npages - 1] = s;
	s->state = MSpanInUse;
	MHeap_FreeLocked(h, s);
	return true;
}

// Look up the span at the given address.
// Address is guaranteed to be in map
// and is guaranteed to be start or end of span.
MSpan*
runtime·MHeap_Lookup(MHeap *h, void *v)
{
	uintptr p;

	p = (uintptr)v;
	if(sizeof(void*) == 8)
		p -= (uintptr)h->arena_start;
	return h->map[p >> PageShift];
}

// Look up the span at the given address.
// Address is *not* guaranteed to be in map
// and may be anywhere in the span.
// Map entries for the middle of a span are only
// valid for allocated spans.  Free spans may have
// other garbage in their middles, so we have to
// check for that.
MSpan*
runtime·MHeap_LookupMaybe(MHeap *h, void *v)
{
	MSpan *s;
	PageID p, q;

	if((byte*)v < h->arena_start || (byte*)v >= h->arena_used)
		return nil;
	p = (uintptr)v>>PageShift;
	q = p;
	if(sizeof(void*) == 8)
		q -= (uintptr)h->arena_start >> PageShift;
	s = h->map[q];
	if(s == nil || p < s->start || p - s->start >= s->npages)
		return nil;
	if(s->state != MSpanInUse)
		return nil;
	return s;
}

// Free the span back into the heap.
void
runtime·MHeap_Free(MHeap *h, MSpan *s, int32 acct)
{
	runtime·lock(h);
	runtime·purgecachedstats(m);
	mstats.heap_inuse -= s->npages<<PageShift;
	if(acct) {
		mstats.heap_alloc -= s->npages<<PageShift;
		mstats.heap_objects--;
	}
	MHeap_FreeLocked(h, s);
	runtime·unlock(h);
}

static void
MHeap_FreeLocked(MHeap *h, MSpan *s)
{
	uintptr *sp, *tp;
	MSpan *t;
	PageID p;

	if(s->state != MSpanInUse || s->ref != 0) {
		runtime·printf("MHeap_FreeLocked - span %p ptr %p state %d ref %d\n", s, s->start<<PageShift, s->state, s->ref);
		runtime·throw("MHeap_FreeLocked - invalid free");
	}
	s->state = MSpanFree;
	runtime·MSpanList_Remove(s);
	sp = (uintptr*)(s->start<<PageShift);

	// Coalesce with earlier, later spans.
	p = s->start;
	if(sizeof(void*) == 8)
		p -= (uintptr)h->arena_start >> PageShift;
	if(p > 0 && (t = h->map[p-1]) != nil && t->state != MSpanInUse) {
		tp = (uintptr*)(t->start<<PageShift);
		*tp |= *sp;	// propagate "needs zeroing" mark
		s->start = t->start;
		s->npages += t->npages;
		p -= t->npages;
		h->map[p] = s;
		runtime·MSpanList_Remove(t);
		t->state = MSpanDead;
		runtime·FixAlloc_Free(&h->spanalloc, t);
		mstats.mspan_inuse = h->spanalloc.inuse;
		mstats.mspan_sys = h->spanalloc.sys;
	}
	if(p+s->npages < nelem(h->map) && (t = h->map[p+s->npages]) != nil && t->state != MSpanInUse) {
		tp = (uintptr*)(t->start<<PageShift);
		*sp |= *tp;	// propagate "needs zeroing" mark
		s->npages += t->npages;
		h->map[p + s->npages - 1] = s;
		runtime·MSpanList_Remove(t);
		t->state = MSpanDead;
		runtime·FixAlloc_Free(&h->spanalloc, t);
		mstats.mspan_inuse = h->spanalloc.inuse;
		mstats.mspan_sys = h->spanalloc.sys;
	}

	// Insert s into appropriate list.
	if(s->npages < nelem(h->free))
		runtime·MSpanList_Insert(&h->free[s->npages], s);
	else
		runtime·MSpanList_Insert(&h->large, s);

	// TODO(rsc): IncrementalScavenge() to return memory to OS.
}

// Initialize a new span with the given start and npages.
void
runtime·MSpan_Init(MSpan *span, PageID start, uintptr npages)
{
	span->next = nil;
	span->prev = nil;
	span->start = start;
	span->npages = npages;
	span->freelist = nil;
	span->ref = 0;
	span->sizeclass = 0;
	span->state = 0;
}

// Initialize an empty doubly-linked list.
void
runtime·MSpanList_Init(MSpan *list)
{
	list->state = MSpanListHead;
	list->next = list;
	list->prev = list;
}

void
runtime·MSpanList_Remove(MSpan *span)
{
	if(span->prev == nil && span->next == nil)
		return;
	span->prev->next = span->next;
	span->next->prev = span->prev;
	span->prev = nil;
	span->next = nil;
}

bool
runtime·MSpanList_IsEmpty(MSpan *list)
{
	return list->next == list;
}

void
runtime·MSpanList_Insert(MSpan *list, MSpan *span)
{
	if(span->next != nil || span->prev != nil) {
		runtime·printf("failed MSpanList_Insert %p %p %p\n", span, span->next, span->prev);
		runtime·throw("MSpanList_Insert");
	}
	span->next = list->next;
	span->prev = list;
	span->next->prev = span;
	span->prev->next = span;
}


text:
<?php

class Vtiger_FindDuplicates_View extends Vtiger_List_View {

	function preProcess(Vtiger_Request $request, $display = true) {
		$viewer = $this->getViewer ($request);
		$this->initializeListViewContents($request, $viewer);
		parent::preProcess($request, $display);
	}

	public function preProcessTplName(Vtiger_Request $request) {
		return 'FindDuplicatePreProcess.tpl';
	}

	function process (Vtiger_Request $request) {
		$viewer = $this->getViewer ($request);
		$moduleName = $request->getModule();
		$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
		$this->initializeListViewContents($request, $viewer);

		$viewer->assign('VIEW', $request->get('view'));
		$viewer->assign('MODULE_MODEL', $moduleModel);
		$viewer->assign('CURRENT_USER_MODEL', Users_Record_Model::getCurrentUserModel());
		$viewer->view('FindDuplicateContents.tpl', $moduleName);
	}

	/**
	 * Function to get the list of Script models to be included
	 * @param Vtiger_Request $request
	 * @return <Array> - List of Vtiger_JsScript_Model instances
	 */
	function getHeaderScripts(Vtiger_Request $request) {
		$headerScriptInstances = parent::getHeaderScripts($request);
		$moduleName = $request->getModule();

		$jsFileNames = array(
			'modules.Vtiger.resources.List',
			'modules.Vtiger.resources.FindDuplicates',
		);

		$jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames);
		$headerScriptInstances = array_merge($headerScriptInstances, $jsScriptInstances);
		return $headerScriptInstances;
	}

	/*
	 * Function to initialize the required data in smarty to display the List View Contents
	 */
	public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewer $viewer) {
		$currentUser = vglobal('current_user');
		$viewer = $this->getViewer ($request);
		$module = $request->getModule();
		$moduleModel = Vtiger_Module_Model::getInstance($module);

		$massActionLink = array(
			'linktype' => 'LISTVIEWBASIC',
			'linklabel' => 'LBL_DELETE',
			'linkurl' => 'Javascript:Vtiger_FindDuplicates_Js.massDeleteRecords("index.php?module='.$module.'&action=MassDelete");',
			'linkicon' => ''
		);
		$massActionLinks[] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);
		$viewer->assign('LISTVIEW_LINKS', $massActionLinks);
		$viewer->assign('MODULE_MODEL', $moduleModel);

		$pageNumber = $request->get('page');
		if(empty($pageNumber)){
			$pageNumber = '1';
		}
		$pagingModel = new Vtiger_Paging_Model();
		$pagingModel->set('page', $pageNumber);
		$pageLimit = $pagingModel->getPageLimit();

		$duplicateSearchFields = $request->get('fields');
		$dataModelInstance = Vtiger_FindDuplicate_Model::getInstance($module);
		$dataModelInstance->set('fields', $duplicateSearchFields);

		$ignoreEmpty = $request->get('ignoreEmpty');
		$ignoreEmptyValue = false;
		if($ignoreEmpty == 'on' || $ignoreEmpty == 'true' || $ignoreEmpty == '1') $ignoreEmptyValue = true;
		$dataModelInstance->set('ignoreEmpty', $ignoreEmptyValue);

		if(!$this->listViewEntries) {
			$this->listViewEntries = $dataModelInstance->getListViewEntries($pagingModel);
		}

		if(!$this->listViewHeaders){
			$this->listViewHeaders = $dataModelInstance->getListViewHeaders();
		}
		if(!$this->rows) {
			$this->rows = $dataModelInstance->getRecordCount();
			$viewer->assign('TOTAL_COUNT', $this->rows);
		}

		$rowCount = 0;
		foreach($this->listViewEntries as $group) {
			foreach($group as $row) {
				$rowCount++;
			}
		}
		//for calculating the page range
		for($i=0; $i<$rowCount; $i++) $dummyListEntries[] = $i;
		$pagingModel->calculatePageRange($dummyListEntries);

		$viewer->assign('IGNORE_EMPTY', $ignoreEmpty);
		$viewer->assign('LISTVIEW_ENTRIES_COUNT', $rowCount);
		$viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);
		$viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);
		$viewer->assign('PAGING_MODEL', $pagingModel);
		$viewer->assign('PAGE_NUMBER',$pageNumber);
		$viewer->assign('MODULE', $module);
		$viewer->assign('DUPLICATE_SEARCH_FIELDS', $duplicateSearchFields);

		$customViewModel = CustomView_Record_Model::getAllFilterByModule($module);
		$viewer->assign('VIEW_NAME', $customViewModel->getId());
	}

	/**
	 * Function returns the number of records for the current filter
	 * @param Vtiger_Request $request
	 */
	function getRecordsCount(Vtiger_Request $request) {
		$moduleName = $request->getModule();
		$duplicateSearchFields = $request->get('fields');
		$dataModelInstance = Vtiger_FindDuplicate_Model::getInstance($moduleName);

		$ignoreEmpty = $request->get('ignoreEmpty');
		$ignoreEmptyValue = false;
		if($ignoreEmpty == 'on' || $ignoreEmpty == 'true' || $ignoreEmpty == '1') $ignoreEmptyValue = true;
		$dataModelInstance->set('ignoreEmpty', $ignoreEmptyValue);

		$dataModelInstance->set('fields', $duplicateSearchFields);
		$count = $dataModelInstance->getRecordCount();

		$result = array();
		$result['module'] = $moduleName;
		$result['count'] = $count;

		$response = new Vtiger_Response();
		$response->setEmitType(Vtiger_Response::$EMIT_JSON);
		$response->setResult($result);
		$response->emit();
	}
}


text:
/*
Necklace of circles
Problem 428

Let a, b and c be positive numbers.
Let W, X, Y, Z be four collinear points where |WX| = a, |XY| = b, |YZ| = c and |WZ| = a + b + c.
Let Cin be the circle having the diameter XY.
Let Cout be the circle having the diameter WZ.

The triplet (a, b, c) is called a necklace triplet if you can place k  3 distinct circles C1, C2, ..., Ck such that:

Ci has no common interior points with any Cj for 1  i, j  k and i  j,
Ci is tangent to both Cin and Cout for 1  i  k,
Ci is tangent to Ci+1 for 1  i < k, and
Ck is tangent to C1.

For example, (5, 5, 5) and (4, 3, 21) are necklace triplets, while it can be shown that (2, 2, 5) is not.

Let T(n) be the number of necklace triplets (a, b, c) such that a, b and c are positive integers, and b  n.
For example, T(1) = 9, T(20) = 732 and T(3000) = 438106.

Find T(1 000 000 000).

*/


text:
The static-positioned text should be underlined.

The relative-positioned text should be underlined.

The floating-positioned text should NOT be underlined.

The absolutely-positioned text should NOT be underlined.

The fixed-positioned text should NOT be underlined.


text:
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// No appearance at all.
#define NS_THEME_NONE                                      0

// A typical dialog button.
#define NS_THEME_BUTTON                                    1

// A radio element within a radio group.
#define NS_THEME_RADIO                                     2

// A checkbox element.
#define NS_THEME_CHECKBOX                                  3

// A rectangular button that contains complex content
// like images (e.g. HTML <button> elements)
#define NS_THEME_BUTTON_BEVEL                              7

// A themed focus outline (for outline:auto)
#define NS_THEME_FOCUS_OUTLINE                             8

// The toolbox that contains the toolbars.
#define NS_THEME_TOOLBOX                                   11

// A toolbar in an application window.
#define NS_THEME_TOOLBAR                                   12

// A single toolbar button (with no associated dropdown)
#define NS_THEME_TOOLBAR_BUTTON                            13

// A dual toolbar button (e.g., a Back button with a dropdown)
#define NS_THEME_TOOLBAR_DUAL_BUTTON                       14

// The dropdown portion of a toolbar button
#define NS_THEME_TOOLBAR_BUTTON_DROPDOWN                   15

// Various arrows that go in buttons
#define NS_THEME_BUTTON_ARROW_UP                           16
#define NS_THEME_BUTTON_ARROW_DOWN                         17
#define NS_THEME_BUTTON_ARROW_NEXT                         18
#define NS_THEME_BUTTON_ARROW_PREVIOUS                     19

// A separator.  Can be horizontal or vertical.
#define NS_THEME_TOOLBAR_SEPARATOR                         20

// The gripper for a toolbar.
#define NS_THEME_TOOLBAR_GRIPPER                           21

// A splitter.  Can be horizontal or vertical.
#define NS_THEME_SPLITTER                                  22

// A status bar in a main application window.
#define NS_THEME_STATUSBAR                                 23

// A single pane of a status bar.
#define NS_THEME_STATUSBAR_PANEL                           24

// The resizer background area in a status bar
// for the resizer widget in the corner of a window.
#define NS_THEME_STATUSBAR_RESIZER_PANEL                   25

// The resizer itself.
#define NS_THEME_RESIZER                                   26

// List boxes
#define NS_THEME_LISTBOX                                   31

// A listbox item
#define NS_THEME_LISTBOX_LISTITEM                          32

// A tree widget
#define NS_THEME_TREEVIEW                                  41

// A tree item
#define NS_THEME_TREEVIEW_TREEITEM                         42

// A tree widget twisty
#define NS_THEME_TREEVIEW_TWISTY                           43

// A tree widget branch line
#define NS_THEME_TREEVIEW_LINE                             44

// A listbox or tree widget header
#define NS_THEME_TREEVIEW_HEADER                           45

// An individual header cell
#define NS_THEME_TREEVIEW_HEADER_CELL                      46

// The sort arrow for a header.
#define NS_THEME_TREEVIEW_HEADER_SORTARROW                 47

// Open tree widget twisty
#define NS_THEME_TREEVIEW_TWISTY_OPEN                      48

// A horizontal progress bar.
#define NS_THEME_PROGRESSBAR                               51

// The progress bar's progress indicator
#define NS_THEME_PROGRESSBAR_CHUNK                         52

// A vertical progress bar.
#define NS_THEME_PROGRESSBAR_VERTICAL                      53

// A vertical progress chunk
#define NS_THEME_PROGRESSBAR_CHUNK_VERTICAL                54

// A horizontal meter bar.
#define NS_THEME_METERBAR                                  55

// The meter bar's meter indicator
#define NS_THEME_METERBAR_CHUNK                            56

// A single tab in a tab widget.
#define NS_THEME_TAB                                       61

// A single pane (inside the tabpanels container)
#define NS_THEME_TAB_PANEL                                 62

// The tab panels container.
#define NS_THEME_TAB_PANELS                                65

// The tabs scroll arrows (left/right)
#define NS_THEME_TAB_SCROLLARROW_BACK                      66
#define NS_THEME_TAB_SCROLLARROW_FORWARD                   67

// A tooltip
#define NS_THEME_TOOLTIP                                   71

// A spin control (up/down control for time/date pickers)
#define NS_THEME_SPINNER                                   72

// The up button of a spin control
#define NS_THEME_SPINNER_UP_BUTTON                         73

// The down button of a spin control
#define NS_THEME_SPINNER_DOWN_BUTTON                       74

// The textfield of a spin control
#define NS_THEME_SPINNER_TEXTFIELD                         75

// For HTML's <input type=number>
#define NS_THEME_NUMBER_INPUT                              76

// A scrollbar.
#define NS_THEME_SCROLLBAR                                 80

// A small scrollbar.
#define NS_THEME_SCROLLBAR_SMALL                           81

// A scrollbar button (up/down/left/right)
#define NS_THEME_SCROLLBAR_BUTTON_UP                       82
#define NS_THEME_SCROLLBAR_BUTTON_DOWN                     83
#define NS_THEME_SCROLLBAR_BUTTON_LEFT                     84
#define NS_THEME_SCROLLBAR_BUTTON_RIGHT                    85

// The scrollbar track
#define NS_THEME_SCROLLBAR_TRACK_HORIZONTAL                86
#define NS_THEME_SCROLLBAR_TRACK_VERTICAL                  87

// The scrollbar thumb
#define NS_THEME_SCROLLBAR_THUMB_HORIZONTAL                88
#define NS_THEME_SCROLLBAR_THUMB_VERTICAL                  89

// A non-disappearing scrollbar.
#define NS_THEME_SCROLLBAR_NON_DISAPPEARING                90

// A textfield or text area
#define NS_THEME_TEXTFIELD                                 95

// The caret of a text area
#define NS_THEME_TEXTFIELD_CARET                           96

// A multiline text field
#define NS_THEME_TEXTFIELD_MULTILINE                       97

// A searchfield
#define NS_THEME_SEARCHFIELD                               98

// A dropdown list.
#define NS_THEME_DROPDOWN                                  101

// The dropdown button(s) that open up a dropdown list.
#define NS_THEME_DROPDOWN_BUTTON                           102

// The text part of a dropdown list, to left of button
#define NS_THEME_DROPDOWN_TEXT                             103

// An editable textfield with a dropdown list (a combobox)
#define NS_THEME_DROPDOWN_TEXTFIELD                        104

// A slider
#define NS_THEME_SCALE_HORIZONTAL                         111
#define NS_THEME_SCALE_VERTICAL                           112

// A slider's thumb
#define NS_THEME_SCALE_THUMB_HORIZONTAL                   113
#define NS_THEME_SCALE_THUMB_VERTICAL                     114

// If the platform supports it, the left/right chunks
// of the slider thumb
#define NS_THEME_SCALE_THUMB_START                        115
#define NS_THEME_SCALE_THUMB_END                          116

// The ticks for a slider.
#define NS_THEME_SCALE_TICK                               117

// nsRangeFrame and its subparts
#define NS_THEME_RANGE                                    120
#define NS_THEME_RANGE_THUMB                              121

// A groupbox
#define NS_THEME_GROUPBOX                                  149

// A generic container that always repaints on state
// changes.  This is a hack to make checkboxes and
// radio buttons work.
#define NS_THEME_CHECKBOX_CONTAINER                        150
#define NS_THEME_RADIO_CONTAINER                           151

// The label part of a checkbox or radio button, used for painting
// a focus outline.
#define NS_THEME_CHECKBOX_LABEL                            152
#define NS_THEME_RADIO_LABEL                               153

// The focus outline box inside of a button
#define NS_THEME_BUTTON_FOCUS                              154

// Window and dialog backgrounds
#define NS_THEME_WINDOW                                    200
#define NS_THEME_DIALOG                                    201

// Menu Bar background
#define NS_THEME_MENUBAR                                   210
// Menu Popup background
#define NS_THEME_MENUPOPUP                                 211
// <menu> and <menuitem> appearances
#define NS_THEME_MENUITEM                                  212
#define NS_THEME_CHECKMENUITEM                             213
#define NS_THEME_RADIOMENUITEM                             214

// menu checkbox/radio appearances
#define NS_THEME_MENUCHECKBOX                              215
#define NS_THEME_MENURADIO                                 216
#define NS_THEME_MENUSEPARATOR                             217
#define NS_THEME_MENUARROW                                 218
// An image in the menu gutter, like in bookmarks or history
#define NS_THEME_MENUIMAGE                                 219
// For text on non-iconic menuitems only
#define NS_THEME_MENUITEMTEXT                              220

// Vista Rebars
#define NS_THEME_WIN_COMMUNICATIONS_TOOLBOX                221
#define NS_THEME_WIN_MEDIA_TOOLBOX                         222
#define NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX               223

// Unified toolbar and titlebar elements on the Mac
#define NS_THEME_MOZ_MAC_UNIFIED_TOOLBAR                   224
#define NS_THEME_MOZ_MAC_FULLSCREEN_BUTTON                 226

// Mac help button
#define NS_THEME_MOZ_MAC_HELP_BUTTON                       227

// Vista glass
#define NS_THEME_WIN_BORDERLESS_GLASS                      229
#define NS_THEME_WIN_GLASS                                 230

// Windows themed window frame elements
#define NS_THEME_WINDOW_TITLEBAR                           231
#define NS_THEME_WINDOW_TITLEBAR_MAXIMIZED                 232
#define NS_THEME_WINDOW_FRAME_LEFT                         233
#define NS_THEME_WINDOW_FRAME_RIGHT                        234
#define NS_THEME_WINDOW_FRAME_BOTTOM                       235
#define NS_THEME_WINDOW_BUTTON_CLOSE                       236
#define NS_THEME_WINDOW_BUTTON_MINIMIZE                    237
#define NS_THEME_WINDOW_BUTTON_MAXIMIZE                    238
#define NS_THEME_WINDOW_BUTTON_RESTORE                     239
#define NS_THEME_WINDOW_BUTTON_BOX                         240
#define NS_THEME_WINDOW_BUTTON_BOX_MAXIMIZED               241

// moz-apperance style used in setting proper glass margins
#define NS_THEME_WIN_EXCLUDE_GLASS                         242

#define NS_THEME_MAC_VIBRANCY_LIGHT                        243
#define NS_THEME_MAC_VIBRANCY_DARK                         244
#define NS_THEME_MAC_DISCLOSURE_BUTTON_OPEN                245
#define NS_THEME_MAC_DISCLOSURE_BUTTON_CLOSED              246


text:
FactoryGirl.define do
  factory :user do
    nick_name "MyString"
    first_name "MyString"
    last_name "MyString"
    phone_number "MyString"
    birthday "2014-04-01 13:31:22"
    email "MyString"
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Xml;
using System.Data;
using System.Web.Configuration;
using System.Configuration;

namespace PatanHospital
{
    public partial class PatientProfile : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = Session["Patient_Email"].ToString();
            Label1.Visible = false;
            Load_Data();

        }

        protected void Load_Data()
        {
            Configuration rootWebConfig = WebConfigurationManager.OpenWebConfiguration("/HospitalServer");
            ConnectionStringSettings connectionString = rootWebConfig.ConnectionStrings.ConnectionStrings["HospitalServerConnectionString"];
            SqlConnection sqlConnection = new SqlConnection(connectionString.ToString());
            sqlConnection.Open();

            SqlCommand cmd = new SqlCommand("Select Fname+' '+Lname as Name,SSN, Gender, Address1, Address2, City, State, ZipCode, Phone, Email from PatientCredientials where email = '" + this.Session["Patient_Email"].ToString() + "';", sqlConnection);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.Fill(ds, "PatientCredientials");
            sqlConnection.Close();

            Label2.Text = ds.Tables["PatientCredientials"].Rows[0]["Name"].ToString();
            Label3.Text = ds.Tables["PatientCredientials"].Rows[0]["SSN"].ToString();
            Label4.Text = ds.Tables["PatientCredientials"].Rows[0]["Gender"].ToString();
            Label5.Text = ds.Tables["PatientCredientials"].Rows[0]["Address1"].ToString();
            Label6.Text = ds.Tables["PatientCredientials"].Rows[0]["Address2"].ToString();
            Label7.Text = ds.Tables["PatientCredientials"].Rows[0]["City"].ToString();
            Label8.Text = ds.Tables["PatientCredientials"].Rows[0]["State"].ToString();
            Label9.Text = ds.Tables["PatientCredientials"].Rows[0]["ZipCode"].ToString();
            Label10.Text = ds.Tables["PatientCredientials"].Rows[0]["Phone"].ToString();
            Label11.Text = ds.Tables["PatientCredientials"].Rows[0]["email"].ToString();

        }

        protected void Logo_Click(object sender, EventArgs e)
        {
            Response.Redirect("PatientHome.aspx");
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("PatientHome.aspx");
        }
    }
}


text:
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package tests

import (
	"bytes"
	"fmt"
	"io"
	"math/big"
	"strconv"
	"testing"

	"github.com/lab2528/go-oneTime/common"
	"github.com/lab2528/go-oneTime/common/math"
	"github.com/lab2528/go-oneTime/core/state"
	"github.com/lab2528/go-oneTime/core/types"
	"github.com/lab2528/go-oneTime/core/vm"
	"github.com/lab2528/go-oneTime/ethdb"
	"github.com/lab2528/go-oneTime/log"
	"github.com/lab2528/go-oneTime/params"
)

func RunVmTestWithReader(r io.Reader, skipTests []string) error {
	tests := make(map[string]VmTest)
	err := readJson(r, &tests)
	if err != nil {
		return err
	}

	if err != nil {
		return err
	}

	if err := runVmTests(tests, skipTests); err != nil {
		return err
	}

	return nil
}

type bconf struct {
	name    string
	precomp bool
	jit     bool
}

func BenchVmTest(p string, conf bconf, b *testing.B) error {
	tests := make(map[string]VmTest)
	err := readJsonFile(p, &tests)
	if err != nil {
		return err
	}

	test, ok := tests[conf.name]
	if !ok {
		return fmt.Errorf("test not found: %s", conf.name)
	}

	env := make(map[string]string)
	env["currentCoinbase"] = test.Env.CurrentCoinbase
	env["currentDifficulty"] = test.Env.CurrentDifficulty
	env["currentGasLimit"] = test.Env.CurrentGasLimit
	env["currentNumber"] = test.Env.CurrentNumber
	env["previousHash"] = test.Env.PreviousHash
	if n, ok := test.Env.CurrentTimestamp.(float64); ok {
		env["currentTimestamp"] = strconv.Itoa(int(n))
	} else {
		env["currentTimestamp"] = test.Env.CurrentTimestamp.(string)
	}

	/*
		if conf.precomp {
			program := vm.NewProgram(test.code)
			err := vm.AttachProgram(program)
			if err != nil {
				return err
			}
		}
	*/

	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		benchVmTest(test, env, b)
	}

	return nil
}

func benchVmTest(test VmTest, env map[string]string, b *testing.B) {
	b.StopTimer()
	db, _ := ethdb.NewMemDatabase()
	statedb := makePreState(db, test.Pre)
	b.StartTimer()

	RunVm(statedb, env, test.Exec)
}

func RunVmTest(p string, skipTests []string) error {
	tests := make(map[string]VmTest)
	err := readJsonFile(p, &tests)
	if err != nil {
		return err
	}

	if err := runVmTests(tests, skipTests); err != nil {
		return err
	}

	return nil
}

func runVmTests(tests map[string]VmTest, skipTests []string) error {
	skipTest := make(map[string]bool, len(skipTests))
	for _, name := range skipTests {
		skipTest[name] = true
	}

	for name, test := range tests {
		if skipTest[name] /*|| name != "exp0"*/ {
			log.Info(fmt.Sprint("Skipping VM test", name))
			continue
		}

		if err := runVmTest(test); err != nil {
			return fmt.Errorf("%s %s", name, err.Error())
		}

		log.Info(fmt.Sprint("VM test passed: ", name))
		//fmt.Println(string(statedb.Dump()))
	}
	return nil
}

func runVmTest(test VmTest) error {
	db, _ := ethdb.NewMemDatabase()
	statedb := makePreState(db, test.Pre)

	// XXX Yeah, yeah...
	env := make(map[string]string)
	env["currentCoinbase"] = test.Env.CurrentCoinbase
	env["currentDifficulty"] = test.Env.CurrentDifficulty
	env["currentGasLimit"] = test.Env.CurrentGasLimit
	env["currentNumber"] = test.Env.CurrentNumber
	env["previousHash"] = test.Env.PreviousHash
	if n, ok := test.Env.CurrentTimestamp.(float64); ok {
		env["currentTimestamp"] = strconv.Itoa(int(n))
	} else {
		env["currentTimestamp"] = test.Env.CurrentTimestamp.(string)
	}

	var (
		ret  []byte
		gas  *big.Int
		err  error
		logs []*types.Log
	)

	ret, logs, gas, err = RunVm(statedb, env, test.Exec)

	// Compare expected and actual return
	rexp := common.FromHex(test.Out)
	if !bytes.Equal(rexp, ret) {
		return fmt.Errorf("return failed. Expected %x, got %x\n", rexp, ret)
	}

	// Check gas usage
	if len(test.Gas) == 0 && err == nil {
		return fmt.Errorf("gas unspecified, indicating an error. VM returned (incorrectly) successful")
	} else {
		gexp := math.MustParseBig256(test.Gas)
		if gexp.Cmp(gas) != 0 {
			return fmt.Errorf("gas failed. Expected %v, got %v\n", gexp, gas)
		}
	}

	// check post state
	for address, account := range test.Post {
		accountAddr := common.HexToAddress(address)
		if !statedb.Exist(accountAddr) {
			continue
		}
		for addr, value := range account.Storage {
			v := statedb.GetState(accountAddr, common.HexToHash(addr))
			vexp := common.HexToHash(value)
			if v != vexp {
				return fmt.Errorf("(%x: %s) storage failed. Expected %x, got %x (%v %v)\n", addr[:4], addr, vexp, v, vexp.Big(), v.Big())
			}
		}
	}

	// check logs
	if len(test.Logs) > 0 {
		lerr := checkLogs(test.Logs, logs)
		if lerr != nil {
			return lerr
		}
	}

	return nil
}

func RunVm(statedb *state.StateDB, env, exec map[string]string) ([]byte, []*types.Log, *big.Int, error) {
	chainConfig := &params.ChainConfig{
		HomesteadBlock: params.MainNetHomesteadBlock,
		DAOForkBlock:   params.MainNetDAOForkBlock,
		DAOForkSupport: true,
	}
	var (
		to    = common.HexToAddress(exec["address"])
		from  = common.HexToAddress(exec["caller"])
		data  = common.FromHex(exec["data"])
		gas   = math.MustParseBig256(exec["gas"])
		value = math.MustParseBig256(exec["value"])
	)
	caller := statedb.GetOrNewStateObject(from)
	vm.PrecompiledContracts = make(map[common.Address]vm.PrecompiledContract)

	environment, _ := NewEVMEnvironment(true, chainConfig, statedb, env, exec)
	ret, g, err := environment.Call(caller, to, data, gas.Uint64(), value)
	return ret, statedb.Logs(), new(big.Int).SetUint64(g), err
}


text:
module Mongoid
  module DocumentLocker
    VERSION = "0.0.1"
  end
end


text:
package gudusoft.gsqlparser.sql2xml.model;

public class simple_target_specification_2
{

}


text:
package org.moe.parser

import org.scalatest.FunSuite
import org.scalatest.BeforeAndAfter
import org.scalatest.matchers.ShouldMatchers

import org.moe.runtime._
import org.moe.interpreter._
import org.moe.ast._
import org.moe.parser._

class StringLiteralTestSuite extends FunSuite with BeforeAndAfter with ParserTestUtils with ShouldMatchers {

  // double quotes ...

  test("... basic test with a simple double-quoted string") {
    val result = interpretCode(""" "hello world" """)
    result.unboxToString.get should equal ("hello world")
  }

  test("... basic test with a double-quoted string with control characters") {
    val result = interpretCode(""" "foo\tbar\n" """)
    result.unboxToString.get should equal ("foo\tbar\n")
  }

  test("... basic test with a double-quoted string with escaped quotes") {
    val result = interpretCode(""" "foo\"bar\"" """)
    result.unboxToString.get should equal ("foo\"bar\"")
  }

  test("... basic test with a double-quoted string with unicode escaped literals ") {
    val result = interpretCode(""" "\x{03a3}" """)
    result.unboxToString.get should equal ("\\x{03a3}")
  }

  test("... basic test with double-quoted string with leading whitespace") {
    val result = interpretCode(""" "    hello world" """)
    result.unboxToString.get should equal ("    hello world")
  }

  // single quotes ...

  test("... basic test with a simple single-quoted string") {
    val result = interpretCode("'hello world'")
    result.unboxToString.get should equal ("hello world")
  }

  test("... basic test with a single-quoted string with control characters") {
    val result = interpretCode("'foo\\tbar\\n'")
    result.unboxToString.get should equal ("foo\\tbar\\n")
  }

  test("... basic test with a single-quoted string with embedded double quotes") {
    val result = interpretCode("'foo\"bar\"'")
    result.unboxToString.get should equal ("foo\"bar\"")
  }

  test("... basic test with a single-quoted string with unicode escaped literals ") {
    val result = interpretCode("'\\x{03a3}'")
    result.unboxToString.get should equal ("\\x{03a3}")
  }

  test("... basic test with single-quoted string with leading whitespace") {
    val result = interpretCode(""" '    hello world' """)
    result.unboxToString.get should equal ("    hello world")
  }
}


text:
package uk.co.traintrackapp.traintrack.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import uk.co.traintrackapp.traintrack.R;
import uk.co.traintrackapp.traintrack.model.JourneyLeg;

public class JourneyLegRowAdapter extends BaseAdapter {

    private List<JourneyLeg> rowList;
    private LayoutInflater inflater = null;

    /**
     * @param inflater layout this is going in
     * @param journeyLegs list of journey legs to show
     */
    public JourneyLegRowAdapter(LayoutInflater inflater,
                                ArrayList<JourneyLeg> journeyLegs) {
        this.rowList = journeyLegs;
        this.inflater = inflater;
    }

    public int getCount() {
        return rowList.size();
    }

    public JourneyLeg getItem(int position) {
        return rowList.get(position);
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {

        ViewHolder holder;
        if (convertView == null) {
            holder = new ViewHolder();
            convertView = inflater.inflate(R.layout.row_journey_leg, null);
            holder.name = (TextView) convertView.findViewById(R.id.name);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        JourneyLeg journeyLeg = rowList.get(position);
        holder.name.setText(journeyLeg.toString());

        return convertView;
    }

    static class ViewHolder {
        TextView name;
    }

}


text:
package term

import (
	"io"
	"os"
	"sync"
	"syscall"
	"time"

	"src.elv.sh/pkg/sys/eunix"
)

// A helper for reading from a file.
type fileReader interface {
	byteReaderWithTimeout
	// Stop stops any outstanding read call. It blocks until the read returns.
	Stop() error
	// Close releases new resources allocated for the fileReader. It does not
	// close the underlying file.
	Close()
}

func newFileReader(file *os.File) (fileReader, error) {
	rStop, wStop, err := os.Pipe()
	if err != nil {
		return nil, err
	}
	return &bReader{file: file, rStop: rStop, wStop: wStop}, nil
}

type bReader struct {
	file  *os.File
	rStop *os.File
	wStop *os.File
	// A mutex that is held when Read is in process.
	mutex sync.Mutex
}

func (r *bReader) ReadByteWithTimeout(timeout time.Duration) (byte, error) {
	r.mutex.Lock()
	defer r.mutex.Unlock()
	for {
		ready, err := eunix.WaitForRead(timeout, r.file, r.rStop)
		if err != nil {
			if err == syscall.EINTR {
				continue
			}
			return 0, err
		}
		if ready[1] {
			var b [1]byte
			r.rStop.Read(b[:])
			return 0, ErrStopped
		}
		if !ready[0] {
			return 0, errTimeout
		}
		var b [1]byte
		nr, err := r.file.Read(b[:])
		if err != nil {
			return 0, err
		}
		if nr != 1 {
			return 0, io.ErrNoProgress
		}
		return b[0], nil
	}
}

func (r *bReader) Stop() error {
	_, err := r.wStop.Write([]byte{'q'})
	r.mutex.Lock()
	//lint:ignore SA2001 We only lock the mutex to make sure that
	// ReadByteWithTimeout has exited, so we unlock it immediately.
	r.mutex.Unlock()
	return err
}

func (r *bReader) Close() {
	r.rStop.Close()
	r.wStop.Close()
}


text:
using System.Collections;
using System;
using System.Globalization;
using System.IO;

public class LimConsole : LimObject
{
    public override string getName() { return "Console"; }

    public new static LimConsole createProto(LimState state)
    {
        LimConsole console = new LimConsole();
        return console.proto(state) as LimConsole;
    }

    public override LimObject proto(LimState state)
    {
        LimConsole pro = new LimConsole();
        pro.setState(state);
        pro.createSlots();
        pro.createProtos();
        state.registerProtoWithFunc(getName(), new LimStateProto(pro.getName(), pro, new LimStateProtoFunc(pro.proto)));
        pro.protos.Add(state.protoWithInitFunc("Object"));

        LimCFunction[] methodTable = new LimCFunction[] {
                new LimCFunction("readLine", new LimMethodFunc(LimConsole.readLine)),
                new LimCFunction("readKey", new LimMethodFunc(LimConsole.readKey))
            };

        pro.addTaglessMethodTable(state, methodTable);
        return pro;
    }

    public override int GetHashCode()
    {
        return Convert.ToInt32(uniqueIdCounter);
    }

    public override void print()
    {
        Console.Write("{0}", this.ToString());
    }

    public static LimSeq readLine(LimObject target, LimObject locals, LimObject message)
    {
        LimConsole o = target as LimConsole;
        return LimSeq.createObject(o.getState(), Console.ReadLine());
    }

    public static LimSeq readKey(LimObject target, LimObject locals, LimObject message)
    {
        LimConsole o = target as LimConsole;
        return LimSeq.createObject(o.getState(), Console.ReadKey().KeyChar.ToString());
    }

}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ADBaseLibrary.Mp4
{
    public class Atom : List<Atom>
    {
        //Totally hacked do not reuse. only moov taken as parent

        public long Size { get; set; }
        public long Position { get; set; }
        public long ExpectedPosition { get; set; }
        public string Name { get; set; }
        private BinaryReader _reader;
        public byte[] Data { get; set; }

        public void ReadHeader(BinaryReader reader)
        {
            _reader = reader;
            Size = 0;
            Position = reader.BaseStream.Position;
            for (int x = 0; x < 4; x++)
            {
                Size = Size << 8 | reader.ReadByte();
            }
            byte[] nm = reader.ReadBytes(4);
            if (Size == 1)
            {
                for (int x = 0; x < 8; x++)
                {
                    Size = Size << 8 | reader.ReadByte();
                }
            }
            Name = Encoding.ASCII.GetString(nm);
        }

        public void Write(BinaryWriter writer)
        {
            if ((Data==null) && (this.Count==0))
            {
                _reader.BaseStream.Seek(Position, SeekOrigin.Begin);
                Matroska.MatroskaExtensions.CopyBytes(_reader, (ulong) Size, writer);
            }
            else if ((Data!=null) && (this.Count==0))
            {
                Size = Data.Length+8;
                for (int i = 3; i >= 0; i--)
                    writer.Write((byte)(Size >> (i * 8)));
                byte[] dta = Encoding.ASCII.GetBytes(Name);
                writer.Write(dta);
                writer.Write(Data);
            }
            else
            {
                for (int i = 3; i >= 0; i--)
                    writer.Write((byte)(Size >> (i * 8)));
                byte[] dta = Encoding.ASCII.GetBytes(Name);
                writer.Write(dta);
                foreach (Atom a in this)
                {
                    a.Write(writer);
                }
            }
        }

        public void SeekEnd(BinaryReader reader)
        {
            reader.BaseStream.Seek(Size - 8, SeekOrigin.Current);
        }

        public void ReadData(BinaryReader reader)
        {
            _reader.BaseStream.Seek(Position+8, SeekOrigin.Begin);
            Data = reader.ReadBytes((int)Size - 8);
        }
        public void Read(BinaryReader reader)
        {
            long Length = Size-8;
            while (Length > 0)
            {
                Atom a = new Atom();
                a.ReadHeader(reader);
                if (a.Name == "moov")
                    a.Read(reader);
                else
                    a.SeekEnd(reader);
                Add(a);
                Length -= a.Size;
            }
        }
        public void ReCalcSize()
        {
            Size = 8 + this.Sum(a => a.Size);
        }

        public void ReCalcPosition()
        {
            long s = ExpectedPosition;
            foreach (Atom a in this)
            {
                a.ExpectedPosition = s;
                s += a.Size;
            }
        }
    }

}