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
try { ... } | |
catch(Exception ex) { ... } // Catch-Log-Forget |
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
currentEvolutionBoard.ForAllCells( | |
(cell, nextEvolutionBoard) => | |
{ | |
// Any live cell with fewer than two live neighbours dies, as if caused by under-population. | |
if (cell.IsAlive() && cell.AmountOfNeighbours() < 2) | |
{ | |
nextEvolutionBoard.CopyCellFromTemplate(cell).Dies(); | |
} | |
// Any live cell with two or three live neighbours lives on to the next generation. |
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
# Request | |
GET /images/task/1 HTTP/1.1 | |
Host: www.example.org | |
# Response | |
HTTP/1.1 200 OK | |
Content-Type: application/xml;charset=UTF-8 | |
<status xmlns:atom="http://www.w3.org/2005/Atom"> | |
<state>pending</state> |
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
<order xmlns=″http://schemas.restbucks.com″ xmlns:dap=″http://schemas.restbucks.com/dap″> | |
<dap:link mediaType=″application/vnd.restbucks+xml″ uri=″http://restbucks.com/order/1234″ rel=″http://relations.restbucks.com/cancel″/> | |
<dap:link mediaType=″application/vnd.restbucks+xml″ uri=″http://restbucks.com/payment/1234″ rel=″http://relations.restbucks.com/payment″/> | |
<dap:link mediaType=″application/vnd.restbucks+xml″ uri=″http://restbucks.com/order/1234″ rel=″http://relations.restbucks.com/update″/> | |
<dap:link mediaType=″application/vnd.restbucks+xml″ uri=″http://restbucks.com/order/1234″ rel=″self″/> | |
<item> | |
<milk>semi</milk> | |
<size>large</size> | |
<drink>cappuccino</drink> | |
</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
public class HelloWorldController : ApiController | |
{ | |
public IEnumerable<string> Get() | |
{ | |
return new[] { "hello", "world" }; | |
} | |
// [Route("api/{controller}/{id}")] | |
// [HttpGet] | |
public string Get(int id) |
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
{{ range .Params.tags }} | |
<a href="{{ $baseurl }}tags/{{ . | urlize }}" class="btn btn-default btn-xs" role="button"><small><span class="glyphicon glyphicon-tag" aria-hidden="true"></span> {{ . }}</small></a> | |
{{ end }} |
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
{{ partial "footer.html" . }} |
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
SELECT * FROM sys.dm_exec_query_memory_grants | |
SELECT * | |
FROM sys.dm_os_performance_counters | |
WHERE [object_name] LIKE '%Memory Manager%' |
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
SELECT sqltext.TEXT, | |
req.session_id, | |
req.status, | |
req.command, | |
req.cpu_time, | |
req.total_elapsed_time, | |
DB_NAME(req.database_id) | |
FROM sys.dm_exec_requests req | |
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext |
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
WITH CTE AS( | |
SELECT [col1], [col2], [col3], [col4], [col5], [col6], [col7], | |
RN = ROW_NUMBER() OVER(PARTITION BY Col1, Col2, ... ORDER BY OrderColumn) | |
FROM dbo.Table1 | |
) | |
DELETE FROM CTE WHERE RN > 1 |
OlderNewer