I am really struggling with migrating a custom plugin from QGIS 2.x to 3.x. Below is a code snippet that seems very straightforward, but I can't find documentation that I understand for setSourceCrs().    # First, make sure the point is not within a half meter of the start   # or end points.   da = QgsDistanceArea()    # Function call in API 2.x   # da.setSourceCrs(lyrDb.lyr.crs().srsid())    # My attempt is missing the second argument   da.setSourceCrs(lyrDb.lyr.sourceCrs())    line = parent.geometry().asPolyline()   n = len(line)   d = da.measureLine(line[0], p1)   if d < 0.5:     return 0   d = da.measureLine(line[n - 1], p1)   if d < 0.5:     return 0   As you can see, previously the only argument required for the function was an integer for SRID. The new API wants two arguments as shown below, but very little explanation. Taken from   void QgsDistanceArea::setSourceCrs (const QgsCoordinateReferenceSystem & crs, const QgsCoordinateTransformContext & context)       I think I have the first argument correct, but I have no idea about the second. What do I need to send for the context argument?   Are there any other sources for documentation for the API?  This solution worked for me. It essentially passes an empty parameter into context, but that's okay because I'm not doing a transformation. I tested and it works as expected.    # First, make sure the point is not within a half meter of the start   # or end points.   da = QgsDistanceArea()   context = QgsCoordinateTransformContext()   da.setSourceCrs(lyrDb.lyr.crs(), context)   line = parent.geometry().asPolyline()   n = len(line)   d = da.measureLine(line[0], p1)   if d < 0.5:     return -1   d = da.measureLine(line[n - 1], p1)   if d < 0.5:     return -1   For the record, though it helped, my question was not solved by , nor is it a duplicate IMO.  That question was specifically concerned with calculating an ellipsoidal area which requires a transformation. The code that I am migrating concerns only a projected layer, which does not involve a transformation.  I came here after spending hours searching for an answer, and in my opinion it is because the documentation for pyQGIS API is sparse at best. However, I fully admit that the post above helped me figure out my solution, assuming it is a solution. It appears to work, and that is all I can say. Surely, there must be a proper way to call setSourceCrs when no transformation is required.  That said, I am happy so feel free to do whatever is appropriate with this question. This is my first foray into StackExchange, and I'm not familiar with protocol.

I'd like to loop though each feature in a layer and calculate its ellipsoidal area using QgsDistanceArea() in PyQGIS 3.  Everything works fine on unprojected layers, but I get strange results when input layer is in projected CRS.  So far I have written this:  from qgis.core import *  def calculate_area(in_lyr_name, ellipsoid, units):     input_layer = QgsProject.instance().mapLayersByName(input_lyr_name)[0]      area = QgsDistanceArea()     area.setEllipsoid(ellipsoid)      features = input_layer.getFeatures()     feature_area = 0     error_features_counter = 0      for i, feat in enumerate(features):         geom = feat.geometry()         polygon_area = 0         try:             if geom.isMultipart():                 polygons = geom.asMultiPolygon()                 for polygon in polygons:                     polygon_area += area.measurePolygon(polygon[0])             else:                 polygon = geom.asPolygon()                 polygon_area = area.measurePolygon(polygon[0])              feature_area += polygon_area          except AttributeError:  # catches NoneType geometries (broken etc.)             error_features_counter += 1             pass      # calculated area is in sq. metres (see the "else" case)     if units == 'km²':         final_area = feature_area / 1e6     elif units == 'Ha':         final_area = feature_area / 10000     else:         final_area = feature_area     return final area, error_features_counter   How do I get a constant result that does not depend on the presence of projection?


I don't know where to start. can anyone help me please ?  if $x^2+ax+b=0$ has an integer root, show that it divides b

Could someone please explain me how to apply the Descartes's Criterion? For example , how do I find the rational roots of $ x^3 -x +1$.  I've been looking at some examples, but I get confused.


So I'm really new to this code thing. And i would like to know, how to automatically run commands when command prompt is open. So, what i usually do to run my application is that i open command prompt, the i go >cd desktop then >cd myapp, and then >node atv.js. But i have to do this everytime i need to run my application. Is there any simple way? or is there any way that in order to run those commands i just click on specific icon or folder. Thank you.

Just discovered doskey emacs=emacs -nw $*, but without something like .bashrc, I'll have to type that every time I start a shell, right?


I was studying friction and got that  is directly proportional to the normal reaction and hence:    $\text{Force of kinetic friction=coefficient of kinetic friction $\times$ normal reaction}$.    I don't see speed anywhere. If kinetic friction has no relation with speed then why fast running racing car's tyre abrade too early than normal cars??

Does the force of kinetic friction increase with the relative speed of the objects involved?    I have heard and read that the answer is no.  This is counter intuitive, and is a big part of why the "Airplane on a Treadmill" question is so interesting.  What phenomena are at work with kinetic friction, and why does it not increase with relative speed?


Recently, I updated my ubuntu, and when restarting my computer, I noticed that my wi-fi was not working. I entered to my settings menu, I found no wifi adapter found. I encountered before this problem and corrected it. When typing the command uname -r I noticed that my kernel was upgraded to 5.3.0-28-generic. when typing lspci -knn | grep Net -A3; rfkill list I get this :  02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter [10ec:c821]     Subsystem: Lenovo RTL8821CE 802.11ac PCIe Wireless Network Adapter [17aa:c024]     Kernel modules: wl 0: ideapad_wlan: Wireless LAN     Soft blocked: no     Hard blocked: no 1: ideapad_bluetooth: Bluetooth     Soft blocked: yes     Hard blocked: no 2: hci0: Bluetooth     Soft blocked: yes     Hard blocked: no   How could I possibly correct this?

We just bought a Lenovo  (which is supposed to have the Intel 8265 for wireless). This laptop was bought in part because it is certified to run Ubuntu and as such to me at least it would make sense for things to work out of the box... but no such luck.  First, I installed Ubuntu 17.10 and after installation realised Wi-Fi was not working. I also tried Ubuntu 16.04 from a USB drive since that is the version of Ubuntu it is certified for, but no luck there either.  The wireless chip is not detected by lshw (or even lspci by the looks of it), ip link does not show a wireless interface, and the iwlwifi kernel module is not loaded at boot (I can load this myself using modprobe iwlwifi but this does not make Wi-Fi work). I think it is a combined Wi-Fi/Bluetooth chip, and Bluetooth does appear to work (or at least Bluetooth shows up in Gnome and rfkill list).  modinfo iwlwifi | grep 8265 shows me a file ending in -34 is supposedly loaded but only a file ending in -33 (and some other lower numbers) is present in /lib/firmware, if that helps).  I have also installed the Linux 4.14.9 kernel in an attempt to get things to work, but this did not resolve the issue either.  Further information  root@ThinkPad-E570:~# modinfo iwlwifi | grep 8265 firmware:       iwlwifi-8265-34.ucode root@ThinkPad-E570:~# rfkill list all 0: tpacpi_bluetooth_sw: Bluetooth     Soft blocked: no     Hard blocked: no 1: hci0: Bluetooth     Soft blocked: no     Hard blocked: no root@ThinkPad-E570:~# dmesg | grep iwl root@ThinkPad-E570:~# lspci -nnk | grep 0280 -A3 05:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:c821]     Subsystem: Lenovo Device [17aa:c024]   Update  I just noticed that the laptop does not have an Intel wireless chip at all, but in fact has a Realtek one... which means that the  of the shop I bought this laptop at were not accurate... Sigh. Same problem stands, however, just with a crappier wireless chip.


Example: Google's Outstanding Shares are 670,000,000 and this value is collected in a txt file from Yahoo Finance API using the below script.   The issue is; that numbers WITH commas or spaces are near impossible for the text wizard and Excel to delimit when I pull this txt file into Excel to complete my work.  Ie the delimiter wants to break 670,000,000 into three separate values AND spread this across three columns which is a joke and renders my work futile.  Thus: I need the prospective script to bring all numerical strings that originally contained commas and spaces back to the txt file WITHOUT such. Ie no commas or no spaces.  So rather than 670,000,000 being brought into the txt file, I need 670000000 so that Excels antiquated delimiter may render the data into columns properly.  I have asked this question 4 times on here and each time the code provided by the super user has not worked.  cd desktop/quoteUpdate while true do   curl -o quotes.txt -s "http://download.finance.yahoo.com/d/quotes.csv?s=goog,aapl&f=nsl1j2" echo UPDATED: date sleep 10 Done

The below script is not working.   cd desktop/quoteUpdate while true do  curl-o quotes.txt -s "http://download.finance.yahoo.com/d/quotes.csv?s=goog,aapl&f=sl1"  sed -i '.bak' 's/,/ /g' quotes.txt echo UPDATED: date sleep 10 done   When I try and run the executable I get this error and no txt file is created in my desktop folder.  UPDATED: Wed 14 Jan 2015 15:33:30 GMT      /Users/chrisdorman/Desktop/quoteUpdate/runNow: line 4: curl-o: command not found     sed: quotes.txt: No such file or directory


Could someone help me with this sentence:  - If you are a well-organised person, you (manage - will manage) your time.  Thank you all.

I had a test today and there was this question : If you are a well-organized person, you .... your time.   a) will manage b) manage   I'd like to know the answer and why?   Thanks in advance.


I am having a very weird issue with Blender. I have created a model of a mansion, with each face on the roof being a flat, solid object. However, when I import the model into Unity, the outer faces of the roof are missing.  I have tried subdividing and triangulating the mesh as other posts have recommended. However, the faces are still not showing in Unity.  Any help would be greatly appreciated.

I have modeled a simple pocket watch in Blender. Every time I import it into Unity3D, regardless of whether I export it from Blender as an FBX or 3ds file, it always comes out missing faces! Why is this happening? I have never had problems importing models into Unity3D like this before.  Blender Screenshot    Unity Screenshots     It seems to me that different faces appear when I rotate it differently. How can I prevent this? Thanks!


If I use film from the 1980s that was put into the freezer ever since it was bought by my great grandfather, will it still work?

I recently bought a Minolta film camera and it had some film with it. The film is dated 1991 - 1994. Can I use the film?


