text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security;
using IKVM.Reflection;
using Type = IKVM.Reflection.Type;

namespace Embeddinator.ObjC {

	public abstract class Generator {

		public bool GenerateLinkerExclusions { get; set; }

		public virtual void Generate ()
		{
			if (Processor == null)
				throw ErrorHelper.CreateError (99, "Internal error `Invalid state for Generate`. Please file a bug report with a test case (https://github.com/mono/Embeddinator-4000/issues).");

			// FIXME: remove asap
			var op = (Processor as ObjC.ObjCProcessor);
			extensions_methods = op.extensions_methods;
			subscriptProperties = op.subscriptProperties;
			icomparable = op.icomparable;

			foreach (var a in Processor.Assemblies) {
				Generate (a);
			}
		}

		public Processor Processor { get; set; }

		public bool HasClass (Type t)
		{
			return Processor.Types.HasClass (t);
		}

		public bool HasProtocol (Type t)
		{
			return Processor.Types.HasProtocol (t);
		}

		protected abstract void Generate (ProcessedAssembly a);
		protected abstract void Generate (ProcessedType t);
		protected abstract void Generate (ProcessedProperty property);
		protected abstract void Generate (ProcessedMethod method);

		protected void WriteFile (string name, string content)
		{
			Console.WriteLine ($"\tGenerated: {name}");
			File.WriteAllText (name, content);
		}

		string ToXml (object o)
		{
			return SecurityElement.Escape (o.ToString ());
		}

		public virtual void Write (string outputDirectory)
		{
			if (!GenerateLinkerExclusions)
				return;
			var xml = new SourceWriter ();
			xml.WriteLine ("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
			xml.WriteLine ("<linker>");
			xml.Indent++;
			foreach (var a in Processor.Assemblies.Where ((arg) => !arg.UserCode)) {
				xml.WriteLine ($"<assembly fullname=\"{a.Name}\">");
				xml.Indent++;
				foreach (var t in Processor.Types.Where ((arg) => arg.Assembly == a)) {
					xml.WriteLine ($"<type fullname=\"{t}\">");
					xml.Indent++;
					if (t.HasConstructors) {
						foreach (var c in t.Constructors)
							xml.WriteLine ($"<method signature=\"{ToXml (c)}\"/>");
					}
					if (t.HasMethods) {
						foreach (var m in t.Methods)
							xml.WriteLine ($"<method signature=\"{ToXml (m)}\"/>");
					}
					if (t.HasProperties) {
						foreach (var p in t.Properties) {
							var prop = p.Property;
							var getter = prop.GetGetMethod ();
							if (getter != null)
								xml.WriteLine ($"<method signature=\"{ToXml (p.ToString (getter))}\"/>");
							var setter = prop.GetSetMethod ();
							if (setter != null)
								xml.WriteLine ($"<method signature=\"{ToXml (p.ToString (setter))}\"/>");
						}
					}
					if (t.HasFields) {
						foreach (var f in t.Fields)
							xml.WriteLine ($"<field signature=\"{ToXml (f)}\"/>");
					}
					xml.Indent--;
					xml.WriteLine ("</type>");
				}
				xml.Indent--;
				xml.WriteLine ("</assembly>");
			}
			xml.Indent--;
			xml.WriteLine ("</linker>");
			WriteFile (Path.Combine (outputDirectory, "bindings.xml"), xml.ToString ());
		}

		// to be removed / replaced
		public Dictionary<Type, Dictionary<Type, List<ProcessedMethod>>> extensions_methods { get; private set; }
		public Dictionary<Type, List<ProcessedProperty>> subscriptProperties { get; private set; }
		public Dictionary<Type, MethodInfo> icomparable { get; private set; }
	}
}


text:
using System;
using System.Buffers;
using System.Buffers.Binary;
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using System.IO.Hashing;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using Orleans.Serialization.Buffers;

namespace Orleans.Serialization.TypeSystem
{
    /// <summary>
    /// Functionality for serializing and deserializing types.
    /// </summary>
    public sealed class TypeCodec
    {
        private const byte Version1 = 1;
        private readonly ConcurrentDictionary<Type, TypeKey> _typeCache = new ConcurrentDictionary<Type, TypeKey>();
        private readonly ConcurrentDictionary<int, (TypeKey Key, Type Type)> _typeKeyCache = new ConcurrentDictionary<int, (TypeKey, Type)>();
        private readonly TypeConverter _typeConverter;
        private readonly Func<Type, TypeKey> _getTypeKey;

        /// <summary>
        /// Initializes a new instance of the <see cref="TypeCodec"/> class.
        /// </summary>
        /// <param name="typeConverter">The type converter.</param>
        public TypeCodec(TypeConverter typeConverter)
        {
            _typeConverter = typeConverter;
            _getTypeKey = type => new TypeKey(Encoding.UTF8.GetBytes(_typeConverter.Format(type)));
        }

        /// <summary>
        /// Writes a type with a length-prefix.
        /// </summary>
        /// <typeparam name="TBufferWriter">The buffer writer type.</typeparam>
        /// <param name="writer">The writer.</param>
        /// <param name="type">The type.</param>
        public void WriteLengthPrefixed<TBufferWriter>(ref Writer<TBufferWriter> writer, Type type) where TBufferWriter : IBufferWriter<byte>
        {
            var key = _typeCache.GetOrAdd(type, _getTypeKey);
            writer.WriteVarUInt32((uint)key.TypeName.Length);
            writer.Write(key.TypeName);
        }

        /// <summary>
        /// Writes a type.
        /// </summary>
        /// <typeparam name="TBufferWriter">The buffer writer type.</typeparam>
        /// <param name="writer">The writer.</param>
        /// <param name="type">The type.</param>
        public void WriteEncodedType<TBufferWriter>(ref Writer<TBufferWriter> writer, Type type) where TBufferWriter : IBufferWriter<byte>
        {
            var key = _typeCache.GetOrAdd(type, _getTypeKey);
            writer.WriteByte(Version1);
            writer.WriteInt32(key.HashCode);
            writer.WriteVarUInt32((uint)key.TypeName.Length);
            writer.Write(key.TypeName);
        }

