Pokazywanie postów oznaczonych etykietą cool. Pokaż wszystkie posty
Pokazywanie postów oznaczonych etykietą cool. Pokaż wszystkie posty

środa, maja 16, 2018

The first Docker ready JDK

Get it from https://hub.docker.com/r/kubaseai/openj9ce






środa, maja 02, 2018

Communication Within Tesla

Subject: Communication Within Tesla

There are two schools of thought about how information should flow within companies. By far the most common way is chain of command, which means that you always flow communication through your manager. The problem with this approach is that, while it serves to enhance the power of the manager, it fails to serve the company.
Instead of a problem getting solved quickly, where a person in one dept talks to a person in another dept and makes the right thing happen, people are forced to talk to their manager who talks to their manager who talks to the manager in the other dept who talks to someone on his team. Then the info has to flow back the other way again. This is incredibly dumb. Any manager who allows this to happen, let alone encourages it, will soon find themselves working at another company. No kidding.
Anyone at Tesla can and should email/talk to anyone else according to what they think is the fastest way to solve a problem for the benefit of the whole company. You can talk to your manager's manager without his permission, you can talk directly to a VP in another dept, you can talk to me, you can talk to anyone without anyone else's permission. Moreover, you should consider yourself obligated to do so until the right thing happens. The point here is not random chitchat, but rather ensuring that we execute ultra-fast and well. We obviously cannot compete with the big car companies in size, so we must do so with intelligence and agility.
One final point is that managers should work hard to ensure that they are not creating silos within the company that create an us vs. them mentality or impede communication in any way. This is unfortunately a natural tendency and needs to be actively fought. How can it possibly help Tesla for depts to erect barriers between themselves or see their success as relative within the company instead of collective? We are all in the same boat. Always view yourself as working for the good of the company and never your dept.

Thanks,
Elon

środa, marca 28, 2018

Hot to abuse NVDIMM support in Java 10

Java 10 allows for memory allocation in a place different than plain RAM. The idea was to support Intel Optane and similar things, but we can abuse that feature to run Java applications in compressed memory or in filesystem. Let's play with something small.

Prerequisites:
root@user-Aspire-ES1-431:~# modinfo zram
filename:       /lib/modules/4.14.20-041420-generic/kernel/drivers/block/zram/zram.ko
description:    Compressed RAM Block Device
author:         Nitin Gupta
license:        Dual BSD/GPL
srcversion:     98BCA9B63810EF5DB65BF87
depends:     
retpoline:      Y
intree:         Y
name:           zram
vermagic:       4.14.20-041420-generic SMP mod_unload
signat:         PKCS#7
signer:       
sig_key:     
sig_hashalgo:   md4
parm:           num_devices:Number of pre-created zram devices (uint)
root@user-Aspire-ES1-431:~# modprobe zram num_devices=4
root@user-Aspire-ES1-431:~# echo 1G > /sys/block/zram0/disksize
[ 2562.326469] zram0: detected capacity change from 0 to 1073741824
root@user-Aspire-ES1-431:~# mkfs.ext4 /dev/zram0; mount /dev/zram0 /cmem
mke2fs 1.43.5 (04-Aug-2017)
Discarding device blocks: done                         
Creating filesystem with 262144 4k blocks and 65536 inodes
Filesystem UUID: f8ddae16-ebd4-4615-80c3-8cf60a448526
Superblock backups stored on blocks:
32768, 98304, 163840, 229376

Allocating group tables: done                         
Writing inode tables: done                         
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

We see here that even with filesystem and compression overhead solution AllocateHeapAt zram isn't very slow. We can put Java EE into zram and fit the same set of applications using one node instead of two. Very tempting. Maximum heap size is set to 512MB (fake NV) and we still use RAM.



And now killer feature: run Java application in filesystem (/tmp). Why it is not slow? Linux has got very good filesystem cache.


