Execution order of event receivers and workflow on a list Item
Execution order of event receivers and workflow on a list
How do I create a villager with custom trade offers? I'm trying to set up a shop system in a vanilla minecraft realm and villagers seem like the most streamlined method of doing so, however I'd also like to make it so that other players on the server can program their own villager, or have me program it for them as an operator so that other players can trade with each other through the villager. I figure that since villagers now have a secret inventory, they can collect items, but I was wondering if there's any way to access the items traded to them or if they just disappear.  Currently my thoughts are that a player would initiate a trade, the villagers sells would be linked to individual slots in a chest and the villager buys could be linked to another chest, allowing the player to fill a chest and thus 'program' their villager, and that finally a third chest would be filled with the item the villager receives, while the chest containing the trades would decrement the specific number of the item in the relevant slot. Why can't enum's constructor access static fields? Why can't enum's constructor access static fields and methods? This is perfectly valid with a class, but is not allowed with an enum.  What I'm trying to do is store my enum instances in a static Map. Consider this example code which allows lookup by abbreivation:  public enum Day {     Sunday("Sun"), Monday("Mon"), Tuesday("Tue"), Wednesday("Wed"), Thursday("Thu"), Friday("Fri"), Saturday("Sat");      private final String abbreviation;      private static final Map&lt;String, Day&gt; ABBREV_MAP = new HashMap&lt;String, Day&gt;();      private Day(String abbreviation) {         this.abbreviation = abbreviation;         ABBREV_MAP.put(abbreviation, this);  // Not valid     }      public String getAbbreviation() {         return abbreviation;     }      public static Day getByAbbreviation(String abbreviation) {         return ABBREV_MAP.get(abbreviation);     } }   This will not work as enum doesn't allow static references in its constructor. It however works just find if implemented as a class:  public static final Day SUNDAY = new Day("Sunday", "Sun"); private Day(String name, String abbreviation) {     this.name = name;     this.abbreviation = abbreviation;     ABBREV_MAP.put(abbreviation, this);  // Valid } For $f$ Riemann integrable prove $\lim_{n\to\infty} \int_0^1x^nf(x)dx=0.$ Suppose $f$ is a Riemann integrable function on $[0,1]$. Prove that $\lim_{n\to\infty} \int_0^1x^nf(x)dx=0.$   This is what I am thinking: Fix $n$. Then by Jensen's Inequality we have $$0\leq\left(\int_0^1x^nf(x)dx\right)^2 \leq \left(\int_0^1x^{2n}dx\right)\left(\int_0^1f^2(x)dx\right)=\left(\frac{1}{2n+1}\right)\left(\int_0^1f^2(x)dx\right).$$Thus, if $n\to\infty$ then $$0\leq \lim_{n\to \infty}\left(\int_0^1x^nf(x)dx\right)^2 \leq 0$$ and hence we get what we want. How correct (or incorrect) is this? LINK : fatal error LNK1104: cannot open file 'D:\...\MyProj.exe' Need guidance on this proof by mathematical induction. I am new to this type of math and don't know how exactly to get started.   $$ 1^3  +  2^3  +  3^3  +  \ldots  +  n^3  =  \left[\frac{n(n+1)}{2}\right]^2 $$ Possible Duplicate:          I know that I have to find the number of factors of $5$'s, $25$'s, $125$'s etc. in order to do this. But how can you derive such a formula for any number $n$? PostgreSQL CPU 100% after configure Wal log shipping hot standby I have configured Hight Avaliabily WAL Log Shipping Hot Standby (SSL) with one node. But after I configure, both hosts (primary and secondary) take 100% CPU usage. The most strange is because I have only one database called &quot;TESTE&quot; with one table called &quot;EXAMPLE&quot; to check if replication was OK. The replication worked perfectly but I don't understand why my CPU takes 100% usage because I don't have any application connect on my cluster. I ran HTOP command and get this results: Image 1 - Primary Server HTOP Info  Image 2 - Secondary Server HTOP info  S.O. version: No LSB modules are available. Distributor ID: Debian Description:    Debian GNU/Linux 10 (buster) Release:        10 Codename:       buster  PostgreSQL version: postgres (PostgreSQL) 12.3 (Debian 12.3-1.pgdg100+1)  Primary server postgres.conf file: max_connections = 100 SSL = on shared_buffers = 2GB work_mem = 10485kb maintenance_work_mem = 512MB dynamic_shared_memory_type = posix effective_io_concurrency = 200 max_worker_processes = 4 max_parallel_maintenance_workers = 2 max_parallel_workers_per_gather = 2 max_parallel_workers = 4 wal_level = replica wal_buffers = 16MB max_wal_size = 200MB min_wal_size = 80MB checkpoint_completion_target = 0.7 archive_mode = on max_wal_senders = 3 wal_keep_segments = 8 hot_standby = on hot_standby_feedback = on random_page_cost = 1.1 effective_cache_size = 6GB default_statistics_target = 100  pg_stat_activity info:  pg_stat_archiver info:  pg_stat_replication info:  If I stop postgres service in both servers the CPU still has 100% usage. Anyone can help me? If a variable is declared as static in a function's scope it is only initialized once and retains its value between function calls. What exactly is its lifetime? When do its constructor and destructor get called?  void foo()  {      static string plonk = "When will I die?"; } Why are integers subset of reals? In most programming languages, integer and real (or float, rational, whatever) types are usually disjoint; 2 is not the same as 2.0 (although most languages do an automatic conversion when necessary). In addition to technical reasons, this separation makes sense -- you use them for quite different purposes.  Why did they choose to say $\mathbb{Z} \subset \mathbb{R}$ in math? In other words, why are 2 and 2.0 considered the same?  When you are working in $\mathbb{R}$, does it make any difference whether some elements, eg. 2.0, also belong to $\mathbb{Z}$ or not? I can understand the choice of material, silicon 28, but why is it a sphere rather than (say) a cube? Article   I would have thought that a sphere would have been the hardest shape to machine accurately. I am writing my thesis,  and i am in restructuring phase - sorting theorems where they should belong thematically. And it would be helpful to have all the proofs hidden so i am not laden with the additional information.  Is it possible to add something like hideproof to documentclass options to omit them when compiling the latex file. Cross product: matrix transformation identity How can one prove the following identity of the cross product?  $$(M a)\times (M b)=\det(M) (M^{\rm T})^{-1}(a\times b)$$  $a$ and $b$ are 3-vectors, and $M$ is an invertible real $3 \times 3$ matrix. Is it possible to wipe an entire iCloud Photo Library? I've been using the beta iCloud Photo Library for a week and a bunch of photos got duplicated and I'd like to wipe all the photos out and start over.  I have backups of all the photos and have turned off iPhoto Cloud Library on all iOS devices. When I log into the web app - it still shows dozens of albums and I can delete all the photos, then go to deleted items and then purge them, but the ghost albums are still there messing things up.  I've turned off the library entirely and you can see there is a 30 day waiting period.     If I click on albums, there are pages of them and no delete button anywhere. If I turn on the library on an iOS device, data starts flooding back as if I wanted to recover the photos.  I don't want to recover anything, I want a clean wipe and clean slate.  Currently, there are 7807 photos in the deleted album and no way to mass delete them. I have 31 albums that show up in iCloud and no way to delete them.  Is there some way to accelerate this or must people wait a month for a corrupt library to eventually be purged to start over?  (I have tickets open with AppleCare after  and it's escalated to engineering, but I was informed that it might be a week or two before it gets seen :-( Perhaps someone has a better idea to clear things out or noticed something I've missed.) How does the formation of a solar system not break the second law of thermodynamics? Please forgive: I am a layman when it comes to physics and cosmology, and have tried finding an answer to this that I can understand, with no luck.  As I understand it, the solar system evolved from a massive molecular cloud. To me, this seems to break the second law of thermodynamics, as I think it suggests order from disorder.  I know there must be something wrong with my logic, but am really stuck.  Can anyone explain this one in layman's terms?  (Posting to both "Astronomy" and "Physics", as it seems to overlap these subjects) How the `\alignat` works in ams package I have read the related question(), which had detailed answer but still don't know what the meaning of the \alignat's argument. It is said in  that      This environment takes one argument, the number of “equation   columns”: count the maximum number of &amp;s in any row, add 1 and and   divide by 2.   What is the meaning of adding one in &amp; number and divide by two? I presumed the argument is given by the user, not automatically generated by the system? A challenge on the parabola Good Night ... Here I am editing the question and explaining the purpose of the same ... Mathematics course, and I love this science, I am very curious, and these days, studying a book of calculus found in (book from the library of the University) a sheet full of challenges, to share with a colleague, he gave me this challenge, which he also failed to respond ... I tried, I tried, I used the formulas of quadratic equation, and I've been trying since Friday (here in Brazil is Sunday at 22:33), and could not, and I ask your help, and please believe me, I struggled, tried to make substitutions, tried both, and I'm confused ... I must find the values of $ a, b $ and $ c $?  Consider a parabola whose roots, other are $x'$ and $x''$, and such that $x'=-x''$ where $x'&gt; 0$. Let $$A = (x', 0)$$ $$B = (x'', 0)$$ and $V$ the vertex of the parabola. Suppose that the equation of this parabola is $$y = ax^2 +bx+ c$$. Calculate the value of the discriminant $$\Delta=b^2-4ac$$, so that the triangle is equilateral AVB. Indefinite Integral of $\sqrt{\sin x}$ $$\int \sqrt{\sin x} ~dx.$$  Does there exist a simple antiderivative of $\sqrt{\sin x}$? How do I integrate it? I'm just starting to learn linear algebra and I understand Gaussion elimination but I don't understand this proof:    Is the heart of this the fact that all the while when I've been row-reducing matrices to reduced row-echelon form... I've actually been multiplying a matrix by a series of a elementary matrices?  What does the notation $[A\ \ 0]$ mean?  How is the equation $A = E_1^{-1}...E_k^{-1}$ arrived at? Powershell Rename Multiple Files with LastWriteTime Prefix I am trying to put together a Powershell script that will:  -Search recursively from a root directory -Exclude files with existing "yyyyMMdd " file name prefix -Rename the files not excluded above with ""yyyyMMdd " file name prefix based on their specific LastWriteTime  Note: ideally, this script should include all file type extensions  I have tried myself, but it would seem to be above my head, as my attempts are not going well.  Thanks, in advance.    #StampMe.ps1 param( [string] $fileName)  # Check the file exists if (-not(Test-Path $fileName)) {break}  # Display the original name "Original filename: $fileName"  $fileObj = get-item $fileName  # Get the date $DateStamp = get-date -uformat "%Y-%m-%d@%H-%M-%S"  $extOnly = $fileObj.extension  if ($extOnly.length -eq 0) {    $nameOnly = $fileObj.Name    rename-item "$fileObj" "$nameOnly-$DateStamp"    } else {    $nameOnly = $fileObj.Name.Replace( $fileObj.Extension,'')    rename-item "$fileName" "$nameOnly-$DateStamp$extOnly"    }  # Display the new name "New filename: $nameOnly-$DateStamp$extOnly"   I am hoping to change the line:  $DateStamp = get-date -uformat "%Y-%m-%d@%H-%M-%S"   To be LastWriteTime instead of get-date, but I have no idea how to make this happen.  This code (from another Super User question):  Get-ChildItem "Test.pdf" | Rename-Item -newname {$_.LastWriteTime.toString("yyyyMMdd") + " Test.pdf"}   ...successfully renames a single file, but I can't seem to integrate this into the larger script.    With regards to running the above recursively, I have tried this (also from ):  foreach ($file in get-ChildItem *.* -recurse) { ./StampMe.ps1 $file.name }   Which succeeds to apply the PS script to files in the root directory, but fails to apply to any files in the sub-folder tree that propagates from the root directory. Java Generics: List, List, List Can someone explained, as detailed as possible, the differences between the following types?  List List&lt;Object&gt; List&lt;?&gt;   Let me make this more specific. When would I want to use  // 1  public void CanYouGiveMeAnAnswer(List l) { }  // 2 public void CanYouGiveMeAnAnswer(List&lt;Object&gt; l) { }  // 3 public void CanYouGiveMeAnAnswer(List&lt;?&gt; l) { }