• Skip to main content
  • Skip to primary sidebar

Ravi Shankar

Tweaking Apps

  • About
  • Portfolio
  • Privacy Policy

Archives for November 2015

iOS Swift – Firebase Demo

November 26, 2015 By Ravi Shankar 4 Comments

Firebase is a platform that allows web and mobile application to store data in cloud. In this article, we will see an example app written in Swift that uses Firebase for storing and retrieving data in real time. The source code for this demo is available under GitHub.

This demo app consists of three fields for capturing name, date and image. These data are then converted in to required data type for storing purpose.

Installing Firebase in iOS SDK Project

The easiest way to include Firebase SDK to your iOS project is by using Cocoapods and the instruction are clearly given in Firebase documentation section. After installing the Firebase iOS sdk make sure to create a bridge file by adding the following import statement.

[code language=”swift”]#import Firebase/Firebase.h
[/code]

Firebase DataStore

User with Google or GitHub account can directly login to Firebase. The data stored in Firebase in JSON format. Find below a screenshot of the data stored by this demo app.

Profiles is top node and under which each row is stored as key/value pairs with name as the identifier for each row. Firebase provides a path (URL ) for storing the data which ends with firebaseio.com. You should be able find this URL in Firebase main screen.

[code language=”plain”]Example :- _unique_identifier_.firebaseio.com[/code]

Saving data to Firebase

You need to create a reference to Firebase class as shown below

