(Windows) AndroidStudio does not recognize ASUS Zenfone 6


If your Asus Zenfone 6 is not being recognized by AndroidStudio, try the following steps:

1. Fetch the drivers from here (select ‘Android’ and then expand ‘USB’).

2. Extract the zip file.

3. Connect your phone to the PC.

4. Go to Device Manager. Find your device (should be under ‘Other Devices’ as ADB device).

5. Right click on the device and click install (or update) driver.

6. Browse to the location where you unzipped the downloaded drivers. Choose the appropriate folder and proceed with installation.

7. Once the installation is done, you will see your device as ‘ASUS Android Composite ADB Interface’ under ASUS Android Device.

8. You will see a confirmation popup on your phone. Accept it.

Now AndroidStudio should recognize your phone.

PowerShell Daily Dose: Get-Process


Get-Process cmdlet gets all the currently running processes on your machine. If you want to see the instances of a particular application, then you can specify the application name.

This gets you all the processes:

Get-Process

This gets you all the instances of Google Chrome web browser:

Get-Process Chrome

And the output will be like this:

Handles  NPM(K)  PM(K)   WS(K)  VM(M)    CPU(s)  Id       ProcessName
-------  ------  -----   -----  -----    ------  --        -----------
 142        19   27828   34220   206     1.05     2544   chrome
 142        19   28268   33976   217     1.33     2924   chrome

You can also use wildcards in application name. For example, if you want to see all the processes that have “sql” in their names, then you can do this:

PS C:\Learn> get-process *sql*

Handles NPM(K) PM(K)  WS(K)  VM(M) CPU(s) Id ProcessName
------- ------ -----  -----  ----- ------ -- -----------
 288     41     19152   5880 512    1.20 5668 SQLAGENT
 473     30     14572  11448 103    2.31 4232 sqlbrowser
 749    178    513208 322264 143   13.28 3028 sqlservr
  91      9      3408   7596  41    0.16 4260 sqlwriter

You can also specify other parameters like process id, handle etc.

For more information on syntax and usage, please refer to the documentation here.

Trivial Tip: Visual Studio – How to easily insert a carriage return in a resource (.resx) file string?


There are many ways to insert a carriage return (new line feed) in a resource string in a resx file but this is the simplest in my opinion.

Just open up the resx file in Visual Studio, edit the string content that you want carriage returns in, and just do a ‘SHIFT’ + ‘ENTER’ everywhere you need a carriage return. Yup, that simple.

For example, if you need

Hi
There!

Just type “Hi”, followed by SHIFT + ENTER and then “There!”.

PowerShell Daily Dose: Get-Content


Get-Content gets the contents of the specified file. A simple usage example:

PS C:\test> Get-Content ps.txt
some random
text for
testing powershell
get-content cmdlet...

Note that you don’t have to type the whole cmdlet; you can use one of the aliases of this cmdlet: cat, gc or type.

This command returns a collection of objects. Each object represents a line of content in the file. You will start realizing the potential of this command as you learn more commands. For example, you can pipe the output of this command to a looping command like ForEach-Object.

There are several different options that you can pass on to the command. For example you can specify the number of lines to read, pass credentials to use, filter strings, include and exclude strings and many more. For more detailed info please check the get-content help page.

PowerShell Daily Dose: Get-Command


Get-Command helps you find/search for cmdlets. Simply typing in ‘Get-Command’ will give you a list of all available commands, which probably is not very useful. But if I want to, say, find all commands that contain ‘file’ in them, I can do this:

Get-Command -Name *file*

and the output will be something like this:

CommandType  Name                             ModuleName
-----------  ----                             ----------
Cmdlet       Add-BitsFile BitsTransfer
Cmdlet       Get-AppLockerFileInformation     AppLocker
Cmdlet       Get-WebConfigFile                WebAdministration
Cmdlet       Get-WebFilePath                  WebAdministration
Cmdlet       New-PSSessionConfigurationFile   Microsoft.PowerShell.Core
Cmdlet       Out-File                         Microsoft.PowerShell.Utility
Cmdlet       Test-PSSessionConfigurationFile  Microsoft.PowerShell.Core
Cmdlet       Unblock-File                     Microsoft.PowerShell.Utility
Application  DataProfileViewer.exe
Application  forfiles.exe
Application  openfiles.exe
Application  PROFILER.EXE

