Posted on 5:00 AM by Softminer and filed under

using (System.Diagnostics.EventLog eventLog = new System.Diagnostics.EventLog("Application"))
eventLog.Source = "Application";
eventLog.WriteEntry("Before Call", System.Diagnostics.EventLogEntryType.Information, 101, 1);
Posted on 1:53 AM by Softminer and filed under

Book can be ordered here
Posted on 4:05 AM by Softminer and filed under

TO be able to see files checked out you need to install TFS power tools

after that you will be able to run command prompt for visual studio

tf status itemspec [/collection:TeamProjectCollectionUrl] [/login:username,[password]] ([/workspace:workspacename[;workspaceowner]]|[/shelveset:shelvesetname[;shelvesetowner]])[/format:(brief|detailed)]

More Info

tf status "$/Project/MyApp" /collection:http://tfs:8080/tfs /user:myuser /recursive /workspace:myworkspace

To view it in Visual studio GUI

Right click on the top most folder that you want to start in
Choose "Find In Source Control"
Choose "Status"
Check "Recursive"
Check "Status"
Enter userid in the "Display files checked out to:" box (i have to include my domain, i.e. domain\userid)
Click "Find"

Posted on 7:40 AM by Softminer and filed under ,

Here is a simple example of reading file using javascript, more info on links

<input type="file" id="fileinput" />
<script type="text/javascript">
  function readSingleFile(evt) {
    //Retrieve the first (and only!) File from the FileList object
    var f = evt.target.files[0]; 

    if (f) {
      var r = new FileReader();
      r.onload = function(e) { 
       var contents = e.target.result;
        alert( "Got the file.n" 
              +"name: " + f.name + "n"
              +"type: " + f.type + "n"
              +"size: " + f.size + " bytesn"
              + "starts with: " + contents.substr(1, contents.indexOf("n"))
    } else { 
      alert("Failed to load file");

  document.getElementById('fileinput').addEventListener('change', readSingleFile, false);
Posted on 1:33 AM by Softminer and filed under

1. First make sure that the MTP is enabled on the Nexus 5: Settings > Storage > Menu > USB connection to the computer.

2. Plug your Nexus 5 into your computer via USB.

2. On Windows, open the device manager (on Windows 8, press "Ctrl+Q" then just use the search box at right hand side to search for it). You may need the administrator password to open it.

3. Once in the Device Manager, look for the name of your plugged in device. It may be given the name phone, Acer ADB Interface, or something else specific to your device. (It might be tricky to find for users unfamiliar with the device manager, so if you can't find it try unplugging the device and seeing which item disappears. You can just plug it in again afterwards and continue with the instructions.)

4. Right click on the device name and click "Update" by selecting local disk. Don't choose online because you'll just get a message telling you that your driver is up to date.

5. Choose MTP USB Driver.

6. Once the installation is complete, your device manager should show Nexus 5 instead of what you had before.
Posted on 2:02 AM by Softminer and filed under

This problem happens when your asp.net application runs on web farms
Adding enableViewStateMac="false" to webform may solve the problem but it's not recommended.


<?xml version="1.0" encoding="UTF-8"?> 
        <machineKey decryptionKey="xx,IsolateApps" validationKey="xxx,IsolateApps" /> 
To generate using Power shell use this instruction http://support.microsoft.com/kb/2915218 Copy and paster powershell script into file, while running you may get security error. To remove security try x86 Open C:\Windows\system32\cmd.exe Run the command powershell Set-ExecutionPolicy RemoteSigned x64 Open C:\Windows\SysWOW64\cmd.exe Run the command powershell Set-ExecutionPolicy RemoteSigned and to set back to default powershell Set-ExecutionPolicy Restricted Power shell Execution Policies
Posted on 1:02 AM by Softminer and filed under

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1.DateOfWeek
    public partial class WebForm1 : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
            string ret = GetStringFromWeek();
        private string GetStringFromWeek()
            var d = DateTime.Now;
            System.Globalization.CultureInfo cul = System.Globalization.CultureInfo.CurrentCulture;
            var firstDayWeek = cul.Calendar.GetWeekOfYear(
            int weekNum = cul.Calendar.GetWeekOfYear(
            int year = weekNum == 52 && d.Month == 1 ? d.Year - 1 : d.Year;
                case 4: return "MA";
                case 5: return "MB";
                case 6: return "MB";
                case 7: return "MB";
                case 8: return "MB";
                case 9: return "MB";
                case 10: return "MB";
                case 11: return "MB";
                case 12: return "MB";
                case 13: return "MB";
                case 14: return "MB";
                case 15: return "MB";
                case 16: return "MB";
                case 17: return "MB";
                case 18: return "MB";
                case 19: return "MB";
                case 20: return "MB";
                case 21: return "MB";
                case 22: return "MB";
                case 23: return "MB";
                case 24: return "MB";
                case 25: return "MB";
                case 26: return "MB";
                case 27: return "MB";
                case 28: return "MB";
                case 29: return "MB";
                case 30: return "MB";
                case 31: return "MB";
                case 32: return "MB";
                case 33: return "MB";
                case 34: return "MB";
                case 35: return "MB";
                case 36: return "MB";
                case 37: return "MB";
                case 38: return "MB";
                case 39: return "MB";
                case 40: return "MB";
                case 41: return "MB";
                case 42: return "MB";
                case 43: return "MB";
                case 44: return "MB";
                case 45: return "MB";
                case 46: return "MB";
                case 47: return "MB";
                case 48: return "MB";
                case 49: return "MB";
                case 50: return "MB";
                case 51: return "MB";
                case 52: return "MB";
                default: return "Default";
            return "test";
        private string GetDayoFWeek()
            switch (DateTime.Now.DayOfWeek)
                case DayOfWeek.Friday:
                    return "F";
                case DayOfWeek.Monday:
                    return "M";
                case DayOfWeek.Saturday:
                    return "S";
                case DayOfWeek.Sunday:
                    return "M";
                case DayOfWeek.Thursday:
                    return "T";
                case DayOfWeek.Tuesday:
                    return "E";
                case DayOfWeek.Wednesday:
                    return "W";
            return "NO";