[code language=”swift”]let firebase = Firebase(url:”https://_unique_identifer.firebaseio.com/profiles”)[/code]

replace _unique_identifier with the identifier provided for your Firebase account.

The following piece of code is used for saving the information to Firebase.

[code language=”swift”]@IBAction func save(sender: AnyObject) {

let name = nameTextField.text
var data: NSData = NSData()

if let image = photoImageView.image {
data = UIImageJPEGRepresentation(image,0.1)!
}

let base64String = data.base64EncodedStringWithOptions(NSDataBase64EncodingOptions.Encoding64CharacterLineLength)

let user: NSDictionary = [“name”:name!,”dob”:dateOfBirthTimeInterval, “photoBase64”:base64String]

//add firebase child node
let profile = firebase.ref.childByAppendingPath(name!)

// Write data to Firebase
profile.setValue(user)
}
[/code]

The above code does the following

  1. Converts image to to JPEG also compresses the size as we will be storing the image as base64EncodedString. 
  2. Creates a dictionary with name, image (String data) and date (as timeinterval).
  3. This dictionary is then added to the FIrebase Datastore by appending the name as the identifier for each row.
  4. And to save the data to Firebase, you need to call profile.setValue by passing the dictionary object.

Retrieving data from Firebase

Here again you need to create a reference to Firebase class by passing the required path as shown below

[code language=”plain”]let firebase = Firebase(url:”https://_unique_identifer.firebaseio.com/profiles”[/code]

In the following price of code, firebase.observerEventType is used for retrieving the data from Firebase account. The data gets refreshed in real time when ever any updates happen in the data store. This is really cool!!!

[code language=”swift”]func loadDataFromFirebase() {

UIApplication.sharedApplication().networkActivityIndicatorVisible = true

firebase.observeEventType(.Value, withBlock: { snapshot in
var tempItems = [NSDictionary]()

for item in snapshot.children {
let child = item as! FDataSnapshot
let dict = child.value as! NSDictionary
tempItems.append(dict)
}

self.items = tempItems
self.tableView.reloadData()
UIApplication.sharedApplication().networkActivityIndicatorVisible = false
})
}[/code]

snapshot referes to the collection of records store under a path. You can iterate through the collection to reteive each data item.

Delete a row from Firebase

[code language=”swift”]override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if editingStyle == .Delete {

let dict = items[indexPath.row]
let name = dict[“name”] as! String

// delete data from firebase

let profile = firebase.ref.childByAppendingPath(name)
profile.removeValue()
}
}
[/code]

 

Removing a row from Firebase can be done by calling removeValue method on the Firebase object reference as shown in the above code snippet.

In this tutorial, we have seen only the code related with Firebase. You can download the full source from here

Filed Under: ios, Swift Tagged With: Cloud, Firebase

Disable permanently delete items warning message in Outlook

November 22, 2015 By Ravi Shankar Leave a Comment

Outlook displays a warning message when deleting outlook emails. It displays a dialog box with message “Are you sure that you want permanently delete the selected items” as shown below

Are you sure that you want to permanently delee the selected items in Outlook

This is very useful warning option for the users before deleting the mail items permanently. But If you do not want to see the permanently deleted warning message then turn off or disable this warning message.

Disable warning message in Outlook 2016, Outlook 2013 and Outlook 2010

Click on the File menu –> Options and navigate to Advanced tab.

Prompt for confirmation before permanently deleting items in Outlook 2013 and Outlook 2010

Scroll down to Other section and clear the checkbox with label as Prompt for confirmation before permanently deleting items. Click OK to save the changes.

 

Turn off permanently delete warning message in Outlook 2007

This warning message can be disabled in Outlook 2007 by using Tools –> Options.

Go to Tools –> Options and select Other tab.

Outlook 2007 Advanced Optons

Click on the Advanced Options button. The following Advanced Options window would be displayed.

Outlook 2007 Warn before permanenly deleting items

Uncheck the “Warn before permanently deleting items” to disable the warning message.

Also See: How to turn off send without attachments warning message in Outlook

Filed Under: MS Office, Outlook 2007, Outlook 2010, Outlook 2013, Outlook 2016 Tagged With: delete mail items, Deleted Items, Disable, Outlook, Turn Off, Warning Message

Turn off display search as you type in Microsoft Outlook

November 22, 2015 By Ravi Shankar Leave a Comment

Microsoft Outlook provides option to display search results as we type the text in search box. This is a useful feature but if you think the real-time search result is a distraction then you can disable “display search as you type” feature using Search options. Listed below are steps to turn off this feature in Outlook 2016, Outlook 2013, Outlook 2010 and Outlook 2007

display search as you type in Outlook 2013

Outlook 2016, Outlook 2013 and Outlook 2010

Click File menu, select Options from the list.

Options in Outlook 2013

In the Options window, click Search Options and navigate to Results section.

Search options in Outlook 2013

Un mark the check box with caption as “When possible, display results as the query is typed”

turn off display results as the query is typed in Outlook 2013

Outlook 2007

display search results as you type in Outlook 2007

 

And to disable this feature, click on the drop down arrow available in the search box. This would display the following menus

Search Options in Outlook 2007

 

Navigate to Search Options and click it open the Search Option dialog box.

display search results as I type

 

The search section has an option for enabling or disabling the display search results as I type. By un ticking the checkbox this feature can be disabled.

Also See: 15 tips to use Google search effectively

Filed Under: MS Office, Outlook 2007, Outlook 2010, Outlook 2013, Outlook 2016 Tagged With: disable search, Microsoft Outlook, search as you type, Turn off search

Repeat action keyboard shortcut in Microsoft Office

November 18, 2015 By Ravi Shankar Leave a Comment

Microsoft Office Applications such as Word and Excel, last action can be repeated using keyboard shortcuts. For example if you have formatted a word with specific style and you want to repeat/apply the same format for other words then you can press F4 or Ctrl + Y or Alt + Enter. This can be used for copying drawings or formatting excel cells thus reducing the steps and saves time.

Change the keyboard shortcut for Repeat Action

Microsoft Office users can change the keyboard shortcut associated for Repeat action using Settings. Let us see these steps in Word 2016 & 2013

Step 1: Click File menu then Options and navigate to Customize Ribbon

Customize Keyboard Shortcuts in Microsoft Office

Step 2: In the Customize Ribbon screen, click Customize button available next to Keyboard shortcuts.

Change keyboard shortcut for Repeat Action

Step 3: In the Customize Keyboard window, select All Commands under Categories and pick EditRedoOrRepeat under Commands. You should be able to see the keys that are currently associated with Repeat action.

Step 4: Navigate to Press new shortcut key option and enter the keyboard shortcut.

Step 5: Click Assign to confirm and apply your changes.

Filed Under: Excel, MS Office, Office 2007, Office 2010, Office 2013, Office 2016 Tagged With: Microsoft Office, Office 2007, Office 2010, Office 2013

How to recall email message in Outlook

November 17, 2015 By Ravi Shankar 7 Comments

Recall message in Outlook 2016, 2013 and Outlook 2010

Outlook has a feature that lets users to recall a sent message. This can be done by accessing the Recall This Message option available as part of Actions drop down. This feature is quite useful If you had sent an e-mail message to an user with incorrect information and you want to recall that message or resend the e-mail message with correct information.

Step 1: Open the email message which needs to be recalled from the Sent Mail items folder.

Step 2: Navigate to Move section and click Actions dropdown and select Recall This Message… from the menu list

Recall This Message in Outlook 2013 and Outlook 2010

Step 3: In the Recall This Message dialog, select whether you want to Delete unread copies of this message or Delete unread copies and replace with a new message.

Deleate unread copies of this message

If you want to receive any acknowledgement then you can tick the check box with caption as Tell me if recall succeeds or fails for each recipient

Demo Video – Recall message in Outlook 2010

Recall email message in Outlook 2007

In Outlook 2007, Recall This Message option is available as part of Other options. Open the email message that needs to be recalled. Click Other Options and select Recall This Message from the drop down menu list.

Recall this message in Outlook 2007

On selecting Recall This Message the following dialog box would be displayed

image

You can select the the following options depending on your requirement

  • Delete unread copies of this message
  • Delete unread copies and replace with a new message

And if you want to receive any acknowledge for deleting the unread copies then you select the checkbox Tell me if recall succeeds or fails for each recipient.

Also See: How to recall  a message in Gmail

Filed Under: MS Office, Outlook 2007, Outlook 2010, Outlook 2013, Outlook 2016 Tagged With: email message, Outlook 2007, Outlook 2010, Outlook 2013, Recall Message

How to import text file in Excel

November 17, 2015 By Ravi Shankar Leave a Comment

This tutorial is provided step by step instruction to import a text file in to Worksheet in Excel 2016 and 2013. For this demo, let us take the following sample data with the columns separated from tabs and spaces.

image

Step 1: Launch Excel Workbook and click the Data menu. Then navigate to Get External Data section.

image

Step 2: Click the From Text option under Get External Data section.

image

Step 3: In the Import Text File window, select Text file and click Import button. This should display the following Text Import Wizard.

image

Step 4: The columns in the text file have been separated using the tabs. Hence we have selected Delimited option for “Choose the file type that best describes your data”.

Step 5: After selecting an appropriate value for Start import at row and File Origin, click the Next button.

Step 6: In Step 2 of Text Import Wizard, choose appropriate delimiter under Delimiters section. You can preview the selection using Data preview section.

image

I have selected “Treat consecutive delimiters as one” as the text file used for import has more than one consecutive delimiters. Now you can see the Data preview section display the of data as 2 columns.

image

Step 7: Click the Next button to access the data format screen in Text import Wizard.

image

Here you can set the data format for the columns to either General, Text or Date. Similarly if you do not want to import any column then highlight it under Data preview select and select Do not import.

image

Step 8: Click Finish button on Text Import Wizard for completion.

image

Step 9: Now you will be show the above dialog box to choose “Where do you want to put the data”. You can either specify range on existing worksheet or New worksheet.

Step 10: After selecting the appropriate option under Import Data screen, click OK button to insert data from the text file.

image

Filed Under: Excel, Excel 2013, Excel 2016, MS Office Tagged With: Delimited file, Excel 2013, Get External Data, Import text file, Office 2013

How to insert numeric symbols in Word

November 17, 2015 By Ravi Shankar Leave a Comment

In this tutorial, we are going to see the steps to required for inserting numeric symbols such as

?, ? in Word 2016 and Word 2013. This is in addition to earlier topic related with inserting symbol in a word document.

Insert numeric symbols in Microsoft Word

Step 1: From Home menu, navigate to the Insert menu.

Insert menu in Word 2013

Step 2: Then click the arrow pointing downwards under Symbol option and select More Symbols.

More Symbols in Word 2013

Step 3: In the Symbol window, click Font dropdown and select Yu Mincho from the list.

Symbol window in Word 2013

Also See: How to insert math symbol in Microsoft Word

Step 4: Scroll down the Yu Mincho symbol list and select numeric symbol that needs to be inserted in the document.

Numeric Symbol in Microsoft Word

You can also note down the shortcut key, if you are repeatedly going to use the symbol.

Shortcutkey for inserting symbol

Also See: How to insert check mark symbol in Microsoft Word

Filed Under: MS Office, Word 2013, Word 2016 Tagged With: insert symbol, Microsoft Word, Numeric Symbol, Word 2013

Remove author name from file properties in Word

November 11, 2015 By Ravi Shankar Leave a Comment

Word 2016 & 2013 users have an option to remove the author name that is displayed as part of File Properties. If you have created  a word document, right click on the file and selecting properties > Details tab should display the author’s name.

File Properties of Word document

Similarly if you navigate to File > Info, the Related People section should display the following information.

Word 2013 Info menu

How to remove author’s name from document properties

Listed below are the steps for removing the author’s name from document properties.

Step 1: After Creating/Editing the document, click File menu then Info menu.

Step 2: In the Info screen, navigate to Inspect Document section and select Inspect Document from Check for Issues dropdown.

Inspect Document in Word 2013

Step 3: Click the Inspect button in Document Inspector window.

Document Inspector in Word 2013

This would start inspecting your document.

image

Step 4: If your document contains Personal Information like Author then the following warning message will be displayed. Click Remove All button to clear the Document Properties and Author details.
Remove All Document Properties and Personal Information

You should see the following “Document properties and personal information were successfully removed” message.

image

Now if you navigate to Related People section in the Info screen, you will not find Author details.

image

And the same for the File Properties > Details tab as well (after saving the document with these changes).

image

 

Also See: Change the author name for Tracking Changes in Word 2010

Filed Under: MS Office, Word 2013, Word 2016 Tagged With: Document Inspector, File Properties, Remove Author, Word 2013

  • Go to page 1
  • Go to page 2
  • Go to Next Page »

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