To flash a LED we will use the GPIO pins(general purpose input/output) to control the LED. We will control these GPIO pins using Python. The GPIO layout on the Raspberry Pi model B. We will be using GPIO 17 which is Pin 11. 1. Installing the library for python. $ sudo apt-get install python-dev python-rpi.gpio […]
Archives for June 2021
How to burn an ISO to CD or DVD using Wodim
Wodim is a command line tool for burning ISO files to disks. wodim is used to record data or audio Compact Discs on an Orange Book CD-Recorder or to write DVD media on a DVD-Recorder. Step 1 Locate you CD/DVD writer. # wodim –devices Example output: # wodim –devices wodim: Overview of accessible drives (1 […]
Java Basics: Lambda Built-in Functional Interfaces
Built-in Functional Interfaces In Java 8, there are a lot of method signatures that refer to interfaces in java.util.function. Therefore, it is important to understand what these interfaces do and what variations on the basics exist. It makes writing lambda expressions a lot easier. The java.util.function Package Predicate: An expression that returns a boolean Consumer: […]
Basic Java: Generics and Collections
Generics Generics provide flexible type safety to your code. They move many common errors from run time to compile-time and provide cleaner, easier-to-write code. Generics also reduce the need for casting with collections and are used heavily in the Java Collections API. Simple Cache Class Without Generic The two examples below show very simple caching […]
Beginners Guide to Interfaces and Lambda Expressions
Java Interfaces In Java, an interface outlines a contract for a class. The contract outlined by an interface mandates the methods that must be implemented in a class. Classes implementing the contract must fulfill the entire contract or be declared abstract. Java interfaces are used to define abstract types. Interfaces: Are similar to abstract classes […]
Java Basics: Abstract and Nested Classes
Modeling Business Problems with Classes Class Inheritance When designing an object-oriented solution, you should attempt to avoid code duplication. One technique to avoid duplication is to create library methods and classes. Libraries function as a central point to contain often reused code. Another technique to avoid code duplication is to use class inheritance. When there […]
Java Basics: Overriding Methods, Polymorphism, and Static Classes
Using Access Control The table below illustrates access to a field or method marked with the access modifier in the left column. Modifier (keyword) Same Class Same Package Subclass in Another Package Universe private Yes – – – default Yes Yes – – protected Yes Yes Yes – public Yes Yes Yes Yes The access […]
Beginners Guide to Java Encapsulation and Subclassing
Encapsulation Encapsulation is one of the four fundamental object-oriented programming concepts. The other three are inheritance, polymorphism, and abstraction. The term encapsulation means to enclose in a capsule or to wrap something around an object to cover it. Encapsulation covers, or wraps, the internal workings of a Java object. – Data variables, or fields, are […]
Basics of Java
This post is a review of fundamental Java and programming concepts. Java Class Structure A Java class is described in a text file with a .java extension. In the example shown below, the Java keywords are highlighted in bold. package [package_name]; import [other_packages]; public class ClassName { [variables(also known as fields)]; [constructor(s)]; [other methods]; } […]
How to monitor your CPU on debian or ubuntu systems
There are many reasons to want to monitor your CPU maybe if you are over-clocking(making sure your CPU hasn’t caught fire after running Prime95), or you might just be interested to look at your CPU temps, there are lots of different reasons and this is a post to show you how. For both of these […]