A scene is the root node in a tree of Sprite Kit nodes. We implement our game logic there. However, there are many situations that SKScene needs to inform its view controller about some events or wants to force particular behavior only view controller can provide. This article shows how to make this communication work. And what is most important – how to do it in the cleanest possible way. Continue reading →
In this tutorial I will explain how to use UIPanGestureRecognizer to drag and drop views. If you want to jump straight to the code you can download a fully working example project from here.
UIPanGestureRecognizer is a subclass of UIGestureRecognizer that specialises in detecting panning (dragging) gestures. A panning gesture can have 3 states.
It begins when user touched the screen and starts dragging. In this moment UIPanGestureRecognizer‘s state changes to UIGestureRecognizerStateBegan. Then, when user continues panning, state of gesture recognizer changes to UIGestureRecognizerStateChanged. Finally, when user released the finger, the gesture ends (UIGestureRecognizerStateEnded). We will use this in our handler method to move an instance of UIView along with the panning gesture.
Let’s start creating an empty project in Xcode. I chose Single View Application template and created a view in the center of the screen. Continue reading →
This article explains in simple words, like to a rubber duck, what a run loop is in OS X and iOS.
What is a NSRunLoop?
A run loop is an event processing loop that you use to schedule work and coordinate the receipt of incoming events. The purpose of a run loop is to keep your thread busy when there is work to do and put your thread to sleep when there is none.
That’s what docs say. Each thread, including the application’s main thread, has an associated NSRunLoop object. The app frameworks automatically set up and run the run loop on the main thread as part of the application startup process. Continue reading →
This article explains configuring DHCP in OS X Server in simple steps. It’s an easy to follow tutorial with screenshots and hints that will help you in starting a DHCP service in your network.
DHCP in OS X Server. Creating a DHCP pool.
First thing we have to do is to set up a desired IP address pool the DHCP server should use. This requires providing start and end addresses of the pool, network mask, and router (default gateway) IP address. Additionally we can also specify DNS servers’ IP addresses and lease time.
This article shows how to share the Internet connection on your Mac with Raspberry Pi. The Pi is connected to Mac using an Ethernet cable. It also shows how to get the IP address of the Pi once the connection is established. Continue reading →
NSLayoutConstraint Extensions is a useful category on NSLayoutConstraint containing a set of helper methods for creating most commonly used constraints. The category also includes a debugging extension that makes troubleshooting invalid constraints much easier and faster.
It is designed to be as easy to use as possible to integrate and use to speed up everyday development tasks. All the methods are well documented and described using doxygen style. Continue reading →
This article explains all you need to know to understand how dynamic linking in Java works.
Dynamic linking in Java
Java applications are typically compiled to bytecode that can run on any Java Virtual Machine (JVM) regardless of computer architecture. The bytecode is an intermediate representation, which is then, linked to platform-specific machine code.
To understand the dynamic linking we must first divide Java program execution into steps. Java language specification defines 5 of them. Continue reading →
Raspberry Pi boards have 2 or 5 Light Emitting Diodes (LEDs). The LEDs indicate status of the operations such as accessing the SD Card or network activity. All of the diodes are located next to the audio socket, in the corner.
The number of LEDs depends on the model. Newer boards have 5 diodes. Older ones, only 2.
Functions of the status LEDs
ACT (or OK on the older boards) - green, blinks when SD card is accessed.
PWR - red when powered on.
LEDs below exist only on Model B boards.
FDX - green when connected to Full Duplex Ethernet network.
LNK - green when Ethernet is connected, blinks on data transfer.
100 (or 10M on on the older boards) - orange, indicates 100Mbit Ethernet.