Tutorial by Examples: am

Sometimes you need to replace a value matching a pattern with a new value that's based on that specific match, making it impossible to predict the new value. For these types of scenarios, a MatchEvaluator can be very useful. In PowerShell, a MatchEvaluator is as simple as a scriptblock with a singl...
It is sometimes useful to integrate a custom error logging framework to ensure all exceptions are logged. [ServiceContract] [ErrorHandler] public interface IMyService { } [AttributeUsage(AttributeTargets.Interface)] public class CustomErrorHandler : Attribute, IContractBehavior, IE...
import tensorflow as tf filename_queue = tf.train.string_input_producer(["file.csv"], num_epochs=1) reader = tf.TextLineReader() key, value = reader.read(filename_queue) col1, col2 = tf.decode_csv(value, record_defaults=[[0], [0]]) with tf.Session() as sess: sess.run(tf.initializ...
To randomly shuffle the examples, you can use tf.train.shuffle_batch function instead of tf.train.batch, as follows: parsed_batch = tf.train.shuffle_batch([serialized_example], batch_size=100, capacity=1000, min_after_dequeue=200) tf.train.shuffle_batch (as well as tf.train.batch) crea...
docker logs --follow <containerid> This tails the output of the running container. This is useful if you did not set up a logging driver on the docker daemon.
AmCharts provides a load-balanced, reliable CDN for loading the libraries directly from our web server. Use https://www.amcharts.com/lib/3/ as a base URL for includes. <script src="https://www.amcharts.com/lib/3/amcharts.js"></script> <script src="https://www.amcharts...
Consider a structure of the following classes should be constructed in XAML an then read into a CLR object: namespace CustomXaml { public class Test { public string Value { get; set; } public List<TestChild> Children { get; set; } = new List<TestChild>(); ...
Consider a structure of the following classes should be constructed in XAML an then read into a CLR object: namespace CustomXaml { public class Test { public string Value { get; set; } public List<TestChild> Children { get; set; } = new List<TestChild>(); ...
AWS Lambda supports Transparent scalability and availability Developer friendly operations and no need to manage servers Native integration to AWS services No need to pay for idle time RESTful integration Monitoring the RESTful interface using AWS API gateway
This is one of the simplest lambda function. It is equivalent to Hello World program. To create your first program follow the below mentioned steps. Login to AWS Console Click Lambda under compute Click create a Lambda Function Skip select blueprint section In configure trigger click on the...
Of course you can pass data to Sinatra routes, to accept data in your routes you can add route paremeters. You can then access a params hash: get '/hello/:name' do # matches "GET /hello/foo" and "GET /hello/bar" # params['name'] is 'foo' or 'bar' "Hello #{params['...
This example adds a new parameter to MyTestFunction if $SomeUsefulNumber is greater than 5. function MyTestFunction { [CmdletBinding(DefaultParameterSetName='DefaultConfiguration')] Param ( [Parameter(Mandatory=$true)][int]$SomeUsefulNumber ) DynamicParam {...
// Main frame class declaration class CMainFrame : public CMDIFrameWndEx { DECLARE_DYNAMIC(CMainFrame) protected: // declare our pane CDockablePane m_wndPane; // .... other class memebers public: CMainFrame(); protected: afx_msg int OnCreate(LPCREATEST...
Some times application must have panes that docked not to the main frame, but to the child frame. Usually it's MDI application. In MFC Feature pack such child frame is inherited from CMDIChildWndEx class and as main frame (inherited from CMDIFrameWndEx) have all required code for such docking. But ...
@Test annotation can be applied to any class or method. This annotation marks a class or a method as part of the test. @Test at method level - mark annotated method as test method @Test at class level The effect of a class level @Test annotation is to make all the public methods of the class ...
VI snippets are like Screenshots of a Block Diagram, with one important difference. They can be opened in LabVIEW to reconstruct the orginal program. They are saved in the common .PNG format so they can be used like normal pictures e.g. in forums and on StackOverflow. To create a VI snippet mark th...
Prerequisites: Apple Developers Account Setup GameCenter Leaderboards with iTunesConnect Setting up GameCenter Leaderboards: Sign in to iTunesConnect Go to My Apps. Create an app for your project then go to Features. Click on Game Center Click the plus sign next to Leaderboards. Choose...
Scenario: You need to select an implementation of address validation when a sales order is submitted, and the validator is determined by the country to which the order is shipping. The factory needs to inspect some value passed as an argument to select the correct implementation. First, write an in...
Scenario: You need to resolve a dependency when a method is called, not in the constructor. Solution: Inject an abstract factory into the constructor. When the method is called, it requests the dependency from the abstract factory, which in turn resolves it from the container. (Your class depends o...
const Koa = require('koa') const app = new Koa() app.use(async ctx => { ctx.body = 'Hello World' }) app.listen(8080)

Page 80 of 129