        /// <summary>
        /// Reads a type.
        /// </summary>
        /// <typeparam name="TInput">The reader input type.</typeparam>
        /// <param name="reader">The reader.</param>
        /// <returns>The type if it was successfully read, <see langword="null" /> otherwise.</returns>
        public unsafe Type TryRead<TInput>(ref Reader<TInput> reader)
        {
            var version = reader.ReadByte();
            if (version != Version1)
            {
                ThrowUnsupportedVersion(version);
            }

            var hashCode = reader.ReadInt32();
            var count = (int)reader.ReadVarUInt32();

            if (!reader.TryReadBytes(count, out var typeName))
            {
                typeName = reader.ReadBytes((uint)count);
            }

            // Search through
            var candidateHashCode = hashCode;
            while (_typeKeyCache.TryGetValue(candidateHashCode, out var entry))
            {
                var existingKey = entry.Key;
                if (existingKey.HashCode != hashCode)
                {
                    break;
                }

                if (existingKey.TypeName.AsSpan().SequenceEqual(typeName))
                {
                    return entry.Type;
                }

                // Try the next entry.
                ++candidateHashCode;
            }

            // Allocate a string for the type name.
            string typeNameString;
            fixed (byte* typeNameBytes = typeName)
            {
                typeNameString = Encoding.UTF8.GetString(typeNameBytes, typeName.Length);
            }

            if (_typeConverter.TryParse(typeNameString, out var type))
            {
                var key = new TypeKey(hashCode, typeName.ToArray());
                while (!_typeKeyCache.TryAdd(candidateHashCode++, (key, type)))
                {
                    // Insert the type at the first available position.
                }
            }

            return type;
        }

        /// <summary>
        /// Reads a length-prefixed type.
        /// </summary>
        /// <typeparam name="TInput">The reader input type.</typeparam>
        /// <param name="reader">The reader.</param>
        /// <returns>Type.</returns>
        public unsafe Type ReadLengthPrefixed<TInput>(ref Reader<TInput> reader)
        {
            var count = (int)reader.ReadVarUInt32();

            if (!reader.TryReadBytes(count, out var typeName))
            {
                typeName = reader.ReadBytes((uint)count);
            }

            // Allocate a string for the type name.
            string typeNameString;
            fixed (byte* typeNameBytes = typeName)
            {
                typeNameString = Encoding.UTF8.GetString(typeNameBytes, typeName.Length);
            }

            var type = _typeConverter.Parse(typeNameString);
            return type;
        }

        /// <summary>
        /// Tries to read a type for diagnostics purposes.
        /// </summary>
        /// <typeparam name="TInput">The reader input type.</typeparam>
        /// <param name="reader">The reader.</param>
        /// <param name="type">The type.</param>
        /// <param name="typeString">The type name as a string.</param>
        /// <returns><see langword="true" /> if a type was successfully read, <see langword="false" /> otherwise.</returns>
        public unsafe bool TryReadForAnalysis<TInput>(ref Reader<TInput> reader, [NotNullWhen(true)] out Type type, out string typeString)
        {
            var version = reader.ReadByte();
            var hashCode = reader.ReadInt32();
            var count = (int)reader.ReadVarUInt32();

            if (!reader.TryReadBytes(count, out var typeName))
            {
                typeName = reader.ReadBytes((uint)count);
            }

            // Allocate a string for the type name.
            string typeNameString;
            fixed (byte* typeNameBytes = typeName)
            {
                typeNameString = Encoding.UTF8.GetString(typeNameBytes, count);
            }

            _ = _typeConverter.TryParse(typeNameString, out type);
            var key = new TypeKey(hashCode, typeName.ToArray());
            typeString = key.ToString();
            return type is not null;
        }

        [DoesNotReturn]
        private static void ThrowUnsupportedVersion(byte version) => throw new NotSupportedException($"Type encoding version {version} is not supported");

