This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
void cube(int& l) { | |
l = l * l * l; | |
} | |
int main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
#include <iterator> | |
#include <array> | |
using namespace std; | |
void cube(int& l) { | |
l = l * l * l; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <iterator> | |
#include <algorithm> | |
#include <fstream> | |
using namespace std; | |
vector<int> get_evens(const vector<int>& nums) { | |
vector<int> results; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Student { | |
//private: | |
string name; | |
double gpa; | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on code taken from | |
// http://en.cppreference.com/w/cpp/regex/regex_iterator#Example, | |
// last access 10/22/2016 | |
#include <regex> | |
#include <iostream> | |
using namespace std; | |
int main() { | |
// some words to pick apart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iterator> | |
#include <random> | |
#include <chrono> | |
using namespace std; | |
#ifndef LSEARCH_UTILS_H | |
#define LSEARCH_UTILS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <cstdlib> // for rand | |
#include "utils.h" | |
using namespace std; | |
/** | |
* NOTE: You may add other headers | |
* as well as your own functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns file-upload.handler | |
(:require [compojure.core :refer :all] | |
[compojure.route :as route] | |
[ring.middleware.defaults :refer [wrap-defaults site-defaults]] | |
[ring.middleware.params :refer [wrap-params]] | |
[ring.middleware.multipart-params :refer [wrap-multipart-params]] | |
[ring.middleware.reload :refer [wrap-reload]] | |
[ring.adapter.jetty :refer [run-jetty]] | |
[hiccup.core :refer [html]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.usf; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.util.Scanner; | |
public class Benford { | |
public static void main(String[] args) throws FileNotFoundException { | |
Scanner s = new Scanner(new File("data/sample1.txt")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.util.Scanner; | |
public class FileStringsEx { | |
public static boolean hasComment(String s) { | |
return s.indexOf("(*") != -1 && s.indexOf("*)") != -1; | |
} | |
public static void main(String[] args) throws FileNotFoundException { |
OlderNewer