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
public class LineDefinitionAttribute : Attribute | |
{ | |
public LineDefinitionAttribute(int size, int startIndex, string format = "") | |
{ | |
Size = size; | |
StartIndex = startIndex; | |
} | |
public int Size { get; set; } | |
public int StartIndex { get; set; } |
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
package example; | |
import com.fasterxml.jackson.databind.DeserializationFeature; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.jayway.jsonpath.Configuration; | |
import com.jayway.jsonpath.Option; | |
import com.jayway.jsonpath.internal.DefaultsImpl; | |
import com.jayway.jsonpath.spi.json.JacksonJsonProvider; | |
import com.jayway.jsonpath.spi.json.JsonProvider; | |
import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider; |
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
@RunWith(SpringRunner.class) | |
@WebMvcTest(ExampleController.class) | |
public class ExampleControllerTest { | |
@Autowired | |
private MockMvc mockMvc; | |
@Test | |
public void should_get_metadata_when_video_processed() throws Exception { | |
this.mockMvc.perform(get("/test")) |
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
package example; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import java.math.BigDecimal; |
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
this.mockMvc.perform(get("/test")) | |
.andExpect(content().contentType(MediaType.APPLICATION_JSON)) | |
.andExpect(status().isOk()) | |
.andExpect(jsonPath("$.value", is("Olá!"))); |
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
public class CoinChangeProblemSolver | |
{ | |
public int Solve(int[] coins, int ammount) | |
{ | |
int count(int[] c, int m, int n) | |
{ | |
// If n is 0 then there is -1 solution | |
// (do not include any coin) | |
if (n == 0) | |
return 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
const int pino_microfone = A0; // pino onde o potenciometro está conectado | |
int leitura = 0; // variável para armazenar o valor lido pelo ADC | |
const int pino_rele = 10; // pino onde o rele está conectado | |
bool estado_rele = false; // variável para armazenar o estado do rele | |
float amplitude = 0.0; // armazenará o valor de pico a pico da onda | |
unsigned int valor_max = 0; // armazenará o valor máximo lido pelo sensor | |
unsigned int valor_min = 1024; // armazenará o valor mínimo lido pelo sensor | |
float valor_limite = 4.5; // valor mínimo para considerar uma palma (0.0 - 5.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
CREATE TABLE Districts | |
( DistrictId int IDENTITY (1,1), | |
DistrictName nvarchar(20), | |
DistrictGeo geometry); | |
GO | |
CREATE TABLE Streets | |
( StreetId int IDENTITY (1,1), | |
StreetName nvarchar(20), | |
StreetGeo geometry); |
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
open System | |
open Microsoft.FSharp.Reflection | |
open Newtonsoft.Json | |
open Newtonsoft.Json.Converters | |
type OptionConverter() = | |
inherit JsonConverter() | |
override x.CanConvert(t) = | |
t.IsGenericType && t.GetGenericTypeDefinition() = typedefof<option<_>> |
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
install.packages("openxlsx") | |
library(openxlsx) | |
fileX = "https://github.com/elthonf/fiap-mba-r/raw/master/data/cameras.baltimore.xlsx" | |
directory = 'data' | |
file.name = basename(fileX) | |
download = function(f, d){ | |
if(!file.exists(d)){ | |
dir.create(d) | |
} |
NewerOlder