In Angular any simple way to set the focus (input cursor) on the start of input box string without jquery. Currently, I've used setFocus() {     this.testInput.nativeElement.focus();   }  but above code set cursor at the end of the input box string but I want to set the cursor at start. My html code &lt;input class=&quot;__input&quot; value=&quot;Hello-&quot; #testInput type=&quot;text&quot;&gt;  @ViewChild('testInput') input: ElementRef;  .
Does anybody know how to move the keyboard caret in a textbox to a particular position?  For example, if a text-box (e.g. input element, not text-area) has 50 characters in it and I want to position the caret before character 20, how would I go about it?  This is in differentiation from this question:  , which requires jQuery.
Is mass converted into energy in exothermic chemical/nuclear reactions?  My (A Level) knowledge of chemistry suggests that this isn't the case. In a simple burning reaction, e.g.   $$\mathrm{C + O_2 \to CO_2}$$  energy is released by the $\mathrm{C-O}$ bonds forming; the atoms lose potential energy when they pull themselves towards each other, in the same way that a falling object converts GPE to KE. There are the same number of protons, electrons etc. in both the reactants and products. I would have assumed that this reasoning extends to nuclear fission/fusion as well, but one physics textbook repeatedly references very small amounts of mass being converted into energy in nuclear reactions.  So I just wanted to know if I was wrong about either of these types of reactions, and if so, what mass is lost exactly? Where can I find the location of downloaded .deb files?  I want to copy this folder before I reinstall Ubuntu so I don't have to redownload the packages.  I am running Ubuntu 12.10 32-bit.  How can I do this? I see the following error while trying run the command shown below. I read somewhere that my /boot partition is low on disk space. How can I increase the size of the /boot partition so I can install more software? I have a 500GB hard disk, so there is enough space to play with.  sudo apt-get install libdvdread4  gzip: stdout: No space left on device                                                                                                                                                                                  E: mkinitramfs failure cpio 141 gzip 1                                                                                                                                                                                 update-initramfs: failed for /boot/initrd.img-3.2.0-33-generic with 1.                                                                                                                                                 run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1                                                                                                                                            Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-33-generic.postinst line 1010.                                                                                                        dpkg: error processing linux-image-3.2.0-33-generic (--configure):                                                                                                                                                      subprocess installed post-installation script returned error exit status 2                                                                                                                                            dpkg: dependency problems prevent configuration of linux-image-server:                                                                                                                                                 linux-image-server depends on linux-image-3.2.0-33-generic; however:                                                                                                                                                    Package linux-image-3.2.0-33-generic is not configured yet.    dpkg: error processing linux-image-server (--configure):     dependency problems - leaving unconfigured    dpkg: dependency problems prevent configuration of linux-server:     linux-server depends on linux-image-server (= 3.2.0.33.36); however:      Package linux-image-server is not configured yet.    dpkg: error processing linux-server (--configure):     dependency problems - leaving unconfigured    No apport report written because the error message indicates its a followup error from a   previous failure.                                                                                                           No apport report written because the error message indicates its a followup error from a previous failure.  Errors were encountered while processing:  linux-image-3.2.0-33-generic  linux-image-server  linux-server N: Ignoring file 'michael-gruz-canon-precise.list.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension N: Ignoring file 'michael-gruz-canon-precise.list.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension   Listed below is the output of du  Filesystem              1K-blocks      Used Available Use% Mounted on /dev/mapper/ubuntu-root 712660664 104095912 572363692  16% / udev                      3964792         4   3964788   1% /dev tmpfs                     1591012      1064   1589948   1% /run none                         5120         0      5120   0% /run/lock none                      3977528       684   3976844   1% /run/shm /dev/sda1                  233191    219821       929 100% /boot Using Mosfet with seperate Logic Converter and Arduino I am trying to use an IRLB3034 with an Arduino even though it is not a logic level MOSFET. I am planning on using an LM2937 12v regulator like the schematic below:    The connection going off the page goes to an Arduino digital pin pulled down with a 10k resistor. I assumed this would work but wanted to check. As a side note, if anyone could recommend a similar MOSFET that could handle 200a and 40v (in TH) that would be great. (Only if such thing excists or is readily available)  EDIT: I have not made it clear what I am planning on using this for so I will now. It is to drive an airsoft motor and I want to use the LM2937 because I didn't think I could turn the mosfet on and off with the arduinos 5v - because the IRLB3034 isn't a logic level mosfet - so that is the reason I added the 12v regulator.  EDIT (Sorry for the previous incorrect name)  EDIT: Unfortunately, I have made a mistake, the current is not 200 amps, it is infact 30-40 amps. I don't know how I made this mistake but I think it will be helpful for people trying to follow along. I am currently trying to use busbars/6awg copper wire to carry the high-ish current around. (Only 40 amps now though)  EDIT: This question is different because it is asking how to convert 5v to 12v to run a mosfet rather then how to use a mosfet with an arduino in the best way like the other post. The accepted answer on this post also answers the other question though. I haven't played Magic: the Gathering since the days of Onslaught and Mirrodin, and I would like to try to catch back up. Since all my cards are quite dated now, I may be more interested in formats other than the most up-to-date one.  Rather than ask what is currently legal in various formats (since that is likely too localized), I would rather pose the question of how can I tell which sets/cards are legal in each format. Is the sub-field of algebraic elements of a field extension of $K$ containing roots of polynomials over $K$ algebraically closed? Managing module library dependencies with composer I've found ,  and  which are releated to my question, but no longer seem to apply since Drupal 8.1 and the deprecation of .  Also popular guides such as  appear to no longer apply as they also mention composer manager.   The other solution opposed to composer manager, alter the core composer.json file feels like too much core hacking and would probably break with every Drush update of Drupal core(?).  More specifically, I am attempting to update  from Drupal 7 to 8. I have created my composer.json file as follows:  {   "name": "drupal/views_vcards",   "description": "Allows creation of vCards using the fields provided by the Views module.",   "type": "drupal-module",   "license": "GPL-2.0+",   "homepage": "https://drupal.org/project/views_vcards",   "require": {     "maennchen/zipstream-php": "0.3.*"   } }   But if I put a composer.json file in my module folder, how do I make Drupal aware that that file is there, and how do I make sure the required zipstream-php library is downloaded?  Simply running composer update from the Drupal root does update a lot of Drupal dependencies, but it does not include the composer.json files that are in the modules folders. I also don't assume I should be calling composer install from inside all modules with dependencies.  How do I make Drupal aware of a module's dependency without using composer manager and/or hacking core?  UPDATE:  The  appears to have support a wildcard path:  {     "require": {         "wikimedia/composer-merge-plugin": "dev-master"     },     "extra": {         "merge-plugin": {             "include": [                 "composer.local.json",                 "extensions/*/composer.json" // &lt; ---- THIS LINE             ],             "require": [                 "submodule/composer.json"             ],             "recurse": true,             "replace": false,             "merge-dev": true,             "merge-extra": false         }     } }   Why doesn't core merge modules/*/composer.json, that would solve everything right?  Update 2:  THe reasoning for not supporting this is covered in  (which also has been quiet for some time now). What is the white smoke-like fog called? C: pointer to struct in the struct definition How can I have a pointer to the next struct in the definition of this struct:  typedef struct A {   int a;   int b;   A*  next; } A;   this is how I first wrote it but it does not work. Show $\sin x = bx$ has at least 3 real solutions. Show $\sin x=bx$ has at least 3 real solutions for every $b$, where $-\dfrac{2}{3 \pi} &lt; b &lt; \dfrac{2}{\pi}$.   Some useful facts I am trying to use:  Intermediate value theorem: If $f$ is a continuous real-valued function on $[a,b]$ and $d \in \mathbb{R}$ satisfies $f(a)&lt; d&lt; f(b)$, then there exists a point $c$ in $(a,b)$ such that $f(c) = d$.   Corollary: If $f$ is a continuous real-valued function on $[a,b]$, then $f([a,b])$ is a closed interval. Whenever we have a changing magnetic flux through a conductor an induced electric field is generated. It is often said that these induced electric field lines are circular in shape.But why is this so?Why are these field lines not elliptical for example? How can this shape be mathematically derived?  Also does this have anything to do with equipotential surfaces?Do such non-conservative electric fields even produce a potential field?If not why? I want to do something like String.Format("[{0}, {1}, {2}]", 1, 2, 3) which returns:  [1, 2, 3]   How do I do this in Python? Earth Engine convert list with coordinates and values into a feature collection for export I need to create a feature collection from a list containing coordinates and band values.  These are extracted from a landsat image as shown in this linked script.    I'm unable to find a solution in creating a feature collection.  Here is the tail end code.  var valuesList = joinedImage.reduceRegion({   reducer: ee.Reducer.toList(4),   geometry: myGeometry }).values().get(0);  var feature = ee.Feature(null, valuesList);   // Wrap the Feature in a FeatureCollection for export. var myFeatures = ee.FeatureCollection([feature]);   // Export the image, specifying scale and region. Export.table.toDrive(myFeatures, "data", "myData", "B4-B5",  "CSV");   This doesn't work, because it is clearly the wrong way to create the feature collection.  I've tried to create it similar to Rodrigo E. Principe's solution of mapping a Feature Collection but I can't seem to create the initial feature collection to start with. I am running Ubuntu 15.10 with Gnome DE.  I installed KDE plasma to try it out but sudo apt-get upgrade started giving me errors so I ppa-purged the kde ppa and removed kubuntu desktop with the terminal in Gnome.  Now when I run sudo apt-get upgrade , I get the following error:    The following packages have unmet dependencies:     kde-telepathy-minimal : Depends: kde-config-telepathy-accounts      (&gt;= 15.04.0) but it is not installed.   sudo apt-get install -f does not resolve the issue. I tried sudo apt-get remove kde-telepathy-minimal to remove the package which gives me this error:    The following packages have unmet dependencies: kde-telepathy : Depends: kde-telepathy-minimal   Attempting to remove 'kde-telepathy' gives me the original error.  I am stuck. Please help me and thank you Ubuntu community! So what I decided to do is to start a small case with only 3 people. There are three possible combinations that I could pair up the people, using the symbols A, B, and C to represent the persons involved: A&amp;B, A&amp;C, B&amp;C. The probability of each pair having the same birthday is $1\over365$ (the first guy gets any birthday, and the second guy only gets one birthday to choose from). What my intuition directed me to do next is to find the probability that any of the three events are true, or the union of the three events, which involved adding up the probabilities.   To put this generally, the equation for the probability SHOULD be:  ${n \choose 2} \div 365$  However, clearly this is not the case since $n \choose 2$ gets over 365 when $n = 28$. And with 28 people, there is obviously still a chance that they all have different birthdays (Person 1 has Jan. 1, Person 2 has Jan. 2. ... Person 28 has Jan. 28). Could anyone tell me what's wrong with my intuition? I don't want to know what's the right solution, I just want to know what's wrong with my solution .. it makes sense to my intuition, even though it's incorrect. Can I create a shortcut to open a specific application on OS X? I want to create a keyboard shortcut to i.e. open Firefox while I am working in another application. I know I can use ⌘ CMD+T when I am in Firefox to open a new tab.   I haven't found a way to create that kind of shortcuts in System Preferences.  Any ideas? Strange grey bordering/outline in Illustrator I made a couple of vector shapes in AI and I get this strange thin border appearing around them. I can't get rid of it. Any suggestions?    Zoomed in: How do I create RAW TCP/IP packets in C++? I'm a beginning C++ programmer / network admin, but I figure I can learn how to do this if someone points me in the right direction. Most of the tutorials are demonstrated using old code that no longer works for some reason.   Since I'm on Linux, all I need is an explanation on how to write raw Berkeley sockets. Can someone give me a quick run down? I'm trying to find the longest consecutive set of composite numbers Hello and I'm quite new to Math SE.  I am trying to find the largest consecutive sequence of composite numbers. The largest I know is:  $$90, 91, 92, 93, 94, 95, 96$$  I can't make this series any longer because $97$ is prime unfortunately.  I can however, see a certain relation, if suppose we take the numbers like (let $a_1, a_2, a_3,...,a_n$denote digits and not multiplication):  $$a_1a_2a_3...a_n1,\ a_1a_2a_3...a_n2,\ a_1a_2a_3...a_n3,\ a_1a_2a_3...a_n4,\ a_1a_2a_3...a_n5,\ a_1a_2a_3...a_n6,\ a_1a_2a_3...a_n7,\ a_1a_2a_3...a_n8,\ a_1a_2a_3...a_n9,\ a_1a_2a_3...(a_n+1)0$$  The entire list of consecutive natural numbers I showed above can be made composite if:   The number formed by digits $a_1a_2a_3...a_n$ should be a multiple of 3 The numbers $a_1a_2a_3...a_n1$ and $a_1a_2a_3...a_n7$ should be composite numbers   If I didn't clearly convey what I'm trying to say, I mean like, say I want the two numbers (eg: ($121$, $127$) or ($151$, $157$) or ($181$, $187$)) to be both composite.  I'm still quite not equipped with enough knowledge to identify if a random large number is prime or not, so I believe you guys at Math SE can help me out. After plain installation of Ubuntu 16.04 LTS gnome-software doesn't work. It has opened once with GUI, but installation of Unity Tweak Tool didn't finish.  When starting again, GUI doesn't come up. When opening from terminal, a warning appears, but the application GUI doesn't open.  $ gnome-software (gnome-software:7052): Gs-WARNING: failed to open plugin /usr/lib/gs-plugins-9/libgs_plugin_xdg_app_reviews.so: /usr/lib/gs-plugins-9/libgs_plugin_xdg_app_reviews.so: cannot open shared object file: No such file or directory   Does anybody have same experience, and eventually, a solution?    According to the recommendation:  $ dpkg-query -S /usr/lib/gs-plugins-9/libgs_plugin_xdg_app_reviews.so gnome-software: /usr/lib/gs-plugins-9/libgs_plugin_xdg_app_reviews.so   Proposed reinstall of gnome-software did not help.    As workaround, use Synaptic Package manager and command line.