Angular PIPES

Transform data before display. For example, lower case to upper case, date formatting etc.

Built in pipes include lowercase, uppercase, decimal, date, percent, currency etc

To read more about angular built-in pipesTo read more about angular built-in pipesPipe URLDate https://angular.io/api/common/DatePipeDecimal https://angular.io/api/common/DecimalPipeCurrency https://angular.io/api/common/CurrencyPipePercent https://angular.io/api/common/PercentPipe

Advertisements

Change loading (Spinning) splash icon for VS2015 angular 2 project

By Default, when I load angular project, this what I see at the beginning when I run the application:

 

a26

 

I would like to change it something look like:

a27.PNG

 

Solution:

Add the following css code in the skyle.css file in here:

a28.PNG

 

 

/* Absolute Center Spinner */
.loading {
position: fixed;
z-index: 999;
height: 2em;
width: 2em;
overflow: show;
margin: auto;
top: 0;
left: 0;
bottom: 0;
right: 0;
}

/* Transparent Overlay */
.loading:before {
content: ”;
display: block;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.3);
}

/* :not(:required) hides these rules from IE9 and below */
.loading:not(:required) {
/* hide “loading…” text */
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}

.loading:not(:required):after {
content: ”;
display: block;
font-size: 10px;
width: 1em;
height: 1em;
margin-top: -0.5em;
-webkit-animation: spinner 1500ms infinite linear;
-moz-animation: spinner 1500ms infinite linear;
-ms-animation: spinner 1500ms infinite linear;
-o-animation: spinner 1500ms infinite linear;
animation: spinner 1500ms infinite linear;
border-radius: 0.5em;
-webkit-box-shadow: rgba(0, 0, 0, 0.75) 1.5em 0 0 0, rgba(0, 0, 0, 0.75) 1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) 0 1.5em 0 0, rgba(0, 0, 0, 0.75) -1.1em 1.1em 0 0, rgba(0, 0, 0, 0.5) -1.5em 0 0 0, rgba(0, 0, 0, 0.5) -1.1em -1.1em 0 0, rgba(0, 0, 0, 0.75) 0 -1.5em 0 0, rgba(0, 0, 0, 0.75) 1.1em -1.1em 0 0;
box-shadow: rgba(0, 0, 0, 0.75) 1.5em 0 0 0, rgba(0, 0, 0, 0.75) 1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) 0 1.5em 0 0, rgba(0, 0, 0, 0.75) -1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) -1.5em 0 0 0, rgba(0, 0, 0, 0.75) -1.1em -1.1em 0 0, rgba(0, 0, 0, 0.75) 0 -1.5em 0 0, rgba(0, 0, 0, 0.75) 1.1em -1.1em 0 0;
}

/* Animation */

@-webkit-keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}

100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}

@-moz-keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}

100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}

@-o-keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}

100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}

@keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}

100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}

 

Change the code in index.html file with following code:

a29

 

Loading

 

Don’t forget to Delete your cookies in IE browser to see the effect of this change.

Select backlog navigation levels for your team in Visual Studio Team Service

 

  1. From your team’s backlog page, click the gear icon (gear icon) to open the common configuration team settings.
    Backlog board, open team settings
  2. Click the Backlogs tab and check the boxes of those backlog levels you want your team to manage.

    Team Services, web portal, team settings dialog, Backlogs tab

  3. To see the changes, open or refresh your team’s backlog web page.

Reff: https://www.visualstudio.com/en-us/docs/work/customize/select-backlog-navigation-levels

VS2013 An exception occurred while initializing the database

I’m doing a code first Entity database

{“An exception occurred while initializing the database. See the InnerException for details.”}

It was working fine, but I decided to delete the physical database to see it recreate it, but it just fails every time.

I get the error

Cannot attach the file ‘C:\ASP\OdeToFood\OdeToFood\App_Data\OdeToFoodDb.mdf’ as database ‘OdeToFoodDb’.”}

Its code first so I don’t understand why its not recreating the database.

 

 

So deleting the file from Visual Studio was a dumb idea.

SQL still has it registered.

Fire up MS Sql Management Tool, connect to the server in my case

(localdb)\v11.0

You will see the database, still exists, delete it, you will get an error. The file doesn’t exist. Refresh and its gone from SQL. Now run your code again and all is good.

So delete the DB from the management tool not visual studio

SQL Server replication requires the actual server name to make a connection to the server

Symptom:

Error Msg: “SQL Server replication requires the actual server name to make a connection to the server”

 

When attempting to create a new replication publication the following error is produced:

New Publication Wizard

SQL Server is unable to connect to server ‘SSSS’.

Additional information:
SQL Server replication requires the actual server name to make a connection to the server. Connections through a server alias, IP address, or any other alternative name are not supported. Specify the actual server name, ‘OOOO’. (Replication.Utilities)

Where “SSSS” is the name of the current server, and (in my case) “OOOO” was the previous name of the same server.

Steps to reproduce this problem:

Microsoft SQL Server Management Studio
Expand the server
Expand Replication
Right click “Local Publications” and select “New Publication …”
Cause:

This error has been observed on a server that had been renamed after the original installation of SQL Server, and where the SQL Server configuration function ‘@@SERVERNAME’ still returned the original name of the server. This can be confirmed by:

select @@SERVERNAME
go

This should return the name of the server. If it does not then follow the procedure below to correct it.

Remedy:

To resolve the problem the server name needs to be updated. Use the following:

sp_addserver ‘real-server-name’, LOCAL

if this gives an error complaining that the name already exists then use the following sequence:

sp_dropserver ‘real-server-name’
go
sp_addserver ‘real-server-name’, LOCAL
go

If instead the error reported is ‘There is already a local server.’ then use the following sequence:

sp_dropserver old-server-name
go
sp_addserver real-server-name, LOCAL
go

Where the “old-server-name” is the name contained in the body of the original error.

Stop and restart SQL Server.

 

 

Reff: http://www.cryer.co.uk/brian/sqlserver/replication_requires_actual_server_name.htm 

Fail2ban unban a IP or Unblock an IP

cd /var/log/

nano fail2ban.loga and search for banned IP address.

 

iptables –L –n

Get the banned type from the output and try the following:

fail2ban-client set ssh-iptables unbanip 192.168.1.101

 

ssh-iptables can be replaces by banned type like “pbx-gui”

 

By simplemsexchange Posted in VOIP

VS 2013 : Project name with number in brackets

In file C:\Users\Username\Documents\IISExpress\config\applicationhost.config, under section

<sites>

</sites>

there was all websites (projects) I have ever opened. I deleted these items and now, on New Website there is no number in brackets. NOTE: I think it is not wise to delete the entire file but only the part that applies to sites/projects.

 

 

Reff: http://forums.asp.net/t/1953275.aspx?Project+name+with+number+in+brackets

Visual Studio 2013 Change the Default Location for Projects

For corporate office user my document is always redirected to a file server where creating exe file is restricted.

1. Create a folder in c drive called: vs 2013

2. Inside that folder create 2 folders

Projects

Templates

3. Inside Templates, create another 2 folders:

ItemTemplates

ProjectTemplates

4. Open visual studio and follow the steps

  • On the Tools menu, select Options.
  • From the Projects and Solutions folder, select General.
  • In the Visual Studio projects location text box, enter a location for files and projects.

 

vs2013

 

And you should be all set.