Skip to content

Instantly share code, notes, and snippets.

#include <algorithm>
#include <string>
#include <iostream>
using namespace std;
int main()
{
string s1("UNIQLO");
string s2("apple");
#include <iostream>
#include <string>
#include <windows.h>
int main()
{
WIN32_FIND_DATA FindDirData;
std::string targets = "C:\\*";
HANDLE hFind = FindFirstFile(targets.c_str(), &FindDirData);
J(¥Theta) =
- ¥frac{1}{m}
¥left[
¥sum_{i=1}^{m}
¥sum_{k=1}^{K}
y_{k}^{(i)} ¥rm{log} ¥, (h_¥Theta (x^{(i)}))_{k} +
(1-y_{k}^{(i)}) ¥rm{log} ¥, (1-(h_¥Theta (x^{(i)}))_{k})
¥right] +
¥frac{¥lambda}{2m}
¥sum_{l=1}^{L-1}
import os
# Given
class Banner(object):
def __init__(self, text):
self.text = text
def show_with_paren(self):
print '(%s)' % self.text
import os
# Given
class Banner(object):
def __init__(self, text):
self.text = text
def show_with_paren(self):
print '(%s)' % self.text
#include <iostream>
using namespace std;
int fact(int k)
{
if( k == 0 ) return 1;
return k * fact(k-1);
}
\newcommand{\argmax}{\mathop{\rm arg¥,max}\limits}
¥hat{¥theta} = ¥argmax L(¥theta)
#include <string>
#include <iostream>
using namespace std;
int main()
{
int size = 4;
string pat(size, '.');
#include <string>
#include <iostream>
using namespace std;
int main()
{
string s = "12345 567890";
string::size_type idx = s.find(" ");