So we have a lot of commands from different modules. To just get cmdlets that contain ‘file’ from the module say ‘Microsoft.PowerShell.Core’, I can do this:

Get-Command -Module Microsoft.PowerShell.Core -Name *file*

And the output will be something like this:

CommandType  Name                            ModuleName
-----------  ----                            ----------
Cmdlet       New-PSSessionConfigurationFile  Microsoft.PowerShell.Core
Cmdlet       Test-PSSessionConfigurationFile Microsoft.PowerShell.Core

PowerShell Daily Dose: Get-Help


Today I have started really learning PowerShell which is notorious for its steep learning curve. After learning a few commands in depth I decided it was better if I documented my learning as a ‘one command a day’ feature. So here it goes…

(This is not a PowerShell tutorial, so I am not going to explain what a cmdlet is nor am I going to venture deep into explaining any specific term :).)
Today’s cmdlet:

Get-Help

This is the first cmdlet that everyone should probably learn. As the name suggests, this cmdlet gets you information about any Powershell command (including itself :)). The usage is ‘Get-Help <command>’.

For example, if you type “Get-Help Get-Help”, this is the output you see in PowerShell:

NAME
 Get-Help
SYNTAX
 Get-Help [[-Name] <string>] [-Path <string>] [-Category <string[]> {Alias | Cmdlet | Provider | General | FAQ | Glossary | HelpFile | ScriptCommand | Function | Filter | ExternalScript |
 All | DefaultHelp | Workflow}] [-Component <string[]>] [-Functionality <string[]>] [-Role <string[]>] [-Full] [<CommonParameters>]
Get-Help [[-Name] <string>] -Detailed [-Path <string>] [-Category <string[]> {Alias | Cmdlet | Provider | General | FAQ | Glossary | HelpFile | ScriptCommand | Function | Filter |
 ExternalScript | All | DefaultHelp | Workflow}] [-Component <string[]>] [-Functionality <string[]>] [-Role <string[]>] [<CommonParameters>]
Get-Help [[-Name] <string>] -Examples [-Path <string>] [-Category <string[]> {Alias | Cmdlet | Provider | General | FAQ | Glossary | HelpFile | ScriptCommand | Function | Filter |
 ExternalScript | All | DefaultHelp | Workflow}] [-Component <string[]>] [-Functionality <string[]>] [-Role <string[]>] [<CommonParameters>]
Get-Help [[-Name] <string>] -Parameter <string> [-Path <string>] [-Category <string[]> {Alias | Cmdlet | Provider | General | FAQ | Glossary | HelpFile | ScriptCommand | Function |
 Filter | ExternalScript | All | DefaultHelp | Workflow}] [-Component <string[]>] [-Functionality <string[]>] [-Role <string[]>] [<CommonParameters>]
Get-Help [[-Name] <string>] -Online [-Path <string>] [-Category <string[]> {Alias | Cmdlet | Provider | General | FAQ | Glossary | HelpFile | ScriptCommand | Function | Filter |
 ExternalScript | All | DefaultHelp | Workflow}] [-Component <string[]>] [-Functionality <string[]>] [-Role <string[]>] [<CommonParameters>]
Get-Help [[-Name] <string>] -ShowWindow [-Path <string>] [-Category <string[]> {Alias | Cmdlet | Provider | General | FAQ | Glossary | HelpFile | ScriptCommand | Function | Filter |
 ExternalScript | All | DefaultHelp | Workflow}] [-Component <string[]>] [-Functionality <string[]>] [-Role <string[]>] [<CommonParameters>]
ALIASES
 None
