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; | |
namespace Macto | |
{ | |
public class Inmate | |
{ | |
public int Id { 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
{ | |
"Results": [ | |
{ | |
"Title": "Macto: The boundaries of a prison", | |
"LegacySlug": null, | |
"Body": "<p>Macto is a prison management system. To be rather more exact, it is an <em>incarceration </em>management system. Managing a prison is a very complex process (did you ever think about who takes the trash out? Or how to handle things like watch rotations?).</p> <p>I am getting ahead of myself, however. The first thing that we have to do when we start designing a system is check:</p> <ul> <li>What is the scope of the system?</li> <li>What is the intended usage?</li> <li>Who are the users?</li> <li>What other systems are we going to interface with?</li></ul> <p>Those are the basics, because in a lot of projects, they don’t get asked.</p> <p>Running a prison is a complex task, I already said. If we wanted a single piece of software to do it all, we would have to do a <em>lot</em> of stuff that we don’t really need. For example, are we going to write our own payroll system for the prison’s stuff? O |
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.Concurrent; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using Glimpse.Core.Extensibility; | |
using Raven.Client.Document; | |
namespace Glimpse.RavenDb | |
{ |
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 class Repository { | |
private gReadieModelContext _Ctx = gReadieModelContext.Create(gReadieModelContext.ConnectionString); | |
public Func<gReadieModelContext, IEnumerable<Folder>> Query_FoldersWithUnreadPosts = | |
CompiledQuery.Compile((gReadieModelContext db) => db.Folders.Where(d => d.UnreadCount != 0).AsEnumerable()); | |
public IEnumerable<Folder> GetFoldersWithUnreadPosts() { | |
return Query_FoldersWithUnread(_Ctx); | |
} | |
} |
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
if (((double)DeviceStatus.ApplicationCurrentMemoryUsage / (double)DeviceStatus.ApplicationMemoryUsageLimit) * 100d > 97d) { | |
// We are using too much memory, try clean a few things up | |
if (_Ctx != null) | |
_Ctx.Dispose(); | |
_Ctx = new gReadieModelContext(gReadieModelContext.ConnectionString); | |
GC.Collect(); | |
if (((double)DeviceStatus.ApplicationCurrentMemoryUsage / (double)DeviceStatus.ApplicationMemoryUsageLimit) * 100d > 97d) { | |
// We couldn't recover enough memory, so we are really running out, lets be nice and bail | |
NotifyComplete(); | |
return; |
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
"C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.1\Tools\IsolatedStorageExplorerTool\ISETool.exe" ts de b8c6eab0-543c-4b55-be96-0b3da982df37 "C:\Users\chris_sainty\Desktop\IsoStore" | |
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
<ul data-bind="template: { name : 'tweetTemplate', foreach: tweets }"></ul> | |
<input type="text" placeholder="search..." data-bind="value: searchTerm" /> | |
<button data-bind="click: search">Search</button> | |
<script type="text/x-jquery-tmpl" id="tweetTemplate"> | |
<li class="tweet"> | |
<img src="${profile_image_url}" alt="${from_user}" /> | |
<p class="content"> |
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 class ApiModule : NancyModule | |
{ | |
private readonly IDataStore _Data; | |
public ApiModule(IDataStore data) : base("/api") | |
{ | |
_Data = data; | |
Get["/messages/list"] = p => Response.AsJson(_Data.GetMessages()); |
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
var http = require('http'); | |
http.createServer(function(request, response) { | |
response.statusCode = 200; | |
response.setHeader('Content-Type', 'text/plain'); | |
response.end('Hello World'); | |
}).listen(8080); |
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.Linq; | |
using MongoDB.Driver; | |
using Nancy; | |
using NancyMongo.Models; | |
namespace NancyMongo | |
{ | |
public class ApiModule : NancyModule | |
{ | |
private readonly MongoCollection<Message> _Messages; |
OlderNewer