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
//Assume you have a method, m() in class "Framework" inside framework.dll | |
// Fire C# interpreter(a.k.a Roslyn CTP) from your Visual Studio and type the following lines of code. | |
using System.Reflection; | |
Assembly assembly = Assembly.LoadFrom(@"path\to\assembly\framework.dll"); | |
Type framework = assembly.GetType("Framework"); | |
ConstructorInfo cFramework = framework.GetConstructor(Type.EmptyTypes); | |
object oFramework = cFramework.Invoke(new object[] { }); | |
MethodInfo mMethod = framework.GetMethod("m"); |
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.Reflection; | |
string[] pathNames = Directory.GetFiles(@"path\to\library\folder\"); | |
foreach (string path in pathNames) | |
{ | |
Assembly asm = Assembly.LoadFrom(path); | |
object[] attrs = asm.GetCustomAttributes(typeof(DebuggableAttribute), false); | |
Console.WriteLine("{0}:{1}", asm.FullName, (attrs.Length > 0) ? "Release" : "Debug"); | |
} |
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
# You know that `cd ~` will change to your home directory. But, if you want to know how shell expands your ~, you can use 'echo' | |
echo ~ | |
# will show /User/antonydeepak | |
echo Antony{1,2} | |
# shows Antony1 Antony2 |
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 you find an annoying application that started during boot-up but you wanted to stop it thru console, use the following commands | |
#Note: The applications that appears in your menubar are mostly daemons(background processes) and hence our objective is to stop this daemon. | |
launchctl list | |
# This command will use launchctl(your interface to launchd, daemon\service manager for Osx) and lists all the current daemons running in your computer. | |
# The output will display 3 columns of information PID, status and Label. | |
# Search for the Label of the job\daemon\aplication that you wanted to kill. | |
launchctl stop <label> | |
# where <label> is the name of the label for your process. Using this command will stop and quit the application |
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
namespace dotNetPlayGround | |
{ | |
using System; | |
using System.Collections.Generic; | |
public struct Jug | |
{ | |
public int Capacity; | |
public int Filled; | |
public Jug(int capacity,int filled){ |
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; | |
using System.Collections.Generic; | |
namespace dotNetPlayGround | |
{ | |
///<summary> | |
///endpos - position where you can Enqueue | |
///currentpos - position where you can Dequeue | |
///</summary> |
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
namespace dotNetPlayGround | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
/// <summary> | |
/// TODO: Update summary. | |
/// </summary> | |
public class RadixSort | |
{ |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using Mono.Cecil; | |
using System.IO; | |
class Reflect | |
{ |
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
namespace dotNetPlayGround | |
{ | |
using System; | |
using System.IO; | |
using System.Collections.Generic; | |
/// <summary> | |
/// TODO: Update summary. | |
/// </summary> | |
public class ReverseFileCopier | |
{ |
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.ComponentModel; | |
namespace dotNetPlayGround | |
{ | |
public enum DataType : int | |
{ | |
None = 0, | |
[Description("A")] | |
Alpha = 1, |
OlderNewer