Tutorial by Examples: c

Create a custom BitmapImageViewTarget to load the image into: public class CircularBitmapImageViewTarget extends BitmapImageViewTarget { private Context context; private ImageView imageView; public CircularBitmapImageViewTarget(Context context, ImageView imageView) { ...
Implicit intents do not name a specific component, but instead declare a general action to perform, which allows a component from another app to handle it. For example, if you want to show the user a location on a map, you can use an implicit intent to request that another capable app show a specif...
To achieve the simplest task in Entity Framework - to connect to an existing database ExampleDatabase on your local instance of MSSQL you have to implement two classes only. First is the entity class, that will be mapped to our database table dbo.People. class Person { public int...
#include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* example.com is redirected, so we tell libcurl to follow redirect...
There are two basic ways in which you can Insert a document Create a document, Then insert it var bucket = cluster.OpenBucket("default"); var document = new Document<dynamic> { Id = "doc_net", Content = new { name = &quo...
Some collection types can be initialized at the declaration time. For example, the following statement creates and initializes the numbers with some integers: List<int> numbers = new List<int>(){10, 9, 8, 7, 7, 6, 5, 10, 4, 3, 2, 1}; Internally, the C# compiler actually converts this...
Apart from the Javadoc documentation code can be documented inline. Single Line comments are started by // and may be positioned after a statement on the same line, but not before. public void method() { //single line comment someMethodCall(); //single line comment after statement }...
NSData can be represented as hexadecimal string, similar to what it outputs in its description method. Swift extension NSData { func hexString() -> String { return UnsafeBufferPointer<UInt8>(start: UnsafePointer<UInt8>(bytes), count: length) .reduce(&quo...
Returns a table with the values for all row versions that were opened and closed within the specified time range defined by the two datetime values for the CONTAINED IN argument. Rows that became active exactly on the lower boundary or ceased being active exactly on the upper boundary are included. ...
Creating a temporal table with a default history table is a convenient option when you want to control naming and still rely on system to create history table with default configuration. In the example below, a new system-versioned memory-optimized temporal table linked to a new disk-based history t...
C++17 Thanks to int std::uncaught_exceptions(), we can implement action which executes only on success (no thrown exception in scope). Previously bool std::uncaught_exception() just allows to detect if any stack unwinding is running. #include <exception> #include <iostream> templa...
C++17 Thanks to int std::uncaught_exceptions(), we can implement action which executes only on failure (thrown exception in scope). Previously bool std::uncaught_exception() just allows to detect if any stack unwinding is running. #include <exception> #include <iostream> template ...
As always, you need to make sure you have the required permissions. public class MainActivity extends AppCompatActivity implements LocationListener{ private LocationManager mLocationManager = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCr...
As always, you need to make sure you have the required permissions. public class MainActivity extends AppCompatActivity implements LocationListener{ private LocationManager mLocationManager = null; HandlerThread mLocationHandlerThread = null; Looper mLocationHandlerLooper = null; ...
As the characters/digits can be anywhere within the string, we require lookaheads. Lookaheads are of zero width meaning they do not consume any string. In simple words the position of checking resets to the original position after each condition of lookahead is met. Assumption :- Considering non-wo...
This can be done with a bit of modification in the above regex ^(?=.{10,}$)(?=(?:.*?[A-Z]){2})(?=.*?[a-z])(?=(?:.*?[0-9]){2}).*$ or ^(?=.{10,}$)(?=(?:.*[A-Z]){2})(?=.*[a-z])(?=(?:.*[0-9]){2}).* Let's see how a simple regex ^(?=(?:.*?[A-Z]){2}) works on string abcAdefD Image Credit :- ht...
In the solver file, we can set a global regularization loss using the weight_decay and regularization_type options. In many cases we want different weight decay rates for different layers. This can be done by setting the decay_mult option for each layer in the network definition file, where decay_...
Capitalize word: M-c Convert word to upper case: M-u Convert word to lower case: M-l
C++17 The [[nodiscard]] attribute can be used to indicate that the return value of a function shouldn't be ignored when you do a function call. If the return value is ignored, the compiler should give a warning on this. The attribute can be added to: A function definition A type Adding the a...
Use parentheses and commas to create tuples. Use one comma to create a pair. (1, 2) Use more commas to create tuples with more components. (1, 2, 3) (1, 2, 3, 4) Note that it is also possible to declare tuples using in their unsugared form. (,) 1 2 -- equivalent to (1,2) (,,) 1 2 3 ...

Page 459 of 826