Tutorial by Examples: c

If you want to take a screenshot of a particular View v, then you can use the following code: Bitmap viewBitmap = Bitmap.createBitmap(v.getWidth(), v.getHeight(), Bitmap.Config.RGB_565); Canvas viewCanvas = new Canvas(viewBitmap); Drawable backgroundDrawable = v.getBackground(); if(backgroundD...
If you installed Laravel via Composer or the Laravel installer, below configuration you will need. Configuration for Apache Laravel includes a public/.htaccess file that is used to provide URLs without the index.php front controller in the path. Before serving Laravel with Apache, be sure to enabl...
The first code block is written in Bootstrap 3. In Bootstrap 3 there are 4 types of column specifications, namely col-md-* col-lg-* col-sm-* col-xs-* . A fully responsive layout will look like this in Bootstrap 3: <div class="row"> <div class="col-lg-4 col-md-8 col-sm-8...
In twitter-bootstrap 4 the support for IE8, IE9, and iOS 6 has been dropped. v4 is now only IE10+ and iOS 7+. For sites needing either of those, use v3. In twitter-bootstrap 4 the official support for Android v5.0 Lollipop’s Browser and WebView has been Added. Earlier versions of the Android Brows...
Affix is removed from Bootstrap 4. It is recommended to use a position: sticky polyfill instead. If you were using Affix to apply additional, non-position styles, the polyfills might not support your use case. One option for such uses is the third-party ScrollPos-Styler library. According to Boot...
Below give solution can be also use in another supported programming languages with some syntax changes To do Scroll down page/section/division in webpage while there is custom scroll bar(Not browser scroll). Click Here For demo and check scroll bar has its independent element. In belo...
In this example we define a package header and a package body wit a function. After that we are calling a function from the package that return a return value. Package header: CREATE OR REPLACE PACKAGE SkyPkg AS FUNCTION GetSkyColour(vPlanet IN VARCHAR2) RETURN VARCHAR2; ...
This examples uses the AES algorithm for encrypting passwords. The salt length can be up to 128 bit. We are using the SecureRandom class to generate a salt, which is combined with the password to generate a secret key. The classes used are already existing in Android packages javax.crypto and java....
image: openjdk:8-jdk before_script: - curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz - mkdir -p /usr/local/gcloud - tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz - echo y |/usr/local/gclou...
If you want to loop over a list of tuples for example: collection = [('a', 'b', 'c'), ('x', 'y', 'z'), ('1', '2', '3')] instead of doing something like this: for item in collection: i1 = item[0] i2 = item[1] i3 = item[2] # logic or something like this: for item in collec...
The preprocessor is an important part of the compiler. It edits the source code, cutting some bits out, changing others, and adding other things. In source files, we can include preprocessor directives. These directives tells the preprocessor to perform specific actions. A directive starts with a ...
Scala packages should follow the Java package naming conventions. Package names are written in all lower case to avoid conflict with the names of classes or interfaces. Companies use their reversed Internet domain name to begin their package names—for example, io.super.math
// Adding a line item to the end of a sublist in Dynamic Mode... // ... if the record is in context: nlapiSelectNewLineItem("item"); nlapiSetCurrentLineItemValue("item", "item", 456); nlapiSetCurrentLineItemValue("item", "quantity", 10); nlapi...
// Working with Sublists in Dynamic Mode in SuiteScript 2.0... require(["N/record"], function (r) { var rec = r.create({ "type": r.Type.SALES_ORDER, "isDynamic": true }); // Set relevant body fields ... // Add line item 456 w...
Reading the specification for the document formats in OpenXML can be a time consuming process. Sometimes you just want to see how to produce a certain feature in a word-document. The Open XML SDK 2.5 Productivity Tool for Microsoft Office (OpenXmlSdkTool.exe) does just that. Its main features are: ...
This example uses the asyncio SSE library: https://github.com/brutasse/asyncio-sse import asyncio import sse class Handler(sse.Handler): @asyncio.coroutine def handle_request(self): yield from asyncio.sleep(2) self.send('foo') yield from asyncio.sleep(2) ...
Objective-C example of swizzling UIView's initWithFrame: method static IMP original_initWithFrame; + (void)swizzleMethods { static BOOL swizzled = NO; if (!swizzled) { swizzled = YES; Method initWithFrameMethod = class_getInstanceMethod([UIView class], ...
To add additional restriction to the poReceiptLinesSelection data view, you should invoke Select method on base view and inspect each item in returned PXResultSet independently to decide if it complies with additional restriction(s): public class APInvoiceEntryExt : PXGraphExtension<APInvoiceEn...
Assume we need to add an NSString object to SomeClass (we cant subclass). In this example we not only create an associated object but also wrap it in a computed property in a category for extra neatness #import <objc/runtime.h> @interface SomeClass (MyCategory) // This is the property wr...
Accessed through including <stdio.h>, the function printf() is the primary tool used for printing text to the console in C. printf("Hello world!"); // Hello world! Normal, unformatted character arrays can be printed by themselves by placing them directly in between the parenthes...

Page 710 of 826