Tutorial by Examples

The class use Phalcon\Validation\Validator; use Phalcon\Validation\ValidatorInterface; use Phalcon\Validation\Message; class RecaptchaValidator extends Validator implements ValidatorInterface { public function validate(\Phalcon\Validation $validation, $attribute) { $value =...
Things you need A paid Apple Developer Program Membership A valid App ID and identifier for you app (like com.example.MyApp) which is not used before anywhere Access to developer.apple.com and Member Center An iOS Device to test (as Push Notifications don't work on Simulator) Enabling t...
Registers: 8 bit: A, B, C, D, E, H, L, F, I, R, 16 bit: SP, PC, IX, IY, and shadows of some 8b registers: A', B', C', D', E', H', L' and F'. Most of the 8 bit registers can be used also in pairs as 16 bit registers: AF, BC, DE and HL. SP is stack pointer, marking the bottom of stack memory (used b...
You can find description of the driver here. The quick example is: import psycopg2 db_host = 'postgres.server.com' db_port = '5432' db_un = 'user' db_pw = 'password' db_name = 'testdb' conn = psycopg2.connect("dbname={} host={} user={} password={}".format( ...
An extremely simple tool for installing PostgreSQL on a Mac is available by downloading Postgres.app. You can change preferences to have PostgreSQL run in the background or only when the application is running.
In order to determine some simple statistics of a value in a column of a table, you can use an aggregate function. If your individuals table is: NameAgeAllie17Amanda14Alana20 You could write this statement to get the minimum, maximum and average value: SELECT min(age), max(age), avg(age) FROM i...
In order to use Gson you have to include it in your project. You can do this by adding the following dependency of the Gson version available in Maven Central: Maven Add to pom.xml <dependencies> <dependency> <groupId>com.google.code.gson</groupId> <a...
C++ compilers encode additional information in the names of exported functions, such as argument types, to make overloads with different arguments possible. This process is called name mangling. This causes problems with importing functions in C# (and interop with other languages in general), as the...
There're several conventions of calling functions, specifying who (caller or callee) pops arguments from the stack, how arguments are passed and in what order. C++ uses Cdecl calling convention by default, but C# expects StdCall, which is usually used by Windows API. You need to change one or the ot...
foo = "bar" foo[0] = "c" # Error Immutable variable value can not be changed once they are created.
foo = ("bar", 1, "Hello!",) foo[1] = 2 # ERROR!! Second line would return an error since tuple members once created aren't assignable. Because of tuple's immutability.
The maximum number of remembered commands: ~> $ echo $HISTSIZE 1000
Each time this parameter is referenced, a random integer between 0 and 32767 is generated. Assigning a value to this variable seeds the random number generator (source). ~> $ echo $RANDOM 27119 ~> $ echo $RANDOM 1349
In Solution Explorer go to your project, right click on References then Add reference… Search for Compression and select System.IO.Compression.FileSystem then press OK. Add Imports System.IO.Compression to the top of your code file (before any class or module, with the other Imports statements)....
Hive-Hbase integration is supported since below versions. Hive: 0.11.0 HBase: 0.94.2 Hadoop: 0.20.2 CREATE TABLE hbase_hive (id string, col1 string, col2 string, col3 int) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping&q...
On Debian or Ubuntu, you can install SCons using $ sudo apt-get install scons On YUM-based systems, use $ sudo yum install scons You can install using an RPM by downloading it, then running $ sudo rpm -Uvh http://prdownloads.sourceforge.net/scons/scons-2.5.0-1.noarch.rpm
Eventually, when you're ready to release a version of your code to production, you'll need a .jar file to distribute. Intellij makes building JARs quite easy. First, navigate to File -> Project Structure and click on Artifacts: Click on the + button, and select JAR -> From modules with dep...
Windows in SFML are represented by one of two classes: sf::Window is a generic window provided by the operating system including an OpenGL render context. sf::RenderWindow is a specialized version of sf::Window that also acts as a sf::RenderTarget, allowing SFML's primitives to be rendered to it...
You can set any function for debugging with debug. debug(mean) mean(1:3) All subsequent calls to the function will enter debugging mode. You can disable this behavior with undebug. undebug(mean) mean(1:3) If you know you only want to enter the debugging mode of a function once, consider t...
On systems that use the System-V style init scripts, such as RHEL/CentOS 6: service <service> start service <service> stop On systems using systemd, such as Ubuntu (Server and Desktop) >= 15.04, and RHEL/CentOS >= 7: systemctl <service> dnsmasq systemctl <service> ...

Page 655 of 1336