Quantcast
Channel: Developers & Friday
Browsing latest articles
Browse All 30 View Live

Image may be NSFW.
Clik here to view.

SQL script to view sizes of all tables

SELECT t.NAME AS TableName, p.rows AS RowCounts, SUM(a.total_pages) * 8 AS TotalSpaceKB, SUM(a.used_pages) * 8 AS UsedSpaceKB, (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB FROM...

View Article



Image may be NSFW.
Clik here to view.

Override EF 5 database mapping

public class UserRepo { private UserContext _context; public UserRepo(UserContext context) { _context = context; } public User Save(User user) { if (user.Id <= 0) { _context.Users.Add(user); }...

View Article

Image may be NSFW.
Clik here to view.

SelectListItem Helper to create selectlistitems from enum

first, we create a extension method to get the descriptions of enum values. public static string ToDescription<T>(this T enumValue) where T : struct, IConvertible, IComparable,...

View Article

Image may be NSFW.
Clik here to view.

C# 6 null check

Like nullable types, null-conditional operators can be used now. Just put a ‘?’ (question mark) after the instance before calling the property on top of it. You don’t have to write additional if...

View Article

Image may be NSFW.
Clik here to view.

Recovering deleted files from an svn repository

To recover a file from svn that you deleted from your local repository, it’s first necessary to get the proper name of the file, and the revision of the repository it last existed in.  To do that...

View Article


Image may be NSFW.
Clik here to view.

Vagrant

Vagrant provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the...

View Article

Image may be NSFW.
Clik here to view.

Cassandra tips

Use short column names Column names take space in each cell, and if you use a big clustering key, it will be copied all over your clustered cells. Eventually, we have found in some situations that...

View Article

Image may be NSFW.
Clik here to view.

SQLCMD to export sql data

export to a csv sqlcmd -S . -d DatabaseName -E -s',' -W -Q "SELECT * FROM TableName" > C:\Test.csv

View Article


Image may be NSFW.
Clik here to view.

Setup a private nuget server

Deploy nuget server project Nuget Server package on nuget.org: https://www.nuget.org/packages/NuGet.Server/2.11.3/ The project source: https://github.com/NuGet/NuGet.Server deploy the project to IIS,...

View Article


Image may be NSFW.
Clik here to view.

git merge vs rebase

Rebasing and merging are both designed to integrate changes from one branch into another branch but in different ways. If you have a feature branch, REBASE: you want to rebase the feature branch onto...

View Article
Browsing latest articles
Browse All 30 View Live




Latest Images