This file contains hidden or 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
| #r "System.Xml.dll" | |
| #r "System.Runtime.Serialization.dll" | |
| open Microsoft.FSharp.Reflection | |
| open System.IO | |
| open System.Reflection | |
| open System.Runtime.Serialization | |
| open System.Runtime.Serialization.Formatters.Binary | |
| open System.Runtime.Serialization.Json | |
| open System.Text |
This file contains hidden or 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
| public interface IRenderable | |
| { | |
| string TransformText(); | |
| string Render<T>(object parameters); | |
| void Initialize(); | |
| } | |
| public partial class Layout : IRenderable | |
| { | |
| public IRenderable Content { get; set; } |
This file contains hidden or 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.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Data.SqlClient; | |
| using System.Text.RegularExpressions; | |
| using Dapper; | |
| namespace ConsoleApplication2 | |
| { |
This file contains hidden or 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
| private Dictionary<string, string> PathForRegex(string path) | |
| { | |
| var dic = new Dictionary<string, Regex> { | |
| {"foo", new Regex("foo/(?<directory_id>\\d+)/bar/(?<coast>\\d+)/hei", RegexOptions.ExplicitCapture)}, | |
| {"hei", new Regex("foo/(?<name>\\w+)/jow", RegexOptions.ExplicitCapture)} | |
| }; | |
| var Params = | |
| ( |
This file contains hidden or 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
| Get("foo/bar.html", | |
| (request, response) => { | |
| using (var connection = new SqlConnection( | |
| System.Configuration.ConfigurationManager.AppSettings["strConnection"])) | |
| { | |
| connection.Open(); | |
| var result = connection.Query<ExecutiveReportResult>( | |
| Util.getSql("rm_consulta_relatorio_executivo"), |
This file contains hidden or 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
| let newtonSqrt (x : float) : float = | |
| let accuracy : float = 0.00001 // desired accuracy | |
| let rec iterate (x : float) (a : float) : float = | |
| let diff : float = x - a*a | |
| if abs diff <= accuracy | |
| then a | |
| else iterate x ((a + x/a) / 2.0) | |
| iterate x (x/2.0) |
This file contains hidden or 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
| let badcode x y = | |
| if y | |
| then newtonSqrt x | |
| else newtonSqrt "abc" |
This file contains hidden or 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
| val newtonSqrt : float -> float |
This file contains hidden or 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
| let newtonSqrt x = | |
| let accuracy = 0.00001 // desired accuracy | |
| let rec iterate a = | |
| let diff = x - a*a | |
| if abs diff <= accuracy | |
| then a | |
| else iterate ((a + x/a) / 2.0) | |
| iterate (x/2.0) |
This file contains hidden or 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
| # Only insert data | |
| mysqldump --compact --no-create-info | |
| # Only structure | |
| mysqldump --compact --no-data |