text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MIMWebClient.Core.Events;

namespace MIMWebClient.Core.Player.Skills
{
    using System.Runtime.CompilerServices;

    using MIMWebClient.Core.PlayerSetup;
    using MIMWebClient.Core.Room;

    public class DirtKick: Skill
    {

        public static Skill DirtKickSkill { get; set; }
        public static Skill DirtKickAb()
        {

            if (DirtKickSkill != null)
            {
               return DirtKickSkill;
            }
            else
            {
                var skill = new Skill
                {
                    Name = "Dirt Kick",
                    CoolDown = 0,
                    Delay = 0,
                    LevelObtained = 7,
                    Proficiency = 1,
                    MaxProficiency = 95,
                    Passive = true,
                    UsableFromStatus = "Standing",
                    Syntax = "Passive command",
                    HelpText = new Help()
                    {
                        HelpText = "Dirt kick help text",
                        DateUpdated = new DateTime().ToShortDateString()
                    }
                };

                DirtKickSkill = skill;
            }

            return DirtKickSkill;

        }

        public  void StartDirtKick(IHubContext context, PlayerSetup.Player player, Room room, string target = "")
        {
            //Check if player has spell
            var hasSkill = Skill.CheckPlayerHasSkill(player, DirtKickAb().Name);

            if (hasSkill == false)
            {
                context.SendToClient("You don't know that skill.", player.HubGuid);
                return;
            }

            var canDoSkill = Skill.CanDoSkill(player);

            if (!canDoSkill)
            {
                return;
            }

            if (string.IsNullOrEmpty(target) && player.Target != null)
            {
                target = player.Target.Name;
            }

            var _target = Skill.FindTarget(target, room);

            //Fix issue if target has similar name to user and they use abbrivations to target them
            if (_target == player)
            {
                _target = null;
            }

            if (player.ActiveSkill != null)
            {

                context.SendToClient("wait till you have finished " + player.ActiveSkill.Name, player.HubGuid);
                return;

            }
            else
            {
                player.ActiveSkill = DirtKickAb();
            }

            if (_target != null)
            {

                if (_target.HitPoints <= 0)
                {
                    context.SendToClient("You can't dirt kick them as they are dead.", player.HubGuid);
                    return;

                }

                if (player.MovePoints < DirtKickAb().MovesCost)
                {

                    context.SendToClient("You are too tired to use dirt kick.", player.HubGuid);
                    player.ActiveSkill = null;

                    return;
                }

                player.MovePoints -= DirtKickAb().MovesCost;

                Score.UpdateUiPrompt(player);

                var chanceOfSuccess = Helpers.Rand(1, 100);
                var skill = player.Skills.FirstOrDefault(x => x.Name.Equals("Dirt Kick"));
                if (skill == null)
                {
                    player.ActiveSkill = null;
                    return;
                }

                var skillProf = skill.Proficiency;

                if (skillProf >= chanceOfSuccess)
                {
                     Task.Run(() => DoSkill(context, player, _target, room));
                }
                else
                {
                    player.ActiveSkill = null;
                    HubContext.Instance.SendToClient("You don't see any dirt here to kick.",
                        player.HubGuid);
                    PlayerSetup.Player.LearnFromMistake(player, DirtKickAb(), 250);

                    Score.ReturnScoreUI(player);
                }
            }
            else if (_target == null)
            {
                context.SendToClient($"You can't find anything known as '{target}' here.", player.HubGuid);
                player.ActiveSkill = null;
            }

        }

        private int DirtKickSuccess(PlayerSetup.Player attacker, PlayerSetup.Player target)
        {
            var success = 2 * attacker.Dexterity - target.Dexterity + (attacker.Level - target.Level) * 2;

            if (attacker.Effects.FirstOrDefault(x => x.Name.Equals("Haste")) != null)
            {
                success += 10;
            }

            if (target.Effects.FirstOrDefault(x => x.Name.Equals("Haste")) != null)
            {
                success -= 25;
            }

            if (success <= 0)
            {
                success = 1;
            }

            return success;
        }

