Tutorial by Examples

In many Excel applications, the VBA code takes actions directed at the workbook in which it's contained. You save that workbook with a ".xlsm" extension and the VBA macros only focus on the worksheets and data within. However, there are often times when you need to combine or merge data fr...
It's a VBA Best Practice to always specify which workbook your VBA code refers. If this specification is omitted, then VBA assumes the code is directed at the currently active workbook (ActiveWorkbook). '--- the currently active workbook (and worksheet) is implied Range("A1").value = 3.1...
If you want to access a workbook that's already open, then getting the assignment from the Workbooks collection is straightforward: dim myWB as Workbook Set myWB = Workbooks("UsuallyFullPathnameOfWorkbook.xlsx") If you want to create a new workbook, then use the Workbooks collection o...
Often saving new data in an existing workbook using VBA will cause a pop-up question noting that the file already exists. To prevent this pop-up question, you have to suppress these types of alerts. Application.DisplayAlerts = False 'disable user prompt to overwrite file myWB.SaveAs FileNa...
The "factory default" number of worksheets created in a new Excel workbook is generally set to three. Your VBA code can explicitly set the number of worksheets in a new workbook. '--- save the current Excel global setting With Application Dim oldSheetsCount As Integer oldSheets...
Mac OSX Using Homebrew: brew install haskell-stack
To create a project called helloworld run: stack new helloworld simple This will create a directory called helloworld with the files necessary for a Stack project.
File structure A simple project has the following files included in it: ➜ helloworld ls LICENSE Setup.hs helloworld.cabal src stack.yaml In the folder src there is a file named Main.hs. This is the "starting point" of the helloworld project. By default...
Stackage is a repository for Haskell packages. We can add these packages to a stack project. Adding lens to a project. In a stack project, there is a file called stack.yaml. In stack.yaml there is a segment that looks like: resolver: lts-6.8 Stackage keeps a list of packages for every revision...
When the GADTs extension is enabled, besides regular data declarations, you can also declare generalized algebraic datatypes as follows: data DataType a where Constr1 :: Int -> a -> Foo a -> DataType a Constr2 :: Show a => a -> DataType a Constr3 :: DataType Int A G...
Example uses of $(document).ready(): Attaching event handlers Attach jQuery event handlers $(document).ready(function() { $("button").click(function() { // Code for the click function }); }); Run jQuery code after the page structure is created jQuery(function($) ...
Step 1: Install the SDK You can install the SDK manually or via CocoaPods. The latter option is highly recommended. Put these lines in Podfile: target 'MyApp' do use_frameworks! pod 'FBSDKCoreKit' pod 'FBSDKLoginKit' pod 'FBSDKShareKit' end Run pod install in the terminal and op...
When building a webserver with Express it's often required to serve a combination of dynamic content and static files. For example, you may have index.html and script.js which are static files kept in the file system. It is common to use folder named 'public' to have static files. In this case th...
A basic example of HTTP server. write following code in http_server.js file: var http = require('http'); var httpPort = 80; http.createServer(handler).listen(httpPort, start_callback); function handler(req, res) { var clientIP = req.connection.remoteAddress; var connectUsi...
a basic example for http client: write the follwing code in http_client.js file: var http = require('http'); var options = { hostname: '127.0.0.1', port: 80, path: '/', method: 'GET' }; var req = http.request(options, function(res) { console.log('STATUS: ' + res.statusCode)...
This program copies a file using readable and a writable stream with the pipe() function provided by the stream class // require the file system module var fs = require('fs'); /* Create readable stream to file in current directory named 'node.txt' Use utf8 encoding Read the data...
I/O in node is asynchronous, so interacting with the disk and network involves passing callbacks to functions. You might be tempted to write code that serves up a file from disk like this: var http = require('http'); var fs = require('fs'); var server = http.createServer(function (req, res) { ...
Multiple database cursors can be published from the same publication method by returning an array of cursors. The "children" cursors will be treated as joins and will not be reactive. Meteor.publish('USER_THREAD', function(postId) { let userId = this.userId; let comments = Comm...
Production deployments will vary in many ways, but a standard convention when deploying in production is to define an environment variable called NODE_ENV and set its value to "production". Runtime flags Any code running in your application (including external modules) can check the valu...
Example. It will be replacing the word email to a name in a text file index.txt with simple RegExp replace(/email/gim, 'name') var fs = require('fs'); fs.readFile('index.txt', 'utf-8', function(err, data) { if (err) throw err; var newValue = data.replace(/email/gim, 'name'); ...

Page 384 of 1336