code stringlengths 4 1.01M | language stringclasses 2 values |
|---|---|
-- Move generator logic
module Kurt.GoEngine ( genMove
, simulatePlayout
, EngineState(..)
, newEngineState
, updateEngineState
, newUctTree
) where
import Control.Arrow (second)
import Control.Monad (liftM)
import Control.Monad.Primitive (PrimState)
import Control.Monad.ST (ST, runST, stToIO)
import Control.Parallel.Strategies (parMap, rdeepseq)
import Data.List ((\\))
import qualified Data.Map as M (map)
import Data.Maybe (fromMaybe)
import Data.Time.Clock (UTCTime (..), getCurrentTime,
picosecondsToDiffTime)
import Data.Tree (rootLabel)
import Data.Tree.Zipper (findChild, fromTree, hasChildren,
tree)
import System.Random.MWC (Gen, Seed, restore, save, uniform,
withSystemRandom)
import Data.Goban.GameState
import Data.Goban.Types (Color (..), Move (..), Score,
Stone (..), Vertex)
import Data.Goban.Utils (rateScore, winningScore)
import Kurt.Config
import Data.Tree.UCT
import Data.Tree.UCT.GameTree (MoveNode (..), RaveMap,
UCTTreeLoc, newMoveNode,
newRaveMap)
import Debug.TraceOrId (trace)
-- import Data.Tree (drawTree)
data EngineState = EngineState {
getGameState :: !GameState
, getUctTree :: !(UCTTreeLoc Move)
, getRaveMap :: !(RaveMap Move)
, boardSize :: !Int
, getKomi :: !Score
, getConfig :: !KurtConfig
}
type LoopState = (UCTTreeLoc Move, RaveMap Move)
-- result from playout: score, playedMoves, path to startnode in tree
type Result = (Score, [Move], [Move])
-- request for playout: gamestate, path to startnode in tree, seed
type Request = (GameState, [Move], Seed)
newEngineState :: KurtConfig -> EngineState
newEngineState config =
EngineState { getGameState =
newGameState (initialBoardsize config) (initialKomi config)
, getUctTree = newUctTree
, getRaveMap = newRaveMap
, boardSize = initialBoardsize config
, getKomi = initialKomi config
, getConfig = config
}
newUctTree :: UCTTreeLoc Move
newUctTree =
fromTree $ newMoveNode
(trace "UCT tree root move accessed"
(Move (Stone (25,25) White)))
(0.5, 1)
updateEngineState :: EngineState -> Move -> EngineState
updateEngineState eState move =
eState { getGameState = gState', getUctTree = loc' }
where
gState' = updateGameState gState move
gState = getGameState eState
loc' = case move of
(Resign _) -> loc
_otherwise ->
if hasChildren loc
then selectSubtree loc move
else newUctTree
loc = getUctTree eState
selectSubtree :: UCTTreeLoc Move -> Move -> UCTTreeLoc Move
selectSubtree loc move =
loc''
where
loc'' = fromTree $ tree loc'
loc' =
fromMaybe newUctTree
$ findChild ((move ==) . nodeMove . rootLabel) loc
genMove :: EngineState -> Color -> IO (Move, EngineState)
genMove eState color = do
now <- getCurrentTime
let deadline = UTCTime { utctDay = utctDay now
, utctDayTime = thinkPicosecs + utctDayTime now }
let moves = nextMoves gState color
let score = scoreGameState gState
(if null moves
then
if winningScore color score
then return (Pass color, eState)
else return (Resign color, eState)
else (do
seed <- withSystemRandom (save :: Gen (PrimState IO) -> IO Seed)
(loc', raveMap') <- runUCT loc gState raveMap config deadline seed
let eState' = eState { getUctTree = loc', getRaveMap = raveMap' }
return (bestMoveFromLoc loc' (getState gState) score, eState')))
where
config = getConfig eState
gState = getGameState eState
loc = getUctTree eState
raveMap = M.map (second ((1 +) . (`div` 2))) $ getRaveMap eState
thinkPicosecs =
picosecondsToDiffTime
$ fromIntegral (maxTime config) * 1000000000
bestMoveFromLoc :: UCTTreeLoc Move -> GameStateStuff -> Score -> Move
bestMoveFromLoc loc state score =
case principalVariation loc of
[] ->
error "bestMoveFromLoc: principalVariation is empty"
(node : _) ->
if value < 0.1
then
if winningScore color score
then
trace ("bestMoveFromLoc pass " ++ show node)
Pass color
else
trace ("bestMoveFromLoc resign " ++ show node)
Resign color
else
trace ("total sims: " ++ show (nodeVisits$rootLabel$tree$loc)
++ " best: " ++ show node
++ "\n")
-- ++ (drawTree $ fmap show $ tree loc)
move
where
move = nodeMove node
value = nodeValue node
color = nextMoveColor state
runUCT :: UCTTreeLoc Move
-> GameState
-> RaveMap Move
-> KurtConfig
-> UTCTime
-> Seed
-> IO LoopState
runUCT initLoc rootGameState initRaveMap config deadline seed00 = do
uctLoop stateStream0 0
where
uctLoop :: [LoopState] -> Int -> IO LoopState
uctLoop [] _ = return (initLoc, initRaveMap)
uctLoop (st : stateStream) !n = do
_ <- return $! st
let maxRuns = n >= (maxPlayouts config)
now <- getCurrentTime
let timeIsUp = (now > deadline)
(if maxRuns || timeIsUp
then return st
else uctLoop stateStream (n + 1))
stateStream0 = loop0 seed00 (initLoc, initRaveMap)
loop0 :: Seed -> LoopState -> [LoopState]
loop0 seed0 st0 =
map (\(_, st, _) -> st) $ iterate loop (seed0, st0, [])
where
loop (seed, st, results0) =
(seed', st'', results)
where
st'' = updater st' r
r : results = results0 ++ (parMap rdeepseq runOne requests)
(st', seed', requests) = requestor st seed reqNeeded
reqNeeded = max 2 $ maxThreads config - length results0
updater :: LoopState -> Result -> LoopState
updater !st !res =
updateTreeResult st res
requestor :: LoopState -> Seed -> Int -> (LoopState, Seed, [Request])
requestor !st0 seed0 !n =
last $ take n $ iterate r (st0, seed0, [])
where
r :: (LoopState, Seed, [Request]) -> (LoopState, Seed, [Request])
r (!st, seed, rs) = (st', seed', request : rs)
where
seed' = incrSeed seed
st' = (loc, raveMap)
(_, raveMap) = st
request = (leafGameState, path, seed)
(loc, (leafGameState, path)) = nextNode st
nextNode :: LoopState -> (UCTTreeLoc Move, (GameState, [Move]))
nextNode (!loc, !raveMap) =
(loc'', (leafGameState, path))
where
loc'' = backpropagate (\_x -> 0) updateNodeVisits $ expandNode loc' slHeu moves
moves = nextMoves leafGameState $ nextMoveColor $ getState leafGameState
leafGameState = getLeafGameState rootGameState path
(loc', path) = selectLeafPath policy loc
policy = policyRaveUCB1 (uctExplorationPercent config) (raveWeight config) raveMap
slHeu = makeStonesAndLibertyHeuristic leafGameState config
updateTreeResult :: LoopState -> Result -> LoopState
updateTreeResult (!loc, !raveMap) (!score, !playedMoves, !path) =
(loc', raveMap')
where
raveMap' = updateRaveMap raveMap (rateScore score) $ drop (length playedMoves `div` 3) playedMoves
loc' = backpropagate (rateScore score) updateNodeValue $ getLeaf loc path
simulatePlayout :: GameState -> IO [Move]
simulatePlayout gState = do
seed <- withSystemRandom (save :: Gen (PrimState IO) -> IO Seed)
let gState' = getLeafGameState gState []
(oneState, playedMoves) <- stToIO $ runOneRandom gState' seed
let score = scoreGameState oneState
trace ("simulatePlayout " ++ show score) $ return ()
return $ reverse playedMoves
runOne :: Request -> Result
runOne (gameState, path, seed) =
(score, playedMoves, path)
where
score = scoreGameState endState
(endState, playedMoves) = runST $ runOneRandom gameState seed
runOneRandom :: GameState -> Seed -> ST s (GameState, [Move])
runOneRandom initState seed = do
rGen <- restore seed
run initState 0 rGen []
where
run :: GameState -> Int -> Gen s -> [Move] -> ST s (GameState, [Move])
run state 1000 _ moves = return (trace ("runOneRandom not done after 1000 moves " ++ show moves) state, [])
run state runCount rGen moves = do
move <- genMoveRand state rGen
let state' = updateGameState state move
case move of
(Pass passColor) -> do
move' <- genMoveRand state' rGen
let state'' = updateGameState state' move'
case move' of
(Pass _) ->
return (state'', moves)
sm@(Move _) ->
run state'' (runCount + 1) rGen (sm : Pass passColor : moves)
(Resign _) ->
error "runOneRandom encountered Resign"
sm@(Move _) ->
run state' (runCount + 1) rGen (sm : moves)
(Resign _) ->
error "runOneRandom encountered Resign"
genMoveRand :: GameState -> Gen s -> ST s Move
genMoveRand state rGen =
pickSane $ freeVertices $ getState state
where
pickSane [] =
return $ Pass color
pickSane [p] = do
let stone = Stone p color
let sane = isSaneMove state stone
return (if sane
then Move stone
else Pass color)
pickSane ps = do
p <- pick ps rGen
let stone = Stone p color
let sane = isSaneMove state stone
(if sane
then return $ Move stone
else pickSane (ps \\ [p]))
color = nextMoveColor $ getState state
pick :: [Vertex] -> Gen s -> ST s Vertex
pick as rGen = do
i <- liftM (`mod` length as) $ uniform rGen
return $ as !! i
incrSeed :: Seed -> Seed
incrSeed !seed =
runST $ do
gen <- restore seed
x <- uniform gen
_ <- return $ x + (1 :: Int)
seed' <- save gen
return $! seed'
| Java |
# k0nsl's blog
mirrored blog posts from my personal platform.
| Java |
# CommandBuilder <span style="font-weight:normal; font-size:.5em">extends [Command](#Command)</span>
## Constructor
```js
new Mechan.CommandBuilder(name);
```
| Parameter | Type | Optional | Default | Description |
|-------------|-----------------------------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------|
| name | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | | | Name of the command |
|[Properties](#CommandBuilder?scrollTo=properties) |[Methods](#CommandBuilder?scrollTo=methods) |Events|
|---------------------------------------------------|-----------------------------------------------------------|------|
|[name](#CommandBuilder?scrollTo=name) |[canRun](#CommandBuilder?scrollTo=canRun) | |
|[fullname](#CommandBuilder?scrollTo=fullname) |[setCallback](#CommandBuilder?scrollTo=setCallback) | |
|[callback](#CommandBuilder?scrollTo=callback) |[addParameter](#CommandBuilder?scrollTo=addParameter) | |
|[parameters](#CommandBuilder?scrollTo=parameters) |[clearParameters](#CommandBuilder?scrollTo=clearParameters)| |
|[checks](#CommandBuilder?scrollTo=checks) |[addCheck](#CommandBuilder?scrollTo=addCheck) | |
|[description](#CommandBuilder?scrollTo=description)|[addChecks](#CommandBuilder?scrollTo=addChecks) | |
|[category](#CommandBuilder?scrollTo=category) |[clearChecks](#CommandBuilder?scrollTo=clearChecks) | |
|[visible](#CommandBuilder?scrollTo=visible) |[setDescription](#CommandBuilder?scrollTo=setDescription) | |
| |[setCategory](#CommandBuilder?scrollTo=setCategory) | |
| |[show](#CommandBuilder?scrollTo=show) | |
| |[hide](#CommandBuilder?scrollTo=hide) | |
## Properties
### .name
Name of the command
**Type:** [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
### .fullname
Fullname of the command
**Type:** [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
### .callback
Callback for the command
**Type:** (event: [CommandContext](#CommandContext)) => void
### .parameters
Parameters for the command
**Type:** [CommandParameter](#CommandParameter)[]
### .checks
Permission checks to perform
**Type:** [PermissionCheck](#PermissionCheck)[]
### .description
Description of the command
**Type:** [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
### .category
Category the command fits into
**Type:** [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
### .visible
Whether or not the command is visible in the default help menu
**Type:** [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
## Methods
<h3 id="canRun"> .canRun(context)</h3>
Checks all permission checks and verifies if a command can be run
|Parameter|Type |Optional|Default|Description |
|---------|---------------------------------|------- |-------|---------------------------|
|context |[CommandContext](#CommandContext)| | |The context for the command|
**Returns: [PermissionCheckResult](#PermissionCheckResult)**
<hr>
<h3 id="setCallback"> .setCallback(callback)</h3>
Set the command's callback
|Parameter |Type |Optional|Default|Description |
|----------|----------------------------------------------------|------- |-------|------------------------|
|callback |(context: [CommandContext](#CommandContext)) => void| | |Callback for the command|
**Returns: [CommandBuilder](#CommandBuilder)**
<hr>
<h3 id="addParameter"> .addParameter(name, type)</h3>
Add a command parameter
|Parameter|Type |Optional|Default|Description |
|---------|-------------------------------------------------------------------------------------------------|------- |-------|--------------|
|name |[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)| | |Parameter name|
|type |[ParameterType](#ParamaterType) | | |Parameter type|
**Returns: [CommandBuilder](#CommandBuilder)**
<hr>
<h3 id="clearParameters"> .clearParameters()</h3>
Remove all perameters
**Returns: [CommandBuilder](#CommandBuilder)**
<hr>
<h3 id="addCheck"> .addCheck(check)</h3>
Add a permission check
|Parameter |Type |Optional|Default|Description |
|----------|-----------------------------------|------- |-------|------------|
|check |[PermissionCheck](#PermissionCheck)| | |Check to add|
**Returns: [CommandBuilder](#CommandBuilder)**
<hr>
<h3 id="addChecks"> .addChecks(checks)</h3>
Add permission checks
|Parameter |Type |Optional|Default|Description |
|----------|-------------------------------------|------- |-------|-------------|
|checks |[PermissionCheck](#PermissionCheck)[]| | |Checks to add|
**Returns: [CommandBuilder](#CommandBuilder)**
<hr>
<h3 id="clearChecks"> .clearChecks()</h3>
Remove all checks
**Returns: [CommandBuilder](#CommandBuilder)**
<hr>
<h3 id="setDescription"> .setDescription(description)</h3>
Set command's description
|Parameter |Type |Optional|Default|Description |
|-----------|-------------------------------------------------------------------------------------------------|------- |-------|--------------------------|
|description|[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)| | |Description of the command|
**Returns: [CommandBuilder](#CommandBuilder)**
<hr>
<h3 id="setCategory"> .setCategory(category)</h3>
Set command's category
|Parameter|Type |Optional|Default|Description |
|---------|-------------------------------------------------------------------------------------------------|------- |-------|------------------------------|
|category |[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)| | |Category the command fits into|
**Returns: [CommandBuilder](#CommandBuilder)**
<hr>
<h3 id="show"> .show()</h3>
Set the command's visibility to true
**Returns: [CommandBuilder](#CommandBuilder)**
<hr>
<h3 id="hide"> .hide()</h3>
Set the command's visibility to false
**Returns: [CommandBuilder](#CommandBuilder)** | Java |
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { number } from '@storybook/addon-knobs';
import { LightboxGallery, Props } from './LightboxGallery';
import { setup as setupI18n } from '../../js/modules/i18n';
import enMessages from '../../_locales/en/messages.json';
import { IMAGE_JPEG, VIDEO_MP4 } from '../types/MIME';
const i18n = setupI18n('en', enMessages);
const story = storiesOf('Components/LightboxGallery', module);
const createProps = (overrideProps: Partial<Props> = {}): Props => ({
close: action('close'),
i18n,
media: overrideProps.media || [],
onSave: action('onSave'),
selectedIndex: number('selectedIndex', overrideProps.selectedIndex || 0),
});
story.add('Image and Video', () => {
const props = createProps({
media: [
{
attachment: {
contentType: IMAGE_JPEG,
fileName: 'tina-rolf-269345-unsplash.jpg',
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
caption:
'Still from The Lighthouse, starring Robert Pattinson and Willem Defoe.',
},
contentType: IMAGE_JPEG,
index: 0,
message: {
attachments: [],
id: 'image-msg',
received_at: Date.now(),
},
objectURL: '/fixtures/tina-rolf-269345-unsplash.jpg',
},
{
attachment: {
contentType: VIDEO_MP4,
fileName: 'pixabay-Soap-Bubble-7141.mp4',
url: '/fixtures/pixabay-Soap-Bubble-7141.mp4',
},
contentType: VIDEO_MP4,
index: 1,
message: {
attachments: [],
id: 'video-msg',
received_at: Date.now(),
},
objectURL: '/fixtures/pixabay-Soap-Bubble-7141.mp4',
},
],
});
return <LightboxGallery {...props} />;
});
story.add('Missing Media', () => {
const props = createProps({
media: [
{
attachment: {
contentType: IMAGE_JPEG,
fileName: 'tina-rolf-269345-unsplash.jpg',
url: '/fixtures/tina-rolf-269345-unsplash.jpg',
},
contentType: IMAGE_JPEG,
index: 0,
message: {
attachments: [],
id: 'image-msg',
received_at: Date.now(),
},
objectURL: undefined,
},
],
});
return <LightboxGallery {...props} />;
});
| Java |
// app.photoGrid
var Backbone = require("backbone");
// var _ = require("underscore");
var $ = require("jquery");
var ImageGridFuncs = require("./photo_grid_functions");
var ImageCollection = require("../models/photo_grid_image_collection");
var ImageView = require("./photo_grid_image");
module.exports = Backbone.View.extend({
el: '#photo-grid',
initialize: function () {
"use strict";
if (this.$el.length === 1) {
var gridJSON = this.$(".hid");
if (gridJSON.length === 1) {
this.funcs = new ImageGridFuncs();
this.template = this.funcs.slideTemplate();
// there is only one allowed div.hid
gridJSON = JSON.parse(gridJSON[0].innerHTML);
if (gridJSON.spacer_URL && gridJSON.image_URL) {
this.model.set({
parentModel: this.model, // pass as reference
spacerURL: gridJSON.spacer_URL,
imageURL: gridJSON.image_URL,
spacers: gridJSON.spacers,
images: gridJSON.images,
// shuffle image order:
imagesShuffled: this.funcs.shuffleArray(gridJSON.images),
});
this.setupGrid();
}
this.model.on({
'change:currentSlide': this.modelChange
}, this);
app.mindbodyModel.on({
'change:popoverVisible': this.killSlides
}, this);
}
}
},
setupGrid: function () {
"use strict";
var that = this,
spacers = this.model.get("spacers"),
randomInt,
imageCollection = new ImageCollection(),
i;
for (i = 0; i < this.model.get("images").length; i += 1) {
randomInt = that.funcs.getRandomInt(0, spacers.length);
imageCollection.add({
// push some info to individual views:
parentModel: this.model,
order: i,
spacerURL: this.model.get("spacerURL"),
spacer: spacers[randomInt],
imageURL: this.model.get("imageURL"),
image: this.model.get("imagesShuffled")[i],
});
}
imageCollection.each(this.imageView, this);
},
imageView: function (imageModel) {
"use strict";
var imageView = new ImageView({model: imageModel});
this.$el.append(imageView.render().el);
},
modelChange: function () {
"use strict";
var currSlide = this.model.get("currentSlide"),
allImages = this.model.get("imageURL"),
imageInfo,
imageViewer,
imgWidth,
slideDiv;
if (currSlide !== false) {
if (app.mindbodyModel.get("popoverVisible") !== true) {
app.mindbodyModel.set({popoverVisible : true});
}
// retrieve cached DOM object:
imageViewer = app.mbBackGroundShader.openPopUp("imageViewer");
// set the stage:
imageViewer.html(this.template(this.model.toJSON()));
// select div.slide, the ugly way:
slideDiv = imageViewer[0].getElementsByClassName("slide")[0];
// pull the array of info about the image:
imageInfo = this.model.get("images")[currSlide];
// calculate the size of the image when it fits the slideshow:
imgWidth = this.funcs.findSlideSize(imageInfo,
slideDiv.offsetWidth,
slideDiv.offsetHeight);
slideDiv.innerHTML = '<img src="' + allImages + imageInfo.filename +
'" style="width: ' + imgWidth + 'px;" />';
}
},
killSlides: function () {
"use strict";
if (app.mindbodyModel.get("popoverVisible") === false) {
// popover is gone. No more slideshow.
this.model.set({currentSlide : false});
}
},
});
| Java |
package ua.pp.shurgent.tfctech.integration.bc.blocks.pipes.transport;
import net.minecraft.item.Item;
import net.minecraftforge.common.util.ForgeDirection;
import ua.pp.shurgent.tfctech.integration.bc.BCStuff;
import ua.pp.shurgent.tfctech.integration.bc.ModPipeIconProvider;
import ua.pp.shurgent.tfctech.integration.bc.blocks.pipes.handlers.PipeItemsInsertionHandler;
import buildcraft.api.core.IIconProvider;
import buildcraft.transport.pipes.PipeItemsQuartz;
import buildcraft.transport.pipes.events.PipeEventItem;
public class PipeItemsSterlingSilver extends PipeItemsQuartz {
public PipeItemsSterlingSilver(Item item) {
super(item);
}
@Override
public IIconProvider getIconProvider() {
return BCStuff.pipeIconProvider;
}
@Override
public int getIconIndex(ForgeDirection direction) {
return ModPipeIconProvider.TYPE.PipeItemsSterlingSilver.ordinal();
}
public void eventHandler(PipeEventItem.AdjustSpeed event) {
super.eventHandler(event);
}
public void eventHandler(PipeEventItem.Entered event) {
event.item.setInsertionHandler(PipeItemsInsertionHandler.INSTANCE);
}
}
| Java |
package org.crazyit.activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
/**
* Description:
* <br/>site: <a href="http://www.crazyit.org">crazyit.org</a>
* <br/>Copyright (C), 2001-2012, Yeeku.H.Lee
* <br/>This program is protected by copyright laws.
* <br/>Program Name:
* <br/>Date:
* @author Yeeku.H.Lee kongyeeku@163.com
* @version 1.0
*/
public class StartActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//»ñȡӦÓóÌÐòÖеÄbn°´Å¥
Button bn = (Button)findViewById(R.id.bn);
//Ϊbn°´Å¥°ó¶¨Ê¼þ¼àÌýÆ÷
bn.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View source)
{
//´´½¨ÐèÒªÆô¶¯µÄActivity¶ÔÓ¦µÄIntent
Intent intent = new Intent(StartActivity.this
, SecondActivity.class);
//Æô¶¯intent¶ÔÓ¦µÄActivity
startActivity(intent);
}
});
}
} | Java |
// Remove the particular item
function removeArr(arr , removeItem){
if(arr.indexOf(removeItem) > -1){
arr.splice(arr.indexOf(removeItem),1);
}
return arr;
}
| Java |
declared in [MTMatrix](MTMatrix.hpp.md)
~~~ { .cpp }
MTMatrix::MTMatrix(int rows, int cols)
{
//std::clog << "MTMatrix(" << rows << ", " << cols << ")" << std::endl;
if (cols > 0 && rows > 0) {
_rows = rows;
_cols = cols;
_elements = new double[_rows * _cols];
for (int i=0; i<_rows*_cols; i++) {
_elements[i] = 0.0; }
}
}
// make a real copy
MTMatrix::MTMatrix(MTMatrix const & m)
: MTMatrix(m._rows,m._cols)
{
//std::clog << "MTMatrix(MTMatrix(" << m._rows << ", " << m._cols << "))" << std::endl;
_transposed = m._transposed;
for (int i=0; i<_rows*_cols; i++) {
_elements[i] = m._elements[i]; }
}
MTMatrix & MTMatrix::operator=(MTMatrix const & m)
{
if (m._cols != _cols || m._rows != _rows) {
if (_elements) {
delete[] _elements;
_elements = nullptr; }
_cols = m._cols; _rows = m._rows;
}
if (! _elements) {
_elements = new double[_rows * _cols];
}
_transposed = m._transposed;
for (int i=0; i<_rows*_cols; i++) {
_elements[i] = m._elements[i]; }
}
~~~
deserialize a MTMatrix from its string representation
TODO :exclamation:
~~~ { .cpp }
MTMatrix::MTMatrix(std::string const & str)
{
}
~~~
| Java |
package ru.mos.polls.ourapps.ui.adapter;
import java.util.ArrayList;
import java.util.List;
import ru.mos.polls.base.BaseRecyclerAdapter;
import ru.mos.polls.base.RecyclerBaseViewModel;
import ru.mos.polls.ourapps.model.OurApplication;
import ru.mos.polls.ourapps.vm.item.OurApplicationVM;
public class OurAppsAdapter extends BaseRecyclerAdapter<RecyclerBaseViewModel> {
public void add(List<OurApplication> list) {
List<RecyclerBaseViewModel> rbvm = new ArrayList<>();
for (OurApplication ourApp : list) {
rbvm.add(new OurApplicationVM(ourApp));
}
addData(rbvm);
}
}
| Java |
using System;
namespace SourceCodeCounter.Core
{
/// <summary>
/// The exception that is thrown when a command-line argument is invalid.
/// </summary>
internal class InvalidArgumentException : Exception
{
readonly string _argument;
public InvalidArgumentException(string argument)
: base("Invalid argument: '" + argument + "'")
{
_argument = argument;
}
public InvalidArgumentException(string argument, string message)
: base(message)
{
_argument = argument;
}
public InvalidArgumentException(string argument, string message, Exception inner)
: base(message, inner)
{
_argument = argument;
}
public InvalidArgumentException(string message, Exception inner)
: base(message, inner)
{
}
public string Argument
{
get { return _argument; }
}
}
} | Java |
html{
margin:0 auto;
}
body {
background:url(images_white/background.gif) repeat-y top center #fff;
color:#404040;
/* font:76% Verdana,Tahoma,Arial,sans-serif; */
line-height:1.3em;
margin:0 auto;
padding:0;
}
/* Menu */
#top_menu {
position:relative;
/* color: #6666aa; */
/* background-color: #aaccee; */
width:1010px;
margin:0 auto;
}
#top{
margin:0 auto;
}
#humo_menu {
background: linear-gradient(rgb(244, 244, 255) 0%, rgb(219, 219, 219) 100%);
margin:0 auto;
}
#humo_menu a {
color:#000000;
}
/* Pop-up menu */
#humo_menu ul.humo_menu_item2 li a{
background: linear-gradient(rgb(244, 244, 255) 0%, rgb(219, 219, 219) 100%);
}
#humo_menu a:visited { color: #000000; }
#humo_menu a:active {color: #2288dd; }
#humo_menu a:hover {color: #2288dd; }
/* #humo_menu a:hover { */
#humo_menu a:hover, #humo_menu ul.humo_menu_item2 li a:hover {
background:url("images_white/white.jpg") repeat left top;
}
#humo_menu #current {
}
#humo_menu #current a, #humo_menu #current_top {
background:url("images_white/white.jpg") repeat left top;
color:#333;
}
/* top bar in left - content - right boxes: only in main menu */
.mainmenu_bar{
background:none;
/* h2 {border-bottom:4px solid #dadada; color:#4088b8; font-size:1.4em; letter-spacing:-1px; margin:0 0 10px; padding:0 2px 2px 5px;} */
border-bottom:4px solid #dadada; color:#4088b8;
}
#mainmenu_centerbox {
box-shadow: 0px 0px 0px #999;
-moz-box-shadow: 0px 0px 0px #999;
-webkit-box-shadow: 0px 0px 0px #999;
}
.search_bar{
background:url("images_white/white.jpg") repeat left top;
/* background:none; */
}
#content {
display:block;
padding-left:10px;
position:relative;
z-index:3;
height:100%;
/* overflow:auto; */
max-height:90%;
top:35px;
width:1005px;
margin:0 auto;
}
#rtlcontent {
display:block;
padding-right:10px;
position:relative;
z-index:3;
height:100%;
/* overflow:auto; */
max-height:95%;
top:35px;
width:1024px;
margin:0 auto;
}
table.index_table{
width:1000px;
}
/* Tables */
table.humo { background-color: #ffffff; }
/* 1st table A-Z */
.border {
border: none;
/* border-collapse: collapse; */
}
table.humo {
-moz-box-shadow: 0px 0px 0px;
-webkit-box-shadow: 0px 0px 0px;
box-shadow: 0px 0px 0px;
}
table.humo td {
/* border: ridge 1px #3355cc; */
border:none;
/* background-color: #cceeff; */ /* achtergrond gezinsblad en 1e tabel */
border-bottom: 2px solid #dadada;
}
table.humo tr:first-of-type td { border:none; border-bottom: 2px solid #dadada; }
table.humo tr:first-of-type th { border:none; }
/* 2nd table A-Z */
.family_page_toptext {
color: #ffffff;
background-image: none;
color:black;
}
td.style_tree_text { background-color: #eeeeff; }
.table_headline{
background: linear-gradient(to bottom, rgb(244, 244, 255) 0%, rgb(219, 219, 219) 100%);
}
table.standard td.table_header { background-image: none; }
div.photobook{ background-color:#FFFFFF; }
.help_box { background-color:#FFFFFF; }
table.container{ background-color:#FFFFFF; }
table.reltable td { border:0px; } | Java |
#ifndef AssimpSceneLoader_H
#define AssimpSceneLoader_H
#include <string>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include <assimp/Importer.hpp>
#include "Common/Singleton.h"
#include "Mesh/Mesh.h"
#include "Shader/ShaderProgram.h"
#include "Scene/Material.h"
using std::string;
class AssimpSceneLoader : public Singleton<AssimpSceneLoader>
{
public:
vector<Mesh*> meshes;
const aiScene* assimpScene;
vector<Material*> materials;
AssimpSceneLoader();
void load(string file);
Mesh * initMesh(aiMesh * assMesh);
void initNode(aiNode * parent);
void printColor(const string &name, const aiColor4D & color);
};
#endif // AssimpSceneLoader_H
| Java |
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Public Class rptAnalisisVencimiento
Inherits DevExpress.XtraReports.UI.XtraReport
'XtraReport overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Designer
'It can be modified using the Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim StoredProcQuery1 As DevExpress.DataAccess.Sql.StoredProcQuery = New DevExpress.DataAccess.Sql.StoredProcQuery()
Dim QueryParameter1 As DevExpress.DataAccess.Sql.QueryParameter = New DevExpress.DataAccess.Sql.QueryParameter()
Dim QueryParameter2 As DevExpress.DataAccess.Sql.QueryParameter = New DevExpress.DataAccess.Sql.QueryParameter()
Dim QueryParameter3 As DevExpress.DataAccess.Sql.QueryParameter = New DevExpress.DataAccess.Sql.QueryParameter()
Dim QueryParameter4 As DevExpress.DataAccess.Sql.QueryParameter = New DevExpress.DataAccess.Sql.QueryParameter()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(rptAnalisisVencimiento))
Dim XrSummary1 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary2 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary3 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary4 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary5 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary6 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary7 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary8 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary9 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary10 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary11 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary12 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary13 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary14 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary15 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary16 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary17 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Dim XrSummary18 As DevExpress.XtraReports.UI.XRSummary = New DevExpress.XtraReports.UI.XRSummary()
Me.Detail = New DevExpress.XtraReports.UI.DetailBand()
Me.XrLabel18 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel19 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel20 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel21 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel22 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel23 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel24 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel25 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel26 = New DevExpress.XtraReports.UI.XRLabel()
Me.TopMargin = New DevExpress.XtraReports.UI.TopMarginBand()
Me.BottomMargin = New DevExpress.XtraReports.UI.BottomMarginBand()
Me.SqlDataSource1 = New DevExpress.DataAccess.Sql.SqlDataSource(Me.components)
Me.GroupHeaderSucursal = New DevExpress.XtraReports.UI.GroupHeaderBand()
Me.XrLabel2 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel1 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel15 = New DevExpress.XtraReports.UI.XRLabel()
Me.GroupHeaderCliente = New DevExpress.XtraReports.UI.GroupHeaderBand()
Me.XrLabel3 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel16 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel17 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel6 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel7 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel8 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel9 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel10 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel11 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel12 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel13 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel14 = New DevExpress.XtraReports.UI.XRLabel()
Me.PageFooterBand1 = New DevExpress.XtraReports.UI.PageFooterBand()
Me.ReportHeaderBand1 = New DevExpress.XtraReports.UI.ReportHeaderBand()
Me.GroupFooterBand1 = New DevExpress.XtraReports.UI.GroupFooterBand()
Me.GroupFooterBand2 = New DevExpress.XtraReports.UI.GroupFooterBand()
Me.XrLabel47 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel46 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel28 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel29 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel30 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel31 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel32 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel33 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel34 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel35 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel36 = New DevExpress.XtraReports.UI.XRLabel()
Me.ReportFooterBand1 = New DevExpress.XtraReports.UI.ReportFooterBand()
Me.XrLabel45 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel27 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel37 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel38 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel39 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel40 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel41 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel42 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel43 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel44 = New DevExpress.XtraReports.UI.XRLabel()
Me.Title = New DevExpress.XtraReports.UI.XRControlStyle()
Me.FieldCaption = New DevExpress.XtraReports.UI.XRControlStyle()
Me.PageInfo = New DevExpress.XtraReports.UI.XRControlStyle()
Me.DataField = New DevExpress.XtraReports.UI.XRControlStyle()
Me.PageHeader = New DevExpress.XtraReports.UI.PageHeaderBand()
Me.XrLabel49 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel48 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrPageInfo4 = New DevExpress.XtraReports.UI.XRPageInfo()
Me.XrPageInfo3 = New DevExpress.XtraReports.UI.XRPageInfo()
Me.XrLabel4 = New DevExpress.XtraReports.UI.XRLabel()
Me.XrLabel5 = New DevExpress.XtraReports.UI.XRLabel()
Me.lblHasta = New DevExpress.XtraReports.UI.XRLabel()
Me.pdFechaFinal = New DevExpress.XtraReports.Parameters.Parameter()
Me.lblCliente = New DevExpress.XtraReports.UI.XRLabel()
Me.psCliente = New DevExpress.XtraReports.Parameters.Parameter()
Me.lblNombreReporte = New DevExpress.XtraReports.UI.XRLabel()
Me.lblEmpresa = New DevExpress.XtraReports.UI.XRLabel()
Me.psEmpresa = New DevExpress.XtraReports.Parameters.Parameter()
Me.piIDBodega = New DevExpress.XtraReports.Parameters.Parameter()
Me.piIDCliente = New DevExpress.XtraReports.Parameters.Parameter()
Me.piConsolidaSucursal = New DevExpress.XtraReports.Parameters.Parameter()
Me.piEnDolar = New DevExpress.XtraReports.Parameters.Parameter()
Me.CalculatedField1 = New DevExpress.XtraReports.UI.CalculatedField()
CType(Me, System.ComponentModel.ISupportInitialize).BeginInit()
'
'Detail
'
Me.Detail.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.XrLabel18, Me.XrLabel19, Me.XrLabel20, Me.XrLabel21, Me.XrLabel22, Me.XrLabel23, Me.XrLabel24, Me.XrLabel25, Me.XrLabel26})
Me.Detail.HeightF = 21.7083!
Me.Detail.Name = "Detail"
Me.Detail.Padding = New DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100.0!)
Me.Detail.StyleName = "DataField"
Me.Detail.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft
'
'XrLabel18
'
Me.XrLabel18.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.SaldoNovencido", "{0:n2}")})
Me.XrLabel18.Font = New System.Drawing.Font("Times New Roman", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel18.LocationFloat = New DevExpress.Utils.PointFloat(15.24502!, 1.000023!)
Me.XrLabel18.Name = "XrLabel18"
Me.XrLabel18.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel18.SizeF = New System.Drawing.SizeF(103.0097!, 18.0!)
Me.XrLabel18.StylePriority.UseFont = False
Me.XrLabel18.StylePriority.UseTextAlignment = False
Me.XrLabel18.Text = "XrLabel18"
Me.XrLabel18.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel19
'
Me.XrLabel19.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldoa30", "{0:n2}")})
Me.XrLabel19.Font = New System.Drawing.Font("Times New Roman", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel19.LocationFloat = New DevExpress.Utils.PointFloat(130.7548!, 1.000023!)
Me.XrLabel19.Name = "XrLabel19"
Me.XrLabel19.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel19.SizeF = New System.Drawing.SizeF(75.74262!, 18.0!)
Me.XrLabel19.StylePriority.UseFont = False
Me.XrLabel19.StylePriority.UseTextAlignment = False
Me.XrLabel19.Text = "XrLabel19"
Me.XrLabel19.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel20
'
Me.XrLabel20.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo31a60", "{0:n2}")})
Me.XrLabel20.Font = New System.Drawing.Font("Times New Roman", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel20.LocationFloat = New DevExpress.Utils.PointFloat(206.4974!, 1.000023!)
Me.XrLabel20.Name = "XrLabel20"
Me.XrLabel20.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel20.SizeF = New System.Drawing.SizeF(90.87666!, 18.0!)
Me.XrLabel20.StylePriority.UseFont = False
Me.XrLabel20.StylePriority.UseTextAlignment = False
Me.XrLabel20.Text = "XrLabel20"
Me.XrLabel20.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel21
'
Me.XrLabel21.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo61a90", "{0:n2}")})
Me.XrLabel21.Font = New System.Drawing.Font("Times New Roman", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel21.LocationFloat = New DevExpress.Utils.PointFloat(315.8251!, 0.0!)
Me.XrLabel21.Name = "XrLabel21"
Me.XrLabel21.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel21.SizeF = New System.Drawing.SizeF(73.91107!, 18.0!)
Me.XrLabel21.StylePriority.UseFont = False
Me.XrLabel21.StylePriority.UseTextAlignment = False
Me.XrLabel21.Text = "XrLabel21"
Me.XrLabel21.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel22
'
Me.XrLabel22.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo91a120", "{0:n2}")})
Me.XrLabel22.Font = New System.Drawing.Font("Times New Roman", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel22.LocationFloat = New DevExpress.Utils.PointFloat(398.1559!, 0.0!)
Me.XrLabel22.Name = "XrLabel22"
Me.XrLabel22.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel22.SizeF = New System.Drawing.SizeF(89.20599!, 18.0!)
Me.XrLabel22.StylePriority.UseFont = False
Me.XrLabel22.StylePriority.UseTextAlignment = False
Me.XrLabel22.Text = "XrLabel22"
Me.XrLabel22.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel23
'
Me.XrLabel23.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo121a180", "{0:n2}")})
Me.XrLabel23.Font = New System.Drawing.Font("Times New Roman", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel23.LocationFloat = New DevExpress.Utils.PointFloat(501.5453!, 0.0!)
Me.XrLabel23.Name = "XrLabel23"
Me.XrLabel23.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel23.SizeF = New System.Drawing.SizeF(89.2699!, 18.0!)
Me.XrLabel23.StylePriority.UseFont = False
Me.XrLabel23.StylePriority.UseTextAlignment = False
Me.XrLabel23.Text = "XrLabel23"
Me.XrLabel23.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel24
'
Me.XrLabel24.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo181a600", "{0:n2}")})
Me.XrLabel24.Font = New System.Drawing.Font("Times New Roman", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel24.LocationFloat = New DevExpress.Utils.PointFloat(608.9234!, 0.0!)
Me.XrLabel24.Name = "XrLabel24"
Me.XrLabel24.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel24.SizeF = New System.Drawing.SizeF(85.12994!, 18.0!)
Me.XrLabel24.StylePriority.UseFont = False
Me.XrLabel24.StylePriority.UseTextAlignment = False
Me.XrLabel24.Text = "XrLabel24"
Me.XrLabel24.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel25
'
Me.XrLabel25.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldomas600", "{0:n2}")})
Me.XrLabel25.Font = New System.Drawing.Font("Times New Roman", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel25.LocationFloat = New DevExpress.Utils.PointFloat(716.9433!, 0.0!)
Me.XrLabel25.Name = "XrLabel25"
Me.XrLabel25.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel25.SizeF = New System.Drawing.SizeF(81.20685!, 18.0!)
Me.XrLabel25.StylePriority.UseFont = False
Me.XrLabel25.StylePriority.UseTextAlignment = False
Me.XrLabel25.Text = "XrLabel25"
Me.XrLabel25.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel26
'
Me.XrLabel26.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.TotalCliente", "{0:n2}")})
Me.XrLabel26.Font = New System.Drawing.Font("Times New Roman", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel26.LocationFloat = New DevExpress.Utils.PointFloat(809.7319!, 0.0!)
Me.XrLabel26.Name = "XrLabel26"
Me.XrLabel26.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel26.SizeF = New System.Drawing.SizeF(80.26801!, 18.0!)
Me.XrLabel26.StylePriority.UseFont = False
Me.XrLabel26.StylePriority.UseTextAlignment = False
Me.XrLabel26.Text = "XrLabel26"
Me.XrLabel26.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'TopMargin
'
Me.TopMargin.HeightF = 100.0!
Me.TopMargin.Name = "TopMargin"
Me.TopMargin.Padding = New DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100.0!)
Me.TopMargin.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft
'
'BottomMargin
'
Me.BottomMargin.HeightF = 100.0!
Me.BottomMargin.Name = "BottomMargin"
Me.BottomMargin.Padding = New DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100.0!)
Me.BottomMargin.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft
'
'SqlDataSource1
'
Me.SqlDataSource1.ConnectionName = "Ced_Connection"
Me.SqlDataSource1.Name = "SqlDataSource1"
StoredProcQuery1.Name = "ccfGetAntiguedadSaldos"
QueryParameter1.Name = "@IDBodega"
QueryParameter1.Type = GetType(Integer)
QueryParameter1.ValueInfo = "0"
QueryParameter2.Name = "@IDCliente"
QueryParameter2.Type = GetType(Integer)
QueryParameter2.ValueInfo = "0"
QueryParameter3.Name = "@FechaCorte"
QueryParameter3.Type = GetType(DevExpress.DataAccess.Expression)
QueryParameter3.Value = New DevExpress.DataAccess.Expression("[Parameters.pdFechaFinal]", GetType(Date))
QueryParameter4.Name = "@EnDolar"
QueryParameter4.Type = GetType(DevExpress.DataAccess.Expression)
QueryParameter4.Value = New DevExpress.DataAccess.Expression("[Parameters.piEnDolar]", GetType(Short))
StoredProcQuery1.Parameters.Add(QueryParameter1)
StoredProcQuery1.Parameters.Add(QueryParameter2)
StoredProcQuery1.Parameters.Add(QueryParameter3)
StoredProcQuery1.Parameters.Add(QueryParameter4)
StoredProcQuery1.StoredProcName = "ccfrptAntiguedadSaldosPorCliente"
Me.SqlDataSource1.Queries.AddRange(New DevExpress.DataAccess.Sql.SqlQuery() {StoredProcQuery1})
Me.SqlDataSource1.ResultSchemaSerializable = resources.GetString("SqlDataSource1.ResultSchemaSerializable")
'
'GroupHeaderSucursal
'
Me.GroupHeaderSucursal.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.XrLabel2, Me.XrLabel1, Me.XrLabel15})
Me.GroupHeaderSucursal.GroupFields.AddRange(New DevExpress.XtraReports.UI.GroupField() {New DevExpress.XtraReports.UI.GroupField("Bodega", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending)})
Me.GroupHeaderSucursal.HeightF = 21.33335!
Me.GroupHeaderSucursal.KeepTogether = True
Me.GroupHeaderSucursal.Level = 1
Me.GroupHeaderSucursal.Name = "GroupHeaderSucursal"
Me.GroupHeaderSucursal.RepeatEveryPage = True
'
'XrLabel2
'
Me.XrLabel2.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Bodega")})
Me.XrLabel2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel2.LocationFloat = New DevExpress.Utils.PointFloat(227.5867!, 3.333346!)
Me.XrLabel2.Name = "XrLabel2"
Me.XrLabel2.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel2.SizeF = New System.Drawing.SizeF(363.2288!, 18.0!)
Me.XrLabel2.StyleName = "DataField"
Me.XrLabel2.StylePriority.UseFont = False
Me.XrLabel2.Text = "XrLabel2"
'
'XrLabel1
'
Me.XrLabel1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel1.LocationFloat = New DevExpress.Utils.PointFloat(92.38262!, 1.333332!)
Me.XrLabel1.Name = "XrLabel1"
Me.XrLabel1.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel1.SizeF = New System.Drawing.SizeF(67.70178!, 20.00002!)
Me.XrLabel1.StyleName = "FieldCaption"
Me.XrLabel1.StylePriority.UseFont = False
Me.XrLabel1.Text = "Sucursal"
'
'XrLabel15
'
Me.XrLabel15.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.IDBodega")})
Me.XrLabel15.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel15.LocationFloat = New DevExpress.Utils.PointFloat(175.6743!, 3.333346!)
Me.XrLabel15.Name = "XrLabel15"
Me.XrLabel15.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel15.SizeF = New System.Drawing.SizeF(41.70179!, 18.0!)
Me.XrLabel15.StylePriority.UseFont = False
Me.XrLabel15.Text = "XrLabel15"
'
'GroupHeaderCliente
'
Me.GroupHeaderCliente.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.XrLabel3, Me.XrLabel16, Me.XrLabel17})
Me.GroupHeaderCliente.GroupFields.AddRange(New DevExpress.XtraReports.UI.GroupField() {New DevExpress.XtraReports.UI.GroupField("IDCliente", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending)})
Me.GroupHeaderCliente.HeightF = 20.00002!
Me.GroupHeaderCliente.KeepTogether = True
Me.GroupHeaderCliente.Name = "GroupHeaderCliente"
Me.GroupHeaderCliente.RepeatEveryPage = True
Me.GroupHeaderCliente.StyleName = "FieldCaption"
'
'XrLabel3
'
Me.XrLabel3.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel3.LocationFloat = New DevExpress.Utils.PointFloat(15.24502!, 0.0!)
Me.XrLabel3.Name = "XrLabel3"
Me.XrLabel3.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel3.SizeF = New System.Drawing.SizeF(67.70178!, 20.00002!)
Me.XrLabel3.StyleName = "FieldCaption"
Me.XrLabel3.StylePriority.UseFont = False
Me.XrLabel3.Text = "Cliente"
'
'XrLabel16
'
Me.XrLabel16.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.IDCliente")})
Me.XrLabel16.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel16.LocationFloat = New DevExpress.Utils.PointFloat(93.29166!, 0.0!)
Me.XrLabel16.Name = "XrLabel16"
Me.XrLabel16.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel16.SizeF = New System.Drawing.SizeF(41.70176!, 18.0!)
Me.XrLabel16.StylePriority.UseFont = False
Me.XrLabel16.Text = "XrLabel16"
'
'XrLabel17
'
Me.XrLabel17.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.NOMBRE")})
Me.XrLabel17.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel17.LocationFloat = New DevExpress.Utils.PointFloat(145.2041!, 0.0!)
Me.XrLabel17.Name = "XrLabel17"
Me.XrLabel17.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel17.SizeF = New System.Drawing.SizeF(298.5751!, 18.0!)
Me.XrLabel17.StylePriority.UseFont = False
Me.XrLabel17.Text = "XrLabel17"
'
'XrLabel6
'
Me.XrLabel6.LocationFloat = New DevExpress.Utils.PointFloat(15.24499!, 149.5!)
Me.XrLabel6.Name = "XrLabel6"
Me.XrLabel6.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel6.SizeF = New System.Drawing.SizeF(103.0097!, 18.0!)
Me.XrLabel6.Text = "Saldo Novencido"
'
'XrLabel7
'
Me.XrLabel7.LocationFloat = New DevExpress.Utils.PointFloat(130.7547!, 149.5!)
Me.XrLabel7.Name = "XrLabel7"
Me.XrLabel7.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel7.SizeF = New System.Drawing.SizeF(75.74263!, 18.0!)
Me.XrLabel7.Text = "Saldoa30"
'
'XrLabel8
'
Me.XrLabel8.LocationFloat = New DevExpress.Utils.PointFloat(227.5865!, 149.5!)
Me.XrLabel8.Name = "XrLabel8"
Me.XrLabel8.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel8.SizeF = New System.Drawing.SizeF(69.78761!, 18.0!)
Me.XrLabel8.Text = "Saldo31a60"
'
'XrLabel9
'
Me.XrLabel9.LocationFloat = New DevExpress.Utils.PointFloat(315.8251!, 149.5!)
Me.XrLabel9.Name = "XrLabel9"
Me.XrLabel9.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel9.SizeF = New System.Drawing.SizeF(73.91107!, 18.0!)
Me.XrLabel9.Text = "Saldo61a90"
'
'XrLabel10
'
Me.XrLabel10.LocationFloat = New DevExpress.Utils.PointFloat(398.1559!, 149.5!)
Me.XrLabel10.Name = "XrLabel10"
Me.XrLabel10.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel10.SizeF = New System.Drawing.SizeF(89.20593!, 18.0!)
Me.XrLabel10.Text = "Saldo91a120"
'
'XrLabel11
'
Me.XrLabel11.LocationFloat = New DevExpress.Utils.PointFloat(501.5453!, 149.5!)
Me.XrLabel11.Name = "XrLabel11"
Me.XrLabel11.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel11.SizeF = New System.Drawing.SizeF(89.2699!, 18.0!)
Me.XrLabel11.Text = "Saldo121a180"
'
'XrLabel12
'
Me.XrLabel12.LocationFloat = New DevExpress.Utils.PointFloat(608.9234!, 149.5!)
Me.XrLabel12.Name = "XrLabel12"
Me.XrLabel12.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel12.SizeF = New System.Drawing.SizeF(94.47827!, 18.0!)
Me.XrLabel12.Text = "Saldo181a600"
'
'XrLabel13
'
Me.XrLabel13.LocationFloat = New DevExpress.Utils.PointFloat(716.9433!, 149.5!)
Me.XrLabel13.Name = "XrLabel13"
Me.XrLabel13.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel13.SizeF = New System.Drawing.SizeF(81.20685!, 18.0!)
Me.XrLabel13.Text = "Saldomas600"
'
'XrLabel14
'
Me.XrLabel14.LocationFloat = New DevExpress.Utils.PointFloat(809.7319!, 149.5!)
Me.XrLabel14.Name = "XrLabel14"
Me.XrLabel14.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel14.SizeF = New System.Drawing.SizeF(80.26813!, 18.0!)
Me.XrLabel14.Text = "Total Cliente"
'
'PageFooterBand1
'
Me.PageFooterBand1.HeightF = 31.00001!
Me.PageFooterBand1.Name = "PageFooterBand1"
'
'ReportHeaderBand1
'
Me.ReportHeaderBand1.HeightF = 0.0!
Me.ReportHeaderBand1.Name = "ReportHeaderBand1"
'
'GroupFooterBand1
'
Me.GroupFooterBand1.HeightF = 1.0!
Me.GroupFooterBand1.Name = "GroupFooterBand1"
'
'GroupFooterBand2
'
Me.GroupFooterBand2.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.XrLabel47, Me.XrLabel46, Me.XrLabel28, Me.XrLabel29, Me.XrLabel30, Me.XrLabel31, Me.XrLabel32, Me.XrLabel33, Me.XrLabel34, Me.XrLabel35, Me.XrLabel36})
Me.GroupFooterBand2.HeightF = 54.99999!
Me.GroupFooterBand2.Level = 1
Me.GroupFooterBand2.Name = "GroupFooterBand2"
'
'XrLabel47
'
Me.XrLabel47.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Bodega")})
Me.XrLabel47.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel47.LocationFloat = New DevExpress.Utils.PointFloat(175.6743!, 0.0!)
Me.XrLabel47.Name = "XrLabel47"
Me.XrLabel47.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel47.SizeF = New System.Drawing.SizeF(363.2288!, 18.0!)
Me.XrLabel47.StyleName = "DataField"
Me.XrLabel47.StylePriority.UseFont = False
Me.XrLabel47.Text = "XrLabel2"
'
'XrLabel46
'
Me.XrLabel46.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel46.LocationFloat = New DevExpress.Utils.PointFloat(34.375!, 0.0!)
Me.XrLabel46.Name = "XrLabel46"
Me.XrLabel46.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel46.SizeF = New System.Drawing.SizeF(140.3196!, 20.00002!)
Me.XrLabel46.StyleName = "FieldCaption"
Me.XrLabel46.StylePriority.UseFont = False
Me.XrLabel46.Text = "Totales de la Sucursal :"
'
'XrLabel28
'
Me.XrLabel28.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.SaldoNovencido")})
Me.XrLabel28.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel28.LocationFloat = New DevExpress.Utils.PointFloat(15.24502!, 35.00001!)
Me.XrLabel28.Name = "XrLabel28"
Me.XrLabel28.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel28.SizeF = New System.Drawing.SizeF(103.0097!, 18.0!)
Me.XrLabel28.StyleName = "FieldCaption"
Me.XrLabel28.StylePriority.UseFont = False
Me.XrLabel28.StylePriority.UseTextAlignment = False
XrSummary1.FormatString = "{0:n2}"
XrSummary1.Running = DevExpress.XtraReports.UI.SummaryRunning.Group
Me.XrLabel28.Summary = XrSummary1
Me.XrLabel28.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel29
'
Me.XrLabel29.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldoa30", "{0:C2}")})
Me.XrLabel29.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel29.LocationFloat = New DevExpress.Utils.PointFloat(130.7548!, 35.00001!)
Me.XrLabel29.Name = "XrLabel29"
Me.XrLabel29.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel29.SizeF = New System.Drawing.SizeF(60.11765!, 18.0!)
Me.XrLabel29.StyleName = "FieldCaption"
Me.XrLabel29.StylePriority.UseFont = False
Me.XrLabel29.StylePriority.UseTextAlignment = False
XrSummary2.FormatString = "{0:n2}"
XrSummary2.Running = DevExpress.XtraReports.UI.SummaryRunning.Group
Me.XrLabel29.Summary = XrSummary2
Me.XrLabel29.Text = "XrLabel29"
Me.XrLabel29.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel30
'
Me.XrLabel30.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo31a60", "{0:C2}")})
Me.XrLabel30.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel30.LocationFloat = New DevExpress.Utils.PointFloat(206.4975!, 35.00001!)
Me.XrLabel30.Name = "XrLabel30"
Me.XrLabel30.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel30.SizeF = New System.Drawing.SizeF(90.87663!, 18.0!)
Me.XrLabel30.StyleName = "FieldCaption"
Me.XrLabel30.StylePriority.UseFont = False
Me.XrLabel30.StylePriority.UseTextAlignment = False
XrSummary3.FormatString = "{0:n2}"
XrSummary3.Running = DevExpress.XtraReports.UI.SummaryRunning.Group
Me.XrLabel30.Summary = XrSummary3
Me.XrLabel30.Text = "XrLabel30"
Me.XrLabel30.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel31
'
Me.XrLabel31.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo61a90", "{0:C2}")})
Me.XrLabel31.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel31.LocationFloat = New DevExpress.Utils.PointFloat(315.8251!, 36.99999!)
Me.XrLabel31.Name = "XrLabel31"
Me.XrLabel31.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel31.SizeF = New System.Drawing.SizeF(73.91107!, 18.0!)
Me.XrLabel31.StyleName = "FieldCaption"
Me.XrLabel31.StylePriority.UseFont = False
Me.XrLabel31.StylePriority.UseTextAlignment = False
XrSummary4.FormatString = "{0:n2}"
XrSummary4.Running = DevExpress.XtraReports.UI.SummaryRunning.Group
Me.XrLabel31.Summary = XrSummary4
Me.XrLabel31.Text = "XrLabel31"
Me.XrLabel31.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel32
'
Me.XrLabel32.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo91a120", "{0:C2}")})
Me.XrLabel32.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel32.LocationFloat = New DevExpress.Utils.PointFloat(398.1559!, 35.00001!)
Me.XrLabel32.Name = "XrLabel32"
Me.XrLabel32.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel32.SizeF = New System.Drawing.SizeF(89.20599!, 18.0!)
Me.XrLabel32.StyleName = "FieldCaption"
Me.XrLabel32.StylePriority.UseFont = False
Me.XrLabel32.StylePriority.UseTextAlignment = False
XrSummary5.FormatString = "{0:n2}"
XrSummary5.Running = DevExpress.XtraReports.UI.SummaryRunning.Group
Me.XrLabel32.Summary = XrSummary5
Me.XrLabel32.Text = "XrLabel32"
Me.XrLabel32.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel33
'
Me.XrLabel33.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo121a180", "{0:C2}")})
Me.XrLabel33.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel33.LocationFloat = New DevExpress.Utils.PointFloat(501.5453!, 35.00001!)
Me.XrLabel33.Name = "XrLabel33"
Me.XrLabel33.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel33.SizeF = New System.Drawing.SizeF(89.26993!, 18.0!)
Me.XrLabel33.StyleName = "FieldCaption"
Me.XrLabel33.StylePriority.UseFont = False
Me.XrLabel33.StylePriority.UseTextAlignment = False
XrSummary6.FormatString = "{0:n2}"
XrSummary6.Running = DevExpress.XtraReports.UI.SummaryRunning.Group
Me.XrLabel33.Summary = XrSummary6
Me.XrLabel33.Text = "XrLabel33"
Me.XrLabel33.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel34
'
Me.XrLabel34.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo181a600", "{0:C2}")})
Me.XrLabel34.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel34.LocationFloat = New DevExpress.Utils.PointFloat(608.9234!, 35.00001!)
Me.XrLabel34.Name = "XrLabel34"
Me.XrLabel34.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel34.SizeF = New System.Drawing.SizeF(85.13!, 18.0!)
Me.XrLabel34.StyleName = "FieldCaption"
Me.XrLabel34.StylePriority.UseFont = False
Me.XrLabel34.StylePriority.UseTextAlignment = False
XrSummary7.FormatString = "{0:n2}"
XrSummary7.Running = DevExpress.XtraReports.UI.SummaryRunning.Group
Me.XrLabel34.Summary = XrSummary7
Me.XrLabel34.Text = "XrLabel34"
Me.XrLabel34.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel35
'
Me.XrLabel35.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldomas600", "{0:C2}")})
Me.XrLabel35.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel35.LocationFloat = New DevExpress.Utils.PointFloat(716.9433!, 35.00001!)
Me.XrLabel35.Name = "XrLabel35"
Me.XrLabel35.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel35.SizeF = New System.Drawing.SizeF(81.20691!, 18.0!)
Me.XrLabel35.StyleName = "FieldCaption"
Me.XrLabel35.StylePriority.UseFont = False
Me.XrLabel35.StylePriority.UseTextAlignment = False
XrSummary8.FormatString = "{0:n2}"
XrSummary8.Running = DevExpress.XtraReports.UI.SummaryRunning.Group
Me.XrLabel35.Summary = XrSummary8
Me.XrLabel35.Text = "XrLabel35"
Me.XrLabel35.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel36
'
Me.XrLabel36.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.TotalCliente", "{0:C2}")})
Me.XrLabel36.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel36.LocationFloat = New DevExpress.Utils.PointFloat(809.7321!, 35.00001!)
Me.XrLabel36.Name = "XrLabel36"
Me.XrLabel36.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel36.SizeF = New System.Drawing.SizeF(80.26794!, 18.0!)
Me.XrLabel36.StyleName = "FieldCaption"
Me.XrLabel36.StylePriority.UseFont = False
Me.XrLabel36.StylePriority.UseTextAlignment = False
XrSummary9.FormatString = "{0:n2}"
XrSummary9.Running = DevExpress.XtraReports.UI.SummaryRunning.Group
Me.XrLabel36.Summary = XrSummary9
Me.XrLabel36.Text = "XrLabel36"
Me.XrLabel36.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'ReportFooterBand1
'
Me.ReportFooterBand1.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.XrLabel45, Me.XrLabel27, Me.XrLabel37, Me.XrLabel38, Me.XrLabel39, Me.XrLabel40, Me.XrLabel41, Me.XrLabel42, Me.XrLabel43, Me.XrLabel44})
Me.ReportFooterBand1.HeightF = 66.45832!
Me.ReportFooterBand1.Name = "ReportFooterBand1"
'
'XrLabel45
'
Me.XrLabel45.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel45.LocationFloat = New DevExpress.Utils.PointFloat(19.76484!, 10.00001!)
Me.XrLabel45.Name = "XrLabel45"
Me.XrLabel45.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel45.SizeF = New System.Drawing.SizeF(140.3196!, 20.00002!)
Me.XrLabel45.StyleName = "FieldCaption"
Me.XrLabel45.StylePriority.UseFont = False
Me.XrLabel45.Text = "Totales Generales :"
'
'XrLabel27
'
Me.XrLabel27.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.TotalCliente", "{0:C2}")})
Me.XrLabel27.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel27.LocationFloat = New DevExpress.Utils.PointFloat(809.7322!, 38.45832!)
Me.XrLabel27.Name = "XrLabel27"
Me.XrLabel27.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel27.SizeF = New System.Drawing.SizeF(80.26794!, 18.0!)
Me.XrLabel27.StyleName = "FieldCaption"
Me.XrLabel27.StylePriority.UseFont = False
Me.XrLabel27.StylePriority.UseTextAlignment = False
XrSummary10.FormatString = "{0:n2}"
XrSummary10.Running = DevExpress.XtraReports.UI.SummaryRunning.Report
Me.XrLabel27.Summary = XrSummary10
Me.XrLabel27.Text = "XrLabel36"
Me.XrLabel27.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel37
'
Me.XrLabel37.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldomas600", "{0:C2}")})
Me.XrLabel37.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel37.LocationFloat = New DevExpress.Utils.PointFloat(716.9434!, 38.45832!)
Me.XrLabel37.Name = "XrLabel37"
Me.XrLabel37.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel37.SizeF = New System.Drawing.SizeF(81.20691!, 18.0!)
Me.XrLabel37.StyleName = "FieldCaption"
Me.XrLabel37.StylePriority.UseFont = False
Me.XrLabel37.StylePriority.UseTextAlignment = False
XrSummary11.FormatString = "{0:n2}"
XrSummary11.Running = DevExpress.XtraReports.UI.SummaryRunning.Report
Me.XrLabel37.Summary = XrSummary11
Me.XrLabel37.Text = "XrLabel35"
Me.XrLabel37.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel38
'
Me.XrLabel38.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo181a600", "{0:C2}")})
Me.XrLabel38.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel38.LocationFloat = New DevExpress.Utils.PointFloat(608.9235!, 38.45832!)
Me.XrLabel38.Name = "XrLabel38"
Me.XrLabel38.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel38.SizeF = New System.Drawing.SizeF(85.13!, 18.0!)
Me.XrLabel38.StyleName = "FieldCaption"
Me.XrLabel38.StylePriority.UseFont = False
Me.XrLabel38.StylePriority.UseTextAlignment = False
XrSummary12.FormatString = "{0:n2}"
XrSummary12.Running = DevExpress.XtraReports.UI.SummaryRunning.Report
Me.XrLabel38.Summary = XrSummary12
Me.XrLabel38.Text = "XrLabel34"
Me.XrLabel38.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel39
'
Me.XrLabel39.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo121a180", "{0:C2}")})
Me.XrLabel39.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel39.LocationFloat = New DevExpress.Utils.PointFloat(501.5453!, 38.45832!)
Me.XrLabel39.Name = "XrLabel39"
Me.XrLabel39.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel39.SizeF = New System.Drawing.SizeF(89.26993!, 18.0!)
Me.XrLabel39.StyleName = "FieldCaption"
Me.XrLabel39.StylePriority.UseFont = False
Me.XrLabel39.StylePriority.UseTextAlignment = False
XrSummary13.FormatString = "{0:n2}"
XrSummary13.Running = DevExpress.XtraReports.UI.SummaryRunning.Report
Me.XrLabel39.Summary = XrSummary13
Me.XrLabel39.Text = "XrLabel33"
Me.XrLabel39.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel40
'
Me.XrLabel40.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo91a120", "{0:C2}")})
Me.XrLabel40.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel40.LocationFloat = New DevExpress.Utils.PointFloat(398.1559!, 38.45832!)
Me.XrLabel40.Name = "XrLabel40"
Me.XrLabel40.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel40.SizeF = New System.Drawing.SizeF(89.20599!, 18.0!)
Me.XrLabel40.StyleName = "FieldCaption"
Me.XrLabel40.StylePriority.UseFont = False
Me.XrLabel40.StylePriority.UseTextAlignment = False
XrSummary14.FormatString = "{0:n2}"
XrSummary14.Running = DevExpress.XtraReports.UI.SummaryRunning.Report
Me.XrLabel40.Summary = XrSummary14
Me.XrLabel40.Text = "XrLabel32"
Me.XrLabel40.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel41
'
Me.XrLabel41.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo61a90", "{0:C2}")})
Me.XrLabel41.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel41.LocationFloat = New DevExpress.Utils.PointFloat(315.8251!, 40.4583!)
Me.XrLabel41.Name = "XrLabel41"
Me.XrLabel41.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel41.SizeF = New System.Drawing.SizeF(73.91107!, 18.0!)
Me.XrLabel41.StyleName = "FieldCaption"
Me.XrLabel41.StylePriority.UseFont = False
Me.XrLabel41.StylePriority.UseTextAlignment = False
XrSummary15.FormatString = "{0:n2}"
XrSummary15.Running = DevExpress.XtraReports.UI.SummaryRunning.Report
Me.XrLabel41.Summary = XrSummary15
Me.XrLabel41.Text = "XrLabel31"
Me.XrLabel41.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel42
'
Me.XrLabel42.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldo31a60", "{0:C2}")})
Me.XrLabel42.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel42.LocationFloat = New DevExpress.Utils.PointFloat(206.4975!, 38.45832!)
Me.XrLabel42.Name = "XrLabel42"
Me.XrLabel42.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel42.SizeF = New System.Drawing.SizeF(90.87663!, 18.0!)
Me.XrLabel42.StyleName = "FieldCaption"
Me.XrLabel42.StylePriority.UseFont = False
Me.XrLabel42.StylePriority.UseTextAlignment = False
XrSummary16.FormatString = "{0:n2}"
XrSummary16.Running = DevExpress.XtraReports.UI.SummaryRunning.Report
Me.XrLabel42.Summary = XrSummary16
Me.XrLabel42.Text = "XrLabel30"
Me.XrLabel42.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel43
'
Me.XrLabel43.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.Saldoa30", "{0:C2}")})
Me.XrLabel43.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel43.LocationFloat = New DevExpress.Utils.PointFloat(130.7549!, 38.45832!)
Me.XrLabel43.Name = "XrLabel43"
Me.XrLabel43.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel43.SizeF = New System.Drawing.SizeF(60.11765!, 18.0!)
Me.XrLabel43.StyleName = "FieldCaption"
Me.XrLabel43.StylePriority.UseFont = False
Me.XrLabel43.StylePriority.UseTextAlignment = False
XrSummary17.FormatString = "{0:n2}"
XrSummary17.Running = DevExpress.XtraReports.UI.SummaryRunning.Report
Me.XrLabel43.Summary = XrSummary17
Me.XrLabel43.Text = "XrLabel29"
Me.XrLabel43.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel44
'
Me.XrLabel44.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.SaldoNovencido")})
Me.XrLabel44.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel44.LocationFloat = New DevExpress.Utils.PointFloat(15.24506!, 38.45832!)
Me.XrLabel44.Name = "XrLabel44"
Me.XrLabel44.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel44.SizeF = New System.Drawing.SizeF(103.0097!, 18.0!)
Me.XrLabel44.StyleName = "FieldCaption"
Me.XrLabel44.StylePriority.UseFont = False
Me.XrLabel44.StylePriority.UseTextAlignment = False
XrSummary18.FormatString = "{0:n2}"
XrSummary18.Running = DevExpress.XtraReports.UI.SummaryRunning.Report
Me.XrLabel44.Summary = XrSummary18
Me.XrLabel44.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'Title
'
Me.Title.BackColor = System.Drawing.Color.Transparent
Me.Title.BorderColor = System.Drawing.Color.Black
Me.Title.Borders = DevExpress.XtraPrinting.BorderSide.None
Me.Title.BorderWidth = 1.0!
Me.Title.Font = New System.Drawing.Font("Times New Roman", 20.0!, System.Drawing.FontStyle.Bold)
Me.Title.ForeColor = System.Drawing.Color.Maroon
Me.Title.Name = "Title"
'
'FieldCaption
'
Me.FieldCaption.BackColor = System.Drawing.Color.Transparent
Me.FieldCaption.BorderColor = System.Drawing.Color.Black
Me.FieldCaption.Borders = DevExpress.XtraPrinting.BorderSide.None
Me.FieldCaption.BorderWidth = 1.0!
Me.FieldCaption.Font = New System.Drawing.Font("Arial", 10.0!, System.Drawing.FontStyle.Bold)
Me.FieldCaption.ForeColor = System.Drawing.Color.Maroon
Me.FieldCaption.Name = "FieldCaption"
'
'PageInfo
'
Me.PageInfo.BackColor = System.Drawing.Color.Transparent
Me.PageInfo.BorderColor = System.Drawing.Color.Black
Me.PageInfo.Borders = DevExpress.XtraPrinting.BorderSide.None
Me.PageInfo.BorderWidth = 1.0!
Me.PageInfo.Font = New System.Drawing.Font("Times New Roman", 10.0!, System.Drawing.FontStyle.Bold)
Me.PageInfo.ForeColor = System.Drawing.Color.Black
Me.PageInfo.Name = "PageInfo"
'
'DataField
'
Me.DataField.BackColor = System.Drawing.Color.Transparent
Me.DataField.BorderColor = System.Drawing.Color.Black
Me.DataField.Borders = DevExpress.XtraPrinting.BorderSide.None
Me.DataField.BorderWidth = 1.0!
Me.DataField.Font = New System.Drawing.Font("Times New Roman", 10.0!)
Me.DataField.ForeColor = System.Drawing.Color.Black
Me.DataField.Name = "DataField"
Me.DataField.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
'
'PageHeader
'
Me.PageHeader.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.XrLabel49, Me.XrLabel48, Me.XrPageInfo4, Me.XrPageInfo3, Me.XrLabel4, Me.XrLabel5, Me.lblHasta, Me.lblCliente, Me.lblNombreReporte, Me.lblEmpresa, Me.XrLabel14, Me.XrLabel13, Me.XrLabel12, Me.XrLabel11, Me.XrLabel10, Me.XrLabel9, Me.XrLabel8, Me.XrLabel7, Me.XrLabel6})
Me.PageHeader.HeightF = 177.5!
Me.PageHeader.Name = "PageHeader"
'
'XrLabel49
'
Me.XrLabel49.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding("Text", Nothing, "ccfGetAntiguedadSaldos.CalculatedField1")})
Me.XrLabel49.Font = New System.Drawing.Font("Verdana", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel49.LocationFloat = New DevExpress.Utils.PointFloat(215.6208!, 99.12504!)
Me.XrLabel49.Name = "XrLabel49"
Me.XrLabel49.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel49.SizeF = New System.Drawing.SizeF(228.1584!, 22.99999!)
Me.XrLabel49.StylePriority.UseFont = False
Me.XrLabel49.Text = "XrLabel49"
'
'XrLabel48
'
Me.XrLabel48.Font = New System.Drawing.Font("Verdana", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel48.LocationFloat = New DevExpress.Utils.PointFloat(125.1225!, 99.12504!)
Me.XrLabel48.Name = "XrLabel48"
Me.XrLabel48.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel48.SizeF = New System.Drawing.SizeF(81.37496!, 23.0!)
Me.XrLabel48.StylePriority.UseFont = False
Me.XrLabel48.Text = "Moneda :"
'
'XrPageInfo4
'
Me.XrPageInfo4.Font = New System.Drawing.Font("Times New Roman", 10.0!)
Me.XrPageInfo4.Format = "Page {0} of {1}"
Me.XrPageInfo4.LocationFloat = New DevExpress.Utils.PointFloat(654.9127!, 17.125!)
Me.XrPageInfo4.Name = "XrPageInfo4"
Me.XrPageInfo4.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrPageInfo4.SizeF = New System.Drawing.SizeF(81.74994!, 23.0!)
Me.XrPageInfo4.StyleName = "PageInfo"
Me.XrPageInfo4.StylePriority.UseFont = False
Me.XrPageInfo4.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrPageInfo3
'
Me.XrPageInfo3.Font = New System.Drawing.Font("Times New Roman", 10.0!)
Me.XrPageInfo3.Format = "{0:dd/MM/yyyy HH:mm}"
Me.XrPageInfo3.LocationFloat = New DevExpress.Utils.PointFloat(595.5376!, 40.12502!)
Me.XrPageInfo3.Name = "XrPageInfo3"
Me.XrPageInfo3.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrPageInfo3.PageInfo = DevExpress.XtraPrinting.PageInfo.DateTime
Me.XrPageInfo3.SizeF = New System.Drawing.SizeF(141.1249!, 23.0!)
Me.XrPageInfo3.StyleName = "PageInfo"
Me.XrPageInfo3.StylePriority.UseFont = False
Me.XrPageInfo3.StylePriority.UseTextAlignment = False
Me.XrPageInfo3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
'
'XrLabel4
'
Me.XrLabel4.Font = New System.Drawing.Font("Verdana", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel4.LocationFloat = New DevExpress.Utils.PointFloat(124.329!, 76.12502!)
Me.XrLabel4.Name = "XrLabel4"
Me.XrLabel4.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel4.SizeF = New System.Drawing.SizeF(81.37496!, 23.0!)
Me.XrLabel4.StylePriority.UseFont = False
Me.XrLabel4.Text = "Cliente :"
'
'XrLabel5
'
Me.XrLabel5.Font = New System.Drawing.Font("Verdana", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrLabel5.LocationFloat = New DevExpress.Utils.PointFloat(259.9543!, 53.125!)
Me.XrLabel5.Name = "XrLabel5"
Me.XrLabel5.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.XrLabel5.SizeF = New System.Drawing.SizeF(94.8334!, 23.0!)
Me.XrLabel5.StylePriority.UseFont = False
Me.XrLabel5.Text = "Cortado al :"
'
'lblHasta
'
Me.lblHasta.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding(Me.pdFechaFinal, "Text", "{0:dd/MM/yyyy}")})
Me.lblHasta.Font = New System.Drawing.Font("Verdana", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblHasta.LocationFloat = New DevExpress.Utils.PointFloat(378.4542!, 53.125!)
Me.lblHasta.Name = "lblHasta"
Me.lblHasta.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.lblHasta.SizeF = New System.Drawing.SizeF(120.2498!, 23.0!)
Me.lblHasta.StylePriority.UseFont = False
'
'pdFechaFinal
'
Me.pdFechaFinal.Description = "Parameter1"
Me.pdFechaFinal.Name = "pdFechaFinal"
Me.pdFechaFinal.Type = GetType(Date)
Me.pdFechaFinal.Visible = False
'
'lblCliente
'
Me.lblCliente.CanGrow = False
Me.lblCliente.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding(Me.psCliente, "Text", "")})
Me.lblCliente.Font = New System.Drawing.Font("Verdana", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblCliente.LocationFloat = New DevExpress.Utils.PointFloat(215.6208!, 76.12502!)
Me.lblCliente.Name = "lblCliente"
Me.lblCliente.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.lblCliente.SizeF = New System.Drawing.SizeF(538.5416!, 23.0!)
Me.lblCliente.StylePriority.UseFont = False
'
'psCliente
'
Me.psCliente.Description = "Parameter1"
Me.psCliente.Name = "psCliente"
Me.psCliente.Visible = False
'
'lblNombreReporte
'
Me.lblNombreReporte.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold)
Me.lblNombreReporte.LocationFloat = New DevExpress.Utils.PointFloat(241.1284!, 30.125!)
Me.lblNombreReporte.Name = "lblNombreReporte"
Me.lblNombreReporte.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.lblNombreReporte.SizeF = New System.Drawing.SizeF(246.2336!, 23.00001!)
Me.lblNombreReporte.StylePriority.UseFont = False
Me.lblNombreReporte.StylePriority.UseTextAlignment = False
Me.lblNombreReporte.Text = "Análisis de Vencimiento"
Me.lblNombreReporte.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter
'
'lblEmpresa
'
Me.lblEmpresa.DataBindings.AddRange(New DevExpress.XtraReports.UI.XRBinding() {New DevExpress.XtraReports.UI.XRBinding(Me.psEmpresa, "Text", "")})
Me.lblEmpresa.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold)
Me.lblEmpresa.LocationFloat = New DevExpress.Utils.PointFloat(189.6207!, 7.124996!)
Me.lblEmpresa.Name = "lblEmpresa"
Me.lblEmpresa.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
Me.lblEmpresa.SizeF = New System.Drawing.SizeF(344.7917!, 23.0!)
Me.lblEmpresa.StylePriority.UseFont = False
Me.lblEmpresa.StylePriority.UseTextAlignment = False
Me.lblEmpresa.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter
'
'psEmpresa
'
Me.psEmpresa.Description = "Parameter1"
Me.psEmpresa.Name = "psEmpresa"
Me.psEmpresa.Visible = False
'
'piIDBodega
'
Me.piIDBodega.Description = "Parameter1"
Me.piIDBodega.Name = "piIDBodega"
Me.piIDBodega.Type = GetType(Integer)
Me.piIDBodega.ValueInfo = "0"
Me.piIDBodega.Visible = False
'
'piIDCliente
'
Me.piIDCliente.Description = "Parameter1"
Me.piIDCliente.Name = "piIDCliente"
Me.piIDCliente.Type = GetType(Integer)
Me.piIDCliente.ValueInfo = "0"
Me.piIDCliente.Visible = False
'
'piConsolidaSucursal
'
Me.piConsolidaSucursal.Description = "Parameter1"
Me.piConsolidaSucursal.Name = "piConsolidaSucursal"
Me.piConsolidaSucursal.Type = GetType(Short)
Me.piConsolidaSucursal.ValueInfo = "0"
Me.piConsolidaSucursal.Visible = False
'
'piEnDolar
'
Me.piEnDolar.Description = "Parameter1"
Me.piEnDolar.Name = "piEnDolar"
Me.piEnDolar.Type = GetType(Short)
Me.piEnDolar.ValueInfo = "0"
Me.piEnDolar.Visible = False
'
'CalculatedField1
'
Me.CalculatedField1.DataMember = "ccfGetAntiguedadSaldos"
Me.CalculatedField1.DisplayName = "Moneda"
Me.CalculatedField1.Expression = "Iif([Parameters.piEnDolar]=1,'DOLAR' ,'CORDOBA' )"
Me.CalculatedField1.Name = "CalculatedField1"
'
'rptAnalisisVencimiento
'
Me.Bands.AddRange(New DevExpress.XtraReports.UI.Band() {Me.Detail, Me.TopMargin, Me.BottomMargin, Me.GroupHeaderSucursal, Me.GroupHeaderCliente, Me.PageFooterBand1, Me.ReportHeaderBand1, Me.GroupFooterBand2, Me.ReportFooterBand1, Me.PageHeader})
Me.CalculatedFields.AddRange(New DevExpress.XtraReports.UI.CalculatedField() {Me.CalculatedField1})
Me.ComponentStorage.AddRange(New System.ComponentModel.IComponent() {Me.SqlDataSource1})
Me.DataMember = "ccfGetAntiguedadSaldos"
Me.DataSource = Me.SqlDataSource1
Me.Landscape = True
Me.Margins = New System.Drawing.Printing.Margins(100, 103, 100, 100)
Me.PageHeight = 850
Me.PageWidth = 1100
Me.Parameters.AddRange(New DevExpress.XtraReports.Parameters.Parameter() {Me.psCliente, Me.psEmpresa, Me.piIDBodega, Me.piIDCliente, Me.pdFechaFinal, Me.piConsolidaSucursal, Me.piEnDolar})
Me.ScriptLanguage = DevExpress.XtraReports.ScriptLanguage.VisualBasic
Me.StyleSheet.AddRange(New DevExpress.XtraReports.UI.XRControlStyle() {Me.Title, Me.FieldCaption, Me.PageInfo, Me.DataField})
Me.Version = "15.2"
CType(Me, System.ComponentModel.ISupportInitialize).EndInit()
End Sub
Friend WithEvents Detail As DevExpress.XtraReports.UI.DetailBand
Friend WithEvents TopMargin As DevExpress.XtraReports.UI.TopMarginBand
Friend WithEvents BottomMargin As DevExpress.XtraReports.UI.BottomMarginBand
Friend WithEvents XrLabel15 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel16 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel17 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel18 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel19 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel20 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel21 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel22 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel23 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel24 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel25 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel26 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents SqlDataSource1 As DevExpress.DataAccess.Sql.SqlDataSource
Friend WithEvents GroupHeaderSucursal As DevExpress.XtraReports.UI.GroupHeaderBand
Friend WithEvents XrLabel2 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel1 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents GroupHeaderCliente As DevExpress.XtraReports.UI.GroupHeaderBand
Friend WithEvents XrLabel6 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel7 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel8 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel9 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel10 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel11 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel12 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel13 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel14 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents PageFooterBand1 As DevExpress.XtraReports.UI.PageFooterBand
Friend WithEvents ReportHeaderBand1 As DevExpress.XtraReports.UI.ReportHeaderBand
Friend WithEvents GroupFooterBand1 As DevExpress.XtraReports.UI.GroupFooterBand
Friend WithEvents GroupFooterBand2 As DevExpress.XtraReports.UI.GroupFooterBand
Friend WithEvents XrLabel28 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel29 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel30 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel31 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel32 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel33 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel34 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel35 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel36 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents ReportFooterBand1 As DevExpress.XtraReports.UI.ReportFooterBand
Friend WithEvents Title As DevExpress.XtraReports.UI.XRControlStyle
Friend WithEvents FieldCaption As DevExpress.XtraReports.UI.XRControlStyle
Friend WithEvents PageInfo As DevExpress.XtraReports.UI.XRControlStyle
Friend WithEvents DataField As DevExpress.XtraReports.UI.XRControlStyle
Friend WithEvents PageHeader As DevExpress.XtraReports.UI.PageHeaderBand
Friend WithEvents XrLabel3 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrPageInfo4 As DevExpress.XtraReports.UI.XRPageInfo
Friend WithEvents XrPageInfo3 As DevExpress.XtraReports.UI.XRPageInfo
Friend WithEvents XrLabel4 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel5 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents lblHasta As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents lblCliente As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents lblNombreReporte As DevExpress.XtraReports.UI.XRLabel
Public WithEvents lblEmpresa As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents psCliente As DevExpress.XtraReports.Parameters.Parameter
Friend WithEvents psEmpresa As DevExpress.XtraReports.Parameters.Parameter
Friend WithEvents piIDBodega As DevExpress.XtraReports.Parameters.Parameter
Friend WithEvents piIDCliente As DevExpress.XtraReports.Parameters.Parameter
Friend WithEvents pdFechaFinal As DevExpress.XtraReports.Parameters.Parameter
Friend WithEvents piConsolidaSucursal As DevExpress.XtraReports.Parameters.Parameter
Friend WithEvents piEnDolar As DevExpress.XtraReports.Parameters.Parameter
Friend WithEvents XrLabel27 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel37 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel38 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel39 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel40 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel41 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel42 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel43 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel44 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel45 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel47 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel46 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel49 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrLabel48 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents CalculatedField1 As DevExpress.XtraReports.UI.CalculatedField
End Class
| Java |
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('dashboard/index',['page'=>'Dashboard','breadcrumbs'=>['dashboard/'=>'/home']]);
}
}
| Java |
{# The template expects one input parameter: `active`, which determines what link we are currently at #}
{% load i18n %}
<div class="economy__leftmenu">
<a class="economy__leftbutton resetlink {% if filter is None %}active{% endif %}"
href="{% url 'economy_soci_sessions' %}">{% trans 'X-lists' %}</a>
<a class="economy__leftbutton resetlink {% if filter == 'open' %}active{% endif %}"
href="{% url 'economy_soci_sessions' %}?filter=open">{% trans 'Open' %}</a>
{% if perms.economy.add_socisession %}
<a class="economy__leftbutton resetlink {% if filter == 'closed' %}active{% endif %}"
href="{% url 'economy_soci_sessions' %}?filter=closed">{% trans 'Closed' %}</a>
{% endif %}
</div> | Java |
const gal=[//731-62
'1@001/b4avsq1y2i',
'1@002/50uvpeo7tb',
'1@002/0ypu4wgjxm',
'1@002/b61d80e9pf',
'1@002/f1kb57t4ul',
'1@002/swq38v49nz',
'1@002/zeak367fw1',
'1@003/nx1ld4j9pe',
'1@003/yh0ub5rank',
'1@004/j29uftobmh',
'1@005/0asu1qo75n',
'1@005/4c7bn1q5mx',
'1@005/le3vrzbwfs',
'1@006/ek0tq9wvny',
'1@006/ax21m8tjos',
'1@006/w2e3104dp6',
'1@007/bsukxlv9j7',
'1@007/w5cpl0uvy6',
'1@007/l04q3wrucj',
'2@007/s2hr6jv7nc',
'2@009/31yrxp8waj',
'2@009/8josfrbgwi',
'2@009/rt4jie1fg8',
'2@009/p0va85n4gf',
'2@010/i9thzxn50q',
'3@010/a6w84ltj02',
'3@010/mfyevin3so',
'3@010/wdy5qzflnv',
'3@011/06wim8bjdp',
'3@011/avtd46k9cx',
'3@011/80915y2exz',
'3@011/vkt4dalwhb',
'3@011/znudscat9h',
'3@012/18xg4h9s3i',
'3@012/120sub86vt',
'3@012/5gxj7u0om8',
'3@012/95gzec2rsm',
'3@012/dihoerqp40',
'3@012/nif7secp8l',
'3@012/q8awn1iplo',
'3@012/ubzfcjte63',
'3@013/b9atnq1les',
'3@013/zof4tprh73',
'3@013/lvdyctgefs',
'4@013/c7fgqbsxkn',
'4@013/ci9vg76yj5',
'4@013/y3v8tjreas',
'4@014/75krn9ifbp',
'4@014/9tf7n5iexy',
'4@014/boz3y1wauf',
'4@014/ihqxma938n',
'4@014/suxj4yv5w6',
'4@014/o19tbsqjxe',
'4@014/wy8tx24g0c',
'4@015/302u7cs5nx',
'4@015/4bo9c8053u',
'4@015/8clxnh6eao',
'4@015/hbi1d9grwz',
'4@015/w8vmtnod7z',
'5@016/0yeinjua6h',
'5@016/rgpcwv4nym',
'5@016/scxjm7ofar']; | Java |
//
// semaphore.cpp
//
// Circle - A C++ bare metal environment for Raspberry Pi
// Copyright (C) 2021 R. Stange <rsta2@o2online.de>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#include <circle/sched/semaphore.h>
#include <circle/atomic.h>
#include <assert.h>
CSemaphore::CSemaphore (unsigned nInitialCount)
: m_nCount (nInitialCount),
m_Event (TRUE)
{
assert (m_nCount > 0);
}
CSemaphore::~CSemaphore (void)
{
assert (m_nCount > 0);
}
unsigned CSemaphore::GetState (void) const
{
return AtomicGet (&m_nCount);
}
void CSemaphore::Down (void)
{
while (AtomicGet (&m_nCount) == 0)
{
m_Event.Wait ();
}
if (AtomicDecrement (&m_nCount) == 0)
{
assert (m_Event.GetState ());
m_Event.Clear ();
}
}
void CSemaphore::Up (void)
{
if (AtomicIncrement (&m_nCount) == 1)
{
assert (!m_Event.GetState ());
m_Event.Set ();
}
#if NDEBUG
else
{
assert (m_Event.GetState ());
}
#endif
}
boolean CSemaphore::TryDown (void)
{
if (AtomicGet (&m_nCount) == 0)
{
return FALSE;
}
if (AtomicDecrement (&m_nCount) == 0)
{
assert (m_Event.GetState ());
m_Event.Clear ();
}
return TRUE;
}
| Java |
import numpy as np
from scipy import sparse
from scipy.interpolate import interp1d
class calibration(object):
'''
some useful tools for manual calibration
'''
def normalize_zdata(self,z_data,cal_z_data):
return z_data/cal_z_data
def normalize_amplitude(self,z_data,cal_ampdata):
return z_data/cal_ampdata
def normalize_phase(self,z_data,cal_phase):
return z_data*np.exp(-1j*cal_phase)
def normalize_by_func(self,f_data,z_data,func):
return z_data/func(f_data)
def _baseline_als(self,y, lam, p, niter=10):
'''
see http://zanran_storage.s3.amazonaws.com/www.science.uva.nl/ContentPages/443199618.pdf
"Asymmetric Least Squares Smoothing" by P. Eilers and H. Boelens in 2005.
http://stackoverflow.com/questions/29156532/python-baseline-correction-library
"There are two parameters: p for asymmetry and lambda for smoothness. Both have to be
tuned to the data at hand. We found that generally 0.001<=p<=0.1 is a good choice
(for a trace with positive peaks) and 10e2<=lambda<=10e9, but exceptions may occur."
'''
L = len(y)
D = sparse.csc_matrix(np.diff(np.eye(L), 2))
w = np.ones(L)
for i in range(niter):
W = sparse.spdiags(w, 0, L, L)
Z = W + lam * D.dot(D.transpose())
z = sparse.linalg.spsolve(Z, w*y)
w = p * (y > z) + (1-p) * (y < z)
return z
def fit_baseline_amp(self,z_data,lam,p,niter=10):
'''
for this to work, you need to analyze a large part of the baseline
tune lam and p until you get the desired result
'''
return self._baseline_als(np.absolute(z_data),lam,p,niter=niter)
def baseline_func_amp(self,z_data,f_data,lam,p,niter=10):
'''
for this to work, you need to analyze a large part of the baseline
tune lam and p until you get the desired result
returns the baseline as a function
the points in between the datapoints are computed by cubic interpolation
'''
return interp1d(f_data, self._baseline_als(np.absolute(z_data),lam,p,niter=niter), kind='cubic')
def baseline_func_phase(self,z_data,f_data,lam,p,niter=10):
'''
for this to work, you need to analyze a large part of the baseline
tune lam and p until you get the desired result
returns the baseline as a function
the points in between the datapoints are computed by cubic interpolation
'''
return interp1d(f_data, self._baseline_als(np.angle(z_data),lam,p,niter=niter), kind='cubic')
def fit_baseline_phase(self,z_data,lam,p,niter=10):
'''
for this to work, you need to analyze a large part of the baseline
tune lam and p until you get the desired result
'''
return self._baseline_als(np.angle(z_data),lam,p,niter=niter)
def GUIbaselinefit(self):
'''
A GUI to help you fit the baseline
'''
self.__lam = 1e6
self.__p = 0.9
niter = 10
self.__baseline = self._baseline_als(np.absolute(self.z_data_raw),self.__lam,self.__p,niter=niter)
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
fig, (ax0,ax1) = plt.subplots(nrows=2)
plt.suptitle('Use the sliders to make the green curve match the baseline.')
plt.subplots_adjust(left=0.25, bottom=0.25)
l0, = ax0.plot(np.absolute(self.z_data_raw))
l0b, = ax0.plot(np.absolute(self.__baseline))
l1, = ax1.plot(np.absolute(self.z_data_raw/self.__baseline))
ax0.set_ylabel('amp, rawdata vs. baseline')
ax1.set_ylabel('amp, corrected')
axcolor = 'lightgoldenrodyellow'
axSmooth = plt.axes([0.25, 0.1, 0.65, 0.03], axisbg=axcolor)
axAsym = plt.axes([0.25, 0.15, 0.65, 0.03], axisbg=axcolor)
axbcorr = plt.axes([0.25, 0.05, 0.65, 0.03], axisbg=axcolor)
sSmooth = Slider(axSmooth, 'Smoothness', 0.1, 10., valinit=np.log10(self.__lam),valfmt='1E%f')
sAsym = Slider(axAsym, 'Asymmetry', 1e-4,0.99999, valinit=self.__p,valfmt='%f')
sbcorr = Slider(axbcorr, 'vertical shift',0.7,1.1,valinit=1.)
def update(val):
self.__lam = 10**sSmooth.val
self.__p = sAsym.val
self.__baseline = sbcorr.val*self._baseline_als(np.absolute(self.z_data_raw),self.__lam,self.__p,niter=niter)
l0.set_ydata(np.absolute(self.z_data_raw))
l0b.set_ydata(np.absolute(self.__baseline))
l1.set_ydata(np.absolute(self.z_data_raw/self.__baseline))
fig.canvas.draw_idle()
sSmooth.on_changed(update)
sAsym.on_changed(update)
sbcorr.on_changed(update)
plt.show()
self.z_data_raw /= self.__baseline
plt.close()
| Java |
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef RUBBERBANDSELECTIONMANIPULATOR_H
#define RUBBERBANDSELECTIONMANIPULATOR_H
#include "liveselectionrectangle.h"
#include <QPointF>
QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
namespace QmlJSDebugger {
class QDeclarativeViewInspector;
class LiveRubberBandSelectionManipulator
{
public:
enum SelectionType {
ReplaceSelection,
AddToSelection,
RemoveFromSelection
};
LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem,
QDeclarativeViewInspector *editorView);
void setItems(const QList<QGraphicsItem*> &itemList);
void begin(const QPointF& beginPoint);
void update(const QPointF& updatePoint);
void end();
void clear();
void select(SelectionType selectionType);
QPointF beginPoint() const;
bool isActive() const;
protected:
QGraphicsItem *topFormEditorItem(const QList<QGraphicsItem*> &itemList);
private:
QList<QGraphicsItem*> m_itemList;
QList<QGraphicsItem*> m_oldSelectionList;
LiveSelectionRectangle m_selectionRectangleElement;
QPointF m_beginPoint;
QDeclarativeViewInspector *m_editorView;
QGraphicsItem *m_beginFormEditorItem;
bool m_isActive;
};
}
#endif // RUBBERBANDSELECTIONMANIPULATOR_H
| Java |
QUnit.test( "testGetIbanCheckDigits", function( assert ) {
assert.equal(getIBANCheckDigits( 'GB00WEST12345698765432' ), '82', 'Get check digits of an IBAN' );
assert.equal(getIBANCheckDigits( '1234567890' ), '', 'If string isn\'t an IBAN, returns empty' );
assert.equal(getIBANCheckDigits( '' ), '', 'If string is empty, returns empty' );
} );
QUnit.test( "testGetGlobalIdentifier", function( assert ) {
assert.equal(getGlobalIdentifier( 'G28667152', 'ES', '' ), 'ES55000G28667152', 'Obtain a global Id' );
} );
QUnit.test( "testReplaceCharactersNotInPattern", function( assert ) {
assert.equal(replaceCharactersNotInPattern(
'ABC123-?:',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
'0' ), 'ABC123000', 'Remove unwanted characters' );
assert.equal(replaceCharactersNotInPattern(
'12345',
'0123456789',
'0' ), '12345', 'If the string didn\'t have unwanted characters, returns it' );
} );
QUnit.test( "testReplaceLetterWithDigits", function( assert ) {
assert.equal(replaceLetterWithDigits( '510007547061BE00' ), '510007547061111400', 'Replaces letters with digits' );
assert.equal(replaceLetterWithDigits( '1234567890' ), '1234567890', 'If we only receive digits, we return them' );
assert.equal(replaceLetterWithDigits( '' ), '', 'If we receive empty, we return empty' );
} );
QUnit.test( "testGetAccountLength", function( assert ) {
assert.equal(getAccountLength( 'GB' ), 22, 'Returns tohe string th a SEPA country' );
assert.equal(getAccountLength( 'US' ), 0, 'If string isn\'t a SEPA country code, returns empty' );
assert.equal(getAccountLength( '' ), 0, 'If string is empty, returns empty' );
} );
QUnit.test( "testIsSepaCountry", function( assert ) {
assert.equal(isSepaCountry( 'ES' ) , 1, 'Detects SEPA countries' );
assert.equal(isSepaCountry( 'US' ), 0, 'Rejects non SEPA countries' );
assert.equal(isSepaCountry( '' ) , 0, 'If string is empty, returns empty' );
} );
QUnit.test( "testIsValidIban", function( assert ) {
assert.equal(isValidIBAN( 'GB82WEST12345698765432' ), 1, 'Accepts a good IBAN' );
assert.equal(isValidIBAN( 'GB00WEST12345698765432' ) , 0, 'Rejects a wrong IBAN' );
assert.equal(isValidIBAN( '' ), 0, 'Rejects empty strings' );
} );
| Java |
<?php
namespace Aqua\SQL;
class Search
extends Select
{
/**
* @var array
*/
public $whereOptions = array();
/**
* @var array
*/
public $havingOptions = array();
/**
* @param array $where
* @param bool $merge
* @return static
*/
public function whereOptions(array $where, $merge = true)
{
if($merge) {
$this->whereOptions = array_merge($this->whereOptions, $where);
} else {
$this->whereOptions = $where;
}
return $this;
}
/**
* @param array $having
* @param bool $merge
* @return static
*/
public function havingOptions(array $having, $merge = true)
{
if($merge) {
$this->havingOptions = array_merge($this->havingOptions, $having);
} else {
$this->havingOptions = $having;
}
return $this;
}
/**
* @param mixed $options
* @param $values
* @param string $type
* @return string|null
*/
public function parseSearch(&$options, &$values, $type = null)
{
if($type === 'where') {
$columns = & $this->whereOptions;
} else {
$columns = & $this->havingOptions;
}
$query = '';
$i = 0;
if(!is_array($options)) {
return null;
} else {
foreach($options as $alias => &$value) {
if($i % 2) {
++$i;
if(is_string($value)) {
$v = strtoupper($value);
if($v === 'AND' || $v === 'OR') {
$query .= "$v ";
continue;
}
}
$query .= 'AND ';
}
if(is_int($alias)) {
if(is_string($value)) {
$query .= "$value ";
++$i;
} else if($q = $this->parseSearch($value, $values, $type)) {
$query .= "$q ";
++$i;
}
} else if(array_key_exists($alias, $columns)) {
if(!is_array($value)) {
$value = array( self::SEARCH_NATURAL, $value );
}
if($this->parseSearchFlags($value, $w, $values, $columns[$alias], $alias)) {
$query .= "$w ";
++$i;
}
}
}
}
if($i === 0) {
return null;
}
$query = preg_replace('/(^\s*(AND|OR)\s*)|(\s*(AND|OR)\s*$)/i', '', $query);
if($i === 1) {
return $query;
} else {
return "($query)";
}
}
public function parseOrder()
{
if(empty($this->order)) return '';
$order = array();
foreach($this->order as $column => $ord) {
if($ord === 'DESC' || $ord === 'ASC') {
if(array_key_exists($column, $this->columns)) {
$column = $this->columns[$column];
}
$order[] = "$column $ord";
} else {
if(array_key_exists($ord, $this->columns)) {
$ord = $this->columns[$ord];
}
$order[] = $ord;
}
}
if(empty($order)) return '';
else return 'ORDER BY ' . implode(', ', $order);
}
}
| Java |
#pragma once
#include <nstd/Base.h>
class DataProtocol
{
public:
enum MessageType
{
errorResponse,
subscribeRequest,
subscribeResponse,
unsubscribeRequest,
unsubscribeResponse,
tradeRequest,
tradeResponse,
registerSourceRequest,
registerSourceResponse,
registerSinkRequest,
registerSinkResponse,
registeredSinkMessage,
tradeMessage,
channelRequest,
channelResponse,
timeRequest,
timeResponse,
timeMessage,
tickerMessage,
};
enum TradeFlag
{
replayedFlag = 0x01,
syncFlag = 0x02,
};
//enum ChannelType
//{
// tradeType,
// orderBookType,
//};
//
//enum ChannelFlag
//{
// onlineFlag = 0x01,
//};
#pragma pack(push, 4)
struct Header
{
uint32_t size; // including header
uint64_t source; // client id
uint64_t destination; // client id
uint16_t messageType; // MessageType
};
struct ErrorResponse
{
uint16_t messageType;
uint64_t channelId;
char_t errorMessage[128];
};
struct SubscribeRequest
{
char_t channel[33];
uint64_t maxAge;
uint64_t sinceId;
};
struct SubscribeResponse
{
char_t channel[33];
uint64_t channelId;
uint32_t flags;
};
struct UnsubscribeRequest
{
char_t channel[33];
};
struct UnsubscribeResponse
{
char_t channel[33];
uint64_t channelId;
};
struct RegisterSourceRequest
{
char_t channel[33];
};
struct RegisterSourceResponse
{
char_t channel[33];
uint64_t channelId;
};
struct RegisterSinkRequest
{
char_t channel[33];
};
struct RegisterSinkResponse
{
char_t channel[33];
uint64_t channelId;
};
struct TradeRequest
{
uint64_t maxAge;
uint64_t sinceId;
};
struct Trade
{
uint64_t id;
uint64_t time;
double price;
double amount;
uint32_t flags;
};
struct TradeMessage
{
uint64_t channelId;
Trade trade;
};
struct TimeMessage
{
uint64_t channelId;
uint64_t time;
};
struct TradeResponse
{
uint64_t channelId;
};
struct Channel
{
char_t channel[33];
//uint8_t type;
//uint32_t flags;
};
struct TimeResponse
{
uint64_t time;
};
struct Ticker
{
uint64_t time;
double bid;
double ask;
};
struct TickerMessage
{
uint64_t channelId;
Ticker ticker;
};
#pragma pack(pop)
};
| Java |
---
title: "हरियाणा में सभी पार्टियां बहुमत से दूर"
layout: item
category: ["politics"]
date: 2019-10-24T11:42:44.692Z
image: 1571917364691hariyana-jjp-congress-bjp-hung-assembly.jpg
---
<p>नई दिल्ली: हरियाणा चुनाव के नतीजे काफी दिलचस्प हो गए हैं। अब तक के रुझान में भाजपा यहां आगे जरूर चल रही है, लेकिन बहुमत का आंकड़ा उससे दूर है। जबकि कांग्रेस ने जबरदस्त वापसी की है और जेजेपी भी बढ़िया प्रदर्शन कर रही है। ऐसे में बीजेपी को सरकार बनाने के लिए जेजेपी की जरूरत पड़ सकती है। लिहाजा हरियाणा के मुख्यमंत्री मनोहर लाल खट्टर को बीजेपी आलाकमान ने दिल्ली बुलाया है। वहीं कांग्रेस अध्यक्ष सोनिया गांधी ने भी भूपेन्द्र सिंह हुड्डा से बात की है। इस बीच जननायक जनता पार्टी (जेजेपी) की भूमिका काफी अहम हो गई है। जानकारी के मुताबिक प्रदेश के पूर्व मुख्यमंत्री प्रकाश सिंह बादल को भाजपा की ओर से जेजेपी से मध्यस्थता के लिए आगे किया जा सकता है। वहीं यह भी खबर है कि जेजपी ने सीएम पद की शर्त के साथ कांग्रेस को समर्थन का प्रस्ताव दिया है। हालांकि थोड़ी देर में तस्वीर साफ हो जाएगी कि हरियाणा की जनता ने किस पार्टी को प्रदेश की कमान सौंपने का निर्णय लिया है। राज्य में सोमवार को मतदान हुआ था।</p> | Java |
ALTER TABLE `b_iblock_element` ADD KEY `TIMESTAMP_X` (`TIMESTAMP_X`);
ALTER TABLE `b_iblock_element` ADD KEY `IBLOCK_ID` (`IBLOCK_ID`);
ALTER TABLE `b_iblock_element` ADD KEY `XML_ID` (`XML_ID`);
ALTER TABLE `b_iblock_element` ADD KEY `WF_PARENT_ELEMENT_ID` (`WF_PARENT_ELEMENT_ID`);
ALTER TABLE `b_iblock_element` ADD KEY `MODIFIED_BY`(`MODIFIED_BY`);
ALTER TABLE `b_iblock_element` ADD KEY `DATE_CREATE` (`DATE_CREATE`);
ALTER TABLE `b_iblock_element` ADD KEY `CREATED_BY` (`CREATED_BY`);
ALTER TABLE `b_iblock_element` ADD KEY `IBLOCK_SECTION_ID` (`IBLOCK_SECTION_ID`);
ALTER TABLE `b_iblock_element` ADD KEY `ACTIVE` (`ACTIVE`);
ALTER TABLE `b_iblock_element` ADD KEY `ACTIVE_FROM` (`ACTIVE_FROM`);
ALTER TABLE `b_iblock_element` ADD KEY `ACTIVE_TO` (`ACTIVE_TO`);
ALTER TABLE `b_iblock_element` ADD KEY `SORT` (`SORT`);
ALTER TABLE `b_iblock_element` ADD KEY `NAME` (`NAME`);
ALTER TABLE `b_iblock_element` ADD KEY `DETAIL_PICTURE` (`DETAIL_PICTURE`);
ALTER TABLE `b_iblock_element` ADD KEY `WF_STATUS_ID` (`WF_STATUS_ID`);
ALTER TABLE `b_iblock_element` ADD KEY `WF_NEW` (`WF_NEW`);
ALTER TABLE `b_iblock_element` ADD KEY `WF_LOCKED_BY` (`WF_LOCKED_BY`);
ALTER TABLE `b_iblock_element` ADD KEY `WF_DATE_LOCK` (`WF_DATE_LOCK`);
ALTER TABLE `b_iblock_element` ADD KEY `IN_SECTIONS` (`IN_SECTIONS`);
ALTER TABLE `b_iblock_element` ADD KEY `CODE` (`CODE`);
ALTER TABLE `b_iblock_element` ADD KEY `TAGS` (`TAGS`);
ALTER TABLE `b_iblock_element` ADD KEY `TMP_ID` (`TMP_ID`);
ALTER TABLE `b_iblock_element` ADD KEY `WF_LAST_HISTORY_ID` (`WF_LAST_HISTORY_ID`);
ALTER TABLE `b_iblock_element` ADD KEY `SHOW_COUNTER` (`SHOW_COUNTER`);
ALTER TABLE `b_iblock_element` ADD KEY `SHOW_COUNTER_START` (`SHOW_COUNTER_START`);
ALTER TABLE `b_iblock_element_iprop` ADD KEY `ELEMENT_ID` (`ELEMENT_ID`);
ALTER TABLE `b_iblock_element_iprop` ADD KEY `IPROP_ID` (`IPROP_ID`);
ALTER TABLE `b_iblock_property` ADD KEY `TIMESTAMP_X` (`TIMESTAMP_X`);
ALTER TABLE `b_iblock_property` ADD KEY `IBLOCK_ID` (`IBLOCK_ID`);
ALTER TABLE `b_iblock_property` ADD KEY `NAME` (`NAME`);
ALTER TABLE `b_iblock_property` ADD KEY `ACTIVE` (`ACTIVE`);
ALTER TABLE `b_iblock_property` ADD KEY `SORT` (`SORT`);
ALTER TABLE `b_iblock_property` ADD KEY `PROPERTY_TYPE` (`PROPERTY_TYPE`);
ALTER TABLE `b_iblock_property` ADD KEY `ROW_COUNT` (`ROW_COUNT`);
ALTER TABLE `b_iblock_property` ADD KEY `COL_COUNT` (`COL_COUNT`);
ALTER TABLE `b_iblock_property` ADD KEY `LIST_TYPE` (`LIST_TYPE`);
ALTER TABLE `b_iblock_property` ADD KEY `MULTIPLE` (`MULTIPLE`);
ALTER TABLE `b_iblock_property` ADD KEY `XML_ID` (`XML_ID`);
ALTER TABLE `b_iblock_property` ADD KEY `FILE_TYPE` (`FILE_TYPE`);
ALTER TABLE `b_iblock_property` ADD KEY `MULTIPLE_CNT` (`MULTIPLE_CNT`);
ALTER TABLE `b_iblock_property` ADD KEY `TMP_ID` (`TMP_ID`);
ALTER TABLE `b_iblock_property` ADD KEY `WITH_DESCRIPTION` (`WITH_DESCRIPTION`);
ALTER TABLE `b_iblock_property` ADD KEY `SEARCHABLE` (`SEARCHABLE`);
ALTER TABLE `b_iblock_property` ADD KEY `FILTRABLE` (`FILTRABLE`);
ALTER TABLE `b_iblock_property` ADD KEY `IS_REQUIRED` (`IS_REQUIRED`);
ALTER TABLE `b_iblock_property` ADD KEY `VERSION` (`VERSION`);
ALTER TABLE `b_iblock_property` ADD KEY `USER_TYPE` (`USER_TYPE`);
ALTER TABLE `b_iblock_property` ADD KEY `HINT` (`HINT`);
ALTER TABLE `b_iblock_property_enum` ADD KEY `PROPERTY_ID` (`PROPERTY_ID`);
ALTER TABLE `b_iblock_property_enum` ADD KEY `DEF` (`DEF`);
ALTER TABLE `b_iblock_property_enum` ADD KEY `SORT` (`SORT`);
ALTER TABLE `b_iblock_property_enum` ADD KEY `XML_ID` (`XML_ID`);
ALTER TABLE `b_iblock_iproperty` ADD KEY `IBLOCK_ID` (`IBLOCK_ID`);
ALTER TABLE `b_iblock_iproperty` ADD KEY `CODE` (`CODE`);
ALTER TABLE `b_iblock_iproperty` ADD KEY `ENTITY_TYPE` (`ENTITY_TYPE`);
ALTER TABLE `b_iblock_iproperty` ADD KEY `ENTITY_ID` (`ENTITY_ID`);
-- -------------------------------------------------
ALTER TABLE `b_iblock_section` ADD KEY `IBLOCK_ID` (`IBLOCK_ID`);
ALTER TABLE `b_iblock_section` ADD KEY `TIMESTAMP_X` (`TIMESTAMP_X`);
ALTER TABLE `b_iblock_section` ADD KEY `MODIFIED_BY` (`MODIFIED_BY`);
ALTER TABLE `b_iblock_section` ADD KEY `DATE_CREATE` (`DATE_CREATE`);
ALTER TABLE `b_iblock_section` ADD KEY `CREATED_BY` (`CREATED_BY`);
ALTER TABLE `b_iblock_section` ADD KEY `IBLOCK_SECTION_ID` (`IBLOCK_SECTION_ID`);
ALTER TABLE `b_iblock_section` ADD KEY `ACTIVE` (`ACTIVE`);
ALTER TABLE `b_iblock_section` ADD KEY `GLOBAL_ACTIVE` (`GLOBAL_ACTIVE`);
ALTER TABLE `b_iblock_section` ADD KEY `SORT` (`SORT`);
ALTER TABLE `b_iblock_section` ADD KEY `DEPTH_LEVEL` (`DEPTH_LEVEL`);
ALTER TABLE `b_iblock_section` ADD KEY `CODE` (`CODE`);
ALTER TABLE `b_iblock_section` ADD KEY `XML_ID` (`XML_ID`);
ALTER TABLE `b_iblock_section` ADD KEY `TMP_ID` (`TMP_ID`);
ALTER TABLE `b_iblock_section` ADD KEY `SOCNET_GROUP_ID` (`SOCNET_GROUP_ID`);
ALTER TABLE `b_iblock_section_element` ADD KEY `IBLOCK_SECTION_ID` (`IBLOCK_SECTION_ID`);
ALTER TABLE `b_iblock_section_element` ADD KEY `ADDITIONAL_PROPERTY_ID` (`ADDITIONAL_PROPERTY_ID`);
ALTER TABLE `b_iblock_section_property` ADD KEY `IBLOCK_ID` (`IBLOCK_ID`);
ALTER TABLE `b_iblock_section_property` ADD KEY `DISPLAY_TYPE` (`DISPLAY_TYPE`);
ALTER TABLE `b_iblock_section_property` ADD KEY `SMART_FILTER` (`SMART_FILTER`);
ALTER TABLE `b_iblock_section_property` ADD KEY `DISPLAY_EXPANDED` (`DISPLAY_EXPANDED`);
ALTER TABLE `b_iblock_section_right` ADD KEY `IBLOCK_ID` (`IBLOCK_ID`);
ALTER TABLE `b_iblock_section_right` ADD KEY `SECTION_ID` (`SECTION_ID`);
ALTER TABLE `b_iblock_section_right` ADD KEY `RIGHT_ID` (`RIGHT_ID`);
ALTER TABLE `b_iblock_section_right` ADD KEY `IS_INHERITED` (`IS_INHERITED`);
ALTER TABLE `b_iblock_section_iprop` ADD KEY `SECTION_ID` (`SECTION_ID`);
ALTER TABLE `b_option` ADD KEY `MODULE_ID` (`MODULE_ID`);
ALTER TABLE `b_option` ADD KEY `SITE_ID` (`SITE_ID`);
ALTER TABLE `b_iblock_fields` ADD KEY `IBLOCK_ID` (`IBLOCK_ID`);
ALTER TABLE `b_iblock_fields` ADD KEY `FIELD_ID` (`FIELD_ID`);
ALTER TABLE `b_iblock_fields` ADD KEY `IS_REQUIRED` (`IS_REQUIRED`);
ALTER TABLE `b_user` ADD KEY `LOGIN` (`LOGIN`);
ALTER TABLE `b_user` ADD KEY `ACTIVE` (`ACTIVE`);
ALTER TABLE `b_user` ADD KEY `LID` (`LID`);
ALTER TABLE `b_user` ADD KEY `DATE_REGISTER` (`DATE_REGISTER`);
ALTER TABLE `b_user` ADD KEY `TIMESTAMP_X` (`TIMESTAMP_X`);
| Java |
/*!
* \file db_mysql_list_entities_report_sql.c
* \brief Returns MYSQL SQL query to create list entities report.
* \author Paul Griffiths
* \copyright Copyright 2014 Paul Griffiths. Distributed under the terms
* of the GNU General Public License. <http://www.gnu.org/licenses/>
*/
const char * db_list_entities_report_sql(void) {
static const char * query =
"SELECT"
" id AS 'ID',"
" shortname AS 'Short',"
" name AS 'Entity Name',"
" currency AS 'Curr.',"
" parent AS 'Parent'"
" FROM entities"
" ORDER BY id";
return query;
}
| Java |
/*
* SPDX-License-Identifier: GPL-3.0
*
*
* (J)ava (M)iscellaneous (U)tilities (L)ibrary
*
* JMUL is a central repository for utilities which are used in my
* other public and private repositories.
*
* Copyright (C) 2013 Kristian Kutin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* e-mail: kristian.kutin@arcor.de
*/
/*
* This section contains meta informations.
*
* $Id$
*/
package jmul.transformation.xml.rules.xml2object;
import jmul.misc.id.ID;
import jmul.misc.id.IntegerID;
import jmul.reflection.classes.ClassDefinition;
import jmul.reflection.classes.ClassHelper;
import jmul.string.TextHelper;
import jmul.transformation.TransformationException;
import jmul.transformation.TransformationParameters;
import jmul.transformation.TransformationRuleBase;
import jmul.transformation.xml.cache.Xml2ObjectCache;
import static jmul.transformation.xml.rules.PersistenceMarkups.ID_ATTRIBUTE;
import static jmul.transformation.xml.rules.PersistenceMarkups.OBJECT_ELEMENT;
import static jmul.transformation.xml.rules.PersistenceMarkups.TYPE_ATTRIBUTE;
import static jmul.transformation.xml.rules.PersistenceMarkups.VALUE_ATTRIBUTE;
import static jmul.transformation.xml.rules.TransformationConstants.OBJECT_CACHE;
import jmul.xml.XmlParserHelper;
import org.w3c.dom.Node;
/**
* An implementation of a transformation rule.
*
* @author Kristian Kutin
*/
public class Xml2ClassRule extends TransformationRuleBase {
/**
* A class name.
*/
private static final String EXPECTED_TYPE_NAME = Class.class.getName();
/**
* Constructs a transformation rule.
*
* @param anOrigin
* a description of the transformation origin
* @param aDestination
* a description of the transformation destination
* @param aPriority
* a rule priority
*/
public Xml2ClassRule(String anOrigin, String aDestination, int aPriority) {
super(anOrigin, aDestination, aPriority);
}
/**
* The method determines if this rule can be applied to the specified
* object.
*
* @param someParameters
* some transformation parameters, including the object which is to
* be transformed
*
* @return <code>true</code> if the rule is applicable, else
* <code>false</code>
*/
@Override
public boolean isApplicable(TransformationParameters someParameters) {
return RuleHelper.isApplicable(someParameters, EXPECTED_TYPE_NAME);
}
/**
* The method performs the actual transformation.
*
* @param someParameters
* some transformation parameters, including the object which is to
* be transformed
*
* @return the transformed object
*/
@Override
public Object transform(TransformationParameters someParameters) {
// Check some plausibilites first.
if (!someParameters.containsPrerequisite(OBJECT_CACHE)) {
String message =
TextHelper.concatenateStrings("Prerequisites for the transformation are missing (", OBJECT_CACHE, ")!");
throw new TransformationException(message);
}
Object target = someParameters.getObject();
Node objectElement = (Node) target;
XmlParserHelper.assertMatchesXmlElement(objectElement, OBJECT_ELEMENT);
XmlParserHelper.assertExistsXmlAttribute(objectElement, ID_ATTRIBUTE);
XmlParserHelper.assertExistsXmlAttribute(objectElement, TYPE_ATTRIBUTE);
XmlParserHelper.assertExistsXmlAttribute(objectElement, VALUE_ATTRIBUTE);
// Get the required informations.
Xml2ObjectCache objectCache = (Xml2ObjectCache) someParameters.getPrerequisite(OBJECT_CACHE);
String idString = XmlParserHelper.getXmlAttributeValue(objectElement, ID_ATTRIBUTE);
String typeString = XmlParserHelper.getXmlAttributeValue(objectElement, TYPE_ATTRIBUTE);
String valueString = XmlParserHelper.getXmlAttributeValue(objectElement, VALUE_ATTRIBUTE);
ID id = new IntegerID(idString);
ClassDefinition type = null;
try {
type = ClassHelper.getClass(typeString);
} catch (ClassNotFoundException e) {
String message = TextHelper.concatenateStrings("An unknown class was specified (", typeString, ")!");
throw new TransformationException(message, e);
}
Class clazz = null;
try {
ClassDefinition definition = ClassHelper.getClass(valueString);
clazz = definition.getType();
} catch (ClassNotFoundException e) {
String message = TextHelper.concatenateStrings("An unknown class was specified (", valueString, ")!");
throw new TransformationException(message, e);
}
// Instantiate and initialize the specified object
objectCache.addObject(id, clazz, type.getType());
return clazz;
}
}
| Java |
Bitrix 16.5 Business Demo = bf14f0c5bad016e66d0ed2d224b15630
| Java |
/*--[litinternal.h]------------------------------------------------------------
| Copyright (C) 2002 Dan A. Jackson
|
| This file is part of the "openclit" library for processing .LIT files.
|
| "Openclit" is free software; you can redistribute it and/or modify
| it under the terms of the GNU General Public License as published by
| the Free Software Foundation; either version 2 of the License, or
| (at your option) any later version.
|
| This program is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| GNU General Public License for more details.
|
| You should have received a copy of the GNU General Public License
| along with this program; if not, write to the Free Software
| Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
| The GNU General Public License may also be available at the following
| URL: http://www.gnu.org/licenses/gpl.html
*/
/*
| This file contains definitions for internal routines and structures which
| the LIT library doesn't wish to expose to the world at large
*/
#ifndef LITINTERNAL_H
#define LITINTERNAL_H
typedef struct dir_type {
U8 * entry_ptr;
U32 entry_size;
U32 entry_last_chunk;
U8 * count_ptr;
U32 count_size;
U32 count_last_chunk;
int num_entries;
int num_counts;
U32 entry_aoli_idx;
U32 total_content_size;
} dir_type;
int lit_i_read_directory(lit_file * litfile, U8 * piece, int piece_size);
int lit_i_make_directories(lit_file * litfile, dir_type * dirtype);
int lit_i_read_headers(lit_file * litfile);
int lit_i_write_headers(lit_file * litfile);
int lit_i_read_secondary_header(lit_file * litfile, U8 * hdr, int size);
int lit_i_cache_section(lit_file * litfile, section_type * pSection );
int lit_i_read_sections(lit_file * litfile );
void lit_i_free_dir_type(dir_type * dirtype);
int lit_i_encrypt_section(lit_file *,char *, U8 * new_key);
int lit_i_encrypt(U8 * ptr, int size, U8 * new_key);
/*
| This routine will check for the presence of DRM and initialize
| the DRM level and bookkey */
extern int lit_i_read_drm(lit_file *);
/*
| This routine will do the decryption with the bookkey, kept off here
| to get the non-DRM path pure */
extern int lit_i_decrypt(lit_file *, U8 * data_pointer, int size);
/*
| Utility routines...
*/
char * lit_i_strmerge(const char * first, ...);
U8 * lit_i_read_utf8_string(U8 * p, int remaining, int * size);
int lit_i_utf8_len_to_bytes(U8 * src, int lenSrc, int sizeSrc);
#endif
| Java |
## mostly copied from: http://norvig.com/spell-correct.html
import sys, random
import re, collections, time
TXT_FILE='';
BUF_DIR='';
NWORDS=None;
def words(text): return re.findall('[a-z]+', text)
def train(features):
model = collections.defaultdict(lambda: 1)
for f in features:
model[f] += 1
return model
alphabet = 'abcdefghijklmnopqrstuvwxyz'
def edits1(word):
splits = [(word[:i], word[i:]) for i in range(len(word) + 1)]
deletes = [a + b[1:] for a, b in splits if b]
transposes = [a + b[1] + b[0] + b[2:] for a, b in splits if len(b)>1]
replaces = [a + c + b[1:] for a, b in splits for c in alphabet if b]
inserts = [a + c + b for a, b in splits for c in alphabet]
return set(deletes + transposes + replaces + inserts)
def known_edits2(word):
return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2 in NWORDS)
def known(words): return set(w for w in words if w in NWORDS)
def correct(word):
candidates = known([word]) or known(edits1(word)) or known_edits2(word) or [word]
return max(candidates, key=NWORDS.get)
#######################################################################################
if __name__ == '__main__':
TXT_FILE = sys.argv[1]
t0 = time.clock()
o_words = words(file(TXT_FILE).read())
NWORDS = train(o_words)
#print time.clock() - t0, " seconds build time"
#print "dictionary size: %d" %len(NWORDS)
et1 = time.clock() - t0
t_count = 10
rl = o_words[0:t_count] #random.sample(o_words, t_count)
orl = [''.join(random.sample(word, len(word))) for word in o_words]
t1 = time.clock()
r_count = 10
for i in range(0, r_count):
for w1, w2 in zip(rl, orl):
correct(w1); correct(w2)
et2 = (time.clock() - t1)/t_count/r_count/2
print '%d\t%f\t%f' %(len(NWORDS), et1, et2)
#######################################################################################
print 'Done'
| Java |
<B_lastforums><div id="derniers-forums" class="listagebloc">
<h2><:derniers_forums:></h2>
<ul class="listageconteneur">
<BOUCLE_lastforums(FORUMS){!par date}{0,#ENV{parametre}}{plat}>
<li>
<h4 class="listagetitre"><a href="#URL_ARTICLE#forums">#TITRE</a></h4>
<div class="listageinfo">[(#DATE|affdate)][, <:par_auteur:> <a href="mailto:#EMAIL">(#NOM)</a>]</div>
<p class="listagetexte">[(#TEXTE|couper{220})]</p>
</li>
</BOUCLE_lastforums>
</ul>
</div></B_lastforums> | Java |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>sensekey</title>
<link rel="stylesheet" type="text/css" href="csound.css" />
<link rel="stylesheet" type="text/css" href="syntax-highlighting.css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1" />
<link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
<link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
<link rel="prev" href="sense.html" title="sense" />
<link rel="next" href="serialBegin.html" title="serialBegin" />
</head>
<body>
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">sensekey</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="sense.html">Prev</a> </td>
<th width="60%" align="center">Orchestra Opcodes and Operators</th>
<td width="20%" align="right"> <a accesskey="n" href="serialBegin.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="refentry">
<a id="sensekey"></a>
<div class="titlepage"></div>
<a id="IndexSensekey" class="indexterm"></a>
<div class="refnamediv">
<h2>
<span class="refentrytitle">sensekey</span>
</h2>
<p>sensekey —
Returns the ASCII code of a key that has been pressed.
</p>
</div>
<div class="refsect1">
<a id="idm431456309440"></a>
<h2>Description</h2>
<p>
Returns the ASCII code of a key that has been pressed, or -1 if no key has been pressed.
</p>
</div>
<div class="refsect1">
<a id="idm431456308048"></a>
<h2>Syntax</h2>
<pre class="synopsis">kres[, kkeydown] <span class="command"><strong>sensekey</strong></span></pre>
</div>
<div class="refsect1">
<a id="idm431456306080"></a>
<h2>Performance</h2>
<p>
<span class="emphasis"><em>kres</em></span> - returns the ASCII value of a key which is pressed or released.
</p>
<p>
<span class="emphasis"><em>kkeydown</em></span> - returns 1 if the key was pressed, 0 if it was released or if there is no key event.
</p>
<p>
<span class="emphasis"><em>kres</em></span> can be used to read keyboard events from stdin and returns the ASCII value of any key that is pressed or released, or it returns -1 when there is no keyboard activity. The value of <span class="emphasis"><em>kkeydown</em></span> is 1 when a key was pressed, or 0 otherwise. This behavior is emulated by default, so a key release is generated immediately after every key press. To have full functionality, FLTK can be used to capture keyboard events. <a class="link" href="FLpanel.html" title="FLpanel"><em class="citetitle">FLpanel</em></a> can be used to capture keyboard events and send them to the sensekey opcode, by adding an additional optional argument. See <a class="link" href="FLpanel.html" title="FLpanel"><em class="citetitle">FLpanel</em></a> for more information.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<table border="0" summary="Note: Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25">
<img alt="[Note]" src="images/note.png" />
</td>
<th align="left">Note</th>
</tr>
<tr>
<td align="left" valign="top">
<p>
This opcode can also be written as <a class="link" href="sense.html" title="sense"><em class="citetitle">sense</em></a>.
</p>
</td>
</tr>
</table>
</div>
</div>
<div class="refsect1">
<a id="idm431456297728"></a>
<h2>Examples</h2>
<p>
Here is an example of the sensekey opcode. It uses the file <a class="ulink" href="examples/sensekey.csd" target="_top"><em class="citetitle">sensekey.csd</em></a>.
</p>
<div class="example">
<a id="idm431456295920"></a>
<p class="title">
<strong>Example 884. Example of the sensekey opcode.</strong>
</p>
<div class="example-contents">
<p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
<div class="refsect1">
<a id="idm431823003600"></a>
<pre class="programlisting">
<span class="nt"><CsoundSynthesizer></span>
<span class="nt"><CsOptions></span>
<span class="c1">; Select audio/midi flags here according to platform</span>
<span class="c1">; Audio out Audio in</span>
-odac -iadc <span class="c1">;;;RT audio I/O</span>
<span class="c1">; For Non-realtime ouput leave only the line below:</span>
<span class="c1">; -o sensekey.wav -W ;;; for file output any platform</span>
<span class="nt"></CsOptions></span>
<span class="nt"><CsInstruments></span>
<span class="c1">; Initialize the global variables.</span>
<span class="vg">sr</span> <span class="o">=</span> <span class="mi">44100</span>
<span class="vg">kr</span> <span class="o">=</span> <span class="mi">4410</span>
<span class="vg">ksmps</span> <span class="o">=</span> <span class="mi">10</span>
<span class="vg">nchnls</span> <span class="o">=</span> <span class="mi">1</span>
<span class="c1">; Instrument #1.</span>
<span class="kd">instr</span> <span class="nf">1</span>
k<span class="n">1</span> <span class="nb">sensekey</span>
<span class="nb">printk2</span> k<span class="n">1</span>
<span class="kd">endin</span>
<span class="nt"></CsInstruments></span>
<span class="nt"><CsScore></span>
<span class="c1">; Play Instrument #1 for thirty seconds.</span>
<span class="nb">i</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">30</span>
<span class="nb">e</span>
<span class="nt"></CsScore></span>
<span class="nt"></CsoundSynthesizer></span>
</pre>
</div>
</div>
</div>
<p><br class="example-break" />
Here is what the output should look like when the "q" button is pressed...
</p>
<pre class="screen">
q i1 113.00000
</pre>
<p>
</p>
<p>
Here is an example of the sensekey opcode in conjucntion with <a class="link" href="FLpanel.html" title="FLpanel"><em class="citetitle">FLpanel</em></a>. It uses the file <a class="ulink" href="examples/FLpanel-sensekey.csd" target="_top"><em class="citetitle">FLpanel-sensekey.csd</em></a>.
</p>
<div class="example">
<a id="idm431456289216"></a>
<p class="title">
<strong>Example 885. Example of the sensekey opcode using keyboard capture from an FLpanel.</strong>
</p>
<div class="example-contents">
<div class="refsect1">
<a id="idm431823457456"></a>
<pre class="programlisting">
<span class="nt"><CsoundSynthesizer></span>
<span class="nt"><CsOptions></span>
<span class="c1">; Select audio/midi flags here according to platform</span>
<span class="c1">; Audio out Audio in No messages</span>
-odac -iadc -d <span class="c1">;;;RT audio I/O</span>
<span class="c1">; For Non-realtime ouput leave only the line below:</span>
<span class="c1">; -o FLpanel-sensekey.wav -W ;;; for file output any platform</span>
<span class="nt"></CsOptions></span>
<span class="nt"><CsInstruments></span>
<span class="c1">; Example by Johnathan Murphy</span>
<span class="vg">sr</span> <span class="o">=</span> <span class="mi">44100</span>
<span class="vg">ksmps</span> <span class="o">=</span> <span class="mi">128</span>
<span class="vg">nchnls</span> <span class="o">=</span> <span class="mi">2</span>
<span class="c1">; ikbdcapture flag set to 1</span>
i<span class="n">key</span> <span class="nb">init</span> <span class="mi">1</span>
<span class="nb">FLpanel</span> <span class="s">"sensekey"</span><span class="p">,</span> <span class="mi">740</span><span class="p">,</span> <span class="mi">340</span><span class="p">,</span> <span class="mi">100</span><span class="p">,</span> <span class="mi">250</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> i<span class="n">key</span>
gk<span class="n">asc</span><span class="p">,</span> gi<span class="n">asc</span> <span class="nb">FLbutBank</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">16</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">700</span><span class="p">,</span> <span class="mi">300</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span>
<span class="nb">FLpanelEnd</span>
<span class="nb">FLrun</span>
<span class="kd">instr</span> <span class="nf">1</span>
k<span class="n">key</span> <span class="nb">sensekey</span>
k<span class="n">print</span> <span class="nb">changed</span> k<span class="n">key</span>
<span class="nb">FLsetVal</span> k<span class="n">print</span><span class="p">,</span> k<span class="n">key</span><span class="p">,</span> gi<span class="n">asc</span>
<span class="kd">endin</span>
<span class="nt"></CsInstruments></span>
<span class="nt"><CsScore></span>
<span class="nb">i</span><span class="mi">1</span> <span class="mi">0</span> <span class="mi">60</span>
<span class="nb">e</span>
<span class="nt"></CsScore></span>
<span class="nt"></CsoundSynthesizer></span>
</pre>
</div>
</div>
</div>
<p><br class="example-break" />
The lit button in the FLpanel window shows the last key pressed.
</p>
<p>
Here is a more complex example of the sensekey opcode in conjucntion with <a class="link" href="FLpanel.html" title="FLpanel"><em class="citetitle">FLpanel</em></a>. It uses the file <a class="ulink" href="examples/FLpanel-sensekey.csd" target="_top"><em class="citetitle">FLpanel-sensekey2.csd</em></a>.
</p>
<div class="example">
<a id="idm431456285456"></a>
<p class="title">
<strong>Example 886. Example of the sensekey opcode using keyboard capture from an FLpanel.</strong>
</p>
<div class="example-contents">
<div class="refsect1">
<a id="idm431823458336"></a>
<pre class="programlisting">
<span class="nt"><CsoundSynthesizer></span>
<span class="nt"><CsOptions></span>
<span class="c1">; Select audio/midi flags here according to platform</span>
<span class="c1">; Audio out Audio in No messages</span>
-odac <span class="c1">; -iadc -d ;;;RT audio I/O</span>
<span class="c1">; For Non-realtime ouput leave only the line below:</span>
<span class="c1">; -o FLpanel-sensekey2.wav -W ;;; for file output any platform</span>
<span class="nt"></CsOptions></span>
<span class="nt"><CsInstruments></span>
<span class="vg">sr</span> <span class="o">=</span> <span class="mi">48000</span>
<span class="vg">ksmps</span> <span class="o">=</span> <span class="mi">32</span>
<span class="vg">nchnls</span> <span class="o">=</span> <span class="mi">1</span>
<span class="c1">; Example by Istvan Varga</span>
<span class="c1">; if the FLTK opcodes are commented out, sensekey will read keyboard</span>
<span class="c1">; events from stdin</span>
<span class="nb">FLpanel</span> <span class="s">""</span><span class="p">,</span> <span class="mi">150</span><span class="p">,</span> <span class="mi">50</span><span class="p">,</span> <span class="mi">100</span><span class="p">,</span> <span class="mi">100</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span>
<span class="nb">FLlabel</span> <span class="mi">18</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span>
<span class="nb">FLgroup</span> <span class="s">"Keyboard Input"</span><span class="p">,</span> <span class="mi">150</span><span class="p">,</span> <span class="mi">50</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span>
<span class="nb">FLgroupEnd</span>
<span class="nb">FLpanelEnd</span>
<span class="nb">FLrun</span>
<span class="kd">instr</span> <span class="nf">1</span>
k<span class="n">trig1</span> <span class="nb">init</span> <span class="mi">1</span>
k<span class="n">trig2</span> <span class="nb">init</span> <span class="mi">1</span>
<span class="nl">nxtKey1</span><span class="p">:</span>
k<span class="n">1</span><span class="p">,</span> k<span class="n">2</span> <span class="nb">sensekey</span>
<span class="k">if</span> <span class="p">(</span>k<span class="n">1</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">||</span> k<span class="n">2</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="k">then</span>
<span class="nb">printf</span> <span class="s">"Key code = </span><span class="si">%02X</span><span class="s">, state = </span><span class="si">%d</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> k<span class="n">trig1</span><span class="p">,</span> k<span class="n">1</span><span class="p">,</span> k<span class="n">2</span>
k<span class="n">trig1</span> <span class="o">=</span> <span class="mi">3</span> <span class="o">-</span> k<span class="n">trig1</span>
<span class="k">kgoto</span> <span class="nl">nxtKey1</span>
<span class="k">endif</span>
<span class="nl">nxtKey2</span><span class="p">:</span>
k<span class="n">3</span> <span class="nb">sensekey</span>
<span class="k">if</span> <span class="p">(</span>k<span class="n">3</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="k">then</span>
<span class="nb">printf</span> <span class="s">"Character = '</span><span class="si">%c</span><span class="s">'</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> k<span class="n">trig2</span><span class="p">,</span> k<span class="n">3</span>
k<span class="n">trig2</span> <span class="o">=</span> <span class="mi">3</span> <span class="o">-</span> k<span class="n">trig2</span>
<span class="k">kgoto</span> <span class="nl">nxtKey2</span>
<span class="k">endif</span>
<span class="kd">endin</span>
<span class="nt"></CsInstruments></span>
<span class="nt"><CsScore></span>
<span class="nb">i</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">3600</span>
<span class="nb">e</span>
<span class="nt"></CsScore></span>
<span class="nt"></CsoundSynthesizer></span>
</pre>
</div>
</div>
</div>
<p><br class="example-break" />
The console output will look something like:
</p>
<div class="literallayout">
<p><br />
new alloc for instr 1:<br />
Key code = 65, state = 1<br />
Character = 'e'<br />
Key code = 65, state = 0<br />
Key code = 72, state = 1<br />
Character = 'r'<br />
Key code = 72, state = 0<br />
Key code = 61, state = 1<br />
Character = 'a'<br />
Key code = 61, state = 0<br />
</p>
</div>
<p>
</p>
</div>
<div class="refsect1">
<a id="idm431456282496"></a>
<h2>See also</h2>
<p>
<a class="link" href="FLpanel.html" title="FLpanel"><em class="citetitle">FLpanel</em></a>,
<a class="link" href="FLkeyIn.html" title="FLkeyIn"><em class="citetitle">FLkeyIn</em></a>
</p>
</div>
<div class="refsect1">
<a id="idm431456279552"></a>
<h2>Credits</h2>
<p>
</p>
<table border="0" summary="Simple list" class="simplelist">
<tr>
<td>Author: John ffitch</td>
</tr>
<tr>
<td>University of Bath, Codemist. Ltd.</td>
</tr>
<tr>
<td>Bath, UK</td>
</tr>
<tr>
<td>October 2000</td>
</tr>
</table>
<p>
</p>
<p>Examples written by Kevin Conder, Johnathan Murphy and Istvan Varga.</p>
<p>New in Csound version 4.09. Renamed in Csound version 4.10.</p>
</div>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="sense.html">Prev</a> </td>
<td width="20%" align="center">
<a accesskey="u" href="OpcodesTop.html">Up</a>
</td>
<td width="40%" align="right"> <a accesskey="n" href="serialBegin.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">sense </td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">Home</a>
</td>
<td width="40%" align="right" valign="top"> serialBegin</td>
</tr>
</table>
</div>
</body>
</html>
| Java |
package com.baeldung.webflux;
import static java.time.LocalDateTime.now;
import static java.util.UUID.randomUUID;
import java.time.Duration;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.socket.WebSocketHandler;
import org.springframework.web.reactive.socket.WebSocketSession;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@Component("EmployeeWebSocketHandler")
public class EmployeeWebSocketHandler implements WebSocketHandler {
ObjectMapper om = new ObjectMapper();
@Override
public Mono<Void> handle(WebSocketSession webSocketSession) {
Flux<String> employeeCreationEvent = Flux.generate(sink -> {
EmployeeCreationEvent event = new EmployeeCreationEvent(randomUUID().toString(), now().toString());
try {
sink.next(om.writeValueAsString(event));
} catch (JsonProcessingException e) {
sink.error(e);
}
});
return webSocketSession.send(employeeCreationEvent
.map(webSocketSession::textMessage)
.delayElements(Duration.ofSeconds(1)));
}
}
| Java |
/*****************************************************************************
The Dark Mod GPL Source Code
This file is part of the The Dark Mod Source Code, originally based
on the Doom 3 GPL Source Code as published in 2011.
The Dark Mod Source Code is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the License,
or (at your option) any later version. For details, see LICENSE.TXT.
Project: The Dark Mod (http://www.thedarkmod.com/)
$Revision: 6618 $ (Revision of last commit)
$Date: 2016-09-06 15:39:46 +0000 (Tue, 06 Sep 2016) $ (Date of last commit)
$Author: grayman $ (Author of last commit)
******************************************************************************/
#ifndef _MULTI_STATE_MOVER_H_
#define _MULTI_STATE_MOVER_H_
#include "MultiStateMoverPosition.h"
#include "MultiStateMoverButton.h"
/**
* greebo: A MultiState mover is an extension to the vanilla D3 movers.
*
* In contrast to the idElevator class, this multistate mover draws the floor
* information from the MultiStateMoverPosition entities which are targetted
* by this class.
*
* The MultiStateMover will start moving when it's triggered (e.g. by buttons),
* where the information where to go is contained on the triggering button.
*
* Furthermore, the MultiStateMover provides a public interface for AI to
* help them figuring out which buttons to use, where to go, etc.
*/
class CMultiStateMover :
public idMover
{
idList<MoverPositionInfo> positionInfo;
idVec3 forwardDirection;
// The lists of buttons, AI entities need them to get the elevator moving
idList< idEntityPtr<CMultiStateMoverButton> > fetchButtons;
idList< idEntityPtr<CMultiStateMoverButton> > rideButtons;
// grayman #3050 - to help reduce jostling on the elevator
bool masterAtRideButton; // is the master in position to push the ride button?
UserManager riderManager; // manage a list of riders (which is different than users)
public:
CLASS_PROTOTYPE( CMultiStateMover );
CMultiStateMover();
void Spawn();
void Save(idSaveGame *savefile) const;
void Restore(idRestoreGame *savefile);
void Activate(idEntity* activator);
// Returns the list of position infos, populates the list if none are assigned yet.
const idList<MoverPositionInfo>& GetPositionInfoList();
/**
* greebo: Returns TRUE if this mover is at the given position.
* Note: NULL arguments always return false.
*/
bool IsAtPosition(CMultiStateMoverPosition* position);
/**
* greebo: This is called by the MultiStateMoverButton class exclusively to
* register the button with this Mover, so that the mover knows which buttons
* can be used to get it moving.
*
* @button: The button entity
* @type: The "use type" of the entity, e.g. "fetch" or "ride"
*/
void RegisterButton(CMultiStateMoverButton* button, EMMButtonType type);
/**
* greebo: Returns the closest button entity for the given position and the given "use type".
*
* @toPosition: the position the elevator needs to go to (to be "fetched" to, to "ride" to).
* @fromPosition: the position the button needs to be accessed from (can be NULL for type == RIDE).
* @type: the desired type of button (fetch or ride)
* @riderOrg: the origin of the AI using the button (grayman #3029)
*
* @returns: NULL if nothing found.
*/
CMultiStateMoverButton* GetButton(CMultiStateMoverPosition* toPosition, CMultiStateMoverPosition* fromPosition, EMMButtonType type, idVec3 riderOrg); // grayman #3029
// grayman #3050 - for ride management
bool IsMasterAtRideButton();
void SetMasterAtRideButton(bool atButton);
inline UserManager& GetRiderManager()
{
return riderManager;
}
protected:
// override idMover's DoneMoving() to trigger targets
virtual void DoneMoving();
private:
// greebo: Controls the direction of targetted rotaters, depending on the given moveTargetPosition
void SetGearDirection(const idVec3& targetPos);
// Returns the index of the named position info or -1 if not found
int GetPositionInfoIndex(const idStr& name) const;
// Returns the index of the position info at the given position (using epsilon comparison)
int GetPositionInfoIndex(const idVec3& pos) const;
// Returns the positioninfo entity of the given location or NULL if no suitable position found
CMultiStateMoverPosition* GetPositionEntity(const idVec3& pos) const;
// Extracts all position entities from the targets
void FindPositionEntities();
void Event_Activate(idEntity* activator);
void Event_PostSpawn();
/**
* grayman #4370: "Override" the TeamBlocked event to detect collisions with the player.
*/
virtual void OnTeamBlocked(idEntity* blockedEntity, idEntity* blockingEntity);
};
#endif /* _MULTI_STATE_MOVER_H_ */
| Java |
describe SearchController, type: :controller do
it { is_expected.to route(:get, '/search').to(action: :basic) }
it { is_expected.to route(:get, '/search/entity').to(action: :entity_search) }
describe "GET #entity_search" do
login_user
let(:org) { build(:org) }
def search_service_double
instance_double('EntitySearchService').tap do |d|
d.instance_variable_set(:@search, [org])
end
end
it 'returns http status bad_request if missing param q' do
get :entity_search
expect(response).to have_http_status(:bad_request)
end
it "returns http success" do
allow(Entity).to receive(:search).with("@(name,aliases) name", any_args).and_return([org])
get :entity_search, params: { :q => 'name' }
expect(response).to have_http_status(:success)
end
it "hash includes url by default" do
allow(Entity).to receive(:search).with("@(name,aliases) name", any_args).and_return([org])
get :entity_search, params: { :q => 'name' }
expect(JSON.parse(response.body)[0]['url']).to include "/org/#{org.id}"
expect(JSON.parse(response.body)[0]).not_to have_key "is_parent"
end
it "hash can optionally include parent" do
allow(Entity).to receive(:search).with("@(name,aliases) name", any_args).and_return([org])
expect(org).to receive(:parent?).once.and_return(false)
get :entity_search, params: { :q => 'name', include_parent: true }
expect(JSON.parse(response.body)[0]['is_parent']).to eq false
end
end
end
| Java |
<?php
namespace App\Model;
use PDO;
use Exception;
use App\Model;
use App\Config;
use App\Exceptions\ServerException;
use App\Exceptions\DatabaseInsertException;
class Account extends Model
{
public $id;
public $name;
public $email;
public $service;
public $password;
public $is_active;
public $imap_host;
public $imap_port;
public $smtp_host;
public $smtp_port;
public $imap_flags;
public $created_at;
public function getData()
{
return [
'id' => $this->id,
'name' => $this->name,
'email' => $this->email,
'service' => $this->service,
'password' => $this->password,
'is_active' => $this->is_active,
'imap_host' => $this->imap_host,
'imap_port' => $this->imap_port,
'smtp_host' => $this->smtp_host,
'smtp_port' => $this->smtp_port,
'imap_flags' => $this->imap_flags,
'created_at' => $this->created_at
];
}
public function getActive()
{
return $this->db()
->select()
->from('accounts')
->where('is_active', '=', 1)
->execute()
->fetchAll(PDO::FETCH_CLASS, get_class());
}
public function getFirstActive()
{
$active = $this->getActive();
return $active
? current($active)
: null;
}
public function getByEmail(string $email)
{
$account = $this->db()
->select()
->from('accounts')
->where('email', '=', $email)
->execute()
->fetchObject();
return $account
? new self($account)
: null;
}
public function fromAddress()
{
return $this->name
? sprintf('%s <%s>', $this->name, $this->email)
: $this->email;
}
public function hasFolders()
{
return (new Folder)->countByAccount($this->id) > 0;
}
/**
* Updates the account configuration.
*/
public function update(
string $email,
string $password,
string $name,
string $imapHost,
int $imapPort,
string $smtpHost,
int $smtpPort
) {
if (! $this->exists()) {
return false;
}
$updated = $this->db()
->update([
'name' => trim($name),
'email' => trim($email),
'password' => trim($password),
'imap_host' => trim($imapHost),
'imap_port' => trim($imapPort),
'smtp_host' => trim($smtpHost),
'smtp_port' => trim($smtpPort)
])
->table('accounts')
->where('id', '=', $this->id)
->execute();
return is_numeric($updated) ? $updated : false;
}
/**
* Creates a new account with the class data. This is done only
* after the IMAP credentials are tested to be working.
*
* @throws ServerException
*
* @return Account
*/
public function create()
{
// Exit if it already exists!
if ($this->exists()) {
return false;
}
$service = Config::getEmailService($this->email);
list($imapHost, $imapPort) = Config::getImapSettings($this->email);
if ($imapHost) {
$this->imap_host = $imapHost;
$this->imap_port = $imapPort;
}
$data = [
'is_active' => 1,
'service' => $service,
'name' => trim($this->name),
'email' => trim($this->email),
'password' => trim($this->password),
'imap_host' => trim($this->imap_host),
'imap_port' => trim($this->imap_port),
'smtp_host' => trim($this->smtp_host),
'smtp_port' => trim($this->smtp_port),
'created_at' => $this->utcDate()->format(DATE_DATABASE)
];
try {
// Start a transaction to prevent storing bad data
$this->db()->beginTransaction();
$newAccountId = $this->db()
->insert(array_keys($data))
->into('accounts')
->values(array_values($data))
->execute();
if (! $newAccountId) {
throw new DatabaseInsertException;
}
$this->db()->commit();
// Saved to the database
} catch (Exception $e) {
$this->db()->rollback();
throw new ServerException(
'Failed creating new account. '.$e->getMessage()
);
}
$this->id = $newAccountId;
return $this;
}
}
| Java |
package org.vaadin.addons.guice.server;
import org.vaadin.addons.guice.servlet.VGuiceApplicationServlet;
import com.google.inject.servlet.ServletModule;
/**
*
* @author Will Temperley
*
*/
public class ExampleGuiceServletModule extends ServletModule {
@Override
protected void configureServlets() {
serve("/*").with(VGuiceApplicationServlet.class);
}
} | Java |
class Global_var_WeaponGUI
{
idd=-1;
movingenable=false;
class controls
{
class Global_var_WeaponGUI_Frame: RscFrame
{
idc = -1;
x = 0.365937 * safezoneW + safezoneX;
y = 0.379 * safezoneH + safezoneY;
w = 0.170156 * safezoneW;
h = 0.143 * safezoneH;
};
class Global_var_WeaponGUI_Background: Box
{
idc = -1;
x = 0.365937 * safezoneW + safezoneX;
y = 0.379 * safezoneH + safezoneY;
w = 0.170156 * safezoneW;
h = 0.143 * safezoneH;
};
class Global_var_WeaponGUI_Text: RscText
{
idc = -1;
text = "Waffenauswahl"; //--- ToDo: Localize;
x = 0.365937 * safezoneW + safezoneX;
y = 0.39 * safezoneH + safezoneY;
w = 0.0773437 * safezoneW;
h = 0.022 * safezoneH;
};
class Global_var_WeaponGUI_Combo: RscCombo
{
idc = 2100;
x = 0.371094 * safezoneW + safezoneX;
y = 0.445 * safezoneH + safezoneY;
w = 0.159844 * safezoneW;
h = 0.022 * safezoneH;
};
class Global_var_WeaponGUI_Button_OK: RscButton
{
idc = 2101;
text = "OK"; //--- ToDo: Localize;
x = 0.371094 * safezoneW + safezoneX;
y = 0.489 * safezoneH + safezoneY;
w = 0.0773437 * safezoneW;
h = 0.022 * safezoneH;
action = "(lbText [2100, lbCurSel 2100]) execVM ""Ammo\Dialog.sqf"";closeDialog 1;";
};
class Global_var_WeaponGUI_Button_Cancel: RscButton
{
idc = 2102;
text = "Abbruch"; //--- ToDo: Localize;
x = 0.453594 * safezoneW + safezoneX;
y = 0.489 * safezoneH + safezoneY;
w = 0.0773437 * safezoneW;
h = 0.022 * safezoneH;
action = "closeDialog 2;";
};
};
}; | Java |
CREATE TABLE "new_american_city_inc_donors" (
"contributor" text,
"aggregate_donation" text
);
| Java |
using CP77.CR2W.Reflection;
using FastMember;
using static CP77.CR2W.Types.Enums;
namespace CP77.CR2W.Types
{
[REDMeta]
public class inkMenuAccountLogicController : inkWidgetLogicController
{
[Ordinal(1)] [RED("playerId")] public inkTextWidgetReference PlayerId { get; set; }
[Ordinal(2)] [RED("changeAccountLabelTextRef")] public inkTextWidgetReference ChangeAccountLabelTextRef { get; set; }
[Ordinal(3)] [RED("inputDisplayControllerRef")] public inkWidgetReference InputDisplayControllerRef { get; set; }
[Ordinal(4)] [RED("changeAccountEnabled")] public CBool ChangeAccountEnabled { get; set; }
public inkMenuAccountLogicController(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { }
}
}
| Java |
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
mirrorMesh
Description
Mirrors a mesh around a given plane.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "mirrorFvMesh.H"
#include "mapPolyMesh.H"
#include "hexRef8Data.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "addOverwriteOption.H"
#include "addDictOption.H"
#include "setRootCase.H"
#include "createTime.H"
const bool overwrite = args.optionFound("overwrite");
const word dictName
(
args.optionLookupOrDefault<word>("dict", "mirrorMeshDict")
);
mirrorFvMesh mesh
(
IOobject
(
mirrorFvMesh::defaultRegion,
runTime.constant(),
runTime
),
dictName
);
hexRef8Data refData
(
IOobject
(
"dummy",
mesh.facesInstance(),
polyMesh::meshSubDir,
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
)
);
if (!overwrite)
{
runTime++;
mesh.setInstance(runTime.timeName());
}
// Set the precision of the points data to 10
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
// Generate the mirrored mesh
const fvMesh& mMesh = mesh.mirrorMesh();
const_cast<fvMesh&>(mMesh).setInstance(mesh.facesInstance());
Info<< "Writing mirrored mesh" << endl;
mMesh.write();
// Map the hexRef8 data
mapPolyMesh map
(
mesh,
mesh.nPoints(), // nOldPoints,
mesh.nFaces(), // nOldFaces,
mesh.nCells(), // nOldCells,
mesh.pointMap(), // pointMap,
List<objectMap>(0), // pointsFromPoints,
labelList(0), // faceMap,
List<objectMap>(0), // facesFromPoints,
List<objectMap>(0), // facesFromEdges,
List<objectMap>(0), // facesFromFaces,
mesh.cellMap(), // cellMap,
List<objectMap>(0), // cellsFromPoints,
List<objectMap>(0), // cellsFromEdges,
List<objectMap>(0), // cellsFromFaces,
List<objectMap>(0), // cellsFromCells,
labelList(0), // reversePointMap,
labelList(0), // reverseFaceMap,
labelList(0), // reverseCellMap,
labelHashSet(0), // flipFaceFlux,
labelListList(0), // patchPointMap,
labelListList(0), // pointZoneMap,
labelListList(0), // faceZonePointMap,
labelListList(0), // faceZoneFaceMap,
labelListList(0), // cellZoneMap,
pointField(0), // preMotionPoints,
labelList(0), // oldPatchStarts,
labelList(0), // oldPatchNMeshPoints,
autoPtr<scalarField>() // oldCellVolumesPtr
);
refData.updateMesh(map);
refData.write();
Info<< "End" << endl;
return 0;
}
// ************************************************************************* //
| Java |
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.6
-- Dumped by pg_dump version 10.6
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
ALTER TABLE IF EXISTS ONLY public.own_television DROP CONSTRAINT IF EXISTS pk_own_television;
DROP TABLE IF EXISTS public.own_television;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: own_television; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.own_television (
geo_level character varying(15) NOT NULL,
geo_code character varying(10) NOT NULL,
geo_version character varying(100) DEFAULT ''::character varying NOT NULL,
own_television character varying(128) NOT NULL,
total integer
);
--
-- Data for Name: own_television; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.own_television (geo_level, geo_code, geo_version, own_television, total) FROM stdin;
region 1 2009 No, don't own 91
region 1 2009 Yes, do own 29
region 2 2009 No, don't own 79
region 2 2009 Yes, do own 194
region 3 2009 No, don't own 91
region 3 2009 Yes, do own 5
region 4 2009 No, don't own 59
region 4 2009 Yes, do own 12
region 5 2009 No, don't own 41
region 5 2009 Yes, do own 7
region 6 2009 No, don't own 56
region 6 2009 Yes, do own 16
region 7 2009 No, don't own 38
region 7 2009 Yes, do own 18
region 8 2009 No, don't own 23
region 8 2009 Yes, do own 17
region 9 2009 No, don't own 16
region 9 2009 Yes, do own 8
region 10 2009 No, don't own 90
region 10 2009 Yes, do own 6
region 11 2009 No, don't own 54
region 11 2009 Yes, do own 34
region 12 2009 No, don't own 6
region 12 2009 Yes, do own 2
region 13 2009 No, don't own 18
region 13 2009 Yes, do own 6
region 14 2009 No, don't own 48
region 15 2009 No, don't own 53
region 15 2009 Yes, do own 11
region 16 2009 No, don't own 64
region 16 2009 Yes, do own 16
region 17 2009 No, don't own 38
region 17 2009 Yes, do own 26
region 30 2009 No, don't own 33
region 30 2009 Yes, do own 79
region 18 2009 No, don't own 104
region 18 2009 Yes, do own 16
region 19 2009 No, don't own 61
region 19 2009 Yes, do own 10
region 20 2009 No, don't own 103
region 20 2009 Yes, do own 21
region 21 2009 No, don't own 30
region 21 2009 Yes, do own 10
region 22 2009 No, don't own 61
region 22 2009 Yes, do own 11
region 23 2009 No, don't own 34
region 23 2009 Yes, do own 5
region 24 2009 No, don't own 68
region 24 2009 Yes, do own 4
region 25 2009 No, don't own 60
region 25 2009 Yes, do own 12
region 26 2009 No, don't own 61
region 26 2009 Yes, do own 3
region 27 2009 No, don't own 55
region 27 2009 Yes, do own 9
region 31 2009 Don't know 1
region 31 2009 No, don't own 59
region 31 2009 Yes, do own 12
region 29 2009 No, don't own 93
region 29 2009 Yes, do own 11
region 28 2009 No, don't own 59
region 28 2009 Yes, do own 29
country TZ 2009 Yes, do own 639
country TZ 2009 No, don't own 1746
country TZ 2009 Don't know 1
\.
--
-- Name: own_television pk_own_television; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.own_television
ADD CONSTRAINT pk_own_television PRIMARY KEY (geo_level, geo_code, geo_version, own_television);
--
-- PostgreSQL database dump complete
--
| Java |
--玄星曜兽-女土蝠
function c21520110.initial_effect(c)
--summon & set with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21520110,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c21520110.ntcon)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(21520110,2))
e2:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e2)
--recover
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(21520110,1))
e3:SetCategory(CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c21520110.reccon)
e3:SetTarget(c21520110.rectg)
e3:SetOperation(c21520110.recop)
c:RegisterEffect(e3)
end
function c21520110.filter(c)
return c:IsSetCard(0x491) and c:IsFaceup()
end
function c21520110.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c21520110.filter,tp,LOCATION_MZONE,0,1,nil)
end
function c21520110.reccon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c21520110.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ev)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,tp,ev)
end
function c21520110.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
| Java |
#include "Data/datadescriptor.h"
#include <type_traits>
#include <QDebug>
unsigned int DataDescriptor::_uid_ctr = 0;
DataDescriptor::DataDescriptor(QString name, QString unit, double factor, Type t) :
_name(name), _unit(unit), _factor(factor), _type(t)
{
_uuid = getUUID();
}
DataDescriptor::DataDescriptor(const QJsonObject &jo) {
_uuid = getUUID();
_name = jo["name"].toString();
_unit = jo["unit"].toString();
_factor = jo["factor"].toDouble();
_type = static_cast<Type>(jo["type"].toInt());
}
DataDescriptor::Type DataDescriptor::typeFromId(quint8 id) {
switch (id) {
case 0: return Type::CHAR;
case 1: return Type::FLOAT;
case 2: return Type::UINT16T;
case 3: return Type::BIGLITTLE;
default: return Type::UINT32T;
}
}
QString DataDescriptor::str() const {
QString test("%1 [%2] * %3");
return test.arg(_name,_unit,QString::number(_factor));
}
unsigned int DataDescriptor::getUUID() {
return _uid_ctr++;
}
QJsonObject DataDescriptor::json() const {
QJsonObject json;
json["name"] = _name;
json["unit"] = _unit;
json["factor"] = _factor;
json["type"] = static_cast<std::underlying_type<Type>::type>(_type);
return json;
}
| Java |
/*
-----------------------------------------------------------------------
Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp
2014-2015, CWI, Amsterdam
Contact: astra@uantwerpen.be
Website: http://sf.net/projects/astra-toolbox
This file is part of the ASTRA Toolbox.
The ASTRA Toolbox is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The ASTRA Toolbox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
-----------------------------------------------------------------------
$Id$
*/
#ifdef ASTRA_CUDA
#include "astra/CudaEMAlgorithm.h"
#include "../cuda/2d/em.h"
using namespace std;
namespace astra {
// type of the algorithm, needed to register with CAlgorithmFactory
std::string CCudaEMAlgorithm::type = "EM_CUDA";
//----------------------------------------------------------------------------------------
// Constructor
CCudaEMAlgorithm::CCudaEMAlgorithm()
{
m_bIsInitialized = false;
CCudaReconstructionAlgorithm2D::_clear();
}
//----------------------------------------------------------------------------------------
// Destructor
CCudaEMAlgorithm::~CCudaEMAlgorithm()
{
// The actual work is done by ~CCudaReconstructionAlgorithm2D
}
//---------------------------------------------------------------------------------------
// Initialize - Config
bool CCudaEMAlgorithm::initialize(const Config& _cfg)
{
ASTRA_ASSERT(_cfg.self);
ConfigStackCheck<CAlgorithm> CC("CudaEMAlgorithm", this, _cfg);
m_bIsInitialized = CCudaReconstructionAlgorithm2D::initialize(_cfg);
if (!m_bIsInitialized)
return false;
m_pAlgo = new astraCUDA::EM();
m_bAlgoInit = false;
return true;
}
//---------------------------------------------------------------------------------------
// Initialize - C++
bool CCudaEMAlgorithm::initialize(CProjector2D* _pProjector,
CFloat32ProjectionData2D* _pSinogram,
CFloat32VolumeData2D* _pReconstruction)
{
m_bIsInitialized = CCudaReconstructionAlgorithm2D::initialize(_pProjector, _pSinogram, _pReconstruction);
if (!m_bIsInitialized)
return false;
m_pAlgo = new astraCUDA::EM();
m_bAlgoInit = false;
return true;
}
} // namespace astra
#endif // ASTRA_CUDA
| Java |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import collections
import six
from .comminfo import CommissionInfo
from .position import Position
from .metabase import MetaParams
from .order import Order, BuyOrder, SellOrder
class BrokerBack(six.with_metaclass(MetaParams, object)):
params = (('cash', 10000.0), ('commission', CommissionInfo()),)
def __init__(self):
self.comminfo = dict()
self.init()
def init(self):
if None not in self.comminfo.keys():
self.comminfo = dict({None: self.p.commission})
self.startingcash = self.cash = self.p.cash
self.orders = list() # will only be appending
self.pending = collections.deque() # popleft and append(right)
self.positions = collections.defaultdict(Position)
self.notifs = collections.deque()
def getcash(self):
return self.cash
def setcash(self, cash):
self.startingcash = self.cash = self.p.cash = cash
def getcommissioninfo(self, data):
if data._name in self.comminfo:
return self.comminfo[data._name]
return self.comminfo[None]
def setcommission(self, commission=0.0, margin=None, mult=1.0, name=None):
comm = CommissionInfo(commission=commission, margin=margin, mult=mult)
self.comminfo[name] = comm
def addcommissioninfo(self, comminfo, name=None):
self.comminfo[name] = comminfo
def start(self):
self.init()
def stop(self):
pass
def cancel(self, order):
try:
self.pending.remove(order)
except ValueError:
# If the list didn't have the element we didn't cancel anything
return False
order.cancel()
self.notify(order)
return True
def getvalue(self, datas=None):
pos_value = 0.0
for data in datas or self.positions.keys():
comminfo = self.getcommissioninfo(data)
position = self.positions[data]
pos_value += comminfo.getvalue(position, data.close[0])
return self.cash + pos_value
def getposition(self, data):
return self.positions[data]
def submit(self, order):
# FIXME: When an order is submitted, a margin check
# requirement has to be done before it can be accepted. This implies
# going over the entire list of pending orders for all datas and
# existing positions, simulating order execution and ending up
# with a "cash" figure that can be used to check the margin requirement
# of the order. If not met, the order can be immediately rejected
order.pannotated = None
order.plen = len(order.data)
order.accept()
self.orders.append(order)
self.pending.append(order)
self.notify(order)
return order
def buy(self, owner, data,
size, price=None, plimit=None,
exectype=None, valid=None):
order = BuyOrder(owner=owner, data=data,
size=size, price=price, pricelimit=plimit,
exectype=exectype, valid=valid)
return self.submit(order)
def sell(self, owner, data,
size, price=None, plimit=None,
exectype=None, valid=None):
order = SellOrder(owner=owner, data=data,
size=size, price=price, pricelimit=plimit,
exectype=exectype, valid=valid)
return self.submit(order)
def _execute(self, order, dt, price):
# Orders are fully executed, get operation size
size = order.executed.remsize
# Get comminfo object for the data
comminfo = self.getcommissioninfo(order.data)
# Adjust position with operation size
position = self.positions[order.data]
oldpprice = position.price
psize, pprice, opened, closed = position.update(size, price)
abopened, abclosed = abs(opened), abs(closed)
# if part/all of a position has been closed, then there has been
# a profitandloss ... record it
pnl = comminfo.profitandloss(abclosed, oldpprice, price)
if closed:
# Adjust to returned value for closed items & acquired opened items
closedvalue = comminfo.getoperationcost(abclosed, price)
self.cash += closedvalue
# Calculate and substract commission
closedcomm = comminfo.getcomm_pricesize(abclosed, price)
self.cash -= closedcomm
# Re-adjust cash according to future-like movements
# Restore cash which was already taken at the start of the day
self.cash -= comminfo.cashadjust(abclosed,
price,
order.data.close[0])
# pnl = comminfo.profitandloss(oldpsize, oldpprice, price)
else:
closedvalue = closedcomm = 0.0
if opened:
openedvalue = comminfo.getoperationcost(abopened, price)
self.cash -= openedvalue
openedcomm = comminfo.getcomm_pricesize(abopened, price)
self.cash -= openedcomm
# Remove cash for the new opened contracts
self.cash += comminfo.cashadjust(abopened,
price,
order.data.close[0])
else:
openedvalue = openedcomm = 0.0
# Execute and notify the order
order.execute(dt, size, price,
closed, closedvalue, closedcomm,
opened, openedvalue, openedcomm,
comminfo.margin, pnl,
psize, pprice)
self.notify(order)
def notify(self, order):
self.notifs.append(order.clone())
def next(self):
for data, pos in self.positions.items():
# futures change cash in the broker in every bar
# to ensure margin requirements are met
comminfo = self.getcommissioninfo(data)
self.cash += comminfo.cashadjust(pos.size,
data.close[-1],
data.close[0])
# Iterate once over all elements of the pending queue
for i in range(len(self.pending)):
order = self.pending.popleft()
if order.expire():
self.notify(order)
continue
popen = order.data.tick_open or order.data.open[0]
phigh = order.data.tick_high or order.data.high[0]
plow = order.data.tick_low or order.data.low[0]
pclose = order.data.tick_close or order.data.close[0]
pcreated = order.created.price
plimit = order.created.pricelimit
if order.exectype == Order.Market:
self._execute(order, order.data.datetime[0], price=popen)
elif order.exectype == Order.Close:
self._try_exec_close(order, pclose)
elif order.exectype == Order.Limit:
self._try_exec_limit(order, popen, phigh, plow, pcreated)
elif order.exectype == Order.StopLimit and order.triggered:
self._try_exec_limit(order, popen, phigh, plow, plimit)
elif order.exectype == Order.Stop:
self._try_exec_stop(order, popen, phigh, plow, pcreated)
elif order.exectype == Order.StopLimit:
self._try_exec_stoplimit(order,
popen, phigh, plow, pclose,
pcreated, plimit)
if order.alive():
self.pending.append(order)
def _try_exec_close(self, order, pclose):
if len(order.data) > order.plen:
dt0 = order.data.datetime[0]
if dt0 > order.dteos:
if order.pannotated:
execdt = order.data.datetime[-1]
execprice = pannotated
else:
execdt = dt0
execprice = pclose
self._execute(order, execdt, price=execprice)
return
# If no exexcution has taken place ... annotate the closing price
order.pannotated = pclose
def _try_exec_limit(self, order, popen, phigh, plow, plimit):
if order.isbuy():
if plimit >= popen:
# open smaller/equal than requested - buy cheaper
self._execute(order, order.data.datetime[0], price=popen)
elif plimit >= plow:
# day low below req price ... match limit price
self._execute(order, order.data.datetime[0], price=plimit)
else: # Sell
if plimit <= popen:
# open greater/equal than requested - sell more expensive
self._execute(order, order.data.datetime[0], price=popen)
elif plimit <= phigh:
# day high above req price ... match limit price
self._execute(order, order.data.datetime[0], price=plimit)
def _try_exec_stop(self, order, popen, phigh, plow, pcreated):
if order.isbuy():
if popen >= pcreated:
# price penetrated with an open gap - use open
self._execute(order, order.data.datetime[0], price=popen)
elif phigh >= pcreated:
# price penetrated during the session - use trigger price
self._execute(order, order.data.datetime[0], price=pcreated)
else: # Sell
if popen <= pcreated:
# price penetrated with an open gap - use open
self._execute(order, order.data.datetime[0], price=popen)
elif plow <= pcreated:
# price penetrated during the session - use trigger price
self._execute(order, order.data.datetime[0], price=pcreated)
def _try_exec_stoplimit(self, order,
popen, phigh, plow, pclose,
pcreated, plimit):
if order.isbuy():
if popen >= pcreated:
order.triggered = True
# price penetrated with an open gap
if plimit >= popen:
self._execute(order, order.data.datetime[0], price=popen)
elif plimit >= plow:
# execute in same bar
self._execute(order, order.data.datetime[0], price=plimit)
elif phigh >= pcreated:
# price penetrated upwards during the session
order.triggered = True
# can calculate execution for a few cases - datetime is fixed
dt = order.data.datetime[0]
if popen > pclose:
if plimit >= pcreated:
self._execute(order, dt, price=pcreated)
elif plimit >= pclose:
self._execute(order, dt, price=plimit)
else: # popen < pclose
if plimit >= pcreated:
self._execute(order, dt, price=pcreated)
else: # Sell
if popen <= pcreated:
# price penetrated downwards with an open gap
order.triggered = True
if plimit <= open:
self._execute(order, order.data.datetime[0], price=popen)
elif plimit <= phigh:
# execute in same bar
self._execute(order, order.data.datetime[0], price=plimit)
elif plow <= pcreated:
# price penetrated downwards during the session
order.triggered = True
# can calculate execution for a few cases - datetime is fixed
dt = order.data.datetime[0]
if popen <= pclose:
if plimit <= pcreated:
self._execute(order, dt, price=pcreated)
elif plimit <= pclose:
self._execute(order, dt, price=plimit)
else:
# popen > pclose
if plimit <= pcreated:
self._execute(order, dt, price=pcreated)
| Java |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.mariotaku.twidere.util.http;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.SecurityInfo;
import javax.microedition.io.SocketConnection;
import javax.microedition.io.StreamConnection;
import repackaged.com.sun.midp.pki.X509Certificate;
import repackaged.com.sun.midp.ssl.SSLStreamConnection;
/**
*
* @author mariotaku
*/
public final class UnsafeSSLConnection implements StreamConnection {
private final SSLStreamConnection sc;
UnsafeSSLConnection(final String host, final int port) throws IOException {
final SocketConnection tcp = (SocketConnection) Connector.open("socket://" + host + ":" + port);
tcp.setSocketOption(SocketConnection.DELAY, 0);
final InputStream tcpIn = tcp.openInputStream();
final OutputStream tcpOut = tcp.openOutputStream();
sc = new SSLStreamConnection(host, port, tcpIn, tcpOut);
}
public synchronized OutputStream openOutputStream() throws IOException {
return sc.openOutputStream();
}
public synchronized InputStream openInputStream() throws IOException {
return sc.openInputStream();
}
public DataOutputStream openDataOutputStream() throws IOException {
return sc.openDataOutputStream();
}
public DataInputStream openDataInputStream() throws IOException {
return sc.openDataInputStream();
}
public X509Certificate getServerCertificate() {
return sc.getServerCertificate();
}
public SecurityInfo getSecurityInfo() throws IOException {
return sc.getSecurityInfo();
}
public synchronized void close() throws IOException {
sc.close();
}
public static UnsafeSSLConnection open(final String host, final int port) throws IOException {
if (host == null && port < 0) {
return new UnsafeSSLConnection("127.0.0.1", 443);
} else if (host != null) {
return new UnsafeSSLConnection(host, 443);
}
return new UnsafeSSLConnection(host, port);
}
}
| Java |
/***************************************************************************
* Title : Find all possible paths from Source to Destination
* URL :
* Date : 2018-02-23
* Author: Atiq Rahman
* Comp : O(V+E)
* Status: Demo
* Notes : comments inline, input sample at '01_BFS_SP.cs'
* meta : tag-graph-dfs, tag-recursion, tag-company-gatecoin, tag-coding-test, tag-algo-core
***************************************************************************/
using System;
using System.Collections.Generic;
public class GraphDemo {
bool[] IsVisited;
// We are using Adjacency List instead of adjacency matrix to save space,
// for sparse graphs which is average case
List<int>[] AdjList;
// Nodes in the path being visited so far
int[] Path;
// Number of nodes so far encountered during the visit
int PathHopCount;
int PathCount = 0;
// Number of Vertices in the graph
int nV;
// Number of Edges
int nE;
int Source;
int Destination;
/*
* Takes input
* Build adjacency list graph representation
* Does input validation
*/
public void TakeInput() {
Console.WriteLine("Please enter number of vertices in the graph:");
nV = int.Parse(Console.ReadLine());
if (nV < 1)
throw new ArgumentException();
// As number of vertices is know at this point,
// Initialize (another way to do is to move this block to constructor)
Path = new int[nV];
PathHopCount = 0;
PathCount = 0;
AdjList = new List<int>[nV];
// by default C# compiler sets values in array to false
IsVisited = new bool[nV];
for (int i = 0; i < nV; i++)
AdjList[i] = new List<int>();
// Build adjacency list from given points
Console.WriteLine("Please enter number of edges:");
nE = int.Parse(Console.ReadLine());
if (nE < 0)
throw new ArgumentException();
Console.WriteLine("Please enter {0} of edges, one edge per line \"u v\" " +
"where 1 <= u <= {1} and 1 <= v <= {1}", nE, nV);
string[] tokens = null;
for (int i=0; i<nE; i++) {
tokens = Console.ReadLine().Split();
int u = int.Parse(tokens[0]) - 1;
int v = int.Parse(tokens[1]) - 1;
if (u < 0 || u >= nV || v < 0 || v >= nV)
throw new ArgumentException();
AdjList[u].Add(v);
AdjList[v].Add(u);
}
Console.WriteLine("Please provide source and destination:");
// reuse tokens variable, if it were reducing readability we would a new
// variable
tokens = Console.ReadLine().Split();
Source = int.Parse(tokens[0]) - 1;
Destination = int.Parse(tokens[1]) - 1;
if (Source < 0 || Source >= nV || Destination < 0 || Destination >= nV)
throw new ArgumentException();
}
/*
* Depth first search algorithm to find path from source to destination
* for the node of the graph passed as argument
* 1. We check if it's destination node (we avoid cycle)
* 2. If not then if the node is not visited in the same path then we visit
* its adjacent nodes
* To allow visiting same node in a different path we set visited to false
* for the node when we backtrack to a different path
*
* We store the visited paths for the node in Path variable and keep count
* of nodes in the path using variable PathHopCount. Path variable is
* reused for finding other paths.
*
* If we want to return list of all paths we can use a list of list to store
* all of them from this variable
*/
private void DFSVisit(int u) {
IsVisited[u] = true;
Path[PathHopCount++] = u;
if (u == Destination)
PrintPath();
else
foreach (int v in AdjList[u])
if (IsVisited[v] == false)
DFSVisit(v);
PathHopCount--;
IsVisited[u] = false;
}
/*
* Simply print nodes from array Path
* PathCount increments every time a new path is found.
*/
private void PrintPath() {
Console.WriteLine("Path {0}:", ++PathCount);
for (int i = 0; i < PathHopCount; i++)
if (i==0)
Console.Write(" {0}", Path[i] + 1);
else
Console.Write(" -> {0}", Path[i]+1);
Console.WriteLine();
}
public void ShowResult() {
Console.WriteLine("Listing paths from {0} to {1}.", Source+1, Destination+1);
DFSVisit(Source);
}
}
class Program {
static void Main(string[] args) {
GraphDemo graph_demo = new GraphDemo();
graph_demo.TakeInput();
graph_demo.ShowResult();
}
}
| Java |
/***********************************************************************
This file is part of KEEL-software, the Data Mining tool for regression,
classification, clustering, pattern mining and so on.
Copyright (C) 2004-2010
F. Herrera (herrera@decsai.ugr.es)
L. Sánchez (luciano@uniovi.es)
J. Alcalá-Fdez (jalcala@decsai.ugr.es)
S. García (sglopez@ujaen.es)
A. Fernández (alberto.fernandez@ujaen.es)
J. Luengo (julianlm@decsai.ugr.es)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/
**********************************************************************/
package keel.Algorithms.RE_SL_Methods.LEL_TSK;
import java.io.*;
import org.core.*;
import java.util.*;
import java.lang.Math;
class Simplif {
public double semilla;
public long cont_soluciones;
public long Gen, n_genes, n_reglas, n_generaciones;
public int n_soluciones;
public String fich_datos_chequeo, fich_datos_tst, fich_datos_val;
public String fichero_conf, ruta_salida;
public String fichero_br, fichero_reglas, fich_tra_obli, fich_tst_obli;
public String datos_inter = "";
public String cadenaReglas = "";
public MiDataset tabla, tabla_tst, tabla_val;
public BaseR_TSK base_reglas;
public BaseR_TSK base_total;
public Adap_Sel fun_adap;
public AG alg_gen;
public Simplif(String f_e) {
fichero_conf = f_e;
}
private String Quita_blancos(String cadena) {
StringTokenizer sT = new StringTokenizer(cadena, "\t ", false);
return (sT.nextToken());
}
/** Reads the data of the configuration file */
public void leer_conf() {
int i, j;
String cadenaEntrada, valor;
double cruce, mutacion, porc_radio_reglas, porc_min_reglas, alfa, tau;
int tipo_fitness, long_poblacion;
// we read the file in a String
cadenaEntrada = Fichero.leeFichero(fichero_conf);
StringTokenizer sT = new StringTokenizer(cadenaEntrada, "\n\r=", false);
// we read the algorithm's name
sT.nextToken();
sT.nextToken();
// we read the name of the training and test files
sT.nextToken();
valor = sT.nextToken();
StringTokenizer ficheros = new StringTokenizer(valor, "\t ", false);
fich_datos_chequeo = ( (ficheros.nextToken()).replace('\"', ' ')).trim();
fich_datos_val = ( (ficheros.nextToken()).replace('\"', ' ')).trim();
fich_datos_tst = ( (ficheros.nextToken()).replace('\"', ' ')).trim();
// we read the name of the output files
sT.nextToken();
valor = sT.nextToken();
ficheros = new StringTokenizer(valor, "\t ", false);
fich_tra_obli = ( (ficheros.nextToken()).replace('\"', ' ')).trim();
fich_tst_obli = ( (ficheros.nextToken()).replace('\"', ' ')).trim();
String aux = ( (ficheros.nextToken()).replace('\"', ' ')).trim(); //Br inicial
aux = ( (ficheros.nextToken()).replace('\"', ' ')).trim(); //BD
fichero_br = ( (ficheros.nextToken()).replace('\"', ' ')).trim(); //BR salida de MAN2TSK
fichero_reglas = ( (ficheros.nextToken()).replace('\"', ' ')).trim(); //BR salida de Select
aux = ( (ficheros.nextToken()).replace('\"', ' ')).trim(); //BR salida de Tuning
ruta_salida = fich_tst_obli.substring(0, fich_tst_obli.lastIndexOf('/') + 1);
// we read the seed of the random generator
sT.nextToken();
valor = sT.nextToken();
semilla = Double.parseDouble(valor.trim());
Randomize.setSeed( (long) semilla); ;
for (i = 0; i < 19; i++) {
sT.nextToken(); //variable
sT.nextToken(); //valor
}
// we read the Number of Iterations
sT.nextToken();
valor = sT.nextToken();
n_generaciones = Long.parseLong(valor.trim());
// we read the Population Size
sT.nextToken();
valor = sT.nextToken();
long_poblacion = Integer.parseInt(valor.trim());
// we read the Tau parameter for the minimun maching degree required to the KB
sT.nextToken();
valor = sT.nextToken();
tau = Double.parseDouble(valor.trim());
// we read the Rate of Rules that don't are eliminated
sT.nextToken();
valor = sT.nextToken();
porc_min_reglas = Double.parseDouble(valor.trim());
// we read the Rate of rules to estimate the niche radio
sT.nextToken();
valor = sT.nextToken();
porc_radio_reglas = Double.parseDouble(valor.trim());
// we read the Alfa parameter for the Power Law
sT.nextToken();
valor = sT.nextToken();
alfa = Double.parseDouble(valor.trim());
// we read the Type of Fitness Function
sT.nextToken();
valor = sT.nextToken();
tipo_fitness = Integer.parseInt(valor.trim());
// we select the numero de soluciones
n_soluciones = 1;
// we read the Cross Probability
sT.nextToken();
valor = sT.nextToken();
cruce = Double.parseDouble(valor.trim());
// we read the Mutation Probability
sT.nextToken();
valor = sT.nextToken();
mutacion = Double.parseDouble(valor.trim());
// we create all the objects
tabla = new MiDataset(fich_datos_chequeo, false);
if (tabla.salir == false) {
tabla_val = new MiDataset(fich_datos_val, false);
tabla_tst = new MiDataset(fich_datos_tst, false);
base_total = new BaseR_TSK(fichero_br, tabla, true);
base_reglas = new BaseR_TSK(base_total.n_reglas, tabla);
fun_adap = new Adap_Sel(tabla, tabla_tst, base_reglas, base_total,
base_total.n_reglas, porc_radio_reglas,
porc_min_reglas, n_soluciones, tau, alfa,
tipo_fitness);
alg_gen = new AG(long_poblacion, base_total.n_reglas, cruce, mutacion,
fun_adap);
}
}
public void run() {
int i, j;
double ec, el, min_CR, ectst, eltst;
/* We read the configutate file and we initialize the structures and variables */
leer_conf();
if (tabla.salir == false) {
/* Inicializacion del contador de soluciones ya generadas */
cont_soluciones = 0;
System.out.println("Simplif-TSK");
do {
/* Generation of the initial population */
alg_gen.Initialize();
Gen = 0;
/* Evaluation of the initial population */
alg_gen.Evaluate();
Gen++;
/* Main of the genetic algorithm */
do {
/* Interchange of the new and old population */
alg_gen.Intercambio();
/* Selection by means of Baker */
alg_gen.Select();
/* Crossover */
alg_gen.Cruce_Multipunto();
/* Mutation */
alg_gen.Mutacion_Uniforme();
/* Elitist selection */
alg_gen.Elitist();
/* Evaluation of the current population */
alg_gen.Evaluate();
/* we increment the counter */
Gen++;
}
while (Gen <= n_generaciones);
/* we store the RB in the Tabu list */
if (Aceptar(alg_gen.solucion()) == 1) {
fun_adap.guardar_solucion(alg_gen.solucion());
/* we increment the number of solutions */
cont_soluciones++;
fun_adap.Decodifica(alg_gen.solucion());
fun_adap.Cubrimientos_Base();
/* we calcule the MSEs */
fun_adap.Error_tra();
ec = fun_adap.EC;
el = fun_adap.EL;
fun_adap.tabla_tst = tabla_tst;
fun_adap.Error_tst();
ectst = fun_adap.EC;
eltst = fun_adap.EL;
/* we calculate the minimum and maximum matching */
min_CR = 1.0;
for (i = 0; i < tabla.long_tabla; i++) {
min_CR = Adap.Minimo(min_CR, tabla.datos[i].maximo_cubrimiento);
}
/* we write the RB */
cadenaReglas = base_reglas.BRtoString();
cadenaReglas += "\n\nMinimum of C_R: " + min_CR +
" Minimum covering degree: " + fun_adap.mincb +
"\nAverage covering degree: " + fun_adap.medcb + " MLE: " + el +
"\nMSEtra: " + ec + " , MSEtst: " + ectst + "\n";
Fichero.escribeFichero(fichero_reglas, cadenaReglas);
/* we write the obligatory output files*/
String salida_tra = tabla.getCabecera();
salida_tra += fun_adap.getSalidaObli(tabla_val);
Fichero.escribeFichero(fich_tra_obli, salida_tra);
String salida_tst = tabla_tst.getCabecera();
salida_tst += fun_adap.getSalidaObli(tabla_tst);
Fichero.escribeFichero(fich_tst_obli, salida_tst);
/* we write the MSEs in specific files */
Fichero.AnadirtoFichero(ruta_salida + "SimplifcomunR.txt", "" + base_reglas.n_reglas + "\n");
Fichero.AnadirtoFichero(ruta_salida + "SimplifcomunTRA.txt", "" + ec + "\n");
Fichero.AnadirtoFichero(ruta_salida + "SimplifcomunTST.txt", "" + ectst + "\n");
}
/* the multimodal GA finish when the condition is true */
}
while (Parada() == 0);
}
}
/** Criterion of stop */
public int Parada() {
if (cont_soluciones == n_soluciones) {
return (1);
}
else {
return (0);
}
}
/** Criterion to accept the solutions */
int Aceptar(char[] cromosoma) {
return (1);
}
}
| Java |
package com.orcinuss.reinforcedtools.item.tools;
import com.google.common.collect.Sets;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTool;
import java.util.Set;
public class ItemRTMHarvester extends ItemTool{
private static final Set blocksToBreak = Sets.newHashSet(new Block[]{Blocks.glowstone});
public EnumRarity rarity;
public ItemRTMHarvester(Item.ToolMaterial material)
{
this(material, EnumRarity.common);
}
public ItemRTMHarvester(Item.ToolMaterial material, EnumRarity rarity ){
super(0.0F, material, blocksToBreak);
this.rarity = rarity;
this.maxStackSize = 1;
}
}
| Java |
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''Copyright (C) 2010 MapAction UK Charity No. 1075977
''
''www.mapaction.org
''
''This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
''
''This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
''
''You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses>.
''
''Additional permission under GNU GPL version 3 section 7
''
''If you modify this Program, or any covered work, by linking or combining it with
''ESRI ArcGIS Desktop Products (ArcView, ArcEditor, ArcInfo, ArcEngine Runtime and ArcEngine Developer Kit) (or a modified version of that library), containing parts covered by the terms of ESRI's single user or concurrent use license, the licensors of this Program grant you additional permission to convey the resulting work.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Imports ESRI.ArcGIS.esriSystem
Imports mapaction.datanames.api
Module maDataNameChecker
Private m_AOLicenseInitializer As LicenseInitializer = New mapaction.datanames.cli.LicenseInitializer()
Private m_strDataListPath As String = Nothing
Private m_strLookupTablesPath As String = Nothing
Private m_blnRecuse As Boolean = True
Sub Main(ByVal CmdArgs() As String)
'ESRI License Initializer generated code.
m_AOLicenseInitializer.InitializeApplication(New esriLicenseProductCode() {esriLicenseProductCode.esriLicenseProductCodeEngine, esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB, esriLicenseProductCode.esriLicenseProductCodeArcView, esriLicenseProductCode.esriLicenseProductCodeArcEditor, esriLicenseProductCode.esriLicenseProductCodeArcInfo}, _
New esriLicenseExtensionCode() {})
Dim blnNextArgIsDataList As Boolean = False
Dim blnNextAgrIsLookupTable As Boolean = False
Dim blnPrintVersion As Boolean = False
Dim blnPrintHelp As Boolean = False
Dim blnUnregconisedArg As Boolean = False
Dim strMDBpath(1) As String
''
' Read the arguments
If CmdArgs Is Nothing OrElse CmdArgs.Length < 1 Then
blnPrintHelp = True
Else
For Each strArg As String In CmdArgs
'System.Console.WriteLine(arg)
Select Case strArg
Case "-l", "/l"
blnNextArgIsDataList = True
Case "-t", "/t"
blnNextAgrIsLookupTable = True
Case "-v", "/v"
blnPrintVersion = True
Case "-h", "-?", "/h", "/?"
blnPrintHelp = True
Case "-r"
m_blnRecuse = True
Case "-n"
m_blnRecuse = False
Case Else
If blnNextArgIsDataList Then
m_strDataListPath = strArg
blnNextArgIsDataList = False
ElseIf blnNextAgrIsLookupTable Then
m_strLookupTablesPath = strArg
blnNextAgrIsLookupTable = False
Else
blnUnregconisedArg = True
End If
End Select
Next
End If
''
' Now decide want to do
If blnNextAgrIsLookupTable Or blnNextArgIsDataList Or blnUnregconisedArg Then
printUnregconisedArgs()
ElseIf blnPrintHelp Then
printUsageMessage()
ElseIf blnPrintVersion Then
printNameAndVersion()
Else
testDataNames()
End If
'MsgBox("done")
'ESRI License Initializer generated code.
'Do not make any call to ArcObjects after ShutDownApplication()
m_AOLicenseInitializer.ShutdownApplication()
End Sub
Private Sub testDataNames()
Dim dlc As IDataListConnection = Nothing
Dim dnclFactory As DataNameClauseLookupFactory
Dim dncl As IDataNameClauseLookup
Dim lstDNtoTest As New List(Of IDataName)
Dim lngStatus As Long
Try
'''''''''''''''''''
'' First look for an IGeoDataListConnection argument
'''''''''''''''''''
If m_strDataListPath Is Nothing Then
printUnregconisedArgs()
Else
'We are using names read from a directory or GDB
dlc = DataListConnectionFactory.getFactory().createDataListConnection(m_strDataListPath)
'''''''''''''''''''
'' Secound look for an IDataNameClauseLookup argument
'''''''''''''''''''
If m_strLookupTablesPath Is Nothing Then
dncl = dlc.getDefaultDataNameClauseLookup()
System.Console.WriteLine()
System.Console.WriteLine("Using Data Name Clause Lookup Tables at:")
System.Console.WriteLine(dncl.getDetails())
Else
dnclFactory = DataNameClauseLookupFactory.getFactory()
dncl = dnclFactory.createDataNameClauseLookup(m_strLookupTablesPath, False)
End If
dlc.setRecuse(m_blnRecuse)
lstDNtoTest.AddRange(dlc.getLayerDataNamesList(dncl))
'''''''''''''''''''
'' Third loop through IDataName details
'''''''''''''''''''
For Each dnCurrent In lstDNtoTest
'todo MEDIUM: Rewrite the way that the names are tested in the testingCommandline
lngStatus = dnCurrent.checkNameStatus()
System.Console.WriteLine()
System.Console.WriteLine("********************************************************")
System.Console.WriteLine("DATA NAME: " & dnCurrent.getNameStr())
System.Console.WriteLine("********************************************************")
System.Console.Write(DataNameStringFormater.getDataNamingStatusMessage(lngStatus))
Next
End If
Catch ex As Exception
System.Console.WriteLine(ex.ToString())
System.Console.WriteLine("Test commandline ended with error")
End Try
End Sub
Private Sub printUnregconisedArgs()
Dim stb As New System.Text.StringBuilder
stb.AppendLine()
stb.AppendLine("Unregconised Arguments:")
stb.AppendFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9}", My.Application.CommandLineArgs)
System.Console.Write(stb.ToString())
printUsageMessage()
End Sub
Private Sub printUsageMessage()
Dim stb As New System.Text.StringBuilder
stb.AppendLine()
stb.AppendFormat("Usage: {0}", My.Application.Info.AssemblyName)
stb.AppendLine()
stb.AppendLine()
stb.AppendFormat("{0} {{-l <path to data list> [-r|-n] [-t <path to non-default clause lookup tables>] | -v | -h | -? }}", My.Application.Info.AssemblyName)
stb.AppendLine()
stb.AppendLine()
stb.AppendLine("Options:")
stb.AppendLine(" -v Print the name and version number and quit")
stb.AppendLine(" -h or -? Print this usage message and quit")
stb.AppendLine(" -l <path to data list> Specify the path of the list of datanames to be checked. This may be an MXD file (*.mxd), " & _
"a personal GDB (*.mdb), a filebased GDB (*.gdb), a directory of shapefiles (<dir>), or an SDE connection file (*.sde)")
stb.AppendLine(" -r (default) Recuse the list if appropriate (eg for a directory)")
stb.AppendLine(" -n Do not recuse the list if appropriate (eg for a directory)")
stb.AppendLine(" -t Optional: Override the default clause table locations by speficing a location of an MDB or GDB containing the " & _
"clause tables. If this option is not specified then the program will attempt to automatically detrive their location. " & _
"If they cannot be automatically located then the program will quit with an error.")
System.Console.Write(stb.ToString())
End Sub
Private Sub printNameAndVersion()
Dim stb As New System.Text.StringBuilder
stb.AppendLine()
stb.AppendFormat("{0} version {1}", My.Application.Info.AssemblyName, My.Application.Info.Version)
stb.AppendLine()
System.Console.Write(stb.ToString())
End Sub
End Module
| Java |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
namespace Admin.Models
{
public class FacilityClient
{
//private string BASE_URL = "http://ihmwcore.azurewebsites.net/api/";
private string BASE_URL = "http://localhost:52249/api/";
public IEnumerable<Facility> findAll()
{
try
{
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(BASE_URL);
client.DefaultRequestHeaders.Accept.Add(
new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = client.GetAsync("Facility").Result;
if (response.IsSuccessStatusCode)
{
return response.Content.ReadAsAsync<IEnumerable<Facility>>().Result;
}
else
{
return null;
}
}
catch
{
return null;
}
}
public Facility find(int id)
{
try
{
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(BASE_URL);
client.DefaultRequestHeaders.Accept.Add(
new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = client.GetAsync("Facility/" + id).Result;
if (response.IsSuccessStatusCode)
{
return response.Content.ReadAsAsync<Facility>().Result;
}
else
{
return null;
}
}
catch
{
return null;
}
}
public bool Create(Facility Facility)
{
try
{
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(BASE_URL);
client.DefaultRequestHeaders.Accept.Add(
new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = client.PostAsJsonAsync("Facility", Facility).Result;
return response.IsSuccessStatusCode;
}
catch
{
return false;
}
}
public bool Edit(Facility Facility)
{
try
{
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(BASE_URL);
client.DefaultRequestHeaders.Accept.Add(
new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = client.PutAsJsonAsync("Facility/" + Facility.facilityNumber, Facility).Result;
return response.IsSuccessStatusCode;
}
catch
{
return false;
}
}
public bool Delete(int id)
{
try
{
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(BASE_URL);
client.DefaultRequestHeaders.Accept.Add(
new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = client.DeleteAsync("Facility/" + id).Result;
return response.IsSuccessStatusCode;
}
catch
{
return false;
}
}
}
} | Java |
/*
This file is part of Darling.
Copyright (C) 2019 Lubos Dolezel
Darling is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Darling is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Darling. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Foundation/Foundation.h>
@interface MDLMemoryMappedData : NSObject
@end
| Java |
/*
* Copyright © 2004 Noah Levitt
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* MucharmapSearchDialog handles all aspects of searching */
#ifndef MUCHARMAP_SEARCH_DIALOG_H
#define MUCHARMAP_SEARCH_DIALOG_H
#include <gtk/gtk.h>
#include <mucharmap/mucharmap.h>
#include "mucharmap-window.h"
G_BEGIN_DECLS
//class MucharmapSearchDialog
//{
#define MUCHARMAP_TYPE_SEARCH_DIALOG (mucharmap_search_dialog_get_type ())
#define MUCHARMAP_SEARCH_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MUCHARMAP_TYPE_SEARCH_DIALOG, MucharmapSearchDialog))
#define MUCHARMAP_SEARCH_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MUCHARMAP_TYPE_SEARCH_DIALOG, MucharmapSearchDialogClass))
#define MUCHARMAP_IS_SEARCH_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MUCHARMAP_TYPE_SEARCH_DIALOG))
#define MUCHARMAP_IS_SEARCH_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MUCHARMAP_TYPE_SEARCH_DIALOG))
#define MUCHARMAP_SEARCH_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MUCHARMAP_TYPE_SEARCH_DIALOG, MucharmapSearchDialogClass))
typedef struct _MucharmapSearchDialog MucharmapSearchDialog;
typedef struct _MucharmapSearchDialogClass MucharmapSearchDialogClass;
struct _MucharmapSearchDialog
{
GtkDialog parent;
};
struct _MucharmapSearchDialogClass
{
GtkDialogClass parent_class;
/* signals */
void (* search_start) (void);
void (* search_finish) (gunichar found_char);
};
typedef enum
{
MUCHARMAP_DIRECTION_BACKWARD = -1,
MUCHARMAP_DIRECTION_FORWARD = 1
}
MucharmapDirection;
GType mucharmap_search_dialog_get_type (void);
GtkWidget * mucharmap_search_dialog_new (MucharmapWindow *parent);
void mucharmap_search_dialog_present (MucharmapSearchDialog *search_dialog);
void mucharmap_search_dialog_start_search (MucharmapSearchDialog *search_dialog,
MucharmapDirection direction);
gdouble mucharmap_search_dialog_get_completed (MucharmapSearchDialog *search_dialog);
//}
G_END_DECLS
#endif /* #ifndef MUCHARMAP_SEARCH_DIALOG_H */
| Java |
#include "XmlSerializer.h"
namespace dnc {
namespace Xml {
XmlSerializer::XmlSerializer() {}
XmlSerializer::~XmlSerializer() {}
std::string XmlSerializer::ToString() {
return std::string("System.Xml.XmlSerializer");
}
std::string XmlSerializer::GetTypeString() {
return std::string("XmlSerializer");
}
String XmlSerializer::ToXml(Serializable* obj, Collections::Generic::List<unsigned long long>& _childPtrs) {
unsigned long long hash = 0;
String res;
size_t len;
//Serializable* seri = nullptr;
/*if(std::is_same<T, Serializable*>::value) {
seri = (Serializable*) obj;
} else {
seri = static_cast<Serializable*>(&obj);
}*/
len = obj->AttrLen();
res = "<" + obj->Name() + " ID=\"" + obj->getHashCode() + "\">";
for(size_t i = 0; i < len; i++) {
SerializableAttribute& t = obj->Attribute(i);
// Get Values
String attrName = t.AttributeName();
Object& val = t.Member();
// Check Serializable
Serializable* child = dynamic_cast<Serializable*>(&val);
if(child == nullptr) {
// Just serialize
res += "<" + attrName + " type=\"" + val.GetTypeString() + "\">";
res += val.ToString();
res += "</" + attrName + ">";
} else {
// Is Serializable
hash = child->getHashCode();
if(_childPtrs.Contains(hash)) {
// Just add a reference
res += "<" + attrName + " ref=\"" + hash + "\"/>";
} else {
// Call serialize
_childPtrs.Add(hash);
res += "<" + attrName + " type=\"" + val.GetTypeString() + "\">";
res += ToXml(child, _childPtrs);
res += "</" + attrName + ">";
}
}
}
res += "</" + obj->Name() + ">\r\n";
return res;
}
}
} | Java |
package org.hl7.v3;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
/**
* <p>AgeDetectedIssueCodeのJavaクラス。
*
* <p>次のスキーマ・フラグメントは、このクラス内に含まれる予期されるコンテンツを指定します。
* <p>
* <pre>
* <simpleType name="AgeDetectedIssueCode">
* <restriction base="{urn:hl7-org:v3}cs">
* <enumeration value="AGE"/>
* <enumeration value="DOSEHINDA"/>
* <enumeration value="DOSELINDA"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "AgeDetectedIssueCode")
@XmlEnum
public enum AgeDetectedIssueCode {
AGE,
DOSEHINDA,
DOSELINDA;
public String value() {
return name();
}
public static AgeDetectedIssueCode fromValue(String v) {
return valueOf(v);
}
}
| Java |
---
title: Puppet ça pête !
author: Deimos
type: post
date: 2010-06-24T14:50:45+00:00
url: /2010/06/24/puppet-ca-pete/
image: /images/Puppet-short.png
thumbnailImage: /thumbnails/Puppet-short.png
thumbnailImagePosition: left
categories:
- Developement
- Hi-Tech
- Linux
- OpenBSD
- Solaris
tags:
- Developement
- Hi-Tech
- Linux
- OpenBSD
- Solaris
---

Et bah voilà ! Ca y est je vais passer mon puppet en prod au taf. Franchement c'est vraiment bien. Très long à mettre en place mais pour après arrêter les taches répétitives sur les serveurs ! Ça vaut le coup surtout si on a une belle ferme de machines.
J'ai donc prévu [une petite doc](http://wiki.deimos.fr/Puppet_:_Solution_de_gestion_de_fichier_de_configuration) à cet effet pour ceux que ça intéresse. J'ai été aidé de Luc (un presta qui depuis a fait quelques commentaires sur le blog) et ai enrichi un peu le tout.
Avec les besoins de ma boite, j'ai du développer un petit truc permettant de faire du push "easy" avec Puppet. J'ai donc développé [puppet_push](http://www.deimos.fr/gitweb/?p=puppet_push.git;a=tree) qui est encore en phase bêta mais qui fonctionne plutôt pas mal pour le moment.
Hier j'ai eu quelques mails houleux avec Nico (un mec du GCU) se plaignant de ne pas assez le citer lorsque je lui prenais des infos sur son blog. Donc on va la faire officielle : MERCI NICO !
| Java |
<?php
/**
* @package Arastta eCommerce
* @copyright Copyright (C) 2015 Arastta Association. All rights reserved. (arastta.org)
* @license GNU General Public License version 3; see LICENSE.txt
*/
// Heading
$_['heading_title'] = 'Produktegenskaper - Grupper';
// Text
$_['text_success'] = 'Endringer ble vellykket lagret.';
$_['text_list'] = 'Liste';
$_['text_add'] = 'Legg til';
$_['text_edit'] = 'Endre';
// Column
$_['column_name'] = 'Navn';
$_['column_sort_order'] = 'Sortering';
$_['column_action'] = 'Valg';
// Entry
$_['entry_name'] = 'Navn';
$_['entry_sort_order'] = 'Sortering';
// Error
$_['error_permission'] = 'Du har ikke rettigheter til å utføre valgte handling.';
$_['error_name'] = 'Navn må inneholde mellom 3 og 64 tegn.';
$_['error_attribute'] = 'Denne gruppen kan ikke slettes ettersom den er tilknyttet %s produktegenskaper.';
$_['error_product'] = 'Denne gruppen kan ikke slettes ettersom den er tilknyttet %s produkter.'; | Java |
code --install-extension brian-anders.sublime-duplicate-text
code --install-extension britesnow.vscode-toggle-quotes
code --install-extension dbaeumer.vscode-eslint
code --install-extension dinhlife.gruvbox
code --install-extension eamodio.gitlens
code --install-extension editorconfig.editorconfig
code --install-extension esbenp.prettier-vscode
code --install-extension malmaud.tmux
code --install-extension marp-team.marp-vscode
code --install-extension mikestead.dotenv
code --install-extension pnp.polacode
code --install-extension sleistner.vscode-fileutils
code --install-extension wmaurer.change-case
| Java |
<?php
/**
* @package Joomla.Platform
* @subpackage Data
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* JDataSet is a collection class that allows the developer to operate on a set of JData objects as if they were in a
* typical PHP array.
*
* @since 12.3
*/
class JDataSet implements JDataDumpable, ArrayAccess, Countable, Iterator
{
/**
* The current position of the iterator.
*
* @var integer
* @since 12.3
*/
private $_current = false;
/**
* The iterator objects.
*
* @var array
* @since 12.3
*/
private $_objects = array();
/**
* The class constructor.
*
* @param array $objects An array of JData objects to bind to the data set.
*
* @since 12.3
* @throws InvalidArgumentException if an object is not an instance of JData.
*/
public function __construct(array $objects = array())
{
// Set the objects.
$this->_initialise($objects);
}
/**
* The magic call method is used to call object methods using the iterator.
*
* Example: $array = $objectList->foo('bar');
*
* The object list will iterate over its objects and see if each object has a callable 'foo' method.
* If so, it will pass the argument list and assemble any return values. If an object does not have
* a callable method no return value is recorded.
* The keys of the objects and the result array are maintained.
*
* @param string $method The name of the method called.
* @param array $arguments The arguments of the method called.
*
* @return array An array of values returned by the methods called on the objects in the data set.
*
* @since 12.3
*/
public function __call($method, $arguments = array())
{
$return = array();
// Iterate through the objects.
foreach ($this->_objects as $key => $object)
{
// Create the object callback.
$callback = array($object, $method);
// Check if the callback is callable.
if (is_callable($callback))
{
// Call the method for the object.
$return[$key] = call_user_func_array($callback, $arguments);
}
}
return $return;
}
/**
* The magic get method is used to get a list of properties from the objects in the data set.
*
* Example: $array = $dataSet->foo;
*
* This will return a column of the values of the 'foo' property in all the objects
* (or values determined by custom property setters in the individual JData's).
* The result array will contain an entry for each object in the list (compared to __call which may not).
* The keys of the objects and the result array are maintained.
*
* @param string $property The name of the data property.
*
* @return array An associative array of the values.
*
* @since 12.3
*/
public function __get($property)
{
$return = array();
// Iterate through the objects.
foreach ($this->_objects as $key => $object)
{
// Get the property.
$return[$key] = $object->$property;
}
return $return;
}
/**
* The magic isset method is used to check the state of an object property using the iterator.
*
* Example: $array = isset($objectList->foo);
*
* @param string $property The name of the property.
*
* @return boolean True if the property is set in any of the objects in the data set.
*
* @since 12.3
*/
public function __isset($property)
{
$return = array();
// Iterate through the objects.
foreach ($this->_objects as $object)
{
// Check the property.
$return[] = isset($object->$property);
}
return in_array(true, $return, true) ? true : false;
}
/**
* The magic set method is used to set an object property using the iterator.
*
* Example: $objectList->foo = 'bar';
*
* This will set the 'foo' property to 'bar' in all of the objects
* (or a value determined by custom property setters in the JData).
*
* @param string $property The name of the property.
* @param mixed $value The value to give the data property.
*
* @return void
*
* @since 12.3
*/
public function __set($property, $value)
{
// Iterate through the objects.
foreach ($this->_objects as $object)
{
// Set the property.
$object->$property = $value;
}
}
/**
* The magic unset method is used to unset an object property using the iterator.
*
* Example: unset($objectList->foo);
*
* This will unset all of the 'foo' properties in the list of JData's.
*
* @param string $property The name of the property.
*
* @return void
*
* @since 12.3
*/
public function __unset($property)
{
// Iterate through the objects.
foreach ($this->_objects as $object)
{
unset($object->$property);
}
}
/**
* Gets the number of data objects in the set.
*
* @return integer The number of objects.
*
* @since 12.3
*/
public function count()
{
return count($this->_objects);
}
/**
* Clears the objects in the data set.
*
* @return JDataSet Returns itself to allow chaining.
*
* @since 12.3
*/
public function clear()
{
$this->_objects = array();
$this->rewind();
return $this;
}
/**
* Get the current data object in the set.
*
* @return JData The current object, or false if the array is empty or the pointer is beyond the end of the elements.
*
* @since 12.3
*/
public function current()
{
return is_scalar($this->_current) ? $this->_objects[$this->_current] : false;
}
/**
* Dumps the data object in the set, recursively if appropriate.
*
* @param integer $depth The maximum depth of recursion (default = 3).
* For example, a depth of 0 will return a stdClass with all the properties in native
* form. A depth of 1 will recurse into the first level of properties only.
* @param SplObjectStorage $dumped An array of already serialized objects that is used to avoid infinite loops.
*
* @return array An associative array of the date objects in the set, dumped as a simple PHP stdClass object.
*
* @see JData::dump()
* @since 12.3
*/
public function dump($depth = 3, SplObjectStorage $dumped = null)
{
// Check if we should initialise the recursion tracker.
if ($dumped === null)
{
$dumped = new SplObjectStorage;
}
// Add this object to the dumped stack.
$dumped->attach($this);
$objects = array();
// Make sure that we have not reached our maximum depth.
if ($depth > 0)
{
// Handle JSON serialization recursively.
foreach ($this->_objects as $key => $object)
{
$objects[$key] = $object->dump($depth, $dumped);
}
}
return $objects;
}
/**
* Gets the data set in a form that can be serialised to JSON format.
*
* Note that this method will not return an associative array, otherwise it would be encoded into an object.
* JSON decoders do not consistently maintain the order of associative keys, whereas they do maintain the order of arrays.
*
* @param mixed $serialized An array of objects that have already been serialized that is used to infinite loops
* (null on first call).
*
* @return array An array that can be serialised by json_encode().
*
* @since 12.3
*/
public function jsonSerialize($serialized = null)
{
// Check if we should initialise the recursion tracker.
if ($serialized === null)
{
$serialized = array();
}
// Add this object to the serialized stack.
$serialized[] = spl_object_hash($this);
$return = array();
// Iterate through the objects.
foreach ($this->_objects as $object)
{
// Call the method for the object.
$return[] = $object->jsonSerialize($serialized);
}
return $return;
}
/**
* Gets the key of the current object in the iterator.
*
* @return scalar The object key on success; null on failure.
*
* @since 12.3
*/
public function key()
{
return $this->_current;
}
/**
* Gets the array of keys for all the objects in the iterator (emulates array_keys).
*
* @return array The array of keys
*
* @since 12.3
*/
public function keys()
{
return array_keys($this->_objects);
}
/**
* Advances the iterator to the next object in the iterator.
*
* @return void
*
* @since 12.3
*/
public function next()
{
// Get the object offsets.
$keys = $this->keys();
// Check if _current has been set to false but offsetUnset.
if ($this->_current === false && isset($keys[0]))
{
// This is a special case where offsetUnset was used in a foreach loop and the first element was unset.
$this->_current = $keys[0];
}
else
{
// Get the current key.
$position = array_search($this->_current, $keys);
// Check if there is an object after the current object.
if ($position !== false && isset($keys[$position + 1]))
{
// Get the next id.
$this->_current = $keys[$position + 1];
}
else
{
// That was the last object or the internal properties have become corrupted.
$this->_current = null;
}
}
}
/**
* Checks whether an offset exists in the iterator.
*
* @param mixed $offset The object offset.
*
* @return boolean True if the object exists, false otherwise.
*
* @since 12.3
*/
public function offsetExists($offset)
{
return isset($this->_objects[$offset]);
}
/**
* Gets an offset in the iterator.
*
* @param mixed $offset The object offset.
*
* @return JData The object if it exists, null otherwise.
*
* @since 12.3
*/
public function offsetGet($offset)
{
return isset($this->_objects[$offset]) ? $this->_objects[$offset] : null;
}
/**
* Sets an offset in the iterator.
*
* @param mixed $offset The object offset.
* @param JData $object The object object.
*
* @return void
*
* @since 12.3
* @throws InvalidArgumentException if an object is not an instance of JData.
*/
public function offsetSet($offset, $object)
{
// Check if the object is a JData object.
if (!($object instanceof JData))
{
throw new InvalidArgumentException(sprintf('%s("%s", *%s*)', __METHOD__, $offset, gettype($object)));
}
// Set the offset.
$this->_objects[$offset] = $object;
}
/**
* Unsets an offset in the iterator.
*
* @param mixed $offset The object offset.
*
* @return void
*
* @since 12.3
*/
public function offsetUnset($offset)
{
if (!$this->offsetExists($offset))
{
// Do nothing if the offset does not exist.
return;
}
// Check for special handling of unsetting the current position.
if ($offset == $this->_current)
{
// Get the current position.
$keys = $this->keys();
$position = array_search($this->_current, $keys);
// Check if there is an object before the current object.
if ($position > 0)
{
// Move the current position back one.
$this->_current = $keys[$position - 1];
}
else
{
// We are at the start of the keys AND let's assume we are in a foreach loop and `next` is going to be called.
$this->_current = false;
}
}
unset($this->_objects[$offset]);
}
/**
* Rewinds the iterator to the first object.
*
* @return void
*
* @since 12.3
*/
public function rewind()
{
// Set the current position to the first object.
if (empty($this->_objects))
{
$this->_current = false;
}
else
{
$keys = $this->keys();
$this->_current = array_shift($keys);
}
}
/**
* Validates the iterator.
*
* @return boolean True if valid, false otherwise.
*
* @since 12.3
*/
public function valid()
{
// Check the current position.
if (!is_scalar($this->_current) || !isset($this->_objects[$this->_current]))
{
return false;
}
return true;
}
/**
* Initialises the list with an array of objects.
*
* @param array $input An array of objects.
*
* @return void
*
* @since 12.3
* @throws InvalidArgumentException if an object is not an instance of JData.
*/
private function _initialise(array $input = array())
{
foreach ($input as $key => $object)
{
if (!is_null($object))
{
$this->offsetSet($key, $object);
}
}
$this->rewind();
}
}
| Java |
package medium_challenges;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
class BenderSolution {
public static void main(String args[]) {
@SuppressWarnings("resource")
Scanner in = new Scanner(System.in);
int R = in.nextInt();
int C = in.nextInt();
in.nextLine();
List<Node> teleports = new ArrayList<>();
Node start = null;
// Create (x,y) map and store starting point
char[][] map = new char[C][R];
for (int y = 0; y < R; y++) {
String row = in.nextLine();
for (int x = 0; x < C; x++){
char item = row.charAt(x);
map[x][y] = item;
if (item == '@') {
start = new Node(x,y);
}
if (item == 'T') {
teleports.add(new Node(x,y));
}
}
}
// Create new robot with map
Bender bender = new Bender(start, map, teleports);
// Limit iterations
boolean circular = false;
final int MAX_ITERATIONS = 200;
// Collect all moves.
List<String> moves = new ArrayList<>();
while (bender.alive && !circular) {
moves.add(bender.move());
circular = moves.size() > MAX_ITERATIONS;
}
// Output Result
if (circular) System.out.println("LOOP");
else {
for (String s: moves) System.out.println(s);
}
}
/** Simple object to store coordinate pair */
private static class Node {
final int x, y;
Node(int x, int y) {
this.x = x;
this.y = y;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + x;
result = prime * result + y;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Node other = (Node) obj;
if (x != other.x)
return false;
if (y != other.y)
return false;
return true;
}
}
/** Object to store state and behavior of Bender */
private static class Bender {
Node position;
char[][] map;
boolean directionToggle;
boolean alive;
Direction facing;
boolean beerToggle;
List<Node> teleports;
/** Direction enum includes the ability to find next node based on direction Bender is facing.
*/
private enum Direction {
SOUTH(0, 1), EAST(1, 0), NORTH(0, -1), WEST(-1, 0);
private int dx;
private int dy;
Direction (int dx, int dy) {
this.dx = dx;
this.dy = dy;
}
public Node newNode(Node original) {
return new Node(original.x + dx, original.y + dy);
}
public Direction nextDirection(boolean toggle) {
if (toggle) {
switch (this) {
case SOUTH: return EAST;
case EAST: return NORTH;
default: return WEST;
}
} else {
switch (this) {
case WEST: return NORTH;
case NORTH: return EAST;
default: return SOUTH;
}
}
}
}
public Bender(Node start, char[][] map, List<Node> teleports) {
this.position = start;
this.map = map;
this.alive = true;
this.facing = Direction.SOUTH;
this.directionToggle = true;
this.beerToggle = false;
this.teleports = teleports;
}
/** Updates the state of bender.
Returns direction of the move.
*/
public String move() {
char currentContent = map[position.x][position.y];
// Check for Teleporters
if (currentContent == 'T') {
position = (teleports.get(0).equals(position)) ? teleports.get(1) : teleports.get(0);
}
// Check for immediate move command
if ((""+currentContent).matches("[NESW]")) {
switch (currentContent) {
case 'N': facing = Direction.NORTH; position = facing.newNode(position); return Direction.NORTH.toString();
case 'W': facing = Direction.WEST; position = facing.newNode(position); return Direction.WEST.toString();
case 'S': facing = Direction.SOUTH; position = facing.newNode(position); return Direction.SOUTH.toString();
default: facing = Direction.EAST; position = facing.newNode(position); return Direction.EAST.toString();
}
}
// Check for inversion
if (currentContent == 'I') {
directionToggle = !directionToggle;
}
// Check for beer
if (currentContent == 'B') {
beerToggle = !beerToggle;
}
// Trial next possibility
Node trial = facing.newNode(position);
char content = map[trial.x][trial.y];
// Check if Bender dies
if (content == '$') {
alive = false;
return facing.toString();
}
// Check for beer power to remove X barrier
if (beerToggle && content == 'X') {
content = ' ';
map[trial.x][trial.y] = ' ';
}
// Check for Obstacles
boolean initialCheck = true;
while (content == 'X' || content == '#') {
// Check for obstacles
if (content == 'X' || content == '#') {
if (initialCheck) {
facing = directionToggle ? Direction.SOUTH : Direction.WEST;
initialCheck = false;
} else {
facing = facing.nextDirection(directionToggle);
}
}
// Update position and facing
trial = facing.newNode(position);
content = map[trial.x][trial.y];
}
// If we made it to this point, it's okay to move bender
position = facing.newNode(position);
if (content == '$') alive = false;
return facing.toString();
}
}
} | Java |
package me.zsj.moment.utils;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
/**
* @author zsj
*/
public class CircleTransform extends BitmapTransformation {
public CircleTransform(Context context) {
super(context);
}
@Override
protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) {
return circleCrop(pool, toTransform);
}
private static Bitmap circleCrop(BitmapPool pool, Bitmap source) {
if (source == null) return null;
int size = Math.min(source.getWidth(), source.getHeight());
int x = (source.getWidth() - size) / 2;
int y = (source.getHeight() - size) / 2;
Bitmap squared = Bitmap.createBitmap(source, x, y, size, size);
Bitmap result = pool.get(size, size, Bitmap.Config.ARGB_8888);
if (result == null) {
result = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
}
Canvas canvas = new Canvas(result);
Paint paint = new Paint();
paint.setShader(new BitmapShader(squared, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP));
paint.setAntiAlias(true);
float r = size / 2f;
canvas.drawCircle(r, r, r, paint);
squared.recycle();
return result;
}
@Override public String getId() {
return getClass().getName();
}
}
| Java |
/*
* Copyright (C)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUTDOOR_PVP_HP_
#define OUTDOOR_PVP_HP_
#include "OutdoorPvP.h"
#define OutdoorPvPHPBuffZonesNum 6
// HP, citadel, ramparts, blood furnace, shattered halls, mag's lair
const uint32 OutdoorPvPHPBuffZones[OutdoorPvPHPBuffZonesNum] = { 3483, 3563, 3562, 3713, 3714, 3836 };
enum OutdoorPvPHPSpells
{
AlliancePlayerKillReward = 32155,
HordePlayerKillReward = 32158,
AllianceBuff = 32071,
HordeBuff = 32049
};
enum OutdoorPvPHPTowerType
{
HP_TOWER_BROKEN_HILL = 0,
HP_TOWER_OVERLOOK = 1,
HP_TOWER_STADIUM = 2,
HP_TOWER_NUM = 3
};
const uint32 HP_CREDITMARKER[HP_TOWER_NUM] = {19032, 19028, 19029};
const uint32 HP_CapturePointEvent_Enter[HP_TOWER_NUM] = {11404, 11396, 11388};
const uint32 HP_CapturePointEvent_Leave[HP_TOWER_NUM] = {11403, 11395, 11387};
enum OutdoorPvPHPWorldStates
{
HP_UI_TOWER_DISPLAY_A = 0x9ba,
HP_UI_TOWER_DISPLAY_H = 0x9b9,
HP_UI_TOWER_COUNT_H = 0x9ae,
HP_UI_TOWER_COUNT_A = 0x9ac,
HP_UI_TOWER_SLIDER_N = 2475,
HP_UI_TOWER_SLIDER_POS = 2474,
HP_UI_TOWER_SLIDER_DISPLAY = 2473
};
const uint32 HP_MAP_N[HP_TOWER_NUM] = {0x9b5, 0x9b2, 0x9a8};
const uint32 HP_MAP_A[HP_TOWER_NUM] = {0x9b3, 0x9b0, 0x9a7};
const uint32 HP_MAP_H[HP_TOWER_NUM] = {0x9b4, 0x9b1, 0x9a6};
const uint32 HP_TowerArtKit_A[HP_TOWER_NUM] = {65, 62, 67};
const uint32 HP_TowerArtKit_H[HP_TOWER_NUM] = {64, 61, 68};
const uint32 HP_TowerArtKit_N[HP_TOWER_NUM] = {66, 63, 69};
const go_type HPCapturePoints[HP_TOWER_NUM] =
{
{182175, 530, -471.462f, 3451.09f, 34.6432f, 0.174533f, 0.0f, 0.0f, 0.087156f, 0.996195f}, // 0 - Broken Hill
{182174, 530, -184.889f, 3476.93f, 38.205f, -0.017453f, 0.0f, 0.0f, 0.008727f, -0.999962f}, // 1 - Overlook
{182173, 530, -290.016f, 3702.42f, 56.6729f, 0.034907f, 0.0f, 0.0f, 0.017452f, 0.999848f} // 2 - Stadium
};
const go_type HPTowerFlags[HP_TOWER_NUM] =
{
{183514, 530, -467.078f, 3528.17f, 64.7121f, 3.14159f, 0.0f, 0.0f, 1.0f, 0.0f}, // 0 broken hill
{182525, 530, -187.887f, 3459.38f, 60.0403f, -3.12414f, 0.0f, 0.0f, 0.999962f, -0.008727f}, // 1 overlook
{183515, 530, -289.610f, 3696.83f, 75.9447f, 3.12414f, 0.0f, 0.0f, 0.999962f, 0.008727f} // 2 stadium
};
class OPvPCapturePointHP : public OPvPCapturePoint
{
public:
OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType type);
void ChangeState();
void SendChangePhase();
void FillInitialWorldStates(WorldPacket & data);
// used when player is activated/inactivated in the area
bool HandlePlayerEnter(Player* player);
void HandlePlayerLeave(Player* player);
private:
OutdoorPvPHPTowerType m_TowerType;
};
class OutdoorPvPHP : public OutdoorPvP
{
public:
OutdoorPvPHP();
bool SetupOutdoorPvP();
void HandlePlayerEnterZone(Player* player, uint32 zone);
void HandlePlayerLeaveZone(Player* player, uint32 zone);
bool Update(uint32 diff);
void FillInitialWorldStates(WorldPacket &data);
void SendRemoveWorldStates(Player* player);
void HandleKillImpl(Player* player, Unit* killed);
uint32 GetAllianceTowersControlled() const;
void SetAllianceTowersControlled(uint32 count);
uint32 GetHordeTowersControlled() const;
void SetHordeTowersControlled(uint32 count);
private:
// how many towers are controlled
uint32 m_AllianceTowersControlled;
uint32 m_HordeTowersControlled;
};
#endif
| Java |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>reordc_c</TITLE>
</HEAD>
<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A name="TOP"></A>
<table style="text-align: left; margin-left: auto; margin-right: auto; width: 800px;"
border="0" cellpadding="5" cellspacing="2">
<tbody>
<tr>
<td style="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
<div align="right">
<small><small><a href="index.html">Index Page</a></small></small>
</div>
<b>reordc_c</b> </td>
</tr>
<tr>
<td style="vertical-align: top;">
<small><div align="center">
<A HREF="index.html#A">A</A>
<A HREF="index.html#B">B</A>
<A HREF="index.html#C">C</A>
<A HREF="index.html#D">D</A>
<A HREF="index.html#E">E</A>
<A HREF="index.html#F">F</A>
<A HREF="index.html#G">G</A>
<A HREF="index.html#H">H</A>
<A HREF="index.html#I">I</A>
<A HREF="index.html#J">J</A>
<A HREF="index.html#K">K</A>
<A HREF="index.html#L">L</A>
<A HREF="index.html#M">M</A>
<A HREF="index.html#N">N</A>
<A HREF="index.html#O">O</A>
<A HREF="index.html#P">P</A>
<A HREF="index.html#Q">Q</A>
<A HREF="index.html#R">R</A>
<A HREF="index.html#S">S</A>
<A HREF="index.html#T">T</A>
<A HREF="index.html#U">U</A>
<A HREF="index.html#V">V</A>
<A HREF="index.html#W">W</A>
<A HREF="index.html#X">X</A>
</div></small>
<br>
<table style="text-align: left; width: 60%; margin-left: auto; margin-right: auto;"
border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td style="width: 33%; text-align: center;">
<small>
<a href="#Procedure">Procedure<br></a>
<a href="#Abstract">Abstract<br></a>
<a href="#Required_Reading">Required_Reading<br></a>
<a href="#Keywords">Keywords<br></a>
<a href="#Brief_I/O">Brief_I/O<br></a>
<a href="#Detailed_Input">Detailed_Input<br></a>
</small>
</td>
<td style="vertical-align: top; width: 33%; text-align: center;">
<small> <a href="#Detailed_Output">Detailed_Output<br></a>
<a href="#Parameters">Parameters<br></a>
<a href="#Exceptions">Exceptions<br></a>
<a href="#Files">Files<br></a>
<a href="#Particulars">Particulars<br></a>
<a href="#Examples">Examples<br></a>
</small>
</td>
<td style="vertical-align: top; width: 33%; text-align: center;">
<small> <a href="#Restrictions">Restrictions<br></a>
<a href="#Literature_References">Literature_References<br></a>
<a href="#Author_and_Institution">Author_and_Institution<br></a>
<a href="#Version">Version<br></a>
<a href="#Index_Entries">Index_Entries<br></a>
</small>
</td>
</tr>
</tbody>
</table>
<h4><a name="Procedure">Procedure</a></h4>
<PRE>
void reordc_c ( ConstSpiceInt * iorder,
SpiceInt ndim,
SpiceInt lenvals,
void * array )
</PRE>
<h4><a name="Abstract">Abstract</a></h4>
<PRE>
Re-order the elements of an array of character strings
according to a given order vector.
</PRE>
<h4><a name="Required_Reading">Required_Reading</a></h4>
<PRE>
None.
</PRE>
<h4><a name="Keywords">Keywords</a></h4>
<PRE>
ARRAY, SORT
</PRE>
<h4><a name="Brief_I/O">Brief_I/O</a></h4>
<PRE>
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
iorder I Order vector to be used to re-order array.
ndim I Dimension of array.
lenvals I String length.
array I/O Array to be re-ordered.
</PRE>
<h4><a name="Detailed_Input">Detailed_Input</a></h4>
<PRE>
iorder is the order vector to be used to re-order the input
array. The first element of iorder is the index of
the first item of the re-ordered array, and so on.
Note that the order imposed by <b>reordc_c</b> is not the
same order that would be imposed by a sorting
routine. In general, the order vector will have
been created (by one of the order routines) for
a related array, as illustrated in the example below.
The elements of iorder range from zero to ndim-1.
ndim is the number of elements in the input array.
lenvals is the declared length of the strings in the input
string array, including null terminators. The input
array should be declared with dimension
[ndim][lenvals]
array on input, is an array containing some number of
elements in unspecified order.
</PRE>
<h4><a name="Detailed_Output">Detailed_Output</a></h4>
<PRE>
array on output, is the same array, with the elements
in re-ordered as specified by iorder.
</PRE>
<h4><a name="Parameters">Parameters</a></h4>
<PRE>
None.
</PRE>
<h4><a name="Exceptions">Exceptions</a></h4>
<PRE>
1) If the input string array pointer is null, the error
SPICE(NULLPOINTER) will be signaled.
2) If the input array string's length is less than 2, the error
SPICE(STRINGTOOSHORT) will be signaled.
3) If memory cannot be allocated to create a Fortran-style version of
the input order vector, the error SPICE(MALLOCFAILED) is signaled.
4) If ndim < 2, this routine executes a no-op. This case is
not an error.
</PRE>
<h4><a name="Files">Files</a></h4>
<PRE>
None.
</PRE>
<h4><a name="Particulars">Particulars</a></h4>
<PRE>
<b>reordc_c</b> uses a cyclical algorithm to re-order the elements of
the array in place. After re-ordering, element iorder[0] of
the input array is the first element of the output array,
element iorder[1] of the input array is the second element of
the output array, and so on.
The order vector used by <b>reordc_c</b> is typically created for
a related array by one of the order*_c routines, as shown in
the example below.
</PRE>
<h4><a name="Examples">Examples</a></h4>
<PRE>
In the following example, the order*_c and reord*_c routines are
used to sort four related arrays (containing the names,
masses, integer ID codes, and visual magnitudes for a group
of satellites). This is representative of the typical use of
these routines.
#include "SpiceUsr.h"
.
.
.
/.
Sort the object arrays by name.
./
<a href="orderc_c.html">orderc_c</a> ( namlen, names, n, iorder );
<b>reordc_c</b> ( iorder, n, namlen, names );
<a href="reordd_c.html">reordd_c</a> ( iorder, n, masses );
<a href="reordi_c.html">reordi_c</a> ( iorder, n, codes );
<a href="reordd_c.html">reordd_c</a> ( iorder, n, vmags );
</PRE>
<h4><a name="Restrictions">Restrictions</a></h4>
<PRE>
None.
</PRE>
<h4><a name="Literature_References">Literature_References</a></h4>
<PRE>
None.
</PRE>
<h4><a name="Author_and_Institution">Author_and_Institution</a></h4>
<PRE>
N.J. Bachman (JPL)
W.L. Taber (JPL)
I.M. Underwood (JPL)
</PRE>
<h4><a name="Version">Version</a></h4>
<PRE>
-CSPICE Version 1.0.0, 10-JUL-2002 (NJB) (WLT) (IMU)
</PRE>
<h4><a name="Index_Entries">Index_Entries</a></h4>
<PRE>
reorder a character array
</PRE>
</td>
</tr>
</tbody>
</table>
<pre>Tue Jul 15 14:31:41 2014</pre>
</body>
</html>
| Java |
/*
Rocrail - Model Railroad Software
Copyright (C) 2002-2014 Rob Versluis, Rocrail.net
This program is free software; you can redistribute it and/or
as published by the Free Software Foundation; either version 2
modify it under the terms of the GNU General Public License
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __bidibidentdlg__
#define __bidibidentdlg__
/**
@file
Subclass of BidibIdentDlgGen, which is generated by wxFormBuilder.
*/
#include "bidibidendlggen.h"
#include "rocs/public/node.h"
#include "rocs/public/list.h"
#include "rocs/public/map.h"
#include "rocs/public/mutex.h"
//// end generated include
/** Implementing BidibIdentDlgGen */
class BidibIdentDlg : public BidibIdentDlgGen
{
iONode node;
iONode bidibnode;
iOList nodeList;
iOMap nodeMap;
iOMap nodePathMap;
iONode m_SelectedBidibNode;
iONode m_ProductsNode;
iOMap m_ProductsMap;
int macro;
int macroline;
int macrosize;
int macrolevel;
int macroparam;
bool macrosave;
bool macroapply;
int configL;
int configR;
int configV;
int configS;
int uid;
char* www;
iOMutex servoSetMutex;
bool eventUpdate;
wxTreeItemId findTreeItem( const wxTreeItemId& root, const wxString& text);
int getLevel(const char* path, int* n, int* o, int* p, char** key, char** parentkey);
wxTreeItemId addTreeChild( const wxTreeItemId& root, iONode bidibnode);
void handleFeature(iONode node);
void clearFeatureList();
void handleMacro(iONode node);
void handleAccessory(iONode node);
iONode findNodeByUID( const char* uid);
protected:
// Handlers for BidibIdentDlgGen events.
void onClose( wxCloseEvent& event );
void onCancel( wxCommandEvent& event );
void onOK( wxCommandEvent& event );
void onHelp( wxCommandEvent& event );
void onTreeSelChanged( wxTreeEvent& event );
void onBeginDrag( wxTreeEvent& event );
void onItemActivated( wxTreeEvent& event );
void onItemRightClick( wxTreeEvent& event );
void onMenu( wxCommandEvent& event );
void onFeatureSelect( wxCommandEvent& event );
void onFeaturesGet( wxCommandEvent& event );
void onFeatureSet( wxCommandEvent& event );
void onServoLeft( wxScrollEvent& event );
void onServoRight( wxScrollEvent& event );
void onServoSpeed( wxScrollEvent& event );
void onServoPort( wxSpinEvent& event );
void onServoLeftTest( wxCommandEvent& event );
void onServoRightTest( wxCommandEvent& event );
void onServoGet( wxCommandEvent& event );
void onPortSet( wxCommandEvent& event );
void onConfigL( wxSpinEvent& event );
void onConfigR( wxSpinEvent& event );
void onConfigV( wxSpinEvent& event );
void onConfigS( wxSpinEvent& event );
void onServoReserved( wxScrollEvent& event );
void onPortType( wxCommandEvent& event );
void onConfigLtxt( wxCommandEvent& event );
void onConfigRtxt( wxCommandEvent& event );
void onConfigVtxt( wxCommandEvent& event );
void onConfigStxt( wxCommandEvent& event );
void onSelectUpdateFile( wxCommandEvent& event );
void onUpdateStart( wxCommandEvent& event );
void onServoSet(bool overwrite=false);
void onPageChanged( wxNotebookEvent& event );
void onMacroList( wxCommandEvent& event );
void onMacroLineSelected( wxGridEvent& event );
void onMacroApply( wxCommandEvent& event );
void onMacroReload( wxCommandEvent& event );
void onMacroSave( wxCommandEvent& event );
void onMacroEveryMinute( wxCommandEvent& event );
void onMacroExport( wxCommandEvent& event );
void onMacroImport( wxCommandEvent& event );
void onMacroSaveMacro( wxCommandEvent& event );
void onMacroDeleteMacro( wxCommandEvent& event );
void onMacroRestoreMacro( wxCommandEvent& event );
void onMacroTest( wxCommandEvent& event );
void onVendorCVEnable( wxCommandEvent& event );
void onVendorCVDisable( wxCommandEvent& event );
void onVendorCVGet( wxCommandEvent& event );
void onVendorCVSet( wxCommandEvent& event );
void onAccessoryOnTest( wxCommandEvent& event );
void onAccessoryOffTest( wxCommandEvent& event );
void onAccessoryReadOptions( wxCommandEvent& event );
void onAccessoryWriteOptions( wxCommandEvent& event );
void onAccessoryReadMacroMap( wxCommandEvent& event );
void onAccessoryWriteMacroMap( wxCommandEvent& event );
void onLeftLogo( wxMouseEvent& event );
void onProductName( wxMouseEvent& event );
int getProductID(int uid);
void onReport( wxCommandEvent& event );
void onUsernameSet( wxCommandEvent& event );
public:
/** Constructor */
BidibIdentDlg( wxWindow* parent );
//// end generated class members
BidibIdentDlg( wxWindow* parent, iONode node );
~BidibIdentDlg();
void event(iONode node);
void initLabels();
void initValues();
void initProducts();
const char* GetProductName(int vid, int pid, char** www);
};
#endif // __bidibidentdlg__
| Java |
package clientdata.visitors;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.util.HashMap;
import java.util.Map;
import org.apache.mina.core.buffer.IoBuffer;
import clientdata.VisitorInterface;
public class SlotDefinitionVisitor implements VisitorInterface {
public static class SlotDefinition {
public String slotName;
public byte global;
public byte canMod;
public byte exclusive;
public String hardpointName;
public int unk1;
}
public SlotDefinitionVisitor() {
definitions = new HashMap<String, SlotDefinition>();
}
private Map<String, SlotDefinition> definitions;
public Map<String, SlotDefinition> getDefinitions() {
return definitions;
}
@Override
public void parseData(String nodename, IoBuffer data, int depth, int size) throws Exception {
if(nodename.endsWith("DATA")) {
CharsetDecoder cd = Charset.forName("US-ASCII").newDecoder();
while(data.hasRemaining()) {
SlotDefinition next = new SlotDefinition();
next.slotName = data.getString(cd);
cd.reset();
next.global = data.get();
next.canMod = data.get();
next.exclusive = data.get();
next.hardpointName = data.getString(cd);
cd.reset();
next.unk1 = data.getInt();
definitions.put(next.slotName, next);
}
}
}
@Override
public void notifyFolder(String nodeName, int depth) throws Exception {}
}
| Java |
package fr.eurecom.senml.entity;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.Key;
@PersistenceCapable
public class ContactTest {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
@Persistent
private String firstName;
@Persistent
private String lastName;
@Persistent
private String email;
public ContactTest(String firstName, String lastName, String email) {
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
}
public String getirstName() {return firstName;}
public String getLastName() {return lastName;}
public String getEmail() {return email;}
public Key getKey() {return key;}
}
| Java |
<ion-header>
<ion-navbar color="secondary">
<button ion-button menuToggle>
<ion-icon color="primary" name="menu"></ion-icon>
</button>
<ion-title color="primary">Gourmet Calculator</ion-title>
</ion-navbar>
</ion-header>
<ion-content class="calc">
<form #calcForm="ngForm" (ngSubmit)="onSubmit()">
<ion-item padding-top class="noBg">
<ion-label color="secondary" stacked class="amountLabel">Enter the amount (x100) <span padding-left class="preview" [hidden]="!amount>0 || calcForm.form.invalid" stacked>{{amount/100 | currency:currency:true:'1.2'}}</span></ion-label>
<!-- better tel because it allows to set maxlength -->
<ion-input type="tel" pattern="[0-9]+" placeholder="2500" maxlength="4" name="amount" required [(ngModel)]="amount" (ngModelChange)="amountChange($event)" [disabled]="gotResults"></ion-input>
</ion-item>
<ion-item text-center class="noBg" [hidden]="gotResults">
<button type="submit" ion-button large [outline]="calcForm.form.invalid" [disabled]="calcForm.form.invalid || isLoading" color="light">
<ion-icon padding-right name="calculator" [hidden]="isLoading" ></ion-icon>
<ion-spinner padding-right [hidden]="!isLoading" ></ion-spinner>
Calc
</button>
</ion-item>
</form>
<div padding *ngIf="gotResults">
<ion-list-header no-margin class="noBg">
Option 1 <ion-icon name="arrow-down" color="warning"></ion-icon>
</ion-list-header>
<ion-item padding class="semiBg calcResults">
<ion-label no-margin color="secondary" stacked>{{results.Option1Ticket1}} x {{ticket1/100 | currency:currency:true:'1.2'}}</ion-label>
<ion-label color="secondary" stacked>{{results.Option1Ticket2}} x {{ticket2/100 | currency:currency:true:'1.2'}}</ion-label>
<ion-label color="light" stacked>To pay: {{results.Option1Cash/100 | currency:currency:true:'1.2'}}</ion-label>
</ion-item>
<ion-list-header no-margin class="noBg">
Option 2 <ion-icon name="arrow-up" color="warning"></ion-icon>
</ion-list-header>
<ion-item padding class="semiBg calcResults">
<ion-label no-margin color="secondary" stacked>{{results.Option2Ticket1}} x {{ticket1/100 | currency:currency:true:'1.2'}}</ion-label>
<ion-label color="secondary" stacked>{{results.Option2Ticket2}} x {{ticket2/100 | currency:currency:true:'1.2'}}</ion-label>
<ion-label color="light" stacked>To receive: {{results.Option2Cash/100 | currency:currency:true:'1.2'}}</ion-label>
</ion-item>
<ion-item text-center padding-top class="noBg">
<button ion-button large outline (click)="reset()" [disabled]="calcForm.form.invalid" color="light">
<ion-icon padding-right name="refresh"></ion-icon> Reset
</button>
</ion-item>
</div>
<div padding *ngIf="gotFacts && !gotResults">
<ion-list-header no-margin class="noBg">
<ion-icon padding-right name="bulb" color="warning"></ion-icon> Did you know?
</ion-list-header>
<ion-item padding class="semiBg" text-wrap>
{{fact}}
</ion-item>
</div>
</ion-content>
| Java |
class CustomUrl < ActiveRecord::Base
belongs_to :media_resource
belongs_to :creator, class_name: 'User', foreign_key: :creator_id
belongs_to :updator, class_name: 'User', foreign_key: :updator_id
default_scope lambda{order(id: :asc)}
end
| Java |
package me.anthonybruno.soccerSim.team.member;
import me.anthonybruno.soccerSim.models.Range;
/**
* Player is a class that contains information about a player.
*/
public class Player extends TeamMember {
private final Range shotRange;
private final int goal;
/**
* Creates a new player with a name, shot range (how likely a shot will be attributed to the player) and a goal
* rating (how likely they are to score a goal).
*
* @param name The name of the player
* @param shotRange Shot range of player. Defines how likely a shot on goal will be attributed to this player (see
* rule files for more information. Is the maximum value when lower and upper bounds given by the
* rules.
* @param goal How likely a shot from the player will go in. When shot is taken, a number from 1-10 is generated.
* If the generated number is above or equal to goal rating, the player scores.
*/
public Player(String name, Range shotRange, int goal, int multiplier) {
super(name, multiplier);
this.shotRange = shotRange;
this.goal = goal;
}
/**
* Returns the shot range of player.
*
* @return the player's shot range.
*/
public Range getShotRange() {
return shotRange;
}
/**
* Returns the goal rating of the player.
*
* @return the player's goal range.
*/
public int getGoal() {
return goal;
}
}
| Java |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Newtonsoft.Json;
using SmartStore.Core.Infrastructure;
namespace SmartStore.Collections
{
public abstract class TreeNodeBase<T> where T : TreeNodeBase<T>
{
private T _parent;
private List<T> _children = new List<T>();
private int? _depth = null;
private int _index = -1;
protected object _id;
private IDictionary<object, TreeNodeBase<T>> _idNodeMap;
protected IDictionary<string, object> _metadata;
private readonly static ContextState<Dictionary<string, object>> _contextState = new ContextState<Dictionary<string, object>>("TreeNodeBase.ThreadMetadata");
public TreeNodeBase()
{
}
#region Id
public object Id
{
get
{
return _id;
}
set
{
_id = value;
if (_parent != null)
{
var map = GetIdNodeMap();
if (_id != null && map.ContainsKey(_id))
{
// Remove old id from map
map.Remove(_id);
}
if (value != null)
{
map[value] = this;
}
}
}
}
public T SelectNodeById(object id)
{
if (id == null || IsLeaf)
return null;
var map = GetIdNodeMap();
var node = (T)map?.Get(id);
if (node != null && !this.IsAncestorOfOrSelf(node))
{
// Found node is NOT a child of this node
return null;
}
return node;
}
private IDictionary<object, TreeNodeBase<T>> GetIdNodeMap()
{
var map = this.Root._idNodeMap;
if (map == null)
{
map = this.Root._idNodeMap = new Dictionary<object, TreeNodeBase<T>>();
}
return map;
}
#endregion
#region Metadata
public IDictionary<string, object> Metadata
{
get
{
return _metadata ?? (_metadata = new Dictionary<string, object>());
}
set
{
_metadata = value;
}
}
public void SetMetadata(string key, object value)
{
Guard.NotEmpty(key, nameof(key));
Metadata[key] = value;
}
public void SetThreadMetadata(string key, object value)
{
Guard.NotEmpty(key, nameof(key));
var state = _contextState.GetState();
if (state == null)
{
state = new Dictionary<string, object>();
_contextState.SetState(state);
}
state[GetContextKey(this, key)] = value;
}
public TMetadata GetMetadata<TMetadata>(string key, bool recursive = true)
{
Guard.NotEmpty(key, nameof(key));
object metadata;
if (!recursive)
{
return TryGetMetadataForNode(this, key, out metadata) ? (TMetadata)metadata : default(TMetadata);
}
// recursively search for the metadata value in current node and ancestors
var current = this;
while (!TryGetMetadataForNode(current, key, out metadata))
{
current = current.Parent;
if (current == null)
break;
}
if (metadata != null)
{
return (TMetadata)metadata;
}
return default(TMetadata);
}
private bool TryGetMetadataForNode(TreeNodeBase<T> node, string key, out object metadata)
{
metadata = null;
var state = _contextState.GetState();
if (state != null)
{
var contextKey = GetContextKey(node, key);
if (state.ContainsKey(contextKey))
{
metadata = state[contextKey];
return true;
}
}
if (node._metadata != null && node._metadata.ContainsKey(key))
{
metadata = node._metadata[key];
return true;
}
return false;
}
private static string GetContextKey(TreeNodeBase<T> node, string key)
{
return node.GetHashCode().ToString() + key;
}
#endregion
private List<T> ChildrenInternal
{
get
{
if (_children == null)
{
_children = new List<T>();
}
return _children;
}
}
private void AddChild(T node, bool clone, bool append = true)
{
var newNode = node;
if (clone)
{
newNode = node.Clone(true);
}
newNode.AttachTo((T)this, append ? (int?)null : 0);
}
private void AttachTo(T newParent, int? index)
{
Guard.NotNull(newParent, nameof(newParent));
var prevParent = _parent;
if (_parent != null)
{
// Detach from parent
_parent.Remove((T)this);
}
if (index == null)
{
newParent.ChildrenInternal.Add((T)this);
_index = newParent.ChildrenInternal.Count - 1;
}
else
{
newParent.ChildrenInternal.Insert(index.Value, (T)this);
_index = index.Value;
FixIndexes(newParent._children, _index + 1, 1);
}
_parent = newParent;
FixIdNodeMap(prevParent, newParent);
}
/// <summary>
/// Responsible for propagating node ids when detaching/attaching nodes
/// </summary>
private void FixIdNodeMap(T prevParent, T newParent)
{
ICollection<TreeNodeBase<T>> keyedNodes = null;
if (prevParent != null)
{
// A node is moved. We need to detach first.
keyedNodes = new List<TreeNodeBase<T>>();
// Detach ids from prev map
var prevMap = prevParent.GetIdNodeMap();
Traverse(x =>
{
// Collect all child node's ids
if (x._id != null)
{
keyedNodes.Add(x);
if (prevMap.ContainsKey(x._id))
{
// Remove from map
prevMap.Remove(x._id);
}
}
}, true);
}
if (keyedNodes == null && _idNodeMap != null)
{
// An orphan/root node is attached
keyedNodes = _idNodeMap.Values;
}
if (newParent != null)
{
// Get new *root map
var map = newParent.GetIdNodeMap();
// Merge *this map with *root map
if (keyedNodes != null)
{
foreach (var node in keyedNodes)
{
map[node._id] = node;
}
// Get rid of *this map after memorizing keyed nodes
if (_idNodeMap != null)
{
_idNodeMap.Clear();
_idNodeMap = null;
}
}
if (prevParent == null && _id != null)
{
// When *this was a root, but is keyed, then *this id
// was most likely missing in the prev id-node-map.
map[_id] = (T)this;
}
}
}
[JsonIgnore]
public T Parent
{
get
{
return _parent;
}
}
public T this[int i]
{
get
{
return _children?[i];
}
}
public IReadOnlyList<T> Children
{
get
{
return ChildrenInternal;
}
}
[JsonIgnore]
public IEnumerable<T> LeafNodes
{
get
{
return _children != null
? _children.Where(x => x.IsLeaf)
: Enumerable.Empty<T>();
}
}
[JsonIgnore]
public IEnumerable<T> NonLeafNodes
{
get
{
return _children != null
? _children.Where(x => !x.IsLeaf)
: Enumerable.Empty<T>();
}
}
[JsonIgnore]
public T FirstChild
{
get
{
return _children?.FirstOrDefault();
}
}
[JsonIgnore]
public T LastChild
{
get
{
return _children?.LastOrDefault();
}
}
[JsonIgnore]
public bool IsLeaf
{
get
{
return _children == null || _children.Count == 0;
}
}
[JsonIgnore]
public bool HasChildren
{
get
{
return _children == null || _children.Count > 0;
}
}
[JsonIgnore]
public bool IsRoot
{
get
{
return _parent == null;
}
}
[JsonIgnore]
public int Index
{
get
{
return _index;
}
}
/// <summary>
/// Root starts with 0
/// </summary>
[JsonIgnore]
public int Depth
{
get
{
if (!_depth.HasValue)
{
var node = this;
int depth = 0;
while (node != null && !node.IsRoot)
{
depth++;
node = node.Parent;
}
_depth = depth;
}
return _depth.Value;
}
}
[JsonIgnore]
public T Root
{
get
{
var root = this;
while (root._parent != null)
{
root = root._parent;
}
return (T)root;
}
}
[JsonIgnore]
public T First
{
get
{
return _parent?._children?.FirstOrDefault();
}
}
[JsonIgnore]
public T Last
{
get
{
return _parent?._children?.LastOrDefault();
}
}
[JsonIgnore]
public T Next
{
get
{
return _parent?._children?.ElementAtOrDefault(_index + 1);
}
}
[JsonIgnore]
public T Previous
{
get
{
return _parent?._children?.ElementAtOrDefault(_index - 1);
}
}
public bool IsDescendantOf(T node)
{
var parent = _parent;
while (parent != null)
{
if (parent == node)
{
return true;
}
parent = parent._parent;
}
return false;
}
public bool IsDescendantOfOrSelf(T node)
{
if (node == (T)this)
return true;
return IsDescendantOf(node);
}
public bool IsAncestorOf(T node)
{
return node.IsDescendantOf((T)this);
}
public bool IsAncestorOfOrSelf(T node)
{
if (node == (T)this)
return true;
return node.IsDescendantOf((T)this);
}
[JsonIgnore]
public IEnumerable<T> Trail
{
get
{
var trail = new List<T>();
var node = (T)this;
do
{
trail.Insert(0, node);
node = node._parent;
} while (node != null);
return trail;
}
}
/// <summary>
/// Gets the first element that matches the predicate by testing the node itself
/// and traversing up through its ancestors in the tree.
/// </summary>
/// <param name="predicate">predicate</param>
/// <returns>The closest node</returns>
public T Closest(Expression<Func<T, bool>> predicate)
{
Guard.NotNull(predicate, nameof(predicate));
var test = predicate.Compile();
if (test((T)this))
{
return (T)this;
}
var parent = _parent;
while (parent != null)
{
if (test(parent))
{
return parent;
}
parent = parent._parent;
}
return null;
}
public T Append(T value)
{
this.AddChild(value, false, true);
return value;
}
public void AppendRange(IEnumerable<T> values)
{
values.Each(x => Append(x));
}
public void AppendChildrenOf(T node)
{
if (node?._children != null)
{
node._children.Each(x => this.AddChild(x, true, true));
}
}
public T Prepend(T value)
{
this.AddChild(value, false, false);
return value;
}
public void InsertAfter(int index)
{
var refNode = _children?.ElementAtOrDefault(index);
if (refNode != null)
{
InsertAfter(refNode);
}
throw new ArgumentOutOfRangeException(nameof(index));
}
public void InsertAfter(T refNode)
{
this.Insert(refNode, true);
}
public void InsertBefore(int index)
{
var refNode = _children?.ElementAtOrDefault(index);
if (refNode != null)
{
InsertBefore(refNode);
}
throw new ArgumentOutOfRangeException(nameof(index));
}
public void InsertBefore(T refNode)
{
this.Insert(refNode, false);
}
private void Insert(T refNode, bool after)
{
Guard.NotNull(refNode, nameof(refNode));
var refParent = refNode._parent;
if (refParent == null)
{
throw Error.Argument("refNode", "The reference node cannot be a root node and must be attached to the tree.");
}
AttachTo(refParent, refNode._index + (after ? 1 : 0));
}
public T SelectNode(Expression<Func<T, bool>> predicate, bool includeSelf = false)
{
Guard.NotNull(predicate, nameof(predicate));
return this.FlattenNodes(predicate, includeSelf).FirstOrDefault();
}
/// <summary>
/// Selects all nodes (recursively) witch match the given <c>predicate</c>
/// </summary>
/// <param name="predicate">The predicate to match against</param>
/// <returns>A readonly collection of node matches</returns>
public IEnumerable<T> SelectNodes(Expression<Func<T, bool>> predicate, bool includeSelf = false)
{
Guard.NotNull(predicate, nameof(predicate));
return this.FlattenNodes(predicate, includeSelf);
}
private void FixIndexes(IList<T> list, int startIndex, int summand = 1)
{
if (startIndex < 0 || startIndex >= list.Count)
return;
for (var i = startIndex; i < list.Count; i++)
{
list[i]._index += summand;
}
}
public void Remove(T node)
{
Guard.NotNull(node, nameof(node));
if (!node.IsRoot)
{
var list = node._parent?._children;
if (list.Remove(node))
{
node.FixIdNodeMap(node._parent, null);
FixIndexes(list, node._index, -1);
node._index = -1;
node._parent = null;
node.Traverse(x => x._depth = null, true);
}
}
}
public void Clear()
{
Traverse(x => x._depth = null, false);
if (_children != null)
{
_children.Clear();
}
FixIdNodeMap(_parent, null);
}
public void Traverse(Action<T> action, bool includeSelf = false)
{
Guard.NotNull(action, nameof(action));
if (includeSelf)
action((T)this);
if (_children != null)
{
foreach (var child in _children)
child.Traverse(action, true);
}
}
public void TraverseParents(Action<T> action, bool includeSelf = false)
{
Guard.NotNull(action, nameof(action));
if (includeSelf)
action((T)this);
var parent = _parent;
while (parent != null)
{
action(parent);
parent = parent._parent;
}
}
public IEnumerable<T> FlattenNodes(bool includeSelf = true)
{
return this.FlattenNodes(null, includeSelf);
}
protected IEnumerable<T> FlattenNodes(Expression<Func<T, bool>> predicate, bool includeSelf = true)
{
IEnumerable<T> list;
if (includeSelf)
{
list = new[] { (T)this };
}
else
{
list = Enumerable.Empty<T>();
}
if (_children == null)
return list;
var result = list.Union(_children.SelectMany(x => x.FlattenNodes()));
if (predicate != null)
{
result = result.Where(predicate.Compile());
}
return result;
}
public T Clone()
{
return Clone(true);
}
public virtual T Clone(bool deep)
{
var clone = CreateInstance();
if (deep)
{
clone.AppendChildrenOf((T)this);
}
return clone;
}
protected abstract T CreateInstance();
}
}
| Java |
package vizardous.delegate.dataFilter;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import vizardous.util.Converter;
/**
* Filter class that provides filter functionality for data structures with comparable content
*
* @author Johannes Seiffarth <j.seiffarth@fz-juelich.de>
*/
public class ComparableFilter {
/**
* Filters a map. All values (not keys!) that equal kick will be removed
* @param map to filter
* @param kick Value to kick out
*/
public static <T extends Comparable<T>, K> void filter(Map<K,T> map, T kick) {
Set<Map.Entry<K, T>> entrySet = map.entrySet();
for(Iterator<Map.Entry<K,T>> it = entrySet.iterator(); it.hasNext();) {
Map.Entry<K, T> entry = it.next();
if(entry.getValue().equals(kick))
it.remove();
}
}
/**
* Filters a list. All values that equal kick will be removed
* @param list to filter
* @param kick Value to kick out
* @return a reference to list (no new list!)
*/
public static <T extends Comparable<T>> List<T> filter(List<T> list, T kick) {
for(Iterator<T> it = list.iterator(); it.hasNext();) {
T val = it.next();
if(val.equals(kick))
it.remove();
}
return list;
}
/**
* Filters a double array. All values that equal kick will be removed
* @param data array to filter
* @param kick Value to kick out
* @return a new filtered array
*/
public static double[] filter(double[] data, double kick) {
LinkedList<Double> list = new LinkedList<Double>();
for(double value : data) {
if(value != kick)
list.add(value);
}
return Converter.listToArray(list);
}
}
| Java |
/*++
Copyright (c) 2008 Microsoft Corporation
Module Name:
ast_smt_pp.h
Abstract:
Pretty printer of AST formulas as SMT benchmarks.
Author:
Nikolaj Bjorner 2008-04-09.
Revision History:
--*/
#ifndef _AST_SMT_PP_H_
#define _AST_SMT_PP_H_
#include"ast.h"
#include<string>
#include"map.h"
class smt_renaming {
typedef map<symbol, symbol, symbol_hash_proc, symbol_eq_proc> symbol2symbol;
symbol2symbol m_translate;
symbol2symbol m_rev_translate;
symbol fix_symbol(symbol s, int k);
bool is_legal(char c);
bool is_special(char const* s);
bool is_numerical(char const* s);
bool all_is_legal(char const* s);
public:
smt_renaming();
symbol get_symbol(symbol s0);
symbol operator()(symbol const & s) { return get_symbol(s); }
};
class ast_smt_pp {
public:
class is_declared {
public:
virtual bool operator()(func_decl* d) const { return false; }
virtual bool operator()(sort* s) const { return false; }
};
private:
ast_manager& m_manager;
expr_ref_vector m_assumptions;
expr_ref_vector m_assumptions_star;
symbol m_benchmark_name;
symbol m_source_info;
symbol m_status;
symbol m_category;
symbol m_logic;
std::string m_attributes;
family_id m_dt_fid;
is_declared m_is_declared_default;
is_declared* m_is_declared;
bool m_simplify_implies;
public:
ast_smt_pp(ast_manager& m);
void set_benchmark_name(const char* bn) { if (bn) m_benchmark_name = bn; }
void set_source_info(const char* si) { if (si) m_source_info = si; }
void set_status(const char* s) { if (s) m_status = s; }
void set_category(const char* c) { if (c) m_category = c; }
void set_logic(const char* l) { if (l) m_logic = l; }
void add_attributes(const char* s) { if (s) m_attributes += s; }
void add_assumption(expr* n) { m_assumptions.push_back(n); }
void add_assumption_star(expr* n) { m_assumptions_star.push_back(n); }
void set_simplify_implies(bool f) { m_simplify_implies = f; }
void set_is_declared(is_declared* id) { m_is_declared = id; }
void display(std::ostream& strm, expr* n);
void display_smt2(std::ostream& strm, expr* n);
void display_expr(std::ostream& strm, expr* n);
void display_expr_smt2(std::ostream& strm, expr* n, unsigned indent = 0, unsigned num_var_names = 0, char const* const* var_names = 0);
};
struct mk_smt_pp {
expr * m_expr;
ast_manager& m_manager;
unsigned m_indent;
unsigned m_num_var_names;
char const* const* m_var_names;
mk_smt_pp(expr* e, ast_manager & m, unsigned indent = 0, unsigned num_var_names = 0, char const* const* var_names = 0) :
m_expr(e), m_manager(m), m_indent(indent), m_num_var_names(num_var_names), m_var_names(var_names) {}
};
inline std::ostream& operator<<(std::ostream& out, const mk_smt_pp & p) {
ast_smt_pp pp(p.m_manager);
pp.display_expr_smt2(out, p.m_expr, p.m_indent, p.m_num_var_names, p.m_var_names);
return out;
}
#endif
| Java |
#!/bin/bash
set -e
echo "$(whoami)"
if [ "$(whoami)" == "root" ]; then
chown -R scrapy:scrapy /home/scrapy/backup
chown --dereference scrapy "/proc/$$/fd/1" "/proc/$$/fd/2" || :
exec gosu scrapy "$@"
fi | Java |
<!DOCTYPE html>
<html>
<head>
<title>!AntiShout demo</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
</head>
<body>
<form action="/">
<p>
<label>Type: text</label>
<input type="text" placeholder="Try me">
</p>
<p>
<label>Textarea</label>
<textarea placeholder="And me too"></textarea>
</p>
<div class="message"></div>
<button type="submit" disabled>send</button>
</form>
<!-- load scripts -->
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'></script>
<script src="antishout.js"></script>
<!-- antishout init -->
<script>
$(function(){
$('form').antishout();
});
</script>
</body>
</html>
| Java |
# Tutorials
## Table of contents
- [Make a server from scratch](https://github.com/Komrod/web-servo/blob/master/tutorials.md#make-a-server-from-scratch)
- [Create a HTTPS server](https://github.com/Komrod/web-servo/blob/master/tutorials.md#make-a-https-server)
## Make a server from scratch
Assuming you start from nothing, install Node (https://nodejs.org/en/download/) and open a console. Then create a directory for your project and install the web-servo module:
```
mkdir myProject
cd myProject
npm install web-servo
```
Create the script "server.js" to launch the server in "myProject/":
```
require('web-servo').start();
```
If you run the server now, it will show an error because the configuration is not set in the script and the server is supposed to use the file "config.json" that doesn't exist yet. It is also recommanded to create the WWW root directory and log directory so everything works fine.
```
mkdir www
mkdir log
```
Now create "config.json" in "myProject/":
```
{
"server": {
"port": "9000",
"dir": "www/"
},
"log": {
"access": {
"enabled": true,
"path": "log/access.log",
"console": true
},
"error": {
"enabled": true,
"path": "log/error.log",
"console": true,
"debug": true
}
}
}
```
In this file, we defined the server to run on port 9000 and the WWW directory to "www/". I also add the log parameters to show access and errors in the console.
If you omit a parameter in this file, it will take the default value. For example, the default page is set by default to "index.html".
Now launch the server and it should run properly:
```
node server.js
```
The console will output:
```
Using config file "C:\Users\me\git\myProject\config.json"
Using WWW directory "C:\Users\me\git\myProject\www"
Server listening on: http://localhost:9000
```
Create a simple "index.html" file and put it in "myProject/www/":
```
<!doctype html>
<html>
<head>
<title>Hello world!</title>
</head>
<body>
This is the Hello world page!
</body>
</html>
```
Now open a browser and request http://localhost:9000/ you should see the Hello world page. You can now build a whole website inside the WWW directory with images, CSS, JS ...
## Make a HTTPS server
You can run a web server over HTTPS protocol. You will need the SSL key file and the SSL certificate file.
If you want to run your server locally, you can generate those files on your computer with some commands, it will require OpenSSL installed.
### Generate local SSL files by script
There is a shell script in the root directory that can do it for you. How to use it :
```
./generateSSL.sh example/ssl/ example
```
This will generate the files in the "example/ssl/" directory.
After succefull execution, the generated files are "example/ssl/example.key" and "example/ssl/example.crt".
### Generate local SSL files manually
You can generate manually those files by typing the commands yourself. You can go to the directory you want to create the SSL files "example.crt" and "example.key".
```
cd example/ssl/
openssl genrsa -des3 -passout pass:x -out example.pass.key 2048
openssl rsa -passin pass:x -in example.pass.key -out example.key
```
You must know your local hostname or else your certificate will not work.
```
hostname
```
Your host name is the response to field Common Name (CN or FQDN).
```
openssl x509 -req -days 365 -in example.csr -signkey example.key -out example.crt
```
Cleanup temporary files.
```
rm example.pass.key example.csr
```
If everything runs properly, you now have the 2 files "example.crt" and "example.key". They are ready to use with the example HTTPS server. They must be in the directory "example/ssl/".
If you use them in another project, you can also rename them.
### Configure the server
You now have the 2 SSL files. You need to configure the files in the config file of Web-servo, it may looks like this (in config.json):
```
{
"server": {
"port": "443",
"ssl": {
"enabled": true,
"key": "ssl/example.key",
"cert": "ssl/example.crt"
}
}
}
```
If you are using the example server, the config file is already ready in "example/config_https.json".
Then, you have to run your server with a simple line in a node script.
```
require('web-servo').start();
```
The script is also ready in "example/server_https.js". You can run "node example/server_https.js".
Executing the example HTTPS server will have this result :
```
Using config file "C:\Users\PR033\git\web-servo\example\config_https.json"
Using WWW directory "C:\Users\PR033\git\web-servo\example\www"
Server listening on: https://localhost:443
```
### Finally
You can now access the server on https://localhost/. If you are using a locally generated certificate, you may have a warning because your certificate is not validated by a trusted source. But it will run properly.
Way to disable the warning:
- [For Internet Explorer](https://www.poweradmin.com/help/sslhints/ie.aspx)
- [For Chrome](https://support.google.com/chrome/answer/99020)
- [For Firefox](http://ccm.net/faq/14655-firefox-disable-warning-when-accessing-secured-sites)
If your certificate files are invalid or corrupted, there might be no errors while running the server but your browser will prevent you to process the requests.
| Java |
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: ../pdfreporter-core/src/org/oss/pdfreporter/crosstabs/fill/calculation/BucketingServiceContext.java
//
#include "J2ObjC_header.h"
#pragma push_macro("INCLUDE_ALL_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext")
#ifdef RESTRICT_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext
#define INCLUDE_ALL_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext 0
#else
#define INCLUDE_ALL_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext 1
#endif
#undef RESTRICT_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext
#if !defined (OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext_) && (INCLUDE_ALL_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext || defined(INCLUDE_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext))
#define OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext_
@class IOSObjectArray;
@protocol OrgOssPdfreporterEngineFillJRFillExpressionEvaluator;
@protocol OrgOssPdfreporterEngineJRExpression;
@protocol OrgOssPdfreporterEngineJasperReportsContext;
@protocol OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext < NSObject, JavaObject >
- (id<OrgOssPdfreporterEngineJasperReportsContext>)getJasperReportsContext;
- (id<OrgOssPdfreporterEngineFillJRFillExpressionEvaluator>)getExpressionEvaluator;
- (id)evaluateMeasuresExpressionWithOrgOssPdfreporterEngineJRExpression:(id<OrgOssPdfreporterEngineJRExpression>)expression
withOrgOssPdfreporterCrosstabsFillCalculationMeasureDefinition_MeasureValueArray:(IOSObjectArray *)measureValues;
@end
J2OBJC_EMPTY_STATIC_INIT(OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext)
J2OBJC_TYPE_LITERAL_HEADER(OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext)
#endif
#pragma pop_macro("INCLUDE_ALL_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext")
| Java |
<?php
return array(
'title' => 'Publicaciones',
'parent' => 'Contenido',
'name' => 'publicación|publicaciones',
'table' =>
array(
'id' => 'ID',
'action' => 'Acción',
'title' => 'Título',
'category_id' => 'Categoría',
'author_id' => 'Autor',
'url_alias' => 'Alias de la URL',
'author_alias' => 'Alias del autor',
'image_file' => 'Imagen',
'description' => 'Descripción',
'content' => 'Contenido',
'created_at' => 'Creado',
'status' => 'Estado',
),
);
| Java |
package com.albion.common.graph.algorithms;
import com.albion.common.graph.core.v1.Edge;
import com.albion.common.graph.core.v1.Graph;
import com.albion.common.graph.core.v1.Vertex;
import java.util.ArrayList;
import java.util.List;
public class BreathFirstSearch {
public static Vertex locate(Graph graph, Integer source, Integer target){
List<Vertex> queue = new ArrayList<>();
Vertex root = graph.getVertex(source);
queue.add(root);
while(!queue.isEmpty()){
Vertex v = queue.remove(0);
if(v.getId() == target.intValue()){
v.setVisited(true);
return v;
}
List<Edge> edgeList = v.getEdgeList();
for(Edge edge : edgeList){
int vertexId = edge.getY();
Vertex w = graph.getVerticesMap().get(vertexId);
if(w.isVisited() == false){
w.setVisited(true);
queue.add(w);
}
}
}
return null;
}
}
| Java |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Athame.PluginAPI.Service
{
/// <summary>
/// Represents a collection of items that are retrieved as pages from a service.
/// </summary>
/// <typeparam name="T">The type of each item.</typeparam>
public abstract class PagedMethod<T> : PagedList<T>
{
/// <summary>
/// Default constructor.
/// </summary>
/// <param name="itemsPerPage">The amount of items per page to load.</param>
protected PagedMethod(int itemsPerPage)
{
ItemsPerPage = itemsPerPage;
}
/// <summary>
/// Retrieves the next page asynchronously and appends the result to <see cref="AllItems"/>.
/// </summary>
/// <returns>The next page's contents.</returns>
public abstract Task<IList<T>> GetNextPageAsync();
/// <summary>
/// Retrieves each page sequentially until there are none left.
/// </summary>
public virtual async Task LoadAllPagesAsync()
{
while (HasMoreItems)
{
await GetNextPageAsync();
}
}
}
}
| Java |
namespace Animals.Animals
{
public class Kitten : Cat
{
public Kitten(string name, int age) : base(name, age, "Female")
{
}
public override string ProduceSound()
{
return "Meow";
}
}
}
| Java |
URLDetector
===========
URLDetector is an objc program that can find all parts in a string that might refer to an URL.
| Java |
// Copyright 2012 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Platform-specific code for FreeBSD goes here. For the POSIX-compatible
// parts, the implementation is in platform-posix.cc.
#include <osconfig.h>
#ifdef FreeBSD
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/ucontext.h>
#include <stdlib.h>
#include <sys/types.h> // mmap & munmap
#include <sys/mman.h> // mmap & munmap
#include <sys/stat.h> // open
#include <sys/fcntl.h> // open
#include <unistd.h> // getpagesize
// If you don't have execinfo.h then you need devel/libexecinfo from ports.
#include <strings.h> // index
#include <errno.h>
#include <stdarg.h>
#include <limits.h>
#undef MAP_TYPE
#include "v8.h"
#include "v8threads.h"
#include "platform.h"
namespace v8 {
namespace internal {
const char* OS::LocalTimezone(double time, TimezoneCache* cache) {
if (std::isnan(time)) return "";
time_t tv = static_cast<time_t>(std::floor(time/msPerSecond));
struct tm* t = localtime(&tv);
if (NULL == t) return "";
return t->tm_zone;
}
double OS::LocalTimeOffset(TimezoneCache* cache) {
time_t tv = time(NULL);
struct tm* t = localtime(&tv);
// tm_gmtoff includes any daylight savings offset, so subtract it.
return static_cast<double>(t->tm_gmtoff * msPerSecond -
(t->tm_isdst > 0 ? 3600 * msPerSecond : 0));
}
void* OS::Allocate(const size_t requested,
size_t* allocated,
bool executable) {
const size_t msize = RoundUp(requested, getpagesize());
int prot = PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0);
void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0);
if (mbase == MAP_FAILED) {
LOG(Isolate::Current(), StringEvent("OS::Allocate", "mmap failed"));
return NULL;
}
*allocated = msize;
return mbase;
}
class PosixMemoryMappedFile : public OS::MemoryMappedFile {
public:
PosixMemoryMappedFile(FILE* file, void* memory, int size)
: file_(file), memory_(memory), size_(size) { }
virtual ~PosixMemoryMappedFile();
virtual void* memory() { return memory_; }
virtual int size() { return size_; }
private:
FILE* file_;
void* memory_;
int size_;
};
OS::MemoryMappedFile* OS::MemoryMappedFile::open(const char* name) {
FILE* file = fopen(name, "r+");
if (file == NULL) return NULL;
fseek(file, 0, SEEK_END);
int size = ftell(file);
void* memory =
mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno(file), 0);
return new PosixMemoryMappedFile(file, memory, size);
}
OS::MemoryMappedFile* OS::MemoryMappedFile::create(const char* name, int size,
void* initial) {
FILE* file = fopen(name, "w+");
if (file == NULL) return NULL;
int result = fwrite(initial, size, 1, file);
if (result < 1) {
fclose(file);
return NULL;
}
void* memory =
mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno(file), 0);
return new PosixMemoryMappedFile(file, memory, size);
}
PosixMemoryMappedFile::~PosixMemoryMappedFile() {
if (memory_) munmap(memory_, size_);
fclose(file_);
}
static unsigned StringToLong(char* buffer) {
return static_cast<unsigned>(strtol(buffer, NULL, 16)); // NOLINT
}
void OS::LogSharedLibraryAddresses(Isolate* isolate) {
static const int MAP_LENGTH = 1024;
int fd = open("/proc/self/maps", O_RDONLY);
if (fd < 0) return;
while (true) {
char addr_buffer[11];
addr_buffer[0] = '0';
addr_buffer[1] = 'x';
addr_buffer[10] = 0;
int result = read(fd, addr_buffer + 2, 8);
if (result < 8) break;
unsigned start = StringToLong(addr_buffer);
result = read(fd, addr_buffer + 2, 1);
if (result < 1) break;
if (addr_buffer[2] != '-') break;
result = read(fd, addr_buffer + 2, 8);
if (result < 8) break;
unsigned end = StringToLong(addr_buffer);
char buffer[MAP_LENGTH];
int bytes_read = -1;
do {
bytes_read++;
if (bytes_read >= MAP_LENGTH - 1)
break;
result = read(fd, buffer + bytes_read, 1);
if (result < 1) break;
} while (buffer[bytes_read] != '\n');
buffer[bytes_read] = 0;
// Ignore mappings that are not executable.
if (buffer[3] != 'x') continue;
char* start_of_path = index(buffer, '/');
// There may be no filename in this line. Skip to next.
if (start_of_path == NULL) continue;
buffer[bytes_read] = 0;
LOG(isolate, SharedLibraryEvent(start_of_path, start, end));
}
close(fd);
}
void OS::SignalCodeMovingGC() {
}
// Constants used for mmap.
static const int kMmapFd = -1;
static const int kMmapFdOffset = 0;
VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { }
VirtualMemory::VirtualMemory(size_t size)
: address_(ReserveRegion(size)), size_(size) { }
VirtualMemory::VirtualMemory(size_t size, size_t alignment)
: address_(NULL), size_(0) {
ASSERT(IsAligned(alignment, static_cast<intptr_t>(OS::AllocateAlignment())));
size_t request_size = RoundUp(size + alignment,
static_cast<intptr_t>(OS::AllocateAlignment()));
void* reservation = mmap(OS::GetRandomMmapAddr(),
request_size,
PROT_NONE,
MAP_PRIVATE | MAP_ANON | MAP_NORESERVE,
kMmapFd,
kMmapFdOffset);
if (reservation == MAP_FAILED) return;
Address base = static_cast<Address>(reservation);
Address aligned_base = RoundUp(base, alignment);
ASSERT_LE(base, aligned_base);
// Unmap extra memory reserved before and after the desired block.
if (aligned_base != base) {
size_t prefix_size = static_cast<size_t>(aligned_base - base);
OS::Free(base, prefix_size);
request_size -= prefix_size;
}
size_t aligned_size = RoundUp(size, OS::AllocateAlignment());
ASSERT_LE(aligned_size, request_size);
if (aligned_size != request_size) {
size_t suffix_size = request_size - aligned_size;
OS::Free(aligned_base + aligned_size, suffix_size);
request_size -= suffix_size;
}
ASSERT(aligned_size == request_size);
address_ = static_cast<void*>(aligned_base);
size_ = aligned_size;
}
VirtualMemory::~VirtualMemory() {
if (IsReserved()) {
bool result = ReleaseRegion(address(), size());
ASSERT(result);
USE(result);
}
}
bool VirtualMemory::IsReserved() {
return address_ != NULL;
}
void VirtualMemory::Reset() {
address_ = NULL;
size_ = 0;
}
bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) {
return CommitRegion(address, size, is_executable);
}
bool VirtualMemory::Uncommit(void* address, size_t size) {
return UncommitRegion(address, size);
}
bool VirtualMemory::Guard(void* address) {
OS::Guard(address, OS::CommitPageSize());
return true;
}
void* VirtualMemory::ReserveRegion(size_t size) {
void* result = mmap(OS::GetRandomMmapAddr(),
size,
PROT_NONE,
MAP_PRIVATE | MAP_ANON | MAP_NORESERVE,
kMmapFd,
kMmapFdOffset);
if (result == MAP_FAILED) return NULL;
return result;
}
bool VirtualMemory::CommitRegion(void* base, size_t size, bool is_executable) {
int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0);
if (MAP_FAILED == mmap(base,
size,
prot,
MAP_PRIVATE | MAP_ANON | MAP_FIXED,
kMmapFd,
kMmapFdOffset)) {
return false;
}
return true;
}
bool VirtualMemory::UncommitRegion(void* base, size_t size) {
return mmap(base,
size,
PROT_NONE,
MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | MAP_FIXED,
kMmapFd,
kMmapFdOffset) != MAP_FAILED;
}
bool VirtualMemory::ReleaseRegion(void* base, size_t size) {
return munmap(base, size) == 0;
}
bool VirtualMemory::HasLazyCommits() {
// TODO(alph): implement for the platform.
return false;
}
} } // namespace v8::internal
#endif
| Java |
#! /usr/bin/env python
import logging, logtool
from .page import Page
from .xlate_frame import XlateFrame
LOG = logging.getLogger (__name__)
class Contents:
@logtool.log_call
def __init__ (self, canvas, objects):
self.canvas = canvas
self.objects = objects
@logtool.log_call
def render (self):
with Page (self.canvas) as pg:
for obj in self.objects:
coords = pg.next (obj.asset)
with XlateFrame (self.canvas, obj.tile_type, *coords,
inset_by = "margin"):
# print ("Obj: ", obj.asset)
obj.render ()
| Java |
class CfgWeapons {
// Base classes
class ItemCore;
class H_HelmetB;
class H_Cap_red;
class H_Bandanna_khk;
class rhs_booniehat2_marpatd;
// RHSSAF
class rhssaf_helmet_base : H_HelmetB{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m59_85_nocamo : rhssaf_helmet_base{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m59_85_oakleaf : rhssaf_helmet_base{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_olive_nocamo : rhssaf_helmet_base{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_olive_nocamo_black_ess : rhssaf_helmet_base{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_olive_nocamo_black_ess_bare: rhssaf_helmet_m97_olive_nocamo_black_ess{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_black_nocamo : rhssaf_helmet_m97_olive_nocamo{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_black_nocamo_black_ess : rhssaf_helmet_m97_olive_nocamo_black_ess{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_black_nocamo_black_ess_bare: rhssaf_helmet_m97_olive_nocamo_black_ess_bare{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_woodland : rhssaf_helmet_base{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_digital : rhssaf_helmet_m97_woodland{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_md2camo : rhssaf_helmet_m97_woodland{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_oakleaf : rhssaf_helmet_m97_woodland{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_nostrap_blue : rhssaf_helmet_m97_woodland{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_nostrap_blue_tan_ess : rhssaf_helmet_m97_woodland{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_nostrap_blue_tan_ess_bare : rhssaf_helmet_m97_woodland{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_woodland_black_ess : rhssaf_helmet_m97_olive_nocamo_black_ess{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_digital_black_ess : rhssaf_helmet_m97_woodland_black_ess{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_md2camo_black_ess : rhssaf_helmet_m97_woodland_black_ess{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_oakleaf_black_ess : rhssaf_helmet_m97_woodland_black_ess{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_woodland_black_ess_bare: rhssaf_helmet_m97_woodland_black_ess{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_digital_black_ess_bare : rhssaf_helmet_m97_woodland_black_ess_bare{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_md2camo_black_ess_bare : rhssaf_helmet_m97_woodland_black_ess_bare{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_oakleaf_black_ess_bare : rhssaf_helmet_m97_woodland_black_ess_bare{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_veil_Base : rhssaf_helmet_m97_woodland{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_veil_woodland : rhssaf_helmet_m97_veil_Base{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_veil_digital : rhssaf_helmet_m97_veil_Base{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_veil_md2camo : rhssaf_helmet_m97_veil_Base{
rgoc_canAcceptNVG = 1;
};
class rhssaf_helmet_m97_veil_oakleaf : rhssaf_helmet_m97_veil_Base{
rgoc_canAcceptNVG = 1;
};
class rhssaf_beret_green : rhssaf_helmet_base{
rgoc_canAcceptNVG = 0;
};
class rhssaf_beret_red : rhssaf_beret_green{
rgoc_canAcceptNVG = 0;
};
class rhssaf_beret_para : rhssaf_beret_green{
rgoc_canAcceptNVG = 0;
};
class rhssaf_beret_black : rhssaf_beret_green{
rgoc_canAcceptNVG = 0;
};
class rhssaf_beret_blue_un : rhssaf_helmet_base{
rgoc_canAcceptNVG = 0;
};
class rhssaf_booniehat_digital: rhs_booniehat2_marpatd{
rgoc_canAcceptNVG = 0;
};
class rhssaf_booniehat_md2camo: rhs_booniehat2_marpatd{
rgoc_canAcceptNVG = 0;
};
class rhssaf_booniehat_woodland: rhs_booniehat2_marpatd{
rgoc_canAcceptNVG = 0;
};
class rhssaf_bandana_digital: H_Bandanna_khk{
rgoc_canAcceptNVG = 0;
};
class rhssaf_bandana_digital_desert: rhssaf_bandana_digital{
rgoc_canAcceptNVG = 0;
};
class rhssaf_bandana_oakleaf: rhssaf_bandana_digital{
rgoc_canAcceptNVG = 0;
};
class rhssaf_bandana_smb: rhssaf_bandana_digital{
rgoc_canAcceptNVG = 0;
};
class rhssaf_bandana_md2camo: rhssaf_bandana_digital{
rgoc_canAcceptNVG = 0;
};
}; | Java |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package services;
import FareCalculator.Calculate;
import java.util.ArrayList;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.PathParam;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.lang.ClassNotFoundException;
import java.net.URI;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.QueryParam;
import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
import localstorage.FaresType;
/**
*
* @author peppa
*/
@Path("/")
public class calculatorService {
@Context
private UriInfo context;
public calculatorService(){
}
@GET
@Path("/calculate")
@Produces({"application/xml"})
public Response fareCalculator(@DefaultValue("TK") @QueryParam("carrier") String carrier,
@DefaultValue("2012-01-01") @QueryParam("date") String date,
@DefaultValue("ADB") @QueryParam("origCode") String origCode,
@DefaultValue("ESB") @QueryParam("destCode") String destCode,
@DefaultValue("Economy") @QueryParam("fareClass") String fareClass) {
Calculate cal = new Calculate();
FaresType fare = cal.fareCalculate(carrier, date, origCode, destCode, fareClass);
return Response.ok(new JAXBElement<FaresType>(new QName("faresType"), FaresType.class, fare)).build();
}
}
| Java |
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Globalization
Imports System.Resources
Imports System.Windows
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("Viewport Reporting for Revit 2015")>
<Assembly: AssemblyDescription("Viewport Reporting for Revit 2015")>
<Assembly: AssemblyCompany("Case Design, Inc.")>
<Assembly: AssemblyProduct("Viewport Reporting for Revit 2015")>
<Assembly: AssemblyCopyright("Copyright @ Case Design, Inc. 2014")>
<Assembly: AssemblyTrademark("Case Design, Inc.")>
<Assembly: ComVisible(false)>
'In order to begin building localizable applications, set
'<UICulture>CultureYouAreCodingWith</UICulture> in your .vbproj file
'inside a <PropertyGroup>. For example, if you are using US english
'in your source files, set the <UICulture> to "en-US". Then uncomment the
'NeutralResourceLanguage attribute below. Update the "en-US" in the line
'below to match the UICulture setting in the project file.
'<Assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)>
'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
'1st parameter: where theme specific resource dictionaries are located
'(used if a resource is not found in the page,
' or application resource dictionaries)
'2nd parameter: where the generic resource dictionary is located
'(used if a resource is not found in the page,
'app, and any theme specific resource dictionaries)
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("c93af61b-e349-4300-985b-fc4a99f2897a")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2014.6.2.0")>
<Assembly: AssemblyFileVersion("2014.6.2.0")>
| Java |
package xyw.ning.juicer.poco.model;
import xyw.ning.juicer.base.NoProguard;
/**
* Created by Ning-win on 2016/7/30.
*/
public class Size implements NoProguard {
public String url;
public long width;
public long height;
}
| Java |
#include <gtest/gtest.h>
#include "math/integr/WeightedIntegral.h"
#include "math/integr/IntegrationDensities.h"
#include <stdexcept>
#include <cmath>
class WeightedIntegralTest: public testing::Test
{
};
TEST_F(WeightedIntegralTest,Test)
{
rql::integr::WeightedIntegral wi(rql::integr::WeightedIntegral::gen_xs(0, 1, 100), rql::integr::IntegrationDensities::Constant(1.0));
const double integral = wi.integrate<double(*)(double)>(cos);
const double sin1 = sin(1.0);
ASSERT_NEAR(sin1, integral, 1E-5);
rql::integr::WeightedIntegral ws(rql::integr::WeightedIntegral::gen_xs(0, 1, 100), rql::integr::IntegrationDensities::Sine(2.0));
const double integral2 = ws.integrate<double(*)(double)>(cos);
const double cos1 = cos(1.0);
const double expected2 = (1-pow(cos1, 3))*2.0/3;
ASSERT_NEAR(expected2, integral2, 1E-8);
rql::integr::WeightedIntegral wc(rql::integr::WeightedIntegral::gen_xs(0, 1, 100), rql::integr::IntegrationDensities::Cosine(2.0));
const double integral3 = wc.integrate<double(*)(double)>(sin);
const double expected3 = (3*cos1 - cos(3.0)-2)/6.0;
ASSERT_NEAR(expected3, integral3, 1E-8);
}
double constant_one(double x)
{
return 1;
}
double linear(double x)
{
return x;
}
TEST_F(WeightedIntegralTest,Sine)
{
rql::integr::WeightedIntegral wu(rql::integr::WeightedIntegral::gen_xs(0, 1, 100), rql::integr::IntegrationDensities::Constant(1.0));
const double integral_u = wu.integrate<double(*)(double)>(sin);
ASSERT_NEAR(1 - cos(1.0), integral_u, 1E-5) << "unity";
rql::integr::WeightedIntegral ws(rql::integr::WeightedIntegral::gen_xs(0, 1, 100), rql::integr::IntegrationDensities::Sine(1.0));
const double integral_s = ws.integrate(constant_one);
ASSERT_NEAR(1 - cos(1.0), integral_s, 1E-10) << "sine_weight";
const double integral_linear = ws.integrate(linear);
ASSERT_NEAR(sin(1.0) - cos(1.0), integral_linear, 1E-10);
}
| Java |
/********************************************************************
* a A
* AM\/MA
* (MA:MMD
* :: VD
* :: º
* ::
* :: ** .A$MMMMND AMMMD AMMM6 MMMM MMMM6
+ 6::Z. TMMM MMMMMMMMMDA VMMMD AMMM6 MMMMMMMMM6
* 6M:AMMJMMOD V MMMA VMMMD AMMM6 MMMMMMM6
* :: TMMTMC ___MMMM VMMMMMMM6 MMMM
* MMM TMMMTTM, AMMMMMMMM VMMMMM6 MMMM
* :: MM TMMTMMMD MMMMMMMMMM MMMMMM MMMM
* :: MMMTTMMM6 MMMMMMMMMMM AMMMMMMD MMMM
* :. MMMMMM6 MMMM MMMM AMMMMMMMMD MMMM
* TTMMT MMMM MMMM AMMM6 MMMMD MMMM
* TMMMM8 MMMMMMMMMMM AMMM6 MMMMD MMMM
* TMMMMMM$ MMMM6 MMMM AMMM6 MMMMD MMMM
* TMMM MMMM
* TMMM .MMM
* TMM .MMD ARBITRARY·······XML········RENDERING
* TMM MMA ====================================
* TMN MM
* MN ZM
* MM,
*
*
* AUTHORS: see AUTHORS file
*
* COPYRIGHT: ©2019 - All Rights Reserved
*
* LICENSE: see LICENSE file
*
* WEB: http://axrproject.org
*
* THIS CODE AND INFORMATION ARE PROVIDED "AS IS"
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
* FITNESS FOR A PARTICULAR PURPOSE.
*
********************************************************************/
#ifndef HSSEVENTSELECTOR_H
#define HSSEVENTSELECTOR_H
#include "HSSNameSelector.h"
namespace AXR
{
/**
* @brief The special object \@event in HSS.
*
* Used in selector chains, returns a special object that contains
* information about an event.
*/
class AXR_API HSSEventSelector : public HSSNameSelector
{
public:
/**
* Creates a new instance of a event selector.
*/
HSSEventSelector(AXRController * controller);
/**
* Clones an instance of HSSEventSelector and gives a shared pointer of the
* newly instanciated object.
* @return A shared pointer to the new HSSEventSelector
*/
QSharedPointer<HSSEventSelector> clone() const;
//see HSSNameSelector.h for the documentation of this method
AXRString getElementName();
//see HSSParserNode.h for the documentation of this method
virtual AXRString toString();
//see HSSParserNode.h for the documentation of this method
AXRString stringRep();
QSharedPointer<HSSSelection> filterSelection(QSharedPointer<HSSSelection> scope, QSharedPointer<HSSDisplayObject> thisObj, bool processing, bool subscribingToNotifications);
private:
virtual QSharedPointer<HSSClonable> cloneImpl() const;
};
}
#endif
| Java |
/*
* Copyright (C) 2014 Matej Kormuth <http://matejkormuth.eu>
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
*/
package ts3bot.helpers;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Helper for testing method signatures.
*/
public final class MethodSignatureTester {
// Object methods.
private static final List<MethodSignature> objectMethodSignatures = new ArrayList<MethodSignatureTester.MethodSignature>();
static {
for (Method m : Object.class.getDeclaredMethods()) {
objectMethodSignatures.add(new MethodSignature(m.getName(),
m.getParameterTypes()));
}
}
/**
* Checks whether specified interface declares all of public methods implementation class declares.
*
* @param impl
* implementation class
* @param interf
* interface class
* @throws RuntimeException
* When interface does not declare public method implementation class does
*/
public static final void hasInterfAllImplPublicMethods(final Class<?> impl,
final Class<?> interf) {
List<MethodSignature> interfMethodSignatures = new ArrayList<MethodSignature>(
100);
// Generate interface method signatures.
for (Method m : interf.getDeclaredMethods()) {
// Interface has only public abstract methods.
interfMethodSignatures.add(new MethodSignature(m.getName(),
m.getParameterTypes()));
}
for (Method m : impl.getDeclaredMethods()) {
// Checking only public methods.
MethodSignature ms;
if (Modifier.isPublic(m.getModifiers())) {
// Build method signature.
ms = new MethodSignature(m.getName(), m.getParameterTypes());
// Don't check methods derived from Object.
if (!objectMethodSignatures.contains(ms)) {
// Check if interface declares it.
if (!interfMethodSignatures.contains(ms)) { throw new RuntimeException(
"Interface '" + interf.getName()
+ "' does not declare method " + ms.toString()
+ " implemented in class '" + impl.getName() + "'!"); }
}
}
}
}
/**
* Class that specified method signature in Java.
*/
private static class MethodSignature {
private final String name;
private final Class<?>[] params;
public MethodSignature(final String name, final Class<?>[] params) {
this.name = name;
this.params = params;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
result = prime * result
+ ((this.params == null) ? 0 : this.params.hashCode());
return result;
}
@Override
public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (this.getClass() != obj.getClass())
return false;
MethodSignature other = (MethodSignature) obj;
if (this.name == null) {
if (other.name != null)
return false;
}
else if (!this.name.equals(other.name))
return false;
if (this.params == null) {
if (other.params != null)
return false;
}
else if (this.params.length != other.params.length)
return false;
for (int i = 0; i < this.params.length; i++) {
if (!this.params[i].equals(other.params[i])) { return false; }
}
return true;
}
@Override
public String toString() {
return "MethodSignature [name=" + this.name + ", params="
+ Arrays.toString(this.params) + "]";
}
}
}
| Java |
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6" > <![endif]-->
<!--[if IE 7]> <html class="no-js ie7" > <![endif]-->
<!--[if IE 8]> <html class="no-js ie8" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="generator" content="pandoc" />
<meta name="description" content="Responsive Web Design" />
<meta name="author" content="Adolfo Sanz De Diego" />
<title>Responsive Web Design</title>
<!-- deck core css -->
<link rel="stylesheet" href="../lib/deck.js-master/core/deck.core.css">
<!-- deck extensions css -->
<link rel="stylesheet" href="../lib/deck.js-master/extensions/goto/deck.goto.css">
<link rel="stylesheet" href="../lib/deck.js-master/extensions/menu/deck.menu.css">
<link rel="stylesheet" href="../lib/deck.js-master/extensions/navigation/deck.navigation.css">
<link rel="stylesheet" href="../lib/deck.js-master/extensions/scale/deck.scale.css">
<link rel="stylesheet" href="../lib/deck.js-master/extensions/status/deck.status.css">
<!-- deck slide theme css -->
<link rel="stylesheet" href="../lib/deck.js-master/themes/style/web-2.0.css">
<!--
<link rel="stylesheet" href="../lib/deck.js-master/themes/style/neon.css">
<link rel="stylesheet" href="../lib/deck.js-master/themes/style/swiss.css">
<link rel="stylesheet" href="../lib/deck.js-master/themes/style/web-2.0.css">
-->
<!-- deck slide transition css -->
<link rel="stylesheet" href="../lib/deck.js-transition-cube-master/cube.css">
<!--
<link rel="stylesheet" href="../lib/deck.js-transition-cube-master/cube.css">
<link rel="stylesheet" href="../lib/deck.js-master/themes/transition/fade.css">
<link rel="stylesheet" href="../lib/deck.js-master/themes/transition/horizontal-slide.css">
<link rel="stylesheet" href="../lib/deck.js-master/themes/transition/vertical-slide.css">
-->
<!-- custom css just for this page -->
<style>
figcaption {
display: none;
visibility:hidden;
}
#titlepage, #documentauthor, #documentdate {
text-align: center;
}
#titlepage {
font-size: 5.25em;
padding-top: 15%;
}
#documentauthor {
font-size: 2.25em;
}
#documentdate {
font-size: 1.25em;
}
</style>
<!-- modernizr deck js -->
<script src="../lib/deck.js-master/modernizr.custom.js"></script>
</head>
<body class="deck-container">
<section class="slide">
<h2 id="titlepage">Responsive Web Design</h2>
<h3 id="documentauthor">Adolfo Sanz De Diego</h3>
<h4 id="documentdate">Septiembre 2014</h4>
</section>
<section id="el-autor" class="titleslide slide level1"><h1><span class="header-section-number">1</span> El autor</h1></section><section id="adolfo-sanz-de-diego" class="slide level2">
<h2><span class="header-section-number">1.1</span> Adolfo Sanz De Diego</h2>
<ul>
<li><p><strong>Antiguo programador web JEE (6 años)</strong></p></li>
<li><p>Hoy en día:</p>
<ul>
<li><strong>Profesor de FP (6 años)</strong>:
<ul>
<li>Hardware, Sistemas Operativos</li>
<li>Redes, Programación</li>
</ul></li>
<li><strong>Formador Freelance (3 años)</strong>:
<ul>
<li>Java, Android</li>
<li>JavaScript, jQuery</li>
<li>JSF, Spring, Hibernate</li>
<li>Groovy & Grails</li>
</ul></li>
</ul></li>
</ul>
</section><section id="algunos-proyectos" class="slide level2">
<h2><span class="header-section-number">1.2</span> Algunos proyectos</h2>
<ul>
<li><p>Fundador y/o creador:</p>
<ul>
<li><strong>Hackathon Lovers</strong>: <a href="http://hackathonlovers.com">http://hackathonlovers.com</a></li>
<li><strong>Tweets Sentiment</strong>: <a href="http://tweetssentiment.com">http://tweetssentiment.com</a></li>
<li><strong>MarkdownSlides</strong>: <a href="https://github.com/asanzdiego/markdownslides">https://github.com/asanzdiego/markdownslides</a></li>
</ul></li>
<li><p>Co-fundador y/o co-creador:</p>
<ul>
<li><strong>PeliTweets</strong>: <a href="http://pelitweets.com">http://pelitweets.com</a></li>
<li><strong>Password Manager Generator</strong>: <a href="http://pasmangen.github.io">http://pasmangen.github.io</a></li>
</ul></li>
</ul>
</section><section id="donde-encontrarme" class="slide level2">
<h2><span class="header-section-number">1.3</span> ¿Donde encontrarme?</h2>
<ul>
<li><p>Mi nick: <strong>asanzdiego</strong></p>
<ul>
<li>AboutMe: <a href="http://about.me/asanzdiego">http://about.me/asanzdiego</a></li>
<li>GitHub: <a href="http://github.com/asanzdiego">http://github.com/asanzdiego</a></li>
<li>Twitter: <a href="http://twitter.com/asanzdiego">http://twitter.com/asanzdiego</a></li>
<li>Blog: <a href="http://asanzdiego.blogspot.com.es">http://asanzdiego.blogspot.com.es</a></li>
<li>LinkedIn: <a href="http://www.linkedin.com/in/asanzdiego">http://www.linkedin.com/in/asanzdiego</a></li>
<li>Google+: <a href="http://plus.google.com/+AdolfoSanzDeDiego">http://plus.google.com/+AdolfoSanzDeDiego</a></li>
</ul></li>
</ul>
</section>
<section id="introducción" class="titleslide slide level1"><h1><span class="header-section-number">2</span> Introducción</h1></section><section id="esto-no-es-la-web" class="slide level2">
<h2><span class="header-section-number">2.1</span> Esto no es la web</h2>
<figure>
<img src="../img/brad_frost_1.png" alt="Esto no es la web. Fuente: bradfostweb.com" /><figcaption>Esto no es la web. Fuente: bradfostweb.com</figcaption>
</figure>
</section><section id="esto-es-la-web" class="slide level2">
<h2><span class="header-section-number">2.2</span> Esto es la web</h2>
<figure>
<img src="../img/brad_frost_2.png" alt="Esto es la web. Fuente: bradfostweb.com" /><figcaption>Esto es la web. Fuente: bradfostweb.com</figcaption>
</figure>
</section><section id="será-esto-la-web" class="slide level2">
<h2><span class="header-section-number">2.3</span> ¿Será esto la web?</h2>
<figure>
<img src="../img/brad_frost_3.png" alt="¿Será esto la web?. Fuente: bradfostweb.com" /><figcaption>¿Será esto la web?. Fuente: bradfostweb.com</figcaption>
</figure>
</section><section id="estadísticas" class="slide level2">
<h2><span class="header-section-number">2.4</span> Estadísticas</h2>
<figure>
<img src="../img/StatCounter-resolution-ww-monthly-200903-201408.jpeg" alt="Estadísticas. Fuente: gs.statcounter.com" /><figcaption>Estadísticas. Fuente: gs.statcounter.com</figcaption>
</figure>
</section><section id="el-desarrollador" class="slide level2">
<h2><span class="header-section-number">2.5</span> El desarrollador</h2>
<figure>
<img src="../img/globalmoxie.png" alt="El desarrollador atual. Fuente: globalmoxie.com" /><figcaption>El desarrollador atual. Fuente: globalmoxie.com</figcaption>
</figure>
</section><section id="responsive-web-design" class="slide level2">
<h2><span class="header-section-number">2.6</span> Responsive Web Design</h2>
<figure>
<img src="../img/rwd.png" alt="Responsive Web Design. Fuente: flickr.com/photos/zergev/" /><figcaption>Responsive Web Design. Fuente: flickr.com/photos/zergev/</figcaption>
</figure>
</section><section id="content-is-like-water" class="slide level2">
<h2><span class="header-section-number">2.7</span> Content is like water</h2>
<figure>
<img src="../img/content-is-like-water.jpg" alt="Content is like water. Fuente: fr.wikipedia.org/wiki/Site_web_adaptatif" /><figcaption>Content is like water. Fuente: fr.wikipedia.org/wiki/Site_web_adaptatif</figcaption>
</figure>
</section><section id="graceful-degradation" class="slide level2">
<h2><span class="header-section-number">2.8</span> Graceful degradation</h2>
<ul>
<li>Se <strong>desarrolla para los últimos navegadores</strong>, con la posibilidad de que funcione en navegadores antiguos.</li>
</ul>
<figure>
<img src="../img/responsive-design-graceful-degradation.png" alt="Graceful degradation. Fuente: bradfostweb.com" /><figcaption>Graceful degradation. Fuente: bradfostweb.com</figcaption>
</figure>
</section><section id="progessive-enhancement" class="slide level2">
<h2><span class="header-section-number">2.9</span> Progessive enhancement</h2>
<ul>
<li>Se <strong>desarrolla una versión básica</strong> completamente operativa, con la posibilidad de ir añadiendo mejoras para los últimos navegadores.</li>
</ul>
<figure>
<img src="../img/responsive-design-progressive-enhancement.png" alt="Progressive enhancement. Fuente: bradfostweb.com" /><figcaption>Progressive enhancement. Fuente: bradfostweb.com</figcaption>
</figure>
</section><section id="beneficios-i" class="slide level2">
<h2><span class="header-section-number">2.10</span> Beneficios (I)</h2>
<ul>
<li><p><strong>Reducción de costos</strong>. Pues no hay que hacer varias versiones de una misma página.</p></li>
<li><p><strong>Eficiencia en la actualización</strong>. El sitio solo se debe actualizar una vez y se ve reflejada en todas las plataformas.</p></li>
<li><p><strong>Mejora la usabilidad</strong>. El usuario va a tener experiencias de usuario parecidas independientemente del dispositivo que esté usando en cada momento</p></li>
</ul>
</section><section id="beneficios-ii" class="slide level2">
<h2><span class="header-section-number">2.11</span> Beneficios (II)</h2>
<ul>
<li><p><strong>Mejora el SEO</strong>. Según las Guidelines de Google el tener una web que se vea correctamente en móviles es un factor que tienen en cuenta a la hora de elaborar los rankings.</p></li>
<li><p><strong>Impacto en el visitante</strong>. Esta tecnología por ser nueva genera impacto en las personas que la vean en acción, lo que permitirá asociar a la marca con creatividad e innovación.</p></li>
</ul>
</section>
<section id="ejemplos" class="titleslide slide level1"><h1><span class="header-section-number">3</span> Ejemplos</h1></section><section id="matt-kersley" class="slide level2">
<h2><span class="header-section-number">3.1</span> Matt Kersley</h2>
<ul>
<li>Página de testeo de Matt Kersley
<ul>
<li><a href="http://mattkersley.com/responsive">http://mattkersley.com/responsive</a></li>
</ul></li>
</ul>
</section><section id="dconstruct-2011" class="slide level2">
<h2><span class="header-section-number">3.2</span> dConstruct 2011</h2>
<ul>
<li><a href="http://2011.dconstruct.org">http://2011.dconstruct.org</a></li>
</ul>
<figure>
<img src="../img/dConstruct-2011-ejemplo-de-Responsive-Web-Design.jpg" alt="Ejemplo RWD: dConstruct 2011. Fuente:ecbloguer.com" /><figcaption>Ejemplo RWD: dConstruct 2011. Fuente:ecbloguer.com</figcaption>
</figure>
</section><section id="boston-globe" class="slide level2">
<h2><span class="header-section-number">3.3</span> Boston Globe</h2>
<ul>
<li><a href="http://www.bostonglobe.com">http://www.bostonglobe.com</a></li>
</ul>
<figure>
<img src="../img/Boston-Globe-ejemplo-de-Responsive-Web-Design.jpg" alt="Ejemplo RWD: Boston Globe. Fuente:ecbloguer.com" /><figcaption>Ejemplo RWD: Boston Globe. Fuente:ecbloguer.com</figcaption>
</figure>
</section><section id="food-sense" class="slide level2">
<h2><span class="header-section-number">3.4</span> Food Sense</h2>
<ul>
<li><a href="http://foodsense.is">http://foodsense.is</a></li>
</ul>
<figure>
<img src="../img/Food-Sense-ejemplo-de-Responsive-Web-Design.jpg" alt="Ejemplo RWD: Food Sense. Fuente:ecbloguer.com" /><figcaption>Ejemplo RWD: Food Sense. Fuente:ecbloguer.com</figcaption>
</figure>
</section><section id="deren-keskin" class="slide level2">
<h2><span class="header-section-number">3.5</span> Deren Keskin</h2>
<ul>
<li><a href="http://www.deren.me">http://www.deren.me</a></li>
</ul>
<figure>
<img src="../img/Deren-Keskin-ejemplo-de-Responsive-Web-Design.jpg" alt="Ejemplo RWD: Deren Keskin. Fuente:ecbloguer.com" /><figcaption>Ejemplo RWD: Deren Keskin. Fuente:ecbloguer.com</figcaption>
</figure>
</section>
<section id="diseño-fluido" class="titleslide slide level1"><h1><span class="header-section-number">4</span> Diseño fluido</h1></section><section id="de-px-a-em" class="slide level2">
<h2><span class="header-section-number">4.1</span> De PX a EM</h2>
<ul>
<li><p>Formula: <strong>target ÷ context = result</strong></p>
<ul>
<li>target - font-size que tenemos en píxeles</li>
<li>context - font-size base (por defecto 16px en la mayoría de los navegadores)</li>
<li>result - resultado que obtenemos en em</li>
</ul></li>
<li><p>Es recomendable indicar el cálculo realizado junto a la regla de CSS.</p></li>
</ul>
</section><section id="on-line" class="slide level2">
<h2><span class="header-section-number">4.2</span> On Line</h2>
<ul>
<li><a href="http://pxtoem.com">http://pxtoem.com</a></li>
</ul>
<figure>
<img src="../img/pxtoem.png" alt="px to em. Fuente:pxtoem.com" /><figcaption>px to em. Fuente:pxtoem.com</figcaption>
</figure>
</section><section id="ejemplo" class="slide level2">
<h2><span class="header-section-number">4.3</span> Ejemplo</h2>
<ul>
<li>Ejemplo para poner 13px por defecto y luego 18px para h1 en em:</li>
</ul>
<pre><code>body {
font: 13px;
}
h1 {
font-size: 1.3846 em;
/* 18px/13px = 1.3846em */
}</code></pre>
</section><section id="em-se-hereda" class="slide level2">
<h2><span class="header-section-number">4.4</span> EM se hereda</h2>
<ul>
<li><p>Importante: <strong>las medidas em se heredan</strong>, es decir, un elemento dentro de un elemento tomará como referencia el superior para calcular cuánto es un em.</p></li>
<li><p>Por ejemplo, si tenemos una caja donde hemos definido una fuente como 0.5em y dentro de esa caja otra con una fuente 0.25em, esta última fuente tendrá 1/4 de tamaño respecto a la 1/2 de tamaño de la fuente general.</p></li>
</ul>
</section><section id="de-px-a" class="slide level2">
<h2><span class="header-section-number">4.5</span> De PX a %</h2>
<figure>
<img src="../img/porcentajes.jpg" alt="Cálculo porcentajes. Fuente:aloud.es" /><figcaption>Cálculo porcentajes. Fuente:aloud.es</figcaption>
</figure>
</section>
<section id="sistema-de-rejilla" class="titleslide slide level1"><h1><span class="header-section-number">5</span> Sistema de rejilla</h1></section><section id="ejemplo-1" class="slide level2">
<h2><span class="header-section-number">5.1</span> Ejemplo</h2>
<ul>
<li>1 columna para xs (<768px)</li>
<li>2 columnas para sm (≥768px)</li>
<li>3 columnas para md (≥992px)</li>
<li>4 columnas para lg (≥1200px)</li>
</ul>
</section><section id="uso-de-clases" class="slide level2">
<h2><span class="header-section-number">5.2</span> Uso de clases</h2>
<ul>
<li>Uso de clases en el HTML como <strong>Bootstrap</strong>
<ul>
<li><a href="http://getbootstrap.com/css">http://getbootstrap.com/css</a></li>
</ul></li>
</ul>
</section><section id="ejemplo-bootstrap" class="slide level2">
<h2><span class="header-section-number">5.3</span> Ejemplo Bootstrap</h2>
<pre><code><div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">1</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">2</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">3</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">4</div>
</div></code></pre>
</section><section id="semántico" class="slide level2">
<h2><span class="header-section-number">5.4</span> Semántico</h2>
<ul>
<li><strong>The Semantic Grid System</strong>: Mediante layouts, y sin necesidad de usar clases en HTML.
<ul>
<li><a href="http://semantic.gs">http://semantic.gs</a></li>
</ul></li>
</ul>
</section><section id="ejemplo-semantic.gs-html" class="slide level2">
<h2><span class="header-section-number">5.5</span> Ejemplo semantic.gs (HTML)</h2>
<pre><code><header>...</header>
<article>...</article>
<aside>...</aside></code></pre>
</section><section id="ejemplo-semantic.gs-css" class="slide level2">
<h2><span class="header-section-number">5.6</span> Ejemplo semantic.gs (CSS)</h2>
<pre><code>@column-width: 60;
@gutter-width: 20;
@columns: 12;
header { .column(12); }
article { .column(9); }
aside { .column(3); }
@media (max-device-width: 960px) {
article { .column(12); }
aside { .column(12); }
}</code></pre>
</section>
<section id="imágenes-fluidas" class="titleslide slide level1"><h1><span class="header-section-number">6</span> Imágenes fluidas</h1></section><section id="tamaño-máximo" class="slide level2">
<h2><span class="header-section-number">6.1</span> Tamaño máximo</h2>
<ul>
<li>Fijar un <strong>tamaño máximo</strong> (si la imagen no llega, se queda con su tamaño):</li>
</ul>
<pre><code>img {
max-width:400px;
}</code></pre>
</section><section id="ancho-del-contenedor-i" class="slide level2">
<h2><span class="header-section-number">6.2</span> Ancho del contenedor (I)</h2>
<ul>
<li>Ocupar el <strong>ancho del contenedor</strong> (si la imagen no llega, se deforma):</li>
</ul>
<pre><code>img {
width:100%;
}</code></pre>
</section><section id="ancho-del-contenedor-ii" class="slide level2">
<h2><span class="header-section-number">6.3</span> Ancho del contenedor (II)</h2>
<ul>
<li>Ocupar el <strong>ancho del contenedor</strong> (si la imagen no llega, se queda con su tamaño):</li>
</ul>
<pre><code>img {
max-width:100%;
}</code></pre>
</section><section id="ancho-del-contenedor-iii" class="slide level2">
<h2><span class="header-section-number">6.4</span> Ancho del contenedor (III)</h2>
<ul>
<li>Ocupar el <strong>ancho del contenedor hasta un máximo</strong> (si la imagen no llega, se deforma):</li>
</ul>
<pre><code>img {
width:100%;
max-width:400px;
}</code></pre>
</section><section id="backgrounds" class="slide level2">
<h2><span class="header-section-number">6.5</span> Backgrounds</h2>
<ul>
<li>Para los background usar <strong>cover</strong></li>
</ul>
<pre><code>.background-fluid {
width: 100%;
background-image:
url(img/water.jpg);
background-size: cover;
}</code></pre>
</section>
<section id="viewport" class="titleslide slide level1"><h1><span class="header-section-number">7</span> Viewport</h1></section><section id="orígenes" class="slide level2">
<h2><span class="header-section-number">7.1</span> Orígenes</h2>
<ul>
<li><p>La etiqueta meta para el viewport fue <strong>introducida por Apple</strong> en Safari para móviles en el año 2007, para ayudar a los desarrolladores a mejorar la presentación de sus aplicaciones web en un iPhone.</p></li>
<li><p>Hoy en día ha sido <strong>ampliamente adoptada por el resto de navegadores móviles</strong>, convirtiéndose en un estándar de facto.</p></li>
</ul>
</section><section id="qué-nos-permite" class="slide level2">
<h2><span class="header-section-number">7.2</span> ¿Qué nos permite?</h2>
<ul>
<li>La etiqueta viewport nos permite definir el <strong>ancho, alto y escala del área</strong> usada por el navegador para mostrar contenido.</li>
</ul>
</section><section id="tamaño" class="slide level2">
<h2><span class="header-section-number">7.3</span> Tamaño</h2>
<ul>
<li><p>Al fijar el ancho (width) o alto (height) del viewport, <strong>podemos usar un número fijo de pixeles</strong> (ej: 320px, 480px, etc) <strong>o usar dos constantes, device-width y device-height</strong> respectivamente.</p></li>
<li><p>Se considera una <strong>buena práctica configurar el viewport con device-width y device-height</strong>, en lugar de utilizar un ancho o alto fijo.</p></li>
</ul>
</section><section id="escala" class="slide level2">
<h2><span class="header-section-number">7.4</span> Escala</h2>
<ul>
<li><p>La propiedad <strong>initial-scale</strong> controla el nivel de zoom inicial al cargarse la página.</p></li>
<li><p>Las propiedades <strong>maximum-scale, minimum-scale</strong> controlan el nivel máximo y mínimo de zoom que se le va a permitir usar al usuario.</p></li>
<li><p>La propiedad <strong>user-scalable [yes|no]</strong> controlan si el usuario puede o no hacer zoom sobre la página.</p></li>
</ul>
</section><section id="accesibilidad" class="slide level2">
<h2><span class="header-section-number">7.5</span> Accesibilidad</h2>
<ul>
<li>Es una <strong>buena práctica de accesibilidad no bloquear las opciones de zoom</strong> al usuario.</li>
</ul>
</section><section id="ejemplo-2" class="slide level2">
<h2><span class="header-section-number">7.6</span> Ejemplo</h2>
<ul>
<li>Un ejemplo adaptable y accesible sería:</li>
</ul>
<pre><code><meta name="viewport"
content="width=device-width,
initial-scale=1,
user-scalable=yes"></code></pre>
</section>
<section id="media-queries" class="titleslide slide level1"><h1><span class="header-section-number">8</span> Media Queries</h1></section><section id="qué-son" class="slide level2">
<h2><span class="header-section-number">8.1</span> ¿Qué son?</h2>
<p>Un Media Query <strong>no sólo nos permite seleccionar el tipo de medio</strong> (all, braille, print, proyection, screen, tty, tv, etc.), <strong>sino además consultar otras características</strong> sobre el dispositivo que esta mostrando la página.</p>
</section><section id="ejemplo-3" class="slide level2">
<h2><span class="header-section-number">8.2</span> Ejemplo</h2>
<ul>
<li><strong>Ejemplo</strong>: aplicar distintas reglas CSS cuando el área de visualización sea mayor que 480px.</li>
</ul>
</section><section id="distintos-css" class="slide level2">
<h2><span class="header-section-number">8.3</span> Distintos CSS</h2>
<ul>
<li>Solución 1: <strong>cargar distintas CSS</strong>:</li>
</ul>
<pre><code><link rel="stylesheet"
type="text/css"
media="all and (min-width: 480px)"
href="tablet.css" />
<!-- tablet.css es un CSS con reglas para cuando el área de visualización sea mayor que 480px --></code></pre>
</section><section id="mismo-css" class="slide level2">
<h2><span class="header-section-number">8.4</span> Mismo CSS</h2>
<ul>
<li>Solución 2: <strong>definir distintas propiedades dentro del mismo CSS</strong>:</li>
</ul>
<pre><code>@media all and (min-width: 480px) {
/* aquí poner las reglas CSS
para cuando el área de visualización
sea mayor que 480px*/
}</code></pre>
</section><section id="importar-css" class="slide level2">
<h2><span class="header-section-number">8.5</span> Importar CSS</h2>
<ul>
<li>Solución 3: <strong>importar distintas hojas de estilo dentro del mismo CSS</strong>:</li>
</ul>
<pre><code>@import url("tablet.css")
all and (min-width: 480px);
/* tablet.css es un CSS con reglas
para cuando el área de visualización
sea mayor que 480px */
}</code></pre>
</section><section id="operador-and" class="slide level2">
<h2><span class="header-section-number">8.6</span> Operador and</h2>
<ul>
<li>Es usado para combinar múltiples media features en un sólo Media Query, <strong>requiriendo que cada función devuelve true</strong> para que el Query también lo sea.</li>
</ul>
</section><section id="ejemplo-and" class="slide level2">
<h2><span class="header-section-number">8.7</span> Ejemplo and</h2>
<pre><code>@media tv
and (min-width: 700px)
and (orientation: landscape) {
/* reglas que queremos que
se apliquen para televisiones
con áreas de visualización
mayores de 700px siempre que
la pantalla esté en
modo landscape */
}</code></pre>
</section><section id="operador-or" class="slide level2">
<h2><span class="header-section-number">8.8</span> Operador 'or'</h2>
<ul>
<li><p>Se pueden combinar múltiples Media Queries <strong>separados por comas</strong> en una lista, de tal forma que si alguna de las Media Queries devuelve true, todo la sentencia devolverá true.</p></li>
<li><p>Esto es <strong>equivalente a un operador or</strong>.</p></li>
<li><p>Cada Media Query separado por comas en la lista se trata individualmente.</p></li>
</ul>
</section><section id="ejemplo-or" class="slide level2">
<h2><span class="header-section-number">8.9</span> Ejemplo 'or'</h2>
<pre><code>@media tv,
(min-width: 700px),
(orientation: landscape) {
/* reglas que queremos que
se apliquen para televisiones,
o para dispositivos con áreas
de visualización mayores
de 700px, o cuando la pantalla
está en modo landscape */
}</code></pre>
</section><section id="operador-not" class="slide level2">
<h2><span class="header-section-number">8.10</span> Operador not</h2>
<ul>
<li><p>Se utiliza para <strong>negar un Media Query completo</strong>.</p></li>
<li><p>No se puede negar una característica individualmente, si no solamente el Media Query completo.</p></li>
</ul>
</section><section id="ejemplo-not-i" class="slide level2">
<h2><span class="header-section-number">8.11</span> Ejemplo not (I)</h2>
<pre><code>@media not tv and max-width(800px),
not screen and max-width(400px) {
/* reglas que queremos que
se apliquen para dispositivos
que no sean ni televisiones
con áreas de visualización
menores de 800px, ni pantallas
con áreas de visualización
menores de 400px */
}</code></pre>
</section><section id="ejemplo-not-ii" class="slide level2">
<h2><span class="header-section-number">8.12</span> Ejemplo not (II)</h2>
<ul>
<li>El anterior ejemplo sería equivalente a:</li>
</ul>
<pre><code>@media not (tv and max-width(800px)),
not (screen and max-width(400px)) {
...
}</code></pre>
</section><section id="características-i" class="slide level2">
<h2><span class="header-section-number">8.13</span> Características (I)</h2>
<ul>
<li><p>Características que hacen referencia al <strong>área de visualización</strong>:</p>
<ul>
<li><strong>width</strong></li>
<li><strong>height</strong></li>
<li><strong>aspect-ratio</strong> [4/3 | 16/9 | ...]</li>
<li><strong>orientation</strong> [portrait | landscape]</li>
</ul></li>
</ul>
</section><section id="características-ii" class="slide level2">
<h2><span class="header-section-number">8.14</span> Características (II)</h2>
<ul>
<li><p>Características que hacen referencia a la <strong>pantalla del dispositivo</strong>:</p>
<ul>
<li><strong>device-width</strong></li>
<li><strong>device-height</strong></li>
<li><strong>device-aspect-ratio</strong> [4/3 | 16/9 | ...]</li>
</ul></li>
</ul>
</section><section id="características-iii" class="slide level2">
<h2><span class="header-section-number">8.15</span> Características (III)</h2>
<ul>
<li><p><strong>Otras</strong> características:</p>
<ul>
<li><strong>color</strong>: El número de bits de profundidad de color</li>
<li><strong>monocrome</strong>: El número de bits de profundidad de color, en dispotivos monocromáticos</li>
<li><strong>resolution</strong>: Densidad de pixels en el dispositivo, medido en dpi</li>
</ul></li>
</ul>
</section><section id="min--y-max-" class="slide level2">
<h2><span class="header-section-number">8.16</span> Min- y Max-</h2>
<ul>
<li><p>A casi todas las características se les puede adjuntar los <strong>prefijos min- y max-</strong></p></li>
<li><p>De hecho lo habitual es usar dichos prefijos.</p></li>
</ul>
</section>
<section id="metodologías" class="titleslide slide level1"><h1><span class="header-section-number">9</span> Metodologías</h1></section><section id="desktop-vs-mobile" class="slide level2">
<h2><span class="header-section-number">9.1</span> Desktop VS Mobile</h2>
<figure>
<img src="../img/desktop-first-vs-mobile-first.png" alt="Desktop first VS Mobile first. Fuente: brettjankord.com" /><figcaption>Desktop first VS Mobile first. Fuente: brettjankord.com</figcaption>
</figure>
</section><section id="desktop-first" class="slide level2">
<h2><span class="header-section-number">9.2</span> Desktop First</h2>
<ul>
<li>Consiste en <strong>desarrollar para pantallas grandes</strong> y posteriormente adaptar el diseño a pantallas pequeñas.</li>
</ul>
</section><section id="df-utiliza-max-width" class="slide level2">
<h2><span class="header-section-number">9.3</span> DF: utiliza max-width</h2>
<ul>
<li>Normalmente los Media Queries utilizan <strong>max-width</strong>, simplificando y ajustando para las pantallas más pequeñas.</li>
</ul>
<pre><code>@media all and (max-width: 320px) {
/* Estilos para anchos
menores a 320px */
}
@media all and (max-width: 768px) {
/* Estilos para anchos
menores a 768px */
}</code></pre>
</section><section id="df-problemas" class="slide level2">
<h2><span class="header-section-number">9.4</span> DF: problemas</h2>
<ul>
<li><p>Los Media Query <strong>no están soportados por todos los móviles</strong>.</p></li>
<li><p>La <strong>versión móvil termina siendo una versión descafeinada</strong> de la web original.</p></li>
</ul>
</section><section id="mobile-first" class="slide level2">
<h2><span class="header-section-number">9.5</span> Mobile first</h2>
<ul>
<li>Consiste en <strong>desarrollar para pantallas pequeñas</strong> y posteriormente adaptar el diseño a pantallas grandes.</li>
</ul>
</section><section id="mf-utiliza-min-width" class="slide level2">
<h2><span class="header-section-number">9.6</span> MF: utiliza min-width</h2>
<ul>
<li>Ahora los Media Queries utilizan <strong>min-width</strong>, para ajustar el diseño a medida que aumenta el tamaño de pantalla.</li>
</ul>
<pre><code>@media all and (min-width: 320px) {
/* Estilos para anchos
superiores a 320px */
}
@media all and (min-width: 768px) {
/* Estilos para anchos
superiores a 768px */
}</code></pre>
</section><section id="mf-ventajas" class="slide level2">
<h2><span class="header-section-number">9.7</span> MF: ventajas</h2>
<ul>
<li><p>Funciona en <strong>móviles y/o navegadores antiguos</strong> que no soportan los Media Queries.</p></li>
<li><p>Normalmente la <strong>hoja de estilos resultante suele ser más sencilla</strong> que usando la otra vía.</p></li>
<li><p>Empezar por el móvil nos servirá para <strong>determinar de una manera más clara cual es el contenido realmente importante</strong> de nuestra web.</p></li>
</ul>
</section><section id="puntos-de-rotura-i" class="slide level2">
<h2><span class="header-section-number">9.8</span> Puntos de rotura (I)</h2>
<ul>
<li>Normalmente:
<ul>
<li>320px para el móvil,</li>
<li>768px para el tablet,</li>
<li>1024px para el portatil,</li>
<li>1200px para el sobremesa.</li>
</ul></li>
</ul>
</section><section id="puntos-de-rotura-ii" class="slide level2">
<h2><span class="header-section-number">9.9</span> Puntos de rotura (II)</h2>
<ul>
<li><p>Lo mejor sería que los puntos de rotura que aplicamos en los Media Query, fueran <strong>en función de nuestro contenido</strong>, en vez de en función del tamaño del dispositivo más vendido.</p></li>
<li><p>La manera de hacerlo: <strong>ir cambiando poco a poco el ancho del navegador y donde la web se rompa</strong>, aplicar un Media Query.</p></li>
</ul>
</section>
<section id="acerca-de" class="titleslide slide level1"><h1><span class="header-section-number">10</span> Acerca de</h1></section><section id="licencia" class="slide level2">
<h2><span class="header-section-number">10.1</span> Licencia</h2>
<ul>
<li>Estas <strong>transparencias</strong> están hechas con:
<ul>
<li>MarkdownSlides: <a href="https://github.com/asanzdiego/markdownslides">https://github.com/asanzdiego/markdownslides</a></li>
</ul></li>
<li>Estas <strong>transparencias</strong> están bajo una licencia Creative Commons Reconocimiento-CompartirIgual 3.0:
<ul>
<li><a href="http://creativecommons.org/licenses/by-sa/3.0/es">http://creativecommons.org/licenses/by-sa/3.0/es</a></li>
</ul></li>
</ul>
</section><section id="fuentes" class="slide level2">
<h2><span class="header-section-number">10.2</span> Fuentes</h2>
<ul>
<li>Transparencias:
<ul>
<li><a href="https://github.com/asanzdiego/curso-interfaces-web-2014/tree/master/03-rwd/slides">https://github.com/asanzdiego/curso-interfaces-web-2014/tree/master/03-rwd/slides</a></li>
</ul></li>
<li>Código:
<ul>
<li><a href="https://github.com/asanzdiego/curso-interfaces-web-2014/tree/master/03-rwd/src">https://github.com/asanzdiego/curso-interfaces-web-2014/tree/master/03-rwd/src</a></li>
</ul></li>
</ul>
</section><section id="bibliografía-i" class="slide level2">
<h2><span class="header-section-number">10.3</span> Bibliografía (I)</h2>
<ul>
<li>Responsive Web Design
<ul>
<li><a href="http://www.arkaitzgarro.com/responsive-web-design/index.html">http://www.arkaitzgarro.com/responsive-web-design/index.html</a></li>
</ul></li>
<li>Introducción al Diseño Web Adaptable o Responsive Web Design
<ul>
<li><a href="http://www.emenia.es/diseno-web-adaptable-o-responsive-web-design">http://www.emenia.es/diseno-web-adaptable-o-responsive-web-design</a></li>
</ul></li>
<li>Tutorial: Responsive Web Design
<ul>
<li><a href="http://www.mmfilesi.com/blog/tutorial-responsive-web-design-i">http://www.mmfilesi.com/blog/tutorial-responsive-web-design-i</a></li>
</ul></li>
</ul>
</section><section id="bibliografía-ii" class="slide level2">
<h2><span class="header-section-number">10.4</span> Bibliografía (II)</h2>
<ul>
<li>Tutorial: Transforma tu web en Responsive Design
<ul>
<li><a href="http://blog.ikhuerta.com/transforma-tu-web-en-responsive-design">http://blog.ikhuerta.com/transforma-tu-web-en-responsive-design</a></li>
</ul></li>
<li>Curso responsive web design - Redradix School
<ul>
<li><a href="http://www.slideshare.net/Redradix/curso-responsive-web-design-redradix-school">http://www.slideshare.net/Redradix/curso-responsive-web-design-redradix-school</a></li>
</ul></li>
<li>Todo lo que necesita saber sobre Responsive Web Design
<ul>
<li><a href="http://www.ecbloguer.com/marketingdigital/?p=2635">http://www.ecbloguer.com/marketingdigital/?p=2635</a></li>
</ul></li>
</ul>
</section><section id="bibliografía-iii" class="slide level2">
<h2><span class="header-section-number">10.5</span> Bibliografía (III)</h2>
<ul>
<li>Diseño web fluido y plantilla fluida con HTML5 y CSS3
<ul>
<li><a href="http://www.aloud.es/diseno-web-fluido-y-plantilla-fluida">http://www.aloud.es/diseno-web-fluido-y-plantilla-fluida</a></li>
</ul></li>
<li>Beneficios del Responsive Web Design en SEO
<ul>
<li><a href="http://madridnyc.com/blog/2013/01/29/beneficios-del-responsive-web-design-en-seo">http://madridnyc.com/blog/2013/01/29/beneficios-del-responsive-web-design-en-seo</a></li>
</ul></li>
<li>Responsive Web Design Testing Tool
<ul>
<li><a href="http://mattkersley.com/responsive">http://mattkersley.com/responsive</a></li>
</ul></li>
</ul>
</section><section id="bibliografía-iv" class="slide level2">
<h2><span class="header-section-number">10.6</span> Bibliografía (IV)</h2>
<ul>
<li>Responsive Web Design
<ul>
<li><a href="http://www.ricardocastillo.com/rwd.pdf">http://www.ricardocastillo.com/rwd.pdf</a></li>
</ul></li>
<li>Responsive Design y accesibilidad. Buenas y malas prácticas. Errores comunes.
<ul>
<li><a href="http://olgacarreras.blogspot.com.es/2014/01/responsive-design-y-accesibilidad.html">http://olgacarreras.blogspot.com.es/2014/01/responsive-design-y-accesibilidad.html</a></li>
</ul></li>
<li>Diseño web adaptativo: mejores prácticas
<ul>
<li><a href="http://www.emenia.es/diseno-web-adaptativo-mejores-practicas">http://www.emenia.es/diseno-web-adaptativo-mejores-practicas</a></li>
</ul></li>
</ul>
</section><section id="bibliografía-v" class="slide level2">
<h2><span class="header-section-number">10.7</span> Bibliografía (V)</h2>
<ul>
<li>Traducción de "Responsive Web Design" de "A List Apart"
<ul>
<li><a href="http://diseñowebresponsivo.com.ar">http://diseñowebresponsivo.com.ar</a></li>
</ul></li>
<li>Responsive Design Exercise
<ul>
<li><a href="http://blog.garciaechegaray.com/2013/11/29/responsive-design-exercise.html">http://blog.garciaechegaray.com/2013/11/29/responsive-design-exercise.html</a></li>
</ul></li>
</ul>
</section><section id="bibliografía-vi" class="slide level2">
<h2><span class="header-section-number">10.8</span> Bibliografía (VI)</h2>
<ul>
<li>Estadísticas de StatCounter
<ul>
<li><a href="http://gs.statcounter.com">http://gs.statcounter.com</a></li>
</ul></li>
<li>Página de testeo de Matt Kersley
<ul>
<li><a href="http://mattkersley.com/responsive">http://mattkersley.com/responsive</a></li>
</ul></li>
</ul>
</section>
<!--footer id="footer">
<h4 class="author"> Adolfo Sanz De Diego - Septiembre 2014</h4>
</footer-->
<!-- deck goto extension html -->
<form action="." method="get" class="goto-form">
<label for="goto-slide">Go to slide:</label>
<input type="text" name="slidenum" id="goto-slide" list="goto-datalist">
<datalist id="goto-datalist"></datalist>
<input type="submit" value="Go">
</form>
<!-- deck navigation extension html -->
<div aria-role="navigation">
<a href="#" class="deck-prev-link" title="Previous">←</a>
<a href="#" class="deck-next-link" title="Next">→</a>
</div>
<!-- deck status extension html -->
<p class="deck-status" aria-role="status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
<!-- jquery -->
<script src="../lib/deck.js-master/jquery.min.js"></script>
<!-- deck core js -->
<script src="../lib/deck.js-master/core/deck.core.js"></script>
<!-- deck extension js -->
<script src="../lib/deck.js-master/extensions/goto/deck.goto.js"></script>
<script src="../lib/deck.js-master/extensions/menu/deck.menu.js"></script>
<script src="../lib/deck.js-master/extensions/navigation/deck.navigation.js"></script>
<script src="../lib/deck.js-master/extensions/scale/deck.scale.js"></script>
<script src="../lib/deck.js-master/extensions/status/deck.status.js"></script>
<!--script src="../lib/deck.search.js-master/search/deck.search.js"></script-->
<!-- Initialize the deck. -->
<script>
$(function() {
$.deck('.slide');
});
</script>
</body>
</html>
| Java |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Abide.HaloLibrary.Halo2.Retail.Tag.Generated
{
using System;
using Abide.HaloLibrary;
using Abide.HaloLibrary.Halo2.Retail.Tag;
/// <summary>
/// Represents the generated weapon_shared_interface_struct_block tag block.
/// </summary>
public sealed class WeaponSharedInterfaceStructBlock : Block
{
/// <summary>
/// Initializes a new instance of the <see cref="WeaponSharedInterfaceStructBlock"/> class.
/// </summary>
public WeaponSharedInterfaceStructBlock()
{
this.Fields.Add(new PadField("", 16));
}
/// <summary>
/// Gets and returns the name of the weapon_shared_interface_struct_block tag block.
/// </summary>
public override string BlockName
{
get
{
return "weapon_shared_interface_struct_block";
}
}
/// <summary>
/// Gets and returns the display name of the weapon_shared_interface_struct_block tag block.
/// </summary>
public override string DisplayName
{
get
{
return "weapon_shared_interface_struct";
}
}
/// <summary>
/// Gets and returns the maximum number of elements allowed of the weapon_shared_interface_struct_block tag block.
/// </summary>
public override int MaximumElementCount
{
get
{
return 1;
}
}
/// <summary>
/// Gets and returns the alignment of the weapon_shared_interface_struct_block tag block.
/// </summary>
public override int Alignment
{
get
{
return 4;
}
}
}
}
| Java |
<?php
require('../../php/bdd.php');
$bdd->query('DELETE FROM general WHERE 1');
$reqe = $bdd->prepare('INSERT INTO general (name, text, date) VALUES (:label, :text, 0)');
$reqe->execute(array(
"label" => 'titre_accueil',
"text" => $_POST['title']
));
$reqe->CloseCursor();
$reqe = $bdd->prepare('INSERT INTO general (name, text, date) VALUES (:label, :text, 0)');
$reqe->execute(array(
"label" => 'text_accueil',
"text" => $_POST['text']
));
$reqe->CloseCursor();
$reqe = $bdd->prepare('INSERT INTO general (name, text, date) VALUES (:label, :text, 0)');
$reqe->execute(array(
"label" => 'foot_accueil',
"text" => $_POST['foot']
));
$reqe->CloseCursor();
echo "Effectué !";
?> | Java |
Get required packages
=====================
``` r
library(devtools)
install.packages('tm')
install.packages("SnowballC")
devtools::install_github("cran/wordcloud")
```
Setup corpus
============
- Around here I became frustrated with the CamlCase inconsistencies. Oh well.
- The recursive argument doesn't seem to work, either. Something to investigate.
``` r
suppressPackageStartupMessages(library(tm))
project_dir <- "~/projects/9999-99-99_master_text_miner"
setwd(project_dir)
org_dir <- "~/projects/9999-99-99_master_text_miner/data"
org_dir_source <- DirSource(org_dir, recursive = FALSE)
agenda_corpus <- VCorpus(x=org_dir_source,
readerControl=
list(reader = reader(org_dir_source),
language = "en"))
```
Inspect the corpus
==================
- Structure of the corpus object
``` r
typeof(agenda_corpus)
str(agenda_corpus[1])
```
## [1] "list"
## List of 1
## $ computing.org:List of 2
## ..$ content: chr [1:4509] "* Document appearance and settings" "#+LINK: google http://www.google.com/search?q=%s" "#+TAGS: install(i) sysupdate(s) bug(b) config(c) laptop(l) desktop(d)" "#+DRAWERS: CODE HIDDEN" ...
## ..$ meta :List of 7
## .. ..$ author : chr(0)
## .. ..$ datetimestamp: POSIXlt[1:1], format: "2014-10-02 10:34:03"
## .. ..$ description : chr(0)
## .. ..$ heading : chr(0)
## .. ..$ id : chr "computing.org"
## .. ..$ language : chr "en"
## .. ..$ origin : chr(0)
## .. ..- attr(*, "class")= chr "TextDocumentMeta"
## ..- attr(*, "class")= chr [1:2] "PlainTextDocument" "TextDocument"
## - attr(*, "class")= chr [1:2] "VCorpus" "Corpus"
``` r
inspect(agenda_corpus[c(1, 4, 5)])
```
Tranformations and filtering
============================
- It is important to remove some content, such as punctuation, letter case, certain words, etc.
- what transformations are available?
``` r
getTransformations()
```
## [1] "removeNumbers" "removePunctuation" "removeWords"
## [4] "stemDocument" "stripWhitespace"
- Makes sense, except stem. [What's that?](http://en.wikipedia.org/wiki/Stemming). Oh, so reduce a compound or derivative words to their base. So, e.g. "computing", "computers", "computation", etc may be identified as "compute". Not a great example, since compute and computer are rather different. Digress.
- Undigress, that highlights that one should be familiar with the stemming algorithm. I'll assume it's OK for this exercise.
``` r
suppressPackageStartupMessages(library(SnowballC))
lapply(agenda_corpus, nchar)[[1]]
agenda_corpus <- tm_map(agenda_corpus,
content_transformer(removeWords),
stopwords())
agenda_corpus <- tm_map(agenda_corpus,
content_transformer(removePunctuation))
agenda_corpus <- tm_map(agenda_corpus,
content_transformer(removeNumbers))
agenda_corpus <- tm_map(agenda_corpus,
content_transformer(stripWhitespace))
agenda_corpus <- tm_map(agenda_corpus,
content_transformer(stemDocument))
lapply(agenda_corpus, nchar)[[1]]
```
## content meta
## 173970 272
## content meta
## 103882 272
- the transformations working, but removeWords with the org agenda terms wasn't working. A hack is implemented below for wordcloud.
- future project, pertaining to org specifically, is add custom transformations, e.g. DONE, TODO, NEXT etc
Create document term matrix
===========================
- Here's how to imagine a document term matrix
| doc | word1 | word2 | ... | wordN |
|----------|--------|--------|-----|--------|
| doc1.txt | freq11 | freq12 | ... | freq1N |
| doc2.txt | freq21 | freq22 | ... | freq2N |
| .... | ... | ..... | ... | ..... |
| docn.txt | freqn1 | freqn2 | ... | freqnN |
``` r
org_doc_term_matrix <- DocumentTermMatrix(agenda_corpus)
str(org_doc_term_matrix)
inspect(org_doc_term_matrix[, 1:10])
```
## List of 6
## $ i : int [1:13751] 1 1 1 1 1 1 1 1 1 1 ...
## $ j : int [1:13751] 9 10 14 15 24 26 27 28 40 41 ...
## $ v : num [1:13751] 6 1 1 1 2 7 2 1 2 3 ...
## $ nrow : int 7
## $ ncol : int 9126
## $ dimnames:List of 2
## ..$ Docs : chr [1:7] "computing.org" "fynanse.org" "personal.org" "physical.org" ...
## ..$ Terms: chr [1:9126] "aabout" "aac" "aacount" "aal" ...
## - attr(*, "class")= chr [1:2] "DocumentTermMatrix" "simple_triplet_matrix"
## - attr(*, "weighting")= chr [1:2] "term frequency" "tf"
## <<DocumentTermMatrix (documents: 7, terms: 10)>>
## Non-/sparse entries: 12/58
## Sparsity : 83%
## Maximal term length: 7
## Weighting : term frequency (tf)
##
## Terms
## Docs aabout aac aacount aal aaltiv aas abbrev abcd able
## computing.org 0 0 0 0 0 0 0 0 6
## fynanse.org 0 0 0 0 0 0 0 0 0
## personal.org 0 0 0 0 0 0 0 0 0
## physical.org 0 0 0 0 0 1 0 0 1
## professional.org 0 1 0 20 1 0 1 1 4
## reading.org 0 0 0 0 0 0 0 0 0
## website.org 1 0 1 0 0 0 0 0 0
## Terms
## Docs abort
## computing.org 1
## fynanse.org 0
## personal.org 0
## physical.org 0
## professional.org 0
## reading.org 0
## website.org 0
- hmm, would be nice to see most frequent terms.
Examine document term matrix
============================
``` r
org_term_freq <- colSums(as.matrix(org_doc_term_matrix))
org_term_order <- order(org_term_freq)
org_term_freq[tail(org_term_order, n=25L)]
```
## data get also make add see use
## 143 143 145 145 146 164 166
## check cancelled can sat sun thu scheduled
## 175 202 226 299 316 335 346
## wed fri mon tue next closed logbook
## 399 422 537 558 653 752 1046
## todo end state done
## 1055 1186 1693 2143
- the org mode todo items are common. Blimey, ive done a lot.
- It might be intersting to remove them, but it also indicates the actionability of my work. Identify tasks and execute.
- more examining reveals many other semi-useless words in top 50+ words
``` r
findFreqTerms(org_doc_term_matrix, lowfreq=1000)
```
## [1] "done" "end" "logbook" "state" "todo"
``` r
findFreqTerms(org_doc_term_matrix, lowfreq=100)
```
## [1] "add" "air" "also" "broker" "can"
## [6] "cancelled" "check" "closed" "create" "data"
## [11] "deal" "done" "edm" "end" "fri"
## [16] "get" "git" "just" "logbook" "loss"
## [21] "make" "mon" "need" "new" "next"
## [26] "one" "peril" "results" "right" "rms"
## [31] "run" "sat" "scheduled" "see" "setup"
## [36] "state" "sun" "thu" "todo" "tue"
## [41] "use" "waiting" "wed" "will" "work"
- can also examine word associations, plot associations, which I will omit here.
Plot wordcloud
==============
- I had issues isntalling wordcloud. Github worked, my cran mirror (Rstudio) didn't.
- There's a hack in here to plot only some of the words, since omitting the org bulk words via removeWords didn't work. I heard there's a bug with removeWords if they're at the start of a line, which the org state words usually are.
``` r
library("wordcloud")
set.seed(1945)
wordcloud(names(org_term_freq), org_term_freq,
min.freq=40,
colors=brewer.pal(6,"Dark2"))
```

``` r
org_term_freq[tail(org_term_order, n=25L)]
```
## data get also make add see use
## 143 143 145 145 146 164 166
## check cancelled can sat sun thu scheduled
## 175 202 226 299 316 335 346
## wed fri mon tue next closed logbook
## 399 422 537 558 653 752 1046
## todo end state done
## 1055 1186 1693 2143
``` r
all_terms <- length(org_term_freq)
omit_last <- 25
wordcloud(names(org_term_freq[head(org_term_order,
n=all_terms-omit_last)]),
org_term_freq[head(org_term_order,
n=all_terms-omit_last)],
min.freq=15,
colors=brewer.pal(5,"Dark2"))
```

Finally, make wordclouds for individual org agenda files
========================================================
- I've omitted some of the plots for brevity.
``` r
setwd("data")
org_dirs <- dir()[!grepl(".org",dir())]
org_dirs
corp_to_wordcloud <- function(top_dir){
dir_source <- DirSource(top_dir)
agenda_corpus <- VCorpus(x=dir_source,
readerControl=
list(reader = reader(dir_source),
language = "en"))
agenda_corpus <- tm_map(agenda_corpus,
content_transformer(removeWords),
stopwords())
agenda_corpus <- tm_map(agenda_corpus,
content_transformer(removePunctuation))
agenda_corpus <- tm_map(agenda_corpus,
content_transformer(removeNumbers))
agenda_corpus <- tm_map(agenda_corpus,
content_transformer(stripWhitespace))
agenda_corpus <- tm_map(agenda_corpus,
content_transformer(stemDocument))
org_doc_term_matrix <- DocumentTermMatrix(agenda_corpus)
org_term_freq <- colSums(as.matrix(org_doc_term_matrix))
org_term_order <- order(org_term_freq)
set.seed(1945)
all_terms <- length(org_term_freq)
omit_last <- 15
wordcloud(names(org_term_freq[head(org_term_order,
n=all_terms-omit_last)]),
org_term_freq[head(org_term_order,
n=all_terms-omit_last)],
min.freq=15,
colors=brewer.pal(5,"Dark2"), main=dir_source)
}
lapply(org_dirs, corp_to_wordcloud)
```
      
## [1] "computing" "fynanse" "personal" "physical"
## [5] "professional" "reading" "website"
## [[1]]
## NULL
##
## [[2]]
## NULL
##
## [[3]]
## NULL
##
## [[4]]
## NULL
##
## [[5]]
## NULL
##
## [[6]]
## NULL
##
## [[7]]
## NULL
Next time
=========
- Try python's nltk
- I think some normalization of the word frequencies against a null case (some generic books, dictionary, i don't know what) might be more interesting
- Trim terms using in inflection points on the ordered terms vs frequency relationship
- Animate the wordclouds of the individual org agenda files
References
==========
- <http://onepager.togaware.com/TextMiningO.pdf>
- <http://cran.r-project.org/web/packages/tm/vignettes/tm.pdf>
| Java |
#ifndef TOKENS_H
#define TOKENS_H
#define NUMBER 256
#define SYMBOL 257
#endif
| Java |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using Newegg.Oversea.Silverlight.Controls;
using Newegg.Oversea.Silverlight.ControlPanel.Core.Base;
using ECCentral.Portal.UI.MKT.Models;
using ECCentral.Portal.UI.MKT.UserControls.Keywords;
using Newegg.Oversea.Silverlight.Controls.Components;
using ECCentral.Portal.UI.MKT.Facades;
using ECCentral.Portal.Basic.Utilities;
using ECCentral.QueryFilter.MKT;
using ECCentral.BizEntity.MKT;
using ECCentral.Portal.Basic;
using ECCentral.BizEntity.Common;
using ECCentral.BizEntity.Enum.Resources;
using Newegg.Oversea.Silverlight.ControlPanel.Core;
using ECCentral.Portal.UI.MKT.Resources;
using Newegg.Oversea.Silverlight.Utilities.Validation;
namespace ECCentral.Portal.UI.MKT.Views
{
[View(IsSingleton = true, SingletonType = SingletonTypes.Url)]
public partial class HotKeywords : PageBase
{
private HotKeywordsQueryFacade facade;
private HotKeywordsQueryFilter filter;
private List<HotKeywordsVM> gridVM;
private HotKeywordsQueryVM queryVM;
private HotKeywordsQueryFilter filterVM;
public HotKeywords()
{
InitializeComponent();
}
/// <summary>
/// 数据全部导出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void QueryResultGrid_ExportAllClick(object sender, EventArgs e)
{
if (filterVM == null || this.QueryResultGrid.TotalCount < 1)
{
Window.Alert(ResKeywords.Information_ExportFailed);
return;
}
ColumnSet col = new ColumnSet(this.QueryResultGrid);
filter = queryVM.ConvertVM<HotKeywordsQueryVM, HotKeywordsQueryFilter>();
filter.PageInfo = new ECCentral.QueryFilter.Common.PagingInfo()
{
PageSize = ConstValue.MaxRowCountLimit,
PageIndex = 0,
SortBy = string.Empty
};
facade.ExportExcelFile(filterVM, new ColumnSet[] { col });
}
public override void OnPageLoad(object sender, EventArgs e)
{
facade = new HotKeywordsQueryFacade(this);
filter = new HotKeywordsQueryFilter();
queryVM = new HotKeywordsQueryVM();
queryVM.CompanyCode = CPApplication.Current.CompanyCode;
queryVM.ChannelID = "1";
QuerySection.DataContext = queryVM;
facade.GetHotKeywordsEditUserList(CPApplication.Current.CompanyCode, (s, args) =>
{
if (args.FaultsHandle())
return;
BindEditUserList(args.Result);
});
base.OnPageLoad(sender, e);
}
private void BindEditUserList(List<UserInfo> userList)
{
if (userList == null)
{
userList = new List<UserInfo>();
}
userList.Insert(0, new UserInfo { SysNo = null, UserName = ResCommonEnum.Enum_All });
comEditUser.ItemsSource = userList;
}
private void QueryResultGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e)
{
facade.QueryHotKeywords(QueryResultGrid.QueryCriteria as HotKeywordsQueryFilter, e.PageSize, e.PageIndex, e.SortField, (s, args) =>
{
if (args.FaultsHandle())
return;
gridVM = DynamicConverter<HotKeywordsVM>.ConvertToVMList<List<HotKeywordsVM>>(args.Result.Rows);
QueryResultGrid.ItemsSource = gridVM;
QueryResultGrid.TotalCount = args.Result.TotalCount;
if (gridVM != null)
{
btnVoidItem.IsEnabled = true;
btnAvailableItem.IsEnabled = true;
}
else
{
btnVoidItem.IsEnabled = false;
btnAvailableItem.IsEnabled = false;
}
});
}
/// <summary>
/// 预览
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void hlViewItem_Click(object sender, RoutedEventArgs e)
{
HotKeywordsVM vm = QueryResultGrid.SelectedItem as HotKeywordsVM;
HotKeywordsVM vmItem = gridVM.SingleOrDefault(a => a.SysNo.Value == vm.SysNo.Value);
HotSearchKeyWords item = EntityConvertorExtensions.ConvertVM<HotKeywordsVM, HotSearchKeyWords>(vmItem, (v, t) =>
{
t.Keywords = new BizEntity.LanguageContent(ConstValue.BizLanguageCode, v.Keywords);
});
UCViewHotSearchKeywords usercontrol = new UCViewHotSearchKeywords();
usercontrol.Model = item;
usercontrol.Dialog = Window.ShowDialog(ResKeywords.Title_ReviewHotKeywords, usercontrol, OnMaintainDialogResult);
}
private void btnNewItem_Click(object sender, RoutedEventArgs e)
{
UCAddHotKeywords usercontrol = new UCAddHotKeywords();
usercontrol.Dialog = Window.ShowDialog(ResKeywords.Title_NewHotKeywords, usercontrol, OnMaintainDialogResult);
}
private void OnMaintainDialogResult(object sender, ResultEventArgs args)
{
if (args.DialogResult == DialogResultType.OK)
{
filter = queryVM.ConvertVM<HotKeywordsQueryVM, HotKeywordsQueryFilter>();
filter.PageType = ucPageType.PageType;
filter.PageID = ucPageType.PageID;
filterVM = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone<HotKeywordsQueryFilter>(filter);
QueryResultGrid.QueryCriteria = this.filter;
QueryResultGrid.Bind();
}
}
/// <summary>
/// 屏蔽
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnVoidItem_Click(object sender, RoutedEventArgs e)
{
List<int> invalidSysNo = new List<int>();
gridVM.ForEach(item =>
{
if (item.IsChecked == true)
invalidSysNo.Add(item.SysNo.Value);
});
if (invalidSysNo.Count > 0)
facade.BatchSetHotKeywordsInvalid(invalidSysNo, (obj, args) =>
{
if (args.FaultsHandle())
return;
QueryResultGrid.Bind();
Window.Alert(ResKeywords.Information_OperateSuccessful, MessageType.Information);
});
else
Window.Alert(ResKeywords.Information_MoreThanOneRecord, MessageType.Error);
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void hlEdit_Click(object sender, RoutedEventArgs e)
{
HotKeywordsVM item = this.QueryResultGrid.SelectedItem as HotKeywordsVM;
UCAddHotKeywords usercontrol = new UCAddHotKeywords();
//usercontrol.SysNo = item.SysNo.Value;
usercontrol.VM = gridVM.Single(a => a.SysNo.Value == item.SysNo.Value);//item;
usercontrol.Dialog = Window.ShowDialog(ResKeywords.Title_EditHotKeywords, usercontrol, OnMaintainDialogResult);
}
private void Button_Search_Click(object sender, RoutedEventArgs e)
{
if (ValidationManager.Validate(this.QuerySection))
{
filter = queryVM.ConvertVM<HotKeywordsQueryVM, HotKeywordsQueryFilter>();
filter.PageType = ucPageType.PageType;
filter.PageID = ucPageType.PageID;
filterVM = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone<HotKeywordsQueryFilter>(filter);
QueryResultGrid.QueryCriteria = this.filter;
QueryResultGrid.Bind();
}
}
private void ckbSelectRow_Click(object sender, RoutedEventArgs e)
{
var checkBoxAll = sender as CheckBox;
if (gridVM == null || checkBoxAll == null)
return;
gridVM.ForEach(item =>
{
item.IsChecked = checkBoxAll.IsChecked ?? false;
});
}
/// <summary>
/// 有效
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnAvailableItem_Click(object sender, RoutedEventArgs e)
{
List<int> invalidSysNo = new List<int>();
gridVM.ForEach(item =>
{
if (item.IsChecked == true)
invalidSysNo.Add(item.SysNo.Value);
});
if (invalidSysNo.Count > 0)
facade.BatchSetHotKeywordsAvailable(invalidSysNo, (obj, args) =>
{
if (args.FaultsHandle())
return;
QueryResultGrid.Bind();
Window.Alert(ResKeywords.Information_OperateSuccessful, MessageType.Information);
});
else
Window.Alert(ResKeywords.Information_MoreThanOneRecord, MessageType.Error);
}
}
}
| Java |
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
public class SelectOnInput : MonoBehaviour {
public EventSystem eventSystem;
public GameObject selectedObject;
private bool buttonSelected;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update ()
{
if(Input.GetAxisRaw("Vertical") != 0 && buttonSelected == false)
{
eventSystem.SetSelectedGameObject(selectedObject);
buttonSelected = true;
}
}
private void OnDisable()
{
buttonSelected = false;
}
}
| Java |
package org.anddev.amatidev.pvb;
import java.util.LinkedList;
import org.amatidev.util.AdEnviroment;
import org.amatidev.util.AdPrefs;
import org.anddev.amatidev.pvb.bug.BugBeetle;
import org.anddev.amatidev.pvb.card.Card;
import org.anddev.amatidev.pvb.card.CardTomato;
import org.anddev.amatidev.pvb.obj.Dialog;
import org.anddev.amatidev.pvb.plant.Plant;
import org.anddev.amatidev.pvb.singleton.GameData;
import org.anddev.andengine.engine.handler.timer.ITimerCallback;
import org.anddev.andengine.engine.handler.timer.TimerHandler;
import org.anddev.andengine.entity.IEntity;
import org.anddev.andengine.entity.modifier.LoopEntityModifier;
import org.anddev.andengine.entity.modifier.ScaleModifier;
import org.anddev.andengine.entity.modifier.SequenceEntityModifier;
import org.anddev.andengine.entity.primitive.Rectangle;
import org.anddev.andengine.entity.sprite.Sprite;
import org.anddev.andengine.entity.text.Text;
public class Tutorial extends MainGame {
private Sprite mArrow;
private int mTutorialStep = 1;
@Override
public void createScene() {
// sfondo e tabellone
Sprite back = new Sprite(0, 0, GameData.getInstance().mBackground);
Sprite table = new Sprite(0, 0, GameData.getInstance().mTable);
getChild(BACKGROUND_LAYER).attachChild(back);
getChild(BACKGROUND_LAYER).attachChild(table);
Sprite seed = new Sprite(25, 14, GameData.getInstance().mSeed);
table.attachChild(seed);
GameData.getInstance().mMySeed.setParent(null);
table.attachChild(GameData.getInstance().mMySeed);
// field position
for (int i = 0; i < FIELDS; i++) {
int x = i % 9;
int y = (int)(i / 9);
Rectangle field = new Rectangle(0, 0, 68, 74);
field.setColor(0f, 0f, 0f);
if (i % 2 == 0)
field.setAlpha(0.05f);
else
field.setAlpha(0.08f);
field.setPosition(42 + x * 71, 96 + y * 77);
getChild(GAME_LAYER).attachChild(field);
registerTouchArea(field);
}
}
protected void initLevel() {
// contatori per individuare se in una riga c'e' un nemico
AdPrefs.resetAccessCount(AdEnviroment.getInstance().getContext(), "enemy");
AdPrefs.resetAccessCount(AdEnviroment.getInstance().getContext(), "enemy_killed");
AdPrefs.resetAccessCount(AdEnviroment.getInstance().getContext(), "count96.0");
AdPrefs.resetAccessCount(AdEnviroment.getInstance().getContext(), "count173.0");
AdPrefs.resetAccessCount(AdEnviroment.getInstance().getContext(), "count250.0");
AdPrefs.resetAccessCount(AdEnviroment.getInstance().getContext(), "count327.0");
AdPrefs.resetAccessCount(AdEnviroment.getInstance().getContext(), "count404.0");
GameData.getInstance().mMySeed.resetScore();
LinkedList<Card> cards = GameData.getInstance().mCards;
cards.clear();
cards.add(new CardTomato());
// TUTORIAL
this.mArrow = new Sprite(106, 95, GameData.getInstance().mArrow);
this.mArrow.setColor(1f, 0.4f, 0.4f);
this.mArrow.registerEntityModifier(
new LoopEntityModifier(
null,
-1,
null,
new SequenceEntityModifier(
new ScaleModifier(0.5f, 1f, 1.2f),
new ScaleModifier(0.5f, 1.2f, 1f)
)
)
);
getChild(GUI_LAYER).attachChild(this.mArrow);
AdEnviroment.getInstance().showMessage("Select a card to use");
AdEnviroment.getInstance().showMessage("Each card has a recharge time and price");
}
@Override
public void startScene() {
initLevel();
// add card
LinkedList<Card> cards = GameData.getInstance().mCards;
int start_x = 106;
for (int i = 0; i < cards.size(); i++) {
Card c = cards.get(i);
c.setPosition(start_x + i * 69, 7);
getChild(BACKGROUND_LAYER).attachChild(c);
}
Text skip = new Text(0, 0, GameData.getInstance().mFontTutorial, "Skip");
skip.setColor(1.0f, 0.3f, 0.3f);
skip.setPosition(37, 360);
getChild(GUI_LAYER).attachChild(skip);
registerTouchArea(skip);
}
public void checkLevelFinish() {
if (this.mGameOver == false && this.mLevelFinish == false) {
registerUpdateHandler(new TimerHandler(2f, false, new ITimerCallback() {
@Override
public void onTimePassed(TimerHandler pTimerHandler) {
if (Tutorial.this.mTutorialStep == 4) {
final Sprite e = new Sprite(12, 25, GameData.getInstance().mSeed);
IEntity field = getChild(GAME_LAYER).getChild(12);
if (field.getChildCount() == 0)
field.attachChild(e);
Tutorial.this.mTutorialStep++;
Tutorial.this.mArrow.setPosition(310, 135);
Tutorial.this.mArrow.setRotation(-132f);
AdEnviroment.getInstance().showMessage("Pick the seeds producing the field to increase the stock");
}
}
}));
}
}
private void levelFinish() {
if (this.mGameOver == false && this.mLevelFinish == false) {
Dialog dialog = new Dialog("Tutorial\nComplete");
getChild(GUI2_LAYER).attachChild(dialog);
clearScene();
registerUpdateHandler(new TimerHandler(6, false, new ITimerCallback() {
@Override
public void onTimePassed(TimerHandler pTimerHandler) {
AdEnviroment.getInstance().nextScene();
}
}));
this.mLevelFinish = true;
GameData.getInstance().mMyScore.resetScore();
}
}
@Override
public void manageAreaTouch(ITouchArea pTouchArea) {
if (pTouchArea instanceof Card) {
GameData.getInstance().mSoundCard.play();
this.mSelect = ((Card) pTouchArea).makeSelect();
// TUTORIAL
if (this.mTutorialStep == 1) {
this.mTutorialStep++;
this.mArrow.setPosition(595, 203);
this.mArrow.setRotation(132f);
AdEnviroment.getInstance().showMessage("If bugs incoming, try to kill them by planting");
BugBeetle e = new BugBeetle(250f);
getChild(GAME_LAYER).attachChild(e);
registerUpdateHandler(new TimerHandler(6f, false, new ITimerCallback() {
@Override
public void onTimePassed(TimerHandler pTimerHandler) {
Tutorial.this.mTutorialStep++;
Tutorial.this.mArrow.setPosition(100, 203);
Tutorial.this.mArrow.setRotation(-132f);
AdEnviroment.getInstance().showMessage("If you have enough seeds you can plant");
}
}));
}
} else {
IEntity field = (IEntity) pTouchArea;
if (field.getChildCount() == 1 && !(field.getFirstChild() instanceof Plant)) {
GameData.getInstance().mSoundSeed.play();
GameData.getInstance().mMySeed.addScore(1);
AdEnviroment.getInstance().safeDetachEntity(field.getFirstChild());
if (this.mTutorialStep == 5) {
this.mTutorialStep++;
this.mArrow.setPosition(17, 95);
this.mArrow.setRotation(0f);
AdEnviroment.getInstance().showMessage("Seeds stock are increased to +1");
AdEnviroment.getInstance().showMessage("Kill bugs to complete levels and obtain score and new plants");
registerUpdateHandler(new TimerHandler(9f, false, new ITimerCallback() {
@Override
public void onTimePassed(TimerHandler pTimerHandler) {
AdEnviroment.getInstance().getEngine().runOnUpdateThread(new Runnable() {
@Override
public void run() {
Tutorial.this.levelFinish();
}
});
}
}));
}
} else if (field instanceof Text) {
GameData.getInstance().mSoundMenu.play();
AdEnviroment.getInstance().nextScene();
} else {
if (this.mSelect != null && this.mSelect.isReady() && field.getChildCount() == 0 && this.mTutorialStep >= 3 && field.getY() == 250.0f) {
if (GameData.getInstance().mMySeed.getScore() >= this.mSelect.getPrice()) {
GameData.getInstance().mMySeed.addScore(-this.mSelect.getPrice());
this.mSelect.startRecharge();
field.attachChild(this.mSelect.getPlant());
// TUTORIAL
if (this.mTutorialStep == 3) {
this.mTutorialStep++;
this.mArrow.setPosition(17, 95);
this.mArrow.setRotation(0f);
AdEnviroment.getInstance().showMessage("Seeds stock are decreased because you bought a plant");
}
}
}
}
}
}
}
| Java |
<html>
<body>
<table border="0" cellspacing="0" cellpadding="0" align="LEFT">
<tr>
<td><img src="file:///I:/Monografia/2. Diagramas BPMN/3. Generados/Añadir Escuela a proyectos-1.0_0_0.png"/></td>
</tr>
</table>
</body>
</html> | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.