text:
class PlacesController < ApplicationController

  get "/" do
    @recommendations = Place.all
    erb :read_recommendation
    # @places = Place.all
    #
    # erb :places
  end

  get "/place" do
    @places = Place.all
    erb :places
  end

  get "/create" do
    erb :create_recommendation
  end

  post "/create" do
    p params
    @rec = Place.new
    @rec.contributor = params[:contributor]
    @rec.place = params[:place]
    @rec.type_of_place = params[:type_of_place]
    @rec.notes = params[:notes]
    @rec.save
    erb :index
  end

  get "/api" do
    # SELECT * FROM recommendations;
    return Place.all.to_json
  end

  get "/api/:id" do
    p params
    return Place.find(params[:id]).to_json
  end

end


text:
  Souyeaux est
       un village
       géographiquement positionné dans le département des Hautes-Pyrénées en Midi-Pyrénées. On dénombrait 265 habitants en 2008.

Souyeaux est localisé à seulement 8 km de Tarbes, les étudiants qui voudrons se loger à pas cher pourront envisager de prendre un logement à Souyeaux. Souyeaux est aussi un bon investissement locatif a cause de sa proximité de Tarbes et de ses Universités. Il sera facile de trouver un appartement à vendre.

La ville offre quelques  équipements, elle dispose, entre autres, de un terrain de sport.

À coté de Souyeaux sont situées les villes de
Lansac située à 2 km, 149 habitants,
Laslades à 1 km, 333 habitants,
Marquerie située à 3 km, 63 habitants,
Boulin localisée à 3 km, 295 habitants,
Sarrouilles localisée à 3 km, 568 habitants,
Coussan située à 2 km, 120 habitants,
 entre autres. De plus, Souyeaux est située à seulement huit km de Tarbes.

Le parc d'habitations, à Souyeaux, se décomposait en 2011 en trois appartements et 121 maisons soit
 un marché plutôt équilibré.

Si vous envisagez de demenager à Souyeaux, vous pourrez facilement trouver une maison à acheter.

redpajama_set_name: RedPajamaGithub


text:
#include <stdio.h>

//#include "../game/q_shared.h"
//#include "../client/snd_local.h"
#include "../client/client.h"
#include "../client/snd_loc.h"

#define LOG_TAG "QSound"
#include <android/log.h>

#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)

static int  snd_inited;

/* The audio callback. All the magic happens here. */
static int dmapos = 0;
static int dmasize = 0;

/*
===============
SNDDMA_AudioCallback
===============
*/
void SNDDMA_AudioCallback(void *userdata, void *stream, int len)
{
	int pos = (dmapos * (dma.samplebits/8));
	if (pos >= dmasize)
		dmapos = pos = 0;

	if (!snd_inited)  /* shouldn't happen, but just in case... */
	{
		memset(stream, '\0', len);
		return;
	}
	else
	{
		int tobufend = dmasize - pos;  /* bytes to buffer's end. */
		int len1 = len;
		int len2 = 0;

		if (len1 > tobufend)
		{
			len1 = tobufend;
			len2 = len - len1;
		}
		memcpy(stream, dma.buffer + pos, len1);
		if (len2 <= 0)
			dmapos += (len1 / (dma.samplebits/8));
		else  /* wraparound? */
		{
			memcpy(stream+len1, dma.buffer, len2);
			dmapos = (len2 / (dma.samplebits/8));
		}
	}

	if (dmapos >= dmasize)
		dmapos = 0;
}

// SNDDMA_AudioCallback is a better implementaion
int paint_audio (void *unused, void * stream, int len)
{
	if (!snd_inited) return 0;
	//if (dma) {
		dma.buffer = (unsigned char *)stream;
		dma.samplepos += len / (dma.samplebits / 4);
		// Check for samplepos overflow?
		S_PaintChannels (dma.samplepos);
		return len;
	//}
	return 0;
}

qboolean SNDDMA_Init(void)
{

	 // most of the wav files are 16 bits, 22050 Hz, mono
	/* Fill the audio DMA information block */
	//shm = &sn;

	dma.samplebits = 16;

	// malloc max : 7 MB  => -12 MB !!
	dma.speed = 22050;
	dma.channels = 2;

	LOGD("SNDDMA_Init Speed %d channels %d", dma.speed, dma.channels);

	dmapos = 0;

	// 2048 (= 100 ms) better for multithreading ?

	dma.samples = 32768; //2048 * dma.channels;
	dma.samplepos = 0;
	dma.submission_chunk = 1;

	dmasize = (dma.samples * (dma.samplebits/8));
	dma.buffer = calloc(1, dmasize);

	//dma.buffer = NULL;

	snd_inited = 1;

	return 1;
}

