Selecting Multiple Checkboxes at a time on HTML page

I need this as i have a habit of adding all utube videos that i’ve watched in playlists to track that i have watched ’em…

so one way is to manually do this for every video as u watch it…which sucks…

Another smarter way is to go to watch history and select them all in a go and then add all with a single clk.

Now the thing is that checking so many checkboxes was a pain,

so i wrote this simple script to select all videos from top of page up to the one which has this

var getInputs = document.getElementsByTagName(“input”);

var getInputs = document.getElement(“V4nknAzQPHE”);

for (var i = 0, max = getInputs.length; i < max; i++){
    if (getInputs[i].type === ‘checkbox’)
        getInputs[i].checked = true;
    if (getInputs[i].value === ‘V4nknAzQPHE’)
        break;
}

Here’s the better compressed version:
var getInputs=document.getElementsByTagName(“input”);var i=0;while(getInputs[i].value!==’ABC’){if(getInputs[i].type===’checkbox’)getInputs[i].checked=true;i++}

Replace ABC with ID of element upto which checkbox in list needs to be selected…

<input type=”checkbox” class=”yt-uix-form-input-checkbox feed-item-checkbox tag-video-checkbox” name=”feed-item-checkbox” value=”r3c0THQbdDE”>

when this is the textbox, then ABC = “r3c0THQbdDE”, the value…id:




Managed Extensibility Framework (MEF)

Start in this order:

1. http://msdn.microsoft.com/en-us/library/dd460648.aspx

2. Sample App- simple calculator  : http://archive.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=clrsamples&DownloadId=13687

3. Documentation https://mef.codeplex.com/documentation

NOTES

The Managed Extensibility Framework (MEF) is a composition layer for .NET that improves the flexibility, maintainability and testability of large applications. MEF can be used for third-party plugin extensibility, or it can bring the benefits of a loosely-coupled plugin-like architecture to regular applications.

All your objects are MEF now (in 4.5)
Generics
POCO
Explicit Wiring (wire specific MEF 
parts the way YOU want)

MEF problems are easy to diagnose
Break on First Chance Exceptions
Visualize the exception

Fix your problem!

Status

MEF is a part of the Microsoft .NET Framework, with types primarily under theSystem.ComponentModel.Composition.* namespaces.

  • MEF has shipped with .NET 4.0 and Silverlight 4

Change the Internet Explorer Proxy Settings

How to host asp.net web API

This is the content of my default MVC 4 web API that i created using VS 2012 …

this does not have a single line of my code and on building it has size: 17 MB

 Directory of C:\inetpub\wwwroot\SMtest

08/30/2013  08:16 PM    <DIR>          .
08/30/2013  08:16 PM    <DIR>          ..
08/30/2013  06:02 PM    <DIR>          App_Data
08/30/2013  06:34 PM    <DIR>          App_Start
08/30/2013  06:34 PM    <DIR>          Areas
08/30/2013  06:34 PM    <DIR>          bin
08/30/2013  06:34 PM    <DIR>          Content
08/30/2013  06:34 PM    <DIR>          Controllers
08/30/2013  06:02 PM            32,038 favicon.ico
08/30/2013  06:02 PM               101 Global.asax
08/30/2013  06:02 PM               813 Global.asax.cs
08/30/2013  06:34 PM    <DIR>          Images
08/30/2013  06:02 PM    <DIR>          Models
08/30/2013  06:34 PM    <DIR>          obj
08/30/2013  06:04 PM             2,572 packages.config
08/30/2013  06:34 PM    <DIR>          Properties
08/30/2013  06:34 PM    <DIR>          Scripts
08/30/2013  06:04 PM            20,259 SMTest.csproj
08/30/2013  06:04 PM             1,087 SMTest.csproj.user
08/30/2013  06:34 PM    <DIR>          Views
08/30/2013  06:03 PM             6,351 Web.config
08/30/2013  06:02 PM             1,285 Web.Debug.config
08/30/2013  06:02 PM             1,346 Web.Release.config
               9 File(s)         65,852 bytes
              14 Dir(s)  74,141,380,608 bytes free