I'm trying to parse CSV files in Rails, which works great except for anything saved in Excel (testing with Version 16.26) for both Windows and Mac (CSVs saved in Numbers & Google sheets work fine). Any character with an accent produces "Encoding::UndefinedConversionError: "\xEF" from ASCII-8BIT to UTF-8".  Excel claims it saves in UTF-8.  I want accented characters to not throw errors when I upload CSVs saved in Excel.  Things I've tried:   setting the read encoding to bom|utf-8 (as per the ), utf-8, iso-8859-1, utf-16, windows-1252, ascii-8bit (and cycling through each of these in an array incase one fails then dropping it out of the array) current code uses ISO8859-1:UTF-8 which is supposed to read in ISO8859-1 then encode in UTF-8 Creating a tempfile, converting it to binmode, CSV.parse(temp.path,  encoding: "bom|utf-8") per .   data = CSV.parse(csv, headers: true, header_converters: :symbol, skip_blanks: true, encoding: 'ISO8859-1:UTF-8')   It also works if I take a csv saved in Excel, then save it in google sheets or Numbers then upload it. Unfortunately, Excel is the most common CSV uploaded by our users.

I'm consuming a data feed that has recently added a Unicode BOM header (U+FEFF), and my rake task is now messed up by it.  I can skip the first 3 bytes with file.gets[3..-1] but is there a more elegant way to read files in Ruby which can handle this correctly, whether a BOM is present or not?


I’m wondering what kind of security measures may be in place or which I could enable in GNU/Linux (Debian specifically) to mitigate the risk of USB-based attacks. I understand that USB sticks which are ostensibly storage mediums may actually behave as input devices when plugged in.  They could pretend to be keyboard/mice and carry out malicious acts.  I don’t recall my OS ever asking permission for my keyboard to type keys nor for my mouse to behave as a pointing device when I’ve plugged either in, so I suppose I must be vulnerable to such attacks. Is there a way for me to make the OS more cautious about the devices I plug in?  I’d like to not be “tricked” by a bad USB, or even by a once-good-USB-turned-bad (I’ve heard USBs could be “infected” if plugged into a computer with a virus). In my search I’ve only seen solutions that involve disabling auto-opening a file browser when storage mediums are inserted.  I’m not concerned about that.

When inserting a USB stick or device to computer, there is always the risk that the device is malicious, will act as an HID and potentially do some damage on the computer. How can I prevent this problem? Is disabling HID on specific USB port sufficient? How do I do that?


I was trying to execute the below on my linux terminal and it was working fine by creating the backup of the source file at a given location + a log file was getting created with timestamp to the name of the log file.  rsync -av --delete /home/root/Desktop/Test/ /home/root/auto_backups/My_Programs/ /home/root/auto_backups/My_Programs/zz_crontab_logs/`date +\%F_%H-%M-%S-%N`-test1.log   But when I am running the same as a crontab as given below the I am not getting any output at all. Neither the backup of the source file nor the log file.  30 11,22 * * * rsync -av --delete /home/root/Desktop/Test/ /home/root/auto_backups/My_Programs/ /home/root/auto_backups/My_Programs/zz_crontab_logs/`date +\%F_%H-%M-%S-%N`-test1.log   and if i am just trying below command in cron with out the creating the log file it working fine.  30 11,22 * * * rsync -av --delete /home/root/Desktop/Test/ /home/root/auto_backups/My_Programs/   Can some one help on this please.

This is a  about using cron & crontab.   You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question.  The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below.  This addresses the cron system with the crontab highlighted.


"There is a strange smell here. Have you been cooking something?" Is something correct here? As far as I know we must use any in negative and interrogative sentences...

Is there any difference between "Is there something wrong?" and "Is there anything wrong?"? Also, you would say "He would like something to drink" but "Would you like anything to drink?", right? I'd appreciate if any one could explain the usage of "something" and "anything".


My upcoming travel plans include applying for a multi entry Schengen visa to visit Europe (France, Italy, Hungary and Belgium). However in between this trip, I also plan to visit Croatia, Bosnia and Herzegovina and Montenegro. As per the visa rules for these 3 countries that I read online, I found that merely possessing a multiple entry Schengen visa (with an active entry remaining) for these 3 countries is enough for being eligible to get a visa on arrival for these 3 countries.   However, having recently gone through this article ()  which gives the example of Serbia (having the same rules as the other 3 countries of visa on arrival for multi entry Schengen holders), I am in doubt.  It would be great if someone could confirm that my plan is okay and I can enter Croatia, Bosnia and Montenegro on a multiple entry Schengen visa.

There are countries in the Balkan area that allow entry if you have a Schengen visa but am not able find a definite list of all those countries. Knowing that will save me getting a visa for all those countries when I do my mega Euro trip.


I want to create a program in Java/Spring that listens always a directory. If a particular called for example "example.txt" is created in this directory then the program reads it and do some stuff and then continues listening. If this txt file is not created then nothing happens and it continues listening. Any idea about how can I create this listener part? Thank you so much for your help

I'd like to be notified when a file has been changed in the file system. I have found nothing but a thread that polls the lastModified File property and clearly this solution is not optimal.


How does awaken works in battle? What if i have a 4/4 elemental creature that is still a land, got beaten by a 5/5 creature, will i lose the tokens or my land?   I also tried to find more information about this but couldnt find the battling system somewhere

Some lands have an ability to become a creature, but they usually say they are still a land. If a land is a 3/3 creature and a land, can you target and kill it with a  to send it to the graveyard, or does it remain in play as a land?


I came across an exercise in which we are asked to prove the identity:  $${2n\choose n}=\sum_{k=0}^n{n\choose k}^2$$  The exercise gives the hint:  $$\left(1+x\right)^{2n}=\left[(1+x)^n\right]^2$$  It's not too difficult to use the hint to prove the identity (the expressions in the identity are the coefficients of $x^n$ in the respective expansions of the expressions in the hint, which of course must be the same number), but I was wondering whether there is a neater equivalent-counting interpretation...  It's clear that ${2n \choose n}$ is the number of ways in which we can choose half the elements in a set (where this is possible): how can we interpret $\sum_{k=0}^n{n\choose k}^2$ equivalently?

