background preloader

Programming resources (Beginner)

Facebook Twitter

CSS: centering things. See also the index of all tips. Centering lines of text The most common and (therefore) easiest type of centering is that of lines of text in a paragraph or in a heading. CSS has the property 'text-align' for that: renders each line in a P or in a H2 centered between its margins, like this: The lines in this paragraph are all centered between the paragraph's margins, thanks to the value 'center' of the CSS property 'text-align'. Centering a block or image Sometimes it is not the text that needs to be centered, but the block as a whole.

This rather narrow block of text is centered. This is also the way to center an image: make it into block of its own and apply the margin properties to it. The following image is centered: Centering vertically CSS level 2 doesn't have a property for centering things vertically. The example below centers a paragraph inside a block that has a certain given height. This small paragraph is vertically centered. Centering vertically in CSS level 3. Bootstrap. Bootstrap is downloadable in two forms, within which you'll find the following directories and files, logically grouping common resources and providing both compiled and minified variations. jQuery required Please note that all JavaScript plugins require jQuery to be included, as shown in the starter template.

Consult our bower.json to see which versions of jQuery are supported. Precompiled Bootstrap Once downloaded, unzip the compressed folder to see the structure of (the compiled) Bootstrap. You'll see something like this: Copy This is the most basic form of Bootstrap: precompiled files for quick drop-in usage in nearly any web project. Bootstrap source code The Bootstrap source code download includes the precompiled CSS, JavaScript, and font assets, along with source Less, JavaScript, and documentation. Bootstrap/ ├── less/ ├── js/ ├── fonts/ ├── dist/ │ ├── css/ │ ├── js/ │ └── fonts/ └── docs/ └── examples/ Installing Grunt Available Grunt commands grunt watch (Watch) grunt test (Run tests) CSS: centering things. “I Need Practice Programming”: 49 Ideas for Game Clones to Code. So you know a little bit about programming (perhaps you've read the free book, "Invent Your Own Computer Games with Python", a free programming book for beginners whose author shamelessly plugs at every chance) but you want to get better at coding.

You can't seem to find any open source projects that are at your level or easy for new people to contribute to. You've gone through a few of the practice problems at Project Euler but you want to create something more substantial, or at least a cool thing you can show your friends. (Not that finding the 31337th prime number isn't cool.) Here's a list of game clone ideas for you to implement. Each has a short description of the game, links to videos of the game, and descriptions of what kind of algorithms you'll need to know in order to implement them.

These games have been selected for their simplicity, so you don't have to spend several weeks designing art, levels, scripted dialogue, or complicated AI. Orisinal Games: 1. 2. 3. 4. 5. 6. 7. 8.

Websites I like

Recursion (computer science) Recursion in computer science is a method where the solution to a problem depends on solutions to smaller instances of the same problem (as opposed to iteration).[1] The approach can be applied to many types of problems, and recursion is one of the central ideas of computer science.[2] "The power of recursion evidently lies in the possibility of defining an infinite set of objects by a finite statement. In the same manner, an infinite number of computations can be described by a finite recursive program, even if this program contains no explicit repetitions. " [3] A common computer programming tactic is to divide a problem into sub-problems of the same type as the original, solve those sub-problems, and combine the results.

Many computer programs must process or generate an arbitrarily large quantity of data. Recursion is one technique for representing data whose exact size the programmer does not know: the programmer can specify this data with a self-referential definition. If. Recursion Explained with the Flood Fill Algorithm (and Zombies and Cats) | The “Invent with Python” Blog. The source code of everything in this article can be downloaded here: floodfill_src.zip Consider the Lazy Zombie This is a cat: This is a normal human: This is a normal human who has been turned into an ungodly, flesh-eating zombie of the undead: Zombies are lazy and will only bite things that are next to them.

Humans that are bitten will then turn into zombies: There is an interesting recursive principle here, because the humans that have turned into zombies will start to bite other humans that are next to them, which will make more zombies, who bite more adjacent humans, which will make more zombies, and so on and so on in a chain reaction: Zombies don’t bite cats though. So as long as there is a cat between the human and the lazy zombie, the human is safe: The same cannot be said of any humans who don’t have a cat between them and a zombie: Let’s make a two dimensional field of humans, cats, and zombies like this: But if there is a gap in the cats, then the entire population is doomed:

Things I Wish Someone Had Told Me When I Was Learning How to Code. And what I’ve learned from teaching others Before you learn to code, think about what you want to code Knowing how to code is mostly about building things, and the path is a lot clearer when you have a sense of the end goal. If your goal is “learn to code,” without a clear idea of the kinds of programs you will write and how they will make your life better, you will probably find it a frustrating exercise. I’m a little ashamed to admit that part of my motivation for studying computer science was that I wanted to prove I was smart, and I wanted to be able to get Smart Person jobs.

I also liked thinking about math and theory (this book blew my mind at an impressionable age) and the program was a good fit. It wasn’t enough to sustain me for long, though, until I found ways to connect technology to the things I really loved, like music and literature. So, what do you want to code? There’s nothing mystical about it Coding is a skill like any other. This guy (a very smart guy! See above.