This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Commands to remove a directory in Linux | |
There are two command to delete a folder in Linux: | |
rmdir command – Deletes the specified empty directories and folders in Linux. | |
rm command – Delete the file including sub-directories. You can delete non-empty directories with rmdir command in Linux. | |
Let us see some examples and usage in details. | |
rmdir command syntax to delete directory in Linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://chromedriver.storage.googleapis.com/index.html?path=76.0.3809.68/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class SerializeHelper | |
{ | |
static byte[] key = { 1, 2, 3, 4, 5, 6, 7, 8 }; | |
static byte[] iv = { 1, 2, 3, 4, 5, 6, 7, 8 }; | |
static DESCryptoServiceProvider des = new DESCryptoServiceProvider(); | |
public static void SerialiZe<T>(T data, string path) | |
{ | |
using (var fs = new FileStream(path, FileMode.Create, FileAccess.Write)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
public static void AutoCreateDirectory(string dpath) | |
{ | |
try | |
{ | |
if (!Directory.Exists(dpath)) | |
{ | |
Directory.CreateDirectory(dpath); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Data.SqlClient; | |
using System.Data; | |
using System.Windows.Forms; | |
using System.Windows.Forms.Design; | |
using System.Windows.Input; | |
using System.Collections.ObjectModel; | |
using System.IO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import json | |
from datetime import datetime, timedelta | |
def printData(data): | |
jsonData = json.loads(data) | |
print('Printing Json Data....') | |
for d in jsonData: | |
s = str(d["date"]) | |
dt=datetime(year=int(s[0:4]), month=int(s[4:6]), day=int(s[6:8])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF EXISTS ( | |
SELECT * FROM sysobjects WHERE id = object_id(N'function_name') | |
AND xtype IN (N'FN', N'IF', N'TF') | |
) | |
DROP FUNCTION function_name | |
GO | |
If you want to avoid the sys* tables, you could instead do (from here in example A): | |
IF object_id(N'function_name', N'FN') IS NOT NULL | |
DROP FUNCTION function_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class ViewModelBase : INotifyPropertyChanged | |
{ | |
/// <summary> | |
/// Multicast event for property change notifications. | |
/// </summary> | |
public event PropertyChangedEventHandler PropertyChanged; | |
/// <summary> | |
/// Checks if a property already matches a desired value. Sets the property and | |
/// notifies listeners only when necessary. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The orginal class was obtained from official site, then I made some desirable changes such as `UpdateOrAdd`, | |
// which I think usefull for others | |
// | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
namespace mynamespace | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAllUrlParams(url) { | |
// get query string from url (optional) or window | |
var queryString = url ? url.split("?")[1] : window.location.search.slice(1); | |
// we'll store the parameters here | |
var obj = {}; | |
// if query string exists | |
if (queryString) { | |
// stuff after # is not part of query string, so get rid of it |