Показаны сообщения с ярлыком en. Показать все сообщения
Показаны сообщения с ярлыком en. Показать все сообщения

пятница, 5 января 2018 г.

Maker's Schedule vs Manager's Schedule

Kind of classic already but most companies (even in the whole Silicon Valley) still don't follow it:
July 2009

One reason programmers dislike meetings so much is that they're on a different type of schedule from other people. Meetings cost them more.

There are two types of schedule, which I'll call the manager's schedule and the maker's schedule. The manager's schedule is for bosses. It's embodied in the traditional appointment book, with each day cut into one hour intervals. You can block off several hours for a single task if you need to, but by default you change what you're doing every hour.

When you use time that way, it's merely a practical problem to meet with someone. Find an open slot in your schedule, book them, and you're done.

Most powerful people are on the manager's schedule. It's the schedule of command. But there's another way of using time that's common among people who make things, like programmers and writers. They generally prefer to use time in units of half a day at least. You can't write or program well in units of an hour. That's barely enough time to get started.

When you're operating on the maker's schedule, meetings are a disaster. A single meeting can blow a whole afternoon, by breaking it into two pieces each too small to do anything hard in. Plus you have to remember to go to the meeting. That's no problem for someone on the manager's schedule. There's always something coming on the next hour; the only question is what. But when someone on the maker's schedule has a meeting, they have to think about.
For someone on the maker's schedule, having a meeting is like throwing an exception. It doesn't merely cause you to switch from one task to another; it changes the mode in which you work.
.... 

Here is the full article from Y-Combinator guys here.

воскресенье, 14 июля 2013 г.

ultimate-stress: simple and fast stress-test framework

This post is about stress test framework mainly for java projects but can easily be used for others (from any machine with java7+), as there is a support for http requests with template engine out-of-box.

пятница, 21 июня 2013 г.

Algorithms and Data Structures of JDK 7


While checking periodically if there is one or another standard algorithm in JDK I've decided to make such index. It was also interesting why some famous data structures or algs are included in and others - not.
A format of this survey is only about key properties and features of algorithms and data structures of JDK, all details and full description - you can easily find in javadoc or jdk sources.
Let's start from simple to complex!

вторник, 28 мая 2013 г.

2 days of integration of osgi, hadoop and hbase

Spent almost 2 days trying to connect to local hbase from OSGI.
The problem is that hbase client uses hadoop which had this bug when run in containers (osgi, tomcat etc).
Bug tracker guys finally submit a fix to legacy 0.23 branch with fix, so I tried it, but it failed with source/api incompatibility (this issue):
java.lang.NoSuchMethodError: org.apache.hadoop.net.NetUtils.getInputStream(Ljava/net/Socket;)Ljava/io/InputStream;
    at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:363)
    at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1046)
...

What I've found in the sources is that - hbase calls this static method
...
public static java.io.InputStream getInputStream(Socket socket) throws IOException
...
but 0.23.x branch latest version has this
...
public static org.apache.hadoop.net.SocketInputWrapper getInputStream(java.net.Socket socket) throws java.io.IOException
...

Do you see the issue? I don't yet. Normally the second can be used in any place where the fist does... But still it fails either due to OSGI some classloading issue or some implicit hbase/hadoop integration issues, I'm not clear on this yet.

What could I do?
I tried orderly downgrading from 0.23.7 to 0.23.1 (just in case), and fortunately 0.23.1 - worked! It has the same static signiture.

So, if you need to connect to hbase from osgi - you'll have to downgrade required hadoop libs to 0.23.1. Seems there is yet another annoying OSGI-specific bug.

SUMMARY: you can add frameworks and components to your java app just adding their dependencies if you don't have OSGI... because otherwise you'll be dancing with tambourines for days and hacking to get it working!

понедельник, 22 апреля 2013 г.

unique escaping of ' in shell

if you need to escape single quote in a bash script, e.g. in bashrc:
alias='cool command with ' inside'
- you must replace it with '"'"'
i.e.:
alias='cool command with '"'"' inside'

p.s. explanation.

пятница, 30 ноября 2012 г.

Why is Erlang slower than Java?

Why is Erlang slower than Java on all these small math benchmarks?

Despite many answers and interest the question is still open - why?

Erlang HiPE is also compiled to native, compact data types (not min 32/64 bit sizes as in java), no threading overhead (actors)... And still java7 is faster from x10 to x100 in that benchmarks.

Why? dynamic typing, slow GC or poor native compiling?

суббота, 6 октября 2012 г.

scala vs java8

Despite all bold promises from Oracle, java8 will be still much inferior to Scala:
http://www.infoq.com/articles/java-8-vs-scala (e.g. traits vs virtual methods - can't be compared)

In all of this java8 will be released no earlier than mid-2013 and scala "certainly won't be sitting still between now and 2013"(c)

(c) from comments:

"Notwithstanding the nice new features in Java 8, Scala seems (in my opinion) to remain significantly more concise and clean than Java."

"Remeber even if its java 8, it still just java. Don't expect too much."

