poniedziałek, maja 29, 2017
sobota, maja 27, 2017
czwartek, maja 25, 2017
piątek, maja 19, 2017
Empatia jest agile
Jeśli będąc w IT podchodzisz do biznesu z empatią, to masz większe szanse na sukces. Wchodzisz w dialog, chcesz pomóc, chcesz zrozumieć problemy, wyzwania i oczekiwania. Takie podejście sprzyja budowaniu zaufania i właściwych relacji. Pomagając biznesowi dbasz o swoją premię wynikającą z realizacji celu całej firmy. Aspekty społeczne w Business IT alignment są bardzo ważne.
czwartek, maja 18, 2017
Bug in Java(c)?
String lastReturnCode = "WAITING";
Long isSuccessful = ("OK".equals(lastReturnCode) || "DEAD".equals(lastReturnCode)) ? 1L :
"WAITING".equals(lastReturnCode) ? null : 0L;
System.out.println(isSuccessful);
NullPointerException in the third line. Let's decompile class file.
Long isSuccessful = Long.valueOf((("OK".equals(lastReturnCode)) || ("DEAD".equals(lastReturnCode))) ? 1L :
(("WAITING".equals(lastReturnCode)) ? null : Long.valueOf(0L))
.longValue());
No proper autoboxing here. Use Long.valueOf(1L) to fix it.
poniedziałek, maja 15, 2017
How to monitor Tibco BW with free tools
Connect to BW via JMX. Export metrics to Prometheus PushGateway via BW Timer or cron. Use metrics in preferred monitoring GUI.
środa, maja 10, 2017
Clustered filesystem is built-in standard of Windows 201x
Use Cluster Shared Volumes in a Failover Cluster, https://technet.microsoft.com/en-us/library/jj612868(v=ws.11).aspx
piątek, kwietnia 28, 2017
piątek, kwietnia 21, 2017
How I saved big money for Allegro with Tibco BusinessWorks using Java
Time is money. Tibco BusinessWorks is a business enabler allowing for rapid development and very short time to market. Company which deployed Tibco EAI stack has a real market advantage. Power of now. Usage of Canonical Data Model promotes reusability. Visual programming with predefined common activities makes it easy and fast to design processes. What about complex problems which would slow down development to the left from Tibco (system calling BW services) while accessing external operations from the right, for at least 6 months. No business integration means no money. Here is the case: API of the business partner had various usage limits on different levels (including global limit). Limits were interconnected and blocking or interrupting complex business processes. Implementation of usage counters, time slots and batching among all BW clients would took one year. In fact limits were preventing business cooperation. Hey, but Tibco is a business enabler, not a blocker! BW allows to include any static Java Custom Function as internal BW function visible among built-in functions. I created "throttling" custom function holding state across component restarts in 10 minutes. Addtional 2-3 hours of development saved months of hard and complex work of BW callers! We started business cooperation much earlier and started earning money earlier. Tibco. Power of now!
Messaging of AliExpress
The biggest world global eCommerce - AliExpress has its own messaging and its source code looks interesting especially with claims "Throughout the period, 99.996% of the delay fell within 10ms, very few due to GC caused by the pause in 50ms or less, for the read and write ratio is almost balanced distributed message engine, the results are all exciting." which are about Java software.
With first look following can be spotted: heavy usage of java.util.concurrent, volatile keyword, ByteBuffers and very limited usage of synchronized blocks. File storage uses plain RandomAccessFile with OS-mapped ByteBuffers where everything read and written is with computed offsets. Flushing data to disk is performed in file groups which is very wise due to mechanical sympathy with underlying disks (think about hardware I/O queues and servicing according to given offsets). Memory storage uses direct ByteBuffers not affected by GC and also locked into physical memory with POSIX mlock call. Very smart! I was exploiting the last feature while writing near RealTime software for T-Mobile emergency number. It really helps to achieve low latency without outliers.
With first look following can be spotted: heavy usage of java.util.concurrent, volatile keyword, ByteBuffers and very limited usage of synchronized blocks. File storage uses plain RandomAccessFile with OS-mapped ByteBuffers where everything read and written is with computed offsets. Flushing data to disk is performed in file groups which is very wise due to mechanical sympathy with underlying disks (think about hardware I/O queues and servicing according to given offsets). Memory storage uses direct ByteBuffers not affected by GC and also locked into physical memory with POSIX mlock call. Very smart! I was exploiting the last feature while writing near RealTime software for T-Mobile emergency number. It really helps to achieve low latency without outliers.
wtorek, kwietnia 18, 2017
czwartek, kwietnia 06, 2017
Dlaczego nie należy kupować Toyoty starszej niż 2011
środa, lutego 22, 2017
Czy ArrayList jest szybsze od LinkedList? #3
int elements = 2000000;
int tries = 100;
String values[] = new String[elements];
IntStream.range(0, elements).forEach( el -> { values[el]=el+""; } );
long t0 = System.currentTimeMillis();
IntStream.range(0, tries).parallel().forEach( i -> {
ArrayList al = new ArrayList();
IntStream.range(0, elements).parallel().forEach( j -> { al.add(values[j]); } );
});
long t1= System.currentTimeMillis();
IntStream.range(0, tries).parallel().forEach( i -> {
LinkedList ll = new LinkedList();
IntStream.range(0, elements).parallel().forEach( j -> { ll.add(values[j]); } );
});
long t2 = System.currentTimeMillis();
System.out.println("Add to ArrayList: "+(t1-t0)/tries+" ms avg, cnt="+elements+", tries="+tries);
System.out.println("Add to LinkedList: "+(t2-t1)/tries+" ms avg, cnt="+elements+", tries="+tries);
--
Add to ArrayList: 18 ms avg, cnt=2000000, tries=100
Add to LinkedList: 77 ms avg, cnt=2000000, tries=100
piątek, lutego 17, 2017
Czy ArrayList jest szybsze od LinkedList? #2
ArrayListal = new ArrayList<>(); for (int j=0; j < elements; j++) al.add(new Long(j)); LinkedList ll = new LinkedList<>(); for (int j=0; j < elements; j++) ll.add(new Long(j)); int indices[] = new int[elements / 100]; Random r = new Random(19700101); for (int i=0; i < indices.length; i++) { indices[i] = r.nextInt(indices.length); } t0 = System.currentTimeMillis(); BigDecimal sum = new BigDecimal(0); for (int i=0; i < indices.length; i++) { sum.add( new BigDecimal(al.get(indices[i])) ); } t1 = System.currentTimeMillis(); sum = new BigDecimal(0); for (int i=0; i < indices.length; i++) { sum.add( new BigDecimal(ll.get(indices[i])) ); } t2 = System.currentTimeMillis(); System.out.println("Access ArrayList: "+(t1-t0)+" ms, cnt="+elements+", tries="+indices.length); System.out.println("Access LinkedList: "+(t2-t1)+" ms, cnt="+elements+", tries="+indices.length); -- Access ArrayList: 12 ms, cnt=2000000, tries=20000 Access LinkedList: 371 ms, cnt=2000000, tries=20000
Czy ArrayList jest szybsze od LinkedList?
int elements = 1000000;
int tries = 100;
String values[] = new String[elements];
for (int k=0; k < elements; k++) {
values[k] = String.valueOf(k).intern();
}
long t0 = System.currentTimeMillis();
for (int i=0; i < tries; i++) {
ArrayList al = new ArrayList();
for (int j=0; j < elements; j++)
al.add(values[j]);
}
long t1= System.currentTimeMillis();
for (int i=0; i < tries; i++) {
LinkedList ll = new LinkedList();
for (int j=0; j < elements; j++)
ll.add(values[j]);
}
long t2 = System.currentTimeMillis();
System.out.println("Add to ArrayList: "+(t1-t0)/100+" ms avg, cnt="+elements+", tries="+tries);
System.out.println("Add to LinkedList: "+(t2-t1)/100+" ms avg, cnt="+elements+", tries="+tries);
-- Add to ArrayList: 33 ms avg, cnt=2000000, tries=100 Add to LinkedList: 51 ms avg, cnt=2000000, tries=100 Add to ArrayList: 18 ms avg, cnt=1000000, tries=100 Add to LinkedList: 12 ms avg, cnt=1000000, tries=100
poniedziałek, stycznia 30, 2017
Subskrybuj:
Posty (Atom)




















