Tutorial by Examples: f

You can do a permissions check when sending an Intent to a registered broadcast receiver. The permissions you send are cross-checked with the ones registered under the tag. They restrict who can send broadcasts to the associated receiver. To send a broadcast request with permissions, specify the p...
A function declared inline may be defined in multiple translation units, provided that all definitions are identical. It also must be defined in every translation unit in which it is used. Therefore, inline functions should be defined in headers and there is no need to mention them in the implementa...
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!...
private static void GetAllTheAssetsAndFiles(MediaServicesCredentials _medServCredentials) { try { string result = string.Empty; CloudMediaContext mediaContext; mediaContext = new CloudMediaContext(_medServCredentials); ...
SP_HELPINDEX tableName
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...
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...
.find() method allows us to search through the descendants of these elements in the DOM tree and construct a new jQuery object from the matching elements. HTML <div class="parent"> <div class="children" name="first"> <ul> ...
Programmatically generating a String is best accomplished with a StringBuffer. A StringBuffer doesn't generate a new String object until toString() is called. var sb = new StringBuffer(); sb.write("Use a StringBuffer"); sb.writeAll(["for ", "efficient ", "stri...
for arg; do echo arg=$arg done A for loop without a list of words parameter will iterate over the positional parameters instead. In other words, the above example is equivalent to this code: for arg in "$@"; do echo arg=$arg done In other words, if you catch yourself wri...
# 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> InputIterator find (InputIterator first, InputIterator last, const T& val); Effects Finds the first occurrence of val within the range [first, last) Parameters first => iterator pointing to the beginning of the range last => iterator p...
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...
git log --pretty=format:"%Cgreen%ci %Cblue%cn %Cgreen%cr%Creset %s" This will give a nice overview of all commits (1 per line) with date, user and commit message. The --pretty option has many placeholders, each starting with %. All options can be found here
It is not possible to add and commit an empty folder in Git due to the fact that Git manages files and attaches their directory to them, which slims down commits and improves speed. To get around this, there are two methods: Method one: .gitkeep One hack to get around this is to use a .gitkeep fil...
Arrow functions are lexically scoped; this means that their this Binding is bound to the context of the surrounding scope. That is to say, whatever this refers to can be preserved by using an arrow function. Take a look at the following example. The class Cow has a method that allows for it to pr...
C extensions are comprised of two general pieces: The C Code itself. The extension configuration file. To get started with your first extension put the following in a file named extconf.rb: require 'mkmf' create_makefile('hello_c') A couple of things to point out: First, the name hell...
To initialize a static final fields that require using more than a single expression, a static initializer can be used to assign the value. The following example initializes a unmodifiable set of Strings: public class MyClass { public static final Set<String> WORDS; static {...
Sun / Oracle releases of Java SE come in two forms: JRE and JDK. In simple terms, JREs support running Java applications, and JDKs also support Java development. Java Runtime Environment Java Runtime Environment or JRE distributions consist of the set of libraries and tools needed to run and mana...

Page 229 of 457