This file contains hidden or 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 <stdio.h> | |
#include "cs50.h" | |
#define S_BUFFER 20 | |
#define L_BUFFER 900 | |
int words(const char sentence[ ]) | |
{ | |
int counted = 0; // result | |
// state: |
This file contains hidden or 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 selenium import webdriver | |
from bs4 import BeautifulSoup | |
news_link = 'http://www.dhakatribune.com/tags/bangladesh%20garments' | |
news_class = 'entry-title' | |
class GetNewsLinks(): | |
def __init__(self): | |
self.chrome = webdriver.Chrome() | |
self.chrome.get(news_link) |
This file contains hidden or 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 bs4 import BeautifulSoup | |
import urllib2 | |
# Scraping Info (visiting a link with tags) | |
""" | |
title: h2 .entry-title with link | |
""" | |
news_link = 'http://www.dhakatribune.com/tags/Garments' |
This file contains hidden or 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 <stdio.h> | |
#include "cs50.h" | |
#define S_BUFFER 20 | |
#define L_BUFFER 900 | |
#define empty '\0' | |
#define print_number(x) printf("%d", x) | |
#define print_string(x) printf("%s", x) | |
void reverse(char str[], int begin, int end); |
This file contains hidden or 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 <stdio.h> | |
#include "cs50.h" | |
#include <math.h> | |
void printX(int dimension) | |
{ | |
// dimension -= 2; | |
dim = dimension - 2; | |
char x[dim][dim]; | |
int i; |
This file contains hidden or 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 <stdio.h> | |
#include "cs50.h" | |
#include <math.h> | |
void printX(int dimension) | |
{ | |
// dimension -= 2; | |
if ((dimension % 2 == 0) || (dimension < 3 || dimension > 23)) return; | |
if (dimension == 3){ |
This file contains hidden or 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 <SDL.h> | |
#include <stdio.h> | |
#ifdef __MINGW32__ | |
#undef main /* Prevents SDL from overriding main() */ | |
#endif | |
/*This source code copyrighted by Lazy Foo' Productions (2004-2015) | |
and may not be redistributed without written permission.*/ |
This file contains hidden or 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
TEMPLATE = app | |
CONFIG += console c++11 | |
CONFIG -= app_bundle | |
CONFIG -= qt | |
SOURCES += main.cpp | |
# Command | |
# -L[Directory path of "lib" folder] -lSDL2 | |
LIBS += -LE://SDL2//i686-w64-mingw32//lib -lSDL2 |
This file contains hidden or 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 <SDL.h> | |
#include <stdio.h> | |
//Program won't run if you don't add this | |
#ifdef __MINGW32__ | |
#undef main /* Prevents SDL from overriding main() */ | |
#endif | |
/*This source code copyrighted by Lazy Foo' Productions (2004-2015) |
This file contains hidden or 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 matplotlib.pyplot as plt | |
short_loss = [-44.49, -44.52, -44.99, -45.49, -46, -46.55,-47.16, -47.72, -48.92, -50.30, -52.04, -57.42] | |
short_freq = [1, 2.45, 2.73, 3.14, 3.57, 4.06, 4.43, 4.66, 5.19, 6.06, 7.99, 8.59] | |
long_loss = [-30.10, -30.45, -31.21, -32.64, -32.95, -33.98, -35.14, -36.12, -36.48, -38.06] | |
long_freq = [1.01, 1.55, 2.6, 3, 3.74, 3.83, 5.22, 5.96, 6.25, 7.35] | |
fig = plt.figure() | |
ax = fig.add_subplot(1, 1, 1) |