Have written and wrote. They mean the same thing?
Which is correct: "has died" or "died"?
How can I get textures on edge of walls like in Super Metroid and Aquaria? Games like Super Metroid and Aquaria present the terrain with the other facing parts having rocks and stuff while deeper behind them (i.e. underground) there's different detail or just black.      I would like to do something similar using polygons. Terrain is created in my current level as a set of overlapping square boxes. I'm not sure if this rendering method will work such a system for creating terrain but if anyone has ideas I'd love to hear them. Otherwise I'd like to know how I should re-write the terrain rendering system so it actually works to draw terrain in this manner... I have an issue with my Minecraft launcher - I downloaded modpack for minecraft then the launcher started an update for the modpack version which it's 1.6.2, however then I started to get the issue      [15:40:59 ERROR]: Gave up trying to download      for job 'Version &amp; Libraries'      [15:40:59 ERROR]: Job 'Version &amp; Libraries' finished with 26   failure(s)! (took 0:01:06.362)   At the same time I had just downloaded Avira antivirus and ran it, but unfortunately  removing it and trying again didn't help. I've tried to restore the system to the point before downloading the antvirus and the mod pack a 2 days ago, I've tried turning off the firewall and I have tried removing the whole .minecraft folder all with no luck at all. I can't figure it out, all the servers are working and I have good internet connection but some of the files download fine and other don't.  The full log is here:  [15:40:59 WARN]: Couldn't download https ://libraries.minecraft.net/net/sf/jopt-simple/jopt-simple/4.5/jopt-simple-4.5.jar for job 'Version &amp; Libraries' java.net.SocketTimeoutException: connect timed out         at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method) ~[?:1.7.0_45]         at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) ~[?:1.7.0_45]         at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) ~[?:1.7.0_45]         at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[?:1.7.0_45]         at java.net.PlainSocketImpl.connect(Unknown Source) ~[?:1.7.0_45]         at java.net.SocksSocketImpl.connect(Unknown Source) ~[?:1.7.0_45]         at java.net.Socket.connect(Unknown Source) ~[?:1.7.0_45]         at sun.security.ssl.SSLSocketImpl.connect(Unknown Source) ~[?:1.7.0_45]         at sun.net.NetworkClient.doConnect(Unknown Source) ~[?:1.7.0_45]         at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[?:1.7.0_45]         at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[?:1.7.0_45]         at sun.net.www.protocol.https.HttpsClient.&lt;init&gt;(Unknown Source) ~[?:1.7.0_45]         at sun.net.www.protocol.https.HttpsClient.New(Unknown Source) ~[?:1.7.0_45]         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source) ~[?:1.7.0_45]         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) ~[?:1.7.0_45]         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source) ~[?:1.7.0_45]         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) ~[?:1.7.0_45]         at java.net.HttpURLConnection.getResponseCode(Unknown Source) ~[?:1.7.0_45]         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source) ~[?:1.7.0_45]         at net.minecraft.launcher.updater.download.ChecksummedDownloadable.download(ChecksummedDownloadable.java:49) ~[launcher.jar:?]         at net.minecraft.launcher.updater.download.DownloadJob.popAndDownload(DownloadJob.java:108) [launcher.jar:?]         at net.minecraft.launcher.updater.download.DownloadJob.access$000(DownloadJob.java:12) [launcher.jar:?]         at net.minecraft.launcher.updater.download.DownloadJob$1.run(DownloadJob.java:89) [launcher.jar:?]         at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.7.0_45]         at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.7.0_45]         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.7.0_45]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.7.0_45]         at java.lang.Thread.run(Unknown Source) [?:1.7.0_45] [15:40:59 ERROR]: Gave up trying to download https ://libraries.minecraft.net/net/sf/jopt-simple/jopt-simple/4.5/jopt-simple-4.5.jar for job 'Version &amp; Libraries' [15:40:59 ERROR]: Job 'Version &amp; Libraries' finished with 26 failure(s)! (took 0:01:06.362) So, the question pretty much says it all. I'm on Snow Leopard, and I do a lot of web development, particularly in Rails 3 which makes heavy use of the console.  I've seen some notable bloggers etc. mention Zsh as their preference over Bash, but I don't know what difference it would make.  Could anyone give me a good comparison of what difference there is and what might make one prefer one option or the other? How can I recover from deleting the /usr/share/themes directory? Polygon intersection using turf js I have given this code for intersection: function intersectPolyByPolyFC(poly,fcPoly){         var fgp=[];//variable for feature group         var bbPoly=turf.bboxPolygon(turf.bbox(poly));//polygon representation of the bounding box of a reference polygon         for(var i=0;i&lt;fcPoly.features.length;i++){//loop through the feature collection of polygons             var bb=turf.bboxPolygon(turf.bbox(fcPoly.features[i]));//variable bb represents each polygon for feature collection             if(turf.intersect(bbPoly,bb)){//condition to check if the two bounding boxes intersect                 var int= turf.intersect(poly,fcPoly.features[i]);                 if(int){                     int.properties=fcPoly.features[i].properties;                     fgp.push(int);                 }             }         }         return turf.featureCollection(fgp);     }  and the function definition I have given as var bufline=turf.buffer(line,0.05,{units:&quot;kilometers&quot;}); var intBUOWL= intersectPolyByPolyFC(bufline, lyrBUOWL.toGeoJSON()); L.geoJSON(intBUOWL,{style:{color:'red',weight:5}}).addTo(mymap);  When I am drawing a line over a polygon for intersection I am getting this error Uncaught TypeError: Cannot read property 'map' of undefined     at Object.t.collect (turf.min.js:1)     at summarizePointsByLine (buffer.html:440)     at NewClass.&lt;anonymous&gt; (buffer.html:155)     at NewClass.fire (Events.js:190)     at NewClass._fireCreatedEvent (leaflet.draw.js:8)     at NewClass._fireCreatedEvent (leaflet.draw.js:8)     at NewClass.completeShape (leaflet.draw.js:8)     at HTMLAnchorElement.handler (DomEvent.js:92)  How can I resolve this error? Smoothing/interpolating across images in an ImageCollection to remove missing data I have some code that is working properly to calculate the monthly NDVI averages for the previous two years from a date but I sometimes have missing data in some of the months and I would like to get an average based on the mean of the previous two months. I suppose I could also interpolate from the closest geographic data point but it seems like it would be better to interpolate across time than distance given that sometimes the clouds cover reasonably large areas.   But I'm certainly open to other opinions, I just want to fill these holes as accurately as possible. Is there an efficient way to do this.  and here is the code itself:  // pick a landsat tile footprint to use as my geometry var wrs2_descending = ee.FeatureCollection('ft:1_RZgjlcqixp-L9hyS6NYGqLaKOlnhSC35AB5M5Ll'); // use a manually defined point to pick the WRS2 tile var wrs2_filtered = wrs2_descending.filterBounds(roi); var layer1 = ui.Map.Layer(wrs2_filtered, {}, 'WRS2 filtered'); Map.layers().set(1, layer1);  var imageCollection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR').filterBounds(wrs2_filtered); var monthCount = ee.List.sequence(0, 11);  // Function to cloud mask from the pixel_qa band of Landsat 8 SR data. function maskL8sr(image) {   // Bits 3 and 5 are cloud shadow and cloud, respectively.   var cloudShadowBitMask = 1 &lt;&lt; 3;   var cloudsBitMask = 1 &lt;&lt; 5;    // Get the pixel QA band.   var qa = image.select('pixel_qa');    // Both flags should be set to zero, indicating clear conditions.   var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)       .and(qa.bitwiseAnd(cloudsBitMask).eq(0));    // Return the masked image, scaled to reflectance, without the QA bands.   return image.updateMask(mask).divide(10000)       .select("B[0-9]*")       .copyProperties(image, ["system:time_start"]); }  // run through the image collection and generate monthly NDVI median images var composites = ee.ImageCollection.fromImages(monthCount.map(function(m) {   var startMonth = 1; // thinking that I should always start from Jan so the series are similar   var startYear = ee.Number(2017-1); // number is one year before the current one    var month = ee.Date.fromYMD(startYear, startMonth, 1).advance(m,'month').get('month');   var year = ee.Date.fromYMD(startYear, startMonth, 1).advance(m,'month').get('year')    // filter by year and then filter by month to get monthly mosaics   var filtered = imageCollection.filter(ee.Filter.calendarRange({     start: year.subtract(1), // we want an average of the last two years     end: year,     field: 'year'   })).filter(ee.Filter.calendarRange({     start: month,     field: 'month'   }));   // mask for clouds and then take the median   var composite = filtered.map(maskL8sr).median();   return composite.normalizedDifference(['B5', 'B4']).rename('NDVI')       .set('month', ee.Date.fromYMD(startYear, startMonth, 1).advance(m,'month')); })); print(composites);  Map.addLayer(composites, {min: 0, max: 1}, 'check');  // stack the ImageCollection into a multi-band raster for downloading var stackCollection = function(collection) {   // Create an initial image.   var first = ee.Image(collection.first()).select([]);    // Write a function that appends a band to an image.   var appendBands = function(image, previous) {     return ee.Image(previous).addBands(image);   };   return ee.Image(collection.iterate(appendBands, first)); }; var stacked = stackCollection(composites); print('stacked image', stacked);  // Display the first band of the stacked image. Map.addLayer(stacked.select(0).clip(wrs2_filtered), {min:0, max:1}, 'stacked'); If a product of relatively prime integers is an $n$th power, then each is an $n$th power Unable to log in to Stack Exchange How do I render a Twig template and load a CSS file from a controller? Is this considered a good practice for rendering a Twig template and loading a CSS file from a controller?   DefaultController.php  namespace Drupal\acme\Controller;  use Drupal\Core\Controller\ControllerBase; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Template\TwigEnvironment;  class DefaultController extends ControllerBase implements ContainerInjectionInterface  {   /**   * @var Drupal\Core\Template\TwigEnvironment   */   protected $twig;    public function __construct(TwigEnvironment $twig)   {     $this-&gt;twig = $twig;   }    public static function create(ContainerInterface $container)   {     return new static(       $container-&gt;get('twig')     );   }    /**    * hello    * @param  string $name    * @return string    */   public function hello($name)    {      $template = $this-&gt;twig-&gt;loadTemplate(       drupal_get_path('module', 'acme') . '/templates/hello.html.twig'     );      $markup = [       '#markup' =&gt; $template-&gt;render([ 'name' =&gt; $name ]),       '#attached' =&gt; [ 'css' =&gt; [           drupal_get_path('module', 'acme') . '/assets/css/acme.css'         ]       ]     ];      return drupal_render($markup);   } }   acme.routing.yml  acme_hello:   path: '/acme/hello/{name}'   defaults:     _content: '\Drupal\acme\Controller\DefaultController::hello'     _title: 'acme Title'   requirements:     _permission: 'access content'   hello.html.twig  &lt;div class="acme-hello-text"&gt;   &lt;h1&gt;Hello {{ name }}!&lt;/h1&gt; &lt;/div&gt; Named parameters in JDBC Highest quality website screenshot? I have created a  that i would like to add to my portfolio, but i'm having a hard time getting high quality screenshots of the full site. I tried to save the website as PDF, but that was full of errors, other online services cant recreate the images and so on. I've also just tried to take regular screenshots on the mac at put it all together, but it really lost a lot of quality when i scaled it down.  Any good ideas? :) What does "cpu MHz" field mean in the /proc/cpuinfo of a hyper-threading cpu? The CPU is a i7-3770@3.40GHz. It has 4 cores and each core has 2 threads. Here is the dmidecode output:  # dmidecode -t 4 # dmidecode 2.9 SMBIOS 2.7 present.  Handle 0x0042, DMI type 4, 42 bytes Processor Information     Socket Designation: SOCKET 0     Type: Central Processor     Family: &lt;OUT OF SPEC&gt;     Manufacturer: Intel(R) Corporation     ID: A9 06 03 00 FF FB EB BF     Version: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz     Voltage: 1.1 V     External Clock: 100 MHz     Max Speed: 3800 MHz     Current Speed: 3400 MHz     Status: Populated, Enabled     Upgrade: &lt;OUT OF SPEC&gt;     L1 Cache Handle: 0x003F     L2 Cache Handle: 0x003E     L3 Cache Handle: 0x0040     Serial Number: Not Specified     Asset Tag: Fill By OEM     Part Number: Fill By OEM     Core Count: 4     Core Enabled: 4     Thread Count: 8     Characteristics:         64-bit capable   It will be 8 logic core in a system, like what shows in /proc/cpuinfo. But can any one tell why the cpu MHz of a core is 1600MHz? I guess there is 2 threads in a core, so a hw thread freq may be about the half of the core's? How this number is calculated?  processor   : 7 vendor_id   : GenuineIntel cpu family  : 6 model       : 58 model name  : Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz stepping    : 9 cpu MHz     : 1600.000 cache size  : 8192 KB physical id : 0 siblings    : 8 core id     : 3 cpu cores   : 4 apicid      : 7 initial apicid  : 7 fpu     : yes fpu_exception   : yes cpuid level : 13 wp      : yes flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat tpr_shadow vnmi flexpriority ept vpid bogomips    : 7013.49 clflush size    : 64 cache_alignment : 64 address sizes   : 36 bits physical, 48 bits virtual power management:   Also, here is the output of lshw and lscpu command. There are also 1600MHz mentioned.   lshw info:  #lshw -class processor   *-cpu                           description: CPU        product: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz        vendor: Intel Corp.        physical id: 42        bus info: cpu@0        version: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz        slot: SOCKET 0        size: 1600MHz        capacity: 3800MHz        width: 64 bits        clock: 100MHz        capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp x86-64 constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat tpr_shadow vnmi flexpriority ept vpid cpufreq   lscpu info:  #lscpu Architecture:          x86_64 CPU op-mode(s):        32-bit, 64-bit CPU(s):                8 Thread(s) per core:    2 Core(s) per socket:    4 CPU socket(s):         1 NUMA node(s):          1 Vendor ID:             GenuineIntel CPU family:            6 Model:                 58 Stepping:              9 CPU MHz:               1600.000 Virtualization:        VT-x L1d cache:             32K L1i cache:             32K L2 cache:              256K L3 cache:              8192K Schrödinger Equation for Two Electrons? I'm having trouble finding a simple answer to this question (maybe because there isn't one), but I'm just confused about how the Schrödinger Equation would look for two electrons. I understand that it would exist in 6 dimensional configuration space, but how does the potential look? It's confusing that the potential would be different for each electron depending on where the other one is. Why is python ordering my dictionary like so? Here is the dictionary I have  propertyList = {     "id":           "int",     "name":         "char(40)",      "team":         "int",     "realOwner":    "int",      "x":            "int",     "y":            "int",      "description":  "char(255)",      "port":         "bool",     "secret":       "bool",     "dead":         "bool",     "nomadic":      "bool",      "population":   "int",     "slaves":       "int", }   But when I print it out with "\n".join(myDict) I get this  name nomadic dead port realOwner secret slaves team y x population id description   I know that a dictionary is unordered but it comes out the same every time and I've no idea why. How to run sudo command with no password? How does the ubuntu user on the AWS images for Ubuntu Server 12.04 have passwordless sudo for all commands when there is no configuration for it in /etc/sudoers?  I'm using Ubuntu server 12.04 on Amazon. I want to add a new user that has the same behavior as the default Ubuntu user. Specifically I want passwordless sudo for this new user.   So I've added a new user and went to edit /etc/sudoers (using visudo of course). From reading that file it seemed like the default ubuntu user was getting it's passwordless sudo from being a member of the admin group. So I added my new user to that. Which didn't work. Then I tried adding the NOPASSWD directive to sudoers. Which also didn't work.   Anyway, now I'm just curious. How does the ubuntu user get passwordless privileges if they aren't defined in /etc/sudoers. What is the mechanism that allows this? Integral representation $B_T^3$ I have to find a $F_t$ such that $B_T^3=E[B_T^3]+\int_0^T F_t dB_t$. I have shown by ito formula that $B_T^3=\int_0^T 3 B_s^2 dB_s+\int_0^T 3 B_s ds$. Could you please help me? Can I travel after visa's intended travel date? I just finished applying for my visa and had originally planned to travel on the 30th of September, so I put that as my intended date of travel. But now I will not be leaving until close to the second week of October.  How does this work, will I still be able to travel with this visa even though it says I intended to arrive on September 30th? How do I start DMing a new game after the Red Box? Inherited values between polygons in QGIS In this project, I have three polygons, see the image below  'Polygons_From', includes input attributes, i.g. &quot;Value_1&quot;, &quot;Value_2&quot;, &quot;Value_3&quot;, and $area for each quadrate (on the image there are two types of them). 'Polygons_To' polygons for which new values &quot;Value_1_new&quot;, &quot;Value_2_new&quot;, &quot;Value_3_new&quot; need to be defined 'Border' defines an area where the calculation should be done.   My task is to transfer values from 'Polygons_From' into 'Polygons_To' based on a certain aspect/ratio. Of course, I can simply achieve it with the 'Union' function as was suggested in . It uses $area-factor, but perhaps there are better approaches that will lead me to a much more efficient output? So, I am asking for a recommendation regarding the technique/workflow that can be applied in QGIS 2.18. Shall I consider only $area or there are some other criteria? Moreover, I looking forward to finding some papers that may improve my general understanding of the methodology.  References: Probability question with interarrival times (Why did the chicken cross the road?) A chicken wants to cross a single-lane road where the cars arrive according to a Poisson process with rate $\lambda$. She needs at least $k$ minutes to cross the road safely, so she will have to wait until she sees a gap of at least $k$ between the oncoming cars. If the gap between the car that just arrived and the next one is at least $k$ then she starts crossing the road immediately. Let $T$ denote the random time she needs to wait by the road.  Find the expected time needed to cross the road.