[pid 31442] openat(AT_FDCWD, "/cmem/storage//jvmheap.d3tNHS", O_RDWR|O_CREAT|O_EXCL, 0600) = 4
[pid 31442] unlink("/cmem/storage//jvmheap.d3tNHS" 
[pid 31442] fallocate(4, 0, 0, 536870912 
[pid 31442] mmap(0xe0000000, 536870912, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, 4, 0) = 0xe0000000
[pid 31442] close(4)                    = 0

If the name passed to unlink was the last link to a file but any processes still have the file open, the file will remain in existence until the last file descriptor referring to it is closed. Access to nvdimm memory visible as filesystem and allocated via files must be secure. No other process should be able to alter memory file and unlink is used for that together with exclusive file access. The munmap() system call deletes the mappings for the specified address range, and causes further references to addresses within the range to generate invalid memory references. The region is also automatically unmapped when the process is terminated. On the other hand, closing the file descriptor does not unmap the region. It is not possible for any Java thread to access file descriptor of memory file, because this descriptor is gone. Security gives us also good cleanup.

In case heap is mmaped from /tmp we use memory from filesystem buffers - we have swapping at application level, controlled by us, not by the OS which can hit any application. In case of zram we have transparent memory compression.

wtorek, marca 06, 2018

Docker Swarm & Stack


wtorek, stycznia 02, 2018

Jak z komórki zmieniać kanały Supermedia

W aplikacji SURE należy wybrać urządzenie ADB

Danfoss Eco

Gdyby grzejniki w mieszkaniu były takie mądre, żeby same zmniejszyły temperaturę na noc, a potem nagrzały pokój tuż przed wstawaniem do pracy. Żeby po wyjściu do pracy grzejniki ustawiały się same na 17C. A w sobotę i niedzielę, żeby grzały później niż w dni robocze. Żeby można było stworzyć harmonogram na cały tydzień. Można. Są na rynku termostaty Danfoss Eco programowane z komórki za pomocą protokołu Bluetooth.

Na dole temperatura z harmonogramu lub ustawiona ręcznie (i obowiązująca do następnej zmiany automatycznej), na górze temperatura zmierzona przez termostat.

Aktualnie widoczne po protokole Bluetooth termostaty. Zasięg komunikacji wynosi do 10m.

Adaptive learning pozwala na uczenie się termostatu jak bardzo ma odkręcić zawór, żeby uzyskać docelową temperaturę. Po 7 dniach termostat powinien optymalnie utrzymywać zadane wartości. W przypadku otwartego salonu i/lub grzejnika w pobliżu drzwi balkonowych kontrolę ciepła (Heat control) należy ustawić na Moderate (vs Quick) - nagrzane powietrze szybko ucieka i należy założyć większą bezwładność wynikową grzejnika.



Gdzie są domyślne temperatury? Z prawej strony ekranu. Trzeba wykonać ruch slide.





Jak to może działać? Temperaturowy zakres pracy urządzenia to 0-40C. Rodzielczość pół stopnia. Pomiary temperatury co 10 minut, a ustawianie co 30 minut. Tablica do adaptacji może wyglądać tak: czas [0-48], T zadana, T początkowa, T wynikowa, l - długość po obwodzie wykręcenie zaworu. Urządzenie sprawdza czy dla danego czasu i zadanej temperatury ma wpis. Jeśli tak to sprawdza T początkową. Jeśli są takie same to sprawdza T wynikową. Jeśli wartość wynikowa równa się zadanej to używa historycznej wartości l. Jeśli wartość wynikowa jest większa l musi być mniejsze, w przeciwnym wypadku większe. Po upływie cyklu 30 minut urządzenie zapisuje aktualne parametry. Temperatury i wartość l dadzą się zapisać w 8 bitach, a cały wpis tablicy na 32-bitowej liczbie całkowitej, dlatego liniowe skanowanie tablicy w celu znalezienia najlepszego wpisu [T zadana, T początkowa] jest szybkie. Mikrokontroler może być bardzo prosty. Stos Bluetooth może jednak wymagać SoC ARM.


sobota, września 23, 2017

Tibco BusinessWorks on IBM Java 9 with reduced memory consumption thanks to Strings held as byte[] instead of char[]

http://openjdk.java.net/jeps/254

https://www.ibm.com/support/knowledgecenter/SSYKE2_9.0.0/j9vm_reference.html

but...

https://github.com/eclipse/openj9/issues/42 needs some work - default Garbage Collection settings may have impact on some benchmarks and real life loads. Still IBM Metronome GC doesn't have these issues.

To switch Tibco BW to OpenJ9 use these settings in tra:

tibco.env.JVM_LIB_DIR /home/user/TIBCO/tibcojre64/jdk-9+181/lib/j9vm
tibco.env.JVM_LIB_SERVER_DIR /home/user/TIBCO/tibcojre64/jdk-9+181/lib/j9vm
tibco.env.JVM_LIB_PATH /home/user/TIBCO/tibcojre64/jdk-9+181/lib/j9vm/libjvm.so

When switching from Java 7 you have to add sun.io.* to some jar in classpath. Memory usage needs some research and numbers and then we can think of target environments: DEV, TEST. PROD would need support from Tibco.



poniedziałek, lipca 17, 2017

Synthesizing Obama: Learning Lip Sync from Audio

piątek, czerwca 09, 2017

How to create instance of Java interface returning dummy data


poniedziałek, maja 29, 2017

Doskonała analiza Google Maps

https://www.justinobeirne.com/a-year-of-google-maps-and-apple-maps

sobota, maja 27, 2017

Antywirusy chmurowe są do kitu

http://blog.emsisoft.com/2017/05/12/wcry-ransomware-outbreak/

czwartek, maja 25, 2017

Microsoft Translator

https://translator.microsoft.com/neural


środa, maja 10, 2017

Microsoft Face API dostępne publicznie

https://azure.microsoft.com/en-us/services/cognitive-services/face/


piątek, kwietnia 21, 2017

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.





czwartek, stycznia 26, 2017

Cache w Allegro

http://allegro.tech/2017/01/estimating-the-cache-efficiency-using-big-data.html

czwartek, października 20, 2016

Johny Mnemonic - Memory Doubler

cat /etc/default/grub | grep zswap
GRUB_CMDLINE_LINUX_DEFAULT="splash quiet zswap.enabled=1 zswap.max_pool_percent=50"

https://www.ibm.com/developerworks/community/blogs/fe313521-2e95-46f2-817d-44a4f27eba32/entry/new_linux_zswap_compression_functionality7?lang=en

piątek, września 09, 2016

Lądowanie w Modlinie z GPS-em








niedziela, sierpnia 21, 2016

Ferrari w Modenie