Does this strict reading allow both Extra attack and Thirsthing blade to be used together?

The warlock invocation Thirsting Blade cannot be normally used with the class feature Extra attack since both feature explicitly say attack twice instead of once. But it seems to me that you could use both features when using two weapon fighting.

Assuming two light weapons, one of which is your pact weapon. You take the Attack action on your turn to attack twice with your non-pact weapon using you Extra Attack class feature.

Then, given the two fighting rules, you use your bonus action to attack once using your pact weapon this time.

Two weapon fighting rules (PHB p.195):

When you take the Attack action and attack with a light melee weapon that you’re holding in one hand, you can use a bonus action to attack with a different light melee weapon that you’re holding in the other hand.

But since your have the Thirsting Blade invocation, and you used the Attack action, you get to attack twice with your pact weapon.

Thirsting Blade (PHB p.111):

Vou can attack with your pact weapon twice, instead of once, whenever you take the Attack action on your turn.

Does this combo work or is there any interaction I’m not aware of ?

Getting weird characters (Chinese) when reading csv files with LibrOffice

I remember one of my colleagues sent me a csv file to check it.
I opened it using LibrOffice, it was too big so I had problems and could not open it (but I could open it using google docs on google drive).
After that, whenever I open a csv file, I get this:
enter image description here

I don’t know where the Chinese characters came from! But I can’t get rid of them.

when any csv file is opened, I get this:
enter image description here

And I am asked to download additional fonts. when I agree, I find no fonts to download.
I also tried to uninstall LibreOffice and install it again:

sudo apt-get purge fonts-opensymbol libreoffice libreoffice-\* openoffice.org-dtd-officedocument1.0 python\*-uno uno-libs3-\* ure ure-dbg sudo apt-get -s purge fonts-opensymbol libreoffice libreoffice-\* openoffice.org-dtd-officedocument1.0 python\*-uno uno-libs3-\* ure ure-dbg sudo apt-get remove --purge libreoffice* sudo apt-get clean sudo apt-get autoremove sudo add-apt-repository ppa:libreoffice/ppa sudo apt-get update sudo apt-get install libreoffice 

But it didn’t work!
Any suggestions please?

“failure reading sector 0x728b6c0 from hd1” after dual boot

I have installed Ubuntu at the second SSD drive in my laptop, but when the Grub shows up and I choose Ubuntu – the following error appears: “error: failure reading sector 0x728b6c0 from hd1. You need to load the Kernel first.” The sector is different each time I try to boot in. Windows 8 boots in normally. Do you have any ideas how to fix this? Grub repair doesn’t help…

OpenVPN on OpenWRT: TLS Error: reading acknowledgement record from packet

I am trying to connect my (windows and apple) remote client to my home router so that I can remotely access servers and devices behind my firewall. I have installed all of the components on both the client and server, I think that my problem is in the configuration. I know that the certificate files are correct on both the client and server because this had been working at one point (I had to reset the router so the config and firewall files got wiped out).

Results from logread on the openvpn/openwrt router:

Sun May 19 16:20:07 2019 daemon.notice openvpn(my_server)[4784]: 185.245.86.12:55378 TLS: Initial packet from [AF_INET]185.245.86.12:55378, sid=0f4ceaba c69f7575 Sun May 19 16:20:07 2019 daemon.err openvpn(my_server)[4784]: 185.245.86.12:55378 TLS Error: reading acknowledgement record from packet Sun May 19 16:20:09 2019 daemon.err openvpn(my_server)[4784]: 185.245.86.12:55378 TLS Error: reading acknowledgement record from packet Sun May 19 16:20:13 2019 daemon.err openvpn(my_server)[4784]: 185.245.86.12:55378 TLS Error: reading acknowledgement record from packet Sun May 19 16:20:20 2019 daemon.err openvpn(my_server)[4784]: 185.245.86.12:55378 TLS Error: reading acknowledgement record from packet Sun May 19 16:20:37 2019 daemon.err openvpn(my_server)[4784]: 185.245.86.12:55378 TLS Error: reading acknowledgement record from packet Sun May 19 16:21:07 2019 daemon.err openvpn(my_server)[4784]: 185.245.86.12:55378 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity) Sun May 19 16:21:07 2019 daemon.err openvpn(my_server)[4784]: 185.245.86.12:55378 TLS Error: TLS handshake failed 