        /// <summary>
        /// Represents a named type for the purposes of serialization.
        /// </summary>
        internal readonly struct TypeKey
        {
            public readonly int HashCode;

            public readonly byte[] TypeName;

            public TypeKey(int hashCode, byte[] key)
            {
                HashCode = hashCode;
                TypeName = key;
            }

            public TypeKey(byte[] key)
            {
                TypeName = key;
                Unsafe.SkipInit(out int hash);
                XxHash32.TryHash(key, MemoryMarshal.AsBytes(MemoryMarshal.CreateSpan(ref hash, 1)), out _);
                HashCode = BitConverter.IsLittleEndian ? hash : BinaryPrimitives.ReverseEndianness(hash);
            }

            public bool Equals(in TypeKey other)
            {
                if (HashCode != other.HashCode)
                {
                    return false;
                }

                var a = TypeName;
                var b = other.TypeName;
                return ReferenceEquals(a, b) || a.AsSpan().SequenceEqual(b);
            }

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

            public override int GetHashCode() => HashCode;

            public override string ToString() => $"TypeName \"{Encoding.UTF8.GetString(TypeName)}\" (hash {HashCode:X8})";
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
@{layout('')}
@{title('Simple sample chat application for openplatform')}

<!DOCTYPE html>

	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=11" />
	<meta name="format-detection" content="telephone=no" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<meta name="robots" content="all,follow" />

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,900" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Arimo" rel="stylesheet">
	@{import('meta', 'head','font-awesome.min.css', 'default.css', 'default.js', 'favicon.ico')}

                Contacts

Chatting with

                    <input type="text" style="width: 80%; height:100%;" placeholder="Message..." id="chat_input">
                    <button class="inputButton" id="chat_submit"> Send</button>

	@{helpers.openplatform()}


text:
<?php
return [
    'service_manager' => [
        'invokables' => [
            'DataGrid\Factory\DataSource'  => 'DataGrid\DataSource\Factory',
            'DataGrid\Factory\Cell'        => 'DataGrid\Cell\Factory',
            'DataGrid\Factory\FilterItem'  => 'DataGrid\Filter\Item\Factory',
            'DataGrid\DataSource\Doctrine' => 'DataGrid\DataSource\DoctrineSource',
            'DataGrid\DataSource\Array'    => 'DataGrid\DataSource\ArraySource',

            'DataGrid\Cell\Text' => '\DataGrid\Cell\Text',
            'DataGrid\Cell\Boolean' => '\DataGrid\Cell\Boolean',
            'DataGrid\Cell\Union' => '\DataGrid\Cell\Union',
            'DataGrid\Cell\Action' => '\DataGrid\Cell\Action',

            'DataGrid\Filter\Search' => '\DataGrid\Filter\Item\Search',
        ],
        'shared'     => [
            'DataGrid\DataSource\Doctrine' => false,
            'DataGrid\DataSource\Array'    => false,
            'DataGrid\Cell\Text' => false,
            'DataGrid\Cell\Boolean' => false,
            'DataGrid\Cell\Union' => false,
            'DataGrid\Cell\Action' => false,
        ],
    ],
    'view_helpers'    => [
        'invokables' => [
            'dataGrid'             => 'DataGrid\View\Helper\GridHelper',
            'dataGridPagination'   => 'DataGrid\View\Helper\GridPaginatorHelper',
            'dataGridFilter'       => 'DataGrid\View\Helper\GridFilterHelper',
            'dataGridFilterSearch' => 'DataGrid\View\Helper\GridFilter\SearchHelper',
            'dataGridTable'        => 'DataGrid\View\Helper\GridTableHelper',
            'dataGridHead'         => 'DataGrid\View\Helper\GridHeadHelper',
            'dataGridHeadText'     => 'DataGrid\View\Helper\GridHeadTextHelper',
            'dataGridHeadOrder'    => 'DataGrid\View\Helper\GridHeadOrderHelper',
            'dataGridRow'          => 'DataGrid\View\Helper\GridRowHelper',
            'dataGridCellText'     => 'DataGrid\View\Helper\GridCellTextHelper',
            'dataGridCellBoolean'  => 'DataGrid\View\Helper\GridCellBooleanHelper',
            'dataGridCellUnion'    => 'DataGrid\View\Helper\GridCellUnionHelper',
            'dataGridCellAction'   => 'DataGrid\View\Helper\GridCellActionHelper',
        ],
    ],
];


text:
oc delete all --selector logging-infra=kibana
oc delete all --selector logging-infra=fluentd
oc delete all --selector logging-infra=elasticsearch
oc delete all --selector logging-infra=curator
oc delete all,sa,oauthclient --selector logging-infra=support
oc delete secret logging-fluentd logging-elasticsearch \
    logging-es-proxy logging-kibana logging-kibana-proxy \
    logging-kibana-ops-proxy


text:
package sk.jmd.taskapp.clientapi.v1.dao.rest;

import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import sk.r3n.dto.ColumnId;

@XmlAccessorType(XmlAccessType.FIELD)
public class TaskData implements Serializable {

    @ColumnId(table = "jmd_task_data", column = "code")
    protected String code;

    @ColumnId(table = "jmd_task_data", column = "name")
    protected String name;

    @ColumnId(table = "jmd_task_data", column = "mime_type")
    protected String mimeType;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

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

    public String getMimeType() {
        return mimeType;
    }

    public void setMimeType(String mimeType) {
        this.mimeType = mimeType;
    }

    @Override
    public String toString() {
        return "TaskData{" + "code=" + code + ", name=" + name + ", mimeType=" + mimeType + '}';
    }

}


text:
template <typename T>
void atomicMinTestImpl(T const &)
{
    using namespace seqan;

    int const ARR_SIZE = 4 * 1024;

    // Generate pseudorandom numbers to compute minimum of.
    T expectedMin = MaxValue<T>::VALUE;
    T arr[ARR_SIZE];
    T volatile x = 3;
    for (int i = 0; i < ARR_SIZE; ++i) {
        x = 32456 * x + 9874;
        arr[i] = x;
        expectedMin = _min(expectedMin, x);
    }

    // Compute minimum in parallel.  Not efficient, but many conflicts
    // should occur.
    x = MaxValue<T>::VALUE;
    SEQAN_OMP_PRAGMA(omp parallel for schedule(static, 1))
    for (int i = 0; i < ARR_SIZE; ++i)
        atomicMin(x, arr[i]);

    SEQAN_ASSERT_EQ(expectedMin, x);
}

template <typename T>
void atomicMaxTestImpl(T const &)
{
    using namespace seqan;

    int const ARR_SIZE = 4 * 1024;

    // Generate pseudorandom numbers to compute maximum of.
    T expectedMax = MinValue<T>::VALUE;
    T arr[ARR_SIZE];
    T x = 3;
    for (int i = 0; i < ARR_SIZE; ++i) {
        x = 32456 * x + 9874;
        arr[i] = x;
        expectedMax = _max(expectedMax, x);
    }

    // Compute maximum in parallel.  Not efficient, but many conflicts
    // should occur.
    x = MinValue<T>::VALUE;
    SEQAN_OMP_PRAGMA(omp parallel for schedule(static, 1))
    for (int i = 0; i < ARR_SIZE; ++i)
        atomicMax(x, arr[i]);

    SEQAN_ASSERT_EQ(expectedMax, x);
}

SEQAN_DEFINE_TEST(test_parallel_atomic_min)
{
    using namespace seqan;
    typedef unsigned short SEQAN_ushort;
    typedef unsigned long SEQAN_ulong;

    // Tests are limited to the types where MSVC allows atomic
    // Compare-And-Swap, also 64 bit CAS is not available on 32 bit Intel.
    atomicMinTestImpl(short());
    atomicMinTestImpl(SEQAN_ushort());
    atomicMinTestImpl(long());
    atomicMinTestImpl(SEQAN_ulong());
#if SEQAN_IS_64_BIT
    atomicMinTestImpl(__int64());
    atomicMinTestImpl(__uint64());
#endif  // #if SEQAN_IS_64_BIT
}

SEQAN_DEFINE_TEST(test_parallel_atomic_max)
{
    using namespace seqan;
    typedef unsigned short SEQAN_ushort;
    typedef unsigned long SEQAN_ulong;

    // Tests are limited to the types where MSVC allows atomic
    // Compare-And-Swap, also 64 bit CAS is not available on 32 bit Intel.
    atomicMaxTestImpl(short());
    atomicMaxTestImpl(SEQAN_ushort());
    atomicMaxTestImpl(long());
    atomicMaxTestImpl(SEQAN_ulong());
#if SEQAN_IS_64_BIT
    atomicMaxTestImpl(__int64());
    atomicMaxTestImpl(__uint64());
#endif  // #if SEQAN_IS_64_BIT
}

#endif  // TEST_PARALLEL_TEST_PARALLEL_ATOMIC_MISC_H_


text:
from openerp.osv import fields, osv
from openerp.tools.translate import _

class hr_recruitment_partner_create(osv.osv_memory):
    _name = 'hr.recruitment.partner.create'
    _description = 'Create Partner from job application'
    _columns = {
        'close': fields.boolean('Close job request'),
                }

    def view_init(self, cr, uid, fields_list, context=None):
        case_obj = self.pool.get('hr.applicant')
        if context is None:
            context = {}
        for case in case_obj.browse(cr, uid, context['active_ids'], context=context):
            if case.partner_id:
                raise osv.except_osv(_('Error!'),
                    _('A contact is already defined on this job request.'))
        pass

    def make_order(self, cr, uid, ids, context=None):
        mod_obj = self.pool.get('ir.model.data')
        partner_obj = self.pool.get('res.partner')
        case_obj = self.pool.get('hr.applicant')

        if context is None:
            context = {}
        data = self.read(cr, uid, ids, context=context)[0]
        result = mod_obj._get_id(cr, uid, 'base', 'view_res_partner_filter')
        res = mod_obj.read(cr, uid, result, ['res_id'], context=context)

        for case in case_obj.browse(cr, uid, context['active_ids'], context=context):
            partner_id = partner_obj.search(cr, uid, [('name', '=', case.partner_name or case.name)], context=context)
            if partner_id:
                raise osv.except_osv(_('Error!'),_('A contact is already existing with the same name.'))
            partner_id = partner_obj.create(cr, uid, {
                'name': case.partner_name or case.name,
                'user_id': case.user_id.id,
                'comment': case.description,
                'phone': case.partner_phone,
                'mobile': case.partner_mobile,
                'email': case.email_from
            }, context=context)

            case_obj.write(cr, uid, [case.id], {
                'partner_id': partner_id,
            }, context=context)

        return {
            'domain': "[]",
            'view_type': 'form',
            'view_mode': 'form,tree',
            'res_model': 'res.partner',
            'res_id': int(partner_id),
            'view_id': False,
            'type': 'ir.actions.act_window',
            'search_view_id': res['res_id']
        }

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SystemUser.SystemModel;

namespace SystemUser
{
    public partial class AddAppointment : Form
    {
        //constructer
        public AddAppointment(int control)
        {
            InitializeComponent();
            listView1.MouseDoubleClick += new MouseEventHandler(listView1_doubleclick);

            if (control == 1)
            {
                dateTimePicker1.Enabled = false;
                cmbspec.Enabled = false;
                chkspc.Enabled = false;
                chkdate.Enabled = false;
            }
            else if (control == 2)
            {
                txtfullname.Enabled = false;
                chkname.Enabled = false;
            }
            else if (control == 3)
            {

            }

        }

        //close button
        private void btnclose_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        // get all appoinment information from database
        private void AddAppointment_Load(object sender, EventArgs e)
        {

            //loading the speciality of all the doctors in the combo bo
            string oracleDB = Helper.con_string("acma_db");

            //query to select all the sepeciality to combo box
            string qry_speciality = "select description from acma_specialty";

            OracleConnection connect = new OracleConnection(oracleDB);
            connect.Open();

            //data reading to specilaty of items
            OracleCommand cmd = new OracleCommand(qry_speciality, connect);
            OracleDataReader readData = cmd.ExecuteReader();

            while (readData.Read())
            {
                cmbspec.Items.Add(readData[0]);
            }

            connect.Close();
        }

        //Search button options
        private void btnsearch_Click(object sender, EventArgs e)
        {
            // checking name and doctor speciality
            if ((chkname.Checked == true) && (chkspc.Checked == true))
            {
                MessageBox.Show("You can search doctor by NAME or NAME & SPECIALITY or SPECIALITY & DATE, Also make sure that your choice is checked.", "Choice Not Fullfilled to Search", MessageBoxButtons.OK, MessageBoxIcon.Information);
                listView1.Items.Clear();
            }

            // checking name and doctor available date
            else if ((chkname.Checked == true) && (chkdate.Checked == true))
            {
                MessageBox.Show("You can search doctor by NAME or NAME & SPECIALITY or SPECIALITY & DATE, Also make sure that your choice is checked.", "Choice Not Fullfilled to Search", MessageBoxButtons.OK, MessageBoxIcon.Information);
                listView1.Items.Clear();
            }

            // checking doctor available date and doctor specility
            else if ((chkdate.Checked == true) && (chkspc.Checked == true))
            {
                string spec = cmbspec.Text;
                int day = 0;

                if (dateTimePicker1.Value.DayOfWeek == DayOfWeek.Sunday)
                    day = 1;
                else if (dateTimePicker1.Value.DayOfWeek == DayOfWeek.Monday)
                    day = 2;
                else if (dateTimePicker1.Value.DayOfWeek == DayOfWeek.Tuesday)
                    day = 3;
                else if (dateTimePicker1.Value.DayOfWeek == DayOfWeek.Wednesday)
                    day = 4;
                else if (dateTimePicker1.Value.DayOfWeek == DayOfWeek.Thursday)
                    day = 5;
                else if (dateTimePicker1.Value.DayOfWeek == DayOfWeek.Friday)
                    day = 6;
                else if (dateTimePicker1.Value.DayOfWeek == DayOfWeek.Saturday)
                    day = 6;

                SystemController SearchDoctorBySpecDate = new SystemController();

                List<SearchDoctorModel> BySpecDate = SearchDoctorBySpecDate.SearchDoctorBySpecDate(spec, day);
                if (BySpecDate.Count() > 0)
                {
                    listView1.Items.Clear();

                    foreach (SearchDoctorModel dataRow in BySpecDate)
                    {
                        ListViewItem ListItem = new ListViewItem(dataRow.Doctor_id.ToString());
                        ListItem.SubItems.Add(dataRow.Fullname);
                        ListItem.SubItems.Add(dataRow.Weekend.ToString());
                        ListItem.SubItems.Add(dataRow.Room_number.ToString());
                        ListItem.SubItems.Add(dataRow.Descriptionl);

                        listView1.Items.Add(ListItem);
                    }
                }
            }

            // search doctor by doctor name
            else if (chkname.Checked == true)
            {
                string doctorname = txtfullname.Text;

                SystemController SearchDoctorName = new SystemController();

                List<SearchDoctorModel> ByDoctorName = SearchDoctorName.SearchDoctorByName(doctorname);
                if (ByDoctorName.Count() > 0)
                {
                    listView1.Items.Clear();

                    foreach (SearchDoctorModel dataRow in ByDoctorName)
                    {
                        ListViewItem ListItem = new ListViewItem(dataRow.Doctor_id.ToString());
                        ListItem.SubItems.Add(dataRow.Fullname);
                        ListItem.SubItems.Add(dataRow.Weekend.ToString());
                        ListItem.SubItems.Add(dataRow.Room_number.ToString());
                        ListItem.SubItems.Add(dataRow.Descriptionl);

                        listView1.Items.Add(ListItem);
                    }
                }
            }

            // search doctor by his specility
            else if (chkspc.Checked == true)
            {
                string spec = cmbspec.Text;

                SystemController SearchDoctorBySpec = new SystemController();

                List<SearchDoctorModel> ByDoctorSpec = SearchDoctorBySpec.SearchDoctorBySpec(spec);
                if (ByDoctorSpec.Count() > 0)
                {
                    listView1.Items.Clear();

                    foreach (SearchDoctorModel dataRow in ByDoctorSpec)
                    {
                        ListViewItem ListItem = new ListViewItem (dataRow.Doctor_id.ToString());
                        ListItem.SubItems.Add(dataRow.Fullname);
                        ListItem.SubItems.Add(dataRow.Weekend.ToString());
                        ListItem.SubItems.Add(dataRow.Room_number.ToString());
                        ListItem.SubItems.Add(dataRow.Descriptionl);

                        listView1.Items.Add(ListItem);
                    }
                }
            }

            //warning for all other searching opetion selections
            else
            {
                MessageBox.Show("You can search doctor by NAME or NAME & SPECIALITY or SPECIALITY & DATE, Also make sure that your choice is checked.", "Choice Not Fullfilled to Search", MessageBoxButtons.OK, MessageBoxIcon.Information);
                listView1.Items.Clear();
            }

        }

        //worng added button
        private void button1_Click(object sender, EventArgs e)
        {

        }

        //wrong added list view
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        //List view item select event
        private void listView1_doubleclick(object sender, MouseEventArgs e)
        {
            string doctor_id = listView1.SelectedItems[0].SubItems[0].Text.ToString();
            string doctor_name = listView1.SelectedItems[0].SubItems[1].Text.ToString();
            string weekend_status = listView1.SelectedItems[0].SubItems[2].Text.ToString();
            string room_number = listView1.SelectedItems[0].SubItems[3].Text.ToString();
            string description = listView1.SelectedItems[0].SubItems[4].Text.ToString();

            this.Hide();

            AddAppointmentDoctorInfo doctorInfo = new AddAppointmentDoctorInfo(doctor_id, doctor_name, weekend_status, room_number, description,this);
            doctorInfo.Show();
        }
    }
}


text:
These sample source codes on this page below are displaying how to make searchable PDF discarding existing content with PDF extractor SDK in C#. ByteScout Data Extraction Suite can make searchable PDF discarding existing content with PDF extractor SDK. It can be applied from C#. ByteScout Data Extraction Suite is the bundle that includes three SDK tools for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK.

This prolific sample source code in C# for ByteScout Data Extraction Suite contains various functions and other necessary options you should do calling the API to make searchable PDF discarding existing content with PDF extractor SDK. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Enjoy writing a code with ready-to-use sample codes in C#.

Trial version of ByteScout Data Extraction Suite is available for free. Source code samples are included to help you with your C# app.

## REQUEST FREE TECH SUPPORT

[Click here to get in touch](https://bytescout.zendesk.com/hc/en-us/requests/new?subject=ByteScout%20Data%20Extraction%20Suite%20Question)

or just send email to [support@bytescout.com](mailto:support@bytescout.com?subject=ByteScout%20Data%20Extraction%20Suite%20Question)

## ON-PREMISE OFFLINE SDK

[Get Your 60 Day Free Trial](https://bytescout.com/download/web-installer?utm_source=github-readme)
[Explore SDK Docs](https://bytescout.com/documentation/index.html?utm_source=github-readme)
[Sign Up For Online Training](https://academy.bytescout.com/)

## ON-DEMAND REST WEB API

[Get your API key](https://pdf.co/documentation/api?utm_source=github-readme)
[Explore Web API Documentation](https://pdf.co/documentation/api?utm_source=github-readme)
[Explore Web API Samples](https://github.com/bytescout/ByteScout-SDK-SourceCode/tree/master/PDF.co%20Web%20API)

## VIDEO REVIEW

[https://www.youtube.com/watch?v=NEwNs2b9YN8](https://www.youtube.com/watch?v=NEwNs2b9YN8)

<!-- code block begin -->

##### ****MakeSearchablePDFDiscardingExistingContent.NETCore.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
    <GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
    <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
    <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
    <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
    <GenerateAssemblyTrademarkAttribute>false</GenerateAssemblyTrademarkAttribute>
    <GenerateAssemblyCultureAttribute>false</GenerateAssemblyCultureAttribute>
    <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <None Include="..\..\sample_ocr_withText.pdf" Link="sample_ocr_withText.pdf">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Windows.Compatibility" Version="2.0.0" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>c:\Program Files\Bytescout PDF Extractor SDK\netcoreapp2.0\Bytescout.PDFExtractor.dll</HintPath>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>c:\Program Files\Bytescout PDF Extractor SDK\netcoreapp2.0\Bytescout.PDFExtractor.OCRExtension.dll</HintPath>
    </Reference>
  </ItemGroup>
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****MakeSearchablePDFDiscardingExistingContent.VS2005.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B664BC67-BC23-45C4-97A0-BE617CCAA7DA}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <RootNamespace>MakeSearchablePDFDiscardingExistingContent</RootNamespace>
    <AssemblyName>MakeSearchablePDFDiscardingExistingContent</AssemblyName>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\..\sample_ocr_withText.pdf">
      <Link>sample_ocr_withText.pdf</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****MakeSearchablePDFDiscardingExistingContent.VS2008.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B664BC67-BC23-45C4-97A0-BE617CCAA7DA}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <RootNamespace>MakeSearchablePDFDiscardingExistingContent</RootNamespace>
    <AssemblyName>MakeSearchablePDFDiscardingExistingContent</AssemblyName>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\..\sample_ocr_withText.pdf">
      <Link>sample_ocr_withText.pdf</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****MakeSearchablePDFDiscardingExistingContent.VS2010.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B664BC67-BC23-45C4-97A0-BE617CCAA7DA}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <RootNamespace>MakeSearchablePDFDiscardingExistingContent</RootNamespace>
    <AssemblyName>MakeSearchablePDFDiscardingExistingContent</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\..\sample_ocr_withText.pdf">
      <Link>sample_ocr_withText.pdf</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****MakeSearchablePDFDiscardingExistingContent.VS2012.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B664BC67-BC23-45C4-97A0-BE617CCAA7DA}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <RootNamespace>MakeSearchablePDFDiscardingExistingContent</RootNamespace>
    <AssemblyName>MakeSearchablePDFDiscardingExistingContent</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\..\sample_ocr_withText.pdf">
      <Link>sample_ocr_withText.pdf</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****MakeSearchablePDFDiscardingExistingContent.VS2013.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B664BC67-BC23-45C4-97A0-BE617CCAA7DA}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <RootNamespace>MakeSearchablePDFDiscardingExistingContent</RootNamespace>
    <AssemblyName>MakeSearchablePDFDiscardingExistingContent</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\..\sample_ocr_withText.pdf">
      <Link>sample_ocr_withText.pdf</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****MakeSearchablePDFDiscardingExistingContent.VS2015.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B664BC67-BC23-45C4-97A0-BE617CCAA7DA}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <RootNamespace>MakeSearchablePDFDiscardingExistingContent</RootNamespace>
    <AssemblyName>MakeSearchablePDFDiscardingExistingContent</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\..\sample_ocr_withText.pdf">
      <Link>sample_ocr_withText.pdf</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****Program.cs:**

```
using System.Diagnostics;
using Bytescout.PDFExtractor;

// To make OCR work you should references "Bytescout.PDFExtractor.dll" and "Bytescout.PDFExtractor.OCRExtension.dll" from your project.

namespace MakeSearchablePDFDiscardingExistingContent
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create Bytescout.PDFExtractor.TextExtractor instance
            SearchablePDFMaker searchablePDFMaker = new SearchablePDFMaker();
            searchablePDFMaker.RegistrationName = "demo";
            searchablePDFMaker.RegistrationKey = "demo";

            // Load sample PDF document
            searchablePDFMaker.LoadDocumentFromFile("sample_ocr_withText.pdf");

            // Set the location of language data files
            searchablePDFMaker.OCRLanguageDataFolder = @"c:\Program Files\Bytescout PDF Extractor SDK\ocrdata_best\";

            // Set OCR language
            searchablePDFMaker.OCRLanguage = "eng"; // "eng" for english, "deu" for German, "fra" for French, "spa" for Spanish etc - according to files in "ocrdata" folder

            // Set PDF document rendering resolution
            searchablePDFMaker.OCRResolution = 300;

            // Discard Existing Text in document
            searchablePDFMaker.DiscardExistingDocumentText = true;

            // Save extracted text to file
            searchablePDFMaker.MakePDFSearchable("output.pdf");

            // Cleanup
            searchablePDFMaker.Dispose();

            // Open output file in default associated application
            ProcessStartInfo processStartInfo = new ProcessStartInfo("output.pdf");
            processStartInfo.UseShellExecute = true;
            Process.Start(processStartInfo);
        }
    }
}

```

<!-- code block end -->


text:
from typing import List

from cerebralcortex.kernel.datatypes.datapoint import DataPoint
from cerebralcortex.kernel.datatypes.datastream import DataStream

def generate_cStress_feature_vector(ecg_features: List[DataStream]):
    """
    :param ecg_features: DataStream
    :return feature vector DataStream
    """

    final_feature_vector = []
    for i in range(len(ecg_features[0].data)):
        feature_vector = []
        for ef in ecg_features:
            if ef.data[i].sample is None:
                continue
            feature_vector.append(ef.data[i].sample)

        final_feature_vector.append(DataPoint.from_tuple(start_time=ef.data[i].start_time,
                                                         end_time=ef.data[i].end_time,
                                                         sample=feature_vector))

    feature_vector_ds = DataStream.from_datastream(ecg_features)
    feature_vector_ds.data = final_feature_vector

    return feature_vector_ds


text:
import Engine from "./engine";
import Vector from "./math/vector";
import { Root } from "../redux/reducer";

const cross = (pos: Vector, context: CanvasRenderingContext2D) => {
  const size = 20;
  context.beginPath();
  context.moveTo(pos.x - size, pos.y);
  context.lineTo(pos.x + size, pos.y);
  context.moveTo(pos.x, pos.y - size);
  context.lineTo(pos.x, pos.y + size);
  context.stroke();
};

export default class Guide {
  private context: CanvasRenderingContext2D;

  constructor(
    public canvas: HTMLCanvasElement,
    private engine: Engine,
    private getState: () => Root,
  ) {
    this.context = canvas.getContext("2d") as CanvasRenderingContext2D;
  }

  draw() {
    const guide = this.getState().guide;
    if (!guide.active) {
      this.canvas.hidden = true;
      return;
    }

    this.canvas.hidden = false;
    const cam = this.engine.ctx.camera;
    const scr = cam.cpx2scr(new Vector(guide.x, guide.y));
    this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);

    this.context.lineWidth = 3;
    this.context.strokeStyle = "#000000";
    cross(scr.plus(new Vector(3, 3)), this.context);
    this.context.strokeStyle = "#FFFFFF";
    cross(scr, this.context);
  }
}


text:
(function($, window, undefined)
{
	$.fn.lazy = function(settings)
	{
		/**
		 * settings and configuration data
		 * @var array
		 */
		var configuration =
		{
			// general
			bind            : "load",
			threshold       : 300,
			fallbackHeight  : 2000,
			visibleOnly     : true,

			// delay
			delay           : -1,
			combined        : false,

			// attribute
			attribute       : "data-src",
			removeAttribute : true,

			// effect
			effect          : "show",
			effectTime      : 0,

			// throttle
			enableThrottle  : false,
			throttle        : 250,

			// callback
			beforeLoad      : null,
			afterLoad       : null
		}

		// overwrite configuration with custom user settings
		if( settings )
			$.extend(configuration, settings);

		// all given items by jQuery selector
		var items = this;

		// on first page load get initial images
		if( configuration.bind == "load" )
		{
			$(window).load(function()
			{
				_init();
			});
		}

		// if event driven don't wait for page loading
		else if( configuration.bind == "event" )
		{
			_init();
		}

		/**
		 * lazyLoadImages(allImages)
		 *
		 * check and load all needed images
		 *
		 * @param boolean allImages
		 * @return void
		 */
		function lazyLoadImages(allImages)
		{
			if( typeof allImages != "boolean" )
				allImages = false;

			// get only item wich have an tag attribute
			items = items.filter("[" + configuration.attribute + "]");

			items.each(function()
			{
				var element = $(this);

				if( element.attr(configuration.attribute) &&
					element.attr(configuration.attribute) != element.attr("src") &&
					(element.is(":visible") || !configuration.visibleOnly) )
				{
					if( _isInLoadableArea(element) || allImages  )
					{
						// trigger function before loading image
						if( configuration.beforeLoad )
							configuration.beforeLoad(element);

						element.hide().attr("src", element.attr(configuration.attribute))[configuration.effect](configuration.effectTime);

						// remove attribute after load
						if( configuration.removeAttribute )
							element.removeAttr(configuration.attribute);

						// trigger function after loading image
						if( configuration.afterLoad )
							configuration.afterLoad(element);
					}
				}
			});
		}

		/**
		 * _init()
		 *
		 * initialize lazy plugin
		 * bind loading to events or set delay time to load all images at once
		 *
		 * @return void
		 */
		function _init()
		{
			// if delay time is set load all images at once after delay time
			if( configuration.delay >= 0 )
			{
				setTimeout(function() { lazyLoadImages(true); }, configuration.delay);
			}

			// if no delay is set or combine usage is active bin events
			if( configuration.delay < 0 || configuration.combined )
			{
				// bind lazy load functions to scroll and resize event
				$(window).bind("scroll", _throttle(configuration.throttle, lazyLoadImages));
				$(window).bind("resize", _throttle(configuration.throttle, lazyLoadImages));

				// load initial images
				lazyLoadImages();
			}
		}

		/**
		 * _isInLoadableArea(element)
		 *
		 * try to allocate current viewport height of the browser
		 * uses fallback option when no height was found
		 *
		 * @param jQuery element
		 * @return integer
		 */
		function _isInLoadableArea(element)
		{
			var top = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;

			if( (top + _getActualHeight() + configuration.threshold) > (element.offset().top + element.height()) )
			{
				return true;
			}

			return false;
		}

		/**
		 * _getActualHeight()
		 *
		 * try to allocate current viewport height of the browser
		 * uses fallback option when no height is found
		 *
		 * @return integer
		 */
		function _getActualHeight()
		{
			if( window.innerHeight )
			{
				return window.innerHeight;
			}

			if( document.documentElement && document.documentElement.clientHeight )
			{
				return document.documentElement.clientHeight;
			}

			if( document.body && document.body.clientHeight )
			{
				return document.body.clientHeight;
			}

			if( document.body && document.body.offsetHeight )
			{
				return document.body.offsetHeight;
			}

			return configuration.fallbackHeight;
		}

		/**
		 * _throttle(delay, call)
		 *
		 * helper function to throttle down event triggering
		 *
		 * @param integer delay
		 * @param object function call
		 * @return function object
		 */
		function _throttle(delay, call)
		{
			var _timeout;
			var _exec = 0;

			function callable()
			{
				var elapsed = +new Date() - _exec;

				function run()
				{
					_exec = +new Date();
					call.apply();
				};

				_timeout && clearTimeout(_timeout);

				if( elapsed > delay || !configuration.enableThrottle )
				{
					run();
				}
				else
				{
					_timeout = setTimeout(run, delay - elapsed);
				}
			}

			return callable;
		}

		return this;
	}

	// make lazy a bit more caseinsensitive :)
	$.fn.Lazy = $.fn.lazy;
}
)(jQuery, window);


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

<title>Uses of Class org.objectweb.asm.MethodVisitor (ASM 5.0.4 Documentation)</title>
<meta name="date" content="2015-05-15">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.objectweb.asm.MethodVisitor

Packages that use MethodVisitor

Package
Description

org.objectweb.asm

Provides a small and fast bytecode manipulation framework.

org.objectweb.asm.commons

Provides some useful class and method adapters.

org.objectweb.asm.tree

Provides an ASM visitor that constructs a tree representation of the
classes it visits.

org.objectweb.asm.util

Provides ASM visitors that can be useful for programming and
debugging purposes.

org.objectweb.asm.xml

Provides SAX 2.0 adapters for ASM
visitors to convert classes to and from XML.

Uses of MethodVisitor in org.objectweb.asm

Fields in org.objectweb.asm declared as MethodVisitor

Modifier and Type
Field and Description

protected MethodVisitor
MethodVisitor.mv

The method visitor to which this visitor must delegate method calls.

Methods in org.objectweb.asm that return MethodVisitor

Modifier and Type
Method and Description

MethodVisitor
ClassWriter.visitMethod(int access,
           String name,
           String desc,
           String signature,
           String[] exceptions)

MethodVisitor
ClassVisitor.visitMethod(int access,
           String name,
           String desc,
           String signature,
           String[] exceptions)

Visits a method of the class.

Constructors in org.objectweb.asm with parameters of type MethodVisitor

Constructor and Description

MethodVisitor(int api,
             MethodVisitor mv)

Constructs a new MethodVisitor.

Uses of MethodVisitor in org.objectweb.asm.commons

Subclasses of MethodVisitor in org.objectweb.asm.commons

Modifier and Type
Class and Description

class
AdviceAdapter

A MethodVisitor to insert before, after and around
 advices in methods and constructors.

class
AnalyzerAdapter

A MethodVisitor that keeps track of stack map frame changes between
 visitFrame calls.

class
CodeSizeEvaluator

A MethodVisitor that can be used to approximate method size.

class
GeneratorAdapter

A MethodVisitor with convenient methods to generate
 code.

class
InstructionAdapter

A MethodVisitor providing a more detailed API to generate and
 transform instructions.

class
JSRInlinerAdapter

A MethodVisitor that removes JSR instructions and
 inlines the referenced subroutines.

class
LocalVariablesSorter

A MethodVisitor that renumbers local variables in their order of
 appearance.

class
RemappingMethodAdapter

A LocalVariablesSorter for type mapping.

class
TryCatchBlockSorter

A MethodVisitor adapter to sort the exception handlers.

Methods in org.objectweb.asm.commons that return MethodVisitor

Modifier and Type
Method and Description

protected MethodVisitor
RemappingClassAdapter.createRemappingMethodAdapter(int access,
                            String newDesc,
                            MethodVisitor mv)

MethodVisitor
StaticInitMerger.visitMethod(int access,
           String name,
           String desc,
           String signature,
           String[] exceptions)

MethodVisitor
SerialVersionUIDAdder.visitMethod(int access,
           String name,
           String desc,
           String signature,
           String[] exceptions)

MethodVisitor
RemappingClassAdapter.visitMethod(int access,
           String name,
           String desc,
           String signature,
           String[] exceptions)

Methods in org.objectweb.asm.commons with parameters of type MethodVisitor

Modifier and Type
Method and Description

protected MethodVisitor
RemappingClassAdapter.createRemappingMethodAdapter(int access,
                            String newDesc,
                            MethodVisitor mv)

Constructors in org.objectweb.asm.commons with parameters of type MethodVisitor

Constructor and Description

AdviceAdapter(int api,
             MethodVisitor mv,
             int access,
             String name,
             String desc)

Creates a new AdviceAdapter.

AnalyzerAdapter(int api,
               String owner,
               int access,
               String name,
               String desc,
               MethodVisitor mv)

Creates a new AnalyzerAdapter.

AnalyzerAdapter(String owner,
               int access,
               String name,
               String desc,
               MethodVisitor mv)

Creates a new AnalyzerAdapter.

CodeSizeEvaluator(int api,
                 MethodVisitor mv)

CodeSizeEvaluator(MethodVisitor mv)

GeneratorAdapter(int access,
                Method method,
                MethodVisitor mv)

Creates a new GeneratorAdapter.

GeneratorAdapter(int api,
                MethodVisitor mv,
                int access,
                String name,
                String desc)

Creates a new GeneratorAdapter.

GeneratorAdapter(MethodVisitor mv,
                int access,
                String name,
                String desc)

Creates a new GeneratorAdapter.

InstructionAdapter(int api,
                  MethodVisitor mv)

Creates a new InstructionAdapter.

InstructionAdapter(MethodVisitor mv)

Creates a new InstructionAdapter.

JSRInlinerAdapter(int api,
                 MethodVisitor mv,
                 int access,
                 String name,
                 String desc,
                 String signature,
                 String[] exceptions)

Creates a new JSRInliner.

JSRInlinerAdapter(MethodVisitor mv,
                 int access,
                 String name,
                 String desc,
                 String signature,
                 String[] exceptions)

Creates a new JSRInliner.

LocalVariablesSorter(int api,
                    int access,
                    String desc,
                    MethodVisitor mv)

Creates a new LocalVariablesSorter.

LocalVariablesSorter(int access,
                    String desc,
                    MethodVisitor mv)

Creates a new LocalVariablesSorter.

RemappingMethodAdapter(int api,
                      int access,
                      String desc,
                      MethodVisitor mv,
                      Remapper remapper)

RemappingMethodAdapter(int access,
                      String desc,
                      MethodVisitor mv,
                      Remapper remapper)

TryCatchBlockSorter(int api,
                   MethodVisitor mv,
                   int access,
                   String name,
                   String desc,
                   String signature,
                   String[] exceptions)

TryCatchBlockSorter(MethodVisitor mv,
                   int access,
                   String name,
                   String desc,
                   String signature,
                   String[] exceptions)

Uses of MethodVisitor in org.objectweb.asm.tree

Subclasses of MethodVisitor in org.objectweb.asm.tree

Modifier and Type
Class and Description

class
MethodNode

A node that represents a method.

Methods in org.objectweb.asm.tree that return MethodVisitor

Modifier and Type
Method and Description

MethodVisitor
ClassNode.visitMethod(int access,
           String name,
           String desc,
           String signature,
           String[] exceptions)

Methods in org.objectweb.asm.tree with parameters of type MethodVisitor

Modifier and Type
Method and Description

void
VarInsnNode.accept(MethodVisitor mv)

void
TypeInsnNode.accept(MethodVisitor mv)

void
TryCatchBlockNode.accept(MethodVisitor mv)

Makes the given visitor visit this try catch block.

void
TableSwitchInsnNode.accept(MethodVisitor mv)

void
ParameterNode.accept(MethodVisitor mv)

Makes the given visitor visit this parameter declaration.

void
MultiANewArrayInsnNode.accept(MethodVisitor mv)

void
MethodNode.accept(MethodVisitor mv)

Makes the given method visitor visit this method.

void
MethodInsnNode.accept(MethodVisitor mv)

void
LookupSwitchInsnNode.accept(MethodVisitor mv)

void
LocalVariableNode.accept(MethodVisitor mv)

Makes the given visitor visit this local variable declaration.

void
LineNumberNode.accept(MethodVisitor mv)

void
LdcInsnNode.accept(MethodVisitor mv)

void
LabelNode.accept(MethodVisitor cv)

void
JumpInsnNode.accept(MethodVisitor mv)

void
InvokeDynamicInsnNode.accept(MethodVisitor mv)

void
IntInsnNode.accept(MethodVisitor mv)

void
InsnNode.accept(MethodVisitor mv)

Makes the given visitor visit this instruction.

void
InsnList.accept(MethodVisitor mv)

Makes the given visitor visit all of the instructions in this list.

void
IincInsnNode.accept(MethodVisitor mv)

void
FrameNode.accept(MethodVisitor mv)

Makes the given visitor visit this stack map frame.

void
FieldInsnNode.accept(MethodVisitor mv)

abstract void
AbstractInsnNode.accept(MethodVisitor cv)

Makes the given code visitor visit this instruction.

void
LocalVariableAnnotationNode.accept(MethodVisitor mv,
      boolean visible)

Makes the given visitor visit this type annotation.

protected void
AbstractInsnNode.acceptAnnotations(MethodVisitor mv)

Makes the given visitor visit the annotations of this instruction.

Uses of MethodVisitor in org.objectweb.asm.util

Subclasses of MethodVisitor in org.objectweb.asm.util

Modifier and Type
Class and Description

class
CheckMethodAdapter

A MethodVisitor that checks that its methods are properly used.

class
TraceMethodVisitor

A MethodVisitor that prints the methods it visits with a
 Printer.

Methods in org.objectweb.asm.util that return MethodVisitor

Modifier and Type
Method and Description

MethodVisitor
TraceClassVisitor.visitMethod(int access,
           String name,
           String desc,
           String signature,
           String[] exceptions)

MethodVisitor
CheckClassAdapter.visitMethod(int access,
           String name,
           String desc,
           String signature,
           String[] exceptions)

Constructors in org.objectweb.asm.util with parameters of type MethodVisitor

Constructor and Description

CheckMethodAdapter(int api,
                  MethodVisitor mv,
                  Map<Label,Integer> labels)

Constructs a new CheckMethodAdapter object.

CheckMethodAdapter(int access,
                  String name,
                  String desc,
                  MethodVisitor cmv,
                  Map<Label,Integer> labels)

Constructs a new CheckMethodAdapter object.

CheckMethodAdapter(MethodVisitor mv)

Constructs a new CheckMethodAdapter object.

CheckMethodAdapter(MethodVisitor mv,
                  Map<Label,Integer> labels)

Constructs a new CheckMethodAdapter object.

TraceMethodVisitor(MethodVisitor mv,
                  Printer p)

Uses of MethodVisitor in org.objectweb.asm.xml

Subclasses of MethodVisitor in org.objectweb.asm.xml

Modifier and Type
Class and Description

class
SAXCodeAdapter

A MethodVisitor that generates SAX 2.0 events from the visited
 method.

Methods in org.objectweb.asm.xml that return MethodVisitor

Modifier and Type
Method and Description

protected MethodVisitor
ASMContentHandler.Rule.getCodeVisitor()

MethodVisitor
SAXClassAdapter.visitMethod(int access,
           String name,
           String desc,
           String signature,
           String[] exceptions)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes