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 Users.Id, | |
Users.DisplayName, | |
Min(Posts.CreationDate) as FirstAnswerProvidedDate, | |
Max(Posts.CreationDate) as LastAnswerProvidedDate, | |
Count(Distinct(Posts.Id)) As AnswersProvided, | |
SUM(CASE WHEN Votes.VoteTypeId = 1 THEN 1 ELSE 0 END) AS AcceptedAnswers, | |
SUM(CASE WHEN Votes.VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes, | |
SUM(CASE WHEN Votes.VoteTypeId = 3 THEN 1 ELSE 0 END) AS Downvotes | |
From Users | |
Left Join Posts on Users.Id = Posts.OwnerUserId |
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
const fs = require('fs'); | |
const Promise = require('bluebird'); | |
const createEmptyFileOfSize = (fileName, size) => { | |
return new Promise((resolve, reject) => { | |
try { | |
fd = fs.openSync(fileName, 'w'); | |
fs.writeSync(fd, Buffer.alloc(1), 0, 1, Math.max(0, size-1)); | |
fs.closeSync(fd); | |
resolve(true); |
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
using System; | |
using Microsoft.Azure.Documents; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.Documents.Client; | |
namespace StackOverflow.NetCore | |
{ | |
class Program | |
{ | |
private static IDocumentClient client = new Microsoft.Azure.Documents.Client.DocumentClient(new Uri("https://myaccount.documents.azure.com"), "accountkey=="); |
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
static async void SearchTest() | |
{ | |
var credentials = new SearchCredentials("myaccountkey"); | |
var indexClient = new SearchIndexClient("mysearchservicename", "myindexname", credentials); | |
var searchResults = await indexClient.Documents.SearchAsync("filename:'건국화원'"); | |
Console.WriteLine(searchResults.Results.Count);//Prints 1 | |
} | |