code stringlengths 5 1.01M | repo_name stringlengths 5 84 | path stringlengths 4 311 | language stringclasses 30 values | license stringclasses 15 values | size int64 5 1.01M | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|
<?php
/*
* Local plugin enable/disable settings
* Auto-generated through plugin/extension manager
*
* NOTE: Plugins will not be added to this file unless there is a need to override a default setting. Plugins are
* enabled by default, unless having a 'disabled' file in their plugin folder.
*/
$plugins['authmysql'] = 0;
$plugins['authad'] = 0;
$plugins['authpgsql'] = 0;
$plugins['authldap'] = 0;
| emanuel-bs/omd | packages/dokuwiki/skel/etc/dokuwiki/plugins.local.php | PHP | gpl-2.0 | 410 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
2334,
13354,
2378,
9585,
1013,
4487,
19150,
10906,
1008,
8285,
1011,
7013,
2083,
13354,
2378,
1013,
5331,
3208,
1008,
1008,
3602,
1024,
13354,
7076,
2097,
2025,
2022,
2794,
2000,
2023,
5371,
4983,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
module Cubicle
class Dimension < Member
end
end
| PlasticLizard/Cubicle | lib/cubicle/dimension.rb | Ruby | mit | 52 | [
30522,
11336,
11919,
2571,
2465,
9812,
1026,
2266,
2203,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
-----------------------------------
-- Area: Port San d'Oria
-- NPC: Thierride
-- Type: Quest Giver
-- @zone: 232
-- @pos -67 -5 -28
--
-- Starts and Finishes Quest: A Taste For Meat
-----------------------------------
package.loaded["scripts/zones/Port_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/globals/titles");
require("scripts/zones/Port_San_dOria/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
local count = trade:getItemCount();
if (trade:hasItemQty(4358, 5) and count == 5) then
if(player:getQuestStatus(SANDORIA, A_TASTE_FOR_MEAT) == QUEST_ACCEPTED) then
player:startEvent(0x0210);
else
player:startEvent(0x020e);
end
elseif (player:getQuestStatus(SANDORIA,THE_BRUGAIRE_CONSORTIUM) == QUEST_ACCEPTED and trade:hasItemQty(595,1) == true and count == 1) then
player:tradeComplete();
player:startEvent(0x021b);
player:setVar("TheBrugaireConsortium-Parcels", 31);
else
player:startEvent(0x0211);
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
aTasteForMeat = player:getQuestStatus(SANDORIA, A_TASTE_FOR_MEAT);
if (aTasteForMeat == QUEST_AVAILABLE and player:getVar("aTasteForMeat") == 1 or aTasteForMeat == QUEST_ACCEPTED) then
player:startEvent(0x020e);
else
player:delQuest(SANDORIA, A_TASTE_FOR_MEAT);
player:startEvent(0x020c);
end;
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if (csid == 0x020e) then
if (player:getQuestStatus(SANDORIA, A_TASTE_FOR_MEAT) == QUEST_AVAILABLE) then
player:setVar("aTasteForMeat", 0);
player:addQuest(SANDORIA, A_TASTE_FOR_MEAT);
end;
elseif (csid == 0x0210) then
player:tradeComplete();
player:addFame(SANDORIA, SAN_FAME*30);
player:addGil(GIL_RATE*150);
player:messageSpecial(GIL_OBTAINED, GIL_RATE*150);
player:completeQuest(SANDORIA, A_TASTE_FOR_MEAT);
player:addTitle(RABBITER);
player:setVar("aTasteForMeat", 1);
end;
end;
| Gwynthell/FFDB | scripts/zones/Port_San_dOria/npcs/Thierride.lua | Lua | gpl-3.0 | 2,483 | [
30522,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
2181,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* arch/arm/mach-tegra/suspend.c
*
* CPU complex suspend & resume functions for Tegra SoCs
*
* Copyright (c) 2009-2010, NVIDIA Corporation.
*
* 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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/sched.h>
#include <linux/smp.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/suspend.h>
#include <asm/cacheflush.h>
#include <asm/hardware/gic.h>
#include <asm/localtimer.h>
#include <asm/tlbflush.h>
#include <asm/cacheflush.h>
#include <mach/iomap.h>
#include <mach/iovmm.h>
#include <mach/irqs.h>
#include <mach/nvrm_linux.h>
#include <mach/pmc.h>
#include <nvrm_memmgr.h>
#include <nvrm_power_private.h>
#include "nvrm/core/common/nvrm_message.h"
#include "power.h"
#include "board.h"
/* NOTE: only add elements to the end of this structure, since the assembly
* code uses hard-coded offsets */
struct suspend_context
{
u32 cpu_burst;
u32 clk_csite_src;
u32 pllx_base;
u32 pllx_misc;
u32 pllx_timeout;
u32 twd_ctrl;
u32 twd_load;
u32 cclk_divider;
};
volatile struct suspend_context tegra_sctx;
bool core_lock_on = false;
#ifdef CONFIG_HOTPLUG_CPU
extern void tegra_board_nvodm_suspend(void);
extern void tegra_board_nvodm_resume(void);
static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
static void __iomem *clk_rst = IO_ADDRESS(TEGRA_CLK_RESET_BASE);
static void __iomem *flow_ctrl = IO_ADDRESS(TEGRA_FLOW_CTRL_BASE);
static void __iomem *evp_reset = IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE)+0x100;
static void __iomem *tmrus = IO_ADDRESS(TEGRA_TMRUS_BASE);
#endif
#define PMC_CTRL 0x0
#define PMC_CTRL_LATCH_WAKEUPS (1 << 5)
#define PMC_WAKE_MASK 0xc
#define PMC_WAKE_LEVEL 0x10
#define PMC_DPAD_ORIDE 0x1C
#define PMC_WAKE_DELAY 0xe0
#define PMC_DPD_SAMPLE 0x20
#define PMC_SW_WAKE_STATUS 0x18
#define PMC_COREPWRGOOD_TIMER 0x3c
#define PMC_SCRATCH0 0x50
#define PMC_SCRATCH1 0x54
#define PMC_CPUPWRGOOD_TIMER 0xc8
#define PMC_CPUPWROFF_TIMER 0xcc
#define PMC_COREPWROFF_TIMER PMC_WAKE_DELAY
#define PMC_SCRATCH38 0x134
#define PMC_SCRATCH39 0x138
#define PMC_SCRATCH41 0x140
#define CLK_RESET_CCLK_BURST 0x20
#define CLK_RESET_CCLK_DIVIDER 0x24
#define CLK_RESET_PLLC_BASE 0x80
#define CLK_RESET_PLLM_BASE 0x90
#define CLK_RESET_PLLX_BASE 0xe0
#define CLK_RESET_PLLX_MISC 0xe4
#define CLK_RESET_SOURCE_CSITE 0x1d4
#define CLK_RESET_CCLK_BURST_POLICY_SHIFT 28
#define CLK_RESET_CCLK_BURST_POLICY_PLLM 3
#define CLK_RESET_CCLK_BURST_POLICY_PLLX 8
#define FLOW_CTRL_CPU_CSR 0x8
#define FLOW_CTRL_CPU1_CSR 0x18
static struct clk *tegra_pclk = NULL;
static const struct tegra_suspend_platform_data *pdata = NULL;
bool tegra_nvrm_lp2_allowed(void)
{
bool ret_value = true;
#ifdef CONFIG_TEGRA_NVRM
if (s_hRmGlobal) {
if (g_Lp2Policy == NvRmLp2Policy_Disabled)
ret_value = false;
else if(g_Lp2Policy == NvRmLp2Policy_EnterInLowCorner)
ret_value = NvRmPrivGetDfsFlags(s_hRmGlobal) &
NvRmDfsStatusFlags_Pause;
}
#endif
return ret_value;
}
#ifdef CONFIG_HOTPLUG_CPU
static bool tegra_nvrm_lp2_persist(void)
{
bool ret_value = true;
#ifdef CONFIG_TEGRA_NVRM
if (s_hRmGlobal && (g_Lp2Policy == NvRmLp2Policy_MaskInLowCorner))
ret_value = NvRmPrivGetDfsFlags(s_hRmGlobal) &
NvRmDfsStatusFlags_Pause;
#endif
return ret_value;
}
static inline void disable_pll(unsigned long base)
{
unsigned long reg = readl(clk_rst + base);
reg &= ~(1<<30);
writel(reg, clk_rst + base);
}
static bool tegra_nvrm_suspend_plls(void)
{
bool ret_value = false;
#ifdef CONFIG_TEGRA_NVRM
if (s_hRmGlobal) {
unsigned long dfs_flags = NvRmPrivGetDfsFlags(s_hRmGlobal);
if (dfs_flags & NvRmDfsStatusFlags_StopPllC0) {
disable_pll(CLK_RESET_PLLC_BASE);
ret_value = true;
}
if (dfs_flags & NvRmDfsStatusFlags_StopPllM0) {
disable_pll(CLK_RESET_PLLM_BASE);
ret_value = true;
}
}
#endif
return ret_value;
}
static void set_power_timers(unsigned long us_on, unsigned long us_off)
{
static int last_pclk = 0;
unsigned long long ticks;
unsigned long long pclk;
pclk = clk_get_rate(tegra_pclk);
if (pclk != last_pclk) {
ticks = (us_on * pclk) + 999999ull;
do_div(ticks, 1000000);
writel((unsigned long)ticks, pmc + PMC_CPUPWRGOOD_TIMER);
ticks = (us_off * pclk) + 999999ull;
do_div(ticks, 1000000);
writel((unsigned long)ticks, pmc + PMC_CPUPWROFF_TIMER);
wmb();
}
last_pclk = pclk;
}
/*
* suspend_cpu_complex
*
* disable periodic IRQs used for DVFS to prevent suspend wakeups
* disable coresight debug interface
*
*
*/
static noinline void restore_cpu_complex(bool wait_plls)
{
unsigned int reg;
/* restore original burst policy setting; PLLX state restored
* by CPU boot-up code - wait for PLL stabilization if PLLX
* was enabled, or if explicitly requested by caller */
BUG_ON(readl(clk_rst + CLK_RESET_PLLX_BASE) != tegra_sctx.pllx_base);
if ((tegra_sctx.pllx_base & (1<<30)) || wait_plls) {
while (readl(tmrus)-tegra_sctx.pllx_timeout >= 0x80000000UL)
cpu_relax();
}
writel(tegra_sctx.cclk_divider, clk_rst + CLK_RESET_CCLK_DIVIDER);
writel(tegra_sctx.cpu_burst, clk_rst + CLK_RESET_CCLK_BURST);
writel(tegra_sctx.clk_csite_src, clk_rst + CLK_RESET_SOURCE_CSITE);
/* do not power-gate the CPU when flow controlled */
reg = readl(flow_ctrl + FLOW_CTRL_CPU_CSR);
reg &= ~((1<<5) | (1<<4) | 1); /* clear WFE bitmask */
reg |= (1<<14); /* write-1-clear event flag */
writel(reg, flow_ctrl + FLOW_CTRL_CPU_CSR);
wmb();
writel(tegra_sctx.twd_ctrl, twd_base + 0x8);
writel(tegra_sctx.twd_load, twd_base + 0);
gic_dist_restore(0);
get_irq_chip(IRQ_LOCALTIMER)->unmask(IRQ_LOCALTIMER);
if(tegra_nvrm_lp2_persist())
enable_irq(INT_SYS_STATS_MON);
}
static noinline void suspend_cpu_complex(void)
{
unsigned int reg;
int i;
if(tegra_nvrm_lp2_persist())
disable_irq(INT_SYS_STATS_MON);
/* switch coresite to clk_m, save off original source */
tegra_sctx.clk_csite_src = readl(clk_rst + CLK_RESET_SOURCE_CSITE);
writel(3<<30, clk_rst + CLK_RESET_SOURCE_CSITE);
tegra_sctx.cpu_burst = readl(clk_rst + CLK_RESET_CCLK_BURST);
tegra_sctx.pllx_base = readl(clk_rst + CLK_RESET_PLLX_BASE);
tegra_sctx.pllx_misc = readl(clk_rst + CLK_RESET_PLLX_MISC);
tegra_sctx.cclk_divider = readl(clk_rst + CLK_RESET_CCLK_DIVIDER);
tegra_sctx.twd_ctrl = readl(twd_base + 0x8);
tegra_sctx.twd_load = readl(twd_base + 0);
local_timer_stop();
reg = readl(flow_ctrl + FLOW_CTRL_CPU_CSR);
/* clear any pending events, set the WFE bitmap to specify just
* CPU0, and clear any pending events for this CPU */
reg &= ~(1<<5); /* clear CPU1 WFE */
reg |= (1<<14) | (1<<4) | 1; /* enable CPU0 WFE */
writel(reg, flow_ctrl + FLOW_CTRL_CPU_CSR);
wmb();
for (i=1; i<num_present_cpus(); i++) {
unsigned int offs = FLOW_CTRL_CPU1_CSR + (i-1)*8;
reg = readl(flow_ctrl + offs);
writel(reg | (1<<14), flow_ctrl + offs);
wmb();
}
gic_cpu_exit(0);
gic_dist_exit(0);
}
unsigned int tegra_suspend_lp2(unsigned int us)
{
unsigned int mode, entry, exit;
unsigned long orig, reg, lp2time, lp2timelast;
bool wait_plls = false;
reg = readl(pmc + PMC_CTRL);
mode = (reg >> TEGRA_POWER_PMC_SHIFT) & TEGRA_POWER_PMC_MASK;
mode |= TEGRA_POWER_CPU_PWRREQ_OE;
if (pdata->separate_req)
mode |= TEGRA_POWER_PWRREQ_OE;
else
mode &= ~TEGRA_POWER_PWRREQ_OE;
mode &= ~TEGRA_POWER_EFFECT_LP0;
orig = readl(evp_reset);
writel(virt_to_phys(tegra_lp2_startup), evp_reset);
set_power_timers(pdata->cpu_timer, pdata->cpu_off_timer);
if (us) {
wait_plls = tegra_nvrm_suspend_plls();
tegra_lp2_set_trigger(us);
}
suspend_cpu_complex();
flush_cache_all();
/* structure is written by reset code, so the L2 lines
* must be invalidated */
outer_flush_range(__pa(&tegra_sctx),__pa(&tegra_sctx+1));
barrier();
__cortex_a9_save(mode);
/* return from __cortex_a9_restore */
restore_cpu_complex(wait_plls);
if (us)
tegra_lp2_set_trigger(0);
writel(orig, evp_reset);
entry = readl(pmc + PMC_SCRATCH38);
exit = readl(pmc + PMC_SCRATCH39);
lp2time = (exit - entry);
#ifdef CONFIG_TEGRA_NVRM
if (us) {
lp2timelast = NvRmPrivGetLp2TimeUS(s_hRmGlobal);
NvRmPrivSetLp2TimeUS(s_hRmGlobal,(lp2timelast + lp2time));
}
#endif
return lp2time;
}
#endif
#ifdef CONFIG_PM
extern unsigned int s_AvpWarmbootEntry;
/* ensures that sufficient time is passed for a register write to
* serialize into the 32KHz domain */
static void pmc_32kwritel(u32 val, unsigned long offs)
{
writel(val, pmc + offs);
wmb();
udelay(130);
}
static void tegra_setup_warmboot(bool lp0_ok)
{
if (lp0_ok) {
u32 scratch0;
scratch0 = readl(pmc + PMC_SCRATCH0);
/* lp0 restore is broken in the ap20 a03 boot rom, so fake the
* bootrom into performing a regular boot, but pass a flag to the
* bootloader to bypass the kernel reload and jump to the lp0
* restore sequence */
if (tegra_is_ap20_a03() && (!tegra_is_ap20_a03p()))
scratch0 |= (1<<5);
else
scratch0 |= 1;
pmc_32kwritel(scratch0, PMC_SCRATCH0);
/* Write the AVP warmboot entry address in SCRATCH1 */
pmc_32kwritel(s_AvpWarmbootEntry, PMC_SCRATCH1);
/* Write the CPU LP0 reset vector address in SCRATCH41 */
writel(virt_to_phys(tegra_lp2_startup), pmc + PMC_SCRATCH41);
} else {
/* Setup LP1 start addresses */
writel(TEGRA_IRAM_CODE_AREA, evp_reset);
writel(virt_to_phys(tegra_lp2_startup), pmc + PMC_SCRATCH1);
}
}
static void tegra_setup_wakepads(bool lp0_ok)
{
u32 temp, status, lvl;
/* wakeup by interrupt, nothing to do here */
if (!lp0_ok)
return;
pmc_32kwritel(0, PMC_SW_WAKE_STATUS);
temp = readl(pmc + PMC_CTRL);
temp |= PMC_CTRL_LATCH_WAKEUPS;
pmc_32kwritel(temp, PMC_CTRL);
temp &= ~PMC_CTRL_LATCH_WAKEUPS;
pmc_32kwritel(temp, PMC_CTRL);
status = readl(pmc + PMC_SW_WAKE_STATUS);
lvl = readl(pmc + PMC_WAKE_LEVEL);
/* flip the wakeup trigger for any-edge triggered pads
* which are currently asserting as wakeups */
status &= pdata->wake_any;
lvl &= ~pdata->wake_low;
lvl |= pdata->wake_high;
lvl ^= status;
writel(lvl, pmc + PMC_WAKE_LEVEL);
/* Enable DPD sample to trigger sampling pads data and direction
* in which pad will be driven during lp0 mode*/
writel(0x1, pmc + PMC_DPD_SAMPLE);
writel(pdata->wake_enb, pmc + PMC_WAKE_MASK);
}
extern void __tegra_lp1_reset(void);
extern void __tegra_iram_end(void);
static u8 *iram_save = NULL;
static unsigned int iram_save_size = 0;
static void __iomem *iram_code = IO_ADDRESS(TEGRA_IRAM_CODE_AREA);
static void __iomem *iram_avp_resume = IO_ADDRESS(TEGRA_IRAM_BASE);
static void tegra_suspend_dram(bool lp0_ok)
{
static unsigned long cpu_timer_32k = 0;
static unsigned long cpu_off_timer_32k = 0;
unsigned int on_timer, off_timer;
unsigned int mode = TEGRA_POWER_SDRAM_SELFREFRESH;
unsigned long orig, reg;
orig = readl(evp_reset);
/* copy the reset vector and SDRAM shutdown code into IRAM */
memcpy(iram_save, iram_code, iram_save_size);
memcpy(iram_code, (void *)__tegra_lp1_reset, iram_save_size);
if (!cpu_timer_32k) {
unsigned long long temp = 32768ull*pdata->cpu_timer + 999999;
do_div(temp, 1000000ul);
cpu_timer_32k = temp;
temp = 32768ull*pdata->cpu_off_timer + 999999;
do_div(temp, 1000000ul);
cpu_off_timer_32k = temp;
}
on_timer = readl(pmc + PMC_CPUPWRGOOD_TIMER);
writel(cpu_timer_32k, pmc + PMC_CPUPWRGOOD_TIMER);
off_timer = readl(pmc + PMC_CPUPWROFF_TIMER);
writel(cpu_off_timer_32k, pmc + PMC_CPUPWROFF_TIMER);
reg = readl(pmc + PMC_CTRL);
mode |= ((reg >> TEGRA_POWER_PMC_SHIFT) & TEGRA_POWER_PMC_MASK);
if (!lp0_ok) {
NvRmPrivPowerSetState(s_hRmGlobal, NvRmPowerState_LP1);
mode |= TEGRA_POWER_CPU_PWRREQ_OE;
if (pdata->separate_req)
mode |= TEGRA_POWER_PWRREQ_OE;
else
mode &= ~TEGRA_POWER_PWRREQ_OE;
mode &= ~TEGRA_POWER_EFFECT_LP0;
} else {
NvRmPrivPowerSetState(s_hRmGlobal, NvRmPowerState_LP0);
//20110213, , sched_clock mismatch issue after deepsleep [START]
#if defined(CONFIG_MACH_STAR)
tegra_lp0_sched_clock_clear();
#endif
//20110213, , sched_clock mismatch issue after deepsleep [END]
mode |= TEGRA_POWER_CPU_PWRREQ_OE;
mode |= TEGRA_POWER_PWRREQ_OE;
mode |= TEGRA_POWER_EFFECT_LP0;
/* for platforms where the core & CPU power requests are
* combined as a single request to the PMU, transition to
* LP0 state by temporarily enabling both requests
*/
if (!pdata->separate_req) {
reg |= ((mode & TEGRA_POWER_PMC_MASK) <<
TEGRA_POWER_PMC_SHIFT);
pmc_32kwritel(reg, PMC_CTRL);
mode &= ~TEGRA_POWER_CPU_PWRREQ_OE;
}
}
tegra_setup_warmboot(lp0_ok);
tegra_setup_wakepads(lp0_ok);
suspend_cpu_complex();
flush_cache_all();
outer_shutdown();
__cortex_a9_save(mode);
restore_cpu_complex(false);
writel(orig, evp_reset);
outer_restart();
writel(on_timer, pmc + PMC_CPUPWRGOOD_TIMER);
writel(off_timer, pmc + PMC_CPUPWROFF_TIMER);
if (!lp0_ok) {
memcpy(iram_code, iram_save, iram_save_size);
} else {
/* for platforms where the core & CPU power requests are
* combined as a single request to the PMU, transition out
* of LP0 state by temporarily enabling both requests
*/
if (!pdata->separate_req) {
reg = readl(pmc + PMC_CTRL);
reg |= (TEGRA_POWER_CPU_PWRREQ_OE << TEGRA_POWER_PMC_SHIFT);
pmc_32kwritel(reg, PMC_CTRL);
reg &= ~(TEGRA_POWER_PWRREQ_OE << TEGRA_POWER_PMC_SHIFT);
writel(reg, pmc + PMC_CTRL);
}
}
wmb();
}
static int tegra_suspend_prepare(void)
{
#ifdef CONFIG_TEGRA_NVRM
NvOdmSocPowerState state = NvRmPowerLowestStateGet();
NvRmPrivDfsSuspend(state);
NvRmPrivPmuLPxStateConfig(s_hRmGlobal, state, NV_TRUE);
#endif
return 0;
}
static void tegra_suspend_finish(void)
{
#ifdef CONFIG_TEGRA_NVRM
NvOdmSocPowerState state = NvRmPowerLowestStateGet();
NvRmPrivPmuLPxStateConfig(s_hRmGlobal, state, NV_FALSE);
NvRmPrivDfsResume();
#endif
}
static int tegra_suspend_prepare_late(void)
{
#ifdef CONFIG_TEGRA_NVRM
static NvRmTransportHandle port = NULL;
static NvRmMemHandle iram_area = NULL;
static unsigned long iram_area_pa = 0;
static void __iomem *barrier = NULL;
NvRmMessage_InitiateLP0 msg;
unsigned long timeout;
NvError e;
if (!s_hRmGlobal)
return 0;
if (!port) {
e = NvRmTransportOpen(s_hRmGlobal, "RPC_AVP_PORT", NULL, &port);
if (e != NvSuccess) {
pr_err("%s: aborting suspend due to TransportOpen "
"returning 0x%08x\n", __func__, e);
return -ENOSYS;
}
}
if (!iram_area) {
NvRmHeap h = NvRmHeap_ExternalCarveOut;
e = NvRmMemHandleCreate(s_hRmGlobal, &iram_area,
TEGRA_IRAM_SIZE + PAGE_SIZE);
if (e != NvSuccess) {
pr_err("%s: MemHandleCreate returned 0x%08x\n",
__func__, e);
return -ENOMEM;
}
e = NvRmMemAlloc(iram_area, &h, 1, PAGE_SIZE,
NvOsMemAttribute_Uncached);
if (e != NvSuccess) {
pr_err("%s: NvRmMemAlloc returned 0x%08x\n",
__func__, e);
NvRmMemHandleFree(iram_area);
iram_area = NULL;
return -ENOMEM;
}
iram_area_pa = NvRmMemPin(iram_area);
}
BUG_ON(iram_area_pa == ~0ul);
if (!barrier) {
barrier = ioremap(iram_area_pa + TEGRA_IRAM_SIZE, PAGE_SIZE);
if (IS_ERR_OR_NULL(barrier)) {
pr_err("%s: failed to map barrier\n", __func__);
barrier = NULL;
return -ENOMEM;
}
}
/* the AVP will write a non-zero value to PMC_SCRATCH38 once it has
* suspended itself */
msg.msg = NvRmMsg_InitiateLP0;
msg.sourceAddr = TEGRA_IRAM_BASE;
msg.bufferAddr = iram_area_pa;
msg.bufferSize = TEGRA_IRAM_SIZE;
writel(0, barrier);
wmb();
e = NvRmTransportSendMsgInLP0(port, &msg, sizeof(msg));
if (e != NvSuccess) {
pr_err("%s: aborting suspend due to SendMsgInLP0 returning "
"0x%08x\n", __func__, e);
return -EIO;
}
timeout = jiffies + msecs_to_jiffies(1000);
while (time_before(jiffies, timeout)) {
if (readl(barrier))
break;
udelay(10);
rmb();
}
/* FIXME: reset the AVP, don't abort suspend */
if (!readl(barrier)) {
pr_err("%s: aborting suspend due to AVP timeout\n", __func__);
return -EIO;
}
tegra_board_nvodm_suspend();
e = NvRmKernelPowerSuspend(s_hRmGlobal);
if (e != NvSuccess) {
pr_err("%s: aborting suspend due to RM failure 0x%08x\n",
__func__, e);
return -EIO;
}
/* The AVP stores its resume address in the first word of IRAM
* Write this resume address to SCRATCH39, where the warmboot
* code can later find it */
writel(*(volatile unsigned int *)iram_avp_resume, pmc + PMC_SCRATCH39);
#endif
disable_irq(INT_SYS_STATS_MON);
return tegra_iovmm_suspend();
}
static void tegra_suspend_wake(void)
{
tegra_iovmm_resume();
enable_irq(INT_SYS_STATS_MON);
#ifdef CONFIG_TEGRA_NVRM
{
NvError e;
e = NvRmKernelPowerResume(s_hRmGlobal);
if (e != NvSuccess)
panic("%s: RM resume failed 0x%08x!\n", __func__, e);
}
tegra_board_nvodm_resume();
#endif
}
extern void __init lp0_suspend_init(void);
extern void tegra_pinmux_suspend(void);
extern void tegra_irq_suspend(void);
extern void tegra_gpio_suspend(void);
extern void tegra_clk_suspend(void);
extern void tegra_dma_suspend(void);
extern void tegra_pinmux_resume(void);
extern void tegra_irq_resume(void);
extern void tegra_gpio_resume(void);
extern void tegra_clk_resume(void);
extern void tegra_dma_resume(void);
#define MC_SECURITY_START 0x6c
#define MC_SECURITY_SIZE 0x70
static int tegra_suspend_enter(suspend_state_t state)
{
struct irq_desc *desc;
void __iomem *mc = IO_ADDRESS(TEGRA_MC_BASE);
unsigned long flags;
u32 mc_data[2];
int irq;
bool lp0_ok = (pdata->core_off && (!core_lock_on));
local_irq_save(flags);
if (lp0_ok) {
tegra_irq_suspend();
tegra_dma_suspend();
tegra_pinmux_suspend();
tegra_gpio_suspend();
tegra_clk_suspend();
mc_data[0] = readl(mc + MC_SECURITY_START);
mc_data[1] = readl(mc + MC_SECURITY_SIZE);
}
for_each_irq_desc(irq, desc) {
if ((desc->status & IRQ_WAKEUP) &&
(desc->status & IRQ_SUSPENDED)) {
get_irq_chip(irq)->unmask(irq);
}
}
if (!pdata->dram_suspend || !iram_save) {
/* lie about the power state so that the RM restarts DVFS */
NvRmPrivPowerSetState(s_hRmGlobal, NvRmPowerState_LP1);
tegra_suspend_lp2(0);
} else
tegra_suspend_dram(lp0_ok);
for_each_irq_desc(irq, desc) {
if ((desc->status & IRQ_WAKEUP) &&
(desc->status & IRQ_SUSPENDED)) {
get_irq_chip(irq)->mask(irq);
}
}
/* Clear DPD sample */
writel(0x0, pmc + PMC_DPD_SAMPLE);
if (lp0_ok) {
writel(mc_data[0], mc + MC_SECURITY_START);
writel(mc_data[1], mc + MC_SECURITY_SIZE);
tegra_clk_resume();
tegra_gpio_resume();
tegra_pinmux_resume();
tegra_dma_resume();
tegra_irq_resume();
}
local_irq_restore(flags);
return 0;
}
static struct platform_suspend_ops tegra_suspend_ops = {
.valid = suspend_valid_only_mem,
.prepare = tegra_suspend_prepare,
.finish = tegra_suspend_finish,
.prepare_late = tegra_suspend_prepare_late,
.wake = tegra_suspend_wake,
.enter = tegra_suspend_enter,
};
#endif
void __init tegra_init_suspend(struct tegra_suspend_platform_data *plat)
{
u32 reg, mode;
tegra_pclk = clk_get_sys(NULL, "pclk");
BUG_ON(!tegra_pclk);
pdata = plat;
(void)reg;
(void)mode;
#ifdef CONFIG_PM
iram_save_size = (unsigned long)__tegra_iram_end;
iram_save_size -= (unsigned long)__tegra_lp1_reset;
iram_save = kmalloc(iram_save_size, GFP_KERNEL);
if (!iram_save) {
pr_err("%s: unable to allocate memory for SDRAM self-refresh "
"LP0/LP1 unavailable\n", __func__);
}
writel(virt_to_phys(tegra_lp2_startup), pmc + PMC_SCRATCH1);
/* Always enable CPU power request; just normal polarity is supported */
reg = readl(pmc + PMC_CTRL);
BUG_ON(reg & (TEGRA_POWER_CPU_PWRREQ_POLARITY << TEGRA_POWER_PMC_SHIFT));
reg |= (TEGRA_POWER_CPU_PWRREQ_OE << TEGRA_POWER_PMC_SHIFT);
pmc_32kwritel(reg, PMC_CTRL);
/* Configure core power request and system clock control if LP0
is supported */
writel(pdata->core_timer, pmc + PMC_COREPWRGOOD_TIMER);
writel(pdata->core_off_timer, pmc + PMC_COREPWROFF_TIMER);
reg = readl(pmc + PMC_CTRL);
mode = (reg >> TEGRA_POWER_PMC_SHIFT) & TEGRA_POWER_PMC_MASK;
mode &= ~TEGRA_POWER_SYSCLK_POLARITY;
mode &= ~TEGRA_POWER_PWRREQ_POLARITY;
if (!pdata->sysclkreq_high)
mode |= TEGRA_POWER_SYSCLK_POLARITY;
if (!pdata->corereq_high)
mode |= TEGRA_POWER_PWRREQ_POLARITY;
/* configure output inverters while the request is tristated */
reg |= (mode << TEGRA_POWER_PMC_SHIFT);
pmc_32kwritel(reg, PMC_CTRL);
/* now enable requests */
reg |= (TEGRA_POWER_SYSCLK_OE << TEGRA_POWER_PMC_SHIFT);
if (pdata->separate_req)
reg |= (TEGRA_POWER_PWRREQ_OE << TEGRA_POWER_PMC_SHIFT);
writel(reg, pmc + PMC_CTRL);
if (pdata->core_off)
lp0_suspend_init();
suspend_set_ops(&tegra_suspend_ops);
#endif
}
#ifdef CONFIG_PM
void tegra_configure_dpd_kbc(unsigned int kbc_rows, unsigned int kbc_cols)
{
unsigned long dpd_oride;
/* Only need to configure the enabled rows */
dpd_oride = readl(pmc + PMC_DPAD_ORIDE);
dpd_oride &= 0x00300000;
dpd_oride |= (kbc_rows & 0xFFFF);
writel(dpd_oride, pmc + PMC_DPAD_ORIDE);
}
#endif
| martyj/LGP999_V10c_Kernel | arch/arm/mach-tegra/suspend.c | C | gpl-2.0 | 21,690 | [
30522,
1013,
1008,
1008,
7905,
1013,
2849,
1013,
24532,
1011,
8915,
17643,
1013,
28324,
1012,
1039,
1008,
1008,
17368,
3375,
28324,
1004,
13746,
4972,
2005,
8915,
17643,
27084,
2015,
1008,
1008,
9385,
1006,
1039,
1007,
2268,
1011,
2230,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* @module ol/control/Zoom
*/
import {inherits} from '../index.js';
import {listen} from '../events.js';
import EventType from '../events/EventType.js';
import Control from '../control/Control.js';
import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js';
import {easeOut} from '../easing.js';
/**
* @typedef {Object} Options
* @property {number} [duration=250] Animation duration in milliseconds.
* @property {string} [className='ol-zoom'] CSS class name.
* @property {string|Element} [zoomInLabel='+'] Text label to use for the zoom-in
* button. Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|Element} [zoomOutLabel='-'] Text label to use for the zoom-out button.
* Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string} [zoomInTipLabel='Zoom in'] Text label to use for the button tip.
* @property {string} [zoomOutTipLabel='Zoom out'] Text label to use for the button tip.
* @property {number} [delta=1] The zoom delta applied on each click.
* @property {Element|string} [target] Specify a target if you want the control to be
* rendered outside of the map's viewport.
*/
/**
* @classdesc
* A control with 2 buttons, one for zoom in and one for zoom out.
* This control is one of the default controls of a map. To style this control
* use css selectors `.ol-zoom-in` and `.ol-zoom-out`.
*
* @constructor
* @extends {ol.control.Control}
* @param {module:ol/control/Zoom~Options=} opt_options Zoom options.
* @api
*/
const Zoom = function(opt_options) {
const options = opt_options ? opt_options : {};
const className = options.className !== undefined ? options.className : 'ol-zoom';
const delta = options.delta !== undefined ? options.delta : 1;
const zoomInLabel = options.zoomInLabel !== undefined ? options.zoomInLabel : '+';
const zoomOutLabel = options.zoomOutLabel !== undefined ? options.zoomOutLabel : '\u2212';
const zoomInTipLabel = options.zoomInTipLabel !== undefined ?
options.zoomInTipLabel : 'Zoom in';
const zoomOutTipLabel = options.zoomOutTipLabel !== undefined ?
options.zoomOutTipLabel : 'Zoom out';
const inElement = document.createElement('button');
inElement.className = className + '-in';
inElement.setAttribute('type', 'button');
inElement.title = zoomInTipLabel;
inElement.appendChild(
typeof zoomInLabel === 'string' ? document.createTextNode(zoomInLabel) : zoomInLabel
);
listen(inElement, EventType.CLICK,
Zoom.prototype.handleClick_.bind(this, delta));
const outElement = document.createElement('button');
outElement.className = className + '-out';
outElement.setAttribute('type', 'button');
outElement.title = zoomOutTipLabel;
outElement.appendChild(
typeof zoomOutLabel === 'string' ? document.createTextNode(zoomOutLabel) : zoomOutLabel
);
listen(outElement, EventType.CLICK,
Zoom.prototype.handleClick_.bind(this, -delta));
const cssClasses = className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL;
const element = document.createElement('div');
element.className = cssClasses;
element.appendChild(inElement);
element.appendChild(outElement);
Control.call(this, {
element: element,
target: options.target
});
/**
* @type {number}
* @private
*/
this.duration_ = options.duration !== undefined ? options.duration : 250;
};
inherits(Zoom, Control);
/**
* @param {number} delta Zoom delta.
* @param {Event} event The event to handle
* @private
*/
Zoom.prototype.handleClick_ = function(delta, event) {
event.preventDefault();
this.zoomByDelta_(delta);
};
/**
* @param {number} delta Zoom delta.
* @private
*/
Zoom.prototype.zoomByDelta_ = function(delta) {
const map = this.getMap();
const view = map.getView();
if (!view) {
// the map does not have a view, so we can't act
// upon it
return;
}
const currentResolution = view.getResolution();
if (currentResolution) {
const newResolution = view.constrainResolution(currentResolution, delta);
if (this.duration_ > 0) {
if (view.getAnimating()) {
view.cancelAnimations();
}
view.animate({
resolution: newResolution,
duration: this.duration_,
easing: easeOut
});
} else {
view.setResolution(newResolution);
}
}
};
export default Zoom;
| gingerik/ol3 | src/ol/control/Zoom.js | JavaScript | bsd-2-clause | 4,367 | [
30522,
1013,
1008,
1008,
1008,
1030,
11336,
19330,
1013,
2491,
1013,
24095,
1008,
1013,
12324,
1063,
22490,
2015,
1065,
2013,
1005,
1012,
1012,
1013,
5950,
1012,
1046,
2015,
1005,
1025,
12324,
1063,
4952,
1065,
2013,
1005,
1012,
1012,
1013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
public class Solution {
public int findLUSlength(String[] strs) {
Arrays.sort(strs, new Comparator<String>(){
public int compare(String a, String b) {
if (a.length() != b.length()) {
return b.length()-a.length();
} else {
return a.compareTo(b);
}
}
});
for (int i=0; i<strs.length; i++) {
boolean flag = (i == strs.length-1 || !strs[i].equals(strs[i+1]));
if (flag) {
for (int j=i-1; j>=0; j--) {
if (isSub(strs[i], strs[j])) {
flag = false;
break;
}
}
}
if (flag) {
return strs[i].length();
}
}
return -1;
}
private boolean isSub(String a, String b) {
if (a.length() <= b.length()) {
for (int state=1, i=0; i<b.length(); i++) {
int next = 1;
for (int j=0; j<=i && j<a.length(); j++) {
if (0 != (state&(1<<j)) && a.charAt(j) == b.charAt(i)) {
if (j == a.length()-1) {
return true;
}
next |= (1<<(j+1));
}
}
state |= next;
}
}
return false;
}
}
| DevinZ1993/LeetCode-Solutions | java/522.java | Java | mpl-2.0 | 1,490 | [
30522,
2270,
2465,
5576,
1063,
2270,
20014,
2424,
7393,
7770,
13512,
2232,
1006,
5164,
1031,
1033,
2358,
2869,
1007,
1063,
27448,
1012,
4066,
1006,
2358,
2869,
1010,
2047,
4012,
28689,
4263,
1026,
5164,
1028,
1006,
1007,
1063,
2270,
20014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
echo __DIR__;
require dirname(__DIR__) . "/HikerCommand.php";
function _manually_load_plugin() {
require dirname( __FILE__ ) . '/../hikerquotes.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
require getenv( 'WP_TESTS_DIR' ) . '/includes/bootstrap.php';
| jasonrhodes/wphackerguide | public/content/plugins/hikerquotes/tests/bootstrap.php | PHP | mit | 292 | [
30522,
1026,
1029,
25718,
9052,
1035,
1035,
16101,
1035,
1035,
1025,
5478,
16101,
18442,
1006,
1035,
1035,
16101,
1035,
1035,
1007,
1012,
1000,
1013,
21857,
29566,
14760,
4859,
1012,
25718,
1000,
1025,
3853,
1035,
21118,
1035,
7170,
1035,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<style>
table.head, table.foot { width: 100%; }
td.head-rtitle, td.foot-os { text-align: right; }
td.head-vol { text-align: center; }
table.foot td { width: 50%; }
table.head td { width: 33%; }
div.spacer { margin: 1em 0; }
</style>
<title>
STARTPROC(8)</title>
</head>
<body>
<div class="mandoc">
<table class="head">
<tbody>
<tr>
<td class="head-ltitle">
STARTPROC(8)</td>
<td class="head-vol">
The SuSE boot concept</td>
<td class="head-rtitle">
STARTPROC(8)</td>
</tr>
</tbody>
</table>
<div class="section">
<h1>NAME</h1> Startproc - Start processes identified by path name<div style="height: 0.00em;">
 </div>
Start_daemon - Start processes identified by path name</div>
<div class="section">
<h1>SYNOPSIS</h1><div style="margin-left: 5.00ex;text-indent: -5.00ex;" class="spacer">
<b>startproc</b> [<b>-fLves</b>] [[<b>-n </b>]<b><i>+/-<prio></i></b>] [<b>-</b>(<b>t</b>|<b>T</b>) <b><i><sec></i></b>] [<b>-u <i>user</i></b>] [<b>-g <i>group</i></b>] [<b>-l <i>log_file</i></b>|<b>-q</b>|<b>-d</b>] [<b>-p <i>pid_file</i></b>] [<b>-i <i>ignore_file</i></b>] [<b>-c <i>root</i></b>] <i>/path/to/executable</i> [<i>arguments for executable</i>]</div>
<div class="spacer">
</div>
<div style="margin-left: 5.00ex;text-indent: -5.00ex;" class="spacer">
<b>start_daemon</b> [<b>-fLve</b>] [<b>-n <i>+/-<prio></i></b>] [<b>-u <i>user</i></b>] [<b>-g <i>group</i></b>] [<b>-l <i>log_file</i></b>|<b>-q</b>|<b>-d</b>] [<b>-p <i>pid_file</i></b>] [<b>-i <i>ignore_file</i></b>] [<b>-c <i>root</i></b>] <i>/path/to/executable</i> [<i>arguments for executable</i>]</div>
</div>
<div class="section">
<h1>SYNOPSIS LSB 3.1</h1><div style="margin-left: 5.00ex;text-indent: -5.00ex;" class="spacer">
<b>start_daemon</b> [<b>-f</b>] [<b>-n <i>+/-<prio></i></b>] <i>/path/to/executable</i> [<i>arguments for executable</i>]</div>
</div>
<div class="section">
<h1>DESCRIPTION</h1> <b>startproc</b> and the LSB variant <b>start_daemon</b> check for all processes of the specified executable and starts it if <b>no</b> processes are found. Note that <b>startproc</b> is designed to start a daemon but not a kernel thread or a program which enables a kernel thread.<div class="spacer">
</div>
<b>startproc</b> does not use the pid to search for a process but the full path of the corresponding program which is used to identify the executable (see<b> proc</b>(5)). Only if the inode number (/proc/<b><pid></b>/exe) and the full name are unavailable (/proc/<b><pid></b>/cmdline) or if the executable changes its zeroth argument, <b>startproc</b> uses the base name (/proc/<b><pid></b>/stat) to identify the running program.<div class="spacer">
</div>
Extended functionality is provided by the <b>-p</b> option (former option <b>-f</b> changed due to the LSB specification). If this option is specified, <b>startproc</b> tries to check against the pid read from this file instead of the default (/var/run/<b><basename></b>.pid). The pid read from this file is compared against the pids of possible running processes that use the specified executable. In order to avoid confusion with stale pid files, a not up-to-date pid will be ignored.<div class="spacer">
</div>
For the possibility of having two different sessions of one binary program, the option <b>-i</b> <i>ignore_file</i> allows to specify a pid file which pid number is used to <b>ignore</b> all processes of corresponding process <b>session</b>.<div class="spacer">
</div>
The option <b>-v</b> makes <b>startproc</b> print out verbose diagnostics.<div class="spacer">
</div>
The <b>start_daemon</b> does not support the options <b>-</b>(<b>t</b>|<b>T</b>) <b><i><sec></i></b> for waiting for success and the option <b>-s</b> for a new session as this variant does not fork to start the executable.</div>
<div class="section">
<h1>REQUIRED</h1><dl>
<dt>
<i>/path/to/executable</i></dt>
<dd>
Specifies the executable by its full path name. This argument is always required. Everything that follows this path is considered options for the executable to be launched. Further information can be obtained from the respective manpage(s).</dd>
</dl>
</div>
<div class="section">
<h1>OPTIONS</h1><dl>
<dt>
[<b>-n </b>]<b><i>+/-<prio></i></b></dt>
<dd>
Set the nice level for the process. If used, this option should always be the first in the command line. The nice level <i><prio></i> may be specified in the range between -20 and +20. Only root is allowed to set negative nice values.</dd>
</dl>
<dl>
<dt>
<b>-e</b></dt>
<dd>
Bequeath only a minimal set of environment variables to the new process: <b>HOME</b>, <b>PATH</b>, <b>SHELL</b>, <b>RUNLEVEL</b>, and <b>PREVLEVEL</b>.</dd>
</dl>
<dl>
<dt>
<b>-p</b><i> pid_file</i></dt>
<dd>
(Former option <b>-f</b> changed due to the LSB specification.) Use an alternate pid file instead of the default (/var/run/<b><basename></b>.pid). The pid read from this file is being matched against the pid of running processes that have an executable with specified path. of the program. In order to avoid confusion with stale pid files, a not up-to-date pid will be ignored.</dd>
</dl>
<dl>
<dt>
<b>-i</b><i> ignore_file</i></dt>
<dd>
The pid found in this file is used as <b>session</b> id of the same binary program which should be ignored by <b>startproc</b>.</dd>
</dl>
<dl>
<dt>
<b>-f</b></dt>
<dd>
This option is required by the Linux Standard Base Specification (LSB). With this option the start of a process is forced.</dd>
</dl>
<dl>
<dt>
<b>-g</b><i> group</i></dt>
<dd>
Sets the group ID of the process to <i>gid</i>.</dd>
</dl>
<dl>
<dt>
<b>-l</b><i> log_file</i></dt>
<dd>
Redirect the process standard output and standard error to the file <i>log_file</i>.</dd>
</dl>
<dl>
<dt>
<b>-L</b></dt>
<dd>
This option causes symlinks to be followed, as the like-named option in <b>ls</b>(1). BR Note : for the file name the original name of the program is used instead of the name of the symbolic link.</dd>
</dl>
<dl>
<dt>
<b>-c</b><i> root</i></dt>
<dd>
Change root directory to <i>root</i>. Services which have been started with this option can only be checked by <b>checkproc</b>(8) and signaled by <b>killproc</b>(8) if <b>checkproc</b>(8) and <b>killproc</b>(8) are called with the same option argument for the option <b>-c</b>.</dd>
</dl>
<dl>
<dt>
<b>-q</b></dt>
<dd>
Equals to -l /dev/null (supresses output).</dd>
</dl>
<dl>
<dt>
<b>-d</b></dt>
<dd>
Let startproc expect that the started service will do a dialog by prompting for, e.g. a passphrase. This option implies a timeout of 15 seconds (-t 15).</dd>
</dl>
<dl>
<dt>
<b>-s</b></dt>
<dd>
Starts the process in a new session. The new task is a process group leader and has no controlling tty.</dd>
</dl>
<dl>
<dt>
<b>-t</b><i> <sec></i></dt>
<dd>
The number of seconds to wait after the successful start of a service. This options accepts the number of seconds to wait. You can specify some units after a given number: <b>s</b> for seconds, <b>m</b> for minutes, and <b>h</b> for hours to wait.</dd>
</dl>
<dl>
<dt>
<b>-T</b><i> <sec></i></dt>
<dd>
The same as for option <b>-t</b> but wait only on the started process not on childs forked by the process.</dd>
</dl>
<dl>
<dt>
<b>-u</b><i> user</i></dt>
<dd>
Sets the user ID of the process to <i>user</i>.</dd>
</dl>
<dl>
<dt>
<b>-v</b></dt>
<dd>
Verbose output.</dd>
</dl>
</div>
<div class="section">
<h1>EXAMPLE</h1><dl>
<dt>
<b>startproc /usr/sbin/sendmail</b></dt>
<dd>
</dd>
</dl>
<dl>
<dt>
</dt>
<dd>
starts <i>/usr/sbin/sendmail</i> if no sendmail process is found. If a pid file <i>sendmail.pid</i> exists in <i>/var/run/</i>, then the pid found in this file is used to search the process table for a process with an executable that matches the specified pathname, <i>/usr/sbin/sendmail</i>. If no matching process is found, <i>/usr/sbin/sendmail</i> is launched.</dd>
</dl>
<dl>
<dt>
<b>startproc -p /var/myrun/lpd.pid /usr/sbin/lpd</b></dt>
<dd>
</dd>
</dl>
<dl>
<dt>
</dt>
<dd>
starts <i>/usr/sbin/lpd</i> if there is no process with the pid found in <i>/var/myrun/lpd.pid</i> <b>and</b> no process in the actual process table exists that uses the specified binary.</dd>
</dl>
</div>
<div class="section">
<h1>EXIT CODES</h1> The exit codes have the following <b>LSB</b> conform conditions:<div class="spacer">
</div>
<div style="margin-left: 7.00ex;">
<dl>
<dt>
0</dt>
<dd>
Success</dd>
</dl>
<dl>
<dt>
1</dt>
<dd>
Generic or unspecified error</dd>
</dl>
<dl>
<dt>
2</dt>
<dd>
Invalid or excess argument(s)</dd>
</dl>
<dl>
<dt>
4</dt>
<dd>
Insufficient privilege(s)</dd>
</dl>
<dl>
<dt>
5</dt>
<dd>
Program is not installed</dd>
</dl>
<dl>
<dt>
7</dt>
<dd>
Program is not running</dd>
</dl>
</div>
<div class="spacer">
</div>
In some error cases, diagnostic output is sent to standard error, or, if standard error is not available, <b>syslogd</b>(8) is being used<b>.</b></div>
<div class="section">
<h1>NOTE</h1> <b>startproc</b> is a replacement for the Bourne shell function <b>daemon</b> found in the widely used SysVinit package of Miquel van Smoorenburg, <miquels@cistron.nl>. <b>startproc</b> is not useful to start kernel threads. This should be done by service utilities designed for the purpose to accomplish this task.</div>
<div class="section">
<h1>BUGS</h1> Identifying a process based on the executable file and the corresponding inode number only works if the process stays alive during startproc's execution. Processes rewriting their zeroth argument or shell scripts (the inode number of the shell executable file is not identical to that of the script file) may not be identified by a filename path.<div class="spacer">
</div>
<b>Startproc</b> does not start a process if there already exists one being in the zombie state. Zombies are processes which arn't alive but listed in the process table to have the exit status ready for the corresponding parent processes. Therefore the parent processes should be check out.<div class="spacer">
</div>
<b>Start_daemon</b> is not able to check for exit status of an executable daemon because after the final <b>execve</b>(3) the <b>start_daemon</b> as an own process does not exit anymore.</div>
<div class="section">
<h1>FILES</h1><dl>
<dt>
<i>/proc/</i></dt>
<dd>
path to the proc file system (see<b> proc</b>(5)).</dd>
</dl>
<dl>
<dt>
<i>/etc/init.d/</i></dt>
<dd>
path to the SuSE boot concept script base directory as required by the Linux Standard Base Specification (LSB) (see<b> init.d</b>(7)).</dd>
</dl>
</div>
<div class="section">
<h1>SEE ALSO</h1> <b>checkproc</b>(8), <b>killproc</b>(8), <b>insserv</b>(8), <b>init.d</b>(7), <b>kill</b>(1), <b>skill</b>(1), <b>killall</b>(8), <b>killall5</b>(8), <b>signal</b>(7), <b>proc</b>(5).</div>
<div class="section">
<h1>COPYRIGHT</h1> 1994-2007 Werner Fink, 1996-2000 SuSE GmbH Nuernberg, Germany. 2007 SuSE LINUX Products GmbH, Nuernberg, Germany.</div>
<div class="section">
<h1>AUTHOR</h1> Werner Fink <werner@suse.de></div>
<table class="foot">
<tr>
<td class="foot-date">
November 30, 2007</td>
<td class="foot-os">
3rd Berkeley Distribution</td>
</tr>
</table>
</div>
</body>
</html>
| fusion809/fusion809.github.io-old | man/startproc.8.html | HTML | gpl-3.0 | 11,265 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1013,
1028,
1026,
2806,
1028,
2795,
1012,
2132,
1010,
2795,
1012,
3329,
1063,
9381,
1024,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Signals.h
*
* Created on: 07.06.2017
* Author: abt674
*
*
*/
#ifndef SIGNALS_H_
#define SIGNALS_H_
//Lightbarriers and Sensor
#define INLET_IN_VAL 0b0000000000000001
#define INLET_OUT_VAL 0b0000000000000011
#define HEIGHTMEASUREMENT_IN_VAL 0b0000000000000010
#define HEIGHTMEASUREMENT_OUT_VAL 0b0000000000000110
//#define SENSOR_HEIGHT 0b0000000000000100
#define SWITCH_IN_VAL 0b0000000000001000
#define SWITCH_OUT_VAL 0b0000000000011000
#define METAL_DETECT_VAL 0b0000000000010000
#define SWITCH_OPEN_VAL 0b0000000000100000
#define SWITCH_CLOSED_VAL 0b0000000001100000
#define SLIDE_IN_VAL 0b0000000001000000
#define SLIDE_OUT_VAL 0b0000000011000000
#define OUTLET_IN_VAL 0b0000000010000000
#define OUTLET_OUT_VAL 0b0000000110000000
//Buttons
#define BUTTON_START_VAL 0b0001000000000000
#define BUTTON_STOP_VAL 0b0010000000000000
#define BUTTON_RESET_VAL 0b0100000000000000
#define BUTTON_ESTOP_IN_VAL 0b1000000000000000
#define BUTTON_ESTOP_OUT_VAL 0b1100000000000000
namespace interrupts {
enum interruptSignals : int32_t {
INLET_IN = INLET_IN_VAL,
INLET_OUT = INLET_OUT_VAL,
HEIGHTMEASUREMENT_IN = HEIGHTMEASUREMENT_IN_VAL,
HEIGHTMEASUREMENT_OUT = HEIGHTMEASUREMENT_OUT_VAL,
SWITCH_IN = SWITCH_IN_VAL,
SWITCH_OUT = SWITCH_OUT_VAL,
METAL_DETECT = METAL_DETECT_VAL,
SWITCH_OPEN = SWITCH_OPEN_VAL,
SWITCH_CLOSED = SWITCH_CLOSED_VAL,
SLIDE_IN = SLIDE_IN_VAL,
SLIDE_OUT = SLIDE_OUT_VAL,
OUTLET_IN = OUTLET_IN_VAL,
OUTLET_OUT = OUTLET_OUT_VAL,
BUTTON_START = BUTTON_START_VAL,
BUTTON_STOP = BUTTON_STOP_VAL,
BUTTON_RESET = BUTTON_RESET_VAL,
BUTTON_ESTOP_IN = BUTTON_ESTOP_IN_VAL,
BUTTON_ESTOP_OUT = BUTTON_ESTOP_OUT_VAL
};
}
#endif /* SIGNALS_H_ */
| ReneHerthel/ConveyorBelt | src/ISR/Signals.h | C | mit | 1,925 | [
30522,
1013,
1008,
1008,
7755,
1012,
1044,
1008,
1008,
2580,
2006,
1024,
5718,
1012,
5757,
1012,
2418,
1008,
3166,
1024,
11113,
2102,
2575,
2581,
2549,
1008,
1008,
1008,
1013,
1001,
2065,
13629,
2546,
7755,
1035,
1044,
1035,
1001,
9375,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Unona fulva Wall. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Magnoliales/Annonaceae/Unona/Unona fulva/README.md | Markdown | apache-2.0 | 167 | [
30522,
1001,
27776,
2532,
11865,
22144,
2813,
1012,
2427,
1001,
1001,
1001,
1001,
3570,
3970,
1001,
1001,
1001,
1001,
2429,
2000,
2248,
3269,
3415,
5950,
1001,
1001,
1001,
1001,
2405,
1999,
19701,
1001,
1001,
1001,
1001,
2434,
2171,
19701,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace BecklynLayout\Model;
use BecklynLayout\Entity\Download;
/**
*
*/
class DownloadModel
{
/**
* @var string
*/
private $downloadDir;
/**
* Relative to web/
*/
const RELATIVE_DOWNLOAD_DIR = "downloads";
/**
* @param $baseDir
*/
public function __construct ($baseDir)
{
$this->downloadDir = rtrim($baseDir, "/") . "/web/" . self::RELATIVE_DOWNLOAD_DIR;
}
/**
* Returns a list of all downloads
*
* @return Download[]
*/
public function getAllDownloads ()
{
try
{
$directoryIterator = new \DirectoryIterator($this->downloadDir);
$downloads = [];
foreach ($directoryIterator as $file)
{
if (!$file->isFile())
{
continue;
}
// skip hidden files
if ("." === $file->getBasename()[0])
{
continue;
}
$downloads[$file->getFilename()] = new Download($file, self::RELATIVE_DOWNLOAD_DIR);
}
ksort($downloads);
return $downloads;
}
catch (\UnexpectedValueException $e)
{
return [];
}
}
}
| Becklyn/Gluggi | src/Model/DownloadModel.php | PHP | bsd-3-clause | 1,330 | [
30522,
1026,
1029,
25718,
3415,
15327,
10272,
9644,
8485,
5833,
1032,
2944,
1025,
2224,
10272,
9644,
8485,
5833,
1032,
9178,
1032,
8816,
1025,
1013,
1008,
1008,
1008,
1008,
1013,
2465,
8816,
5302,
9247,
1063,
1013,
1008,
1008,
1008,
1030,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace Sidus\EAVDataGridBundle\Model;
use Sidus\DataGridBundle\Model\DataGrid as BaseDataGrid;
use Sidus\EAVFilterBundle\Configuration\EAVFilterConfigurationHandler;
use Sidus\EAVModelBundle\Model\FamilyInterface;
use Sidus\EAVModelBundle\Translator\TranslatableTrait;
use Symfony\Component\Translation\TranslatorInterface;
/**
* Extended datagrid configuration for EAV entities
*/
class DataGrid extends BaseDataGrid
{
use TranslatableTrait;
/** @var FamilyInterface */
protected $family;
/**
* DataGrid constructor.
*
* @param string $code
* @param array $configuration
* @param TranslatorInterface $translator
*
* @throws \Exception
*/
public function __construct($code, array $configuration, TranslatorInterface $translator = null)
{
$this->translator = $translator;
parent::__construct($code, $configuration);
}
/**
* @return FamilyInterface
*/
public function getFamily()
{
return $this->family;
}
/**
* @param FamilyInterface $family
*
* @return DataGrid
*/
public function setFamily($family)
{
$this->family = $family;
$filterConfig = $this->getFilterConfig();
if ($filterConfig instanceof EAVFilterConfigurationHandler) {
$filterConfig->setFamily($family);
}
return $this;
}
/**
* @param string $key
* @param array $columnConfiguration
*
* @throws \Exception
*/
protected function createColumn($key, array $columnConfiguration)
{
if ($this->translator) {
$columnConfiguration['translator'] = $this->translator;
}
$this->columns[] = new Column($key, $this, $columnConfiguration);
}
}
| VincentChalnot/SidusEAVDataGridBundle | Model/DataGrid.php | PHP | gpl-2.0 | 1,823 | [
30522,
1026,
1029,
25718,
3415,
15327,
15765,
2271,
1032,
19413,
16872,
6790,
16523,
3593,
27265,
2571,
1032,
2944,
1025,
2224,
15765,
2271,
1032,
2951,
16523,
3593,
27265,
2571,
1032,
2944,
1032,
2951,
16523,
3593,
2004,
2241,
6790,
16523,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<section data-ng-controller="SlideshowsListController">
<div class='iqss-page-header'>
<div>
<div class='iqss-slideshowlist-showOnlyMineContainer'>
<input id='showOnlyMine' type="checkbox" ng-model="filterParameters.showOnlyMine" ng-change='filterSlideshows()'>
<label for='showOnlyMine'><span></span>Show only mine</label>
</div>
<div tag-and-name-filter search-Provider="searchProvider"></div>
</div>
</div>
<div class='iqss-slideshowlist-content' infinite-scroll handler='getNextChunk()'>
<section data-ng-repeat="slideshow in slideshows" >
<div class="iqss-slideshowlist-slideshow" ng-if='!slideshow.isPlacheloderForCreateNew || showCreateNewTile'>
<div ng-if='slideshow.isPlacheloderForCreateNew' class='iqss-slideshowlist-slideshow-createNew-container iqss-slideshows-links' ng-click='navigateToCreateNewSlideShow()' ng-show='showCreateNewTile'>
<div class='iqss-slideshowlist-slideshow-createNew'>
<span class='iqss-slideshowlist-slideshow-createNew-link'>Create new</span>
</div>
</div>
<div ng-if='!slideshow.isPlacheloderForCreateNew'>
<div>
<div class="iqss-slideshowlist-slideshow-title-container" ng-class="{'iqss-slideshowlist-slideshow-title-container-published': slideshow.published, 'iqss-slideshowlist-slideshow-title-container-draft': !slideshow.published}">
<div data-ng-bind="slideshow.name"></div>
</div>
</div>
<a class='iqss-slideshowlist-slideshow-preview' href="#!/slideshows/{{slideshow._id}}" data-ng-controller="PlayerController" ng-init="initPreviewFirstSlide(slideshow._id)">
<div ng-player style="background-color: #ffffff;height:100px;max-height:100%;width:100%;display:inline-block" slides="slides" ng-player-on-hold='true'></div>
</a>
<div class='iqss-slideshowlist-slideshow-linksContainer'>
<a data-ng-href='#!/slideshows/{{slideshow._id}}/edit' class='iqss-slideshowlist-slideshow-editLink'></a>
<a href='#' ng-click="publishSlideShow(slideshow)" class='iqss-slideshowlist-slideshow-publishLink'></a>
<a href='#' data-ng-click='remove(slideshow);' class='iqss-slideshowlist-slideshow-deleteLink'></a>
<div class='iqss-slideshowlist-slideshow-delimiter'>
</div>
</div>
<div class='iqss-slideshowlist-slideshow-authorName' data-ng-bind="slideshow.user.displayName"></div>
<div class='iqss-slideshowlist-slideshow-lastModified'>Last modified: <span data-ng-bind="slideshow.modified | date:'dd.MM.yyyy'"></span></div>
</div>
</div>
</section>
<div class="iqss-slideshowlist-slideshow-empty">
</div>
<div class="iqss-slideshowlist-slideshow-empty">
</div>
<div class="iqss-slideshowlist-slideshow-empty">
</div>
<div class="iqss-slideshowlist-slideshow-empty">
</div>
<div class="iqss-slideshowlist-slideshow-empty">
</div>
</div>
</section>
| tmol/iQSlideShow | public/modules/slideshows/views/list-slideshows.client.view.html | HTML | mit | 3,405 | [
30522,
1026,
2930,
2951,
1011,
12835,
1011,
11486,
1027,
1000,
14816,
14406,
14540,
2923,
8663,
13181,
10820,
1000,
1028,
1026,
4487,
2615,
2465,
1027,
1005,
26264,
4757,
1011,
3931,
1011,
20346,
1005,
1028,
1026,
4487,
2615,
1028,
1026,
44... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
body {
padding-top:50px;
padding-bottom: 40px;
margin-left:200px;
-webkit-transition: margin 500ms ease;
-moz-transition: margin 500ms ease;
-ms-transition: margin 500ms ease;
-o-transition: margin 500ms ease;
transition: margin 500ms ease;
font-family: "Helvetica Neue",Helvetica,Arial,"Microsoft Yahei UI","Microsoft YaHei",SimHei,"宋体",simsun,sans-serif;
font-weight: normal;
}
@media (max-width: 980px) {
/* Enable use of floated navbar text */
.navbar-text.pull-right {
float: none;
padding-left: 5px;
padding-right: 5px;
}
}
@media (max-width: 979px) {
.navbar-fixed-top { position:fixed; }
}
.navbar-inverse .brand { color:#fff; text-shadow: 0 1px 0 #FFFFFF;}
.brand img {float:left; margin:2px 10px 0 0; }
.brand .label {
position:relative;
left:10px;
top:-3px;
font-weight:normal;
font-size:9px;
background:#666;
-webkit-box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.7);
-moz-box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.7);
box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.7);
}
.edit .demo { margin-left:0px; margin-top:10px; padding:30px 15px 15px; border: 1px solid #DDDDDD; border-radius: 4px; position:relative; word-wrap: break-word;}
.edit .demo:after {
background-color: #F5F5F5;
border: 1px solid #DDDDDD;
border-radius: 4px 0 4px 0;
color: #9DA0A4;
content: "Container";
font-size: 12px;
font-weight: bold;
left: -1px;
padding: 3px 7px;
position: absolute;
top: -1px;
}
.sidebar-nav {
position:fixed;
width:200px;
left:0px;
bottom:0;
top:44px;
background:#ccc;
padding: 9px 0; z-index:10;
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
-ms-transition: all 500ms ease;
-o-transition: all 500ms ease;
transition: all 500ms ease;
}
.sidebar-nav .nav-header { cursor:pointer; font-size:14px; color:#666; text-shadow:0 1px 0 rgba(0, 0, 0, 0.3);}
.sidebar-nav .nav-header span.label { font-size:10px; /*padding-bottom:0;*/ position:relative; top:-1px;}
.sidebar-nav .nav-header i.icon-plus {}
.sidebar-nav .nav-header .popover {color:#999; text-shadow:none;}
.popover-info {position:relative;}
.popover-info .popover {display:none; top: -12.5px; left:15px; }
.popover-info:hover .popover {display:block; opacity:1; width:400px;}
.popover-info:hover .popover .arrow {top:23px;}
.sidebar-nav .accordion-group { border:none; }
.boxes {}
.sidebar-nav li { line-height:25px; }
.sidebar-nav .box { line-height:25px; width:170px; height:25px; }
.sidebar-nav .preview { display: block; color:#666; font-size:12px; line-height:22px;}
.sidebar-nav .preview input { width:90px; padding:0 10px; background:#bbb; font-size:10px; color:#999; line-height:20px; height:20px; position:relative; top:-1px; }
.sidebar-nav .view { display: none; }
.sidebar-nav .remove,
.sidebar-nav .configuration { display: none; }
.sidebar-nav .boxes { display:none;}
.demo .preview { display: none; }
.demo .box .view { display: block; padding-top:30px;}
.ui-draggable-dragging .view { display:block;}
/*.demo .ui-sortable-placeholder { outline: 5px dotted #ddd; visibility: visible!Important; border-radius: 4px; }*/
.ui-sortable-placeholder { outline: 1px dashed #ddd;visibility: visible!Important; border-radius: 4px;}
.edit .drag { position: absolute; top: 0;right: 0; cursor: pointer; }
.box,.lyrow { position:relative;}
.edit .demo .lyrow .drag { top:5px; right:80px; z-index:10; }
.edit .demo .column .box .drag { top:5px; }
.edit .demo .column .box .configuration {position: absolute; top: 3px; right: 140px;white-space:nowrap; }
.edit .demo .remove { position: absolute; top: 5px; right: 5px; z-index:10; }
.demo .configuration {
filter: alpha(opacity=0);
opacity: 0;
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
-ms-transition: all 500ms ease;
-o-transition: all 500ms ease;
transition: all 500ms ease;
}
.demo .drag, .demo .remove {
filter: alpha(opacity=20); opacity: 0.2;
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
-ms-transition: all 500ms ease;
-o-transition: all 500ms ease;
transition: all 500ms ease;
}
.demo .lyrow:hover > .drag,
.demo .lyrow:hover > .configuration,
.demo .lyrow:hover > .remove,
.demo .box:hover .drag,
.demo .box:hover .configuration,
.demo .box:hover .remove { filter: alpha(opacity=100); opacity: 1; }
.edit .demo .row-fluid:before {
background-color: #F5F5F5;
border: 1px solid #DDDDDD;
border-radius: 4px 0 4px 0;
color: #9DA0A4;
content: "Row";
font-size: 12px;
font-weight: bold;
left: -1px;
line-height:2;
padding: 3px 7px;
position: absolute;
top: -1px;
}
.demo .row-fluid {
background-color: #F5F5F5;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-shadow: inset 0 1px 13px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 1px 13px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 13px rgba(0, 0, 0, 0.1);
border: 1px solid #DDDDDD;
border-radius: 4px 4px 4px 4px;
margin: 15px 0;
position: relative;
padding: 25px 14px 0;
}
.edit .column:after {
background-color: #F5F5F5;
border: 1px solid #DDDDDD;
border-radius: 4px 0 4px 0;
color: #9DA0A4;
content: "Column";
font-size: 12px;
font-weight: bold;
left: -1px;
padding: 3px 7px;
position: absolute;
top: -1px;
}
.column {
background-color: #FFFFFF;
border: 1px solid #DDDDDD;
border-radius: 4px 4px 4px 4px;
margin: 15px 0;
padding: 39px 19px 24px;
position: relative;
}
/* preview */
body.devpreview { margin-left:0px;}
.devpreview .sidebar-nav {
left:-200px;
-webkit-transition: all 0ms ease;
-moz-transition: all 0ms ease;
-ms-transition: all 0ms ease;
-o-transition: all 0ms ease;
transition: all 0ms ease;
}
.devpreview .drag, .devpreview .configuration, .devpreview .remove { display:none !Important; }
.sourcepreview .column, .sourcepreview .row-fluid, .sourcepreview .demo .box {
margin:0px 0;
padding:0px;
background:none;
border:none;
-webkit-box-shadow: inset 0 0px 0px rgba(0, 0, 0, 0.00);
-moz-box-shadow: inset 0 0px 0px rgba(0, 0, 0, 0.00);
box-shadow: inset 0 0px 0px rgba(0, 0, 0, 0.00);
}
.devpreview .demo .box, .devpreview .demo .row-fluid { padding-top:0; background:none; }
.devpreview .demo .column { padding-top:19px; padding-bottom:19px; }
#download-layout { display: none }
#editorModal textarea,#sourceModal textarea,
#downloadModal textarea { width:100%;height:280px;resize: none;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box; }
#editorModal, #sourceModal {width:640px;}
a.language-selected { font-style: italic; font-weight: bold; }
| blale-zhang/codegen | WebContent/component/layoutit-master/css/layoutit.css | CSS | mit | 6,533 | [
30522,
2303,
1063,
11687,
4667,
1011,
2327,
1024,
2753,
2361,
2595,
1025,
11687,
4667,
1011,
3953,
1024,
2871,
2361,
2595,
1025,
7785,
1011,
2187,
1024,
3263,
2361,
2595,
1025,
1011,
4773,
23615,
1011,
6653,
1024,
7785,
3156,
5244,
7496,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require 'spec_helper'
describe Padrino::GelfLogger do
include RR::Adapters::MiniTest
padrino_levels = [:fatal, :error, :warn, :info, :debug, :devel]
attr_reader :logger
before do
@logger = Padrino::GelfLogger.new('0.0.0.0', 12201, 'WAN', :facility => 'Padrino::GelfLogger', :level => GELF::DEBUG)
end
it "#fatal" do
mock(logger).notify_with_level(4, "test")
logger.fatal "test"
end
it "#error" do
mock(logger).notify_with_level(3, "test")
logger.error "test"
end
it "#warn" do
mock(logger).notify_with_level(2, "test")
logger.warn "test"
end
it "#info" do
mock(logger).notify_with_level(1, "test")
logger.info "test"
end
it "#debug" do
mock(logger).notify_with_level(0, "test")
logger.debug "test"
end
it "#devel" do
mock(logger).notify_with_level(0, "test")
logger.devel "test"
end
%w{fatal error warn info debug devel}.each do |supported_level|
it "supports ##{supported_level}?" do
assert logger.public_send("#{supported_level}?")
end
end
it '#<<' do
mock(logger).notify_with_level(logger.level, 'test')
logger << 'test'
end
it '#bench' do
mock(logger).notify_with_level(0, {short_message: '(action 1000ms) - short_message', full_message: nil, _Duration: 1000, _Action: 'action'})
Timecop.freeze(Time.local(2012, 12, 20, 20, 12, 1)) do
logger.bench("action", Time.local(2012, 12, 20, 20, 12, 00), "short_message", level=:debug, color=:yellow)
end
end
it '#bench with optional full_message' do
mock(logger).notify_with_level(0, {short_message: '(action 1000ms) - message', full_message: "full", _Duration: 1000, _Action: 'action'})
Timecop.freeze(Time.local(2012, 12, 20, 20, 12, 1)) do
logger.bench("action", Time.local(2012, 12, 20, 20, 12, 00), "message", level=:debug, color=:yellow, full_message="full")
end
end
it 'should respond to #log_static for sinatra and not log anything' do
assert_respond_to logger, :log_static
end
it 'should respond to #log and not log anything' do
assert_respond_to logger, :log
end
end
| pzol/padrino_gelflogger | spec/gelf_logger_spec.rb | Ruby | mit | 2,115 | [
30522,
5478,
1005,
28699,
1035,
2393,
2121,
1005,
6235,
11687,
17815,
1024,
1024,
21500,
10258,
8649,
4590,
2079,
2421,
25269,
1024,
1024,
15581,
2545,
1024,
1024,
7163,
22199,
11687,
17815,
1035,
3798,
1027,
1031,
1024,
10611,
1010,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
get_header();
?>
<!-- main content -->
<section id="main-content" class="container">
<div class="row">
<div class="col col-12">
<h3>404 Not found</h3>
</div>
</div>
<!-- end main-content -->
</section>
<?php
get_footer();
?> | interglobalvision/materiadedibujo-org | 404.php | PHP | apache-2.0 | 251 | [
30522,
1026,
1029,
25718,
2131,
1035,
20346,
1006,
1007,
1025,
1029,
1028,
1026,
999,
1011,
1011,
2364,
4180,
1011,
1011,
1028,
1026,
2930,
8909,
1027,
1000,
2364,
1011,
4180,
1000,
2465,
1027,
1000,
11661,
1000,
1028,
1026,
4487,
2615,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html lang = "en">
<head>
<title> Cultural Blog</title>
<link href='http://fonts.googleapis.com/css?family=Italianno' rel='stylesheet' type='text/css'>
</head>
<style type="text/css">
h1 {
text-align: center;
margin-top: 3%
}
p {
}
body {
background: url("http://www.hdwallpapers.in/walls/hd_sky_blue_beach-HD.jpg");
background-size: cover;
font-family: 'Italianno', serif;
font-size: 32px
}
.question {
color: #4D4D4D;
margin-top: 3%
}
.answer {
}
</style>
<body>
<h1>Here are my answers to Q&A:</h1>
<p class="question">Q: When you think of the times in your life where you've been the happiest, the proudest, or the most satisfied, which of the following values come to mind?</p>
<p class="answer">A: Accomplishment, Achievement, Adventure, Autonomy, Relationships, Commitment, Courage, Creativity, Competence, Confidence, Credibility, Decisiveness, Effectiveness, Excitement, Faith, Freedom, Fiendships, Growth, Having a family, Health, Helping other people, Independence, Inner harmony, Insight, Justice, Knowledge, Peace, Personal development, Pleasure, Romance, Security, Serenity, Sophistication, Spirituality, Tranquility, Truth, Vibrancy, Wisdom</p>
<p class="question">Q: Pick one value and write a couple of sentences about why one of the values you chose is important to you</p>
<p class="answer">A: Having faith is the source of everything you need in life. Faith in god and yourself. It brings all other qualities and values you need in life. It brings peace, Inner harmony, Serenity, Courage, Confidence, and all other values I mentioned above.</p>
<p class="question">Q: Answer the following for the values you chose in Exercise 1: In general, I try to live up to these values: Disagree 1 ----- 2 ----- 3 ----- 4 ----- 5 Agree</p>
<p class="answer">A: I have to say 5. I try my best to live up to those values because they do make me happy and satisfied.</p>
<p class="question">Q: What was the last topic that someone asked for your advice on?</p>
<p class="answer">A: A close friend of mine got accepted in couple of universities for p.h.d and he asked for my advice about the cities and which university he should attend.</p>
</body>
| Parjam/parjam.github.io | week2_cultural_blog.html | HTML | mit | 2,212 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
11374,
1027,
1000,
4372,
1000,
1028,
1026,
2132,
1028,
1026,
2516,
1028,
3451,
9927,
1026,
1013,
2516,
1028,
1026,
4957,
17850,
12879,
1027,
1005,
8299,
1024,
1013,
1013,
15489,
2015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require_relative '../lib/panlex_client'
| laMarciana/panlex_client | spec/spec_helper.rb | Ruby | gpl-3.0 | 40 | [
30522,
5478,
1035,
5816,
1005,
1012,
1012,
1013,
5622,
2497,
1013,
6090,
2571,
2595,
1035,
7396,
1005,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
\skillfeat{Mounted Combat}{[Skill:Ride]}
{You are at your best when fighting with an ally that you are sitting on.}
{Once per turn, you may attempt to negate an attack that hits your mount by making a Ride skill check with a DC equal to the AC that the attack hit. Attacks that do not require an attack roll cannot be negated in this way.}
{While Mounted, you may take a charge attack at any point along your mount's movement, so long as your mount is moving in a straight line up to the point of your attack.}
{You suffer no penalty to your ride or handle animal skill checks when training or riding unusual mounts such as magical beasts or dragons.}
{You may use your Ride Check in place of your mount's Balance, Jump, Climb, or Reflex Saving Throws.}
{Any time a spell effect would target your mount, you may elect to have it target you instead. Any time a spell effect would target you, you may elect to have it affect your Mount instead.} | vlad-malkav/Tome-Rules-with-Errata | current-source/phb/feats/skill/mountedcombat.tex | TeX | gpl-2.0 | 943 | [
30522,
1032,
8066,
7959,
4017,
1063,
5614,
4337,
1065,
1063,
1031,
8066,
1024,
4536,
1033,
1065,
1063,
2017,
2024,
2012,
2115,
2190,
2043,
3554,
2007,
2019,
9698,
2008,
2017,
2024,
3564,
2006,
1012,
1065,
1063,
2320,
2566,
2735,
1010,
201... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
---
layout: post
title: Download e Instalação do Visual Studio
tags:
- '#VisualStudio'
- '#Instalação'
---
<div style="text-align:center">
<p><img src="https://raw.githubusercontent.com/mateusbtlopes/mateusbtlopes.github.io/master/_posts/img/VisualStudio5.png" alt="Download e Instalação do Visual Studio" height="180" width="480"/></p>
</div>
<p>Neste tutorial faremos o download e a instalação do Microsoft Visual Studio.</p>
<h3 id="heading3">Download</h3>
<p>1. Faça uma busca no google ou no site da própria Microsoft por "<a href="https://www.visualstudio.com/downloads/" target="_blank">Microsoft Visual Studio</a>".</p>
<p>2. Selecione a versão desejada, no meu caso estou utilizando a versão Professional, em seguida clique no link <strong>"Download"</strong> para fazer o download do software. </p>
<hr/>
<h3 id="heading3">Instalação</h3>
<p>1. Execute o instalador que acabamos de fazer download e uma tela semelhante a exibida abaixo aparecerá para que você escolha o diretorio de instalação e aceite a licença de uso do Visual Studio, clique em "Next".</p>
<p><img src="https://raw.githubusercontent.com/mateusbtlopes/mateusbtlopes.github.io/master/_posts/img/VisualStudio1.png" alt="Visual Studio - Diretório de instalação e licença de uso" /></p>
<p>2. Na próxima tela serão exibidas as opções de features que você pode instalar junto com seu Visual Studio, selecione as festaures que desejar instalar e clique em "Next".</p>
<p><img src="https://raw.githubusercontent.com/mateusbtlopes/mateusbtlopes.github.io/master/_posts/img/VisualStudio2.png" alt="Visual Studio - Features da instalação" /></p>
<p>3. Aguarde o processo de instalação ser concluído.</p>
<p><img src="https://raw.githubusercontent.com/mateusbtlopes/mateusbtlopes.github.io/master/_posts/img/VisualStudio3.png" alt="Visual Studio - Processo de Instalação" /></p>
<p>4. Ao final do processo de instalação temos o Visual Studio instalado e pronto para ser usado.</p>
<p><img src="https://raw.githubusercontent.com/mateusbtlopes/mateusbtlopes.github.io/master/_posts/img/VisualStudio4.png" alt="Visual Studio - Instalação Concluída" /></p>
| mateusblopes/mateusblopes.github.io | _posts/2016-10-27-download e instalacao visual studio.md | Markdown | mit | 2,216 | [
30522,
1011,
1011,
1011,
9621,
1024,
2695,
2516,
1024,
8816,
1041,
16021,
9080,
19629,
2080,
2079,
5107,
2996,
22073,
1024,
1011,
1005,
1001,
26749,
8525,
20617,
1005,
1011,
1005,
1001,
16021,
9080,
19629,
2080,
1005,
1011,
1011,
1011,
1026... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*=========================================================================
Program: Visualization Toolkit
Module: vtkBitArray.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkBitArray - dynamic, self-adjusting array of bits
// .SECTION Description
// vtkBitArray is an array of bits (0/1 data value). The array is packed
// so that each byte stores eight bits. vtkBitArray provides methods
// for insertion and retrieval of bits, and will automatically resize
// itself to hold new data.
#ifndef vtkBitArray_h
#define vtkBitArray_h
#include "vtkCommonCoreModule.h" // For export macro
#include "vtkDataArray.h"
class vtkBitArrayLookup;
class VTKCOMMONCORE_EXPORT vtkBitArray : public vtkDataArray
{
public:
static vtkBitArray *New();
vtkTypeMacro(vtkBitArray,vtkDataArray);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Allocate memory for this array. Delete old storage only if necessary.
// Note that ext is no longer used.
int Allocate(vtkIdType sz, vtkIdType ext=1000);
// Description:
// Release storage and reset array to initial state.
void Initialize();
// satisfy vtkDataArray API
int GetDataType() {return VTK_BIT;};
int GetDataTypeSize() { return 0; }
// Description:
// Set the number of n-tuples in the array.
void SetNumberOfTuples(vtkIdType number);
// Description:
// Set the tuple at the ith location using the jth tuple in the source array.
// This method assumes that the two arrays have the same type
// and structure. Note that range checking and memory allocation is not
// performed; use in conjunction with SetNumberOfTuples() to allocate space.
virtual void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray* source);
// Description:
// Insert the jth tuple in the source array, at ith location in this array.
// Note that memory allocation is performed as necessary to hold the data.
virtual void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray* source);
// Description:
// Copy the tuples indexed in srcIds from the source array to the tuple
// locations indexed by dstIds in this array.
// Note that memory allocation is performed as necessary to hold the data.
virtual void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds,
vtkAbstractArray *source);
// Description:
// Copy n consecutive tuples starting at srcStart from the source array to
// this array, starting at the dstStart location.
// Note that memory allocation is performed as necessary to hold the data.
virtual void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart,
vtkAbstractArray* source);
// Description:
// Insert the jth tuple in the source array, at the end in this array.
// Note that memory allocation is performed as necessary to hold the data.
// Returns the location at which the data was inserted.
virtual vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray* source);
// Description:
// Get a pointer to a tuple at the ith location. This is a dangerous method
// (it is not thread safe since a pointer is returned).
double *GetTuple(vtkIdType i);
// Description:
// Copy the tuple value into a user-provided array.
void GetTuple(vtkIdType i, double * tuple);
// Description:
// Set the tuple value at the ith location in the array.
void SetTuple(vtkIdType i, const float * tuple);
void SetTuple(vtkIdType i, const double * tuple);
// Description:
// Insert (memory allocation performed) the tuple into the ith location
// in the array.
void InsertTuple(vtkIdType i, const float * tuple);
void InsertTuple(vtkIdType i, const double * tuple);
// Description:
// Insert (memory allocation performed) the tuple onto the end of the array.
vtkIdType InsertNextTuple(const float * tuple);
vtkIdType InsertNextTuple(const double * tuple);
// Description:
// These methods remove tuples from the data array. They shift data and
// resize array, so the data array is still valid after this operation. Note,
// this operation is fairly slow.
virtual void RemoveTuple(vtkIdType id);
virtual void RemoveFirstTuple();
virtual void RemoveLastTuple();
// Description:
// Set the data component at the ith tuple and jth component location.
// Note that i is less then NumberOfTuples and j is less then
// NumberOfComponents. Make sure enough memory has been allocated (use
// SetNumberOfTuples() and SetNumberOfComponents()).
void SetComponent(vtkIdType i, int j, double c);
// Description:
// Free any unneeded memory.
void Squeeze();
// Description:
// Resize the array while conserving the data.
virtual int Resize(vtkIdType numTuples);
// Description:
// Get the data at a particular index.
int GetValue(vtkIdType id);
// Description:
// Fast method based setting of values without memory checks. First
// use SetNumberOfValues then use SetValue to actually set them.
// Specify the number of values for this object to hold. Does an
// allocation as well as setting the MaxId ivar. Used in conjunction with
// SetValue() method for fast insertion.
void SetNumberOfValues(vtkIdType number);
// Description:
// Set the data at a particular index. Does not do range checking. Make sure
// you use the method SetNumberOfValues() before inserting data.
void SetValue(vtkIdType id, int value);
// Description:
// Inserts values and checks to make sure there is enough memory
void InsertValue(vtkIdType id, int i);
// Description:
// Set a value in the array from a variant.
void SetVariantValue(vtkIdType idx, vtkVariant value);
// Description:
// Inserts values from a variant and checks to ensure there is enough memory
void InsertVariantValue(vtkIdType idx, vtkVariant value);
vtkIdType InsertNextValue(int i);
// Description:
// Insert the data component at ith tuple and jth component location.
// Note that memory allocation is performed as necessary to hold the data.
virtual void InsertComponent(vtkIdType i, int j, double c);
// Description:
// Direct manipulation of the underlying data.
unsigned char *GetPointer(vtkIdType id) {return this->Array + id/8;}
// Description:
// Get the address of a particular data index. Make sure data is allocated
// for the number of items requested. Set MaxId according to the number of
// data values requested.
unsigned char *WritePointer(vtkIdType id, vtkIdType number);
void* WriteVoidPointer(vtkIdType id, vtkIdType number)
{ return this->WritePointer(id, number); }
void *GetVoidPointer(vtkIdType id)
{
return static_cast<void *>(this->GetPointer(id));
}
// Description:
// Deep copy of another bit array.
void DeepCopy(vtkDataArray *da);
void DeepCopy(vtkAbstractArray* aa)
{ this->Superclass::DeepCopy(aa); }
// Description:
// This method lets the user specify data to be held by the array. The
// array argument is a pointer to the data. size is the size of
// the array supplied by the user. Set save to 1 to keep the class
// from deleting the array when it cleans up or reallocates memory.
// The class uses the actual array provided; it does not copy the data
// from the supplied array. If save 0, the array must have been allocated
// with new[] not malloc.
#ifndef __VTK_WRAP__
void SetArray(unsigned char* array, vtkIdType size, int save);
#endif
void SetVoidArray(void *array, vtkIdType size, int save)
{
this->SetArray(static_cast<unsigned char *>(array), size, save);
}
void SetVoidArray(void *array, vtkIdType size, int save,
int vtkNotUsed(deleteMethod))
{
this->SetArray(static_cast<unsigned char *>(array), size, save);
}
// Description:
// Returns a new vtkBitArrayIterator instance.
VTK_NEWINSTANCE vtkArrayIterator* NewIterator();
// Description:
// Return the indices where a specific value appears.
virtual vtkIdType LookupValue(vtkVariant value);
virtual void LookupValue(vtkVariant value, vtkIdList* ids);
vtkIdType LookupValue(int value);
void LookupValue(int value, vtkIdList* ids);
// Description:
// Tell the array explicitly that the data has changed.
// This is only necessary to call when you modify the array contents
// without using the array's API (i.e. you retrieve a pointer to the
// data and modify the array contents). You need to call this so that
// the fast lookup will know to rebuild itself. Otherwise, the lookup
// functions will give incorrect results.
virtual void DataChanged();
// Description:
// Delete the associated fast lookup data structure on this array,
// if it exists. The lookup will be rebuilt on the next call to a lookup
// function.
virtual void ClearLookup();
protected:
vtkBitArray();
~vtkBitArray();
unsigned char *Array; // pointer to data
unsigned char *ResizeAndExtend(vtkIdType sz);
// function to resize data
int TupleSize; //used for data conversion
double *Tuple;
int SaveUserArray;
private:
// hide superclass' DeepCopy() from the user and the compiler
void DeepCopy(vtkDataArray &da) {this->vtkDataArray::DeepCopy(&da);}
private:
vtkBitArray(const vtkBitArray&) VTK_DELETE_FUNCTION;
void operator=(const vtkBitArray&) VTK_DELETE_FUNCTION;
vtkBitArrayLookup* Lookup;
void UpdateLookup();
};
inline void vtkBitArray::SetNumberOfValues(vtkIdType number)
{
this->Allocate(number);
this->MaxId = number - 1;
this->DataChanged();
}
inline void vtkBitArray::SetValue(vtkIdType id, int value)
{
if (value)
{
this->Array[id/8] = static_cast<unsigned char>(
this->Array[id/8] | (0x80 >> id%8));
}
else
{
this->Array[id/8] = static_cast<unsigned char>(
this->Array[id/8] & (~(0x80 >> id%8)));
}
this->DataChanged();
}
inline void vtkBitArray::InsertValue(vtkIdType id, int i)
{
if ( id >= this->Size )
{
if (!this->ResizeAndExtend(id+1))
{
return;
}
}
if (i)
{
this->Array[id/8] = static_cast<unsigned char>(
this->Array[id/8] | (0x80 >> id%8));
}
else
{
this->Array[id/8] = static_cast<unsigned char>(
this->Array[id/8] & (~(0x80 >> id%8)));
}
if ( id > this->MaxId )
{
this->MaxId = id;
}
this->DataChanged();
}
inline void vtkBitArray::SetVariantValue(vtkIdType id, vtkVariant value)
{
this->SetValue(id, value.ToInt());
}
inline void vtkBitArray::InsertVariantValue(vtkIdType id, vtkVariant value)
{
this->InsertValue(id, value.ToInt());
}
inline vtkIdType vtkBitArray::InsertNextValue(int i)
{
this->InsertValue (++this->MaxId,i);
this->DataChanged();
return this->MaxId;
}
inline void vtkBitArray::Squeeze() {this->ResizeAndExtend (this->MaxId+1);}
#endif
| SimVascular/VTK | Common/Core/vtkBitArray.h | C | bsd-3-clause | 11,213 | [
30522,
1013,
1008,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^external/', include('external.urls')),
url(r'^dev/', include('dev.urls')),
]
| SequencingDOTcom/App-Market-API-integration | python/bootstrap/urls.py | Python | mit | 231 | [
30522,
2013,
6520,
23422,
1012,
9530,
2546,
1012,
24471,
4877,
12324,
2421,
1010,
24471,
2140,
2013,
6520,
23422,
1012,
9530,
18886,
2497,
12324,
4748,
10020,
24471,
14277,
20097,
3619,
1027,
1031,
24471,
2140,
1006,
1054,
1005,
1034,
4748,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/*
* admin42
*
* @package admin42
* @link https://github.com/kiwi-suite/admin42
* @copyright Copyright (c) 2010 - 2017 kiwi suite (https://www.kiwi-suite.com)
* @license MIT License
* @author kiwi suite <tech@kiwi-suite.com>
*/
namespace Admin42\TableGateway;
use Core42\Db\TableGateway\AbstractTableGateway;
class LoginHistoryTableGateway extends AbstractTableGateway
{
/**
* @var string
*/
protected $table = 'admin42_user_loginhistory';
/**
* @var array
*/
protected $primaryKey = ['id'];
/**
* @var array
*/
protected $databaseTypeMap = [
'id' => 'integer',
'userId' => 'integer',
'status' => 'string',
'ip' => 'string',
'created' => 'dateTime',
];
/**
* @var string
*/
protected $modelPrototype = 'Admin42\\Model\\LoginHistory';
}
| raum42/admin42 | src/TableGateway/LoginHistoryTableGateway.php | PHP | mit | 874 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
4748,
10020,
20958,
1008,
1008,
1030,
7427,
4748,
10020,
20958,
1008,
1030,
4957,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
1012,
4012,
1013,
11382,
9148,
1011,
7621,
1013,
4748,
10020,
20958,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
use App\Models\Post;
use Illuminate\Support\Facades\DB;
use Test\Factory;
use Test\TestCase;
class PostControllerTest extends TestCase {
public function setUp() {
parent::setUp();
DB::table('posts')->delete();
$this->user = Factory::create('user');
$this->be($this->user);
}
public function testIndex()
{
$this->call('GET', 'posts');
$this->assertResponseOk();
$this->assertViewHas('posts');
}
public function testCreate()
{
$this->call('GET', 'posts/create');
$this->assertResponseOk();
}
public function testStore()
{
$countPosts = Post::count();
$inputs = [
'title' => 'title POst',
'content' => 'Content posts'
];
$this->call('POST', 'posts', $inputs);
$this->assertEquals($countPosts + 1, Post::count());
$this->assertRedirectedTo('/posts');
}
public function testEdit()
{
$post = Factory::create('post');
$this->call('GET', 'posts/'.$post->id.'/edit');
$this->assertResponseOk();
}
public function testUpdate()
{
$oldTitle = 'Old title';
$newTitle = 'New title';
$post = Factory::create('post', ['title' => $oldTitle]);
$inputs = [
'title' => $newTitle,
];
$this->shouldRedirectBack();
$this->call('PUT', 'posts/'.$post->id, $inputs);
$freshPost = Post::find($post->id);
$this->assertEquals($newTitle, $freshPost->title);
}
public function testDestroy()
{
$post = Factory::create('post');
$countPosts = Post::count();
$this->shouldRedirectBack();
$this->call('DELETE', 'posts/'.$post->id);
$this->assertEquals($countPosts - 1, Post::count());
}
}
| pinnackl/cabrette-dev | tests/Http/Controllers/PostControllerTest.php | PHP | apache-2.0 | 1,851 | [
30522,
1026,
1029,
25718,
2224,
10439,
1032,
4275,
1032,
2695,
1025,
2224,
5665,
12717,
12556,
1032,
2490,
1032,
28708,
1032,
16962,
1025,
2224,
3231,
1032,
4713,
1025,
2224,
3231,
1032,
3231,
18382,
1025,
2465,
2695,
8663,
13181,
10820,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"""Windows-specific implementation of process utilities.
This file is only meant to be imported by process.py, not by end-users.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from __future__ import print_function
# stdlib
import os
import sys
import ctypes
import msvcrt
from ctypes import c_int, POINTER
from ctypes.wintypes import LPCWSTR, HLOCAL
from subprocess import STDOUT
# our own imports
from ._process_common import read_no_interrupt, process_handler, arg_split as py_arg_split
from . import py3compat
from . import text
from .encoding import DEFAULT_ENCODING
#-----------------------------------------------------------------------------
# Function definitions
#-----------------------------------------------------------------------------
class AvoidUNCPath(object):
"""A context manager to protect command execution from UNC paths.
In the Win32 API, commands can't be invoked with the cwd being a UNC path.
This context manager temporarily changes directory to the 'C:' drive on
entering, and restores the original working directory on exit.
The context manager returns the starting working directory *if* it made a
change and None otherwise, so that users can apply the necessary adjustment
to their system calls in the event of a change.
Example
-------
::
cmd = 'dir'
with AvoidUNCPath() as path:
if path is not None:
cmd = '"pushd %s &&"%s' % (path, cmd)
os.system(cmd)
"""
def __enter__(self):
self.path = os.getcwdu()
self.is_unc_path = self.path.startswith(r"\\")
if self.is_unc_path:
# change to c drive (as cmd.exe cannot handle UNC addresses)
os.chdir("C:")
return self.path
else:
# We return None to signal that there was no change in the working
# directory
return None
def __exit__(self, exc_type, exc_value, traceback):
if self.is_unc_path:
os.chdir(self.path)
def _find_cmd(cmd):
"""Find the full path to a .bat or .exe using the win32api module."""
try:
from win32api import SearchPath
except ImportError:
raise ImportError('you need to have pywin32 installed for this to work')
else:
PATH = os.environ['PATH']
extensions = ['.exe', '.com', '.bat', '.py']
path = None
for ext in extensions:
try:
path = SearchPath(PATH, cmd + ext)[0]
except:
pass
if path is None:
raise OSError("command %r not found" % cmd)
else:
return path
def _system_body(p):
"""Callback for _system."""
enc = DEFAULT_ENCODING
for line in read_no_interrupt(p.stdout).splitlines():
line = line.decode(enc, 'replace')
print(line, file=sys.stdout)
for line in read_no_interrupt(p.stderr).splitlines():
line = line.decode(enc, 'replace')
print(line, file=sys.stderr)
# Wait to finish for returncode
return p.wait()
def system(cmd):
"""Win32 version of os.system() that works with network shares.
Note that this implementation returns None, as meant for use in IPython.
Parameters
----------
cmd : str
A command to be executed in the system shell.
Returns
-------
None : we explicitly do NOT return the subprocess status code, as this
utility is meant to be used extensively in IPython, where any return value
would trigger :func:`sys.displayhook` calls.
"""
# The controller provides interactivity with both
# stdin and stdout
#import _process_win32_controller
#_process_win32_controller.system(cmd)
with AvoidUNCPath() as path:
if path is not None:
cmd = '"pushd %s &&"%s' % (path, cmd)
return process_handler(cmd, _system_body)
def getoutput(cmd):
"""Return standard output of executing cmd in a shell.
Accepts the same arguments as os.system().
Parameters
----------
cmd : str
A command to be executed in the system shell.
Returns
-------
stdout : str
"""
with AvoidUNCPath() as path:
if path is not None:
cmd = '"pushd %s &&"%s' % (path, cmd)
out = process_handler(cmd, lambda p: p.communicate()[0], STDOUT)
if out is None:
out = b''
return py3compat.bytes_to_str(out)
try:
CommandLineToArgvW = ctypes.windll.shell32.CommandLineToArgvW
CommandLineToArgvW.arg_types = [LPCWSTR, POINTER(c_int)]
CommandLineToArgvW.restype = POINTER(LPCWSTR)
LocalFree = ctypes.windll.kernel32.LocalFree
LocalFree.res_type = HLOCAL
LocalFree.arg_types = [HLOCAL]
def arg_split(commandline, posix=False, strict=True):
"""Split a command line's arguments in a shell-like manner.
This is a special version for windows that use a ctypes call to CommandLineToArgvW
to do the argv splitting. The posix paramter is ignored.
If strict=False, process_common.arg_split(...strict=False) is used instead.
"""
#CommandLineToArgvW returns path to executable if called with empty string.
if commandline.strip() == "":
return []
if not strict:
# not really a cl-arg, fallback on _process_common
return py_arg_split(commandline, posix=posix, strict=strict)
argvn = c_int()
result_pointer = CommandLineToArgvW(py3compat.cast_unicode(commandline.lstrip()), ctypes.byref(argvn))
result_array_type = LPCWSTR * argvn.value
result = [arg for arg in result_array_type.from_address(ctypes.addressof(result_pointer.contents))]
retval = LocalFree(result_pointer)
return result
except AttributeError:
arg_split = py_arg_split
| cloud9ers/gurumate | environment/lib/python2.7/site-packages/IPython/utils/_process_win32.py | Python | lgpl-3.0 | 6,316 | [
30522,
1000,
1000,
1000,
3645,
1011,
3563,
7375,
1997,
2832,
16548,
1012,
2023,
5371,
2003,
2069,
3214,
2000,
2022,
10964,
2011,
2832,
1012,
1052,
2100,
1010,
2025,
2011,
2203,
1011,
5198,
1012,
1000,
1000,
1000,
1001,
1011,
1011,
1011,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
class Year(object):
def __init__(self, year):
self.year = year
def is_leap_year(self):
return (self._by_4() and not self._by_100()) \
or self._by_400()
def _by_4(self):
return self.year % 4 == 0
def _by_100(self):
return self.year % 100 == 0
def _by_400(self):
return self.year % 400 == 0
| mscoutermarsh/exercism_coveralls | assignments/python/leap/example.py | Python | agpl-3.0 | 368 | [
30522,
2465,
2095,
1006,
4874,
1007,
1024,
13366,
1035,
1035,
1999,
4183,
1035,
1035,
1006,
2969,
1010,
2095,
1007,
1024,
2969,
1012,
2095,
1027,
2095,
13366,
2003,
1035,
11679,
1035,
2095,
1006,
2969,
1007,
1024,
2709,
1006,
2969,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Palette = function(name,colors){
this.name = name;
this.colors = colors;
};
Palette.prototype.hasName = function(name){
return this.name.toLowerCase() == name.toLowerCase()?true:false;
};
Palette.prototype.getRandomColor = function(){
return this.colors[(Math.floor(Math.random() * this.colors.length))];
};
Palette.prototype.getName = function(){
return this.name;
};
Palette.prototype.setName = function(name){
this.name = name;
};
Palette.prototype.getColors = function(){
return this.colors;
};
Palette.prototype.setColors = function(colors){
this.colors = colors;
};
Palette.generateRandomPalette = function(){
var colors = [];
for(var i = 0; i< 5; i++){
colors.push(('#'+Math.floor(Math.random()*16777215).toString(16)).toUpperCase());
}
return new Palette("RandomizePalette",colors);
}; | sirCamp/supercolor | src/palette.js | JavaScript | mit | 825 | [
30522,
27396,
1027,
3853,
1006,
2171,
1010,
6087,
1007,
1063,
2023,
1012,
2171,
1027,
2171,
1025,
2023,
1012,
6087,
1027,
6087,
1025,
1065,
1025,
27396,
1012,
8773,
1012,
8440,
14074,
1027,
3853,
1006,
2171,
1007,
1063,
2709,
2023,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.springdemo.learningMVC.common.src.main.java.com.common.tuple;
/**
* A mutable triple consisting of three {@code Object} elements.
* <p>
* Not #ThreadSafe#
*
* @param <L> the left element type
* @param <M> the middle element type
* @param <R> the right element type
* @version $Id: MutableTriple.java 290 2014-10-27 08:48:18Z $
*/
public class MutableTriple<L, M, R> extends Triple<L, M, R> {
/**
* Serialization version
*/
private static final long serialVersionUID = 1L;
/**
* Left object
*/
public L left;
/**
* Middle object
*/
public M middle;
/**
* Right object
*/
public R right;
/**
* Obtains an mutable triple of three objects inferring the generic types.
* <p>
* This factory allows the triple to be created using inference to
* obtain the generic types.
*
* @param <L> the left element type
* @param <M> the middle element type
* @param <R> the right element type
* @param left the left element, may be null
* @param middle the middle element, may be null
* @param right the right element, may be null
* @return a triple formed from the three parameters, not null
*/
public static <L, M, R> MutableTriple<L, M, R> of(
final L left, final M middle, final R right) {
return new MutableTriple<>(left, middle, right);
}
/**
* Create a new triple instance of three nulls.
*/
public MutableTriple() {
super();
}
/**
* Create a new triple instance.
*
* @param left the left value, may be null
* @param middle the middle value, may be null
* @param right the right value, may be null
*/
public MutableTriple(final L left, final M middle, final R right) {
super();
this.left = left;
this.middle = middle;
this.right = right;
}
//-----------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public L getLeft() {
return left;
}
/**
* Sets the left element of the triple.
*
* @param left the new value of the left element, may be null
*/
public void setLeft(final L left) {
this.left = left;
}
/**
* {@inheritDoc}
*/
@Override
public M getMiddle() {
return middle;
}
/**
* Sets the middle element of the triple.
*
* @param middle the new value of the middle element, may be null
*/
public void setMiddle(final M middle) {
this.middle = middle;
}
/**
* {@inheritDoc}
*/
@Override
public R getRight() {
return right;
}
/**
* Sets the right element of the triple.
*
* @param right the new value of the right element, may be null
*/
public void setRight(final R right) {
this.right = right;
}
} | simonpatrick/stepbystep-java | spring-demo/docs/learningMVC/common/src/main/java/com/common/tuple/MutableTriple.java | Java | gpl-3.0 | 2,978 | [
30522,
7427,
4012,
1012,
3500,
3207,
5302,
1012,
4083,
2213,
25465,
1012,
2691,
1012,
5034,
2278,
1012,
2364,
1012,
9262,
1012,
4012,
1012,
2691,
1012,
10722,
10814,
1025,
1013,
1008,
1008,
1008,
1037,
14163,
10880,
6420,
5398,
1997,
2093,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#pragma checksum "C:\Users\agomez.ETIC\Documents\Visual Studio 2013\Projects\Edatalia_signplyRT\Edatalia_signplyRT\ServiceContractPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "24BB41AB0CC87304CC4E51704C814814"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Edatalia_signplyRT
{
partial class ServiceContractPage : global::Windows.UI.Xaml.Controls.Page
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private global::Windows.UI.Xaml.Controls.Page pageRoot;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private global::Windows.UI.Xaml.Controls.StackPanel spContractData;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private global::Windows.UI.Xaml.Controls.DatePicker dtPicker;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private global::Windows.UI.Xaml.Controls.TextBox tbImporte;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private global::Windows.UI.Xaml.Controls.Button backButton;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private global::Windows.UI.Xaml.Controls.TextBlock pageTitle;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private global::Windows.UI.Xaml.Controls.Image imgTittle;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private global::Windows.UI.Xaml.Controls.AppBar bottomAppBar;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private global::Windows.UI.Xaml.Controls.AppBarButton appbtnOpen;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private global::Windows.UI.Xaml.Controls.AppBarButton appbtnCancel;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private bool _contentLoaded;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void InitializeComponent()
{
if (_contentLoaded)
return;
_contentLoaded = true;
global::Windows.UI.Xaml.Application.LoadComponent(this, new global::System.Uri("ms-appx:///ServiceContractPage.xaml"), global::Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
pageRoot = (global::Windows.UI.Xaml.Controls.Page)this.FindName("pageRoot");
spContractData = (global::Windows.UI.Xaml.Controls.StackPanel)this.FindName("spContractData");
dtPicker = (global::Windows.UI.Xaml.Controls.DatePicker)this.FindName("dtPicker");
tbImporte = (global::Windows.UI.Xaml.Controls.TextBox)this.FindName("tbImporte");
backButton = (global::Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
pageTitle = (global::Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
imgTittle = (global::Windows.UI.Xaml.Controls.Image)this.FindName("imgTittle");
bottomAppBar = (global::Windows.UI.Xaml.Controls.AppBar)this.FindName("bottomAppBar");
appbtnOpen = (global::Windows.UI.Xaml.Controls.AppBarButton)this.FindName("appbtnOpen");
appbtnCancel = (global::Windows.UI.Xaml.Controls.AppBarButton)this.FindName("appbtnCancel");
}
}
}
| edatalia/edatalia_eContrato | obj/x86/Release/ServiceContractPage.g.i.cs | C# | agpl-3.0 | 4,272 | [
30522,
1001,
10975,
8490,
2863,
14148,
2819,
1000,
1039,
1024,
1032,
5198,
1032,
3283,
4168,
2480,
1012,
3802,
2594,
1032,
5491,
1032,
5107,
2996,
2286,
1032,
3934,
1032,
3968,
27815,
2401,
1035,
3696,
22086,
5339,
1032,
3968,
27815,
2401,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Type definitions for auth0-lock 10.9
// Project: http://auth0.com
// Definitions by: Brian Caruso <https://github.com/carusology>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="auth0-js/v7" />
interface Auth0LockAdditionalSignUpFieldOption {
value: string;
label: string;
}
type Auth0LockAdditionalSignUpFieldOptionsCallback =
(error: Auth0Error, options: Auth0LockAdditionalSignUpFieldOption[]) => void;
type Auth0LockAdditionalSignUpFieldOptionsFunction =
(callback: Auth0LockAdditionalSignUpFieldOptionsCallback) => void;
type Auth0LockAdditionalSignUpFieldPrefillCallback =
(error: Auth0Error, prefill: string) => void;
type Auth0LockAdditionalSignUpFieldPrefillFunction =
(callback: Auth0LockAdditionalSignUpFieldPrefillCallback) => void;
interface Auth0LockAdditionalSignUpField {
icon?: string;
name: string;
options?: Auth0LockAdditionalSignUpFieldOption[] | Auth0LockAdditionalSignUpFieldOptionsFunction;
placeholder: string;
prefill?: string | Auth0LockAdditionalSignUpFieldPrefillFunction;
type?: "select" | "text";
validator?: (input: string) => { valid: boolean; hint?: string };
}
type Auth0LockAvatarUrlCallback = (error: Auth0Error, url: string) => void;
type Auth0LockAvatarDisplayNameCallback = (error: Auth0Error, displayName: string) => void;
interface Auth0LockAvatarOptions {
url: (email: string, callback: Auth0LockAvatarUrlCallback) => void;
displayName: (email: string, callback: Auth0LockAvatarDisplayNameCallback) => void;
}
interface Auth0LockThemeOptions {
logo?: string;
primaryColor?: string;
}
// https://auth0.com/docs/libraries/lock/v10/sending-authentication-parameters
interface Auth0LockAuthParamsOptions {
access_token?: any;
connection_scopes?: any;
device?: any;
nonce?: any;
protocol?: any;
request_id?: any;
scope?: string;
state?: string;
}
interface Auth0LockAuthOptions {
params?: Auth0LockAuthParamsOptions;
redirect?: boolean;
redirectUrl?: string;
responseType?: string;
sso?: boolean;
}
interface Auth0LockPopupOptions {
width: number;
height: number;
left: number;
top: number;
}
interface Auth0LockConstructorOptions {
additionalSignUpFields?: Auth0LockAdditionalSignUpField[];
allowedConnections?: string[];
allowForgotPassword?: boolean;
allowLogin?: boolean;
allowSignUp?: boolean;
assetsUrl?: string;
auth?: Auth0LockAuthOptions;
autoclose?: boolean;
autofocus?: boolean;
avatar?: Auth0LockAvatarOptions;
closable?: boolean;
container?: string;
defaultADUsernameFromEmailPrefix?: string;
defaultDatabaseConnection?: string;
defaultEnterpriseConnection?: string;
forgotPasswordLink?: string;
initialScreen?: "login" | "signUp" | "forgotPassword";
language?: string;
languageDictionary?: any;
loginAfterSignUp?: boolean;
mustAcceptTerms?: boolean;
popupOptions?: Auth0LockPopupOptions;
prefill?: { email?: string, username?: string};
rememberLastLogin?: boolean;
signupLink?: string;
socialButtonStyle?: "big" | "small";
theme?: Auth0LockThemeOptions;
usernameStyle?: string;
}
interface Auth0LockFlashMessageOptions {
type: "success" | "error";
text: string;
}
interface Auth0LockShowOptions {
allowedConnections?: string[];
allowForgotPassword?: boolean;
allowLogin?: boolean;
allowSignUp?: boolean;
auth?: Auth0LockAuthOptions;
initialScreen?: "login" | "signUp" | "forgotPassword";
flashMessage?: Auth0LockFlashMessageOptions;
rememberLastLogin?: boolean;
}
interface Auth0LockStatic {
new (clientId: string, domain: string, options?: Auth0LockConstructorOptions): Auth0LockStatic;
// deprecated
getProfile(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void): void;
getUserInfo(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void): void;
show(options?: Auth0LockShowOptions): void;
hide(): void;
logout(query: any): void;
on(event: "show" | "hide", callback: () => void): void;
on(event: "unrecoverable_error" | "authorization_error", callback: (error: Auth0Error) => void): void;
on(event: "authenticated", callback: (authResult: any) => void): void;
on(event: string, callback: (...args: any[]) => void): void;
}
declare var Auth0Lock: Auth0LockStatic;
declare module "auth0-lock" {
export default Auth0Lock;
}
| progre/DefinitelyTyped | auth0-lock/index.d.ts | TypeScript | mit | 4,526 | [
30522,
1013,
1013,
2828,
15182,
2005,
8740,
2705,
2692,
1011,
5843,
2184,
1012,
30524,
1013,
2482,
26658,
6483,
1028,
1013,
1013,
15182,
1024,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
1012,
4012,
1013,
5791,
13874,
2094,
1013,
5791,
138... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2006-2015 The MZmine 2 Development Team
*
* This file is part of MZmine 2.
*
* MZmine 2 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.
*
* MZmine 2 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
* MZmine 2; if not, write to the Free Software Foundation, Inc., 51 Franklin St,
* Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.sf.mzmine.modules.peaklistmethods.peakpicking.deconvolution.savitzkygolay;
public final class SGDerivative {
/**
* This method returns the second smoothed derivative values of an array.
*
* @param double[] values
* @param boolean is first derivative
* @param int level of filter (1 - 12)
* @return double[] derivative of values
*/
public static double[] calculateDerivative(double[] values,
boolean firstDerivative, int levelOfFilter) {
double[] derivative = new double[values.length];
int M = 0;
for (int k = 0; k < derivative.length; k++) {
// Determine boundaries
if (k <= levelOfFilter)
M = k;
if (k + M > derivative.length - 1)
M = derivative.length - (k + 1);
// Perform derivative using Savitzky Golay coefficients
for (int i = -M; i <= M; i++) {
derivative[k] += values[k + i]
* getSGCoefficient(M, i, firstDerivative);
}
// if ((Math.abs(derivative[k])) > maxValueDerivative)
// maxValueDerivative = Math.abs(derivative[k]);
}
return derivative;
}
/**
* This method return the Savitzky-Golay 2nd smoothed derivative coefficient
* from an array
*
* @param M
* @param signedC
* @return
*/
private static Double getSGCoefficient(int M, int signedC,
boolean firstDerivate) {
int C = Math.abs(signedC), sign = 1;
if (firstDerivate) {
if (signedC < 0)
sign = -1;
return sign
* SGCoefficients.SGCoefficientsFirstDerivativeQuartic[M][C];
} else {
return SGCoefficients.SGCoefficientsSecondDerivative[M][C];
}
}
}
| DrewG/mzmine2 | src/main/java/net/sf/mzmine/modules/peaklistmethods/peakpicking/deconvolution/savitzkygolay/SGDerivative.java | Java | gpl-2.0 | 2,508 | [
30522,
1013,
1008,
1008,
9385,
2294,
1011,
2325,
1996,
1049,
2480,
11233,
1016,
2458,
2136,
1008,
1008,
2023,
5371,
2003,
2112,
1997,
1049,
2480,
11233,
1016,
1012,
1008,
1008,
1049,
2480,
11233,
1016,
2003,
2489,
4007,
1025,
2017,
2064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ 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.
#
# ESPResSo++ 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/>.
r"""
******************************
espressopp.integrator.CapForce
******************************
This class can be used to forcecap all particles or a group of particles.
Force capping means that the force vector of a particle is rescaled
so that the length of the force vector is <= capforce
Example Usage:
>>> capforce = espressopp.integrator.CapForce(system, 1000.0)
>>> integrator.addExtension(capForce)
CapForce can also be used to forcecap only a group of particles:
>>> particle_group = [45, 67, 89, 103]
>>> capforce = espressopp.integrator.CapForce(system, 1000.0, particle_group)
>>> integrator.addExtension(capForce)
.. function:: espressopp.integrator.CapForce(system, capForce, particleGroup)
:param system:
:param capForce:
:param particleGroup: (default: None)
:type system:
:type capForce:
:type particleGroup:
"""
from espressopp.esutil import cxxinit
from espressopp import pmi
from espressopp.integrator.Extension import *
from _espressopp import integrator_CapForce
class CapForceLocal(ExtensionLocal, integrator_CapForce):
def __init__(self, system, capForce, particleGroup = None):
if not (pmi._PMIComm and pmi._PMIComm.isActive()) or pmi._MPIcomm.rank in pmi._PMIComm.getMPIcpugroup():
if (particleGroup == None) or (particleGroup.size() == 0):
cxxinit(self, integrator_CapForce, system, capForce)
else:
cxxinit(self, integrator_CapForce, system, capForce, particleGroup)
if pmi.isController :
class CapForce(Extension, metaclass=pmi.Proxy):
pmiproxydefs = dict(
cls = 'espressopp.integrator.CapForceLocal',
pmicall = ['setCapForce', 'setAbsCapForce', 'getCapForce', 'getAbsCapForce'],
pmiproperty = [ 'particleGroup', 'adress' ]
)
| espressopp/espressopp | src/integrator/CapForce.py | Python | gpl-3.0 | 2,764 | [
30522,
1001,
9385,
1006,
1039,
1007,
2262,
1010,
2286,
1001,
4098,
26486,
2820,
2005,
17782,
2470,
1001,
9385,
1006,
1039,
1007,
2263,
1010,
2268,
1010,
2230,
1010,
2249,
1001,
4098,
1011,
26486,
1011,
2820,
2005,
17782,
2470,
1004,
25312,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Copyright (C) 2002-2006 Stephen Kennedy <stevek@gnome.org>
# Copyright (C) 2009-2013 Kai Willadsen <kai.willadsen@gmail.com>
#
# 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/>.
import math
from gi.repository import Gtk
from meld.misc import get_common_theme
from meld.settings import meldsettings
# Rounded rectangle corner radius for culled changes display
RADIUS = 3
class LinkMap(Gtk.DrawingArea):
__gtype_name__ = "LinkMap"
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed)
def associate(self, filediff, left_view, right_view):
self.filediff = filediff
self.views = [left_view, right_view]
if self.get_direction() == Gtk.TextDirection.RTL:
self.views.reverse()
self.view_indices = [filediff.textview.index(t) for t in self.views]
self.on_setting_changed(meldsettings, 'style-scheme')
def on_setting_changed(self, settings, key):
if key == 'style-scheme':
self.fill_colors, self.line_colors = get_common_theme()
def do_draw(self, context):
if not self.filediff:
return
context.set_line_width(1.0)
allocation = self.get_allocation()
pix_start = [t.get_visible_rect().y for t in self.views]
y_offset = [
t.translate_coordinates(self, 0, 0)[1] + 1 for t in self.views]
clip_y = min(y_offset) - 1
clip_height = max(t.get_visible_rect().height for t in self.views) + 2
context.rectangle(0, clip_y, allocation.width, clip_height)
context.clip()
height = allocation.height
visible = [self.views[0].get_line_num_for_y(pix_start[0]),
self.views[0].get_line_num_for_y(pix_start[0] + height),
self.views[1].get_line_num_for_y(pix_start[1]),
self.views[1].get_line_num_for_y(pix_start[1] + height)]
wtotal = allocation.width
# For bezier control points
x_steps = [-0.5, (1. / 3) * wtotal, (2. / 3) * wtotal, wtotal + 0.5]
q_rad = math.pi / 2
left, right = self.view_indices
view_offset_line = lambda v, l: (self.views[v].get_y_for_line_num(l) -
pix_start[v] + y_offset[v])
for c in self.filediff.linediffer.pair_changes(left, right, visible):
# f and t are short for "from" and "to"
f0, f1 = [view_offset_line(0, l) for l in c[1:3]]
t0, t1 = [view_offset_line(1, l) for l in c[3:5]]
# We want the last pixel of the previous line
f1 = f1 if f1 == f0 else f1 - 1
t1 = t1 if t1 == t0 else t1 - 1
# If either endpoint is completely off-screen, we cull for clarity
if (t0 < 0 and t1 < 0) or (t0 > height and t1 > height):
if f0 == f1:
continue
context.arc(x_steps[0], f0 - 0.5 + RADIUS, RADIUS, -q_rad, 0)
context.arc(x_steps[0], f1 - 0.5 - RADIUS, RADIUS, 0, q_rad)
context.close_path()
elif (f0 < 0 and f1 < 0) or (f0 > height and f1 > height):
if t0 == t1:
continue
context.arc_negative(x_steps[3], t0 - 0.5 + RADIUS, RADIUS,
-q_rad, q_rad * 2)
context.arc_negative(x_steps[3], t1 - 0.5 - RADIUS, RADIUS,
q_rad * 2, q_rad)
context.close_path()
else:
context.move_to(x_steps[0], f0 - 0.5)
context.curve_to(x_steps[1], f0 - 0.5,
x_steps[2], t0 - 0.5,
x_steps[3], t0 - 0.5)
context.line_to(x_steps[3], t1 - 0.5)
context.curve_to(x_steps[2], t1 - 0.5,
x_steps[1], f1 - 0.5,
x_steps[0], f1 - 0.5)
context.close_path()
context.set_source_rgba(*self.fill_colors[c[0]])
context.fill_preserve()
chunk_idx = self.filediff.linediffer.locate_chunk(left, c[1])[0]
if chunk_idx == self.filediff.cursor.chunk:
highlight = self.fill_colors['current-chunk-highlight']
context.set_source_rgba(*highlight)
context.fill_preserve()
context.set_source_rgba(*self.line_colors[c[0]])
context.stroke()
def do_scroll_event(self, event):
self.filediff.next_diff(event.direction)
class ScrollLinkMap(Gtk.DrawingArea):
__gtype_name__ = "ScrollLinkMap"
def __init__(self):
self.melddoc = None
def associate(self, melddoc):
self.melddoc = melddoc
def do_scroll_event(self, event):
if not self.melddoc:
return
self.melddoc.next_diff(event.direction)
| Spitfire1900/meld | meld/linkmap.py | Python | gpl-2.0 | 5,512 | [
30522,
1001,
9385,
1006,
1039,
1007,
2526,
1011,
2294,
4459,
5817,
1026,
3889,
2243,
1030,
25781,
1012,
8917,
1028,
1001,
9385,
1006,
1039,
1007,
2268,
1011,
2286,
11928,
2097,
19303,
2368,
1026,
11928,
1012,
2097,
19303,
2368,
1030,
20917,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# frozen_string_literal: true
require "active_support/core_ext/kernel/singleton_class"
require "active_support/core_ext/module/redefine_method"
require "active_support/core_ext/array/extract_options"
class Class
# Declare a class-level attribute whose value is inheritable by subclasses.
# Subclasses can change their own value and it will not impact parent class.
#
# ==== Options
#
# * <tt>:instance_reader</tt> - Sets the instance reader method (defaults to true).
# * <tt>:instance_writer</tt> - Sets the instance writer method (defaults to true).
# * <tt>:instance_accessor</tt> - Sets both instance methods (defaults to true).
# * <tt>:instance_predicate</tt> - Sets a predicate method (defaults to true).
# * <tt>:default</tt> - Sets a default value for the attribute (defaults to nil).
#
# ==== Examples
#
# class Base
# class_attribute :setting
# end
#
# class Subclass < Base
# end
#
# Base.setting = true
# Subclass.setting # => true
# Subclass.setting = false
# Subclass.setting # => false
# Base.setting # => true
#
# In the above case as long as Subclass does not assign a value to setting
# by performing <tt>Subclass.setting = _something_</tt>, <tt>Subclass.setting</tt>
# would read value assigned to parent class. Once Subclass assigns a value then
# the value assigned by Subclass would be returned.
#
# This matches normal Ruby method inheritance: think of writing an attribute
# on a subclass as overriding the reader method. However, you need to be aware
# when using +class_attribute+ with mutable structures as +Array+ or +Hash+.
# In such cases, you don't want to do changes in place. Instead use setters:
#
# Base.setting = []
# Base.setting # => []
# Subclass.setting # => []
#
# # Appending in child changes both parent and child because it is the same object:
# Subclass.setting << :foo
# Base.setting # => [:foo]
# Subclass.setting # => [:foo]
#
# # Use setters to not propagate changes:
# Base.setting = []
# Subclass.setting += [:foo]
# Base.setting # => []
# Subclass.setting # => [:foo]
#
# For convenience, an instance predicate method is defined as well.
# To skip it, pass <tt>instance_predicate: false</tt>.
#
# Subclass.setting? # => false
#
# Instances may overwrite the class value in the same way:
#
# Base.setting = true
# object = Base.new
# object.setting # => true
# object.setting = false
# object.setting # => false
# Base.setting # => true
#
# To opt out of the instance reader method, pass <tt>instance_reader: false</tt>.
#
# object.setting # => NoMethodError
# object.setting? # => NoMethodError
#
# To opt out of the instance writer method, pass <tt>instance_writer: false</tt>.
#
# object.setting = false # => NoMethodError
#
# To opt out of both instance methods, pass <tt>instance_accessor: false</tt>.
#
# To set a default value for the attribute, pass <tt>default:</tt>, like so:
#
# class_attribute :settings, default: {}
def class_attribute(
*attrs,
instance_accessor: true,
instance_reader: instance_accessor,
instance_writer: instance_accessor,
instance_predicate: true,
default: nil
)
attrs.each do |name|
singleton_class.silence_redefinition_of_method(name)
define_singleton_method(name) { default }
singleton_class.silence_redefinition_of_method("#{name}?")
define_singleton_method("#{name}?") { !!public_send(name) } if instance_predicate
ivar = "@#{name}".to_sym
singleton_class.silence_redefinition_of_method("#{name}=")
define_singleton_method("#{name}=") do |val|
redefine_singleton_method(name) { val }
if singleton_class?
class_eval do
redefine_method(name) do
if instance_variable_defined? ivar
instance_variable_get ivar
else
singleton_class.send name
end
end
end
end
val
end
if instance_reader
redefine_method(name) do
if instance_variable_defined?(ivar)
instance_variable_get ivar
else
self.class.public_send name
end
end
redefine_method("#{name}?") { !!public_send(name) } if instance_predicate
end
if instance_writer
redefine_method("#{name}=") do |val|
instance_variable_set ivar, val
end
end
end
end
end
| msaintemarie/msaintemarie.github.io | vendor/cache/ruby/2.6.0/gems/activesupport-6.0.0/lib/active_support/core_ext/class/attribute.rb | Ruby | mit | 4,747 | [
30522,
1001,
7708,
1035,
5164,
1035,
18204,
1024,
2995,
5478,
1000,
3161,
1035,
2490,
1013,
4563,
1035,
4654,
2102,
1013,
16293,
1013,
28159,
1035,
2465,
1000,
5478,
1000,
3161,
1035,
2490,
1013,
4563,
1035,
4654,
2102,
1013,
11336,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* $NetBSD: strtok_r.c,v 1.10 2012/06/25 22:32:46 abs Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <string.h>
char *strtok_r(char *s, const char *delim, char **lasts) {
const char *spanp;
int c, sc;
char *tok;
/* s may be NULL */
_DIAGASSERT(delim != NULL);
_DIAGASSERT(lasts != NULL);
if (s == NULL && (s = *lasts) == NULL)
return (NULL);
/*
* Skip (span) leading delimiters (s += strspn(s, delim), sort of).
*/
cont:
c = *s++;
for (spanp = delim; (sc = *spanp++) != 0;) {
if (c == sc)
goto cont;
}
if (c == 0) { /* no non-delimiter characters */
*lasts = NULL;
return (NULL);
}
tok = s - 1;
/*
* Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
* Note that delim must have one NUL; we stop if we see that, too.
*/
for (;;) {
c = *s++;
spanp = delim;
do {
if ((sc = *spanp++) == c) {
if (c == 0)
s = NULL;
else
s[-1] = 0;
*lasts = s;
return (tok);
}
} while (sc != 0);
}
/* NOTREACHED */
}
| cahirwpz/mimiker | lib/libc/string/strtok_r.c | C | bsd-3-clause | 2,669 | [
30522,
1013,
1008,
1002,
5658,
5910,
2094,
1024,
2358,
5339,
6559,
1035,
1054,
1012,
1039,
1010,
1058,
1015,
1012,
2184,
2262,
1013,
5757,
1013,
2423,
2570,
1024,
3590,
1024,
4805,
14689,
4654,
2361,
1002,
1008,
1013,
1013,
1008,
1008,
93... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
Copyright:
2015/2016 Benjamin Aigner
developer.google.com
This file is part of AustrianPublicStream.
AustrianPublicStream 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.
AustrianPublicStream 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 AustrianPublicStream. If not, see <http://www.gnu.org/licenses/>.
**/
package systems.byteswap.publicstream;
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatDelegate;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls
* to be used with AppCompat.
*/
public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
private AppCompatDelegate mDelegate;
@Override
protected void onCreate(Bundle savedInstanceState) {
getDelegate().installViewFactory();
getDelegate().onCreate(savedInstanceState);
super.onCreate(savedInstanceState);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
getDelegate().onPostCreate(savedInstanceState);
}
public ActionBar getSupportActionBar() {
return getDelegate().getSupportActionBar();
}
@NonNull
@Override
public MenuInflater getMenuInflater() {
return getDelegate().getMenuInflater();
}
@Override
public void setContentView(@LayoutRes int layoutResID) {
getDelegate().setContentView(layoutResID);
}
@Override
public void setContentView(View view) {
getDelegate().setContentView(view);
}
@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().setContentView(view, params);
}
@Override
public void addContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().addContentView(view, params);
}
@Override
protected void onPostResume() {
super.onPostResume();
getDelegate().onPostResume();
}
@Override
protected void onTitleChanged(CharSequence title, int color) {
super.onTitleChanged(title, color);
getDelegate().setTitle(title);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
getDelegate().onConfigurationChanged(newConfig);
}
@Override
protected void onStop() {
super.onStop();
getDelegate().onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
getDelegate().onDestroy();
}
public void invalidateOptionsMenu() {
getDelegate().invalidateOptionsMenu();
}
private AppCompatDelegate getDelegate() {
if (mDelegate == null) {
mDelegate = AppCompatDelegate.create(this, null);
}
return mDelegate;
}
}
| benjaminaigner/AustrianPublicStream | app/src/main/java/systems/byteswap/publicstream/AppCompatPreferenceActivity.java | Java | gpl-3.0 | 3,612 | [
30522,
1013,
1008,
1008,
9385,
1024,
2325,
1013,
2355,
6425,
9932,
10177,
2099,
9722,
1012,
8224,
1012,
4012,
2023,
5371,
2003,
2112,
1997,
6161,
14289,
30524,
1996,
3408,
1997,
1996,
27004,
2236,
2270,
6105,
2004,
2405,
2011,
1996,
2489,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 25.3.1.3
description: >
When a generator is paused before a `try..catch` statement, `return` should
interrupt control flow as if a `return` statement had appeared at that
location in the function body.
---*/
function* g() {
yield;
try {
$ERROR('This code is unreachable (within `try` block)');
} catch (e) {
throw e;
}
$ERROR('This code is unreachable (following `try` statement)');
}
var iter = g();
var result;
iter.next();
result = iter.return(45);
assert.sameValue(result.value, 45, 'Result `value` following `return`');
assert.sameValue(result.done, true, 'Result `done` flag following `return`');
result = iter.next();
assert.sameValue(result.value,
undefined, 'Result `value` is undefined when complete'
);
assert.sameValue(
result.done, true, 'Result `done` flag is `true` when complete'
);
| m0ppers/arangodb | 3rdParty/V8/V8-5.0.71.39/test/test262/data/test/built-ins/GeneratorPrototype/return/try-catch-before-try.js | JavaScript | apache-2.0 | 988 | [
30522,
1013,
1013,
9385,
1006,
1039,
1007,
2325,
1996,
15754,
2622,
6048,
1012,
2035,
2916,
9235,
1012,
1013,
1013,
2023,
3642,
2003,
9950,
2011,
1996,
18667,
2094,
6105,
2179,
1999,
1996,
6105,
5371,
1012,
1013,
1008,
1011,
1011,
1011,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'use strict';
describe("Divhide.Obj", function () {
beforeEach(function () {
jasmine.addMatchers(window.JasmineCustomMatchers);
});
it("Divhide.Specs.ObjExample", function () {
Divhide.Specs.ObjExample();
});
/**
*
* Tests for Obj.stringify()
*
*/
describe("stringify", function () {
/**
*
* Test toString() with a literal as argument
*
*/
describe("stringify(literal)", function(){
it("String should return a valid string", function () {
var val = Divhide.Obj.stringify("Oscar");
expect("\"Oscar\"").toBe(val);
});
it("Number should return a valid string", function () {
var val = Divhide.Obj.stringify(1);
expect(val).toBe("1");
});
it("null should return a valid string", function () {
var val = Divhide.Obj.stringify(null);
expect(val).toBe("null");
});
it("undefined should return a valid string", function () {
var val = Divhide.Obj.stringify(undefined);
expect(val).toBe("undefined");
});
});
/**
*
* Test toString() with an object as the argument
*
*/
describe("stringify(obj)", function(){
it("empty object should return a valid string", function () {
var val = Divhide.Obj.stringify({}, { space: 0 });
expect(val).toBe("{}");
});
it("one level object should return a valid string", function () {
var val = Divhide.Obj.stringify({
"firstName": "Oscar",
"lastName": "Brito"
}, { space: 0 });
expect(val)
.toBe("{\"firstName\":\"Oscar\",\"lastName\":\"Brito\"}");
});
it("two level object should return a valid string", function () {
var val = Divhide.Obj.stringify({
"firstName": {
"value": "Oscar"
},
"lastName": {
"value": "Brito"
}
}, { space: 0 });
expect(val)
.toBe("{\"firstName\":{\"value\":\"Oscar\"},\"lastName\":{\"value\":\"Brito\"}}");
});
it("with identation should return a valid string", function () {
var val = Divhide.Obj.stringify({
"other": {},
"firstName": {
"value": "Oscar"
}
}, { space: 2 });
expect(val).toBe("{\n" +
" \"other\": {},\n" +
" \"firstName\": {\n" +
" \"value\": \"Oscar\"\n" +
" }\n" +
"}");
});
});
/**
*
* Test toString() with an array as argument
*
*/
describe("stringify(array)", function(){
it("empty array should return a valid string", function () {
var val = Divhide.Obj.stringify([], { space: 0 });
expect(val).toBe("[]");
});
it("one level array should return a valid string", function () {
var val = Divhide.Obj.stringify([
"one",
"two",
3
], { space: 0 });
expect(val).toBe("[\"one\",\"two\",3]");
});
it("complex array should return a valid string", function () {
var val = Divhide.Obj.stringify(
["one", ["two"]],
{ space: 0 });
expect(val).toBe("[\"one\",[\"two\"]]");
});
it("with identation should return a valid string", function () {
var val = Divhide.Obj.stringify([
1,
[],
[ 2, 3 ],
], { space: 2 });
expect(val).toBe(
"[\n" +
" 1,\n" +
" [],\n" +
" [\n" +
" 2,\n" +
" 3\n" +
" ]\n" +
"]");
});
});
/**
*
* Test toString() with different combination of
* arguments.
*
*/
describe("stringify(*)", function(){
it("array with complex combination should return a valid string", function () {
var val = Divhide.Obj.stringify([
"one",
{
"2": "two",
"3": "three",
4: [4]
},
[ 5 ]
], { space: 0 });
expect(val)
.toBe("[\"one\",{\"2\":\"two\",\"3\":\"three\",\"4\":[4]},[5]]");
});
it("object with complex combination should return a valid string", function () {
var val = Divhide.Obj.stringify({
1: 1,
2: [ 2 ],
3: {
"value": "3"
}
}, { space: 0 });
expect(val)
.toBe("{\"1\":1,\"2\":[2],\"3\":{\"value\":\"3\"}}");
});
it("array with identation should return a valid string", function () {
var val = Divhide.Obj.stringify([
{
name: "Oscar",
age: 30,
tags: [ "tag1", "tag2" ]
},
{
name: "Filipe",
age: 31
},
], { space: 2 });
expect(val).toBe(
"[\n" +
" {\n" +
" \"name\": \"Oscar\",\n" +
" \"age\": 30,\n" +
" \"tags\": [\n" +
" \"tag1\",\n" +
" \"tag2\"\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"name\": \"Filipe\",\n" +
" \"age\": 31\n" +
" }\n" +
"]");
});
});
/**
* Test stringify() annotations
*/
describe("annotate", function(){
it("literal should return a valid string", function(){
var val = Divhide.Obj.stringify(1, {
space: 2,
annotate: function(value, info){
return {
before: "-> ",
after: " /* A value */"
};
}
});
expect(val).toBe("-> 1 /* A value */");
});
it("object should return a valid string", function(){
var val = Divhide.Obj.stringify({
name: "Oscar",
age: 30
}, {
space: 2,
annotate: function(value, info){
return {
after: (value instanceof Object) ? " /* The one! */" : null
};
}
});
expect(val).toBe(
"{\n" +
" \"name\": \"Oscar\",\n" +
" \"age\": 30\n" +
"} /* The one! */");
});
it("object keys should return a valid string", function(){
var val = Divhide.Obj.stringify({
name: "Oscar",
age: 30
}, {
space: 2,
annotate: function(value, info){
return {
before: (value == "Oscar") ? "/* The name */ " : null,
after: (value == "Oscar") ? " /* is so cool */" : null
};
}
});
expect(val).toBe(
"{\n" +
" \"name\": /* The name */ \"Oscar\", /* is so cool */\n" +
" \"age\": 30\n" +
"}");
});
it("array should return a valid string", function(){
var val = Divhide.Obj.stringify([{
name: "Oscar",
age: 30
}], {
space: 2,
annotate: function(value, info){
return {
after: (value instanceof Array) ? " /* The one! */" : null
};
}
});
expect(val).toBe(
"[\n" +
" {\n" +
" \"name\": \"Oscar\",\n" +
" \"age\": 30\n" +
" }\n" +
"] /* The one! */");
});
it("array item should return a valid string", function(){
var val = Divhide.Obj.stringify([{
name: "Oscar",
age: 30
}], {
space: 2,
annotate: function(value, info){
return {
after: (Divhide.Type.isObject(value)) ? " /* The one! */" : null
};
}
});
expect(val).toBe(
"[\n" +
" {\n" +
" \"name\": \"Oscar\",\n" +
" \"age\": 30\n" +
" } /* The one! */\n" +
"]");
});
});
});
}); | divhide/divhide-core | src/Common/ObjJasmineSpec.js | JavaScript | mit | 10,281 | [
30522,
1005,
2224,
9384,
1005,
1025,
6235,
1006,
1000,
4487,
2615,
26100,
1012,
27885,
3501,
1000,
1010,
3853,
1006,
1007,
1063,
2077,
5243,
2818,
1006,
3853,
1006,
1007,
1063,
14032,
1012,
5587,
18900,
21844,
1006,
3332,
1012,
14032,
7874,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
class Mafia
{
protected $valid;
protected $error;
protected $published;
protected $ids = [];
protected $links = [];
protected $users = [];
public function __construct($uri, $published, $ids)
{
if (!$this->validate($uri)) {
return $this;
}
$this->published = $published;
$this->links = $this->loadRelatedLinks($this->link);
if (empty($ids)) {
return;
}
array_map(function ($value) use ($ids) {
$value->selected = in_array($value->link_id, $ids);
}, $this->links);
}
public function isValid()
{
return $this->valid;
}
public function getError()
{
return $this->error;
}
public function getLinks()
{
return $this->links;
}
public function getUsers()
{
if ($this->valid !== true) {
return [];
}
if ($this->users) {
return $this->users;
}
$ids = array_filter(array_map(function ($value) {
return $value->selected ? $value->link_id : null;
}, $this->links));
return $this->getUsersByLinks($ids);
}
protected function validate($uri)
{
global $globals;
if (empty($uri)) {
return $this->setError('No se ha indicado una URL');
}
if (strstr($uri, '/')) {
if (!preg_match('#/story/([^/]+)#', $uri, $uri)) {
return $this->setError('La URL indicada no es correcta');
}
$uri = $uri[1];
}
$this->link = $this->getLinkByUri($uri);
if (empty($this->link)) {
return $this->setError('Envío no encontrado');
}
return $this->valid = true;
}
protected function getLinkByUri($uri)
{
global $db;
return $db->get_row('
SELECT *, false AS `selected`
FROM `links`
WHERE `link_uri` = "'.$db->escape($uri).'"
LIMIT 1;
');
}
protected function loadRelatedLinks($link)
{
global $db;
$domain = $this->getDomain($link->link_url);
return array_merge(
[$link],
$db->get_results('
SELECT *, false AS `selected`
FROM `links`
WHERE (
`link_id` < "'.(int)$link->link_id.'"
AND `link_url` LIKE "%'.$domain.'/%"
'.($this->published ? 'AND link_status = "published"' : '').'
)
ORDER BY `link_id` DESC
LIMIT 5;
'),
$db->get_results('
SELECT *, false AS `selected`
FROM `links`
WHERE (
`link_id` > "'.(int)$link->link_id.'"
AND `link_url` LIKE "%'.$domain.'/%"
'.($this->published ? 'AND link_status = "published"' : '').'
)
ORDER BY `link_id` ASC
LIMIT 5;
')
);
}
protected function setError($error)
{
$this->error = $error;
return $this->valid = false;
}
protected function getDomain($uri)
{
return implode('.', array_slice(explode('.', parse_url($uri, PHP_URL_HOST)), -2));
}
protected function getUsersByLinks(array $link_ids)
{
global $db, $globals;
$users = $db->get_results('
SELECT `users`.`user_id`, `users`.`user_login`
FROM `users`, `votes`
WHERE (
`votes`.`vote_type` = "links"
AND `votes`.`vote_link_id` IN ("'.implode('","', $link_ids).'")
AND `users`.`user_id` = `votes`.`vote_user_id`
AND `votes`.`vote_value` > 0
)
GROUP BY `users`.`user_id`
HAVING COUNT(`users`.`user_id`) = "'.count($link_ids).'";
');
foreach ($users as $user) {
$user->user_link = $globals['base_url_general'].'user/'.htmlspecialchars($user->user_login).'/'.$user->user_id;
}
usort($users, function ($a, $b) {
return ($a->user_login > $b->user_login) ? 1 : -1;
});
return $users;
}
}
| gallir/Meneame | www/libs/mafia.php | PHP | agpl-3.0 | 4,683 | [
30522,
1026,
1029,
25718,
1013,
1013,
1996,
3120,
3642,
21972,
2007,
2023,
5371,
2003,
2489,
4007,
1010,
9385,
1006,
1039,
1007,
2384,
2011,
1013,
1013,
13559,
26033,
2072,
1026,
26033,
4313,
2012,
21318,
2497,
11089,
9686,
1028,
1012,
1013... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Building a distributed memcached environment is far simpler than you might have thought. The memcached daemon is blind about the cluster setup and has no special configuration on the server side to run the cluster, the client is actually doing the data distribution not the server.
How it works
============
What happens is that you specify a list of your servers to your client configuration and the client library uses consistent hashing to decide which server a certain key-value should go to.
The constructor of the client object here was fed with a couple of interesting parameters:
binary = True: This is to configure pylibmc to use the memcached binary protocol not the ASCII protocol.
behaviors={"tcp_nodelay": True, "ketama": True}: This configures the memcached connection socket to use the tcp_nodelay socket option which disables Nagle's algorithm (http://en.wikipedia.org/wiki/Nagle%27s_algorithm) on the socket level. Setting "ketama" = True means that pylibmc is using md5 hashing and that it's using consistent hashing for key distribution.
After we have created the client object, we have set two keys ahmed and tek with the value Hello World and what actually happens behind the scenes is that each key-value pair is actually stored on a different daemon, according to the consistent hashing of the key.
You can checkout Redis at http://redis.io and Kyoto Tycoon at http://fallabs.com/kyototycoon/.
How access to machines
======================
vagrant ssh machine_name
Change default password for ubuntu user:
sudo passwd ubuntu
Links
=====
https://app.vagrantup.com/ubuntu/boxes/xenial64
http://kirang89.github.io/blog/2013/01/24/installing-pylibmc-in-ubuntu/
https://wincent.com/wiki/Testing_memcached_with_telnet
In php
======
If you are planning to connect to a cluster of memcached servers you will need to add all the servers using the addServer method:
<?php
/* OO API */
$memcache = new Memcache;
$memcache->addServer('memcached_host1', 11211);
$memcache->addServer('memcached_host2', 11211);
?>
In python
=========
http://sendapatch.se/projects/pylibmc/behaviors.html
ketama : True, means that pylibmc is using md5 hashing and that it's using consistent hashing for key distribution.
tcp_nodelay : True, which disables Nagle’s algorithm. https://es.wikipedia.org/wiki/Algoritmo_de_Nagle
remove_failed : 1, if set, a server will be removed from the server list after this many operations on it in a row have failed.
retry_timeout: 1, retry them once every minute.
dead_timeout: 60, Once a server has been marked dead, wait this amount of time (in seconds) before checking to see if the server is alive again.
| CALlanoR/virtual_environments | web/memcached/distributed/vagrant/README.md | Markdown | apache-2.0 | 2,650 | [
30522,
2311,
1037,
5500,
2033,
12458,
15395,
2094,
4044,
2003,
2521,
16325,
2084,
2017,
2453,
2031,
2245,
1012,
1996,
2033,
12458,
15395,
2094,
12828,
2003,
6397,
2055,
1996,
9324,
16437,
1998,
2038,
2053,
2569,
9563,
2006,
1996,
8241,
2217... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# CSObot (beta)
- A bot serving the civil society organisations in China.
- 一個幫助中國的公民社會組織的機器人(bot)。
## Features
- 推送平台:
- #csobot:matrix.org (Matrix 平台的房间)
- https://t.me/csobotcn (Telegram bridged from Matrix)
- #aqi-data-share (IRC at OFTC)
- `IPFS 转换器`:把单一网页上传到 IPFS 并返回相应 IPFS gateway 网址,可以免翻墙访问该网页(返回约15个 IPFS 网址,可任选其一,大部分经墙内测试可通)。
- 在以上平台里输入:
```
ipfs-add 要转换的网页
或
ipfs-add-all 要转换的网页
```
> 注1:第一条命令只抓取网页文字和一些简单的元素;第二条命令会抓取站内文字、部分图片和 js/css 等元素(更接近原网页但反应较慢——约2~5分钟)。
> 注2: 使用第二条命令时`要转换的网页`网址需要带上`https://` 或 `http://`,且末尾不能带`/`。
- 检查`[Signal](https://signal.org)`Android 无谷歌框架版的更新([官方发布网站](https://signal.org/android/apk/)),如有更新,推送下载链接和其校验码。(每日2次)
- ~~`OONI probe` 探测可能被墙的华文新闻媒体网站(采用 Citizen Lab 的[cn 列表](https://github.com/citizenlab/test-lists/blob/master/lists/cn.csv), [hk 列表](https://github.com/citizenlab/test-lists/blob/master/lists/hk.csv), [tw 列表](https://github.com/citizenlab/test-lists/blob/master/lists/tw.csv)中的`NEWS`类别的url),每日执行一次。生成报告并发送到 [OONI API](https://api.ooni.io), 报告编号和被墙网站数量推送到以上平台。~~
## Structure
- 兩部分:
- IRC bot (即最外層目錄下的腳本)
> 只提供發送消息到 IRC 平臺的功能(通常要在系統上設置定時任務)。
- Matrix bot (在`matrix-bot`目錄下,改造自`tiny-matrix-bot`)
> 只發送消息到 Matrix 平臺(房間如上),可在其配置文件設置定時任務時間。
- Matrix bot(外部)
> 可以在 Matrix 平臺接收指令並返回結果。代碼在: [tiny matrix bot](https://github.com/mdrights/tiny-matrix-bot)。如需使用,請記得 clone(或下載)它。
- 部署方法:
- IRC bot 無需額外操作,直接運行;
- Matrix bot:
```
> 依賴組件
# apt install python3 python3-requests curl jq
$ pip3 install --user schedule (必須以普通用戶執行)
( 如果腳本需要`IPFS`則需另單獨下載解壓即可, default path: `~/bin/go-ipfs/ipfs`)
git clone https://github.com/mdrights/csobot
git clone https://github.com/matrix-org/matrix-python-sdk (依賴庫)
cd csobot/matrix-bot
ln -s ../../matrix-python-sdk/matrix_client
> 修改配置文件
cp csobot-matrix.cfg.sample csobot-matrix.cfg
vi csobot-matrix.cfg
> 設置到系統服務
# cp csobot-matrix.service /etc/systemd/system
$ vi /etc/systemd/system/csobot-matrix.service
systemctl enable csobot-matrix
systemctl start csobot-matrix
```
## Updates
- 2020.02.26 新增:matrix-bot,直接發送消息到 Matrix 平臺。
- 2019.11.19 新增:ipfs-add-all 命令,抓取更多网页元素。
- 2019.08.31 新增:check-ipfs-gateway.sh(位于墙内节点)。`ipfs-add`生成网页的 ipfs hash 时使用该脚本生成的 gateway 列表里的网址。
- 2019.07.21 新增:check-signalapp.sh(位于墙内节点)。
- 2019.07.20 新增:提供 IPFS 相关功能
- 2019.06.09 新增 run-ooni-probe.sh
## TODO
- [x] `IPFS 转换器`:会抓取该网页站内文字、部分图片和 js/css 等元素。但不抓取站外、第三方资源。
- [ ] 查询墙内可用的 IPFS gateway 服务(可用服务列表来自:[public gateway list](https://github.com/ipfs/public-gateway-checker/blob/master/gateways.json))。
<hr />
## 什么是 Matrix ?以及 Element?
[Matrix](https://matrix.org) 是一种新型去中心化通讯网络,它让互相通讯的客户端可以不再依赖唯一的中心化的服务器,实现的是多中心的自选或自建的服务器作为服务端。目前在这个网络上的客户端软件有很多,其中最流行的是 [Element](https://element.io/),在各操作系统平台均有版本,也有PC桌面和網頁版: https://app.element.io
用最最简单的(人)话来说,就是 Matrix 这玩意其实借鉴了 Email 的连结方式。大家可曾记得每人的电子邮件地址:`abc@xyz.com` —— xyz.com 就是自己可以选择的邮件服务商,不同人可以选择不同的服务商,互相之间都可以通信。这就是古老但有效的去中心化的方式(只是到了现代,很多通讯软件都只允许用户使用官方的服务了,不能选择别人的,因为都不可能自己搭建该软件的服务器~呵呵)
因此,在使用和注册 Matrix 的时候,请大家不要怕麻烦,选择其中一家服务者的服务器进行注册和登录,之后的互相通讯就没什么特别的了(服务器列表在下文的链接李)。顺便说一句,只有这样,才能抵抗无论是政府的封锁和软件服务商自己的原因拒绝提供服务了。
那么如果你还想问 Matrix 和 Element 的关系时,可以拿 Email 来帮忙理解:Email vs Gmail vs Outlook 客户端。 小明想使用 Email,于是她去 Gmail 注册了一个邮箱,然后她再在自己的电脑上打开了 Outlook 客户端,登录自己的 Gmail 账号,愉快地接收邮件了。所以 Matrix 好比 Email,下面的众多服务器(home server)就相当于 Gmail,Protonmail,Element 就好比邮件客户端(如 Outlook,Apple Mail,Thunderbird,QQ),三种东西基本都可以互相组合使用不会有什么例外。
### 注册一个账号
那么由于服务端可以自选/自建,就不必一定用官方的 matrix.org 注册账号了(而且也被墙了)。
目前有这些公开的他人运营的 Matrix 服务端(其实大多都是非营利组织的):
```
https://www.hello-matrix.net/public_servers.php
```
启动 app 或桌面/网页版时应该都可见注册的入口,旁边可自行选择 `Other homeserver` 然后输入上面其中一个服务器地址作为自己帐号的所在服务器。

### 加入一个房间
手机版点击「+」,桌面/网页版点击 Filter 输入框旁边的小指南针图标(看到了吗?是的我承认这UI的设计……),搜索关键词如`csobot` 应该能见到该房间,点击进入。 注意:只有公开的房间才能搜索到,不开放的房间可以通过邀请直接进入。


### 创建一个房间
也和加入房间差不多,只是在进入之后的输入框上方点击文字超链接:`create a new room`。
(由于 Matrix 和 Element 还在不断开发中,因此此文对应的是 2021年初的版本)
| mdrights/CSObot | README.md | Markdown | gpl-3.0 | 7,298 | [
30522,
1001,
20116,
16429,
4140,
1006,
8247,
1007,
1011,
1037,
28516,
3529,
1996,
2942,
2554,
8593,
1999,
2859,
1012,
1011,
1740,
100,
100,
100,
1746,
1800,
1916,
1772,
1892,
1924,
100,
100,
100,
1916,
100,
100,
1756,
1006,
28516,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'use strict'; // eslint-disable-line semi
const request = require('supertest');
const {expect} = require('chai');
const db = require('APP/db');
const app = require('./start');
describe('/api/users', () => {
before('Await database sync', () => db.didSync);
afterEach('Clear the tables', () => db.truncate({ cascade: true }));
describe('GET /:id', () => {
describe('when not logged in', () => {
it('fails with a 401 (Unauthorized)', () =>
request(app)
.get(`/api/users/1`)
.expect(401)
);
});
});
describe('POST', () => {
describe('when not logged in', () => {
it('creates a user', () =>
request(app)
.post('/api/users')
.send({
email: 'beth@secrets.org',
password: '12345'
})
.expect(201)
);
it('redirects to the user it just made', () =>
request(app)
.post('/api/users')
.send({
email: 'eve@interloper.com',
password: '23456',
})
.redirects(1)
.then(res => expect(res.body).to.contain({
email: 'eve@interloper.com'
}))
);
});
});
});
| jzheng16/personal-website | server/users.test.js | JavaScript | mit | 1,217 | [
30522,
1005,
2224,
9384,
1005,
1025,
1013,
1013,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
2240,
4100,
9530,
3367,
5227,
1027,
5478,
1006,
1005,
3565,
22199,
1005,
1007,
1025,
9530,
3367,
1063,
5987,
1065,
1027,
5478,
1006,
1005,
15775,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* JBoss, Home of Professional Open Source
* Copyright 2015, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.weld.tests.el.resolver;
import javax.inject.Named;
@Named("com.acme.settings")
public class MyBean {
public String getFoo() {
return "foo";
}
}
| antoinesd/weld-core | tests-arquillian/src/test/java/org/jboss/weld/tests/el/resolver/MyBean.java | Java | apache-2.0 | 957 | [
30522,
1013,
1008,
1008,
1046,
15853,
2015,
1010,
2188,
1997,
2658,
2330,
3120,
1008,
9385,
2325,
1010,
2417,
6045,
1010,
4297,
1012,
1010,
1998,
3265,
16884,
1008,
2011,
1996,
1030,
6048,
6415,
1012,
2156,
1996,
9385,
1012,
19067,
2102,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package compilerapi
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"strings"
)
const (
GoogleEndpointUrl = "http://closure-compiler.appspot.com/compile"
)
// See https://developers.google.com/closure/compiler/docs/api-ref for details about the options
type Client struct {
// Possible values: ECMASCRIPT3, ECMASCRIPT5, ECMASCRIPT5_STRICT, default to ECMASCRIPT5_STRICT
Language string
// Possible values: WHITESPACE_ONLY, SIMPLE_OPTIMIZATIONS, ADVANCED_OPTIMIZATIONS, default to WHITESPACE_ONLY
CompilationLevel string
}
type OutputError struct {
Charno int `json:"charno"`
Error string `json:"error"`
Lineno int `json:"lineno"`
File string `json:"file"`
Type string `json:"type"`
Line string `json:"line"`
}
func (e *OutputError) AsLogline() string {
return fmt.Sprintf("\033[36;1m[%d, %d]\033[31m error: \033[0m%s\n\t%s\n",
e.Lineno,
e.Charno,
e.Error,
e.Line,
)
}
type OutputWarning struct {
Charno int `json:"charno"`
Warning string `json:"warning"`
Lineno int `json:"lineno"`
File string `json:"file"`
Type string `json:"type"`
Line string `json:"line"`
}
func (w *OutputWarning) AsLogline() string {
return fmt.Sprintf("\033[36;1m[%d, %d]\033[33m warning: \033[0m%s\n\t%s\n",
w.Lineno,
w.Charno,
w.Warning,
w.Line,
)
}
type OutputServerError struct {
Code int `json:"code"`
Error string `json:"error"`
}
type OutputStatistics struct {
OriginalSize int `json:"originalSize"`
CompressedSize int `json:"compressedSize"`
CompileTime int `json:"compileTime"`
}
type Output struct {
CompiledCode string `json:"compiledCode"`
Errors []OutputError `json:"errors"`
Warnings []OutputWarning `json:"warnings"`
ServerErrors *OutputServerError `json:"serverErrors"`
Statistics OutputStatistics `json:"statistics"`
}
func (client *Client) buildRequest(jsCode []byte) *http.Request {
values := url.Values{}
values.Set("js_code", string(jsCode[:]))
values.Set("output_format", "json")
values.Add("output_info", "compiled_code")
values.Add("output_info", "statistics")
values.Add("output_info", "warnings")
values.Add("output_info", "errors")
if client.Language != "" {
values.Set("language", client.Language)
} else {
values.Set("language", "ECMASCRIPT5_STRICT")
}
if client.CompilationLevel != "" {
values.Set("compilation_level", client.CompilationLevel)
} else {
values.Set("compilation_level", "WHITESPACE_ONLY")
}
req, err := http.NewRequest(
"POST",
GoogleEndpointUrl,
strings.NewReader(values.Encode()),
)
if err != nil {
log.Fatalf(err.Error())
}
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
return req
}
func (client *Client) Compile(jsCode []byte) *Output {
httpClient := http.Client{}
req := client.buildRequest(jsCode)
res, err := httpClient.Do(req)
if err != nil {
log.Fatalf(err.Error())
}
content, err := ioutil.ReadAll(res.Body)
res.Body.Close()
if err != nil {
log.Fatalf(err.Error())
}
output := Output{}
err = json.Unmarshal(content, &output)
if err != nil {
log.Fatalf(err.Error())
}
return &output
}
| ant0ine/go-closure-compilerapi | client.go | GO | mit | 3,163 | [
30522,
7427,
21624,
9331,
2072,
12324,
1006,
1000,
17181,
1013,
1046,
3385,
1000,
1000,
4718,
2102,
1000,
1000,
22834,
1013,
22834,
21823,
2140,
1000,
1000,
8833,
1000,
1000,
5658,
1013,
8299,
1000,
1000,
5658,
1013,
24471,
2140,
1000,
1000... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace Reshadman\FileSecretary\Application\Usecases;
use Ramsey\Uuid\Uuid;
use Reshadman\FileSecretary\Application\EloquentPersistedFile;
use Reshadman\FileSecretary\Application\PersistableFile;
use Reshadman\FileSecretary\Application\PresentedFile;
use Reshadman\FileSecretary\Infrastructure\FileSecretaryManager;
class StoreTrackedFile
{
/**
* @var StoreFile
*/
private $storeFile;
/**
* @var FileSecretaryManager
*/
private $fManager;
public function __construct(StoreFile $storeFile, FileSecretaryManager $fManager)
{
$this->storeFile = $storeFile;
$this->fManager = $fManager;
}
/**
* @param PresentedFile $presentedFile
* @return PersistableFile|EloquentPersistedFile
*/
public function execute(PresentedFile $presentedFile)
{
$stored = $this->storeFile->execute($presentedFile);
return $this->fManager->getPersistModel()->create([
'uuid' => Uuid::uuid4()->toString(),
'context' => $presentedFile->getContext(),
'original_name' => $presentedFile->getOriginalName(),
'file_name' => $presentedFile->getFileName(false),
'sibling_folder' => $presentedFile->getSiblingFolder(),
'context_folder' => $presentedFile->getContextFolder(),
'file_hash' => $presentedFile->getMd5Hash(),
'file_extension' => $presentedFile->getFileExtension(),
'file_ensured_hash' => $presentedFile->getSha1Hash(),
'file_size' => $stored->getRealFileSize(),
'category' => $presentedFile->getCategory()
]);
}
} | reshadman/file-secretary | src/Application/Usecases/StoreTrackedFile.php | PHP | mit | 1,650 | [
30522,
1026,
1029,
25718,
3415,
15327,
24501,
16102,
2386,
1032,
6764,
8586,
13465,
5649,
1032,
4646,
1032,
2224,
18382,
2015,
1025,
2224,
15092,
1032,
1057,
21272,
1032,
1057,
21272,
1025,
2224,
24501,
16102,
2386,
1032,
6764,
8586,
13465,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Make screen : lists different control activities and allows to select which to use
var MakeScreen = Screen.extend({
enter: function(){
// Display this screen
this.display('make_screen');
// Setup button clicks
this.html.find(".btn-play").off().click(function(){ fabrica.navigation.go("/make/play"); });
this.html.find(".btn-upload").off().click(function(){ fabrica.navigation.go("/make/upload"); });
},
});
screens.make = new MakeScreen();
| arthurwolf/fabrica | src/interfaces/fabrica/make/make.js | JavaScript | gpl-3.0 | 503 | [
30522,
1013,
1013,
2191,
3898,
1024,
7201,
2367,
2491,
3450,
1998,
4473,
2000,
7276,
2029,
2000,
2224,
13075,
3084,
24410,
1027,
3898,
1012,
7949,
1006,
1063,
4607,
1024,
3853,
1006,
1007,
1063,
1013,
1013,
4653,
2023,
3898,
2023,
1012,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<div class="container" id="mainContent">
<div id="topOfPage">
</div>
<h1>
Feedback Results - Student
</h1>
<br>
<div class="well well-plain">
<div class="panel-body">
<div class="form-horizontal">
<div class="panel-heading">
<div class="form-group">
<label class="col-sm-2 control-label">
Course ID:
</label>
<div class="col-sm-10">
<p class="form-control-static">
AHPUiT____.instr1_.gma-demo
</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Session:
</label>
<div class="col-sm-10">
<p class="form-control-static">
First team feedback session
</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Opening time:
</label>
<div class="col-sm-10">
<p class="form-control-static">
Sun, 01 Apr 2012, 11:59 PM
</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Closing time:
</label>
<div class="col-sm-10">
<p class="form-control-static">
Mon, 02 Apr 2012, 11:59 PM
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div id="statusMessagesToUser">
<div class="overflow-auto alert alert-info statusMessage">
You have received feedback from others. Please see below.
</div>
</div>
<script defer="" src="/js/statusMessage.js" type="text/javascript">
</script>
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h4>
Question 1:
<span class="text-preserve-space">
Please rate the estimated contribution of your team members and yourself.
<span style=" white-space: normal;">
<a class="color_gray" data-less="[less]" data-more="[more]" href="javascript:;" id="questionAdditionalInfoButton-1-" onclick="toggleAdditionalQuestionInfo('1-')">
[more]
</a>
<br>
<span id="questionAdditionalInfo-1-" style="display:none;">
Team contribution question
</span>
</span>
</span>
</h4>
<div class="panel panel-primary">
<div class="panel-heading">
Comparison of work distribution
<span style=" white-space: normal;">
<a class="small link-in-dark-bg" data-less="[less]" data-more="[how to interpret, etc..]" href="javascript:;" id="questionAdditionalInfoButton-1-contributionInfo" onclick="toggleAdditionalQuestionInfo('1-contributionInfo')">
[how to interpret, etc..]
</a>
<br>
<span id="questionAdditionalInfo-1-contributionInfo" style="display:none;">
<h4 id="interpret">
How do I interpret these results?
</h4>
<ul class="bulletedList">
<li>
Compare values given under 'My view' to those under 'Team's view'. This tells you whether your perception matches with what the team thinks, particularly regarding your own contribution. You may ignore minor differences.
</li>
<li>
Team's view of your contribution is the average value of the contribution your team members attributed to you, excluding the contribution you attributed to yourself. That means you cannot boost your perceived contribution by claiming a high contribution for yourself or attributing a low contribution to team members.
</li>
<li>
Also note that the team’s view has been scaled up/down so that the sum of values in your view matches the sum of values in team’s view. That way, you can make a direct comparison between your view and the team’s view. As a result, the values you see in team’s view may not match the values your team members see in their results.
</li>
</ul>
<br>
<h4>
How are these results used in grading?
</h4>
TEAMMATES does not calculate grades. It is up to the instructors to use contribution question results in any way they want. However, TEAMMATES recommend that contribution question results are used only as flags to identify teams with contribution imbalances. Once identified, the instructor is recommended to investigate further before taking action.
<br>
<br>
<h4>
How are the contribution numbers calculated?
</h4>
Here are the important things to note:
<ul class="bulletedList">
<li>
The contribution you attributed to yourself is not used when calculating the perceived contribution of you or team members.
</li>
<li>
From the estimates you submit, we try to deduce the answer to this question: In your opinion, if your teammates are doing the project by themselves without you, how do they compare against each other in terms of contribution? This is because we want to deduce your unbiased opinion about your team members’ contributions. Then, we use those values to calculate the average perceived contribution of each team member.
</li>
<li>
When deducing the above, we first adjust the estimates you submitted to remove artificial inflations/deflations. For example, giving everyone [Equal share + 20%] is as same as giving everyone [Equal share] because in both cases all members have done a similar share of work.
</li>
</ul>
The actual calculation is a bit complex and the finer details can be found
<a href="https://docs.google.com/document/d/1hjQQHYM3YId0EUSrGnJWG5AeFpDD_G7xg_d--7jg3vU/pub?embedded=true#h.n5u2xs6z9y0g">
here
</a>
.
</span>
</span>
</div>
<table class="table table-striped">
<tbody>
<tr>
<td>
<strong>
My view:
</strong>
</td>
<td>
<span class="text-muted">
<strong>
of me:
</strong>
</span>
<span class="color-positive">
E +10%
</span>
</td>
<td>
<span class="text-muted">
<strong>
of others:
</strong>
</span>
<span class="color-positive">
E +10%
</span>
,
<span class="color-positive">
E +10%
</span>
,
<span class="color-negative">
E -20%
</span>
</td>
</tr>
<tr>
<td>
<strong>
Team's view:
</strong>
</td>
<td>
<span class="text-muted">
<strong>
of me:
</strong>
</span>
<span class="color-positive">
E +9%
</span>
</td>
<td>
<span class="text-muted">
<strong>
of others:
</strong>
</span>
<span class="color-positive">
E +9%
</span>
,
<span class="color-positive">
E +9%
</span>
,
<span class="color-negative">
E -18%
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h4>
Question 2:
<span class="text-preserve-space">
Comments about my contribution (shown to other teammates)
</span>
</h4>
<div class="panel panel-info">
<div class="panel-heading">
<b>
To:
</b>
You
</div>
<table class="table">
<tbody>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
You
</td>
</tr>
<tr>
<td class="text-preserve-space">
I was the project lead. I designed the application architecture and managed the project to ensure we deliver the product on time.
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
<b>
To:
</b>
Charlie Davis
</div>
<table class="table">
<tbody>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
Charlie Davis
</td>
</tr>
<tr>
<td class="text-preserve-space">
I am a bit slow compared to my team mates, but the members helped me to catch up.
</td>
</tr>
<tr>
<td>
<ul class="list-group comment-list">
<li class="list-group-item list-group-item-warning" id="responseCommentRow-${comment.id}">
<div id="commentBar-${comment.id}">
<span class="text-muted">
From: AHPUiT+++_.instr1!@gmail.tmt [Mon, 30 Apr 2012, 09:36 PM UTC]
</span>
</div>
<div id="plainCommentText-${comment.id}" style="margin-left: 15px;">
<p>
Well, Being your first team project always takes some time. I hope you had nice experience working with the team.
</p>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
<b>
To:
</b>
Francis Gabriel
</div>
<table class="table">
<tbody>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
Francis Gabriel
</td>
</tr>
<tr>
<td class="text-preserve-space">
I was the designer. I did all the UI work.
</td>
</tr>
<tr>
<td>
<ul class="list-group comment-list">
<li class="list-group-item list-group-item-warning" id="responseCommentRow-${comment.id}">
<div id="commentBar-${comment.id}">
<span class="text-muted">
From: AHPUiT+++_.instr1!@gmail.tmt [Mon, 30 Apr 2012, 09:39 PM UTC]
</span>
</div>
<div id="plainCommentText-${comment.id}" style="margin-left: 15px;">
<p>
Design could have been more interactive.
</p>
</div>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
<b>
To:
</b>
Gene Hudson
</div>
<table class="table">
<tbody>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
Gene Hudson
</td>
</tr>
<tr>
<td class="text-preserve-space">
I am the programmer for the team. I did most of the coding.
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h4>
Question 3:
<span class="text-preserve-space">
My comments about this teammate(confidential and only shown to instructor)
</span>
</h4>
<div class="panel panel-info">
<div class="panel-heading">
<b>
To:
</b>
Charlie Davis
</div>
<table class="table">
<tbody>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
You
</td>
</tr>
<tr>
<td class="text-preserve-space">
A bit weak in terms of technical skills. He spent lots of time in picking up the skills. Although a bit slow in development, his attitude is good.
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<b>
To:
</b>
Francis Gabriel
</div>
<table class="table">
<tbody>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
You
</td>
</tr>
<tr>
<td class="text-preserve-space">
Francis is the designer of the project. He did a good job!
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<b>
To:
</b>
Gene Hudson
</div>
<table class="table">
<tbody>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
You
</td>
</tr>
<tr>
<td class="text-preserve-space">
Gene is the programmer for our team. She put in a lot of effort in coding a significant portion of the project.
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h4>
Question 4:
<span class="text-preserve-space">
Comments about team dynamics(confidential and only shown to instructor)
</span>
</h4>
<div class="panel panel-info">
<div class="panel-heading">
<b>
To:
</b>
Team 2
</div>
<table class="table">
<tbody>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
You
</td>
</tr>
<tr>
<td class="text-preserve-space">
I had a great time with this team. Thanks for all the support from the members.
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h4>
Question 5:
<span class="text-preserve-space">
My feedback to this teammate(shown anonymously to the teammate)
</span>
</h4>
<div class="panel panel-primary">
<div class="panel-heading">
<b>
To:
</b>
You
</div>
<table class="table">
<tbody>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
Anonymous student ${participant.hash}
</td>
</tr>
<tr>
<td class="text-preserve-space">
Thank you AHPUiT Instrúctör WithPlusInEmail for all the hardwork!
</td>
</tr>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
Anonymous student ${participant.hash}
</td>
</tr>
<tr>
<td class="text-preserve-space">
Thank you AHPUiT Instrúctör WithPlusInEmail for all the help in the project.
</td>
</tr>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
Anonymous student ${participant.hash}
</td>
</tr>
<tr>
<td class="text-preserve-space">
Thank you AHPUiT Instrúctör WithPlusInEmail for being such a good team leader!
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<b>
To:
</b>
Charlie Davis
</div>
<table class="table">
<tbody>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
You
</td>
</tr>
<tr>
<td class="text-preserve-space">
Good try Charlie! Thanks for showing great effort in picking up the skills.
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<b>
To:
</b>
Francis Gabriel
</div>
<table class="table">
<tbody>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
You
</td>
</tr>
<tr>
<td class="text-preserve-space">
Nice work Francis!
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<b>
To:
</b>
Gene Hudson
</div>
<table class="table">
<tbody>
<tr class="resultSubheader">
<td>
<span class="bold">
<b>
From:
</b>
</span>
You
</td>
</tr>
<tr>
<td class="text-preserve-space">
Keep up the good work Gene!
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br>
</div>
| thenaesh/teammates | src/test/resources/pages/newlyJoinedInstructorStudentFeedbackResultsPage.html | HTML | gpl-2.0 | 20,492 | [
30522,
1026,
4487,
2615,
2465,
1027,
1000,
11661,
1000,
8909,
1027,
1000,
2364,
8663,
6528,
2102,
1000,
1028,
1026,
4487,
2615,
8909,
1027,
1000,
2327,
11253,
13704,
1000,
1028,
1026,
1013,
4487,
2615,
1028,
1026,
1044,
2487,
1028,
12247,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/usr/bin/perl -w
use strict;
use Getopt::Long;
use FindBin qw($Bin $Script);
use File::Basename qw(basename dirname);
use Data::Dumper;
use lib "/home/zhoujj/my_lib/pm";
use bioinfo;
&usage if @ARGV<1;
#open IN,"" ||die "Can't open the file:$\n";
#open OUT,"" ||die "Can't open the file:$\n";
sub usage {
my $usage = << "USAGE";
Description of this script.
Author: zhoujj2013\@gmail.com
Usage: $0 <para1> <para2>
Example:perl $0 para1 para2
USAGE
print "$usage";
exit(1);
};
my ($all_int_f, $directed_int_f, $inferred_int_f, $ra_scored_inferred_int_f) = @ARGV;
my %directed;
open IN,"$directed_int_f" || die $!;
while(<IN>){
chomp;
my @t = split /\t/;
unless(exists $directed{$t[0]}{$t[1]} || exists $directed{$t[1]}{$t[0]}){
my $score = 1;
if($t[3] =~ /\d+$/){
$score = $t[3];
}else{
$score = 1;
}
$directed{$t[0]}{$t[1]} = $score;
}
}
close IN;
my %inferred;
open IN,"$inferred_int_f" || die $!;
while(<IN>){
chomp;
my @t = split /\t/;
unless(exists $inferred{$t[0]}{$t[1]} || exists $inferred{$t[1]}{$t[0]}){
my $score = 0;
if($t[3] =~ /\d+$/){
$score = $t[3];
}else{
$score = 1;
}
$inferred{$t[0]}{$t[1]} = $score;
}
}
close IN;
my %ra;
open IN,"$ra_scored_inferred_int_f" || die $!;
while(<IN>){
chomp;
my @t = split /\t/;
unless(exists $ra{$t[0]}{$t[1]} || exists $ra{$t[1]}{$t[0]}){
$ra{$t[0]}{$t[1]} = $t[3];
}
}
close IN;
my %int;
open IN,"$all_int_f" || die $!;
while(<IN>){
chomp;
my @t = split /\t/;
if(exists $directed{$t[0]}{$t[1]} || exists $directed{$t[1]}{$t[0]}){
my $score = abs($directed{$t[0]}{$t[1]});
$t[3] = $score;
}elsif(exists $inferred{$t[0]}{$t[1]} || exists $inferred{$t[1]}{$t[0]}){
my $score1 = 0;
if(exists $inferred{$t[0]}{$t[1]}){
$score1 = $inferred{$t[0]}{$t[1]};
}elsif(exists $inferred{$t[1]}{$t[0]}){
$score1 = $inferred{$t[1]}{$t[0]};
}
my $score2 = 0;
if(exists $ra{$t[0]}{$t[1]}){
$score2 = abs($ra{$t[0]}{$t[1]});
}elsif(exists $ra{$t[1]}{$t[0]}){
$score2 = abs($ra{$t[1]}{$t[0]});
}
my $score = ($score1 + $score2)/2;
$t[3] = $score;
}
print join "\t",@t;
print "\n";
}
close IN;
| zhoujj2013/lncfuntk | bin/NetworkConstruction/bk/CalcConfidentScore.pl | Perl | mit | 2,170 | [
30522,
1001,
999,
1013,
2149,
2099,
1013,
8026,
1013,
2566,
2140,
1011,
1059,
2224,
9384,
1025,
2224,
2131,
7361,
2102,
1024,
1024,
2146,
1025,
2224,
2424,
8428,
1053,
2860,
1006,
1002,
8026,
1002,
5896,
1007,
1025,
2224,
5371,
1024,
1024... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
public class Usuario
{
static void Main(string[] args)
{
Expresion expresionConsulta = null;
Console.Write("Introduzca su consulta: ");
string consulta = Console.ReadLine();
try
{
expresionConsulta = Expresion.analiza(consulta);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
expresionConsulta = null;
}
if (expresionConsulta != null)
{
Console.WriteLine(
"Introduzca la descripción de un vehículo: ");
string descripcion = Console.ReadLine();
if (expresionConsulta.evalua(descripcion))
Console.WriteLine(
"La descripción responde a la consulta");
else
Console.WriteLine(
"La descripción no responde a la consulta");
}
}
}
| pcurich/TiendaOnLine | DesignPatterns/reference/Interpreter/Usuario.cs | C# | apache-2.0 | 919 | [
30522,
2478,
2291,
1025,
2270,
2465,
2149,
6692,
9488,
1063,
10763,
11675,
2364,
1006,
5164,
1031,
1033,
12098,
5620,
1007,
1063,
4654,
28994,
3258,
4654,
28994,
3258,
8663,
23722,
2696,
1027,
19701,
1025,
10122,
1012,
4339,
1006,
1000,
171... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace Algolia\SearchBundle;
use Algolia\SearchBundle\TestApp\Entity\Comment;
use Algolia\SearchBundle\TestApp\Entity\Image;
use Algolia\SearchBundle\TestApp\Entity\Post;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\ConsoleOutput;
class BaseTest extends KernelTestCase
{
public function setUp(): void
{
self::bootKernel();
}
protected function createPost($id = null): Post
{
$post = new Post();
$post->setTitle('Test');
$post->setContent('Test content');
if (!is_null($id)) {
$post->setId($id);
}
return $post;
}
protected function createSearchablePost(): SearchableEntity
{
$post = $this->createPost(random_int(100, 300));
return new SearchableEntity(
$this->getPrefix() . 'posts',
$post,
$this->get('doctrine')->getManager()->getClassMetadata(Post::class),
$this->get('serializer')
);
}
protected function createComment($id = null): Comment
{
$comment = new Comment();
$comment->setContent('Comment content');
$comment->setPost(new Post(['title' => 'What a post!', 'content' => 'my content']));
if (!is_null($id)) {
$comment->setId($id);
}
return $comment;
}
protected function createImage($id = null): Image
{
$image = new Image();
if (!is_null($id)) {
$image->setId($id);
}
return $image;
}
protected function createSearchableImage(): SearchableEntity
{
$image = $this->createImage(random_int(100, 300));
return new SearchableEntity(
$this->getPrefix() . 'image',
$image,
$this->get('doctrine')->getManager()->getClassMetadata(Image::class),
null
);
}
protected function getPrefix(): ?string
{
return $this->get('search.service')->getConfiguration()['prefix'];
}
protected function get($id): ?object
{
return self::$kernel->getContainer()->get($id);
}
protected function refreshDb($application): void
{
$inputs = [
new ArrayInput([
'command' => 'doctrine:schema:drop',
'--full-database' => true,
'--force' => true,
'--quiet' => true,
]),
new ArrayInput([
'command' => 'doctrine:schema:create',
'--quiet' => true,
]),
];
$application->setAutoExit(false);
foreach ($inputs as $input) {
$application->run($input, new ConsoleOutput());
}
}
protected function getFileName($indexName, $type): string
{
return sprintf(
'%s/%s-%s.json',
$this->get('search.service')->getConfiguration()['settingsDirectory'],
$indexName,
$type
);
}
protected function getDefaultConfig(): array
{
return [
'hitsPerPage' => 20,
'maxValuesPerFacet' => 100,
];
}
}
| algolia/AlgoliaSearchBundle | tests/BaseTest.php | PHP | mit | 3,259 | [
30522,
1026,
1029,
25718,
3415,
15327,
2632,
24141,
2401,
1032,
3945,
27265,
2571,
1025,
2224,
2632,
24141,
2401,
1032,
3945,
27265,
2571,
1032,
3231,
29098,
1032,
9178,
1032,
7615,
1025,
2224,
2632,
24141,
2401,
1032,
3945,
27265,
2571,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
*
* Copyright 2021 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPC_RB_XDS_CHANNEL_CREDENTIALS_H_
#define GRPC_RB_XDS_CHANNEL_CREDENTIALS_H_
#include <grpc/grpc_security.h>
#include <ruby/ruby.h>
#include <stdbool.h>
/* Initializes the ruby ChannelCredentials class. */
void Init_grpc_xds_channel_credentials();
/* Gets the wrapped credentials from the ruby wrapper */
grpc_channel_credentials* grpc_rb_get_wrapped_xds_channel_credentials(VALUE v);
/* Check if v is kind of XdsChannelCredentials */
bool grpc_rb_is_xds_channel_credentials(VALUE v);
#endif /* GRPC_RB_XDS_CHANNEL_CREDENTIALS_H_ */
| nicolasnoble/grpc | src/ruby/ext/grpc/rb_xds_channel_credentials.h | C | apache-2.0 | 1,151 | [
30522,
1013,
1008,
1008,
1008,
9385,
25682,
24665,
15042,
6048,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#region License
// TableDependency, SqlTableDependency
// Copyright (c) 2015-2020 Christian Del Bianco. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
namespace TableDependency.SqlClient.Base.Abstracts
{
public interface IUpdateOfModel<T> where T : class
{
void Add(params Expression<Func<T, object>>[] expressions);
int Count();
IList<PropertyInfo> GetPropertiesInfos();
}
} | christiandelbianco/monitor-table-change-with-sqltabledependency | TableDependency.SqlClient/Base/Abstracts/IUpdateOfModel.cs | C# | mit | 1,589 | [
30522,
1001,
2555,
6105,
1013,
1013,
2795,
3207,
11837,
4181,
5666,
1010,
29296,
10880,
3207,
11837,
4181,
5666,
1013,
1013,
9385,
1006,
1039,
1007,
2325,
1011,
12609,
3017,
3972,
12170,
2319,
3597,
1012,
2035,
30524,
1010,
2489,
1997,
3715... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*****************************************************************************/
/* */
/* Copyright 1999 - 2003, Huawei Tech. Co., Ltd. */
/* ALL RIGHTS RESERVED */
/* */
/* FileName: v_int.c */
/* */
/* Author: Yang Xiangqian */
/* */
/* Version: 1.0 */
/* */
/* Date: 2006-10 */
/* */
/* Description: implement int function */
/* */
/* Others: */
/* */
/* History: */
/* 1. Date: */
/* Author: */
/* Modification: Create this file */
/* */
/* 2. Date: 2006-10 */
/* Author: Xu Cheng */
/* Modification: Standardize code */
/* */
/* */
/*****************************************************************************/
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cpluscplus */
#endif /* __cpluscplus */
#include "vos_config.h"
#include "v_typdef.h"
#include "v_lib.h"
#if (VOS_WIN32 == VOS_OS_VER)
CRITICAL_SECTION VOS_CriticalSection;
/*****************************************************************************
Function : VOS_SplInit()
Description: Initialize the interrupt
Input : None
Return : Nnoe
*****************************************************************************/
VOS_VOID VOS_SplInit()
{
InitializeCriticalSection( &VOS_CriticalSection );
}
/*****************************************************************************
Function : VOS_SplIMP()
Description: Turn off the interrupt
Input : None
Return : VOS_OK;
Other : none
*****************************************************************************/
VOS_CPU_SR VOS_SplIMP(VOS_VOID)
{
EnterCriticalSection( &VOS_CriticalSection );
return VOS_OK;
}
/*****************************************************************************
Function : VOS_Splx()
Description: Turn on the interrupt
Input : s -- value returned by VOS_SplIMP()
Return : None
*****************************************************************************/
VOS_VOID VOS_Splx( VOS_CPU_SR s )
{
LeaveCriticalSection ( &VOS_CriticalSection );
}
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cpluscplus */
#endif /* __cpluscplus */
| gabry3795/android_kernel_huawei_mt7_l09 | drivers/vendor/hisi/modem/med/hi6930/osa/src/v_int.c | C | gpl-2.0 | 3,786 | [
30522,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Set up so TypeInt only defined during InconsistentHeader1.h include.
#ifdef SYMBOL1
#define SYMBOL 1
#define FUNC_STYLE(a, b) a||b
#endif
#ifdef SYMBOL2
#define SYMBOL 2
#define FUNC_STYLE(a, b) a&&b
#endif
#if SYMBOL == 1
typedef int TypeInt;
#endif
int var = FUNC_STYLE(1, 0);
#if defined(SYMBOL1)
#endif
| endlessm/chromium-browser | third_party/llvm/clang-tools-extra/test/modularize/Inputs/InconsistentSubHeader.h | C | bsd-3-clause | 313 | [
30522,
1013,
1013,
2275,
2039,
2061,
2828,
18447,
2069,
4225,
2076,
20316,
4974,
2121,
2487,
1012,
1044,
2421,
1012,
1001,
2065,
3207,
2546,
6454,
2487,
1001,
9375,
6454,
1015,
1001,
9375,
4569,
2278,
1035,
2806,
1006,
1037,
1010,
1038,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.javascript.optimizer;
import org.mozilla.javascript.ArrowFunction;
import org.mozilla.javascript.Callable;
import org.mozilla.javascript.ConsString;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.ContextFactory;
import org.mozilla.javascript.ES6Generator;
import org.mozilla.javascript.Function;
import org.mozilla.javascript.JavaScriptException;
import org.mozilla.javascript.NativeFunction;
import org.mozilla.javascript.NativeGenerator;
import org.mozilla.javascript.NativeIterator;
import org.mozilla.javascript.Script;
import org.mozilla.javascript.ScriptRuntime;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;
import org.mozilla.javascript.Undefined;
/**
* <p>OptRuntime class.</p>
*
*
*
*/
public final class OptRuntime extends ScriptRuntime
{
/** Constant <code>oneObj</code> */
public static final Double oneObj = Double.valueOf(1.0);
/** Constant <code>minusOneObj</code> */
public static final Double minusOneObj = Double.valueOf(-1.0);
/**
* Implement ....() call shrinking optimizer code.
*
* @param fun a {@link org.mozilla.javascript.Callable} object.
* @param thisObj a {@link org.mozilla.javascript.Scriptable} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object call0(Callable fun, Scriptable thisObj,
Context cx, Scriptable scope)
{
return fun.call(cx, scope, thisObj, ScriptRuntime.emptyArgs);
}
/**
* Implement ....(arg) call shrinking optimizer code.
*
* @param fun a {@link org.mozilla.javascript.Callable} object.
* @param thisObj a {@link org.mozilla.javascript.Scriptable} object.
* @param arg0 a {@link java.lang.Object} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object call1(Callable fun, Scriptable thisObj, Object arg0,
Context cx, Scriptable scope)
{
return fun.call(cx, scope, thisObj, new Object[] { arg0 } );
}
/**
* Implement ....(arg0, arg1) call shrinking optimizer code.
*
* @param fun a {@link org.mozilla.javascript.Callable} object.
* @param thisObj a {@link org.mozilla.javascript.Scriptable} object.
* @param arg0 a {@link java.lang.Object} object.
* @param arg1 a {@link java.lang.Object} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object call2(Callable fun, Scriptable thisObj,
Object arg0, Object arg1,
Context cx, Scriptable scope)
{
return fun.call(cx, scope, thisObj, new Object[] { arg0, arg1 });
}
/**
* Implement ....(arg0, arg1, ...) call shrinking optimizer code.
*
* @param fun a {@link org.mozilla.javascript.Callable} object.
* @param thisObj a {@link org.mozilla.javascript.Scriptable} object.
* @param args an array of {@link java.lang.Object} objects.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object callN(Callable fun, Scriptable thisObj,
Object[] args,
Context cx, Scriptable scope)
{
return fun.call(cx, scope, thisObj, args);
}
/**
* Implement name(args) call shrinking optimizer code.
*
* @param args an array of {@link java.lang.Object} objects.
* @param name a {@link java.lang.String} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object callName(Object[] args, String name,
Context cx, Scriptable scope)
{
Callable f = getNameFunctionAndThis(name, cx, scope);
Scriptable thisObj = lastStoredScriptable(cx);
return f.call(cx, scope, thisObj, args);
}
/**
* Implement name() call shrinking optimizer code.
*
* @param name a {@link java.lang.String} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object callName0(String name,
Context cx, Scriptable scope)
{
Callable f = getNameFunctionAndThis(name, cx, scope);
Scriptable thisObj = lastStoredScriptable(cx);
return f.call(cx, scope, thisObj, ScriptRuntime.emptyArgs);
}
/**
* Implement x.property() call shrinking optimizer code.
*
* @param value a {@link java.lang.Object} object.
* @param property a {@link java.lang.String} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object callProp0(Object value, String property,
Context cx, Scriptable scope)
{
Callable f = getPropFunctionAndThis(value, property, cx, scope);
Scriptable thisObj = lastStoredScriptable(cx);
return f.call(cx, scope, thisObj, ScriptRuntime.emptyArgs);
}
/**
* <p>add.</p>
*
* @param val1 a {@link java.lang.Object} object.
* @param val2 a double.
* @return a {@link java.lang.Object} object.
*/
public static Object add(Object val1, double val2)
{
if (val1 instanceof Scriptable)
val1 = ((Scriptable) val1).getDefaultValue(null);
if (!(val1 instanceof CharSequence))
return wrapDouble(toNumber(val1) + val2);
return new ConsString((CharSequence)val1, toString(val2));
}
/** {@inheritDoc} */
public static Object add(double val1, Object val2)
{
if (val2 instanceof Scriptable)
val2 = ((Scriptable) val2).getDefaultValue(null);
if (!(val2 instanceof CharSequence))
return wrapDouble(toNumber(val2) + val1);
return new ConsString(toString(val1), (CharSequence)val2);
}
/** {@inheritDoc} */
@Deprecated
public static Object elemIncrDecr(Object obj, double index,
Context cx, int incrDecrMask)
{
return elemIncrDecr(obj, index, cx, getTopCallScope(cx), incrDecrMask);
}
/** {@inheritDoc} */
public static Object elemIncrDecr(Object obj, double index,
Context cx, Scriptable scope,
int incrDecrMask)
{
return ScriptRuntime.elemIncrDecr(obj, Double.valueOf(index), cx, scope,
incrDecrMask);
}
/**
* <p>padStart.</p>
*
* @param currentArgs an array of {@link java.lang.Object} objects.
* @param count a int.
* @return an array of {@link java.lang.Object} objects.
*/
public static Object[] padStart(Object[] currentArgs, int count) {
Object[] result = new Object[currentArgs.length + count];
System.arraycopy(currentArgs, 0, result, count, currentArgs.length);
return result;
}
/**
* <p>initFunction.</p>
*
* @param fn a {@link org.mozilla.javascript.NativeFunction} object.
* @param functionType a int.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
*/
public static void initFunction(NativeFunction fn, int functionType,
Scriptable scope, Context cx)
{
ScriptRuntime.initFunction(cx, scope, fn, functionType, false);
}
/**
* <p>bindThis.</p>
*
* @param fn a {@link org.mozilla.javascript.NativeFunction} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @param thisObj a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link org.mozilla.javascript.Function} object.
*/
public static Function bindThis(NativeFunction fn, Context cx, Scriptable scope, Scriptable thisObj)
{
return new ArrowFunction(cx, scope, fn, thisObj);
}
/** {@inheritDoc} */
public static Object callSpecial(Context cx, Callable fun,
Scriptable thisObj, Object[] args,
Scriptable scope,
Scriptable callerThis, int callType,
String fileName, int lineNumber)
{
return ScriptRuntime.callSpecial(cx, fun, thisObj, args, scope,
callerThis, callType,
fileName, lineNumber);
}
/**
* <p>newObjectSpecial.</p>
*
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param fun a {@link java.lang.Object} object.
* @param args an array of {@link java.lang.Object} objects.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @param callerThis a {@link org.mozilla.javascript.Scriptable} object.
* @param callType a int.
* @return a {@link java.lang.Object} object.
*/
public static Object newObjectSpecial(Context cx, Object fun,
Object[] args, Scriptable scope,
Scriptable callerThis, int callType)
{
return ScriptRuntime.newSpecial(cx, fun, args, scope, callType);
}
/**
* <p>wrapDouble.</p>
*
* @param num a double.
* @return a {@link java.lang.Double} object.
*/
public static Double wrapDouble(double num)
{
if (num == 0.0) {
if (1 / num > 0) {
// +0.0
return zeroObj;
}
} else if (num == 1.0) {
return oneObj;
} else if (num == -1.0) {
return minusOneObj;
} else if (Double.isNaN(num)) {
return NaNobj;
}
return Double.valueOf(num);
}
static String encodeIntArray(int[] array)
{
// XXX: this extremely inefficient for small integers
if (array == null) { return null; }
int n = array.length;
char[] buffer = new char[1 + n * 2];
buffer[0] = 1;
for (int i = 0; i != n; ++i) {
int value = array[i];
int shift = 1 + i * 2;
buffer[shift] = (char)(value >>> 16);
buffer[shift + 1] = (char)value;
}
return new String(buffer);
}
private static int[] decodeIntArray(String str, int arraySize)
{
// XXX: this extremely inefficient for small integers
if (arraySize == 0) {
if (str != null) throw new IllegalArgumentException();
return null;
}
if (str.length() != 1 + arraySize * 2 && str.charAt(0) != 1) {
throw new IllegalArgumentException();
}
int[] array = new int[arraySize];
for (int i = 0; i != arraySize; ++i) {
int shift = 1 + i * 2;
array[i] = (str.charAt(shift) << 16) | str.charAt(shift + 1);
}
return array;
}
/**
* <p>newArrayLiteral.</p>
*
* @param objects an array of {@link java.lang.Object} objects.
* @param encodedInts a {@link java.lang.String} object.
* @param skipCount a int.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link org.mozilla.javascript.Scriptable} object.
*/
public static Scriptable newArrayLiteral(Object[] objects,
String encodedInts,
int skipCount,
Context cx,
Scriptable scope)
{
int[] skipIndexces = decodeIntArray(encodedInts, skipCount);
return newArrayLiteral(objects, skipIndexces, cx, scope);
}
/**
* <p>main.</p>
*
* @param script a {@link org.mozilla.javascript.Script} object.
* @param args an array of {@link java.lang.String} objects.
*/
public static void main(final Script script, final String[] args)
{
ContextFactory.getGlobal().call(cx -> {
ScriptableObject global = getGlobal(cx);
// get the command line arguments and define "arguments"
// array in the top-level object
Object[] argsCopy = new Object[args.length];
System.arraycopy(args, 0, argsCopy, 0, args.length);
Scriptable argsObj = cx.newArray(global, argsCopy);
global.defineProperty("arguments", argsObj,
ScriptableObject.DONTENUM);
script.exec(cx, global);
return null;
});
}
/**
* <p>throwStopIteration.</p>
*
* @param scope a {@link java.lang.Object} object.
* @param genState a {@link java.lang.Object} object.
*/
public static void throwStopIteration(Object scope, Object genState) {
Object value = getGeneratorReturnValue(genState);
Object si =
(value == Undefined.instance) ?
NativeIterator.getStopIterationObject((Scriptable)scope) :
new NativeIterator.StopIteration(value);
throw new JavaScriptException(si, "", 0);
}
/**
* <p>createNativeGenerator.</p>
*
* @param funObj a {@link org.mozilla.javascript.NativeFunction} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @param thisObj a {@link org.mozilla.javascript.Scriptable} object.
* @param maxLocals a int.
* @param maxStack a int.
* @return a {@link org.mozilla.javascript.Scriptable} object.
*/
public static Scriptable createNativeGenerator(NativeFunction funObj,
Scriptable scope,
Scriptable thisObj,
int maxLocals,
int maxStack)
{
GeneratorState gs = new GeneratorState(thisObj, maxLocals, maxStack);
if (Context.getCurrentContext().getLanguageVersion() >= Context.VERSION_ES6) {
return new ES6Generator(scope, funObj, gs);
} else {
return new NativeGenerator(scope, funObj, gs);
}
}
/**
* <p>getGeneratorStackState.</p>
*
* @param obj a {@link java.lang.Object} object.
* @return an array of {@link java.lang.Object} objects.
*/
public static Object[] getGeneratorStackState(Object obj) {
GeneratorState rgs = (GeneratorState) obj;
if (rgs.stackState == null)
rgs.stackState = new Object[rgs.maxStack];
return rgs.stackState;
}
/**
* <p>getGeneratorLocalsState.</p>
*
* @param obj a {@link java.lang.Object} object.
* @return an array of {@link java.lang.Object} objects.
*/
public static Object[] getGeneratorLocalsState(Object obj) {
GeneratorState rgs = (GeneratorState) obj;
if (rgs.localsState == null)
rgs.localsState = new Object[rgs.maxLocals];
return rgs.localsState;
}
/**
* <p>setGeneratorReturnValue.</p>
*
* @param obj a {@link java.lang.Object} object.
* @param val a {@link java.lang.Object} object.
*/
public static void setGeneratorReturnValue(Object obj, Object val) {
GeneratorState rgs = (GeneratorState) obj;
rgs.returnValue = val;
}
/**
* <p>getGeneratorReturnValue.</p>
*
* @param obj a {@link java.lang.Object} object.
* @return a {@link java.lang.Object} object.
*/
public static Object getGeneratorReturnValue(Object obj) {
GeneratorState rgs = (GeneratorState) obj;
return (rgs.returnValue == null ? Undefined.instance : rgs.returnValue);
}
public static class GeneratorState {
static final String CLASS_NAME =
"org/mozilla/javascript/optimizer/OptRuntime$GeneratorState";
@SuppressWarnings("unused")
public int resumptionPoint;
static final String resumptionPoint_NAME = "resumptionPoint";
static final String resumptionPoint_TYPE = "I";
@SuppressWarnings("unused")
public Scriptable thisObj;
static final String thisObj_NAME = "thisObj";
static final String thisObj_TYPE =
"Lorg/mozilla/javascript/Scriptable;";
Object[] stackState;
Object[] localsState;
int maxLocals;
int maxStack;
Object returnValue;
GeneratorState(Scriptable thisObj, int maxLocals, int maxStack) {
this.thisObj = thisObj;
this.maxLocals = maxLocals;
this.maxStack = maxStack;
}
}
}
| oswetto/LoboEvolution | LoboParser/src/main/java/org/mozilla/javascript/optimizer/OptRuntime.java | Java | gpl-3.0 | 18,041 | [
30522,
1013,
1008,
2023,
3120,
3642,
2433,
2003,
3395,
2000,
1996,
3408,
1997,
1996,
9587,
5831,
4571,
2270,
1008,
6105,
1010,
1058,
1012,
1016,
1012,
1014,
1012,
2065,
1037,
6100,
1997,
1996,
6131,
2140,
2001,
2025,
5500,
2007,
2023,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?xml version="1.0" encoding="iso-8859-1"?>
<!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" lang="en">
<!-- Scopes/vsip/impl/Const_cast.html -->
<!-- this view was generated by Scope -->
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"/>
<title>Synopsis - vsip::impl::Const_cast</title>
<link href="../../../synopsis.css" type="text/css" rel="stylesheet"/>
<script src="../../../synopsis.js" type="text/javascript"></script>
</head>
<body class="Scope" onload="load()">
<div class="navigation">
<span class="normal"><a href="../../global.html">Global Namespace</a></span>
<span class="normal"><a href="../../../InheritanceTree.html">Inheritance Tree</a></span>
<span class="normal"><a href="../../../InheritanceGraph.html">Inheritance Graph</a></span>
<span class="normal"><a href="../../../NameIndex.html">Name Index</a></span>
</div>
<!-- this part was generated by Heading -->
<div class="class-template">template <<span class="keyword">typename</span> T></div><div class="class-name">struct <a href="../../vsip.html">vsip</a>::<a href="../impl.html">impl</a>::Const_cast
</div><div class="links"><div class="file">File: <a href="../../../File/vsip/core/storage.hpp.html" target="detail">../../../vsip/core/storage.hpp</a></div> <div class="xref"><a href="../../../XRef/xref43.html#vsip_mimpl_mConst_cast"><img src="../../../xref.png" alt="references"/></a></div> <div class="source"><a href="../../../Source/vsip/core/storage.hpp.html#line19"><img src="../../../src-c++.png" alt="source code"/></a></div></div> <div class="doc"></div> <div class="specializations">Specializations: <div><a href="Const_cast.LT.S.R.html">Const_cast<T*></a></div> <div><a href="Const_cast.Lstd-pair.LT.S.cT.S.R.R.html">Const_cast<std::pair<T*,T*>></a></div> <div><a href="Const_cast.LRt_pointer.LT.R.R.html">Const_cast<Rt_pointer<T>></a></div> <div><a href="Const_cast.LRt_pointer.Lstd-complex.LT.R.R.R.html">Const_cast<Rt_pointer<std::complex<T>>></a></div></div>
<!-- this part was generated by Body -->
<div class="heading"><span id="toggle_s702" onclick="return body_section_toggle('s702');" class="toggle">-</span>Public Member functions</div>
<div class="body expanded" id="s702">
<div class="item"><div class="synopsis"><span class="keyword">static</span> T* <a id="cast_lT_S_r" class="name">cast</a>(T* <span class="variable">p</span>) </div> <div class="xref"><a href="../../../XRef/xref43.html#vsip_mimpl_mConst_cast_mcast_lT_S_r"><img src="../../../xref.png" alt="references"/></a></div> <div class="source"><a href="../../../Source/vsip/core/storage.hpp.html#line21"><img src="../../../src-c++.png" alt="source code"/></a></div> <div class="doc"></div></div>
</div><!-- body -->
<!-- this part was generated by Inheritance -->
<div class="logo">Generated on Sat Apr 17 11:13:40 2010 by
<br/>
<a href="http://synopsis.fresco.org" target="_blank"><img src="../../../synopsis.png" alt="logo"/> synopsis</a> (version 0.12)</div>
</body>
</html>
| maxywb/vsipl | sourceryvsipl++-2.3/share/doc/sourceryvsipl++/api-reference/Scopes/vsip/impl/Const_cast.html | HTML | gpl-2.0 | 3,155 | [
30522,
1026,
1029,
20950,
2544,
1027,
1000,
1015,
1012,
1014,
1000,
17181,
1027,
1000,
11163,
1011,
6070,
28154,
1011,
1015,
1000,
1029,
1028,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Created by PhpStorm.
* User: Renfrid-Sacids
* Date: 2/4/2016
* Time: 9:44 AM
*/
class Xform_model extends CI_Model
{
/**
* Table name for xform definitions
*
* @var string
*/
private static $xform_table_name = "xforms"; //default value
/**
* Table name for archived/deleted xforms
*
* @var string
*/
private static $archive_xform_table_name = "archive_xformx"; //default value
public function __construct()
{
$this->initialize_table();
}
/**
* Initializes table names from configuration files
*/
private function initialize_table()
{
if ($this->config->item("table_xform"))
self::$xform_table_name = $this->config->item("table_xform");
if ($this->config->item("table_archive_xform"))
self::$archive_xform_table_name = $this->config->item("table_archive_xform");
}
/**
* @param $statement
* @return bool
*/
public function create_table($statement)
{
if ($this->db->simple_query($statement)) {
log_message("debug", "Success!");
return TRUE;
} else {
$error = $this->db->error(); // Has keys 'code' and 'message'
log_message("debug", $statement . ", error " . json_encode($error));
return FALSE;
}
}
/**
* @param $statement
* @return bool
*/
public function insert_data($statement)
{
if ($this->db->simple_query($statement)) {
log_message("debug", "Success!");
return TRUE;
} else {
$error = $this->db->error(); // Has keys 'code' and 'message'
log_message("debug", $statement . ", error " . json_encode($error));
}
}
/**
* @param $form_details an array of form details with keys match db field names
* @return id for the created form
*/
public function create_xform($form_details)
{
$this->db->insert(self::$xform_table_name, $form_details);
return $this->db->insert_id();
}
/**
* @param int xform_id the row that needs to be updated
* @param string form_id
* @return bool
*/
public function update_form_id($xform_id, $form_id)
{
$data = array('form_id' => $form_id);
$this->db->where('id', $xform_id);
return $this->db->update(self::$xform_table_name, $data);
}
/**
* @param $form_id
* @param $form_details
* @return mixed
*/
public function update_form($form_id, $form_details)
{
$this->db->where('id', $form_id);
return $this->db->update(self::$xform_table_name, $form_details);
}
/**
* @param null $user_id
* @param int $limit
* @param int $offset
* @return mixed returns list of forms available.
*/
public function get_form_list($user_id = NULL, $limit = 30, $offset = 0)
{
if ($user_id != NULL)
$this->db->where("user_id", $user_id);
$this->db->limit($limit, $offset);
return $this->db->get(self::$xform_table_name)->result();
}
/**
* Finds a table field with point data type
*
* @param $table_name
* @return field name or FALSE
*/
public function get_point_field($table_name)
{
$sql = " SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS ";
$sql .= " WHERE table_name = '{$table_name}' ";
$sql .= " AND DATA_TYPE = 'point'";
$query = $this->db->query($sql);
return ($query->num_rows() == 1) ? $query->row(1)->COLUMN_NAME : FALSE;
}
/**
* @param $form_id
* @return mixed
*/
public function find_by_id($form_id)
{
$this->db->where("id", $form_id);
return $this->db->get(self::$xform_table_name)->row();
}
/**
* @param $xform_id
* @return mixed
*/
public function delete_form($xform_id)
{
$this->db->limit(1);
$this->db->where("id", $xform_id);
return $this->db->delete(self::$xform_table_name);
}
/**
* @param $xform_archive_data
* @return mixed
*/
public function create_archive($xform_archive_data)
{
return $this->db->insert(self::$archive_xform_table_name, $xform_archive_data);
}
/**
* @param $table_name
* @param int $limit
* @param int $offset
* @return mixed returns data from tables created by uploading xform definitions files.
*/
public function find_form_data($table_name, $limit = 30, $offset = 0)
{
$this->db->limit($limit, $offset);
return $this->db->get($table_name)->result();
}
/**
* @param $table_name
* @return mixed return an object of fields of the specified table
*/
public function find_table_columns($table_name)
{
return $this->db->list_fields($table_name);
}
/**
* @param $table_name
* @return mixed returns table fields/columns with metadata object
*/
public function find_table_columns_data($table_name)
{
return $this->db->field_data($table_name);
}
public function get_graph_data($table_name, $x_axis_column, $y_axis_column, $y_axis_action = "COUNT")
{
if ($y_axis_action == "COUNT") {
$this->db->select("`" . $y_axis_column . "`, COUNT(" . $y_axis_column . ") AS `" . strtolower($y_axis_action) . "`");
$this->db->group_by($x_axis_column);
}
if ($y_axis_action == "SUM") {
$this->db->select("`" . $y_axis_column . "`, SUM(" . $y_axis_column . ") AS `" . strtolower($y_axis_action) . "`");
$this->db->group_by($x_axis_column);
}
$this->db->from($table_name);
return $this->db->get()->result();
}
} | renfrid/dataManager | application/models/Xform_model.php | PHP | mit | 5,088 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
2580,
2011,
25718,
19718,
1012,
1008,
5310,
1024,
14916,
27439,
1011,
17266,
9821,
1008,
3058,
1024,
1016,
1013,
1018,
1013,
2355,
1008,
2051,
1024,
1023,
1024,
4008,
2572,
1008,
1013,
2465,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*global document, window, gdn, jQuery*/
jQuery(($) => {
// Check if an element's top is visible in the viewport.
function inview(target) {
target = $(target);
return target.length && target.offset().top > window.pageYOffset;
}
// Find the previous comment of the mentioned user in this discussion.
function get(mention) {
// Extract the CommentID or DiscussionID from the parent item.
const commentID = mention.closest('.Item')[0].id.replace(/\D+/, '');
// Extract the name of the mentioned user.
const username = mention[0].innerHTML.replace(/^@"?(.*?)"?$/, '$1');
return $.getJSON(gdn.url(
'plugin/quotemention' +
'/' + gdn.definition('DiscussionID') +
'/' + commentID +
'/' + encodeURIComponent(username)
));
}
// mouseenter handler: Show a tooltip and/or highlight a post.
function show({currentTarget}) {
const mention = $(currentTarget)
// Keep track of the hover state manually for the "done" callback.
.data('mouseOver', '1');
const loaded = mention.data('quoteMention');
const showProgress = gdn.definition('quoteMention.showProgress', true);
let target;
if (loaded !== undefined) {
target = $(loaded).addClass('mentionHighlight');
} else {
get(mention)
.done((data) => {
// If the mouse is still over the element, highlight the referenced post.
if (mention.data('mouseOver')) {
target = $(data.target).addClass('mentionHighlight');
// Hide the tooltip if the target post is visible.
mention.tooltipster(inview(target) ? 'hide' : 'show');
}
mention
// Replace the content with the actual post.
.tooltipster('content', data.html)
// Save the target for highlighting.
.data('quoteMention', data.target);
})
.fail(() => {
// No post found or request failed: Remove the tooltip.
mention
.tooltipster('disable')
// Prevent further requests.
.data('quoteMention', false);
});
}
// Show the tooltip if it is loading or if the post is not fully visible.
if ((!loaded && showProgress) || (loaded && !inview(target))) {
mention.tooltipster('show');
}
}
// mouseleave handler: Hide a tooltip.
function hide({currentTarget}) {
const mention = $(currentTarget)
.tooltipster('hide')
.data('mouseOver', '');
$(mention.data('quoteMention')).removeClass('mentionHighlight');
}
// Register event handlers for all mentions on the page.
function init() {
const maxWidth = gdn.definition('quoteMention.maxWidth', 350);
const position = gdn.definition('quoteMention.position', 'bottom');
// Initialized mentions get the "quoteMention" class.
$('.ItemComment .Message a:not(.quoteMention)')
// Only grab links that start with an @.
.filter((ignore, {innerHTML}) => innerHTML.substring(0, 1) === '@')
.addClass('quoteMention')
// Initialize the tooltip with the progress animation.
.tooltipster({
content: '<span class="Progress"/>',
contentAsHTML: true,
trigger: 'custom',
position,
speed: 0,
updateAnimation: false,
theme: 'tooltipster-vanilla',
maxWidth
})
.hover(show, hide);
}
// Search for new mentions when comments are added or changed.
$(document).on('CommentAdded CommentEditingComplete CommentPagingComplete', init);
init();
});
| bleistivt/quotemention | js/quotemention.js | JavaScript | gpl-2.0 | 4,098 | [
30522,
1013,
1008,
3795,
6254,
1010,
3332,
1010,
1043,
2094,
2078,
1010,
1046,
4226,
2854,
1008,
1013,
1046,
4226,
2854,
1006,
1006,
1002,
1007,
1027,
1028,
1063,
1013,
1013,
4638,
2065,
2019,
5783,
1005,
1055,
2327,
2003,
5710,
1999,
199... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* //TODO add comments.
*
* @author Evgeny Vorokhobko (vorokhobko2011@yandex.ru).
* @version 1.
* @since 11.11.2016.
*/
package by.vorokhobko.servlets; | 1Evgeny/java-a-to-z | chapter_010_hibernate/configuration/src/main/java/by.vorokhobko/servlets/package-info.java | Java | apache-2.0 | 161 | [
30522,
1013,
1008,
1008,
1008,
1013,
1013,
28681,
2080,
5587,
7928,
1012,
1008,
1008,
1030,
3166,
23408,
17487,
29536,
27923,
6806,
2497,
3683,
1006,
29536,
27923,
6806,
2497,
3683,
11387,
14526,
1030,
13619,
3207,
2595,
1012,
21766,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require 'test_helper'
module Tire
class SearchTest < Test::Unit::TestCase
context "Search" do
setup { Configuration.reset }
should "be initialized with single index" do
s = Search::Search.new('index') { query { string 'foo' } }
assert_match %r|/index/_search|, s.url
end
should "be initialized with multiple indices" do
s = Search::Search.new(['index1','index2']) { query { string 'foo' } }
assert_match %r|/index1,index2/_search|, s.url
end
should "be initialized with multiple indices with options" do
indices = {'index1' => {:boost => 1},'index2' => {:boost => 2}}
s = Search::Search.new(indices) { query { string 'foo' } }
assert_match /index1/, s.url
assert_match /index2/, s.url
assert_equal({'index1' => 1, 'index2' => 2}, s.to_hash[:indices_boost])
end
should "be initialized with multiple indices as string" do
s = Search::Search.new(['index1,index2,index3']) { query { string 'foo' } }
assert_match %r|/index1,index2,index3/_search|, s.url
end
should "allow to search all indices by leaving index empty" do
s = Search::Search.new { query { string 'foo' } }
assert_match %r|localhost:9200/_search|, s.url
end
should "allow to limit results with document type" do
s = Search::Search.new('index', :type => 'bar') do
query { string 'foo' }
end
assert_match %r|index/bar/_search|, s.url
end
should "allow to pass search parameters" do
s = Search::Search.new('index', :routing => 123, :timeout => 1) { query { string 'foo' } }
assert ! s.params.empty?
assert_match %r|routing=123|, s.params
assert_match %r|timeout=1|, s.params
end
should "encode search parameters in the request" do
Configuration.client.expects(:get).with do |url, payload|
url.include? 'routing=123&timeout=1'
end.returns mock_response( { 'hits' => { 'hits' => [ {:_id => 1} ] } }.to_json )
Search::Search.new('index', :routing => 123, :timeout => 1) { query { string 'foo' } }.perform
end
should "encode missing params as an empty string" do
Configuration.client.expects(:get).with do |url, payload|
(! url.include? '?') && (! url.include? '&')
end.returns mock_response( { 'hits' => { 'hits' => [ {:_id => 1} ] } }.to_json )
s = Search::Search.new('index') { query { string 'foo' } }
s.perform
assert_equal '', s.params
end
should "properly encode namespaced document type" do
Configuration.client.expects(:get).with do |url, payload|
url.match %r|index/my_application%2Farticle/_search|
end.returns mock_response( { 'hits' => { 'hits' => [ {:_id => 1} ] } }.to_json )
s = Search::Search.new('index', :type => 'my_application/article') do
query { string 'foo' }
end
s.perform
assert_match %r|index/my_application%2Farticle/_search|, s.url
assert_match %r|index/my_application%2Farticle/_search|, s.to_curl
end
should "allow to pass block to query" do
Search::Query.any_instance.expects(:instance_eval)
Search::Search.new('index') do
query { string 'foo' }
end
end
should "allow to pass block with argument to query (use variables from outer scope)" do
def foo; 'bar'; end
Search::Query.any_instance.expects(:instance_eval).never
Search::Search.new('index') do |search|
search.query do |query|
query.string foo
end
end
end
should "store indices as an array" do
s = Search::Search.new('index1') do;end
assert_equal ['index1'], s.indices
s = Search::Search.new(['index1', 'index2']) do;end
assert_equal ['index1', 'index2'], s.indices
end
should "return curl snippet for debugging" do
s = Search::Search.new('index') do
query { string 'title:foo' }
end
assert_match %r|curl \-X GET 'http://localhost:9200/index/_search\?pretty' -d |, s.to_curl
assert_match %r|\s*{\s*"query"\s*:\s*"title:foo"\s*}\s*|, s.to_curl
end
should "return curl snippet with multiple indices for debugging" do
s = Search::Search.new(['index_1', 'index_2']) do
query { string 'title:foo' }
end
assert_match /index_1,index_2/, s.to_curl
end
should 'not include the load option in queries' do
s = Search::Search.new(:load => { :includes => [:author, {:nested => :relation}] }) do
query { string 'title:foo' }
end
assert_nil s.to_hash[:load], 'Make sure to ignore load in URL params'
end
should "return itself as a Hash" do
s = Search::Search.new('index') do
query { string 'title:foo' }
end
assert_nothing_raised do
assert_instance_of Hash, s.to_hash
assert_equal "title:foo", s.to_hash[:query][:query_string][:query]
end
end
should "allow chaining" do
assert_nothing_raised do
Search::Search.new('index').query { }.
sort { by :title, 'desc' }.
size(5).
sort { by :name, 'asc' }.
from(1).
version(true)
end
end
should "perform the search lazily" do
response = mock_response '{"took":1,"hits":[]}', 200
Configuration.client.expects(:get).returns(response)
Results::Collection.expects(:new).returns([])
s = Search::Search.new('index')
assert_not_nil s.results
assert_not_nil s.response
assert_not_nil s.json
end
should "allow the search criteria to be chained" do
s = Search::Search.new('index').query { string 'foo' }
assert_nil s.filters, "Should NOT have filters"
s.expects(:perform).once
s.filter :term, :other_field => 'bar'
assert s.filters.size == 1, "Should have filters"
s.results
end
should "print debugging information on exception and return false" do
::RestClient::Request.any_instance.
expects(:execute).
raises(::RestClient::InternalServerError)
STDERR.expects(:puts)
s = Search::Search.new('index')
assert_raise Search::SearchRequestFailed do
s.perform
end
end
should "log request, but not response, when logger is set" do
Configuration.logger STDERR
Configuration.client.expects(:get).returns(mock_response( '{"took":1,"hits":[]}', 200 ))
Results::Collection.expects(:new).returns([])
Configuration.logger.expects(:log_request).returns(true)
Configuration.logger.expects(:log_response).with(200, 1, '')
Search::Search.new('index').perform
end
should "log the original exception on failed request" do
Configuration.logger STDERR
Configuration.client.expects(:get).raises(Errno::ECONNREFUSED)
Configuration.logger.expects(:log_response).with('N/A', 'N/A', '')
assert_raise Errno::ECONNREFUSED do
Search::Search.new('index').perform
end
end
should "allow to set the server url" do
search = Search::Search.new('indexA')
Configuration.url 'http://es1.example.com'
Configuration.client.
expects(:get).
with do |url, payload|
url == 'http://es1.example.com/indexA/_search'
end.
returns(mock_response( '{"took":1,"hits":{"total": 0, "hits" : []}}', 200 ))
search.perform
end
context "sort" do
should "allow sorting by multiple fields" do
s = Search::Search.new('index') do
sort do
by :title, 'desc'
by :_score
end
end
hash = MultiJson.decode( s.to_json )
assert_equal [{'title' => 'desc'}, '_score'], hash['sort']
end
should "allow to track scores" do
s = Search::Search.new('index') do
sort { by :title }
track_scores true
end
assert_equal 'true', s.to_hash[:track_scores].to_json
end
end
context "facets" do
should "retrieve terms facets" do
s = Search::Search.new('index') do
facet('foo1') { terms :bar, :global => true }
facet('foo2', :global => true) { terms :bar }
facet('foo3') { terms :baz }
end
assert_equal 3, s.facets.keys.size
assert_not_nil s.facets['foo1']
assert_not_nil s.facets['foo2']
assert_not_nil s.facets['foo3']
end
should "retrieve date histogram facets" do
s = Search::Search.new('index') do
facet('date') { date :published_on }
end
assert_equal 1, s.facets.keys.size
assert_not_nil s.facets['date']
end
end
context "filter" do
should "allow to specify filter" do
s = Search::Search.new('index') do
filter :terms, :tags => ['foo']
end
assert_equal 1, s.filters.size
assert_not_nil s.filters.first
assert_not_nil s.filters.first[:terms]
assert_equal( {:terms => {:tags => ['foo']}}.to_json,
s.to_hash[:filter].to_json )
end
should "allow to add multiple filters" do
s = Search::Search.new('index') do
filter :terms, :tags => ['foo']
filter :term, :words => 125
end
assert_equal 2, s.filters.size
assert_not_nil s.filters.first[:terms]
assert_not_nil s.filters.last[:term]
assert_equal( { :and => [ {:terms => {:tags => ['foo']}}, {:term => {:words => 125}} ] }.to_json,
s.to_hash[:filter].to_json )
end
end
context "highlight" do
should "allow to specify highlight for single field" do
s = Search::Search.new('index') do
highlight :body
end
assert_not_nil s.highlight
assert_instance_of Tire::Search::Highlight, s.highlight
end
should "allow to specify highlight for more fields" do
s = Search::Search.new('index') do
highlight :body, :title
end
assert_not_nil s.highlight
assert_instance_of Tire::Search::Highlight, s.highlight
end
should "allow to specify highlight with for more fields with options" do
s = Search::Search.new('index') do
highlight :body, :title => { :fragment_size => 150, :number_of_fragments => 3 }
end
assert_not_nil s.highlight
assert_instance_of Tire::Search::Highlight, s.highlight
end
end
context "with version" do
should "set the version" do
s = Search::Search.new('index') do
version true
end
hash = MultiJson.decode( s.to_json )
assert_equal true, hash['version']
end
end
context "with from/size" do
should "set the values in request" do
s = Search::Search.new('index') do
size 5
from 3
end
hash = MultiJson.decode( s.to_json )
assert_equal 5, hash['size']
assert_equal 3, hash['from']
end
should "set the size value in options" do
Results::Collection.any_instance.stubs(:total).returns(50)
s = Search::Search.new('index') do
size 5
end
assert_equal 5, s.options[:size]
end
should "set the from value in options" do
Results::Collection.any_instance.stubs(:total).returns(50)
s = Search::Search.new('index') do
from 5
end
assert_equal 5, s.options[:from]
end
end
context "when limiting returned fields" do
should "set the fields limit in request" do
s = Search::Search.new('index') do
fields :title
end
hash = MultiJson.decode( s.to_json )
assert_equal ['title'], hash['fields']
end
should "take multiple fields as an Array" do
s = Search::Search.new('index') do
fields [:title, :tags]
end
hash = MultiJson.decode( s.to_json )
assert_equal ['title', 'tags'], hash['fields']
end
should "take multiple fields as splat argument" do
s = Search::Search.new('index') do
fields :title, :tags
end
hash = MultiJson.decode( s.to_json )
assert_equal ['title', 'tags'], hash['fields']
end
end
context "with min_score" do
should "allow to specify minimum score for returned documents" do
s = Search::Search.new('index') do
query { string 'foo' }
min_score 0.5
end
assert_equal( '0.5', s.to_hash[:min_score].to_json )
end
end
context "with partial fields" do
should "add partial_fields config" do
s = Search::Search.new('index') do
partial_field 'name', :include => 'name_*'
end
hash = MultiJson.decode( s.to_json )
assert_equal({'name' => { 'include' => 'name_*'} }, hash['partial_fields'])
end
end
context "explain" do
should "default to false" do
s = Search::Search.new('index') do
end
hash = MultiJson.decode( s.to_json )
assert_nil hash['explain']
end
should "set the explain field in the request when true" do
s = Search::Search.new('index') do
explain true
end
hash = MultiJson.decode( s.to_json )
assert_equal true, hash['explain']
end
should "not set the explain field when false" do
s = Search::Search.new('index') do
explain false
end
hash = MultiJson.decode( s.to_json )
assert_nil hash['explain']
end
end
context "boolean queries" do
should "wrap other queries" do
# TODO: Try to get rid of the `boolean` method
#
# TODO: Try to get rid of multiple `should`, `must`, invocations, and wrap queries like this:
# boolean do
# should do
# string 'foo'
# string 'bar'
# end
# end
s = Search::Search.new('index') do
query do
boolean do
should { string 'foo' }
should { string 'moo' }
must { string 'title:bar' }
must { terms :tags, ['baz'] }
end
end
end
hash = MultiJson.decode(s.to_json)
query = hash['query']['bool']
# p hash
assert_equal 2, query['should'].size
assert_equal 2, query['must'].size
assert_equal( { 'query_string' => { 'query' => 'foo' } }, query['should'].first)
assert_equal( { 'terms' => { 'tags' => ['baz'] } }, query['must'].last)
end
end
context "boosting queries" do
should "wrap other queries" do
s = Search::Search.new('index') do
query do
boosting do
positive { string 'foo' }
positive { term('bar', 'baz') }
negative { term('bar', 'moo') }
end
end
end
hash = MultiJson.decode(s.to_json)
query = hash['query']['boosting']
assert_equal 2, query['positive'].size
assert_equal 1, query['negative'].size
assert_equal( { 'query_string' => { 'query' => 'foo' } }, query['positive'].first)
assert_equal( { 'term' => { 'bar' => {'term' => 'moo' } } }, query['negative'].first)
end
end
end
context "script field" do
should "allow to specify script field" do
s = Search::Search.new('index') do
script_field :test1, :script => "doc['my_field_name'].value * 2"
end
assert_equal 1, s.script_fields.size
assert_not_nil s.script_fields
assert_not_nil s.script_fields[:test1]
assert_equal( {:test1 => { :script => "doc['my_field_name'].value * 2" }}.to_json,
s.to_hash[:script_fields].to_json )
end
should "allow to add multiple script fields" do
s = Search::Search.new('index') do
script_field :field1, :script => "doc['my_field_name'].value * 2"
script_field :field2, :script => "doc['other_field_name'].value * 3"
end
assert_equal 2, s.script_fields.size
assert_not_nil s.script_fields[:field1]
assert_not_nil s.script_fields[:field2]
assert_equal( { :field1 => { :script => "doc['my_field_name'].value * 2" }, :field2 => { :script => "doc['other_field_name'].value * 3" } }.to_json,
s.to_hash[:script_fields].to_json )
end
end
end
end
| 1776/tire | test/unit/search_test.rb | Ruby | mit | 17,575 | [
30522,
5478,
1005,
3231,
1035,
2393,
2121,
1005,
11336,
12824,
2465,
3945,
22199,
1026,
3231,
1024,
1024,
3131,
1024,
1024,
3231,
18382,
6123,
1000,
3945,
1000,
2079,
16437,
1063,
9563,
1012,
25141,
1065,
2323,
1000,
2022,
3988,
3550,
2007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
//
// System.Drawing.Design.ToolboxService
//
// Authors:
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Collections;
using System.ComponentModel.Design;
using System.Reflection;
using System.Windows.Forms;
namespace System.Drawing.Design {
public abstract class ToolboxService : IComponentDiscoveryService, IToolboxService {
[MonoTODO]
protected ToolboxService ()
{
throw new NotImplementedException ();
}
protected abstract CategoryNameCollection CategoryNames {
get;
}
protected abstract string SelectedCategory {
get;
set;
}
protected abstract ToolboxItemContainer SelectedItemContainer {
get;
set;
}
[MonoTODO]
protected virtual ToolboxItemContainer CreateItemContainer (IDataObject dataObject)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected virtual ToolboxItemContainer CreateItemContainer (ToolboxItem item, IDesignerHost link)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected virtual void FilterChanged ()
{
throw new NotImplementedException ();
}
protected abstract IList GetItemContainers ();
protected abstract IList GetItemContainers (string categoryName);
[MonoTODO]
protected virtual bool IsItemContainer (IDataObject dataObject, IDesignerHost host)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected bool IsItemContainerSupported (ToolboxItemContainer container, IDesignerHost host)
{
throw new NotImplementedException ();
}
protected abstract void Refresh ();
[MonoTODO]
protected virtual void SelectedItemContainerUsed ()
{
throw new NotImplementedException ();
}
[MonoTODO]
protected virtual bool SetCursor ()
{
throw new NotImplementedException ();
}
[MonoTODO]
public static void UnloadToolboxItems ()
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ToolboxItem GetToolboxItem (Type toolType)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ToolboxItem GetToolboxItem (Type toolType, bool nonPublic)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ICollection GetToolboxItems (AssemblyName an)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ICollection GetToolboxItems (AssemblyName an, bool throwOnError)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ICollection GetToolboxItems (Assembly a, string newCodeBase)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ICollection GetToolboxItems (Assembly a, string newCodeBase, bool throwOnError)
{
throw new NotImplementedException ();
}
// IComponentDiscoveryService
ICollection IComponentDiscoveryService.GetComponentTypes (IDesignerHost designerHost, Type baseType)
{
throw new NotImplementedException ();
}
// IToolboxService
CategoryNameCollection IToolboxService.CategoryNames {
get { throw new NotImplementedException (); }
}
string IToolboxService.SelectedCategory {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
void IToolboxService.AddCreator (ToolboxItemCreatorCallback creator, string format)
{
throw new NotImplementedException ();
}
void IToolboxService.AddCreator (ToolboxItemCreatorCallback creator, string format, IDesignerHost host)
{
throw new NotImplementedException ();
}
void IToolboxService.AddLinkedToolboxItem (ToolboxItem toolboxItem, IDesignerHost host)
{
throw new NotImplementedException ();
}
void IToolboxService.AddLinkedToolboxItem (ToolboxItem toolboxItem, string category, IDesignerHost host)
{
throw new NotImplementedException ();
}
void IToolboxService.AddToolboxItem (ToolboxItem toolboxItem, String category)
{
throw new NotImplementedException ();
}
void IToolboxService.AddToolboxItem (ToolboxItem toolboxItem)
{
throw new NotImplementedException ();
}
ToolboxItem IToolboxService.DeserializeToolboxItem (object serializedObject)
{
throw new NotImplementedException ();
}
ToolboxItem IToolboxService.DeserializeToolboxItem (object serializedObject, IDesignerHost host)
{
throw new NotImplementedException ();
}
ToolboxItem IToolboxService.GetSelectedToolboxItem ()
{
throw new NotImplementedException ();
}
ToolboxItem IToolboxService.GetSelectedToolboxItem (IDesignerHost host)
{
throw new NotImplementedException ();
}
ToolboxItemCollection IToolboxService.GetToolboxItems ()
{
throw new NotImplementedException ();
}
ToolboxItemCollection IToolboxService.GetToolboxItems (IDesignerHost host)
{
throw new NotImplementedException ();
}
ToolboxItemCollection IToolboxService.GetToolboxItems (String category)
{
throw new NotImplementedException ();
}
ToolboxItemCollection IToolboxService.GetToolboxItems (String category, IDesignerHost host)
{
throw new NotImplementedException ();
}
bool IToolboxService.IsSupported (object serializedObject, ICollection filterAttributes)
{
throw new NotImplementedException ();
}
bool IToolboxService.IsSupported (object serializedObject, IDesignerHost host)
{
throw new NotImplementedException ();
}
bool IToolboxService.IsToolboxItem (object serializedObject)
{
throw new NotImplementedException ();
}
bool IToolboxService.IsToolboxItem (object serializedObject, IDesignerHost host)
{
throw new NotImplementedException ();
}
void IToolboxService.Refresh ()
{
throw new NotImplementedException ();
}
void IToolboxService.RemoveCreator (string format)
{
throw new NotImplementedException ();
}
void IToolboxService.RemoveCreator (string format, IDesignerHost host)
{
throw new NotImplementedException ();
}
void IToolboxService.RemoveToolboxItem (ToolboxItem toolboxItem)
{
throw new NotImplementedException ();
}
void IToolboxService.RemoveToolboxItem (ToolboxItem toolboxItem, string category)
{
throw new NotImplementedException ();
}
void IToolboxService.SelectedToolboxItemUsed ()
{
throw new NotImplementedException ();
}
object IToolboxService.SerializeToolboxItem (ToolboxItem toolboxItem)
{
throw new NotImplementedException ();
}
bool IToolboxService.SetCursor ()
{
throw new NotImplementedException ();
}
void IToolboxService.SetSelectedToolboxItem (ToolboxItem toolboxItem)
{
throw new NotImplementedException ();
}
}
}
#endif
| edwinspire/VSharp | class/System.Drawing.Design/System.Drawing.Design/ToolboxService.cs | C# | lgpl-3.0 | 7,694 | [
30522,
1013,
1013,
1013,
1013,
2291,
1012,
5059,
1012,
2640,
1012,
6994,
8758,
8043,
7903,
2063,
1013,
1013,
1013,
1013,
6048,
1024,
1013,
1013,
28328,
13433,
24825,
2102,
1026,
28328,
1030,
8418,
20924,
1012,
4012,
1028,
1013,
1013,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 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.
[assembly: AssemblyTitle("ExternalNoCookieLogin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Target Corporation")]
[assembly: AssemblyProduct("ExternalNoCookieLogin")]
[assembly: AssemblyCopyright("Copyright © Target Corporation 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("865efabd-dac7-4bfd-83ff-1ba0132a26d7")]
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| jzoss/LowCalorieOwin | ExternalNoCookieLogin/Properties/AssemblyInfo.cs | C# | mit | 1,409 | [
30522,
2478,
2291,
1012,
9185,
1025,
2478,
2291,
1012,
2448,
7292,
1012,
21624,
8043,
7903,
2229,
1025,
2478,
2291,
1012,
2448,
7292,
1012,
6970,
11923,
2121,
7903,
2229,
1025,
1013,
1013,
2236,
2592,
2055,
2019,
3320,
2003,
4758,
2083,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
function getHost()
{
// Determine the "host" (domain) part of the requested resource URL.
if(isset($_SERVER['HTTP_X_FORWARDED_HOST']) && $host = $_SERVER['HTTP_X_FORWARDED_HOST']) {
$elements = explode(',', $host);
$host = trim(end($elements));
}
else {
if(!isset($_SERVER['HTTP_HOST']) || !$host = $_SERVER['HTTP_HOST']) {
if(!isset($_SERVER['SERVER_NAME']) || !$host = $_SERVER['SERVER_NAME']) {
$host = isset($_SERVER['SERVER_ADDR']) && !empty($_SERVER['SERVER_ADDR'])
? $_SERVER['SERVER_ADDR']
: '';
}
}
}
// Remove port number and username from host.
return trim(preg_replace('/(^.+@|:\d+$)/', '', $host));
}
// Define the Perl-compatible Regular Expression for valid labels in PHP, as application environments must adhere to
// this rule.
defined('VALIDLABEL') || define('VALIDLABEL', '/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/');
// Specify that we are in production mode, we can turn it off in the front controller if you want.
defined('PRODUCTION') || define('PRODUCTION', true);
// If the application environment has already been defined, return it straight away.
// First check that the ENVIRONMENT constant has not already been set in the front-controller (useful for overriding
// configuration values in development or testing stages). If so, return it straight away.
if(defined('ENVIRONMENT')) {
return ENVIRONMENT;
}
/* ================ *\
| VIA: HOST/DOMAIN |
\* ================ */
// Calculate the application environment from the current domain if it has been determined from server variables.
if(!empty($host = getHost())) {
// Load up the configuration for mapping hosts to application environments.
$hosts = file_exists($hostsConfig = dirname(__FILE__) . '/hosts.php')
? require_once $hostsConfig
: null;
// Check to see if the current domain is in the "hosts" configuration.
if(is_array($hosts) && !empty($hosts)) {
foreach($hosts as $domain => $appenv) {
if($domain === $host) {
if(is_string($appenv) && preg_match(VALIDLABEL, $appenv)) {
define('ENVIRONMENT', strtolower($appenv));
return ENVIRONMENT;
}
}
}
}
}
/* ==================== *\
| VIA: SERVER VARIABLE |
\* ==================== */
// Check if the application environment has been set in the server variables. This can be done through Apache's
// htaccess files, or through the Nginx server configuration.
if(isset($_SERVER['ENVIRONMENT']) && preg_match(VALIDLABEL, $appenv = trim($_SERVER['ENVIRONMENT']))) {
define('ENVIRONMENT', strtolower($appenv));
return ENVIRONMENT;
}
/* ================ *\
| VIA: CONFIG FILE |
\* ================ */
$envfile = dirname(__FILE__) . '/.environment';
if(file_exists($envfile) && preg_match(VALIDLABEL, $appenv = trim(file_get_contents($envfile)))) {
define('ENVIRONMENT', strtolower($appenv));
return ENVIRONMENT;
}
// If we got this far then a suitable application environment could not be found. Throw an exception.
throw new \Exception('Could not determine a valid application environment. Please check the application and/or server configuration, and try again.'); | Scowen/osrs-market | application/config/appenv.php | PHP | mit | 3,628 | [
30522,
1026,
1029,
25718,
3853,
2131,
15006,
2102,
1006,
1007,
1063,
1013,
1013,
5646,
1996,
1000,
3677,
1000,
1006,
5884,
1007,
2112,
1997,
1996,
7303,
7692,
24471,
2140,
1012,
2065,
1006,
26354,
3388,
1006,
1002,
1035,
8241,
1031,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
---
date: "2015-10-07T00:00:00Z"
link: http://musicemojis.tumblr.com/
remoteImage: true
title: Music Emojis
category: Inspiration
---
_A showcase of musicians in the minimal style of emojis!_
By [Bruno Leo Ribeiro](http://www.brunoleoribeiro.com/#kauko-home)
| tholman/inspiring-online | content/posts/2015-09-12-music-emojis.md | Markdown | gpl-3.0 | 261 | [
30522,
1011,
1011,
1011,
3058,
1024,
1000,
2325,
1011,
2184,
1011,
5718,
2102,
8889,
1024,
4002,
1024,
4002,
2480,
1000,
4957,
1024,
8299,
1024,
1013,
1013,
2189,
6633,
29147,
2483,
1012,
10722,
14905,
20974,
1012,
4012,
1013,
6556,
9581,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.mk.shoppingbackend.dao;
import java.util.List;
import com.mk.shoppingbackend.dto.Product;
import com.mk.shoppingbackend.dto.Product;
public interface ProductDAO {
Product get(int productId);
List<Product> list();
boolean add(Product product);
boolean update(Product product);
boolean delete(Product product);
//Business method
List<Product> listActiveProducts();
List<Product> listActiveProductsByCategory(int categoryId);
List<Product> getLatestActiveProducts(int count);
}
| M123kumar1/online-shopping | ShoppingBackEnd/src/main/java/com/mk/shoppingbackend/dao/ProductDAO.java | Java | mit | 521 | [
30522,
7427,
4012,
1012,
12395,
1012,
6023,
5963,
10497,
1012,
4830,
2080,
1025,
12324,
9262,
1012,
21183,
4014,
1012,
2862,
1025,
12324,
4012,
1012,
12395,
1012,
6023,
5963,
10497,
1012,
26718,
2080,
1012,
4031,
1025,
12324,
4012,
1012,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
@extends('master')
@section('page-title')
За контакти
@endsection
@section('content')
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>За контакти</h1>
<hr>
</div>
<div class="col-md-6">
<img class="img-responsive" src="/images/contacts.jpg">
</div>
<div class="col-md-6">
@foreach ($contacts as $contact)
@if ($contact->id == 1)
<h4>Работно време: </h4>
<p>{!! $contact->text !!}</p>
@endif
@endforeach
<hr>
@foreach ($contacts as $contact)
@if ($contact->id == 2)
<h4>Телефон за консултации и поръчки:</h4>{{ $contact->text }}
@endif
@endforeach
<hr>
@foreach ($contacts as $contact)
@if ($contact->id == 3)
<h4>Email: </h4>
<p>{{ $contact->text }}</p>
@endif
@endforeach
<hr>
@foreach ($contacts as $contact)
@if ($contact->id == 4)
<h4>Адрес: </h4>
<p>{{ $contact->text }}</p>
@endif
@endforeach
</div>
</div>
</div>
@endsection | gospodin-binev/avtoparts.bg | resources/views/pages/contacts.blade.php | PHP | gpl-2.0 | 1,082 | [
30522,
1030,
8908,
1006,
1005,
3040,
1005,
1007,
1030,
2930,
1006,
1005,
3931,
1011,
2516,
1005,
1007,
1187,
10260,
1189,
14150,
18947,
22919,
10260,
23925,
22919,
10325,
1030,
4515,
18491,
1030,
2930,
1006,
1005,
4180,
1005,
1007,
1026,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* ecgen, tool for generating Elliptic curve domain parameters
* Copyright (C) 2017-2018 J08nY
*/
#include "hex.h"
#include "exhaustive/arg.h"
#include "field.h"
#include "util/bits.h"
#include "util/memory.h"
#include "util/str.h"
static char *hex_point(point_t *point) {
GEN fx = field_elementi(gel(point->point, 1));
GEN fy = field_elementi(gel(point->point, 2));
char *fxs = pari_sprintf("%P0#*x", cfg->hex_digits, fx);
char *fxy = pari_sprintf("%P0#*x", cfg->hex_digits, fy);
char *result = str_joinv(",", fxs, fxy, NULL);
pari_free(fxs);
pari_free(fxy);
return result;
}
static char *hex_points(point_t *points[], size_t len) {
char *p[len];
for (size_t i = 0; i < len; ++i) {
point_t *pt = points[i];
p[i] = hex_point(pt);
}
size_t total = 1;
for (size_t i = 0; i < len; ++i) {
total += strlen(p[i]);
}
char *result = try_calloc(total);
for (size_t i = 0; i < len; ++i) {
strcat(result, p[i]);
try_free(p[i]);
}
return result;
}
CHECK(hex_check_param) {
HAS_ARG(args);
char *search_hex = try_strdup(args->args);
char *p = search_hex;
for (; *p; ++p) *p = (char)tolower(*p);
char *params[OFFSET_END] = {NULL};
bool pari[OFFSET_END] = {false};
if (state >= OFFSET_SEED) {
if (curve->seed && curve->seed->seed) {
params[OFFSET_SEED] = bits_to_hex(curve->seed->seed);
}
}
if (state >= OFFSET_FIELD) {
if (cfg->field == FIELD_PRIME) {
params[OFFSET_FIELD] =
pari_sprintf("%P0#*x", cfg->hex_digits, curve->field);
pari[OFFSET_FIELD] = true;
} else if (cfg->field == FIELD_BINARY) {
}
}
if (state >= OFFSET_A) {
params[OFFSET_A] =
pari_sprintf("%P0#*x", cfg->hex_digits, field_elementi(curve->a));
pari[OFFSET_A] = true;
}
if (state >= OFFSET_B) {
params[OFFSET_B] =
pari_sprintf("%P0#*x", cfg->hex_digits, field_elementi(curve->b));
pari[OFFSET_B] = true;
}
if (state >= OFFSET_ORDER) {
params[OFFSET_ORDER] =
pari_sprintf("%P0#*x", cfg->hex_digits, curve->order);
pari[OFFSET_ORDER] = true;
}
if (state >= OFFSET_GENERATORS) {
char *subgroups[curve->ngens];
for (size_t i = 0; i < curve->ngens; ++i) {
subgroups[i] = hex_point(curve->generators[i]->generator);
}
params[OFFSET_GENERATORS] = str_join(",", subgroups, curve->ngens);
for (size_t i = 0; i < curve->ngens; ++i) {
try_free(subgroups[i]);
}
}
if (state >= OFFSET_POINTS) {
char *subgroups[curve->ngens];
for (size_t i = 0; i < curve->ngens; ++i) {
subgroups[i] = hex_points(curve->generators[i]->points,
curve->generators[i]->npoints);
}
params[OFFSET_POINTS] = str_join(",", subgroups, curve->ngens);
for (size_t i = 0; i < curve->ngens; ++i) {
try_free(subgroups[i]);
}
}
int result = OFFSET_FIELD - state;
for (offset_e i = OFFSET_SEED; i < OFFSET_END; ++i) {
if (params[i]) {
if (result != 1 && strstr(params[i], search_hex)) {
result = 1;
}
if (pari[i]) {
pari_free(params[i]);
} else {
try_free(params[i]);
}
}
}
try_free(search_hex);
return result;
} | J08nY/ecgen | src/gen/hex.c | C | gpl-2.0 | 3,044 | [
30522,
1013,
1008,
1008,
14925,
6914,
1010,
6994,
2005,
11717,
29413,
7774,
5884,
11709,
1008,
9385,
1006,
1039,
1007,
2418,
1011,
2760,
1046,
2692,
2620,
4890,
1008,
1013,
1001,
2421,
1000,
2002,
2595,
1012,
1044,
1000,
1001,
2421,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
//------------------------------------------------------------------------------
// <generado automáticamente>
// Este código fue generado por una herramienta.
//
// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
// se vuelve a generar el código.
// </generado automáticamente>
//------------------------------------------------------------------------------
namespace SSPES.Views.Proyectos {
public partial class ConsultarProyectos {
}
}
| ValentinaRiA/SSPES | SSPES/SSPES/Views/Proyectos/EliminarProyecto.aspx.designer.cs | C# | mit | 522 | [
30522,
1013,
1013,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
30524,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-16" http-equiv="Content-Type" />
<title _locid="PortabilityAnalysis0">.NET Portability Report</title>
<style>
/* Body style, for the entire document */
body {
background: #F3F3F4;
color: #1E1E1F;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
padding: 0;
margin: 0;
}
/* Header1 style, used for the main title */
h1 {
padding: 10px 0px 10px 10px;
font-size: 21pt;
background-color: #E2E2E2;
border-bottom: 1px #C1C1C2 solid;
color: #201F20;
margin: 0;
font-weight: normal;
}
/* Header2 style, used for "Overview" and other sections */
h2 {
font-size: 18pt;
font-weight: normal;
padding: 15px 0 5px 0;
margin: 0;
}
/* Header3 style, used for sub-sections, such as project name */
h3 {
font-weight: normal;
font-size: 15pt;
margin: 0;
padding: 15px 0 5px 0;
background-color: transparent;
}
h4 {
font-weight: normal;
font-size: 12pt;
margin: 0;
padding: 0 0 0 0;
background-color: transparent;
}
/* Color all hyperlinks one color */
a {
color: #1382CE;
}
/* Paragraph text (for longer informational messages) */
p {
font-size: 10pt;
}
/* Table styles */
table {
border-spacing: 0 0;
border-collapse: collapse;
font-size: 10pt;
}
table th {
background: #E7E7E8;
text-align: left;
text-decoration: none;
font-weight: normal;
padding: 3px 6px 3px 6px;
}
table td {
vertical-align: top;
padding: 3px 6px 5px 5px;
margin: 0px;
border: 1px solid #E7E7E8;
background: #F7F7F8;
}
.NoBreakingChanges {
color: darkgreen;
font-weight:bold;
}
.FewBreakingChanges {
color: orange;
font-weight:bold;
}
.ManyBreakingChanges {
color: red;
font-weight:bold;
}
.BreakDetails {
margin-left: 30px;
}
.CompatMessage {
font-style: italic;
font-size: 10pt;
}
.GoodMessage {
color: darkgreen;
}
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
.localLink {
color: #1E1E1F;
background: #EEEEED;
text-decoration: none;
}
.localLink:hover {
color: #1382CE;
background: #FFFF99;
text-decoration: none;
}
/* Center text, used in the over views cells that contain message level counts */
.textCentered {
text-align: center;
}
/* The message cells in message tables should take up all avaliable space */
.messageCell {
width: 100%;
}
/* Padding around the content after the h1 */
#content {
padding: 0px 12px 12px 12px;
}
/* The overview table expands to width, with a max width of 97% */
#overview table {
width: auto;
max-width: 75%;
}
/* The messages tables are always 97% width */
#messages table {
width: 97%;
}
/* All Icons */
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded {
min-width: 18px;
min-height: 18px;
background-repeat: no-repeat;
background-position: center;
}
/* Success icon encoded */
.IconSuccessEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconSuccess#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+eMgQ77v3Xf3Pe51YKGqqisAEwCR1TIAsiAIblSo6xrdHeJR85Xle3mdmCQKb0PsfqyxxzM8K15HZADl/H5+sHpZwYfxyRjTs+kWwKBx8yoHd2mRiuzF8mkJniWH/13u3Fjrs/EdhsdDFHGB/DLXEJBDLh1MWPAhPo1BLB4WX5yQywHR+m3tVe/t97D52CB/ziG0nIgD/qDuYg8WuCcVZ2YGwlJ3YDugkpR/VNcAEx6GEKhERSr71FuO4YCM4XBdwKvecjIlkSnsO0Hyp/GxSeJAdzBKzpOtnPwyyiPdAZhpZptT04tU+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==);
}
/* Information icon encoded */
.IconInfoEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconInformation#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=);
}
/* Warning icon encoded */
.IconWarningEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconWarning#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==);
}
/* Error icon encoded */
.IconErrorEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconError#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=);
}
</style>
</head>
<body>
<h1 _locid="PortabilityReport">.NET Portability Report</h1>
<div id="content">
<div id="submissionId" style="font-size:8pt;">
<p>
<i>
Submission Id
2dd49f3f-896c-4ce4-9f5f-2d9090f19535
</i>
</p>
</div>
<h2 _locid="SummaryTitle">
<a name="Portability Summary"></a>Portability Summary
</h2>
<div id="summary">
<table>
<tbody>
<tr>
<th>Assembly</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
</tr>
<tr>
<td><strong><a href="#Nd.Framework.Logging.Log4Net">Nd.Framework.Logging.Log4Net</a></strong></td>
<td class="text-center">100.00 %</td>
<td class="text-center">97.62 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">97.62 %</td>
</tr>
</tbody>
</table>
</div>
<div id="details">
<a name="Nd.Framework.Logging.Log4Net"><h3>Nd.Framework.Logging.Log4Net</h3></a>
<table>
<tbody>
<tr>
<th>Target type</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
<th>Recommended changes</th>
</tr>
<tr>
<td>System.IO.FileInfo</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
<p>
<a href="#Portability Summary">Back to Summary</a>
</p>
</div>
</div>
</body>
</html> | kuhlenh/port-to-core | Reports/nd/nd.framework.4.0.6/Nd.Framework.Logging.Log4Net-net40.html | HTML | mit | 11,682 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
20950,
3619,
1024,
5796,
2595,
14540,
1027,
1000,
24471,
2078,
1024,
8040,
28433,
2015,
1011,
7513,
1011,
4012,
1024,
1060,
14540,
2102,
1000,
1028,
1026,
2132,
1028,
1026,
18804,
418... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
This file is part of the KDE project
This library is free software you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
aint with this library see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "DgmlValueTagHandler.h"
#include "MarbleDebug.h"
#include "DgmlElementDictionary.h"
#include "DgmlAuxillaryDictionary.h"
#include "GeoParser.h"
#include "GeoSceneProperty.h"
namespace Marble
{
namespace dgml
{
DGML_DEFINE_TAG_HANDLER(Value)
GeoNode* DgmlValueTagHandler::parse(GeoParser& parser) const
{
// Check whether the tag is valid
Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Value));
// Checking for parent item
GeoStackItem parentItem = parser.parentElement();
if (parentItem.represents(dgmlTag_Property)) {
QString parsedText = parser.readElementText().toLower().trimmed();
parentItem.nodeAs<GeoSceneProperty>()->setDefaultValue(parsedText == dgmlValue_true || parsedText == dgmlValue_on);
}
return 0;
}
}
}
| probonopd/marble | src/lib/marble/geodata/handlers/dgml/DgmlValueTagHandler.cpp | C++ | lgpl-2.1 | 1,687 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2263,
24794,
2015,
27946,
2078,
1026,
27946,
2078,
1030,
1047,
3207,
1012,
8917,
1028,
2023,
5371,
2003,
2112,
1997,
1996,
1047,
3207,
2622,
2023,
3075,
2003,
2489,
4007,
2017,
2064,
2417,
2923,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.oozie.executor.jpa;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.oozie.CoordinatorActionBean;
import org.apache.oozie.CoordinatorJobBean;
import org.apache.oozie.client.CoordinatorAction;
import org.apache.oozie.client.CoordinatorJob;
import org.apache.oozie.local.LocalOozie;
import org.apache.oozie.service.JPAService;
import org.apache.oozie.service.Services;
import org.apache.oozie.test.XDataTestCase;
import org.apache.oozie.util.XmlUtils;
public class TestCoordActionGetForStartJPAExecutor extends XDataTestCase {
Services services;
@Override
protected void setUp() throws Exception {
super.setUp();
services = new Services();
services.init();
cleanUpDBTables();
}
@Override
protected void tearDown() throws Exception {
services.destroy();
super.tearDown();
}
public void testCoordActionGet() throws Exception {
int actionNum = 1;
String errorCode = "000";
String errorMessage = "Dummy";
String resourceXmlName = "coord-action-get.xml";
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, false, false);
CoordinatorActionBean action = createCoordAction(job.getId(), actionNum, CoordinatorAction.Status.WAITING,
resourceXmlName, 0);
// Add extra attributes for action
action.setSlaXml(XDataTestCase.slaXml);
action.setErrorCode(errorCode);
action.setErrorMessage(errorMessage);
// Insert the action
insertRecordCoordAction(action);
Path appPath = new Path(getFsTestCaseDir(), "coord");
String actionXml = getCoordActionXml(appPath, resourceXmlName);
Configuration conf = getCoordConf(appPath);
// Pass the expected values
_testGetForStartX(action.getId(), job.getId(), CoordinatorAction.Status.WAITING, 0, action.getId() + "_E",
XDataTestCase.slaXml, resourceXmlName, XmlUtils.prettyPrint(conf).toString(), actionXml,
errorCode, errorMessage);
}
private void _testGetForStartX(String actionId, String jobId, CoordinatorAction.Status status, int pending,
String extId, String slaXml, String resourceXmlName, String createdConf, String actionXml,
String errorCode, String errorMessage) throws Exception {
try {
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
CoordActionGetForStartJPAExecutor actionGetCmd = new CoordActionGetForStartJPAExecutor(actionId);
CoordinatorActionBean action = jpaService.execute(actionGetCmd);
assertNotNull(action);
// Check for expected values
assertEquals(actionId, action.getId());
assertEquals(jobId, action.getJobId());
assertEquals(status, action.getStatus());
assertEquals(pending, action.getPending());
assertEquals(createdConf, action.getCreatedConf());
assertEquals(slaXml, action.getSlaXml());
assertEquals(actionXml, action.getActionXml());
assertEquals(extId, action.getExternalId());
assertEquals(errorMessage, action.getErrorMessage());
assertEquals(errorCode, action.getErrorCode());
}
catch (Exception ex) {
ex.printStackTrace();
fail("Unable to GET a record for COORD Action By actionId =" + actionId);
}
}
}
| terrancesnyder/oozie-hadoop2 | core/src/test/java/org/apache/oozie/executor/jpa/TestCoordActionGetForStartJPAExecutor.java | Java | apache-2.0 | 4,358 | [
30522,
1013,
1008,
1008,
1008,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
1007,
2104,
2028,
1008,
2030,
2062,
12130,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
1008,
5500,
2007,
2023,
2147,
2005,
3176,
2592,
1008,
4953,
9385,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle 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.
//
// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'theme_overlay', language 'es', branch 'MOODLE_22_STABLE'
*
* @package theme_overlay
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['configtitle'] = 'Ajustes Overlay';
$string['customcss'] = 'CSS personalizado';
$string['customcssdesc'] = 'Cualquier CSS que introduzca aquí será agregado a todas las páginas, permitiéndole personalizar con facilidad este tema.';
$string['footertext'] = 'Texto del pie de página';
$string['footertextdesc'] = 'Ajustar una nota o texto a pie de página.';
$string['headercolor'] = 'Color de la cabecera';
$string['headercolordesc'] = 'Color de fondo de la cabecera.';
$string['linkcolor'] = 'Color de los enlaces';
$string['linkcolordesc'] = 'Esta opción ajusta el color de los enlaces en el tema';
$string['pluginname'] = 'Overlay';
$string['region-side-post'] = 'Derecha';
$string['region-side-pre'] = 'Izquierda';
| danielbonetto/twig_MVC | lang/es/theme_overlay.php | PHP | gpl-3.0 | 1,725 | [
30522,
1026,
1029,
25718,
1013,
1013,
2023,
5371,
2003,
30524,
2270,
6105,
2004,
2405,
2011,
1013,
1013,
1996,
2489,
4007,
3192,
1010,
2593,
2544,
1017,
1997,
1996,
6105,
1010,
2030,
1013,
1013,
1006,
2012,
2115,
5724,
1007,
2151,
2101,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* This file is part of the program psim.
Copyright (C) 1994-1996, Andrew Cagney <cagney@highland.com.au>
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/>.
*/
#ifndef _HW_PAL_C_
#define _HW_PAL_C_
#ifndef STATIC_INLINE_HW_PAL
#define STATIC_INLINE_HW_PAL STATIC_INLINE
#endif
#include "device_table.h"
#include "cpu.h"
#ifdef HAVE_STRING_H
#include <string.h>
#else
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
/* DEVICE
pal - glue logic device containing assorted junk
DESCRIPTION
Typical hardware dependant hack. This device allows the firmware
to gain access to all the things the firmware needs (but the OS
doesn't).
The pal contains the following registers. Except for the interrupt
level register, each of the below is 8 bytes in size and must be
accessed using correct alignment. For 16 and 32 bit accesses the
bytes not directed to the register are ignored:
|0 reset register (write)
|4 processor id register (read)
|8 interrupt port (write)
|9 interrupt level (write)
|12 processor count register (read)
|16 tty input fifo register (read)
|20 tty input status register (read)
|24 tty output fifo register (write)
|28 tty output status register (read)
Reset register (write) halts the simulator exiting with the
value written.
Processor id register (read) returns the processor number (0
.. N-1) of the processor performing the read.
The interrupt registers should be accessed as a pair (using a 16 or
32 bit store). The low byte specifies the interrupt port while the
high byte specifies the level to drive that port at. By
convention, the pal's interrupt ports (int0, int1, ...) are wired
up to the corresponding processor's level sensative external
interrupt pin. Eg: A two byte write to address 8 of 0x0102
(big-endian) will result in processor 2's external interrupt pin to
be asserted.
Processor count register (read) returns the total number of
processors active in the current simulation.
TTY input fifo register (read), if the TTY input status register
indicates a character is available by being nonzero, returns the
next available character from the pal's tty input port.
Similarly, the TTY output fifo register (write), if the TTY output
status register indicates the output fifo is not full by being
nonzero, outputs the character written to the tty's output port.
PROPERTIES
reg = <address> <size> (required)
Specify the address (within the parent bus) that this device is to
live.
*/
enum {
hw_pal_reset_register = 0x0,
hw_pal_cpu_nr_register = 0x4,
hw_pal_int_register = 0x8,
hw_pal_nr_cpu_register = 0xa,
hw_pal_read_fifo = 0x10,
hw_pal_read_status = 0x14,
hw_pal_write_fifo = 0x18,
hw_pal_write_status = 0x1a,
hw_pal_address_mask = 0x1f,
};
typedef struct _hw_pal_console_buffer {
char buffer;
int status;
} hw_pal_console_buffer;
typedef struct _hw_pal_device {
hw_pal_console_buffer input;
hw_pal_console_buffer output;
device *disk;
} hw_pal_device;
/* check the console for an available character */
static void
scan_hw_pal(hw_pal_device *hw_pal)
{
char c;
int count;
count = sim_io_read_stdin(&c, sizeof(c));
switch (count) {
case sim_io_not_ready:
case sim_io_eof:
hw_pal->input.buffer = 0;
hw_pal->input.status = 0;
break;
default:
hw_pal->input.buffer = c;
hw_pal->input.status = 1;
}
}
/* write the character to the hw_pal */
static void
write_hw_pal(hw_pal_device *hw_pal,
char val)
{
sim_io_write_stdout(&val, 1);
hw_pal->output.buffer = val;
hw_pal->output.status = 1;
}
static unsigned
hw_pal_io_read_buffer_callback(device *me,
void *dest,
int space,
unsigned_word addr,
unsigned nr_bytes,
cpu *processor,
unsigned_word cia)
{
hw_pal_device *hw_pal = (hw_pal_device*)device_data(me);
unsigned_1 val;
switch (addr & hw_pal_address_mask) {
case hw_pal_cpu_nr_register:
val = cpu_nr(processor);
DTRACE(pal, ("read - cpu-nr %d\n", val));
break;
case hw_pal_nr_cpu_register:
val = tree_find_integer_property(me, "/openprom/options/smp");
DTRACE(pal, ("read - nr-cpu %d\n", val));
break;
case hw_pal_read_fifo:
val = hw_pal->input.buffer;
DTRACE(pal, ("read - input-fifo %d\n", val));
break;
case hw_pal_read_status:
scan_hw_pal(hw_pal);
val = hw_pal->input.status;
DTRACE(pal, ("read - input-status %d\n", val));
break;
case hw_pal_write_fifo:
val = hw_pal->output.buffer;
DTRACE(pal, ("read - output-fifo %d\n", val));
break;
case hw_pal_write_status:
val = hw_pal->output.status;
DTRACE(pal, ("read - output-status %d\n", val));
break;
default:
val = 0;
DTRACE(pal, ("read - ???\n"));
}
memset(dest, 0, nr_bytes);
*(unsigned_1*)dest = val;
return nr_bytes;
}
static unsigned
hw_pal_io_write_buffer_callback(device *me,
const void *source,
int space,
unsigned_word addr,
unsigned nr_bytes,
cpu *processor,
unsigned_word cia)
{
hw_pal_device *hw_pal = (hw_pal_device*)device_data(me);
unsigned_1 *byte = (unsigned_1*)source;
switch (addr & hw_pal_address_mask) {
case hw_pal_reset_register:
cpu_halt(processor, cia, was_exited, byte[0]);
break;
case hw_pal_int_register:
device_interrupt_event(me,
byte[0], /*port*/
(nr_bytes > 1 ? byte[1] : 0), /* val */
processor, cia);
break;
case hw_pal_read_fifo:
hw_pal->input.buffer = byte[0];
DTRACE(pal, ("write - input-fifo %d\n", byte[0]));
break;
case hw_pal_read_status:
hw_pal->input.status = byte[0];
DTRACE(pal, ("write - input-status %d\n", byte[0]));
break;
case hw_pal_write_fifo:
write_hw_pal(hw_pal, byte[0]);
DTRACE(pal, ("write - output-fifo %d\n", byte[0]));
break;
case hw_pal_write_status:
hw_pal->output.status = byte[0];
DTRACE(pal, ("write - output-status %d\n", byte[0]));
break;
}
return nr_bytes;
}
/* instances of the hw_pal device */
static void
hw_pal_instance_delete_callback(device_instance *instance)
{
/* nothing to delete, the hw_pal is attached to the device */
return;
}
static int
hw_pal_instance_read_callback(device_instance *instance,
void *buf,
unsigned_word len)
{
DITRACE(pal, ("read - %s (%ld)", (const char*)buf, (long int)len));
return sim_io_read_stdin(buf, len);
}
static int
hw_pal_instance_write_callback(device_instance *instance,
const void *buf,
unsigned_word len)
{
int i;
const char *chp = buf;
hw_pal_device *hw_pal = device_instance_data(instance);
DITRACE(pal, ("write - %s (%ld)", (const char*)buf, (long int)len));
for (i = 0; i < len; i++)
write_hw_pal(hw_pal, chp[i]);
sim_io_flush_stdoutput();
return i;
}
static const device_instance_callbacks hw_pal_instance_callbacks = {
hw_pal_instance_delete_callback,
hw_pal_instance_read_callback,
hw_pal_instance_write_callback,
};
static device_instance *
hw_pal_create_instance(device *me,
const char *path,
const char *args)
{
return device_create_instance_from(me, NULL,
device_data(me),
path, args,
&hw_pal_instance_callbacks);
}
static const device_interrupt_port_descriptor hw_pal_interrupt_ports[] = {
{ "int", 0, MAX_NR_PROCESSORS },
{ NULL }
};
static void
hw_pal_attach_address(device *me,
attach_type attach,
int space,
unsigned_word addr,
unsigned nr_bytes,
access_type access,
device *client)
{
hw_pal_device *pal = (hw_pal_device*)device_data(me);
pal->disk = client;
}
static device_callbacks const hw_pal_callbacks = {
{ generic_device_init_address, },
{ hw_pal_attach_address, }, /* address */
{ hw_pal_io_read_buffer_callback,
hw_pal_io_write_buffer_callback, },
{ NULL, }, /* DMA */
{ NULL, NULL, hw_pal_interrupt_ports }, /* interrupt */
{ generic_device_unit_decode,
generic_device_unit_encode,
generic_device_address_to_attach_address,
generic_device_size_to_attach_size },
hw_pal_create_instance,
};
static void *
hw_pal_create(const char *name,
const device_unit *unit_address,
const char *args)
{
/* create the descriptor */
hw_pal_device *hw_pal = ZALLOC(hw_pal_device);
hw_pal->output.status = 1;
hw_pal->output.buffer = '\0';
hw_pal->input.status = 0;
hw_pal->input.buffer = '\0';
return hw_pal;
}
const device_descriptor hw_pal_device_descriptor[] = {
{ "pal", hw_pal_create, &hw_pal_callbacks },
{ NULL },
};
#endif /* _HW_PAL_C_ */
| zxombie/aarch64-freebsd-binutils | sim/ppc/hw_pal.c | C | gpl-2.0 | 9,416 | [
30522,
1013,
1008,
2023,
5371,
2003,
2112,
1997,
1996,
2565,
17816,
2213,
1012,
9385,
1006,
1039,
1007,
2807,
1011,
2727,
1010,
4080,
6187,
10177,
2100,
1026,
6187,
10177,
2100,
1030,
10983,
1012,
4012,
1012,
8740,
1028,
2023,
2565,
2003,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" lang="en-US" xml:lang="en-US" data-mc-search-type="Stem" data-mc-help-system-file-name="Documentation.xml" data-mc-path-to-help-system="../" data-mc-target-type="WebHelp2" data-mc-runtime-file-type="Topic" data-mc-preload-images="false" data-mc-in-preview-mode="false" data-mc-toc-path="Command References|Maestro Command Reference|The Maestro Command Language">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../Skins/Default/Stylesheets/Slideshow.css" rel="stylesheet" type="text/css" data-mc-generated="True" />
<link href="../Skins/Default/Stylesheets/TextEffects.css" rel="stylesheet" type="text/css" data-mc-generated="True" />
<link href="../Skins/Default/Stylesheets/Topic.css" rel="stylesheet" type="text/css" data-mc-generated="True" />
<link href="../Skins/Default/Stylesheets/Components/Styles.css" rel="stylesheet" type="text/css" data-mc-generated="True" /><title>propertyclearvalue</title>
<link href="../Resources/Stylesheets/docs.css" rel="stylesheet" />
<script src="../Resources/Scripts/custom.modernizr.js" type="text/javascript">
</script>
<script src="../Resources/Scripts/jquery.min.js" type="text/javascript">
</script>
<script src="../Resources/Scripts/require.min.js" type="text/javascript">
</script>
<script src="../Resources/Scripts/require.config.js" type="text/javascript">
</script>
<script src="../Resources/Scripts/foundation.min.js" type="text/javascript">
</script>
<script src="../Resources/Scripts/plugins.min.js" type="text/javascript">
</script>
<script src="../Resources/Scripts/MadCapAll.js" type="text/javascript">
</script>
</head>
<body><a name="aanchor7933"></a>
<MadCap:concept term="Command References" /><a name="aanchor7934"></a>
<MadCap:concept term="Maestro" />
<table class="NavLink" data-mc-conditions="Default.ScreenOnly">
<tr class="NavLink">
<td class="NavLeft"><span class="NavText">◀ <a class="NavLink MCXref xref xrefNavLink" href="propertycalculate.html" xrefformat="{paratext}">propertycalculate</a></span>
</td>
<td class="NavCenter"><span class="NavText"><a class="NavLink MCXref xref xrefNavLink" href="maestro_command_referenceTOC.htm" xrefformat="{paratext}">Maestro Command Reference Manual</a></span>
</td>
<td class="NavRight"><span class="NavText"><a class="NavLink MCXref xref xrefNavLink" href="propertycreate.html" xrefformat="{paratext}">propertycreate</a> ▶</span>
</td>
</tr>
</table>
<h1 class="title">propertyclearvalue</h1>
<p>This command clear values of the given properties </p>
<p>Syntax: <b>propertyclearvalue</b> <i>allentries</i>= true [<propertynames> ]
</p>
<p>Options:</p>
<dl>
<dt><i>allentries</i>
</dt>
<br />
<dd>The property value to be cleared for selected entries or all the entries. This has two valid values, true for clearing all property values and false for clearing property values for the selected entries only. </dd>
<br />
<dd>
<table summary="">
<tr align="left">
<td valign="top">Valid values:</td>
<td><code>false</code>
<br /><code>true</code>
</td>
</tr>
<tr align="left">
<td valign="top">Default value: </td>
<td valign="top"><b>false</b>
<br />
</td>
</tr>
</table>
</dd>
<br />
</dl>
<p>Operands:</p>
<p><propertynames> </p>
<p>The names of properties for which values need to be cleared. </p>
<table class="NavLink" data-mc-conditions="Default.ScreenOnly">
<tr class="NavLink">
<td class="NavLeft"><span class="NavText">◀ <a class="NavLink MCXref xref xrefNavLink" href="propertycalculate.html" xrefformat="{paratext}">propertycalculate</a></span>
</td>
<td class="NavCenter"><span class="NavText"><a class="NavLink MCXref xref xrefNavLink" href="maestro_command_referenceTOC.htm" xrefformat="{paratext}">Maestro Command Reference Manual</a></span>
</td>
<td class="NavRight"><span class="NavText"><a class="NavLink MCXref xref xrefNavLink" href="propertycreate.html" xrefformat="{paratext}">propertycreate</a> ▶</span>
</td>
</tr>
</table>
</body>
</html> | platinhom/ManualHom | Schrodinger/Schrodinger_2017-1_docs/maestro_command_reference/propertyclearvalue.html | HTML | gpl-2.0 | 5,225 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
20950,
3619,
1024,
5506,
17695,
1027,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
5506,
17695,
6499,
6199,
8059,
1012,
4012,
1013,
8040,
28433,
2015,
1013,
5506,
17695,
1012,
1060,
1615... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
DROP PROCEDURE IF EXISTS selectResetLinks;
DELIMITER $$
CREATE PROCEDURE selectResetLinks(p_timeout_minutes SMALLINT UNSIGNED)
/* By making the parameter unsigned smallint, it has a max value of 65535 */
/* So effectively, the longest expiration that can be generated with this */
/* procedure is 65535 minutes, which is just over 45 days. Seems logical. */
BEGIN
DECLARE v_server_name VARCHAR(30);
DECLARE v_secret_salt VARCHAR(50);
DECLARE v_exp_date INT;
DECLARE v_date_text CHAR(10); /* 10 characters for the time stamp will last until 2286 :-( */
SET v_server_name = 'mm.movementmatch.org'; /* this should be a FQDN */
SET v_secret_salt = 'Insert real salt here'; /* the secret salt must match the secret salt found in include/secrets.php */
SET v_exp_date = UNIX_TIMESTAMP() + (p_timeout_minutes * 60);
SET v_date_text = CAST(v_exp_date AS CHAR CHARACTER SET utf8);
/* the email address is actually URL encoded in the password reset code */
/* in here I did a short workaround which is to replace the @ sign in the */
/* email address with %40, but that will not work with emails that have any */
/* less than standard characters in them, like + or quotes (legal in email addresses) */
/* there is no urlencode function in mysql. To do this right, would need to use or write 1 */
SELECT app_user.user_id, app_user.email,
CONCAT('https://', v_server_name, '/passwordReset.php?email=', REPLACE(app_user.email, '@', '%40'), '&token=',
LEFT(SHA2(CONCAT(v_server_name, REPLACE(app_user.email, '@', '%40'),v_date_text, app_user.user_id,'passwordReset.php', v_secret_salt), 256), 22),
'&user_id=', app_user.user_id, '&date=', v_date_text) AS link
FROM app_user WHERE active_ind = 1;
END
$$
DELIMITER ;
| Discordanian/mmatch | sql/selectResetLinks.sql | SQL | mit | 1,724 | [
30522,
4530,
7709,
2065,
6526,
7276,
6072,
3388,
13767,
2015,
1025,
3972,
27605,
3334,
1002,
1002,
3443,
7709,
7276,
6072,
3388,
13767,
2015,
1006,
1052,
1035,
2051,
5833,
1035,
2781,
2235,
18447,
27121,
1007,
1013,
1008,
2011,
2437,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
---
title: ""
permalink: /sds/3/x/db/000_0-sds-3-x-projects/student-project-01_group-TheTwoCultures/03_word2vec/
sidebar:
nav: "lMenu-SDS-3.x"
---
[As an importable databricks notebook](https://lamastex.github.io/scalable-data-science/sds/3/x/db/000_0-sds-3-x-projects/student-project-01_group-TheTwoCultures/03_word2vec.html)
<iframe src="https://lamastex.github.io/scalable-data-science/sds/3/x/db/000_0-sds-3-x-projects/student-project-01_group-TheTwoCultures/03_word2vec.html" width="1080" height="1080" frameborder="0"></iframe>
| lamastex/scalable-data-science | _sds/3/x/db/000_0-sds-3-x-projects/student-project-01_group-TheTwoCultures/03_word2vec.md | Markdown | unlicense | 538 | [
30522,
1011,
1011,
1011,
2516,
1024,
1000,
1000,
2566,
9067,
19839,
1024,
1013,
17371,
2015,
1013,
1017,
1013,
1060,
1013,
16962,
1013,
2199,
1035,
1014,
1011,
17371,
2015,
1011,
1017,
1011,
1060,
1011,
3934,
1013,
3076,
1011,
2622,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# FPGA settings
FPGA_PART = xcu200-fsgd2104-2-e
FPGA_TOP = fpga
FPGA_ARCH = virtexuplus
# Files for synthesis
SYN_FILES = rtl/fpga.v
SYN_FILES += rtl/fpga_core.v
SYN_FILES += rtl/eth_xcvr_phy_wrapper.v
SYN_FILES += rtl/debounce_switch.v
SYN_FILES += rtl/sync_signal.v
SYN_FILES += lib/eth/rtl/eth_mac_10g_fifo.v
SYN_FILES += lib/eth/rtl/eth_mac_10g.v
SYN_FILES += lib/eth/rtl/axis_xgmii_rx_64.v
SYN_FILES += lib/eth/rtl/axis_xgmii_tx_64.v
SYN_FILES += lib/eth/rtl/eth_phy_10g.v
SYN_FILES += lib/eth/rtl/eth_phy_10g_rx.v
SYN_FILES += lib/eth/rtl/eth_phy_10g_rx_if.v
SYN_FILES += lib/eth/rtl/eth_phy_10g_rx_frame_sync.v
SYN_FILES += lib/eth/rtl/eth_phy_10g_rx_ber_mon.v
SYN_FILES += lib/eth/rtl/eth_phy_10g_rx_watchdog.v
SYN_FILES += lib/eth/rtl/eth_phy_10g_tx.v
SYN_FILES += lib/eth/rtl/eth_phy_10g_tx_if.v
SYN_FILES += lib/eth/rtl/xgmii_baser_dec_64.v
SYN_FILES += lib/eth/rtl/xgmii_baser_enc_64.v
SYN_FILES += lib/eth/rtl/lfsr.v
SYN_FILES += lib/eth/rtl/eth_axis_rx.v
SYN_FILES += lib/eth/rtl/eth_axis_tx.v
SYN_FILES += lib/eth/rtl/udp_complete_64.v
SYN_FILES += lib/eth/rtl/udp_checksum_gen_64.v
SYN_FILES += lib/eth/rtl/udp_64.v
SYN_FILES += lib/eth/rtl/udp_ip_rx_64.v
SYN_FILES += lib/eth/rtl/udp_ip_tx_64.v
SYN_FILES += lib/eth/rtl/ip_complete_64.v
SYN_FILES += lib/eth/rtl/ip_64.v
SYN_FILES += lib/eth/rtl/ip_eth_rx_64.v
SYN_FILES += lib/eth/rtl/ip_eth_tx_64.v
SYN_FILES += lib/eth/rtl/ip_arb_mux.v
SYN_FILES += lib/eth/rtl/arp.v
SYN_FILES += lib/eth/rtl/arp_cache.v
SYN_FILES += lib/eth/rtl/arp_eth_rx.v
SYN_FILES += lib/eth/rtl/arp_eth_tx.v
SYN_FILES += lib/eth/rtl/eth_arb_mux.v
SYN_FILES += lib/eth/lib/axis/rtl/arbiter.v
SYN_FILES += lib/eth/lib/axis/rtl/priority_encoder.v
SYN_FILES += lib/eth/lib/axis/rtl/axis_fifo.v
SYN_FILES += lib/eth/lib/axis/rtl/axis_register.v
SYN_FILES += lib/eth/lib/axis/rtl/axis_async_fifo.v
SYN_FILES += lib/eth/lib/axis/rtl/axis_async_fifo_adapter.v
SYN_FILES += lib/eth/lib/axis/rtl/sync_reset.v
# XDC files
XDC_FILES = fpga.xdc
XDC_FILES += lib/eth/syn/vivado/eth_mac_fifo.tcl
XDC_FILES += lib/eth/lib/axis/syn/vivado/axis_async_fifo.tcl
XDC_FILES += lib/eth/lib/axis/syn/vivado/sync_reset.tcl
# IP
IP_TCL_FILES += ip/eth_xcvr_gt.tcl
include ../common/vivado.mk
program: $(FPGA_TOP).bit
echo "open_hw" > program.tcl
echo "connect_hw_server" >> program.tcl
echo "open_hw_target" >> program.tcl
echo "current_hw_device [lindex [get_hw_devices] 0]" >> program.tcl
echo "refresh_hw_device -update_hw_probes false [current_hw_device]" >> program.tcl
echo "set_property PROGRAM.FILE {$(FPGA_TOP).bit} [current_hw_device]" >> program.tcl
echo "program_hw_devices [current_hw_device]" >> program.tcl
echo "exit" >> program.tcl
vivado -nojournal -nolog -mode batch -source program.tcl
%.mcs %.prm: %.bit
echo "write_cfgmem -force -format mcs -size 128 -interface SPIx4 -loadbit {up 0x01002000 $*.bit} -checksum -file $*.mcs" > generate_mcs.tcl
echo "exit" >> generate_mcs.tcl
vivado -nojournal -nolog -mode batch -source generate_mcs.tcl
mkdir -p rev
COUNT=100; \
while [ -e rev/$*_rev$$COUNT.bit ]; \
do COUNT=$$((COUNT+1)); done; \
COUNT=$$((COUNT-1)); \
for x in .mcs .prm; \
do cp $*$$x rev/$*_rev$$COUNT$$x; \
echo "Output: rev/$*_rev$$COUNT$$x"; done;
flash: $(FPGA_TOP).mcs $(FPGA_TOP).prm
echo "open_hw" > flash.tcl
echo "connect_hw_server" >> flash.tcl
echo "open_hw_target" >> flash.tcl
echo "current_hw_device [lindex [get_hw_devices] 0]" >> flash.tcl
echo "refresh_hw_device -update_hw_probes false [current_hw_device]" >> flash.tcl
echo "create_hw_cfgmem -hw_device [current_hw_device] [lindex [get_cfgmem_parts {mt25qu01g-spi-x1_x2_x4}] 0]" >> flash.tcl
echo "current_hw_cfgmem -hw_device [current_hw_device] [get_property PROGRAM.HW_CFGMEM [current_hw_device]]" >> flash.tcl
echo "set_property PROGRAM.FILES [list \"$(FPGA_TOP).mcs\"] [current_hw_cfgmem]" >> flash.tcl
echo "set_property PROGRAM.PRM_FILES [list \"$(FPGA_TOP).prm\"] [current_hw_cfgmem]" >> flash.tcl
echo "set_property PROGRAM.ERASE 1 [current_hw_cfgmem]" >> flash.tcl
echo "set_property PROGRAM.CFG_PROGRAM 1 [current_hw_cfgmem]" >> flash.tcl
echo "set_property PROGRAM.VERIFY 1 [current_hw_cfgmem]" >> flash.tcl
echo "set_property PROGRAM.CHECKSUM 0 [current_hw_cfgmem]" >> flash.tcl
echo "set_property PROGRAM.ADDRESS_RANGE {use_file} [current_hw_cfgmem]" >> flash.tcl
echo "set_property PROGRAM.UNUSED_PIN_TERMINATION {pull-none} [current_hw_cfgmem]" >> flash.tcl
echo "create_hw_bitstream -hw_device [current_hw_device] [get_property PROGRAM.HW_CFGMEM_BITFILE [current_hw_device]]" >> flash.tcl
echo "program_hw_devices [current_hw_device]" >> flash.tcl
echo "refresh_hw_device [current_hw_device]" >> flash.tcl
echo "program_hw_cfgmem -hw_cfgmem [current_hw_cfgmem]" >> flash.tcl
echo "boot_hw_device [current_hw_device]" >> flash.tcl
echo "exit" >> flash.tcl
vivado -nojournal -nolog -mode batch -source flash.tcl
| alexforencich/verilog-ethernet | example/AU200/fpga_10g/fpga/Makefile | Makefile | mit | 4,890 | [
30522,
1001,
1042,
26952,
2050,
10906,
1042,
26952,
2050,
1035,
2112,
1027,
1060,
10841,
28332,
1011,
1042,
28745,
2094,
17465,
2692,
2549,
1011,
1016,
1011,
1041,
1042,
26952,
2050,
1035,
2327,
1027,
1042,
26952,
2050,
1042,
26952,
2050,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# VIVO: Connect, Share, Discover
[](https://github.com/vivo-project/VIVO/actions?query=workflow%3ABuild) [](https://github.com/vivo-project/VIVO/actions?query=workflow%3ADeploy) [](https://doi.org/10.5281/zenodo.2639713)
VIVO is an open source semantic web tool for research discovery -- finding people and the research they do.
VIVO supports editing, searching, browsing and visualizing research activity in order to discover people, programs,
facilities, funding, scholarly works and events. VIVO's search returns results faceted by type for rapid retrieval of
desired information across disciplines.
## Resources
### VIVO Project web site
http://vivoweb.org/
### VIVO Project Wiki
https://wiki.lyrasis.org/display/VIVO/
### Installation Instructions
Installation instructions for the latest release can be found at this location on the wiki:
https://wiki.lyrasis.org/display/VIVODOC112x/Installing+VIVO
### Docker
VIVO docker container is available at [vivoweb/vivo](https://hub.docker.com/repository/docker/vivoweb/vivo) with accompanying [vivoweb/vivo-solr](https://hub.docker.com/repository/docker/vivoweb/vivo-solr). These can be used independently or with docker-compose.
### Docker Compose
Docker Compose environment variables:
.env defaults
```
LOCAL_VIVO_HOME=./vivo-home
RESET_HOME=false
RESET_CORE=false
```
- `LOCAL_VIVO_HOME`: VIVO home directory on your host machine which will mount to volume in docker container. Set this environment variable to persist your VIVO data on your host machine.
- `RESET_HOME`: Convenience to reset VIVO home when starting container. **Caution**, will delete local configuration, content, and configuration model.
- `RESET_CORE`: Convenience to reset VIVO Solr core when starting container. **Caution**, will require complete reindex.
Before building VIVO, you will also need to clone (and switch to the same branch, if other than main) of [Vitro](https://github.com/vivo-project/Vitro). The Vitro project must be cloned to a sibling directory next to VIVO so that it can be found during the build. You will also need to clone (and switch to the appropriate branch) of [Vitro-languages](https://github.com/vivo-project/Vitro-languages) and [VIVO-languages](https://github.com/vivo-project/VIVO-languages).
Build and start VIVO.
1. In Vitro-languages, run:
```
mvn install
```
2. In VIVO-languages, run:
```
mvn install
```
3. In VIVO (with Vitro cloned alongside it), run:
```
mvn clean package -s installer/example-settings.xml
docker-compose up
```
### Docker Image
To build and run local Docker image.
```
docker build -t vivoweb/vivo:development .
docker run -p 8080:8080 vivoweb/vivo:development
```
## Contact us
There are several ways to contact the VIVO community.
Whatever your interest, we would be pleased to hear from you.
### Contact form
http://vivoweb.org/support/user-feedback
### Mailing lists
#### [vivo-all](https://groups.google.com/forum/#!forum/vivo-all)
This updates list provides news to the VIVO community of interest to all.
#### [vivo-community](https://groups.google.com/forum/#!forum/vivo-community)
Join the VIVO community! Here you'll find non-technical discussion regarding participation, the VIVO
conference, policy, project management, outreach, and engagement.
#### [vivo-tech](https://groups.google.com/forum/#!forum/vivo-tech)
The best place to get your hands dirty in the VIVO Project.
Developers and implementers frequent this list to get the latest on feature design,
development, implementation, and testing.
## Contributing Code
If you would like to contribute code to the VIVO project, please open a ticket
in our [JIRA](https://jira.lyrasis.org/projects/VIVO), and prepare a
pull request that references your ticket. Contributors welcome!
## Citing VIVO
If you are using VIVO in your publications or projects, please cite the software paper in the Journal of Open Source Software:
* Conlon et al., (2019). VIVO: a system for research discovery. Journal of Open Source Software, 4(39), 1182, https://doi.org/10.21105/joss.01182
### BibTeX
```tex
@article{Conlon2019,
doi = {10.21105/joss.01182},
url = {https://doi.org/10.21105/joss.01182},
year = {2019},
publisher = {The Open Journal},
volume = {4},
number = {39},
pages = {1182},
author = {Michael Conlon and Andrew Woods and Graham Triggs and Ralph O'Flinn and Muhammad Javed and Jim Blake and Benjamin Gross and Qazi Asim Ijaz Ahmad and Sabih Ali and Martin Barber and Don Elsborg and Kitio Fofack and Christian Hauschke and Violeta Ilik and Huda Khan and Ted Lawless and Jacob Levernier and Brian Lowe and Jose Martin and Steve McKay and Simon Porter and Tatiana Walther and Marijane White and Stefan Wolff and Rebecca Younes},
title = {{VIVO}: a system for research discovery},
journal = {Journal of Open Source Software}
}
| vivo-project/VIVO | README.md | Markdown | bsd-3-clause | 5,051 | [
30522,
1001,
24269,
1024,
7532,
1010,
3745,
1010,
7523,
1031,
999,
1031,
3857,
1033,
1006,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
1012,
4012,
1013,
24269,
1011,
2622,
1013,
24269,
1013,
2147,
12314,
2015,
1013,
3857,
1013,
10780,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.file;
@SuppressWarnings("serial")
public class FileExistsException extends Exception {
public FileExistsException(String msg) {
super(msg);
}
}
| ChiMarvine/chartreuse-triceratops | youwont/plugins/cordova-plugin-file/src/android/FileExistsException.java | Java | mit | 1,050 | [
30522,
1013,
1008,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
1007,
2104,
2028,
2030,
2062,
12130,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
5500,
2007,
2023,
2147,
2005,
3176,
2592,
4953,
9385,
6095,
1012,
1996,
2004,
2546,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Uncomment the following to provide samples for PageResult<T>. Must also add the Microsoft.AspNet.WebApi.OData
// package to your project.
////#define Handle_PageResultOfT
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net.Http.Headers;
using System.Reflection;
using System.Web;
using System.Web.Http;
#if Handle_PageResultOfT
using System.Web.Http.OData;
#endif
namespace MusicStore.Services.Areas.HelpPage
{
/// <summary>
/// Use this class to customize the Help Page.
/// For example you can set a custom <see cref="System.Web.Http.Description.IDocumentationProvider"/> to supply the documentation
/// or you can provide the samples for the requests/responses.
/// </summary>
public static class HelpPageConfig
{
[SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters",
MessageId = "MusicStore.Services.Areas.HelpPage.TextSample.#ctor(System.String)",
Justification = "End users may choose to merge this string with existing localized resources.")]
[SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly",
MessageId = "bsonspec",
Justification = "Part of a URI.")]
public static void Register(HttpConfiguration config)
{
//// Uncomment the following to use the documentation from XML documentation file.
//config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
//// Uncomment the following to use "sample string" as the sample for all actions that have string as the body parameter or return type.
//// Also, the string arrays will be used for IEnumerable<string>. The sample objects will be serialized into different media type
//// formats by the available formatters.
//config.SetSampleObjects(new Dictionary<Type, object>
//{
// {typeof(string), "sample string"},
// {typeof(IEnumerable<string>), new string[]{"sample 1", "sample 2"}}
//});
// Extend the following to provide factories for types not handled automatically (those lacking parameterless
// constructors) or for which you prefer to use non-default property values. Line below provides a fallback
// since automatic handling will fail and GeneratePageResult handles only a single type.
#if Handle_PageResultOfT
config.GetHelpPageSampleGenerator().SampleObjectFactories.Add(GeneratePageResult);
#endif
// Extend the following to use a preset object directly as the sample for all actions that support a media
// type, regardless of the body parameter or return type. The lines below avoid display of binary content.
// The BsonMediaTypeFormatter (if available) is not used to serialize the TextSample object.
config.SetSampleForMediaType(
new TextSample("Binary JSON content. See http://bsonspec.org for details."),
new MediaTypeHeaderValue("application/bson"));
//// Uncomment the following to use "[0]=foo&[1]=bar" directly as the sample for all actions that support form URL encoded format
//// and have IEnumerable<string> as the body parameter or return type.
//config.SetSampleForType("[0]=foo&[1]=bar", new MediaTypeHeaderValue("application/x-www-form-urlencoded"), typeof(IEnumerable<string>));
//// Uncomment the following to use "1234" directly as the request sample for media type "text/plain" on the controller named "Values"
//// and action named "Put".
//config.SetSampleRequest("1234", new MediaTypeHeaderValue("text/plain"), "Values", "Put");
//// Uncomment the following to use the image on "../images/aspNetHome.png" directly as the response sample for media type "image/png"
//// on the controller named "Values" and action named "Get" with parameter "id".
//config.SetSampleResponse(new ImageSample("../images/aspNetHome.png"), new MediaTypeHeaderValue("image/png"), "Values", "Get", "id");
//// Uncomment the following to correct the sample request when the action expects an HttpRequestMessage with ObjectContent<string>.
//// The sample will be generated as if the controller named "Values" and action named "Get" were having string as the body parameter.
//config.SetActualRequestType(typeof(string), "Values", "Get");
//// Uncomment the following to correct the sample response when the action returns an HttpResponseMessage with ObjectContent<string>.
//// The sample will be generated as if the controller named "Values" and action named "Post" were returning a string.
//config.SetActualResponseType(typeof(string), "Values", "Post");
}
#if Handle_PageResultOfT
private static object GeneratePageResult(HelpPageSampleGenerator sampleGenerator, Type type)
{
if (type.IsGenericType)
{
Type openGenericType = type.GetGenericTypeDefinition();
if (openGenericType == typeof(PageResult<>))
{
// Get the T in PageResult<T>
Type[] typeParameters = type.GetGenericArguments();
Debug.Assert(typeParameters.Length == 1);
// Create an enumeration to pass as the first parameter to the PageResult<T> constuctor
Type itemsType = typeof(List<>).MakeGenericType(typeParameters);
object items = sampleGenerator.GetSampleObject(itemsType);
// Fill in the other information needed to invoke the PageResult<T> constuctor
Type[] parameterTypes = new Type[] { itemsType, typeof(Uri), typeof(long?), };
object[] parameters = new object[] { items, null, (long)ObjectGenerator.DefaultCollectionSize, };
// Call PageResult(IEnumerable<T> items, Uri nextPageLink, long? count) constructor
ConstructorInfo constructor = type.GetConstructor(parameterTypes);
return constructor.Invoke(parameters);
}
}
return null;
}
#endif
}
} | kiko81/Teleric-Academy-Homeworks | Module 3/Web-Services-and-Cloud/2. ASP.NET-Web-API/02_03_MusicStore/MusicStore.Services/Areas/HelpPage/App_Start/HelpPageConfig.cs | C# | mit | 6,509 | [
30522,
1013,
1013,
4895,
9006,
3672,
1996,
2206,
2000,
3073,
8168,
2005,
3931,
6072,
11314,
1026,
1056,
1028,
1012,
2442,
2036,
5587,
1996,
7513,
1012,
2004,
2361,
7159,
1012,
4773,
9331,
2072,
1012,
1051,
2850,
2696,
1013,
1013,
7427,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
namespace ObAuto
{
partial class MainForm
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.kryTheme = new ComponentFactory.Krypton.Toolkit.KryptonPalette(this.components);
this.kryMngMain = new ComponentFactory.Krypton.Toolkit.KryptonManager(this.components);
this.krySplitCntMain = new ComponentFactory.Krypton.Toolkit.KryptonSplitContainer();
this.krySplitCntTop = new ComponentFactory.Krypton.Toolkit.KryptonSplitContainer();
this.kryBtnOpenMng = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kryHdTitle = new ComponentFactory.Krypton.Toolkit.KryptonHeader();
this.kryGbxSet = new ComponentFactory.Krypton.Toolkit.KryptonGroupBox();
this.krySeparator = new ComponentFactory.Krypton.Toolkit.KryptonSeparator();
this.kryBtnSave = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kryBtnDo = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.krySplitCntDbTb = new ComponentFactory.Krypton.Toolkit.KryptonSplitContainer();
this.kryLbxDbTb = new ComponentFactory.Krypton.Toolkit.KryptonListBox();
this.kryPnlDbTip = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
this.kryLblDbTip = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.kryCbxDb = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
this.tabCtrlMain = new System.Windows.Forms.TabControl();
this.tabPgModel = new System.Windows.Forms.TabPage();
this.kryRTbxModel = new ComponentFactory.Krypton.Toolkit.KryptonRichTextBox();
this.tabPgQuery = new System.Windows.Forms.TabPage();
this.kryRTbxQuery = new ComponentFactory.Krypton.Toolkit.KryptonRichTextBox();
this.tabPgPermit = new System.Windows.Forms.TabPage();
this.kryRTbxPermit = new ComponentFactory.Krypton.Toolkit.KryptonRichTextBox();
this.tabPgDAL = new System.Windows.Forms.TabPage();
this.kryRTbxDAL = new ComponentFactory.Krypton.Toolkit.KryptonRichTextBox();
this.tabPgBLL = new System.Windows.Forms.TabPage();
this.kryRTbxBLL = new ComponentFactory.Krypton.Toolkit.KryptonRichTextBox();
this.tabPgAspx = new System.Windows.Forms.TabPage();
this.kryRTbxHtml = new ComponentFactory.Krypton.Toolkit.KryptonRichTextBox();
this.tabPgJs = new System.Windows.Forms.TabPage();
this.kryRTbxJs = new ComponentFactory.Krypton.Toolkit.KryptonRichTextBox();
this.tabPgSDK = new System.Windows.Forms.TabPage();
this.kryRTbxSDK = new ComponentFactory.Krypton.Toolkit.KryptonRichTextBox();
this.tabPgCtrl = new System.Windows.Forms.TabPage();
this.kryRTbxCtrl = new ComponentFactory.Krypton.Toolkit.KryptonRichTextBox();
this.tabPgView = new System.Windows.Forms.TabPage();
this.kryRTbxView = new ComponentFactory.Krypton.Toolkit.KryptonRichTextBox();
this.tabPgSql = new System.Windows.Forms.TabPage();
this.kryRTbxSql = new ComponentFactory.Krypton.Toolkit.KryptonRichTextBox();
this.tabPgDescri = new System.Windows.Forms.TabPage();
this.kryRTbxDescri = new ComponentFactory.Krypton.Toolkit.KryptonRichTextBox();
((System.ComponentModel.ISupportInitialize)(this.krySplitCntMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.krySplitCntMain.Panel1)).BeginInit();
this.krySplitCntMain.Panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.krySplitCntMain.Panel2)).BeginInit();
this.krySplitCntMain.Panel2.SuspendLayout();
this.krySplitCntMain.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.krySplitCntTop)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.krySplitCntTop.Panel1)).BeginInit();
this.krySplitCntTop.Panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.krySplitCntTop.Panel2)).BeginInit();
this.krySplitCntTop.Panel2.SuspendLayout();
this.krySplitCntTop.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryGbxSet)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kryGbxSet.Panel)).BeginInit();
this.kryGbxSet.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.krySeparator)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.krySplitCntDbTb)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.krySplitCntDbTb.Panel1)).BeginInit();
this.krySplitCntDbTb.Panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.krySplitCntDbTb.Panel2)).BeginInit();
this.krySplitCntDbTb.Panel2.SuspendLayout();
this.krySplitCntDbTb.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryPnlDbTip)).BeginInit();
this.kryPnlDbTip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryCbxDb)).BeginInit();
this.tabCtrlMain.SuspendLayout();
this.tabPgModel.SuspendLayout();
this.tabPgQuery.SuspendLayout();
this.tabPgPermit.SuspendLayout();
this.tabPgDAL.SuspendLayout();
this.tabPgBLL.SuspendLayout();
this.tabPgAspx.SuspendLayout();
this.tabPgJs.SuspendLayout();
this.tabPgSDK.SuspendLayout();
this.tabPgCtrl.SuspendLayout();
this.tabPgView.SuspendLayout();
this.tabPgSql.SuspendLayout();
this.tabPgDescri.SuspendLayout();
this.SuspendLayout();
//
// kryTheme
//
this.kryTheme.BasePaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Office2007Silver;
//
// kryMngMain
//
this.kryMngMain.GlobalPalette = this.kryTheme;
this.kryMngMain.GlobalPaletteMode = ComponentFactory.Krypton.Toolkit.PaletteModeManager.Custom;
//
// krySplitCntMain
//
this.krySplitCntMain.Cursor = System.Windows.Forms.Cursors.Default;
this.krySplitCntMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.krySplitCntMain.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.krySplitCntMain.IsSplitterFixed = true;
this.krySplitCntMain.Location = new System.Drawing.Point(0, 0);
this.krySplitCntMain.Name = "krySplitCntMain";
this.krySplitCntMain.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// krySplitCntMain.Panel1
//
this.krySplitCntMain.Panel1.Controls.Add(this.krySplitCntTop);
this.krySplitCntMain.Panel1MinSize = 107;
//
// krySplitCntMain.Panel2
//
this.krySplitCntMain.Panel2.Controls.Add(this.krySplitCntDbTb);
this.krySplitCntMain.Size = new System.Drawing.Size(764, 542);
this.krySplitCntMain.SplitterDistance = 107;
this.krySplitCntMain.SplitterWidth = 2;
this.krySplitCntMain.TabIndex = 0;
//
// krySplitCntTop
//
this.krySplitCntTop.Cursor = System.Windows.Forms.Cursors.Default;
this.krySplitCntTop.Dock = System.Windows.Forms.DockStyle.Fill;
this.krySplitCntTop.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.krySplitCntTop.IsSplitterFixed = true;
this.krySplitCntTop.Location = new System.Drawing.Point(0, 0);
this.krySplitCntTop.Name = "krySplitCntTop";
this.krySplitCntTop.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// krySplitCntTop.Panel1
//
this.krySplitCntTop.Panel1.Controls.Add(this.kryBtnOpenMng);
this.krySplitCntTop.Panel1.Controls.Add(this.kryHdTitle);
this.krySplitCntTop.Panel1MinSize = 36;
//
// krySplitCntTop.Panel2
//
this.krySplitCntTop.Panel2.Controls.Add(this.kryGbxSet);
this.krySplitCntTop.Panel2.Controls.Add(this.krySeparator);
this.krySplitCntTop.Panel2.Controls.Add(this.kryBtnSave);
this.krySplitCntTop.Panel2.Controls.Add(this.kryBtnDo);
this.krySplitCntTop.Size = new System.Drawing.Size(764, 107);
this.krySplitCntTop.SplitterDistance = 36;
this.krySplitCntTop.SplitterWidth = 1;
this.krySplitCntTop.TabIndex = 0;
//
// kryBtnOpenMng
//
this.kryBtnOpenMng.Dock = System.Windows.Forms.DockStyle.Right;
this.kryBtnOpenMng.Location = new System.Drawing.Point(721, 0);
this.kryBtnOpenMng.Name = "kryBtnOpenMng";
this.kryBtnOpenMng.Size = new System.Drawing.Size(43, 36);
this.kryBtnOpenMng.TabIndex = 1;
this.kryBtnOpenMng.Values.Text = "Mng";
this.kryBtnOpenMng.Click += new System.EventHandler(this.kryBtnOpenMng_Click);
//
// kryHdTitle
//
this.kryHdTitle.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryHdTitle.Location = new System.Drawing.Point(0, 0);
this.kryHdTitle.Name = "kryHdTitle";
this.kryHdTitle.Size = new System.Drawing.Size(764, 36);
this.kryHdTitle.TabIndex = 0;
this.kryHdTitle.Values.Description = "AutoCode 。";
this.kryHdTitle.Values.Heading = "Obsidian";
this.kryHdTitle.Values.Image = global::ObAuto.Properties.Resources.win;
//
// kryGbxSet
//
this.kryGbxSet.CaptionStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.KeyTip;
this.kryGbxSet.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryGbxSet.Location = new System.Drawing.Point(145, 0);
this.kryGbxSet.Name = "kryGbxSet";
this.kryGbxSet.Size = new System.Drawing.Size(619, 70);
this.kryGbxSet.TabIndex = 3;
this.kryGbxSet.Text = "#";
this.kryGbxSet.Values.Heading = "#";
//
// krySeparator
//
this.krySeparator.Dock = System.Windows.Forms.DockStyle.Left;
this.krySeparator.Location = new System.Drawing.Point(140, 0);
this.krySeparator.Name = "krySeparator";
this.krySeparator.Size = new System.Drawing.Size(5, 70);
this.krySeparator.SplitterWidth = 3;
this.krySeparator.TabIndex = 1;
//
// kryBtnSave
//
this.kryBtnSave.Dock = System.Windows.Forms.DockStyle.Left;
this.kryBtnSave.Enabled = false;
this.kryBtnSave.Location = new System.Drawing.Point(70, 0);
this.kryBtnSave.Name = "kryBtnSave";
this.kryBtnSave.Size = new System.Drawing.Size(70, 70);
this.kryBtnSave.TabIndex = 1;
this.kryBtnSave.Values.Text = "Save.";
this.kryBtnSave.Click += new System.EventHandler(this.kryBtnSave_Click);
//
// kryBtnDo
//
this.kryBtnDo.Dock = System.Windows.Forms.DockStyle.Left;
this.kryBtnDo.Location = new System.Drawing.Point(0, 0);
this.kryBtnDo.Name = "kryBtnDo";
this.kryBtnDo.Size = new System.Drawing.Size(70, 70);
this.kryBtnDo.TabIndex = 0;
this.kryBtnDo.Values.Text = "Do.";
this.kryBtnDo.Click += new System.EventHandler(this.kryBtnDo_Click);
//
// krySplitCntDbTb
//
this.krySplitCntDbTb.Cursor = System.Windows.Forms.Cursors.Default;
this.krySplitCntDbTb.Dock = System.Windows.Forms.DockStyle.Fill;
this.krySplitCntDbTb.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.krySplitCntDbTb.IsSplitterFixed = true;
this.krySplitCntDbTb.Location = new System.Drawing.Point(0, 0);
this.krySplitCntDbTb.Name = "krySplitCntDbTb";
//
// krySplitCntDbTb.Panel1
//
this.krySplitCntDbTb.Panel1.Controls.Add(this.kryLbxDbTb);
this.krySplitCntDbTb.Panel1.Controls.Add(this.kryPnlDbTip);
this.krySplitCntDbTb.Panel1MinSize = 140;
//
// krySplitCntDbTb.Panel2
//
this.krySplitCntDbTb.Panel2.Controls.Add(this.tabCtrlMain);
this.krySplitCntDbTb.Size = new System.Drawing.Size(764, 433);
this.krySplitCntDbTb.SplitterDistance = 140;
this.krySplitCntDbTb.SplitterWidth = 2;
this.krySplitCntDbTb.TabIndex = 0;
//
// kryLbxDbTb
//
this.kryLbxDbTb.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryLbxDbTb.Location = new System.Drawing.Point(0, 48);
this.kryLbxDbTb.Name = "kryLbxDbTb";
this.kryLbxDbTb.Size = new System.Drawing.Size(140, 385);
this.kryLbxDbTb.TabIndex = 1;
//
// kryPnlDbTip
//
this.kryPnlDbTip.Controls.Add(this.kryLblDbTip);
this.kryPnlDbTip.Controls.Add(this.kryCbxDb);
this.kryPnlDbTip.Dock = System.Windows.Forms.DockStyle.Top;
this.kryPnlDbTip.Location = new System.Drawing.Point(0, 0);
this.kryPnlDbTip.Name = "kryPnlDbTip";
this.kryPnlDbTip.Size = new System.Drawing.Size(140, 48);
this.kryPnlDbTip.TabIndex = 0;
//
// kryLblDbTip
//
this.kryLblDbTip.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryLblDbTip.Location = new System.Drawing.Point(0, 21);
this.kryLblDbTip.Name = "kryLblDbTip";
this.kryLblDbTip.Size = new System.Drawing.Size(140, 27);
this.kryLblDbTip.TabIndex = 1;
this.kryLblDbTip.Values.Text = "";
//
// kryCbxDb
//
this.kryCbxDb.Dock = System.Windows.Forms.DockStyle.Top;
this.kryCbxDb.DropDownWidth = 140;
this.kryCbxDb.Location = new System.Drawing.Point(0, 0);
this.kryCbxDb.Name = "kryCbxDb";
this.kryCbxDb.Size = new System.Drawing.Size(140, 21);
this.kryCbxDb.TabIndex = 0;
//
// tabCtrlMain
//
this.tabCtrlMain.Controls.Add(this.tabPgModel);
this.tabCtrlMain.Controls.Add(this.tabPgQuery);
this.tabCtrlMain.Controls.Add(this.tabPgPermit);
this.tabCtrlMain.Controls.Add(this.tabPgDAL);
this.tabCtrlMain.Controls.Add(this.tabPgBLL);
this.tabCtrlMain.Controls.Add(this.tabPgAspx);
this.tabCtrlMain.Controls.Add(this.tabPgJs);
this.tabCtrlMain.Controls.Add(this.tabPgSDK);
this.tabCtrlMain.Controls.Add(this.tabPgCtrl);
this.tabCtrlMain.Controls.Add(this.tabPgView);
this.tabCtrlMain.Controls.Add(this.tabPgSql);
this.tabCtrlMain.Controls.Add(this.tabPgDescri);
this.tabCtrlMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabCtrlMain.HotTrack = true;
this.tabCtrlMain.Location = new System.Drawing.Point(0, 0);
this.tabCtrlMain.Name = "tabCtrlMain";
this.tabCtrlMain.SelectedIndex = 0;
this.tabCtrlMain.ShowToolTips = true;
this.tabCtrlMain.Size = new System.Drawing.Size(622, 433);
this.tabCtrlMain.TabIndex = 0;
//
// tabPgModel
//
this.tabPgModel.BackColor = System.Drawing.Color.Red;
this.tabPgModel.Controls.Add(this.kryRTbxModel);
this.tabPgModel.ForeColor = System.Drawing.SystemColors.ControlText;
this.tabPgModel.Location = new System.Drawing.Point(4, 22);
this.tabPgModel.Name = "tabPgModel";
this.tabPgModel.Padding = new System.Windows.Forms.Padding(1);
this.tabPgModel.Size = new System.Drawing.Size(614, 407);
this.tabPgModel.TabIndex = 0;
this.tabPgModel.Text = "1.Model";
this.tabPgModel.ToolTipText = "实体模型类";
//
// kryRTbxModel
//
this.kryRTbxModel.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryRTbxModel.Location = new System.Drawing.Point(1, 1);
this.kryRTbxModel.Name = "kryRTbxModel";
this.kryRTbxModel.Palette = this.kryTheme;
this.kryRTbxModel.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.kryRTbxModel.Size = new System.Drawing.Size(612, 405);
this.kryRTbxModel.TabIndex = 0;
this.kryRTbxModel.Text = "";
//
// tabPgQuery
//
this.tabPgQuery.BackColor = System.Drawing.Color.Red;
this.tabPgQuery.Controls.Add(this.kryRTbxQuery);
this.tabPgQuery.Location = new System.Drawing.Point(4, 22);
this.tabPgQuery.Name = "tabPgQuery";
this.tabPgQuery.Padding = new System.Windows.Forms.Padding(1);
this.tabPgQuery.Size = new System.Drawing.Size(614, 407);
this.tabPgQuery.TabIndex = 1;
this.tabPgQuery.Text = "1.Query";
this.tabPgQuery.ToolTipText = "查询模型类";
//
// kryRTbxQuery
//
this.kryRTbxQuery.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryRTbxQuery.Location = new System.Drawing.Point(1, 1);
this.kryRTbxQuery.Name = "kryRTbxQuery";
this.kryRTbxQuery.Palette = this.kryTheme;
this.kryRTbxQuery.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.kryRTbxQuery.Size = new System.Drawing.Size(612, 405);
this.kryRTbxQuery.TabIndex = 1;
this.kryRTbxQuery.Text = "";
//
// tabPgPermit
//
this.tabPgPermit.BackColor = System.Drawing.Color.Red;
this.tabPgPermit.Controls.Add(this.kryRTbxPermit);
this.tabPgPermit.Location = new System.Drawing.Point(4, 22);
this.tabPgPermit.Name = "tabPgPermit";
this.tabPgPermit.Padding = new System.Windows.Forms.Padding(1);
this.tabPgPermit.Size = new System.Drawing.Size(614, 407);
this.tabPgPermit.TabIndex = 11;
this.tabPgPermit.Text = "1.Permit";
this.tabPgPermit.ToolTipText = "权限实体类";
//
// kryRTbxPermit
//
this.kryRTbxPermit.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryRTbxPermit.Location = new System.Drawing.Point(1, 1);
this.kryRTbxPermit.Name = "kryRTbxPermit";
this.kryRTbxPermit.Palette = this.kryTheme;
this.kryRTbxPermit.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.kryRTbxPermit.Size = new System.Drawing.Size(612, 405);
this.kryRTbxPermit.TabIndex = 2;
this.kryRTbxPermit.Text = "";
//
// tabPgDAL
//
this.tabPgDAL.BackColor = System.Drawing.Color.Gold;
this.tabPgDAL.Controls.Add(this.kryRTbxDAL);
this.tabPgDAL.Location = new System.Drawing.Point(4, 22);
this.tabPgDAL.Name = "tabPgDAL";
this.tabPgDAL.Padding = new System.Windows.Forms.Padding(1);
this.tabPgDAL.Size = new System.Drawing.Size(614, 407);
this.tabPgDAL.TabIndex = 2;
this.tabPgDAL.Text = "2.DAL";
this.tabPgDAL.ToolTipText = "数据访问类";
//
// kryRTbxDAL
//
this.kryRTbxDAL.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryRTbxDAL.Location = new System.Drawing.Point(1, 1);
this.kryRTbxDAL.Name = "kryRTbxDAL";
this.kryRTbxDAL.Palette = this.kryTheme;
this.kryRTbxDAL.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.kryRTbxDAL.Size = new System.Drawing.Size(612, 405);
this.kryRTbxDAL.TabIndex = 1;
this.kryRTbxDAL.Text = "";
//
// tabPgBLL
//
this.tabPgBLL.BackColor = System.Drawing.Color.Gold;
this.tabPgBLL.Controls.Add(this.kryRTbxBLL);
this.tabPgBLL.Location = new System.Drawing.Point(4, 22);
this.tabPgBLL.Name = "tabPgBLL";
this.tabPgBLL.Padding = new System.Windows.Forms.Padding(1);
this.tabPgBLL.Size = new System.Drawing.Size(614, 407);
this.tabPgBLL.TabIndex = 3;
this.tabPgBLL.Text = "2.BLL";
this.tabPgBLL.ToolTipText = "业务逻辑类";
//
// kryRTbxBLL
//
this.kryRTbxBLL.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryRTbxBLL.Location = new System.Drawing.Point(1, 1);
this.kryRTbxBLL.Name = "kryRTbxBLL";
this.kryRTbxBLL.Palette = this.kryTheme;
this.kryRTbxBLL.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.kryRTbxBLL.Size = new System.Drawing.Size(612, 405);
this.kryRTbxBLL.TabIndex = 0;
this.kryRTbxBLL.Text = "";
//
// tabPgAspx
//
this.tabPgAspx.BackColor = System.Drawing.Color.LimeGreen;
this.tabPgAspx.Controls.Add(this.kryRTbxHtml);
this.tabPgAspx.Location = new System.Drawing.Point(4, 22);
this.tabPgAspx.Name = "tabPgAspx";
this.tabPgAspx.Padding = new System.Windows.Forms.Padding(1);
this.tabPgAspx.Size = new System.Drawing.Size(614, 407);
this.tabPgAspx.TabIndex = 5;
this.tabPgAspx.Text = "3.ASPX";
this.tabPgAspx.ToolTipText = "后台ASPX页面HTML代码";
//
// kryRTbxHtml
//
this.kryRTbxHtml.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryRTbxHtml.Location = new System.Drawing.Point(1, 1);
this.kryRTbxHtml.Name = "kryRTbxHtml";
this.kryRTbxHtml.Palette = this.kryTheme;
this.kryRTbxHtml.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.kryRTbxHtml.Size = new System.Drawing.Size(612, 405);
this.kryRTbxHtml.TabIndex = 0;
this.kryRTbxHtml.Text = "";
//
// tabPgJs
//
this.tabPgJs.BackColor = System.Drawing.Color.LimeGreen;
this.tabPgJs.Controls.Add(this.kryRTbxJs);
this.tabPgJs.Location = new System.Drawing.Point(4, 22);
this.tabPgJs.Name = "tabPgJs";
this.tabPgJs.Padding = new System.Windows.Forms.Padding(1);
this.tabPgJs.Size = new System.Drawing.Size(614, 407);
this.tabPgJs.TabIndex = 6;
this.tabPgJs.Text = "3.JS";
this.tabPgJs.ToolTipText = "后台页面对应JavaScript接口文件";
//
// kryRTbxJs
//
this.kryRTbxJs.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryRTbxJs.Location = new System.Drawing.Point(1, 1);
this.kryRTbxJs.Name = "kryRTbxJs";
this.kryRTbxJs.Palette = this.kryTheme;
this.kryRTbxJs.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.kryRTbxJs.Size = new System.Drawing.Size(612, 405);
this.kryRTbxJs.TabIndex = 1;
this.kryRTbxJs.Text = "";
//
// tabPgSDK
//
this.tabPgSDK.BackColor = System.Drawing.Color.BlueViolet;
this.tabPgSDK.Controls.Add(this.kryRTbxSDK);
this.tabPgSDK.Location = new System.Drawing.Point(4, 22);
this.tabPgSDK.Name = "tabPgSDK";
this.tabPgSDK.Padding = new System.Windows.Forms.Padding(1);
this.tabPgSDK.Size = new System.Drawing.Size(614, 407);
this.tabPgSDK.TabIndex = 4;
this.tabPgSDK.Text = "4.SDK";
this.tabPgSDK.ToolTipText = "SDK接口辅助类";
//
// kryRTbxSDK
//
this.kryRTbxSDK.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryRTbxSDK.Location = new System.Drawing.Point(1, 1);
this.kryRTbxSDK.Name = "kryRTbxSDK";
this.kryRTbxSDK.Palette = this.kryTheme;
this.kryRTbxSDK.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.kryRTbxSDK.Size = new System.Drawing.Size(612, 405);
this.kryRTbxSDK.TabIndex = 1;
this.kryRTbxSDK.Text = "";
//
// tabPgCtrl
//
this.tabPgCtrl.BackColor = System.Drawing.Color.BlueViolet;
this.tabPgCtrl.Controls.Add(this.kryRTbxCtrl);
this.tabPgCtrl.Location = new System.Drawing.Point(4, 22);
this.tabPgCtrl.Name = "tabPgCtrl";
this.tabPgCtrl.Padding = new System.Windows.Forms.Padding(1);
this.tabPgCtrl.Size = new System.Drawing.Size(614, 407);
this.tabPgCtrl.TabIndex = 8;
this.tabPgCtrl.Text = "4.Ctrl";
this.tabPgCtrl.ToolTipText = "前台项目控制器";
//
// kryRTbxCtrl
//
this.kryRTbxCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryRTbxCtrl.Location = new System.Drawing.Point(1, 1);
this.kryRTbxCtrl.Name = "kryRTbxCtrl";
this.kryRTbxCtrl.Palette = this.kryTheme;
this.kryRTbxCtrl.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.kryRTbxCtrl.Size = new System.Drawing.Size(612, 405);
this.kryRTbxCtrl.TabIndex = 2;
this.kryRTbxCtrl.Text = "";
//
// tabPgView
//
this.tabPgView.BackColor = System.Drawing.Color.BlueViolet;
this.tabPgView.Controls.Add(this.kryRTbxView);
this.tabPgView.Location = new System.Drawing.Point(4, 22);
this.tabPgView.Name = "tabPgView";
this.tabPgView.Padding = new System.Windows.Forms.Padding(1);
this.tabPgView.Size = new System.Drawing.Size(614, 407);
this.tabPgView.TabIndex = 9;
this.tabPgView.Text = "4.View";
this.tabPgView.ToolTipText = "前台项目视图";
//
// kryRTbxView
//
this.kryRTbxView.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryRTbxView.Location = new System.Drawing.Point(1, 1);
this.kryRTbxView.Name = "kryRTbxView";
this.kryRTbxView.Palette = this.kryTheme;
this.kryRTbxView.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.kryRTbxView.Size = new System.Drawing.Size(612, 405);
this.kryRTbxView.TabIndex = 3;
this.kryRTbxView.Text = "";
//
// tabPgSql
//
this.tabPgSql.BackColor = System.Drawing.Color.DodgerBlue;
this.tabPgSql.Controls.Add(this.kryRTbxSql);
this.tabPgSql.Location = new System.Drawing.Point(4, 22);
this.tabPgSql.Name = "tabPgSql";
this.tabPgSql.Padding = new System.Windows.Forms.Padding(1);
this.tabPgSql.Size = new System.Drawing.Size(614, 407);
this.tabPgSql.TabIndex = 7;
this.tabPgSql.Text = "5.SQL";
this.tabPgSql.ToolTipText = "SQL数据文件";
//
// kryRTbxSql
//
this.kryRTbxSql.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryRTbxSql.Location = new System.Drawing.Point(1, 1);
this.kryRTbxSql.Name = "kryRTbxSql";
this.kryRTbxSql.Palette = this.kryTheme;
this.kryRTbxSql.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.kryRTbxSql.Size = new System.Drawing.Size(612, 405);
this.kryRTbxSql.TabIndex = 1;
this.kryRTbxSql.Text = "";
//
// tabPgDescri
//
this.tabPgDescri.BackColor = System.Drawing.Color.DarkGray;
this.tabPgDescri.Controls.Add(this.kryRTbxDescri);
this.tabPgDescri.Location = new System.Drawing.Point(4, 22);
this.tabPgDescri.Name = "tabPgDescri";
this.tabPgDescri.Padding = new System.Windows.Forms.Padding(1);
this.tabPgDescri.Size = new System.Drawing.Size(614, 407);
this.tabPgDescri.TabIndex = 10;
this.tabPgDescri.Text = "6.Descri";
this.tabPgDescri.ToolTipText = "实体,接口描述";
//
// kryRTbxDescri
//
this.kryRTbxDescri.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryRTbxDescri.Location = new System.Drawing.Point(1, 1);
this.kryRTbxDescri.Name = "kryRTbxDescri";
this.kryRTbxDescri.Palette = this.kryTheme;
this.kryRTbxDescri.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.kryRTbxDescri.Size = new System.Drawing.Size(612, 405);
this.kryRTbxDescri.TabIndex = 3;
this.kryRTbxDescri.Text = "";
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(764, 542);
this.Controls.Add(this.krySplitCntMain);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm";
this.Palette = this.kryTheme;
this.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Custom;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Obsidian Framwork";
this.TextExtra = "Hello World~";
this.Load += new System.EventHandler(this.MainForm_Load);
((System.ComponentModel.ISupportInitialize)(this.krySplitCntMain.Panel1)).EndInit();
this.krySplitCntMain.Panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.krySplitCntMain.Panel2)).EndInit();
this.krySplitCntMain.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.krySplitCntMain)).EndInit();
this.krySplitCntMain.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.krySplitCntTop.Panel1)).EndInit();
this.krySplitCntTop.Panel1.ResumeLayout(false);
this.krySplitCntTop.Panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.krySplitCntTop.Panel2)).EndInit();
this.krySplitCntTop.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.krySplitCntTop)).EndInit();
this.krySplitCntTop.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.kryGbxSet.Panel)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.kryGbxSet)).EndInit();
this.kryGbxSet.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.krySeparator)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.krySplitCntDbTb.Panel1)).EndInit();
this.krySplitCntDbTb.Panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.krySplitCntDbTb.Panel2)).EndInit();
this.krySplitCntDbTb.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.krySplitCntDbTb)).EndInit();
this.krySplitCntDbTb.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.kryPnlDbTip)).EndInit();
this.kryPnlDbTip.ResumeLayout(false);
this.kryPnlDbTip.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.kryCbxDb)).EndInit();
this.tabCtrlMain.ResumeLayout(false);
this.tabPgModel.ResumeLayout(false);
this.tabPgQuery.ResumeLayout(false);
this.tabPgPermit.ResumeLayout(false);
this.tabPgDAL.ResumeLayout(false);
this.tabPgBLL.ResumeLayout(false);
this.tabPgAspx.ResumeLayout(false);
this.tabPgJs.ResumeLayout(false);
this.tabPgSDK.ResumeLayout(false);
this.tabPgCtrl.ResumeLayout(false);
this.tabPgView.ResumeLayout(false);
this.tabPgSql.ResumeLayout(false);
this.tabPgDescri.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
public ComponentFactory.Krypton.Toolkit.KryptonPalette kryTheme;
public ComponentFactory.Krypton.Toolkit.KryptonManager kryMngMain;
private ComponentFactory.Krypton.Toolkit.KryptonSplitContainer krySplitCntMain;
private ComponentFactory.Krypton.Toolkit.KryptonSplitContainer krySplitCntTop;
private ComponentFactory.Krypton.Toolkit.KryptonHeader kryHdTitle;
private ComponentFactory.Krypton.Toolkit.KryptonButton kryBtnOpenMng;
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kryCbxDb;
private ComponentFactory.Krypton.Toolkit.KryptonSeparator krySeparator;
private ComponentFactory.Krypton.Toolkit.KryptonSplitContainer krySplitCntDbTb;
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryPnlDbTip;
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryLblDbTip;
private ComponentFactory.Krypton.Toolkit.KryptonListBox kryLbxDbTb;
private System.Windows.Forms.TabControl tabCtrlMain;
private System.Windows.Forms.TabPage tabPgModel;
private System.Windows.Forms.TabPage tabPgQuery;
private System.Windows.Forms.TabPage tabPgDAL;
private ComponentFactory.Krypton.Toolkit.KryptonButton kryBtnSave;
private ComponentFactory.Krypton.Toolkit.KryptonButton kryBtnDo;
private ComponentFactory.Krypton.Toolkit.KryptonGroupBox kryGbxSet;
private ComponentFactory.Krypton.Toolkit.KryptonRichTextBox kryRTbxModel;
private ComponentFactory.Krypton.Toolkit.KryptonRichTextBox kryRTbxQuery;
private ComponentFactory.Krypton.Toolkit.KryptonRichTextBox kryRTbxDAL;
private System.Windows.Forms.TabPage tabPgBLL;
private System.Windows.Forms.TabPage tabPgSDK;
private System.Windows.Forms.TabPage tabPgAspx;
private System.Windows.Forms.TabPage tabPgJs;
private System.Windows.Forms.TabPage tabPgSql;
private ComponentFactory.Krypton.Toolkit.KryptonRichTextBox kryRTbxBLL;
private ComponentFactory.Krypton.Toolkit.KryptonRichTextBox kryRTbxSDK;
private ComponentFactory.Krypton.Toolkit.KryptonRichTextBox kryRTbxHtml;
private ComponentFactory.Krypton.Toolkit.KryptonRichTextBox kryRTbxJs;
private ComponentFactory.Krypton.Toolkit.KryptonRichTextBox kryRTbxSql;
private System.Windows.Forms.TabPage tabPgCtrl;
private System.Windows.Forms.TabPage tabPgView;
private System.Windows.Forms.TabPage tabPgDescri;
private ComponentFactory.Krypton.Toolkit.KryptonRichTextBox kryRTbxCtrl;
private ComponentFactory.Krypton.Toolkit.KryptonRichTextBox kryRTbxView;
private ComponentFactory.Krypton.Toolkit.KryptonRichTextBox kryRTbxDescri;
private System.Windows.Forms.TabPage tabPgPermit;
private ComponentFactory.Krypton.Toolkit.KryptonRichTextBox kryRTbxPermit;
}
}
| caideyuan/ObsidianToolkit | MainForm.Designer.cs | C# | gpl-2.0 | 37,364 | [
30522,
3415,
15327,
27885,
4887,
3406,
1063,
7704,
2465,
2364,
14192,
1063,
1013,
1013,
1013,
1026,
12654,
1028,
1013,
1013,
1013,
100,
100,
1916,
100,
100,
100,
100,
100,
1636,
1013,
1013,
1013,
1026,
1013,
12654,
1028,
2797,
2291,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\models\WindowSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="window-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id') ?>
<?= $form->field($model, 'status_ventana') ?>
<?= $form->field($model, 'status_cortina') ?>
<?= $form->field($model, 'rain_sensor') ?>
<?= $form->field($model, 'light_sensor') ?>
<?= $form->field($model, 'voice_sensor') ?>
<?php // echo $form->field($model, 'datetime') ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
| CarlosTrinidad/VentanaIOT | views/window/_search.php | PHP | bsd-3-clause | 913 | [
30522,
1026,
1029,
25718,
2224,
12316,
2072,
1032,
2393,
2545,
1032,
16129,
1025,
2224,
12316,
2072,
1032,
15536,
28682,
1032,
3161,
14192,
1025,
1013,
1008,
1030,
13075,
1002,
2023,
12316,
2072,
1032,
4773,
1032,
3193,
1008,
1013,
1013,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
//Variables
var chrome_points = 0;
//Functions
function test_chromepoints() {
chrome_points = chrome_points + 1;
}
//HTML Updates
window.setInterval(function(){
document.getElementById("chrome_points").innerHTML = chrome_points;
}, 1000); | draco13th/HD-Tracker | js.js | JavaScript | mit | 245 | [
30522,
1013,
1013,
10857,
13075,
18546,
1035,
2685,
1027,
1014,
1025,
1013,
1013,
4972,
3853,
3231,
1035,
18546,
26521,
1006,
1007,
1063,
18546,
1035,
2685,
1027,
18546,
1035,
2685,
1009,
1015,
1025,
1065,
1013,
1013,
16129,
14409,
3332,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
*
* Description
*
* @package VirtueMart
* @subpackage
* @author
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2012 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: view.json.php 7930 2014-05-15 16:06:09Z Milbo $
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
// Load the view framework
if(!class_exists('VmView'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'vmview.php');
// Load some common models
if(!class_exists('VirtueMartModelCustomfields')) require(JPATH_VM_ADMINISTRATOR.DS.'models'.DS.'customfields.php');
/**
* HTML View class for the VirtueMart Component
*
* @package VirtueMart
* @author
*/
class VirtuemartViewProduct extends VmView {
var $json = array();
function __construct( ){
$this->type = vRequest::getCmd('type', false);
$this->row = vRequest::getInt('row', false);
$this->db = JFactory::getDBO();
$this->model = VmModel::getModel('Customfields') ;
}
function display($tpl = null) {
$filter = vRequest::getVar('q', vRequest::getVar('term', false) );
$id = vRequest::getInt('id', false);
$virtuemart_product_id = vRequest::getInt('virtuemart_product_id',array());
if(is_array($virtuemart_product_id) && count($virtuemart_product_id) > 0){
$product_id = (int)$virtuemart_product_id[0];
} else {
$product_id = (int)$virtuemart_product_id;
}
//$customfield = $this->model->getcustomfield();
/* Get the task */
if ($this->type=='relatedproducts') {
$query = "SELECT virtuemart_product_id AS id, CONCAT(product_name, '::', product_sku) AS value
FROM #__virtuemart_products_".VmConfig::$vmlang."
JOIN `#__virtuemart_products` AS p using (`virtuemart_product_id`)";
if ($filter) $query .= " WHERE product_name LIKE '%". $this->db->escape( $filter, true ) ."%' or product_sku LIKE '%". $this->db->escape( $filter, true ) ."%' limit 0,10";
self::setRelatedHtml($product_id,$query,'R');
}
else if ($this->type=='relatedcategories')
{
$query = "SELECT virtuemart_category_id AS id, CONCAT(category_name, '::', virtuemart_category_id) AS value
FROM #__virtuemart_categories_".VmConfig::$vmlang;
if ($filter) $query .= " WHERE category_name LIKE '%". $this->db->escape( $filter, true ) ."%' limit 0,10";
self::setRelatedHtml($product_id,$query,'Z');
}
else if ($this->type=='custom')
{
$query = "SELECT CONCAT(virtuemart_custom_id, '|', custom_value, '|', field_type) AS id, CONCAT(custom_title, '::', custom_tip) AS value
FROM #__virtuemart_customs";
if ($filter) $query .= " WHERE custom_title LIKE '%".$filter."%' limit 0,50";
$this->db->setQuery($query);
$this->json['value'] = $this->db->loadObjectList();
$this->json['ok'] = 1 ;
}
else if ($this->type=='fields')
{
$fieldTypes= $this->model->getField_types() ;
$query = 'SELECT *,`custom_value` as value FROM `#__virtuemart_customs`
WHERE (`virtuemart_custom_id`='.$id.' or `custom_parent_id`='.$id.') ';
$query .= 'order by `ordering` asc';
$this->db->setQuery($query);
$rows = $this->db->loadObjectlist();
$html = array ();
foreach ($rows as $field) {
if ($field->field_type =='C' ){
$this->json['table'] = 'childs';
$q='SELECT `virtuemart_product_id` FROM `#__virtuemart_products` WHERE `published`=1
AND `product_parent_id`= '.vRequest::getInt('virtuemart_product_id');
//$this->db->setQuery(' SELECT virtuemart_product_id, product_name FROM `#__virtuemart_products` WHERE `product_parent_id` ='.(int)$product_id);
$this->db->setQuery($q);
if ($childIds = $this->db->loadColumn()) {
// Get childs
foreach ($childIds as $childId) {
$field->custom_value = $childId;
$display = $this->model->displayProductCustomfieldBE($field,$childId,$this->row);
if ($field->is_cart_attribute) $cartIcone= 'default';
else $cartIcone= 'default-off';
$html[] = '<div class="removable">
<td>'.$field->custom_title.'</td>
<td>'.$display.$field->custom_tip.'</td>
<td>'.vmText::_($fieldTypes[$field->field_type]).'
'.$this->model->setEditCustomHidden($field, $this->row).'
</td>
<td><span class="vmicon vmicon-16-'.$cartIcone.'"></span></td>
<td></td>
</div>';
$this->row++;
}
}
} elseif ($field->field_type =='E') {
$this->json['table'] = 'customPlugins';
$this->model->bindCustomEmbeddedFieldParams($field,'E');
$display = $this->model->displayProductCustomfieldBE($field,$product_id,$this->row);
if ($field->is_cart_attribute) {
$cartIcone= 'default';
} else {
$cartIcone= 'default-off';
}
$field->virtuemart_product_id=$product_id;
$html[] = '
<tr class="removable">
<td><span class="hasTip" title="'.vmText::_($field->custom_tip).'">'.$field->custom_title.'</td>
<td>'.$display.'
'.$this->model->setEditCustomHidden($field, $this->row).'
<p>'.vmText::_('COM_VIRTUEMART_CUSTOM_ACTIVATE_JAVASCRIPT').'</p></td>
<td><span class="vmicon vmicon-16-'.$cartIcone.'"></span>'.vmText::_('COM_VIRTUEMART_CUSTOM_EXTENSION').'</td>
<td><span class="vmicon vmicon-16-move"></span>
<span class="vmicon vmicon-16-remove"></span><input class="ordering" type="hidden" value="'.$this->row.'" name="field['.$this->row .'][ordering]" />
</td>
</tr>';
$this->row++;
} else {
$this->json['table'] = 'fields';
$display = $this->model->displayProductCustomfieldBE($field,$product_id,$this->row);
if ($field->is_cart_attribute) $cartIcone= 'default';
else $cartIcone= 'default-off';
if(isset($fieldTypes[$field->field_type])){
$type =vmText::_($fieldTypes[$field->field_type]);
} else {
$type = 'deprecated';
}
$html[] = '<tr class="removable">
<td><span class="hasTip" title="'.vmText::_($field->custom_tip).'">'.$field->custom_title.'</td>
<td>'.$display.'</td>
<td><span class="vmicon vmicon-16-'.$cartIcone.'"></span>'.vmText::_($fieldTypes[$field->field_type]).'
'.$type.$this->model->setEditCustomHidden($field, $this->row).'
</td>
<td><span class="vmicon vmicon-16-move"></span><span class="vmicon vmicon-16-remove"></span><input class="ordering" type="hidden" value="'.$this->row.'" name="field['.$this->row .'][ordering]" /></td>
</tr>';
$this->row++;
}
}
$this->json['value'] = $html;
$this->json['ok'] = 1 ;
} else if ($this->type=='userlist')
{
$status = vRequest::getvar('status');
$productShoppers=0;
if ($status) {
$productModel = VmModel::getModel('product');
$productShoppers = $productModel->getProductShoppersByStatus($product_id ,$status);
}
if(!class_exists('ShopFunctions'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'shopfunctions.php');
$html = ShopFunctions::renderProductShopperList($productShoppers);
$this->json['value'] = $html;
} else $this->json['ok'] = 0 ;
if ( empty($this->json)) {
$this->json['value'] = null;
$this->json['ok'] = 1 ;
}
echo json_encode($this->json);
}
function setRelatedHtml($product_id,$query,$fieldType) {
$this->db->setQuery($query);
$this->json = $this->db->loadObjectList();
$query = 'SELECT * FROM `#__virtuemart_customs` WHERE field_type ="'.$fieldType.'" ';
$this->db->setQuery($query);
$custom = $this->db->loadObject();
$custom->virtuemart_product_id = $product_id;
foreach ($this->json as &$related) {
$custom->customfield_value = $related->id;
$display = $this->model->displayProductCustomfieldBE($custom,$related->id,$this->row);
$html = '<div class="vm_thumb_image">
<span class="vmicon vmicon-16-move"></span>
<div class="vmicon vmicon-16-remove"></div>
<span>'.$display.'</span>
'.$this->model->setEditCustomHidden($custom, $this->row).'
</div>';
$related->label = $html;
}
}
}
// pure php no closing tag
| arlesonsilva/fortalpet | tmp/install_5488d6f0c9a33/administrator/components/com_virtuemart/views/product/view.json.php | PHP | gpl-2.0 | 8,327 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
1008,
6412,
1008,
1008,
1030,
7427,
11870,
22345,
1008,
1030,
4942,
23947,
4270,
1008,
1030,
3166,
1008,
1030,
4957,
8299,
1024,
1013,
1013,
7479,
1012,
11870,
22345,
1012,
5658,
1008,
1030,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import json
f = open('text-stripped-3.json')
out = open('text-lines.json', 'w')
start_obj = json.load(f)
end_obj = {'data': []}
characters_on_stage = []
currently_speaking = None
last_scene = '1.1'
for i in range(len(start_obj['data'])):
obj = start_obj['data'][i]
if obj['type'] == 'entrance':
if obj['characters'] in characters_on_stage:
raise Exception('Character tried to enter stage when already on stage at object ' + str(i))
characters_on_stage = characters_on_stage + obj['characters']
elif obj['type'] == 'exeunt':
characters_on_stage = []
elif obj['type'] == 'exit':
characters_on_stage = [char for char in characters_on_stage if char not in obj['characters']]
elif obj['type'] == 'speaker tag':
if obj['speaker'] not in characters_on_stage:
raise Exception('Character tried to speak when not on stage at object ' + str(i), start_obj['data'][i + 1])
currently_speaking = obj['speaker']
elif obj['type'] == 'line':
if currently_speaking == None:
raise Exception('A line did not have an associated speaker at object ' + str(i))
identifier_info = obj['identifier'].split('.')
scene = identifier_info[0] + '.' + identifier_info[1]
#if scene != last_scene:
# if len(characters_on_stage) != 0:
# print('Warning: scene ' + scene + ' just started with ' + str(characters_on_stage) + ' still on stage')
last_scene = scene
end_obj['data'].append({
'type': 'line',
'identifier': obj['identifier'],
'text': obj['text'].strip(),
'speaker': currently_speaking,
'characters': characters_on_stage
})
if len(characters_on_stage) == 0:
currently_speaking = None
json.dump(end_obj, out) | SyntaxBlitz/syntaxblitz.github.io | mining-lear/process/step6.py | Python | mit | 1,654 | [
30522,
12324,
1046,
3385,
1042,
1027,
2330,
1006,
1005,
3793,
1011,
10040,
1011,
1017,
1012,
1046,
3385,
1005,
1007,
2041,
1027,
2330,
1006,
1005,
3793,
1011,
3210,
1012,
1046,
3385,
1005,
1010,
1005,
1059,
1005,
1007,
2707,
1035,
27885,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'use strict';
const fs = require('fs');
const Q = require('q');
const exec = require('child_process').exec;
const searchpaths = ["/bin/xset"];
class XSetDriver {
constructor(props) {
this.name = "Backlight Control";
this.devicePath = "xset";
this.description = "Screensaver control via Xwindows xset command";
this.devices = [];
this.driver = {};
//this.depends = [];
}
probe(props) {
searchpaths.forEach(function(p) {
if(fs.existsSync(p)) {
let stat = fs.lstatSync(p);
if (stat.isFile()) {
console.log("found xset control at "+p);
this.devices.push(new XSetDriver.Channel(this, p, props));
}
}
}.bind(this));
return this.devices.length>0;
}
}
class XSetChannel {
constructor(driver, path, props)
{
this.value = 1;
this.setCommand = path;
this.enabled = true;
this.display = ":0.0";
this.error = 0;
// internal variables
this.lastReset = new Date();
}
enable() {
this.set("on");
}
disable() {
this.set("off");
}
activate() {
this.set("activate");
}
blank() {
this.set("blank");
}
reset() {
this.set("reset");
this.lastReset=new Date();
}
setTimeout(secs) {
this.set(""+secs);
}
set(action) {
if(!this.enabled) return false;
var ss = this;
exec("DISPLAY="+this.display+" "+this.setCommand+" s "+action, function(error,stdout, stderr) {
if(error) {
if(ss.error++ >10) {
ss.enabled=false;
}
console.log("xset error "+error);
console.log(stdout);
console.log("errors:");
console.log(stderr);
}
}.bind(this));
}
}
XSetDriver.Channel = XSetChannel;
module.exports = XSetDriver;
/*
Treadmill.prototype.init_screensaver = function(action)
{
this.screensaver = {
// config/settings
enabled: !simulate,
display: ":0.0",
error: 0,
// internal variables
lastReset: new Date(),
// screensaver functions
enable: function() { this.set("on"); },
disable: function() { this.set("off"); },
activate: function() { this.set("activate"); },
blank: function() { this.set("blank"); },
reset: function() { this.set("reset"); this.lastReset=new Date(); },
timeout: function(secs) { this.set(""+secs); },
// main set() function calls command "xset s <action>"
set: function(action) {
if(!this.enabled) return false;
var ss = this;
exec("DISPLAY="+this.display+" xset s "+action, function(error,stdout, stderr) {
if(error) {
if(ss.error++ >10) {
ss.enabled=false;
}
console.log("xset error "+error);
console.log(stdout);
console.log("errors:");
console.log(stderr);
}
});
}
};
if(simulate) return false;
// initialize the screensaver
var ss = this.screensaver;
exec("./screensaver.conf "+this.screensaver.display, function(error,stdout, stderr) {
if(error) {
ss.enabled = false;
console.log("screensaver.conf error "+error);
console.log(stdout);
console.log("errors:");
console.log(stderr);
}
});
this.screensaver.enable();
}
*/ | flyingeinstein/tread-station | nodejs/drivers/output/screensaver/xset.js | JavaScript | mit | 3,736 | [
30522,
1005,
2224,
9384,
1005,
1025,
9530,
3367,
1042,
2015,
1027,
5478,
1006,
1005,
1042,
2015,
1005,
1007,
1025,
9530,
3367,
1053,
1027,
5478,
1006,
1005,
1053,
1005,
1007,
1025,
9530,
3367,
4654,
8586,
1027,
5478,
1006,
1005,
2775,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="pl">
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Constant Field Values (Play! 2.x Provider for Play! 2.3.x 1.0.0-beta2 API)</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values (Play! 2.x Provider for Play! 2.3.x 1.0.0-beta2 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="com/google/code/play2/provider/play23/package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li><a href="com/google/code/play2/provider/play23/package-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Constant Field Values" class="title">Constant Field Values</h1>
<h2 title="Contents">Contents</h2>
<ul>
<li><a href="#com.google">com.google.*</a></li>
</ul>
</div>
<div class="constantValuesContainer"><a name="com.google">
<!-- -->
</a>
<h2 title="com.google">com.google.*</h2>
<ul class="blockList">
<li class="blockList">
<table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>com.google.code.play2.provider.play23.<a href="com/google/code/play2/provider/play23/Play23LessCompiler.html" title="class in com.google.code.play2.provider.play23">Play23LessCompiler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="com.google.code.play2.provider.play23.Play23LessCompiler.LESS_SCRIPT">
<!-- -->
</a><code>public static final <a href="http://docs.oracle.com/javase/1.6.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td><code><a href="com/google/code/play2/provider/play23/Play23LessCompiler.html#LESS_SCRIPT">LESS_SCRIPT</a></code></td>
<td class="colLast"><code>"less-1.4.2.js"</code></td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="com/google/code/play2/provider/play23/package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li><a href="com/google/code/play2/provider/play23/package-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2013–2015. All rights reserved.</small></p>
</body>
</html>
| play2-maven-plugin/play2-maven-plugin.github.io | play2-maven-plugin/1.0.0-beta2/play2-providers/play2-provider-play23/apidocs/constant-values.html | HTML | apache-2.0 | 5,204 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Gallery.Common.Helpers
{
public class PredicateHelper
{
public static Predicate<T> CombineAll<T>(params Predicate<T>[] predicates)
{
return target =>
{
foreach (Predicate<T> predicate in predicates)
{
if (!predicate(target))
{
return false;
}
}
return true;
};
}
public static Predicate<T> CombineAny<T>(params Predicate<T>[] predicates)
{
return target =>
{
foreach (Predicate<T> predicate in predicates)
{
if (predicate(target))
{
return true;
}
}
return false;
};
}
}
}
| eidias/Gallery | Gallery.Common/Helpers/PredicateHelper.cs | C# | mit | 1,032 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
11409,
4160,
1025,
2478,
2291,
1012,
3793,
1025,
2478,
2291,
1012,
11689,
2075,
1012,
8518,
1025,
3415,
15327,
3916,
1012,
2691,
1012,
2393,
2545,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Brian Schrader - 06ee</title>
<link rel="shortcut icon" href="/assets/images/favicon.ico">
<link rel="stylesheet" href="/assets/css/style.css">
<link rel="alternate" type="application/rss+xml" title="My Blog" href="/rss.xml">
<link rel="stylesheet" href="/assets/css/highlight.css">
</head>
<body>
<nav class="main-nav">
<a href="/"> <span class="arrow">←</span> Home </a>
<a href="/about">About </a>
<a class="cta" href="/feed.xml">RSS</a>
</nav>
<section id="wrapper" class="">
<article class="post">
<header>
<!-- <h1>06ee</h1> -->
<h2 class="headline">April 1, 2016</h2>
</header>
<section id="post-body">
<p>umm... why? <a href="http://bit.ly/1N0zRr2">http://bit.ly/1N0zRr2</a></p>
</section>
</article>
<footer id="post-meta" class="clearfix">
<a href="http://snippets.today/users/sonicrocketman">
<img class="avatar" src="http://www.gravatar.com/avatar/11b074a636e00292c98e3e60f7e16595?s=160" />
<div>
<span class="dark">sonicrocketman</span>
<span>Brian Schrader</span>
</div>
</a>
<section id="sharing">
<a class="twitter" href="https://twitter.com/intent/tweet?text=http://sonicrocketman.snippets.xyz/2016/04/01/06ee.html"><span class="icon-twitter"> Tweet</span></a>
<a class="facebook" href="#" onclick="
window.open(
'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href),
'facebook-share-dialog',
'width=626,height=436');
return false;"><span class="icon-facebook-rect"> Share</span>
</a>
</section>
</footer>
<!-- Disqus comments -->
<!-- Archive post list -->
<!--
<ul id="post-list" class="archive readmore">
<h3>Read more</h3>
<li>
<a href="/2016/09/13/70a7.html">I'm convinced he was a friendly plumbing spirit. I'll never forget you; you were here so briefly I'm not sure you even existed at all.
<aside class="dates">Sep 13</aside></a>
</li>
<li>
<a href="/2016/09/13/5e48.html">Plumber came today to fix a large leak. He came to the door smiling, was here 10 mins, fixed the issue, laughed joyously, and said goodbye.
<aside class="dates">Sep 13</aside></a>
</li>
<li>
<a href="/2016/09/13/1184.html">First impressions of iOS 10: All the text is HUGE.
<aside class="dates">Sep 13</aside></a>
</li>
<li>
<a href="/2016/09/13/4799.html">I guess the whole app wasn't pure white enough. Jony Ive wasn't happy.
<aside class="dates">Sep 13</aside></a>
</li>
<li>
<a href="/2016/09/13/ec93.html">Not sure why the new version of iTunes removed the custom, album cover based playlist background colors, but I'm sad they're gone.
<aside class="dates">Sep 13</aside></a>
</li>
<li>
<a href="/2016/09/12/e9e1.html">I love this effect on photos. [http://bit.ly/2cUuJgV](http://bit.ly/2cUuJgV) credit: @museofadventure
<aside class="dates">Sep 12</aside></a>
</li>
<li>
<a href="/2016/09/09/5e5c.html">Typos make quotes better.
<aside class="dates">Sep 09</aside></a>
</li>
<li>
<a href="/2016/09/09/8c20.html">"See how he pops and locks agains his will?"
<aside class="dates">Sep 09</aside></a>
</li>
<li>
<a href="/2016/09/08/75b3.html">Thanks to everyone who's been commenting or visiting the Adventurer's Codex site. Your response has been amazing.
<aside class="dates">Sep 08</aside></a>
</li>
<li>
<a href="/2016/09/07/ed5f.html">I'm thrilled to announce a project I've been working on for a while now: Announcing Adventurer's Codex, a D&D 5e players tool. [http://bit.ly/2c5BLg7](http://bit.ly/2c5BLg7)
<aside class="dates">Sep 07</aside></a>
</li>
<li>
<a href="/2016/08/25/ada7.html">🎶Adding email filters🎶
<aside class="dates">Aug 25</aside></a>
</li>
<li>
<a href="/2016/08/19/4ccf.html">I need a break for a week. [http://bit.ly/2bxiGlS](http://bit.ly/2bxiGlS)
<aside class="dates">Aug 19</aside></a>
</li>
<li>
<a href="/2016/08/16/cbd2.html">Now this is a hack, but it is also a working hack. [http://bit.ly/2aXQKcB](http://bit.ly/2aXQKcB)
<aside class="dates">Aug 16</aside></a>
</li>
<li>
<a href="/2016/08/15/9691.html">Other than that though, it's super fun. #NoMansSky
<aside class="dates">Aug 15</aside></a>
</li>
<li>
<a href="/2016/08/15/024b.html">One thing about No Man's Sky: the lack of an intro in Minecraft was never really a plus either.
<aside class="dates">Aug 15</aside></a>
</li>
<li>
<a href="/2016/08/14/4d06.html">"Gigabuckets of anti-love"
<aside class="dates">Aug 14</aside></a>
</li>
<li>
<a href="/2016/08/12/8d24.html">Solving the real problems. [http://bit.ly/2aQNYFS](http://bit.ly/2aQNYFS) @museofadventure
<aside class="dates">Aug 12</aside></a>
</li>
<li>
<a href="/2016/08/12/892f.html">Let the Star Gazing begin! #persieds
<aside class="dates">Aug 12</aside></a>
</li>
<li>
<a href="/2016/08/11/5edf.html">I think I've reached peak tech irony (sorry HackerNews commenters). [http://bit.ly/2aPx4WW](http://bit.ly/2aPx4WW)
<aside class="dates">Aug 11</aside></a>
</li>
<li>
<a href="/2016/08/10/f342.html">making plans with @museofadventure [http://bit.ly/2aKFxMn](http://bit.ly/2aKFxMn)
<aside class="dates">Aug 10</aside></a>
</li>
<li>
<a href="/2016/08/09/1a7d.html">I'm so full of good food. 😌😴
<aside class="dates">Aug 09</aside></a>
</li>
<li>
<a href="/2016/08/09/eebb.html">(Yes I just popped in a new fuze). Thanks internet. [http://bit.ly/2aHP19W](http://bit.ly/2aHP19W)
<aside class="dates">Aug 09</aside></a>
</li>
<li>
<a href="/2016/08/09/2b1d.html">I wouldn't have normally noticed until I didn't see the reflection while driving. This stopped me before it could be a problem. 👍
<aside class="dates">Aug 09</aside></a>
</li>
<li>
<a href="/2016/08/09/1f90.html">Apparently my car won't go into gear (there's an override) if the brake light fuze goes out. That's actually pretty cool.
<aside class="dates">Aug 09</aside></a>
</li>
<li>
<a href="/2016/07/30/5968.html">"Minor Text Fixes" - Most hated words in 2016
<aside class="dates">Jul 30</aside></a>
</li>
<li>
<a href="/2016/07/30/7520.html">There must be 80 people here sitting in a small plaza, in the shade playing Pokemon. All ages.
<aside class="dates">Jul 30</aside></a>
</li>
<li>
<a href="/2016/07/27/7087.html">"Completely empty flight tonight" - Attendant 👍😊😴
<aside class="dates">Jul 27</aside></a>
</li>
<li>
<a href="/2016/07/27/357b.html">SJC➡️SAN✈️
<aside class="dates">Jul 27</aside></a>
</li>
<li>
<a href="/2016/07/27/c31f.html">Writing up a pre-flight post... ready for home.
<aside class="dates">Jul 27</aside></a>
</li>
<li>
<a href="/2016/07/27/eb90.html">Pre-Flight cappuccino
<aside class="dates">Jul 27</aside></a>
</li>
<li>
<a href="/2016/07/26/6834.html">This vacation is 30% Pokemon Go.
<aside class="dates">Jul 26</aside></a>
</li>
<li>
<a href="/2016/07/24/cc0f.html">OH: "Feet is not a feeling."
<aside class="dates">Jul 24</aside></a>
</li>
<li>
<a href="/2016/07/24/8dcc.html">Only a little sunburned...
<aside class="dates">Jul 24</aside></a>
</li>
<li>
<a href="/2016/07/23/4662.html">More views. [http://bit.ly/2a6inwX](http://bit.ly/2a6inwX)
<aside class="dates">Jul 23</aside></a>
</li>
<li>
<a href="/2016/07/23/807d.html">Dear SF, please teach your birds not to crap on my head. K thanks.
<aside class="dates">Jul 23</aside></a>
</li>
<li>
<a href="/2016/07/23/88ad.html">TIL Davey Crockett rode into town on the backs of crocodiles. [http://bit.ly/2aiC3Bh](http://bit.ly/2aiC3Bh)
<aside class="dates">Jul 23</aside></a>
</li>
<li>
<a href="/2016/07/23/dc22.html">Feels too much like San Diego here. Not that that's bad, just that I was already in San Diego.
<aside class="dates">Jul 23</aside></a>
</li>
<li>
<a href="/2016/07/23/5918.html">You know San Francisco, without the cold and the fog you lose a lot of the mystique.
<aside class="dates">Jul 23</aside></a>
</li>
<li>
<a href="/2016/07/23/04bc.html">The audiophile section of the last episode of @atpfm was longer than my flight. Super cool stuff though.
<aside class="dates">Jul 23</aside></a>
</li>
<li>
<a href="/2016/07/23/7be0.html">Traveling with @MuseofAdventure 😆🌅⏳☕️🎶😞
<aside class="dates">Jul 23</aside></a>
</li>
<li>
<a href="/2016/07/23/9b21.html">SAN➡️SJC ✈️
<aside class="dates">Jul 23</aside></a>
</li>
<li>
<a href="/2016/07/22/65d3.html">Second wind: Go!
<aside class="dates">Jul 22</aside></a>
</li>
<li>
<a href="/2016/07/20/5f83.html">New café recently opened down the street. Good coffee, weak AC. ☕😊️🔥😞
<aside class="dates">Jul 20</aside></a>
</li>
<li>
<a href="/2016/07/20/aa08.html">An interesting writeup about today's Stack Overflow outage. [http://bit.ly/29Wk53Z](http://bit.ly/29Wk53Z)
<aside class="dates">Jul 20</aside></a>
</li>
<li>
<a href="/2016/07/20/8ff7.html">Xcode doesn't support Swift refactoring so I'm over here writing scripts to grep through source files. Funnily enough, I don't really mind.
<aside class="dates">Jul 20</aside></a>
</li>
<li>
<a href="/2016/07/20/e7f5.html">Python people are usually sticklers for it, and consequently, I am now too. But Swift is making it really difficult.
<aside class="dates">Jul 20</aside></a>
</li>
<li>
<a href="/2016/07/20/1b4d.html">Does anyone out there even attempt to keep ~80 characters/line in Swift?
<aside class="dates">Jul 20</aside></a>
</li>
<li>
<a href="/2016/07/19/58a1.html">It's a two coffee morning. ☕️☕️
<aside class="dates">Jul 19</aside></a>
</li>
<li>
<a href="/2016/07/15/c66c.html">Holy crap Turkey.
<aside class="dates">Jul 15</aside></a>
</li>
<li>
<a href="/2016/07/15/7f78.html">Out for a night of Pokemon hunting.
<aside class="dates">Jul 15</aside></a>
</li>
<li>
<a href="/2016/07/11/8989.html">Will it finally be cool to wear a Pokemon hat as an adult now? I've waited for that moment for years.
<aside class="dates">Jul 11</aside></a>
</li>
<li>
<a href="/2016/07/11/caa7.html">Its official. I'm now fully indoctrinated. I've had the server crash on me while catching Pokemon.
<aside class="dates">Jul 11</aside></a>
</li>
<li>
<a href="/2016/07/11/4fd0.html">I know I'm a bit late to the party, but I'm here now.
<aside class="dates">Jul 11</aside></a>
</li>
<li>
<a href="/2016/07/11/6e42.html">Whelp. It's happened. [http://bit.ly/29CEkYa](http://bit.ly/29CEkYa)
<aside class="dates">Jul 11</aside></a>
</li>
<li>
<a href="/2016/07/08/1377.html">What do you call global, shared-state objects: NSNotificationCenter.defaultCenter, UIApplication.sharedApplication, etc? I say services.
<aside class="dates">Jul 08</aside></a>
</li>
<li>
<a href="/2016/07/05/a427.html">View from the top. #prefireworks [http://bit.ly/29mryMc](http://bit.ly/29mryMc)
<aside class="dates">Jul 05</aside></a>
</li>
<li>
<a href="/2016/07/04/da5b.html">Linode, you're awesome.
<aside class="dates">Jul 04</aside></a>
</li>
<li>
<a href="/2016/07/04/b1c7.html">[notice] everything is fine. It's a non-crucial personal server. Thanks to the folks at Linode for detecting the hack and shutting it down.
<aside class="dates">Jul 04</aside></a>
</li>
<li>
<a href="/2016/07/04/29a6.html">Ladies and Gentlemen, I have been hacked. [http://bit.ly/29oAEdb](http://bit.ly/29oAEdb)
<aside class="dates">Jul 04</aside></a>
</li>
<li>
<a href="/2016/07/02/52e6.html">There's a local Dixieland brass band playing on the front steps of a historical hotel down the street from me. I love this neighborhood.
<aside class="dates">Jul 02</aside></a>
</li>
<li>
<a href="/2016/06/28/10f3.html">Python Programming Interview:
A: "What are the steps to make a PB&J sandwich?"
B: "from sandwich import PBJ; my_sammie = PBJ()"
<aside class="dates">Jun 28</aside></a>
</li>
<li>
<a href="/2016/06/28/894d.html">Remember when we used to print emails, web pages, etc cause we wanted the "real version"?
<aside class="dates">Jun 28</aside></a>
</li>
<li>
<a href="/2016/06/28/df60.html">I normally don't really care for server admin stuff, but doing first time setup for production servers is exciting. It's like passing a milestone.
<aside class="dates">Jun 28</aside></a>
</li>
<li>
<a href="/2016/06/28/3e87.html">The project is real now.
<aside class="dates">Jun 28</aside></a>
</li>
<li>
<a href="/2016/06/21/c355.html">Last night @museofadventure took some great pictures of the Strawberry Moon. [http://bit.ly/28LEDvI](http://bit.ly/28LEDvI)
<aside class="dates">Jun 21</aside></a>
</li>
<li>
<a href="/2016/06/21/b4ad.html">I climb mountain like mountain goat. Minus the stumbling of course.
<aside class="dates">Jun 21</aside></a>
</li>
<li>
<a href="/2016/06/21/001c.html">The moon is so bright and its light is so moon-beautiful. Moon is moon best. Moon. #moon
<aside class="dates">Jun 21</aside></a>
</li>
<li>
<a href="/2016/06/21/fa7c.html">Keep the streak! [http://bit.ly/28JOu4e](http://bit.ly/28JOu4e)
<aside class="dates">Jun 21</aside></a>
</li>
<li>
<a href="/2016/06/19/4caf.html">Oh sweet, merciful god I found shade.
<aside class="dates">Jun 19</aside></a>
</li>
<li>
<a href="/2016/06/18/0050.html">OH: "12PM is the noon?"
<aside class="dates">Jun 18</aside></a>
</li>
<li>
<a href="/2016/06/16/b513.html">A long, but overall successful morning of coding. Now, I has lunch!
<aside class="dates">Jun 16</aside></a>
</li>
<li>
<a href="/2016/06/08/405f.html">"This isn't a Request for Thoughts. It's a Request for Comments."
<aside class="dates">Jun 08</aside></a>
</li>
<li>
<a href="/2016/06/07/f785.html">That's what software engineers should aspire to create.
<aside class="dates">Jun 07</aside></a>
</li>
<li>
<a href="/2016/06/07/2672.html">Not only is BBEdit's software great, but releases are timely with OS updates, and their documentation is complete (as far as I can tell).
<aside class="dates">Jun 07</aside></a>
</li>
<li>
<a href="/2016/06/07/9c61.html">BBEdit is a fantastic example of mature, correct software. It doesn't look "modern", but it's extremely powerful, stable, and feature-rich.
<aside class="dates">Jun 07</aside></a>
</li>
<li>
<a href="/2016/06/04/c4c2.html">PDX ➡️SAN ✈️
<aside class="dates">Jun 04</aside></a>
</li>
<li>
<a href="/2016/06/04/f368.html">I will definitely be back. And hopefully before #PyCon2017
<aside class="dates">Jun 04</aside></a>
</li>
<li>
<a href="/2016/06/04/1a03.html">It's been fun Portland. But now I must leave you.
<aside class="dates">Jun 04</aside></a>
</li>
<li>
<a href="/2016/06/03/ba0c.html">I. Love. This. City.
<aside class="dates">Jun 03</aside></a>
</li>
<li>
<a href="/2016/06/03/bfde.html">Why did I have to travel all the way from San Diego for this? Best coffee shop idea I've seen. [http://www.revolucioncoffeehouse.com](http://www.revolucioncoffeehouse.com)
<aside class="dates">Jun 03</aside></a>
</li>
<li>
<a href="/2016/06/03/7992.html">Re Portland: there's a lot of beautiful architecture. So many old buildings and churches.
<aside class="dates">Jun 03</aside></a>
</li>
<li>
<a href="/2016/06/03/2d82.html">I'm a sucker for columns. [http://bit.ly/1PrZ0Sc](http://bit.ly/1PrZ0Sc)
<aside class="dates">Jun 03</aside></a>
</li>
<li>
<a href="/2016/06/03/c8eb.html">Sacajawea [http://bit.ly/20XJmhX](http://bit.ly/20XJmhX)
<aside class="dates">Jun 03</aside></a>
</li>
<li>
<a href="/2016/06/03/7d72.html">Biscuits for Breakfast. 😊
<aside class="dates">Jun 03</aside></a>
</li>
<li>
<a href="/2016/06/02/06f9.html">Now this is what Portland is about. #coffee [http://bit.ly/1r4kGrN](http://bit.ly/1r4kGrN)
<aside class="dates">Jun 02</aside></a>
</li>
<li>
<a href="/2016/06/02/d4e8.html">Tired. #PyCon has beaten me.
<aside class="dates">Jun 02</aside></a>
</li>
<li>
<a href="/2016/06/02/e3b5.html">Usually. [http://bit.ly/1Uvzjim](http://bit.ly/1Uvzjim)
<aside class="dates">Jun 02</aside></a>
</li>
<li>
<a href="/2016/06/01/8554.html">best quote, "crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, yes!"
<aside class="dates">Jun 01</aside></a>
</li>
<li>
<a href="/2016/06/01/63b1.html">Great talks, great people, but I'm exhausted.
<aside class="dates">Jun 01</aside></a>
</li>
<li>
<a href="/2016/05/31/7c82.html">I can't imagine nicer Portland weather.
<aside class="dates">May 31</aside></a>
</li>
<li>
<a href="/2016/05/31/3e48.html">A Pork Katsu Torta? Yes please!
<aside class="dates">May 31</aside></a>
</li>
<li>
<a href="/2016/05/31/080b.html">some awesome lightning talks #pycon2016
<aside class="dates">May 31</aside></a>
</li>
<li>
<a href="/2016/05/30/2b10.html">Oh no. Other Mac apps are doing the whole "jump to the cursor on-click like iMessage does" thing. Please fix this Apple.
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/8a73.html">Automation > Process #pycon2016
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/7ac3.html">All of the talks are closed captioned. I feel so bad for them, so much jargon.
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/91ff.html">Up next: "The Cobbler's Children have no Shoes."
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/6df5.html">Seriously, their apps are so ridiculously good.
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/844a.html">The one thing I miss most after leaving Twitter: @tweetbot.
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/193b.html">define your charaters (funtions) before they're used. #pycon2016
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/b555.html">programming style as storytelling. great idea.
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/ffda.html">"Readability matters because you don't scale" #pycon2016
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/9b78.html">"Software is made out of people...and their time."
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/daec.html">Everyone in the room has Slack, Twitter, and Github open.
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/46c5.html">recovering git branches... YES!
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/b03f.html">Git: Fear of losing work is a barrier to learning/experimentation #pycon2016
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/bd57.html">so many good talks all at the same time...
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/d31c.html">All examples in Python3. #asitshouldbe #pycon2016
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/fb8e.html">btw if you don't care about programming or Python, then you might want to mute #pycon2016 for the next few days.
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/8412.html">First session of the day: File descriptors, UNIX sockets and other POSIX wizardry. #pycon2016
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/9c03.html">PyCon so far has been 5% technology and 95% inclusivity, community, diversity, and education. #pycon2016
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/7325.html">It's time for PyCon: Day 1!
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/c00c.html">Free food!
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/1c59.html">Badged. [http://bit.ly/1Z7sLb3](http://bit.ly/1Z7sLb3)
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/3c82.html">Portland Lyft driver makes a Portlandia reference and neither of the dudes from San Diego got it. #auspiciousstart
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/30/0a2c.html">I'm in Portland!
<aside class="dates">May 30</aside></a>
</li>
<li>
<a href="/2016/05/29/0513.html">Got some time to wait in the terminal. Time for some Revolutions Podcast! [https://overcast.fm/](https://overcast.fm/) BFNrRhjmI
<aside class="dates">May 29</aside></a>
</li>
<li>
<a href="/2016/05/29/51ae.html">My activity graph makes cat ears. [http://bit.ly/20Q8R4S](http://bit.ly/20Q8R4S)
<aside class="dates">May 29</aside></a>
</li>
<li>
<a href="/2016/05/29/db5e.html">Thank you to whoever unplugged the 12-port, communal charging strip so they could plug in their iPad directly. We didn't need those.
<aside class="dates">May 29</aside></a>
</li>
<li>
<a href="/2016/05/29/7e3e.html">SAN➡️PDX✈️
<aside class="dates">May 29</aside></a>
</li>
<li>
<a href="/2016/05/28/70b4.html">🐍 Prepping for PyCon! 🐍
<aside class="dates">May 28</aside></a>
</li>
<li>
<a href="/2016/05/28/8c01.html">Me before entering a Twitter argument. [http://gph.is/1eRvd1P](http://gph.is/1eRvd1P)
<aside class="dates">May 28</aside></a>
</li>
<li>
<a href="/2016/05/26/dd52.html">Glad to see that this case ended how it should have. The consequences are huge. [http://bit.ly/1UgpGUC](http://bit.ly/1UgpGUC)
<aside class="dates">May 26</aside></a>
</li>
<li>
<a href="/2016/05/26/244f.html">This is my favorite thing this week. [http://bit.ly/1Ru1mKn](http://bit.ly/1Ru1mKn)
<aside class="dates">May 26</aside></a>
</li>
<li>
<a href="/2016/05/24/8975.html">Guns replaced with selfie sticks [http://bit.ly/25k2aia](http://bit.ly/25k2aia)
<aside class="dates">May 24</aside></a>
</li>
<li>
<a href="/2016/05/24/b0c8.html">Work, now with breakfast! Order now!
<aside class="dates">May 24</aside></a>
</li>
<li>
<a href="/2016/05/23/dd56.html">End of a long, productive day. Now that nourishment has been consumed, it's time to relax. 🤖 *beep*
<aside class="dates">May 23</aside></a>
</li>
<li>
<a href="/2016/05/21/5b9f.html">Well it will be in an hour, at least.
<aside class="dates">May 21</aside></a>
</li>
<li>
<a href="/2016/05/21/0757.html">What time is it? Band practice time!
<aside class="dates">May 21</aside></a>
</li>
<li>
<a href="/2016/05/21/5940.html">It's serious stuff. [http://bit.ly/1NDPYRl](http://bit.ly/1NDPYRl)
<aside class="dates">May 21</aside></a>
</li>
<li>
<a href="/2016/05/20/f009.html">Can we all agree that there are too many proprietary chat apps, and bluetooth dongles?
<aside class="dates">May 20</aside></a>
</li>
<li>
<a href="/2016/05/18/d39f.html">🎶Configuring Postgres🎶
<aside class="dates">May 18</aside></a>
</li>
<li>
<a href="/2016/05/18/cfbc.html">For reference, this is the keyboard in question. [http://amzn.to/1TZK4sT](http://amzn.to/1TZK4sT)
<aside class="dates">May 18</aside></a>
</li>
<li>
<a href="/2016/05/18/4caf.html">Got a new keyboard today; not used to split layouts. This might be a good motivator for me to learn to type correctly.
<aside class="dates">May 18</aside></a>
</li>
<li>
<a href="/2016/05/18/1fc1.html">I'm really liking the iTunes update yesterday. What year is this?
<aside class="dates">May 18</aside></a>
</li>
<li>
<a href="/2016/05/17/7d11.html">Different topic: I'm really liking Swift. It's a little inconsistent at times (EAFP/LBYL) but it's really practical. [http://www.oranlooney.com/lbyl-vs-eafp/](http://www.oranlooney.com/lbyl-vs-eafp/)
<aside class="dates">May 17</aside></a>
</li>
<li>
<a href="/2016/05/17/4ba1.html">Not just for if you lock yourself out (which is **huge**) but if you want to go to your car and you left the keys at your desk or something.
<aside class="dates">May 17</aside></a>
</li>
<li>
<a href="/2016/05/17/d255.html">Best advice I've ever gotten: Put a copy of your car key in your wallet.
<aside class="dates">May 17</aside></a>
</li>
<li>
<a href="/2016/05/15/e8b3.html">And now, band practice. 🎶
<aside class="dates">May 15</aside></a>
</li>
<li>
<a href="/2016/05/15/2f47.html">Tried to take a time-lapse while bike riding. Took a slow-mo instead: 5 minutes of 240 glorious frames per second.
<aside class="dates">May 15</aside></a>
</li>
<li>
<a href="/2016/05/10/eb26.html">Remember the old days? [http://bit.ly/1XjNBFp](http://bit.ly/1XjNBFp)
<aside class="dates">May 10</aside></a>
</li>
<li>
<a href="/2016/04/25/4dfe.html">I have Xcode open. Repeat: I have Xcode open.
<aside class="dates">Apr 25</aside></a>
</li>
<li>
<a href="/2016/04/17/7810.html">Surprisingly, its working well.
<aside class="dates">Apr 17</aside></a>
</li>
<li>
<a href="/2016/04/17/3d84.html">I don't know why I'm doing it, but I am.
<aside class="dates">Apr 17</aside></a>
</li>
<li>
<a href="/2016/04/17/cda7.html">Currently listening to music in iTunes, streamed from my webserver, via Icecast, from NiceCast, using VLC, streamed from my media server.
<aside class="dates">Apr 17</aside></a>
</li>
<li>
<a href="/2016/04/16/8c88.html">"Apple recovered [a tonne] of gold from broken iPhones last year" [http://cnnmon.ie/1WxNBkK](http://cnnmon.ie/1WxNBkK)
<aside class="dates">Apr 16</aside></a>
</li>
<li>
<a href="/2016/04/16/688e.html">With this coffee, I am become human.
<aside class="dates">Apr 16</aside></a>
</li>
<li>
<a href="/2016/04/12/8d5d.html">Actually, can we make "Relevant Rocky and Bullwinkle" a thing?
<aside class="dates">Apr 12</aside></a>
</li>
<li>
<a href="/2016/04/12/1e3e.html">Request: Plz upload all human knowledge to the internet. I couldn't find a relevant Rocky and Bullwinkle episode and my joke was lost. k thx
<aside class="dates">Apr 12</aside></a>
</li>
<li>
<a href="/2016/04/07/abfa.html">Filenames are hard.
<aside class="dates">Apr 07</aside></a>
</li>
<li>
<a href="/2016/04/06/8416.html">Yesterday was the first time in months that I've added a new contact on my Mac. Went to my iPhone this morning: it's not there.
<aside class="dates">Apr 06</aside></a>
</li>
<li>
<a href="/2016/04/06/6e76.html">Mr. Rogers Neighborhood [http://bit.ly/25L6ZPg](http://bit.ly/25L6ZPg)
<aside class="dates">Apr 06</aside></a>
</li>
<li>
<a href="/2016/04/06/af55.html">"Why is this place called the Cave of Hopelessness?"
"Oh fear not lad, tis named for its discoverer: Reginald Hopelessness..."
<aside class="dates">Apr 06</aside></a>
</li>
<li>
<a href="/2016/04/06/0ff0.html">"Deep in the Geysers of Gygax"
<aside class="dates">Apr 06</aside></a>
</li>
<li>
<a href="/2016/04/06/f52e.html">Waves. [http://bit.ly/1MRqI9s](http://bit.ly/1MRqI9s)
<aside class="dates">Apr 06</aside></a>
</li>
<li>
<a href="/2016/04/05/5a2b.html">Current status [http://bit.ly/1q4VEc1](http://bit.ly/1q4VEc1)
<aside class="dates">Apr 05</aside></a>
</li>
<li>
<a href="/2016/04/05/6cc2.html">Apparently we depend on C++, Perl, and even Powershell. Here's our full report. [http://pastebin.com/c0UwdGBK](http://pastebin.com/c0UwdGBK)
<aside class="dates">Apr 05</aside></a>
</li>
<li>
<a href="/2016/04/05/9b99.html">For a side project: We've written 8,500 lines of code. That code depends on 1,012,723 lines of 3rd party code. /cc @caseyliss
<aside class="dates">Apr 05</aside></a>
</li>
<li>
<a href="/2016/04/04/7272.html">Yup. [http://www.listen-tome.com/wasted-hours/](http://www.listen-tome.com/wasted-hours/)
<aside class="dates">Apr 04</aside></a>
</li>
<li>
<a href="/2016/04/04/bdf1.html">Fog [http://bit.ly/1MOry76](http://bit.ly/1MOry76)
<aside class="dates">Apr 04</aside></a>
</li>
<li>
<a href="/2016/04/02/35f8.html">Got a guitar yesterday. New to me, needed some cleaning but I've taken care of that, and of course new strings. Can't wait to play today!
<aside class="dates">Apr 02</aside></a>
</li>
<li>
<a href="/2016/04/01/59c9.html">People like pictures.
<aside class="dates">Apr 01</aside></a>
</li>
<li>
<a href="/2016/04/01/081e.html">Knowing all that, I got extremely giddy just now because I converted some console log statements into an HTML report with a progress bar.
<aside class="dates">Apr 01</aside></a>
</li>
<li>
<a href="/2016/04/01/200f.html">Developers get frustrated when people react to small visual changes over large code changes. To people that's when something becomes real.
<aside class="dates">Apr 01</aside></a>
</li>
<li>
<a href="/2016/04/01/06ee.html"><p>umm... why? <a href="http://bit.ly/1N0zRr2">http://bit.ly/1N0zRr2</a></p>
<aside class="dates">Apr 01</aside></a>
</li>
<li>
<a href="/2016/03/30/a03a.html"><p><em>cough</em> <a href="http://bit.ly/1WYCNKq">http://bit.ly/1WYCNKq</a></p>
<aside class="dates">Mar 30</aside></a>
</li>
<li>
<a href="/2016/03/30/1135.html"><p>Captionbot describes itself. <a href="http://bit.ly/1ZLmyC8">http://bit.ly/1ZLmyC8</a></p>
<aside class="dates">Mar 30</aside></a>
</li>
<li>
<a href="/2016/03/30/e7d8.html"><p>I am a tap-to-click trackpad wizard.</p>
<aside class="dates">Mar 30</aside></a>
</li>
<li>
<a href="/2016/03/30/d242.html"><p>and I'm pretty confident that I would have noticed it if it did. I've logged a <em>lot</em> of typing hours on my Mac laptops. #college</p>
<aside class="dates">Mar 30</aside></a>
</li>
<li>
<a href="/2016/03/30/efdf.html"><p>Not sure if I'm imagining it, but when I'm using a trackpad, I mouse with my left hand (my dominant hand) and I've never had issues. </p>
<aside class="dates">Mar 30</aside></a>
</li>
<li>
<a href="/2016/03/30/8763.html"><p>My setup today. Using my laptops keyboard and trackpad. <a href="http://bit.ly/1omk7Zc">http://bit.ly/1omk7Zc</a></p>
<aside class="dates">Mar 30</aside></a>
</li>
<li>
<a href="/2016/03/30/09fa.html"><p>I'm banishing you to the depths! <a href="http://bit.ly/1UCC2Jz">http://bit.ly/1UCC2Jz</a></p>
<aside class="dates">Mar 30</aside></a>
</li>
<li>
<a href="/2016/03/30/2e17.html"><p>Anyone with burgeoning RSI use a magic trackpad over a mouse? I never seem to have issues when I'm using my laptop, only with a mouse.</p>
<aside class="dates">Mar 30</aside></a>
</li>
<li>
<a href="/2016/03/30/c45e.html"><p>My favorite kind of weather. <a href="http://bit.ly/1ThtPsN">http://bit.ly/1ThtPsN</a></p>
<aside class="dates">Mar 30</aside></a>
</li>
<li>
<a href="/2016/03/29/e589.html"><p>Why do I Git version non-code projects? Because I can easily look up when, where, what, and how past me changed something. It's extremely useful.</p>
<aside class="dates">Mar 29</aside></a>
</li>
<li>
<a href="/2016/03/29/3ac7.html"><p>I highly doubt they will. "[this] raises questions about... whether it will inform Apple about these vulnerabilities" <a href="http://bit.ly/22VVxxU">http://bit.ly/22VVxxU</a></p>
<aside class="dates">Mar 29</aside></a>
</li>
<li>
<a href="/2016/03/29/e784.html"><p>It's never a good time when the Finder says an empty directory uses 28GB. That's when the panic starts.</p>
<aside class="dates">Mar 29</aside></a>
</li>
<li>
<a href="/2016/03/29/1e47.html"><p>Looks like a Disk Utility First Aid check caught the issue. <em>phew</em> 😪</p>
<aside class="dates">Mar 29</aside></a>
</li>
<li>
<a href="/2016/03/29/499f.html"><p>Oh no... 😣 please HFS , don't be corrupted.</p>
<aside class="dates">Mar 29</aside></a>
</li>
<li>
<a href="/2016/03/29/c773.html"><p>It took me all day, but I'm down to the last cup of this french press of coffee I made this morning.</p>
<aside class="dates">Mar 29</aside></a>
</li>
<li>
<a href="/2016/03/28/c670.html"><p>Months after it came out, my parents are finally seeing Star Wars. </p>
<aside class="dates">Mar 28</aside></a>
</li>
<li>
<a href="/2016/03/28/2b0d.html"><p>4 cups of coffee and I'm still tired. </p>
<aside class="dates">Mar 28</aside></a>
</li>
<li>
<a href="/2016/03/26/362e.html"><p>Post-hike Perrier. </p>
<aside class="dates">Mar 26</aside></a>
</li>
<li>
<a href="/2016/03/26/69d7.html"><p>I need to turn up my filter on Hacker News. </p>
<aside class="dates">Mar 26</aside></a>
</li>
<li>
<a href="/2016/03/25/b811.html"><p>Most of the buildings are still there. "Classic NYC street photos, from the 1930s and now" <a href="http://bit.ly/1SlQ3ax">http://bit.ly/1SlQ3ax</a></p>
<aside class="dates">Mar 25</aside></a>
</li>
<li>
<a href="/2016/03/25/045d.html"><p>The actual help menu appears when you run the script with no arguments. </p>
<aside class="dates">Mar 25</aside></a>
</li>
<li>
<a href="/2016/03/25/37ca.html"><p>You know you're using some really special software when the --help option just prints out Perl code with no additional comments.</p>
<aside class="dates">Mar 25</aside></a>
</li>
<li>
<a href="/2016/03/24/d904.html"><p>Hell is PDFs for documentation. </p>
<aside class="dates">Mar 24</aside></a>
</li>
<li>
<a href="/2016/03/23/fafa.html"><p>Early coffeehouses in Oxford (~1700s) held talks on topics like politics, news, science, etc. Why don't we do that today? TED: Coffeehouse</p>
<aside class="dates">Mar 23</aside></a>
</li>
<li>
<a href="/2016/03/23/5102.html"><p>so close... </p>
<aside class="dates">Mar 23</aside></a>
</li>
<li>
<a href="/2016/03/22/606d.html"><p>Big Software</p>
<aside class="dates">Mar 22</aside></a>
</li>
<li>
<a href="/2016/03/22/4855.html"><p>When there's no more coffee, it's time to leave.</p>
<aside class="dates">Mar 22</aside></a>
</li>
<li>
<a href="/2016/03/22/e228.html"><p>HTML was designed for researchers to publish and link to each other's work. Yet it's 2016 and we're still using PDF. <a href="http://bit.ly/25jeT24">http://bit.ly/25jeT24</a></p>
<aside class="dates">Mar 22</aside></a>
</li>
<li>
<a href="/2016/03/21/8c7b.html"><p>Looking at the list of talks for PyCon: I'm not past the first set of sessions and I can't decide which one to go to. #AGoodProblemToHave</p>
<aside class="dates">Mar 21</aside></a>
</li>
<li>
<a href="/2016/03/21/86c8.html"><p>aaaaaaaaand no new Macs.</p>
<aside class="dates">Mar 21</aside></a>
</li>
<li>
<a href="/2016/03/21/c4c8.html"><p>What the hell is a "nit of light?" </p>
<aside class="dates">Mar 21</aside></a>
</li>
<li>
<a href="/2016/03/21/a743.html"><p>Wow. Tim Cook starting off the keynote with the FBI debacle. </p>
<aside class="dates">Mar 21</aside></a>
</li>
<li>
<a href="/2016/03/21/2af5.html"><p>Apple event screen. <a href="http://bit.ly/1ZkLKz8">http://bit.ly/1ZkLKz8</a></p>
<aside class="dates">Mar 21</aside></a>
</li>
<li>
<a href="/2016/03/20/3924.html"><p>Prepping for band practice. 🎶😊🎶</p>
<aside class="dates">Mar 20</aside></a>
</li>
<li>
<a href="/2016/03/20/6014.html"><p>Setting up a new Wordpress installation is pretty easy as long as you haven't messed with your Apache PHP configuration. Then it's a nightmare. </p>
<aside class="dates">Mar 20</aside></a>
</li>
<li>
<a href="/2016/03/18/e46a.html"><p>so much want.</p>
<aside class="dates">Mar 18</aside></a>
</li>
<li>
<a href="/2016/03/18/c612.html"><p>TIL that you can design custom telecasters... (designed, not ordered) <a href="http://bit.ly/1WuxSAF">http://bit.ly/1WuxSAF</a></p>
<aside class="dates">Mar 18</aside></a>
</li>
<li>
<a href="/2016/03/17/5108.html"><p>Why is there no standard way of sharing music playlists? And if there is, why doesn't iTunes support it?</p>
<aside class="dates">Mar 17</aside></a>
</li>
<li>
<a href="/2016/03/17/2986.html"><p>Well, I skimmed that paper and looked at the graphs. That's about all I could understand. :P</p>
<aside class="dates">Mar 17</aside></a>
</li>
<li>
<a href="/2016/03/17/3c3f.html"><p>My reading for today: Generalized methods and solvers for noise removal from piecewise constant signals. We'll see how this goes. </p>
<aside class="dates">Mar 17</aside></a>
</li>
<li>
<a href="/2016/03/17/2672.html"><p>A good morning so far. <a href="http://bit.ly/1R6435L">http://bit.ly/1R6435L</a></p>
<aside class="dates">Mar 17</aside></a>
</li>
<li>
<a href="/2016/03/15/e0af.html"><p>Everyone needs this Giphy Alfred workflow. <a href="http://bit.ly/1Xt1K0D">http://bit.ly/1Xt1K0D</a></p>
<aside class="dates">Mar 15</aside></a>
</li>
<li>
<a href="/2016/03/15/81da.html"><p>Google's like, "Platform specific interface guidelines? lolwut?" <a href="http://bit.ly/1QTq2iA">http://bit.ly/1QTq2iA</a></p>
<aside class="dates">Mar 15</aside></a>
</li>
<li>
<a href="/2016/03/15/b25f.html"><p>That's probably the 10th time I've posted that. It's not funny to most people, but it's funny to me.</p>
<aside class="dates">Mar 15</aside></a>
</li>
<li>
<a href="/2016/03/14/bf08.html"><p>Thanks @overcast! I've wanted a dark mode forever (looks great too) and file upload is something I can't wait to use.</p>
<aside class="dates">Mar 14</aside></a>
</li>
<li>
<a href="/2016/03/11/6283.html"><p>A universal install script. <a href="http://xkcd.com/1654/">http://xkcd.com/1654/</a></p>
<aside class="dates">Mar 11</aside></a>
</li>
<li>
<a href="/2016/03/11/5723.html"><p>🎶Mocking all the things🎶</p>
<aside class="dates">Mar 11</aside></a>
</li>
<li>
<a href="/2016/03/08/035e.html"><p>Dat rain doe</p>
<aside class="dates">Mar 08</aside></a>
</li>
<li>
<a href="/2016/03/08/755d.html"><p>🌧🌧🌧🌧🌙🌧🌧🌧🌧</p>
<aside class="dates">Mar 08</aside></a>
</li>
<li>
<a href="/2016/03/05/c865.html"><p>but seriously I don't think you realize how much time you actually spend just browsing (the modern equivalent of flipping channels)</p>
<aside class="dates">Mar 05</aside></a>
</li>
<li>
<a href="/2016/03/05/3dea.html"><p>I recommend filtering HN through to an RSS feed. You'll spend less time searching and more time reading things that are important to you.</p>
<aside class="dates">Mar 05</aside></a>
</li>
<li>
<a href="/2016/03/05/a19d.html"><p>After adding automatic filtering to Hacker News, I've realized how few of the posts I actually want to read. It's not a bad thing.</p>
<aside class="dates">Mar 05</aside></a>
</li>
<li>
<a href="/2016/03/04/2ff3.html"><p>I'm exahusted. Want sleep.</p>
<aside class="dates">Mar 04</aside></a>
</li>
<li>
<a href="/2016/03/02/054c.html"><p>Project meeting time! 🕖🎉🍹</p>
<aside class="dates">Mar 02</aside></a>
</li>
<li>
<a href="/2016/03/01/c52d.html"><p>It's a stupidly beautiful day. </p>
<aside class="dates">Mar 01</aside></a>
</li>
<li>
<a href="/2016/03/01/6e2c.html"><p>My coffee was cold. I warmed it up. Now it is cold again. #cantwin #failwhale #suckstobeme #tuesdays</p>
<aside class="dates">Mar 01</aside></a>
</li>
<li>
<a href="/2016/03/01/ecbf.html"><p>Eggs, with tomatoes and mushrooms, on toast. <a href="http://bit.ly/1oMwP3R">http://bit.ly/1oMwP3R</a></p>
<aside class="dates">Mar 01</aside></a>
</li>
<li>
<a href="/2016/03/01/9b15.html"><p>Also coffee.</p>
<aside class="dates">Mar 01</aside></a>
</li>
<li>
<a href="/2016/03/01/70e6.html"><p>Always coffee.</p>
<aside class="dates">Mar 01</aside></a>
</li>
<li>
<a href="/2016/03/01/9d21.html"><p>“Infinite are the arguments of mages,”
― Ursula K. Le Guin, A Wizard of Earthsea</p>
<aside class="dates">Mar 01</aside></a>
</li>
<li>
<a href="/2016/02/28/a803.html"><p>Gonna play some Risk tonight!</p>
<aside class="dates">Feb 28</aside></a>
</li>
<li>
<a href="/2016/02/27/7672.html"><p>I don't know why, but I just remembered this tweet. <a href="https://twitter.com/rentzsch/status/602862585398992896">https://twitter.com/rentzsch/status/602862585398992896</a></p>
<aside class="dates">Feb 27</aside></a>
</li>
<li>
<a href="/2016/02/25/4dc9.html"><p>[Closed as Expected Behavior]</p>
<aside class="dates">Feb 25</aside></a>
</li>
<li>
<a href="/2016/02/25/029b.html"><p>Bug #1234 "Computers are generally insecure. Please add more privacy protection." <<Closed as Expected Behavior>> </p>
<aside class="dates">Feb 25</aside></a>
</li>
<li>
<a href="/2016/02/25/e04d.html"><p>The modern web and software landscape has conditioned people to just accept that computers are insecure, and broken. </p>
<aside class="dates">Feb 25</aside></a>
</li>
<li>
<a href="/2016/02/25/5fb4.html"><p>From what I've seen, most people just expect that all things can be broken into. That's the scary part. There's no expectation of privacy.</p>
<aside class="dates">Feb 25</aside></a>
</li>
<li>
<a href="/2016/02/25/d56a.html"><p>The idea that the data on an iPhone can't be read, even by Apple or the FBI, is shocking to most people. </p>
<aside class="dates">Feb 25</aside></a>
</li>
<li>
<a href="/2016/02/24/13c2.html"><p>YouTube's goal recently seems to be to remind everyone that it controls everything and there's nothing we can do.</p>
<aside class="dates">Feb 24</aside></a>
</li>
<li>
<a href="/2016/02/24/b6f9.html"><p>Team Four Star's YouTube channel was taken down with no notice. </p>
<aside class="dates">Feb 24</aside></a>
</li>
<li>
<a href="/2016/02/23/4dc2.html"><p>CI is a magical thing. Especially when it auto-deploys.</p>
<aside class="dates">Feb 23</aside></a>
</li>
<li>
<a href="/2016/02/23/c420.html"><p>The evolution of the web. <a href="http://fabianburghardt.de/webolution/">http://fabianburghardt.de/webolution/</a></p>
<aside class="dates">Feb 23</aside></a>
</li>
<li>
<a href="/2016/02/23/f2c3.html"><p>A perfect example of the UNIX philosophy on the web is Gravatar. It does one thing: profile images, and it does it well. </p>
<aside class="dates">Feb 23</aside></a>
</li>
<li>
<a href="/2016/02/23/4bcd.html"><p>Coffee ✅
Eggs on toast ✅
Read some articles before work [In Progress]
Work [Next]
Book of Mormon [Tonight]</p>
<aside class="dates">Feb 23</aside></a>
</li>
<li>
<a href="/2016/02/20/dc1e.html"><p>"Roll for gypsies"</p>
<aside class="dates">Feb 20</aside></a>
</li>
<li>
<a href="/2016/02/20/806f.html"><p>I'm proud of this. "Fatal Python error: Cannot recover from stack overflow."
<a href="http://bit.ly/24g4bJf">http://bit.ly/24g4bJf</a></p>
<aside class="dates">Feb 20</aside></a>
</li>
<li>
<a href="/2016/02/18/41c2.html"><p>Is there really no "equal sign" emoji? </p>
<aside class="dates">Feb 18</aside></a>
</li>
<li>
<a href="/2016/02/18/839d.html"><p>☕️➕🌧➕🎶➡️😌</p>
<aside class="dates">Feb 18</aside></a>
</li>
<li>
<a href="/2016/02/10/9e2e.html"><p>Webpage size with Twitter widget: 200KB; without it: 16KB. That's 12x smaller.</p>
<aside class="dates">Feb 10</aside></a>
</li>
<li>
<a href="/2016/02/10/b9c8.html"><p>Had to wait for my solar powered keyboard to charge before I could start my day.</p>
<aside class="dates">Feb 10</aside></a>
</li>
<li>
<a href="/2016/02/07/53c3.html"><p>This lox bagel is the only thing I've ever wanted right now.</p>
<aside class="dates">Feb 07</aside></a>
</li>
<li>
<a href="/2016/02/07/fa1c.html"><p>Not a LOX bagel; that's something else.</p>
<aside class="dates">Feb 07</aside></a>
</li>
<li>
<a href="/2016/02/07/189c.html"><p>Coffee, code, and a lox Bagel. #aperfectsunday</p>
<aside class="dates">Feb 07</aside></a>
</li>
<li>
<a href="/2016/02/06/3e91.html"><p>I didn't know Gravatar had a default image option for missing avatars. It even includes random monster, and pattern images. That's awesome!</p>
<aside class="dates">Feb 06</aside></a>
</li>
<li>
<a href="/2016/02/05/a241.html"><p>In San Diego we have the problem of the weather being 'too perfect'. It's boring having such perfect weather with no variety. 😜</p>
<aside class="dates">Feb 05</aside></a>
</li>
<li>
<a href="/2016/02/05/da63.html"><p>So, if I were to use the offical clients for all the chat apps I use, I'd have to have 5 seperate applications that do the same thing.</p>
<aside class="dates">Feb 05</aside></a>
</li>
<li>
<a href="/2016/02/05/6a33.html"><p>(aim for some friends, HipChat for work, Gitter for side projects, IRC for meetups, SMS/iMessage for everything else)</p>
<aside class="dates">Feb 05</aside></a>
</li>
<li>
<a href="/2016/02/05/4dfb.html"><p>I log onto Twitter to change my profile and this is my timeline... <a href="http://bit.ly/1PFcLux">http://bit.ly/1PFcLux</a></p>
<aside class="dates">Feb 05</aside></a>
</li>
<li>
<a href="/2016/02/05/5d53.html"><p>I mean, it's probably a lot more than typical users, but I feel like a modern OS should be able to handle that without stuttering animations.</p>
<aside class="dates">Feb 05</aside></a>
</li>
<li>
<a href="/2016/02/05/9125.html"><p>I have 7 virtual desktops with about 4-5 windows in each (and some even have tabs 👻). I don't feel like that's a lot.</p>
<aside class="dates">Feb 05</aside></a>
</li>
<li>
<a href="/2016/02/05/534d.html"><p>Sometimes, I feel like I'm pushing the limits of my Mac by just having lots of windows open. (even on my 2014 rMBP, 16GB Memory)</p>
<aside class="dates">Feb 05</aside></a>
</li>
<li>
<a href="/2016/02/04/921f.html"><p>All code is simple, if designed properly; even the most complex tasks are simple if you break it down.</p>
<aside class="dates">Feb 04</aside></a>
</li>
<li>
<a href="/2016/02/04/5c78.html"><p>Developing Software isn't a test of skill, or cleverness; it's a test of your ability to properly organize things. </p>
<aside class="dates">Feb 04</aside></a>
</li>
<li>
<a href="/2016/02/02/5064.html"><p>Second round of coffee, go!</p>
<aside class="dates">Feb 02</aside></a>
</li>
<li>
<a href="/2016/02/02/5a89.html"><p>Sometimes I wonder if I should write my History and Programming blog posts on seperate sites. </p>
<aside class="dates">Feb 02</aside></a>
</li>
<li>
<a href="/2016/02/01/eae0.html"><p>I opened the Terminal and got this... wut?
<a href="http://bit.ly/20C5cID">http://bit.ly/20C5cID</a></p>
<aside class="dates">Feb 01</aside></a>
</li>
<li>
<a href="/2016/02/01/c894.html"><p>"...it's basically every crappy IT project..."</p>
<aside class="dates">Feb 01</aside></a>
</li>
<li>
<a href="/2016/02/01/485c.html"><p>"I hate The Lord of the Rings because it's too much like work."
<a href="http://kottke.org/16/02/i-hate-the-lord-of-the-rings">http://kottke.org/16/02/i-hate-the-lord-of-the-rings</a></p>
<aside class="dates">Feb 01</aside></a>
</li>
<li>
<a href="/2016/02/01/cfd8.html"><p>"Installing updates"</p>
<aside class="dates">Feb 01</aside></a>
</li>
<li>
<a href="/2016/02/01/3602.html"><p>Gordon Ramsey-style eggs. 😋 <a href="http://bit.ly/1KlLay8">http://bit.ly/1KlLay8</a></p>
<aside class="dates">Feb 01</aside></a>
</li>
<li>
<a href="/2016/01/31/1552.html"><p>"Beer is the space catnip"</p>
<aside class="dates">Jan 31</aside></a>
</li>
<li>
<a href="/2016/01/30/d587.html"><p>"Cap off a canyon with ice"
Bam! Instant building. </p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/2ab3.html"><p>"Pork, pasta, and peanut butter."</p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/7e8f.html"><p>"Hydroponics are key."</p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/d9a4.html"><p>Recycling in space. </p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/8210.html"><p>Found the first use of the .aero domain!
masten.aero</p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/880a.html"><p>Asteroid mining and Masten #SpaceUpV
<a href="https://db.tt/ARJoY71G">https://db.tt/ARJoY71G</a></p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/d315.html"><p>Thorium reactors and space pirates. #SpaceUpV</p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/6574.html"><p>MaaS: Mars as a service. </p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/0143.html"><p>We need Silicon Valley-esq titles for space companies.</p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/abb8.html"><p>"Flags and Footprints model" #SpaceUpV</p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/241c.html"><p>"Sucker punch the satellite" </p>
<p>"Spongebob or a catcher's mitt" #SpaceUpV</p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/83e0.html"><p>"Steampunk in space" #SpaceUpV</p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/d475.html"><p><a href="https://db.tt/tJCerFsF">https://db.tt/tJCerFsF</a></p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/c07c.html"><p>Power satellites! <a href="https://db.tt/Rgncs4BE">https://db.tt/Rgncs4BE</a></p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/64b2.html"><p>Getting ready for talks!</p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/e90b.html"><h1>SpaceUpV</h1>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/5c2b.html"><p>There we go. Now it's official. </p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/30/2f79.html"><p>SpaceUp has started! <a href="https://db.tt/a24WdFrv">https://db.tt/a24WdFrv</a></p>
<aside class="dates">Jan 30</aside></a>
</li>
<li>
<a href="/2016/01/29/c8c5.html"><p>It's a nice dream, but it's unfortunately just that. </p>
<aside class="dates">Jan 29</aside></a>
</li>
<li>
<a href="/2016/01/29/2e0c.html"><p>The dream for scientists, analysts, and programmers is for all the world's data to be in 1 place, in 1 format, and have 1 naming convention.</p>
<aside class="dates">Jan 29</aside></a>
</li>
<li>
<a href="/2016/01/28/7445.html"><p>making graphs!</p>
<aside class="dates">Jan 28</aside></a>
</li>
<li>
<a href="/2016/01/28/5884.html"><p>Oatmeal cookies and coffee. Breakfast of champions.</p>
<aside class="dates">Jan 28</aside></a>
</li>
<li>
<a href="/2016/01/28/76e8.html"><p>I'll fix it tomorrow. #sleep</p>
<aside class="dates">Jan 28</aside></a>
</li>
<li>
<a href="/2016/01/28/e317.html"><p>I guess it's still to early to require automatic https for Let's Encrypt certificates. I'm getting "untrusted" errors from some browsers.</p>
<aside class="dates">Jan 28</aside></a>
</li>
<li>
<a href="/2016/01/28/f5a6.html"><p>Fun fact: There are more people under 15 in India then there are in the U.S. period.</p>
<aside class="dates">Jan 28</aside></a>
</li>
<li>
<a href="/2016/01/27/31b0.html"><p>Anyone have any good resources for learning intermediate-advanced Statistics? </p>
<aside class="dates">Jan 27</aside></a>
</li>
<li>
<a href="/2016/01/27/c031.html"><p>Kinda wanna blog more, but I don't want to look at my computer anymore. 😪</p>
<aside class="dates">Jan 27</aside></a>
</li>
<li>
<a href="/2016/01/27/96bc.html"><p>🎉🎉 Open Source Project Meetup Night 🎉🎉</p>
<aside class="dates">Jan 27</aside></a>
</li>
<li>
<a href="/2016/01/27/489c.html"><p>It's easier to just delete some after a week. The impulse to read clickbait articles vanishes, and only the best articles remain.</p>
<aside class="dates">Jan 27</aside></a>
</li>
<li>
<a href="/2016/01/27/1ad2.html"><p>Finally caught up on all the articles I've been hoarding for the last week. By that I mean I read 2 of them, and deleted 8.</p>
<aside class="dates">Jan 27</aside></a>
</li>
<li>
<a href="/2016/01/26/cc03.html"><p>Everything I needed to do today is done. Now, time to relax.</p>
<aside class="dates">Jan 26</aside></a>
</li>
<li>
<a href="/2016/01/25/65bb.html"><p>I love it when all my tests pass.</p>
<aside class="dates">Jan 25</aside></a>
</li>
<li>
<a href="/2016/01/25/346e.html"><p>I love that <a href="http://bit.ly/1WBUi3w">Dr. Drang</a> links to the actual bills. It makes them so much easier to find.</p>
<aside class="dates">Jan 25</aside></a>
</li>
<li>
<a href="/2016/01/25/e30d.html"><p>"California and New York State legislatures to force smartphone manufacturers... to incorporate backdoors..."
http://bit.ly/1ZNIP0L</p>
<aside class="dates">Jan 25</aside></a>
</li>
<li>
<a href="/2016/01/21/e534.html"><p>I recently read <a href="http://www.amazon.com/gp/product/1621052036?redirect=true&ref_=cm_cr_ryp_prd_ttl_sol_0">King Space Void</a> by my friend Anthony Trevino. It's a fun, bite-sized bit of bizzareness. You should check it out!</p>
<aside class="dates">Jan 21</aside></a>
</li>
<li>
<a href="/2016/01/21/c8dd.html"><p>That feeling when you want to have a server just to serve your clever 500 error jokes.</p>
<aside class="dates">Jan 21</aside></a>
</li>
<li>
<a href="/2016/01/21/8a41.html"><p>I think I rediscover this every 6 months, but a thermos of coffee is a great thing to bring with me in the morning.</p>
<aside class="dates">Jan 21</aside></a>
</li>
<li>
<a href="/2016/01/11/9d46.html"><p>Written Log: blog
Video Log: vlog
Audio Log: alog? aug? augh? ugh?</p>
<aside class="dates">Jan 11</aside></a>
</li>
<li>
<a href="/2016/01/11/68f0.html"><blockquote>
<p>With hindsight, it seems bloody obvious the Sun and not the Earth is the center of the solar system. Occam's razor and all that.</p>
</blockquote>
<p><img src="http://also.kottke.org/misc/images/helio-vs-geo.gif" alt="Heliocentrism vs geocentrism"></p>
<aside class="dates">Jan 11</aside></a>
</li>
<li>
<a href="/2016/01/11/7c56.html"><p>.@kjaymiller No, Peach is just a new version of the same thing. For now I've got my own microblog. Twitter is becoming just chat for me.</p>
<aside class="dates">Jan 11</aside></a>
</li>
<li>
<a href="/2016/01/11/6689.html"><p>PSA: Never remove the Logitech adapter from your Mac, not even for 2 minutes. You'll forget to put it back, and you'll be sad at work.</p>
<aside class="dates">Jan 11</aside></a>
</li>
<li>
<a href="/2016/01/11/1ee6.html"><p>As of today, I won't really be posting to Twitter anymore. I'll still reply, and DM, but all of my normal tweets will be auto-posted from my Microblog.
<a href="http://sonicrocketman.snippets.xyz">http://sonicrocketman.snippets.xyz</a></p>
<aside class="dates">Jan 11</aside></a>
</li>
<li>
<a href="/2016/01/11/0e9f.html"><p>Posting to Hacker News is so hit or miss.</p>
<aside class="dates">Jan 11</aside></a>
</li>
<li>
<a href="/2016/01/11/b54d.html"><p><a href="http://brianschrader.com/archive/breaking-up-is-hard-to-do/">Breaking up is hard to do (A breakup letter to Twitter)</a></p>
<aside class="dates">Jan 11</aside></a>
</li>
<li>
<a href="/2016/01/10/334d.html"><p>Coffee. It's the good stuff. </p>
<aside class="dates">Jan 10</aside></a>
</li>
<li>
<a href="/2015/10/20/1554.html"><p>I have not seen the new Star Wars Trailer.</p>
<aside class="dates">Oct 20</aside></a>
</li>
<li>
<a href="/2015/09/24/82fb.html"><p>Today has been a whirlwind of a day. </p>
<aside class="dates">Sep 24</aside></a>
</li>
<li>
<a href="/2015/09/24/2ea6.html"><p>Got some new data in today. Time to start digging.</p>
<aside class="dates">Sep 24</aside></a>
</li>
<li>
<a href="/2015/09/23/c59f.html"><p>Though, since I'm not a biologist, I probably won't be able to tell.</p>
<aside class="dates">Sep 23</aside></a>
</li>
<li>
<a href="/2015/09/23/f021.html"><p>Got this DNA analysis going. Hopefully it leads to something interesting.</p>
<aside class="dates">Sep 23</aside></a>
</li>
<li>
<a href="/2015/09/23/d6af.html"><p>Hello world and all who inhabit it!</p>
<aside class="dates">Sep 23</aside></a>
</li>
</ul>
-->
</section>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/assets/js/main.js"></script>
<script src="/assets/js/highlight.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXXX-X', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
| Sonictherocketman/mirror.microblog | _site/2016/04/01/06ee.html | HTML | mit | 71,090 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
11374,
1027,
1000,
4372,
1000,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1028,
1026,
18804,
8299,
1011,
1041,
15549,
2615,
1027,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import { module, test } from "qunit";
import argvInjector from "inject-loader?nwjs/App!nwjs/argv";
module( "nwjs/argv" );
test( "Default values", assert => {
const argv = argvInjector({
"nwjs/App": {
argv: []
}
});
assert.propEqual(
argv.argv,
{
"_": [],
"tray": false,
"hide": false,
"hidden": false,
"max": false,
"maximize": false,
"maximized": false,
"min": false,
"minimize": false,
"minimized": false,
"reset-window": false,
"versioncheck": true,
"version-check": true,
"logfile": true,
"loglevel": "",
"l": "",
"goto": "",
"launch": ""
},
"Has the correct parameters"
);
assert.deepEqual(
Object.keys( argv ).sort(),
[
"argv",
"parseCommand",
"ARG_GOTO",
"ARG_LAUNCH",
"ARG_LOGFILE",
"ARG_LOGLEVEL",
"ARG_MAX",
"ARG_MIN",
"ARG_RESET_WINDOW",
"ARG_TRAY",
"ARG_VERSIONCHECK"
].sort(),
"Exports the correct constants"
);
});
test( "Custom parameters", assert => {
const { argv } = argvInjector({
"nwjs/App": {
argv: [
// boolean without values
"--tray",
"--max",
"--min",
"--reset-window",
// boolean with "no-" prefix
"--no-versioncheck",
// boolean with value
"--logfile=false",
// string
"--loglevel",
"debug",
"--goto",
"foo",
"--launch",
"bar",
"positional"
]
}
});
assert.propEqual(
argv,
{
"_": [ "positional" ],
"tray": true,
"hide": true,
"hidden": true,
"max": true,
"maximize": true,
"maximized": true,
"min": true,
"minimize": true,
"minimized": true,
"reset-window": true,
"versioncheck": false,
"version-check": false,
"logfile": false,
"loglevel": "debug",
"l": "debug",
"goto": "foo",
"launch": "bar"
},
"Has the correct parameters"
);
});
test( "Aliases", assert => {
const { argv } = argvInjector({
"nwjs/App": {
argv: [
"--hide",
"--maximize",
"--minimize",
"--no-version-check",
"-l",
"debug"
]
}
});
assert.propEqual(
argv,
{
"_": [],
"tray": true,
"hide": true,
"hidden": true,
"max": true,
"maximize": true,
"maximized": true,
"min": true,
"minimize": true,
"minimized": true,
"reset-window": false,
"versioncheck": false,
"version-check": false,
"logfile": true,
"loglevel": "debug",
"l": "debug",
"goto": "",
"launch": ""
},
"Has the correct parameters"
);
});
test( "Parse command", assert => {
const { parseCommand } = argvInjector({
"nwjs/App": {
argv: [],
manifest: {
"chromium-args": "--foo --bar"
}
}
});
assert.propEqual(
// this is unfortunately how NW.js passes through the command line string from second
// application starts: parameters with leading dashes get moved to the beginning
parseCommand([
"/path/to/executable",
"--goto",
"--unrecognized-parameter-name",
"--foo",
"--bar",
"--user-data-dir=baz",
"--no-sandbox",
"--no-zygote",
"--flag-switches-begin",
"--flag-switches-end",
"foo"
].join( " " ) ),
{
"_": [],
"tray": false,
"hide": false,
"hidden": false,
"max": false,
"maximize": false,
"maximized": false,
"min": false,
"minimize": false,
"minimized": false,
"reset-window": false,
"versioncheck": true,
"version-check": true,
"logfile": true,
"loglevel": "",
"l": "",
"goto": "foo",
"launch": ""
},
"Correctly parses parameters"
);
});
| bastimeyer/livestreamer-twitch-gui | src/test/tests/nwjs/argv.js | JavaScript | mit | 3,497 | [
30522,
12324,
1063,
11336,
1010,
3231,
1065,
2013,
1000,
24209,
3490,
2102,
1000,
1025,
12324,
12098,
2290,
6371,
20614,
2953,
2013,
1000,
1999,
20614,
1011,
7170,
2121,
1029,
22064,
22578,
1013,
10439,
999,
22064,
22578,
1013,
12098,
2290,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
//%LICENSE////////////////////////////////////////////////////////////////
//
// Licensed to The Open Group (TOG) under one or more contributor license
// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
// this work for additional information regarding copyright ownership.
// Each contributor licenses this file to you under the OpenPegasus Open
// Source License; you may not use this file except in compliance with the
// License.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////
//
//%/////////////////////////////////////////////////////////////////////////
#include "CIMFixtureBase.h"
class UNIX_ElementConfigurationFixture :
public CIMFixtureBase
{
public:
UNIX_ElementConfigurationFixture();
~UNIX_ElementConfigurationFixture();
virtual void Run();
};
| brunolauze/pegasus-providers | tests/UNIXProviders.Tests/UNIX_ElementConfigurationFixture.h | C | bsd-2-clause | 1,893 | [
30522,
1013,
1013,
1003,
6105,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* \file PrtValues.h
* \brief Functions and data structures for P values.
* Every P value is a combination of a type expression and an in-memory representation
* of the value. The type expression cannot be `any`, but `any` may appear as an inner type.
* Here are some examples:
*
* `true : bool`, `1 : int`, `null : event`, `null : id`, `(1, 2) : (any, int)`.
*
* The type a value does not change under mutation, and the inner-types of an expression
* constrain the legal mutations of a value. For instance, it is illegal to update `(1, 2) : (any, int)` to become
* `(1, true) : (any, int)` because the second element in the tuple must be an integer.
* Also note that values contained in complex data types may have more specific type information. For instance,
* the value obtained by reading the first element of `(1, true) : (any, int)` is `1 : int`.
*/
#ifndef PRTVALUES_H
#define PRTVALUES_H
#include "PrtTypes.h"
#ifdef __cplusplus
extern "C" {
#endif
/** Structure for representing a standard GUID */
#pragma pack()
typedef struct PRT_GUID
{
PRT_UINT32 data1; /**< 0 First data field (32 bits) */
PRT_UINT16 data2; /**< 0 Second data field (16 bits) */
PRT_UINT16 data3; /**< 0 Third data field (16 bits) */
PRT_UINT64 data4; /**< 0 Fourth data field (64 bits) */
} PRT_GUID;
typedef enum PRT_SPECIAL_EVENT
{
PRT_SPECIAL_EVENT_NULL = 0,
/**< The id of the null event */
PRT_SPECIAL_EVENT_HALT = 1,
/**< The id of the halt event */
PRT_EVENT_USER_START = 2 /**< The first event id available to user code */
} PRT_SPECIAL_EVENT;
/**
* \enum
* These are the kinds of values in the P type system.
**/
typedef enum PRT_VALUE_KIND
{
PRT_VALUE_KIND_NULL = 0,
/**< The kind of the null value in type null */
PRT_VALUE_KIND_BOOL = 1,
/**< The kind of bool values */
PRT_VALUE_KIND_INT = 2,
/**< The kind of int values */
PRT_VALUE_KIND_FLOAT = 3,
/**< The kind of int values */
PRT_VALUE_KIND_STRING = 4,
/**< The kind of string values */
PRT_VALUE_KIND_EVENT = 5,
/**< The kind of event id values */
PRT_VALUE_KIND_MID = 6,
/**< The kind of machine id values */
PRT_VALUE_KIND_FOREIGN = 7,
/**< The kind of all foreign values */
PRT_VALUE_KIND_TUPLE = 8,
/**< The kind of all (named) tuple values */
PRT_VALUE_KIND_SEQ = 9,
/**< The kind of all sequence values */
PRT_VALUE_KIND_SET = 10,
/**< The kind of all set values */
PRT_VALUE_KIND_MAP = 11,
/**< The kind of all map values */
PRT_VALUE_KIND_COUNT = 12,
/**< The number of value kinds */
} PRT_VALUE_KIND;
/** A Union type to discriminate the Prt value */
typedef struct PRT_VALUE
{
PRT_VALUE_KIND discriminator; /**< A value kind to discriminate the union */
union
{
PRT_BOOLEAN bl; /**< A boolean value */
PRT_INT nt; /**< An integer value */
PRT_FLOAT ft; /**< An float value */
PRT_STRING str; /*< A string value */
PRT_UINT32 ev; /**< An event id value */
struct PRT_MACHINEID* mid; /**< A machine id value */
struct PRT_FOREIGNVALUE* frgn; /**< A foreign value */
struct PRT_TUPVALUE* tuple; /**< A (named) tuple value */
struct PRT_SEQVALUE* seq; /**< A sequence value */
struct PRT_SETVALUE* set; /**< A set value */
struct PRT_MAPVALUE* map; /**< A map value */
} valueUnion;
} PRT_VALUE;
/** The id of a machine is a combination of the id of the owner process and an id unique to that process.
*/
typedef struct PRT_MACHINEID
{
PRT_GUID processId;
PRT_UINT32 machineId;
} PRT_MACHINEID;
/** A set value is represented as a hash-table. */
typedef struct PRT_SETVALUE
{
PRT_UINT32 size; /**< The number of elements in the set. */
PRT_UINT32 capNum; /**< An opaque number related to the number of buckets */
struct PRT_SETNODE* first; /**< First element inserted into the set. */
struct PRT_SETNODE* last; /**< Last element inserted into the set. */
struct PRT_SETNODE** buckets; /**< An array of pointers to chained nodes. */
} PRT_SETVALUE;
/** A key-value node of a map. */
typedef struct PRT_SETNODE
{
PRT_VALUE* item; /**< The key of this node. */
struct PRT_SETNODE* bucketNext; /**< The next node in this bucket. */
struct PRT_SETNODE* insertNext; /**< The next node in insertion order. */
struct PRT_SETNODE* insertPrev; /**< The previous node in insertion order. */
} PRT_SETNODE;
/** Adds item to set.
* If item is not in the set, then adds it.
* If item is already in the set, then ignores it.
* @param[in,out] set A set to mutate.
* @param[in] item The item to add.
* @param[in] cloneItem Only set to PRT_FALSE if item will be forever owned by this set.
*/
PRT_API void PRT_CALL_CONV PrtSetAddEx(
_Inout_ PRT_VALUE* set,
_In_ PRT_VALUE* item,
_In_ PRT_BOOLEAN cloneIey);
/** Adds item to set.
* If key is not in the set, then adds it.
* If key is already in the set, then ignores it.
* @param[in,out] set A set to mutate.
* @param[in] item The item to add (will be cloned).
*/
PRT_API void PRT_CALL_CONV PrtSetAdd(
_Inout_ PRT_VALUE* set,
_In_ PRT_VALUE* item);
/** Remove the item from the set.
* If the key is not in then set, then the set is unchanged.
* @param[in,out] set A set to mutate.
* @param[in] item The item to remove.
*/
PRT_API void PRT_CALL_CONV PrtSetRemove(
_Inout_ PRT_VALUE* set,
_In_ PRT_VALUE* item);
/** Returns true if the set contains item; false otherwise.
* @param[in] set A set.
* @param[in] item The item to lookup.
* @returns Returns true if the set contains item; false otherwise.
*/
PRT_API PRT_BOOLEAN PRT_CALL_CONV PrtSetExists(
_In_ PRT_VALUE* set,
_In_ PRT_VALUE* item);
/** Gets the size of a set.
* @param[in] set A set.
* @returns The size of the set.
*/
PRT_API PRT_UINT32 PRT_CALL_CONV PrtSetSizeOf(_In_ PRT_VALUE* set);
/** The hypothetical maximum number of items that could be accessed in constant-time.
* @param[in] set A set.
* @returns The capacity of the set.
*/
PRT_API PRT_UINT32 PRT_CALL_CONV PrtSetCapacity(_In_ PRT_VALUE* set);
/** A tuple value is a (named) tuple represented as an array. */
typedef struct PRT_TUPVALUE
{
PRT_UINT32 size;
PRT_VALUE** values; /**< Is an array of tuple args. */
} PRT_TUPVALUE;
/** A sequence value is a sequence represented as a dynamic array. */
typedef struct PRT_SEQVALUE
{
PRT_UINT32 size; /**< The number of elements in the sequence. */
PRT_UINT32 capacity; /**< The number of elements before resizing */
PRT_VALUE** values; /**< An array of values in the sequence. */
} PRT_SEQVALUE;
/** A map value is represented as a hash-table. */
typedef struct PRT_MAPVALUE
{
PRT_UINT32 size; /**< The number of elements in the map. */
PRT_UINT32 capNum; /**< An opaque number related to the number of buckets */
struct PRT_MAPNODE* first; /**< First element inserted into the map. */
struct PRT_MAPNODE* last; /**< Last element inserted into the map. */
struct PRT_MAPNODE** buckets; /**< An array of pointers to chained nodes. */
} PRT_MAPVALUE;
/** A key-value node of a map. */
typedef struct PRT_MAPNODE
{
PRT_VALUE* key; /**< The key of this node. */
PRT_VALUE* value; /**< The value of this node. */
struct PRT_MAPNODE* bucketNext; /**< The next node in this bucket. */
struct PRT_MAPNODE* insertNext; /**< The next node in insertion order. */
struct PRT_MAPNODE* insertPrev; /**< The previous node in insertion order. */
} PRT_MAPNODE;
/** A foreign value is foreign type paired with a char *. */
typedef struct PRT_FOREIGNVALUE
{
PRT_UINT32 typeTag; /**< The index of the foreign type. */
PRT_UINT64 value; /**< The foreign value. */
} PRT_FOREIGNVALUE;
/** Makes a default value of an arbitrary type. The defaults (def) are as follows:
* 1. def(null) = `null : null`.
* 2. def(any) = `null : null`.
* 3. def(bool) = `false : bool`.
* 4. def(string) = `"" : string`.
* 5. def(event) = `null : event`.
* 6. def(foreign) = `MkDef_foreign_IMPL() : foreign`.
* 7. def(machine) = `null : machine`.
* 8. def(int) = `0 : int`.
* 9. def(map[S, T]) = `[] : map[S, T]`.
* 10. def(set[S]) = `[] : set[S, T]`.
* 11. def((l1: S1,.., ln: Sn)) = `(l1 = def(S1),..., ln = def(Sn)) : (l1: S1,..., ln: Sn)`.
* 12. def([S]) = `[] : [S]`.
* 13. def((S1,..,Sn)) = `(def(S1),..., def(S2)) : (S1,..., Sn)`.
* @param[in] type A type expression (will be cloned).
* @returns The default value of the type. Caller is responsible for freeing.
* @see PrtFreeValue
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMkDefaultValue(_In_ PRT_TYPE* type);
/** Makes a boolean value.
* @param[in] value A boolean value.
* @returns A proper boolean value. Caller is responsible for freeing.
* @see PrtFreeValue
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMkBoolValue(_In_ PRT_BOOLEAN value);
/** Makes an event value.
* @param[in] value An event id.
* @returns A proper event value. Caller is responsible for freeing.
* @see PrtFreeValue
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMkEventValue(_In_ PRT_UINT32 value);
/** Makes an integer value.
* @param[in] value An int value.
* @returns A proper int value. Caller is responsible for freeing.
* @see PrtFreeValue
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMkIntValue(_In_ PRT_INT value);
/** Makes an float value.
* @param[in] value A float value.
* @returns A proper float value. Caller is responsible for freeing.
* @see PrtFreeValue
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMkFloatValue(_In_ PRT_FLOAT value);
/** Makes an string value.
* @param[in] value A string value.
* @returns A proper string value. Caller is responsible for freeing.
* @see PrtFreeValue
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMkStringValue(_In_ PRT_STRING value);
/** Makes null value.
* The types null, event, and machine all share the null value.
* The null value projected onto event is the id PRT_SPECIAL_EVENT_NULL.
* The null value projected onto machine is the processId 0-0-0-0 with machineId PRT_SPECIAL_EVENT_NULL.
* @returns A proper null value. Caller is responsible for freeing.
* @see PrtFreeValue
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMkNullValue(void);
/** Makes an machine value.
* @param[in] value A machine id.
* @returns A proper machine value. Caller is responsible for freeing.
* @see PrtFreeValue
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMkMachineValue(_In_ PRT_MACHINEID value);
/** Makes a foreign value.
* @param[in] value A pointer to foreign data (will be cloned).
* @param[in] type The foreign type.
* @returns A proper foreign value. Caller is responsible for freeing.
* @see PrtFreeValue
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMkForeignValue(_In_ PRT_UINT64 value, _In_ PRT_TYPE* type);
/** Gets foreign data inside a value.
* @param[in] v A pointer to a value.
* @returns The (uncloned) foreign data inside v.
*/
PRT_API PRT_UINT64 PrtGetForeignValue(_In_ PRT_VALUE* v);
/** Sets the value of a boolean.
* @param[in,out] prmVal A primitive boolean value to mutate.
* @param[in] value The value to set.
*/
PRT_API void PRT_CALL_CONV PrtPrimSetBool(_Inout_ PRT_VALUE* prmVal, _In_ PRT_BOOLEAN value);
/** Gets the value of a boolean.
* @param[in] prmVal A primitive boolean value.
* @returns A boolean.
*/
PRT_API PRT_BOOLEAN PRT_CALL_CONV PrtPrimGetBool(_In_ PRT_VALUE* prmVal);
/** Sets the value of a string.
* @param[in,out] prmVal A primitive string value to mutate.
* @param[in] value The value to set.
*/
PRT_API void PRT_CALL_CONV PrtPrimSetString(_Inout_ PRT_VALUE* prmVal, _In_ PRT_STRING value);
/** Gets the value of a string.
* @param[in] prmVal A primitive string value.
* @returns A string.
*/
PRT_API PRT_STRING PRT_CALL_CONV PrtPrimGetString(_In_ PRT_VALUE* prmVal);
/** Sets the value of an event.
* @param[in,out] prmVal A primitive event value to mutate.
* @param[in] value The value to set.
*/
PRT_API void PRT_CALL_CONV PrtPrimSetEvent(_Inout_ PRT_VALUE* prmVal, _In_ PRT_UINT32 value);
/** Gets the value of an event.
* @param[in] prmVal A primitive event value.
* @returns An event id.
*/
PRT_API PRT_UINT32 PRT_CALL_CONV PrtPrimGetEvent(_In_ PRT_VALUE* prmVal);
/** Sets the value of an int.
* @param[in,out] prmVal A primitive int value to mutate.
* @param[in] value The value to set.
*/
PRT_API void PRT_CALL_CONV PrtPrimSetInt(_Inout_ PRT_VALUE* prmVal, _In_ PRT_INT value);
/** Gets the value of an integer.
* @param[in] prmVal A primitive int value.
* @returns An integer.
*/
PRT_API PRT_INT PRT_CALL_CONV PrtPrimGetInt(_In_ PRT_VALUE* prmVal);
/** Sets the value of a float.
* @param[in,out] prmVal A primitive float value to mutate.
* @param[in] value The value to set.
*/
PRT_API void PRT_CALL_CONV PrtPrimSetFloat(_Inout_ PRT_VALUE* prmVal, _In_ PRT_FLOAT value);
/** Gets the value of a float.
* @param[in] prmVal A primitive float value.
* @returns An integer.
*/
PRT_API PRT_FLOAT PRT_CALL_CONV PrtPrimGetFloat(_In_ PRT_VALUE* prmVal);
/** Sets the value of an Machine.
* @param[in,out] prmVal A primitivemachinevalue to mutate.
* @param[in] value The value to set.
*/
PRT_API void PRT_CALL_CONV PrtPrimSetMachine(_Inout_ PRT_VALUE* prmVal, _In_ PRT_MACHINEID value);
/** Gets the value of an Machine.
* @param[in] prmVal A primitive machine value.
* @returns A machine machine
*/
PRT_API PRT_MACHINEID PRT_CALL_CONV PrtPrimGetMachine(_In_ PRT_VALUE* prmVal);
/** Concatenates two strings.
* @param[in] str1 first input string.
* @param[in] str2 second input string.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtStringConcat(_In_ PRT_VALUE* str1, _In_ PRT_VALUE* str2);
/** Sets an element in a (named) tuple by index.
* @param[in,out] tuple A (named) tuple to mutate.
* @param[in] index A 0-based element index.
* @param[in] value The value to set (will be cloned).
*/
PRT_API void PRT_CALL_CONV PrtTupleSet(
_Inout_ PRT_VALUE* tuple,
_In_ PRT_UINT32 index,
_In_ PRT_VALUE* value);
/** Sets an element in a (named) tuple by index.
* @param[in,out] tuple A (named) tuple to mutate.
* @param[in] index A 0-based element index.
* @param[in] value The value to set (will be cloned if cloneValue is PRT_TRUE).
* @param[in] cloneValue Only set to PRT_FALSE if value will be forever owned by this tuple.
*/
PRT_API void PRT_CALL_CONV PrtTupleSetEx(
_Inout_ PRT_VALUE* tuple,
_In_ PRT_UINT32 index,
_In_ PRT_VALUE* value,
_In_ PRT_BOOLEAN cloneValue);
/** Gets an element in a (named) tuple without cloning. Only used for internal manipulation of state variables.
* @param[in] tuple A (named) tuple.
* @param[in] index A 0-based element index.
* @returns The element at index i.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtTupleGetNC(
_In_ PRT_VALUE* tuple,
_In_ PRT_UINT32 index);
/** Gets a pointer to the element in a (named) tuple. Only used for internal manipulation of state variables.
* @param[in] tuple A (named) tuple.
* @param[in] index A 0-based element index.
* @returns The pointer to element at index i.
*/
PRT_API PRT_VALUE** PRT_CALL_CONV PrtTupleGetLValue(
_In_ PRT_VALUE* tuple,
_In_ PRT_UINT32 index);
/** Gets an element in a sequence without cloning. Only used for internal manipulation of state variables.
* @param[in] seq A sequence.
* @param[in] index A 0-based index s.t. 0 <= index < size(seq).
* @returns The value at index.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtSeqGetNC(
_In_ PRT_VALUE* seq,
_In_ PRT_VALUE* index);
/** Gets a pointer to an element in a sequence. Only used for internal manipulation of state variables.
* @param[in] seq A sequence.
* @param[in] index A 0-based index s.t. 0 <= index < size(seq).
* @returns The pointer to the value at index.
*/
PRT_API PRT_VALUE** PRT_CALL_CONV PrtSeqGetLValue(
_In_ PRT_VALUE* seq,
_In_ PRT_VALUE* index);
/** Gets a value from a map without cloning. Only used for internal manipulation of state variables.
* The key must be present the map.
* @param[in] map A map.
* @param[in] key The key to lookup.
* @returns The value to which the key maps.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMapGetNC(
_In_ PRT_VALUE* map,
_In_ PRT_VALUE* key);
/** Gets an element in a (named) tuple by index.
* @param[in] tuple A (named) tuple.
* @param[in] index A 0-based element index.
* @returns The element at index i. Caller is responsible for freeing.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtTupleGet(
_In_ PRT_VALUE* tuple,
_In_ PRT_UINT32 index);
/** Returns true if the seq contains value; false otherwise.
* @param[in] seq A Seq.
* @param[in] val The value to lookup.
* @returns Returns true if the seq contains key; false otherwise.
*/
PRT_API PRT_BOOLEAN PRT_CALL_CONV PrtSeqExists(
_In_ PRT_VALUE* seq,
_In_ PRT_VALUE* val);
/** Updates the sequence at index.
* @param[in,out] seq A sequence to mutate.
* @param[in] index The name of the element to set. A value must already exist at this index.
* @param[in] value The value to store at index (will be cloned).
*/
PRT_API void PRT_CALL_CONV PrtSeqUpdate(
_Inout_ PRT_VALUE* seq,
_In_ PRT_VALUE* index,
_In_ PRT_VALUE* value);
/** Updates the sequence at index.
* @param[in,out] seq A sequence to mutate.
* @param[in] index The name of the element to set. A value must already exist at this index.
* @param[in] value The value to store at index (will be cloned if cloneValue is PRT_TRUE).
* @param[in] cloneValue Only set to PRT_FALSE if value will be forever owned by this seq.
*/
PRT_API void PRT_CALL_CONV PrtSeqUpdateEx(
_Inout_ PRT_VALUE* seq,
_In_ PRT_VALUE* index,
_In_ PRT_VALUE* value,
_In_ PRT_BOOLEAN cloneValue);
/** Inserts value into the sequence at index.
* Index cannot be larger than the size of the sequence. Insertion causes:
* seq'[index] = value.
* For all i >= index, if seq[i] is defined, then seq'[i + 1] = seq[i].
* For all i < index, if seq[i] is defined, then seq'[i] = seq[i].
* @param[in,out] seq A sequence to mutate.
* @param[in] index An 0-based index s.t. 0 <= index <= size(seq).
* @param[in] value The value to store at index (will be cloned).
*/
PRT_API void PRT_CALL_CONV PrtSeqInsert(
_Inout_ PRT_VALUE* seq,
_In_ PRT_VALUE* index,
_In_ PRT_VALUE* value);
/** Inserts value into the sequence at index.
* Index cannot be larger than the size of the sequence. Insertion causes:
* seq'[index] = value.
* For all i >= index, if seq[i] is defined, then seq'[i + 1] = seq[i].
* For all i < index, if seq[i] is defined, then seq'[i] = seq[i].
* @param[in,out] seq A sequence to mutate.
* @param[in] index An 0-based index s.t. 0 <= index <= size(seq).
* @param[in] value The value to store at index (will be cloned if cloneValue is PRT_TRUE).
* @param[in] cloneValue Only set to PRT_FALSE if value will be forever owned by this seq.
*/
PRT_API void PRT_CALL_CONV PrtSeqInsertEx(
_Inout_ PRT_VALUE* seq,
_In_ PRT_VALUE* index,
_In_ PRT_VALUE* value,
_In_ PRT_BOOLEAN cloneValue);
/** Inserts value into the sequence at index.
* Index cannot be larger than the size of the sequence. Insertion causes:
* seq'[index] = value.
* For all i >= index, if seq[i] is defined, then seq'[i + 1] = seq[i].
* For all i < index, if seq[i] is defined, then seq'[i] = seq[i].
* @param[in,out] seq A sequence to mutate.
* @param[in] index An 0-based index s.t. 0 <= index <= size(seq).
* @param[in] value The value to store at index (will be cloned if cloneValue is PRT_TRUE).
* @param[in] cloneValue Only set to PRT_FALSE if value will be forever owned by this seq.
*/
PRT_API void PRT_CALL_CONV PrtSeqInsertExIntIndex(
_Inout_ PRT_VALUE* seq,
_In_ PRT_INT index,
_In_ PRT_VALUE* value,
_In_ PRT_BOOLEAN cloneValue);
/** Gets the sequence at index.
* @param[in] seq A sequence.
* @param[in] index A 0-based index s.t. 0 <= index < size(seq).
* @returns The value at index (clones). Caller is responsible for freeing.
*/
PRT_API PRT_VALUE** PrtSeqGetNCIntIndex(
_In_ PRT_VALUE* seq,
_In_ PRT_INT index);
/** Removes the value at index from the sequence, and shortens the sequence by one.
* seq[index] must be defined. Removal causes:
* For all i > index, if seq[i] is defined, then seq'[i - 1] = seq[i].
* For all i < index, if seq[i] is defined, then seq'[i] = seq[i].
* @param[in,out] seq A sequence to mutate.
* @param[in] index An 0-based index s.t. 0 <= index < size(seq).
*/
PRT_API void PRT_CALL_CONV PrtSeqRemove(
_Inout_ PRT_VALUE* seq,
_In_ PRT_VALUE* index);
/** Gets the sequence at index.
* @param[in] seq A sequence.
* @param[in] index A 0-based index s.t. 0 <= index < size(seq).
* @returns The value at index (clones). Caller is responsible for freeing.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtSeqGet(
_In_ PRT_VALUE* seq,
_In_ PRT_VALUE* index);
/** Gets the size of a sequence.
* @param[in] seq A sequence.
* @returns The size of the sequence.
*/
PRT_API PRT_UINT32 PRT_CALL_CONV PrtSeqSizeOf(_In_ PRT_VALUE* seq);
/** Updates the map at key.
* If key is not in the map, then adds it.
* If key is already in the map, then changes its mapping.
* @param[in,out] map A map to mutate.
* @param[in] key The key to update (will be cloned if cloneKey is PRT_TRUE).
* @param[in] cloneKey Only set to false if key will be forever owned by this map.
* @param[in] value The value to which the key maps (will be cloned if cloneValue is PRT_TRUE).
* @param[in] cloneValue Only set to PRT_FALSE if value will be forever owned by this map.
*/
PRT_API void PRT_CALL_CONV PrtMapUpdateEx(
_Inout_ PRT_VALUE* map,
_In_ PRT_VALUE* key,
_In_ PRT_BOOLEAN cloneKey,
_In_ PRT_VALUE* value,
_In_ PRT_BOOLEAN cloneValue);
/** Returns a pointer to the value at key location in the map.
* If key is not in the map, then stores a NULL value and returns a pointer to it.
* If key is already in the map, then returns a pointer to the mapped value.
* @param[in,out] map A map to mutate.
* @param[in] key The key to update (will be cloned if cloneKey is PRT_TRUE).
* @param[in] cloneKey Only set to false if key will be forever owned by this map.
*/
PRT_API PRT_VALUE** PRT_CALL_CONV PrtMapGetLValue(
_Inout_ PRT_VALUE* map,
_In_ PRT_VALUE* key,
_In_ PRT_BOOLEAN cloneKey,
_In_ PRT_TYPE* mapType
);
/** Updates the map at key.
* If key is not in the map, then adds it.
* If key is already in the map, then changes its mapping.
* @param[in,out] map A map to mutate.
* @param[in] key The key to update (will be cloned).
* @param[in] value The value to which the key maps (will be cloned).
*/
PRT_API void PRT_CALL_CONV PrtMapUpdate(
_Inout_ PRT_VALUE* map,
_In_ PRT_VALUE* key,
_In_ PRT_VALUE* value);
/** Remove the key from the map.
* If the key is not in then map, then the map is unchanged.
* @param[in,out] map A map to mutate.
* @param[in] key The key to remove.
*/
PRT_API void PRT_CALL_CONV PrtMapRemove(
_Inout_ PRT_VALUE* map,
_In_ PRT_VALUE* key);
/** Gets the value to which this key maps.
* The key must be present the map.
* @param[in] map A map.
* @param[in] key The key to lookup.
* @returns The value to which the key maps. Caller is responsible for freeing.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMapGet(
_In_ PRT_VALUE* map,
_In_ PRT_VALUE* key);
/** Converts a map to sequence of keys. Keys are returned in insertion order.
* @param[in] map A map.
* @returns The sequence of its keys. Caller is responsible for freeing.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMapGetKeys(_In_ PRT_VALUE* map);
/** Converts a map to sequence of values. values are returned in insertion order.
* @param[in] map A map.
* @returns The sequence of its values (map image). Caller is responsible for freeing.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMapGetValues(_In_ PRT_VALUE* map);
/** Returns true if the map contains key; false otherwise.
* @param[in] map A map.
* @param[in] key The key to lookup.
* @returns Returns true if the map contains key; false otherwise.
*/
PRT_API PRT_BOOLEAN PRT_CALL_CONV PrtMapExists(
_In_ PRT_VALUE* map,
_In_ PRT_VALUE* key);
/** Gets the size of a map.
* @param[in] map A map.
* @returns The size of the map.
*/
PRT_API PRT_UINT32 PRT_CALL_CONV PrtMapSizeOf(_In_ PRT_VALUE* map);
/** The hypothetical maximum number of keys that could be accessed in constant-time.
* @param[in] map A map.
* @returns The capacity of the map.
*/
PRT_API PRT_UINT32 PRT_CALL_CONV PrtMapCapacity(_In_ PRT_VALUE* map);
/** Determines if value inhabits type.
* @param[in] value The value to check.
* @param[in] type The type to check.
* @returns `true` if value inhabits type, `false` otherwise.
*/
PRT_API PRT_BOOLEAN PRT_CALL_CONV PrtInhabitsType(_In_ PRT_VALUE* value, _In_ PRT_TYPE* type);
/** Determines if value is a null event or machine id.
* @param[in] value The value to check.
* @returns `true` if the null value, `false` otherwise.
*/
PRT_API PRT_BOOLEAN PRT_CALL_CONV PrtIsNullValue(_In_ PRT_VALUE* value);
/** Casts value to type.
* Caller must know that type cast will succeed.
* Method checks validity of type cast and causes an assertion failure if the case is invalid.
* @param[in] value The value to cast (will be cloned).
* @param[in] type The type to cast (will be cloned).
* @returns A copy of value that is a subtype of type. Caller is responsible for freeing.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtCastValue(_In_ PRT_VALUE* value, _In_ PRT_TYPE* type);
/** Converts value to type.
* Caller must know that type convert will succeed.
* Method checks validity of type conversion and causes an assertion failure if the case is invalid.
* @param[in] value The value to convert (will be cloned).
* @param[in] type The type to convert (will be cloned).
* @returns A converted value that is a subtype of type. Caller is responsible for freeing.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtConvertValue(_In_ PRT_VALUE* value, _In_ PRT_TYPE* type);
/** Returns a hash of this value.
* @param[in] value The value to hash.
* @returns The hash code.
*/
PRT_API PRT_UINT32 PRT_CALL_CONV PrtGetHashCodeValue(_In_ PRT_VALUE* value);
/** Removes the value at index from the sequence, and shortens the sequence by one.
* seq[index] must be defined. Removal causes:
* For all i > index, if seq[i] is defined, then seq'[i - 1] = seq[i].
* For all i < index, if seq[i] is defined, then seq'[i] = seq[i].
* @param[in,out] seq A sequence to mutate.
* @param[in] index An 0-based index s.t. 0 <= index < size(seq).
*/
PRT_API void PRT_CALL_CONV PrtRemoveByKey(_Inout_ PRT_VALUE* mapOrSeq, _In_ PRT_VALUE* key);
/** Returns `true` if values are equivalent; `false` otherwise.
* @param[in] value1 The first value.
* @param[in] value2 The second value.
* @returns `true` if values are equivalent; `false` otherwise.
*/
PRT_API PRT_BOOLEAN PRT_CALL_CONV PrtIsEqualValue(
_In_ PRT_VALUE* value1,
_In_ PRT_VALUE* value2);
/** Deeply clones a value.
* @param[in] value The value to clone.
* @returns The cloned value. Caller is responsible for freeing.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtCloneValue(_In_ PRT_VALUE* value);
/** Recursively frees a value. Should only be called on values created using PrtMkXValue()
* @param[in,out] value The value to free.
*/
PRT_API void PRT_CALL_CONV PrtFreeValue(_Inout_ PRT_VALUE* value);
/** Shallow test that value members are non-null.
* @param[in] value The value to check.
*/
PRT_API PRT_BOOLEAN PRT_CALL_CONV PrtIsValidValue(_In_ PRT_VALUE* value);
/** Nondeterministic Boolean choice
* @returns A nondeterministic Boolean value. Caller is responsible for freeing.
*/
PRT_API PRT_VALUE* PRT_CALL_CONV PrtMkNondetBoolValue(void);
#ifdef __cplusplus
}
#endif
#endif
| p-org/P | Src/PRuntimes/PCRuntime/API/PrtValues.h | C | mit | 28,632 | [
30522,
1013,
1008,
1008,
1008,
1032,
5371,
10975,
9189,
2389,
15808,
1012,
1044,
1008,
1032,
4766,
4972,
1998,
2951,
5090,
2005,
1052,
5300,
1012,
1008,
2296,
1052,
3643,
2003,
1037,
5257,
1997,
1037,
2828,
3670,
1998,
2019,
1999,
1011,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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>
| jo-tham/org_text_miner | analysis.md | Markdown | gpl-3.0 | 12,738 | [
30522,
2131,
3223,
14555,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1036,
1036,
1036,
1054,
3075,
1006,
16475,
3406,
27896,
1007,
16500,
1012,
14555,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System.Collections.Generic;
using System.Net.Http;
using HyperLibrary.Core.Controllers;
using HyperLibrary.Core.LibraryModel;
using HyperLibrary.Core.Resources;
namespace HyperLibrary.Core.Queries
{
public class AllBooksQueryHandler
{
private readonly IInMemoryBookRepository _bookRepository;
private readonly BookResourceMapper _bookResourceMapper;
private readonly IResourceLinker _resourceLinker;
public AllBooksQueryHandler(IInMemoryBookRepository bookRepository,BookResourceMapper bookResourceMapper, IResourceLinker resourceLinker)
{
_bookRepository = bookRepository;
_bookResourceMapper = bookResourceMapper;
_resourceLinker = resourceLinker;
}
public BookCatalogResource Query()
{
var books = _bookRepository.GetAll();
BookCatalogResource resource = new BookCatalogResource();
resource.Self = _resourceLinker.GetResourceLink<BooksController>(request => request.Get(), "self","Library Catalog", HttpMethod.Get);
resource.Links = new List<Link>();
resource.Links.Add(_resourceLinker.GetResourceLink<RootController>(request => request.Get(),"home","Home",HttpMethod.Get));
resource.Catalog = new List<BookResource>();
foreach(var book in books)
{
resource.Catalog.Add(_bookResourceMapper.MapToResouce(book));
}
return resource;
}
}
} | ammeep/hyper-library | HyperLibrary.Core/Queries/AllBooksQueryHandler.cs | C# | mit | 1,539 | [
30522,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
5658,
1012,
8299,
1025,
2478,
23760,
29521,
19848,
2100,
1012,
4563,
1012,
21257,
1025,
2478,
23760,
29521,
19848,
2100,
1012,
4563,
1012,
3075,
5302,
9247,
1025,
2478,
237... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _css = require('antd/lib/message/style/css');
var _message = require('antd/lib/message');
var _message2 = _interopRequireDefault(_message);
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactDom = require('react-dom');
var _reactDom2 = _interopRequireDefault(_reactDom);
var _draftJsWhkfzyx = require('draft-js-whkfzyx');
var _decoratorStyle = require('./decoratorStyle.css');
var _decoratorStyle2 = _interopRequireDefault(_decoratorStyle);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var ImageSpan = function (_Component) {
_inherits(ImageSpan, _Component);
function ImageSpan(props) {
_classCallCheck(this, ImageSpan);
var _this = _possibleConstructorReturn(this, (ImageSpan.__proto__ || Object.getPrototypeOf(ImageSpan)).call(this, props));
var entity = _draftJsWhkfzyx.Entity.get(_this.props.entityKey);
var _entity$getData = entity.getData(),
width = _entity$getData.width,
height = _entity$getData.height;
_this.state = {
width: width,
height: height,
imageSrc: ''
};
_this.onImageClick = _this._onImageClick.bind(_this);
_this.onDoubleClick = _this._onDoubleClick.bind(_this);
return _this;
}
_createClass(ImageSpan, [{
key: 'componentDidMount',
value: function componentDidMount() {
var _this2 = this;
var _state = this.state,
width = _state.width,
height = _state.height;
var entity = _draftJsWhkfzyx.Entity.get(this.props.entityKey);
var image = new Image();
var _entity$getData2 = entity.getData(),
src = _entity$getData2.src;
src = src.replace(/[?#&].*$/g, "");
this.setState({ imageSrc: src });
image.src = this.state.imageSrc;
image.onload = function () {
if (width == null || height == null) {
_this2.setState({ width: image.width, height: image.height });
_draftJsWhkfzyx.Entity.mergeData(_this2.props.entityKey, {
width: image.width,
height: image.height,
originalWidth: image.width,
originalHeight: image.height
});
}
};
}
}, {
key: 'render',
value: function render() {
var _this3 = this;
var _state2 = this.state,
width = _state2.width,
height = _state2.height;
var key = this.props.entityKey;
var entity = _draftJsWhkfzyx.Entity.get(key);
var _entity$getData3 = entity.getData(),
src = _entity$getData3.src;
var imageStyle = {
verticalAlign: 'bottom',
backgroundImage: 'url("' + this.state.imageSrc + '")',
backgroundSize: width + 'px ' + height + 'px',
lineHeight: height + 'px',
fontSize: height + 'px',
width: width,
height: height,
letterSpacing: width
};
return _react2.default.createElement(
'div',
{ className: 'editor-inline-image', onClick: this._onClick },
_react2.default.createElement('img', { src: '' + this.state.imageSrc, className: 'media-image', onClick: function onClick(event) {
_this3.onImageClick(event, key);event.stopPropagation();
}, onDoubleClick: this.onDoubleClick })
);
}
}, {
key: '_onDoubleClick',
value: function _onDoubleClick() {
var currentPicture = _reactDom2.default.findDOMNode(this).querySelector("img");
var pictureWidth = currentPicture.naturalWidth;
var pictureSrc = currentPicture.src;
}
}, {
key: '_onImageClick',
value: function _onImageClick(e, key) {
var currentPicture = _reactDom2.default.findDOMNode(this).querySelector("img");
var pictureWidth = currentPicture.naturalWidth;
var editorState = _draftJsWhkfzyx.EditorState.createEmpty();
var selection = editorState.getSelection();
var blockTree = editorState.getBlockTree(this.props.children[0].key);
if (pictureWidth == 0) {
_message2.default.error("图片地址错误!");
} else if (pictureWidth > 650) {
_message2.default.error("图片尺寸过大将会导致用户流量浪费!请调整至最大650px。", 10);
}
}
}, {
key: '_handleResize',
value: function _handleResize(event, data) {
var _data$size = data.size,
width = _data$size.width,
height = _data$size.height;
this.setState({ width: width, height: height });
_draftJsWhkfzyx.Entity.mergeData(this.props.entityKey, { width: width, height: height });
}
}]);
return ImageSpan;
}(_react.Component);
exports.default = ImageSpan;
ImageSpan.defaultProps = {
children: null,
entityKey: "",
className: ""
}; | WHKFZYX-Tool/react-lz-editor-whkfzyx | publish/editor/decorators/ImageSpan.js | JavaScript | mit | 6,306 | [
30522,
1005,
2224,
9384,
1005,
1025,
4874,
1012,
9375,
21572,
4842,
3723,
1006,
14338,
1010,
1000,
1035,
1035,
9686,
5302,
8566,
2571,
1000,
1010,
1063,
3643,
1024,
2995,
1065,
1007,
1025,
13075,
1035,
20116,
2015,
1027,
5478,
1006,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# whistle
iOS swfit APP
| midoks/Swift-Learning | whistle/README.md | Markdown | apache-2.0 | 24 | [
30522,
1001,
13300,
16380,
25430,
8873,
2102,
10439,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# -*- coding: utf-8 -*-
class Slot(object):
"""
To use comb, you should create a python module file. we named *slot*.
A legal slot must be named 'Slot' in your module file and it must be at least contain four method:
* `initialize`
initial resource, e.g: database handle
* `__enter__`
get next data to do,you can fetch one or more data.
* `slot`
user custom code
* `__exit__`
when slot finished, call this method
"""
def __init__(self, combd):
"""Don't override this method unless what you're doing.
"""
self.threads_num = combd.threads_num
self.sleep = combd.sleep
self.sleep_max = combd.sleep_max
self.debug = combd.debug
self.combd = combd
self.initialize()
def initialize(self):
"""Hook for subclass initialization.
This block is execute before thread initial
Example::
class UserSlot(Slot):
def initialize(self):
self.threads_num = 10
def slot(self, result):
...
"""
pass
def __enter__(self):
"""You **MUST** return False when no data to do.
The return value will be used in `Slot.slot`
"""
print("You should override __enter__ method by subclass")
return False
def __exit__(self, exc_type, exc_val, exc_tb):
"""When slot done, will call this method.
"""
print("You should override __exit__ method by subclass")
pass
def slot(self, msg):
"""
Add your custom code at here.
For example, look at:
* `comb.demo.list`
* `comb.demo.mongo`
* `comb.demo.redis`
"""
pass
# @staticmethod
# def options():
# """
# replace this method if you want add user options
# :return:
# """
# return ()
# pass
| nextoa/comb | comb/slot.py | Python | mit | 2,027 | [
30522,
1001,
1011,
1008,
1011,
16861,
1024,
21183,
2546,
1011,
1022,
1011,
1008,
1011,
2465,
10453,
1006,
4874,
1007,
1024,
1000,
1000,
1000,
2000,
2224,
22863,
1010,
2017,
2323,
3443,
1037,
18750,
11336,
5371,
1012,
2057,
2315,
1008,
10453... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package redis.clients.jedis;
import static redis.clients.jedis.Protocol.toByteArray;
import java.io.Closeable;
import java.net.URI;
import java.util.AbstractMap;
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import redis.clients.jedis.BinaryClient.LIST_POSITION;
import redis.clients.jedis.commands.*;
import redis.clients.jedis.exceptions.InvalidURIException;
import redis.clients.jedis.exceptions.JedisDataException;
import redis.clients.jedis.exceptions.JedisException;
import redis.clients.jedis.params.set.SetParams;
import redis.clients.jedis.params.sortedset.ZAddParams;
import redis.clients.jedis.params.sortedset.ZIncrByParams;
import redis.clients.util.JedisByteHashMap;
import redis.clients.util.JedisURIHelper;
import redis.clients.util.SafeEncoder;
public class BinaryJedis implements BasicCommands, BinaryJedisCommands, MultiKeyBinaryCommands,
AdvancedBinaryJedisCommands, BinaryScriptingCommands, Closeable {
protected Client client = null;
protected Transaction transaction = null;
protected Pipeline pipeline = null;
public BinaryJedis() {
client = new Client();
}
public BinaryJedis(final String host) {
URI uri = URI.create(host);
if (uri.getScheme() != null && uri.getScheme().equals("redis")) {
initializeClientFromURI(uri);
} else {
client = new Client(host);
}
}
public BinaryJedis(final String host, final int port) {
client = new Client(host, port);
}
public BinaryJedis(final String host, final int port, final int timeout) {
client = new Client(host, port);
client.setConnectionTimeout(timeout);
client.setSoTimeout(timeout);
}
public BinaryJedis(final String host, final int port, final int connectionTimeout,
final int soTimeout) {
client = new Client(host, port);
client.setConnectionTimeout(connectionTimeout);
client.setSoTimeout(soTimeout);
}
public BinaryJedis(final JedisShardInfo shardInfo) {
client = new Client(shardInfo.getHost(), shardInfo.getPort());
client.setConnectionTimeout(shardInfo.getConnectionTimeout());
client.setSoTimeout(shardInfo.getSoTimeout());
client.setPassword(shardInfo.getPassword());
client.setDb(shardInfo.getDb());
}
public BinaryJedis(URI uri) {
initializeClientFromURI(uri);
}
public BinaryJedis(final URI uri, final int timeout) {
initializeClientFromURI(uri);
client.setConnectionTimeout(timeout);
client.setSoTimeout(timeout);
}
public BinaryJedis(final URI uri, final int connectionTimeout, final int soTimeout) {
initializeClientFromURI(uri);
client.setConnectionTimeout(connectionTimeout);
client.setSoTimeout(soTimeout);
}
private void initializeClientFromURI(URI uri) {
if (!JedisURIHelper.isValid(uri)) {
throw new InvalidURIException(String.format(
"Cannot open Redis connection due invalid URI. %s", uri.toString()));
}
client = new Client(uri.getHost(), uri.getPort());
String password = JedisURIHelper.getPassword(uri);
if (password != null) {
client.auth(password);
client.getStatusCodeReply();
}
int dbIndex = JedisURIHelper.getDBIndex(uri);
if (dbIndex > 0) {
client.select(dbIndex);
client.getStatusCodeReply();
client.setDb(dbIndex);
}
}
@Override
public String ping() {
checkIsInMultiOrPipeline();
client.ping();
return client.getStatusCodeReply();
}
/**
* Set the string value as value of the key. The string can't be longer than 1073741824 bytes (1
* GB).
* <p>
* Time complexity: O(1)
* @param key
* @param value
* @return Status code reply
*/
@Override
public String set(final byte[] key, final byte[] value) {
checkIsInMultiOrPipeline();
client.set(key, value);
return client.getStatusCodeReply();
}
/**
* Set the string value as value of the key. The string can't be longer than 1073741824 bytes (1
* GB).
* @param key
* @param value
* @param params
* @return Status code reply
*/
public String set(final byte[] key, final byte[] value, final SetParams params) {
checkIsInMultiOrPipeline();
client.set(key, value, params);
return client.getStatusCodeReply();
}
/**
* Get the value of the specified key. If the key does not exist the special value 'nil' is
* returned. If the value stored at key is not a string an error is returned because GET can only
* handle string values.
* <p>
* Time complexity: O(1)
* @param key
* @return Bulk reply
*/
@Override
public byte[] get(final byte[] key) {
checkIsInMultiOrPipeline();
client.get(key);
return client.getBinaryBulkReply();
}
/**
* Ask the server to silently close the connection.
*/
@Override
public String quit() {
checkIsInMultiOrPipeline();
client.quit();
String quitReturn = client.getStatusCodeReply();
client.disconnect();
return quitReturn;
}
/**
* Test if the specified keys exist. The command returns the number of keys existed Time
* complexity: O(N)
* @param keys
* @return Integer reply, specifically: an integer greater than 0 if one or more keys existed 0 if
* none of the specified keys existed
*/
public Long exists(final byte[]... keys) {
checkIsInMultiOrPipeline();
client.exists(keys);
return client.getIntegerReply();
}
/**
* Test if the specified key exists. The command returns "1" if the key exists, otherwise "0" is
* returned. Note that even keys set with an empty string as value will return "1". Time
* complexity: O(1)
* @param key
* @return Boolean reply, true if the key exists, otherwise false
*/
@Override
public Boolean exists(final byte[] key) {
checkIsInMultiOrPipeline();
client.exists(key);
return client.getIntegerReply() == 1;
}
/**
* Remove the specified keys. If a given key does not exist no operation is performed for this
* key. The command returns the number of keys removed. Time complexity: O(1)
* @param keys
* @return Integer reply, specifically: an integer greater than 0 if one or more keys were removed
* 0 if none of the specified key existed
*/
@Override
public Long del(final byte[]... keys) {
checkIsInMultiOrPipeline();
client.del(keys);
return client.getIntegerReply();
}
@Override
public Long del(final byte[] key) {
checkIsInMultiOrPipeline();
client.del(key);
return client.getIntegerReply();
}
/**
* Return the type of the value stored at key in form of a string. The type can be one of "none",
* "string", "list", "set". "none" is returned if the key does not exist. Time complexity: O(1)
* @param key
* @return Status code reply, specifically: "none" if the key does not exist "string" if the key
* contains a String value "list" if the key contains a List value "set" if the key
* contains a Set value "zset" if the key contains a Sorted Set value "hash" if the key
* contains a Hash value
*/
@Override
public String type(final byte[] key) {
checkIsInMultiOrPipeline();
client.type(key);
return client.getStatusCodeReply();
}
/**
* Delete all the keys of the currently selected DB. This command never fails.
* @return Status code reply
*/
@Override
public String flushDB() {
checkIsInMultiOrPipeline();
client.flushDB();
return client.getStatusCodeReply();
}
/**
* Returns all the keys matching the glob-style pattern as space separated strings. For example if
* you have in the database the keys "foo" and "foobar" the command "KEYS foo*" will return
* "foo foobar".
* <p>
* Note that while the time complexity for this operation is O(n) the constant times are pretty
* low. For example Redis running on an entry level laptop can scan a 1 million keys database in
* 40 milliseconds. <b>Still it's better to consider this one of the slow commands that may ruin
* the DB performance if not used with care.</b>
* <p>
* In other words this command is intended only for debugging and special operations like creating
* a script to change the DB schema. Don't use it in your normal code. Use Redis Sets in order to
* group together a subset of objects.
* <p>
* Glob style patterns examples:
* <ul>
* <li>h?llo will match hello hallo hhllo
* <li>h*llo will match hllo heeeello
* <li>h[ae]llo will match hello and hallo, but not hillo
* </ul>
* <p>
* Use \ to escape special chars if you want to match them verbatim.
* <p>
* Time complexity: O(n) (with n being the number of keys in the DB, and assuming keys and pattern
* of limited length)
* @param pattern
* @return Multi bulk reply
*/
@Override
public Set<byte[]> keys(final byte[] pattern) {
checkIsInMultiOrPipeline();
client.keys(pattern);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
/**
* Return a randomly selected key from the currently selected DB.
* <p>
* Time complexity: O(1)
* @return Singe line reply, specifically the randomly selected key or an empty string is the
* database is empty
*/
@Override
public byte[] randomBinaryKey() {
checkIsInMultiOrPipeline();
client.randomKey();
return client.getBinaryBulkReply();
}
/**
* Atomically renames the key oldkey to newkey. If the source and destination name are the same an
* error is returned. If newkey already exists it is overwritten.
* <p>
* Time complexity: O(1)
* @param oldkey
* @param newkey
* @return Status code repy
*/
@Override
public String rename(final byte[] oldkey, final byte[] newkey) {
checkIsInMultiOrPipeline();
client.rename(oldkey, newkey);
return client.getStatusCodeReply();
}
/**
* Rename oldkey into newkey but fails if the destination key newkey already exists.
* <p>
* Time complexity: O(1)
* @param oldkey
* @param newkey
* @return Integer reply, specifically: 1 if the key was renamed 0 if the target key already exist
*/
@Override
public Long renamenx(final byte[] oldkey, final byte[] newkey) {
checkIsInMultiOrPipeline();
client.renamenx(oldkey, newkey);
return client.getIntegerReply();
}
/**
* Return the number of keys in the currently selected database.
* @return Integer reply
*/
@Override
public Long dbSize() {
checkIsInMultiOrPipeline();
client.dbSize();
return client.getIntegerReply();
}
/**
* Set a timeout on the specified key. After the timeout the key will be automatically deleted by
* the server. A key with an associated timeout is said to be volatile in Redis terminology.
* <p>
* Voltile keys are stored on disk like the other keys, the timeout is persistent too like all the
* other aspects of the dataset. Saving a dataset containing expires and stopping the server does
* not stop the flow of time as Redis stores on disk the time when the key will no longer be
* available as Unix time, and not the remaining seconds.
* <p>
* Since Redis 2.1.3 you can update the value of the timeout of a key already having an expire
* set. It is also possible to undo the expire at all turning the key into a normal key using the
* {@link #persist(byte[]) PERSIST} command.
* <p>
* Time complexity: O(1)
* @see <a href="http://redis.io/commands/expire">Expire Command</a>
* @param key
* @param seconds
* @return Integer reply, specifically: 1: the timeout was set. 0: the timeout was not set since
* the key already has an associated timeout (this may happen only in Redis versions <
* 2.1.3, Redis >= 2.1.3 will happily update the timeout), or the key does not exist.
*/
@Override
public Long expire(final byte[] key, final int seconds) {
checkIsInMultiOrPipeline();
client.expire(key, seconds);
return client.getIntegerReply();
}
/**
* EXPIREAT works exctly like {@link #expire(byte[], int) EXPIRE} but instead to get the number of
* seconds representing the Time To Live of the key as a second argument (that is a relative way
* of specifing the TTL), it takes an absolute one in the form of a UNIX timestamp (Number of
* seconds elapsed since 1 Gen 1970).
* <p>
* EXPIREAT was introduced in order to implement the Append Only File persistence mode so that
* EXPIRE commands are automatically translated into EXPIREAT commands for the append only file.
* Of course EXPIREAT can also used by programmers that need a way to simply specify that a given
* key should expire at a given time in the future.
* <p>
* Since Redis 2.1.3 you can update the value of the timeout of a key already having an expire
* set. It is also possible to undo the expire at all turning the key into a normal key using the
* {@link #persist(byte[]) PERSIST} command.
* <p>
* Time complexity: O(1)
* @see <a href="http://redis.io/commands/expire">Expire Command</a>
* @param key
* @param unixTime
* @return Integer reply, specifically: 1: the timeout was set. 0: the timeout was not set since
* the key already has an associated timeout (this may happen only in Redis versions <
* 2.1.3, Redis >= 2.1.3 will happily update the timeout), or the key does not exist.
*/
@Override
public Long expireAt(final byte[] key, final long unixTime) {
checkIsInMultiOrPipeline();
client.expireAt(key, unixTime);
return client.getIntegerReply();
}
/**
* The TTL command returns the remaining time to live in seconds of a key that has an
* {@link #expire(byte[], int) EXPIRE} set. This introspection capability allows a Redis client to
* check how many seconds a given key will continue to be part of the dataset.
* @param key
* @return Integer reply, returns the remaining time to live in seconds of a key that has an
* EXPIRE. If the Key does not exists or does not have an associated expire, -1 is
* returned.
*/
@Override
public Long ttl(final byte[] key) {
checkIsInMultiOrPipeline();
client.ttl(key);
return client.getIntegerReply();
}
/**
* Select the DB with having the specified zero-based numeric index. For default every new client
* connection is automatically selected to DB 0.
* @param index
* @return Status code reply
*/
@Override
public String select(final int index) {
checkIsInMultiOrPipeline();
client.select(index);
String statusCodeReply = client.getStatusCodeReply();
client.setDb(index);
return statusCodeReply;
}
/**
* Move the specified key from the currently selected DB to the specified destination DB. Note
* that this command returns 1 only if the key was successfully moved, and 0 if the target key was
* already there or if the source key was not found at all, so it is possible to use MOVE as a
* locking primitive.
* @param key
* @param dbIndex
* @return Integer reply, specifically: 1 if the key was moved 0 if the key was not moved because
* already present on the target DB or was not found in the current DB.
*/
@Override
public Long move(final byte[] key, final int dbIndex) {
checkIsInMultiOrPipeline();
client.move(key, dbIndex);
return client.getIntegerReply();
}
/**
* Delete all the keys of all the existing databases, not just the currently selected one. This
* command never fails.
* @return Status code reply
*/
@Override
public String flushAll() {
checkIsInMultiOrPipeline();
client.flushAll();
return client.getStatusCodeReply();
}
/**
* GETSET is an atomic set this value and return the old value command. Set key to the string
* value and return the old value stored at key. The string can't be longer than 1073741824 bytes
* (1 GB).
* <p>
* Time complexity: O(1)
* @param key
* @param value
* @return Bulk reply
*/
@Override
public byte[] getSet(final byte[] key, final byte[] value) {
checkIsInMultiOrPipeline();
client.getSet(key, value);
return client.getBinaryBulkReply();
}
/**
* Get the values of all the specified keys. If one or more keys dont exist or is not of type
* String, a 'nil' value is returned instead of the value of the specified key, but the operation
* never fails.
* <p>
* Time complexity: O(1) for every key
* @param keys
* @return Multi bulk reply
*/
@Override
public List<byte[]> mget(final byte[]... keys) {
checkIsInMultiOrPipeline();
client.mget(keys);
return client.getBinaryMultiBulkReply();
}
/**
* SETNX works exactly like {@link #set(byte[], byte[]) SET} with the only difference that if the
* key already exists no operation is performed. SETNX actually means "SET if Not eXists".
* <p>
* Time complexity: O(1)
* @param key
* @param value
* @return Integer reply, specifically: 1 if the key was set 0 if the key was not set
*/
@Override
public Long setnx(final byte[] key, final byte[] value) {
checkIsInMultiOrPipeline();
client.setnx(key, value);
return client.getIntegerReply();
}
/**
* The command is exactly equivalent to the following group of commands:
* {@link #set(byte[], byte[]) SET} + {@link #expire(byte[], int) EXPIRE}. The operation is
* atomic.
* <p>
* Time complexity: O(1)
* @param key
* @param seconds
* @param value
* @return Status code reply
*/
@Override
public String setex(final byte[] key, final int seconds, final byte[] value) {
checkIsInMultiOrPipeline();
client.setex(key, seconds, value);
return client.getStatusCodeReply();
}
/**
* Set the the respective keys to the respective values. MSET will replace old values with new
* values, while {@link #msetnx(byte[]...) MSETNX} will not perform any operation at all even if
* just a single key already exists.
* <p>
* Because of this semantic MSETNX can be used in order to set different keys representing
* different fields of an unique logic object in a way that ensures that either all the fields or
* none at all are set.
* <p>
* Both MSET and MSETNX are atomic operations. This means that for instance if the keys A and B
* are modified, another client talking to Redis can either see the changes to both A and B at
* once, or no modification at all.
* @see #msetnx(byte[]...)
* @param keysvalues
* @return Status code reply Basically +OK as MSET can't fail
*/
@Override
public String mset(final byte[]... keysvalues) {
checkIsInMultiOrPipeline();
client.mset(keysvalues);
return client.getStatusCodeReply();
}
/**
* Set the the respective keys to the respective values. {@link #mset(byte[]...) MSET} will
* replace old values with new values, while MSETNX will not perform any operation at all even if
* just a single key already exists.
* <p>
* Because of this semantic MSETNX can be used in order to set different keys representing
* different fields of an unique logic object in a way that ensures that either all the fields or
* none at all are set.
* <p>
* Both MSET and MSETNX are atomic operations. This means that for instance if the keys A and B
* are modified, another client talking to Redis can either see the changes to both A and B at
* once, or no modification at all.
* @see #mset(byte[]...)
* @param keysvalues
* @return Integer reply, specifically: 1 if the all the keys were set 0 if no key was set (at
* least one key already existed)
*/
@Override
public Long msetnx(final byte[]... keysvalues) {
checkIsInMultiOrPipeline();
client.msetnx(keysvalues);
return client.getIntegerReply();
}
/**
* DECRBY work just like {@link #decr(byte[]) INCR} but instead to decrement by 1 the decrement is
* integer.
* <p>
* INCR commands are limited to 64 bit signed integers.
* <p>
* Note: this is actually a string operation, that is, in Redis there are not "integer" types.
* Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented,
* and then converted back as a string.
* <p>
* Time complexity: O(1)
* @see #incr(byte[])
* @see #decr(byte[])
* @see #incrBy(byte[], long)
* @param key
* @param integer
* @return Integer reply, this commands will reply with the new value of key after the increment.
*/
@Override
public Long decrBy(final byte[] key, final long integer) {
checkIsInMultiOrPipeline();
client.decrBy(key, integer);
return client.getIntegerReply();
}
/**
* Decrement the number stored at key by one. If the key does not exist or contains a value of a
* wrong type, set the key to the value of "0" before to perform the decrement operation.
* <p>
* INCR commands are limited to 64 bit signed integers.
* <p>
* Note: this is actually a string operation, that is, in Redis there are not "integer" types.
* Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented,
* and then converted back as a string.
* <p>
* Time complexity: O(1)
* @see #incr(byte[])
* @see #incrBy(byte[], long)
* @see #decrBy(byte[], long)
* @param key
* @return Integer reply, this commands will reply with the new value of key after the increment.
*/
@Override
public Long decr(final byte[] key) {
checkIsInMultiOrPipeline();
client.decr(key);
return client.getIntegerReply();
}
/**
* INCRBY work just like {@link #incr(byte[]) INCR} but instead to increment by 1 the increment is
* integer.
* <p>
* INCR commands are limited to 64 bit signed integers.
* <p>
* Note: this is actually a string operation, that is, in Redis there are not "integer" types.
* Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented,
* and then converted back as a string.
* <p>
* Time complexity: O(1)
* @see #incr(byte[])
* @see #decr(byte[])
* @see #decrBy(byte[], long)
* @param key
* @param integer
* @return Integer reply, this commands will reply with the new value of key after the increment.
*/
@Override
public Long incrBy(final byte[] key, final long integer) {
checkIsInMultiOrPipeline();
client.incrBy(key, integer);
return client.getIntegerReply();
}
/**
* INCRBYFLOAT work just like {@link #incrBy(byte[], long)} INCRBY} but increments by floats
* instead of integers.
* <p>
* INCRBYFLOAT commands are limited to double precision floating point values.
* <p>
* Note: this is actually a string operation, that is, in Redis there are not "double" types.
* Simply the string stored at the key is parsed as a base double precision floating point value,
* incremented, and then converted back as a string. There is no DECRYBYFLOAT but providing a
* negative value will work as expected.
* <p>
* Time complexity: O(1)
* @see #incr(byte[])
* @see #decr(byte[])
* @see #decrBy(byte[], long)
* @param key the key to increment
* @param integer the value to increment by
* @return Integer reply, this commands will reply with the new value of key after the increment.
*/
@Override
public Double incrByFloat(final byte[] key, final double integer) {
checkIsInMultiOrPipeline();
client.incrByFloat(key, integer);
String dval = client.getBulkReply();
return (dval != null ? new Double(dval) : null);
}
/**
* Increment the number stored at key by one. If the key does not exist or contains a value of a
* wrong type, set the key to the value of "0" before to perform the increment operation.
* <p>
* INCR commands are limited to 64 bit signed integers.
* <p>
* Note: this is actually a string operation, that is, in Redis there are not "integer" types.
* Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented,
* and then converted back as a string.
* <p>
* Time complexity: O(1)
* @see #incrBy(byte[], long)
* @see #decr(byte[])
* @see #decrBy(byte[], long)
* @param key
* @return Integer reply, this commands will reply with the new value of key after the increment.
*/
@Override
public Long incr(final byte[] key) {
checkIsInMultiOrPipeline();
client.incr(key);
return client.getIntegerReply();
}
/**
* If the key already exists and is a string, this command appends the provided value at the end
* of the string. If the key does not exist it is created and set as an empty string, so APPEND
* will be very similar to SET in this special case.
* <p>
* Time complexity: O(1). The amortized time complexity is O(1) assuming the appended value is
* small and the already present value is of any size, since the dynamic string library used by
* Redis will double the free space available on every reallocation.
* @param key
* @param value
* @return Integer reply, specifically the total length of the string after the append operation.
*/
@Override
public Long append(final byte[] key, final byte[] value) {
checkIsInMultiOrPipeline();
client.append(key, value);
return client.getIntegerReply();
}
/**
* Return a subset of the string from offset start to offset end (both offsets are inclusive).
* Negative offsets can be used in order to provide an offset starting from the end of the string.
* So -1 means the last char, -2 the penultimate and so forth.
* <p>
* The function handles out of range requests without raising an error, but just limiting the
* resulting range to the actual length of the string.
* <p>
* Time complexity: O(start+n) (with start being the start index and n the total length of the
* requested range). Note that the lookup part of this command is O(1) so for small strings this
* is actually an O(1) command.
* @param key
* @param start
* @param end
* @return Bulk reply
*/
@Override
public byte[] substr(final byte[] key, final int start, final int end) {
checkIsInMultiOrPipeline();
client.substr(key, start, end);
return client.getBinaryBulkReply();
}
/**
* Set the specified hash field to the specified value.
* <p>
* If key does not exist, a new key holding a hash is created.
* <p>
* <b>Time complexity:</b> O(1)
* @param key
* @param field
* @param value
* @return If the field already exists, and the HSET just produced an update of the value, 0 is
* returned, otherwise if a new field is created 1 is returned.
*/
@Override
public Long hset(final byte[] key, final byte[] field, final byte[] value) {
checkIsInMultiOrPipeline();
client.hset(key, field, value);
return client.getIntegerReply();
}
/**
* If key holds a hash, retrieve the value associated to the specified field.
* <p>
* If the field is not found or the key does not exist, a special 'nil' value is returned.
* <p>
* <b>Time complexity:</b> O(1)
* @param key
* @param field
* @return Bulk reply
*/
@Override
public byte[] hget(final byte[] key, final byte[] field) {
checkIsInMultiOrPipeline();
client.hget(key, field);
return client.getBinaryBulkReply();
}
/**
* Set the specified hash field to the specified value if the field not exists. <b>Time
* complexity:</b> O(1)
* @param key
* @param field
* @param value
* @return If the field already exists, 0 is returned, otherwise if a new field is created 1 is
* returned.
*/
@Override
public Long hsetnx(final byte[] key, final byte[] field, final byte[] value) {
checkIsInMultiOrPipeline();
client.hsetnx(key, field, value);
return client.getIntegerReply();
}
/**
* Set the respective fields to the respective values. HMSET replaces old values with new values.
* <p>
* If key does not exist, a new key holding a hash is created.
* <p>
* <b>Time complexity:</b> O(N) (with N being the number of fields)
* @param key
* @param hash
* @return Always OK because HMSET can't fail
*/
@Override
public String hmset(final byte[] key, final Map<byte[], byte[]> hash) {
checkIsInMultiOrPipeline();
client.hmset(key, hash);
return client.getStatusCodeReply();
}
/**
* Retrieve the values associated to the specified fields.
* <p>
* If some of the specified fields do not exist, nil values are returned. Non existing keys are
* considered like empty hashes.
* <p>
* <b>Time complexity:</b> O(N) (with N being the number of fields)
* @param key
* @param fields
* @return Multi Bulk Reply specifically a list of all the values associated with the specified
* fields, in the same order of the request.
*/
@Override
public List<byte[]> hmget(final byte[] key, final byte[]... fields) {
checkIsInMultiOrPipeline();
client.hmget(key, fields);
return client.getBinaryMultiBulkReply();
}
/**
* Increment the number stored at field in the hash at key by value. If key does not exist, a new
* key holding a hash is created. If field does not exist or holds a string, the value is set to 0
* before applying the operation. Since the value argument is signed you can use this command to
* perform both increments and decrements.
* <p>
* The range of values supported by HINCRBY is limited to 64 bit signed integers.
* <p>
* <b>Time complexity:</b> O(1)
* @param key
* @param field
* @param value
* @return Integer reply The new value at field after the increment operation.
*/
@Override
public Long hincrBy(final byte[] key, final byte[] field, final long value) {
checkIsInMultiOrPipeline();
client.hincrBy(key, field, value);
return client.getIntegerReply();
}
/**
* Increment the number stored at field in the hash at key by a double precision floating point
* value. If key does not exist, a new key holding a hash is created. If field does not exist or
* holds a string, the value is set to 0 before applying the operation. Since the value argument
* is signed you can use this command to perform both increments and decrements.
* <p>
* The range of values supported by HINCRBYFLOAT is limited to double precision floating point
* values.
* <p>
* <b>Time complexity:</b> O(1)
* @param key
* @param field
* @param value
* @return Double precision floating point reply The new value at field after the increment
* operation.
*/
@Override
public Double hincrByFloat(final byte[] key, final byte[] field, final double value) {
checkIsInMultiOrPipeline();
client.hincrByFloat(key, field, value);
final String dval = client.getBulkReply();
return (dval != null ? new Double(dval) : null);
}
/**
* Test for existence of a specified field in a hash. <b>Time complexity:</b> O(1)
* @param key
* @param field
* @return Return 1 if the hash stored at key contains the specified field. Return 0 if the key is
* not found or the field is not present.
*/
@Override
public Boolean hexists(final byte[] key, final byte[] field) {
checkIsInMultiOrPipeline();
client.hexists(key, field);
return client.getIntegerReply() == 1;
}
/**
* Remove the specified field from an hash stored at key.
* <p>
* <b>Time complexity:</b> O(1)
* @param key
* @param fields
* @return If the field was present in the hash it is deleted and 1 is returned, otherwise 0 is
* returned and no operation is performed.
*/
@Override
public Long hdel(final byte[] key, final byte[]... fields) {
checkIsInMultiOrPipeline();
client.hdel(key, fields);
return client.getIntegerReply();
}
/**
* Return the number of items in a hash.
* <p>
* <b>Time complexity:</b> O(1)
* @param key
* @return The number of entries (fields) contained in the hash stored at key. If the specified
* key does not exist, 0 is returned assuming an empty hash.
*/
@Override
public Long hlen(final byte[] key) {
checkIsInMultiOrPipeline();
client.hlen(key);
return client.getIntegerReply();
}
/**
* Return all the fields in a hash.
* <p>
* <b>Time complexity:</b> O(N), where N is the total number of entries
* @param key
* @return All the fields names contained into a hash.
*/
@Override
public Set<byte[]> hkeys(final byte[] key) {
checkIsInMultiOrPipeline();
client.hkeys(key);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
/**
* Return all the values in a hash.
* <p>
* <b>Time complexity:</b> O(N), where N is the total number of entries
* @param key
* @return All the fields values contained into a hash.
*/
@Override
public List<byte[]> hvals(final byte[] key) {
checkIsInMultiOrPipeline();
client.hvals(key);
return client.getBinaryMultiBulkReply();
}
/**
* Return all the fields and associated values in a hash.
* <p>
* <b>Time complexity:</b> O(N), where N is the total number of entries
* @param key
* @return All the fields and values contained into a hash.
*/
@Override
public Map<byte[], byte[]> hgetAll(final byte[] key) {
checkIsInMultiOrPipeline();
client.hgetAll(key);
final List<byte[]> flatHash = client.getBinaryMultiBulkReply();
final Map<byte[], byte[]> hash = new JedisByteHashMap();
final Iterator<byte[]> iterator = flatHash.iterator();
while (iterator.hasNext()) {
hash.put(iterator.next(), iterator.next());
}
return hash;
}
/**
* Add the string value to the head (LPUSH) or tail (RPUSH) of the list stored at key. If the key
* does not exist an empty list is created just before the append operation. If the key exists but
* is not a List an error is returned.
* <p>
* Time complexity: O(1)
* @see BinaryJedis#rpush(byte[], byte[]...)
* @param key
* @param strings
* @return Integer reply, specifically, the number of elements inside the list after the push
* operation.
*/
@Override
public Long rpush(final byte[] key, final byte[]... strings) {
checkIsInMultiOrPipeline();
client.rpush(key, strings);
return client.getIntegerReply();
}
/**
* Add the string value to the head (LPUSH) or tail (RPUSH) of the list stored at key. If the key
* does not exist an empty list is created just before the append operation. If the key exists but
* is not a List an error is returned.
* <p>
* Time complexity: O(1)
* @see BinaryJedis#rpush(byte[], byte[]...)
* @param key
* @param strings
* @return Integer reply, specifically, the number of elements inside the list after the push
* operation.
*/
@Override
public Long lpush(final byte[] key, final byte[]... strings) {
checkIsInMultiOrPipeline();
client.lpush(key, strings);
return client.getIntegerReply();
}
/**
* Return the length of the list stored at the specified key. If the key does not exist zero is
* returned (the same behaviour as for empty lists). If the value stored at key is not a list an
* error is returned.
* <p>
* Time complexity: O(1)
* @param key
* @return The length of the list.
*/
@Override
public Long llen(final byte[] key) {
checkIsInMultiOrPipeline();
client.llen(key);
return client.getIntegerReply();
}
/**
* Return the specified elements of the list stored at the specified key. Start and end are
* zero-based indexes. 0 is the first element of the list (the list head), 1 the next element and
* so on.
* <p>
* For example LRANGE foobar 0 2 will return the first three elements of the list.
* <p>
* start and end can also be negative numbers indicating offsets from the end of the list. For
* example -1 is the last element of the list, -2 the penultimate element and so on.
* <p>
* <b>Consistency with range functions in various programming languages</b>
* <p>
* Note that if you have a list of numbers from 0 to 100, LRANGE 0 10 will return 11 elements,
* that is, rightmost item is included. This may or may not be consistent with behavior of
* range-related functions in your programming language of choice (think Ruby's Range.new,
* Array#slice or Python's range() function).
* <p>
* LRANGE behavior is consistent with one of Tcl.
* <p>
* <b>Out-of-range indexes</b>
* <p>
* Indexes out of range will not produce an error: if start is over the end of the list, or start
* > end, an empty list is returned. If end is over the end of the list Redis will threat it
* just like the last element of the list.
* <p>
* Time complexity: O(start+n) (with n being the length of the range and start being the start
* offset)
* @param key
* @param start
* @param end
* @return Multi bulk reply, specifically a list of elements in the specified range.
*/
@Override
public List<byte[]> lrange(final byte[] key, final long start, final long end) {
checkIsInMultiOrPipeline();
client.lrange(key, start, end);
return client.getBinaryMultiBulkReply();
}
/**
* Trim an existing list so that it will contain only the specified range of elements specified.
* Start and end are zero-based indexes. 0 is the first element of the list (the list head), 1 the
* next element and so on.
* <p>
* For example LTRIM foobar 0 2 will modify the list stored at foobar key so that only the first
* three elements of the list will remain.
* <p>
* start and end can also be negative numbers indicating offsets from the end of the list. For
* example -1 is the last element of the list, -2 the penultimate element and so on.
* <p>
* Indexes out of range will not produce an error: if start is over the end of the list, or start
* > end, an empty list is left as value. If end over the end of the list Redis will threat it
* just like the last element of the list.
* <p>
* Hint: the obvious use of LTRIM is together with LPUSH/RPUSH. For example:
* <p>
* {@code lpush("mylist", "someelement"); ltrim("mylist", 0, 99); * }
* <p>
* The above two commands will push elements in the list taking care that the list will not grow
* without limits. This is very useful when using Redis to store logs for example. It is important
* to note that when used in this way LTRIM is an O(1) operation because in the average case just
* one element is removed from the tail of the list.
* <p>
* Time complexity: O(n) (with n being len of list - len of range)
* @param key
* @param start
* @param end
* @return Status code reply
*/
@Override
public String ltrim(final byte[] key, final long start, final long end) {
checkIsInMultiOrPipeline();
client.ltrim(key, start, end);
return client.getStatusCodeReply();
}
/**
* Return the specified element of the list stored at the specified key. 0 is the first element, 1
* the second and so on. Negative indexes are supported, for example -1 is the last element, -2
* the penultimate and so on.
* <p>
* If the value stored at key is not of list type an error is returned. If the index is out of
* range a 'nil' reply is returned.
* <p>
* Note that even if the average time complexity is O(n) asking for the first or the last element
* of the list is O(1).
* <p>
* Time complexity: O(n) (with n being the length of the list)
* @param key
* @param index
* @return Bulk reply, specifically the requested element
*/
@Override
public byte[] lindex(final byte[] key, final long index) {
checkIsInMultiOrPipeline();
client.lindex(key, index);
return client.getBinaryBulkReply();
}
/**
* Set a new value as the element at index position of the List at key.
* <p>
* Out of range indexes will generate an error.
* <p>
* Similarly to other list commands accepting indexes, the index can be negative to access
* elements starting from the end of the list. So -1 is the last element, -2 is the penultimate,
* and so forth.
* <p>
* <b>Time complexity:</b>
* <p>
* O(N) (with N being the length of the list), setting the first or last elements of the list is
* O(1).
* @see #lindex(byte[], long)
* @param key
* @param index
* @param value
* @return Status code reply
*/
@Override
public String lset(final byte[] key, final long index, final byte[] value) {
checkIsInMultiOrPipeline();
client.lset(key, index, value);
return client.getStatusCodeReply();
}
/**
* Remove the first count occurrences of the value element from the list. If count is zero all the
* elements are removed. If count is negative elements are removed from tail to head, instead to
* go from head to tail that is the normal behaviour. So for example LREM with count -2 and hello
* as value to remove against the list (a,b,c,hello,x,hello,hello) will have the list
* (a,b,c,hello,x). The number of removed elements is returned as an integer, see below for more
* information about the returned value. Note that non existing keys are considered like empty
* lists by LREM, so LREM against non existing keys will always return 0.
* <p>
* Time complexity: O(N) (with N being the length of the list)
* @param key
* @param count
* @param value
* @return Integer Reply, specifically: The number of removed elements if the operation succeeded
*/
@Override
public Long lrem(final byte[] key, final long count, final byte[] value) {
checkIsInMultiOrPipeline();
client.lrem(key, count, value);
return client.getIntegerReply();
}
/**
* Atomically return and remove the first (LPOP) or last (RPOP) element of the list. For example
* if the list contains the elements "a","b","c" LPOP will return "a" and the list will become
* "b","c".
* <p>
* If the key does not exist or the list is already empty the special value 'nil' is returned.
* @see #rpop(byte[])
* @param key
* @return Bulk reply
*/
@Override
public byte[] lpop(final byte[] key) {
checkIsInMultiOrPipeline();
client.lpop(key);
return client.getBinaryBulkReply();
}
/**
* Atomically return and remove the first (LPOP) or last (RPOP) element of the list. For example
* if the list contains the elements "a","b","c" LPOP will return "a" and the list will become
* "b","c".
* <p>
* If the key does not exist or the list is already empty the special value 'nil' is returned.
* @see #lpop(byte[])
* @param key
* @return Bulk reply
*/
@Override
public byte[] rpop(final byte[] key) {
checkIsInMultiOrPipeline();
client.rpop(key);
return client.getBinaryBulkReply();
}
/**
* Atomically return and remove the last (tail) element of the srckey list, and push the element
* as the first (head) element of the dstkey list. For example if the source list contains the
* elements "a","b","c" and the destination list contains the elements "foo","bar" after an
* RPOPLPUSH command the content of the two lists will be "a","b" and "c","foo","bar".
* <p>
* If the key does not exist or the list is already empty the special value 'nil' is returned. If
* the srckey and dstkey are the same the operation is equivalent to removing the last element
* from the list and pusing it as first element of the list, so it's a "list rotation" command.
* <p>
* Time complexity: O(1)
* @param srckey
* @param dstkey
* @return Bulk reply
*/
@Override
public byte[] rpoplpush(final byte[] srckey, final byte[] dstkey) {
checkIsInMultiOrPipeline();
client.rpoplpush(srckey, dstkey);
return client.getBinaryBulkReply();
}
/**
* Add the specified member to the set value stored at key. If member is already a member of the
* set no operation is performed. If key does not exist a new set with the specified member as
* sole member is created. If the key exists but does not hold a set value an error is returned.
* <p>
* Time complexity O(1)
* @param key
* @param members
* @return Integer reply, specifically: 1 if the new element was added 0 if the element was
* already a member of the set
*/
@Override
public Long sadd(final byte[] key, final byte[]... members) {
checkIsInMultiOrPipeline();
client.sadd(key, members);
return client.getIntegerReply();
}
/**
* Return all the members (elements) of the set value stored at key. This is just syntax glue for
* {@link #sinter(byte[]...)} SINTER}.
* <p>
* Time complexity O(N)
* @param key the key of the set
* @return Multi bulk reply
*/
@Override
public Set<byte[]> smembers(final byte[] key) {
checkIsInMultiOrPipeline();
client.smembers(key);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
/**
* Remove the specified member from the set value stored at key. If member was not a member of the
* set no operation is performed. If key does not hold a set value an error is returned.
* <p>
* Time complexity O(1)
* @param key the key of the set
* @param member the set member to remove
* @return Integer reply, specifically: 1 if the new element was removed 0 if the new element was
* not a member of the set
*/
@Override
public Long srem(final byte[] key, final byte[]... member) {
checkIsInMultiOrPipeline();
client.srem(key, member);
return client.getIntegerReply();
}
/**
* Remove a random element from a Set returning it as return value. If the Set is empty or the key
* does not exist, a nil object is returned.
* <p>
* The {@link #srandmember(byte[])} command does a similar work but the returned element is not
* removed from the Set.
* <p>
* Time complexity O(1)
* @param key
* @return Bulk reply
*/
@Override
public byte[] spop(final byte[] key) {
checkIsInMultiOrPipeline();
client.spop(key);
return client.getBinaryBulkReply();
}
@Override
public Set<byte[]> spop(final byte[] key, final long count) {
checkIsInMultiOrPipeline();
client.spop(key, count);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
/**
* Move the specified member from the set at srckey to the set at dstkey. This operation is
* atomic, in every given moment the element will appear to be in the source or destination set
* for accessing clients.
* <p>
* If the source set does not exist or does not contain the specified element no operation is
* performed and zero is returned, otherwise the element is removed from the source set and added
* to the destination set. On success one is returned, even if the element was already present in
* the destination set.
* <p>
* An error is raised if the source or destination keys contain a non Set value.
* <p>
* Time complexity O(1)
* @param srckey
* @param dstkey
* @param member
* @return Integer reply, specifically: 1 if the element was moved 0 if the element was not found
* on the first set and no operation was performed
*/
@Override
public Long smove(final byte[] srckey, final byte[] dstkey, final byte[] member) {
checkIsInMultiOrPipeline();
client.smove(srckey, dstkey, member);
return client.getIntegerReply();
}
/**
* Return the set cardinality (number of elements). If the key does not exist 0 is returned, like
* for empty sets.
* @param key
* @return Integer reply, specifically: the cardinality (number of elements) of the set as an
* integer.
*/
@Override
public Long scard(final byte[] key) {
checkIsInMultiOrPipeline();
client.scard(key);
return client.getIntegerReply();
}
/**
* Return 1 if member is a member of the set stored at key, otherwise 0 is returned.
* <p>
* Time complexity O(1)
* @param key
* @param member
* @return Integer reply, specifically: 1 if the element is a member of the set 0 if the element
* is not a member of the set OR if the key does not exist
*/
@Override
public Boolean sismember(final byte[] key, final byte[] member) {
checkIsInMultiOrPipeline();
client.sismember(key, member);
return client.getIntegerReply() == 1;
}
/**
* Return the members of a set resulting from the intersection of all the sets hold at the
* specified keys. Like in {@link #lrange(byte[], long, long)} LRANGE} the result is sent to the
* client as a multi-bulk reply (see the protocol specification for more information). If just a
* single key is specified, then this command produces the same result as
* {@link #smembers(byte[]) SMEMBERS}. Actually SMEMBERS is just syntax sugar for SINTER.
* <p>
* Non existing keys are considered like empty sets, so if one of the keys is missing an empty set
* is returned (since the intersection with an empty set always is an empty set).
* <p>
* Time complexity O(N*M) worst case where N is the cardinality of the smallest set and M the
* number of sets
* @param keys
* @return Multi bulk reply, specifically the list of common elements.
*/
@Override
public Set<byte[]> sinter(final byte[]... keys) {
checkIsInMultiOrPipeline();
client.sinter(keys);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
/**
* This commnad works exactly like {@link #sinter(byte[]...) SINTER} but instead of being returned
* the resulting set is sotred as dstkey.
* <p>
* Time complexity O(N*M) worst case where N is the cardinality of the smallest set and M the
* number of sets
* @param dstkey
* @param keys
* @return Status code reply
*/
@Override
public Long sinterstore(final byte[] dstkey, final byte[]... keys) {
checkIsInMultiOrPipeline();
client.sinterstore(dstkey, keys);
return client.getIntegerReply();
}
/**
* Return the members of a set resulting from the union of all the sets hold at the specified
* keys. Like in {@link #lrange(byte[], long, long)} LRANGE} the result is sent to the client as a
* multi-bulk reply (see the protocol specification for more information). If just a single key is
* specified, then this command produces the same result as {@link #smembers(byte[]) SMEMBERS}.
* <p>
* Non existing keys are considered like empty sets.
* <p>
* Time complexity O(N) where N is the total number of elements in all the provided sets
* @param keys
* @return Multi bulk reply, specifically the list of common elements.
*/
@Override
public Set<byte[]> sunion(final byte[]... keys) {
checkIsInMultiOrPipeline();
client.sunion(keys);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
/**
* This command works exactly like {@link #sunion(byte[]...) SUNION} but instead of being returned
* the resulting set is stored as dstkey. Any existing value in dstkey will be over-written.
* <p>
* Time complexity O(N) where N is the total number of elements in all the provided sets
* @param dstkey
* @param keys
* @return Status code reply
*/
@Override
public Long sunionstore(final byte[] dstkey, final byte[]... keys) {
checkIsInMultiOrPipeline();
client.sunionstore(dstkey, keys);
return client.getIntegerReply();
}
/**
* Return the difference between the Set stored at key1 and all the Sets key2, ..., keyN
* <p>
* <b>Example:</b>
*
* <pre>
* key1 = [x, a, b, c]
* key2 = [c]
* key3 = [a, d]
* SDIFF key1,key2,key3 => [x, b]
* </pre>
*
* Non existing keys are considered like empty sets.
* <p>
* <b>Time complexity:</b>
* <p>
* O(N) with N being the total number of elements of all the sets
* @param keys
* @return Return the members of a set resulting from the difference between the first set
* provided and all the successive sets.
*/
@Override
public Set<byte[]> sdiff(final byte[]... keys) {
checkIsInMultiOrPipeline();
client.sdiff(keys);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
/**
* This command works exactly like {@link #sdiff(byte[]...) SDIFF} but instead of being returned
* the resulting set is stored in dstkey.
* @param dstkey
* @param keys
* @return Status code reply
*/
@Override
public Long sdiffstore(final byte[] dstkey, final byte[]... keys) {
checkIsInMultiOrPipeline();
client.sdiffstore(dstkey, keys);
return client.getIntegerReply();
}
/**
* Return a random element from a Set, without removing the element. If the Set is empty or the
* key does not exist, a nil object is returned.
* <p>
* The SPOP command does a similar work but the returned element is popped (removed) from the Set.
* <p>
* Time complexity O(1)
* @param key
* @return Bulk reply
*/
@Override
public byte[] srandmember(final byte[] key) {
checkIsInMultiOrPipeline();
client.srandmember(key);
return client.getBinaryBulkReply();
}
@Override
public List<byte[]> srandmember(final byte[] key, final int count) {
checkIsInMultiOrPipeline();
client.srandmember(key, count);
return client.getBinaryMultiBulkReply();
}
/**
* Add the specified member having the specifeid score to the sorted set stored at key. If member
* is already a member of the sorted set the score is updated, and the element reinserted in the
* right position to ensure sorting. If key does not exist a new sorted set with the specified
* member as sole member is crated. If the key exists but does not hold a sorted set value an
* error is returned.
* <p>
* The score value can be the string representation of a double precision floating point number.
* <p>
* Time complexity O(log(N)) with N being the number of elements in the sorted set
* @param key
* @param score
* @param member
* @return Integer reply, specifically: 1 if the new element was added 0 if the element was
* already a member of the sorted set and the score was updated
*/
@Override
public Long zadd(final byte[] key, final double score, final byte[] member) {
checkIsInMultiOrPipeline();
client.zadd(key, score, member);
return client.getIntegerReply();
}
@Override
public Long zadd(byte[] key, double score, byte[] member, ZAddParams params) {
checkIsInMultiOrPipeline();
client.zadd(key, score, member, params);
return client.getIntegerReply();
}
@Override
public Long zadd(final byte[] key, final Map<byte[], Double> scoreMembers) {
checkIsInMultiOrPipeline();
client.zadd(key, scoreMembers);
return client.getIntegerReply();
}
@Override
public Long zadd(byte[] key, Map<byte[], Double> scoreMembers, ZAddParams params) {
checkIsInMultiOrPipeline();
client.zadd(key, scoreMembers, params);
return client.getIntegerReply();
}
@Override
public Set<byte[]> zrange(final byte[] key, final long start, final long end) {
checkIsInMultiOrPipeline();
client.zrange(key, start, end);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
/**
* Remove the specified member from the sorted set value stored at key. If member was not a member
* of the set no operation is performed. If key does not not hold a set value an error is
* returned.
* <p>
* Time complexity O(log(N)) with N being the number of elements in the sorted set
* @param key
* @param members
* @return Integer reply, specifically: 1 if the new element was removed 0 if the new element was
* not a member of the set
*/
@Override
public Long zrem(final byte[] key, final byte[]... members) {
checkIsInMultiOrPipeline();
client.zrem(key, members);
return client.getIntegerReply();
}
/**
* If member already exists in the sorted set adds the increment to its score and updates the
* position of the element in the sorted set accordingly. If member does not already exist in the
* sorted set it is added with increment as score (that is, like if the previous score was
* virtually zero). If key does not exist a new sorted set with the specified member as sole
* member is crated. If the key exists but does not hold a sorted set value an error is returned.
* <p>
* The score value can be the string representation of a double precision floating point number.
* It's possible to provide a negative value to perform a decrement.
* <p>
* For an introduction to sorted sets check the Introduction to Redis data types page.
* <p>
* Time complexity O(log(N)) with N being the number of elements in the sorted set
* @param key
* @param score
* @param member
* @return The new score
*/
@Override
public Double zincrby(final byte[] key, final double score, final byte[] member) {
checkIsInMultiOrPipeline();
client.zincrby(key, score, member);
String newscore = client.getBulkReply();
return Double.valueOf(newscore);
}
@Override
public Double zincrby(byte[] key, double score, byte[] member, ZIncrByParams params) {
checkIsInMultiOrPipeline();
client.zincrby(key, score, member, params);
String newscore = client.getBulkReply();
// with nx / xx options it could return null now
if (newscore == null) return null;
return Double.valueOf(newscore);
}
/**
* Return the rank (or index) or member in the sorted set at key, with scores being ordered from
* low to high.
* <p>
* When the given member does not exist in the sorted set, the special value 'nil' is returned.
* The returned rank (or index) of the member is 0-based for both commands.
* <p>
* <b>Time complexity:</b>
* <p>
* O(log(N))
* @see #zrevrank(byte[], byte[])
* @param key
* @param member
* @return Integer reply or a nil bulk reply, specifically: the rank of the element as an integer
* reply if the element exists. A nil bulk reply if there is no such element.
*/
@Override
public Long zrank(final byte[] key, final byte[] member) {
checkIsInMultiOrPipeline();
client.zrank(key, member);
return client.getIntegerReply();
}
/**
* Return the rank (or index) or member in the sorted set at key, with scores being ordered from
* high to low.
* <p>
* When the given member does not exist in the sorted set, the special value 'nil' is returned.
* The returned rank (or index) of the member is 0-based for both commands.
* <p>
* <b>Time complexity:</b>
* <p>
* O(log(N))
* @see #zrank(byte[], byte[])
* @param key
* @param member
* @return Integer reply or a nil bulk reply, specifically: the rank of the element as an integer
* reply if the element exists. A nil bulk reply if there is no such element.
*/
@Override
public Long zrevrank(final byte[] key, final byte[] member) {
checkIsInMultiOrPipeline();
client.zrevrank(key, member);
return client.getIntegerReply();
}
@Override
public Set<byte[]> zrevrange(final byte[] key, final long start, final long end) {
checkIsInMultiOrPipeline();
client.zrevrange(key, start, end);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
@Override
public Set<Tuple> zrangeWithScores(final byte[] key, final long start, final long end) {
checkIsInMultiOrPipeline();
client.zrangeWithScores(key, start, end);
return getBinaryTupledSet();
}
@Override
public Set<Tuple> zrevrangeWithScores(final byte[] key, final long start, final long end) {
checkIsInMultiOrPipeline();
client.zrevrangeWithScores(key, start, end);
return getBinaryTupledSet();
}
/**
* Return the sorted set cardinality (number of elements). If the key does not exist 0 is
* returned, like for empty sorted sets.
* <p>
* Time complexity O(1)
* @param key
* @return the cardinality (number of elements) of the set as an integer.
*/
@Override
public Long zcard(final byte[] key) {
checkIsInMultiOrPipeline();
client.zcard(key);
return client.getIntegerReply();
}
/**
* Return the score of the specified element of the sorted set at key. If the specified element
* does not exist in the sorted set, or the key does not exist at all, a special 'nil' value is
* returned.
* <p>
* <b>Time complexity:</b> O(1)
* @param key
* @param member
* @return the score
*/
@Override
public Double zscore(final byte[] key, final byte[] member) {
checkIsInMultiOrPipeline();
client.zscore(key, member);
final String score = client.getBulkReply();
return (score != null ? new Double(score) : null);
}
public Transaction multi() {
client.multi();
client.getOne(); // expected OK
transaction = new Transaction(client);
return transaction;
}
protected void checkIsInMultiOrPipeline() {
if (client.isInMulti()) {
throw new JedisDataException(
"Cannot use Jedis when in Multi. Please use Transation or reset jedis state.");
} else if (pipeline != null && pipeline.hasPipelinedResponse()) {
throw new JedisDataException(
"Cannot use Jedis when in Pipeline. Please use Pipeline or reset jedis state .");
}
}
public void connect() {
client.connect();
}
public void disconnect() {
client.disconnect();
}
public void resetState() {
if (client.isConnected()) {
if (transaction != null) {
transaction.clear();
}
if (pipeline != null) {
pipeline.clear();
}
if (client.isInWatch()) {
unwatch();
}
client.resetState();
}
transaction = null;
pipeline = null;
}
@Override
public String watch(final byte[]... keys) {
client.watch(keys);
return client.getStatusCodeReply();
}
@Override
public String unwatch() {
client.unwatch();
return client.getStatusCodeReply();
}
@Override
public void close() {
client.close();
}
/**
* Sort a Set or a List.
* <p>
* Sort the elements contained in the List, Set, or Sorted Set value at key. By default sorting is
* numeric with elements being compared as double precision floating point numbers. This is the
* simplest form of SORT.
* @see #sort(byte[], byte[])
* @see #sort(byte[], SortingParams)
* @see #sort(byte[], SortingParams, byte[])
* @param key
* @return Assuming the Set/List at key contains a list of numbers, the return value will be the
* list of numbers ordered from the smallest to the biggest number.
*/
@Override
public List<byte[]> sort(final byte[] key) {
checkIsInMultiOrPipeline();
client.sort(key);
return client.getBinaryMultiBulkReply();
}
/**
* Sort a Set or a List accordingly to the specified parameters.
* <p>
* <b>examples:</b>
* <p>
* Given are the following sets and key/values:
*
* <pre>
* x = [1, 2, 3]
* y = [a, b, c]
*
* k1 = z
* k2 = y
* k3 = x
*
* w1 = 9
* w2 = 8
* w3 = 7
* </pre>
*
* Sort Order:
*
* <pre>
* sort(x) or sort(x, sp.asc())
* -> [1, 2, 3]
*
* sort(x, sp.desc())
* -> [3, 2, 1]
*
* sort(y)
* -> [c, a, b]
*
* sort(y, sp.alpha())
* -> [a, b, c]
*
* sort(y, sp.alpha().desc())
* -> [c, a, b]
* </pre>
*
* Limit (e.g. for Pagination):
*
* <pre>
* sort(x, sp.limit(0, 2))
* -> [1, 2]
*
* sort(y, sp.alpha().desc().limit(1, 2))
* -> [b, a]
* </pre>
*
* Sorting by external keys:
*
* <pre>
* sort(x, sb.by(w*))
* -> [3, 2, 1]
*
* sort(x, sb.by(w*).desc())
* -> [1, 2, 3]
* </pre>
*
* Getting external keys:
*
* <pre>
* sort(x, sp.by(w*).get(k*))
* -> [x, y, z]
*
* sort(x, sp.by(w*).get(#).get(k*))
* -> [3, x, 2, y, 1, z]
* </pre>
* @see #sort(byte[])
* @see #sort(byte[], SortingParams, byte[])
* @param key
* @param sortingParameters
* @return a list of sorted elements.
*/
@Override
public List<byte[]> sort(final byte[] key, final SortingParams sortingParameters) {
checkIsInMultiOrPipeline();
client.sort(key, sortingParameters);
return client.getBinaryMultiBulkReply();
}
/**
* BLPOP (and BRPOP) is a blocking list pop primitive. You can see this commands as blocking
* versions of LPOP and RPOP able to block if the specified keys don't exist or contain empty
* lists.
* <p>
* The following is a description of the exact semantic. We describe BLPOP but the two commands
* are identical, the only difference is that BLPOP pops the element from the left (head) of the
* list, and BRPOP pops from the right (tail).
* <p>
* <b>Non blocking behavior</b>
* <p>
* When BLPOP is called, if at least one of the specified keys contain a non empty list, an
* element is popped from the head of the list and returned to the caller together with the name
* of the key (BLPOP returns a two elements array, the first element is the key, the second the
* popped value).
* <p>
* Keys are scanned from left to right, so for instance if you issue BLPOP list1 list2 list3 0
* against a dataset where list1 does not exist but list2 and list3 contain non empty lists, BLPOP
* guarantees to return an element from the list stored at list2 (since it is the first non empty
* list starting from the left).
* <p>
* <b>Blocking behavior</b>
* <p>
* If none of the specified keys exist or contain non empty lists, BLPOP blocks until some other
* client performs a LPUSH or an RPUSH operation against one of the lists.
* <p>
* Once new data is present on one of the lists, the client finally returns with the name of the
* key unblocking it and the popped value.
* <p>
* When blocking, if a non-zero timeout is specified, the client will unblock returning a nil
* special value if the specified amount of seconds passed without a push operation against at
* least one of the specified keys.
* <p>
* The timeout argument is interpreted as an integer value. A timeout of zero means instead to
* block forever.
* <p>
* <b>Multiple clients blocking for the same keys</b>
* <p>
* Multiple clients can block for the same key. They are put into a queue, so the first to be
* served will be the one that started to wait earlier, in a first-blpopping first-served fashion.
* <p>
* <b>blocking POP inside a MULTI/EXEC transaction</b>
* <p>
* BLPOP and BRPOP can be used with pipelining (sending multiple commands and reading the replies
* in batch), but it does not make sense to use BLPOP or BRPOP inside a MULTI/EXEC block (a Redis
* transaction).
* <p>
* The behavior of BLPOP inside MULTI/EXEC when the list is empty is to return a multi-bulk nil
* reply, exactly what happens when the timeout is reached. If you like science fiction, think at
* it like if inside MULTI/EXEC the time will flow at infinite speed :)
* <p>
* Time complexity: O(1)
* @see #brpop(int, byte[]...)
* @param timeout
* @param keys
* @return BLPOP returns a two-elements array via a multi bulk reply in order to return both the
* unblocking key and the popped value.
* <p>
* When a non-zero timeout is specified, and the BLPOP operation timed out, the return
* value is a nil multi bulk reply. Most client values will return false or nil
* accordingly to the programming language used.
*/
@Override
public List<byte[]> blpop(final int timeout, final byte[]... keys) {
return blpop(getArgsAddTimeout(timeout, keys));
}
private byte[][] getArgsAddTimeout(int timeout, byte[][] keys) {
int size = keys.length;
final byte[][] args = new byte[size + 1][];
for (int at = 0; at != size; ++at) {
args[at] = keys[at];
}
args[size] = Protocol.toByteArray(timeout);
return args;
}
/**
* Sort a Set or a List accordingly to the specified parameters and store the result at dstkey.
* @see #sort(byte[], SortingParams)
* @see #sort(byte[])
* @see #sort(byte[], byte[])
* @param key
* @param sortingParameters
* @param dstkey
* @return The number of elements of the list at dstkey.
*/
@Override
public Long sort(final byte[] key, final SortingParams sortingParameters, final byte[] dstkey) {
checkIsInMultiOrPipeline();
client.sort(key, sortingParameters, dstkey);
return client.getIntegerReply();
}
/**
* Sort a Set or a List and Store the Result at dstkey.
* <p>
* Sort the elements contained in the List, Set, or Sorted Set value at key and store the result
* at dstkey. By default sorting is numeric with elements being compared as double precision
* floating point numbers. This is the simplest form of SORT.
* @see #sort(byte[])
* @see #sort(byte[], SortingParams)
* @see #sort(byte[], SortingParams, byte[])
* @param key
* @param dstkey
* @return The number of elements of the list at dstkey.
*/
@Override
public Long sort(final byte[] key, final byte[] dstkey) {
checkIsInMultiOrPipeline();
client.sort(key, dstkey);
return client.getIntegerReply();
}
/**
* BLPOP (and BRPOP) is a blocking list pop primitive. You can see this commands as blocking
* versions of LPOP and RPOP able to block if the specified keys don't exist or contain empty
* lists.
* <p>
* The following is a description of the exact semantic. We describe BLPOP but the two commands
* are identical, the only difference is that BLPOP pops the element from the left (head) of the
* list, and BRPOP pops from the right (tail).
* <p>
* <b>Non blocking behavior</b>
* <p>
* When BLPOP is called, if at least one of the specified keys contain a non empty list, an
* element is popped from the head of the list and returned to the caller together with the name
* of the key (BLPOP returns a two elements array, the first element is the key, the second the
* popped value).
* <p>
* Keys are scanned from left to right, so for instance if you issue BLPOP list1 list2 list3 0
* against a dataset where list1 does not exist but list2 and list3 contain non empty lists, BLPOP
* guarantees to return an element from the list stored at list2 (since it is the first non empty
* list starting from the left).
* <p>
* <b>Blocking behavior</b>
* <p>
* If none of the specified keys exist or contain non empty lists, BLPOP blocks until some other
* client performs a LPUSH or an RPUSH operation against one of the lists.
* <p>
* Once new data is present on one of the lists, the client finally returns with the name of the
* key unblocking it and the popped value.
* <p>
* When blocking, if a non-zero timeout is specified, the client will unblock returning a nil
* special value if the specified amount of seconds passed without a push operation against at
* least one of the specified keys.
* <p>
* The timeout argument is interpreted as an integer value. A timeout of zero means instead to
* block forever.
* <p>
* <b>Multiple clients blocking for the same keys</b>
* <p>
* Multiple clients can block for the same key. They are put into a queue, so the first to be
* served will be the one that started to wait earlier, in a first-blpopping first-served fashion.
* <p>
* <b>blocking POP inside a MULTI/EXEC transaction</b>
* <p>
* BLPOP and BRPOP can be used with pipelining (sending multiple commands and reading the replies
* in batch), but it does not make sense to use BLPOP or BRPOP inside a MULTI/EXEC block (a Redis
* transaction).
* <p>
* The behavior of BLPOP inside MULTI/EXEC when the list is empty is to return a multi-bulk nil
* reply, exactly what happens when the timeout is reached. If you like science fiction, think at
* it like if inside MULTI/EXEC the time will flow at infinite speed :)
* <p>
* Time complexity: O(1)
* @see #blpop(int, byte[]...)
* @param timeout
* @param keys
* @return BLPOP returns a two-elements array via a multi bulk reply in order to return both the
* unblocking key and the popped value.
* <p>
* When a non-zero timeout is specified, and the BLPOP operation timed out, the return
* value is a nil multi bulk reply. Most client values will return false or nil
* accordingly to the programming language used.
*/
@Override
public List<byte[]> brpop(final int timeout, final byte[]... keys) {
return brpop(getArgsAddTimeout(timeout, keys));
}
@Override
public List<byte[]> blpop(byte[]... args) {
checkIsInMultiOrPipeline();
client.blpop(args);
client.setTimeoutInfinite();
try {
return client.getBinaryMultiBulkReply();
} finally {
client.rollbackTimeout();
}
}
@Override
public List<byte[]> brpop(byte[]... args) {
checkIsInMultiOrPipeline();
client.brpop(args);
client.setTimeoutInfinite();
try {
return client.getBinaryMultiBulkReply();
} finally {
client.rollbackTimeout();
}
}
/**
* Request for authentication in a password protected Redis server. A Redis server can be
* instructed to require a password before to allow clients to issue commands. This is done using
* the requirepass directive in the Redis configuration file. If the password given by the client
* is correct the server replies with an OK status code reply and starts accepting commands from
* the client. Otherwise an error is returned and the clients needs to try a new password. Note
* that for the high performance nature of Redis it is possible to try a lot of passwords in
* parallel in very short time, so make sure to generate a strong and very long password so that
* this attack is infeasible.
* @param password
* @return Status code reply
*/
@Override
public String auth(final String password) {
checkIsInMultiOrPipeline();
client.auth(password);
return client.getStatusCodeReply();
}
public Pipeline pipelined() {
pipeline = new Pipeline();
pipeline.setClient(client);
return pipeline;
}
@Override
public Long zcount(final byte[] key, final double min, final double max) {
return zcount(key, toByteArray(min), toByteArray(max));
}
@Override
public Long zcount(final byte[] key, final byte[] min, final byte[] max) {
checkIsInMultiOrPipeline();
client.zcount(key, min, max);
return client.getIntegerReply();
}
/**
* Return the all the elements in the sorted set at key with a score between min and max
* (including elements with score equal to min or max).
* <p>
* The elements having the same score are returned sorted lexicographically as ASCII strings (this
* follows from a property of Redis sorted sets and does not involve further computation).
* <p>
* Using the optional {@link #zrangeByScore(byte[], double, double, int, int) LIMIT} it's possible
* to get only a range of the matching elements in an SQL-alike way. Note that if offset is large
* the commands needs to traverse the list for offset elements and this adds up to the O(M)
* figure.
* <p>
* The {@link #zcount(byte[], double, double) ZCOUNT} command is similar to
* {@link #zrangeByScore(byte[], double, double) ZRANGEBYSCORE} but instead of returning the
* actual elements in the specified interval, it just returns the number of matching elements.
* <p>
* <b>Exclusive intervals and infinity</b>
* <p>
* min and max can be -inf and +inf, so that you are not required to know what's the greatest or
* smallest element in order to take, for instance, elements "up to a given value".
* <p>
* Also while the interval is for default closed (inclusive) it's possible to specify open
* intervals prefixing the score with a "(" character, so for instance:
* <p>
* {@code ZRANGEBYSCORE zset (1.3 5}
* <p>
* Will return all the values with score > 1.3 and <= 5, while for instance:
* <p>
* {@code ZRANGEBYSCORE zset (5 (10}
* <p>
* Will return all the values with score > 5 and < 10 (5 and 10 excluded).
* <p>
* <b>Time complexity:</b>
* <p>
* O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of
* elements returned by the command, so if M is constant (for instance you always ask for the
* first ten elements with LIMIT) you can consider it O(log(N))
* @see #zrangeByScore(byte[], double, double)
* @see #zrangeByScore(byte[], double, double, int, int)
* @see #zrangeByScoreWithScores(byte[], double, double)
* @see #zrangeByScoreWithScores(byte[], double, double, int, int)
* @see #zcount(byte[], double, double)
* @param key
* @param min
* @param max
* @return Multi bulk reply specifically a list of elements in the specified score range.
*/
@Override
public Set<byte[]> zrangeByScore(final byte[] key, final double min, final double max) {
return zrangeByScore(key, toByteArray(min), toByteArray(max));
}
@Override
public Set<byte[]> zrangeByScore(final byte[] key, final byte[] min, final byte[] max) {
checkIsInMultiOrPipeline();
client.zrangeByScore(key, min, max);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
/**
* Return the all the elements in the sorted set at key with a score between min and max
* (including elements with score equal to min or max).
* <p>
* The elements having the same score are returned sorted lexicographically as ASCII strings (this
* follows from a property of Redis sorted sets and does not involve further computation).
* <p>
* Using the optional {@link #zrangeByScore(byte[], double, double, int, int) LIMIT} it's possible
* to get only a range of the matching elements in an SQL-alike way. Note that if offset is large
* the commands needs to traverse the list for offset elements and this adds up to the O(M)
* figure.
* <p>
* The {@link #zcount(byte[], double, double) ZCOUNT} command is similar to
* {@link #zrangeByScore(byte[], double, double) ZRANGEBYSCORE} but instead of returning the
* actual elements in the specified interval, it just returns the number of matching elements.
* <p>
* <b>Exclusive intervals and infinity</b>
* <p>
* min and max can be -inf and +inf, so that you are not required to know what's the greatest or
* smallest element in order to take, for instance, elements "up to a given value".
* <p>
* Also while the interval is for default closed (inclusive) it's possible to specify open
* intervals prefixing the score with a "(" character, so for instance:
* <p>
* {@code ZRANGEBYSCORE zset (1.3 5}
* <p>
* Will return all the values with score > 1.3 and <= 5, while for instance:
* <p>
* {@code ZRANGEBYSCORE zset (5 (10}
* <p>
* Will return all the values with score > 5 and < 10 (5 and 10 excluded).
* <p>
* <b>Time complexity:</b>
* <p>
* O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of
* elements returned by the command, so if M is constant (for instance you always ask for the
* first ten elements with LIMIT) you can consider it O(log(N))
* @see #zrangeByScore(byte[], double, double)
* @see #zrangeByScore(byte[], double, double, int, int)
* @see #zrangeByScoreWithScores(byte[], double, double)
* @see #zrangeByScoreWithScores(byte[], double, double, int, int)
* @see #zcount(byte[], double, double)
* @param key
* @param min
* @param max
* @return Multi bulk reply specifically a list of elements in the specified score range.
*/
@Override
public Set<byte[]> zrangeByScore(final byte[] key, final double min, final double max,
final int offset, final int count) {
return zrangeByScore(key, toByteArray(min), toByteArray(max), offset, count);
}
@Override
public Set<byte[]> zrangeByScore(final byte[] key, final byte[] min, final byte[] max,
final int offset, final int count) {
checkIsInMultiOrPipeline();
client.zrangeByScore(key, min, max, offset, count);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
/**
* Return the all the elements in the sorted set at key with a score between min and max
* (including elements with score equal to min or max).
* <p>
* The elements having the same score are returned sorted lexicographically as ASCII strings (this
* follows from a property of Redis sorted sets and does not involve further computation).
* <p>
* Using the optional {@link #zrangeByScore(byte[], double, double, int, int) LIMIT} it's possible
* to get only a range of the matching elements in an SQL-alike way. Note that if offset is large
* the commands needs to traverse the list for offset elements and this adds up to the O(M)
* figure.
* <p>
* The {@link #zcount(byte[], double, double) ZCOUNT} command is similar to
* {@link #zrangeByScore(byte[], double, double) ZRANGEBYSCORE} but instead of returning the
* actual elements in the specified interval, it just returns the number of matching elements.
* <p>
* <b>Exclusive intervals and infinity</b>
* <p>
* min and max can be -inf and +inf, so that you are not required to know what's the greatest or
* smallest element in order to take, for instance, elements "up to a given value".
* <p>
* Also while the interval is for default closed (inclusive) it's possible to specify open
* intervals prefixing the score with a "(" character, so for instance:
* <p>
* {@code ZRANGEBYSCORE zset (1.3 5}
* <p>
* Will return all the values with score > 1.3 and <= 5, while for instance:
* <p>
* {@code ZRANGEBYSCORE zset (5 (10}
* <p>
* Will return all the values with score > 5 and < 10 (5 and 10 excluded).
* <p>
* <b>Time complexity:</b>
* <p>
* O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of
* elements returned by the command, so if M is constant (for instance you always ask for the
* first ten elements with LIMIT) you can consider it O(log(N))
* @see #zrangeByScore(byte[], double, double)
* @see #zrangeByScore(byte[], double, double, int, int)
* @see #zrangeByScoreWithScores(byte[], double, double)
* @see #zrangeByScoreWithScores(byte[], double, double, int, int)
* @see #zcount(byte[], double, double)
* @param key
* @param min
* @param max
* @return Multi bulk reply specifically a list of elements in the specified score range.
*/
@Override
public Set<Tuple> zrangeByScoreWithScores(final byte[] key, final double min, final double max) {
return zrangeByScoreWithScores(key, toByteArray(min), toByteArray(max));
}
@Override
public Set<Tuple> zrangeByScoreWithScores(final byte[] key, final byte[] min, final byte[] max) {
checkIsInMultiOrPipeline();
client.zrangeByScoreWithScores(key, min, max);
return getBinaryTupledSet();
}
/**
* Return the all the elements in the sorted set at key with a score between min and max
* (including elements with score equal to min or max).
* <p>
* The elements having the same score are returned sorted lexicographically as ASCII strings (this
* follows from a property of Redis sorted sets and does not involve further computation).
* <p>
* Using the optional {@link #zrangeByScore(byte[], double, double, int, int) LIMIT} it's possible
* to get only a range of the matching elements in an SQL-alike way. Note that if offset is large
* the commands needs to traverse the list for offset elements and this adds up to the O(M)
* figure.
* <p>
* The {@link #zcount(byte[], double, double) ZCOUNT} command is similar to
* {@link #zrangeByScore(byte[], double, double) ZRANGEBYSCORE} but instead of returning the
* actual elements in the specified interval, it just returns the number of matching elements.
* <p>
* <b>Exclusive intervals and infinity</b>
* <p>
* min and max can be -inf and +inf, so that you are not required to know what's the greatest or
* smallest element in order to take, for instance, elements "up to a given value".
* <p>
* Also while the interval is for default closed (inclusive) it's possible to specify open
* intervals prefixing the score with a "(" character, so for instance:
* <p>
* {@code ZRANGEBYSCORE zset (1.3 5}
* <p>
* Will return all the values with score > 1.3 and <= 5, while for instance:
* <p>
* {@code ZRANGEBYSCORE zset (5 (10}
* <p>
* Will return all the values with score > 5 and < 10 (5 and 10 excluded).
* <p>
* <b>Time complexity:</b>
* <p>
* O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of
* elements returned by the command, so if M is constant (for instance you always ask for the
* first ten elements with LIMIT) you can consider it O(log(N))
* @see #zrangeByScore(byte[], double, double)
* @see #zrangeByScore(byte[], double, double, int, int)
* @see #zrangeByScoreWithScores(byte[], double, double)
* @see #zrangeByScoreWithScores(byte[], double, double, int, int)
* @see #zcount(byte[], double, double)
* @param key
* @param min
* @param max
* @return Multi bulk reply specifically a list of elements in the specified score range.
*/
@Override
public Set<Tuple> zrangeByScoreWithScores(final byte[] key, final double min, final double max,
final int offset, final int count) {
return zrangeByScoreWithScores(key, toByteArray(min), toByteArray(max), offset, count);
}
@Override
public Set<Tuple> zrangeByScoreWithScores(final byte[] key, final byte[] min, final byte[] max,
final int offset, final int count) {
checkIsInMultiOrPipeline();
client.zrangeByScoreWithScores(key, min, max, offset, count);
return getBinaryTupledSet();
}
private Set<Tuple> getBinaryTupledSet() {
checkIsInMultiOrPipeline();
List<byte[]> membersWithScores = client.getBinaryMultiBulkReply();
if (membersWithScores.size() == 0) {
return Collections.emptySet();
}
Set<Tuple> set = new LinkedHashSet<Tuple>(membersWithScores.size() / 2, 1.0f);
Iterator<byte[]> iterator = membersWithScores.iterator();
while (iterator.hasNext()) {
set.add(new Tuple(iterator.next(), Double.valueOf(SafeEncoder.encode(iterator.next()))));
}
return set;
}
@Override
public Set<byte[]> zrevrangeByScore(final byte[] key, final double max, final double min) {
return zrevrangeByScore(key, toByteArray(max), toByteArray(min));
}
@Override
public Set<byte[]> zrevrangeByScore(final byte[] key, final byte[] max, final byte[] min) {
checkIsInMultiOrPipeline();
client.zrevrangeByScore(key, max, min);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
@Override
public Set<byte[]> zrevrangeByScore(final byte[] key, final double max, final double min,
final int offset, final int count) {
return zrevrangeByScore(key, toByteArray(max), toByteArray(min), offset, count);
}
@Override
public Set<byte[]> zrevrangeByScore(final byte[] key, final byte[] max, final byte[] min,
final int offset, final int count) {
checkIsInMultiOrPipeline();
client.zrevrangeByScore(key, max, min, offset, count);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
@Override
public Set<Tuple> zrevrangeByScoreWithScores(final byte[] key, final double max, final double min) {
return zrevrangeByScoreWithScores(key, toByteArray(max), toByteArray(min));
}
@Override
public Set<Tuple> zrevrangeByScoreWithScores(final byte[] key, final double max,
final double min, final int offset, final int count) {
return zrevrangeByScoreWithScores(key, toByteArray(max), toByteArray(min), offset, count);
}
@Override
public Set<Tuple> zrevrangeByScoreWithScores(final byte[] key, final byte[] max, final byte[] min) {
checkIsInMultiOrPipeline();
client.zrevrangeByScoreWithScores(key, max, min);
return getBinaryTupledSet();
}
@Override
public Set<Tuple> zrevrangeByScoreWithScores(final byte[] key, final byte[] max,
final byte[] min, final int offset, final int count) {
checkIsInMultiOrPipeline();
client.zrevrangeByScoreWithScores(key, max, min, offset, count);
return getBinaryTupledSet();
}
/**
* Remove all elements in the sorted set at key with rank between start and end. Start and end are
* 0-based with rank 0 being the element with the lowest score. Both start and end can be negative
* numbers, where they indicate offsets starting at the element with the highest rank. For
* example: -1 is the element with the highest score, -2 the element with the second highest score
* and so forth.
* <p>
* <b>Time complexity:</b> O(log(N))+O(M) with N being the number of elements in the sorted set
* and M the number of elements removed by the operation
*/
@Override
public Long zremrangeByRank(final byte[] key, final long start, final long end) {
checkIsInMultiOrPipeline();
client.zremrangeByRank(key, start, end);
return client.getIntegerReply();
}
/**
* Remove all the elements in the sorted set at key with a score between min and max (including
* elements with score equal to min or max).
* <p>
* <b>Time complexity:</b>
* <p>
* O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of
* elements removed by the operation
* @param key
* @param start
* @param end
* @return Integer reply, specifically the number of elements removed.
*/
@Override
public Long zremrangeByScore(final byte[] key, final double start, final double end) {
return zremrangeByScore(key, toByteArray(start), toByteArray(end));
}
@Override
public Long zremrangeByScore(final byte[] key, final byte[] start, final byte[] end) {
checkIsInMultiOrPipeline();
client.zremrangeByScore(key, start, end);
return client.getIntegerReply();
}
/**
* Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
* dstkey. It is mandatory to provide the number of input keys N, before passing the input keys
* and the other (optional) arguments.
* <p>
* As the terms imply, the {@link #zinterstore(byte[], byte[]...)} ZINTERSTORE} command requires
* an element to be present in each of the given inputs to be inserted in the result. The {@link
* #zunionstore(byte[], byte[]...)} command inserts all elements across all inputs.
* <p>
* Using the WEIGHTS option, it is possible to add weight to each input sorted set. This means
* that the score of each element in the sorted set is first multiplied by this weight before
* being passed to the aggregation. When this option is not given, all weights default to 1.
* <p>
* With the AGGREGATE option, it's possible to specify how the results of the union or
* intersection are aggregated. This option defaults to SUM, where the score of an element is
* summed across the inputs where it exists. When this option is set to be either MIN or MAX, the
* resulting set will contain the minimum or maximum score of an element across the inputs where
* it exists.
* <p>
* <b>Time complexity:</b> O(N) + O(M log(M)) with N being the sum of the sizes of the input
* sorted sets, and M being the number of elements in the resulting sorted set
* @see #zunionstore(byte[], byte[]...)
* @see #zunionstore(byte[], ZParams, byte[]...)
* @see #zinterstore(byte[], byte[]...)
* @see #zinterstore(byte[], ZParams, byte[]...)
* @param dstkey
* @param sets
* @return Integer reply, specifically the number of elements in the sorted set at dstkey
*/
@Override
public Long zunionstore(final byte[] dstkey, final byte[]... sets) {
checkIsInMultiOrPipeline();
client.zunionstore(dstkey, sets);
return client.getIntegerReply();
}
/**
* Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
* dstkey. It is mandatory to provide the number of input keys N, before passing the input keys
* and the other (optional) arguments.
* <p>
* As the terms imply, the {@link #zinterstore(byte[], byte[]...) ZINTERSTORE} command requires an
* element to be present in each of the given inputs to be inserted in the result. The {@link
* #zunionstore(byte[], byte[]...) ZUNIONSTORE} command inserts all elements across all inputs.
* <p>
* Using the WEIGHTS option, it is possible to add weight to each input sorted set. This means
* that the score of each element in the sorted set is first multiplied by this weight before
* being passed to the aggregation. When this option is not given, all weights default to 1.
* <p>
* With the AGGREGATE option, it's possible to specify how the results of the union or
* intersection are aggregated. This option defaults to SUM, where the score of an element is
* summed across the inputs where it exists. When this option is set to be either MIN or MAX, the
* resulting set will contain the minimum or maximum score of an element across the inputs where
* it exists.
* <p>
* <b>Time complexity:</b> O(N) + O(M log(M)) with N being the sum of the sizes of the input
* sorted sets, and M being the number of elements in the resulting sorted set
* @see #zunionstore(byte[], byte[]...)
* @see #zunionstore(byte[], ZParams, byte[]...)
* @see #zinterstore(byte[], byte[]...)
* @see #zinterstore(byte[], ZParams, byte[]...)
* @param dstkey
* @param sets
* @param params
* @return Integer reply, specifically the number of elements in the sorted set at dstkey
*/
@Override
public Long zunionstore(final byte[] dstkey, final ZParams params, final byte[]... sets) {
checkIsInMultiOrPipeline();
client.zunionstore(dstkey, params, sets);
return client.getIntegerReply();
}
/**
* Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
* dstkey. It is mandatory to provide the number of input keys N, before passing the input keys
* and the other (optional) arguments.
* <p>
* As the terms imply, the {@link #zinterstore(byte[], byte[]...) ZINTERSTORE} command requires an
* element to be present in each of the given inputs to be inserted in the result. The {@link
* #zunionstore(byte[], byte[]...) ZUNIONSTORE} command inserts all elements across all inputs.
* <p>
* Using the WEIGHTS option, it is possible to add weight to each input sorted set. This means
* that the score of each element in the sorted set is first multiplied by this weight before
* being passed to the aggregation. When this option is not given, all weights default to 1.
* <p>
* With the AGGREGATE option, it's possible to specify how the results of the union or
* intersection are aggregated. This option defaults to SUM, where the score of an element is
* summed across the inputs where it exists. When this option is set to be either MIN or MAX, the
* resulting set will contain the minimum or maximum score of an element across the inputs where
* it exists.
* <p>
* <b>Time complexity:</b> O(N) + O(M log(M)) with N being the sum of the sizes of the input
* sorted sets, and M being the number of elements in the resulting sorted set
* @see #zunionstore(byte[], byte[]...)
* @see #zunionstore(byte[], ZParams, byte[]...)
* @see #zinterstore(byte[], byte[]...)
* @see #zinterstore(byte[], ZParams, byte[]...)
* @param dstkey
* @param sets
* @return Integer reply, specifically the number of elements in the sorted set at dstkey
*/
@Override
public Long zinterstore(final byte[] dstkey, final byte[]... sets) {
checkIsInMultiOrPipeline();
client.zinterstore(dstkey, sets);
return client.getIntegerReply();
}
/**
* Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
* dstkey. It is mandatory to provide the number of input keys N, before passing the input keys
* and the other (optional) arguments.
* <p>
* As the terms imply, the {@link #zinterstore(byte[], byte[]...) ZINTERSTORE} command requires an
* element to be present in each of the given inputs to be inserted in the result. The {@link
* #zunionstore(byte[], byte[]...) ZUNIONSTORE} command inserts all elements across all inputs.
* <p>
* Using the WEIGHTS option, it is possible to add weight to each input sorted set. This means
* that the score of each element in the sorted set is first multiplied by this weight before
* being passed to the aggregation. When this option is not given, all weights default to 1.
* <p>
* With the AGGREGATE option, it's possible to specify how the results of the union or
* intersection are aggregated. This option defaults to SUM, where the score of an element is
* summed across the inputs where it exists. When this option is set to be either MIN or MAX, the
* resulting set will contain the minimum or maximum score of an element across the inputs where
* it exists.
* <p>
* <b>Time complexity:</b> O(N) + O(M log(M)) with N being the sum of the sizes of the input
* sorted sets, and M being the number of elements in the resulting sorted set
* @see #zunionstore(byte[], byte[]...)
* @see #zunionstore(byte[], ZParams, byte[]...)
* @see #zinterstore(byte[], byte[]...)
* @see #zinterstore(byte[], ZParams, byte[]...)
* @param dstkey
* @param sets
* @param params
* @return Integer reply, specifically the number of elements in the sorted set at dstkey
*/
@Override
public Long zinterstore(final byte[] dstkey, final ZParams params, final byte[]... sets) {
checkIsInMultiOrPipeline();
client.zinterstore(dstkey, params, sets);
return client.getIntegerReply();
}
@Override
public Long zlexcount(final byte[] key, final byte[] min, final byte[] max) {
checkIsInMultiOrPipeline();
client.zlexcount(key, min, max);
return client.getIntegerReply();
}
@Override
public Set<byte[]> zrangeByLex(final byte[] key, final byte[] min, final byte[] max) {
checkIsInMultiOrPipeline();
client.zrangeByLex(key, min, max);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
@Override
public Set<byte[]> zrangeByLex(final byte[] key, final byte[] min, final byte[] max,
final int offset, final int count) {
checkIsInMultiOrPipeline();
client.zrangeByLex(key, min, max, offset, count);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
@Override
public Set<byte[]> zrevrangeByLex(byte[] key, byte[] max, byte[] min) {
checkIsInMultiOrPipeline();
client.zrevrangeByLex(key, max, min);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
@Override
public Set<byte[]> zrevrangeByLex(byte[] key, byte[] max, byte[] min, int offset, int count) {
checkIsInMultiOrPipeline();
client.zrevrangeByLex(key, max, min, offset, count);
return SetFromList.of(client.getBinaryMultiBulkReply());
}
@Override
public Long zremrangeByLex(final byte[] key, final byte[] min, final byte[] max) {
checkIsInMultiOrPipeline();
client.zremrangeByLex(key, min, max);
return client.getIntegerReply();
}
/**
* Synchronously save the DB on disk.
* <p>
* Save the whole dataset on disk (this means that all the databases are saved, as well as keys
* with an EXPIRE set (the expire is preserved). The server hangs while the saving is not
* completed, no connection is served in the meanwhile. An OK code is returned when the DB was
* fully stored in disk.
* <p>
* The background variant of this command is {@link #bgsave() BGSAVE} that is able to perform the
* saving in the background while the server continues serving other clients.
* <p>
* @return Status code reply
*/
@Override
public String save() {
client.save();
return client.getStatusCodeReply();
}
/**
* Asynchronously save the DB on disk.
* <p>
* Save the DB in background. The OK code is immediately returned. Redis forks, the parent
* continues to server the clients, the child saves the DB on disk then exit. A client my be able
* to check if the operation succeeded using the LASTSAVE command.
* @return Status code reply
*/
@Override
public String bgsave() {
client.bgsave();
return client.getStatusCodeReply();
}
/**
* Rewrite the append only file in background when it gets too big. Please for detailed
* information about the Redis Append Only File check the <a
* href="http://redis.io/topics/persistence#append-only-file">Append Only File Howto</a>.
* <p>
* BGREWRITEAOF rewrites the Append Only File in background when it gets too big. The Redis Append
* Only File is a Journal, so every operation modifying the dataset is logged in the Append Only
* File (and replayed at startup). This means that the Append Only File always grows. In order to
* rebuild its content the BGREWRITEAOF creates a new version of the append only file starting
* directly form the dataset in memory in order to guarantee the generation of the minimal number
* of commands needed to rebuild the database.
* <p>
* @return Status code reply
*/
@Override
public String bgrewriteaof() {
client.bgrewriteaof();
return client.getStatusCodeReply();
}
/**
* Return the UNIX time stamp of the last successfully saving of the dataset on disk.
* <p>
* Return the UNIX TIME of the last DB save executed with success. A client may check if a
* {@link #bgsave() BGSAVE} command succeeded reading the LASTSAVE value, then issuing a BGSAVE
* command and checking at regular intervals every N seconds if LASTSAVE changed.
* @return Integer reply, specifically an UNIX time stamp.
*/
@Override
public Long lastsave() {
client.lastsave();
return client.getIntegerReply();
}
/**
* Synchronously save the DB on disk, then shutdown the server.
* <p>
* Stop all the clients, save the DB, then quit the server. This commands makes sure that the DB
* is switched off without the lost of any data. This is not guaranteed if the client uses simply
* {@link #save() SAVE} and then {@link #quit() QUIT} because other clients may alter the DB data
* between the two commands.
* @return Status code reply on error. On success nothing is returned since the server quits and
* the connection is closed.
*/
@Override
public String shutdown() {
client.shutdown();
String status;
try {
status = client.getStatusCodeReply();
} catch (JedisException ex) {
status = null;
}
return status;
}
/**
* Provide information and statistics about the server.
* <p>
* The info command returns different information and statistics about the server in an format
* that's simple to parse by computers and easy to read by humans.
* <p>
* <b>Format of the returned String:</b>
* <p>
* All the fields are in the form field:value
*
* <pre>
* edis_version:0.07
* connected_clients:1
* connected_slaves:0
* used_memory:3187
* changes_since_last_save:0
* last_save_time:1237655729
* total_connections_received:1
* total_commands_processed:1
* uptime_in_seconds:25
* uptime_in_days:0
* </pre>
*
* <b>Notes</b>
* <p>
* used_memory is returned in bytes, and is the total number of bytes allocated by the program
* using malloc.
* <p>
* uptime_in_days is redundant since the uptime in seconds contains already the full uptime
* information, this field is only mainly present for humans.
* <p>
* changes_since_last_save does not refer to the number of key changes, but to the number of
* operations that produced some kind of change in the dataset.
* <p>
* @return Bulk reply
*/
@Override
public String info() {
client.info();
return client.getBulkReply();
}
@Override
public String info(final String section) {
client.info(section);
return client.getBulkReply();
}
/**
* Dump all the received requests in real time.
* <p>
* MONITOR is a debugging command that outputs the whole sequence of commands received by the
* Redis server. is very handy in order to understand what is happening into the database. This
* command is used directly via telnet.
* @param jedisMonitor
*/
public void monitor(final JedisMonitor jedisMonitor) {
client.monitor();
client.getStatusCodeReply();
jedisMonitor.proceed(client);
}
/**
* Change the replication settings.
* <p>
* The SLAVEOF command can change the replication settings of a slave on the fly. If a Redis
* server is arleady acting as slave, the command SLAVEOF NO ONE will turn off the replicaiton
* turning the Redis server into a MASTER. In the proper form SLAVEOF hostname port will make the
* server a slave of the specific server listening at the specified hostname and port.
* <p>
* If a server is already a slave of some master, SLAVEOF hostname port will stop the replication
* against the old server and start the synchrnonization against the new one discarding the old
* dataset.
* <p>
* The form SLAVEOF no one will stop replication turning the server into a MASTER but will not
* discard the replication. So if the old master stop working it is possible to turn the slave
* into a master and set the application to use the new master in read/write. Later when the other
* Redis server will be fixed it can be configured in order to work as slave.
* <p>
* @param host
* @param port
* @return Status code reply
*/
@Override
public String slaveof(final String host, final int port) {
client.slaveof(host, port);
return client.getStatusCodeReply();
}
@Override
public String slaveofNoOne() {
client.slaveofNoOne();
return client.getStatusCodeReply();
}
/**
* Retrieve the configuration of a running Redis server. Not all the configuration parameters are
* supported.
* <p>
* CONFIG GET returns the current configuration parameters. This sub command only accepts a single
* argument, that is glob style pattern. All the configuration parameters matching this parameter
* are reported as a list of key-value pairs.
* <p>
* <b>Example:</b>
*
* <pre>
* $ redis-cli config get '*'
* 1. "dbfilename"
* 2. "dump.rdb"
* 3. "requirepass"
* 4. (nil)
* 5. "masterauth"
* 6. (nil)
* 7. "maxmemory"
* 8. "0\n"
* 9. "appendfsync"
* 10. "everysec"
* 11. "save"
* 12. "3600 1 300 100 60 10000"
*
* $ redis-cli config get 'm*'
* 1. "masterauth"
* 2. (nil)
* 3. "maxmemory"
* 4. "0\n"
* </pre>
* @param pattern
* @return Bulk reply.
*/
@Override
public List<byte[]> configGet(final byte[] pattern) {
client.configGet(pattern);
return client.getBinaryMultiBulkReply();
}
/**
* Reset the stats returned by INFO
* @return
*/
@Override
public String configResetStat() {
client.configResetStat();
return client.getStatusCodeReply();
}
/**
* Alter the configuration of a running Redis server. Not all the configuration parameters are
* supported.
* <p>
* The list of configuration parameters supported by CONFIG SET can be obtained issuing a
* {@link #configGet(byte[]) CONFIG GET *} command.
* <p>
* The configuration set using CONFIG SET is immediately loaded by the Redis server that will
* start acting as specified starting from the next command.
* <p>
* <b>Parameters value format</b>
* <p>
* The value of the configuration parameter is the same as the one of the same parameter in the
* Redis configuration file, with the following exceptions:
* <p>
* <ul>
* <li>The save paramter is a list of space-separated integers. Every pair of integers specify the
* time and number of changes limit to trigger a save. For instance the command CONFIG SET save
* "3600 10 60 10000" will configure the server to issue a background saving of the RDB file every
* 3600 seconds if there are at least 10 changes in the dataset, and every 60 seconds if there are
* at least 10000 changes. To completely disable automatic snapshots just set the parameter as an
* empty string.
* <li>All the integer parameters representing memory are returned and accepted only using bytes
* as unit.
* </ul>
* @param parameter
* @param value
* @return Status code reply
*/
@Override
public byte[] configSet(final byte[] parameter, final byte[] value) {
client.configSet(parameter, value);
return client.getBinaryBulkReply();
}
public boolean isConnected() {
return client.isConnected();
}
@Override
public Long strlen(final byte[] key) {
client.strlen(key);
return client.getIntegerReply();
}
public void sync() {
client.sync();
}
@Override
public Long lpushx(final byte[] key, final byte[]... string) {
client.lpushx(key, string);
return client.getIntegerReply();
}
/**
* Undo a {@link #expire(byte[], int) expire} at turning the expire key into a normal key.
* <p>
* Time complexity: O(1)
* @param key
* @return Integer reply, specifically: 1: the key is now persist. 0: the key is not persist (only
* happens when key not set).
*/
@Override
public Long persist(final byte[] key) {
client.persist(key);
return client.getIntegerReply();
}
@Override
public Long rpushx(final byte[] key, final byte[]... string) {
client.rpushx(key, string);
return client.getIntegerReply();
}
@Override
public byte[] echo(final byte[] string) {
client.echo(string);
return client.getBinaryBulkReply();
}
@Override
public Long linsert(final byte[] key, final LIST_POSITION where, final byte[] pivot,
final byte[] value) {
client.linsert(key, where, pivot, value);
return client.getIntegerReply();
}
@Override
public String debug(final DebugParams params) {
client.debug(params);
return client.getStatusCodeReply();
}
public Client getClient() {
return client;
}
/**
* Pop a value from a list, push it to another list and return it; or block until one is available
* @param source
* @param destination
* @param timeout
* @return the element
*/
@Override
public byte[] brpoplpush(byte[] source, byte[] destination, int timeout) {
client.brpoplpush(source, destination, timeout);
client.setTimeoutInfinite();
try {
return client.getBinaryBulkReply();
} finally {
client.rollbackTimeout();
}
}
/**
* Sets or clears the bit at offset in the string value stored at key
* @param key
* @param offset
* @param value
* @return
*/
@Override
public Boolean setbit(byte[] key, long offset, boolean value) {
client.setbit(key, offset, value);
return client.getIntegerReply() == 1;
}
@Override
public Boolean setbit(byte[] key, long offset, byte[] value) {
client.setbit(key, offset, value);
return client.getIntegerReply() == 1;
}
/**
* Returns the bit value at offset in the string value stored at key
* @param key
* @param offset
* @return
*/
@Override
public Boolean getbit(byte[] key, long offset) {
client.getbit(key, offset);
return client.getIntegerReply() == 1;
}
public Long bitpos(final byte[] key, final boolean value) {
return bitpos(key, value, new BitPosParams());
}
public Long bitpos(final byte[] key, final boolean value, final BitPosParams params) {
client.bitpos(key, value, params);
return client.getIntegerReply();
}
@Override
public Long setrange(byte[] key, long offset, byte[] value) {
client.setrange(key, offset, value);
return client.getIntegerReply();
}
@Override
public byte[] getrange(byte[] key, long startOffset, long endOffset) {
client.getrange(key, startOffset, endOffset);
return client.getBinaryBulkReply();
}
@Override
public Long publish(byte[] channel, byte[] message) {
client.publish(channel, message);
return client.getIntegerReply();
}
@Override
public void subscribe(BinaryJedisPubSub jedisPubSub, byte[]... channels) {
client.setTimeoutInfinite();
try {
jedisPubSub.proceed(client, channels);
} finally {
client.rollbackTimeout();
}
}
@Override
public void psubscribe(BinaryJedisPubSub jedisPubSub, byte[]... patterns) {
client.setTimeoutInfinite();
try {
jedisPubSub.proceedWithPatterns(client, patterns);
} finally {
client.rollbackTimeout();
}
}
@Override
public int getDB() {
return client.getDB();
}
/**
* Evaluates scripts using the Lua interpreter built into Redis starting from version 2.6.0.
* <p>
* @return Script result
*/
@Override
public Object eval(byte[] script, List<byte[]> keys, List<byte[]> args) {
return eval(script, toByteArray(keys.size()), getParamsWithBinary(keys, args));
}
protected static byte[][] getParamsWithBinary(List<byte[]> keys, List<byte[]> args) {
final int keyCount = keys.size();
final int argCount = args.size();
byte[][] params = new byte[keyCount + argCount][];
for (int i = 0; i < keyCount; i++)
params[i] = keys.get(i);
for (int i = 0; i < argCount; i++)
params[keyCount + i] = args.get(i);
return params;
}
@Override
public Object eval(byte[] script, byte[] keyCount, byte[]... params) {
client.setTimeoutInfinite();
try {
client.eval(script, keyCount, params);
return client.getOne();
} finally {
client.rollbackTimeout();
}
}
@Override
public Object eval(byte[] script, int keyCount, byte[]... params) {
return eval(script, toByteArray(keyCount), params);
}
@Override
public Object eval(byte[] script) {
return eval(script, 0);
}
@Override
public Object evalsha(byte[] sha1) {
return evalsha(sha1, 1);
}
@Override
public Object evalsha(byte[] sha1, List<byte[]> keys, List<byte[]> args) {
return evalsha(sha1, keys.size(), getParamsWithBinary(keys, args));
}
@Override
public Object evalsha(byte[] sha1, int keyCount, byte[]... params) {
client.setTimeoutInfinite();
try {
client.evalsha(sha1, keyCount, params);
return client.getOne();
} finally {
client.rollbackTimeout();
}
}
@Override
public String scriptFlush() {
client.scriptFlush();
return client.getStatusCodeReply();
}
public Long scriptExists(byte[] sha1) {
byte[][] a = new byte[1][];
a[0] = sha1;
return scriptExists(a).get(0);
}
@Override
public List<Long> scriptExists(byte[]... sha1) {
client.scriptExists(sha1);
return client.getIntegerMultiBulkReply();
}
@Override
public byte[] scriptLoad(byte[] script) {
client.scriptLoad(script);
return client.getBinaryBulkReply();
}
@Override
public String scriptKill() {
client.scriptKill();
return client.getStatusCodeReply();
}
@Override
public String slowlogReset() {
client.slowlogReset();
return client.getBulkReply();
}
@Override
public Long slowlogLen() {
client.slowlogLen();
return client.getIntegerReply();
}
@Override
public List<byte[]> slowlogGetBinary() {
client.slowlogGet();
return client.getBinaryMultiBulkReply();
}
@Override
public List<byte[]> slowlogGetBinary(long entries) {
client.slowlogGet(entries);
return client.getBinaryMultiBulkReply();
}
@Override
public Long objectRefcount(byte[] key) {
client.objectRefcount(key);
return client.getIntegerReply();
}
@Override
public byte[] objectEncoding(byte[] key) {
client.objectEncoding(key);
return client.getBinaryBulkReply();
}
@Override
public Long objectIdletime(byte[] key) {
client.objectIdletime(key);
return client.getIntegerReply();
}
@Override
public Long bitcount(final byte[] key) {
client.bitcount(key);
return client.getIntegerReply();
}
@Override
public Long bitcount(final byte[] key, long start, long end) {
client.bitcount(key, start, end);
return client.getIntegerReply();
}
@Override
public Long bitop(BitOP op, final byte[] destKey, byte[]... srcKeys) {
client.bitop(op, destKey, srcKeys);
return client.getIntegerReply();
}
public byte[] dump(final byte[] key) {
checkIsInMultiOrPipeline();
client.dump(key);
return client.getBinaryBulkReply();
}
public String restore(final byte[] key, final long ttl, final byte[] serializedValue) {
checkIsInMultiOrPipeline();
client.restore(key, ttl, serializedValue);
return client.getStatusCodeReply();
}
/**
* Set a timeout on the specified key. After the timeout the key will be automatically deleted by
* the server. A key with an associated timeout is said to be volatile in Redis terminology.
* <p>
* Voltile keys are stored on disk like the other keys, the timeout is persistent too like all the
* other aspects of the dataset. Saving a dataset containing expires and stopping the server does
* not stop the flow of time as Redis stores on disk the time when the key will no longer be
* available as Unix time, and not the remaining milliseconds.
* <p>
* Since Redis 2.1.3 you can update the value of the timeout of a key already having an expire
* set. It is also possible to undo the expire at all turning the key into a normal key using the
* {@link #persist(byte[]) PERSIST} command.
* <p>
* Time complexity: O(1)
* @see <ahref="http://redis.io/commands/pexpire">PEXPIRE Command</a>
* @param key
* @param milliseconds
* @return Integer reply, specifically: 1: the timeout was set. 0: the timeout was not set since
* the key already has an associated timeout (this may happen only in Redis versions <
* 2.1.3, Redis >= 2.1.3 will happily update the timeout), or the key does not exist.
*/
@Override
public Long pexpire(final byte[] key, final long milliseconds) {
checkIsInMultiOrPipeline();
client.pexpire(key, milliseconds);
return client.getIntegerReply();
}
@Override
public Long pexpireAt(final byte[] key, final long millisecondsTimestamp) {
checkIsInMultiOrPipeline();
client.pexpireAt(key, millisecondsTimestamp);
return client.getIntegerReply();
}
public Long pttl(final byte[] key) {
checkIsInMultiOrPipeline();
client.pttl(key);
return client.getIntegerReply();
}
/**
* PSETEX works exactly like {@link #setex(byte[], int, byte[])} with the sole difference that the
* expire time is specified in milliseconds instead of seconds. Time complexity: O(1)
* @param key
* @param milliseconds
* @param value
* @return Status code reply
*/
public String psetex(final byte[] key, final long milliseconds, final byte[] value) {
checkIsInMultiOrPipeline();
client.psetex(key, milliseconds, value);
return client.getStatusCodeReply();
}
public String clientKill(final byte[] client) {
checkIsInMultiOrPipeline();
this.client.clientKill(client);
return this.client.getStatusCodeReply();
}
public String clientGetname() {
checkIsInMultiOrPipeline();
client.clientGetname();
return client.getBulkReply();
}
public String clientList() {
checkIsInMultiOrPipeline();
client.clientList();
return client.getBulkReply();
}
public String clientSetname(final byte[] name) {
checkIsInMultiOrPipeline();
client.clientSetname(name);
return client.getBulkReply();
}
public List<String> time() {
checkIsInMultiOrPipeline();
client.time();
return client.getMultiBulkReply();
}
public String migrate(final byte[] host, final int port, final byte[] key,
final int destinationDb, final int timeout) {
checkIsInMultiOrPipeline();
client.migrate(host, port, key, destinationDb, timeout);
return client.getStatusCodeReply();
}
/**
* Syncrhonous replication of Redis as described here: http://antirez.com/news/66 Since Java
* Object class has implemented "wait" method, we cannot use it, so I had to change the name of
* the method. Sorry :S
*/
@Override
public Long waitReplicas(int replicas, long timeout) {
checkIsInMultiOrPipeline();
client.waitReplicas(replicas, timeout);
return client.getIntegerReply();
}
@Override
public Long pfadd(final byte[] key, final byte[]... elements) {
checkIsInMultiOrPipeline();
client.pfadd(key, elements);
return client.getIntegerReply();
}
@Override
public long pfcount(final byte[] key) {
checkIsInMultiOrPipeline();
client.pfcount(key);
return client.getIntegerReply();
}
@Override
public String pfmerge(final byte[] destkey, final byte[]... sourcekeys) {
checkIsInMultiOrPipeline();
client.pfmerge(destkey, sourcekeys);
return client.getStatusCodeReply();
}
@Override
public Long pfcount(byte[]... keys) {
checkIsInMultiOrPipeline();
client.pfcount(keys);
return client.getIntegerReply();
}
public ScanResult<byte[]> scan(final byte[] cursor) {
return scan(cursor, new ScanParams());
}
public ScanResult<byte[]> scan(final byte[] cursor, final ScanParams params) {
checkIsInMultiOrPipeline();
client.scan(cursor, params);
List<Object> result = client.getObjectMultiBulkReply();
byte[] newcursor = (byte[]) result.get(0);
List<byte[]> rawResults = (List<byte[]>) result.get(1);
return new ScanResult<byte[]>(newcursor, rawResults);
}
public ScanResult<Map.Entry<byte[], byte[]>> hscan(final byte[] key, final byte[] cursor) {
return hscan(key, cursor, new ScanParams());
}
public ScanResult<Map.Entry<byte[], byte[]>> hscan(final byte[] key, final byte[] cursor,
final ScanParams params) {
checkIsInMultiOrPipeline();
client.hscan(key, cursor, params);
List<Object> result = client.getObjectMultiBulkReply();
byte[] newcursor = (byte[]) result.get(0);
List<Map.Entry<byte[], byte[]>> results = new ArrayList<Map.Entry<byte[], byte[]>>();
List<byte[]> rawResults = (List<byte[]>) result.get(1);
Iterator<byte[]> iterator = rawResults.iterator();
while (iterator.hasNext()) {
results.add(new AbstractMap.SimpleEntry<byte[], byte[]>(iterator.next(), iterator.next()));
}
return new ScanResult<Map.Entry<byte[], byte[]>>(newcursor, results);
}
public ScanResult<byte[]> sscan(final byte[] key, final byte[] cursor) {
return sscan(key, cursor, new ScanParams());
}
public ScanResult<byte[]> sscan(final byte[] key, final byte[] cursor, final ScanParams params) {
checkIsInMultiOrPipeline();
client.sscan(key, cursor, params);
List<Object> result = client.getObjectMultiBulkReply();
byte[] newcursor = (byte[]) result.get(0);
List<byte[]> rawResults = (List<byte[]>) result.get(1);
return new ScanResult<byte[]>(newcursor, rawResults);
}
public ScanResult<Tuple> zscan(final byte[] key, final byte[] cursor) {
return zscan(key, cursor, new ScanParams());
}
public ScanResult<Tuple> zscan(final byte[] key, final byte[] cursor, final ScanParams params) {
checkIsInMultiOrPipeline();
client.zscan(key, cursor, params);
List<Object> result = client.getObjectMultiBulkReply();
byte[] newcursor = (byte[]) result.get(0);
List<Tuple> results = new ArrayList<Tuple>();
List<byte[]> rawResults = (List<byte[]>) result.get(1);
Iterator<byte[]> iterator = rawResults.iterator();
while (iterator.hasNext()) {
results.add(new Tuple(iterator.next(), Double.valueOf(SafeEncoder.encode(iterator.next()))));
}
return new ScanResult<Tuple>(newcursor, results);
}
/**
* A decorator to implement Set from List. Assume that given List do not contains duplicated
* values. The resulting set displays the same ordering, concurrency, and performance
* characteristics as the backing list. This class should be used only for Redis commands which
* return Set result.
* @param <E>
*/
protected static class SetFromList<E> extends AbstractSet<E> {
private final List<E> list;
private SetFromList(List<E> list) {
if (list == null) {
throw new NullPointerException("list");
}
this.list = list;
}
@Override
public void clear() {
list.clear();
}
@Override
public int size() {
return list.size();
}
@Override
public boolean isEmpty() {
return list.isEmpty();
}
@Override
public boolean contains(Object o) {
return list.contains(o);
}
@Override
public boolean remove(Object o) {
return list.remove(o);
}
@Override
public boolean add(E e) {
return !contains(e) && list.add(e);
}
@Override
public Iterator<E> iterator() {
return list.iterator();
}
@Override
public Object[] toArray() {
return list.toArray();
}
@Override
public <T> T[] toArray(T[] a) {
return list.toArray(a);
}
public String toString() {
return list.toString();
}
public int hashCode() {
return list.hashCode();
}
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof Set)) {
return false;
}
Collection<?> c = (Collection<?>) o;
if (c.size() != size()) {
return false;
}
return containsAll(c);
}
@Override
public boolean containsAll(Collection<?> c) {
return list.containsAll(c);
}
@Override
public boolean removeAll(Collection<?> c) {
return list.removeAll(c);
}
@Override
public boolean retainAll(Collection<?> c) {
return list.retainAll(c);
}
protected static <E> SetFromList<E> of(List<E> list) {
return new SetFromList<E>(list);
}
}
}
| carlvine500/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | Java | mit | 126,814 | [
30522,
7427,
2417,
2483,
1012,
7846,
1012,
27273,
2015,
1025,
12324,
10763,
2417,
2483,
1012,
7846,
1012,
27273,
2015,
1012,
8778,
1012,
11291,
27058,
11335,
2100,
1025,
12324,
9262,
1012,
22834,
1012,
2485,
3085,
1025,
12324,
9262,
1012,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.integpg.synapse.actions;
import com.integpg.logger.FileLogger;
import java.io.IOException;
import java.util.Json;
public class CompositeAction extends Action {
private String[] _actions;
public CompositeAction(Json json) {
_actions = (String[]) json.get("Actions");
ActionHash.put((String) json.get("ID"), this);
}
public void execute() throws IOException {
Thread thd = new Thread(new Runnable() {
public void run() {
FileLogger.debug("Executing Composite Action in " + Thread.currentThread().getName());
for (int i = 0; i < _actions.length; i++) {
try {
Action.execute(_actions[i]);
} catch (Exception ex) {
FileLogger.error("Error executing action: " + ex.getMessage());
}
}
}
});
thd.setDaemon(true);
thd.start();
}
}
| kmcloutier/synapse | src/com/integpg/synapse/actions/CompositeAction.java | Java | mit | 998 | [
30522,
7427,
4012,
1012,
20014,
13910,
26952,
1012,
19962,
9331,
3366,
1012,
4506,
1025,
12324,
4012,
1012,
20014,
13910,
26952,
1012,
30524,
1012,
21183,
4014,
1012,
1046,
3385,
1025,
2270,
2465,
12490,
18908,
3258,
8908,
2895,
1063,
2797,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'use strict'
const { describe, it, beforeEach, afterEach } = require('mocha')
const Helper = require('hubot-test-helper')
const { expect } = require('chai')
const mock = require('mock-require')
const http = require('http')
const sleep = m => new Promise(resolve => setTimeout(() => resolve(), m))
const request = uri => {
return new Promise((resolve, reject) => {
http
.get(uri, res => {
const result = { statusCode: res.statusCode }
if (res.statusCode !== 200) {
resolve(result)
} else {
res.setEncoding('utf8')
let rawData = ''
res.on('data', chunk => {
rawData += chunk
})
res.on('end', () => {
result.body = rawData
resolve(result)
})
}
})
.on('error', err => reject(err))
})
}
const infoRutStub = {
getPersonByRut (rut) {
return new Promise((resolve, reject) => {
if (rut === '11111111-1') {
return resolve({ name: 'Anonymous', rut })
} else if (rut === '77777777-7') {
return resolve({ name: 'Sushi', rut })
} else if (rut === '22222222-2') {
return resolve(null)
}
reject(new Error('Not found'))
})
},
getEnterpriseByRut (rut) {
return new Promise((resolve, reject) => {
if (rut === '11111111-1') {
return resolve({ name: 'Anonymous', rut })
} else if (rut === '77777777-7') {
return resolve({ name: 'Sushi', rut })
} else if (rut === '22222222-2') {
return resolve(null)
}
reject(new Error('Not found'))
})
},
getPersonByName (name) {
return new Promise((resolve, reject) => {
if (name === 'juan perez perez') {
return resolve([
{ rut: '11.111.111-1', name: 'Anonymous' },
{ rut: '11.111.111-1', name: 'Anonymous' },
{ rut: '11.111.111-1', name: 'Anonymous' },
{ rut: '11.111.111-1', name: 'Anonymous' },
{ rut: '11.111.111-1', name: 'Anonymous' },
{ rut: '11.111.111-1', name: 'Anonymous' }
])
} else if (name === 'soto') {
return resolve([
{ rut: '11.111.111-1', name: 'Anonymous' },
{ rut: '11.111.111-1', name: 'Anonymous' },
{ rut: '11.111.111-1', name: 'Anonymous' },
{ rut: '11.111.111-1', name: 'Anonymous' },
{ rut: '11.111.111-1', name: 'Anonymous' }
])
} else if (name === 'info-rut') {
return resolve([])
}
reject(new Error('Not found'))
})
},
getEnterpriseByName (name) {
return new Promise((resolve, reject) => {
if (name === 'perez') {
return resolve([{ rut: '11.111.111-1', name: 'Anonymous' }])
} else if (name === 'info-rut') {
return resolve([])
}
reject(new Error('Not found'))
})
}
}
mock('info-rut', infoRutStub)
const helper = new Helper('./../src/index.js')
describe('info rut', function () {
beforeEach(() => {
this.room = helper.createRoom()
})
afterEach(() => this.room.destroy())
describe('person rut valid', () => {
const rut = '11111111-1'
beforeEach(async () => {
this.room.user.say('user', `hubot info-rut rut ${rut}`)
await sleep(1000)
})
it('should return a full name', () => {
expect(this.room.messages).to.eql([
['user', `hubot info-rut rut ${rut}`],
['hubot', `Anonymous (${rut})`]
])
})
})
describe('enterprise rut valid', () => {
const rut = '77777777-7'
beforeEach(async () => {
this.room.user.say('user', `hubot info-rut rut ${rut}`)
await sleep(1000)
})
it('should return a full name', () => {
expect(this.room.messages).to.eql([
['user', `hubot info-rut rut ${rut}`],
['hubot', `Sushi (${rut})`]
])
})
})
describe('rut invalid', () => {
const rut = '22222222-2'
beforeEach(async () => {
this.room.user.say('user', `hubot info-rut rut ${rut}`)
await sleep(1000)
})
it('should return a error', () => {
expect(this.room.messages).to.eql([
['user', `hubot info-rut rut ${rut}`],
['hubot', '@user rut sin resultados']
])
})
})
describe('rut error', () => {
const rut = '1'
beforeEach(async () => {
this.room.user.say('user', `hubot info-rut rut ${rut}`)
await sleep(1000)
})
it('should return a error', () => {
expect(this.room.messages).to.eql([
['user', `hubot info-rut rut ${rut}`],
['hubot', '@user ocurrio un error al consultar el rut']
])
})
})
describe('name valid', () => {
const name = 'juan perez perez'
beforeEach(async () => {
this.room.user.say('user', `hubot info-rut persona ${name}`)
await sleep(1000)
})
it('should return a array of results with link', () => {
expect(this.room.messages).to.eql([
['user', `hubot info-rut persona ${name}`],
[
'hubot',
'Anonymous (11.111.111-1)\n' +
'Anonymous (11.111.111-1)\n' +
'Anonymous (11.111.111-1)\n' +
'Anonymous (11.111.111-1)\n' +
'Anonymous (11.111.111-1)\n' +
'Más resultados en ' +
'http://localhost:8080/info-rut?name=juan%20perez%20perez&' +
'type=persona'
]
])
})
})
describe('name valid', () => {
const name = 'soto'
beforeEach(async () => {
this.room.user.say('user', `hubot info-rut persona ${name}`)
await sleep(500)
})
it('should return a array of results', () => {
expect(this.room.messages).to.eql([
['user', `hubot info-rut persona ${name}`],
[
'hubot',
'Anonymous (11.111.111-1)\n' +
'Anonymous (11.111.111-1)\n' +
'Anonymous (11.111.111-1)\n' +
'Anonymous (11.111.111-1)\n' +
'Anonymous (11.111.111-1)'
]
])
})
})
describe('name without results', () => {
const name = 'info-rut'
beforeEach(async () => {
this.room.user.say('user', `hubot info-rut empresa ${name}`)
await sleep(500)
})
it('should return a empty results', () => {
expect(this.room.messages).to.eql([
['user', `hubot info-rut empresa ${name}`],
['hubot', `@user no hay resultados para ${name}`]
])
})
})
describe('name invalid', () => {
const name = 'asdf'
beforeEach(async () => {
this.room.user.say('user', `hubot info-rut persona ${name}`)
await sleep(500)
})
it('should return a empty results', () => {
expect(this.room.messages).to.eql([
['user', `hubot info-rut persona ${name}`],
['hubot', '@user ocurrio un error al consultar el nombre']
])
})
})
describe('GET /info-rut?name=perez&type=persona', () => {
beforeEach(async () => {
this.response = await request(
'http://localhost:8080/info-rut?name=juan%20perez%20perez&type=persona'
)
})
it('responds with status 200 and results', () => {
expect(this.response.statusCode).to.equal(200)
expect(this.response.body).to.equal(
'Anonymous (11.111.111-1)<br/>' +
'Anonymous (11.111.111-1)<br/>' +
'Anonymous (11.111.111-1)<br/>' +
'Anonymous (11.111.111-1)<br/>' +
'Anonymous (11.111.111-1)<br/>' +
'Anonymous (11.111.111-1)'
)
})
})
describe('GET /info-rut?name=perez&type=empresa', () => {
beforeEach(async () => {
this.response = await request(
'http://localhost:8080/info-rut?name=perez&type=empresa'
)
})
it('responds with status 200 and results', () => {
expect(this.response.statusCode).to.equal(200)
expect(this.response.body).to.equal('Anonymous (11.111.111-1)')
})
})
describe('GET /info-rut?name=info-rut&type=persona', () => {
beforeEach(async () => {
this.response = await request(
'http://localhost:8080/info-rut?name=info-rut&type=persona'
)
})
it('responds with status 200 and not results', () => {
expect(this.response.statusCode).to.equal(200)
expect(this.response.body).to.equal('no hay resultados para info-rut')
})
})
describe('GET /info-rut', () => {
beforeEach(async () => {
this.response = await request('http://localhost:8080/info-rut')
})
it('responds with status 200 and not results', () => {
expect(this.response.statusCode).to.equal(200)
expect(this.response.body).to.equal('faltan los parametros type y name')
})
})
describe('GET /info-rut?name=asdf&type=persona', () => {
beforeEach(async () => {
this.response = await request(
'http://localhost:8080/info-rut?name=asdf&type=persona'
)
})
it('responds with status 200 and not results', () => {
expect(this.response.statusCode).to.equal(200)
expect(this.response.body).to.equal(
'Ocurrio un error al consultar el nombre'
)
})
})
})
| lgaticaq/hubot-info-rut | test/test.js | JavaScript | mit | 9,067 | [
30522,
1005,
2224,
9384,
1005,
9530,
3367,
1063,
6235,
1010,
2009,
1010,
2077,
5243,
2818,
1010,
2044,
5243,
2818,
1065,
1027,
5478,
1006,
1005,
9587,
7507,
1005,
1007,
9530,
3367,
2393,
2121,
1027,
5478,
1006,
1005,
9594,
4140,
1011,
323... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.