Design, Source and Split tabs are missing in Visual Studio 2015?

If the HTML file is in Solution Explorer, then right-click and select “Open With”. Otherwise open it with Open File dialog, but click the small dropdown arrow in the Open button, then select “Open With”. Then select “HTML (Web Forms) Editor with Encoding”. Then you should see the Design, Split and Source buttons. Click Design.

image

ASP.NET: The data protection operation was unsuccessful

the data protection operation was unsuccessful. this may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.

If you receive this error from one of your application, you resolve the problem in this way:

  1. Open IIS Manager
  2. Select Applications Pools, and go ahead and select the App Pool used by your app
  3. Right-click on it, and select Advanced Settings, Go to the Process Model Section and Find the “Load User Profile” Option and set it to True

image

Microsoft's Windows 95 is 20-years-old today

Windows95

When Microsoft kicked off work on Windows 95 way back at the beginning of the 90s, the company wasn't to know how much of an impact it would have on our lives two decades on.

In one fell swoop the new version of Microsoft's OS brought a swish graphical user interface (GUI) to desktops for the first time and the much vaunted Start menu began life inside the mid-1995 edition of the OS. You only need look at the disquiet that surrounded its removal from Windows 8 and subsequent return inside Windows 8.1 and Windows 10 to realise how influential some parts of Windows 95 still are.

With 20 years under its belt, it's a fine time to have a look back at some of the moments that defined the popular OS which was Windows 95.

Now it’s the new era, Windows10 age.

Visual Studio 2015: upgrade all NuGet packages at one time

image

Open the Package Manager Console and use the Update-Package cmd-let to update all packages.

If this doesn't work, you have other two solution. Always in Package Manager Console you type one of those:

First solution
  1. $list = Get-package -project {Add project name here} for($i=0; $i -lt $list.Length;$i ++ ) { Update-Package -project {Add project name here} $list[$i].Id }

Replace {Add project name here} with your project name without braket

Second solution
  1. foreach ($p in get-project -all) { update-package -ProjectName $p.ProjectName }

 

Happy coding!

How to truncate log file in SQL Server

In SQL Server data is stored using two physical files:

  1. (.mdf) extension which contains the data.
  2. (.ldf) extension which contains log.

Log file size increases very rapidly and depend on the operation performed on the data. After a long time period this file becomes too large. When log file is too large it takes time to perform some operations like (attach, de-attach, backup, restore... etc ).

Step 1. Copy/type the below given SQL.

Step 2. Change @DBName to <Database Name>, @DBName_log to <Log File Name>

Step 3. Execute the SQL.

ALTER DATABASE @DBName SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE(@DBName_log, 1)
ALTER DATABASE @DBName SET RECOVERY FULL WITH NO_WAIT
GO  

Amazon, Kindle e Liquavista: novità importanti, ma non per forza a colori

Amazon, Liquavista e un inedito ebook reader a colori, è una di quelle storie che di tanto in tanto vengono fuori in cerca di conferme. Sappiamo che Liquavista fa parte dell'azienda di Jeff Bezos dalla primavera 2013, da quando Samsung ne ha ceduto la proprietà dopo aver cercato di capire come sfruttare quella particolare tecnologia su tablet ed ebook reader. Da allora non è più successo nulla.

Ora Amazon pubblica il video "Meet the Liquavista Team" nel suo canale Youtube, e sostituisce il vecchio logo di liquavista.com con uno nuovo e moderno. E il tutto avviene a ridosso del periodo autunnale, del fine estate, storicamente il momento buono per la presentazione dei nuovi Kindle. Può essere un caso? Forse, ma tutta l'operazione ricorda le attività che si fanno per dare vita ad un marchio, per introdurlo e per crearci una storia. D'altro canto, perché Amazon avrebbe dovuto presentare ufficialmente l'acquisizione di Liquavista solo adesso, solo 2 anni dopo?

