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...
// Working with Sublists in Standard mode ...
// ... if the record is in context:
// Add item 456 with quantity 10 at the end of the item sublist
var nextIndex = nlapiGetLineItemCount("item") + 1;
nlapiSetLineItemValue("item", "item", nextIndex, 456);
nlapiSetL...
// Working with a sublist in Standard Mode in SuiteScript 2.0...
require(["N/record"], function (r) {
var rec = r.create({
"type": r.Type.SALES_ORDER,
"isDynamic": false
});
// Set relevant body fields ...
// Add line item 45...
This example echoes the special character ! into a file. This would only work when DelayedExpansion is disabled. When delayed expansion in enabled, you will need to use three carets and an exclamation mark like this:
@echo off
setlocal enabledelayedexpansion
echo ^^^!>file
echo ^>>&...
If you need to select between several options,
enabling just one via enable_if<> can be quite cumbersome,
since several conditions needs to be negated too.
The ordering between overloads can instead be selected using
inheritance, i.e. tag dispatch.
Instead of testing for the thing that ne...
Installation:
To install the LoopBack command-line interface (CLI) tool:
npm install -g loopback-cli
This installs the lb command-line tool for scaffolding and modifying LoopBack applications.
Create new application:
To create a new application:
lb
The LoopBack application generator will ...
This approach will prevent a user from embedding a second SQL statement in their input for execution.
Dim strSQL As String
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
strSQL = "PARAMETERS [FirstName] Text(255), [LastName] Text(255), [Phone] Text(255); " _
& "INS...
Let's apply the State Machine pattern for parsing lines with the specific pattern using S4 Class feature from R.
PROBLEM ENUNCIATION
We need to parse a file where each line provides information about a person, using a delimiter (";"), but some information provided is optional, and instea...
Lets start installing the popular library Alamofire to our Xcode project!
Lets first install CocoaPods by using the command:
[sudo] gem install cocoapods
Then let's create a new project in Xcode called Start! Navigate to the folder that contains the .xcodeproj and create a new text file called ...
To use MQTT in the application we have variety of Libraries available
for different programming languages.
MQTT Library
LIBRARYLANGUAGEDESCRIPTIONEclipse PahoC, C++, Java, Javascript, Python, Go, C#Paho clients are among the most popular client library implementations.Fusesource MQTT ClientJa...
Scala supports lazy evaluation for function arguments using notation: def func(arg: => String). Such function argument might take regular String object or a higher order function with String return type. In second case, function argument would be evaluated on value access.
Please see the example...
extension Dictionary {
func merge(dict: Dictionary<Key,Value>) -> Dictionary<Key,Value> {
var mutableCopy = self
for (key, value) in dict {
// If both dictionaries have a value for same key, the value of the other dictionary is used.
mu...
I use Spring Boot 1.4.4.RELEASE , with MySQL as the Database and Spring Data JPA abstraction to work with MySQL. Indeed ,it is the Spring Data JPA module that makes it so easy to set up Pagination in a Spring boot app in the first place.
Scenario
expose an endpoint /students/classroom/{id} . It wi...
In a basic implementation the task module must define a run/1 function that takes a list of arguments. E.g. def run(args) do ... end
defmodule Mix.Tasks.Example_Task do
use Mix.Task
@shortdoc "Example_Task prints hello + its arguments"
def run(args) do
IO.puts "Hello ...
Shaders 3.3 + extension.seen at radeon hd5500
#version 330
triangles deployed so that normal to point out of a cube.trace each triangle 3points order.
//#include <stdio.h>
//#include <string.h>
//#include <iostream>
//#include <glib.h>
#include <gdk/gdkx.h>...
Inserting a row at the bottom of a spreadsheet is easy:
var someSheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];
someSheet.appendRow(["Frodo", "Baggins", "Hobbit", "The Shire", 33]);
Note this will add the row after the last non-empty row.
I...