working on it ...

Filters

Explore Public Snippets

Sort by

Found 10k snippets matching: personal

    public by cghersi @ MailUp API DEV  113000  11  5  0

    How to Retrieve your personal information with MailUp .NET SDK

    This snippet takes advantage of the MailUp .NET SDK to setup the secure communication towards the server through OAuth2 two leg authentication. You can start digging into the MailUP API world by reading this content: http://help.mailup.com/display/mailupapi/REST+API An instance of MailUpClient class is able to manage one user at a time. A MailU
    public static void GetPersonalDataFields(string clientID, string clientSecret, string username, string password)
    {
        // 1) Setup the MailUp Client:
        MailUpClient client = new MailUpClient(clientID, clientSecret);
        try
        {
            client.RetrieveAccessToken(username, password);
        }
        catch (MailUpException ex)
        {
            Console.WriteLine("Unable to access the service due to " + ex.Message);
            return;
        }
    
        // 2) Prepare the input:
        //nothing to do here...
    
        // 3) Invoke the web method:
        CollectionOf<ConsoleDynamicFieldItem> result = null;
        try
        {
            result = client.GetPersonalDataFields();
        }
        catch (Exception ex)
        {
            Console.WriteLine("Cannot perform the operation due to " + ex.Message);
            return;
        }
    
    
        if (result != null)
            Console.WriteLine("Personal Data Fields Retrieved: " + result.Count);
        else
            Console.WriteLine("Cannot retrieve Personal Data Fields.");
    }
    

    public by cghersi @ MailUp API DEV  837  7  5  0

    How to Update the information of a recipient with MailUp .NET SDK

    This snippet takes advantage of the MailUp .NET SDK to setup the secure communication towards the server through OAuth2 two leg authentication. You can start digging into the MailUP API world by reading this content: http://help.mailup.com/display/mailupapi/REST+API An instance of MailUpClient class is able to manage one user at a time. A MailU
    public static void UpdateRecipient(string clientID, string clientSecret, string username, string password)
    {
        // 1) Setup the MailUp Client:
        MailUpClient client = new MailUpClient(clientID, clientSecret);
        try
        {
            client.RetrieveAccessToken(username, password);
        }
        catch (MailUpException ex)
        {
            Console.WriteLine("Unable to access the service due to " + ex.Message);
            return;
        }
    
        // 2) Prepare the input:
        ConsoleRecipientItem recipient = new ConsoleRecipientItem()
        {
            Email = "test@mailup.com",
            Name = "Changed Recipient" + DateTime.Now.ToFileTimeUtc(),
            Fields = new List<ConsoleRecipientDynamicFieldItem>()
            {
                new ConsoleRecipientDynamicFieldItem() { Id = 1, Value = "Name" + DateTime.Now.ToFileTimeUtc() },
                new ConsoleRecipientDynamicFieldItem() { Id = 2, Value = "LastName" + DateTime.Now.ToFileTimeUtc() }
                //here you can add all the fields you want to change...
            }
        };
    
        // 3) Invoke the web method:
        ConsoleRecipientItem result = null;
        try
        {
            result = client.UpdateRecipient(recipient);
        }
        catch (Exception ex)
        {
            Console.WriteLine("Cannot perform the operation due to " + ex.Message);
            return;
        }
    
        // 4) Print results:
        if (result != null)
            Console.WriteLine("Recipient updated; new name is:" + result.Name);
        else
            Console.WriteLine("An error occurred while updating the recipient.");
    }
    

    public by Spencer Baumgardner  358  0  3  0

    Clojure is for type B personalities

    Clojure is for type B personalities: clojure_is_for_type_b_personalities.md
    The other day, I was wondering why Clojure fits my brain so well. I think I was relaxing on my old couch, drinking cheap beer, eating a gas station pastry, and drawing doodles on a stack of overdue bills I forgot to pay. Little did I realize, these things are all connected.
    
    I have a hypothesis that people choose programming languages based on their personality. For the purposes of this write-up, I’ll use the well-known distinction between type A and type B people. This may be pop psychology stuff, but it’s convenient for my point so in the spirit of American politics I will treat it as fact.
    
    ## Type A vs Type B
    
    Type A people are very organized, competitive, punctual, and like to plan ahead. When I was a kid, these were the ones who had perfect grades, competed in track or swimming, and on top of that they were nice people so I couldn't even hate the fuckers. Type B people, on the other hand, are laid back and like to do things spontaneously. Like The Dude from *The Big Lebowski*, they are comfortable with unknowns and rely on serendipity to guide them.
    
    Here's the hypothesis: As programmers, type A people gravitate towards languages that are stricter and require more up-front work to get code to run. This includes static typing and compiler-enforced style rules. In contrast, type B people prefer languages that enforce very little at compile-time. They place more value on the ability to change a live program with a REPL, so they can make quick, spontaneous changes with little pre-planning.
    
    ## Top Down vs Bottom Up
    
    Type A people prefer a "top down" methodology, modeling everything in types and planning out the architecture before any functionality is implemented. You see this in the "API first" approach in object-oriented languages like Java. You also see it in ML family languages like Haskell, where you are often advised to follow type-driven development (writing type signatures before implementing anything).
    
    Type B people prefer a "bottom up" methodology, immediately implementing functionality and interactively building on previous work until a larger structure emerges organically. You see this in the Lisp community, where REPL-driven development is the norm. The notion of starting from the bottom is also reflected in the prose of a well-known Canadian rapper who claims to come from humble beginnings.
    
    ## Kobe vs Shaq
    
    As a fan of both basketball and pointless sidetracking, I'll take a moment to bring up my favorite example of this psychological dichotomy. Kobe epitomizes the type A persona. He was obsessively competitive and had an [inhuman work ethic](https://www.reddit.com/r/nba/comments/2dzolu/compilation_of_kobe_bryant_stories/). There is no doubt in my mind that Kobe wouldn't even begin building a Twitter clone until he had it all mapped out in diagrams and type signatures, and had all contributors sign a blood pact that their first born would be sacrificed if they violated whitespace conventions.
    
    Shaq was an entirely different beast. His laziness is perhaps equally legendary, and is one of the reasons he [feuded with his teammate](https://en.wikipedia.org/wiki/Shaq%E2%80%93Kobe_feud). It's been said that Shaq played basketball to do all the things he really wanted to do: making terrible movies, rapping about Kobe eating his ass, and [holding things](https://www.reddit.com/r/shaqholdingthings). Shaq's Twitter clone would be running directly out of his own personal REPL session, projected next to his indoor pool so he could hack on production code by shining a laser pointer from his floating lounge chair.
    
    ## Better for what?
    
    A top-down approach seems ideal for well-understood problems where correctness is the most important attribute. If you're making accounting software, or the avionics software for a plane, you're not necessarily blazing any trails. You have a list of requirements, and you need to satisfy them with minimal defects -- especially if money and lives are on the line.
    
    A bottom-up approach works well for projects with a lot of unknowns, like artificial intelligence or anything artistic. Paul Simon didn't come up with *The Sound of Silence* from a list of requirements. He sat in his bathroom with the lights off and riffed on his guitar until genius poured out. It's no accident that there are Clojure projects like [Overtone](https://github.com/overtone/overtone) and [Quil](https://github.com/quil/quil). A REPL session is the programmer's guitar riff.
    
    ## Culture Shock
    
    Your personality is a deep-seated and, yes, *personal* thing. When you are confronted with someone with an opposite personality, it's not uncommon to feel a visceral reaction. When a type A programmer looks at a type B programmer's code, they see an unmaintainable mess. When the reverse happens, they see an over-architected nightmare. Both may very well be right.
    
    Clojure author Rich Hickey is an obvious example of a type B programmer. He's a brilliant language designer and public speaker, but he has coding habits that drive type A people batty. Clojure's code has a notoriously [weird Java indentation style](https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/ARef.java), he often commits [his personal IntelliJ files](https://github.com/clojure/clojure/commit/36d665793b43f62cfd22354aced4c6892088abd6), and it isn't hard to find his [commented REPL scratch pad](https://github.com/clojure/clojure/blob/59b65669860a1f33825775494809e5d500c19c63/src/clj/clojure/zip.clj#L281) in random places. He also looks a bit like The Dude.
    
    ## Stop the War
    
    When looking at languages through this lens, it becomes obvious that a lot of internet flamewars are predicated not on objective disagreements, but subjective personality differences. It explains why some people use a language like Clojure and are immediately smitten, while others have an allergic reaction.
    
    The correct -- though pathetically diplomatic -- take-away from this is that both sides are right. The type A programmers are right that correctness and uniformity is important for building robust, maintainable software. The type B programmers are right that a tight feedback loop and experimentation is important for building simple, innovative software.
    
    Maybe some day we will figure out how to get the benefits of both. If you think we already have, and that your favorite language provides the answer, you probably haven't thought hard enough about the problem. Beneath that cold, rational shell, you are a warm-blooded mammal with a unique emotional tapestry that reveals itself in every line of code you write.
    
    

    public by cghersi  3165  1  7  1

    Find worst SQL performing queries

    You might have seen a number of queries which provides you with top 10 or top 5 worst performing queries either by Logical IO’s or by CPU time or by Elapsed Time.. I have similar query but it does many more thing. I personally do not query either by total logical reads or total cpu time or total elapsed time individually. I usually use this quer
    with PerformanceMetrics
    as
    (
    select
    --dest.text,
    --statement_start_offset,
    --statement_end_offset,
    --LEN(dest.text) ln,
    substring
    (
    dest.text,
    statement_start_offset/2,
    case when statement_end_offset = -1 then LEN(dest.text)
    else statement_end_offset
    end /2
    ) as 'Text of the SQL' ,
    deqs.plan_generation_num as 'Number of times the plan was generated for this SQL',
    execution_count as 'Total Number of Times the SQL was executed',
    DENSE_RANK() over(order by execution_count desc) as 'Rank of the SQL by Total number of Executions',
    total_elapsed_time/1000 as 'Total Elapsed Time in ms consumed by this SQL',
    DENSE_RANK() over(order by total_elapsed_time desc) as 'Rank of the SQL by Total Elapsed Time',
    Max_elapsed_time/1000 as 'Maximum Elapsed Time in ms consumed by this SQL',
    min_elapsed_time/1000 as 'Minimum Elapsed Time in ms consumed by this SQL',
    total_elapsed_time/1000*nullif(execution_count,0) as 'Average Elapsed Time in ms consumed by this SQL',
    DENSE_RANK() over(order by total_elapsed_time/nullif(execution_count,0) desc) as 'Rank of the SQL by Average Elapsed Time',
    total_worker_time as 'Total CPU Time in ms consumed by this SQL',
    DENSE_RANK() over(order by total_worker_time desc) as 'Rank of the SQL by Total CPU Time',
    Max_worker_time as 'Maximum CPU Time in ms consumed by this SQL',
    min_worker_time as 'Minimum CPU Time in ms consumed by this SQL',
    total_worker_time/nullif(execution_count,0) as 'Average CPU Time in ms consumed by this SQL',
    DENSE_RANK() over(order by total_worker_time/nullif(execution_count,0) desc) as 'Rank of the SQL by Average CPU Time',
    total_logical_reads as 'Total Logical Reads Clocked by this SQL',
    DENSE_RANK() over(order by total_logical_reads desc) as 'Rank of the SQL by Total Logical reads',
    Max_logical_reads as 'Maximum Logical Reads Clocked by this SQL',
    min_logical_reads as 'Minimum Logical Reads Clocked by this SQL',
    total_logical_reads/nullif(execution_count,0) as 'Average Logical Reads Clocked by this SQL',
    DENSE_RANK() over(order by total_logical_reads/nullif(execution_count,0) desc) as 'Rank of the SQL by Average Logical reads',
    total_physical_reads as 'Total Physical Reads Clocked by this SQL',
    DENSE_RANK() over(order by total_physical_reads desc) as 'Rank of the SQL by Total Physical Reads',
    Max_physical_reads as 'Maximum Physical Reads Clocked by this SQL',
    min_physical_reads as 'Minimum Physical Reads Clocked by this SQL',
    total_physical_reads/nullif(execution_count,0) as 'Average Physical Reads Clocked by this SQL',
    DENSE_RANK() over(order by total_physical_reads/nullif(execution_count,0) desc) as 'Rank of the SQL by Average Physical Reads',
    total_logical_writes as 'Total Logical Writes Clocked by this SQL',
    DENSE_RANK() over(order by total_logical_writes desc) as 'Rank of the SQL by Total Logical Writes',
    Max_logical_writes as 'Maximum Logical Writes Clocked by this SQL',
    min_logical_writes as 'Minimum Logical Writes Clocked by this SQL',
    total_logical_writes/nullif(execution_count,0) as 'Average Logical Writes Clocked by this SQL',
    DENSE_RANK() over(order by total_logical_writes/nullif(execution_count,0) desc) as 'Rank of the SQL by Average Logical Writes',
    deqp.query_plan as 'Plan of Query'
    --similarly you can add the ranks for maximum values as well.That is quite useful in finding some of the perf issues.
    from
    sys.dm_exec_query_stats deqs
    /*F0C6560A-9AD1-448B-9521-05258EF7E3FA*/ --use a newid so that we could exclude this query from the performanc emetrics output
    outer apply sys.dm_exec_query_plan(deqs.plan_handle) deqp --sometimes the plan might not be in the cache any longer.So using outer apply
    outer apply sys.dm_exec_sql_text(deqs.sql_handle) dest --Sometimes the text is not returned by the dmv so use outer apply.
    where
    dest.text not like '%F0C6560A-9AD1-448B-9521-05258EF7E3FA%'
    )
    select
    *
    from
    PerformanceMetrics
    where
    1=1
    --apply any of these where clause in any combinations or one by one..
    --and [Rank of the SQL by Average CPU Time] <= 20 --Use this to find the top N queries by avg CPU time.
    --and [Rank of the SQL by Average Elapsed Time] <= 20 --Use this to find the top N queries by avg elspsed time.
    --and [Rank of the SQL by Average Logical reads] <= 20 --Use this to find the top N queries by avg logical reads.
    --and [Rank of the SQL by Average Physical Reads] <= 20 --Use this to find the top N queries by avg physical reads.
    and [Rank of the SQL by Total CPU Time] <= 20 --Use this to find the top N queries by total CPU time.
    and [Rank of the SQL by Total Elapsed Time] <= 20 --Use this to find the top N queries by total elapsed time.
    and [Rank of the SQL by Total Logical reads] <= 20 --Use this to find the top N queries by Total Logical reads.
    and [Rank of the SQL by Total Physical Reads] <= 20 --Use this to find the top N queries by Total Physical Reads.
    and [Rank of the SQL by Total number of Executions] <= 20 --Use this to find the top N queries by Total number of Executions.
    --and [Rank of the SQL by Average Logical Writes] <= 20 --Use this to find the top N queries by Average Logical Writes.
    and [Rank of the SQL by Total Logical Writes] <= 20 --Use this to find the top N queries by Total Logical Writes.
    
    --I usually do the query by 6 rank types together Total logical reads,Total CPU time, Total Elapsed Time , Total Execution count ,Total Physical Reads and Total Logical Writes.Sometimes I exclude last two counters if i do not get any query in the output.
    --If some queries are say in top 10 in all these 6 categories then these needs to tune first...
    --But sometime you might not get any rows at all if u use these 6 categiories in that case remove one of these categories or try one by one..

    public by paulsimmons  300  21  3  1

    WooCommerce Checkout Plugin by FMEAddons

    You can crate extra options on checkout form by using WooCommerce checkout plugin by FMEAddons. This addon lets you add the various fields which are text area, radio and check boxes, file/image select, multi-select, date & time, password, input and select box personalize the checkout form. With this addon, you can get extra information on checkout
    cpp
    <a href="https://www.fmeaddons.com/woocommerce-plugins-extensions/additional-checkout-fields.html">https://www.fmeaddons.com/woocommerce-plugins-extensions/additional-checkout-fields.html<a>                        

    public by jenipher8586  1142  0  4  0

    RoadRunner Support Number In USA +1888-411-1123

    Roadrunner is an online email service supplier and utilized by the several customers around the world.Really the active and safe mode of communication. The individuals use Roadrunner email service for his or her personal and professional use. To resolve technological bugs of Roadrunner email account you need to spend your important time. Just Call
    cpp
    // Enter here the actual content of the snippet.            

    public by simonwalker  184  0  4  0

    Magento 2 Gift Wrap Extension

    Offer gift wrapping facility to your eCommerce store customers using Magento 2 gift wrap extension. This amazing extension lets you add lots of gift wraps with each product. To help users in choosing gift wrap, you can categorize each gift wrap based on the basis of occasions like: birthday, wedding, promotion etc. Show price of gift wrap as well a
    // Enter here the actual content of the snippet.												

    public by msdn  2907  3  7  0

    FindCertificate: Find a X509 certificate of matching thumbprint or SubjectName from the LocalMachine/My certificate store and LocalMachine/Personal store

    Find a X509 certificate of matching thumbprint or SubjectName from the LocalMachine/My certificate store and LocalMachine/Personal store content of ThumbPrint or SubjectName ThumbPrint or SubjectName an X509Certificate2 object
    using System;
    using System.IO;
    using System.Security.Cryptography.X509Certificates;
    using System.Security.Cryptography;
    using Microsoft.ComputeCluster.Management.Win32Helpers;
    using System.Collections.Generic;
    
    /// <summary>
    /// Find a X509 certificate of matching thumbprint or SubjectName from the LocalMachine/My
    /// certificate store and LocalMachine/Personal store
    /// </summary>
    /// <param name="str">content of ThumbPrint or SubjectName</param>
    /// <param name="type">ThumbPrint or SubjectName</param>
    /// <returns>an X509Certificate2 object</returns>
    public static X509Certificate2 FindCertificate(string str, FindType type)
    {
        // Find certificate for personal store
        X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
        store.Open(OpenFlags.ReadOnly);
    
        X509Certificate2Collection collection;
        try
        {
            if (type == FindType.Thumbprint)
            {
                collection = store.Certificates.Find(X509FindType.FindByThumbprint, str, true);
            }
            else
            {
                collection = store.Certificates.Find(X509FindType.FindBySubjectName, str, true);
            }
    
            if (collection != null && collection.Count > 0)
            {
                if (collection[0].HasPrivateKey)
                {
                    return collection[0];
                }
            }
        }
        finally
        {
            store.Close();
        }
    
        string err = string.Format("No private key certificate that matches thumbprint or SubjectName {0} could be found in the personal certificate store of the current user or the local computer. For more information, see http://go.microsoft.com/fwlink/?LinkId=228597.", str);
        throw new InvalidOperationException(err);
    }

    external by Github  15964  0  3  0

    Which team do you support? <a href=" http://www.almacendecamping.com/index.php/seroquel-400-mg-tablets-lte.pptx ">will seroquel 200 mg get you high izle</a> Findings showed that views on absenteeism, whether seen as a legitimate reason to be out of th...

    Which team do you support? will seroquel 200 mg get you high izle Findings showed that views on absenteeism, whether seen as a legitimate reason to be out of the office or a frowned-upon offense, are more about broad cultural influence than individual views or personal work ethics. : Numbers
    Which team do you support? <a href=" http://www.almacendecamping.com/index.php/seroquel-400-mg-tablets-lte.pptx ">will seroquel 200 mg get you high izle</a>  Findings showed that views on absenteeism, whether seen as a legitimate reason to be out of the office or a frowned-upon offense, are more about broad cultural influence than individual views or personal work ethics.
     
    
    

    external by Github  196  0  2  0

    What do you like doing in your spare time? <a href=" http://nadoby.pl/?zyprexa-borderline-personality-disorder.pptx#entertain ">zyprexa borderline personality disorder</a> 'People are already seeing the benefits. Some are seeing the personal benefits,...

    What do you like doing in your spare time? zyprexa borderline personality disorder 'People are already seeing the benefits. Some are seeing the personal benefits, others are seeing the benefits to the bottom line: 25 per cent of corporate America is already offering employees some form of mindfulness training.&rsquo; : Reynaldo
    What do you like doing in your spare time? <a href=" http://nadoby.pl/?zyprexa-borderline-personality-disorder.pptx#entertain ">zyprexa borderline personality disorder</a>  'People are already seeing the benefits. Some are seeing the personal benefits, others are seeing the benefits to the bottom line: 25 per cent of corporate America is already offering employees some form of mindfulness training.&rsquo;
     
    
    
    • Public Snippets
    • Channels Snippets