Skip to content

Instantly share code, notes, and snippets.

@whiter4bbit
whiter4bbit / gist:940198
Created April 25, 2011 05:28
GWTTestCase sample
/**
* Test for {@link SearchWidgetUtils}.
*
* @author Pavel Zalunin
*/
public class GwtTestSearchWidgetUtils extends GWTTestCase {
@Override
public String getModuleName() {
return "com.ean.controlpanel.ControlPanel";
@whiter4bbit
whiter4bbit / gist:1080935
Created July 13, 2011 18:19
hadoop config
whiter4bbit@katrin conf % cat mapred-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
@whiter4bbit
whiter4bbit / gist:1080945
Created July 13, 2011 18:23
namenode logs
2011-07-13 20:51:46,975 INFO org.apache.hadoop.ipc.Server: IPC Server listener on 9000: readAndProcess threw exception java.io.IOException: Unable to read authentication method. Count of bytes read: 0
java.io.IOException: Unable to read authentication method
at org.apache.hadoop.ipc.Server$Connection.readAndProcess(Server.java:1079)
at org.apache.hadoop.ipc.Server$Listener.doRead(Server.java:525)
at org.apache.hadoop.ipc.Server$Listener$Reader.run(Server.java:332)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
@whiter4bbit
whiter4bbit / gist:1106633
Created July 26, 2011 12:27
explicit index
Number of opens = 1
Rows seen = 0
Rows filtered = 0
constructor time (milliseconds) = 0
open time (milliseconds) = 0
next time (milliseconds) = 0
close time (milliseconds) = 0
optimizer estimated row count: 1341,10
optimizer estimated cost: 488322,63
@whiter4bbit
whiter4bbit / gist:1106640
Created July 26, 2011 12:29
without explicit index
Number of opens = 1
Rows seen = 0
Rows filtered = 0
constructor time (milliseconds) = 0
open time (milliseconds) = 0
next time (milliseconds) = 0
close time (milliseconds) = 0
optimizer estimated row count: 1341,10
optimizer estimated cost: 39090,35
@whiter4bbit
whiter4bbit / gist:2011424
Created March 10, 2012 13:31
Dijkstra using scalding
import com.twitter.scalding._
class DijkstraJob(args: Args) extends Job(args) {
val iteration = args.getOrElse("iteration", "0").toInt
Tsv(args("input"), ('node, 'dist, 'adjacent))
.read
.flatMap(('node, 'dist, 'adjacent) -> ('node, 'dist, 'adjacent)) { p: (String, Int, String) =>
val (node, distance, adjacent) = p
(node, distance, adjacent) +: adjacent.split(":").map { part: String =>
@whiter4bbit
whiter4bbit / gist:3047688
Created July 4, 2012 14:37
gcc behaviour - llvm bug
whiter4bbit@katrin llvm-bug % gcc -c foo.c -Wall
whiter4bbit@katrin llvm-bug % gcc -c main.c -Wall
main.c: В функции ‘main’:
main.c:6:3: предупреждение: неявная декларация функции ‘init_foo’
main.c:6:15: предупреждение: при инициализации целое преобразуется в указатель без приведения типа
whiter4bbit@katrin llvm-bug % gcc foo.o main.o
whiter4bbit@katrin llvm-bug % ./a.out
20
whiter4bbit@katrin llvm-bug % gcc --version
gcc (Gentoo 4.5.3-r2 p1.5, pie-0.4.7) 4.5.3
whiter4bbit@mac-mini-pavel ~/dev/objc_fun/llvm-bug $ cat foo.h
#ifndef FOO_H
#define FOO_H
typedef struct foo_int *foo_t;
//foo_t init_foo();
int run_foo(foo_t foo);
#endif //FOO_H
@whiter4bbit
whiter4bbit / gist:3122239
Created July 16, 2012 11:34
whatlanguage
whiter4bbit@mac-mini-pavel ~ $ gem install whatlanguage
Fetching: whatlanguage-1.0.0.gem (100%)
Successfully installed whatlanguage-1.0.0
1 gem installed
Installing ri documentation for whatlanguage-1.0.0...
Installing RDoc documentation for whatlanguage-1.0.0...
whiter4bbit@mac-mini-pavel ~ $ irb
1.9.2p290 :001 > require 'whatlanguage'
=> true
1.9.2p290 :002 > wl = WhatLanguage.new(:all)
whiter4bbit@mac-mini-pavel ~/mvn-test $ mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<<