Access to the path ‘Google.Apis.Auth’ is denied while using UploadAsync / Upload

Hello All,

Today, I’ll talk about an error that had troubled me for a while until I found out the solution for it. I was trying to upload a file to Google Drive from a client machine and it was throwing up the Access is denied error message. I had no clue what had gone wrong.

The application was working as expected on the development machine.

After a bit of reading the Official Drive API v3 documentation, there struck a clue to solve this problem.

The reason for this problem is that the user on whose workstation the application is used does not have rights/permissions to access the %appData% folder under roaming which corresponds to: (C:\Users\your-user-name\AppData\Roaming) or Run and type %appdata%.

There are three steps to solve this problem:

  1. Is to manually set your Google Authorization Broker details on load (or wherever apt)
  2. Set the relevant Administrator permission & folder level permissions
  3. Run the application as an Administrator

Manually Setting Google Authorization Broker Credentials

On your code, before it reaches the Upload / UploadAsync request call, add the below lines of code for setting up the token broker.

‘ Drive scopes which is initialized on the main method.
Dim scopes As IList(Of String) = New List(Of String)()

‘ Add the drive specific scope to the scopes list.
scopes.Add(DriveService.Scope.Drive)

Dim oCredential As UserCredential

Dim oClientSecrets As New ClientSecrets

oClientSecrets.ClientId = YOUR CLIENT ID HERE
oClientSecrets.ClientSecret = YOUR CLIENT SECRET HERE

oCredential = GoogleWebAuthorizationBroker.AuthorizeAsync(oClientSecrets _
, scopes _
, “LookIAmAUniqueUser” _
, CancellationToken.None).Result

TIP: There would be solutions available to download the client secret file from the Google Console into your project and providing the file location instead of using the oClientSecrets variable in the above code. But that did not work for me.

Once set and called in your application and after the Google account authentication, you will be seeing the token response file generated in your roaming as seen below:

tokenresponse.png

After you progress from this step, you will have to provide the below users the Administrator access

  1. The user on whose workstation, the application is being run
  2. IIS_WPG (for some users, this was required, and for some this was not required)
  3. IUSR_USER

Then you will have to provide the access to ‘Everyone’ on the Google.Apis.Auth folder in Roaming (%appdata%)

Lastly, you will have to run the application as an Administrator.

There are not many blogs or reads available on the web mentioning the solution for this problem. So, I thought to write this down for those who need it.

Your comments on the above blog are welcome.

-Cheers!!

How to upload the file to Google Drive and create a link to download in .Net

Hello All,

Today, I’ll talk about how to upload the file to Google Drive and generate a downloadable file link through .Net.

I am using VB.Net to do this. Create a console project or a windows form project in Visual Studio.

There is an important step to undertake, and that is to acquire the access of the Google Drive API through your Google Account. Below is the link that will guide you through the entire process of enabling the Drive UI API

How to Enable the Drive Platform

Make sure, that at the end you should have three details with you, which is required in the tutorial:

  1. Client ID
  2. Client Secret
  3. Project Name

GDRIVE.png

Next, make sure, you have the Google Drive API v3 with you if not, you can use Nuget to install the API for you.

Link: Nuget: Google Drive API V3

Through Package Manager Console: Install-Package Google.Apis.Drive.v3

Below is the list of MIME types, that can be used with Google Drive API. Please keep this handy for the rest of the tutorial:

File Type MIME
xls application/vnd.ms-excel
xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xml text/xml
ods application/vnd.oasis.opendocument.spreadsheet
csv text/plain
tmpl text/plain
pdf application/pdf
php application/x-httpd-php
jpg image/jpeg
png image/png
gif image/gif
bmp image/bmp
txt text/plain
doc application/msword
js text/js
swf application/x-shockwave-flash
mp3 audio/mpeg
zip application/zip
rar application/rar
tar application/tar
arj application/arj
cab application/cab
html text/html
htm text/html
default application/octet-stream
folder application/vnd.google-apps.folder

After you ensure, that the API V3 package is deployed correctly, write the below import statements.

