SQL Injection

Advertisements

dbGo vs dbExpress vs FireDAC

In Community edition: Out of the box FireDAC only talks to local databases, but you could use ADO (dbGo) or a third party library.

dbGo (ADO)
The dbGo components provide data access through the ADO framework. ADO, (Microsoft ActiveX Data Objects) is a set of COM objects that access data through an OLE DB provider. The dbGo components encapsulate these ADO objects in the Delphi database architecture. Windows is the only supported target platform for VCL and FMX applications (32 and 64 bits). Obviously, this technology isn’t available for OS X, iOS and Android operating systems.

dbExpress
dbExpress is Embarcadero’s data driver architecture that replaced the BDE. First released with Borland Delphi 6 and C++Builder 6, it has gone through several iterations itself. It provides unidirectional database access, that means you can traverse data obtained from a database table only in the forward direction. You cannot go back, unless you add other layers. This makes dbExpress a very fast access technology, compared to many others. It can be used in VCL and FMX Windows applications (32 and 64 bits), but also for Mac OS X applications (more information about deploying dbExpress database applications: Deploying dbExpress Database_Applications), and provides local database connectivity for iOS and Android mobile applications (Using InterBase ToGo with dbExpress (iOS and Android)) But dbExpress is being deprecated. This means that it will be removed from RAD Studio in an upcoming release. To migrate your dbExpress application to FireDAC, you can find useful information in this link: Migrating dbExpress Applications to FireDAC

FireDAC
FireDAC is a Universal Data Access library for developing applications for multiple devices, connected to enterprise databases. And its the recommended database access framework in Delphi, C+ + Builder and RAD Studio on the latests releases. It provides high-performance, easy-to-use enterprise database connectivity. Universal data access with database specific features to get the most from every specific database engine. Deploying the final application is way easier as it does not requires any drivers to be installed. It can be used in VCL and FMX Windows applications (32 and 64 bits), for Mac OS X applications, and for local database access in iOS and Android.

.htaccess Flag List

  • C (chained with next rule)
  • CO=cookie (set specified cookie)
  • E=var:value (set environment variable var to value)
  • F (forbidden – sends a 403 header to the user)
  • G (gone – no longer exists)
  • H=handler (set handler)
  • L (last – stop processing rules)
  • N (next – continue processing rules)
  • NC (case insensitive)
  • NE (do not escape special URL characters in output)
  • NS (ignore this rule if the request is a subrequest)
  • P (proxy – i.e., apache should grab the remote content specified in the substitution section and return it)
  • PT (pass through – use when processing URLs with additional handlers, e.g., mod_alias)
  • R (temporary redirect to new URL)
  • R=301 (permanent redirect to new URL)
  • QSA (append query string from request to substituted URL)
  • S=x (skip next x rules)
  • T=mime-type (force specified mime type)

How to set DKIM using VestaCP

DKIM is important like SPF in mail servers.

Go go VestaCP Mail section,

Enable DKIM for your domain.

Go to console: vlistmaildomaindkim <username> <domain>

Copy public key.

Go to your DNS server.

Add TXT.

Name: mail._domainkey

Value: v=DKIM1; k=rsa; p=<PUBLIC KEY>

Keras Project Example

Download pima indian diabetes data file first.

Python code:

from keras.models import Sequential
from keras.layers import Dense
import numpy
# fix random seed for reproducibility
numpy.random.seed(7)
# load pima indians dataset
dataset = numpy.loadtxt("pima-indians-diabetes.csv", delimiter=",")
# split into input (X) and output (Y) variables
X = dataset[:,0:8] #input data - except last column
Y = dataset[:,8] # last column is real results
# create model
model = Sequential()
model.add(Dense(12, input_dim=8, activation='relu'))
model.add(Dense(8, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
# Compile model
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
# Fit the model - train
model.fit(X, Y, epochs=150, batch_size=10, verbose=2)

# evaluate the model
#scores = model.evaluate(X, Y)
#print("\n%s: %.2f%%" % (model.metrics_names[1], scores[1]*100))

# calculate predictions
predictions = model.predict(X)
rounded = [round(x[0],2) for x in predictions]
print(rounded)

Tested on: python-3.6.3-amd64, Keras API 2