FizzBuzzBang ('-' * 12) Solution to essential FizzBuzz problem, however I got bored and stylized it a little :)
A Pen by Ryan Trimble on CodePen.
using System; | |
using Xamarin.Forms; | |
using System.Collections.ObjectModel; | |
namespace NAMESPACE.Controls | |
{ | |
public class PicturesCarousel : ScrollView | |
{ | |
AbsoluteLayout _ElementsStack = new AbsoluteLayout (); |
private static Bitmap getCropBitmap (Bitmap origialBitmap,int left, int top, int right, int bottom){ | |
int targetWidth = right-left; | |
int targetHeight = bottom-top; | |
Bitmap cutBitmap = Bitmap.createBitmap(targetWidth,targetHeight, Bitmap.Config.ARGB_8888); | |
Canvas canvas = new Canvas(cutBitmap); | |
Rect desRect = new Rect(0, 0, targetWidth, targetHeight); | |
Rect srcRect = new Rect(left, top, right, bottom); | |
canvas.drawBitmap(origialBitmap, srcRect, desRect, null); | |
return cutBitmap; | |
} |
import re | |
def credit_card_type(number): | |
""" | |
Return a string that represents the type of the credit card number. | |
Criteria: | |
AMEX: Starts with 34 or 37 and the length 15. | |
MASTERCARD: Starts with 51-55 and the length is 16. |
private int Mod10Check(string creditCardNumber) | |
{ | |
//// 1. Starting with the check digit double the value of every other digit | |
//// 2. If doubling of a number results in a two digits number, add up | |
/// the digits to get a single digit number. This will results in eight single digit numbers | |
//// 3. Get the sum of the digits | |
int sumOfDigits = creditCardNumber.Where((e) => e >= '0' && e <= '9') | |
.Reverse() | |
.Select((e, i) => ((int)e - 48) * (i % 2 == 0 ? 1 : 2)) | |
.Sum((e) => e / 10 + e % 10); |
#r @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Net.Http.dll" | |
#r @"..\packages\Microsoft.AspNet.WebApi.Client.5.2.2\lib\net45\System.Net.Http.Formatting.dll" | |
open System | |
open System.Net.Http | |
open System.Net.Http.Headers | |
open System.Net.Http.Formatting | |
open System.Collections.Generic |
using System; | |
using Applifting; | |
using Android.Content; | |
using Xamarin.Forms.Labs.Services; | |
namespace Applifting.Droid | |
{ | |
public interface IDroidContextProvider{ | |
Context Context {get;} | |
} |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Xamarin.Forms; | |
namespace DatePickerFormat | |
{ |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Android.App; | |
using Android.Content; | |
using Android.OS; | |
using Android.Runtime; | |
using Android.Views; | |
using Android.Widget; |
SET NOCOUNT ON | |
-- Get size of SQL Server Page in bytes | |
DECLARE @pg_size INT, @Instancename varchar(50) | |
SELECT @pg_size = low from master..spt_values where number = 1 and type = 'E' | |
-- Extract perfmon counters to a temporary table | |
IF OBJECT_ID('tempdb..#perfmon_counters') is not null DROP TABLE #perfmon_counters | |
SELECT * INTO #perfmon_counters FROM sys.dm_os_performance_counters |
FizzBuzzBang ('-' * 12) Solution to essential FizzBuzz problem, however I got bored and stylized it a little :)
A Pen by Ryan Trimble on CodePen.