Thursday, April 30, 2015

Windows File History (7, 8 and 10) - One Of the Most Useful and Overlooked Feature

You are probably using some type of backup software from a commercial vendor. I have been too, but recently I stopped using it and switched to a Built in File History.

If you are used to Mac OS Time Machine, it comes as close to that, but in some ways better because you can still control what gets backed up and what does not. Like the Time Machine, you can ask it to back up hourly or even every 30 min of recent file changes and then automatically prune off old backups.

Another advantage is that it is very well integrated with the power control of your system, especially a laptop. I was using another vendor's backup software and any time I wanted to sleep or shutdown, it refused to do so because it was in a middle of a backup. Not with this, you can go to sleep, close the cover and you won't get in a situation where you have a hot battery drained laptop when you pull it out of your case.

In my situation, what I needed was automated hourly backup of some of my important documents, especially the code I am currently working on (but not quite ready to commit to Git). But if you are a teacher or an accountant just keeping the Office docs that works pretty painlessly.

Where to Backup?


Cloud backup is very popular, but the problem is that you are not always on the most reliable network especially on laptops. You could also be in flight and working on documents or code. Fortunately, most laptops have a memory card slot. So I advise that you buy as big of a memory (SD card) as you can afford, I would say get at least 64 GB. So just plug it in, format it in NTFS.

Since this is a solid-state memory, it does not consume much power and you know you have a backup available to you pretty much anywhere.

How To Enable and Configure It?





  • Go to your control panel and find File History which is under System and Security.
  • You can now enable the feature and select the destination "drive" here.
  • After the drive has been configured, click Advanced Settings

  • You can configure how often you want to back up.

Selecting Items to Back Up

Here is another cool thing about this. You can easily manage which stuff on your system is backed up. The key answer to " how to select which folder to backup" is that anything included in the Libraries part of your Explorer is backed up. By default your Documents, Music, Photos and Videos are backed up. In the picture below I have dragged in WinguMD folder which contains my work stuff. Note that dragging the items in the Libraries folder does not move the folder there, but it just like the shortcuts but backups are enabled.  I would not back-up videos if you have a small memory card.

On a side note, I have been wondering what the Libraries were for the longest time. Now we both know what this is.





Windows 10 Lost Ability to RDP Into the System

Symptom:


You upgraded to Windows 10 and now you cannot RDP to the system at your home network. (I do this a lot because I use Mac at home and RDP to my laptop which is Surface 3).

One of the Root Causes

In my situation, all of my WiFi connection went to Public which automatically turned off just about any incoming traffic to it from the Windows Firewall. This is a good feature. Do not turn that off.

To Make Your WiFi Network to Private

This, I guarantee you will take some time as there has been a big change.

  1. On your desktop, click the New Notifications icon on the task bar. That' far right and looks like a Messaging icon.
  2. Right click over WiFi and "Go to Settings."
  3. This is where you will be lost, especially if you have many spots.
  4. On the list of WiFi access points scroll all the way down.
  5. Click HomeGroup
  6. If your system is like mine, you will get a chance to enable the HomeGroup on the network you are on.




Friday, April 03, 2015

VertX Development with IntelliJ IDEA

Problem:


How can I develop Vert.X Verticles with IntelliJ IDEA?

Some Tips (May not be a Solution):


I have been trying to evaluate the Vert.X system (after getting my head spin around Activator + Scala), and believe or not, I have been in C/C++/C# woorld all this time and manged to avoid Java altogether (yes, you can have a whole career based on C# and JavaScript only!). So I am sure there are some figments of ignorance in this article. If you find anything wrong, please let me know as that will help me a lot.

As I stared on this path, I did find many other articles all over the net but I have found that most were written by seasoned Java developers directed to other still-a-bit-seasoned Java developers. This article is written by someone who hardly know much about Java. So if that's your situation this will help a lot, at least get to the point your Verticle to run and debug under IDEA.

Much of the hurdle in dealing with the Java environment (not so much with the language itself) is that  there is initial confusion as where all the classes come from (yes CLASSPATH) and there are more than one ways of doing things right. As a result it has gotten very time consuimg tasks to learn each of the paradigm. For example, there are Maven, Gradle and Ant to handle the builds just to name a few then there are things like Scala and Groovy and such to even confuse us, and on top of various Java frameworks for example Vert.X is one of them and Activator is another, then there are even more stuff like Spring, Netty etc.

Each serves slightly different purpose but they also get combined to do a lot of similar things like serving up Web APIs and web pages and such.

So with that in mind, here is probably very overly simplistic description of how to work IntelliJ with VertX development.

How To Start


I started with both Gradle based project initialization to Marven based. I have found that the Maven based one is a bit less intimidating to approach and lot simpler overall, so I also advise you try the Maven way first then do other stuff.

The most of how to set up the Maven based project skeleton is described on Vert.X document on THIS PAGE. But that page does not give you much more info on how to debug etc.

So first off, follow the directions on that page until you are all done and typed in "mvt idea:idea" to create the IDEA project. Then you can open the top level of your project (where you will find the IDEA files like .iml, .ipr and .iws). This will first convert the project format. Let IDEA handle that.

Integrating the Maven Project is the Key


After you open the project, and after a few minutes IDEA will say, it has found a Maven project and if you want to import it. Say yes. This will cause a small Marven Tab on the right hand side of the IDE.



What I have found out is that clean, compile and package commands (goals) are very handy.

For example, let's say you have added a new Verticle class. I have found that first doing the clean then do compile will make it appear in the target directory.

Now if you want to create the mod directory containing your Verticles, then doing package.


  • For each of the action, which is called Goal in Marven, select an item then press the Green start button above to execute.
  • clean will clean out any derived objects
  • compile should be used each time you update the source
  • package will create the mod directory in the target
  • install will also create the mod directory on the top level of the project, but what will be install is not always updated when you change the source.

Starting Verticles from Within the IDEA

For the reasons that I do not completely know, if you run "vert runnomd com...." stuff from the top directory of your project, it can find your module. So do not be afraid to use that option. But if you want to debug your updated verticle code each time via the mod then you can first do the "package" Marven goal first, then you can "cd" into your "target" directory then you can run the latest version.

Also not shown in this but instead of specifying Make before you debug, you can specify the Maven "package" goal which will always recreates the mod directory with the latest code. You may want to do that. Make takes forever to build, so I would at least switch to "compile" verb of the Marven and remove the Make action.





Adding or Running Your Own Verticle From Within IDEA

This is still an area that is a bit of mystry to me, but here is what I know so far and it does work, but the Vert.X documentation does not tell you how, so I had to do some experimentation to find what worked for me.

  • Go a head and add a new Verticle class under src/main/java/com.blah/ directory.
  • Do not remove PingVerticle.java If you do remove it what will happen is that it will break the build because there are some "tests" that will call this. You could, in theory, remove the tests too but why bother when you actually do not have to remove it.
  • If you want to run your own Verticle, you will have to go inside the "resources" directory, find mod.json and edit it to contain your class under "main": 
  • Now do a clean and then package and you will have your new Verticle to launch when you do runmod com.blah... stuff.
I am sure there are some errors in my post, but I feel that I have given you enough information that allowed me to do what I wanted to do. As I find more information, I will plan to update this document.