This guide is completely irrelevant! You no longer need to follow anything here—doing so may actually harm performance rather than helping it. Please tell whoever linked you here that they need to maintain their own guide, if they want to help people set up newer versions of DXVK / etc.
I find the ability to get my android devices' battery info on my desktop computers via cli to be extremely convenient. I used to be able to this with KDE Connect easily, but things have just changed. Since I can't find any documentation on how to do this, and since I just stumbled on the answer myself, I though I might share what I know here. Please note that in the examples below, I will be using {device-id}
as a placeholder for the string that KDE Connect uses to identify to my devices.
That said, I used to be able to get my various devices' battery status through gdbus through the following:
gdbus call --session --dest org.kde.kdeconnect --object-path /modules/kdeconnect/devices/{device-id} --method org.kde.kdeconnect.device.battery.charge
However on Arch, I now get the following error: Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownInterface: No such interface 'org.kde.kdeconnect.device.battery' at object path '/modules/kdeconnect/devices/b04294f19e8767f5'
. I don't get this message on
See also List of materials about Software Design in Haskell
Junior | Middle | Senior | Architect | |
---|---|---|---|---|
Haskell level | Basic Haskell | Intermediate Haskell | Advanced Haskell | Language-agnostic |
Haskell knowledge scope | Learn you a Haskell | Get programming with Haskell | Haskell in Depth | Knows several languages from different categories |
Get programming with Haskell | Haskell in Depth | Functional Design and Architecture | ||
Soar with Haskell | [Soar |
#!/usr/bin/python3 | |
from bluepy import btle | |
import sys | |
class DiscoLH(btle.DefaultDelegate): | |
def __init__(self): | |
self.devices = [] | |
btle.DefaultDelegate.__init__(self) |
#! /usr/bin/env python3 | |
# This script toggles the PulseAudio output sink of the currently active application (guessed by the currently active X window) between the given output sink and the default output sink. | |
# The output sink is passed as first argument to the script. | |
# | |
# Requirements: | |
# | |
# xdotool (on Ubuntu install via "sudo apt install xdotool") | |
# pulsectl ("sudo pip3 install pulsectl") |
CertSimple just wrote a blog post arguing ES2017's async/await was the best thing to happen with JavaScript. I wholeheartedly agree.
In short, one of the (few?) good things about JavaScript used to be how well it handled asynchronous requests. This was mostly thanks to its Scheme-inherited implementation of functions and closures. That, though, was also one of its worst faults, because it led to the "callback hell", an seemingly unavoidable pattern that made highly asynchronous JS code almost unreadable. Many solutions attempted to solve that, but most failed. Promises almost did it, but failed too. Finally, async/await is here and, combined with Promises, it solves the problem for good. On this post, I'll explain why that is the case and trace a link between promises, async/await, the do-notation and monads.
First, let's illustrate the 3 styles by implementing
object Entities { | |
case class Review(txt: String, userId: Long, id: Long) | |
case class User(name: String, id: Long) | |
case class ReviewEvent(event: String, reviewId: Long) | |
case class FullReview(r: Review, user: User, evts: Seq[ReviewEvent]) | |
} |
Links on Must watch talks
-
A Year living Freely - Chris Myers
-
Programs as Values Pure Composable Database Access in Scala. In general each talk from Rob Norris is very useful for learning.
An expression beginning with a left arrow (<-
) inside a do
block statement is desugared to a monadic binding. This is syntactically a superset of existing Haskell, including extensions. It admits a clean notation that subsumes existing patterns and comes with few downsides.
do
f (<- x) (<- y)
-- ===
Here are 10 one-liners which show the power of scala programming, impress your friends and woo women; ok, maybe not. However, these one liners are a good set of examples using functional programming and scala syntax you may not be familiar with. I feel there is no better way to learn than to see real examples.
Updated: June 17, 2011 - I'm amazed at the popularity of this post, glad everyone enjoyed it and to see it duplicated across so many languages. I've included some of the suggestions to shorten up some of my scala examples. Some I intentionally left longer as a way for explaining / understanding what the functions were doing, not necessarily to produce the shortest possible code; so I'll include both.
The map
function takes each element in the list and applies it to the corresponding function. In this example, we take each element and multiply it by 2. This will return a list of equivalent size, compare to o