• Skip to main content
  • Skip to primary sidebar

Ravi Shankar

Tweaking Apps

  • About
  • Portfolio
  • Privacy Policy

Archives for September 2014

Find out character count Microsoft Word document

September 11, 2014 By Ravi Shankar 3 Comments

Microsoft Word users can find out character count of a document using the option available as part of the Review menu.

Find out character and word count in Word 2013, Word 2010 and Word 2007

Click the review menu and navigate to Proofing section then click the Word Count option.

Word Count in Word 2013, Word 2010 and Word 2007

This should display the following Word Count Statistics along with Characters (no spaces) and Character (with spaces) details. If you are interested to find out only the Characters Count of certain paragraph then all you need to do is Select the Paragraph before clicking the Word Count option.

Words and Characters Count statistics in Word 2013, Word 2010 and Word 2007

If you only want to see the number of words in the document then the quickest way to do this is by checking the Status bar.

display number of words in document in Word 2013, Word 2010 and Word 2007

The status bar in Word 2013 would by default display the Word Count and in case if it not displayed then right click on the Status bar and choose the Word Count in Customize Status Bar menu list.

Display Word count in Status bar in Word 2013, Word 2010 and Word 2010

Also See: How to find word count of an email message in Outlook

Filed Under: MS Office, Word 2007, Word 2010, Word 2013 Tagged With: Character Count, Document, paragraph, Status Bar, Word Count, word document

How to open or close archive file in Outlook

September 9, 2014 By Ravi Shankar Leave a Comment

In this tutorial, we will see the steps to open or close archive file in Outlook 2013 and Outlook 2010.

Open archive file in Outlook 2013 and Outlook 2010

If you have archived your outlook items and you want to open in Outlook then you can use the settings available as apart of Outlook Options.

Click on the File menu –> Open –> Open Outlook Data file option

Open archive file in Outlook 2013 and Outlook 2010

This would display the following Open Outlook Data File window.

Open Outlook Data file in Outlook 2013 and Outlook 2010

Navigate to the folder where the archive file present and choose the file. Now the archived items would be available as apart of your outlook folder structure.

Close archive folder in Outlook 2013 and Outlook 2010

Outlook users can close open archive folder by following the below mentioned steps.

  • Launch Outlook and then move to the Navigation pane.
  • In the Navigation Pane, right click on the Archive folder that needs to be closed.

Close archive folder in Outlook 2013 and Outlook 2010

  • Select Close “archive” option from the list of available menus. By this way you can close an archive file in Outlook 2013 and Outlook 2010

Also See: How to find mailbox size in Microsoft Outlook

Filed Under: MS Office, Outlook 2010, Outlook 2013 Tagged With: Archive, Close Archive folder, Open Outlook Data file, Outlook 2010

How to enable or disable multi threading feature in Excel

September 9, 2014 By Ravi Shankar Leave a Comment

Microsoft Excel 2010 has a multi threading feature which when enabled reduces the time taken for complex calculation or Formulas. And you can enable this feature when your computer supports multi processing capabilities. Listed below are the steps to enable or disable multi threading feature in Excel 2013 and Excel 2010

Step 1: Click File menu and select Options from the list.

Step 2: In the Options window, click Advanced tab and scroll down to Formulas section.

enable or disable multi threading feature in Excel 2013 and Excel 2010

Step 3: Now you can enable or disable multi threading feature by using the checkbox with label Enable multi-threaded calculation. This also provides option for specifying the number of processor that has to be used for the calculation. By this way Excel users can turn on or off multi threading feature.

Also See: How to turn off auto calculation in Excel 2010

Filed Under: Excel, Excel 2010, Office 2010 Tagged With: Calculation, Excel 2010, Formulas, multi thread, Multi-threaded, Office 2010

How to make a workbook read only in Excel

September 8, 2014 By Ravi Shankar Leave a Comment

We have already seen how to How to make a presentation read only in Power Point. Similarly an excel workbook can be made read only using Excel Options. Listed below are the steps to make a workbook read only in Excel 2013 and Excel 2010

Click on the File menu –> Info menu

Protect Workbook in Excel 2013 and Excel 2010

Click on the Protect Workbook drop down arrow. This would display the following menu list

Mark workbook as final in Excel 2013 and Excel 2010

Click on the Mark as Final menu, the following dialog box would appear.

image

On selecting OK button the following confirmation box will be displayed.

Warning message when workbook marked as final in edited

By this way you can make an workbook in excel 2010 read only and prevent users from making any changes to the file.

Also See: Different ways to protect workbook in Excel 2013

Filed Under: Excel, Excel 2010, Excel 2013, MS Office Tagged With: Excel 2010, Mark As Final, Office 2010, Read-only, Workbook

Integrating Stripe in Swift for iOS development

September 2, 2014 By Ravi Shankar 12 Comments

Stripe is payment gateway that can be integrated with any website and mobile apps. In this tutorial we will see a quick and simple integration of Stripe in Swift for iOS development using Stripe documentation for iOS.

