OpCpde | Frequency |
aload_0 | 10.7155% |
invokevirtual | 6.5737% |
getfield | 5.4156% |
aload_1 | 4.0842% |
dup | 3.7698% |
invokespecial | 3.5982% |
iload | 3.2671% |
aload | 3.1602% |
goto | 2.3347% |
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 Control.Monad.Trans.List (ListT(..)) | |
import Control.Monad.Trans (lift) | |
import System.Directory (getDirectoryContents, doesDirectoryExist) | |
listDir :: FilePath -> ListT IO FilePath | |
listDir path = do | |
isDirectory <- lift $ doesDirectoryExist path | |
if not isDirectory | |
then ListT $ return [path] | |
else do |
OpCpde | Frequency |
aload_0 | 8.9024% |
invokestatic | 7.9831% |
invokevirtual | 5.9661% |
dup | 5.6271% |
aload_1 | 5.0123% |
invokeinterface | 4.1291% |
nop | 4.1291% |
getfield | 3.6463% |
aastore | 3.6388% |
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 anton.logvinenko; | |
import javafx.util.Pair; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.atomic.AtomicReference; | |
import java.util.function.Function; | |
public class Parser<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
package com.farpost.imagestorage; | |
import com.farpost.imagestorage.duplicate.index.mongo.MongoDbIndex; | |
import com.mongodb.MongoClient; | |
import org.bson.types.Binary; | |
import java.io.*; | |
import java.math.BigInteger; | |
import java.net.UnknownHostException; | |
import java.util.List; |
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
-- The idea is to have Clojure threading macro '->>' in Haskell: | |
-- (->> 1 repeat (map (* 2)) (take 10) (map (* 2)) (map (+ 40)) (foldl + 0)) | |
-- where (->> x f1 f2 f3 f4) means literally this: "f4 (f3 (f2 (f1 x)))" | |
-- Same in Haskell: "f4 . f3 . f2 . f1 $ x" | |
-- Let's try to implement it | |
data Apply a b = Apply { x :: a, f :: a -> b } | |
(->>) :: a -> (a -> b) -> Apply a b | |
(->>) x f = Apply x f |
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
@Test | |
public void test() throws IOException { | |
//BufferedImage bi = bytesToBufferedImage(readBytesFromFile(this, "1401403088318_default.png")); | |
//pls change readBytesFromFile if not storing file in /resources | |
BufferedImage bi = ImageIO.read(new ByteArrayInputStream(readBytesFromFile(this, "1401403088318_default.png"))); | |
System.out.println(bi.getColorModel().getColorSpace().getType()); | |
if (bi.getType() == BufferedImage.TYPE_USHORT_GRAY) { |
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.farpost.search.statbuilder.termset; | |
import com.farpost.search.statbuilder.util.OrderedSource; | |
import com.farpost.search.statbuilder.util.Source; | |
import com.sun.istack.Nullable; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.io.IOException; | |
import java.util.List; |
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.farpost.search.statbuilder.termset; | |
import com.farpost.search.statbuilder.util.OrderedSource; | |
import com.farpost.search.statbuilder.util.Source; | |
import com.sun.istack.Nullable; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.io.IOException; | |
import java.util.List; |
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.farpost; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.InvocationTargetException; | |
import java.util.*; | |
final public class Bla { | |
private Bla() { | |
} |