"the Scala folks are delighted that Java 8 will have lambdas, since that will ultimately result in attention to performance of such code, and perhaps even to how it is represented in classfiles. Scala will likely benefit from the resulting improvements."

пятница, 27 июля 2012 г.

android.util.Log#wtf ))

funny android developers: android.util.Log#wtf
"What a Terrible Failure: Report a condition that should never happen. The error will always be logged at level ASSERT with the call stack..."

вторник, 10 июля 2012 г.

netty 3.5.1 bundle in Felix 3.2.1 osgi Container = ClassNotFoundException

netty 3.5.1 started in osgi (felix 3.2.1):

...
[org.jboss.netty.util.internal.QueueFactory] - Unable to instance LinkedTransferQueue, fallback to LegacyLinkedTransferQueue
java.lang.NoClassDefFoundError: Could not initialize class org.jboss.netty.util.internal.LinkedTransferQueue
 at org.jboss.netty.util.internal.QueueFactory.createQueue(QueueFactory.java:53) ~[na:na]
 at org.jboss.netty.channel.socket.nio.AbstractNioWorker.(AbstractNioWorker.java:111) ~[netty-3.5.1.Final.jar:na]
 at org.jboss.netty.channel.socket.nio.NioWorker.(NioWorker.java:44) ~[netty-3.5.1.Final.jar:na]
 at org.jboss.netty.channel.socket.nio.NioWorkerPool.createWorker(NioWorkerPool.java:34) ~[netty-3.5.1.Final.jar:na]
 at org.jboss.netty.channel.socket.nio.NioWorkerPool.createWorker(NioWorkerPool.java:26) ~[netty-3.5.1.Final.jar:na]
 at org.jboss.netty.channel.socket.nio.AbstractNioWorkerPool.(AbstractNioWorkerPool.java:58) ~[netty-3.5.1.Final.jar:na]
 at org.jboss.netty.channel.socket.nio.NioWorkerPool.(NioWorkerPool.java:29) ~[netty-3.5.1.Final.jar:na]
 at org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory.(NioClientSocketChannelFactory.java:149) ~[netty-3.5.1.Final.jar:na]
 at org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory.(NioClientSocketChannelFactory.java:114) ~[netty-3.5.1.Final.jar:na]
...

If you debug and dig into netty source code - you'll find more descriptive exception: java.lang.ClassNotFoundException: sun.misc.Unsafe not found by org.jboss.netty

The problem seems that osgi container doesn't normally expose sun.misc.* internals, so the application cannot find it, though it's Oracle Jdk 1.6 with this stuff inside.

Looking further to the source code - you'll find the workaround: -Dorg.jboss.netty.tryUnsafe=false

p.s. issue discussion on the netty github tracker

пятница, 18 мая 2012 г.

yet another gotcha this week )

when running scp task from ant (1.8) script - you need place jsch-0.1.48.jar to ant classpath (via IDE e.g.), otherwise you'll get "class org.apache.tools.ant.taskdefs.optional.ssh.Scp was not found" (SO).

And in case of running it from maven - instead of standart form:
          
                maven-antrun-plugin
                1.7
                
                    
                        deploy
                        
                            
                                
                                       ....
                                
                            
                        
                        
                            run
                        
                    
                
            
you'll need to add the following dependencies:
          
                maven-antrun-plugin
                1.7

                
                    
                        org.apache.ant
                        ant-jsch
                        1.7.0
                    
                    
                        com.jcraft
                        jsch
                        0.1.48
                    
                

                
                    
                        deploy
                        
                            
                                
                                       ....
                                
                            
                        
                        
                            run
                        
                    
                
            
otherwise you'll get in maven smth like that:


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (default) on project ...
ildException has occured: Problem: failed to create task or type scp
[ERROR] Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.Scp was not found.
[ERROR] This looks like one of Ant's optional components.
[ERROR] Action: Check that the appropriate optional JAR exists in
[ERROR] -ANT_HOME\lib
[ERROR] -the IDE Ant configuration dialogs
[ERROR]
[ERROR] Do not panic, this is a common problem.
[ERROR] The commonest cause is a missing JAR.
[ERROR]
[ERROR] This is not a bug; it is a configuration problem
[ERROR]
[ERROR] around Ant part ...<scp ....
[ERROR] -> [Help 1]

faced gotcha

you must use special openssh format key when running scp from ant: http://netpenthe.wordpress.com/2007/02/02/jschexception-invalid-privatekey-ant-scp/

вторник, 17 апреля 2012 г.

GoodBuy Enterprise, Welcome HighLoad!

I've been working in DB Russia Development Center almost 6 years, different projects, different teams - from ERP corporate systems to proprietary trading platfoms and financial exchanges...

Now the story is over (well, tired of enterprise intrabank legacy monsters, time to new challenges etc.) and luckily I found small russian startup-like project developing highload app.

So hope to get a lot of hands-on exp with such cool technologies as Netty, Cassandra, Hadoop and real high scalability )