Using Bipolar Transistors As Switches

While transistors have many uses, one of the less known uses by amateurs is the ability for bipolar transistors to turn things on and off. While there are limitations as to what we can switch on and off, transistor switches offer lower cost and substantial reliability over conventional mechanical relays. In this article, we will review the basic principles for transistor switches using common bipolar transistors. The most commonly used transistor switch is the PNP variety shown in Figure 1. The secret to making a transistor switch work properly is to get the transistor in a saturation state. For this to happen we need to know the maximum load current for the device to be turned on and the minimum HFE of the transistor. ...

2 de agosto de 2012 · 1 min · 129 palabras · Nacho Cano

Introduction to text manipulation on UNIX-based systems

A basic tenets of UNIX philosophy is to create programs (or processes) that do one thing, and do that one thing well. It is a philosophy demanding careful thought about interfaces and ways of joining these smaller (hopefully more simple) processes together to create useful results. Normally textual data flows between these interfaces. Over time, more and more advanced text processing tools and languages have been developed. For languages, earlier on there was perl, later came python, and ruby. While these and other languages are very capable text processors, such tools are not always available, especially in a production environment. In this article, a number of basic UNIX text processing commands are demonstrated and may be used individually or in conjunction with each other to solve problems which may also be addressed with newer languages. For many people, an example provides more information than long winded explanations. Please note because of the variety of UNIX and UNIX-like systems available, command flags, program behavior, and output differs between implementations. ...

31 de julio de 2012 · 1 min · 173 palabras · Nacho Cano

Learn Vim Progressively

You want to teach yourself vim (the best text editor known to human kind) in the fastest way possible. This my way of doing it. You start by learning the minimal to survive, then you integrate all the tricks slowly. Vim the Six Billion Dollar editor Better, Stronger, Faster. Learn vim and it will be your last text editor. There isn’t any better text editor that I know of. It is hard to learn, but incredible to use. I suggest you teach yourself Vim in 4 steps: Survive Feel comfortable Feel Better, Stronger, Faster Use superpowers of vim By the end of this journey, you’ll become a vim superstar. But before we start, just a warning. Learning vim will be painful at first. It will take time. It will be a lot like playing a musical instrument. Don’t expect to be more efficient with vim than with another editor in less than 3 days. In fact it will certainly take 2 weeks instead of 3 days. ...

31 de julio de 2012 · 1 min · 171 palabras · Nacho Cano

Bash prompts

You can tell a lot about a shell user by looking at their prompt. Most shell users will use whatever the system’s default prompt is for their entire career. Under many Linux distributions, this prompt includes the username, the hostname, and the current working directory, along with a $ sigil for regular users, and a # for root. » Tom Ryder | blog.sanctum.geek.nz

27 de julio de 2012 · 1 min · 63 palabras · Nacho Cano

Understanding Python Decorators in 12 Easy Steps!

Ok, perhaps I jest. As a Python instructor, understanding decorators is a topic I find students consistently struggle with upon first exposure. That’s because decorators are hard to understand! Getting decorators requires understanding several functional programming concepts as well as feeling comfortable with some unique features of Python’s function definition and function calling syntax. _Using_ decorators is easy (see Section 10)! But writing them can be complicated. I can’t make decorators easy - but maybe by walking through each piece of the puzzle one step at a time I can help you feel more confident in understanding decorators[1]. Because decorators are complex this is going to be a long article - but stick with it! I promise to make each piece as simple as possible - and if you understand each piece, you’ll understand how decorators work! I’m trying to assume minimal Python knowledge but this will probably be most helpful to people who have at least a casual working exposure to Python. ...

24 de julio de 2012 · 1 min · 168 palabras · Nacho Cano

Key Principles of Maintainable JavaScript

The thing to remember, above all else when writing JS code, is that it’s a dynamic language. This means there are a lot of ways to do things. You don’t have to deal with strongly typed classes, or some of the more complex features from languages, like C# and Java. This is both a blessing and a curse. You can read an article on the history of JavaScript here, but the gist of it is that Brandon Eich, in 1995, was hired by Netscape to design a language. What he came up with was the loosely typed language that we know as JavaScript. Over the years, it became ”standardized” as ECMAscript, but, throughout all the browser wars, the various browsers implemented these features differently. This, naturally, lead to a lot of sleepless nights for web developers. This problem, when combined with the fact that JavaScript was considered to be most applicable for manipulating images and performing quick bits of validation, led JavaScript to, incorrectly, be viewed as a terrible language. ...

11 de julio de 2012 · 1 min · 175 palabras · Nacho Cano

Ubuntu Manual Project

Primeros pasos con Ubuntu 12.04 es una guía para principiantes del sistema operativo Ubuntu. Se encuentra disponible bajo una licencia de código abierto y su descarga, lectura, modificación y distribución son libres. El manual le ayudará a familiarizarse con tareas cotidianas como navegar por Internet, escuchar música, escanear documentos y mucho más. Al centrarse en instrucciones fáciles de seguir, es adecuado para todos los niveles de experiencia. » ubuntu-manual.org

4 de julio de 2012 · 1 min · 69 palabras · Nacho Cano

GNU Make in Detail for Beginners

Large projects can contain thousands of lines of code, distributed in multiple source files, written by many developers and arranged in several subdirectories. A project may contain several component divisions. These components may have complex inter-dependencies ” for example, in order to compile component X, you have to first compile Y; in order to compile Y, you have to first compile Z; and so on. For a large project, when a few changes are made to the source, manually recompiling the entire project each time is tedious, error-prone and time-consuming. Make is a solution to these problems. It can be used to specify dependencies between components, so that it will compile components in the order required to satisfy dependencies. An important feature is that when a project is recompiled after a few changes, it will recompile only the files which are changed, and any components that are dependent on it. This saves a lot of time. Make is, therefore, an essential tool for a large software project. Each project needs a Makefile ” a script that describes the project structure, namely, the source code files, the dependencies between them, compiler arguments, and how to produce the target output (normally, one or more executables). Whenever the make command is executed, the Makefile in the current working directory is interpreted, and the instructions executed to produce the target outputs. The Makefile contains a collection of rules, macros, variable assignments, etc. (’Makefile’ or ’makefile’ are both acceptable.) ...

28 de junio de 2012 · 2 min · 249 palabras · Nacho Cano

PHP Database Access: Are You Doing It Correctly?

We’ve covered PHP’s PDO API a couple of times here on Nettuts+, but, generally, those articles focused more on the theory, and less on the application. This article will fix that! To put it plainly, if you’re still using PHP’s old mysql API to connect to your databases, read on! » tutsplus.com

25 de junio de 2012 · 1 min · 52 palabras · Nacho Cano

Mario5

In the history of computer games some games have created and carried whole companies on their shoulders. One of those games is certainly Mario Bros. The Mario character first appeared in the game Donkey Kong and became very famous within its own game series starting with the original Mario Bros. in 1983. Nowadays a lot of spin-offs and 3D jump and runs are being produced centering the Mario character. In this article we will develop a very simple Super Mario clone, which is easily extendible with new items, enemies, heros and of course levels. The code of the game itself will be written in object oriented JavaScript. Now that sounds like a trap since JavaScript is a prototype based scripting language, however, there are multiple object oriented like patterns possible. We will investigate some code which will give us some object oriented constraints. This will be very useful to stay in the same pattern through the whole coding. ...

21 de junio de 2012 · 1 min · 160 palabras · Nacho Cano