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
class Trie { | |
struct Node{ | |
vector<shared_ptr<Node>> children = vector<shared_ptr<Node>>(26, nullptr); | |
bool is_end = false; | |
}; | |
shared_ptr<Node> root; | |
public: |
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 System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Xml; | |
using System.Xml.Linq; | |
using System.Xml.Schema; | |
public static class MyExtensions |
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
exec sp_executesql N'SELECT ExpertQuery.Time.TimekeeperEmployeeId AS [Time.TimekeeperEmployeeId], ExpertQuery.Time.TimekeeperEmployeeIdSummary_PrimaryText AS [Time.TimekeeperEmployeeIdSummary.PrimaryText], ExpertQuery.Time.TimekeeperEmployeeIdSummary_SecondaryText AS | |
[Time.TimekeeperEmployeeIdSummary.SecondaryText], ExpertQuery.Time.TimekeeperEmployeeIdSummary_CodeText AS [Time.TimekeeperEmployeeIdSummary.CodeText], ExpertQuery.Time.ClientMatterDisplay AS [Time.ClientMatterDisplay], ExpertQuery.Time.MatterId AS [Time.MatterId], ExpertQuery.Time.MatterIdSummary_PrimaryText AS [Time.MatterIdSummary.PrimaryText], ExpertQuery.Time.MatterIdSummary_SecondaryText AS [Time.MatterIdSummary.SecondaryText], ExpertQuery.Time.MatterIdSummary_CodeText AS [Time.MatterIdSummary.CodeText], ExpertQuery.Time.TransactionDate AS [Time.TransactionDate], ExpertQuery.Time.TobillHours AS [Time.TobillHours], ExpertQuery.Time.ToBillAmount AS [Time.ToBillAmount], ExpertQuery.Time.PhaseTaskId AS [Time.PhaseTaskId], ExpertQuery.Time.Phas |
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 character = new Book(name: "马克思主义哲学原理", publisher: "高等教育", isbn: "978-3-16-148410-0") | |
.Pages[47 - 1] | |
.Where(sentence => !sentence.Contains("我")) | |
.ToList() | |
[4 - 1]; | |
Console.WriteLine($"{character} is the character Kyle wanted."); |
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 System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class DecisionTree : IEnumerable<DecisionTree>, IEnumerable | |
{ | |
public int Height { get; private set; } | |
public int Value { get; private set; } | |
public DecisionTree Left { get; set; } |
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
//vs2015 to match public properties and methods | |
public \s*[A-Zv].*\s[A-Z].*\s*? |
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
auto search(std::string const& source, std::string const& goal) -> void | |
{ | |
// add is_max_depth_reached to stop the for loop | |
bool is_max_depth_reached = false; | |
for (max_depth_ = 0; is_max_depth_reached; ++max_depth_) | |
{ | |
is_max_depth_reached = false; | |
visited_.clear(); | |
q_.clear(); | |
for (q_.push_front(Node(source, "")); !q_.empty(); max_q_length_ = std::max(max_q_length_, q_.size())) |
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
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <iostream> | |
using namespace std; | |
class Node | |
{ | |
public: |
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 ProFilePicture = $resource('api/ProfilePicture'); | |
var picture = new ProFilePicture({ | |
userId: | |
'b1d9d320-15cc-4d44-ad4d-9bd57d48ecd5', // note: this string must be the currently logged in user's id | |
data: | |
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAYAAACLz2ctAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAGTXSURBVHja7P15lGX3dd+Hfn5nvPOtuaq7uqrnbgyNgQBBggBBkCApURIpkaIkyxoj++lFSewV58mK46zlxC+DX57tJC/xcxx7vUiyBlMDJZESSZPEQALEQGJGY+x5rO6a68733DP93h/7d+691WgQje4mCVp11qrVQ1Xde+4537OH7/7uvZXWmq1j6/hBHdbWJdg6tgC4dWwBcOvYOrYAuHVsAXDr2Dq2ALh1bAFw69g6tgC4dWwBcOvYOrYAuHVsAXDr2Dq2ALh1bAFw69g6tgC4dWwBcOvYOrYAuHVsAXDr2Dq2ALh1bAFw69g6tgC4dWwBcOvYOrYAuHX80BzOVf1W0gGdQrCMrj+N8sZg/ENg5SCug0b+tBxIQrB80lP/CtU9BYWdULoJcttRuW0QrqMX/xK1/efQ9efRtWewtv88urdIuvhFrNmfQ03cR3r0f4b6C6h9v4kauwddexrqL6LXHgc7j6q+B0r7Uf445GYhDcAZBR1DGoKywK4A6ZV/TmVBtAHeGHrlG2D76MP/VYXOsYj5X+2qnb8Cli3XYvh3wgakEfQuQOcchGvocA06Z6ByI9b+f4hefxIKe1HlG6B1DN14EVW+Bco3otefRCkbxt6PvvgFKB6A9lH |
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
//put what follows into the file index.js | |
var ImageDemo = $resource('api/ImageDemo'); | |
var img = new ImageDemo({ dataUri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAYAAACLz2ctAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAGTXSURBVHja7P15lGX3dd+Hfn5nvPOtuaq7uqrnbgyNgQBBggBBkCApURIpkaIkyxoj++lFSewV58mK46zlxC+DX57tJC/xcxx7vUiyBlMDJZESSZPEQALEQGJGY+x5rO6a68733DP93h/7d+691WgQje4mCVp11qrVQ1Xde+4537OH7/7uvZXWmq1j6/hBHdbWJdg6tgC4dWwBcOvYOrYAuHVsAXDr2Dq2ALh1bAFw69g6tgC4dWwBcOvYOrYAuHVsAXDr2Dq2ALh1bAFw69g6tgC4dWwBcOvYOrYAuHVsAXDr2Dq2ALh1bAFw69g6tgC4dWwBcOvYOrYAuHX80BzOVf1W0gGdQrCMrj+N8sZg/ENg5SCug0b+tBxIQrB80lP/CtU9BYWdULoJcttRuW0QrqMX/xK1/efQ9efRtWewtv88urdIuvhFrNmfQ03cR3r0f4b6C6h9v4kauwddexrqL6LXHgc7j6q+B0r7Uf445GYhDcAZBR1DGoKywK4A6ZV/TmVBtAHeGHrlG2D76MP/VYXOsYj5X+2qnb8Cli3XYvh3wgakEfQuQOcchGvocA06Z6ByI9b+f4hefxIKe1HlG6B1DN14EVW+Bco3otefRCkbxt6PvvgFKB6A9lH04hchN4fyZ6C0F8Y/goobpK/+A/BGsXb/p6AUevnrqJG70KvfguJOyO+E3jLoCFDvGvCpuV/esoBXeKkykN2A5f5t0P+AuPXj |
NewerOlder