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#
public sealed partial class BlankPage : Page
{
    public BlankPage()
    {
        this.InitializeComponent();
 
        var _String = "<special:Users xmlns:special='http://jerry'><User Key='1' Name='Jerry' /><User Key='2' Name='Michael' /></special:Users>";
        using (var _Reader = System.Xml.XmlReader.Create(new StringReader(_String)))
        {
            var _Serializer = new System.Xml.Serialization.XmlSerializer(typeof(Users));
by Jerry Nixon   May 15, 2012 @ 3:01pm
12 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 System;
using System.Net.Http.Formatting;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Json;
using System.IO;
 
namespace Westwind.Web.WebApi
{
    public class JavaScriptSerializerFormatter : MediaTypeFormatter
by Rick Strahl   March 08, 2012 @ 5:17pm
390 Views
no comments
 
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
69 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
143 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
176 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
125 Views
1 comments
 
C++
// =====================================================================================
// 
//       Filename:  for_each.h
// 
// =====================================================================================
 
 
#ifndef  FOR_EACH_INC
#define  FOR_EACH_INC
by sigidagi   June 17, 2011 @ 12:31pm
145 Views
1 comments
 
C++
// =====================================================================================
// 
//       Filename:  indexes.h
//
// =====================================================================================
 
 
#ifndef  INDEXES_INC
#define  INDEXES_INC
by sigidagi   June 17, 2011 @ 12:08pm
152 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
141 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
232 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
622 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
110 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
177 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
292 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
146 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
237 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
408 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
2635 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
240 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