Given infinite unencrypted and encrypted texts, can I find the algorithm?

Question: Given an infinite amount of both unencrypted and the corresponding encrypted text, would I be able to calculate the algorithm? I am relative new to cryptography and don't know if I would be able to find how the unencrypted text is encrypted... Is this possible? If so, what should I study?
Comment: Do you have an infinite amount of time as well?
Comment: If the encryption is a [tag:one-time-pad], no, you can't. For most practical cryptosystems, assuming you also have infinite computational power, yes (or at least you can find something that is as good as the key for any practical purpose).
Comment: yes meant the algorithm better... edited my question
Comment: *removed some comments related to the earlier version of the question*
Answer: summmary
In general, no.
An attacker who has lots of ciphertext+plaintext pairs may never be able to reverse-engineer an algorithm from them.
An attack may not even be able to distinguish which one of a large group of known encryption algorithms was used to generate those ciphertexts.
However, various weaknesses in some algorithms and protocols are known.
If such an algorithm was used, the attacker may find it relatively easy to rule out all but a few or perhaps only 1 of the known encryption algorithms.
details
Some people who build modern ciphers try to make their ciphers "indistinguishable from random".
Several modern ciphers (especially ones intended for use in steganography) are not currently known to be susceptible to such a distinguishing attack.
No matter how many ciphertext+plaintext pairs the attacker collects that were properly encrypted using a single one of those algorithms using a single long-term key,
there is no known practical way for that attacker to distinguish a new message encrypted using the same algorithm using the same long-term key from a freshly generated series of bits from a hardware random-number generator.
This implies that there is no known practical way for that attacker to discover which one of those algorithms was actually used.
Cryptanalysts have discovered distinguishing attacks for many vulnerable ciphers.
If an attacker collects enough ciphertext-plaintext pairs encrypted by such a vulnerable cipher, that attacker can rule out most other ciphers, narrowing down the possible algorithm to a few or perhaps only 1 known vulnerable encryption algorithm.
When an attacker has samples of both the plaintext (called a crib), and its encrypted version (ciphertext), the attacker can mount a known-plaintext attack.
The people who build modern ciphers try hard to make their ciphers immune to known-plaintext attacks.
Most modern ciphers are not currently known to be susceptible to known-plaintext attacks.
However, many historic ciphers (most famously, the Enigma cipher) can be partially or completely broken by a known-plaintext attack.
Many distinguishing attacks and known-plaintext attacks depend on the person doing the encryption using the same key for large numbers of messages.
Sometimes that number is so extremely large that these attacks are impractical.
Other times that number is large but not improactical, and cryptographers recommend periodically rekeying long before such attacks are practical (RFC4253, RFC4344, etc.).
In practice, many communication protocols transmit the specific encryption protocol used, transmitted in plaintext in the header before any ciphertext, at the beginning of every message.
An attacker only needs to look at that header to know which encryption algorithm was used.
If someone encrypts enough messages with the same key using a block cipher in electronic codebook mode,
and an attacker gets enough ciphertext-plaintext pairs,
then even without knowing which particular block cipher is used,
the attacker can decrypt any block in any new encrypted message whenever a block of plaintext in the new message happens to match a block of known plaintext.
In theory, if an attacker has an "infinite amount" of computing power,
that attacker try every possible encryption key in every known encryption algorithm and see if it "works".
Such a brute-force attack can in theory recover the key for almost all known encryption algorithms.
(The one-time pad and closely related ciphers are completely immune to a brute-force attack).
Fortunately for people who are not attackers, the amount of work required for such a brute-force attack usually makes them impractical.
Answer: Did you know the algorithm ? This is the central question.
In modern cryptography, the algorithm is public while the all secret lies in the key. Knowing the algorithm allows analyst to quantify the strength, or the intractability of the mathematical transformation.
You alse have to make a distinction. Two main classes exist between Stream Cipher and Bloc cipher.
In Stream cipher, the key is as long as long as the message, and the question is not well asked. For example OTP case don't recommands to use the same key twice.
In bloc cipher by definition input-output sizes are bounded. for a m-bit cipher size, there are $(2^n)^{2^n}$ binary applications from input space to output space. Then we coudn't have an infinite number of (plain, cipher) pairs.
Comment: ? stream ciphers don't necessarily have keys as long as the message, e.g. see RC4, and block ciphers can have modes of operation that effectively turn them into a stream cipher construction.
Comment: @Thomas: That's Right! But my answer was to give a general view on the 2 main classes to someone who introduce himself as relatively new in Crypto. No need to give more elaborates constructions at a first glance.
Comment: Unfortunately, it looks like your answer caused the OP to change the question :)
Comment: @mikeazo: Yes of Course ! I've pointed out that the problem hasn' been mathematically posed. Unfortunately some people hadn't understood.


How do I rename a metadata term in C#?

Question: Can't find this documented anywhere. Do I just change the Term.Name and run a commit all on the term store?
Answer: Yes, that is the simplest way to do it.  I have only found two ways to rename a term programmatically:
1) Set the Name property and CommitAll on the Term Store:
<code>    var site = SPContext.Current.Site;
    var taxonomySession = new TaxonomySession(site);
    var termStore = taxonomySession.TermStores[0];
    var termGroup = termStore.Groups[0];
    var termSet = termGroup.TermSets[0];
    var term = termSet.Terms[0];
    term.Name = "Test Update";
    termStore.CommitAll();
</code>
2) Create a new Term and then Merge it with the old one.
But you were on the right track.  Go with option 1.  Only thing to note is that it doesn't always update instantly.  It can take a few seconds for the change to be reflected when you try to retrieve the term again.
Comment: Thanks a lot for your answer John. Yer, I believe there's a timer job to update any metadata terms. Thanks again.

How do I rename a metadata term in C#?


Can I use Google Fonts to design my own logotype?

Question: I am a digital marketing freelancer and I am starting to design my own logo. I would like to use two different fonts available onGoogle Fonts: "Poiret One" and "Syncopate". Therefore, I want to know if I am allowed to use them as a professional resource for my own professional career, or should I buy them instead?
Answer: Its opensource. Hence you can use it. For detailed FAQs
https://developers.google.com/fonts/faq


Conserved quantities quantum field theory