int SNDDMA_GetDMAPos(void)
{
	//return dma.samplepos;
	return dmapos;
}

void SNDDMA_Shutdown(void)
{
	free(dma.buffer);
	dma.buffer = NULL;
	dmapos = dmasize = 0;
	snd_inited = 0;
	Com_Printf("SDL audio device shut down.\n");

	if (snd_inited)
	{
		snd_inited = 0;
	}
}

/*
==============
SNDDMA_Submit

Send sound to device if buffer isn't really the dma buffer
===============
*/
void SNDDMA_Submit(void)
{
}

void SNDDMA_BeginPainting( void ) {
}


text:
package com.camunda.bpm.demo.extension_attributes_for_user_tasks.nonarquillian;

import org.camunda.bpm.engine.impl.util.LogUtil;
import org.camunda.bpm.engine.task.Task;
import org.camunda.bpm.engine.test.ProcessEngineTestCase;
import org.camunda.bpm.engine.test.Deployment;

/**
 * Test case starting an in-memory database-backed Process Engine.
 */
public class InMemoryH2Test extends ProcessEngineTestCase {

  private static final String PROCESS_DEFINITION_KEY = "extension-attributes-for-user-tasks";

  // enable more detailed logging
  static {
    LogUtil.readJavaUtilLoggingConfigFromClasspath();
  }

  /**
   * Just tests if the process definition is deployable.
   */
  @Deployment(resources = "process.bpmn")
  public void testParsingAndDeployment() {
    // nothing is done here, as we just want to check for exceptions during deployment
  }

  @Deployment(resources = "process.bpmn")
  public void testExec() {
	  runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY);
	  Task task = taskService.createTaskQuery().singleResult();
	  assertNotNull(task);
	  assertNotNull(task.getDueDate());
  }

}


text:
import decimal
import json
from datetime import date, datetime, time

from django.core.cache import cache
from typing import Any, Dict, Optional

import dateutil.parser
from django.conf import settings
from django.core.files import File
from django.core.files.storage import default_storage
from django.db.models import Model
from django.utils.translation import ugettext_noop

from i18nfield.strings import LazyI18nString
from pretix.base.models.settings import GlobalSetting

