Skip to content

Instantly share code, notes, and snippets.

View DragonOsman's full-sized avatar

Osman Zakir DragonOsman

View GitHub Profile
@DragonOsman
DragonOsman / cust_std_lib_facilities.cpp
Last active November 5, 2017 17:15
linked lists program for exercise
#include "cust_std_lib_facilities.h"
#include <iostream>
#include <chrono>
#include <stdexcept>
#include <random>
#include <string>
int randint(int min, int max)
{
using namespace std;
var map, infoWindow;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: { lat: -34.397, lng: 150.644 },
zoom: 6
});
infoWindow = new google.maps.InfoWindow;
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {
#ifdef _WIN32
#pragma once
#endif
#ifndef LIST_H_
#define LIST_H_
#include <iterator>
#include <stdexcept>
template<typename Elem>
// Osman Zakir
// 11 / 10 / 2017
// Bjarne Stroustrup: Programming: Principles and Practice Using C++ 2nd Edition
// Chapter 20 "Find highest element" example code (with templated high() function)
// This program has a serious bug that I have to find and fix.
#include "../../cust_std_lib_facilities.h"
#include <algorithm>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <iostream>
#include <vector>
#include <list>
#include "Document.h"
std::istream &operator>>(std::istream &is, Document &d)
{
char ch = ' ';
for ( ; is.get(ch);)
#include <vld.h>
#include "../../cust_std_lib_facilities.h"
int main()
{
vector<int> v1;
try
{
for (int num; std::cin >> num;)
{
@DragonOsman
DragonOsman / dictionary_hash.cpp
Last active December 9, 2017 12:40
A dictionary application using a std::unordered_map
// Osman Zakir
// 12 / 8 / 2017
// Bjarne Stroustrup: Programming: Principles and Practice Using C++ 2nd Edition
// Chapter 21 std::unordered_map "Try this"
// Exercise Specifications:
/**
* Write a small program using #include<unordered_map> . If that doesn’t
* work, unordered_map wasn’t shipped with your C++ implementation. If
* your C++ implementation doesn’t provide unordered_map , you have to
* download one of the available implementations (e.g., see www.boost.org).
#include "Item.h"
#include <string>
#include <cctype>
#include <iostream>
#include <algorithm>
#include "../../cust_std_lib_facilities.h"
Item::Item(const std::string &name, const int iid, const double value)
: m_name{ name }, m_iid{ iid }, m_value{ value }
{
// Osman Zakir
// 12 / 18 / 2017
// Bjarne Stroustrup: Programming: Principles and Practice Using C++ 2nd Edition
// Chapter 21 Drill "More vector use"
// Drill Specifications:
/**
* 1. Read some floating-point values (at least 16 values) from a file into a
* vector<double> called vd .
* 2. Output vd to cout .
* 3. Make a vector vi of type vector<int> with the same number of elements
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,
height=device-height, initial-scale=1.0" />
<meta name="author" content="Osman Zakir" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" type="text/css"