TrueCoder# System initializing ...
TrueCoder# _
Notes: - Installation: Extract ALL context from the downloaded archive into %FarHome%\Plugins\FarColorer folder. It's important to name the folderFarColorer ; otherwise you wan't be able to enable the plugin. - My personal favor style: "Xmas Tree" - Use colorer in viewer: Generaly FarManager's viewer doesn't support pluggin in Colorer, BUT you can use "colorer.exe" from the Colorer's "bin" folder as alternative viewer:╔══════════════════════ Edit file associations ═════════════════════════════════════════════════════════════════════════╗ ║ A file mask or several file masks: ║ ║ *.* ↓║ ║ Description of the association: ║ ║ ║ ╟───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢ ║ [ ] Execute command (used for Enter): ║ ║ ║ ║ [ ] Execute command (used for Ctrl-PgDn): ║ ║ ║ ║ [ ] View command (used for F3): ║ ║ ║ ║ [x] View command (used for Alt-F3): ║ ║ %FarHome%\Plugins\FarColorer\bin\colorer.exe -c %FarHome%\Plugins\FarColorer\base\catalog.xml -v "!\!.!" ║ ║ [ ] Edit command (used for F4): ║ ║ ║ ║ [ ] Edit command (used for Alt-F4): ║ ║ ║ ╟───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢ ║ { OK } [ Cancel ] ║ ╚═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
Alt-Shift-Ins
- copy full path to clipboardFunction.prototype.inContext = function(context){ var func = this; return function(){ return func.apply(context, arguments); }; };Use:
getRemoteCircumference: function(url) { $.getJSON(url, this.getCircumference.inContext(this)); }
oColumn.asSorting is undefined
(function($) { $.fn.outerHTML = function() { return $(this).clone().wrap('').parent().html(); } })(jQuery);Source: http://stackoverflow.com/questions/2419749/jquery-get-selected-elements-outer-html
cleartool lsh -fmt "%o%m\1%Nd\1%u\1%En\1%Vn\1%Nc\2\n" -recurse .
%ProgramFiles(x86)%\Microsoft Team Foundation Server 2012 Power Tools\TFPT.EXE uu . /noget /recursive
private static int GetMaxJsonLength() { string str = HttpContext.Current.Request.ApplicationPath.ToString(); Configuration conf = WebConfigurationManager.OpenWebConfiguration(str); const string sectionName = "system.web.extensions/scripting/webServices/jsonSerialization"; ScriptingJsonSerializationSection section = (ScriptingJsonSerializationSection)conf.GetSection(sectionName); return section.MaxJsonLength; }source http://geekswithblogs.net/frankw/archive/2008/08/05/how-to-configure-maxjsonlength-in-asp.net-ajax-applications.aspx#441926
wevtutil cl <LogName> [/bu: <backup_file_name>]
For example, to clear Application Event Log:
wevtutil cl Application
Source: http://technet.microsoft.com/en-us/library/cc722318.aspx
$('<audio controls id="zzz"><source src="http://translate.google.com/translate_tts?ie=UTF-8&q=привет&tl=ru&total=1&idx=0&textlen=6" type="audio/mpeg"/></audio>').appendTo($("hr"))
protected bool DebugMode { get { System.Web.Configuration.CompilationSection tSection; tSection = ConfigurationManager.GetSection("system.web/compilation") as System.Web.Configuration.CompilationSection; if (null != tSection) { return tSection.Debug; } /* Default to release behavior */ return false; } }
Console.Write("\nPlease enter the URI to post data to : "); String uriString = Console.ReadLine(); // Create a new WebClient instance. WebClient myWebClient = new WebClient(); Console.WriteLine("\nPlease enter the fully qualified path of the file to be uploaded to the URI"); string fileName = Console.ReadLine(); Console.WriteLine("Uploading {0} to {1} ...",fileName,uriString); // Upload the file to the URI. // The 'UploadFile(uriString,fileName)' method implicitly uses HTTP POST method. byte[] responseArray = myWebClient.UploadFile(uriString,fileName); // Decode and display the response. Console.WriteLine("\nResponse Received.The contents of the file uploaded are:\n{0}", System.Text.Encoding.ASCII.GetString(responseArray));Server side - the ASPX file the client connects to.
<%@ Import Namespace="System"%> <%@ Import Namespace="System.IO"%> <%@ Import Namespace="System.Net"%> <%@ Import NameSpace="System.Web"%>Upload complete.
// First: less strict check, this will give us the missing items in the error message CollectionAssert.AreEquivalent(expected.ToList(), actual.ToList()); // really helpful error message! // CollectionAssert.AreEquivalent failed. The expected collection contains 1 // occurrence(s) of <b>. The actual collection contains 0 occurrence(s). // Second: check items order. CollectionAssert.AreEqual(expected.ToArray(), actual.ToArray()); // Helpful failure message! // CollectionAssert.AreEqual failed. (Element at index 1 do not match.)
<?xml version="1.0"?> <configuration> <system.diagnostics> <switches> <add name="XmlSerialization.Compilation" value="1" /> </switches> </system.diagnostics> <system.xml.serialization> <xmlSerializer tempFilesLocation="c:\foo"/> </system.xml.serialization> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup> </configuration>Sources:
public static bool IsDotNetProcess(this Process process) { var modules = process.Modules.Cast().Where( m => m.ModuleName.StartsWith("mscor", StringComparison.InvariantCultureIgnoreCase)); return modules.Any(); }
using System; using System.Text; using System.Runtime.InteropServices; public class Utils { public static bool IsNetAssembly(string path) { var sb = new StringBuilder(256); int written; var hr = GetFileVersion(path, sb, sb.Capacity, out written); return hr == 0; } [DllImport("mscoree.dll", CharSet = CharSet.Unicode)] private static extern int GetFileVersion(string path, StringBuilder buffer, int buflen, out int written); }
ICorPublish publish = new ICorPublish(); ICorPublishProcess process; process = publish.GetProcess(PidToCheck); if (process == null || !process.IsManaged) { // Not managed. }
libcheck -store MyAssembly.dll Metadata_Version01 -full MyProgramm_v1\bin
libcheck -store MyAssembly.dll Metadata_Version02 -full MyProgramm_v2\bin
libcheck -compare Metadata_Version01 Metadata_Version02
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="temp"/>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0.30319" />
</startup>
</configuration>
MyList list; // NOTE: this is allocated on STACK try { list.Add(new int(3)); return; } finally { // WARNING: destructor for local var already executed => list already been disposed for(int i = 0; i < l.size();i++) { // MEMORY LEACK delete list[i]; // ATTENTION: this will NEVER run, since list is alread disposed } list.RemoveAll(); }
public static string GetChromeURL(IntPtr hWnd) { var windowElement = AutomationElement.FromHandle(hWnd); AutomationElement editElement = windowElement.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Edit)); var editValuePattern = editElement.GetCurrentPattern(ValuePattern.Pattern) as ValuePattern; var urlText = editValuePattern.Current.Value.ToString(); return urlText; }Sources:
AppDomain domain = AppDomain.CreateDomain("tempDomain");And to load an assembly into the application domain:
AssemblyName assemblyName = AssemblyName.GetAssemblyName(assemblyPath); Assembly assembly = domain.Load(assemblyName);To unload the application domain:
AppDomain.Unload(domain);Source: http://stackoverflow.com/a/14312/938883
%LOCALAPPDATA%\Microsoft\VisualStudio\11.0\ComponentModelCache
ORM (NHibernate or Entity Framework) OOD/Design Patterns/IOC TDD/ATDD Agile Web Services / Rest API