Imports Google.Apis.Auth
Imports Google.Apis.Download
Imports Google.Apis.Drive.v3
Imports Google.Apis.Auth.OAuth2
Imports Google.Apis.Services
Imports System.Threading
Imports Google.Apis.Drive.v3.Data
Imports Google.Apis.Upload

Declare a Drive Service Variable

Private moService As DriveService = New DriveService

TIP: Always re-initialize the Drive Service variable, before you upload. It took me a while to realise this 🙂

Next, create a method by the name CreateService, which will hold your Google Drive Client IDs and connect to your Project Name. You can copy the contents as it is, and reply the place holders, with your Client ID, Client Secret and Project Names respectively.

Private Sub CreateService()

Dim ClientId = “YOUR CLIENT ID HERE”
Dim ClientSecret = “YOUR CLIENT SECRET HERE”

Dim MyUserCredential As UserCredential = GoogleWebAuthorizationBroker.AuthorizeAsync(New ClientSecrets() With {.ClientId = ClientId, .ClientSecret = ClientSecret}, {DriveService.Scope.Drive}, “user”, CancellationToken.None).Result
moService = New DriveService(New BaseClientService.Initializer() With {.HttpClientInitializer = MyUserCredential, .ApplicationName = “YOUR PROJECT NAME HERE”})

End Sub

Next, we will be using a PDF file to upload into the drive, you can copy the below snippet into a method or a function, as you feel appropriate.

‘ Checking if the Service is still alive, if not create the service again.
If moService.ApplicationName <> “YOUR PROJECT NAME” Then CreateService()

Dim oGDriveFile As New File()

oGDriveFile.Name =  “” ‘ Set your File Name here.
oGDriveFile.Description =  “” ‘ Set a meaningful description, I had set the same name as my project name
oGDriveFile.MimeType = “application/pdf” ‘ You must set your MIME type carefully. Refer to the MIME table above

Dim bArrByteArray As Byte() = System.IO.File.ReadAllBytes(“”) ‘ Your File Path from where you would want to upload from.
Dim oStream As New System.IO.MemoryStream(bArrByteArray)

Dim oUploadRequest As FilesResource.CreateMediaUpload

oUploadRequest = moService.Files.Create(oGDriveFile, oStream, oGDriveFile.MimeType)

oUploadRequest.Fields = “id”
oUploadRequest.Alt = FilesResource.CreateMediaUpload.AltEnum.Json

oUploadRequest.Upload() ‘ <- The file upload happens here.

Dim oFile As File = oUploadRequest.ResponseBody

‘ Setting this permission will allow anyone having the link to directly download the file.
‘ Google Drive, will not show any login page to the user, while attempting to download the file.
‘ The below two blocks are imperative.
Dim permission As New Google.Apis.Drive.v3.Data.Permission()
permission.Type = “anyone”
permission.Role = “reader”
permission.AllowFileDiscovery = True

Dim request As PermissionsResource.CreateRequest = moService.Permissions.Create(permission, oFile.Id)
request.Fields = “id”
request.Execute()

If Not IsNothing(oFile) Then

sViewLink = ” https://drive.google.com/uc?id=&#8221; & oFile.Id  ‘ This is the link, that will be used to download the file.

