This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var atributosFormateados = | |
HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes); | |
var atributos = new StringBuilder(); | |
foreach (var atributo in atributosFormateados) | |
{ | |
atributos.AppendFormat("{0}=\"{1}\"", atributo.Key, atributo.Value); | |
} | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//from System.Web.Mvc.HtmlHelper | |
public static RouteValueDictionary AnonymousObjectToHtmlAttributes(object htmlAttributes) | |
{ | |
RouteValueDictionary result = new RouteValueDictionary(); | |
if (htmlAttributes != null) | |
{ | |
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(htmlAttributes)) | |
{ | |
result.Add(property.Name.Replace('_', '-'), property.GetValue(htmlAttributes)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
namespace HexToStringConverter | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var hex = StringToHexConvertidor("StarWars!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.IO; | |
using System.Runtime.Serialization.Formatters.Binary; | |
namespace SerializeObjectToByteArray | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model Starwars.App.Web.Entities.Jedi | |
@{ | |
ViewData["Title"] = "Details"; | |
Layout = "~/Views/Shared/_Layout.cshtml"; | |
} | |
<h2>Details</h2> | |
Jedi: <strong>@Model.Name</strong> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {Client} = require('virtuoso-sparql-client'); | |
const conn = new Client('http://192.168.0.102:8890/sparql'); | |
conn.setOptions( | |
"application/json", | |
{"foaf": "http://xmlns.com/foaf/0.1/"} | |
); | |
var query = 'SELECT ?nombre ?edad WHERE { ?s foaf:name ?nombre; foaf:age ?edad}'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @DemoTable TABLE ( | |
ID INT NULL, | |
F_Inicio DATE NOT NULL | |
) | |
INSERT INTO @DemoTable | |
VALUES (1 , '2001-01-01'), | |
(NULL , '2001-02-02'), | |
(NULL , '2001-02-03'), | |
(2 , '2001-02-04'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @DemoTable TABLE ( | |
ID INT NULL, | |
F_Inicio DATE NOT NULL | |
) | |
INSERT INTO @DemoTable | |
VALUES (1 , '2001-01-01'), | |
(NULL , '2001-02-02'), | |
(NULL , '2001-02-03'), | |
(2 , '2001-02-04'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------------------------------------------------------- | |
# Verify if MSI is installed via powershell | |
# | |
# Example from https://stackoverflow.com/questions/4753051/how-do-i-check-if-a-particular-msi-is-installed | |
#---------------------------------------------------------------------------------- | |
function Get-VerifyMSIinstalled([string]$DisplayName) | |
{ | |
# paths: x86 and x64 registry keys are different | |
if ([IntPtr]::Size -eq 4) { |
OlderNewer