Tutorial by Examples: c

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...
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...
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...
Generators are functions which are able to pause and then resume execution. This allows to emulate async functions using external libraries, mainly q or co. Basically it allows to write functions that wait for async results in order to go on: function someAsyncResult() { return Promise.resolve...
Stream operations fall into two main categories, intermediate and terminal operations, and two sub-categories, stateless and stateful. Intermediate Operations: An intermediate operation is always lazy, such as a simple Stream.map. It is not invoked until the stream is actually consumed. This can...
If you want to Download image as Bitmap using Picasso following code will help you: Picasso.with(mContext) .load(ImageUrl) .into(new Target() { @Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { // Todo: Do some...
Connect to MongoDB, print 'Connected!' and close the connection. const MongoClient = require('mongodb').MongoClient; var url = 'mongodb://localhost:27017/test'; MongoClient.connect(url, function(err, db) { // MongoClient method 'connect' if (err) throw new Error(err); console.log(&q...
Insert a document called 'myFirstDocument' and set 2 properties, greetings and farewell const MongoClient = require('mongodb').MongoClient; const url = 'mongodb://localhost:27017/test'; MongoClient.connect(url, function (err, db) { if (err) throw new Error(err); db.collection('myCollect...
Get all documents in the collection 'myCollection' and print them to the console. const MongoClient = require('mongodb').MongoClient; const url = 'mongodb://localhost:27017/test'; MongoClient.connect(url, function (err, db) { if (err) throw new Error(err); var cursor = db.collection('my...
Find a document with the property { greetings: 'Hellu' } and change it to { greetings: 'Whut?' } const MongoClient = require('mongodb').MongoClient; const url = 'mongodb://localhost:27017/test'; MongoClient.connect(url, function (err, db) { if (err) throw new Error(err); db.collecti...
Delete a document with the property { greetings: 'Whut?' } const MongoClient = require('mongodb').MongoClient; const url = 'mongodb://localhost:27017/test'; MongoClient.connect(url, function (err, db) { if (err) throw new Error(err); db.collection('myCollection').deleteOne(// Delete...
Delete ALL documents with a 'farewell' property set to 'okay'. const MongoClient = require('mongodb').MongoClient; const url = 'mongodb://localhost:27017/test'; MongoClient.connect(url, function (err, db) { if (err) throw new Error(err); db.collection('myCollection').deleteMany(// M...
You can use the plus (+) operator to concatenate strings: 'Dart ' + 'is ' + 'fun!'; // 'Dart is fun!' You can also use adjacent string literals for concatenation: 'Dart ' 'is ' 'fun!'; // 'Dart is fun!' You can use ${} to interpolate the value of Dart expressions within strings. The curly...
A tuple is simply a concatenation of multiple values: of possibly different types whose number and types is known statically For example, (1, "Hello") is a 2 elements tuple composed of a i32 and a &str, and its type is denoted as (i32, &'static str) in a similar fashion as i...
# The following shell function will be used to generate completions for # the "nuance_tune" command. _nuance_tune_opts () { local curr_arg prev_arg curr_arg=${COMP_WORDS[COMP_CWORD]} prev_arg=${COMP_WORDS[COMP_CWORD-1]} # The "config" option takes a file arg, so ...
template <class InputIterator, class T> typename iterator_traits<InputIterator>::difference_type count (InputIterator first, InputIterator last, const T& val); Effects Counts the number of elements that are equal to val Parameters first => iterator pointing to the beginnin...
template <class InputIterator, class UnaryPredicate> typename iterator_traits<InputIterator>::difference_type count_if (InputIterator first, InputIterator last, UnaryPredicate red); Effects Counts the number of elements in a range for which a specified predicate function is true P...

Page 424 of 826