Liquavista non significa solo schermi a colori, ma anche pannelli in bianco e nero (sarebbe più corretto dire: scala di grigi) basati sulle stesse logiche di funzionamento ma con una riflettanza e un rapporto di contrasto davvero vicino alla carta stampata. Se un E-Ink Carta arriva al 44% di riflettanza e 15:1 di contrasto, un Liquavista fa 60% e 12:1. La carta stampata è su 70-80% e 12:1.

Kindle Textbook Creator è ora disponibile in italiano

Kindle Textbook Creator

Amazon ha rilasciato Kindle Textbook Creator, il proprio software dedicato alla creazione ed impaginazione di libri di testo e altri contenuti a scopo didattico ha ricevuto un importante aggiornamento che ha introdotto la localizzazione in numerosi paesi, tra i quali figura l’italiano, oltre a francese, tedesco, spagnolo, portoghese, brasiliano e olandese. 


Gli autori possono ora creare libri per l’apprendimento anche in lingua straniera, raggiungendo in questo modo studenti provenienti da ogni angolo del mondo. Quest’ultimi potranno usufruire dei sopracitati contenuti attraverso le applicazioni di lettura Kindle, disponibili gratuitamente per iPad, iPhone, dispositivi Android, oppure Mac e PC Windows.

La nuova versione di Kindle Textbook Creator è scaricabile a questo indirizzo.

UWA: This application can only run in the context of an AppContainer

  1. Run it from VS (with or without debugging). This will actually install unpackaged version of your app, so you will see it in the start screen.
  2. Create a package to use locally. You can do this in VS by going to Store → Create App Package → Build a package to use only locally. This will create a bunch of files, including a command-line script that will actually install the app. You probably could use this method to distribute the app, but it would work only on developer-enabled computers.
  3. Publish your app to the Store. This is the only way you should use to distribute the apps to ordinary users.

Microsoft now has six million Windows Insiders

Windows10-six-million-insider

In a video posted earlier (see it below), Microsoft CEO Satya Nadella once again accepted the challenge of former NFL player Steve Gleason, who suffers from ALS, and poured a bucket of ice cold water over his head along with Terry Myerson and members of the Windows 10 team.

At the same time, Myerson, head of the Windows and Devices division, confirmed that six million have signed up to the Windows Insider program that sees users able to test preview releases of Windows 10 and Windows 10 Mobile, according to Windows Central.

Windows Insiders were among the first ones to get their hands on Windows 10 when it was in full preview mode and the next version of Microsoft's mobile OS is currently being tested by those people that are still a part of the program.

Over 20 million installs

Becoming a Windows Insider is easy and there are plenty that have decided to remain a part of the program for Windows 10 despite the fact that it is out in all its unadulterated glory.

Windows 10, which was released two weeks ago, has, depending on where you look, already achieved well over 20 million installs and figures released yesterday suggest that it is well ahead of the adoption rates enjoyed by Windows 8 in its first six months, let alone two weeks.

C# Console Progress Bar

At work, I sometimes find myself needing to make Console applications which take some time. For example, I have a few console applications which parse dump files into objects and then insert the data into a database. Usually, I represent the progress of these applications with a simple incremental percentage display, however I thought I'd create a generic method which would display an ASCII progress bar.

ConsoleApp_ProgressBar

At work, I sometimes find myself needing to make Console applications which take some time. For example, I have a few console applications which parse dump files into objects and then insert the data into a database. Usually, I represent the progress of these applications with a simple incremental percentage display, however I thought I'd create a generic method which would display an ASCII progress bar.

