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
@Configuration | |
public class MainConfiguration extends WebMvcConfigurerAdapter { | |
@Bean | |
public TilesViewResolver setupViewTilesResolver() { | |
TilesViewResolver resolver = new TilesViewResolver(); | |
resolver.setViewClass(TilesView.class); | |
resolver.setOrder(0); | |
return resolver; |
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
#! /bin/bash | |
## PHP 7 Initial Compile ## | |
## Some help from the various places like these. ## | |
# http://www.zimuel.it/install-php-7/ | |
# http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu | |
## Setup Ubuntu 15.04/15.10 ## | |
# Other dependencies for PHP 7. Add any missing ones from configure script | |
# complaints, plus some LAMP needs too. |
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
#!/bin/bash | |
echo "removeing evaluation key" | |
rm ~/.IntelliJIdea15/config/eval/idea15.evaluation.key | |
echo "resetting evalsprt in options.xml" | |
sed -i '/evlsprt/d' ~/.IntelliJIdea15/config/options/options.xml | |
echo "resetting evalsprt in prefs.xml" | |
sed -i '/evlsprt/d' ~/.java/.userPrefs/prefs.xml |
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.olegchir.trollcaster.test1; | |
import org.openjdk.jmh.annotations.*; | |
import java.io.File; | |
import java.io.IOException; | |
public class PHPvsJavaBenchmark1 { | |
private static final String PHP_HOME = "C:\\Users\\olegchir\\Downloads\\php-7.0.11-nts-Win32-VC14-x86"; |
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
/** | |
* Created by olegchir on 18.11.2016. | |
*/ | |
import java.math.BigInteger; | |
import java.util.concurrent.ForkJoinPool; | |
import java.util.concurrent.RecursiveTask; | |
class Sum extends RecursiveTask<BigInteger> { | |
private static final BigInteger MAX = new BigInteger("1000000000"); | |
private static final BigInteger STREAK = MAX.divide(new BigInteger("16")); |
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
/** | |
* Created by olegchir on 18.11.2016. | |
*/ | |
import java.math.BigInteger; | |
class Sum2 { | |
private static final BigInteger MIN = BigInteger.ONE; | |
private static final BigInteger MAX = new BigInteger("10000000000"); | |
private static final BigInteger TWO = new BigInteger("2"); |
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
import java.math.BigInteger; | |
class Sum2 { | |
private static final BigInteger MIN = BigInteger.ONE; | |
private static final BigInteger MAX = new BigInteger("10000000000"); | |
private static final BigInteger TWO = new BigInteger("2"); | |
public static void main(String[] args) { | |
long start = System.nanoTime(); | |
final BigInteger result = (MIN.add(MAX)).multiply(MAX.divide(TWO)); //Hi from mister Gauss, motherfuckers! |
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
# | |
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. | |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
# | |
# This code is free software; you can redistribute it and/or modify it | |
# under the terms of the GNU General Public License version 2 only, as | |
# published by the Free Software Foundation. | |
# | |
# This code is distributed in the hope that it will be useful, but WITHOUT | |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
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
# | |
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. | |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
# | |
# This code is free software; you can redistribute it and/or modify it | |
# under the terms of the GNU General Public License version 2 only, as | |
# published by the Free Software Foundation. | |
# | |
# This code is distributed in the hope that it will be useful, but WITHOUT | |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
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 static Object sum(Object args) { | |
//Вначале есть нода, в которой ничего нет | |
Node result = new Node(); | |
result.childList = new ArrayList<>(); | |
result.numberList = new ArrayList<>(); | |
//В ходе развертки всегда остается пара | |
while (args instanceof Pair) { | |
//Берем голову | |
Object firstArg = PairUtils.first(args); |