201409021233.jpg

This hands on tutorial will help you to familiarise yourself in

  • Validating and creating token using Stripe IOS SDK
  • Installing third party library using Cocoa-pods (Stripe)
  • Calling Objective-C framework in Swift (Objective-C Bridging Headers settings)

Click File menu and select New -> Project

201409021049.jpg

Select Single View Application as the template for the project.

201409021050.jpg

Provide a name for your project and select the language as Swift.

201409021110.jpg

Now close the project in Xcode and launch terminal window.

Setup Stripe using Cocoa-pods

Run the following commands on your terminal window to install Stripe.

[code language=”plain”]sudo gem install cocoapods
pod init[/code]

Edit Podfile under project directory and add pod ‘Stripe’ then execute the below command in Terminal window.

[code language=”plain”]pod install[/code]

Navigate to the project folder and launch the file with extension as workspace. Now you should see the Stripe frameworks included under Pods directory along with your default project files.

201409021131.jpg

Write code to integrate Stripe

Edit ViewController.swift and add the following IBOutlet variable for the button.

[code language=”swift”]@IBOutlet var saveButton: UIButton![/code]

Now add the following variable declaration to ViewController.swift file to hold the instance of STPView class.

[code language=”swift”]var stripeView: STPView = STPView()[/code]

Since the Stripe framework has been written in Objective-C, we need to make sure to add the implementation file as part of the Objective-C bridging Headers under Build Settings.

Select Project folder and navigate to Build Settings. Then use the search field to locate to Objective-C Bridging Header setting.

201409021153.jpg

Then drag and drop the STPView.m file to Object-C Bridging Header section.

201409021155.jpg201409021156.jpg

Update the viewDidLoad function and add the following Stripe integration code. Make sure the ViewController class conforms to STPViewDelegate protocol

[code language=”swift”]class ViewController: UIViewController, STPViewDelegate{
override func viewDidLoad() {
super.viewDidLoad()
stripeView = STPView(frame: CGRectMake(15, 20, 290, 55), andKey: )
stripeView.delegate = self
view.addSubview(stripeView)
saveButton.enabled = false
}
}[/code]

 

The above lines of code will add the Stripe control that accepts credit card number, expiry date and code. The save button is by default disabled and will be enabled only after entering valid credit card number. Implement the following function that will be triggered after entering the card details. The boolean parameter in the function will indicate whether the user has entered a valid card information. Based on this value, the save button is enabled or disabled.

[code language=”swift”]func stripeView(view: STPView!, withCard card: PKCard!, isValid valid: Bool) {
if (valid) {
saveButton.enabled = true
} else {
saveButton.enabled = false
}
}[/code]

Add the following IBAction function which will be called on tap of the button. We are using STPView’s createToken function to generate token and a successful token will be written to the console window.

[code language=”swift”]@IBAction func saveButton(sender: AnyObject) {
stripeView.createToken { (stpToken, error) -> Void in
if (error != nil) {
println(error)
} else {
println(stpToken)
}
}[/code]

Navigate to Main.storyboard and add UIButton from object library to ViewController. Centre align the button both horizontally and vertically to the View Controller.

201409021138.jpg

Then use Connection Inspector to connect the button to IBOutlet variable and saveButton function to Tap Up Inside event of the button.

201409021228.jpg

Now build and run the project on simulator and you can use dummy card number 4242 4242 4242 4242 to test your implementation. For more details refer to Stripe Testing Documentation.

Sample Output

[code language=”plain”]Successful token – tok_14YBF42eZvKYlo2CoZtuO3Md (test mode)

Error message – Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo=0x7f9b7147b4a0 {NSUnderlyingError=0x7f9b71786ca0 "The Internet connection appears to be offline.", NSErrorFailingURLStringKey=https://pk_test_6pRNASCoBOKtIshFeQd4XMUh:@api.stripe.com/v1/tokens, NSErrorFailingURLKey=https://pk_test_6pRNASCoBOKtIshFeQd4XMUh:@api.stripe.com/v1/tokens, _kCFStreamErrorDomainKey=12, _kCFStreamErrorCodeKey=8, NSLocalizedDescription=The Internet connection appears to be offline.}[/code]

Download Demo Project from GitHub

Filed Under: Develop, ios, iPhone, Programming Tagged With: Stripe, Swift

Primary Sidebar

Recent Posts

  • We have blocked all requests from this device – Firebase Phone Authentication
  • iPhone is not available error message in Xcode
  • Clear CocoaPods cache, re-download and reinstall all pods
  • PDFKit – View, Annotate PDF file in Swift
  • Tab Bar Controller with WebView

Archives

  • September 2020
  • April 2020
  • December 2019
  • November 2019
  • October 2019
  • February 2019
  • October 2017
  • June 2017
  • May 2017
  • March 2017
  • September 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • October 2013
  • August 2013
  • July 2013
  • June 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • November 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • April 2011
  • March 2011
  • January 2011
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • July 2009
  • March 2008

Copyright 2020 © rshankar.com