Recent snippets

  • How to send SMS using ASP.NET through HTTP (C#)

    Hello Guys, This short ASP.NET code snippet is intended to provide you a brief review on how to add SMS functionality to your website. You will see, this is a very simple but smart solution. This ASP.NET application is able to send messages by using HTTP requests towards the SMS gateway that sends the SMSs to the destination telephone via a GSM modem or an IP SMS connection. Let’s take a quick look at the software requirements that are essentially needed for this solution. In order to send SMS messages from your ASP.NET application, you need a development platform, e.g Visual Studio, of course, .NET Framework 4.0, Internet Information Services (IIS) and an SMS gateway (I used Ozeki NG – http://www.ozekisms.com). You also need a GSM modem attached to your PC or an IP SMS connection to be able to send messages. Okay and now let’s use the code snippet! Copy the content of smssend.aspx and smssend.aspx.cs into the main directory of the IIS server - C:\Inetpub\wwwroot\ directory (). Configure the fixed data in the smssend.aspx.cs file (the IP address and port number of the SMS gateway, username, password). Launch your SMS gateway Server. Start a web browser and enter this URL: http://127.0.0.1/smssend.aspx - where 127.0.0.1 means that the smssend.aspx and smssend.aspx.cs files can be found on the same computer on which the browser has been opened). Fill in the required fields, and then click the Send button. It’s as easy as that! Happy coding! :)

    1 people like this

    Posted: 2 days ago by Aarav Gupta

  • Truth Table Generator

    This program is a mess, really - just ignore support functions. It'll be great if you can help me tidy up. Here's the passcode: "Passcode". The version of code below may not be original.

    1 people like this

    Posted: 2 days ago by you

  • Exception-free String.Insert

    "Please enter the description" - Why'd I do that ?

    2 people like this

    Posted: 2 days ago by you

  • Shuffled Array

    String.Join (" ", [| "This" ; "is"; "a" ; "way" ; "to" ; "generate" ; "a" ; "shuffled" ; "array" ; "with" ; "given" ; "elements" ; "from" ; "an" ; "(ordered)" ; "array." |]) |> printf "\n >> %A\n"

    0 people like this

    Posted: 2 days ago by you

  • Simple C# Parser

    Simple prototype C# AST and parser using the FParsec parser combinator library. Parses a subset of C# 1.1 constructs.

    2 people like this

    Posted: 6 days ago by Phillip Trelford

  • Exponentiation by squaring

    Function, what calculates x^n by non-recursive basic exponentiation squaring algorithm. This method uses the bits of the exponent to determine computing powers. Generic parameter x suitable for any type what supports multiplication. I do not suppose existence of inverse operator like "/", thus parameter n must be a positive integer only. It is not difficult to define an extended variant for a type what supports division.

    3 people like this

    Posted: 20 days ago by Pavel Tatarintsev

Popular snippets

  • Pipeline list processing

    An example showing how to process list in a pipeline. We first use List.filter to return only even numbers and then use List.map to format them as strings.

    90 people like this

    Posted: 9 years ago by Tomas Petricek

  • Doughnut chart using chart controls

    The snippet shows how to use Microsoft Chart Controls (available in .NET 4.0 and for .NET 3.5) to draw a Doughnut chart. The sample shows proportion of seats taken by parties in UK elections.

    86 people like this

    Posted: 9 years ago by Tomas Petricek

  • Projecting lists

    Three functions showing how to implement projection for functional lists. First version uses naive recursion and the second one is tail-recursive using the accumulator parameter. The third version extends this with continuation passing.

    65 people like this

    Posted: 9 years ago by Tomas Petricek

  • The Haskell const function

    The const function is simple, but you can use it to make your code more legible. In this example we convert a unary function to a function of arity 2 (that ignores the second argument). Also by using the flip function from Haskell (which is equally easy to define) you can ignore the first argument.

    119 people like this

    Posted: 9 years ago by Alex Muscar

  • Minimal XML DSL

    This snippet provides a very small internal DSL for creating and querying XML using the underlying XLinq classes.

    362 people like this

    Posted: 9 years ago by Blake Coverett

  • Monadic Memoization

    Modular memoization within a pure functional setting that is implemented as a convenient computation builder.

    89 people like this

    Posted: 9 years ago by Nick Palladinos

Snippets by tags

parsing (25) fold (21) html (15) web (26) lazy (19) game (30) quotations (19) wpf (20) pattern matching (14) f# (44) regex (15) generic programming (16) dsl (23) agent (20) http (15) learning f# (16) monad (22) string (24) mailboxprocessor (27) async (95)

View all...

Database contains 2389 snippets out of which 1622 is public.