Else
Cursor.Current = Cursors.Default
MessageBox.Show(“Unable to contact Google Drive. Check your Connection.”, “Title”, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
Exit Sub
End If

And, that is it, your file is supposed to be uploaded to Google Drive, and a link will be available for any one to download. You can restrict the download of the file, by providing the emailaddress property of the file in the permission object. It seems to work only for the Google Email IDs only.

So, if you have any concerns or doubts on this tutorial, don’t hesitate to contact me through eMail or by posting a comment on this blog.

You can download the test file, using the below link.

DOWNLOAD THE TEST FILE HERE
Read More »

Error while choosing the input controls in SAP BO WebI

Hello All,

Today, we’ll talk about an error message you might get when you access the input controls for filtering your WebI reports for a newly created user or existing user. Below is the screen shot of the error message.

763905

For a new or existing user, ensure that the user has all the desired access to Connection, Universe and the Folder of the WebI report. Unless the user has the access to the above entities it is not possible for them to get to a point where they can access the WebI report and extract data from it.

So, after the access to the above entities are set, open the CMC and go to Applications section (CMC > Application). In the list select Web Intelligence (CMC > Application > Web Intelligence).

From the User Security window, select User Security tab and click Add Principals.

CMCWebi

It is in the Add Principals window, that the desired user is given the access to add.I had provided the access as Full Control, View On Demand, Schedule and View.

I hope, this solves your problem.

-Cheers!

 

 

Adding SOAP Header to ASP.Net Web Service

Hello All,

In todays age of technology, where data-interchange between systems is imminent. In some cases, it is the application interacting with each other or in some cases it will be the web services interacting with each other.

So, today, we will talk about how to add a SOAP header to your Web Service Call. i.e. if you are trying to call a web service, from your web service and you need to pass a SOAP header to each request you send to that service.

Commonly, web service access credentials are passed along with the service request.

This article assumes, you have a knowledge of:

  1. .Net
  2. Web Services
  3. What is SOAP
  4. How to create a ASP .Net Web Service Project in Visual Studio.

Visual Studio IDE:

  1. Visual Studio 2013

So, lets get started:

Firstly, after your .Net Web Service project is created, right click on the Project name and click Add >> Service Reference

Untitled.png

After you have added the service reference. A pop-up would appear as shown below:

test.png

Enter the Web Service URL that you need to connect to and click Go, to check the connectivity. If successfully connected, then enter the Namespace. In my case, the namespace is ‘ServiceReference’, and then click Ok.

Servicerefernece.png

The service reference will show up under Service References section as shown below:

solution.png

Now, lets open the Web.Config file and edit few things there. As you may see in the screen grab below, a new tag is added into the Web.Config by name name system.serviceModel. It is here that your web service bindings and endpoint details are mentioned.

webconfgig.png

Notice the endpoint tag is closing in-line. Which means, it does not have a separate closing tag

Now, remove the inline closing tag for Endpoint and add a separate closing tag for Endpoint as

webconfgig.png

After you do that, add the below tags in the endpoint tag as shown below:

Webconfig2.png

Now, the headers will be attached with each of your SOAP request.

I hope, this blog helps you with your problem.

-Cheers!

 

 

 

Unable to find a specification for ‘ObjectiveDropboxOfficial’ while pod install

Hello All!

Today, we’ll talk about an error which you will face, while using the DropBox V2 API with Objective-C SDK in XCode.

You can configure the DropBox V2 API, by following the steps in the official GitHub repository of DropBox at https://github.com/dropbox/dropbox-sdk-obj-c.

However, while following the instructions to configure it to your XCode project, you will run into an issue while following to integrate the Dropbox Objective-C SDK into your project using CocoaPods.

It is while running the command pod install after you update the pod file with the below information:

platform :ios, '8.0'
use_frameworks!

target '' do
    pod 'ObjectiveDropboxOfficial'
end

The error that you will face in the terminal is:

: $ pod install

Analyzing dependencies

[!] Unable to find a specification for `ObjectiveDropboxOfficial`

There is a workaround for this, all you need to do is run the following command:

pod repo update

I had run this command in my project directory.

It will take a while (it took a good 30 Mins for me to get my pods updated-so please be patient), for the pod to get updated.

After which run the below command to configure the DropBox SDK to your project. Please make sure that your project is not opened in the XCode.

Below are the statuses while configuring the SDK. It wont take much time to configure the SDK to your project.

Analyzing dependencies

Downloading dependencies

Installing ObjectiveDropboxOfficial (3.0.4)

Generating Pods project

Integrating client project

Once the project is configured, please use xcworkspace file to open the project.

I hope, it works for you all.

Please comment, if necessary.

-Cheers!

Error while installing Cocoapod or any Ruby Gem into OS X El Capitan or Sierra Errno::EPERM

Hello All,

Today, we’ll talk about an error you would be facing while installing a Ruby Gem into your OS X El Capitan or OS X Sierra.

ERROR:  While executing gem … (Errno::EPERM)

This is due to a fact that with OS X El Capitan and Sierra, there is a new security feature called called System Integrity Protection

Well, as I always say, there is always a workaround for your problems. And here is the one for this.

Open your Terminal, and type the below command into your terminal.

sudo gem install -n /usr/local/bin GEM_NAME_HERE

So, if you are going to install Cocoapods then type this command:

sudo gem install -n /usr/local/bin cocoapods

After few seconds, the pod should start installing into your OS X.

-Cheers!

 

 

 

How to print a Barcode to a shared / network Barcode Printer using .Net (System.Drawing.Printing.PrintDocument)

Hello All!

Today I’ll talk about how you can print a Barcode or a generic text to a Printer or a Barcode Label Printer.

This blog post will cover the following topics. You can choose your familiarity and proceed to the topic you wish to know.

  1. How to install a Barcode Printer
  2. How to share the Printer
  3. Printing Barcode to a Network Printer

You don’t need to spend on getting a Print Server or a Network Card enabled Barcode Label Printer (which few companies would try selling you) to bring the Barcode Label Printer into the Network. 

Follow these steps to make it all work! Ensure that you have connected a printer to your computer and you are able to run a Test Print out of it. You can name the printer whatever name you wish to name it as. This is the most essential part to get it all working.

If you do not know how to install a Barcode Label Printer in your workstation, please follow the below steps: ( I am installing the Barcode Label Printer with a Generic Text Driver)

STEPS TO INSTALL A BARCODE PRINTER

  1. Go to ControlPanel in your computer and click ‘Add a printer’

Addprinter.png

2. In the Add Printer Modal window, click ‘The printer that I want isn’t listed’ link. It will open up another modal window allowing you to choose the mode you want to add the printer.

addprinter2.png

 

3. In this window, choose ‘Add a local printer or network printer with manual settings’ option and click Next

addprinter3.png

4. In the next window, choose the port you have your printer connected. Mine is connected to USB port, so I am selected USB001 port.

TIP: If you see multiple USB ports in the list (which is normal), try to change the ports in the list and see if you are able to run a test print through that. I had faced similar problems in the past.

addprinter4.png

5. I always print barcodes using the Generic Text drivers (if you wish you change, you can according to your need), so in the below screenshot, I am selecting the Manufacturer as Generic and the Printers as Generic / Text Only. Click Next.

addprinter5.png

6. Select ‘Use the driver that is currently installed (recommended)’ Click Next

addprinter6.png

7. Name the printer as BAR or whatever name you wish to name the printer as and click Next.

addprinter7.png

8. In the below modal popup, if you wish to share the printer, click appropriately and give a proper Share Name. or click Do no share this printer and click Next.

addprinter8.png

9. You will receive a successful confirmation of your new printer being added into your printer list. If you wish to make it a default printer, you can check appropriately and click Finish.

addprinter9.png

HOW TO SHARE THE PRINTER

If you have selected to share the printer in the step 8 (above), then your printer is already shared and ready to use.

If not, then please follow the below steps to share the printer.

1. In the printers list, right click on the Barcode Label printer and click Printer Properties menu item.

Sharing1.png

2. This will open up the printers properties popup. Go to the Sharing tab and check the Share this printer checkbox and give it a share name. I usually provide the same name as the printer name to avoid any confusion. And click Ok.

Sharing2.png

That is it. Your printer is shared across the network.

Like I said, You don’t need to spend on getting a Print Server or a Network Card enabled Barcode Label Printer to bring the Barcode Label Printer into the Network. 

PRINTING BARCODE THROUGH THE NETWORK PRINTER

Firstly, you will have to list down the installed printers in the machine that the program is executed. Below is the code, that lists down the installed printers and shows it in a ListBox.

For Each strPrinterName As String In PrinterSettings.InstalledPrinters
ListBox_PrinterList.Items.Add(strPrinterName) ‘ Adding the installed printers.
Next

‘Find the Default printer
Dim PD As New PrintDocument
ListBox_PrinterList.SelectedItem = PD.DefaultPageSettings.PrinterSettings.PrinterName

Next, add the code to print to the printer

Public Sub prt(ByVal text As String, ByVal asPrinterName As String)
TextToBePrinted = text
Dim prn As New Printing.PrintDocument
Using (prn)
prn.PrinterSettings.PrinterName = asPrinterName
AddHandler prn.PrintPage, AddressOf Me.PrintPageHandler
prn.Print()
RemoveHandler prn.PrintPage, AddressOf Me.PrintPageHandler
End Using
End Sub

Private Sub PrintPageHandler(ByVal sender As Object, ByVal args As Printing.PrintPageEventArgs)
Dim myFont As New Font(“Microsoft San Serif”, 10)
args.Graphics.DrawString(TextToBePrinted, New Font(myFont, FontStyle.Regular), Brushes.Black, 0, 0)
End Sub

In the above code, the asPrinterName argument holds the name of the selected printer. Argument text holds the text/barcode to be printed.

You should be testing it by now!

One Important thing to note:

Barcode Label Printers have their own programming language to send the barcode text to the Barcode Label Printer to print. I am using Zebra printers which enables us to use ZPL or EPL languages to send the barcode to the Zebra Barcode Label Printers.

-Cheers!

Rohant K.

List of Fonts available in iOS (9.3.4)

Hello There,

Today, i’ll be talking about the list of fonts in iOS (9.3.4):

You can set the Font by using this code:

[UIFont fontWithName:@”SFUIText-Regular” size:17.0]

Family name: Copperplate

Font name: Copperplate-Light

Font name: Copperplate

Font name: Copperplate-Bold

Family name: Heiti SC

Family name: Iowan Old Style

Font name: IowanOldStyle-Italic

Font name: IowanOldStyle-Roman

Font name: IowanOldStyle-BoldItalic

Font name: IowanOldStyle-Bold

Family name: Kohinoor Telugu

Font name: KohinoorTelugu-Regular

Font name: KohinoorTelugu-Medium

Font name: KohinoorTelugu-Light

Family name: SF UI Text

Font name: SFUIText-Regular

Family name: Heiti TC

Family name: Courier New

Font name: CourierNewPS-BoldMT

Font name: CourierNewPS-ItalicMT

Font name: CourierNewPSMT

Font name: CourierNewPS-BoldItalicMT

Family name: Gill Sans

Font name: GillSans-Italic

Font name: GillSans-Bold

Font name: GillSans-BoldItalic

Font name: GillSans-LightItalic

Font name: GillSans

Font name: GillSans-Light

Font name: GillSans-SemiBold

Font name: GillSans-SemiBoldItalic

Font name: GillSans-UltraBold

Family name: Apple SD Gothic Neo

Font name: AppleSDGothicNeo-Bold

Font name: AppleSDGothicNeo-Thin

Font name: AppleSDGothicNeo-UltraLight

Font name: AppleSDGothicNeo-Regular

Font name: AppleSDGothicNeo-Light

Font name: AppleSDGothicNeo-Medium

Font name: AppleSDGothicNeo-SemiBold

Family name: Marker Felt

Font name: MarkerFelt-Thin

Font name: MarkerFelt-Wide

Family name: Thonburi

Font name: Thonburi

Font name: Thonburi-Bold

Font name: Thonburi-Light

Family name: Avenir Next Condensed

Font name: AvenirNextCondensed-BoldItalic

Font name: AvenirNextCondensed-Heavy

Font name: AvenirNextCondensed-Medium

Font name: AvenirNextCondensed-Regular

Font name: AvenirNextCondensed-HeavyItalic

Font name: AvenirNextCondensed-MediumItalic

Font name: AvenirNextCondensed-Italic

Font name: AvenirNextCondensed-UltraLightItalic

Font name: AvenirNextCondensed-UltraLight

Font name: AvenirNextCondensed-DemiBold

Font name: AvenirNextCondensed-Bold

Font name: AvenirNextCondensed-DemiBoldItalic

Family name: Tamil Sangam MN

Font name: TamilSangamMN

Font name: TamilSangamMN-Bold

Family name: Helvetica Neue

Font name: HelveticaNeue-Italic

Font name: HelveticaNeue-Bold

Font name: HelveticaNeue-UltraLight

Font name: HelveticaNeue-CondensedBlack

Font name: HelveticaNeue-BoldItalic

Font name: HelveticaNeue-CondensedBold

Font name: HelveticaNeue-Medium

Font name: HelveticaNeue-Light

Font name: HelveticaNeue-Thin

Font name: HelveticaNeue-ThinItalic

Font name: HelveticaNeue-LightItalic

Font name: HelveticaNeue-UltraLightItalic

Font name: HelveticaNeue-MediumItalic

Font name: HelveticaNeue

Family name: Gurmukhi MN

Font name: GurmukhiMN-Bold

Font name: GurmukhiMN

Family name: Times New Roman

Font name: TimesNewRomanPSMT

Font name: TimesNewRomanPS-BoldItalicMT

Font name: TimesNewRomanPS-ItalicMT

Font name: TimesNewRomanPS-BoldMT

Family name: Georgia

Font name: Georgia-BoldItalic

Font name: Georgia

Font name: Georgia-Italic

Font name: Georgia-Bold

Family name: Apple Color Emoji

Font name: AppleColorEmoji

Family name: Arial Rounded MT Bold

Font name: ArialRoundedMTBold

Family name: Kailasa

Font name: Kailasa-Bold

Font name: Kailasa

Family name: Kohinoor Devanagari

Font name: KohinoorDevanagari-Light

Font name: KohinoorDevanagari-Regular

Font name: KohinoorDevanagari-Semibold

Family name: Kohinoor Bangla

Font name: KohinoorBangla-Semibold

Font name: KohinoorBangla-Regular

Font name: KohinoorBangla-Light

Family name: Chalkboard SE

Font name: ChalkboardSE-Bold

Font name: ChalkboardSE-Light

Font name: ChalkboardSE-Regular

Family name: Sinhala Sangam MN

Font name: SinhalaSangamMN-Bold

Font name: SinhalaSangamMN

Family name: PingFang TC

Font name: PingFangTC-Medium

Font name: PingFangTC-Regular

Font name: PingFangTC-Light

Font name: PingFangTC-Ultralight

Font name: PingFangTC-Semibold

Font name: PingFangTC-Thin

Family name: Gujarati Sangam MN

Font name: GujaratiSangamMN-Bold

Font name: GujaratiSangamMN

Family name: Damascus

Font name: DamascusLight

Font name: DamascusBold

Font name: DamascusSemiBold

Font name: DamascusMedium

Font name: Damascus

Family name: Noteworthy

Font name: Noteworthy-Light

Font name: Noteworthy-Bold

Family name: Geeza Pro

Font name: GeezaPro

Font name: GeezaPro-Bold

Family name: Avenir

Font name: Avenir-Medium

Font name: Avenir-HeavyOblique

Font name: Avenir-Book

Font name: Avenir-Light

Font name: Avenir-Roman

Font name: Avenir-BookOblique

Font name: Avenir-Black

Font name: Avenir-MediumOblique

Font name: Avenir-BlackOblique

Font name: Avenir-Heavy

Font name: Avenir-LightOblique

Font name: Avenir-Oblique

Family name: Academy Engraved LET

Font name: AcademyEngravedLetPlain

Family name: Mishafi

Font name: DiwanMishafi

Family name: Futura

Font name: Futura-CondensedMedium

Font name: Futura-CondensedExtraBold

Font name: Futura-Medium

Font name: Futura-MediumItalic

Family name: Farah

Font name: Farah

Family name: Kannada Sangam MN

Font name: KannadaSangamMN

Font name: KannadaSangamMN-Bold

Family name: Arial Hebrew

Font name: ArialHebrew-Bold

Font name: ArialHebrew-Light

Font name: ArialHebrew

Family name: Arial

Font name: ArialMT

Font name: Arial-BoldItalicMT

Font name: Arial-BoldMT

Font name: Arial-ItalicMT

Family name: Party LET

Font name: PartyLetPlain

Family name: Chalkduster

Font name: Chalkduster

Family name: Hoefler Text

Font name: HoeflerText-Italic

Font name: HoeflerText-Regular

Font name: HoeflerText-Black

Font name: HoeflerText-BlackItalic

Family name: Optima

Font name: Optima-Regular

Font name: Optima-ExtraBlack

Font name: Optima-BoldItalic

Font name: Optima-Italic

Font name: Optima-Bold

Family name: Palatino

Font name: Palatino-Bold

Font name: Palatino-Roman

Font name: Palatino-BoldItalic

Font name: Palatino-Italic

Family name: Malayalam Sangam MN

Font name: MalayalamSangamMN-Bold

Font name: MalayalamSangamMN

Family name: Al Nile

Font name: AlNile-Bold

Font name: AlNile

Family name: Lao Sangam MN

Font name: LaoSangamMN

Family name: Bradley Hand

Font name: BradleyHandITCTT-Bold

Family name: PingFang HK

Font name: PingFangHK-Ultralight

Font name: PingFangHK-Semibold

Font name: PingFangHK-Thin

Font name: PingFangHK-Light

Font name: PingFangHK-Regular

Font name: PingFangHK-Medium

Family name: Trebuchet MS

Font name: Trebuchet-BoldItalic

Font name: TrebuchetMS

Font name: TrebuchetMS-Bold

Font name: TrebuchetMS-Italic

Family name: Helvetica

Font name: Helvetica-Bold

Font name: Helvetica

Font name: Helvetica-LightOblique

Font name: Helvetica-Oblique

Font name: Helvetica-BoldOblique

Font name: Helvetica-Light

Family name: Courier

Font name: Courier-BoldOblique

Font name: Courier

Font name: Courier-Bold

Font name: Courier-Oblique

Family name: Cochin

Font name: Cochin-Bold

Font name: Cochin

Font name: Cochin-Italic

Font name: Cochin-BoldItalic

Family name: Hiragino Mincho ProN

Font name: HiraMinProN-W6

Font name: HiraMinProN-W3

Family name: Devanagari Sangam MN

Font name: DevanagariSangamMN

Font name: DevanagariSangamMN-Bold

Family name: Oriya Sangam MN

Font name: OriyaSangamMN

Font name: OriyaSangamMN-Bold

Family name: Snell Roundhand

Font name: SnellRoundhand-Bold

Font name: SnellRoundhand

Font name: SnellRoundhand-Black

Family name: Zapf Dingbats

Font name: ZapfDingbatsITC

Family name: Bodoni 72

Font name: BodoniSvtyTwoITCTT-Bold

Font name: BodoniSvtyTwoITCTT-Book

Font name: BodoniSvtyTwoITCTT-BookIta

Family name: Verdana

Font name: Verdana-Italic

Font name: Verdana-BoldItalic

Font name: Verdana

Font name: Verdana-Bold

Family name: American Typewriter

Font name: AmericanTypewriter-CondensedLight

Font name: AmericanTypewriter

Font name: AmericanTypewriter-CondensedBold

Font name: AmericanTypewriter-Light

Font name: AmericanTypewriter-Bold

Font name: AmericanTypewriter-Condensed

Family name: Avenir Next

Font name: AvenirNext-UltraLight

Font name: AvenirNext-UltraLightItalic

Font name: AvenirNext-Bold

Font name: AvenirNext-BoldItalic

Font name: AvenirNext-DemiBold

Font name: AvenirNext-DemiBoldItalic

Font name: AvenirNext-Medium

Font name: AvenirNext-HeavyItalic

Font name: AvenirNext-Heavy

Font name: AvenirNext-Italic

Font name: AvenirNext-Regular

Font name: AvenirNext-MediumItalic

Family name: Baskerville

Font name: Baskerville-Italic

Font name: Baskerville-SemiBold

Font name: Baskerville-BoldItalic

Font name: Baskerville-SemiBoldItalic

Font name: Baskerville-Bold

Font name: Baskerville

Family name: Khmer Sangam MN

Font name: KhmerSangamMN

Family name: Didot

Font name: Didot-Italic

Font name: Didot-Bold

Font name: Didot

Family name: Savoye LET

Font name: SavoyeLetPlain

Family name: Bodoni Ornaments

Font name: BodoniOrnamentsITCTT

Family name: Symbol

Font name: Symbol

Family name: Menlo

Font name: Menlo-Italic

Font name: Menlo-Bold

Font name: Menlo-Regular

Font name: Menlo-BoldItalic

Family name: Bodoni 72 Smallcaps

Font name: BodoniSvtyTwoSCITCTT-Book

Family name: SF UI Display

Font name: SFUIDisplay-Regular

Family name: Papyrus

Font name: Papyrus

Font name: Papyrus-Condensed

Family name: Hiragino Sans

Font name: HiraginoSans-W3

Font name: HiraginoSans-W6

Family name: PingFang SC

Font name: PingFangSC-Ultralight

Font name: PingFangSC-Regular

Font name: PingFangSC-Semibold

Font name: PingFangSC-Thin

Font name: PingFangSC-Light

Font name: PingFangSC-Medium

Family name: Euphemia UCAS

Font name: EuphemiaUCAS-Italic

Font name: EuphemiaUCAS

Font name: EuphemiaUCAS-Bold

Family name: Telugu Sangam MN

Family name: Bangla Sangam MN

Family name: Zapfino

Font name: Zapfino

Family name: Bodoni 72 Oldstyle

Font name: BodoniSvtyTwoOSITCTT-Book

Font name: BodoniSvtyTwoOSITCTT-Bold

Font name: BodoniSvtyTwoOSITCTT-BookIt

Cheers!!

Rohant K

Set Landscape or Portrait Orientation for a Single View Controller (Objective-C)

Hello All,

Today, I’ll talk to you all about setting only a single View Controller in a StoryBoard (with NavigationController) to either Portrait or Landscape Orientation.

So lets get started!

Firstly set the Device Orientation property of the project to allow Portrait.. Landscape Left and Landscape Right orientations.

Screen Shot 2016-07-24 at 5.14.15 PM.png

Next we point our attention to AppDelegate.m class of your project.

Copy the below snippet into your AppDelegate.m file. The below snippet will return the top ViewController in the UI Stack of the RootViewController

 

– (UIViewController *)topViewController{

return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController];

}

