I'm looking for a diff implementation in Java. I've seen that Python has its own SequenceMatcher (with difflib), which is exactly what I need... in Java.  Is there any portage? Or is there any other class/library that performs the same in Java?  If not, where can I find the source code of that difflib (if free as in speech) to make my own implementation of SequenceMatcher in Java ?  Unfortunately, Apache Commons Lang doesn't help me much.  Thanks!
I need to perform Diffs between Java strings. I would like to be able to rebuild a string using the original string and diff versions. Has anyone done this in Java? What library do you use?  String a1; // This can be a long text String a2; // ej. above text with spelling corrections String a3; // ej. above text with spelling corrections and an additional sentence  Diff diff = new Diff(); String differences_a1_a2 = Diff.getDifferences(a,changed_a); String differences_a2_a3 = Diff.getDifferences(a,changed_a);     String[] diffs = new String[]{a,differences_a1_a2,differences_a2_a3}; String new_a3 = Diff.build(diffs); a3.equals(new_a3); // this is true
Even though JRE 8 is installed on my MAC OS Yosemite, the error - " No Java Runtime present,requesting to install " I'm trying to prove that the rationals are not the countable intersection of open sets, but I still can't understand why   $$\bigcap_{n \in \mathbf{N}} \left\{\left(q - \frac 1n, q + \frac 1n\right) : q \in \mathbf{Q}\right\}$$   isn't a counter-example. Any ideas? Thanks! When changing fields, should I focus more on describing past research or connecting it to the new area in my statement of purpose? I want to change my field from molecular biophysics to theoretical ecology. While they are basically required some same basic background (physics, math, programming), the rest is quite irrelevant. In my current draft of this part, about a half is about this the problem and the result of the work, another half is for my contribution and what I've learnt. Having said that, should I focus less on describing the work and leave space for the thing that will be useful for the next research?  Below is copy from .     What have you already done? What problems have you solved, or at least worked on? What independent projects have you been part of? What were your key contributions? What did you learn? What did you teach the world? How do your results compare to what was already known? What original ideas are you most proud of? Be specific, technical, credible, and confident (but not arrogant). Refer the reader to your web page for more details. Have a web page with more details: preprints, project reports, source code, videos, etc. Why are we using the squared residuals instead of the absolute residuals in OLS estimation?  My idea was that we use the square of the error values, so that residuals below the fitted line (which are then negative), would still have to be able to be added up to the positive errors. Otherwise, we could have an error of 0 simply because a huge positive error could cancel with a huge negative error.  So why do we square it, instead of just taking the absolute value? Is that because of the extra penalty for higher errors (instead of 2 being 2 times the error of 1, it is 4 times the error of 1 when we square it). As a mod when should I vote to close content that is not flagged? Clarifying question on meaning of derivative of a linear transformation In my analysis class, my professor (and the textbook) reference the fact that $\mathbf{D}T(\bar{x}) = T$ for any $\bar{x} \in \mathbb{R}^n$ where $T \in \mathcal{L}(\mathbb{R}^n,\mathbb{R}^n) $. I'm wondering about the precise meaning of this statement. Is it that the differential of any linear transformation is also linear? Or is that the differential of any linear transformation is itself (and therefore also linear)? The second seems confusing to me because the derivative of a function is often not itself. For example, $f(x) = 2x$ is a linear transformation but $f'(x) = 2 \ne 2x$ for all $x \in \mathbb{R}$. Turning DisplayPort monitor off disables monitor completely I have 2 monitors connected to a NVIDIA GeForce GTX 660:   Left is 1920x1080 via DVI (Samsung SyncMaster 2443BW) Right is 2560x1440 via DisplayPort and is set to Primary (Samsung SyncMaster SA850)   I often leave my computer running overnight (working on long render job, doing backups, etc) so I only power off my monitors manually. However, if I power off the primary monitor, it is disabled completely as if it were unplugged from the graphics card (i.e. icons are moved, open apps are moved and resized to fit on the new primary monitor). If I switch from DP to a DVI cable, this does not occur. It seems to be an issue when using DisplayPort.  Is there a way to disable the monitor from being disabled completely in Windows when I power it off physically?   I have found no relevant settings in either Windows Display settings, nor the NVIDIA control panel software.  Edit #1: I'm using an .  Edit #2: Here is a screenshot of my NVIDIA Control Panel v7.2.710.0:   Edit #3: Here are screenshots of my Monitor configuration:    Clicking on Advanced settings reveals a Generic PnP monitor running at 59 Hz? 60 Hz is the only other option available.    Here is my secondary monitor which is connected via DVI:    Edit #4: If I open the "Screen Resolution" configuration panel and power the monitor off (via the power switch), this is what is shown:    It looks like I disconnected the monitor from the video card. While trying to create a custom business rule using Apex I got the error:  INVALID_ID_FIELD, SaveAsActivity is not allowed with whatId that is not supported as a task whatId.  ...and found out that it was caused by the method setSaveAsActivity on my code, that was like:  msg.setSaveAsActivity(true); // "msg" is a SingleEmailMessage   What am I doing wrong here? I've seen many variants of this problem online, but not quite the same as this, so I don't believe this is a duplicate.  The famous differential equation problem models a skydiver jumping out of a plane as  $$m \frac{dv}{dt} = -mg-cv$$ where m is the mass of the skydiver, g is acceleration due to gravity (9.81 m/s) and c is the coefficient of air resistance.  Here is my question:     Suppose the skydiver exits the stationary helicopter at an altitude of 2000m and opens the parachute at 500m. For this exercise, the parachute opens instantaneously. Suppose m= 70kgs, the coefficient of air resistance is c = 14 for a free falling body and c = 105 after the parachute opens. When does the skydiver open the parachute? When does the Skydiver hit the ground?   So my attempt at a solution kinda starts like this, but this is where I get stuck:  Let's assume that s(t) is the distance the body falls in time t from its initial point of release, then $v = \frac{ds}{dt}$ and $a = \frac{dv}{dt} = \frac{d^2s}{dt^2}$. Thus we have a second order differential equation: $m \frac{d^2s}{dt^2} = -mg-c\frac{ds}{dt}$. By simply manipulation, we get $m \frac{d^2s}{dt^2} + c\frac{ds}{dt} = mg$. I originally started thinking of finding the integrating factor, however, this seems more complicated and won't help produce the equation that I need.  Would anyone be able to help? Much thanks in advanced! Can I let my fake flash USB drive get its real capacity through low level format? Recently, I bought an USB flash drive which has a cool design.  The seller said it is 256GB however, I've already known that capacity would be fake. Anyway, I bought it cause of its cool design and want to use this USB flash drive anyway.  What should I do?  I've tried to find a proper tool(vid 1908 / pid 1320) but couldn't. Can I repair this through Low level format? Or partitioning this through Linux? Site choice dropdown cannot be shown on Android app Steps to reproduce:   Ask a question, open the "Ask on which site?" dropdown menu. Press the back button.   Issue: the menu will disappear and you can't bring it back by tapping the arrow or the field. Only typing text or selecting another field then tapping back will return the dropdown menu. Blender Cycles Bake Not Looking Like Object in Rendered View I have a couch in Blender that looks like this in rendered view.    I baked it with a combined texture and this is what it came out to be.    This is what it looks like added to the mesh.    Why does the view with the baked image not look exactly like the rendered view?  Does it have something to do with my mesh and faces?  This is my mesh.    This has never happened to me before as I baked a couple things before this which came out perfectly. What part of a multi-type damage roll is reduced by a non-type-specific effect? Effects like  (PHB, p. 54) and Spirit Shield (XGtE, p.  10) reduce damage by a roll, irrespective of damage  (PHB 196). However, single damage rolls can have multiple damage types, as confirmed (for wording) by Jeremy Crawford in .   How do you know which part of the damage is reduced?   This could actually make a difference to the amount of damage taken if, for example, the creature taking damage is resistant to one or more of the damage types involved.       Cutting Words: ... When a creature that you can see within 60 feet of you makes an attack roll, an ability check, or a damage roll, you can use your reaction to expend one of your uses of Bardic Inspiration, rolling a Bardic Inspiration die and subtracting the number rolled from the creature's roll.   Using this ability to expand upon the examples found in  and :     Barny, an Ice Devil (MM, p.  75) hits Bobby, rolling 9 slashing damage and 11 cold damage.      Bobby's ally, Vera, is a level 10 bard of the college of Lore, and uses her Cutting Words ability on the attack's damage roll. She rolls a 9, which is subtracted from the Barny's damage roll.      Bobby is wearing his Boots of the Winterlands (DMG, p.  156), giving him resistance to cold.   We know that "resistance and then vulnerability are applied after all other modifiers to damage" (PHB, p.  197) and both slashing damage and cold damage are treated as "one big damage roll" (see the JC tweet), so is all the 9 slashing damage removed by cutting words, and then the cold damage halved for 5 total damage, or is 9 of the cold damage removed by cutting words, leaving 2 to be halved for a total of 1 + 9 = 10 damage taken by Bobby?   Who makes this decision?  When an effect (like cutting words) reduces damage without specifying type from a source containing multiple damage types, what part of the damage is reduced? "NG NS" on ticket after airport security How to get icons in Safari favorites (aka favicons) to display correctly? I am using Safari on macOS Sierra. I have added several commonly-used sites to my favorites section, like so:    (there are 10 icons, and all but 2 of them are displayed as the proper, correct icon from the site. For example, the Wikipedia icon has the large W icon. However, for Google Drive and Gmail, the icons are just big, ugly, generic G's)  I would like for the two Google sites to correctly display their icons as well. At first, I thought it was because all 8 of the "correctly displayed" sites had successfully configured their "Safari settings" or something like that, while Google failed to do this (although this doesn't sound too plausible).  However, if I instead go to the top menu in Safari, click Bookmarks > Show Bookmarks, I get the following:    Strangely, this time, the two Google sites do have correctly displayed icons, while it is instead three other sites (out of the 10) that aren't displayed: namely Wikipedia, Amazon, and New York Times.  So it seems that there are two sets of icons, "big" and "small", and for big icons, Google Drive and Gmail are not displayed correctly, while the other 8 are, and on the other hand, for small icons, Google Drive and Gmail are displayed correctly, while Wikipedia, Amazon, and NYTimes are not.  I actually don't care too much about the small icons, but I would really like for all the big icons to display correctly. How can I do that? Association Reputation Bonus on preexisting sites Lost supplementary user groups for GUI login session Ubuntu 16.04.5  Very weird situation - after Xorg crash, now every time when I login into Unity, my user account doesn't have it's system groups like adm, sudo, plugdev, fuse etc. But when I login on virtual console (Alt+F1) or over SSH - all my additional groups are there, as reported by id command.  Neither of /etc/group* or /etc/gshadow* files have changed, my user is still listed there in many system groups.  It looks like some systemd session parameters for GUI logins or lightdm cache files got screwed. But I have no idea where to start looking..  A lightdm log:  $ journalctl -au lightdm  -- Reboot -- systemd[1]: Starting Light Display Manager... systemd[1]: Started Light Display Manager. lightdm[3223]: pam_kwallet5(lightdm-greeter:setcred): (null): pam_sm_setcred lightdm[3223]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0) lightdm[3345]: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "chm" lightdm[4867]: pam_ecryptfs: Passphrase file wrapped lightdm[3345]: pam_kwallet5(lightdm:auth): (null): pam_sm_authenticate lightdm[3345]: pam_kwallet5(lightdm:setcred): pam_kwallet5: pam_sm_setcred lightdm[3345]: pam_unix(lightdm:session): session opened for user chm by (uid=0) lightdm[3046]: Error writing to daemon: Bad file descriptor lightdm[3046]: Error writing to daemon: Bad file descriptor lightdm[3046]: Error writing to daemon: Bad file descriptor lightdm[3046]: Failed to write utmpx: Permission denied Intel Corporation Device [8086:0d4f] is not supported on Ubuntu 18.04.3 I am currently unable to install ubuntu server 18.04.03 LTS on the latest intel NUC10i7FNH.  Ubuntu always states both network adapters as unclaimed. The previous version (NUC8i7BEH) has the same network controller I219-V and worked like a charm.  *-network:0 UNCLAIMED      description:  Network controller      product: Intel Corporation      vendor: Intel Corporation      physical id: 14.3      ...   Without network it is not even possible to follow most suggestions how to get it enabled, because it is impossible to fetch new packages from internet.  Here are some more information as requested:  The output from: modprobe -v e1000e &amp;&amp; dmesg | grep e10   [ 3447.889394] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k [ 3447.889395] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.   The output from: sudo lspci -knn  00:1f.6 Ethernet controller [0200]: Intel Corporation Device [8086:0d4f]     Subsystem: Intel Corporation Device [8086:2081] 01:00.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 2C 2018] [8086:15e7] (rev 06)    For me this looks somehow, as the kernal driver would not be in use :-/  Here are a few more information i got from playiung around with 19.10 desktop version.  [    0.000000] Linux version 5.3.0-29-generic (buildd@lcy01-amd64-024) (gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2)) #31-Ubuntu SMP Fri Jan 17 17:27:26 UTC 2020 (Ubuntu 5.3.0-29.31-generic 5.3.13)   output from lshw:    *-network:0        Beschreibung: Kabellose Verbindung        Produkt: Intel Corporation        Hersteller: Intel Corporation        Physische ID: 14.3        Bus-Informationen: pci@0000:00:14.3        Logischer Name: wlp0s20f3        Version: 00        Seriennummer: c8:09:a8:9c:cd:e0        Breite: 64 bits        Takt: 33MHz        Fähigkeiten: pm msi pciexpress msix bus_master cap_list ethernet physical wireless        Konfiguration: broadcast=yes driver=iwlwifi driverversion=5.3.0-29-generic firmware=48.4fa0041f.0 ip=192.168.178.109 latency=0 link=yes multicast=yes wireless=IEEE 802.11        Ressourcen: iomemory:600-5ff irq:16 memory:6023114000-6023117fff   The output from: modprobe -v e1000e &amp;&amp; dmesg | grep e10  [    2.357430] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k [    2.357430] e1000e: Copyright(c) 1999 - 2015 Intel Corporation. [    2.357616] e1000e 0000:00:1f.6: Interrupt Throttling Rate (ints/sec) set to dynamic conservative mode [    2.562796] e1000e 0000:00:1f.6 0000:00:1f.6 (uninitialized): registered PHC clock [    2.634139] e1000e 0000:00:1f.6 eth0: (PCI Express:2.5GT/s:Width x1) 1c:69:7a:60:44:f0 [    2.634140] e1000e 0000:00:1f.6 eth0: Intel(R) PRO/1000 Network Connection [    2.634258] e1000e 0000:00:1f.6 eth0: MAC: 13, PHY: 12, PBA No: FFFFFF-0FF [    2.634991] e1000e 0000:00:1f.6 eno1: renamed from eth0 [    5.103285] checking generic (4000000000 e10000) vs hw (4000000000 10000000) [   15.806697] e1000e: eno1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None    output from lspci:  00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (10) I219-V [8086:0d4f]     DeviceName:  LAN     Subsystem: Intel Corporation Ethernet Connection (10) I219-V [8086:2081]     Kernel driver in use: e1000e     Kernel modules: e1000e java.sql.SQLException: Column count doesn't match value count at row 1 What is the term for the double consecutive use of a word with stress on one of the words to alter its severity? What is the term when a word is used consecutively twice, with intentional stress placed on the first word, as a means to alter the severity of the word's meaning?  I am not referring to a  (had had) or a  (that that), but to the slightly sarcastic use as demonstrated in shows like Seinfeld. Sample sentences, with emphasis:  I know we're going out to eat, but I am only going to pick at an appetizer because I'm not hungry hungry. Don't wear something so formal to the party; I don't think you need to be dressed dressed.  Of personal note, some of my relatives decided a few years ago to nick-name the term a &quot;Celaine&quot; (a combination of their names) due to their own frequent use of it. Note: This question explicitly requests the term of art used by linguists and English scholars when discussing this phenomenon. This question is different from a  which requests a historical explanation for the phenomenon described by this term. None of the answers to the suggested duplicate provide the term.  The author of the similar question requests the term for the pattern in a comment, but does not receive an acceptable answer. The only mention of an acceptable term is in a comment made by the author of this question, in response to the author of the similar question, directing back to this very question.