DEFAULTS = {
    'max_items_per_order': {
        'default': '10',
        'type': int
    },
    'display_net_prices': {
        'default': 'False',
        'type': bool
    },
    'attendee_names_asked': {
        'default': 'True',
        'type': bool
    },
    'attendee_names_required': {
        'default': 'False',
        'type': bool
    },
    'invoice_address_asked': {
        'default': 'True',
        'type': bool,
    },
    'invoice_address_required': {
        'default': 'False',
        'type': bool,
    },
    'invoice_address_vatid': {
        'default': 'False',
        'type': bool,
    },
    'invoice_numbers_consecutive': {
        'default': 'True',
        'type': bool,
    },
    'reservation_time': {
        'default': '30',
        'type': int
    },
    'payment_term_days': {
        'default': '14',
        'type': int
    },
    'payment_term_last': {
        'default': None,
        'type': datetime,
    },
    'payment_term_weekdays': {
        'default': 'True',
        'type': bool
    },
    'payment_term_expire_automatically': {
        'default': 'True',
        'type': bool
    },
    'payment_term_accept_late': {
        'default': 'True',
        'type': bool
    },
    'presale_start_show_date': {
        'default': 'True',
        'type': bool
    },
    'tax_rate_default': {
        'default': '0.00',
        'type': decimal.Decimal
    },
    'invoice_generate': {
        'default': 'False',
        'type': str
    },
    'invoice_address_from': {
        'default': '',
        'type': str
    },
    'invoice_introductory_text': {
        'default': '',
        'type': LazyI18nString
    },
    'invoice_additional_text': {
        'default': '',
        'type': LazyI18nString
    },
    'invoice_footer_text': {
        'default': '',
        'type': LazyI18nString
    },
    'invoice_language': {
        'default': '__user__',
        'type': str
    },
    'show_items_outside_presale_period': {
        'default': 'True',
        'type': bool
    },
    'timezone': {
        'default': settings.TIME_ZONE,
        'type': str
    },
    'locales': {
        'default': json.dumps([settings.LANGUAGE_CODE]),
        'type': list
    },
    'locale': {
        'default': settings.LANGUAGE_CODE,
        'type': str
    },
    'show_date_to': {
        'default': 'True',
        'type': bool
    },
    'show_times': {
        'default': 'True',
        'type': bool
    },
    'show_quota_left': {
        'default': 'False',
        'type': bool
    },
    'show_variations_expanded': {
        'default': 'False',
        'type': bool
    },
    'waiting_list_enabled': {
        'default': 'False',
        'type': bool
    },
    'waiting_list_auto': {
        'default': 'True',
        'type': bool
    },
    'waiting_list_hours': {
        'default': '48',
        'type': int
    },
    'ticket_download': {
        'default': 'False',
        'type': bool
    },
    'ticket_download_date': {
        'default': None,
        'type': datetime
    },
    'last_order_modification_date': {
        'default': None,
        'type': datetime
    },
    'cancel_allow_user': {
        'default': 'True',
        'type': bool
    },
    'contact_mail': {
        'default': None,
        'type': str
    },
    'imprint_url': {
        'default': None,
        'type': str
    },
    'mail_prefix': {
        'default': None,
        'type': str
    },
    'mail_from': {
        'default': settings.MAIL_FROM,
        'type': str
    },
    'mail_text_resend_link': {
        'type': LazyI18nString,
        'default': LazyI18nString.from_gettext(ugettext_noop("""Hello,

you receive this message because you asked us to send you the link
to your order for {event}.

You can change your order details and view the status of your order at
{url}

Best regards,
Your {event} team"""))
    },
    'mail_text_resend_all_links': {
        'type': LazyI18nString,
        'default': LazyI18nString.from_gettext(ugettext_noop("""Hello,

somebody requested a list of your orders for {event}.
The list is as follows:

{orders}

Best regards,
Your {event} team"""))
    },
    'mail_text_order_free': {
        'type': LazyI18nString,
        'default': LazyI18nString.from_gettext(ugettext_noop("""Hello,

we successfully received your order for {event}. As you only ordered
free products, no payment is required.

You can change your order details and view the status of your order at
{url}

Best regards,
Your {event} team"""))
    },
    'mail_text_order_placed': {
        'type': LazyI18nString,
        'default': LazyI18nString.from_gettext(ugettext_noop("""Hello,

we successfully received your order for {event} with a total value
of {total} {currency}. Please complete your payment before {date}.

{paymentinfo}

You can change your order details and view the status of your order at
{url}

Best regards,
Your {event} team"""))
    },
    'mail_text_order_changed': {
        'type': LazyI18nString,
        'default': LazyI18nString.from_gettext(ugettext_noop("""Hello,

your order for {event} has been changed.

You can view the status of your order at
{url}

Best regards,
Your {event} team"""))
    },
    'mail_text_order_paid': {
        'type': LazyI18nString,
        'default': LazyI18nString.from_gettext(ugettext_noop("""Hello,

we successfully received your payment for {event}. Thank you!

{payment_info}

You can change your order details and view the status of your order at
{url}

Best regards,
Your {event} team"""))
    },
    'mail_days_order_expire_warning': {
        'type': int,
        'default': '3'
    },
    'mail_text_order_expire_warning': {
        'type': LazyI18nString,
        'default': LazyI18nString.from_gettext(ugettext_noop("""Hello,

we did not yet receive a payment for your order for {event}.
Please keep in mind that if we only guarantee your order if we receive
your payment before {expire_date}.

You can view the payment information and the status of your order at
{url}

Best regards,
Your {event} team"""))
    },
    'mail_text_waiting_list': {
        'type': LazyI18nString,
        'default': LazyI18nString.from_gettext(ugettext_noop("""Hello,

you submitted yourself to the waiting list for {event},
for the product {product}.

We now have a ticket ready for you! You can redeem it in our ticket shop
within the next {hours} hours by entering the following voucher code:

{code}

Alternatively, you can just click on the following link:

{url}

Please note that this link is only valid within the next {hours} hours!
We will reassign the ticket to the next person on the list if you do not
redeem the voucher within that timeframe.

Best regards,
Your {event} team"""))
    },
    'smtp_use_custom': {
        'default': 'False',
        'type': bool
    },
    'smtp_host': {
        'default': '',
        'type': str
    },
    'smtp_port': {
        'default': 587,
        'type': int
    },
    'smtp_username': {
        'default': '',
        'type': str
    },
    'smtp_password': {
        'default': '',
        'type': str
    },
    'smtp_use_tls': {
        'default': 'True',
        'type': bool
    },
    'smtp_use_ssl': {
        'default': 'False',
        'type': bool
    },
    'primary_color': {
        'default': '#8E44B3',
        'type': str
    },
    'presale_css_file': {
        'default': None,
        'type': str
    },
    'presale_css_checksum': {
        'default': None,
        'type': str
    },
    'logo_image': {
        'default': None,
        'type': File
    },
    'invoice_logo_image': {
        'default': None,
        'type': File
    },
    'frontpage_text': {
        'default': '',
        'type': LazyI18nString
    }
}

