Skip to content

Instantly share code, notes, and snippets.

View Shravan40's full-sized avatar

Shravan Kumar Gond Shravan40

View GitHub Profile
@Shravan40
Shravan40 / crow_all.h
Created December 3, 2018 06:27
Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask). This is a header file which needs to be included in your project.
#pragma once
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
#include <unordered_map>
#include <iostream>
#include <boost/optional.hpp>
\documentclass[letter]{res}
\setlength{\textheight}{9.5in}
%\usepackage{fontspec}
\usepackage{geometry}
\usepackage{xcolor}
\usepackage[utf8]{inputenc}
\geometry{
a4paper,
total={210mm,297mm},
┌─[shravan40@Shravan] - [~/work/ChangeStreet-Algorithm] - [Sat Dec 24, 17:11]
└─[$] <git:(mutualFundSelection*)> g++ -std=c++1y main.cpp -I ../../date -L ./cpr/build/lib -lsqlpp-mysql -lmysqlclient -lboost_system -lpthread
/tmp/ccyYCkCr.o: In function `main::{lambda(crow::request const&)#14}::operator()(crow::request const&) const':
main.cpp:(.text+0x876b): undefined reference to `cpr::Parameters::Parameters(std::initializer_list<cpr::Parameter> const&)'
/tmp/ccyYCkCr.o: In function `cpr::Response cpr::Get<std::string, cpr::Authentication, cpr::Parameters>(std::string&&, cpr::Authentication&&, cpr::Parameters&&)':
main.cpp:(.text._ZN3cpr3GetIISsNS_14AuthenticationENS_10ParametersEEEENS_8ResponseEDpOT_[_ZN3cpr3GetIISsNS_14AuthenticationENS_10ParametersEEEENS_8ResponseEDpOT_]+0x23): undefined reference to `cpr::Session::Session()'
main.cpp:(.text._ZN3cpr3GetIISsNS_14AuthenticationENS_10ParametersEEEENS_8ResponseEDpOT_[_ZN3cpr3GetIISsNS_14AuthenticationENS_10ParametersEEEENS_8ResponseEDpOT_]+0x75): undefined ref
┌─[shravan40@Shravan] - [~/work/ChangeStreet-Algorithm] - [Sat Dec 24, 17:01]
└─[$] <git:(mutualFundSelection*)> find . -name libcpr.a
./cpr/build/lib/libcpr.a
┌─[shravan40@Shravan] - [~/work/ChangeStreet-Algorithm] - [Sat Dec 24, 17:02]
└─[$] <git:(mutualFundSelection*)> g++-4.9 -std=c++1y main.cpp -I ../../date -L ./cpr/build/lib/libcpr.a -lsqlpp-mysql -lmysqlclient -lboost_system -lpthread
/tmp/ccuDKcGu.o: In function `main::{lambda(crow::request const&)#14}::operator()(crow::request const&) const':
main.cpp:(.text+0x876b): undefined reference to `cpr::Parameters::Parameters(std::initializer_list<cpr::Parameter> const&)'
/tmp/ccuDKcGu.o: In function `cpr::Response cpr::Get<std::string, cpr::Authentication, cpr::Parameters>(std::string&&, cpr::Authentication&&, cpr::Parameters&&)':
main.cpp:(.text._ZN3cpr3GetIISsNS_14AuthenticationENS_10ParametersEEEENS_8ResponseEDpOT_[_ZN3cpr3GetIISsNS_14AuthenticationENS_10ParametersEEEENS_8ResponseEDpOT_]+0x23): undefined reference to `cpr::Session::Session()'
main.cpp:(
┌─[shravan40@ChangeStreet] - [~] - [Fri Dec 16, 16:41]
└─[$] <> git clone git@github.com:jpbarrette/curlpp.git
Cloning into 'curlpp'...
remote: Counting objects: 1840, done.
remote: Total 1840 (delta 0), reused 0 (delta 0), pack-reused 1840
Receiving objects: 100% (1840/1840), 2.48 MiB | 912.00 KiB/s, done.
Resolving deltas: 100% (1429/1429), done.
┌─[shravan40@ChangeStreet] - [~] - [Fri Dec 16, 16:42]
└─[$] <> cd curlpp && mkdir build && cd build && cmake ..
-- The C compiler identification is GNU 4.9.2
@Shravan40
Shravan40 / gist:3377b3645ef7b1f1355b9eb02c693d81
Created November 19, 2016 00:18
SQLPP11 and SQLPP11-Connector Library build log
┌─[shravan40@Shravan] - [~/sqlpp11/build] - [Sat Nov 19, 05:46]
└─[$] <git:(master*)> cmake ..
-- Pyparsing is installed: Enabling ddl2cpp tests.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/shravan40/sqlpp11/build
┌─[shravan40@Shravan] - [~/sqlpp11/build] - [Sat Nov 19, 05:46]
└─[$] <git:(master*)> make
[ 29%] Built target sqlpp11_tests
[ 32%] Built target sqlpp11_result_row
crow_all.h:9382:86: error: no matching function for call to ‘crow::Crow<>::route(const char [20])’
#define CROW_ROUTE(app, url) app.route<crow::black_magic::get_parameter_tag(url)>(url)
^
main.cpp:20:5: note: in expansion of macro ‘CROW_ROUTE’
CROW_ROUTE(app,"/welcome/<uint64_t>")
^
crow_all.h:9382:86: note: candidate is:
#define CROW_ROUTE(app, url) app.route<crow::black_magic::get_parameter_tag(url)>(url)
^
main.cpp:20:5: note: in expansion of macro ‘CROW_ROUTE’
@Shravan40
Shravan40 / driver.h
Created September 29, 2016 14:32
MySQL Driver.h
/*
Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPL
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPL as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
*/
@Shravan40
Shravan40 / non_repeat_element.cpp
Created May 18, 2014 07:09
Find the first non repeating element
#include <limits>
#include <iostream>
int firstNonRepeatingInteger(int* input, int n)
{
int min = std::numeric_limits<int>::max() ;
int max = std::numeric_limits<int>::min() ;
// Find min/max values in input array.
for(int i = 0; i < n; ++i)
@Shravan40
Shravan40 / semi_sort.cpp
Created January 27, 2014 23:29
Given an array of numbers and the size of array. Wrtite a program to arrange all the negative numbers at the beginning followed by positive numbers..(Note : The order of elements should be the same as in the input) ex : i/p : -3 4 2 1 -8 6 -5 o/p: -3 -8 -5 4 2 1 6 conditions: should be done in O(n) and without using extra space.
#include<iostream>
#include<vector>
using namespace std;
int main()
{
cout<<"Enter the number of element in sequence : ";
int n;
cin>>n;
vector<int> data;
int temp;