Format:
Recent snippets matching tags of cs
#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. *
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. *
15 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication8 { class Program { static void Main(string[] args)
17 Views
no comments
using Moq; using NUnit.Framework; using StructureMap; namespace StackOverflow.Question { #region Commands public interface ICommand {
23 Views
no comments
using System; using System.IO; class Program { static void Main() { // // It will free resources on its own. //
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;
88 Views
no comments
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())
174 Views
no comments
#-- Files *.bak.* *.bak *.dll *.exe *.ldf *.log *.mdf *.msi *.resharper
161 Views
no comments
body { background-color: #000000; } .MainTitle /* Class */ { font-family: Arial, Helvetica, sans-serif; font-size: xx-large; color: #0000CC;
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'")
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
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);
177 Views
no comments
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Linq.Expressions; namespace ToCsv { /// <summary>
181 Views
2 comments
public static decimal Accumulate(IEnumerable e) { decimal sum = 0; foreach (Account a in e) sum += a.Balance; return sum; }
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
128 Views
no comments
<html> <head> <title></title> <style> .ULCtrlList { list-style-type: none; display: inline; }
176 Views
no comments
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
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; }
998 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; namespace Orxxx.Data { public interface IRepository<T> { void Create(T entity);
191 Views
no comments
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
322 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
