I was thinking about making a fun project that would tell me where I am throughout my house. My idea was to put two routers in different spots of the house at the same height and then send ping requests or something and check the latency, from that it should be able to triangulate where I am in the house.
I know this would only really ...
In order to keep the OSI model straight in my head, I dreamt up the silly mnemonic:
P. Diddy Never Takes Shit, Punk Ass!
(Physical, Data, Network, Transport, Session, Presentation, Application)
Similarly I was first learning Perl, I rearranged (some of) the regex modifiers to:
SIXMOP GC
(as in 6 of the things you use to clean the floo...
Inspired by this question
Suppose we had a magical turing machine with infinite memory, and unlimited CPU power.
Use your imagination as to how this might be possible, e.g. it uses some sort of hyperspace continuum to automatically parallelize anything as much as is desired, so that it could calculate the answer to any computable quest...
In this xkcd comic:
they mention that real programmers use cat. Well, I was asking myself: how could you program using the cat command?
...
Now that systems are so powerful, there doesn't seem to be anything like the fun challenge of trying to get the most out of some 8-bit micro and with less than 64kb memory. Is there something (that isn't an emulator) which can provide a similar experience?
...
I'm starting to really love extension methods... I was wondering if anyone her has stumbled upon one that really blew their mind, or just found clever.
An example I wrote today:
Edited due to other users' comments:
public static IEnumerable<int> To(this int fromNumber, int toNumber) {
while (fromNumber < toNumber) {
yield...
How can I treat important session info as if it were a model?
I've started toying with it, and some of it works. But I'm not sure what I'm missing? Does anyone know a good place to start or where I can find some good examples?
Also, I'm able to use the model to set session variables, but what about getting them from the model as op...
I often hear of situations where a bug in a program is passed off as a feature. This seems like a useful skill to have.
Please describe a technique for doing this - preferably with specific examples.
...
We all like to play games from time to time. Playing games is not only a way to spend time, but often is a good source of concepts related to various parts of life and science. Examples: importance of good resource management and parallel execution early in the game in resource-constrained RTS's (e.g. Warcraft); importance of good risk...
I just came across this little problem on UVA's Online Judge and thought, that it may be a good candidate for a little code-golf.
The problem:
You are to design a program to assist an architect in drawing the skyline of a city given the locations of the buildings in the city. To make the problem tractable, all buildings are rectangular...
Are there any interpreters available for the Android platform for any language at all? If so, do they work with both physical and on-screen keyboards?
...
I love regex. I’ve used them with grep, Perl, Java, C, and a variety of others. I have Jeffery Friedl’s awesome book on them, and I studied their theory in college.
But for years I have been haunted by a famous regex joke:
Q: What did one regular expression say to the other?
A: .*
which I first saw on Slashdot, years ago.
...
As you all know, there is nothing more fun than writing software. I guess we all remember occasions where we had to force ourselves to get up from behind our monitor to get something to eat or to go to bed. The odd thing is, non-programmers (mere mortals ;-)) often see programming as the most boring thing a man can do for a living. They ...
Background
So, I'm working on a fresh iteration of a web app. And, we've found that our users are obsessed with being lazy. Really lazy. In fact, the more work we do for them, the more they love the service. A portion of the existing app requires the user to select a color scheme to use. However, we have an image (a screenshot of t...
I've encountered a website that uses a 50-digit decimal integer ID in a URL query string, which seems a little excessive.
The smallest 50-digit decimal number is 1.0 x 10^49, otherwise known as:
1000000000
0000000000
0000000000
0000000000
0000000000
How many bits would the binary representation contain?
How would you approach conver...
Lassooing users and putting them down to monkey around with your application may be the best way to spot deficiencies in your freshly baked program.
But it is also where some jaw-dropping things occur. Stuff you really did not expect to happen, made you facepalm for your own stupidity or the users, let us in on the fun!
My story is ...
Using recursion, find an index that cuts an array in two parts so that both parts have equal sum.
Cut means to cut like with a knife. All the cells with index <= to the result must be equal in their sum to the all the cells with index > to the result. No cells can be left off or be part of both sides.
The arrays contains arbitrary inte...
What is the funniest or strangest error message you have ever seen from a compiler?
My personal favorite is one I came across with java: cannot cast boolean to Boolean
Any others?
...
I've decided to start working on programming an old favorite of mine. I've never done a game before and also never done a large project in Python.
The game is the old Avalon Hill game Russian Campaign
I've been playing with PyGame a little bit and was wondering if there were reasons not to try to do this with PyGame and go after some o...
Is there an online Python interpreter or some such that would allow me to try out simple python code from my iPhone?
Something like try ruby! (in your browser) for Python, and works with the iPhone?
...