I was hoping to find a more "mathematical" proof, instead of proving logically $\displaystyle \sum_{k = 0}^n {n \choose k}^2= {2n \choose n}$.  I already know the logical Proof:  $${n \choose k}^2 = {n \choose k}{ n \choose n-k}$$  Hence summation can be expressed as:  $$\binom{n}{0}\binom{n}{n} + \binom{n}{1}\binom{n}{n-1} + \cdots + \binom{n}{n}\binom{n}{0}$$  One can think of it as choosing $n$ people from a group of $2n$  (imagine dividing a group of $2n$ into $2$ groups of $n$ people each. I can get $k$ people from group $1$ and another $n-k$ people from group $2$. We do this from $k = 0$ to $n$.


is possible remove self vote to an answer without give point or remove?  I'm explain better the question, for example I give to an answer +1 and the user take 10 point, but then i want to remove it if i press -1 the user loss 2 point and i have value of answer 0, finally him take 8 point, i want remove my vote like that i don't give him point, this is possible?

If I vote up a post, the vote score will increase from 0 to 1. But then I might change my mind or repent  my actions and wish to take back that vote.  If I vote it down, the score will be minus instead of zero.  How do I undo my vote so that the score will come back down to zero instead of showing the minus 1?


This question is from Ponnusamy and Silvermann's complex variables with applications Ch- 12 , subsection Infinite products.  Question: prove that $\prod_{n=2}^{\infty} \frac{n^3+1}{n^3-1}=2/3$.  I factored numerator and denominator to $\frac{(n-1) \times n^2+n+1 } { (n+1) \times n^2 -n+1}$ . But I think it's not possible to cancel denominantor and numerator in a way to get a pattren of cancelling due to factors $n^2-n+1$ and $n^2+n+1$ . So, I am struck on how should this be approached and unable to find any idea. Kindly guide on how this should be approached. Thanks!

Find value of   $${{7}\over {9}}\times {{26}\over {28}}\times {{63}\over {65}}\times \dots \infty$$    I can see that the terms take the form $${{n^{3}-1}\over {n^{3}+1}}\ \ \text{for} \ \ n=2,3, \dots$$ How to prove that the product converges?


I'm looking for a Mathematical software that can do the following:  I put in a metric (some kind of a two-dimensional matrix), and the software calculates Christoffel symbols, Ricci curvatures, Paneitz operators, etc.  What software should I use? Can I do this somewhere online?

I would like to use an open source computer algebra system (CAS) for research in general relativity. Kindly suggest a good choice between Ipython and Sage. I am more interested in the theoretical aspect rather than numerical computations.


In OpenLayers v5, if I have a view defined like this:  var view = new View({     center: [952014.59, 5571269.68],     zoom: 8 });   , trying to get its resolution doing view.getResolution() outputs 611.49622628141.  How should I interpret this number?  Here is my problem: I am trying to figure out if the resolution of the view is greater/smaller than that found parsing the MaxScaleDenominator and MinScaleDenominator of . They are 500000 and 0 respectively for each layer.  However, the numbers from OL and the WMS seem to be in different units, and frankly I understand the ones coming from the WMS but not those coming from OL.  Can anybody help me understanding how should I handle this, in order to make these numbers comparable?  EDIT1  The main problem is that  seems to output values which are always the same regardless of the latitude.  Consider my output: 611.49622628141.  If you look at the equation presented at , the pixel scale (Spx) can be obtained by:  Spx = C * cos(latitude) / 2 ^ (zoomlevel + 8)   , where C is the equatorial circumference of the Earth (equal to 40075016.686 m). My zoomlevel is 8 and the latitude assumed by OL seems always 0 (equator). Indeed, if you do the calculations, you'll obtain eaxctly 611.49622628141.  So I guess that I should not trust the output from view.getResolution() to make my comparison, am I wrong? If I am not, this would be a good reason not to close this question, as it has very much to do with this specific method.  EDIT2  By the way, as far as I understand, following  in the duplicated question linked (making adjustment as per last comment (cm to m missing conversion), I am finally able to calculate the scale I needed from the view.getResolution() output, but the doubts I had (see EDIT1) still remain unsoved.  My calculation led me to:  map scale =      pixel resolution (as per view.getResolution()) / screen distance per pixel (in meters) =   611,49622628141 /   0,00028 =     2183915   , so approximately 1:2 millions.  My doubt if .getResolution() output is accurate for any projection/latitude/(map size?) still is there...


In terminal I ran:  defaults write com.apple.finder AppleShowAllFiles TRUE  and   killall Finder  If I CMD + SHIFT + G  /usr/local/.git I can see the folder.    However, if I CMD + SHIFT + G and go to /usr/local I cannot see the folder.

I noticed that whenever I add files and delete them, their physical space remains on the disk drive. I uninstalled NTFS Tuxera and I still have the same problem.  So I had to insert the disk under my other Windows laptop to locate the ./#### files and delete them. I was surprised that I couldn't locate those files in Finder, but windows allowed me to view them.  Is there a way to have more control over what files are viewed in Finder?  Platform: retina MacBook Pro, Mountain Lion (OS X 10.8)


I created this script:  code fn() {   sleep 1001 }  fn & sleep 1000 echo "finish"   When I  runt it and list processes (it's pid is 11570):  $ ps xao pid,ppid,pgid,command | grep 11570 |grep -v grep  11570 24322 11570 /bin/bash ./bash.sh 11577 11570 11570 /bin/bash ./bash.sh 11578 11570 11570 sleep 1000 11579 11577 11570 sleep 1001   then I'm killing it with ctrl+c and same ps returns:  11577     1 11570 /bin/bash ./bash.sh 11579 11577 11570 sleep 1001   Then:  kill -INT 11579    And nothing happnes (still same processes in bg)  I know that ctrl+c is same as killing it by:  kill -INT -11570    The same happens (same two processes are still in background). Then - in next run - I killed processes within group one by one and found that the only one which cares is sleep which is not in function.  I thought then that main process finishes then and that's why it finishes. But then 'finish' should be printed. (as it is when I interrupt just this sleep)  And now the questions are:  Why is only one sleep answering to interruption signal?  How to make this script cleanup processes in backgound on interruption?

I am looking for a way to clean up the mess when my top-level script exits.  Especially if I want to use set -e, I wish the background process would die when the script exits.


As you may know, scikit-learn library utilizes singular value decomposition (SVD) of data matrix X to produce eigenvectors for PCA. I decided to code PCA by using eigenvalue-decomposition of covariance matrix A. Then, I compared the eigenvectors that both ones come up with. All numerical values are correct, but some of the values in eigenvectors are positive in sklearn library, but negative in my PCA or vice versa. To highlight the phrase opposite directions, I give an example of eigenvectors computed by SVD and Eigen-decomposition: Eigen-decomposition: [-8.11734515e-06  3.29264421e-03  1.57754708e-04  2.77006684e-05                        -9.99994324e-01 -6.40764448e-04  2.05179008e-04 -1.76522227e-04] SVD:                 [ 8.11734515e-06 -3.29264421e-03 -1.57754708e-04 -2.77006684e-05                         9.99994324e-01  6.40764448e-04 -2.05179008e-04  1.76522227e-04]  I could not figure out the reason for this. Is there anyone who knows what it is happening?

I have 10 years of daily returns data for 28 different currencies. I wish to extract the first principal component, but rather than operate PCA on the whole 10 years, I want to rollapply a 2 year window, because the currencies' behaviours evolve and so I wish to reflect this. However I have a major problem, that is that both the princomp() and prcomp() functions will often jump from positive to negative loadings in adjacent PCA analyses (ie 1 day apart). Have a look at the loading chart for the EUR currency:    Clearly I can't use this because adjacent loadings will jump from positive to negative, so my series which uses them will be erroneous. Now take a look at the absolute value of the EUR currency loading:    The problem is of course that I still cannot use this because you can see from the top chart that the loading does go from negative to positive and back at times, a characteristic which I need to preserve.   Is there any way I can get around this problem? Can I force the eigenvector orientation to always be the same in adjacent PCAs?   By the way this problem also occurs with the FactoMineR PCA() function. The code for the rollapply is here:  rollapply(retmat, windowl, function(x) summary(princomp(x))$loadings[, 1], by.column = FALSE, align = "right") -> princomproll


Can someone please differentiate logistic regression vs linear regression? I know that logistic regression is discrete (1, 0) and Linear regression is continuous. Could you provide two examples that set the two apart? Im just really confused on when to use which.

What is the difference between linear regression and logistic regression?  When would you use each?


I've just bought a notebook Lenovo B590 with Windows 8 preinstalled. I tried the Live version of Ubuntu 14.04. The WiFi wasn't working, but I went on Additional Driver and I selected "Using Broadcom 802.11 Linux STA wireless driver source from bcwl-kernel-source (proprietary)" and it worked correctly. Then I installed Ubuntu 14.04, without partitions, I hadn't even activated Windows 8, and the WiFi wasn't working. I went on Additional Driver (this time in the Italian version) and I selected the same driver as before. Ubuntu asked me the password and at the end of the "applying changes" it deselected the Broadcom driver and automatically re-selected "Do not use the device". The Live version still works. Maybe are there any packages downloaded during the installation that do not work correctly with the Broadcom driver? Can you help me, please?

I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible.   What are the steps to install Broadcom wireless drivers for a BCM43xx card?  I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc.    lspci -vnn | grep Network showed:   Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b]      iwconfig showed:  lo        no wireless extensions. eth0      no wireless extensions.   NOTE: Answer below is updated every time new information is added and confirmed working.


Context:  I was looking at  Then I started thinking: if $0.999999... = 1$, then $0.000..001 = 1/1000...000 = 0$. Then if we multiply both side by $1000...000$, we will have $1 = 0$? To rephrase it in a slightly more formal way as below. Suppose we multiply both sides of the equality $$\lim_{n\to\infty}\frac{1}{n} = 0$$ by $n$: \begin{align} n \cdot \lim_{n \to \infty}\frac{1}{n}&=n\cdot 0 \\[5pt] \lim_{n \to \infty}1 &= 0 \end{align} So $1=0$. I'm sure I am wrong, but what exactly is wrong with my reasoning? Edit After some kind suggestion and answers from Terasa, Martin and Joe, I'd like to link a related helpful question below. The only slight difference is that question confused about the infinite sum and limits, while I confused between the product and limits!

Let we have \begin{equation*} n\times\frac{1}{n}=\frac{1}{n}+\frac{1}{n}+\cdots+\frac{1}{n}\mbox{ ($n$ times)}. \end{equation*} Taking $\lim_{n\to\infty}$ to both sides, we get \begin{eqnarray*} \lim_{n\to\infty}1 &=& \lim_{n\to\infty}\left(\frac{1}{n}+\frac{1}{n}+\cdots+\frac{1}{n}\right)\\ \Longrightarrow1&=&0+0+\cdots+0\mbox{ ($n$ times)}\\ &=&0. \end{eqnarray*} I am not an expert of math, and confused that where the confusion is.


I've accidentally staged a lot of changes including new files that I do not want to commit.  How can I unstage or reset only the new files?  I am not looking for a script of any kind; I am looking for core git functionality to be exposed and documented here on SO under a meaningful topic title.

I mistakenly added files to Git using the command:  git add myfile.txt   I have not yet run git commit. Is there a way to undo this, so these files won't be included in the commit?


Please don't mark the question as a duplicate. I have gone through every possibility, but I didn't find an answer. I use Ubuntu 12.04(LTS)  Python urlopen function raises this error message when an https site is given as input:  Traceback (most recent call last):   File "fb.py", line 13, in <module>     htmlfile = urllib.urlopen(url)   File "/usr/lib/python2.7/urllib.py", line 86, in urlopen     return opener.open(url)   File "/usr/lib/python2.7/urllib.py", line 207, in open     return getattr(self, name)(url)   File "/usr/lib/python2.7/urllib.py", line 436, in open_https     h.endheaders(data)   File "/usr/lib/python2.7/httplib.py", line 954, in endheaders     self._send_output(message_body)   File "/usr/lib/python2.7/httplib.py", line 814, in _send_output     self.send(msg)   File "/usr/lib/python2.7/httplib.py", line 776, in send     self.connect()   File "/usr/lib/python2.7/httplib.py", line 1161, in connect     self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)   File "/usr/lib/python2.7/ssl.py", line 381, in wrap_socket     ciphers=ciphers)   File "/usr/lib/python2.7/ssl.py", line 143, in __init__     self.do_handshake()   File "/usr/lib/python2.7/ssl.py", line 305, in do_handshake     self._sslobj.do_handshake() IOError: [Errno socket error] [Errno 8] _ssl.c:504: EOF occurred in violation of protocol   How do I fix this?

I have an little app I wrote in Python and it used to work... until yesterday, when it suddenly started giving me an error in a HTTPS connection. I don't remember if there was an update, but both Python 2.7.3rc2 and Python 3.2 are failing just the same.  I googled it and found out that this happens when people are behind a proxy, but I'm not (and nothing have changed in my network since the last time it worked). My syster's computer running windows and Python 2.7.2 has no problems (in the same network).  >>> url = 'https://www.mediafire.com/api/user/get_session_token.php' >>> response = urllib2.urlopen(url).read()   File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen     return _opener.open(url, data, timeout)   File "/usr/lib/python2.7/urllib2.py", line 400, in open     response = self._open(req, data)   File "/usr/lib/python2.7/urllib2.py", line 418, in _open     '_open', req)   File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain     result = func(*args)   File "/usr/lib/python2.7/urllib2.py", line 1215, in https_open     return self.do_open(httplib.HTTPSConnection, req)   File "/usr/lib/python2.7/urllib2.py", line 1177, in do_open     raise URLError(err) urllib2.URLError: <urlopen error [Errno 8] _ssl.c:504: EOF occurred in violation of protocol>   What's wrong? Any help is appreciated.  PS.: Older python versions don't work either, not in my system and not in a live session from USB, but DO work in a Ubuntu 11.10 live session.


If $\pi:E\rightarrow B$ is a vector bundle  (I allow it to be of nonconstant rank), then I want to prove that it is a homotopy equivalence. As a homotopy inverse I propose the zero section $s:B\rightarrow E$. So $\pi s=id_B$ and $s\pi$ is homotopic to $id_E$ by $f:E\times[0,1]\rightarrow E$, $f(e,t)=te+(1-t)s\pi(e)$. Is this correct?

I would like to compute the de Rham cohomology of the tangent bundle $TM$ of a manifold $M$. It seems to me that we can just homotopy each fibre to a point, and that this would give a homotopy equivalence between $TM$ and $M$. Since de Rham cohomology is a homotopy invariant, this would imply that $H^*_{\text{dR}}(TM) \cong H^*_{\text{dR}}(M)$.     Is it always true that the tangent bundle of a manifold is homotopic to the manifold itself by the homotopy of each fibre with a point?


I'm currently working in a bank, and while about 99.7% of the internet is blocked, Stack Exchange thankfully isn't (yet) however imgur is.  It means I can't view images posted alongside questions. The only workaround I have found is to search Google images for the URL, but you get a  which is a bit useless.  Does anybody know any clever tricks for viewing the images accompanying questions when you are somewhere where imgur is blocked?  Are there any plans to route the images stored on imgur through a Stack Exchange URL?