Here is my /etc/config/openvpn:

config openvpn 'my_server'         option enable '1'         option port '1194'         option proto 'udp'         option dev 'tap0'         option ca '/etc/openvpn/ca.crt'         option cert '/etc/openvpn/my-server.crt'         option key '/etc/openvpn/my-server.key'         option dh '/etc/openvpn/dh2048.pem'         option ifconfig_pool_persist '/tmp/ipp.txt'         option keepalive '10 120'         option 'comp_lzo' 'yes'         option persist_key '1'         option persist_tun '1'         option status '/tmp/openvpn-status.log'         option verb '3'         option server_bridge '192.168.1.1 255.255.255.0 192.168.1.200 192.168.1.219'         list push 'redirect-gateway def1'         list push 'dhcp-option DNS 192.168.1.1'         option enabled '1' 

Additional /etc/config/firewall settings:

config 'rule'         option 'target' 'ACCEPT'         option 'dest_port' '1194'         option 'src' 'wan'             option 'proto' 'tcpudp'         option 'family' 'ipv4' 

Additional /etc/config/dhcp settings:

    config dhcp 'lan'             option interface 'lan'             option ignore '0'             option start '50'             option limit '150' 

Client (Macbook) .opvn:

  client   dev tun   proto udp   fast-io   remote someplace-really-cool.com 1194   nobind   persist-key   persist-tun   verb 3   key-direction 1   cipher AES-128-CBC   auth SHA256  <ca> -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- </ca> <cert> Certificate:     Data:         Version: 3 (0x2)         Serial Number: 4097 (0x1001)     Signature Algorithm: sha256WithRSAEncryption         Issuer: C=GB, ST=London, O=WWW Ltd.         Validity             Not Before: Jun 22 19:57:52 2018 GMT             Not After : Jun 19 19:57:52 2028 GMT         Subject: CN=my-client         Subject Public Key Info:             Public Key Algorithm: rsaEncryption                 Public-Key: (4096 bit)                 Modulus: ...                 Exponent: 65537 (0x10001)         X509v3 extensions:             X509v3 Key Usage:                  Digital Signature             X509v3 Extended Key Usage:                  TLS Web Client Authentication     Signature Algorithm: sha256WithRSAEncryption ... -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- </cert> <key> -----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY----- </key> <tls-auth> # # 2048 bit OpenVPN static key # -----BEGIN OpenVPN Static key V1----- ... -----END OpenVPN Static key V1----- </tls-auth>   auth-nocache   client   dev tun   proto udp   fast-io   remote someplace-really-cool.com 1194   remote-cert-tls server   nobind   persist-key   persist-tun   verb 3   key-direction 1 <ca> -----BEGIN CERTIFICATE----- -----END CERTIFICATE----- </ca> <cert> Certificate:     Data:         Version: 3 (0x2)         Serial Number: 4097 (0x1001)     Signature Algorithm: sha256WithRSAEncryption         Issuer: C=GB, ST=London, O=WWW Ltd.         Validity             Not Before: Jun 22 19:57:52 2018 GMT             Not After : Jun 19 19:57:52 2028 GMT         Subject: CN=my-client         Subject Public Key Info:             Public Key Algorithm: rsaEncryption                 Public-Key: (4096 bit)                 Modulus: ... -----END CERTIFICATE----- </ca> <cert> Certificate:     Data:         Version: 3 (0x2)         Serial Number: 4097 (0x1001)     Signature Algorithm: sha256WithRSAEncryption         Issuer: C=GB, ST=London, O=WWW Ltd.         Validity             Not Before: Jun 22 19:57:52 2018 GMT             Not After : Jun 19 19:57:52 2028 GMT         Subject: CN=my-client         Subject Public Key Info:             Public Key Algorithm: rsaEncryption                 Public-Key: (4096 bit)                 Modulus: ...                 Exponent: 65537 (0x10001)         X509v3 extensions:             X509v3 Key Usage:                  Digital Signature             X509v3 Extended Key Usage:                  TLS Web Client Authentication     Signature Algorithm: sha256WithRSAEncryption ... -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- </cert> <key> -----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY----- </key> <tls-auth> # # 2048 bit OpenVPN static key # -----BEGIN OpenVPN Static key V1----- ... -----END OpenVPN Static key V1----- </tls-auth> 