class SettingsProxy:
    """
    This object allows convenient access to settings stored in the
    EventSettings/OrganizerSettings database model. It exposes all settings as
    properties and it will do all the nasty inheritance and defaults stuff for
    you.
    """

    def __init__(self, obj: Model, parent: Optional[Model]=None, type=None):
        self._obj = obj
        self._parent = parent
        self._cached_obj = None
        self._write_cached_obj = None
        self._type = type

    def _cache(self) -> Dict[str, Any]:
        if self._cached_obj is None:
            self._cached_obj = cache.get_or_set(
                'settings_{}_{}'.format(self._obj.settings_namespace, self._obj.pk),
                lambda: {s.key: s.value for s in self._obj.setting_objects.all()},
                timeout=1800
            )
        return self._cached_obj

    def _write_cache(self) -> Dict[str, Any]:
        if self._write_cached_obj is None:
            self._write_cached_obj = {
                s.key: s for s in self._obj.setting_objects.all()
            }
        return self._write_cached_obj

    def _flush(self) -> None:
        self._cached_obj = None
        self._write_cached_obj = None
        self._flush_external_cache()

    def _flush_external_cache(self):
        cache.delete('settings_{}_{}'.format(self._obj.settings_namespace, self._obj.pk))

    def freeze(self) -> dict:
        """
        Returns a dictionary of all settings set for this object, including
        any default values of its parents or hardcoded in pretix.
        """
        settings = {}
        for key, v in DEFAULTS.items():
            settings[key] = self._unserialize(v['default'], v['type'])
        if self._parent:
            settings.update(self._parent.settings.freeze())
        for key in self._cache():
            settings[key] = self.get(key)
        return settings

    def _unserialize(self, value: str, as_type: type, binary_file=False) -> Any:
        if as_type is None and value is not None and value.startswith('file://'):
            as_type = File

        if as_type is not None and isinstance(value, as_type):
            return value
        elif value is None:
            return None
        elif as_type == int or as_type == float or as_type == decimal.Decimal:
            return as_type(value)
        elif as_type == dict or as_type == list:
            return json.loads(value)
        elif as_type == bool or value in ('True', 'False'):
            return value == 'True'
        elif as_type == File:
            try:
                fi = default_storage.open(value[7:], 'rb' if binary_file else 'r')
                fi.url = default_storage.url(value[7:])
                return fi
            except OSError:
                return False
        elif as_type == datetime:
            return dateutil.parser.parse(value)
        elif as_type == date:
            return dateutil.parser.parse(value).date()
        elif as_type == time:
            return dateutil.parser.parse(value).time()
        elif as_type == LazyI18nString and not isinstance(value, LazyI18nString):
            try:
                return LazyI18nString(json.loads(value))
            except ValueError:
                return LazyI18nString(str(value))
        elif as_type is not None and issubclass(as_type, Model):
            return as_type.objects.get(pk=value)
        return value

    def _serialize(self, value: Any) -> str:
        if isinstance(value, str):
            return value
        elif isinstance(value, int) or isinstance(value, float) \
                or isinstance(value, bool) or isinstance(value, decimal.Decimal):
            return str(value)
        elif isinstance(value, list) or isinstance(value, dict):
            return json.dumps(value)
        elif isinstance(value, datetime) or isinstance(value, date) or isinstance(value, time):
            return value.isoformat()
        elif isinstance(value, Model):
            return value.pk
        elif isinstance(value, LazyI18nString):
            return json.dumps(value.data)
        elif isinstance(value, File):
            return 'file://' + value.name

        raise TypeError('Unable to serialize %s into a setting.' % str(type(value)))

    def get(self, key: str, default=None, as_type: type=None, binary_file=False):
        """
        Get a setting specified by key ``key``. Normally, settings are strings, but
        if you put non-strings into the settings object, you can request unserialization
        by specifying ``as_type``. If the key does not have a harcdoded type in the pretix source,
        omitting ``as_type`` always will get you a string.

        If the setting with the specified name does not exist on this object, any parent object
        will be queried (e.g. the organizer of an event). If still no value is found, a default
        value hardcoded will be returned if one exists. If not, the value of the ``default`` argument
        will be returned instead.
        """
        if as_type is None and key in DEFAULTS:
            as_type = DEFAULTS[key]['type']

        if key in self._cache():
            value = self._cache()[key]
        else:
            value = None
            if self._parent:
                value = self._parent.settings.get(key, as_type=str)
            if value is None and key in DEFAULTS:
                value = DEFAULTS[key]['default']
            if value is None and default is not None:
                value = default

        return self._unserialize(value, as_type, binary_file=binary_file)

    def __getitem__(self, key: str) -> Any:
        return self.get(key)

    def __getattr__(self, key: str) -> Any:
        if key.startswith('_'):
            return super().__getattr__(key)
        return self.get(key)

    def __setattr__(self, key: str, value: Any) -> None:
        if key.startswith('_'):
            return super().__setattr__(key, value)
        self.set(key, value)

    def __setitem__(self, key: str, value: Any) -> None:
        self.set(key, value)

    def set(self, key: str, value: Any) -> None:
        """
        Stores a setting to the database of its object.
        """
        wc = self._write_cache()
        if key in wc:
            s = wc[key]
        else:
            s = self._type(object=self._obj, key=key)
        s.value = self._serialize(value)
        s.save()
        self._cache()[key] = s.value
        wc[key] = s
        self._flush_external_cache()

    def __delattr__(self, key: str) -> None:
        if key.startswith('_'):
            return super().__delattr__(key)
        self.delete(key)

    def __delitem__(self, key: str) -> None:
        self.delete(key)

    def delete(self, key: str) -> None:
        """
        Deletes a setting from this object's storage.
        """
        if key in self._write_cache():
            self._write_cache()[key].delete()
            del self._write_cache()[key]

        if key in self._cache():
            del self._cache()[key]

        self._flush_external_cache()

