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 Helper { | |
public void addInterface(SomeInterface some) { | |
} | |
} |
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
private List<AbstractConfigurationEntry<?>> entries = new ArrayList<AbstractConfigurationEntry<?>>(); | |
/** | |
* | |
* {@link AbstractConfiguration} now uses reflection to build its list of entries<p> | |
* You no longer need to call define to add your {@link AbstractConfigurationEntry}s to the list to be validated<p> | |
* | |
* This method will be removed in the next version | |
* | |
*/ |
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
int escalated = 0, regular = 0, requeue = 0; | |
for (LanguageMessageCountType languageMessageCountType : LanguageMessageCountType.values()) { | |
switch (languageMessageCountType) { | |
case ESCALATED: | |
escalated = languageQueue.getEscalatedMessagesCount(); | |
keyValuesMap.put(languageMessageCountType.name(), String.valueOf(escalated)); | |
break; | |
case REGULAR: | |
regular = languageQueue.getRegularMessagesCount(); | |
keyValuesMap.put(languageMessageCountType.name(), String.valueOf(regular)); |
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 StringArrayConfigurationEntry extends AbstractConfigurationEntry<String[]> { | |
public StringArrayConfigurationEntry(String name) { | |
super(name); | |
} | |
@Override | |
public boolean invalid(String[] value) { | |
return false; | |
} |
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
private String removeNewlines(String inputString) { | |
String returnString = ""; | |
for (int i = 0;i < inputString.length(); i++) { | |
if ((inputString.charAt(i) == '\r') || (inputString.charAt(i) == '\n')) { | |
} | |
else { | |
returnString = returnString + inputString.charAt(i); | |
} | |
} | |
return returnString; |
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 com.blogspot.swishbob; | |
import static com.blogspot.swishbob.MessageCounter.COMPLETED; | |
import static com.blogspot.swishbob.MessageCounter.REASSIGNED; | |
import static com.blogspot.swishbob.MessageCounter.TIMED_OUT; | |
import static com.blogspot.swishbob.MessageEventType.MESSAGE_COMPLETED; | |
import static com.blogspot.swishbob.MessageEventType.MESSAGE_REASSIGNED; | |
import static com.blogspot.swishbob.MessageEventType.MESSAGE_TIMED_OUT; | |
import static com.blogspot.swishbob.Expectation.expect; |
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
class SimplePropertySpec extends Specification with ScalaCheck { | |
"the property test" should { | |
"prove addition and multiplication are related" in { | |
forAll{(a: Int) => a+a must_== 2*a} | |
} | |
} | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration scan="true"> | |
<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder> | |
<charset>UTF-8</charset> | |
<Pattern>%d %-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern> | |
</encoder> | |
</appender> | |
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
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
memo = {}; | |
function fibonacci(num) { | |
if (num <= 1) return 1; | |
if (! memo[num]) { | |
memo[num] = fibonacci(num - 1) + fibonacci(num - 2); | |
} | |
return memo[num]; | |
} |