Stop systemd from reading partitions

I’m trying to do a data recovery job on a hard drive (using ddrescue and some custom scripts) but every time I insert the drive, dmesg records multiple read errors to all seven of the drive’s partitions; These reads bog down the drive and it fails (requiring a power cycle) before I can get much data off of it.

I’ve tried tracking down what is doing the disk access and it seems like it’s systemd-u (that’s what lsof shows).

Is there any way to stop it?

Reading problem of object-oriented concept about the book “Object-oriented software construction 2/e”

I’ve been learning object-oriented concept from this book, and stuck in a specified concept in the middle of chapter 6.

Because with no brief explaining beforehand, no one could understand my question; so I’m giving it first.

The purpose of chapter 6 is teaching how to describe objects by using abstract data descriptions; three criteria are given.

  1. The descriptions should be precise and unambiguous
  2. They should be complete — or at least as complete as we want them in each case(we may decide to leave some details out)
  3. They should not be overspecifying.

Then the author decided to demonstrate how to describe objects in a wrong way by using physical representation, instead of in a right way by ADTs.

Three physical representations(array up, array down, and linked list) of stack are taken as an example.

After briefly describing these three kind of stack, author then said:

In the stack example, what unites the various representations in spite of all their differences is that they describe a “container” structure, where certain operations are applicable and enjoy certain properties. By focusing not on a particular choice of representation but on these operations and properties, we may be able to obtain an abstract yet useful characterization of the notion of stack.

Then

We are interested in individual agents not so much for what they are internally as for what they have to offer to each other.

That is to say, we are interested in what operations objects can do, rather than what objects internally are. From the stack example, we interested in push and pop rather than which physical representation is that stack.

Based on this conclusion, author started to teach how to write a specification in a right way for describing objects.

Something called abstract data type specification is responsible for describing objects. It offers client(the user of software module) two information.

  1. How these operations can be used.
  2. What these operations will do for client.

Abstract data type specification consists of four paragraphs.

  • TYPES
  • FUNCTIONS
  • AXIOMS
  • PRECONDITIONS

Author started from types first, where is I’m stuck in; so I just paste context for not to mislead you.

Specifying types

The TYPES paragraph indicates the types being specified. In general, it may be convenient to specify several ADTs together, although our example has only one, STACK.

By the way, what is a type? The answer to this question will combine all the ideas developed in the rest of this chapter; a type is a collection of objects characterized by functions, axioms and preconditions. If for the moment you just view a type as a set of objects, in the mathematical sense of the word “set” — type STACK as the set of all possible stacks, type INTEGER as the set of all possible integer values and so on — you are not guilty of any terrible misunderstanding. As you read this discussion you will be able to refine this view. In the meantime the discussion will not be too fussy about using “set” for “type” and conversely.

On one point, however, you should make sure to avoid any confusion: an abstract data type such as STACK is not an object (one particular stack) but a collection of objects (the set of all stacks). Remember what our real goal is: finding a good basis for the modules of our software systems. As was noted in the previous chapter, basing a module on one particular object — one stack, one airplane, one bank account — would not make sense. O-O design will enable us to build modules covering the properties of all stacks, all airplanes, all bank accounts — or at least of some stacks, airplanes or accounts.

An object belonging to the set of objects described by an ADT specification is called an instance of the ADT. For example, a specific stack which satisfies the properties of the STACK abstract data type will be an instance of STACK. The notion of instance will carry over to object-oriented design and programming, where it will play an important role in explaining the run-time behavior of programs.

The TYPES paragraph simply lists the types introduced in the specification. Here:

STACK[G]

Our specification is about a single abstract data type STACK, describing stacks of objects of an arbitrary type G.

Genericity

In STACK [G], G denotes an arbitrary, unspecified type. G is called a formal generic parameter of the abstract data type STACK, and STACK itself is said to be a generic ADT. The mechanism permitting such parameterized specifications is known as genericity; we already encountered a similar concept in our review of package constructs.