class SettingsSandbox:
    """
    Transparently proxied access to event settings, handling your prefixes for you.

    :param typestr: The first part of the pretix, e.g. ``plugin``
    :param key: The prefix, e.g. the name of your plugin
    :param obj: The event or organizer that should be queried
    """

    def __init__(self, typestr: str, key: str, obj: Model):
        self._event = obj
        self._type = typestr
        self._key = key

    def _convert_key(self, key: str) -> str:
        return '%s_%s_%s' % (self._type, self._key, key)

    def __setitem__(self, key: str, value: Any) -> None:
        self.set(key, value)

    def __setattr__(self, key: str, value: Any) -> None:
        if key.startswith('_'):
            return super().__setattr__(key, value)
        self.set(key, value)

    def __getattr__(self, item: str) -> Any:
        return self.get(item)

    def __getitem__(self, item: str) -> Any:
        return self.get(item)

    def __delitem__(self, key: str) -> None:
        del self._event.settings[self._convert_key(key)]

    def __delattr__(self, key: str) -> None:
        del self._event.settings[self._convert_key(key)]

    def get(self, key: str, default: Any=None, as_type: type=str):
        return self._event.settings.get(self._convert_key(key), default=default, as_type=as_type)

    def set(self, key: str, value: Any):
        self._event.settings.set(self._convert_key(key), value)

class GlobalSettingsObject():
    settings_namespace = 'global'

    def __init__(self):
        self.settings = SettingsProxy(self, type=GlobalSetting)
        self.setting_objects = GlobalSetting.objects
        self.slug = '_global'
        self.pk = '_global'


text:
#ifndef nucleo_h
#define nucleo_h
#include <SDL/SDL.h>
#include "galeria.h"
#include "configuration.h"
#include "utils.h"

