Skip to content

Instantly share code, notes, and snippets.

View shaina7837's full-sized avatar

Shaina Sabarwal shaina7837

View GitHub Profile
MAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(micromax)
SET (WT_CONNECTOR "wthttp" CACHE STRING "abc")
ADD_SUBDIRECTORY(source)
SET(WT_PROJECT_SOURCE
shaina.cpp
)
SET(WT_PROJECT_TARGET f1)
ADD_EXECUTABLE (${WT_PROJECT_TARGET} ${WT_PROJECT_SOURCE})
TARGET_LINK_LIBRARIES(${WT_PROJECT_TARGET} ${WT_CONNECTOR} wt)
#include <iostream>
#include <string.h>
using namespace std;
main()
{
char *p[6] = {"paper", "pen", "pencil", "book"};
char *str;
cout << "enter what you want to purchase? " << endl;
#include <Wt/WApplication>
#include <Wt/WContainerWidget>
#include <Wt/WPainter>
#include <Wt/WPaintedWidget>
#include <Wt/WPaintDevice>
using namespace Wt;
using namespace std;
class PaintApplication : public WPaintedWidget //Paint class
@shaina7837
shaina7837 / gist:6051970
Created July 22, 2013 07:37
output is: Input some numbers and then end the input 3 4 5 end if I use 1st simple for loop, output is 5 if use 2nd one range for loop output is 5 5 5 why ?
#include <iostream>
#include <vector>
using namespace std;
main()
{
vector<int> v;
int number;
auto c = 0;
cout <<"Input some numbers and then end the input\n";
@shaina7837
shaina7837 / gist:6060161
Last active December 20, 2015 02:59
output: simple copy constructor copy assignment operator marks 82 name shaina marks 0 name
#include <iostream>
using namespace std;
class student
{
string name;
float marks;
public: //simple constructor with parameters
student (const string n, const float m){
name = n;
g++-4.8 -Wall -std=c++0x -c session.C
In file included from /usr/include/boost/signals/trackable.hpp:14:0,
from /usr/include/Wt/WObject:14,
from /usr/include/Wt/Auth/Login:10,
from session.h:15,
from session.C:16:
/usr/include/boost/signals/connection.hpp: In member function ‘boost::shared_ptr<boost::signals::detail::basic_connection> boost::signals::connection::get_connection() const’:
/usr/include/boost/signals/connection.hpp:102:16: error: use of deleted function ‘boost::shared_ptr<boost::signals::detail::basic_connection>::shared_ptr(const boost::shared_ptr<boost::signals::detail::basic_connection>&)’
{ return con; }
^
#include "showpost.h"
Showpost::Showpost(WContainerWidget *parent) : WContainerWidget(parent),sqlite3("datadb")
{
session_.setConnection(sqlite3);
session_.mapClass<Post> ("post");
session_.mapClass<Category> ("category");
sqlite3.setProperty("show-queries","true");
try{
@shaina7837
shaina7837 / form.php
Created October 5, 2013 01:57
A program to make a form using php and MySql.
<!DOCTYPE HTML>
<html>
<head> <title> form </title>
</head>
<body>
<form action="insert.php" method="post">
Firstname: <input type="text" name="firstname">
Lastname: <input type="text" name="lastname">
Age: <input type="text" name="age">
#include <iostream>
#include <GL/glut.h>
using namespace std;
unsigned char get_col[50][50][3];
void init(void)
{
glClearColor(1.0, 0.0, 0.0, 0.0);
// glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
#include <GL/glut.h>
#include <cmath>
void line(float x, float y)
{
glClearColor(1.0, 1.0, 1.0, 1.0); //defining for background color
glClear(GL_COLOR_BUFFER_BIT); //assigning the defined color to background
glColor3f(0.0, 0.0, 0.0); // color of the object to be displayed
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);//representing the real world dimensions in 2D screen and defining the coordinate limits
glPointSize(2);
glBegin(GL_LINES); //start drawing polygon