Tutorial by Examples

Phoenix framework is written in Elixir, and Elixir itself is based on Erlang language and leverages the Erlang VM, known for running low-latency, distributed and fault-tolerant systems. Both languages are required for using phoenix framework. Following following step to install phoenix framework: 1...
First make sure you link against the logging library in your Android.mk file: LOCAL_LDLIBS := -llog Then use one of the following __android_log_print() calls: #include <android/log.h> #define TAG "MY LOG" __android_log_print(ANDROID_LOG_VERBOSE, TAG, "The valu...
ActionMailer also allows attaching files. attachments['filename.jpg'] = File.read('/path/to/filename.jpg') By default, attachments will be encoded with Base64. To change this, you can add a hash to the attachments method. attachments['filename.jpg'] = { mime_type: 'application/gzip', enco...
ActionMailer supports three callbacks before_action after_action around_action Provide these in your Mailer class class UserMailer < ApplicationMailer after_action :set_delivery_options, :prevent_delivery_to_guests, :set_business_headers Then create these methods under the private ...
Using Ubuntu you have different ways to read a text file, all similar but useful in different context. cat This is the simplest way to read a text file; it simply output the file content inside the terminal. Be careful: if the file is huge, it could take some time to complete the printing process!...
Get All Annotation //following method returns all annotations object added on map NSArray *allAnnotations = mapView.annotations; Get Annotation View for (id<MKAnnotation> annotation in mapView.annotations) { MKAnnotationView* annotationView = [mapView viewForAnnotation:annotation];...
public static string CreateBLOBContainer(string containerName) { try { string result = string.Empty; CloudMediaContext mediaContext; mediaContext = new CloudMediaContext(mediaServicesAccountName, mediaServicesAccou...
private static void GetAllTheAssetsAndFiles(MediaServicesCredentials _medServCredentials) { try { string result = string.Empty; CloudMediaContext mediaContext; mediaContext = new CloudMediaContext(_medServCredentials); ...
Sometimes conversion of primitive types to boxed types is necessary. To convert the array, it's possible to use streams (in Java 8 and above): Java SE 8 int[] primitiveArray = {1, 2, 3, 4}; Integer[] boxedArray = Arrays.stream(primitiveArray).boxed().toArray(Integer[]::new); With lowe...
With a clustered index the leaf pages contain the actual table rows. Therefore, there can be only one clustered index. CREATE TABLE Employees ( ID CHAR(900), FirstName NVARCHAR(3000), LastName NVARCHAR(3000), StartYear CHAR(900) ) GO CREATE CLUSTERED INDEX IX_Clustered O...
Non-clustered indexes have a structure separate from the data rows. A non-clustered index contains the non-clustered index key values and each key value entry has a pointer to the data row that contains the key value. There can be maximum 999 non-clustered index on SQL Server 2008/ 2012. Link for r...
SP_HELPINDEX tableName
CREATE VIEW View_Index02 WITH SCHEMABINDING AS SELECT c.CompanyName, o.OrderDate, o.OrderID, od.ProductID FROM dbo.Customers C INNER JOIN dbo.orders O ON c.CustomerID=o.CustomerID INNER JOIN dbo.[Order Details] od ON o.OrderID=od.OrderID GO CREATE UNIQUE C...
When state_below is a 2D Tensor, U is a 2D weights matrix, b is a class_size-length vector: logits = tf.matmul(state_below, U) + b return tf.nn.softmax(logits) When state_below is a 3D tensor, U, b as before: def softmax_fn(current_input): logits = tf.matmul(current_input, U) + b ret...
Use tf.nn.sparse_softmax_cross_entropy_with_logits, but beware that it can't accept the output of tf.nn.softmax. Instead, calculate the unscaled activations, and then the cost: logits = tf.matmul(state_below, U) + b cost = tf.nn.sparse_softmax_cross_entropy_with_logits(logits, labels) In this c...
Saving a model in tensorflow is pretty easy. Let's say you have a linear model with input x and want to predict an output y. The loss here is the mean square error (MSE). The batch size is 16. # Define the model x = tf.placeholder(tf.float32, [16, 10]) # input y = tf.placeholder(tf.float32, [16...
Restoring is also quite nice and easy. Here's a handy helper function: def restore_vars(saver, sess, chkpt_dir): """ Restore saved net, global score and step, and epsilons OR create checkpoint directory for later storage. """ sess.run(tf.initialize_all_...
For use TypeScript REPL in Node.js you can use tsun package Install it globally with npm install -g tsun and run in your terminal or command prompt with tsun command Usage example: $ tsun TSUN : TypeScript Upgraded Node type in TypeScript expression to evaluate type :help for commands in r...
/*- * * The default VCL code. * * NB! You do NOT need to copy & paste all of these functions into your * own vcl code, if you do not provide a definition of one of these * functions, the compiler will automatically fall back to the default * code from this file. * */ sub vcl...
/* * The built-in (previously called default) VCL code. * * NB! You do NOT need to copy & paste all of these functions into your * own vcl code, if you do not provide a definition of one of these * functions, the compiler will automatically fall back to the default * code from this f...

Page 684 of 1336