Is it possible to run code when the object in WeakReference is garbage collected?
Is there a destructor for Java?
How can I get the size of a memory block allocated using malloc()? Create database fields to an existing table when installing a module I'm new to drupal and I need some help.  I created a new module with name user_extra. Which create necessery table when Installing the module.  But I also need to insert some database field in 'users_field_data' table ('user_extra_id' and 'user_office')  In baseFieldDefinitions I wrote all necessery database table fields for user_extra table.   public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {     // Standard field, used as a unique if primary index.     $fields['id'] = BaseFieldDefinition::create('integer')         -&gt;setLabel(t('Unit ID'))         -&gt;setDescription(t('The unit ID.'))         -&gt;setReadOnly(TRUE)         -&gt;setSetting('unsigned', TRUE);      $fields['uuid'] = BaseFieldDefinition::create('uuid')         -&gt;setLabel(t('UUID'))         -&gt;setDescription(t('The unit UUID.'))         -&gt;setReadOnly(TRUE);         .         .         .     $fields['user_info'] = BaseFieldDefinition::create('string')         -&gt;setLabel(t('User Info'))         -&gt;setDescription(t("The User Info"))         -&gt;setSetting('max_length', 255)         -&gt;setDisplayOptions('form', array(           'type' =&gt; 'string_textfield',           'weight' =&gt; 10,         ))         -&gt;setDisplayConfigurable('form', TRUE);      return $fields;      }   When I install the module it inserts all values that I define in baseFieldDefinitions.  But I also need to create 'user_extra_id' and 'user_office' in 'users_field_data' table with setDisplayOptions and setDisplayConfigurable options.  This is the commenting that I made in entity file  /**  * @ContentEntityType(  *   id = "user_extra",  *   label = @Translation("user extra"),  *   handlers = {  *     "storage" = "Drupal\user_extra\UserextraStorage",  *     "storage_schema" = "Drupal\user_extra\UserextraStorageSchema",  *     "access" = "Drupal\user_extra\UserextraAccessControlHandler",  *     "list_builder" = "Drupal\user_extra\UserextraListBuilder",  *     "view_builder" = "Drupal\user_extra\UserextraViewBuilder",  *     "views_data" = "Drupal\user_extra\UserextraViewsData",  *     "form" = {  *       "default" = "Drupal\user_extra\Form\UserextraForm",  *       "add" = "Drupal\user_extra\Form\UserextraAddForm",  *       "edit" = "Drupal\user_extra\Form\UserextraEditForm",  *       "delete" = "Drupal\user_extra\Form\UserextraDeleteForm",  *     }  *   },  *   admin_permission = "administer user_extra",  *   base_table = "user_extra",  *   entity_keys = {  *     "id" = "id",  *     "label" = "name",  *     "uuid" = "uuid",  *   },  *   links = {  *     "canonical" = "/admin/user_extra/{user_extra}",  *     "add-form" = "/admin/user_extra/add",  *     "delete-form" = "/admin/user_extra/{user_extra}/delete",  *     "overview-form" = "/admin/user_extra/${user_extra}/overview",  *     "edit-form" = "/admin/user_extra/{user_extra}",  *     "collection" = "/admin/user_extra",  *     "children" = "/admin/user_extra/{user_extra}/children",  *   },  * )  */ Are repository lists secure? Is there an HTTPS version? Can't execute terminal commands: "the command 'sudo' is available in '/usr/bin/sudo'" I have been using Ubuntu 12.04 for quite a while and have never had a problem come at me out of the blue like this. I'm trying to install python 3.2 on my Ubuntu system and every time I run the code to compile the python source, I get this error:  'Command 'sudo' is available in '/usr/bin/sudo' The command could not be located because '/usr/bin' is not included in the PATH environment variable. sudo: command not found'   I've also tried running gksudo command to view what my environment shows but I pretty much get the same error. Site hosted on EC2 / Amazon held hostage with private key I have a new client whose previous developer has left her high &amp; dry with her site on Amazon/EC2. He holds the private key to the instance, and though she has full access to the Amazon control panel (she's paying $300/mo for a site that has like 3 visitors per week) she doesn't have any way to get her content off and move to a new host.  I'm not familiar with AWS and am not sure how to help her. The site's group/file permissions are screwed up on the server so exporting the content/database via her WordPress control panel isn't working.  Any ideas on how to help her? Thanks! I installed an Ubuntu alpha or beta and have been keeping it up to date.   So, Should I presume that my system has automatically updated to the next alpha or beta, and will be running the official release when it's finished? Is there a way to solve this integral?  $$\int \frac{dx}{\sqrt{-ax^2 + bx +c}}, \;\;\;\;\; \forall\; a,b,c \in (0,+\infty) \;in\;R$$  I have tried it by changing of variable and by parts, but no result. I don't know what else to do.  Thanks in advance. How does A* pathfinding work? How to fix apt: Signature by key uses weak digest algorithm (SHA1)? I started setting up by adding repositories and then went to run a sudo apt-get update again before I started installing other software, and I get the Signature key lines and it stops. So it essentially won't let me update any packages now.  d@EliteBook:~/Downloads$ sudo apt-get update Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease Hit:2 http://dl.google.com/linux/chrome/deb stable Release                      Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease               Get:5 http://ca.archive.ubuntu.com/ubuntu xenial InRelease [247 kB] Hit:6 http://ca.archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:7 http://ca.archive.ubuntu.com/ubuntu xenial-backports InRelease Fetched 247 kB in 0s (256 kB/s)                    Reading package lists... Done W: http://dl.google.com/linux/chrome/deb/dists/stable/Release.gpg: Signature by  key 4CCA1EAF950CEE4AB83976DCA040830F7FAC5991 uses weak digest algorithm (SHA1) d@EliteBook:~/Downloads$   I've never seen this before whenever I setup and start installing things in Ubuntu. Is there something else I can do? If Python does not have a ternary conditional operator, is it possible to simulate one using other language constructs? What special characters must be escaped in regular expressions? Evaluating the limit of a sequence given by recurrence relation $a_1=\sqrt2$, $a_{n+1}=\sqrt{2+a_n}$. Is my solution correct? Problem  The sequence $(a_n)_{n=1}^\infty$ is given by recurrence relation:   $a_1=\sqrt2$, $a_{n+1}=\sqrt{2+a_n}$.   Evaluate the limit $\lim_{n\to\infty} a_n$.  Solution   Show that the sequence $(a_n)_{n=1}^\infty$ is monotonic. The statement $$V(n): a_n &lt; a_{n+1}$$ holds for $n = 1$, that is $\sqrt2 &lt; \sqrt{2+\sqrt2}$. Let us assume the statement holds for $n$ and show that $V(n) \implies V(n+1)$. We have that $$a_n &lt; a_{n+1}.$$ Adding 2 to both sides and taking square roots, we have that $$\sqrt{2+a_n} &lt; \sqrt{2+a_{n+1}},$$ that is $a_{n+1} &lt; a_{n+2}$ by definition. Find bounds for $a_n$. The statement $$W(n): 0 &lt; a_n &lt; 2$$ holds for $n=1$, that is $0 &lt; \sqrt2 &lt; 2$. Let us assume the statement holds for $n$ and show that $W(n) \implies W(n+1)$. We have that $$0 &lt; a_n &lt; 2.$$ Adding two and taking square roots, we have that $$0 &lt; \sqrt2 &lt; \sqrt{2+a_n} &lt; \sqrt4 = 2.$$ The limit $\lim_{n\to\infty} a_n$ exists, because $(a_n)_{n=1}^\infty$ is a bounded monotonic sequence. Let $A = \lim_{n\to\infty} a_n$. Therefore the limit $\lim_{n \to\infty} a_{n+1}$ exists as well and $\lim_{n \to\infty} a_{n+1} = A$. (For $(n_k)_{k=1}^\infty = (2,3,4, \dots)$, we have that $(a_{n_k})_{k=1}^\infty$ is a subsequence of $(a_n)_{n=1}^\infty$, from which the statement follows.) We have that $a_{n+1} = f(a_n)$. That means that $A = \lim_{n\to\infty} a_n = \lim_{n \to\infty} {f(a_n)} = f(\lim_{n \to\infty} a_n) = f(A) = \sqrt{2 + A}$. Solving the equation $A = \sqrt{2 + A}$, we get $A = -1 \lor A = 2$. Putting it all together, we get that $A = 2$, because the terms of the sequence are increasing and $a_1 &gt; 0$.   Is my solution correct? Find a function value given 2 points Given $f(x)$, which is differentiable at every point such that: $f'(x) \ge -5$ for every $ x \in R$   $f(2) = -13$, $f(9) = -48$  Prove that:$ f(3) = -18$  Now it's quite obvious that $ f(3) = -18$ since that if we know that the lowest value of the derivative is -5, the difference between $f(2)$ and $f(9)$ is $-48-(-13)=-35$  that means that that in the area $[2,9]$, $f'(x)=-5$ right? that's why I told that $f(3) = -18$, but I feel that my proof is insufficient, probably because I'm missing some theorems or such. can someone help me structure this proof into something RIGHT :)?  Thanks a lot! Return multiple values to a method caller Is it possible to use a spell scroll with a spell that requires a bonus action to cast? The DMG contains spell scrolls (on page 200), with the following rule:     If the spell is on your class's spell list, you can use an action to read the scroll and cast its spell without having to provide any of the spell's components.   This is all well and good for spells with a casting time of 1 action (which admittedly is most of them), but for spells with a bonus action casting time, how is it supposed to work?  Does it require:   Both an action and a bonus action?  Just an action? Just a bonus action? Something else I haven't thought of?   In case it needs saying, I'm not interested in speculation here - only RAW-based answers or explicit statements of developer intent should apply. What do you call someone who is supported? Synonym for a supportee (Which doesn't seem to be a word)?  I created products that retail and we sell them and give the proceeds to charities. Trying to figure out a single word to use as a page title for those that we support were we can list the charities (With their permission of course).  Thanks Adding DC voltages of PSU I need to add two voltages together that share a common ground (power supply from computer). I tried using bridge rectifiers and Op-Amps. Solving $f(x+y) = f(x)f(y)f(xy)$ Is this correct? "One of the things that makes him great is..." One of the things that makes him great is he brings it every night.   I'm pretty sure it should be that make him in the plural, because one of the things is referring to a lot of things and a lot of things should take a plural verb. But I always hear native speakers in America say it in the singular, so with an s.  Another example:     This is one of the responsibilities that comes with greatness and he understands that.   Native speakers always use the verb in the singular (here, comes) even though [I believe] it is grammatically incorrect to use the singular form of the verb there. Sarrus Rule with LaTeX Is there a way to create a new command with 9 arguments ({a_{11}},{a_{12}},{a_{13}},{a_{21}},{a_{22}},{a_{23}},{a_{31}},{a_{32}},{a_{33}}) that has as output a matrix with the Sarrus Rule? For instance: to obtain     just use the command that we will call sarrus:  \sarrus{-k}{k-1}{1}{0}{k-1}{k}{2}{0}{1}.   If it is possible i want to use the command sarrus in math mode just like matrix for istance.