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 RIA
C#
const string KEY = "MyUniqueKey";
 
private void SaveButton_Click(object sender, EventArgs e)
{
    var _Store = IsolatedStorageFile.GetUserStoreForApplication();
    using (var _Stream 
        = new IsolatedStorageFileStream(KEY, FileMode.Create, _Store))
    {
        var _Data = MyTextBox.Text;
        var _Serializer = new XmlSerializer(typeof(string));
by Jerry Nixon   November 01, 2011 @ 3:22pm
37 Views
no comments
 
<!DOCTYPE html>
<html lang="es">
<head>
    <title>Problema de Física en JS</title>
        <script type="text/javascript">
            //Problema a resolver
            document.write('<p>Sobre un cuerpo de 36 kg que se encuentra en reposo, se aplica una fuerza durante 7 segundos hasta que alcance una velocidad de 21 m/s. <br /> Calcular: <ol><li>Aceleración</li><li>Espacio</li><li>Fuerza aplicada</li><li>Peso</li></ol></p>');
            
            //Datos iniciales a tener en cuenta
            var vi = 0; //Velocidad inicial
94 Views
no comments
 
C++
#include "for_each.h"
#include <iostream>
#include <tuple>
 
// ------- Fibonacii number generator ---------
template<int N>
struct Fib
{
    enum { value = Fib<N-1>::value + Fib<N-2>::value };
};
by sigidagi   June 18, 2011 @ 2:27am
118 Views
no comments
 
C++
#include "for_each.h"
#include <iostream>
#include <string>
#include <tuple>
 
using namespace std;
 
struct Functor 
{
    template<typename T>
by sigidagi   June 17, 2011 @ 1:12pm
97 Views
1 comments
 
C++
// =====================================================================================
// 
//       Filename:  for_each.h
// 
// =====================================================================================
 
 
#ifndef  FOR_EACH_INC
#define  FOR_EACH_INC
by sigidagi   June 17, 2011 @ 12:31pm
112 Views
1 comments
 
C++
// =====================================================================================
// 
//       Filename:  indexes.h
//
// =====================================================================================
 
 
#ifndef  INDEXES_INC
#define  INDEXES_INC
by sigidagi   June 17, 2011 @ 12:08pm
117 Views
2 comments
 
C#
public class DbContextDomainService<TContext> : DomainService where TContext : DbContext, new()
{
  private TContext _DbContext;
  protected TContext DbContext
  {
    get
    {              
      return _DbContext ?? (_DbContext = CreateDbContext());
    }
  }
by Shimmy Weitzhandler   May 27, 2011 @ 3:28am
113 Views
no comments
 
C#
public partial class Entities
{
 
  public void Insert<T>(T entity) where T : class
  {
    if (entity == null) throw new ArgumentNullException("entity");
 
    // Note: changing the state to Added on a detached entity is the same as calling
    // Add on the DbSet.                    
    Entry(entity).State = EntityState.Added;
by Shimmy Weitzhandler   May 27, 2011 @ 3:24am
182 Views
no comments
 
C#
#region Get entity set name             
public string GetEntitySetName(Type entityType)
{
  if (entityType == null)
    throw new ArgumentNullException("entityType");
 
  if (!entityType.IsSubclassOf(typeof(EntityObject)))
    throw new ArgumentException("Only subclasses of EntityObject are supported.", "entityType");
 
  return GetEntitySetNameInternal(entityType);
by Shimmy Weitzhandler   May 18, 2011 @ 8:13pm
457 Views
no comments
 
C#
/// <summary>
/// Serialize anything
/// </summary>
/// <param name="serializeMe"></param>
/// <returns></returns>
public static string Serialize<T>(T serializeMe)
{
    var serializer = new XmlSerializer(serializeMe.GetType());
    var ms = new MemoryStream();
    serializer.Serialize(ms, serializeMe);
by rawbert   February 25, 2011 @ 12:49am
97 Views
no comments
 
// System.Runtime.Seriaization.dll and System.Xml.dll are needed.
open System.IO
open System.Runtime.Serialization 
open System.Xml
 
let write(x : float32[]) =
    let ds = new DataContractSerializer(typeof<float32[]>)
    let ms = new MemoryStream()    
    ds.WriteObject(ms, x)
    ms.ToArray()
by nyinyithann   January 22, 2011 @ 8:24am
149 Views
no comments
 
C#
/// <summary>
/// Returns the content of the POST buffer as string
/// </summary>
/// <returns></returns>
public static string FormBufferToString()
{
    HttpRequest Request = HttpContext.Current.Request;            
 
    if (Request.TotalBytes > 0)            
        return Encoding.Default.GetString(Request.BinaryRead(Request.TotalBytes));
by Rick Strahl   August 19, 2010 @ 2:39pm
265 Views
no comments
 
C#
public XDocument ResponseXml { get; protected set; }
 
public T Inflate<T>() where T : class
{
   var attr = typeof(T)
      .GetCustomAttributes(true)
      .OfType<XmlRootAttribute>()
      .SingleOrDefault();
 
   string root = attr.ElementName;
by John Nelson   June 25, 2010 @ 6:52am
133 Views
no comments
 
C#
public class MyData
{
   [Key]
   public int Id { get; set; }
   public string Name { get; set; }
   public Queue<DataPoint> DataSerie { get; set; }
} 
by EricSch   March 30, 2010 @ 5:34am
Tags: ria
219 Views
no comments
 
C#
#region $entity$
 
public IQueryable<$entity$> Get$entities$()
{
    return this.DataContext.$entities$;
}
 
public void Insert$entity$($entity$ current$entity$)
{
    this.DataContext.$entities$.InsertOnSubmit(current$entity$);
by Glenn Block   March 23, 2010 @ 11:39pm
Tags: RIA
390 Views
no comments
 
'Form1.vb
#Region " Import Declaratives "
 
Imports DevExpress.XtraEditors
Imports DevExpress.Utils.Menu
Imports System.IO
Imports System.Xml.Serialization
 
#End Region
by Thom Lamb   February 11, 2010 @ 6:53am
2276 Views
no comments
 
[alias]
# show author and revision number
blame = annotate -u -n
 
# clearer Git style diff output
dif = diff --git
 
log5 = log --limit 5
log10 = log --limit 10
log25 = log --limit 25
by Al Gonzalez   February 05, 2010 @ 8:13am
220 Views
no comments
 
syntax: glob
#-- Files
*.bak.*
*.bak
thumbs.db
*.msi
*.log
*.sqlite
 
#-- Directories
by Al Gonzalez   January 29, 2010 @ 1:40pm
721 Views
no comments
 
@echo off
rem Shell wrapper for Mercurial Distributed SCM
setlocal
rem ########################################
rem NOTES:
rem   /I flag on if forces case-insensitive comparisons for ==
rem ########################################
 
rem ########################################
rem Set the following variables to the 
by Al Gonzalez   January 28, 2010 @ 1:31pm
537 Views
4 comments
 
C++
#include <utility>
 
// Note: I've revised my implementation of AUTO_FUN here
// to make its use look more like a function definition
 
#define AUTO_FUN_IMPL( ... ) decltype( __VA_ARGS__ ) { return __VA_ARGS__; }
 
#define AUTO_FUN( name_and_param_list ) auto name_and_param_list-> AUTO_FUN_IMPL
 
template< typename SourceType >
by Matt Calabrese   January 27, 2010 @ 9:55pm
477 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