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
#include "stdafx.h" | |
#include <string> | |
#include <iostream> | |
#include <map> | |
using namespace std; | |
extern const string Test; | |
bool IsVowel(const char ch); | |
int main() |
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
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){function i(i,a){var o,l,d,r,c,u,h,p,f,m=this.data(),y=this.find("ul"),g=!1;if(m.vals&&0!==y.length){for(i||(i=m.seconds),m.intervalId&&(g=!0,clearTimeout(m.intervalId)),o=Math.floor(i/s),l=o*s,d=Math.floor((i-l)/n),l+=d*n,r=Math.floor((i-l)/60),l+=60*r,c=i-l,u=(o<100?"0"+(o<10?"0":""):"")+o+(d<10?"0":"")+d+(r<10?"0":"")+r+(c<10?"0":"")+c,h=m.vals.length-1,p=u.length-1;h>=0;h-=1,p-=1)f=parseInt(u.substr(p,1),10),m.vals[h]=f,y.eq(h).children().html(f);(g||a)&&(m.ttStartTime=t.now(),m.intervalId=setTimeout(e.bind(this),1e3),this.data("intervalId",m.intervalId))}}function e(i){var s,n,a,o,l,d,r,c=this,u=this.find("ul"),h=this.data();return h.vals&&0!==u.length?("undefined"==typeof i&&(i=h.iSec),s=h.tickCount+1,this.data("tickCount",s),n=h.vals[i],a=u.eq(i),o=a.children(),l=h.countdown?-1:1,o.eq(1).html(n),n+=l,"function"==typeof this.data("step")&&this.data("t |
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
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved. | |
// | |
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | |
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using CefSharp.Example; |
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
#include <chrono> | |
#include <algorithm> | |
#include <functional> | |
#include <iostream> | |
#include <random> | |
#include <string> | |
// Return time in seconds as a double. | |
static std::chrono::high_resolution_clock::time_point GetTime(void) | |
{ |
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
#include <chrono> | |
#include <algorithm> | |
#include <functional> | |
#include <iostream> | |
#include <random> | |
#include <string> | |
// All this should be in a header, but I'm doing this for ease of use in a Gist | |
// Readability | |
using StrlenFunc = size_t(*const)(const char*); |
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
// Be sure to set your project to use the ISO C++17 Standard (/std:c++17) under | |
// C++ Language Standard in Properties... C/C++... Language... | |
#include <string> | |
#include <iostream> | |
#include <algorithm> | |
#include <execution> | |
#include <random> | |
#include <chrono> | |
#include <iomanip> |
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
#include <string> | |
#include <algorithm> | |
#include <functional> | |
#include <iostream> | |
#include <random> | |
#include <map> | |
// Percentage of pickers in each group | |
enum group {low, lowMid, hiMid, hi}; |
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
// Use of lambda with std::accumulate to only add numbers that are n | |
#include <numeric> | |
#include <iterator> | |
#include <iostream> | |
#include <algorithm> | |
#include <iostream> | |
#include <list> | |
#include <numeric> | |
#include <random> | |
#include <vector> |
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
/* | |
This a header file that includes every standard library. | |
You can use it to save time. | |
NOTE: This header file may not be recognized by compilers | |
other than gcc. | |
*/ | |
#include <bits/stdc++.h> | |
/* | |
//Use this if the above header file doesn't work. |
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
#include <Windows.h> | |
static float CalculateCPULoad(unsigned long long idleTicks, unsigned long long totalTicks) | |
{ | |
static unsigned long long _previousTotalTicks = 0; | |
static unsigned long long _previousIdleTicks = 0; | |
unsigned long long totalTicksSinceLastTime = totalTicks-_previousTotalTicks; | |
unsigned long long idleTicksSinceLastTime = idleTicks-_previousIdleTicks; |