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.Text; | |
namespace CesarCipher { | |
class Program { | |
static void Main(string[] args) { | |
// if upper or lower letter increment by N (rotate at end of alphabet) | |
// 97 - 122 lower, 65 - 90 upper | |
// % 26 allows us to work with #'s greater than 26 with same algorithm |
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
SELECT a.index_id, name, avg_fragmentation_in_percent, fragment_count, | |
avg_fragment_size_in_pages | |
FROM sys.dm_db_index_physical_stats(DB_ID('database'), | |
OBJECT_ID('table'), NULL, NULL, NULL) AS a | |
JOIN sys.indexes AS b ON a.OBJECT_ID = b.OBJECT_ID AND a.index_id = b.index_id; |
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
// mock file | |
function MockFile() { }; | |
MockFile.prototype.create = function (name, size, mimeType) { | |
name = name || "mock.txt"; | |
size = size || 1024; | |
mimeType = mimeType || 'plain/txt'; | |
function range(count) { | |
var output = ""; |
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
Download and install NodeJs | |
Open a command/terminal and type npm to verify installation and path variable setup | |
Run npm install -g karma | |
Run npm install -g karma-cli | |
Run npm install karma-jasmine karma-phantom-launcher jasmine-core --save-dev |
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 MvcApiJsonRequest : JsonResult { | |
private readonly int _httpStatusCode; | |
private readonly string _invalidHttpStatusCodeMessage = "set httpStatusCode to an allowed http status code"; | |
public MvcApiJsonRequest() { | |
_httpStatusCode = 200; | |
} | |
public MvcApiJsonRequest(object content) : this(200, content) {} | |
public MvcApiJsonRequest(int httpStatusCode) : this(httpStatusCode, null) {} |