Skip to content

Instantly share code, notes, and snippets.

View evonsdesigns's full-sized avatar
🌞

Joseph Evans evonsdesigns

🌞
View GitHub Profile
https://draftjs.org/
export const AV_REAL_TIME = "Rank A: Real-Time Performance";
export const AV_1D = "Rank B: 1 Day Performance";
export const AV_5D = "Rank C: 5 Day Performance";
export const AV_1M = "Rank D: 1 Month Performance";
export const AV_3M = "Rank E: 3 Month Performance";
export const AV_YTD = "Rank F: Year-to-Date (YTD) Performance";
export const AV_1Y = "Rank G: 1 Year Performance";
export const AV_3Y = "Rank H: 3 Year Performance";
export const AV_5Y = "Rank I: 5 Year Performance";
export const AV_10Y = "Rank J: 10 Year Performance";
import xhr from 'xhr';
const AVKEY = 'N77G40733L3SU8Z3';
const BASE_URL = 'https://www.alphavantage.co/query?function=SECTOR&apikey=';
export function getSectorsPerformance() {
return new Promise((resolve, reject) => {
xhr.get(BASE_URL + AVKEY, (err, resp, body) => {
if(err) {
reject(err);
[platform-work-answers] Full Error: {"data":{"@type":"Errors","errors":[{"@type":"Error","guid":"4c936746-8d37-4671-a1f7-e82699fee07e","message":"The provided value is not within the allowed range of this value","code":"validation
_constraint_rate_is_not_valid_value_range","field":"value","invalidValue":2.333333333333333e+43,"additionalInformations":[{"@type":"AdditionalInfo","name":"minValue","value":0},{"@type":"AdditionalInfo","name":"maxValue","value":99999}]},{"@type":"Error","guid":"b
981289b-2dc3-437f-94f8-0a65dac6e7fe","message":"The provided value has too many numbers after the decimal point","code":"validation_constraint_rate_has_too_many_decimal_places","field":"value","invalidValue":"2.333333333333333E43","additionalInformations":[{"@type
":"AdditionalInfo","name":"maxDecimalPoints","value":0}]}],"otherAttributes":{}},"isBoom":true,"isServer":false,"output":{"statusCode":400,"payload":{"statusCode":400,"error":"Bad Request","message":"PUT '/workAnswers/5f1ab2a7-2e4f-4789-b6e4-5ecde612e8c1' with re
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
public class PojoMapper {
private ObjectMapper mapper;
public PojoMapper() {
mapper = new ObjectMapper();
mapper.configure(
MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES,
true
@Test
public void testPojoMapper() {
PojoMapper pojoMapper = new PojoMapper();
ObjectMapper objectMapper = pojoMapper.getMapper();
assertTrue(
objectMapper.getDeserializationConfig().isEnabled(
MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES
)
);
}
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
public class PojoMapper {
private ObjectMapper mapper;
public PojoMapper() {
mapper = new ObjectMapper();
mapper.configure(
MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES,
@Test
public void testPojoMapper() {
PojoMapper pojoMapper = new PojoMapper();
ObjectMapper objectMapper = pojoMapper.getMapper();
assertTrue(
objectMapper.getDeserializationConfig().isEnabled(
MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES
)
);
assertTrue(
package examples;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
PowerMockito.when(LoggerFactory.getLogger(any(Class.class)).thenReturn(logger);