Windows Update 0x80070643 error fix

If you are getting 0x80070643 error while doing windows update, this may be because of downloaded setup files are corrupted.

There were some problems installing updates, but we’ll try again later. If you keep seeing this and want to search the web or contact support for information, this may help: (0x80070643)

To fix this error, move latest downloaded files from “C:\ProgramData\Package Cache” to another backup folder. To do this, sort this folder by “Date Modified” and move the folder that has the same date.

Then if you try Windows Update again, error would be gone and Windows Update would install the updates.

Note: If this doesn’t work, move back those backed-up folders back…


Why svchost.exe is at 100% CPU simple solution


The SvcHost.exe process hosts services that run in the background on Windows. It’s literally “Service Host.” You may have a dozen services or more running inside that process. More complex is that you’ll sometimes see multiple SvcHost.exe’s in your TaskManager.

Let me tell you now, Task Manager will not save you. You can see the PIDs for a running Service for the Services tab, but when a service goes insane, good luck nailing it down.

This inevitably leads you to questions like, “What Services are running inside what SvcHost.exe?” and “Which Service is using 100% CPU.”

There’s lots of ways to figure this out, but first I’ll tell you that simply killing the SvcHost.exe process that is using the most CPU will also kill ALL the other services that were running inside that host process.

There’s many command line ways to figure this stuff out, like

net start


sc query type= service


tasklist /svc

But this post is about doing it the easy way without lining up Process IDs and such.


From the Start Menu, type “Resource Monitor” and run it.

Resource Monitor

Click the checkboxes to the left of each of the svchost.exe processes (or just those that you care about). Now, switch to the CPU tab:

Resource Monitor - CPU

See the names of the logical services in the middle pane? Now you can sort by the CPU column and you’ve got the name of your out of control process.

You can right click and try to stop or restart just the one services, or even use default browser’s default search engine to “Search Online” for that service name:

Resource Monitor with the Right Click Menu showing

This tip has helped me several times while writing and debugging services. Resource Monitor is your friend. Many folks don’t’ even know it’s there!


MySQL Remove Duplicates

If we have a table like that and want to remove rows with duplicate name fields.

| id | name   |
| 1  | google |
| 2  | yahoo  |
| 3  | msn    |
| 4  | google |
| 5  | google |
| 6  | yahoo  |

1) If you want to keep the row with the lowest id value:

DELETE n1 FROM names n1, names n2 

2) If you want to keep the row with the highest id value:

DELETE n1 FROM names n1, names n2 


How to Update TeamCity Server

  1. Assumption is that you already have TeamCity installed (otherwise, why would you be looking to upgrade it 🙂
  2. Assumption is that you have already downloaded the new version of TeamCity, in this case 7.1.4.
  3. Log into TeamCity using an account that has Administrator privileges
  4. Click on the Backup link near the bottom left hand corner
  5. When the Run Backup Tab opens, click on “Start Backup”
  6. The backup should complete successfully
  7. Double Click the installation *.exe which was downloaded in Step 2 above
  8. At the first step in the installation wizard simply click Next
  9. Read the License Agreement and assuming you are happy with it, click “I Agree”
  10. In the “Choose Install Location” window, assuming you are happy with the default installation folder, simply click Next, otherwise change it first
  11. In order to install the latest version of TeamCity, you have to first uninstall the current version.  Click “Next”
  12. On this screen simply click Next once the current installation has been located
  13. Typically, since you are doing an upgrade, you want to keep both the build configuration and working directory, but the log files can be removed.  Click Uninstall
  14. The un-installation will continue
  15. After a short period, the un-installation will complete
  16. In the “Choose Components” window choose the components that you want to install.  As already mentioned, we will be installing both the Server and Build Agent on one server.  Click Next
  17. In the “Specify server configuration directory” window assuming you are happy with the default location click Next, otherwise change it first
  18. The main portion of the installation will start now
  19. The “Configure Build Agent Properties” window will then open, giving you the opportunity to add/edit build agent properties.  For now, you can leave this as the default.  If needed, this can be changed later.  Click Save.
  20. Simply click OK on the “TeamCity Build Agent Properties” pop-up
  21. In the “Select Service Account for Server” window decide what user account you want to run the TeamCity Server, I chose to use the SYSTEM account.  Click Next
  22. In the “Select Service Account for Agent” window decide what user account you want to run the TeamCity Build Agent, I chose to use the SYSTEM account.  Click Next
  23. In the “Services” window, choose to start both the Server and Build Agent Services, and click Next
  24. In the final screen, ensure that the option to open TeamCity Website after exit is checked and click Finish.
  25. A web page will open saying “TeamCity is starting”
  26. The login screen will then be presented
  27. On logging in, you will see the latest version number displayed


Linking folder on a path with Dropbox path

If there is folder, i.e. game save folder or sth. that you can’t move under Dropbox folder to continue working, then you can link a folder with dropbox folder to be in sync.

In windows there is a command named ‘mklink’ that enables linking folders.

Here is the usage

mklink [[/d] | [/h] | [/j]] <Link> <Target>

For example to link a game save folder with your dropbox folder:

mklink /D “C:\Users\username\Dropbox\games\My Favourite Game\” “C:\Program Files (x86)\Steam\steamapps\common\My Favourite Game\saves\”

This way your files will be always synced and also versioned with dropbox.

Note: Make sure “C:\Users\username\Dropbox\games\My Favourite Game\” folder does not exist, to allow mklink to create.

Note 2: If you get “Access Denied” error, try opening command prompt with Administrator rights.

Replacing jQuery live with on

.live() function is removed on jQuery version 1.9.

So if you want the same behaviour, you can use on with versions gte 1.9.

Let’s say we have a code that’s like:

$(“#serviceItemsContainer input“).live(“change”, function(){ /* some code */ });

then this code block can be changed like that:

$(“#serviceItemsContainer”).on(“change”, “input”, function(){ /* some code */ });

Notice, there is an extra parameter to pass the function as a selector. This way you can attach a function without having the item on DOM, when you execute the code.

Happy Coding


First and Second Level caching in Hibernate

1.1) First-level cache

First-level cache always Associates with the Session object. Hibernate uses this cache by default. Here, it processes one transaction after another one, means wont process one transaction many times. Mainly it reduces the number of SQL queries it needs to generate within a given transaction. That is instead of updating after every modification done in the transaction, it updates the transaction only at the end of the transaction.

1.2) Second-level cache

Second-level cache always associates with the Session Factory object. While running the transactions, in between it loads the objects at the Session Factory level, so that those objects will available to the entire application, don’t bounds to single user. Since the objects are already loaded in the cache, whenever an object is returned by the query, at that time no need to go for a database transaction. In this way the second level cache works. Here we can use query level cache also.