http://www.jsonschema2pojo.org/
Handles Gson annotations too.
http://www.jsonschema2pojo.org/
Handles Gson annotations too.
.\get-installedapp -appname "*SQL*SERVER*" -matchall | select-object -expandproperty AppID | foreach-object { "msiexec /x ""$_""" } > uninstall.bat
To see what applications the above command would remove, run this first:
.\get-installedapp -appname "*SQL*SERVER*" -matchall | select-object AppName,AppID
References:
http://windowsitpro.com/scripting/auditing-32-bit-and-64-bit-applications-powershell
In the list you want to perform the comparison against, override Equals
[Serializable] public class AlertSubscriptionOption { .. . /// <summary> /// Determines whether the specified <see cref="System.Object" />, is equal to this instance. /// </summary> /// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param> /// <returns> /// <c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>. /// </returns> public override bool Equals(object obj) { // Check for null values and compare run-time types. if (obj == null || GetType() != obj.GetType()) return false; AlertSubscriptionOption p = (AlertSubscriptionOption)obj; return this.SubType == p.SubType; }
Now, to compare the 2 lists, perform the following
bool subscriptionEmailDifferent = false; subscriptionEmailDifferent = (newSubscriptionEmailOptions.Count > 0 || oldSubscriptionEmailOptions.Count > 0) && !newSubscriptionEmailOptions.OrderBy(x => x.SubType).ToList().SequenceEqual(oldSubscriptionEmailOptions.OrderBy(x => x.SubType).ToList());
References:
http://stackoverflow.com/questions/12795882/quickest-way-to-compare-two-list
http://stackoverflow.com/questions/188141/list-orderby-alphabetical-order
<%@ Page Language="C#" %> <!DOCTYPE html> <script runat="server"> [System.Web.Services.WebMethod] public static string GetCurrentTime(string name) { return "Hello " + name + Environment.NewLine + "The Current Time is: " + DateTime.Now.ToString(); } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <script src="Scripts/jquery-2.1.3.min.js" type="text/javascript"></script> <script type="text/javascript"> function ShowCurrentTime() { $.ajax({ type: "POST", url: "Default.aspx/GetCurrentTime", data: '{name: "' + $("#<%=txtUserName.ClientID%>")[0].value + '" }', contentType: "application/json; charset=utf-8", dataType: "json", success: OnSuccess, failure: function (response) { alert(response.d); } }); } function OnSuccess(response) { //alert(response.d); $("#DivShowAfterClick").append("<p>" + response.d + "</p>"); $("#DivShowAfterClick").toggle(); } </script> <div> Your Name : <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox> <input id="btnGetTime" type="button" value="Show Current Time" onclick="ShowCurrentTime()" /> </div> <div id="DivShowAfterClick" runat="server">This should be invisible until button clicked.</div> </form> </body> </html>
Source: http://aspsnippets.com/Articles/Call-ASPNet-Page-Method-using-jQuery-AJAX-Example.aspx
/// <summary> /// Objects to XML. /// </summary> /// <param name="output">The output.</param> /// <returns></returns> public static string ObjectToXml(object output) { string objectAsXmlString; System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(output.GetType()); using (System.IO.StringWriter sw = new System.IO.StringWriter()) { try { xs.Serialize(sw, output); objectAsXmlString = sw.ToString(); } catch (Exception ex) { objectAsXmlString = ex.ToString(); } } return objectAsXmlString; }
<p>Already have an online account? <a href="#" id="aLoginForStreamlined">Log in for a streamlined experience</a>.</p> <div id="DivLoginForm" style="display: none"> Content To Hide/Show Here! </div> <asp:HiddenField ID="hdnLoginFormState" runat="Server" Value="0" /> <script> // Retain Login Form expansion/contraction state between postbacks $(document).ready(function () { var hdnState = $('#<%=hdnLoginFormState.ClientID %>').val(); if (hdnState == "0") { $("[id$='DivLoginForm']").hide(); } else { $("[id$='DivLoginForm']").show(); } $('a#aLoginForStreamlined').click(function () { $("[id$='DivLoginForm']").toggle(); var oldValue = $('#<%=hdnLoginFormState.ClientID %>').val(); var newValue = (oldValue == 0) ? "1" : "0"; $('#<%=hdnLoginFormState.ClientID %>').val(newValue); return false; }); }); </script>
/// <summary> /// Gets the application log4net log instance. /// </summary> /// <value>The log.</value> public ILog log { get { return LogManager.GetLogger("AppLogger"); } } void Application_Start(object sender, EventArgs e) { // Code that runs on application startup log4net.Config.XmlConfigurator.Configure(); }
<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/> </configSections> <appSettings> </appSettings> <log4net> <appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender"> <file value="Logs/application.log"/> <appendToFile value="true"/> <rollingStyle value="Composite"/> <datePattern value="yyyyMMdd"/> <maxSizeRollBackups value="10"/> <maximumFileSize value="5MB"/> <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%n DATE: %date{MM/dd/yyyy HH:mm:ss} %n THREAD: [%thread] %n LEVEL: %-5level %n USER ID: %identity %n CLASS: %type{1} %n METHOD: %M %n LOCATION: %location %n MESSAGE: %message %n "/> </layout> </appender> <root> <level value="DEBUG"/> <appender-ref ref="LogFileAppender"/> </root> </log4net> </configuration>
class Program { /// <summary> /// Logging /// </summary> //private readonly ILog Logger = DecisionLogManager.GetLogger(typeof(UC4Request)); private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
catch (Exception ex) { // Log to local log file log.Error("Error", ex); }
log.Info(responseOutput + Environment.NewLine + Base.HelperFunctions.ObjectToString(keywordClientReply, DisplayMode.HTML) );
<%@ Page Language="C#" AutoEventWireup="true" Trace="true" TraceMode="SortByCategory" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>ASP.NET Diagnostic Page</title> </head> <body> <form id="form1" runat="server"> <h2>Environment Variables</h2> <pre> <table> <% var variables = Environment.GetEnvironmentVariables(); foreach (DictionaryEntry entry in variables) { Response.Write("<tr><td>"); Response.Write(entry.Key); Response.Write("</td><td>"); Response.Write(entry.Value); Response.Write("</td></tr>"); } %> </table> </pre> <h2>Misc</h2> <pre> Response.Filter = <%= Request.Filter.ToString() %> Request.ApplicationPath = <%= Request.ApplicationPath %> Request.PhysicalApplicationPath = <%= Request.PhysicalApplicationPath %> Request.PhysicalPath = <%= Request.PhysicalPath %> Request.UrlReferrer = <%= Request.UrlReferrer %> Request.UserLanguages = <%= string.Join(",", (Request.UserLanguages ?? new string[0])) %> </pre> </form> </body> </html>
Source: http://www.codeproject.com/Articles/229356/ASP-NET-Diagnostic-page-to-dump-ASP-NET-and-Enviro
To re-enable the Create Unit Tests… menu, go to Tools->Customize… to launch the Customize dialog. At the Customize dialog, go to the Commands tab, select the Context menu radio button and choose Editor Context Menus | Code Window.
You will realized that the menu item is actually available in the context menu. 🙂 The VS developers were kind enough to leave it there for us. *HeHe* Click on the Create Unit Tests… menu item and click either Move Up or Move Down. [Note: My screenshot is showing Create Unit Test in singular because I had previously tried to rename it]. Then click Close.
Restart Visual Studio 2012 and whalla! The context menu will be available!