Skip to content

Instantly share code, notes, and snippets.

View ElemarJR's full-sized avatar
🏠
Working from home

Elemar Rodrigues Severo Junior ElemarJR

🏠
Working from home
View GitHub Profile
root@ubuntu:/home/elemarjr# mvn archetype:create -DgroupId=com.elemarjr.simpleMath -DartifactId=SimpleMath -DarchetypeArtifactId=maven-archetype-quickstart
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-archetype-plugin:2.4:create (default-cli) @ standalone-pom ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
@ElemarJR
ElemarJR / euler.fs
Last active September 3, 2015 18:48
(* --- 0001 --- *)
[1..999]
|> List.where (fun f -> (f % 3 = 0) || (f % 5 = 0))
|> List.sum
(* --- 0002 --- *)
let fib =
let rec f a b = seq {
yield a
yield! f b (a + b)
let inline solution n =
[1UL..(n - 1UL)]
|> List.filter (fun f -> (f % 3UL = 0UL) || (f % 5UL = 0UL))
|> List.sum
let rec iterate count =
if count > 0
then
System.Console.ReadLine()
|> (uint64)
// Este teste verifica o bit mais alto ligado em um bitboard
// (ver minha série sobre xadrez [http://elemarjr.net]) para entender o contexto
// Não só mais de um assert faz sentido, como a lógica no teste
// O equivalente a esse teste seriam 64 testes individuais (muito trabalho para pouco resultado, não acha)
[Test]
public void GetLeadingSquare_EverySquare()
{
var bitboard = new Bitboard();
for (int i = 0; i < 64; i++)
@ElemarJR
ElemarJR / gist:776090
Created January 12, 2011 12:21
Diagonal NEA1H8
public void ctor_DiagonalsNEA1H8()
{
Square[] squares = new Square[] {
Squares.A1,
Squares.B2,
Squares.C3,
Squares.D4,
Squares.E5,
Squares.F6,
Squares.G7,
using System.Collections.Generic;
using StrongChess.Model.Pieces;
namespace StrongChess.Model.Sets
{
struct PieceSet<TPieceRule>
where TPieceRule : IPieceRule, new()
{
Bitboard _Positions;
public PieceSet(Bitboard positions) : this()
14 Bis
AC_DC
Ac£sticos e Valvulados
Adele
Adriana Calcanhoto, Ana Carolina e Maris
Aerosmith
Aha
Air Supply
Alanis Morissette
Alceu Valenca- Elba Ramalho - Geraldo Azevedo
[Test]
public static void Class_AllStaticMethodsShouldBeDecoratedWithDebuggerStepThroughAttribute()
{
var methods = from m in typeof(Mooble.Util.StringExtensions).GetMethods()
where !m.IsSpecialName && m.IsStatic &&
m.GetCustomAttributes(typeof(DebuggerStepThroughAttribute), true).Count() == 0
select m.Name;
if (methods.Count() > 0)
{
namespace SilverlightApplication1
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
this.Loaded += (s, e) => { this.DataContext = new Person(); };
}
}
<UserControl x:Class="SilverlightApplication1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<StackPanel x:Name="LayoutRoot" Background="White">