using namespace std;

/// Tipos de Escena dentro del programa
enum escenas {ESCENA_MENU, ESCENA_JUEGO};

class Nucleo
{
    public:
		Nucleo(int i_fullscreen, int i_depth);
		~Nucleo();
		void terminar(int reason);

        class Galeria       *r_galeria;       // Galeria de graficas
        class Configuration *r_configuration; // Todos los datos de config.dat
        class Utils         *r_utils;         // Red telon, messagebox, etc
        SDL_Surface         *sdls_screen;     // Puntero a la Display Surface
        struct {
            int enabled; // 1 si esta activado el subsistema, 0 si no lo esta.
            /*TODO: Punteros a toda la informacion
                    global del subsistema Multiplayer*/
        } d_multiplayer;

    private:
        void init_SDL(void);
        void create_DisplaySurface(int i_fullscreen, int i_depth);
		void bucle_principal(void);
		void cambiar_escena(enum escenas nueva);
		void capture_events(void);

  		class Escena      *e_actual;      //  }
  		class Menu        *e_menu;        //  } 3 Escenas.
		class Juego       *e_juego;       //  }
		class Multiplayer *s_multiplayer; /* Subsistema que maneja toda la
                                          conectividad del juego. */
};

/*
    public:
		Nucleo(int i_fullscreen, int i_depth);
		~Nucleo();
		void bucle_principal (void);
		void cambiar_escena  (enum escenas nueva);
		void red_telon       (void);
		void terminar        (void);

        SDL_Surface          *screen; // --> The Screen
        Configuration        *configuration;
		class Galeria        *galeria;

    private:
		void iniciar_ventana   (Uint8 resolucion, bool fullscreen);
		void pantalla_completa (void);
		void input_refresh     (void);
		int  sincronizar_fps   (void);

        SDL_Surface     *old_scene;
  		class Escena    *actual;
		class Juego     *juego;
		class Opciones  *opciones;
		class Menu      *menu;
		class Game_Over *game_over;

        //TODO: Averiguar si sirven para algo.
        bool salir;
		int  menu_index;
};*/

#endif


text:
class Foo(val d: Double) extends AnyVal {
  override def toString = s"Foo($d)"
}

class Bar(val d: String) extends AnyVal {
  override def toString = s"Foo($d)"
}

object Test {
  def main(args: Array[String]): Unit = {
    val f: Foo = {val n: Any = null; n.asInstanceOf[Foo]}
    println(f)

    val b: Bar = {val n: Any = null; n.asInstanceOf[Bar]}
    println(b)
  }
}


text:
namespace WakeyWakey {
	partial class Main {
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose( bool disposing ) {
			if( disposing && ( components != null ) ) {
				components.Dispose();
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent() {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main));
            this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
            this.notifyIconStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.notifyIconStrip.SuspendLayout();
            this.SuspendLayout();
            //
            // notifyIcon
            //
            this.notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon.Icon")));
            this.notifyIcon.Text = "Nothing to report";
            this.notifyIcon.Visible = true;
            //
            // notifyIconStrip
            //
            this.notifyIconStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.exitToolStripMenuItem});
            this.notifyIconStrip.Name = "notifyIconStrip";
            this.notifyIconStrip.Size = new System.Drawing.Size(93, 26);
            //
            // exitToolStripMenuItem
            //
            this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
            this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22);
            this.exitToolStripMenuItem.Text = "Exit";
            this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
            //
            // Main
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(284, 261);
            this.Name = "Main";
            this.ShowInTaskbar = false;
            this.Text = "WakeyWakey";
            this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
            this.notifyIconStrip.ResumeLayout(false);
            this.ResumeLayout(false);

		}

		#endregion

		private System.Windows.Forms.NotifyIcon notifyIcon;
		private System.Windows.Forms.ContextMenuStrip notifyIconStrip;
		private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CocosSharp;

namespace tests
{
    public class SceneTestLayer2 : CCLayer
    {
        float m_timeCounter;
		private CCMenuItemFont popMenuItem;
		private CCMenu theMenu;