– (UIViewController *)topViewController:(UIViewController *)rootViewController

{

if (rootViewController.presentedViewController == nil) {

return rootViewController;

}

if ([rootViewController.presentedViewController isMemberOfClass:[UINavigationController class]]) {

UINavigationController *navigationController = (UINavigationController *)rootViewController.presentedViewController;

UIViewController *lastViewController = [[navigationController viewControllers] lastObject];

return [self topViewController:lastViewController];

}

UIViewController *presentedViewController = (UIViewController *)rootViewController.presentedViewController;

return [self topViewController:presentedViewController];

}

Now add the below snippet in the AppDelegate file. This snippet will check the the current top View Controller in the RootViewController by its title.

And according to its title, will decide, what would be the Orientation of the View Controller.

In the below snippet, I have set the orientation to Landscape with a specific title and for the rest, I have set the orientation to Portrait.

A bit of a workaround, but it works for me.

– (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window

{

if ([[self topViewController].title isEqualToString: @”Enter your view controller title”])

{

return UIInterfaceOrientationMaskLandscape;

}

else return UIInterfaceOrientationMaskPortrait;

}

One More Thing!

Now lets point our focus towards the Storyboard. The above snippet / code will work only if you present your “Landscape” view controller Modally.

So, in order to set the “Kind” property in the Segue to “Present Modally”. Screen Shot 2016-07-24 at 5.30.39 PM.png

Also, it would be better if you change the orientation of the View Controller to Landscape by changing the “Orientation” property to Landscape!

Screen Shot 2016-07-24 at 5.32.27 PM.png

I hope it helps!

Do comment your opinions!

Cheers!!

Rohant K!

‘global_asax’ is ambiguos in the namespace ‘ASP’

Hello All!

Today, I’ll talk about an error message, that I had encountered while compiling my ASP.Net Web Application, which nearly, compelled me to create a new Project Solution and transfer my project files into that Solution – Old School way of getting things to work 🙂

The Global.asax, Project Classes and Web Service references were all showing the error for ambiguity.

Error.png

After struggling for 3-4 days to get my Project Solution working, I arrived at a solution.

You’ll have to delete these files from the Bin folder and then build the solution again.

files.png

I hope it works for you’ll too!

Cheers!

Rohant K3