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
//Sample usage of AE.NET.Mail | |
//https://github.com/andyedinborough/aenetmail | |
using (var pop = new AE.Net.Mail.Pop3Client(_host, _username, _password, _port, _useSSL)) | |
{ | |
var count = pop.GetMessageCount(); | |
for (var i = count - 1; i >= 0; i--) | |
{ | |
var msg = pop.GetMessage(i, false); |
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
sSQL = @"SELECT | |
A.CTA_ID, | |
A.CTA_AG_NUM, | |
A.CTA_AG_NOM, | |
A.CTA_NUM, | |
A.CTA_NOM_GRT, | |
A.CTA_BCO_ID, | |
B.BCO_NOM, | |
A.CTA_DD_TEL, | |
A.CTA_TEL, |
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
;5 + 4 (2 - (3 - (6 + 4/5))) / 3(6 - 2)(2 - 7) | |
(/ (+ 5 4 | |
(- 2 | |
(- 3 | |
(+ 6 | |
(/ 4 5) | |
) | |
) | |
) |
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 myNamespace = myNamespace || {}; | |
myNamespace.jqGridWrapper = function (gridId, pagerId, gridUrl, gridConfig) { | |
var grid = $(gridId).jqGrid({ | |
url: gridUrl, | |
datatype: "json", | |
colNames: gridConfig.colNames, | |
colModel: gridConfig.colModel, | |
rowNum: 10, | |
rowList: [10, 20, 30], |
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
function PrintContent() { | |
printWindow = window.open("", "mywindow", "location=0,status=0,scrollbars=1,resizable=1"); | |
var strContent = "<html><head>"; | |
strContent = strContent + "<title" + ">Print Preview</title>"; | |
strContent = strContent + "<link href=\"Styles/jqGrid/ui.jqgrid.css\" type=\"text/css\" rel=\"Stylesheet\" />"; | |
strContent = strContent + "<link href=\"Styles/JQueryUI/jquery-ui-1.8.16.custom.css\" type=\"text/css\" rel=\"Stylesheet\" />"; | |
strContent = strContent + "<link href=\"Styles/ASI/Main.css\" type=\"text/css\" rel=\"Stylesheet\" />"; | |
strContent = strContent + "<script type=\"text/javascript\" src=\"ClientScript/Shared/jquery-1.6.2.min.js\"></scr" + "ipt>"; |
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
//Module | |
Widget = function (core) { | |
var Entry = function (entryText, accountId) { | |
this.EntryText = entryText; | |
this.AccountId = accountId; | |
}; | |
var EntriesViewModel = function () { | |
var that = this; |
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 Node = function (v) { | |
if ( !(this instanceof arguments.callee) ) { | |
throw new Error("Constructor called as a function"); | |
} | |
this.value = v; | |
this.next = null; | |
this.previous = null; | |
} |
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
public class ProductDetailTranslator | |
{ | |
public ProductDetail Translate(string xmlFrom) | |
{ | |
var productTo = new ProductDetail(); | |
var xmlReader = XmlReader.Create(new StringReader(xmlFrom)); | |
var productDetail = XElement.Load(xmlReader); | |
var parentGroups = productDetail.Elements("Grouping").First().Elements("section") | |
.Select(parentGroup => new Group() { Name = parentGroup.Elements("displayname").First().Value, Items = GetChildren(parentGroup).ToList() }); |
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
//C# | |
public T FindInList(List<T> source, List<T> target> | |
{ | |
foreach(T item in source) | |
{ | |
foreach(T targ in target) | |
{ | |
if(item == targ) | |
return item |
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
let entryDate = match List.filter dateToken tokens with | |
| r when r.Length > 0 -> | |
Some(Seq.head r) | |
| otherwise -> | |
None |