REMARKS
 Get-Help cannot find the Help files for this cmdlet on this computer. It is displaying only partial help.
 -- To download and install Help files for the module that includes this cmdlet, use Update-Help.
 -- To view the Help topic for this cmdlet online, type: "Get-Help Get-Help -Online" or
 go to http://go.microsoft.com/fwlink/?LinkID=113316.

This cmdlet can also be used with wildcard-ed nouns and verbs. For example, if you would like to see all the ‘Get’ cmdlets, you would use something like:

Get-Help -Name Get-*

That results in an output like this:

Name Category Module Synopsis
---- -------- ------ --------
Get-Verb Function
Get-Command Cmdlet Microsoft.PowerShell.Core ...
Get-Module Cmdlet Microsoft.PowerShell.Core ...
Get-Help Cmdlet Microsoft.PowerShell.Core ...

So that’s the Get-Help cmdlet.

Android Adventures


I am a Microsoft fan boy, more or less… I like their products, want their products to succeed, and use their products as much as I can. At least I used to. Then my mind wandered over to Android. I love it! I first started playing with my wife’s Samsung phone with GB. I wrote a couple of small apps for that phone and started messing around. Then I got hooked. I was using a really nice Nokia Lumia 900 at that time but decided to venture into Android world, so got myself a Samsung Galaxy Note. That has got to be the best phone I have ever seen/used in my life (then came Note 2, which is probably even better but I digress). And I have used a lot of different phones (Nokias, Blackberrys, an iPhone, a couple of Windows Phones). The level of customizations you could do was in itself a big plus for me.

I decided to take the next big step, a VERY risky one at that. Rooting and flashing ROMs. I was a bit nervous in the beginning because you can brick your phone. I gathered up some courage and finally did it last month. And it has been loads of fun since then…

I started off with Padawan v8, an ICS custom rom. It has a ton of very nice features, and of course no bloatware. It was pretty fast, no crashes or reboots. All in all a very good rom. I ran it for a couple of weeks, and then decided to move on to Jelly Bean.

Jelly Bean is a bit different because, unlike ICS, there is no stock rom for Note. So you have to work with unofficial JB builds. I tried a couple of different versions but finally decided to stick with CM 10.1 kang build by flappjaxxx (rom CM 10.1-20130225-FJKang-quincyatt). It is really beautiful, smooth and fast. This rom doesn’t have the S-Pen apps (since there is no stock JB rom yet), but the rest is so good, I can live without that stuff. I highly recommend this rom.

Even though my current rom is awesome, I am already searching for the next rom to flash :). This stuff is that addictive :).

If you are interested in custom roms I suggest you head over to xda developer forums. It has a lot of info. But I suggest you don’t take this lightly, because if something goes wrong with rooting or flashing your phone, you might be left with a bricked phone.

Upgrading Xcode in OS X Lion – My MBPro Experience


Ok, I can say that I am a reasonable person and I usually don’t get frustrated at small goof ups by gazillion dollar companies. But this thing really pissed me off.
I forked over 30 bucks for OS X Lion for my 2010 MacBook Pro. The upgrade was relatively issue free and was a success. Then I tried to fire up Xcode. It said I needed to upgrade it to a newer version released for Lion.
Fine, Let’s do it, I thought.
I went to the App store on my mbp and navigated to the Xcode page. Clicked Install. A spinning wheel appeared. It stayed on for a while and then disappeared. And that was it. Nothing else happened. Tried the same thing over and over. Nothing else happened!
Went over the internet, searched all the forums, found that a lot of people had similar issues but couldn’t find a fix.
Then one day, while looking for something, opened Launchpad and scrolled to the second page. And there it was! Sitting there, paused, was my Xcode update download! Every time I clicked the Install button in app store, the download state in Launchpad toggled between ‘paused’ and ‘downloading’. What could I say? The app store should have said something like ‘downloading’! Nope. It said nothing…
Anyway, I clicked on the Launchpad item and it resumed download and the install was successful.
So that’s the story of my Xcode upgrade in OS X Lion.