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
Gson gson = new GsonBuilder().registerTypeAdapter(ObjectId.class, | |
new JsonSerializer<ObjectId>() | |
{ | |
public JsonElement serialize(ObjectId t, Type type, | |
JsonSerializationContext jsc) | |
{ | |
return new JsonPrimitive(t.toString()); | |
} | |
}).setDateFormat("MMMM dd, yyyy HH:mm:ss").create(); |
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
ObjectMapper mapper = new ObjectMapper(); | |
JsonNode rootNode = mapper.readValue(compoundCriteria, | |
JsonNode.class); | |
if(rootNode.has("ContextualCriteria")) | |
{ | |
JsonNode contextualNode = rootNode.get("ContextualCriteria"); | |
ContextualCriteria contextualCriteria = (ContextualCriteria) | |
fromJson(contextualNode.toString(), |
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
if (typeof console != 'undefined') { | |
console.log("Useful error message"); | |
} |
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
{"user":"system-user","synapseVersion":"2.2.3","mapping":"{\"fieldMapperStore\":[{\"userFieldName\":\"name\",\"synapseTypeName\":\"O4.PersonName\",\"synapseFieldName\":\"Name\",\"displayName\":\"Name\",\"fieldMinimumValue\":5e-324,\"fieldMaximumValue\":1.7976931348623157e+308},{\"userFieldName\":\"age\",\"synapseTypeName\":\"O4.Integer\",\"synapseFieldName\":\"Age\",\"displayName\":\"Age\",\"fieldMinimumValue\":5e-324,\"fieldMaximumValue\":1.7976931348623157e+308},{\"userFieldName\":\"loc\",\"synapseTypeName\":\"O4.CompoundProperty\",\"synapseFieldName\":\"Location\",\"displayName\":\"Location\",\"fieldMinimumValue\":5e-324,\"fieldMaximumValue\":1.7976931348623157e+308,\"miscellaneousInfo\":{\"fieldMapperStore\":[{\"userFieldName\":\"address\",\"synapseTypeName\":\"O4.String\",\"synapseFieldName\":\"Address\",\"displayName\":\"Address\",\"fieldMinimumValue\":5e-324,\"fieldMaximumValue\":1.7976931348623157e+308},{\"userFieldName\":\"zip\",\"synapseTypeName\":\"O4.Integer\",\"synapseFieldName\":\"Zip\",\"displa |
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
ObjectMapper mapper = new ObjectMapper(); | |
VisibilityChecker<?> vc = mapper.getVisibilityChecker(); | |
vc = vc.withFieldVisibility(Visibility.ANY); | |
mapper.setVisibilityChecker(vc); |
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 interface GenericDao<T, K> { | |
public K insert(T object); | |
} | |
public class GenericDaoMongoDBImpl<T, K> implements GenericDao<T, K> { | |
public K insert(T object) { | |
return null; | |
} | |
} |
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
<plugin> | |
<groupId>org.apache.felix</groupId> | |
<artifactId>maven-bundle-plugin</artifactId> | |
<version>2.3.5</version> | |
<executions> | |
<execution> | |
<id>wrap-my-dependency</id> | |
<phase>package</phase> | |
<goals> | |
<goal>wrap</goal> |
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 uni.rev.q0; | |
import java.util.Stack; | |
public class q0 { | |
static class Parenthesis { | |
private char parenthesis; | |
private int position; | |
public Parenthesis(char par, int pos) { |
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 is the O(n) solution for tutorial 1, question 2 in ruby | |
A = [2,4,6,8] # elements to multiply | |
B = [] # left products | |
C = [] # right products | |
output = [] # to hold final result | |
product = 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
if(!store) { | |
store = ctlr.getStore('Users'); | |
} | |
it("should have users",function() { | |
expect(store.getCount()).toBeGreaterThan(1); | |
}); |
OlderNewer