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 Function
/*
@ 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
 
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
1256 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
239 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
256 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
280 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
259 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
294 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
 
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
1785 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
 
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