Skip to content

Instantly share code, notes, and snippets.

View zaltoprofen's full-sized avatar

nakashima zaltoprofen

  • Tokyo, Japan
View GitHub Profile
Undefined symbols for architecture x86_64:
"boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > const&)", referenced from:
boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<ch
import theano
import theano.tensor as T
EPS=1E-10
x=T.dscalar('x')
y=(x-3)**2 - T.log(x)
dy = T.grad(y,x)
ddy = T.grad(dy,x)
#include <stdio.h>
#include <string.h>
#include <assert.h>
int start_with(char const *str, char const *prefix){
if (strlen(str) < strlen(prefix))
return 0;
return strstr(str, prefix) == str;
}
#include <iostream>
#include <vector>
#include <string>
template<typename T, typename Container = std::vector<T>>
class ChainContainer : public Container {
struct chain{
chain(ChainContainer& c): container(c){}
chain& operator()(T val){
#include <iostream>
#include <functional>
#include <vector>
template<typename Func,
typename TIContainer, typename TIValue = typename TIContainer::value_type,
typename TOValue = decltype(std::declval<Func>()(std::declval<TIValue>())),
typename TOContainer=std::vector<TOValue>>
TOContainer map(Func f, TIContainer cont){
TOContainer retval;
app = angular.module 'hoge'
app.directive 'json', ->
{
require: 'ngModel'
link: (scope, elm, attr, ctrl) ->
ctrl.$parsers.push (value) ->
try
parsed = angular.fromJson(value)
isValid = true
import numpy as np
t = np.arange(-np.pi, np.pi, 0.01)
_X = [np.array([1]*t.shape[0])]
for n in range(1, 51):
_X.append(np.sin(n*t))
_X.append(np.cos(n*t))
X = np.array(_X).T
(define (uniq lst)
(define (uniq-detail head tail)
(cond
((null? tail) (list head))
((eq? head (car tail)) (uniq-detail head (cdr tail)))
(else (cons head (uniq-detail (car tail) (cdr tail))))))
(cond
((null? lst) '())
(else (uniq-detail (car lst) (cdr lst)))))
#include <iostream>
#include <fstream>
#include <utility>
#include <cstdlib>
#include <vector>
int main(int argc, char const* argv[])
{
using namespace std;
if (argc != 4){
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.