Imgur is blocked by two of the private ISPs we use. Is there a workaround without involving tunnelling?  Bear in mind that Filmot (an Imgur mirror) and Flickr are also blocked.


Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); java.util.Date fromDate = cal.getTime(); System.out.println(fromDate);   The above code doesn't print the date in GMT, but rather prints in the local timezone. How do I get a GMT equivalent date from the current date (assuming that the program can run in Japan or SFO)

When I create a new Date object, it is initialized to the current time but in the local timezone. How can I get the current date and time in GMT?


Could you give a hint how to prove this? if $n>5$ is prime, prove $(n-1)|(n-2)!$

I have a proof and need some feedback. It seems really obvious that the statement is true but it is always the obvious ones that are a little trickier to prove. So I would appreciate any feedback. Thank you!  Here is what I am asked to prove:     If $n$ is composite then $(n-1)! \equiv 0 \pmod n$.   Proof:  $n$ is composite $\implies n=ab$ where $a,b \in \mathbb{Z}$ and $0<a,b<n$.  Case 1: If $a=b$ then $n=a^{2}$. Now $n \mid (n-1)! \implies a \mid (n-1)!$, so $$\begin{aligned} (n-1)! &\equiv 1\times 2\times \dotsb \times a \times\dotsb\times (n-a)\times\dotsb\times (n-1) \\ &\equiv 1\times 2\times \dotsb\times a \times\dotsb\times -a\times\dotsb\times -1 \\ &\equiv 0 \pmod n \end{aligned}$$  Case 2: $0<a<b<n$.  Then, since $a \mid n$, $b \mid n$ and $n \mid (n-1)!$ we have that $a \mid (n-1)!$ and $b \mid (n-1)!$.  So this implies $(n-1)! \equiv 1\times 2\times \dotsb\times a \times\dotsb\times b\times\dotsb\times (n-1) \equiv 0 \pmod n$, Q.E.D.


I logged into iCloud today, and the two factor auth code was sent to the same mac that i logged into iCloud with. My iPhone was right next to me with a full signal, but did not receive the code.  What's the point in that? This seems a bug to me, unless anyone knows any different?

My Apple-ID (e.g., on  ) is set up to require entry of a 6-digit code sent to my registered Apple products.  This code is being sent to the same device I'm currently requesting to log in. I feel this absolutely defeats the purpose of this 2-Factor Authentication: If a person knows my password, this person can receive the code on that device, and access my apple account without any problems.  Is this a bug or can I set up / change how this security step works?


I know it can be a bad idea in general, but for a specific case (a music production computer, not connected to internet), I would like to totally disable Windows 10's UAC limitations and Windows 10's User Interface Privilege Isolation (UIPI).  Why? Because I had  when trying to use a few software with Windows 10.  The solutions seem , that's why I would like to disable these annoying limitations, that I don't need. Everything works fine on my non-internet computer with Win7, so why would it be a problem with Win10?  How to totally disable Windows 10's UAC limitations and Windows 10's User Interface Privilege Isolation (UIPI)?

I have a problem, i have a Windows 8 realease Preview. I have UAC turned off always, but for test i switched UAC on (slider up) and restarted my pc, then, i turned it off (slider down) and restarted my pc. And now have a problem, all .exe files starts without admin privileges (my pc user is administrator). How can i fix that?  Thanks!


If someone can explain why a capacitor blocks DC, but not AC, with some math, I will understand all of that much better. I know that there are picture animations illustrating this, but I really want to know this a little bit more detailed.

I am confused with this! How does a capacitor block DC?   I have seen many circuits using capacitors powered by a DC supply. So, if capacitor blocks DC, why should it be used in such circuits? Also, the voltage rating is mentioned as a DC value on the capacitor. What does it signify?


What does this do: :(){ :|:& };:.  I was reading through encyclopedia dramatica and saw that command.  It just being above rm -rf / --a-flag-we-don't-mention-here makes me anxious about trying it out to see. Any insights on what it might be? I tried googling but to symboles make it impossible to search.

Do not run this command to 'test' it unless you are prepared for a crash and/or force-rebooting your system.  I was in my Virtualbox running 12.04 trying to compile an app, and while waiting I happened to chance upon a forum where a comment said:   Try :(){ :|: & };:  Fun, too, and doesn't need root.  Without thinking, I ran it in my gnome-terminal. It made my 12.04(in Virtualbox) lag so badly, I had to shut it down. My question is what does this command do?   :(){ :|: & };:


Okay everyone, do you remember the game Five Nights at Freddy's:The Sister Location?  Well, I'm trying to make the stripe texture that was used for the springs that surround the endoskeletons and looks like a layer of muscle tissue.  Take Ennard as an example of what I'm talking about.  I'm using a stripe image texture for this and I can't unwrap it correctly on the bezier circle.  Here it is:   Can you guy's please help me out?  And to be specific,the rendering engine I'm using is Cycles.

I have a question about the mesh and geometry of a torus and how to achieve a certain physical effect.     This is what I am talking about. I need to have a divided cut that is perpendicular to the direction of the faces of the torus.   Here is a picture of what I want to acheive:   Notice how the torus-es/curves each have dividing segments that lie inbetween the faces of the torus? I'd like to achieve this effect, but I am not sure how to. Any help would be appreciated.


How do they make the sun or moon appear so big in backgrounds of some images?

I see pictures of the moon that looks like it is very close to the earth; I am wondering whether they are real or is there a trick to show the moon that big?  Here is an example:


Is it possible to add a group string name to a grouped set in T-SQL  Name     |    NO      |   ---------+------------+  A        |      1     | B        |      1     | C        |      1     | E        |      2     | F        |      2     | G        |      2     |   Output Name join in String.  Name     |    NO      |   ---------+------------+  A,B,C    |     1      |  E,F,G    |     2      |  Declare @tbG Table(idx  int , Name  nvarchar(250)) Insert into @tbG values (1,'A'),(1,'B'),(1,'C'),(2,'E'),(2,'F'),(2,'G');  SELECT Name, idx AS column_names FROM @tbG AS extern CROSS APPLY (     SELECT Name + ','     FROM @tbG AS intern     WHERE extern.idx = intern.idx     FOR XML PATH('') ) pre_trimmed (column_names) GROUP BY idx, Name;    I thinks below is my solution but I can not replace example.  SELECT table_name, LEFT(column_names , LEN(column_names )-1) AS column_names FROM information_schema.columns AS extern CROSS APPLY (     SELECT column_name + ','     FROM information_schema.columns AS intern     WHERE extern.table_name = intern.table_name     FOR XML PATH('') ) pre_trimmed (column_names) GROUP BY table_name, column_names;

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


When I look for my error key number 0429ACCAF7AA50B3, it is not in the database, thus I cannot receive or generate anything even none of this did not work:      Please, do you know what to do next? Thank you!  This is what it shows:  $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0429ACCAF7AA50B3 [sudo] password for jiri:  Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.ag55619bV6 --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/nilarimogard-webupd8.gpg --keyring /etc/apt/trusted.gpg.d/webupd8team-y-ppa-manager.gpg --keyserver keyserver.ubuntu.com --recv-keys 0429ACCAF7AA50B3 gpg: requesting key F7AA50B3 from hkp server keyserver.ubuntu.com gpgkeys: key 0429ACCAF7AA50B3 not found on keyserver gpg: no valid OpenPGP data found. gpg: Total number processed: 0

Possible Duplicate:    I am using 10.04 LTS - Lucid Lynx. I shutdown the computer while a software update was running. Then after I restarted my computer and while the update manager was running, I got this error:  Could not download all repository indexes The repository may no longer be available or could not be contacted because of network problems. If available an older version of the failed index will be used. Otherwise the repository will be ignored. Check your network connection and ensure the repository address in the preferences is correct. GPG error: http://toolbelt.herokuapp.com ./ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C927EBE00F1B0520 Failed to fetch  http://ppa.launchpad.net/rabbitvcs/ppa/ubuntu/dists/**DISTRIBUTION**/main/binary-i386/Packages.gz 404  Not Found   I went through the answers to  and I tried this $ sudo launchpad-getkeys  Please wait... launchpad-getkeys is running an update so it can detect the missing GPG keys Trying to import all the missing keys gpg: requesting key 0F1B0520 from hkp server keyserver.ubuntu.com gpgkeys: key C927EBE00F1B0520 not found on keyserver gpg: no valid OpenPGP data found. gpg: Total number processed: 0 launchpad-getkeys has finished importing all missing GPG keys.  Try running sudo apt-get update - you shouldn't see any key  errors anymore  But when I run sudo apt-get update again, it again shows that the key was not found on the keyserver. How to solve this problem?


Python (3.8.6) module re finds the given pattern in the string, but can't replace it. # example text x = """hello world new line"""  re.search(r"^hello world$", x, re.MULTILINE) -> <re.Match object; span=(0, 11), match='hello world'> # pattern found  re.sub(r"^hello world$", "SUB", x, re.MULTILINE) -> "hello world\nnew line" # does not get replaced  Can anyone explain this behavior?

The Python docs say:     re.MULTILINE: When specified, the pattern character '^' matches at the beginning of the string and at the beginning of each line (immediately following each newline)... By default, '^' matches only at the beginning of the string...   So what's going on when I get the following unexpected result?  >>> import re >>> s = """// The quick brown fox. ... // Jumped over the lazy dog.""" >>> re.sub('^//', '', s, re.MULTILINE) ' The quick brown fox.\n// Jumped over the lazy dog.'


The question said:   Use the Euclidean Algorithm to find gcd $(1207,569)$ and write $(1207,569)$ as an integer linear combination of $1207$ and $569$  I proceeded as follows:   $$ 12007 = 569(2) +69$$  $$569 = 69(8) +17$$  $$69 = 17(4) +1$$  $$17 = 1(17) + 0$$  Thus the gcd = 1   The part I am having problems with is how calculate and write it was a linear combination. Can someone help?

I've only found a recursive algorithm of the extended Euclidean algorithm. I'd like to know how to use it by hand. Any idea?


If we look at a unit circle we can see that the values of cosine are between -1 and 1. However is there a particular proof for this fact? I have tried using the Euler's identity to arrive at a proof with no luck. I have also tried using the expanded form of cosine : $\cos(x)=\sum_{n=0}^{\infty } \frac{(-1)^n x^{2n}}{2n!}$. Using the expansion I tried to manipulate as much as I could however it seems that I am not finding a proof in this fashion either. I also tried going from the fact that it is a Cauchy sequence. I know that identities can be brought in to prove it, but I should like to find a more fundamental way of proving it. Any ideas?

