instruction
stringlengths
71
71.9k
I have a Timer class executing a function in a specified interval: #include <chrono> #include <functional> #include <future> #include <iostream> #include <list> #include <mutex> #include <thread> using namespace std; // Timer // ===== template <typename Result> class Timer { public: typedef std::chrono::mill...
This is my first attempt at creating a game in Haskell, and I would greatly appreciate some feedback. Here is Main.hs: module Main where import Deck import Data.List import System.Random import Control.Monad.State -- |'main' is the entry point for the program. This function will bind a -- random number generator and...
I have this code that compares all version numbers of servers. (The version numbers are stored in an XML file) Before the code would compare the current version number with the previous. This caused some problems because in the cluster of servers, one has a different version number than the rest. If my code happened to...
I'm crawling Flickr for data for my university research project. However it's very slow and I'm not sure what it is exactly. It could be the FileWriter slowing it down. Any advice on speeding it up? try { String userID = file.getUserIDFromList(i); System.out.println(i + "." + " " + userID);//to screen S...
I have 2 vectors of Facebook-like pages which are represented by an ID from 2 different users. I want to verify the number of liked pages that are similar between these 2 users. This is my algorithm that I am using right now, which is basically a search into all rows and columns of a matrix: for(int i = 0; i < 100; i++...
In my Python application, I am using Tarjan's algorithm to compute strongly connected components. Unfortunately, it shows up under profiling as one of the top functions in my application (at least under cPython, I haven't figured out how to profile under Pypy yet). I've looked at the code, but I don't see any obvious ...
I am building a Tic Tac Toe game with AngularJS and making it online playable with AngularFire. The Tic Tac Toe logic is all there so this question concerns Angularfire a little bit more. I want to be able to match a user with an opponent as well as delete inactive games. I have done my homework and at this point I wa...
I have the below class which moves the AI towards the given plant, this works well however it feels really messy. Any input as to a better way to lay out the logic would be really grateful, the logic follows the idea that we will take the x and y positions of the AI from the plants position, if the values are positive ...
/*The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. */ #include <iostream> #include <vector> using namespace std; int main(){ //We will be storing the primes as bool in a vector. vector<bool>primes(2000000,true); // This is the Sieve of Eratosthenes. It is ...
I'm making some changes to a JavaScript plugin on a site I've been made steward over. This main plugin has it's own sub-plugins and I'm trying to make certain aspects modular. Currently, I'm attempting to make a reusable modal window that the sub-plugins ferry data to. This main plugin uses extensive use of prototype....
Trying to learn shell sort, I kinda understood what wikipedia was trying to say, but I wanted a bit of confirmation, so I went on youtube, here, but this code does not work and does not look like what I read on wikipedia. I go to hi's website just in case I misspelled anything to copy+paste hi's code, nop not working e...
A few months ago I put up a port scanner for review. Now, I've updated it with some new Python knowledge and integraing the feedback I got. Some things I specifically think might be wrong with it or feel clunky to me: Default argument values for the scan_ports function. I set the default values, but then I have to c...
I've put together a simple application in order for me to learn sqlite and OOP in PHP. The application basically outputs two random words, e.g. "Angry Badger", from two database tables, one called Animals & the other named Adjectives. At present both tables contain the same columns (but could change in future). The cod...
Quite a specific question can the below code be made more clearer / pythonic in any way. Essentially based on the condition of the string x((len(x) / 3) - 1), I use this to extract out parts of the string. def split_string(x): splitted_string = [x[counter*3:(counter*3)+3] for counter in range ((len(x) /3) - 1)] ...
I have some PHP code where I use variable functions to call the right function. I need to build a chart array (for example), and the chart array that comes out has a fixed format. But the data that goes into the chart or table comes from varying places in the underlying objects. An example: private function buildChartG...
I've recently been asked to make some emergency changes to a legacy application written in VB.NET. I come from a C# background so am not overly familiar with this language, though there are enough similarities for me to get by. The current code has no separation of concerns (e.g. DAL code is written in the codebehind ...
I have written code to send a simple email submission form to a sql table so that I can manage the data. I would like feedback on whether or not the code that I have written is efficient and secure. I have a config file that defines constants for database credentials. HTML FORM <form method="post" action="index.php"> ...
An optimisation question: Currently I have entities stored in text files in the following format: Attribute1,Attribute2,Attribute3 Value1-1,Value1-2,Value1-3 Value2-1,Value2-2,Value2-3 Value3-1,Value3-2,Value3-3 And convert it into a 2D array in the following format: $array = array(array('Attribute1' => 'Value1-1', ...
I made lots of changes to the script presented in my previous question. I was tempted to edit that one with the new code, but it would invalidate @200_success's helpful answer. It was also disallowed on a Meta thread. So I apologize for the new question, but it seemed like the right thing to do. Again, any and all t...
I recently self-taught myself MySQL as quickly as possible because it was needed for a project that I'm working on. Now that I've got some time I've been working on improving some thrown together SQL procedures. I've already done a few things, like logic improvements and removal of sub-queries, but I'm wondering if any...
#include <stdio.h> #include <stdlib.h> #define RED "\x1b[31m" #define GREEN "\x1b[32m" #define YELLOW "\x1b[33m" #define BLUE "\x1b[34m" #define MAGENTA "\x1b[35m" #define CYAN "\x1b[36m" #define RESET "\x1b[0m" int main () { int n1 = 1, n2 = 0, i = 0, limit = 0, neg = 0, pos = 0; printf("En...
I have this uniform cost search that I created to solve Project Euler Questions 18 and 67. It takes the numbers in the txt file, places them into a two dimensional list, and then traverses them in a uniform cost search (that I hoped was a kind of implementation of an a* search). It looks like this: f = open('triangle.t...
I would like to put the following design to your consideration. This is the pattern I use to follow when I'm building a Model and Data Access Layer for an MVC Application (using Entity Framework 5). I'm looking for any advises about how to improve me design (feel free to provide a new one) because I feel that it can be...
I have a MySQL table with a very large data. What I need is to find and separate duplicates from the unique rows Let's say this is my table: indx, data_lname, data_fname, data_mname, data_dob, data_mobile What I'm doing right now is selecting all the rows in one query and then comparing each row with the same table u...
The following is a small class I extended MySQLi with. I'm going to use this in my upcoming projects, but my main reason to do this class is learning, so I would like to submit this for your review, tell me if there are any bugs or improvements to be made. NOTES: I know about prepared statements, but I am not going t...
Given a postfix expression, construct an expression tree. Looking code code review, optimizations and best practices. public class ExpressionTree { private final String postfix; private TreeNode root; /** * Takes in a valid postfix expression and later its used to construct the expression tree. ...
I have an abstract class that represents data request. The request is in XML format. There are a few classes that derive from abstract class and they do similar things. Some basic XML operations such as create XML document, write the elements and attributes of XML document and so on are implemented as methods of abstra...
I am coding a web based solution which consists of N number of tiers, these are: UI Web API Business The question I have is related to validation, repository and CRUD operations. I am adopting the command / query pattern whereby I have my repositories for data retrieval only (see below) and its query dependencies inj...
Please give thoughts and optimization tips on my thread library. Update 1 : I have renamed the different method types. unit AgThread13; interface uses SysUtils, Classes, Windows, Rtti; type {$SCOPEDENUMS ON$} TAgCallType = ( Direct, Synchronize, Queue ); TAgThread = class; TAgThreadSimpleObjectMethod ...
Say I have an array with 60 elements, and I want to select 40 elements from this array. The subset should consist of elements with evenly spaced indices. In theory I would need to select every 1.5th point, which is obviously not possible. I tried doing it with a recursive function, kind of a divide & conquer approach. ...
I was going through the Project Euler problem #3 and made a program to solve it. The problem is as follows: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? My code is as follows: #include<iostream> #include<vector> using std::cout; using std::endl; using...
Imagine I have code like this in (it's about the concept; this is example code): # models.py from django.db import models class Monster(models.Model): x = models.FloatField() y = models.FloatField() def use_unique_ability(self, target): ''' different monsters types will implement this differently '...
I am working on a price slider that is for a Java environment. It is working correctly but I would like to optimise it as much as possible. Any tips/advice? <div class="wrap"> <div class="range"></div> <div class="amount min-amount left"></div> <div class="amount max-amount right"></div> <form action="...
Let's compare the following code: 1) public class MyClass { private object syncRoot; public MyClass() { this.syncRoot = new object(); } ... } 2) public class MyClass { private object syncRoot = new object(); public MyClass() { } ... } What do you prefer and what are...
I was having a hard time with bug logstash#665. Hope they will fix it some day, but sparc/solaris support is probably not on top of their priority list. For further reference, original error is: NotImplementedError: stat.st_dev unsupported or native support failed to load dev_major at org/jruby/RubyFileStat.java:190 _d...
I'm experimenting with angular directives, and as a proof of concept I wanted to create a basic tab control. I'd like to know if anything can be changed to be more fluid, or if I'm doing things "right". Live Example: http://jsfiddle.net/6wa2x/ HTML (with embedded angular templates): <!doctype html> <html ng-app="mainMo...
The purpose of the below code is to build a shape based on the user input, specifically: Prompt the user to enter a shape - either a triangle or a square Determine which "texture" to use for the shape - currently set at #'s for squares, *'s for triangles Build the shape based on the selected texture Sample output for...
The following code achieves what I require, reading 10000 rows at a time: var query = repository.Subscribers.ToList().Skip(numberToSkip).Take(numberInBatch); Is there an alternative which will make this faster? Here's the full code: protected static string ContactUrl = BaseUrl + "/api/contact"; protected static in...
For full disclosure: this is an assignment for my programming class and I just want tips or advice on some of the code. Assignment details just for background information purposes: Write a program that will read a number 1-100 from the user, and the name of a data file, and will tell the user what word is in the fil...
I tried making a class that handles my header and footer of my site. It looks like a mess, because I like to preserve the indentations as is. But I'm wondering if there maybe is an even cleaner or better way of writing this class? <?php class HeadFoot { protected $title, $scripts; public function...
I've been reviewing my previous projects for the last few days. I've found that I never return an error from any of my methods. I always throw exceptions. I googled about exceptions vs errors and I feel like I should return an error if there's an error. Please consider my service class from my previous project. We have...
Public Function MyProjectFuncion(firstObject As Object, myEnumeration As Enumeration, theString As String, someCollection As List(of Object), anotherObject As Object) _ ...
I'm still new in Java so I always try to find new ways and improve my skills. I found enum in Java to be very powerful (maybe excessively?) and while I was reading Effective Java book I've had some great ideas and I thought about using it to improve the flexibility of a standard console application which asks to the us...
I'm trying to work with exception handling by displaying "No Such File" when the file doesn't exist. I need to use a try statement. import sys try: f = open("h:\\nosuchdirectory\\nosuchfile.txt","w") # do not modify this line f.write("This is the grape file") # do not modify this line f.close() # do not mo...
Please be brutal, and treat this as if I was at an interview at a top 5 tech firm. Question: Write a function to find the longest common prefix string amongst an array of strings. Time it took: 17 minutes Worst case complexity analysis: n possible array elements, each can have length m that we are traversing, hence...
This is my first time using knockout. I'm reading/writing a JSON file with a fair bit of nested data. I had no problem creating the ViewModel to just write to the file, but now that I'm reading the data into my model also, I've had to write a few if/else statements to handle the different cases. Not sure if this is the...
I have had this keylogger code for a while now (a few years*), and I figured I would put it up for review. Here is what I would like reviewed (in order): Portability - right now, this program can only work on Windows systems. In what ways can I make this more portable? (I feel like I would have to go digging for POSI...
So about a year and a half ago, me and my friend started on a game called Zombie Smack Down. It's a text based game written in Ruby. But we were both really new to Ruby when most of it was written. I realize lots of this code is probably really bad, but I'm kinda stuck in my ways. I'd love to know which parts of it ca...
I'm a beginner to .NET and could you guide me to right direction. My problem is based on the following code. Here I have 4 variations of same method and all 4 variations are working fine. What is the recommended or standard way of doing this? If none of these methods are okay, kindly suggest one with code? Code expl...
The crawler is in need of a mechanism that will dispatch threads based on network latency and system load. How does one keep track of network latency in Python without using system tools like ping? import sys import re import urllib2 import urlparse import requests import socket import threading import gevent from geve...
I need help optimizing my code to run faster (it works but I get Time Limit Exceeded) for this problem. (Don't pay attention to readInt() function, its only used for fast input) #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS #endif #include<iostream> #include<vector> #include<fstream> #include<algorithm> #include<stri...
I made a function for recursively reading a directory and it just seems kind of long and complicated. If you could take a look and tell me what's good or bad about it, that would be great. Reading the directory synchronously is not an option. var dutils = require('./dutils'); module.exports = { getIndex: function(i...
Please feel free to comment on the accuracy/validity of the following wrapper source for processing signals using the new POSIX sigaction API. If you feel I'm doing anything wrong or potentially dangerous, chime in. Note: syserr is a custom function not shown to exit gracefully. #include <stdio.h> #include <stdlib.h> ...
I'm writing the data structures for my program (a toy compiler), and I'm trying to understand what's the best way to define the AST: Current code data RExpr = RExpr Location InnerRExpr data InnerRExpr = RLExpr LExpr | RConstant Constant | RMathExpr MathExpr | FCall Id [RExpr] Alternative A data RExpr = RLExpr Location...
I have a trivial function that rotates 2d vectors, and a method in a class representing a polygon that rotates every point in the polygon around an origin. The code is fairly optimized as it is, but I was wondering if there is any faster way of doing it, since the function is called a HUGE amount of times and I need it...
I need a function (I named it applyToEveryPair) that works on lists, e.g. [x0,x1,x2,x3,...], and uses a function f:: (a,a) -> [(a,a)]. For every (distinct) pair (xi,xj), i/=j of the list I want all lists where xi is replaced by yik and xj is replaced by yjk where xik is the output of f. This visualizes input and output...
I solved a problem which you can read about here, but it gives me "time limit exceeded" even though it runs in 4 seconds. I really don't understand why. I don't think my code can be any simpler, basically it has as many functions as there are solutions I think. At the start of my code I find the first letter matching t...
I am learning string algorithms and wrote this C example based on a Java example I found online. Any feedback relating to style, code clarity, whether it is generic enough to be re-used, interface, etc, etc would be very much appreciated. /* Demonstration of least significant digit (LSD) radix sort of strings Specif...
For the first time, I tried to use threads by myself in order to implement a parallel sieve of Eratosthenes. The trick is that each time a prime is found, a thread is spawned to eliminate all the multiples of this prime number from the boolean vector (the one that tells whether a number is a prime or not). Here is my c...
Motivation: I have a large number of large read-only dicts with large string keys mapped to tuples of two floats. They are taking up a large amount of heap space. Proposed solution: a 3xn NumPy array, with the first column being the hash value of the key, and sorted by that column. Only contains and getitem ops are req...
I have made a basic calculator using methods. This is my first attempt at using methods and would like to see if I can improve on this as there is a lot of repeated code. import java.util.Scanner; public class Calculator { public static void main(String[] args) { Scanner kb = new Scanner(System.in); ...
Below is a naive algorithm to find nearest neighbours for a point in some n-dimensional space. import numpy as np import scipy.sparse as ss # brute force method to get k nearest neighbours to point p def knn_naive(k, p, X): stacked_p = ss.vstack([p for n in range(X.get_shape()[0])]) D = X - stacked_p D = ...
Would you please review and give me some feedback? I've been learning Java and I want to avoid bad practices. Is it good to make a helper class to define the methods my main program is using? Is this approach ok for bigger projects? If the game looks fine, what would be the next simple game challenge I should attempt? ...
Given two rectangles, return the intersecting rectangles. This class is thread-safe. It takes rectangles in two different representations, and returns the intersecting rectangle in the respective representations. Looking for code review, optimization and best practices. final class RectangleWithPoints { private fin...
I would like to revise the fundamentals of Java threads on before-Java 5, so that I can understand improvements in Java 5 and beyond. I started off with a custom collection and need help on: Things I am doing wrong / grossly overlooking How to make it better Suggest alternate implementation, if any Which is the correc...
I googled around for secure random number generation and random string generation, combining them with some user data. Is this good or am I totally off-base? I don't know much about cryptography but I do not see many alternatives, other than some bad code that gets copied around a lot with mt_rand and uniqid. //csrf t...
The code displays a video that will play a video and then display some text on the screen at specific locations on the video screen. The code works but I would like to see if I could change somethings to make it better and how I would do that. You should be able to just copy the code into a web browser and it should wo...
This scrapes results from thefreedictionary.com: #!/usr/bin/python from bs4 import BeautifulSoup as bs import re from requests import get def remove_non_ascii(text): return re.sub(r'[^\x00-\x7F]+', '', text) def get_soup(url): raw = remove_non_ascii(get(url).content) soup = bs(raw) return soup.sele...
I just started getting into the Less CSS framework and I am wondering if I'm doing it right and how the code can be improved if possible. global.less //variables @themeRed: #cc1111; @themeColor: @themeRed; @marginBottom: 10px; @contentRadius: 5px; //mixins .border-radius(@args) { -webkit-border-radius: @args; -mo...
Project Euler problem 27 I decided to try simple brute force, and it worked surprisingly quickly. How can this be optimized? """Considering quadratics of the form: n^2 + an + b, where |a| < 1000 and |b| < 1000 Find the product of the coefficients, a and b, for the quadratic expression that produces the maximum numbe...
Project Euler problem 28 Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows: $$\begin{array}{rrrrr} \color{red}{21} &22 &23 &24 &\color{red}{25}\\ 20 & \color{red}{7} & 8 & \color{red}{9} &10\\ 19 & 6 & \color{red}{1} & 2 &11\\ 18 & \color{red}{5} & 4 & \co...
I'm trying to find the best - read: readable, maintainable, robust, threadsafe, usable - solution for a State Machine in python. For this I've been looking at the State Design Pattern. However I want a pythonic and lean solution (saying not implementing functions in subclasses that are not needed). Long story short, he...
Background I have a base (only 2 classes inherit from it, and only from it) abstract (meaning I don't want it to be used directly) class that implements some common functionality. Some of it depends on certain methods being defined, methods whose implementation differs per the exact sub-class; so I set-up a mechanism t...
I'm not going to explain the purpose of the code provided below. If you do not understand it, i know that i have to improve it (naming, structure etc.). I would like to know how to improve this code in terms of readability and complexity. Data structure: <?xml version="1.0" encoding="utf-8"?> <QuoteApp> <Authors> ...
This question is a revision of Parallel sieve of Eratosthenes. The goal is to implement a sieve of Eratosthenes with parallel strikes out from the boolean array. I tried to fix the data races and all the threading-related errors as well as to add some of the ideas from the previous answers. Now, the implementation work...
I'm a beginner to Model-View-Presenter pattern and I'm finding a way to use it in a sample application In my C# winforms application has a Employee Class and it has properties like EmployeeID,Name, Address, Designation etc. Also it has behaviors like viewEmployee(), AddNewEmployee(), PromoteEmployee() etc. Could you p...
This started out with my answer to Radix Sort on an Array of Strings?. Since I intend to write a generic radix sort for my own purposes anyway, I continued a little bit, and here is a version tested on: a fixed std::array of unsigned numbers, each treated as a fixed sequence of bytes from least-significant (right) to ...
I've brute forced solve Project Euler 14. This is my first attempt at trying to solve it, by caching already solved answers, and skipping them as I run it, I am finding the program take's almost twice as long as the simple brute force method of checking each number. It works, but I could also use some insight on how to...
I'm very much on the beginner end of the PHP scale but I have read plenty of the entry level books and completed the online training at teamtreehouse.com so I know the basics. I'm at a point where I've built a tax calculator in PHP (UK income tax) and it works and is accurate but I have no clue if the code follows best...
I retrieved Bloomberg data using the Excel API. In the typical fashion, the first row contains tickers in every fourth column, and the second row has the labels Date, PX_LAST, [Empty Column], Date, PX_LAST, etc. The following rows have dates and last price. EHFI38 Index BBGID, , , EHFI139 Index...
I'm doing some high energy physics modelling in C++. I have written code that implements class that score interactions of particles with detector material. Here is a base class: class XYZScorer: public virtual AbstractScorer{ public: XYZScorer(double material_rad_len=-1): AbstractScorer(material_rad_len...
Now that I've got this working, any improvements that I can make to better my code review would be helpful. import random import math import console console.set_font('Arial-BoldMT',15) print'Welcome to the guessing game!\nA number will be randomly chosen from 0 to 1000.\nThe player will make a guess, and then the com...
This is solution to the assembly line problem. Here is complete description, which is too big and verbose to re-describe. I apologize for the inconvenience of the hyperlink. Note: I do understand merits of unit testing in separate files. But deliberately added it to main method for personal convenience, so I request t...
Is it recommended to combine two similar methods into one? public void initialize_board(){ for(int y = 0; y < board.length; y++){ for(int x = 0; x < board.length; x++){ if(x == 0) board[x][y] = (char)y; else board[x][y] = '~'; } } } public...
I'm writing a set of simple widgets for a microcontroller application. I'd like to use the observer pattern to pass around events: when a button is clicked, when a timeout occurs - there are many uses which I'm currently implementing with very ugly glue code, with similar code occuring again and again. The whole system...
I have started learning programming in ObjC from "Objective-C Programming: The Big Nerd Ranch Guide" In a task to exercise the learned stuff I've had to write a program what compares the the names in the file /usr/share/dict/words if there are same proper names (capitalized) and normal words (uncapitalized). This is my...
I have the class below to manage my specific implementation of a membership system using entity framework 6.1 Is the use of static access correct in this case? as far as I understood that EF context is not thread-safe so I'm instantiating one with every call through the using statement. My second question, is the use o...
I want to interpolate temperature in correlation with height. I have temperature data from stations with coordinates and height in this format: Lat Lon Temp Height 46.2956 16.3978 10.71196 120 45.9776 16.0159 11.78539 150 45.8521 15.9598 11.18838 133 etc. After reading the data there are 4 arrays (y, x...
A project I was working on required the usage of the Separating Axis Theorem to detect collisions between two convex polygons in real time. So I implemented a basic class (ConvexFrame in the code) to keep track of the information about the polygon that is necessary for the SAT algorithm. I implemented it, and it works,...
This finds the equilibrium. For sum/mult an equilibrium is defined as the index i at which sum/mult of all elements at index < i is same as sum/mult of all elements of at index > j respectively. Edge cases are documented clearly in JavaDocs. Note: I do understand merits of unit testing in separate files. But deliberate...
I would like to give it a try and ask about my codes on here from now on to see if there are improvement for'em this code is supposed to combine two sql tables into one. SELECT * FROM (SELECT * FROM posts WHERE id < $lastpost AND position = submitter order by id DESC LIMIT 5) t1 JOIN (SELECT username, firstname, lastna...
A very simple Thread pool: Any work added to the pool will be executed. The destructor will wait for all work to be finished before letting the threads stop. We then join all threads before letting the destructor exit. #include <thread> #include <mutex> #include <condition_variable> #include <functional> #include <vect...
This code animates my main game sprite by increasing the animation frame. First I check if the character is moving, then I increase the animation counter until it reaches the desired speed, and then if so, I increase the animation frame. How can I make it more elegant and optimised in terms of speed? if (moving)...
Return any three descending numbers that appear sequentially in the input such that A[i] > A[j] > A[k] and i < j < k. Since problem description contains 'any', I could not unit test using JUnit. I'm looking for request code review, optimizations and best practices. final class DescendingTriplets { private final i...
It has been a while since I've implemented a QuickSort and I wanted to write it down like I remembered. int MyPartition(List<int> list, int left, int right) { int pivot = list[left]; while(true) { while(list[left] < pivot) left++; while(list[right] > pivot) right--;...
I'm trying to implement String-Pool. I'm maintaining a HashMap<String,String> to store the keys. public class TestStringCaching { static Map < String, String > cache = new HashMap < String, String > (); public static void main(String[] args) { int iter = 8000000; String[] temp = new String[iter]...
I have been looking through Code Review on the subject of Unit of Work and Repository patterns and realised that my implementation appears to provide very similar functionality but in reverse class order/hierarchy. (Couldn't think of a better way to describe it sorry) This is one of the questions I feel mine is similar...
I have three JavaScript objects. The first one serves merely as a prototype. The other two are implementation of a specific type. var MainPrototype = {}; var SpecificType = $.extend(Object.create(MainPrototype)); var OtherSpecificType = $.extend(Object.create(MainPrototype)); I am missing the option of a parent-metho...
I'm learning how to use Python with the Raspberry Pi. I successfully followed the tutorial for how to have a Python script run on the Pi to check for new email and turn on an LED if any new messages are in an inbox. I wanted to give myself a challenge by adding a feature to blink a secondary LED to indicate the number ...
I would like a review for this code which is used apparently successfully in my current project. More info are available in this gist but I'm pasting here the main info: The project use C++11/14 as provided by VS2013 (no CTP) and Boost. I didn't try to compile it in other compilers yet (lack of time and resources)...