Deleted Help page etc.

 Directory of C:\inetpub\wwwroot\SMtest

08/30/2013  08:22 PM    <DIR>          .
08/30/2013  08:22 PM    <DIR>          ..
08/30/2013  06:34 PM    <DIR>          App_Start
08/30/2013  06:34 PM    <DIR>          bin
08/30/2013  06:34 PM    <DIR>          Controllers
08/30/2013  06:02 PM            32,038 favicon.ico
08/30/2013  06:02 PM               101 Global.asax
08/30/2013  06:02 PM               813 Global.asax.cs
08/30/2013  06:04 PM             2,572 packages.config
08/30/2013  06:34 PM    <DIR>          Properties
08/30/2013  06:04 PM            20,259 SMTest.csproj
08/30/2013  06:04 PM             1,087 SMTest.csproj.user
08/30/2013  06:03 PM             6,351 Web.config
08/30/2013  06:02 PM             1,285 Web.Debug.config
08/30/2013  06:02 PM             1,346 Web.Release.config
               9 File(s)         65,852 bytes
               6 Dir(s)  74,141,515,776 bytes free

ON Removing Unused Ref (option in VS 2012 ) i decreased the size of bin folder from 14.5 MB to 6.5 MB

IIS ISAPI and CGI Restrictions

Error: The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.

The issue i had with this that for my site i was getting 404 and VD and App Pool was fine,

Also, localhost/ was returning 404…

Finally i found that this was the issue..

going upto the level of machine name and ISAPI and CGI Restrictions feature in it, i found that for 4.0 it was Not Allowed. I changed it and all was well.

ref: http://stackoverflow.com/questions/7578134/problem-in-running-net-framework-4-0-website-on-iis-7-0

CORS issue resolved..finally

The use case here is that my website (aspx) hosted on web server (domain: a.b.c) is making a call to a svc, hosted on a web service server (domain: p.b.c).

This is causing a CORS error that i see in the browser console.

To resolve this i did this :

1. Enabled anonymous access for the VD of svc.
2. In the svc added tags like:

httpContext = context;
            this.httpContext.Response.AddHeader(“Access-Control-Allow-Origin”, “*”);
            this.httpContext.Response.AddHeader(“Access-Control-Allow-Credentials”, “true”);
            this.httpContext.Response.ContentType = “text/event-stream”;
            this.asyncOperation = asyncOperation;

and:

private void writeResponse(string msg)
        {
            string s = string.Empty;
            if (this.httpContext.Request.HttpMethod == “OPTIONS”)
            {
                this.httpContext.Response.AddHeader(“Access-Control-Allow-Origin”, “*”);
                this.httpContext.Response.AddHeader(“Access-Control-Request-Methods”, “POST,GET,PUT,DELETE,OPTIONS”);
                this.httpContext.Response.AddHeader(“Access-Control-Request-Headers”, “*”);
                this.httpContext.Response.AddHeader(“Access-Control-Max-Age”, “1728000”);
                this.httpContext.Response.ContentType = “text/event-stream”;
                this.httpContext.Response.StatusCode = 200;
                this.httpContext.Response.Flush();
                CometUtil.TraceDebug(“Tarun in OPTIONS”);
            }
            else
            {
                CometUtil.TraceDebug(“Tarun in ELSE Enter”);
                this.httpContext.Response.AddHeader(“Access-Control-Allow-Origin”, “*”);
                this.httpContext.Response.AddHeader(“Access-Control-Allow-Methods”, “POST,GET,PUT,DELETE,OPTIONS”);
                this.httpContext.Response.AddHeader(“Access-Control-Allow-Headers”, “*”);
                this.httpContext.Response.AddHeader(“Access-Control-Max-Age”, “1728000”);
                this.httpContext.Response.ContentType = “text/event-stream”;

https://developer.mozilla.org/en/docs/HTTP/Access_control_CORS

But what i was missing was that the Prefetch request from Browser using OPTIONS  verb was not allowed on the VD itself , hence the reqest wasn’t even reaching the svc.

To enable that i went to VD props -> configuration
 and in Extension i selected .aspx and allowed all verbs for it…