pts.blog

2015-11-27

How to compute the intersection of two sorted lists (in Python)

›
This blog post explains how to compute the sorted intersection of two sorted lists, and it shows a fast Python implementation. The time comp...
2 comments:
2015-03-20

How to use rsync over USB on Android with adb

›
This blog post explains how to copy files using rsync between the computer running Unix (typically Linux or Mac OS X) and the mobile device ...
12 comments:
2015-03-03

How to avoid data copies with move semantics in C++11

›
This blog post explains how to avoid data copies in assignment from temporary values in C++. The move assignment operator (a feature introdu...
2015-02-12

How to generate all subsets of size k in Java

›
This blog post shows a Java class to generate all subsets of size k of the set {0, 1, ..., n - 1}, in lexicographic order. The code uses O...
2014-10-26

How to download some labeled messages from Gmail to a Unix computer

›
This blog post explains how to download some Gmail messages (distinguished by a label) to a computer running in Unix. The download method sh...
2014-10-21

On the speed of memset

›
This blog post presents some of the speed measurements I've done with alternative implementations of memset. I was filling a 1 GB memor...
2014-09-25

Change 1 character puzzle #2

›
Add or replace at most 1 character in the longest line of the following program so that it will print 20 dots. There are at least 10 solutio...

Change 1 character puzzle #1

›
Add or replace at most 1 character in the longest line of the following program so that it will print 20 dots. There are at least 3 solution...
2014-09-08

How to keep to your commitments without using up too much willpower

›
This blog post explains how hyperbolic discounting causes you to change your mind, and how to trick it so that you can keep to your commitme...
2014-08-16

On generating integer-sided triangles with an integer area/perimeter ratio

›
This blog post contains come comments about finding all triangles whose sizes are integers and the area/perimeter ratio is the integer r . T...
2014-08-12

How the lifetime of temporaries is extended because of references in C++

›
This blog post summarizes what I learned about C++ today about how the lifetime of temporaries is extended because of references. Normally ...
2014-07-29

How to discard committer info from git history

›
This blog post explains how to overwrite the git committer name, git committer e-mail and git committer date in previous commits in a git re...
2014-07-08

Programming tips for students

›
This blog post gives you advice to make the best use of your time for learning how to program and enjoying programming in your pre-college y...

Recommended books for programming students

›
This blog post lists the best books I can recommend to students who want to learn how to program. Please note that programming is more about...
2014-06-20

Message to the students

›
Dear Student, This is your life. Make it happy, productive and full for yourself! The smarter and more skilled you are, the more choices a...

What's the difference between StaticPython and PyRun?

›
This blog post explains the difference between StaticPython and PyRun . Both StaticPython and PyRun are free, portable binary distribution...
5 comments:
2014-04-26

How to parse an integer in C++ (and C) with overflow detection

›
This blog post explains how to write C++ code which parses integers, in a type-safe way for any integral type, paying attention to overflows...
9 comments:
‹
›
Home
View web version
Powered by Blogger.