        public SceneTestLayer2()
        {
            m_timeCounter = 0;

            CCMenuItemFont item1 = new CCMenuItemFont("(2) replaceScene", onReplaceScene);
            CCMenuItemFont item2 = new CCMenuItemFont("(2) replaceScene w/transition", onReplaceSceneTran);
            CCMenuItemFont item3 = new CCMenuItemFont("(2) Go Back", onGoBack);
            popMenuItem = new CCMenuItemFont("(2) Test popScene w/transition", onPopSceneTran);

			theMenu = new CCMenu(item1, item2, item3, popMenuItem);
            theMenu.AlignItemsVertically();

            AddChild(theMenu);

			CCSprite sprite = new CCSprite(SceneTestScene.grossini) { Tag = SceneTestScene.GROSSINI_TAG };
            AddChild(sprite);
        }

		public override void OnEnter()
		{
			base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size;

            CCLog.Log("SceneTestLayer2#OnEnter - Can Pop Scene = {0} - {1}", Director.CanPopScene, Director.SceneCount);
            popMenuItem.Visible = Director.CanPopScene;
            theMenu.AlignItemsVertically(12f);

			var sprite = this[SceneTestScene.GROSSINI_TAG];
			var s = windowSize;
			sprite.Position = new CCPoint(s.Width - 40, s.Height / 2);
			sprite.RepeatForever(SceneTestScene.rotate);

			Schedule(testDealloc);

		}

        public void testDealloc(float dt)
        {
            //m_timeCounter += dt;
            //if( m_timeCounter > 10 )
            //	onReplaceScene(this);
        }

        public void onGoBack(object pSender)
        {
            Director.PopScene();
        }

		public override void OnExit()
		{
			base.OnExit();
			CCLog.Log("SceneTestLayer2#OnExit - Can Pop Scene = {0} - {1}", Director.CanPopScene, Director.SceneCount);
		}

        public void onReplaceScene(object pSender)
        {
            CCScene pScene = new SceneTestScene();
            CCLayer pLayer = new SceneTestLayer3();
            pScene.AddChild(pLayer, 0);
           	Director.ReplaceScene(pScene);
        }

        public void onReplaceSceneTran(object pSender)
        {
            CCScene pScene = new SceneTestScene();
            CCLayer pLayer = new SceneTestLayer3();
            pScene.AddChild(pLayer, 0);
            Director.ReplaceScene(new CCTransitionFlipX(2, pScene, CCTransitionOrientation.UpOver));
        }

        public void onPopSceneTran(object pSender)
        {
            CCScene scene = new SceneTestScene();
            CCLayer pLayer = new SceneTestLayer1();
            scene.AddChild(pLayer, 0);

            Director.PopScene(1f, new CCTransitionSlideInB(1f, scene));
        }
    }
}


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>boost/python/type_id.hpp</title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../index.html" title="Boost.Python Reference Manual">
<link rel="up" href="../utility_and_infrastructure.html" title="Chapter 7. Utility and Infrastructure">
<link rel="prev" href="boost_python_handle_hpp.html" title="boost/python/handle.hpp">
<link rel="next" href="boost_python_ssize_t_hpp.html" title="boost/python/ssize_t.hpp">

boost/python/type_id.hpp

Introduction

Class
        template type_info

Functions

Example

Introduction

          <boost/python/type_id.hpp> provides types and functions for runtime
          type identification like those of of <typeinfo>.
          It exists mostly to work around certain compiler bugs and platform-dependent
          interactions with shared libraries.

Class
        template type_info

Class
          template type_info constructor

Class
          template type_info comparison

Class
          template type_info observers

          type_info instances identify
          a type. As std::type_info is specified to (but unlike
          its implementation in some compilers), boost::python::type_info
          never represents top-level references or cv-qualification (see section
          5.2.8 in the C++ standard). Unlike std::type_info,
          boost::python::type_info instances are copyable, and
          comparisons always work reliably across shared library boundaries.

namespace boost { namespace python
{
  class type_info : totally_ordered<type_info>
  {
  public:
    // constructor
    type_info(std::type_info const& = typeid(void));

    // comparisons
    bool operator<(type_info const& rhs) const;
    bool operator==(type_info const& rhs) const;

    // observers
    char const* name() const;
  };
}}

Class
          template type_info constructor

type_info(std::type_info const& = typeid(void));

Effects

                  constructs a type_info
                  object which identifies the same type as its argument.

Rationale

                  Since it is occasionally necessary to make an array of type_info objects a benign default
                  argument is supplied. Note: this constructor does not correct for
                  non-conformance of compiler typeid() implementations. See type_id, below.

Class
          template type_info comparison