        private async Task DoSkill(IHubContext context, PlayerSetup.Player attacker, PlayerSetup.Player target, Room room)
        {

            attacker.Status = PlayerSetup.Player.PlayerStatus.Busy;

            await Task.Delay(500);

            if (attacker.ManaPoints < DirtKickAb().MovesCost)
            {
                context.SendToClient("You are too tired to use dirt kick.", attacker.HubGuid);
                attacker.ActiveSkill = null;
                PlayerSetup.Player.SetState(attacker);
                return;
            }

            if (Effect.HasEffect(target, Effect.Blindness(attacker).Name))
            {
                context.SendToClient("They are already blinded.", attacker.HubGuid);
                attacker.ActiveSkill = null;
                PlayerSetup.Player.SetState(attacker);
                return;
            }

            var die = new PlayerStats();

            bool alive = Fight2.IsAlive(attacker, target);

            if (alive)
            {

                    var skillSuccess = DirtKickSuccess(attacker, target);
                    int chanceOfDirtKick = die.dice(1, 100);

                    if (skillSuccess > chanceOfDirtKick)
                    {
                        HubContext.Instance.SendToClient(
                            "You kick dirt into the eyes of " +
                            Helpers.ReturnName(target, attacker, null).ToLower() + ".",
                            attacker.HubGuid);

                        HubContext.Instance.SendToClient(
                            $"Your dirt kick blinds {Helpers.ReturnName(target, attacker, null).ToLower()}.",
                            attacker.HubGuid);

                        HubContext.Instance.SendToClient(
                            $"{Helpers.ReturnName(attacker, target, null)} kicks dirt in your eyes!",
                            target.HubGuid);

                        HubContext.Instance.SendToClient(
                            $"You can't see a thing!",
                            target.HubGuid);

                        var blindEffect = Effect.Blindness(attacker);

                        if (!Effect.HasEffect(target, blindEffect.Name))
                        {
                            target.Effects.Add(blindEffect);

                        }

                        foreach (var player in room.players)
                        {
                            if (player != attacker && player != target)
                            {

                                HubContext.Instance.SendToClient(
                                    Helpers.ReturnName(attacker, target, null) + " kicks dirt into the eyes of " +
                                    Helpers.ReturnName(target, attacker, null) + ".", target.HubGuid);

                            }

                        }

                    }
                    else
                    {
                        var attackerMessage = "Your dirt kick misses " +
                                                 Helpers.ReturnName(target, attacker, null);

                        var targetMessage = Helpers.ReturnName(attacker, target, null) +
                                               "'s dirt kick misses you ";

                        var observerMessage = Helpers.ReturnName(attacker, target, null) +
                                                 "'s dirt kick misses " +
                                                 Helpers.ReturnName(target, attacker, null);

                        HubContext.Instance.SendToClient(attackerMessage, attacker.HubGuid);
                        HubContext.Instance.SendToClient(targetMessage, target.HubGuid);

                        foreach (var player in room.players)
                        {
                            if (player != attacker && player != target)
                            {
                                HubContext.Instance.SendToClient(
                                    observerMessage, player.HubGuid);
                            }
                        }

                    }

            }

            Score.ReturnScoreUI(target);

            PlayerSetup.Player.SetState(attacker);

            Fight2.PerpareToFightBack(attacker, room, target.Name, true);

            attacker.ActiveSkill = null;

        }
    }
}


text:
layout: default
modal-id: 2
date: 2017-09-26
img: cthumagi.png
alt: image-alt
project-date: August 2017
category: Game Jam
description: Low Rez Jam 2017
---
Originally made for the LowResJam 2017, Cthulhu Magica is my first attempt at a J-RPG.

The original idea for the game was the mixing of Lovecraftian inspired creatures and the world of Magical Girls, but it served as a personnal challenge for the most part as I finally managed to create a Text Editor in Unity that allows me to write branching dialogue. Post-jam, I am remaking the game from scratch to improve the tools I made and i'm setting the game's resolution to 256*192px.

###### Jam version