Question: In classical field theory, due to Noether's theorem, corresponding to every continuous symmetry there is a conserved current/charge. However, to arrive at this conclusion one has to assume that the Euler-Lagrange EoM holds,
$$\partial_\mu\frac{\partial\mathcal{L}}{\partial \left(\partial_\mu\phi\right)}-\frac{\partial\mathcal{L}}{\partial\phi}=0.$$
Now, when we promote the fields to the status of operators to build quantum fields, we impose the following commutation relation on the fields,
$$\left[\hat{\phi}(\mathbf{x},t),\hat{\pi}(\mathbf{y},t)\right]=i\delta^{(3)}(\mathbf{x}-\mathbf{y}).$$
This means that that the operator $\hat{\phi}(x)$ do not satisfy any Euler-Lagrange type EoMs. Then what happens to the conserved quantities/currents/charges in a quantum theory? How can the Noether theorem apply to quantum fields, if there's no EoM for the field operators?
Comment: @FaberBosch the operators $\phi(x)$ and $\pi(x)$ are already predetermined. You're probably confusing them with the expectation values and/or eigenvalues.
Comment: @FaberBosch To clarify: when you say that the field operators in QFT don't have EoMs, do you mean that we can't write them in Euler-Lagrange form? Whether that's true or not, the field operators in QFT do obey EoMs (in the Heisenberg picture, which is the picture we *always* use in classical field theory), even though they don't commute. We use the EoMs to determine whether a given quantity is conserved. We don't need to use a lagrangian for this, so whether the lagrangian formalism works for non-commuting operators may or may not be relevant, depending on exactly what you're asking.
Comment: Possible duplicate: [Is there a formulation of Noether's theorem for the path integral formalism?](https://physics.stackexchange.com/q/587625/2451)
Comment: @Qmechanic The question sounds similar but I want to know what happens in the canonical quantization formulation. I am not much familiar with path integrals and I have no idea what Ward-Takahashi identities are!
Comment: @annav With this search keyword I mostly find QFT notes with mostly the same approach where Noerther's theorem is discussed in Classical Field Theory and never it is mentioned clearly when the quantum fields are discussed.
Comment: @ChiralAnomaly "the field operators in QFT do obey EoMs" I don't understand this. How? The conjugate pairs $\hat{\phi}$ and $\hat{\pi}$ cannot be determined with precision simultaneously. Then how can there be an EoM? If there is an EoM you could know the history of field configurations for both conjugate operators. Can you elaborate your claim with an example, say, by writing down the EoM for a non-interacting quantum scalar field.
Answer: Let me make some comments on this topic as it's an important point that often gets glossed over till late into most standard treatments of QFT. There are a couple major places where symmetries come in, and I will try and describe them here.
First, let's recall that in a classical theory, Noether's theorem has two important implications. The first is the existence of conserved charges which can be useful in solving the equations of motion and so on. But her theorem also tells us that these charges generate the transformation they're associated with via the Poisson bracket. That is, suppose we have a continuous transformation $T_\alpha$ parametrized by $\alpha$ which acts on our fields $\phi$ by
$$
\phi^\prime = T_\alpha[\phi].
$$
If this transformation is a symmetry, then Noether's theorem tells us there will be an associated charge $Q$ which is consrved:
$$
\frac{d Q}{d t}=\{Q,H\}=0
$$
and which generates the symmetry. That is, for any function $F$ on phase space,
$$
\frac{d F(T_\alpha[\phi])}{d\alpha}\biggr|_{\alpha=0}=\{F,Q\}.
$$
Meaning if we take the derivative of $F$ along the flow generated by the transformation $T$, this is equivalent to computing the Poisson bracket of $F$ and $Q$.
The reason I belabor this point is because it carries over to the quantized version of the theory: the charges $Q$ which are conserved $[H,Q]=0$ and are associated to a symmetry generate that symmetry via the commutator, up to factors of $i$ and $\hbar$.
For example, we know the angular momentum operator is the generator of rotations. The linear momentum operator of the generator of translations, and so on.
So Noether's theorem provides a link between transformations on our Hilbert space and symmetries.
Next, we know that for any collection of pair-wise commuting operators, we can simultaneously diagonalize them all. This is very useful for organizing our Hilbert space. For example, when considering the hydrogen atom, we use the fact that the Hamiltonian commutes with $L_z$ and $L^2$ to write a basis of states in the form $|E_n,\ell,m\rangle$. If you've only ever seen Griffith's presentation of the hydrogen atom problem, I highly recommend looking in Sakurai's book. There operator algebras (which are the clear way to understand the role of symmetry) are stressed as opposed to tedious PDE problems.
Finally, there are Ward identities, which unfortunately are typically not discussed until late into a standard treatment of QFT. Essentially these are relations between inner products controlled by symmetry. That is, suppose we have some collection of operators $\mathcal{O}_1,\ldots,\mathcal{O}_n$ and wish to compute
$$
\langle 0|\mathcal{O}_1\ldots\mathcal{O}_n|0\rangle.
$$
Symmetries will tell us something about how this expectation value relates to other expectations. The easiest way to derive the identities comes from what's known as a field redefinition in a path integral approach, but these can also be obtained from an operator point of view.
Schematically, these identities state that if $\frac{d}{d\alpha}$ is the derivative with respect to a continuous symmetry (in the same sense as in the classical case above), then we must have the identity
$$
\frac{d}{d\alpha}\langle 0|\mathcal{O}_1\ldots\mathcal{O}_n|0\rangle=-i\sum_{k=1}^n\langle0|\mathcal{O}_1\ldots T[\mathcal{O}_k]\ldots\mathcal{O}_n|0\rangle.
$$
Again, this is only schematic to give some idea of how it goes.
The power of the Ward identities is that the hold non-perturbatively and as a result are one of the few statements we can really confidently make about a theory without relying upon some perturbative expansion. Whether classical or quantum, that is always the power of Noether's theorem: it tells us things we otherwise would never be able to compute.
In any case, there is some very nice information about these things out there, unfortunately I have tended to find it very scattered about.
Answer: The simplest possible Lorentz-invariant equation of motion for a field is $\Box \phi = 0$. The classical solutions are plane waves. For example a solution is $\phi(x) = a_p(t) e^{i \vec p \cdot \vec x}$, which is the equation of motion of a harmonic oscillator.
A general solution is
$\phi(x, t) = \int \frac{d^3 p}{(2 \pi)^3} (a_p e^{-i p x} + a_p^\dagger e^{i p x})$
where $a_p$ and $a_p^\dagger$ are respectively the annihilation and creation operators, and $[a_k, a_p^\dagger] = (2 \pi)^3 \delta^3 (\vec p - \vec k)$ are the equal time commutation relations.
The operator canonically conjugate to $\phi(x)$ at $t = 0$ is $\pi(\vec x) = \partial_t \phi(x) |_{t = 0}$. If you compute the commutator, you get
$[\phi(\vec x), \pi(\vec y)] = i \delta^3 (\vec x - \vec y)$
All what above is consistent with the Euler-Lagrange equations of motion, hence the Noether theorem holds for the quantized fields as well.


Juniper SRX, workstation on SRX switch port cannot ping reth interface

Question:
I have a SRX345 firewall that has a workstation hanging off one of its ethernet ports.
The workstation cannot ping the SRX reth interface, reth1.50 (its default gw) even though the   ethernet port is configured as access and in vlan 50.
The workstation and reth1.50 are in the same subnet and security zone.
There is also in intrazone security policy
Reth1.50 has host-inbound system service ping.
What am I missing? Thanks in advance!
Comment: Please add the (sanitized) configuration to your question, as text using the editor's `{}` option. We cannot just guess what you did wrong.
Answer: A reth interface on the SRX is a Layer 3 interface - that is to say that VLAN tags are only added to traffic from a reth interface as it egresses the physical port(s) you have bound it to - it does not interact with VLANs configured on the SRX in any way.
If you are just trying to provide a gateway to your workstation, create an irb interface, bind it to your VLAN and add it to the required security-zone eg:
set interfaces irb unit 50 family inet address 192.168.50.1/24
set vlans v50 vlan-id 50
set vlans v50 l3-interface irb.50
set security zones security-zone WORKSTATIONS interfaces irb.50

(though I would advise using a VLAN tag other than 50 since it is being used elsewhere on your network).
Alternatively, connect the workstation to a switch downstream from the SRX that the reth is connected to in VLAN 50 and it will be able to route via the reth1.50 interface.


How to use a proxy on the command line?

Question: I can set my proxy username and password along with proxy settings in the proxy ui but these settings do not work on the command line. How can I use apps such as wget & ping on the command line with a proxy?
Example Details:

username: 1234
pass: linux
proxy: proxy
port: 8080
Answer: The general scheme for the proxy URL is user:password@host:port
You can set the environment variable http_proxy, https_proxy, ftp_proxy, socks_proxy or all_proxy
In a bash shell, type this:
export http_proxy="http://user:password@host:port"

To persist this configuration, you can add it to /etc/environment or /etc/bash.bashrc, /etc/profile or to an individual user /home/user/.bashrc
Comment: It seems like a bad idea to add plaintext passwords into the command prompt, is this really the ideal solution?
Comment: When I try to wget something it connects to the proxy server but then gets a 407 a says I need authentication
Comment: wget should work using only the environment variable "http_proxy", but you can take a look at the link that @nitstorm posted. It says you can add proxy information to ~/.wgetrc
Comment: If you did add that line to any of those files, you can unset your proxy by removing the same from them.
Answer: To set Network proxy settings one can use gsettings
gsettings changes the configuation files at DConf, which is the core settings for Ubuntu network proxy settings that you see in GUI by going to Network > Network Proxy
Here is an example to set http, https and ftp proxy:
gsettings set org.gnome.system.proxy.http host ''
gsettings set org.gnome.system.proxy.http port 0
gsettings set org.gnome.system.proxy.https host ''
gsettings set org.gnome.system.proxy.https port 0
gsettings set org.gnome.system.proxy.ftp host ''
gsettings set org.gnome.system.proxy.ftp port 0

#Setting the Dynamic socks proxy
gsettings set org.gnome.system.proxy.socks host 'localhost'
gsettings set org.gnome.system.proxy.socks port 1111

#Setting Mode
gsettings set org.gnome.system.proxy mode 'manual'

Answer: You can't use proxies in the traditional sense with Ping. Ping works using the ICMP protocol.
HTTP proxies will only work with HTTP traffic. You can proxy most traffic in most programs using a SOCKSify-wrapper. The "dante-client" package provides a socksify. I used this one on other occasions: https://github.com/gr0gmint/transucks

How to use a proxy on the command line?


Why is adb backup with system apps unsafe? (Holo backup)

Question: In holo backup, adb backup with system apps is said to be unsafe. I was and am not sure why it is. But I tried it anyway, and slept then when I woke up in the morning, my computer crashed. So I am wondering what is going on. (I tried other "safe" adb backup methods, and they did not crash my computer :) )
Answer: I doubt two things here: first, the crash of your computer is unlikely to be meant by that statement (I won't say it was completely unrelated, but at least rather a co-incidence). Second, the backup is unlikely to be unsafe – it's rather the restore to be concerned about.
Searching the web, you can find plenty of reports where a restore "broke the device", and left the user with crashing apps, not being able to read/write SMS, and things like that. Such happens especially when that backup was restored to a different ROM, or even just with some OTA in between. Structures might have changed, database layouts looking different (some columns dropped, others added), so "stuff" is no longer compatible with the backup. A restore would simply place the old files back, and thus might change parts of the system which now consist of more files/apps.
All those problems are rather unlikely to affect "self-contained user apps", but quite often happen with system apps. I hope this little excurse sheds some light.


How to support all REST operations for an endpoint in django rest framework

Question: I have a subscription model that looks like this
class Subscription(models.Model):
    name = models.CharField(max_length=100)
    quantity = models.IntegerField(max_length=20)
    stripe_id = models.CharField(max_length=100)
    user = models.ForeignKey(User)

I would like to create an endpoint that allows POST, PATCH, DELETE, GET
So I did the following things
views.py
class SubscriptionDetail(viewsets.ModelViewSet):
    serializer_class = SubscriptionSerializer
    permission_classes = (IsAuthenticated,)
    queryset = Subscription.objects.all()

serializers.py
class SubscriptionSerializer(serializers.ModelSerializer):
    class Meta:
        model = Subscription
        fields = ('name','quantity', 'stripe_id')

    def update(self, instance, validated_data):
        print "In update"

    #how do I write create and delete?

urls.py
 subscription = SubscriptionDetail.as_view({
     'patch': 'update'
 })
url(r'^rest-auth/subscription/$', subscription, name='something'),

Questions

Using the above when I send a PATCH request, I get an error. How can I fix this?

Expected view SubscriptionDetail to be called with a URL keyword
  argument named "pk". Fix your URL conf, or set the .lookup_field
  attribute on the view correctly.

While sending the patch request I would also like to send an 'email' field which is not on the subscription model. Is this possible to do? I need the email field in the POST (create) operation so that I know which user the subscription belongs to.
Comment: What is `subscription` in your urls.py?
Comment: I've updated to reflect that. I'm new to DRF and simply want to have all four REST opetrations (CRUD) on the subscription model. And also, I can't find in the documentation how to send an extra field to the endpoint (extra field being the one that does not exist on the model - `email` in my case)
Answer: The easiest way is to do it this way.
keep the models class the same
views.py
from rest_framework import viewsets
#impost serializer and model class for subscription

class SubscriptionViewSet(viewsets.ModelViewSet):

    serializer_class = SubscriptionSerializer

    def get_queryset(self):
        queryset = Subscription.objects.all()
        #if you need to get subscription by name
        name = self.request.QUERY_PARAMS.get('name', None)
        if name is not None:
            queryset = queryset.filter(name=name)

        return queryset

serializers.py
 class SubscriptionSerializer(serializers.ModelSerializer):
     class Meta:
         model = Subscription
         fields = ('name','quantity', 'stripe_id')

 # django will handle get, delete,patch, update for you ....
 # for customization you can use def update or def create ... to do whatever you need
 # def create(self, validated_data):
 # you can handle the email here
 # and something like subscription=        Subscription (name=validated_data['name'],vendor=validated_data['quantity']...)
 # subscription.save()
 # it will save whatever you want

urls.py
#use the router to handle everything for you
from django.conf.urls import patterns, include, url
from rest_framework import routers
#import your classes

router = routers.DefaultRouter()
router.register(r'subscription', views.SubscriptionViewSet,base_name='subscription')

urlpatterns = patterns('',
url(r'^', include(router.urls)),

)

Answer: For the creation of an Object you must implement the create function as described in the official documentation, found here. For patching you could use the partial argument from within you view class:
SubscriptionSerializer(subscription, data={'something': u'another', partial=True)

For deletion of the a Subscription, that could be done when you get the delete call as so in your view class:
if request.METHOD == 'DELETE':
       subscription = Subscription.objects.get(pk=pk)
       subscription.delete()

See this tutorial for complete example
Further more I think that you should include the "id" field in the SubscriptionSerialiser Meta class, otherwise it will be difficult to do the updates/deletions. I hope this helped a little.
Cheers,
Tobbe
Answer:
Using the above when I send a PATCH request, I get an error. How can I fix this?

Expected view SubscriptionDetail to be called with a URL keyword
  argument named "pk". Fix your URL conf, or set the .lookup_field
  attribute on the view correctly.

The error is caused because unlike create request, patch/update require a pk to know which object to update. That is why you have to supply the pk value for it. So, your url for PUT, DELETE andPATCH must have at least named parameter like this -
subscription = SubscriptionDetail.as_view({
     'patch': 'update'
 })
url(r'^rest-auth/subscription/(?<pk>(\d+))$', subscription, name='something'),

an example url will be - rest-auth/subscription/10 where 10 is the pk or id of the object. Django Rest Framework will then load the object internally to be updated.

While sending the patch request I would also like to send an 'email' field which is not on the subscription model. Is this possible to do? I need the email field in the POST (create) operation so that I know which user the subscription belongs to.

To add custom parameters, first declare the property in serializer, it is better to keep it required=False, so that other request does not throw error -
class SubscriptionSerializer(serializers.ModelSerializer):
    custom_field = serialiers.BooleanField(required=False)

    class Meta:
        model = Subscription
        fields = ('name','quantity', 'stripe_id')

    def update(self, instance, validated_data):
        print "In update"

so far this is enough for the django rest framework to accept the field custom_field and you will find the value in update method. To get the value pop it from the attributes supplied by the framework like this -
    def update(self, instance, validated_data):
        custom_field = validated_data.pop('custom_field', None)
        if custom_field is not None:
            # do whatever you like with the field
        return super().update(instance, validated_data)
        # for python < 3.0 super(SubscriptionSerializer, self).update(instance, validated_data)

Answer:
When you want to use a method that allow make these operations you have to use a @detail_route() where you can say as well which methods will you use, like in the docs is said:
@detail_route(methods=['post'])
def set_password(self, request, pk=None):
    user = self.get_object()
    serializer = PasswordSerializer(data=request.data)
        ...

So to be able to use them you should add the next decorator
@detail_route(methods=['post', 'patch'])

To add another parameters you can do it for the .save() parameter. You just have to indicate the name of this and them just override your .save() model to check if that email belongs or not to the user that is trying to do the subscription. Here I paste you what the Django Rest docs says:

" Passing additional attributes to .save()
...
You can do so by including additional keyword arguments when calling .save(). For example:
serializer.save(owner=request.user)
Here I leave you the link for more information:
http://www.django-rest-framework.org/api-guide/serializers/#passing-additional-attributes-to-save
Answer:
When you overrided (I don't know if that's the proper conjugation of overriding a method) the update method, you stopped the ability to PUT or PATCH and object. Your new method only prints out "In update" but doesn't save the instance. Look at the update method from the serializer.ModelSerializer object:
def update(self, instance, validated_data):
    raise_errors_on_nested_writes('update', self, validated_data)

    for attr, value in validated_data.items():
        setattr(instance, attr, value)
    instance.save()
    return instance

Notice the last few lines where the instance is saved with the values and then returned. Remove your update method on the SubscriptionSerializer object. This let's your parent object's create, update, retrieve, and delete methods do their magic which supports PATCH and PUT updates. The next problem is that your urls.py is using the Django rather than the REST framework router. Change it to this:
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'subscription', SubscriptionDetail)

That should solve the patch update problem.

I don't think you can add an email field in your patch method without the attribute on the subscription model. That's just a guess on my part, and I may be wrong. Does the email field map to anything on any object? Can you use a ForeignKey to map it?

I hope that works for you, good luck!
Answer: In view.py you just need set the class with:
class SubscriptionDetail(mixins.CreateModelMixin,
        mixins.ListModelMixin,
        mixins.RetrieveModelMixin,
        mixins.UpdateModelMixin,
        generics.GenericAPIView):

and add this to fix .lookup_field :
    def update(self, request, *args, **kwargs):
        log.error("OBJ update kwargs= %s , data = %s" % (kwargs,  str(request.data)))
        pk = request.data.get('id')
        if (kwargs.get('pk') is not None):
            kwargs['pk'] = request.data.get('id')
        self.kwargs['pk'] = request.data.get('id')
        return super().update(request, *args, **kwargs)

and add support to methods do you want :
    def post(self, request, *args, **kwargs):
        return self.create(request, *args, **kwargs)

    def get(self, request, *args, **kwargs):
        return self.list(request, *args, **kwargs)

#    def get(self, request, *args, **kwargs):
#        return self.retrieve(request, *args, **kwargs)

    def put(self, request, *args, **kwargs):
        return self.update(request, *args, **kwargs)

#    def patch(self, request, *args, **kwargs):
#        return self.partial_update(request, *args, **kwargs)
#
#    def delete(self, request, *args, **kwargs):
#        return self.destroy(request, *args, **kwargs)

only tweak that remains is get for list or get for retrieve on element but should be easy now add something if we have one pk we may call self.retrieve else we may call self.list


What is the best solution to replace NaN values?

Question: I'm thinking about using the normal distribution of a specific column that has missing values and replace them by random values generated using the normal distribution function of numpy on that specific column ? Replacing by zeros or the mode doesn't really make sense sometimes... When is it relevant to do so ?
Comment: Are the NaN random or is there some censoring in the data, so that NaN follow a certain pattern?
Comment: What is your goal after that ?
Answer: You are right in saying that replacing with a simple mean, mode... is a common but unreliable imputation strategy in many cases.
You have in scikit learn some utilities for imputation of missing values (have a look at https://scikit-learn.org/stable/modules/classes.html#module-sklearn.impute) using for instance the knn imputer as an additional strategy.
Take into account you cannot assume your feature of interest follows a normal distribution, so instead you can actually apply a kernel density estimator to model such distribution, see here: http://scikit-learn.org/stable/modules/density.html
Answer: There is no one size fits all. So you cannot assume that one technique will work the best for all the datasets.
That being said the goal of imputing missing values is to ensure that after imputation, the distribution of the column does not change. So if you have a feature that follows a left skewed distribution, then after imputation the distribution should not change much.
Following this logic use multiple imputation techniques to see which one retains the original distribution of the feature you are imputing the values for.


How do I "uneject" an iPad from iTunes?

Question: I have an iPad and I want to sync it via wifi. That works fine. Sometimes I mistakenly eject the iPad from iTunes and then it does not synchronize anymore ("searching for my MacBook"). Can I instruct iTunes to search for my iPad again? To undo the eject? I use the newest OS on my MacBook and iPad.
Answer: I just tested with my iPhone, and I can get it to reappear in the Devices list simply by quitting iTunes and reopening it (waking up your iPad may help iTunes find it faster). If that doesn't work, simply plug it in via USB and it should stay in.
Comment: After I have rebooted my MacBook, it worked as you described. Before that, I have tried it several times and even with plugging it in and out, the iPad disappeared again. iTunes is a monster, right? :)
Comment: Strange that you needed a reboot, but glad you got it working.
Answer: You can initiate a sync directly from the iPad, the device will then appear in iTunes again as well.

How do I "uneject" an iPad from iTunes?


Magento 2.3 - Add a new column after one column into the table using db schema

Question: I need to add a new column after one of the particular columns in the existing table using DB schema & checked this dev doc link, they didn't mention about the before or after column.
Is there any way to do this?
Comment: please check this link https://magento.stackexchange.com/questions/251884/magento-2-3-how-to-implement-declarative-schema-in-custom-module
Comment: https://magento.stackexchange.com/questions/266635/magento-2-3-how-to-add-custom-column-to-customer-entity-table
Comment: @HiteshBalpande I wish to add a new column, before or after the existing column in a table.
i.e. Let's say we have column_a, column_b, column_d in a table.
Now I would like to add a new column (column_c) which should come after column_b.
Comment: @MohamedAsar, I am also looking for the same solution. I think this should be there in DB Schema. Unfortunately, I can't see it at anywhere. Hoping for some resolution in future.
Comment: I'm also looking for a solution for this but it seems this wasn't implemented yet by the Core team https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/db-schema.html
Comment: Tried putting the "after" attribute in the column and I'm getting the error:
`Element 'column', attribute 'after': The attribute 'after' is not allowed.
Line: 10

Verify the XML and try again.`
Answer: This is an old question but for the sake of others who find this looking for an answer - Do not do this unless you run on Mysql 8.0.29 or after, or another RDS which supports instant add (I'd generally just suggest not doing it at all, column order is often irrelevant). Be careful of things like Postgrel 10 vs 11 where in v10 if you use default NULL it isnt supported, but in v11 it is.
This is why Magento does not supply this functionality because it can have a severe impact on the next run of setup:upgrade or setup:db-schema:upgrade for versions of Mysql that come before this, or others RDS's that do not support ALGORITHM=instant for column adds or column adds with specific boundaries (such as using before/after, default null, etc).
In older version of MYSQL altering tables required locking the table and then implementing the change - the more rows you have the longer this process takes. I mostly see this implemented on the order grid to disastrous effect as they can often have 10s of millions of rows leading to a very long downtime, or if you use blue/green configuration it can lead to hampered site performance or loss of specific functionality for minutes to hours. (As a side note, dont add to core tables, use extension or map tables if necessary)
However if you wish to do this, which I suggest not as its mostly for vanity,  but if you still wish to go ahead then you can create it manually or use an UpgradeSchema with something like the below
<code><?php
declare(strict_types = 1);

namespace Vendor\Module\Setup;

use Magento\Framework\DB\Ddl\Table;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\UpgradeSchemaInterface;

class UpgradeSchema implements UpgradeSchemaInterface {

    public function upgrade(
        SchemaSetupInterface $setup,
        ModuleContextInterface $context
    ) {
        // Switch this for a version check and/or if columns exists check
        if (version_compare($context–>getVersion(), '1.0.1') < 0) {
            $connection = $setup–>getConnection();
            $connection–>addColumn(
                $setup–>getTable($targetTableName),
                $yourNewColumnName,
                    [
                        'type' => Table::TYPE_TEXT,
                        'nullable' => true,
                        'length' => 255,
                        'default' => '',
                        'comment' => $yourNewColumnDescription
                        'after'   => $yourTargetColumn
                    ]
            );
        }
    }
}
</code>
I highly suggest sticking to db-schema.xml to avoid the need for a migration set after this.


Cygwin has no watch command?

Question: I installed Cygwin on my Windows XP to use some of its commands. Now I what to check a file every 2 minutes and want to use watch for this purpose but I see that Cygwin has no such command. Is this really true? what can I do instead?
Comment: You can find out which Cygwin packages provide which files and programs at http://cygwin.com/packages/
Answer: There is watch in cygwin. But it isn't installed by default. You need to install procps-ng package to appear watch. (you can run cygwin installer again and it allows to install only the missed packages without reinstalling the whole cygwin)
Instead of watch you can use simple cycle like:
while true ; do check file ; sleep 2 ; done

where check is your command of choice.
Comment: Is 'check' a command, or are you including it as a placeholder? I literally pasted this and I just got a sequence of `-bash: check: command not found`. The cygwin installer doesn't seem to know anything about it ...
Comment: @robert, it is a placeholder.
Answer: watch is included in procps-ng, so you should install the procps-ng package for Cygwin.
Answer: Apparently procps is outdated, watch can now be found in the procps-ng package.
Answer: Installed the ncurses package and then I get a clear screen on every run.  Thank you rush.
I ran mine as
while true ; do clear; <command> <file> ; sleep 2 ; done

such as
while true ; do clear; grep ERROR server.log | tail -n 5 ; done

Cygwin has no watch command?


Limit cropping on one side?

Question: I have a workflow that uses one of several tools that crop a generated pdf (either the standalone class with crop=true, or the pdfcrop or dvipng tools). In some cases I want to limit the cropping on one side. Currently, I'm achieving this by doing an \hspace then writing a period. That works, but I want to know if there are more elegant solutions. I just verified that (at least with the dvipng method) writing my period in white also works (\usepackage{xcolor}...\hspace{...}\textcolor{white}.). I also verified that using \hphantom and so on does not work: the extra space generated thereby will be cropped. Any other ideas about how to achieve this---if possible, without loading the xcolor package?
Answer: Use pdfcrop only
You can do this with pdfcrop with no need for the \hspace and period.  For example...
pdfcrop --margins 10 0 0 0 in.pdf out.pdf

will leave a margin of 10 basic points on the left side of your pdf.  The order of the --margins values are left, top, right, and bottom.
You can also add a white border to an already cropped pdf.
pdfcrop --margins 10 in.pdf out.pdf

You can even use a negative margin value to "overcrop", or crop more than the white border.  This is especially useful if you need to crop away a box that surrounds your content.
Comment: Thanks, yes this could be an option. In my use-case, though, I have a number of documents where the ink takes up varying space. I want them all to have a constant width. To use the `--margin` flag on pdfcrop, I'd have to determine a different margin width for each. So not ideal for me. But for other workflows, this might be a good option.
Comment: @dubiousjim: I see.  Is it possible for you to simply use the geometry package to create your original PDF already having the correct width?

Limit cropping on one side?


Bugzilla gives Internal Server Error after Ubuntu and Perl upgrade

Question: I've just upgraded a server running a Bugzilla installation from Ubuntu 14.04 to 16.04 (this also comes with a Perl 5.18 to 5.22 upgrade).  Bugzilla is configured as a virtual host in Apache.  After the upgrade, accessing Bugzilla returns an "Internal Server Error"

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
  Apache/2.4.18 (Ubuntu) Server at Bugzilla-URL Port 80

The Apache error log /var/log/apache2/error.log has only one line related to this error:
[Tue Apr 30 08:34:21.227311 2019] [cgid:error] [pid 90210:tid 86753098675309] [client url:port] End of script output before headers: index.cgi

I haven't been able to find out a whole lot about this error.  It seems to refer to the file /var/www/bugzilla/index.cgi, which does exist on the system:
$ sudo ls -Alh /var/www/bugzilla/index.cgi
-rwxr-x--- 1 root www-data 2.2K May 12  2016 /var/www/bugzilla/index.cgi

One person in this post had that error line thrown by Gitweb after the same upgrade to Ubuntu 16.04.  In this case, the Perl upgrade 5.18 -> 5.22 removed the perl module CGI.pm, which is provided by the package libcgi-pm-perl; installing libcgi-pm-perl fixed it.  I did not get any error message about a missing module, however, and libcgi-pm-perl is already installed on my system (v4.26-1 from Ubuntu main).
Another answer on this StackOverflow question points out Bugzilla's checksetup.pl utility, which sounds useful.  When I attempt to run it, however, I get a segfault:
# perl /var/www/bugzilla/checksetup.pl
Segmentation fault (core dumped)

So, how do I diagnose the problem at this point?
Please note that I'm more interested in determining what's wrong than I am in making Bugzilla work.  I welcome and appreciate any thoughts on troubleshooting, but if you want to suggest a solution, I'm not going to try it unless you can also tell me what you think is wrong and why what you suggest will help.
Thank you in advance!
Answer: The solution that worked for me on openSUSE Leap 15.1 can be found at Bugzilla checksetup.pl stops with segmentation fault:

Rename the lib folder in the Bugzilla directory
Run ./install-modules –all
Run ./checksetup.pl again

Note that in step 2, I had to run ./install-module.pl -all


How to crack windowed crackmes?

Question: I am starting with reverse engineering/cracking with advanced knowledge about programming and functioning of the operating system and I saw a whole series of lena151 Lenas Reversing for Newbies but I have a problem I do not know how I should properly begin cracking windowed crackmes without using call stack and finding text strings. For example I have ollydbg and Pulsar Crackme (Level 0) (https://uloz.to/!CsZzoI6kT9zF/crackme-exe) I have already cracked, and several other, (key is  PuL-sAr-001) but I crack him only because I accidentally found badboy/goodboy but it can not crack it using another method (in more complicated crackmes it is big problem). Is there any tutorial where this is explained ? And what method you use which may also be used in the analysis viruses ?
Comment: Why don't you want to use text strings? You should use whatever you have at your disposal. Use IDA Pro and disassemble the code as well. If you can't because it's packed, use PEiD or another packer identifier, then unpack the program first...
Answer: There are many ways to go about changing the behavior of programs. For example, if you have a program that checks for the date and time in order to decide if the product is expired, you could: a. change the system date and time to temporarily "crack" the program or b. patch the system call that checks for the date and time to return an acceptable value.
You could also patch the kernel (which is probably unsuitable for a check like this, as it will affect the whole system) or simply find the check in the executable and change the code to jump it , or just remove it...
What you're doing is trying to reverse engineer an application and change it to do what you want. This requires knowledge in general and specific areas, dependening on what kind of program you're trying to reverse engineer.
Here's a few a practical leads on how you could achieve what you're trying to do:

Use a tool like Regshot to compare changes in the registry
Use a tool like Program monitor from SystemInternals to find out what the program is doing
Place breakpoints on all suspect system calls
With complex applications, once you find a starting point you may need to reverse engineer the assembly code to understand what it's doing
You can use Radare2/ IDA to statically analyze (or actively debug) the program and rename methods until you reach an understanding of what must be done to achieve your goal.

If you're interested in learning how to reverse engineer applications there are many books on this subject that you can look for and read.
Here's a list of (some of the) things you'd need to know:

Understand the OS you're working in
Knowledge of (several) programming languages
Understand the PE/ELF file formats (or any other format you'd want to reverse engineer)
Understanding Assembly language

Needless to say, reverse engineering may be illegal in your location, or on specific products (see EULA), so make sure that you're not doing anything that you are not allowed to do.
Hope this helps
Comment: I'm not sure I understand how this answer specifically addresses the OP's question about windows programs.
Comment: the part about practical leads is where I wrote a few specific examples on how one could try to achieve what the OP was asking. The truth is that it's not that simple, you need to reverse engineer the software to be able to do what he wants to do. When you're solving a simple crackme you can often avoid a lot of the necessary things you may need to understand in order to find the "crack". When you're working on something complicated you have to understand the software using static analysis, strings, debugging and reading the assembly, system-call hooking, registry etc...

How to crack windowed crackmes?


Rimerunner discussion

Question: https://speculativeevolution.fandom.com/wiki/Rimerunner One of the weirdest creatures of Darwin IV in the book Expedition is the Rimerunner.

This rare resident of the tundra regions hops along on one leg and occasionally swallows and spits out that orange object in front of it, connected by an uncomfortably thin bit of nerve tissue. The closest the book gives for an explanation is it's a sort of sensory organs. Atrophying or evolving I don't know. Maybe it's a way to smell and collect aerial plankton. Do you have any thoughts on it?  Maybe what else that one organ could be about?
Comment: VTC:NAW. Asking about [third party or commercial worlds is off-topic](https://worldbuilding.meta.stackexchange.com/a/7336/40609). We'll help you build a fictional world of your own creation, but asking about other people's worlds is better suited to [scifi.se].
Comment: Come on! How do you know I wasn't asking so I could make my own legally safe copy of this creature?
Comment: That isn't the question you posted. VTC'd.
Comment: @JoeSmith I ran a micropublisher for 10 years. There isn't a way to make a "legally safe copy" of a copyright-protected creature - and you didn't ask that, anyway. We understand that there will always be questions like, "given the rules of my world as described, how can I have Star Wars-style light sabers?", which is on-topic. But you didn't ask that, either (note the first part... "given the rules of my world as described..."). You specifically asked what a 3rd party, commercial world's rule could be. That is off-topic.
Answer: Osmeterium

The osmeterium is a defensive organ found in all papilionid larvae, in
all stages.1 The organ is situated in the prothoracic segment and
can be everted when the larva feels threatened. The everted organ
resembles a fleshy forked tongue (not unlike a snake tongue), and this
along with the large eye-like spots on the body might be used to
startle birds and small reptiles. The osmeterial organ remains inside
the body in the thoracic region in an inverted position and is everted
when the larva is disturbed in any way emitting a foul, disagreeable
odor which serves to repel ants,[2] small spiders[3] and mantids.[4]
To humans, this odour is rather strong but pleasant, usually smelling
like a concentrated scent of the caterpillar's food plant and
pineapple.

The osmeterium is usually orange.  It is "swallowed" and then "spit out" by the larva.  It is meant to be showy and also smell bad.  Maybe the Rimerunner is dissuading predators or parasites with that thing?
Comment: Interesting, but not sure it works. There was no mention of a predator being near when the organ was seen. And why such a thin attachment?
But, constructive criticism: if your idea was right, how could this be confirmed?

Rimerunner discussion


LocalStorage with PhoneGap

Question: I am initializing my localStorage with body onload="init()" so it sets the value to localStorage. My problem is that the value is not returned to and represented inside a div i wish to.
I have debugged it and made sure it works.
So I am wondering what kind of lifecycle does PhoneGap follow? ie. when is the html loaded again? Every time user returns to the app or every time the app is actually not running on a device?
Answer: You should use PhoneGap's onDeviceReady event for initializing your code. See the documentation here.

LocalStorage with PhoneGap


What is the story of Amruth Manthan?

Question: I heard Amruth Manthan today. I do not know what it means. Can anyone explain me the story of Amruth Manthan?
Answer: Samudra Manhan :

Mrut  = Dead
Amrut ( Amrit ) = A liquid which can give immortality to anyone (Elixir of life).
Manthan = to churn

Once Devtas & Asuras came togather to get Amrut by doing Samudra Manthan ( Churning of The Ocean ). They come down to ocean of milk and took the mountain Mandara as a churning-pole and the hundred-headed serpent Vāsuki as a churning-rope. They tied the serpent around the mountain, and started churning the ocean.
They churned the Ocean of milk for thousand years and many things came out from the ocean. The Lord Dhanvantary ( the heavenly physician ) appeared with pot containing Amrut inside it. Vishnu took the Mohini avatar and distracted the Asuras from drinking the Amrut.
Then lord Vishnu distributed the Amrut among devtas but one of the Asura that is RahuKetu took the avatar of a devta. Later on when Vishnu came to know about this, he threw his divine weapon Sudarshana, which cuts off RahuKetu's head, but the nectar had reached upto his throat so he did not died.
Hence, his head and body were then separated, and later on they became planets, i.e Rahu and Ketu.
Reference

What is the story of Amruth Manthan?


How to change Google Chrome UI Size on Ubuntu 19.04

Question: How do I do that? I tried to follow the instructions for previous versions of Ubuntu but can't manage it.
Answer: If you do not have gnome-tweaks installed, please install it using sudo apt install gnome-tweaks. Then launch it by typing tweaks in the dash or gnome-tweaks in the window brought up with Alt+F2.
In there, click on Fonts in the pane on the left and choose the font size you want in your UI in the Interface Text section. (Keep in mind this will affect all applications, not just google-chrome.)
gnome-tweaks GUI

This is what google-chrome looks like with Ubuntu Regular 11
Ubuntu Regular 11

And this is with a larger font size:
Ubuntu Regular 16

The limitation is that the font size in the address bar aka omnibar is unchanged. This is a long-standing WontFix issue.
Other SE links on the small size of fonts in the omnibar:

Text size in Chrome's omnibar is too small
https://stackoverflow.com/questions/18343740/how-to-change-font-size-of-address-bar-in-chrome-programmatically


Please identify cause of dead spots on my Malabar spinach

Question: I noticed there are small spots on the plant, but they keep getting bigger and eventually turned brown, like dead spots on the leaf. How do I get rid of these? I've already cut all the affected leaves but they keep coming back on the new leaves.
Answer: It seems that the problem is caused by a fungal infestation, and the rainy weather, which keeps the leaves moist, worsened the problem.


Storing a shared key for Rails application

Question: One of my Rails applications is going to depend on a secret key in memory, so all of its functions will only be available once administrator goes to a certain page and uploads the valid key.
The problem is that this key needs to be stored securely, so no other processes on the same machine should be able to access it (so memcached and filesystem are not suitable). One good idea would be just to store it in some configuration variable in the application, but newly spawned instances won't have access to that variable. Any thoughts how to implement this on RubyEE/Apache/mod_passenger?
Answer: there is really no way to accomplish that goal. (this is the same problem all DRM systems have)
You can't keep things secret from the operating system.  Your application has to have the key somewhere in memory and the operating system kernel can read any memory location it wants to.
You need to be able to trust the operating system, which means that you then can also trust the operating system to properly enforce file access permissions. This in turn means that can store the key in a file that only the rails-user-process can read.
Think of it this way: even if you had no key at all, what is to stop an attacker on the server from simply changing the application code itself to gain access to the disabled functionality?
Comment: The fact that kernel can access the key is fine for me, I just don't want it to be accessible to other users' processes. If there was a shared memory area accessible to all of Rails instances, I would keep it there. But it seems to me that every instance only accesses its own copy of data.
Answer: I would use the filesystem, with read access only to the file owner, and ensure the ruby process is the only process owned by this user. (using chmod 400 file)
You can get more complex than that, but it all boils down to using the unix users and permissions.
Answer: Encrypt it heavily in the filesystem?
Answer: What about treating it like a regular password, and using a salted hash? Once the user authenticates, he has access to the functions of the website.
Comment: This key should be available during the whole application lifetime, as it will be used to encrypt/decrypt information.


Switch callout text boxes on and off?

Question: In my ArcMap project I've added text to the map in callout boxes to identify certain districts. Is it possible switch these on and off like the data layers? I don't want them to show in everything I export.
Comment: if an answer is helpful to you, please mark it as answered.  This goes for all of the questions you've asked over the last few days.  It will help you get better answers if people see you are making the best answers as such.  More info here: http://gis.stackexchange.com/tour
Answer: If you have added the labels inside of your data frame, you can turn them on and off.  Here are a few ways to know if your labels are inside or outside of your data frame.

If you are in Data View and you can see the labels, they are inside of your data frame.
If you are in Layout View, first notice if you are working inside or outside of your data frame.  If the edge of the data frame is hatched, you are working inside of it.  It is is a solid line, you are working outside (ie. on top) of it. (Double click to go inside the data frame).
You will only be able to select your labels when you are working in the same "space" that they are (either inside or outside of the data frame).  So if you can select, move, and edit your labels when you are working inside the data frame, your labels are also inside the data frame, and vice versa (if you can only select, move, and edit your labels when you are outside of the data frame, then they are also outside of the data frame.)

If your labels are inside of your Data Frame, you can turn them on and off using the following method.  Go to the Data Frame Properties window, and then to the Annotation Groups tab.  Uncheck the box by the annotation group you'd like to turn off (most likely the "Default" group name if you added the labels manually as text boxes.  If you add them by converting a layer's labels to annotation, then they will be listed in there as separate layers.

If the labels are outside of your data frame, you cannot use this method to turn them on and off and you will have a few options.

Move your labels inside of your data frame.  To do this, select them all and right-click to Cut them.  Now double click inside your data frame to go inside the data frame and Paste them.  If you are lucky, they will all come in in the right place.  Otherwise, you'll need to manually move them to the correct locations.
The other method to turn them on and off for different maps is less elegant if you're doing it many times.  Basically just select all of the labels and move them off of your map to "turn them off" (just moving them off the map display).  To "turn them back on" select them all and move them back on top of your map.  I'd recommend the 1st method unless the cutting and pasting does not work right.

The next time to add labels to a map, you can alleviate some of this if you Label your map based on attributes in the shapefile and then convert that text to annotation.  There is more detail on that at the following link:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s80000001r000000.htm
If you want to add labels that aren't attributes of your data (so you can't use labeling), you can still add labels to an annotation group.  See this article (the part about Active Annotation Targets):
http://resources.arcgis.com/en/help/main/10.1/index.html#//00s800000008000000
Comment: Sorry, I'm a bit of a novice so I apologize if I'm asking stupid questions! How do I convert the callout text boxes to annotation? How do I put the callout boxes inside the data frame?
Comment: No problem - this is something I found really confusing when I started with ArcMap!  I'll edit my answer to add some information on this.
Comment: @MikeFallopian If this answered your question, please click the green check near the voting arrows to mark it as "answered."  More info here: http://gis.stackexchange.com/tour

Switch callout text boxes on and off?


Double baking / endorsing

Question: For research work, I need to do double baking on mainnet, what is the possibility to do this, I ran two copies of the baker on two servers, but it didn't work due to the fitness too low error
Answer: I think you'd need to disconnect the second node from the network just before the second baker injects its block. In this way the block of the first node does not reach the second node. The two nodes will have (possibly) different blocks at the same level and round (to make sure they are different, you may also try to inject a transaction in the second node). After the baker injects, then you reconnect the second node.
I'm not completely sure this is sufficient.
Comment: what do you think if I run two bakers with different --minimal-fees and make a transaction before the block that I have to bake so that one baker accepts the transaction from the commission, and the second one does not accept it, I will get different hashes and will there be a successful inject?
Comment: I guess this ensures that the block are different. But this alone does not solve your initial problem, that the baker cannot inject because it has already seen a block with the same fitness; see also here: https://tezos.gitlab.io/shell/validation.html#fitness. That's why I suggested also temporarily disconnecting the nodes.

Double baking / endorsing


Can a player move into my town from their 3ds?

Question: Or would they have to have their own town since it's a different acnl cartridge/download? My sister is getting her own 3ds and animal crossing game.
Answer: There is no multi-console multiplayer with one cartridge in AC:NL.
If she wants to visit your town, she'll need her own console and her own cartridge. That's the only way to play "co-op".
Answer: She will have her own town. Each cartridge will have one town's data saved to it so, unless she makes another villager on your cartridge to play when you are not, she will have to be mayor of her own village.
There will be a lot of advantages to this, though, as your sister can decorate her town as she wants and you will be able to have 10 different villagers each (there's a few hundred altogether so it will give you a chance to meet twice as many at once) so you will get more enjoyment out of the game. You will be able to visit the island together when one of you visits the other so you will be able to partake in the minigames together and if she has a different town fruit to you, you will be able to trade fruit and make more money that way. If you make money easier, you can help contribute to her public works to get her started and someday she will be able to contribute to yours.
If she is quite young and you want to help make the game easier for her then you can always dig/plant/water flowers in her town to help her out when you visit :)


DirectoryEntry Invoke method name required for getting Authorization Groups

Question: I am using the below method of DirectoryEntry
https://learn.microsoft.com/en-us/dotnet/api/system.directoryservices.directoryentry.invoke?view=netframework-4.7.2
I am trying to fetch the AuthorizationGroups using the invoke method.
I used the below method
          object obGroups = de.Invoke("Groups");
                            foreach (object ob in (IEnumerable)obGroups)
                            {
                                // name of group
                                obGpEntry.Name;
                            }

But this will not return all active directory groups. I need to get all Authorization Groups the user belongs to
Any idea which is the method name needs to be used for that
Answer: Using .Invoke("Groups") calls the Windows native IADSUser::Groups method. It only gets the direct membership (not nested groups) and does not give you the primary group. I'm not entirely sure where it's getting that information from, so I couldn't say for certain what it does and doesn't give you.
Are you trying to find the groups for the current user (the user currently logged in)? Because there are other ways to do it that let you read the groups from the authentication token. In both ASP.NET and a desktop app you can use UserPrincipal.GetAuthorizationGroup().
But otherwise, you could use the tokenGroups attribute, which gives you all nested security groups for the purposes of authorization:
de.RefreshCache(new [] {"tokenGroups"});
var groups = de.Properties["tokenGroups"];

However that gives you the SID of the groups, which may not be immediately helpful if you want the names.
There are a few ways to tackle getting all of a user's groups, which depends on how much information you're after and your environment. I wrote an article about this very thing with several sample methods: Active Directory: Finding all of a user's groups


Removing constraints in convex optimization

Question: Say I have a convex optimization problem of the form $$\min_x f(x) ~~ s.t.\\ g_1(x)\leq0,\\\vdots \\g_n(x)\leq 0$$ with all functions convex. Suppose that $x^*$ is a unique optimizer to my problem and that we have $g_i(x^*)=0$ for some index $i$ and that $g_j(x^*)<0$ for all other indices.  Then, it is well-understood that $x^*$ is also a solution to the problem $$\min_x f(x) ~~ s.t.\\ g_i(x)\leq0~.$$ in other words, the $(n-1)$ inactive constraints did not contribute anything to the problem.  My question is:  does anything change if, instead of having $n$ constraint functions, I have a continuum of functions?  That is, say that I now have the problem $$\min_x f(x) ~~ s.t.\\ g_t(x)\leq0 ~ \forall t\in[0,1] ~ $$ for some parameterized family of functions $g_t$, and I can again show that there is a unique minimizer $x^*$ where there is a single value of $t^*$ such that $g_{t^*}(x^*)=0$ and $g_{t}(x^*)<0$ otherwise.  Are there any extra precautions I need to take before claiming that it will suffice to consider the simpler problem $$\min_x f(x) ~~ s.t.\\ g_{t^*}(x)\leq0 ~ $$?  My gut tells me no, but strange things are known to happen at infinity.
Comment: Should "$g_t(x^*)=0$ otherwise" be "$g_t(x^*)<0$ for $t\neq t^*$"?
Answer: Part of the reason this works for a finite set of constraints, and in particular
the reason that the simplified problem still has a unique minimizer, is that
$x^*$ is an interior point of each of the regions $g_j(x) \lt 0,\; j \ne i$ and
therefore is an interior point of their intersection. This does not work if
there are infinitely many constraints, and you cannot rely on uniqueness.
For a simple example consider minimizing $x_2$ under the constraint
$x_1^2 - x_2 \le 0$. Clearly the unique minimizer is $(0, 0)$. We can however replace the single strictly convex constraint by an equivalent family of
linear constraints $g_t(x) = 2tx_1 - x_2 - t^2 \le 0,\; t \in \mathbb{R}$.
The only active constraint is then $g_0(x) \le 0$, but if we remove all the other constraints, the (over)simplified problem has every
$(x_1, 0),\; x_1 \in \mathbb{R}$ as a minimizer.
Answer: I think the claim is true under some additional assumption: Let $\bar x$ be another solution of
$$\min_x f(x) ~~ s.t.\\ g_{t^*}(x)\leq0 ~ $$
for which some constraints are not fulfilled, i.e. $g_{\bar t}(\bar x) >0$ for $\bar t\in T$ with some set $T$.
Let's try this additional assumption:

Now assume that $\sup_{t\in T} g_t(\bar x)$ is finite, i.e. the constraint violation is bounded.

But since the set of solutions of a convex problem is convex, you can take a convex combination
$x_\epsilon = \epsilon \bar x + (1-\epsilon) x^*$ which is also a solution of the "reduced problem". Now check, if $x_\epsilon$ fulfills all constraints of the original problem, i.e. $g_t(x_\epsilon)\leq 0$: By convexity of $g_t$ this follows if $\epsilon g_t(\bar x) + (1-\epsilon)g_t(x^*)\leq 0$ which is equivalent to $g_t(x^*) \leq -\tfrac{\epsilon}{1-\epsilon} g_t(\bar x)$.
Oh, but here one sees that the additional assumption still does not guarantee that $x_\epsilon$ fulfills the constraints for $\epsilon$ small enough but that one needs a stronger assumption on how fast $g_t(x^*)$ and $g_t(\bar x)$ depart from zero if $t\neq t^*$. You may be able to build and prove an additional assumption that can be helpful for your case by exploiting additional structure of $g_t$…
This feels related to the concept of a Slater point…
I think that there could be a counterexample without the additional assumption but I could not construct one yet.
Comment: I do not understand how $x_\epsilon$ can be proven to exist -- how can one construct an appropriately small $\epsilon$?
Comment: Well, ehm, actually I don't see it either… Adapted my answer which is only a "partial answer" now…


Does the word "simpleness" actually exist?

Question: I always thought the word "simpleness" didn't exist and this was even confirmed by some American friends of mine. However, I tried to look it up on some online dictionaries and I was surprised to find out that some of them report this word while others don't.
What's the story behind "simpleness"?
Comment: You don't want to use it instead of simplicity; that would sound uneducated or inarticulate.
Comment: http://oxforddictionaries.com/us/definition/american_english/simple?q=simpleness#simple__21
Comment: *Simpleness* is not quite the same thing as *simplicity*: Syn: *artlessness, greenness, guilelessness, ingenuousness, innocence, naiveness, naivety* (also *naïvety*) [chiefly British], *naturalness, simplemindedness, simpleness, simplicity, unsophistication, unworldliness, viridity* (http://www.merriam-webster.com/thesaurus/simpleness); freedom from difficulty or hardship or effort (http://www.thefreedictionary.com/Simpleness)
Comment: see "[Is 'quantitate' a synonym for 'quantify' or just a misnomer?](http://english.stackexchange.com/questions/114448/is-quantitate-a-synonym-for-quantify-or-just-a-misnomer)" for how to tell if something is a word.
Answer: Simpleness does not necessarily mean the same as simplicity.
For example, simple time in music is a time signature (basic rhythm) which is not compound time. Simple time has simpleness, not simplicity.
OED has a number of similar definitions:

simpleness noun

Absence of pride, ostentation, or pretentiousness; plain or unassuming disposition or manners.
Absence of duplicity or guile; innocence, integrity, guilelessness.
a. Deficiency in knowledge or learning, ignorance; also, lack of mental acuteness, intellectual weakness, foolishness.
a. Poor or lowly condition; also, lack of elegance or refinement; plainness of dress, etc.
Absence of complexity; freedom from complications; simple character.
Comment: You can find some good examples of how _simpleness_ is properly used in the [BYU copus](http://corpus.byu.edu/coca/). There are 10 hits. I would suspect that most careful users would either restrict it to its technical meanings, as in music, or its suggestion that a person described as having the trait of simpleness is essentially _simpleminded_ or _intellectually challenged_, to put it into PC-speak. [Google Ngrams](http://rdd.me/beofv00e) shows very few examples of _simpleness_: here are [some examples](http://rdd.me/r5geksxl).
Comment: @T.E.D. yeah indeed, especially when Italians try to translate something to english :-)
Comment: Thank you for your answer. By saying that "does not necessarily mean the same" it's not clear if it could still be used as a synonim of "simplicity". Can you clarify?
Comment: This is a simple sentence. It is a model of simplicity. All of the examples in my answer have *simpleness* as the "quality of being simple," not simplicity. *Simpleness* is more of a technical term, perhaps.
Comment: OTOH, probably 9 times out of 10 if you see "simpleness" the person meant "simplicity", but couldn't come up with that word for some reason (brain-fart, bad vocabulary, etc.).


Why does a stock split increase liquidity?

Question: I'm confused on how dividing the stock into two increases the trading volume.
Answer: There are several effects from a traditional stock split:
A stock split increases the number of  shares in circulation thereby increasing liquidity which facilitates more trading which in turn tends to narrow the bid-ask spread.
Higher liquidity may also attract traders which may increase volatility.
Reduced share price also attracts new investors who might have felt that the pre-split price was too high.
When combined, all of these factors increase trading volume.
Answer: Back when the lowest fees were when you bought in round lots of 100 shares, then the raw stock price was important or you would price certain investors out of the market.
Then the price break disappeared. Meanwhile  raw share prices went though the roof as the market boomed.
According the Wall Street Journal:Tiny 'Odd Lot' Trades Reach Record Share of U.S. Stock Market :

Throughout the 20th century, the average price of a U.S. stock hovered
around $35, with companies splitting their stocks if they grew much
higher. That meant a single round-lot trade of 100 shares used to cost
the buyer about $3,500.
By comparison, buying 100 shares of Amazon today costs more than
$170,000—a heavy lift even for a big investor. The online-shopping
company isn't alone in its stratospheric share price. In 2012, no
companies in the S&P 500 traded above $1,000 a share. Now there are
five: Amazon, Google parent Alphabet Inc., online-travel company
Booking Holdings Inc., car-parts retailer AutoZone Inc. and home
builder NVR Inc.

Now today many individual investors can buy a fraction of a share. I have seen advertisements that offer the ability to buy a slice as small as $5 of one of the FAANG companies.
This would mean that a major need for a split has gone away.
But it still drives positive news. We had a bunch of questions on this site asking about the mechanics of a split, and how best to take advantage of a split in the last few weeks because Tesla and Apple were splitting. Remember the P/E ratio doesn't change because of the split. Yet some people want to buy a stock because of the split news.
The desire to buy because of the news, means that even more shares trade hands.


Is this a schefflera plant?

Question: I thought maybe a schefflera but not sure. Waxy leaves and some look like they have serrated tips.
Answer: It's hard to know from the information provided. Some details say it could be, but there are other plants that might qualify as well. Consider this picture for example, that of a woody vine (Cissus hypoglauca) in Australia and there may well be others with palmate 5 leaflets.
Arguments no: normally by this size Brassaia actinophylla (Schefflera) has started producing palmate leaves with more than 5 leaflets. While 5 might be good on a very young plant the normal count is 7 or more, and most of the images of young leaves I have viewed don't have that purple coloration at the tip of the petiole and into the leaf veins.
Arguments yes: leaf shape is right, seem to be thick and glossy on long petioles and the very young leaves are not completely reddish. We could go into a discussion of sap differences but I don't want to go there since Schefflera sap contact is something you want to avoid. It's a diagnostic test that has a high potential cost.
So really you need to wait for a bit more to happen. Either it produces the kind of bark expected on Schefflera or it turns into a vine with tendrils or something else. You might add a few details to your question, such as the description/source of the seed, your rough location, closeup of any bark visible at this stage.
Comment: Agreed, what I was looking for in the picture, but could not see was some trunk material to help indicate. My immediate reaction is that it is not because the leaves are pretty big for a juvenile scheffalara

Is this a schefflera plant?


Multiple GPUs in AWS G2-8X LARGE I can only use 1 out of 4 GPUs

Question: Using cycles on AWS G2-8X large which has 4 GPUs however cannot get blender to use more than 1 GPU at a time even though I can get it to switch between GPUs any suggestions? I have the latest drivers and versions
Answer: I know this question is pretty old but posting this in case anyone is having similar issues.
The question is a bit vague. I'm assuming you're using python script to call and render something in blender. I'm also assuming that you're using the following lines in the python script for setting GPU as the render device:
bpy.context.scene.cycles.device = 'GPU'
bpy.context.user_preferences.system.compute_device_type = 'CUDA'
bpy.context.user_preferences.system.compute_device = 'CUDA_0'

where the CUDA_0 means to use the first graphics card, CUDA_1 for second graphics card and so on. To make use of all the graphics cards, all you have to do is to modify the third line to:
bpy.context.user_preferences.system.compute_device = 'CUDA_MULTI_0'

Unrelated: If you want to see what all options are available for this setting in your current system, use the following in the python script:
print (bpy.context.user_preferences.system.bl_rna.properties['compute_device'].enum_items.keys())

Please note that if you give only this line in the script, it will show only 'CPU'. Make sure you set the render device to GPU using the code sample I've shared, and then use this line.
Answer: I believe it depends on how you are sending the rendering to the farm. This must be done via a script IIRC. Renderbot may have a setting to accommodate this as well.
Dalai's post illustrates the issue:
https://www.dalaifelinto.com/?p=746


Does Marketing Cloud deduplicate subscribers before making an A/B split?

Question: I am configuring my first A/B split test with an email. I know that during a single send to a data extension, normally, Marketing Cloud will dedupe the DE's contents on the email address. However, I'm not sure if this occurs the same way for an A/B split send. My DE contains 130,000 records, including about 50,000 people who appear more than once, with slightly different attributes. I must leave this DE as-is. But I cannot have anyone receiving more than one email out of this send. If the dedupe is performed on each split segment separately, then thousands of subscribers will receive both the A and B versions of the email, and possibly receive the winner a second time.
Comment: My suspicion is SFMC would only dedupe within each Job - A, B and Remainder. Rather than depend on deduplication at time of send, could you not consider deduping your Sendable DE with a Query before you do the test?
Answer: Answered my own question. After you select a DE, then a deduplicate checkbox appears. But not before. As shown in these screenshots (before/after).
BEFORE:

AFTER:


Turn an object into a clone of another object

Question: Is it possible to take an existing object and turn it into a clone of another object?
Of course, the right way is to do things in the correct order by creating the original object first and then make clones. But sometimes I realize later in the workflow that I would like certain objects to be modifiable all at once. I wish I could then copy one of the objects, make it my "master template", and then link all the other objects to it, without having to delete them all then making clones and having to place all the new clone onjects.
Answer: As far as I know, there's nothing that will do this fully automatically.
However you could semi-automate it.

Clone one of your objects, move the clone off the page, and move the clone source off to the other side of the page, so you know where they are.

Change one of the colours in the clone source object so you can better see the replacement in the later steps.

Select all your objects to replace, and look at the status bar to count how many there are. Take a note of this number

Using the Tiled Clone functionality on the clone, add as many clones as there are objects (as calculated in the previous step).

Select and move all the tiled clones to the top of the stack (using the Raise to Top button or the shortcut Home). The later steps for replacement rely upon the z-order in the stack.

Select all the objects to replace and all the clones together, do not include the clone source in the selection.

In the Align and Distribute panel, under Rearrange, hit the Exchange in Z-order button repeatedly until all the objects are replaced with clones. Note that this could be tedious if you have a lot of clones.

Now the objects are replaced by clones, and if you edit the clone source, you should see everything works. Finally delete the left over objects that aren't clones.

A quick example showing the replacement process

I got this idea from a tutorial on youtube by Unfa which goes into more detail if you get stuck on any of the steps above.  The only difference here is that I began with a clone to do the Tiled Clones step.


Running sudo apt-gt update gives E: The repository 'https://apt.postgresql.org/pub/repos/apt virginia-pgdg Release' does not have a Release file

Question: I am using Linux Mint Cinnamon 21.3 Virginia.
I installed PostgreSQL recently and the installation proceeded successfully. However, there seems to be some issue with the package manager now.
On running sudo apt-get update I get the following errors:
Err:9 https://apt.postgresql.org/pub/repos/apt virginia-pgdg Release
  404  Not Found [IP: 184.108.40.206 443]

E: The repository 'https://apt.postgresql.org/pub/repos/apt virginia-pgdg Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Based on the answers on this StackOverflow question, I have tried the following:

Change the URL of apt repository to apt-archive. To do this, I edited /etc/apt/sources.list.d/pgdg.list and changed deb https://apt-archive.postgresql.org/pub/repos/apt virginia-pgdg main to deb https://apt.postgresql.org/pub/repos/apt virginia-pgdg main. However, on doing so, I get a new error:

Err:12 https://apt-archive.postgresql.org/pub/repos/apt virginia-pgdg InRelease
  403  Forbidden [IP: 188.8.131.52 443]

E: Failed to fetch https://apt-archive.postgresql.org/pub/repos/apt/dists/virginia-pgdg/InRelease  403  Forbidden [IP: 188.8.131.52 443]
E: The repository 'https://apt-archive.postgresql.org/pub/repos/apt virginia-pgdg InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Installing the repository signing key from the PostgreSQL official Installation instructions. This doesn't solve anything.
Changing the codename of my Linux Mint version to the Ubuntu version it is based on Linux Mint 21.3 is based off of Ubuntu 22.04 (Jammy Jellyfish), so I changed my /etc/apt/sources.list.d/pgdg/list to deb https://apt.postgresql.org/pub/repos/apt jammy-pgdg main. This throws a new warning:

Get:10 https://apt.postgresql.org/pub/repos/apt jammy-pgdg/main amd64 Packages [297 kB]

W: https://apt.postgresql.org/pub/repos/apt/dists/jammy-pgdg/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://apt.postgresql.org/pub/repos/apt jammy-pgdg InRelease' doesn't support architecture 'i386'

Since I am using an amd64 architecture, I am not worried about the architecture i386, for a 32-bit machine, not being supported. But how do I disable this warning every time I run the apt update command?
Answer: To set up the postgresql apt repository on Linux Mint Virginia based on jammy, use:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc |
sudo tee /usr/share/keyrings/pgdg.pgp
echo "deb [signed-by=/usr/share/keyrings/pgdg.pgp arch=amd64] https://apt.postgresql.org/pub/repos/apt jammy-pgdg main" |
sudo tee /etc/apt/sources.list.d/pgdg.list

For general use, to install postgresql on Linux Mint:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc |
sudo tee /usr/share/keyrings/pgdg.pgp
echo "deb [signed-by=/usr/share/keyrings/pgdg.pgp arch=amd64] https://apt.postgresql.org/pub/repos/apt $(. /etc/os-release && echo "$UBUNTU_CODENAME")-pgdg main" |
sudo tee /etc/apt/sources.list.d/pgdg.list

The . /etc/os-release && echo "$UBUNTU_CODENAME" will print the Ubuntu codename instead of lsb_release -cs.
Adding [arch=amd64] to disable the ...doesn't support architecture 'i386'...  warning.


A time frame for a faculty position application application in UK

Question: Let us imagine that I am uploading the application for a faculty position (e.g. lecturer) in a university in UK today. What to expect next? Should I wait for their reply anyway or only in the case that my application is in a short list? How long might it take to get an email from them (weeks, months etc)?
Thanks!
Answer: In my experience English and Welsh[1] universities will notify all applicants shortly after the shortlist has been decided upon, either with a positive or negative response. Moreover, this decision is typically quite fast, around 2weeks - 2months.
[1] I have insufficient experience with North-Irish universities, and have applied to Scottish universities and never received a response at all.
Answer: Normally, shortlisting happens a week or two after the application submission deadline. If you are shortlisted, you will be invited to an interview. If you are not invited to an interview within a month after the application deadline, it is safe to assume you are not shortlisted, but the University does not want to let you know until the appointment is made (which may happen a few months later).
The interview can be scheduled from a few weeks to a few months after the shortlisting date. After the interview, the decision is normally made within a week. If you don't hear from them after 2 weeks, it is safe to assume you are not the first candidate, but the University does not want to let you know until the appointment is made.
It is not unusual to never hear back from a University if your application is unsuccessful. Generally speaking, standards for professional communication in the UK academia are surprisingly low.


Magento problem in login and product view

Question: I m new in magento and I have installed magento. It's working fine.
When I installed some themes, its getting problem, like when I am login my admin panel at that time i have to type index.php between my wesite name and admin.
I want to resolve it. Even when I open any product at that time also I have to include index.php after that it will open like example http://ulogin.co.uk/admin this will not work but when I type http://ulogin.co.uk/index.php/admin at this time it work. Same thing happen in product open
Answer: change your .htaccess file .. or put your fresh Magento  .htaccess file on your server root file. Hope this work ..


Short story, first spaceship's burn starts chain reaction and destroys all life, astronaut returns and seeks out the ocean

Question: I think (but I'm not sure) this story is quite old, possibly from before the first launch of anything into space. In the story the burn from the shuttle/spacecraft leaving Earth sets off a chain reaction that destroys all life on Earth. When the astronaut aboard returns to Earth, he realizes he is all that is left, and has an urge to find the ocean.
Answer: Alfred Bester, "Adam and No Eve"
The protagonist develops a drive that uses a "catalyst on iron solution." There is a pit that is supposed to contain any exhaust spillage until the ship is in space.  This safety feature doesn't work -oops- and the first launch destroys the Earth.

And then he knew what had brought him back to the sea.  There need be
no Adam - no Eve.  Only the sea, the great mother of life was needed.
Comment: People in the story are literally trying to kill the protagonist and destroy the ship because it's such a bad idea.  But he presses on.
Comment: So the spaceship was designed was software engineers? Nyah nyah nyah (time to hide)
Comment: @OrganicMarble *closes eyes tightly* I won't make a comparison to current US politics... I won't make a comparison to US politics...
Comment: @corsiKa You refer to the battle for the presidency between chaotic neutral and lawless evil?
Comment: Thanks @Organic Marble, that puts it in an entirely new light
Comment: @user14111 Well, it's confusing to say the least.


Problems with Realtek 8822CE WLAN Card

Question: I'm trying solve drivers issues with WiFi card in object. I tried various unsuccessfull threads.
Anyone solved this problem before?
Comment: `Anyone solved this problem before?` Please edit your question to include some details describing the problem you're facing. Simply stating the model of your wireless adapter is not enough. Do you not see wireless networks? You see wireless networks but unable to connect? You can connect but it disconnects after a while? Cannot connect after wakeing up from suspend?
Comment: Probably you need to download a firmware for this model and then recompile the kernel with the firmware. But you did not provide much information about the issue and if I would like to kindly ask you to answer above questions from the previous comment, please. I am able to help step by step but I need more information. First of all I need exact model of this Wi-Fi card.
Comment: Here you have additionally the list of firmware for realtek.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/
But I need to know which exact files are needed for 8822CE.
Answer: I have the same problem with this wlan card. The connection is down after a short time.
I noticed that if I keep a connection alive (like a browser session) the connection doesn't go down. So I launched a non stop ping to another local device into a terminal and I wait for a long time: tada ! the connection is steel up.
So now, I launch a no ending ping process at gnome startup and it is fine.
It's not very clean but I didn't find another solution...
Comment: Bad news, this solution doesn't work anymore today...

Problems with Realtek 8822CE WLAN Card


Users and Forum Transfer from a live site to a staging site

Question: How do I transfer just the Forum of a Drupal site to another Drupal site as my staging site is lagging behind the live site, So I need to update it with the live site forum content and then  publish my staging site as the live site afterwards.
Comment: If you want to migrate content also then you can use node export module. Node export also supports features so you can export content type, content and other fields too..
Answer: Use Features for all need of these kind. Module page explains -

Features provides a UI and API for taking different site building
  components from modules with exportables and bundling them together in
  a single feature module. A feature module is like any other Drupal
  module except that it declares its components (e.g. views, contexts,
  CCK fields, etc.) in its .info file so that it can be checked,
  updated, or reverted programmatically.

So you can make feature of your users setting as well as forum and you can always track the changes at your staging site and if it's overridden then you can make it again and apply the changes at live site by replacing the created feature and enabling it..


Given their huge variety, why is it so often concluded that the penalties needed to use a Weapon of Legacy are never worth it?

Question: A common trend when discussing Weapons of Legacy is to compare their benefits to that of normal magical items, notice that they pretty much match up, and then conclude that because the Weapons of Legacy have extra penalties associated with them, they are clearly inferior to any comparable normal magical item. However, some of the benefits of some of the Weapons of Legacy are as good as unique (for there level, at least), so how is it so frequently and easily concluded that their extra penalties outweigh their unique benefits? What I've just linked does a fairly good job of assessing the value and rarity of said benefits, but despite the frequency with which I've seen the claim that the penalties for Weapons of Legacy always outweigh their benefits, I've never seen any such analysis of their penalties, which are rather varied. What property of these penalties is so severe that it allows the Weapons of Legacy to be disregarded without any further analysis, despite the variety in these penalties?
Answer: Most legacies penalize one or more saving throws. Saving throws are some of the most important defenses in the game; the best cloak of resistance you can afford is all but mandatory for literally every adventurer.
Other options for penalties include

Attack—pretty crucial for most weapons
Caster/manifester level and spell slots/power points—absolutely mandatory for those affected, which includes everyone interested in those items
Skill points—maybe bearable but quite painful
Hit points—ya know, the thing that makes the difference between you being alive and dead?

Sadly, hp is often the least painful of these. That's saying something—that's saying a whole lot. The spell slots aren't always so bad—since they aren't cumulative—but caster/manifester level is awful. Attack may not matter to everyone, but it's likely to for anyone who'd be interested in the weapons that have that cost. Realistically, the skill points are actually the least painful, but only because 3.5e's skills are kind of meh to begin with—otherwise, everyone always has far too few skill points to get by, losing them should hurt, only they don't because the skills themselves aren't as useful as they should be. And in any event, not every legacy costs skill points.
And once again, we have to remember that the benefits of the printed legacy weapons are almost all garbage. Cunning, the capstone on Ur, and the high-level abilities of Faithful Avenger are seriously the only things I'd even bother to double-check against their penalties to see if maybe they're worth it.

Cunning appears on Mau-Jehe, which penalizes all saving throws—hard pass

Cunning also appears on legacy ability menu D, which is available from legacy champion—which is mostly only worthwhile for hellfire warlock abuse—or if you found your own legacy. If you can found your own legacy, and create a really minor legacy weapon, so you can pick up cunning with as few personal costs as possible—ideally costs that are irrelevant to you, such as an attack penalty for a spellcaster or a caster level penalty for a warrior—then fine, I guess.

Ur costs 20 hp—equivalent to 2 Constitution, which is a big deal. That's really rough, and it's only even worth asking if it might be worthwhile at 20th. But there's no saving throw penalty, and in fact the other penalties aren't too harsh, so it's maybe worthwhile. Ironically, if we're going this route, legacy champion becomes more plausible—because getting more daily uses of savage transformation is valuable, because we clearly have some shenanigans planned for it. And then we can get cunning too. But that's only at 20th, which is a level very few campaigns ever reach (and, to be honest, probably none should: the game breaks down well before that even if everyone's trying really hard to hold it together). And only if you have some abusive combo that requires savage transformation.

Faithful Avenger costs 10 from your Fortitude saving throw. Stop, do not pass go, do not collect $200—that is a non-starter.

Seriously, Weapons of Legacy is terrible. Every single facet of it, from beginning to end. There is no redeeming quality to the book.1 Just forget it exists; you'll save yourself time and wind up in the same place.

Monster of legacy is a kind of convenient template for a DM to generically boost a monster. It's not the only way to do that, but it's the closest thing Weapons of Legacy has to content that's actually worth using.
Comment: I think you've missed a penalty. Have a look at the Bones of Li-Peng. There's a Skill Check Penalty and a Skill Point Loss. Speaking of, as bad as a -2 attack penalty is for a monk, the personal costs on that item really don't look all that bad. Does this answer still apply when the costs are small? Is there some sort of trend like "some of the items have low costs, but they tend to have equally small benefits"?
Comment: @J.Mini You would presume that they intended for such a trend to exist, because that would be in keeping with the themes of the book and (if any of this nonsense actually worked) would be necessary for balance, though there are necessarily outliers where benefits were paired with below-the-curve penalties, or (equivalently) vice versa. However, since nearly every benefit written for legacy abilities is either "garbage" or "easily obtained from a regular item," it basically *does not matter* how light the penalties are for most of them—because the benefits aren't really worth anything at all.


In which site asking for code is on-topic?

Question: Is there any site on Stack exchange network that allows to ask for code (or reference to code) in a particular programming language for a given problem?
Comment: @Confused Then you try to adapt them to suit your needs.  If you can't, you might have created a specific problem which you can clearly explain indicating what you're trying to do, what you're doing, how it fails to solve your problem, what research you've done on existing solutions to that problem, and how they fail to work for you.  After having done that, you might have a question that's on topic on a site here.
Comment: None, that I'm aware of.
Comment: @Confused The place to ask those questions is [here](http://google.com)
Comment: It's going to depend on the specifics of what you're asking for as to what site, if any, that might be appropriate on.
Comment: I am asking for general code asking platform like,

ex : 'python code for subset sum problem', 'Julia code for generating permutations', 'C code for K nearest neighbor classifier' etc.,
Comment: @Servy But, most of the times, the codes over Google may not be as per requirements and obeying restrictions needed.
Answer: Stack Exchange sites are designed to create a collection of knowledge by helping users with very specific problem statements so other can solve those problems on their own.
Unfortunately, questions soliciting users to build something for me are not allowed on these sites. And posts sending users elsewhere for solutions are not considered an 'answer' in the context of a Stack Exchange site because posts are expected to contain complete solutions.
There are rare exceptions like "Puzzling" and "Code Review" where folks engage in exercises of solving problems and improving working code. But Stack Exchange is not meant solicit code or other work and should be 'flagged' if it occurs.