Format:
Recent snippets matching tags of RIA
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));
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
#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 }; };
118 Views
no comments
#include "for_each.h" #include <iostream> #include <string> #include <tuple> using namespace std; struct Functor { template<typename T>
97 Views
1 comments
// ===================================================================================== // // Filename: for_each.h // // ===================================================================================== #ifndef FOR_EACH_INC #define FOR_EACH_INC
112 Views
1 comments
// ===================================================================================== // // Filename: indexes.h // // ===================================================================================== #ifndef INDEXES_INC #define INDEXES_INC
117 Views
2 comments
public class DbContextDomainService<TContext> : DomainService where TContext : DbContext, new() { private TContext _DbContext; protected TContext DbContext { get { return _DbContext ?? (_DbContext = CreateDbContext()); } }
113 Views
no comments
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;
182 Views
no comments
#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);
457 Views
no comments
/// <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);
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()
149 Views
no comments
/// <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));
265 Views
no comments
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;
133 Views
no comments
public class MyData { [Key] public int Id { get; set; } public string Name { get; set; } public Queue<DataPoint> DataSerie { get; set; } }
219 Views
no comments
#region $entity$ public IQueryable<$entity$> Get$entities$() { return this.DataContext.$entities$; } public void Insert$entity$($entity$ current$entity$) { this.DataContext.$entities$.InsertOnSubmit(current$entity$);
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
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
220 Views
no comments
syntax: glob #-- Files *.bak.* *.bak thumbs.db *.msi *.log *.sqlite #-- Directories
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
537 Views
4 comments
#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 >
477 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
