This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec factorial n = | |
let rec fact n p = | |
if n = 1 then | |
r | |
else | |
fact (n - 1) (p * n) | |
fact n 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<phone:PhoneApplicationPage | |
x:Class="Testing.MainPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" | |
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480" | |
FontFamily="{StaticResource PhoneFontFamilyNormal}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pageToWorld = new CompositeTransform(); | |
pageToWorld.CenterX = ActualWidth/2; | |
pageToWorld.CenterY = ActionHeight/2; | |
pageToWorld.ScaleX = 1/100; | |
pageToWorld.ScaleY = -1/100; | |
pageToWorld.TranslateX = - ActionWidth/2; | |
pageToWorld.TranslateY = - ActualHeight/2; | |
var worldToPage = pageToWorld.Inverse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<phone:PhoneApplicationPage | |
x:Class="FarseerTransforms.MainPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" | |
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" | |
FontFamily="{StaticResource PhoneFontFamilyNormal}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.Windows; | |
using System.Windows.Media; | |
using System.Windows.Threading; | |
using FarseerPhysics.Common; | |
using FarseerPhysics.Dynamics; | |
using FarseerPhysics.Factories; | |
using Microsoft.Phone.Controls; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void MainPageLoaded(object sender, RoutedEventArgs e) | |
{ | |
float aspectRatio = (float)(_worldControl.ActualWidth / _worldControl.ActualHeight); | |
float width = 10.0f * aspectRatio; | |
float height = 10.0f; | |
float borderDepth = 0.01f; | |
double scaleFactor = _worldControl.ActualHeight / 10.0f; | |
// create transform between world and canvas | |
_worldToCanvas = new CompositeTransform(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ComponentModel; | |
using System.Windows; | |
using System.Windows.Media; | |
using FarseerPhysics.Dynamics; | |
namespace FarseerTransforms | |
{ | |
public class BodyViewModel : INotifyPropertyChanged | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Copyright 2007 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: inline-upload | |
version: 1 | |
runtime: python27 | |
api_version: 1 | |
threadsafe: yes | |
handlers: | |
- url: /favicon\.ico | |
static_files: favicon.ico | |
upload: favicon\.ico |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: inline-upload | |
version: 1 | |
runtime: python27 | |
api_version: 1 | |
threadsafe: yes | |
handlers: | |
- url: /favicon\.ico | |
static_files: favicon.ico | |
upload: favicon\.ico |
OlderNewer