echo 'https://{user}:{token}@your_git_url' > ~/.git-credentials && git config --global credential.helper store
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
/* | |
Here two solutions for this problem: | |
Consider an array of numeric strings where each string is a positive number with anywhere from to digits. | |
Sort the array's elements in non-decreasing, or ascending order of their integer values and return the sorted array. | |
Example ['1', '200', '150', '3'] | |
Return the array ['1', '3', '150', '200']. | |
*/ |
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
void countApplesAndOranges(int s, int t, int a, int b, vector<int> apples, vector<int> oranges) { | |
std::transform(apples.begin(), apples.end(),apples.begin(), [a](auto x) { | |
return a + x; | |
}); | |
std::transform(oranges.begin(), oranges.end(),oranges.begin(), [b](auto x) { | |
return b + x; | |
}); | |
std::cout << std::count_if(apples.begin(), apples.end(), [s, t](auto x) { | |
return s <= x && x <= t; | |
}) << std::endl |
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
vector<int> gradingStudents(vector<int> grades) { | |
std::transform(grades.begin(), grades.end(), grades.begin(), [](auto x) { | |
if (x < 38) return x; | |
if (auto d = x % 5; 5 - d < 3) { | |
return x + 5 - d; | |
} | |
return x; | |
}); | |
return grades; | |
} |
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 <bits/stdc++.h> | |
using namespace std; | |
string ltrim(const string &); | |
string rtrim(const string &); | |
vector<string> split(const string &); | |
struct hash_tuple { | |
template <class T1, class T2> |
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 <bits/stdc++.h> | |
using namespace std; | |
string ltrim(const string &); | |
string rtrim(const string &); | |
vector<string> split(const string &); | |
/* | |
* Complete the 'zeroMoveNim' function below. |
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
type KeyType string | |
type ValueType int | |
type BiMap struct { | |
forward map[KeyType]ValueType | |
backward map[ValueType]KeyType | |
} | |
func NewBiMap() *BiMap { | |
return &BiMap{ |
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
/** | |
* @bref Example of how the use of xsimd could be generalized to handle containers like std::vector and xt::xarray. | |
* @link https://xsimd.readthedocs.io/en/latest/vectorized_code.html#memory-alignment-and-tag-dispatching | |
*/ | |
#include <cstddef> | |
#include <vector> | |
#include <xsimd/xsimd.hpp> | |
#include <xtensor/xarray.hpp> | |
#include <xtensor/xmath.hpp> |
-
Open
keychain Access.App
>Certificate Assistant
>Create Certificate
withSelf Signed Root
then set full priviledges to certificate. -
Open terminal and paste:
cat <<EOF > gdb.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
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
namespace io { | |
template <class X> | |
using is_string = typename std::enable_if<std::is_same<X, std::string>::value>::type; | |
template <class X> | |
using is_not_string = typename std::enable_if<!std::is_same<X, std::string>::value>::type; | |
template <class T, class = is_not_string<T>> | |
constexpr T forward_or_transform(T t) { | |
return std::forward<T>(t); |
NewerOlder