text:
@interface LLSocialCommand ()
@end

@implementation LLSocialCommand

- (void)setValue:(id)value forKey:(NSString *)key {
    if ([key isEqualToString:OPTION_BODY]) {
        if ([value isKindOfClass:[NSString class]]) {
            self.body = value;
        }
    } else if ([key isEqualToString:OPTION_URL]) {
        if ([value isKindOfClass:[NSString class]]) {
            self.url = [NSURL URLWithString:value];
        } else if ([value isKindOfClass:[NSURL class]]) {
            self.url = value;
        }
    } else if ([key isEqualToString:OPTION_IMAGE]) {
        if ([value isKindOfClass:[UIImage class]]) {
            self.image = value;
        }
    } else {
        [super setValue:value forKey:key];
    }
}

@end


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class org.apache.commons.codec.binary.BaseNCodec (Apache Commons Codec 1.9 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.commons.codec.binary.BaseNCodec

Packages that use BaseNCodec

Package
Description

org.apache.commons.codec.binary

Base64, Base32, Binary, and Hexadecimal String encoding and decoding.

Uses of BaseNCodec in org.apache.commons.codec.binary

Subclasses of BaseNCodec in org.apache.commons.codec.binary

Modifier and Type
Class and Description

class
Base32

Provides Base32 encoding and decoding as defined by RFC 4648.

class
Base64

Provides Base64 encoding and decoding as defined by RFC 2045.

Constructors in org.apache.commons.codec.binary with parameters of type BaseNCodec

Constructor and Description

BaseNCodecInputStream(InputStream in,
                     BaseNCodec baseNCodec,
                     boolean doEncode)

BaseNCodecOutputStream(OutputStream out,
                      BaseNCodec basedCodec,
                      boolean doEncode)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2002–2013 The Apache Software Foundation. All rights reserved.

redpajama_set_name: RedPajamaGithub


text:
package edu.usc.irds.sparkler;

import edu.usc.irds.sparkler.model.FetchedData;
import edu.usc.irds.sparkler.model.Resource;

import java.util.Iterator;

/**
 * A contract for any {@link ExtensionPoint} that offers functionality to
 * determine a score for urls.
 */
public interface Scorer extends ExtensionPoint {

    Double score(String extractedText) throws Exception;

    String getScoreKey();

}


text:
package pl.themolka.arcade.score;

import pl.themolka.arcade.ArcadePlugin;
import pl.themolka.arcade.event.Cancelable;
import pl.themolka.arcade.game.Participator;

public class ScoreScoredEvent extends ScoreEvent implements Cancelable {
    private final boolean byLimit;
    private boolean cancel;
    private Participator completer;

    public ScoreScoredEvent(ArcadePlugin plugin, Score score, boolean byLimit, Participator completer) {
        super(plugin, score);

        this.byLimit = byLimit;
    }

    @Override
    public boolean isCanceled() {
        return this.cancel;
    }

    @Override
    public void setCanceled(boolean cancel) {
        this.cancel = cancel;
    }

    public Participator getCompleter() {
        return this.completer;
    }

    public boolean hasCompleter() {
        return this.completer != null;
    }

    public boolean isByLimit() {
        return this.byLimit;
    }

    public void setCompleter(Participator completer) {
        this.completer = completer;
    }
}


text:
USE [master]
GO

/****** Object:  StoredProcedure [dbo].[SP_SQL_KillNoNavSession]    Script Date: 18/04/2018 15.53.50 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author: 	Roberto Stefantti
-- Create date: <13/01/2017>
-- Description:	KILL SLEEPING NO NAV SESSIONS
-- =============================================
CREATE PROCEDURE [dbo].[SP_SQL_KillNoNavSession]
AS
BEGIN
----------------------------------------------------------------------------
-- Variable
----------------------------------------------------------------------------
DECLARE @Session TABLE
(
	id INT IDENTITY(1,1) PRIMARY KEY,
	[sid] int,
	ltime DATETIME,
	hname varchar(MAX),
	uid varchar(100),
	lret datetime,
	etime int
);

DECLARE @NotAffectedUserList TABLE
(
	id INT IDENTITY(1,1) PRIMARY KEY,
	[uid] varchar(MAX)
);

DECLARE	@session_time as int;
DECLARE @vSID as int;
DECLARE @command as varchar(MAX);
DECLARE @RowIndex AS INT;
DECLARE @MaxIndex AS INT;
----------------------------

set @session_time=15; -- Assign Session time in Minutes

-- Assign List of Users who "will not be affected" by this Session Kill
INSERT into @NotAffectedUserList SELECT 'sa'
INSERT into @NotAffectedUserList SELECT 'NT AUTHORITY\SERVIZIO DI RETE'
INSERT into @NotAffectedUserList SELECT 'DOMAIN\SERVICE'
INSERT into @NotAffectedUserList SELECT 'scheduler'

INSERT into @Session
SELECT
    session_id as [Session ID],
    login_time as [Login Time],
    host_name as [Host Name],
    LOGIN_NAME as [Login ID],
    last_request_end_time as [Last Request End Time],
    DATEDIFF(minute,  last_request_end_time,getdate()) as[Elapsed Time (minutes)]
FROM
    sys.dm_exec_sessions
WHERE
open_transaction_count = 0
AND host_name <> 'NAV-SERVER' COLLATE Latin1_General_CI_AS
AND host_name <> 'SQL-SERVER' COLLATE Latin1_General_CI_AS
AND host_name is not NULL
AND DATEDIFF(minute,  last_request_end_time,getdate())>=@session_time
--AND client_version=4
AND login_name COLLATE Latin1_General_CI_AS not in
(
	SELECT DISTINCT uid
	FROM @NotAffectedUserList
)

SET @RowIndex = 1;
SELECT @MaxIndex = MAX(id) FROM @Session;

WHILE( @RowIndex <= @MaxIndex)
BEGIN
	SELECT @vSID = sid
	FROM @Session
	WHERE id = @RowIndex;

	-- String together the KILL statement
	SELECT @command = 'KILL ' + CAST(@vSID AS varchar(5))

	BEGIN TRY

		-- Execute the final string to KILL the spids
		EXEC (@command)

	END TRY
	BEGIN CATCH
		declare @emsg varchar(500);
		SELECT
        @emsg=ERROR_MESSAGE();

		print @emsg;
	END CATCH

	SET @RowIndex = @RowIndex + 1;
END;
END
GO


text:
<?
session_start();

if (isset($_POST["urlsite"]))
{
	function limpiarez($mess)
	{
		$mess=str_replace(";"," ",$mess);
		$mess=str_replace("$"," ",$mess);
		$mess=str_replace("'"," ",$mess);
		$mess=strip_tags($mess);
		return $mess;
	}

	$plan=limpiarez($_POST["plan"]);
        $plan=intval($plan);
	if (is_numeric($plan)!="true" or $plan<=0)
	{
		echo " Введено неверное количество дней показа";
		include('footer.php');
		exit();
	}

	$urlsite=limpiarez($_POST["urlsite"]);
	$urlsite=htmlspecialchars($urlsite);

	$urlpic=limpiarez($_POST["urlpic"]);
	$urlpic=htmlspecialchars($urlpic);

	if ($plan==""){echo " Введены не все поля";include('footer.php'); exit();}
	if ($urlsite==""){echo " Введены не все поля";include('footer.php'); exit();}
	if ($urlpic==""){echo " Введены не все поля";include('footer.php'); exit();}

	$user=uc($_SESSION["username"]);
	$pass=uc($_SESSION["password"]);

	$res=mysql_query("select count(username) as kolvo from tb_users where username='$user' and password='$pass'");
	$row=mysql_fetch_array($res);
	$kolvo=$row["kolvo"];

	$res=mysql_query("select money from tb_users where username='$user' and password='$pass'");
	$res=mysql_fetch_array($res);
	$money=$res["money"];

	$sql="select price from tb_config1 where item='mfabanner'";
	$res=mysql_query($sql);
	$price=mysql_result($res,0,0);

	$amount=$plan*$price;

	if($kolvo==0) { echo " Ошибка! Для заказа рекламы с внутреннего счета Вам необходимо авторизоваться!";include('footer.php'); exit(); }
	if($money<$amount) {echo " На Вашем балансе недостаточно средств!";include('footer.php'); exit(); }

	$expa=$money-$amount;

	$t=time();

	$sql = "INSERT INTO tb_ban (urlsite,urlpic,begindate,numdays,wmid) VALUES('$urlsite','$urlpic','$t','$plan','$user')";
	mysql_query($sql) or die(mysql_error());

	$sql="update tb_users set money='$expa' where username='$user'";
	mysql_query($sql) or die(mysql_error());

	echo " <green>Ваш баннер добавлен</green>";
	include('footer.php');
	exit();
}
?>

<fieldset style="width: 95%; background: #fff;">
<form method="post" action="moneyforadv.php?adv=banner100x100">

URL сайта:

    <input type="text" name="urlsite" size="25" maxlength="150" autocomplete="off" class="field" value="http://" tabindex="3" />

URL баннера:

    <input type="text" name="urlpic" size="25" maxlength="150" autocomplete="off" class="field" value="http://" tabindex="3" />

Кол-во дней показа:

    <input name="plan" type="text" size="6" maxlength="5" />

    <input type="submit" value="Конвертировать" class="submit" tabindex="6" />

</form>
</fieldset>


text:
/*************************************************************************/
/*  node_dock.h                                                          */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* 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.                */
/*************************************************************************/

#ifndef NODE_DOCK_H
#define NODE_DOCK_H

#include "groups_editor.h"

class ConnectionsDock;

class NodeDock : public VBoxContainer {
	GDCLASS(NodeDock, VBoxContainer);

	Button *connections_button = nullptr;
	Button *groups_button = nullptr;

	ConnectionsDock *connections = nullptr;
	GroupsEditor *groups = nullptr;

	HBoxContainer *mode_hb = nullptr;

	Label *select_a_node = nullptr;

private:
	static NodeDock *singleton;

public:
	static NodeDock *get_singleton() { return singleton; }

protected:
	static void _bind_methods();
	void _notification(int p_what);

public:
	void set_node(Node *p_node);

	void show_groups();
	void show_connections();

	void update_lists();

	NodeDock();
	~NodeDock();
};

#endif // NODE_DOCK_H


text:
function print(result) {
    jsConsole.writeLine(result);
    console.log(result);
}

//Problem 1
function task1() {
    var number = document.getElementById('problem1').value;
    var digit = number % 10;
    lastDigit(digit);

    function lastDigit(param) {
        var result;
        switch (param) {
            case 0: result = 'zero'; break;
            case 1: result = 'one'; break;
            case 2: result = 'two'; break;
            case 3: result = 'three'; break;
            case 4: result = 'four'; break;
            case 5: result = 'five'; break;
            case 6: result = 'six'; break;
            case 7: result = 'seven'; break;
            case 8: result = 'eight'; break;
            case 9: result = 'nine'; break;
            default: result = 'wrong input number'; break;
        }
        print(result);
    }
}

//Problem 2
function task2() {
    var number = document.getElementById('problem2').value;
    reverseNumber(number);

    function reverseNumber(num) {
        var reversed = "";
        var temp = 0;

        if (num < 0) {
            temp = (-num).toString();
        }
        else {
            temp = num;
        }

        var len = temp.toString().length - 1;

        for (var i = len; i >= 0; i-=1) {
            reversed = reversed + temp[i];
        }

        if (num < 0) {
            print('-' + reversed);
        }
        else {
            print(reversed);
        }
    }
}

//Problem 3
function task3() {
    var text = document.getElementById('problem3-a').value;
    var replacePunctuation = text.replace(/\W+/g, ' ');
    var words = replacePunctuation.split(' ');
    var word = document.getElementById('problem3-b').value;

    var casing = 'insensitive';
    print('Case sensitive: count=' + countWordOccurrence(words, word));
    print('Case insensitive: count=' + countWordOccurrence(words, word, casing));

    function countWordOccurrence(words, word, casing) {
        var count = 0;
        if (casing === 'insensitive') {
            for (var i = 0; i < words.length; i++) {
                if (words[i].toString().toLowerCase() == word.toString().toLowerCase()) {
                    count++;
                }
            }
        }
        else {
            for (var i = 0; i < words.length; i++) {
                if (words[i] == word) {
                    count++;
                }
            }
        }
        return count;
    }
}

//Problem 4
function task4() {
    getDivs();

    function getDivs() {
        print("Number of Div tags in current html document: " + document.getElementsByTagName('div').length);
    }
}

//Problem 5
function task5() {
    var input = document.getElementById('problem5-a').value;
    var array = input.split(", ");
    var number = document.getElementById('problem5-b').value;

    countNumber(array, number);

    function countNumber(array, number) {
        var count = 0;
        for (var i = 0; i < array.length; i++) {
            if (array[i] === number) {
                count += 1;
            }
        }

        if (count === 0) {
            print('Number you have entered does not exist in array.');
        }
        else {
            print(count);
        }
    }
}

//Problem 6
function task6() {
    var input = document.getElementById('problem6-a').value;
    var array = input.split(", ");
    var position = document.getElementById('problem6-b').value;
    largerThanNeighbours(array, position);

    function largerThanNeighbours(array, pos) {
        var result;

        for (var i = 0; i < array.length; i++) {
            if (pos < 1 || pos > (array.length - 1)) {
                result='Number of this position does not have two neighbours';
                break;
            }
            else {
                if (i == pos) {
                    if (array[i - 1] < array[i] && array[i] > array[i + 1]) {
                        result = true;
                    }
                    else {
                        result = false;
                        break;
                    }
                }
            }
        }

        print(result);
    }
}

//Problem 7
function task7() {
    var input = document.getElementById('problem7').value;
    var array = input.split(", ");
    largerThanNeighbours(array);

    function largerThanNeighbours(array) {
        var result;

        for (var i = 0; i < array.length; i++) {
            if (array[i - 1] < array[i] && array[i] > array[i + 1]) {
                result = array[i];
                break;
            }
            else {
                result = -1;
            }
        }

        print(result);
    }
}


text:
@class WPYToken;
@class WPYCreditCard;
@class WPYPaymentViewController;
typedef void (^WPYPaymentViewCallback)(WPYPaymentViewController *paymentViewController, WPYToken *token, NSError *error);

@interface WPYPaymentViewController : UIViewController
// If you don't need to provide initial values for form fields, use this initializer
+ (WPYPaymentViewController *)paymentViewControllerWithPriceTag:(NSString *)priceTag // price tag should include currency unit. i.e) $1.00
                                                       callback:(WPYPaymentViewCallback)callback;

+ (WPYPaymentViewController *)paymentViewControllerWithPriceTag:(NSString *)priceTag
                                                           card:(WPYCreditCard *)card // card properties will be used to populate textfield
                                                       callback:(WPYPaymentViewCallback)callback;

+ (WPYPaymentViewController *)paymentViewControllerWithPriceTag:(NSString *)priceTag
                                                supportedBrands:(NSArray *)brands // if you've prefetched supported brands, pass them here
                                                       callback:(WPYPaymentViewCallback)callback;

+ (WPYPaymentViewController *)paymentViewControllerWithPriceTag:(NSString *)priceTag
                                                           card:(WPYCreditCard *)card
                                                supportedBrands:(NSArray *)brands
                                                       callback:(WPYPaymentViewCallback)callback;

- (void)setPayButtonComplete;
- (void)dismissAfterDelay:(NSTimeInterval)delay;
- (void)popAfterDelay:(NSTimeInterval)delay;
@end


text:
/* global Log, Module, moment */

/* Magic Mirror
 * Module: Compliments
 *
 * By Michael Teeuw http://michaelteeuw.nl
 * MIT Licensed.
 */

Module.register("compliments",{

	// Module config defaults.
	defaults: {
		compliments: {
			morning: [
				"Good morning, handsome!",
				"Enjoy your day!",
				"How was your sleep?"
			],
			afternoon: [
				"Hello, beauty!",
				"You look sexy!",
				"Looking good today!"
			],
			evening: [
				"Wow, you look hot!",
				"You look nice!",
				"Hi, sexy!"
			]
		},
		updateInterval: 30000,
		fadeSpeed: 4000
	},

	// Define required scripts.
	getScripts: function() {
		return ["moment.js"];
	},

	// Define start sequence.
	start: function() {
		Log.info("Starting module: " + this.name);

		this.lastComplimentIndex = -1;

		// Schedule update timer.
		var self = this;
		setInterval(function() {
			self.updateDom(self.config.fadeSpeed);
		}, this.config.updateInterval);
	},

	/* randomIndex(compliments)
	 * Generate a random index for a list of compliments.
	 *
	 * argument compliments Array<String> - Array with compliments.
	 *
	 * return Number - Random index.
	 */
	randomIndex: function(compliments) {
		if (compliments.length === 1) {
			return 0;
		}

		var generate = function() {
			return Math.floor(Math.random() * compliments.length);
		};

		var complimentIndex = generate();

		while (complimentIndex === this.lastComplimentIndex) {
			complimentIndex = generate();
		}

		this.lastComplimentIndex = complimentIndex;

		return complimentIndex;
	},

	/* complimentArray()
	 * Retrieve an array of compliments for the time of the day.
	 *
	 * return compliments Array<String> - Array with compliments for the time of the day.
	 */
	complimentArray: function() {
		var hour = moment().hour();

		if (hour >= 3 && hour < 12) {
			return this.config.compliments.morning;
		} else if (hour >= 12 && hour < 17) {
			return this.config.compliments.afternoon;
		} else {
			return this.config.compliments.evening;
		}
	},

	/* complimentArray()
	 * Retrieve a random compliment.
	 *
	 * return compliment string - A compliment.
	 */
	randomCompliment: function() {
		var compliments = this.complimentArray();
		var index = this.randomIndex(compliments);

		return compliments[index];
	},

	// Override dom generator.
	getDom: function() {
		var complimentText = this.randomCompliment();

		var compliment = document.createTextNode(complimentText);
		var wrapper = document.createElement("div");
		wrapper.className = "thin xlarge bright";
		wrapper.appendChild(compliment);

		return wrapper;
	}

});