If we look at a unit circle we can see that the values of cosine are between -1 and 1 however is there a particular proof for this fact? I have tried using the Eulers identity to arrive at a proof with no luck. I have also tried using the expanded form of cosine : $cos(x)=\sum_{n=0}^{\infty } \frac{(-1)^n x^{2n}}{2n!}$. Using the expansion I tried to manipulate as much as I could however it seems that I am not finding a proof in this fashion either. I also tried going from the fact that it is a cauchy sequence.Any ideas?


In Kiki's Delivery Service, Kiki temporarily loses her powers and her ability to speak to her cat Jiji. By the end of the movie, her powers have returned, but in the original Japanese version, she is still unable to speak to or understand Jiji.  Why can she not speak to or understand Jiji if all of her other powers have returned?

In the film, Kiki's Delivery Service, the small black cat that Kiki keeps with her a sort-of familiar is Jiji. Jiji can talk, and is quite incisive, really.  In the middle portion of the film, Kiki loses touch with her powers and Jiji goes silent. Yet, by the end of the film, Kiki's powers are restored, but Jiji remains silent. Why?


Should there be a comma before "and" in the sentence below? The reason why I ask is because I think that the sentence below has committed a comma splice, but I am not completely sure. Can someone please explain to me why there is a comma in front of "and".      Birmingham lighted a runaway fuse, and as fast as the headlines could record them, demonstrations exploded all over the country...

I read this sentence on an educational website:     Now times have changed and you are ready for situations involving forces in two dimensions.   Shouldn't there be a comma before and, since the subject of the sentence has changed (things vs. you)?      Now times have changed, and you are ready for situations involving forces in two dimensions.   What is the exact comma rule for joining two clauses with and?


The thing is GRUB doesn't load up automatically , I have to do it manually, so can someone tell me how can I make it load up automatically everytime I boot?

In Ubuntu 12.04 (or above), how do I set the GRUB time and the default OS (that I see at boot time) as I'm dual-booting Windows (7/8) and Ubuntu (12.04 or above)?


My friend has a Xbox one, while I've got an Xbox 360.  Will I be able to play FIFA 16 with him online? Or would I have to get an Xbox One to play with him?

Is it possible to play against and with Xbox 360 players through my Xbox One?


Am totally stuck!  Am unable completely to install python2.7-dev on my Ubuntu13.04. I have tried all the tricks mentioned on this site (askubuntu.com) and many other sites on the web but still nothing!  Am running Ubuntu 13.04 64bit on a virtualbox, but every time I run sudo apt-get install python2.7-dev, I get the following error;  python2.7-dev : Depends: python2.7 (= 2.7.3-0ubuntu3.5) but 2.7.4-2ubuntu3 is to be installed                  Depends: libpython2.7 (= 2.7.3-0ubuntu3.5) but 2.7.4-2ubuntu3 is to be installed                  Depends: libexpat1-dev but it is not going to be installed                  Depends: libssl-dev but it is not going to be installed E: Unable to correct problems, you have held broken packages.   I've tried to do apt-get update, but still nothing! I've even tried installing Python2.7 from sources, but still nothing doing!  Is there a single package with all the dependencies I can download, that can just install everything (Python2.7-dev) or is there another trick I can use to get the Python-dev headers installed on my machine.  Hint: I've noticed when I run sudo apt-get update , somewhere along the updates I've seen some errors;  ... Get:1 http://us.archive.ubuntu.com precise-updates Release.gpg [198 B] Ign http://us.archive.ubuntu.com raring Release       Ign http://us.archive.ubuntu.com raring-updates Release Ign http://us.archive.ubuntu.com raring-backports Release Ign http://us.archive.ubuntu.com raring-security Release Get:2 http://us.archive.ubuntu.com precise-updates Release [98.7 kB] Err http://extras.ubuntu.com raring/main Sources            404  Not Found Err http://extras.ubuntu.com raring/main amd64 Packages     404  Not Found Err http://extras.ubuntu.com raring/main i386 Packages   404  Not Found Ign http://extras.ubuntu.com raring/main Translation-en_US Ign http://extras.ubuntu.com raring/main Translation-en ...   On my precise-updates.list file is a single entry;  deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted   I don't know if that might help  Help!  Paul

Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found:  $ sudo apt-get install vlc Reading package lists... Done                Building dependency tree        Reading state information... Done     E: Couldn't find package vlc


I tried to google for quite some time, but the results are mixed and the documentation is quite sparse on this one. I need to add 2 sets of vertices to 2 vertex groups, assign a weight of 1 and name them. After selecting my object based on it's name here's what I have - import bpy  bpy.ops.object.editmode_toggle()      indices = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 30, 33]    vertices= [e for e in bm.verts] oa = bpy.context.active_object #group = bpy.context.object.vertex_groups.new(name = 'Left' )  for vert in vertices:     if vert.index in indices:         vert.select = True              else:         vert.select = False           bpy.ops.object.vertex_group_assign_new()                   #selecting right half (to snap cursor, create empty and vert group)  indices = [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32]    vertices= [e for e in bm.verts] oa = bpy.context.active_object  for vert in vertices:     if vert.index in indices:         vert.select = True     else:         vert.select = False          bpy.ops.object.vertex_group_assign_new()          bpy.ops.object.editmode_toggle()  I couldn't figure out how to assign the verts, weights, name the vert group in one go, and for some reason the 2 vert group assignments do some strange things when used together. Anyone any tips for a newbie? Cheers, Dan

How to select and assign vertices to a vertex group via python? I have a script that generates random hair on sphere, and I want to make it work for a custom head mannequin, so I have to assign vertices to a vertex group for scalp hair, and then apply my script on it, so it adds hair only to the scalp part?


I have generated a FeatureCollection of polygons and calculated the centroid and added it. I now want to pull in some data from FAO/GAUL/2015/level2 dataset with fields such as ADM2_CODE etc. This can be just the centroid.  How do I get data out of one FeatureCollection and add it to mine?  var fromList = ee.FeatureCollection("FAO/GAUL/2015/level2");  var filter = ee.Filter.inList('ADM2_NAME', ['Gwent']); var filteredArea = fromList.filter(filter);  Map.setCenter(1.1, 51.5, 8); Map.addLayer(filteredArea, {}, 'Regions');  var gfc2018= ee.Image('UMD/hansen/global_forest_change_2018_v1_6').clip(filteredArea);  var lossImage = gfc2018.select(['lossyear']).gte(7); var lossBand = lossImage.and(gfc2018.select(['lossyear']).lte(20)); var zones = lossBand.updateMask(lossBand.neq(0));  // Add the loss layer in red. Map.addLayer(lossImage.updateMask(lossBand),             {palette: ['FF0000']}, 'Loss 2007 onwards');  var area_threshold = 300; // about 30 hectares?  // Define whole county as a region var geom = filteredArea.geometry();  // Convert the zones of the forest loss areas to vectors. var vectors = zones.addBands(zones).reduceToVectors({   geometry: geom,   crs: lossBand.projection(),   scale: 30,   geometryType: 'polygon',   eightConnected: true,   labelProperty: 'zone',   reducer: ee.Reducer.count() }).filterMetadata("count","greater_than", area_threshold);  // Make a display image for the vectors, add it to the map. var display = ee.Image(0).updateMask(0).paint(vectors, '000000', 1); Map.addLayer(display, {palette: '000000'}, 'vectors');  var SRTM = ee.Image("USGS/SRTMGL1_003"); // exampleelevation image  var slope = ee.Terrain.slope(SRTM);  // add min, max and mean elevation of each geometry var reducers = ee.Reducer.median()                 .combine(ee.Reducer.min(), 'Elevation', true)                 .combine(ee.Reducer.max(), 'Elevation', true)                 .combine(ee.Reducer.mean(), 'Elevation', true);  vectors = SRTM.reduceRegions(vectors, reducers, 30);  // This function computes the feature's geometry area and adds it as a property. var addCentroid = function(feature) {   return feature.set({CentralPoint: feature.geometry().centroid(10)}); };  // Map the area getting function over the FeatureCollection. var CPAdded = vectors.map(addCentroid);  // Get Admin Districts var AreaName = filteredArea.aggregate_first("ADM2_CODE")  // How can I add the ADM2_CODE or any of the fields to my featurecollection? It can be just for the central point which I have calculated?  // Export the FeatureCollection to a CSV file. Export.table.toDrive({   collection: CPAdded,   description: 'ForestPlus',   fileFormat: 'CSV' });

I want to add the ADMIN2_CODE from the dataset FAO/GAUL/2015/level2 to a featurecollection I have created to get information on some forests in Wales. I have added the elevation to the polygons but I can't work out how to add the (first) ADMIN2_CODE. My code doesn't work - can someone help please - I know I am doing something blatantly wrong!  var fromList = ee.FeatureCollection("FAO/GAUL/2015/level2");  var filter = ee.Filter.inList('ADM2_NAME', ['Gwent']); var filteredArea = fromList.filter(filter);  Map.setCenter(1.1, 51.5, 8); Map.addLayer(filteredArea, {}, 'Regions');  var gfc2018= ee.Image('UMD/hansen/global_forest_change_2018_v1_6').clip(filteredArea);  var lossImage = gfc2018.select(['lossyear']).gte(7); var lossBand = lossImage.and(gfc2018.select(['lossyear']).lte(20)); var zones = lossBand.updateMask(lossBand.neq(0));  // Add the loss layer in red. Map.addLayer(lossImage.updateMask(lossBand),             {palette: ['FF0000']}, 'Loss 2007 onwards');  var area_threshold = 300; // about 30 hectares?  // Define whole county as a region var geom = filteredArea.geometry();  // Convert the zones of the forest loss areas to vectors. var vectors = zones.addBands(zones).reduceToVectors({   geometry: geom,   crs: lossBand.projection(),   scale: 30,   geometryType: 'polygon',   eightConnected: true,   labelProperty: 'zone',   reducer: ee.Reducer.count() }).filterMetadata("count","greater_than", area_threshold);  // Make a display image for the vectors, add it to the map. var display = ee.Image(0).updateMask(0).paint(vectors, '000000', 1); Map.addLayer(display, {palette: '000000'}, 'vectors');  var SRTM = ee.Image("USGS/SRTMGL1_003"); // exampleelevation image  var slope = ee.Terrain.slope(SRTM);  // add min, max and mean elevation of each geometry var reducers = ee.Reducer.median()                 .combine(ee.Reducer.min(), 'Elevation', true)                 .combine(ee.Reducer.max(), 'Elevation', true)                 .combine(ee.Reducer.mean(), 'Elevation', true);  vectors = SRTM.reduceRegions(vectors, reducers, 30);  // Get Admin Districts var fromList = ee.FeatureCollection("FAO/GAUL/2015/level2"); var filter = ee.Filter.inList('ADM0_NAME', ['Romania']); var filteredArea = fromList.filter(filter);  var AreaName = filteredArea.aggregate_first("ADM2_CODE")  reducers = ee.Reducer.first();  // This next line is wrong! vectors = AreaName.reduceRegions(vectors, reducers, 10);  // Export the FeatureCollection to a CSV file. Export.table.toDrive({   collection: vectors,   description: 'Forest',   fileFormat: 'CSV' });


