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
qs = lambda l: [] if not l else qs(filter(lambda x: x <= l[0], l[1:])) + [l[0]] + qs(filter(lambda x: x > l[0], l[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
package your.package; | |
import de.hybris.platform.util.logging.log4j2.HybrisLoggerContext; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.List; | |
import javax.annotation.PostConstruct; | |
import org.apache.logging.log4j.Level; | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; |
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
// ciao manuello | |
sessionService.executeInLocalView(new SessionExecutionBody() | |
{ | |
@Override | |
public void executeWithoutResult() | |
{ | |
i18nService.setCurrentLocale(LA_TUA_LINGUA); | |
export(product) | |
} |
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 CustomCmsContentPagePrepareInterceptor extends CmsContentPagePrepareInterceptor | |
{ | |
@Override | |
protected void resetHomepageFlag(Collection<AbstractPageModel> contentPages, ContentPageModel currentPageModel, InterceptorContext ctx) | |
{ | |
if (this.getCmsAdminPageService().getActiveCatalogVersion().equals(currentPageModel.getCatalogVersion())) | |
{ | |
super.resetHomepageFlag(contentPages, currentPageModel, ctx); | |
} | |
} |
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
-server | |
-Xms2g | |
-Xmx2g | |
-Xss16m | |
-XX:+UseConcMarkSweepGC | |
-XX:+CMSParallelRemarkEnabled | |
-XX:ConcGCThreads=4 | |
-XX:ReservedCodeCacheSize=256m | |
-XX:+AlwaysPreTouch | |
-XX:+TieredCompilation |
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
def flipTheCoin(): | |
while True: | |
t1 = notFairRandomNumber() | |
t2 = notFairRandomNumber() | |
if t1 != t2: | |
return t1 and 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
def wbc_caesar_cipher(message): | |
result = "" | |
I = {' ': ' ', 'a': 'y', 'c': 'a', 'b': 'z', 'e': 'c', 'd': 'b', 'g': 'e', 'f': 'd', 'i': 'g', 'h': 'f', 'k': 'i', 'j': 'h', 'm': 'k', 'l': 'j', 'o': 'm', 'n': 'l', 'q': 'o', 'p': 'n', 's': 'q', 'r': 'p', 'u': 's', 't': 'r', 'w': 'u', 'v': 't', 'y': 'w', 'x': 'v', 'z': 'x'} | |
O_inverse = {' ': ' ', 'a': 'h', 'c': 'j', 'b': 'i', 'e': 'l', 'd': 'k', 'g': 'n', 'f': 'm', 'i': 'p', 'h': 'o', 'k': 'r', 'j': 'q', 'm': 't', 'l': 's', 'o': 'v', 'n': 'u', 'q': 'x', 'p': 'w', 's': 'z', 'r': 'y', 'u': 'b', 't': 'a', 'w': 'd', 'v': 'c', 'y': 'f', 'x': 'e', 'z': 'g'} | |
P = {' ': ' ', 'a': 'p', 'c': 'r', 'b': 'q', 'e': 't', 'd': 's', 'g': 'v', 'f': 'u', 'i': 'x', 'h': 'w', 'k': 'z', 'j': 'y', 'm': 'b', 'l': 'a', 'o': 'd', 'n': 'c', 'q': 'f', 'p': 'e', 's': 'h', 'r': 'g', 'u': 'j', 't': 'i', 'w': 'l', 'v': 'k', 'y': 'n', 'x': 'm', 'z': 'o'} | |
Q = {' ': ' ', 'a': 'j', 'c': 'l', 'b': 'k', 'e': 'n', 'd': 'm', 'g': 'p', 'f': 'o', 'i': 'r', 'h': 'q', 'k': 't', 'j': 's |
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
def wbc_caesar_cipher(message): | |
result = "" | |
look_up_table = {"a" : "d", "b" : "e", "c" : "f", "d" : "g", "e" : "h", ...} | |
for m in message: | |
result += look_up_table[m] | |
return result |
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
def caesar_cipher(message, key): | |
result = "" | |
for m in message: | |
result += chr((ord(m) + key - 97) % 26 + 97) | |
return result |
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
look_up_table = { | |
'a' : 'd', | |
'b' : 'e', | |
'c' : 'f', | |
'd' : 'g', | |
'e' : 'h', | |
... | |
} |
OlderNewer