bool operator<(type_info const &rhs) const;

Effects

                  yields a total order over type_info
                  objects.

bool operator==(type_info const &rhs) const;

Returns

                  true iff the two values
                  describe the same type.

Note

                  The use of totally_ordered<type_info> as a private base class supplies
                  operators <=,
                  >=, >, and !=

Class
          template type_info observers

char const* name() const;

Returns

                  The result of calling name() on the argument used to construct
                  the object.

Functions

std::ostream& operator<<(std::ostream&s, type_info const&x);

Effects

                Writes a description of the type described by to x
                into s.

Rationale

                Not every C++ implementation provides a truly human-readable type_info::name()
                string, but for some we may be able to decode the string and produce
                a reasonable representation.

Note

                On some non-conforming C++ implementations, the code is not actually
                as simple as described above; the semantics are adjusted to work
                as-if the C++ implementation were conforming.

template <class T> type_info type_id()

Returns

                type_info(typeid(T))

Note

                On some non-conforming C++ implementations, the code is not actually
                as simple as described above; the semantics are adjusted to work
                as-if the C++ implementation were conforming.

Example

          The following example, though silly, illustrates how the type_id facility
          might be used

#include <boost/python/type_id.hpp>

// Returns true iff the user passes an int argument
template <class T>
bool is_int(T x)
{
   using boost::python::type_id;
   return type_id<T>() == type_id<int>();
}

Copyright © 2002-2005, 2015 David Abrahams, Stefan Seefeld

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt


text:
<?php

namespace Yappkahowe\ArtisanComplement;

use Illuminate\Console\GeneratorCommand;
use Illuminate\Support\Str;
use Symfony\Component\Console\Input\InputOption;
use InvalidArgumentException;

class ObserverMakeCommand extends GeneratorCommand
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'make:observer';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Create a new observer class';

    /**
     * The type of class being generated.
     *
     * @var string
     */
    protected $type = 'Observer';

    /**
     * Determine if the class already exists.
     *
     * @param  string  $rawName
     * @return bool
     */
    protected function alreadyExists($rawName)
    {
        return class_exists($rawName);
    }

    /**
     * Get the stub file for the generator.
     *
     * @return string
     */
    protected function getStub()
    {
        return __DIR__.'/stubs/observer.stub';
    }

    /**
     * Get the default namespace for the class.
     *
     * @param  string  $rootNamespace
     * @return string
     */
    protected function getDefaultNamespace($rootNamespace)
    {
        return $rootNamespace.'\Observers';
    }

    /**
     * Build the class with the given name.
     *
     * Remove the base controller import if we are already in base namespace.
     *
     * @param  string  $name
     * @return string
     */
    protected function buildClass($name)
    {
        $replace = [];

        if ($this->option('model')) {
            $replace = $this->buildModelReplacements($replace);
        }

        return str_replace(
            array_keys($replace), array_values($replace), parent::buildClass($name)
        );
    }

    /**
     * Build the model replacement values.
     *
     * @param  array  $replace
     * @return array
     */
    protected function buildModelReplacements(array $replace)
    {
        $modelClass = $this->parseModel($this->option('model'));

        if (! class_exists($modelClass)) {
            if ($this->confirm("A {$modelClass} model does not exist. Do you want to generate it?", true)) {
                $this->call('make:model', ['name' => $modelClass]);
            }
        }

        return array_merge($replace, [
            'DummyFullModelClass' => $modelClass,
            'DummyModelClass' => class_basename($modelClass),
            'DummyModelVariable' => lcfirst(class_basename($modelClass)),
        ]);
    }

    /**
     * Get the fully-qualified model class name.
     *
     * @param  string  $model
     * @return string
     */
    protected function parseModel($model)
    {
        if (preg_match('([^A-Za-z0-9_/\\\\])', $model)) {
            throw new InvalidArgumentException('Model name contains invalid characters.');
        }

        $model = trim(str_replace('/', '\\', $model), '\\');

        if (! Str::startsWith($model, $rootNamespace = $this->laravel->getNamespace())) {
            $model = $rootNamespace.$model;
        }

        return $model;
    }

    /**
     * Get the console command options.
     *
     * @return array
     */
    protected function getOptions()
    {
        return [
            ['model', 'm', InputOption::VALUE_REQUIRED, 'Generate an observer for the given model.'],
        ];
    }
}