View vowel_prob.py
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 re | |
import sys | |
yevgeny = "" | |
vowels_after_vowels = 0.0 | |
vowels_after_consonants = 0.0 | |
number_of_vowels = 0.0 | |
vowels = [ "a", "e", "i", "o", "u", "A", "E", "I", "O", "U" ] | |
View GamePlayStatistics.cpp:
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
/** SuggestProjectileVelocity **/ | |
// note: this will automatically fall back to line test if radius is small enough// Based on analytic solution to ballistic angle of launch http://en.wikipedia.org/wiki/Trajectory_of_a_projectile#Angle_required_to_hit_coordinate_.28x.2Cy.29bool UGameplayStatics::SuggestProjectileVelocity(const UObject* WorldContextObject, FVector& OutTossVelocity, FVector Start, FVector End, float TossSpeed, bool bFavorHighArc, float CollisionRadius, float OverrideGravityZ, ESuggestProjVelocityTraceOption::Type TraceOption, const FCollisionResponseParams& ResponseParam, const TArray<AActor*>& ActorsToIgnore, bool bDrawDebug){ | |
const FVector FlightDelta = End - Start; | |
const FVector DirXY = FlightDelta.GetSafeNormal2D(); | |
const float DeltaXY = FlightDelta.Size2D(); | |
const float DeltaZ = FlightDelta.Z; | |
const float TossSpeedSq = FMath::Square(TossSpeed); |
View draw_olympic_logo.py
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
from turtle import Turtle | |
def create_circle( turtle_object, coordinates, color, radius ): | |
"""Creates a circle with **coordinates** as start point.""" | |
# Pull up the pen first. | |
turtle_object.penup() | |
# Go to initial coordinates. | |
turtle_object.goto(coordinates[0], coordinates[1]); | |
# Pendown to start drawing. | |
turtle_object.pendown(); |
View maze_player.cpp
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 <cstdio> | |
#include <string> | |
using namespace std; | |
// Used for proper response structuring. | |
// reduces code on check_for_dots and check_for_xs. | |
struct Response | |
{ |
View string_to_text.cpp
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 <stdexcept> | |
#include <cmath> | |
using namespace std; | |
/** | |
* Reports any non numeric charaters in a string. Removes if just whitespace. | |
* @param {string} str - String to convert. | |
* @return {string} String with just numbers. | |
*/ |
View pointer_fix.cpp
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 Person | |
{ | |
public: | |
string name; | |
int age; | |
double height; |
View moron.cpp
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
/* | |
Execute the program as: | |
g++ -std=c++11 file_name.cpp -o file_name | |
*/ | |
#include <iostream> | |
#include <fstream> | |
#include <string> | |
using namespace std; |
View chegg_1491721626696.cpp
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
/** | |
* "Sun Apr 09 2017 12:36:54 GMT+0530 (IST)" | |
* Design a file filter package. | |
* | |
* 1) A file filter reads an input file, transforms it in some way, and writes the result to an output file. | |
* You are tasked to write an abstract Filter class that defines a pure virtual function char transform | |
* (char ch) for transforming a single character . | |
* | |
* 2) The Filter class should have member variables to hold the input and output streams; it also should | |
* have a default constructor that initializes the input/output streams to cin/cout respectively as well |
View homework1_mscppcouse_module3.cpp
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
// You cannot do << to the cin, you can do 'cin >> auto a' though but I | |
// think it'd be great to initialize int's first and then getting values. | |
cin<< auto a; | |
cin<<auto b; | |
// This way powerMultiply will already have a power of a. | |
int powerMultiply=a; | |
// so you need not do it i<b times, you just have to do | |
// it i < (b-1) times. | |
for(int i =0;i<b;i++) |
View problem11.cpp
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 <iomanip> | |
int grid[20][20] = { | |
{ 8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8 }, | |
{ 49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0 }, | |
{ 81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65 }, | |
{ 52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91 }, | |
{ 22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80 }, | |
{ 24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50 }, |
NewerOlder