Shift-Right click a folder in windows explorer and tada!
So, let’s just dive in and get the dev machine setup. We are going to be using Apache Cordova, Ionic, and AngularJS frameworks. And we’ll get Jasmine and Karma setup for testing. We will also use npm (node package manager) to install these libraries, so let’s get that installed first.
Install nodejs using the install link at nodejs.org. Then let’s ensure we have the latest version by running this as administrator.
npm install npm -g
We also need the Java JDK (not just JRE). That can be downloaded and installed from here. Just follow the instructions, and ensure it’s in your PATH when complete.
Now let’s get Apache ANT from here, and install it.
Also required is the Android SDK. Just follow the instructions, and run the Android SDK Manager to install the latest SDK Platform. Cordova requires the ANDROID_HOME environment variable. This should point to the android-sdk directory.
Now that we have npm, let’s install cordova and ionic as administrator.
npm install -g cordova npm install -g ionic
Now, navigate to the location you want to create your application. And generate a blank ionic app with
cd c:\source\ ionic start helloworld blank
NOTE: I had a problem here, I received the following error: “Unable to add plugins. Perhaps your version of Cordova is too old. Try updating (npm install -g cordova), removing this project folder, and trying again. (CLI v1.3.2)”. However, nothing I did solved the problem. Turns out, for some reason, my helloworld/config.xml was blank. You can fetch a new config.xml here, replace the empty one, and things should start working.
Open the helloworld folder and let’s add the android platform, and run the blank app
cd helloworld ionic platform add android ionic serve
Or connect your android device by usb, and load the application on it with
ionic run android
You can also run it in the Android emulator, but I don’t recommend it, as it’s slooooooow.
ionic build android ionic emulate android
Next we’ll start adding some code and tests.
I recently had to keep retesting an installer, part of it’s actions were to install a print driver, but to be able to keep testing, I had to remove the driver from the computer, not just the printer. So, here’s how it’s done, in case someone else needs to do this.
- Find your driver name. (ex.“Brother MFC-J6520DW Printer”)
- In “Devices and Printers” remove all printers using the driver from step 1
- Open Regedit.
- Navigate to (on 32 bit(x86) computers) “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-3”
- Or (on 64 bit(x64) computers) “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Drivers\Version-3”
- And then remove the folder that matches the printer driver name.
- Open Services, and restart the print spooler service
If you’re like me, you always want Visual Studio opening as Administrator, allowing it to install services, and do whatever you need it to do. But you often forget to right click and “Run as Administrator”. Or you just want to be able to use the pinned shortcuts on the task bar. It’s really amazingly simple to make it always run as an administrator, just follow these simple steps:
- Right Click on “devenv.exe” in Explorer
- Click “Troubleshoot compatibility”
- Click “Troubleshoot program”
- Check “The program requires additional permissions”
- Click “Next”
- Click “Test the program…“. It should launch Visual Studio as Administrator
- Click “Next”
- Click “Yes, save these settings for this program”
- Click “Close the troubleshooter”
You can revert by following the same steps, but unchecking “The program requires additional permissions”
These lists are everywhere, every blogger at some point puts up there list of “must read” because … because they’re important. Some of the best books I’ve read have been off people’s lists. When you look at a few dozen lists, you notice the same books over and over and over…and you realize, “I should read this book!”. If all these people I respect and follow are recommending it, it must be worth reading. So here’s my list, with commentary, hopefully containing some suggestions that you haven’t already read, and enjoy when you do.
- Pragmatic Thinking and Learning: Refactor Your Wetware
This book literally changed the way I think about my day. Lots of examples about how your mind works, tricks to help you let your mind solve problems for you in the background, and why. It generated a lot of interesting discussion at during our companies book club meeting.
- The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win
- Clean Code: A Handbook of Agile Software Craftsmanship
A great book that changed how I write software. It really brought refactoring, and proper program structure to the front of my mind. Before reading this book, I didn’t realize how bad a programmer I really was. I got things done…but not as well as I could have.
- The Clean Coder: A Code of Conduct for Professional Programmers
Along the same lines as Clean Code, but this book isn’t about writing code, it’s about how to be a professional in the workplace. How and when to say no. How to estimate, and when not to. It confirmed many of my practices, and caused me to understand better some of the mistakes I’ve made in the past.
- Dreaming in Code: Two Dozen Programmers, Three Years, 4,732 Bugs, and One Quest for Transcendent Software
This was another great story, the author’s original intent, was to follow this company as they created a piece of softare and document how great people can write revolutionary software…however, that’s not quite what happened.
- Leaders eat Last: Why Some Teams Pull Together and Others Don’t
This book isn’t about tech at all, it’s about what makes a good leader, and why. It goes into a lot of detail about the chemicals in your brain, when they are released, their short and long term effects, and why we’ve evolved to have them. It generated a LOT of fantastic converstaion in our book club meetings.
- The Drunkard’s Walk: How Randomness Rules Our Lives
If you’re interested in math, and statistics, you’ll enjoy this book. Great stories and examples helping to understand how randomness works. And some history about statistics, and how we generally misinterpret so much of what we see because we don’t understand how to properly calculate the probability of something happening. The math is also, very easy to follow, it’s not big complicated formulas.
This is probably my favourite book on the list, it describes a fictional company that has horrible internal practices, and one employees attempt to change that. It feels so real, and I can relate so much of the story to places I have worked. It offered some insights into how we can affect change for the better in the companies we work for.
Now for a couple books that have nothing to do with IT, they are just so great that you should read them. They should appeal to the same crowd as the above books, as everyone I know who has read them, has LOVED them.
- The Martian: A Novel
I read this book in the span of 24 hours, I started one evening, was done the next. It’s gripping. The first lines of the book are “I’m pretty much fucked. That’s my considered opinion. Fucked.” It’s written as a journal, as a person keeps a log about being stranded on Mars. It’s about the struggle to stay alive after being left for dead when a sandstorm forces the rest of the crew to evacuate.
- Ready Player One: A Novel
If you grew up in the 80’s this is a must read. It’s page after page of 80’s movie, video game, and television references. Every paragraph takes you back to your childhood (or whenever you were alive in the 80s). And it’s all wrapped in a great story set in the real world in 2044 after a global energy crisis; and in a virtual world, the OASIS. Once I picked up this book, I could barely put it down, I think I’ve only read The Martian faster.
I hope you read or have read these books and enjoy them as much as I have. Let me know in the comments, if you have recommendations for further reading, I’d love to hear them! There’s so much out there it’s hard to find quality.
Have a great day!
What more is there to say? Microsoft opensourced Roslyn (.NET Compiler Platform), source is avaiable on CodePlex!!!
It’s fantastic news, to quote Eric Lippert
What astonished me was that its not just a “reference” license, but a full on liberal Apache 2.0 license. And then to have Miguel announce that Xamarin had already got Roslyn working on linux was gobsmacking.
It’s a huge step, and something I hope Microsoft does more of. I can’t wait to find some time to dig into this code, and see how it all works.
Last fall I purchased a Nexus 7 (2013) and have really enjoyed the pure Android experience. I’ll be retiring my S3 and buying a Nexus phone to replace it in the near future. Anyhow, one thing that’s always lacking is a way to develop on the tablet…or so I thought! Enter AIDE, an Android IDE that allows you to develop and run applications right from your tablet!
It comes with the code for Tetris, a Clock Widget, and a Hello World app. I started hacking together my first native app. And tried to run it. Of course, it crashed. So, Google, and I download a few logcat readers. None seem to work. I do some more research and learn that as of the Jelly Bean update, apps can no longer read each others logs. This was added for security reasons, as some applications (facebook) were logging passwords in the log file, meaning, a maliscous app could easily read your facebook password from it’s logfile. Which now means, you need to connect your tablet to a pc to read the logs, and determine why your application is crashing. At first, this annoyed me. It took a while to get that work, and I’ll show you how. But if you plan to deploy your app, you’re going to want to have log files sent to you anyway. After showing you how to read logcat from your PC, I’ll show you how to write your first app in AIDE, that will email (or change it to write to a file you can open) it’s logcat after it crashes. It will allow you to develop, without the need for a PC.
First, you need to enable developer mode on your tablet. It used to just be in the settings, but now it’s more complicated. Open your settings and scroll down to “About tablet” (phone, or whatever). Scroll down to the Build number, and click it 7 times.
You’ll see a message that developer mode is now enabled. Success. Back in the Settings screen you’ll now see Developer Options.
In there, turn on USB Debugging
Next we need to install drivers, you can get the latest Google USB Driver from http://developer.android.com/sdk/win-usb.html. Unzip them to a location your machine, I chose c:\Android Tools\Usb_Driver. Now, open Device Manager, and find your device under “Other devices”
Choose “Browse my computer…” and navigate to the folder you extracted the drivers into. Make sure “Include Subfolders” is checked. And install them, you should now see the device installed correctly.
So, now that the drivers are installed, let’s get adb installed, you can download r19.0.1 for windows here which is currently the latest version. Just extract the files onto your computer, I stored them at “C:\Android Tools\platform-tools” on mine.
Open a command prompt, go to the directory you just extracted adb.exe into, and try issuing the command “adb devices“, you should see a result listing the attached device.
C:\Android Tools\platform-tools>adb devices
List of devices attached
If nothing is attached, you many need to change the Connection type with your computer, on your Android device, go to Settings -> Storage, and click the elipses in the top right, you’ll come to this screen, try changing between the two modes, one should work. On mine it was Camera, others have reported differently.
If all is working correctly, you should be able to dump the logcat contents with the command
Or to a file
adb logcat -d > logcat.txt
This logcat grows quickly, if you want to clear the logcat of your device, issue the command
adb logcat -c
And that’s all for now. My next article should be a walkthrough of using AIDE to get a simple app up and running, with logging, so you can do do your development without needing adb to view logs, and thus, remove the tether to your computer.
Now, back to coding!
I was writing up another article and needed screen grabs from my device, and wanted a simple way to grab them, well, adb to the rescue!
adb shell /system/bin/screencap -p /sdcard/screenshot.png
adb pull /sdcard/screenshot.png screenshot.png
It’s that easy.
The first line saves the screenshot on the device, the second pulls a file from the device to the local machine.
All of this assumes you have adb working and the drivers setup for your device. Which I will be showing how to do in a future post.
Found this on a friends site (which I recommend you read as he posts some great sys admin tips and tricks!)
We watched it, then tried it out, and it worked. It takes about 2 minutes to change the password on an account and gain access to any windows computer.
The basic steps:
- When your computer is booting, reset it during the splash screen
- The prompt to repair appears, durin gthe repair there is an option to show the details in Notepad.exe
- You can use it’s Open/Save dialog to rename your sethc.exe (sticky keys) and replace it with a copy of cmd.exe
- On the login, hit shift 5 times, and get a cmd.exe window
- Use the ‘net’ commands to reset a local admin password
- Login and profit.
It’s way way way too easy. Looks like the only way to secure your machine is to encrypt the entire drive so a password is required just to start the boot process.
The other day at work, an innocuous question was posed…
This did not seem right to me, but, sure enough, a js fiddle showed this to be true…almost (go to result tab, and hit different keyboard keys, it will show the character code).
What appeared to be the same code (if you hit apostrophe then an arrow) was actually just that the arrow didn’t register as a keypress, and you were still seeing the last keys code. However, this was only true in some browsers, IE and Chrome, Firefox I believe worked as one would expect.
Changing to a keydown event works, and shows the right arrow as 39, like it should.
Quirksmode clears up a bit of the confusion, and has a nice little tester at the bottom of the page.