After rebooting my laptop, Debian 8.2 didn't want to boot but tells me:
cryptsetup: lvm is not available
The Hitchhiker's Guide to the Galaxy says: "Don't Panic". After about 3-5 minutes, the build-in shell is loaded (initramfs). You can directly leave the shell by typing exit and the system will boot normally. I don't know the problem yet, but it also says:
modprobe: module ehci-orion not found in modules.deb
Monday, September 14, 2015
Saturday, August 8, 2015
Installing Oracle JDK on Debian Jessie
Hi there. I just found out yet another way to install the Oracle JDK on your Debian. There's a nice article in the Debian Wiki and you only have to follow the five steps that are listed under the "Process" section. After you have installed the new .deb package, you can simply change from OpenJDK to Oracle JDK by using the update-java-alternatives command. In my case, its the following:
# update-java-alternatives --set jdk-8-oracle-x64
# update-java-alternatives --set jdk-8-oracle-x64
Thursday, April 16, 2015
Scala Future Callback for Apache HTTP Async Client
In a recent project, I needed an asynchronous HTTP client and due to some other requirements, I decided to use the Apache Async HTTP Client. The problem is, that the Async HTTP Client uses Java's Future implementation:
After I discussed the problem with a collegue, he came up with a pretty cool solution that prepares the ground for Scala Futures. The trick is to implement the FutureCallback interface by using a Scala Promise:
class ScalaFutureCallbackImpl[T] extends FutureCallback[T] {
private val promise: Promise[T] = Promise()
def cancelled(): Unit =
promise.failure(new RuntimeException("cancelled!"))
def completed(result: T): Unit = promise.success(result)
def failed(ex: Exception): Unit = promise.failure(ex)
def getScalaFuture: Future[T] = promise.future
}
Its interesting to see, how perfect the methods from the interface can be mapped to the corresponding Promise methods. The additional method getScalaFuture is necessary to give the caller access to the underlying Scala Future. With the new implementation, we are now able to use the Apache Async HTTP Client in a more convenient way:
val httpclient = HttpAsyncClients.createDefault()
val callback = new ScalaFutureCallbackImpl[HttpResponse]
httpClient.execute(host, request, context, callback)
for {
httpResponse <- callback.getScalaFuture
}
yield httpResponse
"The result can only be retrieved using method get when the computation has completed, blocking if necessary until it is ready." [Java Futures]An example code snippet demonstrates how to send an asynchronous HTTP request. To make a long story short: accessing the result of the Future means we block the current thread. An alternative solution is to use the Apache FutureCallback interface, which also lacks the ability to access the result of the future in a non-blocking way (see example). Hence: the provided functionality does not scale well in highly concurrent environments.
After I discussed the problem with a collegue, he came up with a pretty cool solution that prepares the ground for Scala Futures. The trick is to implement the FutureCallback interface by using a Scala Promise:
class ScalaFutureCallbackImpl[T] extends FutureCallback[T] {
private val promise: Promise[T] = Promise()
def cancelled(): Unit =
promise.failure(new RuntimeException("cancelled!"))
def completed(result: T): Unit = promise.success(result)
def failed(ex: Exception): Unit = promise.failure(ex)
def getScalaFuture: Future[T] = promise.future
}
Its interesting to see, how perfect the methods from the interface can be mapped to the corresponding Promise methods. The additional method getScalaFuture is necessary to give the caller access to the underlying Scala Future. With the new implementation, we are now able to use the Apache Async HTTP Client in a more convenient way:
val httpclient = HttpAsyncClients.createDefault()
val callback = new ScalaFutureCallbackImpl[HttpResponse]
httpClient.execute(host, request, context, callback)
for {
httpResponse <- callback.getScalaFuture
}
yield httpResponse
Thursday, January 8, 2015
Thinkpad T410 Wireless (Intel Centrino Advanced-N 6200 AGN) and Debian Wheezy
It might happen that your T410 wireless doesn't work after installing Debian, because you didn't have the non-free firmware at hand.
You'll find the missing firmware at the packages site. After you downloaded and decompressed the tarball put the file iwlwifi-6000-4.ucode-9.221.4.1 into /lib/firmware and create a symlink:
# ln -s iwlwifi-6000-4.ucode-9.221.4.1 iwlwifi-6000-4.ucode
Now, its time to reboot!
You'll find the missing firmware at the packages site. After you downloaded and decompressed the tarball put the file iwlwifi-6000-4.ucode-9.221.4.1 into /lib/firmware and create a symlink:
# ln -s iwlwifi-6000-4.ucode-9.221.4.1 iwlwifi-6000-4.ucode
Now, its time to reboot!
Subscribe to:
Posts (Atom)