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 cs
C++
#include <stdio.h>
#include <cs50.h>
 
int main (void) {
/*******************************************************************************************************
*                                                                                                      *
* This program will ask the user how many days are in the month and how many pennies they would like   *
* to receive on day one.  Based upon this information provided it will figure out how much money a     *
* person would receive each day of the month & how much a person would have in total at the end of the *
* month.                                                                                               *
Thursday @ 5:07pm
31 Views
no comments
 
#include <stdio.h>
#include <cs50.h>
 
int main (void) {
/*******************************************************************************************************
*                                                                                                      *
* This program will ask the user how many days are in the month and how many pennies they would like   *
* to receive on day one.  Based upon this information provided it will figure out how much money a     *
* person would receive each day of the month & how much a person would have in total at the end of the *
* month.                                                                                               *
Thursday @ 5:06pm
15 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
by bnaya   March 25, 2012 @ 7:37am
17 Views
no comments
 
C#
 
using Moq;
using NUnit.Framework;
using StructureMap;
 
namespace StackOverflow.Question
{
#region Commands
    public interface ICommand
    {
by Olle   February 28, 2012 @ 1:32pm
23 Views
no comments
 
C#
using System;
using System.IO;
 
class Program
{
    static void Main()
    {
    //
    // It will free resources on its own.
    //
January 26, 2012 @ 7:26am
44 Views
no comments
 
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title></title>
    <style>
    .bigbutton
    {
        background: #1e5799; /* Old browsers */        
        color: White;
by Rick Strahl   November 09, 2011 @ 6:35pm
Tags: HTML, CSS, Button
88 Views
no comments
 
C#
public static IList<T> ToList<T>(this System.Data.SqlClient.SqlDataReader dr) where T : new()
       {
           Type type = typeof(T);
           if(System.Web.HttpContext.Current.Cache[type.Name + "_properties"] == null)
           {
               System.Web.HttpContext.Current.Cache.Insert(type.Name + "_properties", type.GetProperties().ToList());
           }
           IList<PropertyInfo> properties = (IList<PropertyInfo>)System.Web.HttpContext.Current.Cache[type.Name + "_properties"];
           IList<T> result = new List<T>();
           while(dr.Read())
by ofer   September 25, 2011 @ 3:18am
174 Views
no comments
 
#-- Files
*.bak.*
*.bak
*.dll
*.exe
*.ldf
*.log
*.mdf
*.msi
*.resharper
by Al Gonzalez   June 06, 2011 @ 8:08am
161 Views
no comments
 
CSS
body
{
    background-color: #000000;
}
 
.MainTitle  /* Class */
{
    font-family: Arial, Helvetica, sans-serif;
    font-size: xx-large;
    color: #0000CC;
by Jose David Parra   May 01, 2011 @ 5:14pm
Tags: CSS, web Dev
106 Views
no comments
 
Imports System.IO
Imports System.Data.SqlClient
Public Class FrmFromCSV
    Public Connection As New SqlConnection(mConnectionString)
    Private Sub OpenFileCSV(ByVal FileName As String)
        Dim cnn As New OleDb.OleDbConnection( _
        "Provider=Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source=" & _
        PathFile & _
        "; Extended Properties='TEXT;HDR=No'")
by NelsonAmaya   April 30, 2011 @ 8:59am
Tags: CSV
221 Views
no comments
 
#requires get-interface from http://www.nivot.org/2009/03/26/PowerShell20CTP3ModulesInPracticeNETInterfaces.aspx
# this needs to be program files x86 if in 64 bit context
$runtimeDir="$($env:ProgramFiles)\Inishtech SLP Code Protector"
add-type -path "$runtimeDir\Microsoft.Licensing.Runtime2.0.DLL"
#NB if you leave this empty, you'll only see the memory store
$shortCode = "abc12"
$r = new-object Microsoft.Licensing.SLMRuntime $shortCode
$ls = get-interface $r.LicenseStores ([Microsoft.Licensing.ISLMLicenseStores])
$localStores=$ls.MachineStore
$localStores | %{get-interface $_ ([Microsoft.Licensing.ILicenseStore])}
150 Views
no comments
 
C#
const string PC_CATEGORY = "_Tmp";
const string PC_NAME = "_Tmp";
 
if (!PerformanceCounterCategory.Exists(PC_CATEGORY))
{
    CounterCreationDataCollection data = new CounterCreationDataCollection();
    CounterCreationData counter = new CounterCreationData(PC_NAME, "", PerformanceCounterType.NumberOfItems32);
    var pcCategory = PerformanceCounterCategory.Create(PC_CATEGORY, "", PerformanceCounterCategoryType.MultiInstance, data);
 
    data.Add(counter);
by bnaya   February 09, 2011 @ 12:45am
177 Views
no comments
 
C#
 
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
 
namespace ToCsv
{
    /// <summary>
by ahsteele   November 14, 2010 @ 3:11pm
Tags: csv
181 Views
2 comments
 
C#
public static decimal Accumulate(IEnumerable e)
{
   decimal sum = 0;
 
   foreach (Account a in e)
      sum += a.Balance;
 
   return sum;
}
by Athens Springer   October 15, 2010 @ 12:35pm
150 Views
no comments
 
This is just a snippet to remember syntax for different CSS selector types.
 
CSS: Selectors
 
Type selectors
 
    a {} 
        applies to all <a> elements
 
Class selectors
by henkers   September 12, 2010 @ 11:12am
Tags: CSS
128 Views
no comments
 
<html>
<head>
<title></title>
<style>
.ULCtrlList
{
    list-style-type: none;
    display: inline;
}
by Fred Thomas   August 21, 2010 @ 10:18am
176 Views
no comments
 
C#
 
var realHandler = GetHandler<SomeType>();
var message = GetMessage(); //Returns derived type of SomeType
var handlerType = typeof(IHandler<>);
var genericType = message.GetType();
var genericHandler = handlerType.MakeGenericType(genericType);
 
return realHandler --> as genericHandler would not work
by Hadi Eskandari   July 19, 2010 @ 8:45am
Tags: Generics
211 Views
no comments
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Html Template</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 
    <style type="text/css">
        .primary { background-color: green; }
        .secondary { background-color: blue; }
by jwwishart   June 16, 2010 @ 4:02pm
998 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
 
namespace Orxxx.Data 
{
    public interface IRepository<T> 
    {
        void Create(T entity);
by darek156   May 07, 2010 @ 1:54am
Tags: generics
191 Views
no comments
 
C#
public interface IRepository<T>
{
    T GetById(Guid id);
    T GetByQuery(Query query);
    void Add(T item);
    void Remove(T item);
    void Update(T item);
}
 
//mozliwe jest rozszezenie generycznego interfejsu o metody specyfikczne
by darek156   April 02, 2010 @ 1:21am
322 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