It is possible to write ADT specifications without genericity, but at the price of unjustified repetition. Why have separate specifications for the types “stack of bank accounts”, “stack of integers” and so on? These specifications would be identical except where they explicitly refer to the type of the stack elements — bank accounts or integers. Writing them, and then performing the type substitutions manually, would be tedious. Reusability is desirable for specifications too — not just programs! Thanks to genericity, we can make the type parameterization explicit by choosing some arbitrary name, here G, to represent the variable type of stack elements.

As a result, an ADT such as STACK is not quite a type, but rather a type pattern; to obtain a directly usable stack type, you must obtain some element type, for example ACCOUNT, and provide it as actual generic parameter corresponding to the formal parameter G. So although STACK is by itself just a type pattern, the notation

STACK [ACCOUNT]

is a fully defined type. Such a type, obtained by providing actual generic parameters to a generic type, is said to be generically derived.

The notions just seen are applicable recursively: every type should, at least in principle, have an ADT specification, so you may view ACCOUNT as being itself an abstract data type; also, a type that you use as actual generic parameter to STACK (to produce a generically derived type) may itself be generically derived, so it is perfectly all right to use

STACK [STACK [ACCOUNT]]

specifying a certain abstract data type: the instances of that type are stacks, whose elements are themselves stacks; the elements of these latter stacks are bank accounts.

Here is my question

I can roughly understand

STACK[G]

where

  1. STACK is a generic ADT which describe all kind of STACK, and STACK is not quite a type, but rather a type pattern
  2. G is a type with arbitrary and unspecified, called formal generic parameter.
  3. We can provide an actual generic parameter, in this example ACCOUNT, in place of G to obtain a fully defined type “STACK[ACCOUNT]”, which is said to be generically derived.

If I put above three in this way, why ACCOUNT itself is an abstract data type? How comes ACCOUNT at the same time is parameter as well as abstract data type?

I cannot figure out author’s mind, let alone STACK [STACK [ACCOUNT]]

Can you explain it to me in the author’s way? If C Code is accompanied, that would be awesome.

I’m willing to pay bounty if this feature is available in this website.

Reading asynchronous video streams

Given several video files / RTSP streams I want to retrieve frames (cv::Mat) concurrently with minimum temporal difference between timestamps and without interlocking the threads. So, basically I need a function get_packet(packetstruct& packet) which can be called inside while(1) and which blocks until a new frame from every camera has been collected. I have to assume that some of the streams can fail to yield a new frame (low bandwidth, connection break). In this case, the packet shall contain an empty placeholder. Also, the streams might be clocked at different frame rates in which case the packets shall be retrieved according to the fastest stream and fill the frames of the slower streams with placeholders.

It should work like this (pseudocode):

thread_worker(queue) {   while (1) {      frame = get_frame(cam)      queue.push(frame)   } }  num_streams = 8 start_thread_workers(num_streams)  frame_packet get_packet() {     for queue in queues {         frame = queue.pop()         frame_packet.append(frame)     }     return frame_packet }  while(1) {    frame_packet = get_packet()     for frame in frame_packet {        display(frame)    } } 

This is a simple example which does not meet the requirements. I tried the following: – Thread barrier to let frame producer threads wait for each other. This leads to a slow down as the threads have to wait for each other. Also, it does not allow for different stream clocks.

Any idea, how to achieve this? (in C++)

Edit: I was thinking of using boost::latch to let the threads wait for each other with possibility of a timeout. But I am not sure how to go about that.

android studio app reading data sent by module hc-05

I program on android studio for very little time (1 week) and wants to make an application that reads data sent by a module hc-05 but it looks very complicated when I look on forums and I do not understand anything at all. I need to realize the application for a project of my school. can someone help me please? it’s really important for me. (I have solid foundations in c) 😁

how to protect bash scripts from reading

Good evening guys. As the title suggests I was wondering if it is possible to protect bash scripts that also contain sensitive data from reading and tampering with other users using the system. Let me explain: the scripts are run in an office on a Debian computer. My user “jack” is a sudoers user, and it uses the “sudo” command without input a root password (necessary for my work). My problem is that other users logging in via root in ssh and could read or manipulate the scripts damaging my work. I realized that only fixing the permissions is useless.

What could be the best solution to my problem? Thanks in advance.