Skip to content

Instantly share code, notes, and snippets.

View samudiogo's full-sized avatar
🎯
Focusing

Samuel Diogo samudiogo

🎯
Focusing
View GitHub Profile
@samudiogo
samudiogo / TestingGroupby.cs
Created March 16, 2016 15:27 — forked from anonymous/TestingGroupby.cs
teste de group by e join no linqpad
void Main()
{
var dpts = new List<Department>
{
new Department {id = 1, Name = "CIO Department"},
new Department {id = 2, Name = "CEO Department"}
};
var cioEmplyers = new List<Employer>
{
@samudiogo
samudiogo / web.config
Last active October 29, 2015 00:40
resolução de erro "A potentially dangerous Request.Path value was detected from the client (&)" C# MVC 5
<system.web>
<globalization uiCulture="pt-BR" culture="pt-BR"/>
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" maxRequestLength="1048576" requestPathInvalidCharacters="" />
<pages validateRequest="false"/>
<machineKey validationKey="ABD40FDFB8D031E24643799452B69E81144807334F87C4AFDE7B93083D59C3E2" decryptionKey="BE6987D2CD1D38C9D2AD4A6E4C67E8E49C4B61262FB6FCEB0C45A601F924C472" validation="HMACSHA256" decryption="AES" />
<authentication mode="Forms">
<forms loginUrl="~/../Global/Usuario/Login" timeout="20" />
</authentication>
<customErrors mode="Off"/>
@samudiogo
samudiogo / LINQPad.cs
Created September 28, 2015 17:01 — forked from troygoode/LINQPad.cs
Add/Update/Delete With LINQPad
// select (LINQ Syntax)
var regions =
from r in Regions
where r.RegionID > 0
select r;
regions.Dump();
// insert
Region newRegion = new Region(){
RegionID = 99,
public static int [] BubbleSort(int[] vetor)
{
int aux;
bool control;
for (int i = 0; i < vetor.Length; ++i)
{
control = true;// usando o mecanismo de controle para evitar que o BubbleSort ordene um array já ordenado
for (int j = 0; j < (vetor.Length - 1); ++j)
{
if (vetor[j] > vetor[j + 1])
using System;
using System.Text;
namespace PI.EdaII.App
{
public class ArrayUtils
{
private int[] _vet;
private int[] _originalVet;
private const int maxLength = 10;
namespace PI.EdaII.App
{
public static class MDC
{
public static int MdcInterativo(int a, int b)
{
var remainder = (a % b);
while (remainder != 0)
{
a = b;
@samudiogo
samudiogo / excercicio_01.c
Created January 26, 2015 18:12
Exercício 01 - LP EDA I - 2015
/**
* 1. Faça um programa que crie um registro de um funcionário com as seguintes informações:
* nome, identidade, data de nascimento e salário.
* O programa deve inicializar a estrutura e depois mostra-la na tela.
*/
#include <stdio.h>
typedef struct{
int dia;
int mes;
@samudiogo
samudiogo / fibonacci.c
Created December 1, 2014 17:26
FIbonacci Recursive
#include <stdio.h>
int fib(int n)
{
if((n == 0) || (n == 1))
return n;
else
return fib(n-1) + fib(n-2);
}
main()
{
@samudiogo
samudiogo / EncodingMultiplyFiles.cs
Last active August 29, 2015 14:07
Converting multiply files to UTF-8 without BOM
using System;
using System.IO;
namespace EncodingMultiplyFiles
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("put bellow the path of files:");