I have Ubuntu 14.05 installed with an Nvidia Driver.  After recent automatic software updates, the Nvidia driver was disabled and when I rebooted, the standard driver was enabled.  How do I re-enable the Nvidia driver?  NOTE: I tried to re-install the NVIDIA driver, but had problems.  It requires the kernel source code and that now seems to be missing.  I can't install the kernel source now because the machine is now off the internet.

Since my previous questions were not answered I will try to ask again more precisely.  I previously had the Nvidia driver installed and working correctly.  Then the ubuntu software update did something which broke it.  In fact, it completely de-configured it so that the standard display driver is used when the computer reboots.  I would like to re-enable the existing Nvidia  driver without re-installing the Nvidia driver.  How do I do that?  This machine is no longer connected to the internet.  NOTE: I am not asking how to disable automatic updates in this question.  I asked that elsewhere (and it wasn't answered).  NOTE: I am not asking how to stop the Ubuntu software updater from breaking the Nvidia driver the next time it updates the system.  That would be nice to know, but I asked that already and did not receive the correct answer either.  NOTE: Please don't make this as duplicate simply because someone else asked a question about Ubuntu and the software updater.  Try to read the actual question and see how it's different and try to realize how annoying it is when users have to spend hours of their own time to correct the problems that other people causing by incorrectly designing software updaters.


Is it possible to have an @ symbol in a classname when using sass? I keep getting compilation errors even though it seems to be valid syntax in CSS.  I want classnames like:  .u-6@sm {     width: 50%; }   I've tried a variaty of approaches using interpolation but can't get it to spit out the CSS with the @ symbol.  e.g.  $at-symbol: unquote('@'); .u-6#{$at-symbol}sm {     width: 50%; }   That doens't work. I also tried a function to return it and a mixin that accepts a symbol as a param but still nothing.  The weirdest thing is that if I do this:  .u-6\@sm {     width: 50%; }   it compiles fine with both backslash and the @ symbol. Huh? Whaa?  So why can't I use just the @?

What characters/symbols are allowed within the CSS class selectors? I know that the following characters are invalid, but what characters are valid?  ~ ! @ $ % ^ & * ( ) + = , . / ' ; : " ? > < [ ] \ { } | ` #


I moved away (to an external drive) about 30 GB of files from a drive (startup disk) that had 60 GB of free space.  After the move it still shows only 60 GB of free space, not 90, as I would expect.  The trash is emptied.  I tried rebooting and verifying the disk (no problems found), but it didn't change anything.  How can I diagnose and fix the problem?  Note:  is what happened during the move.  I deleted the "washed out" items and repeated the move.     Update: The space was being taken up by Time Machine's Mobile Backups feature.  has solved the problem.

I had approximately 50Gb of Windows VMs on my MacBook Pro internal SSD (128Gb) (OS X 10.7.3).  I copied them to an external drive, then deleted them from the internal drive, then emptied the Trash.    When I look at disk usage in Activity Monitor it shows the same level of usage as it did prior to deleting 50Gb of files.   Any ideas why the space hasn't been freed up?


I was wondering if Legacy BIOS is the blue interface, but then why is EFI an interface (UEFI) and a boot mode in one while BIOS is the interface and Legacy is the boot mode (separate things)? Is (U)EFI working as a boot mode itself and as an interface?

Now Windows 8 supports the UEFI bootloader and I have read that its different from the BIOS, but it's unclear to me after many searches on the Google.  Some points in mind are below:-   As we all know, BIOS is an important part of accessing boot options. So UEFI will do that now? How?   How would I know that I'm booting with UEFI not with BIOS?  So what is the real difference in the "boot with BIOS" and "boot with UEFI"?


Could proton-proton Collisions in the LHC produce Gravitons?

I've heard that it is incredibly difficult to detect a graviton, but I don't quite understand why. With all of the knowledge I have at the present time it seems like it should be possible to create a graviton in a particle accelerator. This is how I figure: a graviton is massless, so the collision shouldn't need to have too high of an energy. Since gravity acts upon anything with energy, a graviton field should couple with all of the other fields, so it seems like gravitons could be created in collisions. A graviton created this way would probably not show up on traditional detectors, but the two units of spin associated with the particle would be missing from the observed decay products. What is wrong with this picture?It may come from a naive understanding of scattering, as I am no physicist (yet.)   p.s. I have the same misunderstanding regarding axions. They are predicted to be light particles, so why aren't they created in collisions?


I read a series of 5 novels that began with a space pirate kidnapping a woman from Earth, using her horribly, selling her or perhaps losing her to anothe pirate and her tale grew more awful... Each time you thought her plight could not get worse, the author twisted it more. The protagonist also went through many trials by the end of the series. The protagonist's name was Nick and I don't recall her name. She did eventually triumph.   Anyone know? TIA if so!

When I was rather young I had picked up a bunch of SF books at the library,  one had a kind of interested plot about an undercover Space Cop of some sort who had somehow been turned into a slave.  It might have been part of a series.  The main character was female and she had some sort of pain / pleasure implant.  She had been turned into the slave of some sort of Space Pirate whom she was intent on bringing to justice or something.  It was rather a graphic book, both sexually and when it came to violence.  It also wasn't what you would call well written.  Though at the time the idea of a future with some sort of Space Patrol going undercover to capture Space Pirates had fascinated me.  Recently someone mentioned the same book and neither of us could remember its name.    We were both pretty sure it was written in the 80's or 90's and most of it took place on a space ship where the girl was kept hostage.  We think that the Pirates hadn't known she was an undercover Space Cop and she may have been drugged and implanted with this device.  She might have been a crew member at first (maybe an engineer) that the Captain turned into a slave, we're really not sure about that.  We can't even remember how it ends for sure...  Can anyone help us?


iOS 8 in my iPhone 5 drains the battery, I'd like to return to iOS 7 if I can.  Is it possible?

I'm trying to downgrade my iPhone from the current iOS to an older one, as per .  But every time I try, I always receive this error:     The iPhone could not be restored. This device isn't eligible for the requested build.     I have tried many times with and without DFU mode. Any ideas regarding this?


Example of a finite commutative ring $R$ whose maximal ideal $I$ is not prime?  Is it possible? I am not able to find such example.

In a commutative ring with an identity, every maximal ideal is a prime ideal. However, if a commutative ring does not have an identity, I'm not sure this is true. I would like to know the counterexamples, if any. The more examples, the better.  EDIT I would like to know the counterexamples other than $2\mathbb{Z}$. The more examples, the better.  EDIT I also would like to know the counterexamples that are not given in  if any, namely an example of a non-prime maximal ideal which does not contain $R^2$.


I consider this question unanswered as I would like a minimal example. The examples I've seen are for very complex shapes and I get lost in the immensity and complexity of the code. This question is different from the red square solution as I'd like to be able to have a certain compat in pfgplots. Also, I'd like to be able to put in exact values for a coordinate point (sqrt(75) for example). I get an error when I do that, but putting something in like 8.66 works just fine. This is not a duplicate, no more reporting it as one, please.  \documentclass[11pt]{exam}  \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.9}  \begin{document}  \begin{tikzpicture} \draw (-5,0) -- (5,0); \draw (0,0) -- (0,5); \end{tikzpicture}  \end{document}   What would be the simplest way to mark 90 degrees on this diagram.

The sample code:  \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw  ( 0 , 0 ) coordinate (A)      -- ( 4 , 0 ) coordinate (C)      -- ( 0 , 3 ) coordinate (B)      -- (0,    0); \end{tikzpicture} \end{document}   The figure:    I would like to use a box in the lower left angle of the triangle to indicate a right angle.


We have a situation where a worker is using a Dropbox shared with many people in different companies to work on a collaborative project. She cannot figure out how to use our company's Dropbox now, to work on a different project. She needs access to both Dropboxes, at different times. We're using Windows 7. Thank you for any help.

Can Dropbox be used with multiple accounts on one computer?


I recently switched to the Dell XPS 13 DE from a Mac.  I'm trying to replicated the super + spacebar motions to open up a dialog to run applications on the computer but I can't seem to get it going.  Also, is there a quick guide on the best way to use key combos to snap windows?

In Unity, are there any pre-defined shortcuts, e.g. to open the dash or unhide the launcher?


I want my method to have access to the variable defined outside the method, but even if i use global keyword it says it can't:  global var = 0 def test():   var = var +1   Compiler still says var is not defined in test method Where is my mistake?

How can I create or use a global variable in a function?  If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?


I've searched for a similar question and haven't found one yet, so here goes:  How do I roll back to a previous installation of WINE without knowing what that version was?  Backstory:  I played a game on my Ubuntu machine using WINE a few months ago and noticed that an error kept occurring under certain circumstances that made it almost unplayable.I stopped playing.  Fast forward a few months and a few WINE updates and I decide to give the game another go. To my delight, the error has stopped occurring. Then, I notice a new WINE update and decide to install it.   Using these commands:  wget -nc https://dl.winehq.org/wine-builds/Release.key sudo apt-key add Release.key sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/ sudo apt-get update sudo apt-get install --install-recommends winehq-stable   Now the game is performing the same error and it has become unplayable again.   So, my question is:  Without knowing what that last version of WINE was, how do I get back to it? This game is in early alpha and has not been released yet. It's also a very 'niche' sort of game, so there wont be a large amount of people playing it, and even fewer on Linux (I'm the only one I know of). I can't expect any help from other players. They're all on either Windows or Mac.

Is there a way to show the history of packages that were changed by apt-get via command line?


I want to use a byte array as a lookup key in a concurentDictionary. Currently I solve this by using a custom EqualityComparer<byte[]>.  This works fine, but I do realize that my hashcode generator will generate a lot of overlaps where things end up in the same hash bucket.  public class ByteArrayEqualityComparer : EqualityComparer<byte[]> {     public override bool Equals(byte[] x, byte[] y)     {         //fast buffer compare         return UnsafeCompare(x, y);     }      public override int GetHashCode(byte[] obj)     {         int hash = 0;         for (int i = 0; i < obj.Length; i += 2)         {             hash += obj[i]; //xor? shift? black magic?         }         return hash;     } }   What would be a good formula to create a relatively fast hash from the byte array?  My idea is that I can calculate the hashcode by skipping every x bytes for speed. As the final comparison is still done over the full data set, it seems pointless to compare all bytes multiple times.  I imagine that some xor magic and shifting on the hash var would make things better.  This is extremely performance critical, so any shortcut that can be used is welcome too.  [edit] I ended up using this solution. I use a struct to wrap the byte array so that I can use a cached hashcode for it instead of calculating it for each comparison. This resulted in a very nice performance gain.  public struct ByteArrayKey {     public readonly byte[] Bytes;     private readonly int _hashCode;      public override bool Equals(object obj)     {         var other = (ByteArrayKey) obj;         return Compare(Bytes, other.Bytes);     }      public override int GetHashCode()     {         return _hashCode;     }      private static int GetHashCode([NotNull] byte[] bytes)     {         unchecked         {             var hash = 17;             for (var i = 0; i < bytes.Length; i++)             {                 hash = hash*23 + bytes[i];             }             return hash;         }     }      public ByteArrayKey(byte[] bytes)     {         Bytes = bytes;         _hashCode = GetHashCode(bytes);     }      public static ByteArrayKey Create(byte[] bytes)     {         return new ByteArrayKey(bytes);     }      public static unsafe bool Compare(byte[] a1, byte[] a2)     {         if (a1 == null || a2 == null || a1.Length != a2.Length)             return false;         fixed (byte* p1 = a1, p2 = a2)         {             byte* x1 = p1, x2 = p2;             var l = a1.Length;             for (var i = 0; i < l/8; i++, x1 += 8, x2 += 8)                 if (*(long*) x1 != *(long*) x2) return false;             if ((l & 4) != 0)             {                 if (*(int*) x1 != *(int*) x2) return false;                 x1 += 4;                 x2 += 4;             }             if ((l & 2) != 0)             {                 if (*(short*) x1 != *(short*) x2) return false;                 x1 += 2;                 x2 += 2;             }             if ((l & 1) != 0) if (*x1 != *x2) return false;             return true;         }     } }

In .NET, the  is used in a lot of places throughout the .NET base class libraries. Implementing it properly is especially important to find items quickly in a collection or when determining equality.  Is there a standard algorithm or best practice on how to implement GetHashCode for my custom classes so I don't degrade performance?


I am new to python. Please anybody explain the following string operations  s="abcdefghijklmnop"   print s[:6][::-1]  #is it first calculating s[:6] and then operating the result with [::-1] ?

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


I have updated from 19.10 to 20.04 and have been using gnome-logs to check everything is working ok. In fact I have posted here about a couple of warnings, so I am 100% sure it has been working in 20.04. Then today gnome-logs didn't start from the dash so I called it from the console and got this message:     $ gnome-logs      Der Befehl 'gnome-logs' wurde nicht gefunden, kann aber installiert   werden mit:      sudo snap install gnome-logs  # version 3.34.0, or sudo apt  install   gnome-logs  # version 3.34.0-1ubuntu1   (The German reads "The command 'gnome-logs' was not found but can be installed with: .......)  I have no idea how or why it  it disappeared but I reinstalled it with sudo apt-get install gnome-logs and the version 3.34.0 was installed and works as it did previously. If anyone has an idea of why gnome-logs just disappeared I love to know why, but for now my main question is this:  Is it advantageous for me to use snap? I have plenty of room on my hard-drive and I understand (and being happy with apt I haven't really studied it) that snap doesn't share libraries among programs but installs libraries for exclusive use by each program. I can see the pros and cons of this but have never had a problem with Ubuntu using apt. Is there any good reason for me to start installing via snap? And if I start now won't I have a mongrel system with apt and snap apps and programs which could lead to problems later on?  Edit: How would I know, as an end user, which from apt or snap is best for each need. Why did the system recommend a snap for gnome-logs? Is the system helping me decide which installation app to use, or simply choosing snap for everything from now on?

This is not a duplicate of the following questions     because:  My question specifically states that I am interested in end-user experience, not ease or efficiency of development, which is what the other question largely refers to.  As has been noted, development/deployment affects end-user experience, but it is not all there is to it, and neither of the referenced questions address issues that directly impact an end-user's ability to use the application (e.g. trouble accessing data on other partitions, sluggishness, etc.) Maybe "compelling" wasn't the right word to use; my intent was to ask about real-world, experiential consequences, i.e., things that happen or  don't happen, as opposed to theoretical/architectural statements that, while presumably accurate, don't appear to be backed up with any real-world examples to support the statement. I should have stated more directly that my intention was to get answers that consider the balance of "advantages" to snaps against the real-world downsides experienced by end-users. The "duplicate" question is largely theoretical, and doesn't discuss end-user experience at all. The "duplicate" question makes no mention of anything remotely similar to the example I used here, i.e., that there is an end-user downside to snaps (in this case, lack of access to data on other partitions and snap app performance) that isn't discussed in any available documentation that I can find.   While I understand that snap has a big advantage in making apps more widely available, is there any compelling reason to choose snap over apt, if the app is available for my distro/version via an apt package? I am curious because I've been doing some reading about snaps, and all the excitement about the method seems to be about things that are advantageous for app developers, but I've seen virtually nothing on how this makes life easier for end users (aside from the obvious; that they may be able to install apps that aren't otherwise available on their distro/version). I installed snapd and installed a couple of snaps and was really frustrated and disappointed.  The snap apps are slow and it's difficult, if not impossible, to access files on other partitions from within the snap. While I've seen plenty of info that says snaps are "faster," "easier," "safer," etc., I haven't been able to find anything that explains why or how this is actually the case. Being very new to Linux, I am wondering if maybe I'm just missing something obvious? To be clear, I understand why the technology might be useful overall, but I can't find anything that explains whether/why it is a better option even when the app in question is available for install via a more traditional method, and all dependencies are met.


The postulate that the velocity of light in a vacuum is the same in all inertial frames, can be exploited to establish that the spacetime interval between two events $x^\mu=(ct,{\bf r})$ and $x^\mu+dx^\mu=(ct+cdt,{\bf r}+d{\bf r})$ defined as $$ds^2=\eta_{\mu\nu}dx^\mu dx^\nu=c^2dt^2-d{\bf r}^2\tag{1}$$ remains invariant. In general relativity, we require $$ds^2=g_{\mu\nu}(x)dx^\mu dx^\nu \tag{2}$$ to be invariant. Which postulate of general relativity gives rise to this requirement?

I understand how to derive the spacetime interval being invariant for Minkowski space, but I've never seen any derivation of it in general curved spacetime. Is the invariance just derived for Minkowski space and then postulated that it holds for all metric tensors in general relativity, or is there a proof to show it is invariant in general relativity?


The data I'm trying to analyze are the quadratic estimates from a quadratic fit to a curve.  Most of the data vary between -.15 and .15.  However, I have outliers in both directions up to things like -23.00. Outlier analysis and removal has been deemed insufficient as the primary coping method.  Therefore, I need to transform the data; I wanted to use a log transformation but adding a constant to the data seems sketchy (it would have to be a large constant to cover all extreme outliers).  Any suggestions as to what kinds of transformations might work here?  I need normally distributed data in the end so that I can run ANOVAs.

My data (see image below) is positively skewed and contains both positive and negative values. I'd like to transform it to achieve normality so I can apply a repeated measures ANOVA, but can't find a technique that works.  I've considered the following options:   Square-rooting: doesn't keep the sign Square-rooting then making the original negative values negative: makes my data bimodal Natural log transform: can't do this with negative values Add a constant then log transform: this arbitrarily leaves my lowest value as an outlier '' transform (Cox, 2005; also Whittaker et al. 2005): makes my data bimodal Outlier removal (2.5 SD): doesn't fix normality, but an ANOVA on this data has similar results to an ANOVA on the raw data (for better or worse). Perform the non-parametric equivalent (Friedman test) and compare the results: will do this today   My supervisor suggests I should stick with the outlier removal though the data is still visibly skewed, and 'see what the reviewers suggest' but I just wanted to check here in case there was anything I was missing.  Original data:    With outliers (2.5 SD) replaced with the value at that criterion. I later decided to just exclude the outliers, so imagine the highlight data points in each condition removed.


The problem:  Let $ABC$ be an arbitrary triangle.  What is the minimum value $$\sum \frac{\sqrt{\sin A}}{\sqrt {\sin B}+\sqrt{\sin C}-\sqrt{\sin A}}?$$  I need a little help in simplifying the problem, so that I can finish it on my own. I do know that we can simply it before using the $\sum$, but  I don’t know how.

If $a,b,c$ are sides of triangle Find Minimum value of  $$S=\sum \frac{\sqrt{a}}{\sqrt{b}+\sqrt{c}-\sqrt{a}}$$  My Try:  Let $$P=\sqrt{a}+\sqrt{b}+\sqrt{c}$$  we have $$S=\sum \frac{1}{\frac{\sqrt{b}}{\sqrt{a}}+\frac{\sqrt{c}}{\sqrt{a}}-1}$$  $$S=\sum \frac{1}{\frac{P}{\sqrt{a}}-2}$$  Let $x=\frac{P}{\sqrt{a}}$, $y=\frac{P}{\sqrt{b}}$,$z=\frac{P}{\sqrt{c}}$  Then we have $$\frac{1}{x}+\frac{1}{y}+\frac{1}{z}=1$$  By $AM \ge HM$  $$\frac{x+y+z}{3} \ge \frac{3}{\frac{1}{x}+\frac{1}{y}+\frac{1}{z}}$$  Hence  $$x+y+z \ge 9$$  Any way to proceed further?


In school, especscially, one is not taught "why" we can change variables, dummy variables in integration.   $$\int_{a}^{b} f(x) dx$$  We can change the $x$ variable to $y$ for example.  The idea is that the value of the expression does not depend on the given variable correct?  This is known as the bound variable idea.  But how do we know that: the value of the expression does not depend on the given variable  ??  Is it an axiom, theorem?   Thanks.

I do not understand how dummy variables work in math.   Suppose we have:  $$I_1 = \int_{0}^{\infty} e^{-x^2} dx$$  How is this equivalent to:  $$I_2 = \int_{0}^{\infty} e^{-y^2} dy$$  How does this dummy variable system work?   Since $y$ is the dependent variable for $I_1$ How can $y$ itself be and independent variable for $I_2$  ??  Thanks!


Hi, I have a problem with Eevee, when i render an image the first few second it fine but when it finishes to render everything it goes white and i can't see anything in render layer. This is what i get every time i render and there is no other object that is hidden in the viewport or anything like that

A scene I made is not rendering, at all. This grey screen stays the same and nothing changes.  Here are my settings:  [


I was trying to solve a competitive coding question which required building a series 7,77,777,..., for that I wrote a code in c++ #include<iostream> #include<math.h> using namespace std; int main() {     int series=0;     for(int i=0;i<6;i++)     {         series += (pow(10,i))*7;     }     return 0; }  I was getting the required answer while dry-running but while running through MinGW compiler, the answer I got was 7,77,776,7776,77775,... does this have anything to do with bit conversion? I tried running the same code in python and got the required answer.

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


I have a simple algorithm to add a node in a sorted LinkedList in Java. The issue is with insertBefore method. When the call returns to the calling method, the reference (node) is not updated with pointing to the new node. Java is call by reference and should update the underlying object value, according to my understanding. Any help appreciated.  Below is the code:  public MyListNode<Integer> findAndInsert(MyListNode<Integer> node, int nbr) {      MyListNode<Integer> head = node;     MyListNode<Integer> tail = null;      boolean inserted = false;      //Sample Input: 2, 3, 5, 7, 9;  1     //Sample Output: 1, 2, 3, 5, 7, 9      if(nbr <= node.data)     {         insertBefore(node, nbr);         inserted = true;     }     else     {         while(node != null && node.next != null)         {             if( nbr <= node.next.data )             {                  insertAfter(node, nbr);                 inserted = true;                 break;             }              if(node.next.next == null)             {                 tail = node.next;             }              node = node.next;         }     }      if(!inserted)     {         insertAfter(tail, nbr);     }     return head; }  public void insertAfter(MyListNode<Integer> node, int i) {     MyListNode<Integer> n = new MyListNode<Integer>(new Integer(i));      n.next = node.next;     node.next = n; }  public void insertBefore(MyListNode<Integer> head, int i) {     MyListNode<Integer> newNode = new MyListNode<Integer>(new Integer(i));       newNode.next = head;     head = newNode; }

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


Can someone explains me why   ["23", "45", "67"].map(parseInt); returns [ 23, NaN, NaN ]  but   ["23", "45", "67"].map((e) => parseInt(e)); returns [ 23, 45, 67 ]  ?

From the :  [1,4,9].map(Math.sqrt)   will yield:  [1,2,3]   Why then does this:  ['1','2','3'].map(parseInt)   yield this:  [1, NaN, NaN]   I have tested in Firefox 3.0.1 and Chrome 0.3 and just as a disclaimer, I know this is not cross-browser functionality (no IE).  I found out that the following will accomplish the desired effect. However, it still doesn’t explain the errant behavior of parseInt.  ['1','2','3'].map(function(i){return +i;}) // returns [1,2,3]


Recently I worked on a game on Spritekit Engine. My question is not about spritekit, but generaly about game engines. When I write a loop code and run it (eg while i< 100000) my CPU usage goes to 100%, but when I run the test game there is no changes specially on CPU usage ,why is this so? (We know game engines runs in a loop that includes logic and graphic commands )

Generally, what are the core things that one should do in the game loop, and what are some things that one shouldn't do in the game loop?


I've been working on a solution of a problem in Java. I have a store and I need to ask the customer if she/he had bought anything. If he/she types "yes" I want the program to continue to the next question and if he/she types "no" I want a message to appears such as "have a nice day!" and then I want the program to stop. How can I manage this?  Thank you!  Here's what I've done so far ~Line 17 to 20~ (but it doesn't work very well):  import java.util.Scanner;  public class Discount {  public static void main(String[] args) {     String cname;     float I_price, drate, discount, dprice;      Scanner in = new Scanner(System.in);      System.out.println("Enter Costumers Name:");     cname = in.next();      System.out.println("Have you bought anything?");     if (cname == "no") {         System.out.println("Have a good day!");         System.exit(0);     }      System.out.println("Enter Price of Item:");     I_price = in.nextFloat();      System.out.println("Enter Discount Rate:");     drate = in.nextFloat();      discount = (I_price * drate / 100);     dprice = (I_price - discount);      System.out.println(             "Costumer Name:" + cname + "\n" + "Discount Rate:" + discount + "\n" + "Discounted Price:" + dprice + "\n");     } }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I hope someone can help me. Here's my issue:   I'd like to create a content type - let's call it News Story.   Amongst its other attributes, this content type will have a taxonomy field.   I would like to be able to create a number of views around my site to display a subset of the News Story content, based on its taxonomy value.   However, I do not want the News Story to generate a standalone node/page - I only want the news stories to appear in views of news stories.   Have you done this before? How did you do it?   I'd be really grateful for your help.   Thanks

When I'm developing sites in Drupal, I create various content types and taxonomy vocabularies that I use with Views to build displays. I might not ever want the nodes to be viewable in their own right or listed by taxonomy. Visitors may never figure out the URLs to do this, but I'd still like to lock this down.  I'm aware of various content access modules, and have considered theming taxonomy displays to simply say 'page not found'. But I've yet to find a simple solution, so wondered what other people use to prevent content from being viewed outside of a View?


this is a newbie question: I only made a bit of interface design in my life, and now I have to produce some printables - I used my old faithful Fireworks because Photoshop I don't know how to use quickly, I made documents 300 dpi, created vector graphics solid colour fill, RGB (well, I knew only the Pantone hex colors but Fireworks also puts the RGB number, don't know which one denotes the file) but whenever I try to print the colors are all meh and not very vivid, I exported PNG and JPEG highest quality, and I just don't seem to get a good image quality. I tried different papers, and different copy shops. What am I doing wrong please? Should I just redo everything with Photoshop or Indesign, would that change things?I have some vector graphics and fonts that I did myself and some photos processed with a filter by some apps, also 300 dpi I believe. What else can I do to get those pretty solid colors you see in commercial prints please? Thank you

I recently had some business cards printed, and was warned to use the CMYK colour space if providing TIF files.  When I tried saving from Paint Shop Pro to a CMYK, of course the colours came out very much duller, so I provided a different file type that preserved my colours using RGB. To my horror, the cards came back nevertheless converted to the CMYK dull shades.    A few months previously I had been in a hurry and had printed my own one-sided quasi business cards using glossy photo paper and a cheap home printer.  This reproduced my desired colours perfectly.  Since the whole point of using professional printers is quality (though I admit bulk as well), why do they not use printers that can cope with the RGB colour range?   FYI: the main colour in question, which I chose very carefully, is a slightly yellow-tinged lawn green, which I understand doesn't feature in the CMYK gamut.  So why use that gamut, and is there anything I can do to overcome this issue and get cards printed in the colour I have chosen?


I'm trying to get a head start before my A level and one thing I couldn't quite understand was why private ip addresses are used.  My current understanding is that mac addresses are used amongst local networks to send data. And public ip addresses are outside of LANs. Local ips are used within LAN's only so why are they needed if mac addresses do this aswell?  Another thing I don't understand completely is the private ip classes, A B and C. What is the difference between these?

I understand the reason public IP addresses are necessary to be that if we only had MAC to move data between one host and another, the entire Internet would be one massively flat network. But what is the need for private IP addresses? Why can't routers just connect to local clients using their MAC address?


We held a competition, and I am writing a Congratulations email to those who placed 1st, 2nd, and 3rd, but I don't know what to call them. Are they place-holders? There wasn't an award ceremony, so I don't feel that medalists works.

I am writing about a competition I won in which I got third place. I want to say that I am the first out of my school to get an award in this competition, with a third place award but that sounds a little bulky. What would be a short phrase or word to describe this. I am thinking maybe I can say "I placed in the competition" but I am not sure that will work.


Suppose there is a  earth thick, on the inner surface would the gravity be pointing outwards of centre of sphere with same strength as Earth's gravity?

Consider your typical  scenario.  You are standing on the inner side of the sphere.  You look up and see the shining sun far away.    My question (or thought experiment rather) is: Completely negating the gravitational forces, mass, etc. of the sun, if you could be placed anywhere within the radius of the Sphere, is there a point within the Sphere where you would float freely? The center seems the most obvious answer, but is it the only one? Keep in mind: standing at any point on the ground you have a "small" amount of mass beneath your feet, and FAR much more mass "above" you. Does this mass pull you more than the ground beneath your feet?


When one converts a list to a set in Python using the set() function, Python tries to simplify the set by removing repeated values from the list, as in the following example.  In [1]: list = [1,4,1]  In [2]: list Out[2]: [1, 4, 1]  In [3]: set = set(list)  In [4]: set Out[4]: {1, 4}   This is inconvenient when using sets to calculate properties of the list and converting back, as in the following vector subtraction example.  In [1]: a = [1,1,1]  In [2]: a Out[2]: [1, 1, 1]  In [3]: b = [1,2,3]  In [4]: b Out[4]: [1, 2, 3]  In [5]: list( set(a) - set(b) ) Out[5]: []   Clearly something went wrong: we were expecting the operation {1-1, 1-2, 1-3} = {0, -1, -2}. Instead, we have the following stored values.  In [6]: set(a) Out[6]: {1}  In [7]: set(b) Out[7]: {1, 2, 3}   This means we are calculating {1-1, ?-2, ?-3} = ?, which cannot be done.  Is there a way to retain the structure and values of a list when converting to a set in order to avoid this problem?  Clearly I am not talking about subtracting lists: I am talking about subtracting sets.

Right now I have vector3 values represented as lists. is there a way to subtract 2 of these like vector3 values, like  [2,2,2] - [1,1,1] = [1,1,1]   Should I use tuples?  If none of them defines these operands on these types, can I define it instead?  If not, should I create a new vector3 class?


Consider the Two Snippets     const sayMyName = wizard => {   wizard.name = 'Shazam'; }  let boy = { name: 'Billy' };  sayMyName(boy);  console.log(boy.name);     Since We know that objects in js are passed by reference hence a reference to boy object is assigned a property with value 'Shazam'. Since Object at the stored Reference is changed hence boy's name is changed to 'Shazam'.    const sayMyName = wizard => {   wizard = { name: 'Shazam' }; }  let boy = { name: 'Billy' };  sayMyName(boy);  console.log(boy.name);     Considering above case Here When Boy is passed in sayMyName function why it is behaving as pass by value and boy.name still return 'billy' ?

The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?