lynda fundamentals of web development

SMTP is for sending mail and POP is for receiving mail, that’s why its called Post Office Protocol. RTP is real time Protocol for VOIP and audio and video

types of servers are : Web Servers, FTP Servers, Mail servers etc.

http://www.abc.com:

www is SubDomain, a folder in the http server (in parallel to FTP or Video) where the sites are hosted.
asc is Domain
com is Top Level Domain

when new site is registered the client’s local ISP DNS Server would not have the entry for it, and so it passes it to Root Name server that fwd’s it to the .com Name server

Note that DNS is a distributed database so there is no replication of all domains everywhere. when u get response, Local DNS server caches the domain to make retrieval faster the next time around

W3C released XHTML 1.0 and 2.0 post HTML 4.0. WHATWG released HTML 5.0

DTD Stand for both Document type Definition and Document type Decleration (<doctype>)
Document type Definition is machine redable file for parsing any doc
Document type Decleration is a way for you to declare the type of your doc, like the version of HTML etc. <!DOCTYPE HTML> is how you declare HTML 5 doc

CSS Can be in seperate file, or as tag or attribute in HTML

CSS style/ css rules is : Selector + Decleration : p{font: as;color: #ffff}

JPGs (support millions of colors ) are compressed each time they’re saved so don’t keep them as source images

GIFis 256 colors, and support transerrency and animation.use for logo , It is lossy

PNG (portabke n/w graphics) are lossless and support millions of colors

PHP is Hy[ertext Prepressor. is free, works on Apache and with free mySQL

JSP is for java

.Net

Adobe Coldfusion. Coldfusion server is not free

use progressive enhancwment… not graceful degradation

when hosting on sghared host ie seerver shared by many sites makre syure ur neighnors are noyt nbad or google will block it use axandra free reverse ip lookup for this shared hosting siytes

register domai n on multiple top leve l domains like .com and org so that users fon’t have to rememger and are redirected to right site no matter

 

registry company for regisrering is cheaper than hosting company
u shoul;d own the domain

have primary and sec name eservers

how to prevent code check in to git if unit tests fail

http://stackoverflow.com/questions/2087216/commit-in-git-only-if-tests-pass

A pre-commit hook is a piece of code/script you tell your SCM tool to run after you type `bzr/git/svn commit` but before it actually commits your new code. A pre-commit hook can do just about anything, and with ours we run our unit tests and if they fail, we abort the commit.

http://sorcery.smugmug.com/2012/01/24/you-shall-not-commit-without-passing-tests/

This : http://stackoverflow.com/questions/17976505/enforcing-code-standards-in-git-before-commit-is-accepted

says that using the commit hook is bogus as anyone can delete it and then commit code.

The best way is to use a build and test remote server that triggers a build and runs the test script everytime code is pushed to the repo.

I am using Teamcity, so can Teamcity run jasmine and protractor tests for angular code?

Yes:
1. http://stackoverflow.com/questions/21185246/how-to-run-jasmine-tests-in-teamcity
2. http://blog.danmerino.com/continuos-integration-ci-for-javascript-jasmine-and-teamcity/
3 .http://benshepheard.blogspot.in/2011/05/running-jasmine-tests-in-continuous.html
http://sirars.com/2013/10/30/continuous-javascript-testing-with-karma-test-runner-and-teamcity/

SQLExpress Lessons

SQLExpress Lessons

  1. To connect to your own DB use just the server name
  2. To connect to other person’s DB use IP/Hostname,Port
  3. Connection string for SQL Express (for it to work in VS 2012,13 replace .\ SQLEXPRESS with (LocalDB)\v11.0):

<connectionStrings>

<add name=”ProductServiceContext” connectionString=”Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|ProductServiceContext-20131021111706.mdf;Initial Catalog=ProductServiceContext-20131021111706;Integrated Security=True;MultipleActiveResultSets=True;User Instance=True” providerName=”System.Data.SqlClient” />-

</connectionStrings>

  1. entity framework code first migrations with sqlexpress 2008
    1. sd
  2. One way to see what SQL services are available on your machine is to go to the Package Manager Console in Visual Studio and execute the following command (also showing the output below): PM> Get-Service | Where-Object {$_.Name -like ‘*SQL*’}
  3. Since LocalDb is a user process and not a service, you won’t see it listed in the output of the Get-Service command above. You can, however, run SqlLocalDb.exe from the package manager console (or the command line) to see if LocalDb is installed. > SqlLocalDb info
  4. The connection string can always be found from when you connect to the server using server explorer. There in advanced menu, it shows the string in the end of the form
  5. SQLExpress of VS 2010 has been replaced by SQL Server Local DB. To connect to it from server explorer use Server Name as (LocalDB)\v11.0 andthen explore it
  6. For SQL Server 2008 with win auth use connection string:

<connectionStrings>    <add name=”ProductServiceContext” connectionString=”Data Source=MIAPGKHEMATARWD;Database=ProductService;Trusted_Connection=True” providerName=”System.Data.SqlClient” />

</connectionStrings>

 

BEST LINKS

  1. http://odetocode.com/blogs/scott/archive/2012/08/15/a-troubleshooting-guide-for-entity-framework-connections-amp-migrations.aspx
  2. http://msdn.microsoft.com/en-us/library/ms233817.aspx
  3. https://www.connectionstrings.com/sql-server-2008/
  4. http://msdn.microsoft.com/en-us/data/jj591621.aspx
  5. http://msdn.microsoft.com/en-us/library/ff647396.aspx

Entity Framework 6 lessons

 

  1. 1st run: Enable-Migrations
  2. Check what all servers are up: Get-Service | Where-Object {$_.Name -like ‘*SQL*’}
    1. Note that this will not show SQL Express Local DB
  3. Make sure that the connection string is correct
  4. Then run: Add-Migration
  5. Then run: Update-Database
  6. If the class (Model) structure gets changed: The Designer Code for this migration file includes a snapshot of your current Code First model. This snapshot is used to calculate the changes to your model when you scaffold the next migration. If you make additional changes to your model that you want to include in this migration, then you can re-scaffold it by running ‘Add-Migration SQL Server’ again.
  7. Connect to the DB using server explorer and check the data

 

PS

Another way to find the right connection string: http://henrywrites.wordpress.com/2013/11/04/entity-framework-code-first-providerincompatibleexception/  or http://stackoverflow.com/questions/9582193/entity-framework-connection-string-not-from-config

 

WHEN MIGRATING FROM LOCAL DB TO SQL SERVER CHANGE THE CONNECTION FACTORY AS WELL:
<entityFramework>

<defaultConnectionFactory type=”System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework”>

<parameters>

<parameter value=”v11.0″ />

</parameters>

</defaultConnectionFactory>

<providers>

<provider invariantName=”System.Data.SqlClient” type=”System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer” />

</providers>

</entityFramework>

 

To

<entityFramework>

<defaultConnectionFactory type=”System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″>

</defaultConnectionFactory>

<providers>

<provider invariantName=”System.Data.SqlClient” type=”System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer” />

</providers>

 

 

AUTHENTICATION ISSUES

I have used Windows Auth for my Database and so now I’m getting error:

Cannot open database “ProductService” requested by the login. The login failed.

Login failed for user ‘IIS APPPOOL\DefaultAppPool

I have kept windows auth enabled for my site in IIS 7.5

Tried this: http://stackoverflow.com/questions/7698286/login-failed-for-user-iis-apppool-asp-net-v4-0

Worked like a charm

 

 

Orleans

http://blogs.msdn.com/b/dotnet/archive/2014/04/02/available-now-preview-of-project-orleans-cloud-services-at-scale.aspx

see: Using Orleans to Build Halo 4’s Distributed Cloud Services in Azure

Project “Orleans” enables scenarios that are difficult to productively implement using current technologies, complementing solutions like SignalR and WebAPI. Gaming, Internet of Things, social networks, and other scenarios with complex and dynamic relationships are particularly well suited for this model.

https://orleans.codeplex.com/ : Download the samples

What is TPL ( Task Parallel Library) and how it differs from threads (c# interview questions) ?

SEE: https://www.youtube.com/watch?v=No7QqSc5cl8 and https://www.youtube.com/watch?v=V2sMXJnDEjM

NOTES:

  1. Threads have processor affinity, but TPL Tasks encapsulate MULTI CORE Execution
  2. TPL Automatically does Thread Pooling

BONUS: yield: https://www.youtube.com/watch?v=4fju3xcm21M