ProgressBar Class
  1. using System;
  2. using System.Text;
  3. using System.Threading;
  4.  
  5. namespace ConsoleApplication1
  6. {
  7.     /// <summary>
  8.     /// An ASCII progress bar
  9.     /// </summary>
  10.     public class ProgressBar : IDisposable, IProgress<double>
  11.     {
  12.         private const int blockCount = 10;
  13.         private readonly TimeSpan animationInterval = TimeSpan.FromSeconds(1.0 / 8);
  14.         private const string animation = @"|/-\";
  15.         private bool showProgressBar = true;
  16.  
  17.         private readonly Timer timer;
  18.  
  19.         private double currentProgress = 0;
  20.         private string currentText = string.Empty;
  21.         private bool disposed = false;
  22.         private int animationIndex = 0;
  23.  
  24.         public ProgressBar(bool ShowProgressBar = true)
  25.         {
  26.             showProgressBar = ShowProgressBar;
  27.             timer = new Timer(TimerHandler);
  28.  
  29.             // A progress bar is only for temporary display in a console window.
  30.             // If the console output is redirected to a file, draw nothing.
  31.             // Otherwise, we'll end up with a lot of garbage in the target file.
  32.             if (!Console.IsOutputRedirected)
  33.             {
  34.                 ResetTimer();
  35.             }
  36.         }
  37.  
  38.         public void Report(double value)
  39.         {
  40.             // Make sure value is in [0..1] range
  41.             value = Math.Max(0, Math.Min(1, value));
  42.             Interlocked.Exchange(ref currentProgress, value);
  43.         }
  44.  
  45.         private void TimerHandler(object state)
  46.         {
  47.             lock (timer)
  48.             {
  49.                 if (disposed) return;
  50.  
  51.                 string text = "";
  52.                 if (showProgressBar)
  53.                 {
  54.                     int progressBlockCount = (int)(currentProgress * blockCount);
  55.                     int percent = (int)(currentProgress * 100);
  56.                     text = string.Format("[{0}{1}] {2,3}% {3}",
  57.                            new string('#', progressBlockCount), new string('-', blockCount - progressBlockCount),
  58.                            percent,
  59.                            animation[animationIndex++ % animation.Length]);
  60.                 }
  61.                 else
  62.                 {
  63.                     text = animation[animationIndex++ % animation.Length].ToString();
  64.                 }
  65.                 UpdateText(text);
  66.  
  67.                 ResetTimer();
  68.             }
  69.         }
  70.  
  71.         private void UpdateText(string text)
  72.         {
  73.             // Get length of common portion
  74.             int commonPrefixLength = 0;
  75.             int commonLength = Math.Min(currentText.Length, text.Length);
  76.             while (commonPrefixLength < commonLength && text[commonPrefixLength] == currentText[commonPrefixLength])
  77.             {
  78.                 commonPrefixLength++;
  79.             }
  80.  
  81.             // Backtrack to the first differing character
  82.             StringBuilder outputBuilder = new StringBuilder();
  83.             outputBuilder.Append('\b', currentText.Length - commonPrefixLength);
  84.  
  85.             // Output new suffix
  86.             outputBuilder.Append(text.Substring(commonPrefixLength));
  87.  
  88.             // If the new text is shorter than the old one: delete overlapping characters
  89.             int overlapCount = currentText.Length - text.Length;
  90.             if (overlapCount > 0)
  91.             {
  92.                 outputBuilder.Append(' ', overlapCount);
  93.                 outputBuilder.Append('\b', overlapCount);
  94.             }
  95.  
  96.             Console.Write(outputBuilder);
  97.             currentText = text;
  98.         }
  99.  
  100.         private void ResetTimer()
  101.         {
  102.             timer.Change(animationInterval, TimeSpan.FromMilliseconds(-1));
  103.         }
  104.  
  105.         public void Dispose()
  106.         {
  107.             lock (timer)
  108.             {
  109.                 disposed = true;
  110.                 UpdateText(string.Empty);
  111.             }
  112.         }
  113.     }
  114. }

 

Program.cs
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ConsoleApplication1
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             Console.Write("Performing some task... ");
  15.             using (var progress = new ProgressBar())
  16.             {
  17.                 for (int i = 0; i <= 1000; i++)
  18.                 {
  19.                     progress.Report((double)i / 100);
  20.                     Thread.Sleep(20);
  21.                 }
  22.             }
  23.             Console.WriteLine("Done.");
  24.         }
  25.     }
  26. }

The code itself is pretty self explanatory and probably more verbose than it really needs to be, but it gets the job done and looks good.

Advertsing

125X125_06

Planet Xamarin

Planet Xamarin

Calendar

<<  November 2017  >>
MonTueWedThuFriSatSun
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Month List