Skip to content

Instantly share code, notes, and snippets.

Avatar

Srajan Garg srajangarg

  • IIT Bombay
  • Mumbai
View GitHub Profile
View allocator.h
#include <bits/stdc++.h>
#include <stdlib.h>
#include <sys/mman.h>
using namespace std;
#define USE_FLASH
void print_and_exit(string s)
{
@srajangarg
srajangarg / final_submission.txt
Last active Aug 17, 2016
GSoC Final submission : Srajan Garg
View final_submission.txt
PRs authored by me at github.com/symengine/symengine :
https://github.com/symengine/symengine/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Asrajangarg
A personal blog, explaining the work done by me on a weekly basis :
http://srajangarg.github.io/
@srajangarg
srajangarg / q12.sql
Last active Jul 26, 2016
DB Lab 1 Discprepancies
View q12.sql
Your Answer:
select distinct S1.time_slot_id, S2.time_slot_id
from time_slot as S1, time_slot as S2
where S1.day = S2.day and S1.time_slot_id != S2.time_slot_id
and numrange((60*S1.start_hr+S1.start_min), 60*S1.end_hr+S1.end_min)
&& numrange(60*S2.start_hr+S2.start_min, 60*S2.end_hr+S2.end_min)
Instructor Answer:
@srajangarg
srajangarg / q9.sql
Created Jul 26, 2016
DB Lab 1 Discprepancies
View q9.sql
Your Answer:
with stable as
(select course_id, sec_id, year, semester, count(ID) as numstu from takes
group by course_id, sec_id, year, semester),
enrol(max_enroll) as
(
select max(numstu) from stable
)
select course_id, sec_id, year, semester, numstu from stable, enrol
View gist:1377cab18be847a19f07afc2d33eb830
In file included from /usr/local/include/piranha/symbol_set.hpp:49:0,
from /usr/local/include/piranha/is_key.hpp:37,
from /usr/local/include/piranha/math.hpp:49,
from ./symengine/expression.h:196,
from symengine/polys/uintpoly_piranha.cpp:2:
/usr/local/include/piranha/term.hpp: In instantiation of ‘class piranha::term<SymEngine::mpq_wrapper, piranha::monomial<unsigned int> >’:
/usr/include/c++/5/type_traits:842:28: required by substitution of ‘template<class _Tp, class> static std::true_type std::__do_is_default_constructible_impl::__test(int) [with _Tp = piranha::term<SymEngine::mpq_wrapper, piranha::monomial<unsigned int> >; <template-parameter-1-2> = <missing>]’
/usr/include/c++/5/type_traits:853:35: required from ‘struct std::__is_default_constructible_impl<piranha::term<SymEngine::mpq_wrapper, piranha::monomial<unsigned int> > >’
/usr/include/c++/5/type_traits:137:12: required from ‘struct std::__and_<std::__not_<std::is_void<piran
View cmake settings
cmake .
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- serialization
-- iostreams
-- regex
--------------------------------------------------------------------------------
+-------------------------------+
| Configuration results SUMMARY |
View test.cpp
RCP<const Symbol> x = symbol("x");
RCP<const Symbol> y = symbol("y");
RCP<const Basic> basic, gen;
RCP<const Basic> i2 = integer(2);
RCP<const Basic> i1 = integer(1);
RCP<const Basic> i5 = integer(5);
RCP<const Basic> twopx = pow(i2, x);
RCP<const Basic> xb2 = div(x, i2);
RCP<const Basic> r3b2 = div(integer(3), i2);
RCP<const Basic> half = div(one, i2);
View gist:480914342934253677651f461b1ecfb9
+-rwxrwxr-x 1 garg garg 1873 Jul 30 2015 client.down
+-rwxrwxr-x 1 garg garg 1835 Jul 30 2015 client.up
+-rw-rw-r-- 1 garg garg 5813 May 8 14:39 iitbvpn.conf
+-rwxr-xr-x 1 root root 1301 Feb 2 18:10 update-resolv-conf
@srajangarg
srajangarg / piranha_bench
Last active Jun 16, 2016
`testmul.cpp` requires only minimal changes for benchmarking `UIntPolyPiranha` too.
View piranha_bench
0.25 1 2 0.920732
0.25 2 2 0.870588
0.25 3 2 0.995726
0.25 4 2 1.051118
0.25 5 2 1.310433
0.25 6 2 1.345603
0.25 7 2 1.327754
0.25 8 2 1.548291
0.25 9 2 1.546229
0.25 10 2 1.686339
View gist:4376bd3fe458c6d674703d3635604f7d
In file included from /usr/local/include/piranha/symbol_set.hpp:49:0,
from /usr/local/include/piranha/is_key.hpp:37,
from /usr/local/include/piranha/math.hpp:49,
from /home/garg/code/symengine/symengine/expression.h:192,
from /home/garg/code/symengine/symengine/series_piranha.h:6,
from /home/garg/code/symengine/symengine/series_piranha.cpp:2:
/usr/local/include/piranha/hash_set.hpp: In instantiation of ‘class piranha::hash_set<piranha::term<SymEngine::mpz_wrapper, piranha::monomial<unsigned int> >, piranha::detail::term_hasher<piranha::term<SymEngine::mpz_wrapper, piranha::monomial<unsigned int> > >, std::equal_to<piranha::term<SymEngine::mpz_wrapper, piranha::monomial<unsigned int> > > >’:
/usr/local/include/piranha/series.hpp:1232:72: required from ‘class piranha::series<SymEngine::mpz_wrapper, piranha::monomial<unsigned int>, piranha::polynomial<SymEngine::mpz_wrapper, piranha::monomial<unsigned int> > >’
/usr/local/incl