If the displayed link is incorrect, please head **[here](https://kavehes.itch.io/magical-mythos)**
Made with Unity, all assets were produced during the time of the jam.

###### First mockups of the game
![Mockup]({{ "/img/magicthu/mockup0.png" | #}})
![Mockup]({{ "/img/magicthu/mockup1.png" | #}})

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="../../assets/ico/favicon.ico">

    <title>Code for Syracuse</title>

    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
    <link href="//netdna.bootstrapcdn.com/bootswatch/3.1.1/superhero/bootstrap.min.css" rel="stylesheet">

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

          </button>
          Code for Syracuse

Home

Data

About

Civic Hacking in the Salt City

We are a group of software developers, technologists, activists, and urbanists interested in using technology to make Syracuse and Central New York better.

Central New York Data

        Data and APIs for Syracuse, Central New York and NY State:

CNY Vitals

Syracuse Community Geography

Syracuse Newspaper Data sets</l1>

MapSyracuse</l1>

Onondaga County GIS

New York State Open Data Portal & Health Data Portal</l1>

New York State GIS Clearinghouse

511NY Developer Resource Area

        Data Sources for Other Upstate Cities:

City of Rochester Neighborhood Data Map

City of Albany Open Data Portal

City of Buffalo Property Viewer Mapping Application

About

          Code for Syracuse is a group of volunteers that builds digital tools with government and non-profit partners to enhance public life and bridge the digital gap. We're a platform for civic innovation, driven by civic engagement within the Greater Syracuse community.

        Code for America Brigades are local volunteer groups that bring together community members to help make communities work better. Brigades use technology to build new tools to help with local civic issues. Code for America supports Brigade chapters with resources, tools, and access to the wider civic technology movement.

      Check out our Meetup Page to see when our next event is and sign up.  We meet the fourth Tuesday of the month.  We look forward to hacking together!


text:
import sys
import re
from natsort import natsorted

INPUT = sys.argv[ 1 ]

# NOTE:
# KSP Reference Manual.txt created by Acrobat DC (Windows version & locale cp932) and re-save on vscode as utf-8 encoding.
# If created by different locale, change encoding name.
ENCODING = 'utf-8'

REGEX    = r"[a-z|A-Z|_]+\(\).*"
REGEX2   = r"(.*)\/(.*)"
wordList = []

IGNORE_WORD_LIST = [
    "select",
    "while",
    "ui_waveform",
]

def appendWord( word, targetList ):
    if( not word in IGNORE_WORD_LIST and not word in targetList ) :
        targetList.append( word )

f = open( INPUT, 'r', encoding = ENCODING )

line = f.readline()
while( line ):
    line = f.readline()
    m = re.match( re.compile( REGEX ), line )
    if( m == None ):
        continue

    word = m.group( 0 ).strip()
    word = re.sub( r".*?\s+.*", "", word )
    word = re.sub( r"\s*\(\s*", "", word )
    word = re.sub( r"\s*\)\s*", "", word )

    if( len( word ) == 0 ):
        continue

    m = re.match( re.compile( REGEX2 ), word )
    if( m == None ):
        appendWord( word, wordList )
    else:
        for i in m.groups():
            appendWord( i.strip(), wordList )

f.close()

for i in natsorted( wordList ):
    print( i )


text:
Title: Clipboard directive
Added: v3.2.0
Status: Active
Last reviewed: 2019-04-12
---

# [Clipboard directive](lib/core/src/lib/clipboard/clipboard.directive.ts "Defined in clipboard.directive.ts")

Copies text to the clipboard.

## Basic Usage

```html
<span adf-clipboard="translate_key" [clipboard-notification]="notify message">
    text to copy
</span>

<button adf-clipboard="translate_key" target="ref" [clipboard-notification]="notify message">
    Copy
</button>
```

## Class members

### Properties

| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| message | `string` |  | Translation key or message for snackbar notification. |
| placeholder | `string` |  | Translation key or message for the tooltip. |
| target | [`HTMLInputElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement)` \| `[`HTMLTextAreaElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement) |  | Reference to the HTML element containing the text to copy. |

## Details

Clicking on the decorated element will copy the text content of that element (or the
element specified in the `target` property) to the clipboard.

Use the parameter to `adf-clipboard` to specify a tooltip message that will be shown when
the user hovers the mouse over the element. You can also provide a snackbar message in the
`clipboard-notification` property, which will appear when the copying is complete.

## See also

-   [Clipboard service](../../core/services/clipboard.service.md)


text:
import { AfterContentInit, ElementRef, EventEmitter, OnDestroy, Renderer2 } from '@angular/core';
import { MdDatepicker } from './datepicker';
import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from '@angular/forms';
import { MdInputContainer } from '../input/input-container';
import { DateAdapter } from '../core/datetime/index';
import { MdDateFormats } from '../core/datetime/date-formats';
export declare const MD_DATEPICKER_VALUE_ACCESSOR: any;
export declare const MD_DATEPICKER_VALIDATORS: any;
/** Directive used to connect an input to a MdDatepicker. */
export declare class MdDatepickerInput<D> implements AfterContentInit, ControlValueAccessor, OnDestroy, Validator {
    private _elementRef;
    private _renderer;
    private _dateAdapter;
    private _dateFormats;
    private _mdInputContainer;
    /** The datepicker that this input is associated with. */
    mdDatepicker: MdDatepicker<D>;
    _datepicker: MdDatepicker<D>;
    matDatepicker: MdDatepicker<D>;
    mdDatepickerFilter: (date: D | null) => boolean;
    _dateFilter: (date: D | null) => boolean;
    matDatepickerFilter: (date: D | null) => boolean;
    /** The value of the input. */
    value: D | null;
    /** The minimum valid date. */
    min: D;
    private _min;
    /** The maximum valid date. */
    max: D;
    private _max;
    /** Emits when the value changes (either due to user input or programmatic change). */
    _valueChange: EventEmitter<D | null>;
    _onTouched: () => void;
    private _cvaOnChange;
    private _validatorOnChange;
    private _datepickerSubscription;
    /** The form control validator for the min date. */
    private _minValidator;
    /** The form control validator for the max date. */
    private _maxValidator;
    /** The form control validator for the date filter. */
    private _filterValidator;
    /** The combined form control validator for this input. */
    private _validator;
    constructor(_elementRef: ElementRef, _renderer: Renderer2, _dateAdapter: DateAdapter<D>, _dateFormats: MdDateFormats, _mdInputContainer: MdInputContainer);
    ngAfterContentInit(): void;
    ngOnDestroy(): void;
    registerOnValidatorChange(fn: () => void): void;
    validate(c: AbstractControl): ValidationErrors | null;
    /**
     * Gets the element that the datepicker popup should be connected to.
     * @return The element to connect the popup to.
     */
    getPopupConnectionElementRef(): ElementRef;
    writeValue(value: D): void;
    registerOnChange(fn: (value: any) => void): void;
    registerOnTouched(fn: () => void): void;
    setDisabledState(disabled: boolean): void;
    _onKeydown(event: KeyboardEvent): void;
    _onInput(value: string): void;
}


text:
package videoplayer;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.util.Log;

public class VideoPlayer extends CordovaPlugin
{
    /**
     * Executes the request and returns PluginResult.
     *
     * @param action            The action to execute.
     * @param args              JSONArray of arguments for the plugin.
     * @param callbackContext   The callback context used when calling back into JavaScript.
     * @return                  True when the action was valid, false otherwise.
     */
	@Override
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException
	{
		if (action.equals("play"))
		{
			Intent intent = new Intent(cordova.getActivity(), VideoPlayerActivity.class);
			intent.putExtra("url", args.getString(0));
			intent.putExtra("srt", args.getString(1));

			this.cordova.getActivity().startActivity(intent);

			return true;
        }

        return false;
    }
}


text:
menu_window::menu_window(QWidget *parent) :
    QDialog(parent), ui(new Ui::menu_window)
{
    ui->setupUi(this);

    QObject::connect (ui->admin_login_button, SIGNAL (clicked()),
                      this, SLOT (open_login_window()));
    QObject::connect (ui->user_login_button, SIGNAL (clicked()),
                      this, SLOT (open_login_window()));
    QObject::connect (ui->exit_button, SIGNAL (clicked()),
                      qApp, SLOT (quit()));
}

menu_window::~menu_window()
{
    delete ui;
}

void menu_window::open_login_window ()
{
    login_window *log_win = new login_window (0);
    QObject::connect (log_win, SIGNAL (login_done()),
                      this, SLOT (close()));
    log_win->show ();
}