Login | Register

Nerd Paradise

Now with 15% less sodium!

Front Page Posts

Page: 1 2 3 ... 19 20 21 Next >

PyGame Tips & Tricks

Posted by Blake on 12 Cresco 12:0
PyWeek 15 starts in one week. So here's a few tips and tricks for a more lovely pygame coding experience. Image CacheUse a string->Surface dictionary as an image cache. Wrap this cache with a function called get_image(path). This path will be the key for the cache. If the image isn't found in the...

Problem of the Whenever #15

Posted by OmnipotentEntity on 12 Cresco 0:3
Given a range of integers from M to N, where M and N might not be a powers of 2. Is there an efficient way to count the number of times each bit is set? For example the range 0 to 10 I'd like the counts for the number of time each bit is set in each column which would be 3,4,5,5 in this case. S...

C++ Functions

Posted by OmnipotentEntity on 12 Ineo 13:4
Because using the right consts correctly can be somewhat of a challenge if you're a C++ novice, here's a short post to explain the difference between different ways to pass function parameters. It also helps explain why global variables are bad mmm'kay The Problem You're trying to get at the valu...

Coding Interview 14: Counting Characters

Posted by Blake on 11 Vigeo 14:0
Count the number of occurences of a given character in a file. If they ask this question, it's either an easy job you're interviewing for, or it's a lead-in to one of the next questions. The complexity of this is linear. Find the most common character in a file. The complexity of this is also li...

JavaScript Tutorial, Part 5 - Interacting with HTML

Posted by Blake on 11 Vigeo 13:5
What good is JavaScript if you can't interact with the HTML page? Modify your index.html to look like this: onclick is a JavaScript event. I will talk about this more later. Just nod and smile for now. Modify your code.js file to look like this: do_things is a user-defined function. I will talk a...

JavaScript Tutorial, Part 4 - Strings

Posted by Blake on 11 Vigeo 13:4
So far in all the examples, everything has dealt with numbers and math. One of the other primary data types in JavaScript are strings. Strings are just pieces of text. You can join strings together, just like adding numbers... As for getting a subsection of a string, there are a few ways t...

I Need Sleep 3

Posted by Blake on 11 Vigeo 13:3
The final installment of my silly trilogy. I made this back in the Winter of 2004. You'll have to pardon the quality of some of the special effects. This is the first time I've uploaded a high quality render to the general public and most of the special effects were reliant on the fact that the vid...

Problem of the Whenever #14

Posted by OmnipotentEntity on 11 Vigeo 13:2
When you drive, the major part of your gas is used fighting wind resistance, which increases with the square of your speed. Assuming that your car gets 35 mpg at 45 mph and 28 mpg at 70 mph (for you metric folks, 15 km/L at 72 km/h and 12 km/L at 112 km/h). How fast should you drive if you value y...

JavaScript Tutorial, Part 3 - Using the Magical Debugger

Posted by Blake on 11 Vigeo 13:1
If something breaks and you don't immediately know what's wrong with your code, then you have to use the debugger. The debugger is your magical friend. Like Jimminey Cricket. First, let's write some buggy code. Save this code in your code.js file. Note that hypotenuse is misspelled when it is d...

Coding Interview 13: Byte Image

Posted by Blake on 11 Vigeo 13:0
You have a monochrome image (black and white only). You are to write a function that will take in this image, an x-coordinate, a y-coordinate, a width, and a height, and draw a black rectangle that has its top left corner position at the x/y coordinate and with the given width and height. Also, the...
Page: 1 2 3 ... 19 20 21 Next >
Current Date: 13 Ineo 9:5Current Time: 11.61.99Join us in IRC...
Server: irc.esper.net
Channel: #nerdparadise
Your IP: 54.226.5.29Browser: UnknownBrowser Version: 0