I am new to android. I am trying to make a navigation drawer with the help   URL.  Everything works perfectly except one thing.  In my activity_home layout, when I try to add a menu(named drawer_view), in design view of this layout, it is displaying a rendering problem.    Its been about a day that I tried on google for the solution but nothing works.  Please help me out for the same.  Here is the activity_home.xml  <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     android:id="@+id/drawer_layout"     android:layout_width="match_parent"     android:layout_height="match_parent">     <!-- The main content view -->     <LinearLayout         android:layout_width="match_parent"         android:layout_height="match_parent"         android:orientation="vertical">      <!-- The ActionBar displayed at the top -->     <include         layout="@layout/toolbar"         android:layout_width="match_parent"         android:layout_height="wrap_content" />     <FrameLayout         android:id="@+id/content_frame"         android:layout_width="match_parent"         android:layout_height="match_parent"         />     </LinearLayout>     <android.support.design.widget.NavigationView         android:id="@+id/nvView"         android:layout_width="wrap_content"         android:layout_height="match_parent"         android:layout_gravity="start"         android:background="@android:color/white"         app:menu="@menu/drawer_view"         app:headerLayout="@layout/nav_header"         />  </android.support.v4.widget.DrawerLayout>   Here is the drawer_view.xml  <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" >      <group android:id="@+id/group_feature"         android:checkableBehavior="single"          >         <item android:id="@+id/first_item"             android:checked="true"             android:icon="@drawable/coc"             android:title="@string/first_name"/>         <item android:id="@+id/second_item"             android:checked="true"             android:icon="@drawable/cricinfo"             android:title="@string/second_name"/>          <item android:id="@+id/third_item"             android:checked="true"             android:icon="@drawable/flipkart"             android:title="@string/third_name"/>      </group>     <group android:id="@+id/group_settings"         android:checkableBehavior="single">         <item android:id="@+id/navdrawer_item_settings"             android:icon="@drawable/setting"             android:title="@string/action_settings"/>      </group> </menu>   Here is my style.xml file  <resources>     <!-- Base application theme. -->     <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">         <item name="colorPrimary">#673AB7</item>         <item name="colorPrimaryDark">#512DA8</item>         <item name="colorAccent">#FF4081</item>      </style>     Here is the nav_header.xml code  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="192dp"     android:background="?attr/colorPrimaryDark"     android:padding="16dp"     android:theme="@style/Base.ThemeOverlay.AppCompat.Dark"     android:orientation="vertical"     android:gravity="bottom">      <TextView         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:text="Header"         android:textColor="@android:color/white"         android:textAppearance="@style/Base.TextAppearance.AppCompat.Body1"/>  </LinearLayout>   Thanks


I want to make my navigation in secure way and I won't buying  vpn services as expressvpn etc.. openvpn can do this by installing on the PC that I use to navigate?  If yes can you link me any guide to configure it ?  Thanks a lot.

I saw a thing called VPN connections under the Internet button at the top of my screen.   So I would like more info on this, and possibly instructions on how to set one up. Thanks!


I'd written a tiny c program. The code compiled successfully by GCC 4.8.5 20150623 (Red Hat 4.8.5-4) with -std=c99, but gave me a warning. I cannot deal with the warning, and I even don't known what's wrong with it. The code is here:  #include <stdio.h> #define COLS 4 int SumOf2DArray(const int array[][COLS], int rows); int SumOfArray(const int array[], int element_number); int main(void) {   int sum_of_array0, sum_of_2d_array, sum_of_array1;   int *array, (*dimensions)[COLS];   array = (int [2]){10, 20};   dimensions = (int [2][COLS]){{1, 2, 3, -9}, {4, 5, 6, -8}};   sum_of_array0 = SumOfArray(array, 2);   sum_of_2d_array = SumOf2DArray(dimensions, 2);   sum_of_array1 = SumOfArray((int []){4, 4, 4, 5, 5, 5}, 6);   printf("sum_of_array0 = %d \t sum_of_2d_array = %d \t sum_of_array1 = %d\n",     sum_of_array0, sum_of_2d_array, sum_of_array1);   return 0; } int SumOf2DArray(const int array[][COLS], int rows) {   int sum_of_2d_array = 0;   for (int rows_i = 0; rows_i < rows; rows_i++) {     for (int cols_i = 0; cols_i < COLS; cols_i++) {       sum_of_2d_array += array[rows_i][cols_i];     }   }   return sum_of_2d_array; } int SumOfArray(const int array[], int element_number) {   int sum_of_array = 0;   for (int i = 0; i < element_number; i++) {     sum_of_array += array[i];   }   return sum_of_array; }   And the warning is here:  chapter10_compound_literals.c: In function ‘main’: chapter10_compound_literals.c:25:3: warning: passing argument 1 of ‘SumOf2DArray’ from incompatible pointer type [enabled by default]    sum_of_2d_array = SumOf2DArray(dimensions, 2);    ^ chapter10_compound_literals.c:15:5: note: expected ‘const int (*)[4]’ but argument is of type ‘int (*)[4]’  int SumOf2DArray(const int array[][COLS], int rows);   Now, I assume I have a 2d-array: int array[2][3] = {{1, 2, 3}, {3, 4, 5}}, and I have a function: int SumOf2DArray(const int array[][3], int rows).   The way in the code above is using a pointer(int (*pointer)[3] = array), but get a warning, and I have tried to pass argument using array directly, but the same warning.  How I can pass the array to the function?

The following code snippet (correctly) gives a warning in C and an error in C++ (using gcc & g++ respectively, tested with versions 3.4.5 and 4.2.1; MSVC does not seem to care):  char **a; const char** b = a;   I can understand and accept this. The C++ solution to this problem is to change b to be a const char * const *, which disallows reassignment of the pointers and prevents you from circumventing const-correctness ().  char **a; const char* const* b = a;   However, in pure C, the corrected version (using const char * const *) still gives a warning, and I don't understand why. Is there a way to get around this without using a cast?  To clarify: 1) Why does this generate a warning in C?  It should be entirely const-safe, and the C++ compiler seems to recognize it as such. 2) What is the correct way to go about accepting this char** as a parameter while saying (and having the compiler enforce) that I will not be modifying the characters it points to? For example, if I wanted to write a function:  void f(const char* const* in) {   // Only reads the data from in, does not write to it }   And I wanted to invoke it on a char**, what would be the correct type for the parameter?


I have saved some references in a library.bib file, using JabRef. One of these entries is the following:   @Article{Feng2014,      author = {Bo Feng, Mengyin Fu, Hongbin Ma, Yuanqing Xia, Bo Wang},     title = {Kalman filter with recursive covariance estimatio - sequentially estimating process noise covariance},      journal = {IEEE Transactions on Industrial Electronics},     year = {2014},      volume = {61},     number = {11},     pages = {6253-6263} }   Now I want to include citations in my TeX-document:   \documentclass{article}   \usepackage[backend=biber,citestyle=ieee,sorting=none,dateabbrev=false,urldate=comp]{biblatex} \addbibresource{./library.bib} \begin{document} \section{First Section} Equations given in this section have been taken from \cite{Feng2014} and \printbibliography[heading=bibintoc] \end{document}   I am running PDFLaTeX, Biber, PDFLaTex, PDFLaTeX. The references should be included as numbers, such as [1], wherever the citation is used. Instead of the number, however, the name of the BibTeX-key is given. And the reference is not included in the bibliography.   I have tried to make this a MWE. When I run this code now, the bibliography is not printed at all and the reference within the text is given as the BibTeX-key.

I use  to store all articles I need and bibtex4word add-on (in MS Word) to maintain the reference list. So, I would like to know how to properly fill the "author" field in Jabref with multiple authors to appear them correct in the reference list.  For example, I've got the article with several authors:      E. Orti, J.L. Bredas, C. Clarisse   And I would like them to appear in this manner. But instead I get this:     C. C. E. Orti, J. L. Bredas


One of the problems in my latest logic homework asks us to prove ⊢B→(A→B) using any of the many rules of natural deduction. I've been at it for several minutes yet can't seem to find a way to solve this... my answer always turns out to be dependent on assumptions I'm unable to eliminate. Is it actually even possible to provide proof when there are no premises? If so, how (in this particular case)?

So I have a question regarding natural deduction, are we allowed to "copy" our previous assumption inside a new assumption. I will use an example to illustrate.  $\vdash$ $P\Rightarrow(Q\Rightarrow P)$  So here are my steps.  1.) $P$             Assumption  2.)$Q$             Assumption  3.)$P$             Copy (1)  4.)$Q \Rightarrow P$   Implication Introduction  5.)$P \Rightarrow (Q \Rightarrow P)$ Implication Introduction  Is my proof correct, or is there something missing.


I am wondering the following question.     Let $A$ be a ring. Is it always true that End$_A(A)\cong A$. Is true when $A$ is semisimple?   I tried to give an isomorphism $\phi$ between End$_A(A)$ and  $A$. $\phi(f)=f(1)$, but I don't know if I am right.  Thanks for your help.

Given a ring $R$, how to prove that $\operatorname{End}_R(R)\cong R^{\mathrm{op}}$, where $R^{\mathrm{op}}$ is the opposite ring of $R$.   I read this proposition somewhere, but I think it is wrong. Because for any given $f\in\operatorname{End}_R(R) $ and any $r$ in $R$, we can get $f(r)$ by $r f(1)$, and $f(1)$can only be $1$, so $\operatorname{End}_R(R)$ is isomorphic to the trivil group.   Is there anything wrong with my logic? Please help me identify where I am wrong in my understanding of $\operatorname{End}_R(R)$. Thanks!


I ran SVM with several kernels on my data. RBS has the best performing results. The task is similar to the text classification. I wonder how I can explain why RBS is actually the best kernel for my task. I can simplify the task a bit, and compare RBS with only linear. I user libsvm to train and test.

When using SVM, we need to select a kernel.  I wonder how to select a kernel. Any criteria on kernel selection?


I have a long series of implied statements as follows:    I am using the following code to generate it in Latex (I am using AMS Math):  \[   \begin{alignedat}{2}     &&\sqrt{x^2+y^2} &= r \\     &\implies& x^2+y^2 &= r^2 \\     &\implies& x &= a   \end{alignedat} \]   But I don't think this is the correct way. What should be the way to typeset this?

I want to generate the following mathematics:   The code I am using is this (I am using AMS Math):  $$   \begin{alignedat}{2}     &&           \sqrt{x^2+y^2} &= r \\     &\implies&   x^2+y^2        &= r^2   \end{alignedat} $$   But I don't think that this is the correct way. Is there a better way?  Also, is the typesetting in the picture wrong? If it is so, then what should be the correct code?


Error mounting /dev/sda5 at /media/highpana/OS: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000" "/dev/sda5" "/media/highpana/OS"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda5': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option. (udisks-error-quark, 0)

Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.  When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.    Here's my partition table, if any more data is needed please let me know.     Device Boot      Start         End      Blocks   Id  System /dev/sda1            2048    20000767     9999360   83  Linux /dev/sda2        20002814   478001151   228999169    5  Extended /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris /dev/sda5        20002816   478001151   228999168   83  Linux


Answers I want to describe a sad situation that I encountered here recently. I joined a subcommunity "Russian language" cause I am interested in linguistics and had some experience of working in a Russian language magazine as an editor.  So I posted some replies and got a comment that they are bad and too broad and pretty harsh commands in a style "do this, don't do that" from some of the old-timers here. Anyway I disagreed and said I was probably right and had some experience (maybe that was wrong to say). After that this guy started insulting me implying that I lie about my previous work and telling that his 4-year exp. here matters much more! Then we had a bit of unpleasant talk and later he deleted ALL his comments in it.  That was all a bit rude, but no problem, maybe my answer was a bit broad, I admit that. Bad things started later. He started putting minuses to all my answers (moreover 2 minuses at a time) and told me that he would do it further cause I "don't understand in a good way".  But I really wanted to take part in this community. I wrote to moderator using a standard form, but got no reply. (maybe he is a moderator himself?)  What should I do? I don't want to have all my answers minused (with 2 minuses at the same time - dunno why) Here he threatens me to "control" all my answers -  (sorry it's in Russian) Here he "controls" them -   Sorry about that question, I don't want to have quarrels or drama, just want to have friendlier attitude and not being minused cause someone dislike me personally. Whom should I contact about it if moderator option doesn't work?

While browsing Stack Overflow, I noticed that I lost a lot of reputation:        Is this serial downvoting? Will it be corrected by a rep-recalculation? How often are those done?    Here's a second instance:


So Sauron had to trick the elves/Celebrimbor into making tainted rings for him. The reason he couldn't just cut out the middle man and make them himself, using his fair physical form, was because........?

Among all the rings of power, the 3 rings possessed by Elves are special in that they (unlike Men's and Dwarves' and The one) were made by Elves and not Sauron.  Why?  As in,   Were they made before Sauron conceived of the idea of making the Rings and controlling them with the One? Were they made before Sauron knew HOW to make Rings of power, by Elves on his request so that he could learn the process? Were they made because Elves didn't trust him and preferred to roll their own modules instead of downloading from CPAN? Other?   Canon supported answers only, please.


I have some problems formatting code on so. If i use only 4 spaces in the code snipped in this post: , the code will not be formatted as code.  I think it has some thing to do with the list (1, 2, 3), but i've made break between the code and the list.  Is there i bug right now?

Consider the following piece of Markdown code:  This is some regular text.      >>> def factorial(n):     ...     return 1 if n < 2 else n * factorial(n - 1)     ...   * This is a list item.      >>> def factorial(n):     ...     return 1 if n < 2 else n * factorial(n - 1)     ...    Notice that the second code block is preceded by a list item.   Why is the factorial code not properly formatted under these circumstances? To demonstrate the problem, I'll insert the Markdown code show above:    This is some regular text.  >>> def factorial(n): ...     return 1 if n < 2 else n * factorial(n - 1) ...     This is a list item                 def factorial(n):       ...     return 1 if n < 2 else n * factorial(n - 1)       ...               This applies to numbered as well as unnumbered lists.


I know that for some pages Google lists the results as can be seen in the following screenshot:    As you can see, main navigation pages (About, Constructed, Contact etc.) are shown in an indented and table-like manner before the other results (urbalize.tumblr.com etc.) are shown.  My question is: How can I get Google to show the results of my (wordpress) page in the same way?  What I already tried: I assumed that submitting my sitemap (via sitemap.xml) to Google would help, but it didnt.   Is there anything else I have to do?

My website used to have sitelinks and now it doesn't. It's very possible that it's due to changing the website to a sidebar design instead of having an "interstitial" type landing page which limited the number of choices, but I'm not sure.  Here is how sitelinks might look for a site:    What are some things that I can do to improve my chances of getting sitelinks?


Coming from a Java background, I've got used to creating an object and using it's methods in main class by referencing the object and it's method, for example:  object.objectMethod();   Having different classes with identical-named methods wasn't an issue, but now I'm doing a project in Arduino which is pretty much C++. A  on using classes in Arduino suggests using class name and double colons in .cpp file before every single method. A bit of googling led me to believe that this is called a namespace. Further googling on namespaces in C++ yielded various options of use of namespaces, but none of them were like the one in the Arduino tutorial and that got me puzzled.  My question: what is the appropriate use of namespaces and if using it as in linked tutorial is a good practice?

I come from a Java background, where packages are used, not namespaces. I'm used to putting classes that work together to form a complete object into packages, and then reusing them later from that package. But now I'm working in C++.  How do you use namespaces in C++? Do you create a single namespace for the entire application, or do you create namespaces for the major components? If so, how do you create objects from classes in other namespaces?


I have deleted sources.list.d directory from /etc/apt/ on my  ubuntu 16.04 system. Now, I dont know how to get that directory.

I'm still a little new to Ubuntu and was wondering how I can copy files, in this case Aptana Studio, to /usr/local/ without being denied.   Is there a way to do it in terminal? Or a way to allow myself permission?  I should add that I am using 10.10 Desktop edition, not server.


Background  We are proving that two free groups on sets $S_1,S_2$ are isomorphic iff the sets have the same cardinality. If they are finite, it's easy to show, by the freeness of the groups, that $2^{|S_1|}=2^{|S_2|}$, and thus the cardinalities are the same. Otherwise the power sets are in bijection, which is shown in the same way.  The problem is that in the infinite case, I'm not sure how to prove that bijection of power sets implies bijection of sets. I tried by contradiction, but only got stuck with one p.s. being in bijection with a proper subset of the other and not being able to rule out that this proper subset be in bijection with the whole p.s.  Question  Is it true that if the power sets of two sets are in bijection, then the two sets also are? If so, how do I prove it? Otherwise, can you provide a  counterexample? And if this does not hold how do I complete the proof in the background section?

I am really sure that if two sets have the same power set, then they are the same set. I just am wondering how does one exactly go about proving/showing this?  I'm usually wrong, so if anyone can show me an example where this fails, I'd like that too.  The homework just asks for true/false, but I'm wanting to show it if possible. My thoughts are that since the power set is by definition the set of all subsets of a set, if each of the two power sets are identical, we have an identity map between each set, thus it's indistinguishable which power set is a given set's power set. I hope that wasn't verbose. Since a set has only one power set, we can conclude they are in fact the same set.


Suppose I've typed   cd Documents/dir1/    I want to remove only dir1 from that input so that I get   cd Documents/   This has been asked in in , but I couldn't find what I was looking for.

Possible Duplicate:          Is there a short-cut in bash that lets you delete the last part of a path?  Example: /usr/local/bin should become /usr/local/ (or /usr/local)  I know of Ctrl+w but it deletes the complete last word and I'd like to retain that functionality, too.


What is the best way to check if the directory a file is going to be written to exists, and if not, how to create the directory using Python? Does a flag exists as "open", that makes this happen automatically?

What is the most elegant way to check if the directory a file is going to be written to exists, and if not, create the directory using Python? Here is what I tried:  import os  file_path = "/my/directory/filename.txt" directory = os.path.dirname(file_path)  try:     os.stat(directory) except:     os.mkdir(directory)         f = file(filename)   Somehow, I missed os.path.exists (thanks kanja, Blair, and Douglas). This is what I have now:  def ensure_dir(file_path):     directory = os.path.dirname(file_path)     if not os.path.exists(directory):         os.makedirs(directory)   Is there a flag for "open", that makes this happen automatically?


I'm making a generic linked list and I have to make two sets of data.  First file is "auto.txt" which contains information about cars in the following format:  Brand Model Year   Second file is "moto.txt" which contains information about motorcycles in the following format:  Brand Model Year Engine   I made a two-way linked list and I need to make two lists, one containing the motorcycles and other containing cars. However, I get the following errors:  cannot convert from 'L3_Console.Car' to 'T' cannot convert from 'L3_Console.Motorcycle' to 'T'   This is my code:  class Program {     static void Main(string[] args)     {         GenList<Car> Cars = Read<Car>("auto.txt");         GenList<Motorcycle> Motorcycles = Read<Motorcycle>("moto.txt");     }      public static GenList<T> Read<T>(string Failas)     {         GenList<T> List = new GenList<T>();         using (StreamReader reader = new StreamReader(File.Open(Failas, FileMode.Open), Encoding.GetEncoding(1257)))         {             string line;             while ((line = reader.ReadLine()) != null)             {                 string[] parts = line.Split(' ');                 if (typeof(T) == typeof(Car)) List.Add(new Car(parts[0],parts[1],int.Parse(parts[2]))); //error here                 else if (typeof(T) == typeof(Motorcycle)) List.Add(new Motorcycle(parts[0], parts[1], int.Parse(parts[2]),parts[3])); //error here             }         }         return List;     } }  public sealed class GenList<T> {     private sealed class Node<T>     {         public T Data { get; set; }         public Node<T> Previous { get; set; }         public Node<T> Next { get; set; }          public Node() { }          public Node(T data, Node<T> adr_p, Node<T> adr_n)         {             Data = data;             Previous = adr_p;             Next = adr_n;         }     }      private Node<T> start;     private Node<T> end;     private Node<T> current;       public GenList()     {         this.start = null;         this.end = null;         this.current = null;     }      public void Add(T data)     {         var dd = new Node<T>(data, null, start);         if (start != null)             start.Previous = dd;         else end = dd;         start = dd;     }  } public class Car {     public string Brand { get; private set; }     public string Model { get; private set; }     public int Year { get; private set; }      public Car(string brand, string model, int year)     {         Brand = brand;         Model = model;         Year = year;     } } public class Motorcycle {     public string Brand { get; private set; }     public string Model { get; private set; }     public int Year { get; private set; }     public string Engine { get; private set; }      public Motorcycle(string brand, string model, int year,string engine)     {         Brand = brand;         Model = model;         Year = year;         Engine = engine;     } }   How do I properly add a new node to the list, containing a class which depends on how the function was called? Thank you

EDIT:  I found out that I can get it to compile if I cast the IMetadataType object to the TMetadata type.  Why do I need to do this?  EDIT #2:  The "Values" property is a .NET dictionary of type <TMetadata, TData>.  I have this generic method:  private void FillMetadata<TMetadata, TData>     (Metadata<TMetadata, TData> oMetadata) where TMetadata : IMetadataType {     IMetadataType o;     oMetadata.Values.Add(o, (TData)(object)GetValue()); }   I have stripped the implementation to simplify it (I actually use a real object, not the IMetadataType declared here).  My question is, why doesn't this compile?  The compile error is on the Add() method:  "cannot convert from 'IMetadataType' to 'TMetadata'."  Isn't that what the "where" clause on the method is for?  What am I missing?


I read a printed byte in a file, as a string:  a = "b'\xa0-\xfc\xa3\xf8\xd9'"    type(a) is str.  How should I decode it?  The decoded value should be a02dfca3f8d9.  A part the file is uploaded here:   [PICA8-P3297] dl-dst output #1 OFPFlowMod(actions=[OFPActionOutput(max_len=65509,port=45)],buffer_id=4294967295,command=0,cookie=16895774056056650001,flags=0,hard_timeout=0,idle_timeout=0,match=OFPMatch(dl_dst=b'\xa0-\xfc\xa3\xf8\xd9',dl_src=b'\x00\x00\x00\x00\x00\x00',dl_type=0,dl_vlan=0,dl_vlan_pcp=0,in_port=0,nw_dst=0,nw_proto=0,nw_src=0,nw_tos=0,tp_dst=0,tp_src=0,wildcards=4194295),out_port=65535,priority=1)   I open and get the dl_dst value in the file by this line:  dl_dst = fm_line.split('OFPMatch')[1].split(',')[0].split('=')[1]   dl_dst is supposed to be a Mac Address. My question is how to convert it?  As suggested, I tried:  print(''.join(["{0:x}".format(ord(char)) for char in dl_dst[2:-1]]))   But the printed resuls is 275c5c7861302d5c5c7866635c5c7861335c5c7866385c5c78643927, which is not what I expected.

I'm using this code to get standard output from an external program:  >>> from subprocess import * >>> command_stdout = Popen(['ls', '-l'], stdout=PIPE).communicate()[0]   The communicate() method returns an array of bytes:  >>> command_stdout b'total 0\n-rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file1\n-rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file2\n'   However, I'd like to work with the output as a normal Python string. So that I could print it like this:  >>> print(command_stdout) -rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file1 -rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file2   I thought that's what the  method is for, but when I tried it, I got the same byte array again:  >>> binascii.b2a_qp(command_stdout) b'total 0\n-rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file1\n-rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file2\n'   How do I convert the bytes value back to string? I mean, using the "batteries" instead of doing it manually. And I'd like it to be OK with Python 3.


I have a JSONObject where I need to rename some keys if a value exists in a map. This keeps throwing ConcurrentModificationException. Any way to achieve this instead of going through multiple loops?  JSONObject jsonObject = new JSONObject(result); jsonObject.keySet().stream().forEach(key -> {     if (someMap.containsKey(key)) {          jsonObject.put(someMap.get(key), jsonObject.get(key)); //Update the key in jsonObject with same value         jsonObject.remove(key);     } });

We all know you can't do the following because of ConcurrentModificationException:  for (Object i : l) {     if (condition(i)) {         l.remove(i);     } }   But this apparently works sometimes, but not always. Here's some specific code:  public static void main(String[] args) {     Collection<Integer> l = new ArrayList<>();      for (int i = 0; i < 10; ++i) {         l.add(4);         l.add(5);         l.add(6);     }      for (int i : l) {         if (i == 5) {             l.remove(i);         }     }      System.out.println(l); }   This, of course, results in:  Exception in thread "main" java.util.ConcurrentModificationException   Even though multiple threads aren't doing it. Anyway.  What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception?  I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.


I have data:  7456 7456 0 0 0 2 7463 7463 0 0 1 2   I want to add column headers so the output is:  FID IID PAT MAT SEX PHENOTYPE  7456 7456 0 0 0 2 7463 7463 0 0 1 2   I have tried echo -e "FID\tIID\tPAT\tMAT\tSEX\tPHENOTYPE" | cat file1 > file2  But this is copying the original file and not the headers.  sed '1i\FID, IID, PAT, MAT, SEX PHENOTYPE' file1 > file2   has the error  sed: 1: "1i\FID, IID, PAT, MAT,  ...": extra characters after \ at the end of i command   Any advice please?

I've been looking around sed command to add text into a file in a specific line. This works adding text after line 1:  sed '1 a\   But I want to add it before line 1. It would be:  sed '0 a\   but I get this error: invalid usage of line address 0.  Any suggestion?


I have the following piece of code as a problem.  list = [ [ ] ] * 5 print list list[0].append(1) print list   The first line prints [[][][][][]] which is what it should print  but the second print gives  [[1][1][1][1][1]]  why does this happen? it is supposed to append only to the first list.

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


After many hours of searching I still haven't found a solution to the following problem. In my game I make use of an abstract factory which generates objects. I'm trying to pass a function made in this factory, which generates bullets, to enemy. For this I tried using a function pointer which points to factory->getBullet() and passing it with the constructor of enemy. It failed :)  #include "Factory.h" int main()  {     Factory* f = new Factory();     f->getEnemy(&f->getBullet);     return 0; }   Factory.h  #include "Enemy.h"; #include "Bullet.h"; class Factory { public:     Factory();     virtual ~Factory();     Enemy* getEnemy(Bullet* (*getBulletPtr)(int));     Bullet* getBullet(int damage); };   Factory.cpp  #include "Factory.h" Factory::Factory() {} Factory::~Factory() {}  Enemy* Factory::getEnemy(Bullet* (*getBulletPtr)(int)) {return new Enemy(getBulletPtr);}  Bullet* Factory::getBullet(int damage) {return new Bullet(damage);}   Enemy.h  #include "Bullet.h" class Enemy {     private:         Bullet* (*getBullet)(int) = NULL;     public:         Enemy(Bullet* (*getBulletPtr)(int));         virtual ~Enemy(); };   Enemy.cpp  #include "Enemy.h" Enemy::Enemy(Bullet* (*getBulletPtr)(int)) {     getBullet = getBulletPtr;     getBullet(10); }  Enemy::~Enemy() {}   Bullet.h  #include <iostream> using namespace std;  class Bullet { public:     Bullet(int damage);     virtual ~Bullet(); };   Bullet.cpp  #include "Bullet.h" Bullet::Bullet(int damage) {     cout << "This is a bullet: Damage:"<< damage << endl; }  Bullet::~Bullet() {}   When I try to run this code I get the following error:  ISO C++ forbids taking the address of a bound member function to form a pointer to member function.  Say '&Factory::getBullet' [-fpermissive]   When I change   f->getEnemy(&f->getBullet);   to   f->getEnemy(&Factory::getBullet);   I get the following error:  no matching function for call to 'Factory::getEnemy(Bullet* (Factory::*)(int))'   How can I pass factory->getBullet function to my enemies.  Any help would be appreciated!

I am trying to pass a member function within a class to a function that takes a member function class pointer.  The problem I am having is that I am not sure how to properly do this within the class using the this pointer.  Does anyone have suggestions?  Here is a copy of the class that is passing the member function:  class testMenu : public MenuScreen{ public:  bool draw;  MenuButton<testMenu> x;  testMenu():MenuScreen("testMenu"){     x.SetButton(100,100,TEXT("buttonNormal.png"),TEXT("buttonHover.png"),TEXT("buttonPressed.png"),100,40,&this->test2);      draw = false; }  void test2(){     draw = true; } };   The function x.SetButton(...) is contained in another class, where "object" is a template.  void SetButton(int xPos, int yPos, LPCWSTR normalFilePath, LPCWSTR hoverFilePath, LPCWSTR pressedFilePath, int Width, int Height, void (object::*ButtonFunc)()) {      BUTTON::SetButton(xPos, yPos, normalFilePath, hoverFilePath, pressedFilePath, Width, Height);      this->ButtonFunc = &ButtonFunc; }   If anyone has any advice on how I can properly send this function so that I can use it later.


In other words, what are the arguments for ZF over ZFC, and what philosophical issues have people raised against including it as a standard axiom of set theory?

I don't know much about set theory or foundational mathematics, this question arose just out of curiosity. As far as I know, the widely accepted axioms of set theory is the Zermelo-Fraenkel axioms with the axiom of choice. But the last axiom seems to be the most special out of these axioms. A lot of theorems specifically mention that they depend on the axiom of choice. So, what is so special about this axiom?  I know that a lot of funny results occur when we assume the axiom of choice, such as the Banach-Tarski paradox. However, we are assuming the other ZF axioms at the same time. So why do we blame it to the axiom of choice, not the others? To me, the axiom of regularity is less convincing than the axiom of choice (though it's probably due to my lack of understanding).


so this:    so I need:  any suggestions?

My table is like this:  Sitecode    Month  Amount --------    -----  ------ XX          Jan     1000 XX          Jan     3000 XX          Apr     3000 XX          Apr     1000   What I want is, to show the result something like this:  Sitecode    MonthJAN   MonthAPR --------    --------   -------- XX          4000       4000


Is it possible to convert an integer to a written out word? IE, convert '29' to 'twentynine'?  There is a comment on the strval() page of the PHP Manual, but it's from 13 years ago, before PHP 5 was introduced. Is there a standard PHP function that can do the same, or maybe an easier way to write out the function?

In PHP, is there an easy way to convert a number to a word? For instance, 27 to twenty-seven.


In other answer script not working: (in  answer not working, generate only black image and delete everything) import bpy nazwa_tek="cyfry" plik_tek_gr="//grafiki/gr.png" tek = bpy.data.materials.new(name=nazwa_tek) tek.use_nodes = True bsdf = tek.node_tree.nodes["Principled BSDF"] texImage = tek.node_tree.nodes.new('ShaderNodeTexImage') texImage.image = bpy.data.images.load(plik_tek_gr) #tek.diffuse_color = (1.0, 0.0, 1.0, 0.8) tek.node_tree.links.new(bsdf.inputs['Base Color'], texImage.outputs['Color']) print("tekstura:=", tek)  def DodajTeksture(ob, nazwa="cyfry", plik_gr="//grafiki/gr.png"):     global tek     # Assign it to object     if ob.data.materials:       ob.data.materials[0] = tek     else:       ob.data.materials.append(tek)     return  bpy.data.scenes["Scene"].render.image_settings.file_format = 'JPEG' bpy.data.scenes["Scene"].render.filepath = './' bpy.ops.render.render(animation = False) img = bpy.data.images[0] img.save_render('wynik.jpg') bpy.ops.wm.save_mainfile(filepath='bb.blend')  but how create a image texture? My texture are now procedural and do not have .image value. (I need image texture not procedural) obrazek = bpy.ops.image.open(filepath="//file.png") bpy.data.images["//file.png"].pack(as_png=True)  load image, but how aplying image for object named "Cube"?  How creating procedure in python def appimage(obj, name_image, dx, dy)    #applying image to object name obj staring from (dx,dy) in image    return  create texture, add image to texture (one texture will be assign to some object) specifi region in image for this object. I have big texture for many objects. Only small region is for object. My image have transparent region (it schow diffuse color from bottom?). appimage("Cube", "//file.png", 170, 200)

i have trouble to get a script working within Blender 2.8. The following function work perfectly for me in Blender 2.79, but not in 2.8.  def CreateMaterialFromImage(matName, imgPath):     '''Creates and returns a material from an Image'''     realpath = os.path.expanduser(imgPath)     try:         img = bpy.data.images.load(realpath)     except:         raise NameError("Cannot load image %s" % realpath)      # Create image texture from image     cTex = bpy.data.textures.new(matName, type='IMAGE')     cTex.image = img      # Create material     mat = bpy.data.materials.new(matName)      # Add texture slot for color texture     mtex = mat.texture_slots.add()     mtex.texture = cTex     mtex.texture_coords = 'UV'     mtex.use_map_color_diffuse = True     mtex.use_map_color_emission = True     mtex.emission_color_factor = 0.5     mtex.use_map_density = True     mtex.mapping = 'FLAT'     return mat   It seems to be that the material.texture_slots were removed.  Under following Link  i found the note:        Texture slots for materials, lamps and world were removed. They remain   for brushes, particles and freestyle linestyles.      So my question is where do i find this property now or how could i change my code to get things done?  Thanks for your help!  EDIT:  This seems to be an interesting link for people run in to issues by updating their scripts to 2.8. Unfortunately there is no solution for my problem listed, yet.


When I click on the achievements button/menu I obviously get a dashed border around it, much as when you click on a link. I notice that this border is much wider than the achievements button.    Why is this? Is it possible for other things to be displayed there, subject to rep perhaps?

Whenever we click on the Inbox or the Achievements in the top bar, an extra blue line appears near by them. This is reproducible on Stack Overflow and Anime & Manga(as I use only those) but not on Meta Stack Overflow. Here is a snapshot of that.    I'm using Firefox 25.0.1 on Win7 Pro.  Edit: Just to be double sure, I restarted the FF and still I'm able to see it. Here is another snapshot, with the 2 distinct sites.


I am writing a book using the amsbook style. I would like references to formulas and theorems to appear without chapter numbers when I cite within the chapter, and with them otherwise. For example, I want  ... see (3.2) ... [if that equation is in the same chapter]  and  ... see (II.3.2)... [if this appears in, say, Chapter IV but the equation is in Chapter II]  Is there an easy way to do this? I can do it now by writing (\ref{ChapterII}.\ref{3.2}) in the latter case, and just (\ref{3.2}) in the former but I wonder if there is an automatic way of doing it.   EDIT: I saw the linked answer - but that does not work with amsbook! Any idea?  ======= Here is an example based on the linked one. It works (without eq. numbers) but it does not with amsbook!    ===============    \documentclass{book}  \% does not work with amsbook   \usepackage{ntheorem}   % From your post I assume you have settings like this: \renewcommand*\thechapter{\Roman{chapter}} \newtheorem{mytheo}{MyTheo}[chapter]  % Redefine the format of the theorem number: \renewcommand*\themytheo{% \protect\maybechapter{\arabic{chapter}}\arabic{section}.\arabic{mytheo}% }  % May print the chapter number \newcommand*\maybechapter[1]{% % Tests if current chapter is equal to the chapter number of label) \ifnum\value{chapter}=0#1\relax  % Print nothing if so \else  % Set 'chapter' locally (=> no \setcounter) to the label chapter and  % print it in the usual format followed by a dot  {\value{chapter}=#1\relax\thechapter.}% \fi }  % Test document: \begin{document} \chapter{One} Here \ref{theo:11}  % prints "1.1" and there \ref{theo:21}. % print "II.1.1"   \section{Section1} \begin{mytheo}\label{theo:11} \begin{equation}\label{11} x^n+y^n=z^n \end{equation} \end{mytheo} The eq. number should be (1.1) (section.eq).    \section{Section 2} \begin{mytheo} Theo1-2\label{theo:12} \end{mytheo}   \chapter{Two} There \ref{theo:11}  % prints "I.1.1" and here \ref{theo:21}. % print "1.1"  \section{S1} \begin{mytheo} Theo2-1\label{theo:21} \end{mytheo}  See (\ref{11}) for more details. I expected (I.1.1).   \end{document}

I have a document organized into several chapters. In each chapter, theorems are numbered by section (1.1, 1.2, ... even in chapter 5). I often would like to refer to theorems in different chapters. However, if I am in chapter 6 and refer to theorem 1.3 in chapter 1, it is rather ambiguous, and the reader might assume that "theorem 1.3" meant the current chapter. Is there an automatic way of configuring things so that the cross-referencing will say "theorem 1.3" only if it is really the current chapter, but "theorem I.1.3" (or something like that) if the cross-referencing spans chapters?


I have 400 folders (/123_0/, /123_1/, ...) and inside each one I have a file with extension *.root and different names. I just want to copy these files to a destination /destination/. How can I do it?

I have all my music in a folder /media/kalenpw/MyBook/Music/ABunchOfOtherFoldersWithFilesInside. I want to copy all of the mp3s to /media/kalenpw/HDD/Music so I used:  cp -R /media/kalenpw/MyBook/Music/*.mp3 /media/kalenpw/HDD/Music   however this only copied the mp3s in the root music folder and did not open any of the artist subdirectories and copy those files.  I was under the impression -R would recursively copy all the files. How can I achieve said goal?


I gave a "friend" my number and he sent the effective power code and now my iMessage doesn't work anymore I click on the app for iMessage and the app crashes

Recently a new "glitch" has surfaced over the Internet over the last few weeks where if an iPhone user is sent:    effective.        Power            لُلُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ  冗   via iMessage it crashes the phone OS temporarily and force restarts the receiving phone.  Why does this work?


Introcution I am new in Java and I have written a method to return an element from an two dimensional ArrayList, based on a given parameter. The method should return a value that meets the given parameter or else return null. Problem     public String getUnit(String nutrient) {         String foundUnit = null;          for (int row = 0; row < nutrientsList.size(); row++) {             for (int column = 0; column < nutrientsList.get(row).size(); column++) {                 if(nutrientsList.get(row).get(column) == nutrient) {                     foundUnit= nutrientsList.get(row).get(column+1);                 }             }         }         return foundUnit;     }  The unit value is located in the second column. Unfortunately it returns a null, when there are more than two instances. The output of  System.out.print((nutrientsList.get(row).get(column))); is BIG Macstuk510drop100 g336 . While the output is correct, it cannot be used to compare it against the nutrient variable. For example, if I need to have the value drop from the ArrayList, it won't return me this value. I have been debugging the code and the variable nutrient has the correct value, so I suspect the main cause has to be: if(nutrientsList.get(row).get(column) == nutrient). Question What is issue here? Although all the values and outputs are correct, I have no idea what is causing the if-statement to fail. I have been trying to split it, but it didn't work out as expected. How could this be fixed? Things I have tried  I have tried to convert the ArrayList to an Array; Tried to add + "," to split the elements; Tried to change the if-statement to nutrientsList == nutrient. This gave me the error that the data types were not equal  None this worked.

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 want to reduce the home size. So I need to unmount it. How can I do it using gparted?  2) what type of file system is better for accessing both windows and linux.

I'm new to GParted. I have to resize a partition that contains root file system which is full. Previously I had Windows installed in my system. I use a 250GB hard drive and was divided into 3 drives namely C, D and E drive. After this I installed Ubuntu and used the existing NTFS file system, to install Ubuntu. Now, I need to resize the partition mounted on root file system as it is full. Below is the link to screenshot of GParted -    What should I do to increase the size the /dev/sda6 without any data loss in GParted


How can I retrieve the Nth record of a large text file and insert them into a new file?

I am trying to print every Nth line out of a file with more than 300,000 records into a  new file. This has to happen every Nth record until it reaches the end of the file.


Every time the anonymous group targets a website, they are able to take it down.. even for large corporates / governments with professional.  I read (basic theory) about dealing with normal DDOS attack, with DDOS protection techniques.  But why do these techniques fail in case of Anonymous group attacks?  Is there any success stories about surviving through a really good organized DDOS attack?

This is a  about DoS and DDoS mitigation.   I found a massive traffic spike on a website that I host today; I am getting thousands of connections a second and I see I'm using all 100Mbps of my available bandwidth.  Nobody can access my site because all the requests time out, and I can't even log into the server because SSH times out too!  This has happened a couple times before, and each time it's lasted a couple hours and gone away on its own.  Occasionally, my website has another distinct but related problem: my server's load average (which is usually around .25) rockets up to 20 or more and nobody can access my site just the same as the other case.  It also goes away after a few hours.  Restarting my server doesn't help; what can I do to make my site accessible again, and what is happening?  Relatedly, I found once that for a day or two, every time I started my service, it got a connection from a particular IP address and then crashed.  As soon as I started it up again, this happened again and it crashed again.  How is that similar, and what can I do about it?


I have a Single Page Application in which the browser does all the logic work.  Except for initial loading, the server is pretty much a fancy interface to the database.  The browser sends data dictionary keys, column name / value pairs, and where clauses for SELECT, for example.  The server assembles the parts into SQL, executes the queries, and replies.  NEW: In a SELECT, for example, the table name and columns pulled are from the data dictionary - the browser supplies the data dictionary key and the SELECT where clause.  This very open environment is very susceptible to SQL Injection attacks.  The goal is to prevent damage from said attacks.  Problems to be Overcome  First, as , it is impossible to paramaterize a random SELECT where clause - SELECT cannot use a prepared statements.  Second, mysqli, the library for paramaterized statements with MySQL, does not support NULL nor MySQL functions, eg, CURRENT_DATE or NOW(), as .  Proposed Solution  First, if SELECT cannot be paramterized, then execute SELECT by a user who has no DML or DDL rights.  This will prevent SQL Injection Attacks from changing the database.  Second, write a wrapper function for mysqli that will allow NULL and MySQL functions to be passed as parameters.  This will allow parameters to be easily used for all DML.  Third, shadow highly sensitive data where it cannot be seen or touched by normal queries or normal users.  This will put sensitive data, such as passwords, out of the range of attacks.  Forth, write a wrapper order to enforce the user / query type relationship.  This will ensure SELECT are executed by the select user, for example  The result of that effort is .  The question is, logically, will this approach successfully protect against SQL Injection Attacks?  Non-Answer Answers  I proposed this same question .  Due to my poor job of presentation, received answers and comments ended up focusing on spurious issues instead of addressing the (admittedly) difficult question - does this actually work?  As a reference, here are some of those comments and answers.  Use PDO's prepared statements  First, prepared statements cannot be used for all SELECTs - how does PDO help?  Second, mysqli does not accept NULL or MySQL functions - how does PDO help?  Why re-invent the wheel  If you know of an approach that overcomes these problems, I would really really like to know - this is a difficult problem.  no mysql_real_escape_string() in sight  Values should be sanitized before being passed to the database query functions.  mysql_real_escape_string() is one of a set of sanitizing functions available, for example, one would use a different sanitizer for dates.  too much work  Please share with me your know of any approach that overcomes these problems - I would really like better insight.  That said, from my setting up the whole thing again, following my notes it took between 30 and 45 minutes. No time costs incurred thereafter.  I am happy with mysqli  How are you going to prevent SQL Injection Attacks when you cannot parameterize your SELECT?  Do you expect to never use NULL when updating a column?  Every man to his own poison, but these are issues I hope to solve - not live with.  @Konerack pointing out limited number of parameters  Right.  Changed to code to use eval() (shudder) which solved the problem.  Needs security review.  The Question Again  Will this approach protect against SQL Injection Attacks while overcoming the problems of no parameterized SELECT and mysqli's parameter limitations?

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


I want to move a game object from its current position toward the mouse position.  I wrote this Vector2D class to help me:  public class Vector2D {          private double xVect;         private double yVect;          public Vector2D() {                 xVect = 0;                 yVect = 0;         }         public Vector2D(double x1, double y1) {                 xVect = x1;                 yVect = y1;         }         public double getX(){             return xVect;         }         public double getY(){             return yVect;         }          public double length() {                 return Math.sqrt((xVect*xVect) + (yVect * yVect));         }         public void normalize() {                 double length = length();                 if(length > 0){                     xVect = (xVect/length);                     yVect = (yVect/length);                 }         }         public Vector2D normalize2() {                 double length = length();                 return new Vector2D((xVect/length), (xVect/length));         } }   I then try to move it toward the target position.  public void move(){ // saveX , saveY - mouse x, y coordinates // x, y - game object coordinates     Vector2D moveVec = new Vector2D(saveX, saveY);     moveVec.normalize();     while(cont){         if(saveX > x){             x += ((moveVec.getX()));         }if(saveX < x){             x -= ((moveVec.getX()));         }         if(saveY > y){             y += ((moveVec.getY()));         }if(saveY < y){             y -= ((moveVec.getY()));         }         sleep(); // Thread.sleep(200);         frame.repaint();         cont = moveEnemy(moveVec);     } }   But something strange happens: When x = 0 and y = 0, everything is OK, but when for example x = 200 y = 0, my object moves along the red line instead of directly toward its target.    Why is this? What's wrong with my code?  EDIT:  public boolean moveEnemy(Vector2D v){     if((((x - sizeX) <= currentX && currentX <= (x + sizeY) && (y - sizeY) <= currentY && currentY <= (y + sizeY)))){         return false;     }else if((((x - sizeX) <= saveX && saveX <= (x + sizeY) && (y - sizeY) <= saveY && saveY <= (y + sizeY))) && (saveX != currentX || saveY != currentY)){         miss(v);         return false;     }     return true; }

How can I move an object (like a cube) towards another object?  Let's say that we have a red cube in the center of a floor, and a blue cube in another location, there aren't objects between this two, so the movement is along a line.  How can I move the blue cube towards the red one?


so I have this dictionary  Dictionary<ulong, PlayerData> PlayersCache = new Dictionary<ulong, PlayerData>();   I have class PlayerData          public class PlayerData         {             public int Shots;             public int Hits;             public PlayerData()             {             }         }   How can I sort Dictionary so player with the most hits will be first the second player with most hits will be second, third player with most hits will be third... In the Dictionary Sort it ascending.

I often have to sort a dictionary, consisting of keys & values, by value. For example, I have a hash of words and respective frequencies, that I want to order by frequency.  There is a SortedList which is good for a single value (say frequency), that I want to map it back to the word.   orders by key, not value. Some resort to a , but is there a cleaner way?


I used a plug with USB output than may have been inappropriate (output DC5V +/- 0.20V DC500mA +/-30mA). While it was plugged in, the touchscreen stopped working properly (touching one part of the screen would trigger another), I guess because the voltage was wrong? Is there any danger that I did some permanent damage to the phone or the battery? It wasn't plugged in for long.

My phone (Motorola DROID RAZR MAXX) seems to have problems accepting touch input when connected to a non-OEM power source. When connected to my computer via USB, it accepts input fine, as it does when connected to an Xbox 360 through USB. When connected to the wall USB charger it shipped with, it also accepts input fine, but when connected to a third-party wall USB charger, the touch input goes crazy and starts selecting objects all over the screen where I'm not pressing. The charger did not do this with my previous Android phone.  Is this because there is some data connection it is looking for through USB so that it acts weirdly if not using an OEM charger or actually connected to a data-using device?


Does there exist a complex series that the radius of convergence is $R=1$ but the series diverges at exactly three points of a set $\{z \in \Bbb{C} : \space |z|=1 \}?$   I found this exercise and I wonder how should it be solved. I know that in real analysis there exist such series that the radius of convergence is $1$ in the interval $X$ but the same series diverges at the endpoints of $X$. But it has only two points of divergence.   Can anyone show me the way?

I want to construct a complex power series with the radius of convergence $R=1$ that diverges in:  1) $k$ points on the circle $\{|z|=1\}$.  2) countable number of points on the circle  I have already crafted series that converges on the whole circle and diverges on the whole circle.  Can anybody help with the problem?  Update: I have googled a series $\sum{\frac{z^{kn}}{kn}}$ that is an answer for 1). Though I still need help for the countable case.


Let $a,b,c>0, a^2+b^2+c^2+abc=4$. Then prove that $0\leq ab+bc+ca-abc\leq 2$.  My idea is substitution. First, I'll prove that $cos^2\alpha+cos^2\beta+cos^2\gamma+2cos\alpha cos\beta cos\gamma=1$ where $\alpha+\beta+\gamma=\pi$.  $cos^2\alpha+cos^2\beta+cos^2\gamma+2cos\alpha cos\beta cos\gamma=\frac{3+cos2\alpha+cos2\beta+cos2\gamma}{2}+2cos\alpha cos\beta cos\gamma=\frac{3}{2}+cos(\alpha+\beta)cos(\alpha-\beta)-\frac{1}{2}+cos^2(\alpha+\beta)+2cos\alpha cos\beta cos\gamma=1+2cos(\alpha+\beta)cos\alpha cos\beta+2cos\alpha cos\beta cos\gamma=1$  Therefore we can substitute $a=2cos\alpha,b=2cos\beta,c=2cos\gamma$ with $\alpha,\beta,\gamma\in(0,\frac{\pi}{2})$. Then the inequality becomes $0\leq cos\alpha cos\beta+cos\beta cos\gamma+cos\gamma cos\alpha-2cos\alpha cos\beta cos\gamma\leq\frac{1}{2}$.  LHS is easy. If one of $cos\alpha,cos\beta,cos\gamma$ is equal to $0$, we may assume that $\alpha=\frac{\pi}{2}$. $0\leq\beta,\gamma\leq\frac{\pi}{2}$ and $cos\beta cos\gamma\geq 0$(True).  Else, we can divide by $cos\alpha cos\beta cos\gamma$ and the inequality becomes $\frac{1}{cos\alpha}+\frac{1}{cos\beta}+\frac{1}{cos\gamma}\geq 2$. But it's true because $\frac{1}{cos\alpha}+\frac{1}{cos\beta}+\frac{1}{cos\gamma}\geq\frac{9}{cos\alpha+cos\beta+cos\gamma}\geq\frac{9}{\frac{3}{2}}=6>2$. Equality occurs if $(\alpha,\beta,\gamma)=(\frac{\pi}{2},\frac{\pi}{2},0)$ and its permutations.  I can't solve RHS. Maybe dividing by $cos\alpha cos\beta cos\gamma$, it can be little bit easier. Anyone can help me?

Let $a,b,$ and $c$ be nonnegative real numbers such that $a^2+b^2+c^2+abc = 4$. Prove that $$0 \leq ab + ac + bc - abc \leq 2.$$   I tried using rearrangement to get $a^2+b^2+c^2+abc = 4 \geq ab+bc+ac+abc$. Then I just need to show that $0\leq ab + ac + bc - abc$ and $4-2abc \leq 2$. I am not sure if this method will work, though.


Let's say I'm standing on the equator, and that there is no other reference point in the sky.  If the planet is rotating, then I measure my weight to be lower than if it is not.  But given that I have no reference frames to "prove" than I am rotating, why can't I just claim that my weight should be the same since I'm standing still and the universe is rotating around me?  (After all, this kind of argument does work for translation... so what's different about rotation?)

Let's assume that there is nothing in the universe except Earth. If the Earth rotates on its axis as it does, then would we experience the effects of rotational motion like centrifugal force and Coriolis force?  The meaning of my question is: is Earth rotating relative to space?


I'm facing a memory leak issue with Windows 10. I've got 4 GB physical memory which is mostly occupied by "nonpaged pool" according to , which sadly cannot be attributed to any single process. Generally, the processes in task manager don't add up to resource usage of such scale (biggest processes have two-figure MB private memory). And it gets worse with growing uptime. Alas, this computer is running in an industrial environment and normally has to be running continuously. Presently, it locks up every few weeks and has to be reset manually.  As per magicandre1981's detailed answer to , I identified the tags FMic and Irp as the main offenders using poolmon ().  After using xperf to record a few minutes of data, in Windows Performance Analyser, the most memory usage under those tags is in the Stack level "n/a" by process "Unknown" ().  The memory allocations under both tags consist of 1 KB chunks or smaller, roughly 600 each (,  detail).  I think it's beyond dispute that there is a memory leak in this system. What else could I try to isolate the offending process or driver?  Thanks and best regards  Björn  EDIT 2018-07-11: Captured the following using WPA.        If the detail isn't deep enough, I can provide the ETL after a little setup work (two days download link).  The offending processes seem to be from "F-Secure Client Security" (memory leak?). Can I do anything else about it, other than complaining to F-Secure?  EDIT 2018-07-16: After removing F-Secure (using Windows Defender now) several days ago, the nonpaged pool is stable at about 200 MB. Problem solved, it seems.

A few days ago I updated my PC to Windows 10. However, after some use my PC started to slow down until it was impossible to use – it was due to high memory usage. After a restart, everything came back to normal (total usage around 25% of 8GB of RAM). However, during a few hours of usage the memory builds up again to 70%, and if not restarted it further goes to 100%, and later on even freezes. Task manager does not help very much as it does not show all the processes (added screenshots below). Also tried RAMMap but it gives an error: "error refreshing database". I tried Googling this question, yet without much success.  I do not know much about PCs, but maybe some of you know this issue, or could help to find out what is using my RAM.


When we want to say that something is inappropriate or an incorrect selection from several options, we often say that it is "the wrong [whatever]". For example:  Ten o'clock is the wrong time to have lunch.   I put on the wrong shirt this morning.  But this is surely incorrect logically, because the use of the word "the" implies uniqueness where there is none. Ten o'clock is not uniquely the wrong time to have lunch; nine o'clock would also be wrong. So it's not the wrong time to have lunch, merely a wrong time to have lunch. And if I have a shirt that's not a good selection, then I may have several; yet even if I had several, I would still say that I put on the wrong shirt and not the more logically defensible a wrong shirt. So why do we talk about wrong selections this way, using the definite article? How long have we been doing it? Is it something that arose from the history of the English language, or did it come to us from a precursor to English?

In English, when presented with a list (real or imagined) or answers that could be given to a question, and the correct one is not given, we will say that somebody has given "the wrong answer".  However, doesn't "the" imply that there is only one wrong answer?    Logically, it should be "that's a wrong answer", not "that's the wrong answer". Right?


Let  $A$  be  an $10\times 10$  invertible  matrix  with  real  entries  such  that the  sum  of  each  row  is  $1$. Then  $A$. The  sum  of  entries of  each  row  of  the  inverse  of  $A$  is  $1$  $B$. The  sum  of  entries of  each  column  of  the  inverse  of  $A$  is  $1$  $C$. The  trace  of the  inverse of $A$  is  non-zero  $D$. None  of  the  above  I  don't  see  how  to  proceed or how  to  use  the  sum of  the  elements of of  rows.  Please  help.  I know  option $A$  is  correct  and  option $C$  is not. Why  is  option $B$  not  correct?

Let $A$ be an invertible $10\times 10$ matrix with real entries such that the sum of each row is $1$. Then choose the correct option.   The sum of the entries of each row of the inverse of $A$ is $1$. The sum of the entries of each column of the inverse of $ A$ is $1$. The trace of the inverse of $A$ is non-zero. None of the above.   If the matrix is given we can find its inverse but how can we find its inverse if the matrix itself not given?  Any idea on how to find the answer?


I am trying to add styles via Javascript. For some reason unknown to me, I am getting an error that says my query selector is not a valid selector, even though my ids look correct. Can someone please help me to understand what is going wrong with my code?   var currentRow; var rowCol; for(let i = 0; i < 3; i++) {     var x = i.toString();     currentRow = document.querySelector("#0");     for(let j = 0; j < 3; j++)     {         y = j.toString();         rowCol = currentRow.querySelector("#" + x + y);         if(i == 1)         {             rowCol.style.border = "5px 'solid black'";             rowCol.style.border = "5px 'solid black'";         }          if(j == 0 || j == 1)         {           rowCol.style.border = "5px 'solid black'";         }     }  } <!DOCTYPE html>       <link rel="stylesheet" href="./tictactoe.css">

x

x

x

x

x

x

x

x

x

When creating the id attributes for HTML elements, what rules are there for the value?


I scanned a file in this site :    and got this :  SHA-256 70902a0e2e5608b5ce980f0a28d23b6943287b3955e2fddb12e6c805c7be906b  can the above sha-256 be cracked to plain text ?

First off, I know hashes are 1 way. There are an infinite number of inputs that can result in the same hash output. Why can't we take a hash and convert it to an equivalent string that can be hashed back to the original hash output?  eg:  string: "Hello World" hashed: a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e   unhash: "rtjwwm689phrw96kvo48rm64unc8oetb5kmrjiuh7h8huhi6dde5n5"         (a real string that gives the same hash as "Hello World") hashed: a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e    ...


When my opponent declares blockers, I want to be able to kill a blocking creature (with something like ) while still doing combat damage to my opponent.  Is this possible?

We are in the combat phase:   I declared my attackers  My opponent declared his blockers, stating which attackers he was blocking I cast an instant, which automatically kills his blocker. There is nothing blocking my attacker now   Now we're in the damage phase. I said that my attacker now does damage and  reduces my opponent's hit points. My opponent said that because my attacker was blocked no damage could be done. I pointed out that the blocker was destroyed before the damage phase, so therefore he wasn't blocking, but he wasn't having it. (My attacker does not have trample)  Is this covered by a specific section in the rules?


As an olympiad-participant, I've had to solve numerous inequalities; some easy ones and some very difficult ones. Inequalities might appear in every Olympiad discipline (Number theory, Algebra, Geometry and Combinatorics) and usually require previous manipulations, which makes them even harder to solve...    Some time ago, someone told me that      Solving inequalities is kind of applying the same hundred tricks again and again   And in fact, knowledge and experience play a fundamental role when it comes to proving/solving inequalities, rather than instinct.  This is the reason why I wanted to gather the most important Olympiad-inequalities such as    AM-GM (and the weighted one) Cauchy-Schwarz Jensen   ...  Could you suggest some more?    This question was inspired by the fantastic contributions of @Michael Rozenberg on inequalities.

I know some of it, but I would like to learn other ones. I think this question is useful, as it will be helpful for other beginners. Such as: uvw, AM GM, Cauchy–Schwarz inequality, Jensen inequality. Could you please add something? Maybe books containing it?


My original sample has 350 observations drawn randomly from a population of 60,000 people.   My independent variable is Default, with 35 observations with value of 1, and the rest with value of 0.  I split my sample to Train (60%) and Test (40%), then use multi-variate logistic regression to predict Default on Train, and validate on Test.  Because of small sample size, I want to validate confidence interval of a performance statistics (ROC) using bootstrap in two ways:  (1) Create 10,000 samples with the same size of the original sample, split them into train and test, and fit the model on train, and calculate ROC on test for each of the samples. Finally, plot the distribution of ROC.  However, when doing this, my ROC values are very disperse with high variance.  (2) Create 10,000 samples, but each sample has 3000 observations (randomly drawn from the original 350 observations), then repeat the process. In this case, my ROC and GINI values become very concentrated. This is what I prefer.  My question is:  In theory, what is the difference between the two methods?   Since (2) will most likely produce a better result, why (1) is much more popular?

When searching the internet on the sample size of for boostrap samples I generally find that the size should equal the original sample size. However, I can't find any explanation on why this should be the case.   In what way is it bad to use a smaller sample size? Is it always better to use a larger sample size?   Some of the sites which report this:


Here is my problem: I want to add small video clip to my database.  I used longblob type in MYSQL. I tried to insert small video clip to phpmyadmin but I failed to attach it.   I want to know how to insert a video clip into the MYSQL database How to retrieve that video to PHP.   Please guide me to this. I searched, but I could not found a satisfying answer.


Is there a better way to accomplish this in Javascript?  const data: any = {}; if (values.email) data.email = values.email; if (values.password) data.password = values.password; if (values.username) data.username = values.username;   I don't want the data object to have the properties for the undefined or falsy values.

How do I remove all attributes which are undefined or null in a JavaScript object?  (Question is similar to  for Arrays)


I would like to know how to prove that $$\sum_{r=1}^\infty \frac{(-1)^{r+1}}{(2r-1)^3}=\frac{\pi^3}{32}$$ I would very much prefer answers that avoid non-elementary functions like the gamma or beta functions, as although I am researching them, I am still in high school and not very familiar with them- but if it is necessary, I will not object :) I know how to prove the Basel problem using $\sin$ expressed as a product of its factors and its Maclaurin series, and other similar series, such as $$\sum_{r=1}^\infty \frac{(-1)^{r+1}}{r^2}=\frac{\pi^2}{12}$$ but I cannot find a similar method to help evaluate this. It'd also be helpful if I could find an elementary function that I could express as a useful series expansion and then integrate between $0$ and $1$ to evaluate the series I am dealing with such as $$\frac{1}{1^2}-\frac{x^2}{3^2}+\frac{x^4}{5^2}-\frac{x^6}{7^2}+\cdots$$ but I cannot find any function that has this series expansion. Many thanks for your help.

After numerical analysis it seems that   $$ \frac{\pi^{3}}{32}=1-\sum_{k=1}^{\infty}\frac{2k(2k+1)\zeta(2k+2)}{4^{2k+2}} $$  Could someone prove the validity of such identity?


Is it possible for there to be a measurable set $E\subseteq\mathbb{R}$ such that for every open interval $I$, $0<m(I\cap E)<m(I)$ (where $m$ is the Lebesgue measure of a set)?  The first thing I notice is that this set must be dense, since if it were not dense we would be able to find an interval with no members of $E$.  It of course also must be uncountable in size, since it cannot have zero measure itself.  It is also pretty clear that $\mathbb{R}\setminus E$ must also have this property if $E$ has this property.  Aside from that I'm stumped.  I've tried a couple of toy sets but they all turned out to not have this property.  Then I tried to show no set could have this property but I hit a brick wall pretty quickly.

I was wondering how one can construct a Borel set that doesn't have full measure on any interval of the real line but does have positive measure everywhere.   To be precise, if $\mu$ denotes Lebesgue measure, how would one construct a Borel set $A \subset \mathbb{R}$ such that $$0 < \mu(A \cap I) < \mu(I)$$ for every interval $I$ in $\mathbb{R}$?   Moreover, would such a set necessarily have to contain infinite measure?


I imported my shapefile dat to R with readOGR, coordinates are given in easting and northing, I'd like to change it to latlon and tried:  dat_latlon <- spTransform(dat, CRS("+proj=longlat +datum=WGS84"))   However, I get this error message:  Error in spTransform(xSP, CRSobj, ...) :    No transformation possible from NA reference system   And str(dat) shows that:    ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots   .. .. ..@ projargs: chr NA   So I guess I have to assign the projection first? Somewhere here (or stackoverflow) I found this:  dat@proj4string <- "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +datum=potsdam +units=m +no_defs"   but I only get an error:  Error in checkAtAssignment("SpatialPointsDataFrame", "proj4string", "character") :    Zuweisung eines Objektes der Klasse “character” ist für @‘proj4string’ in einem Objekt aus Klasse “SpatialPointsDataFrame” nicht zulässig; is(value, "CRS") ist nicht TRUE   (sorry for German - apparently it's not valid to assign an object of class character in an object of class SpatialPointsDataFrame).  Now I am stuck, can you help me?

I think that by using readOGR to import a shapefile renders worthless to put proj4string to the script since if any coords are available in the shapefile, it will be transported through the readOGR.   Therefore, proj4string is expedient only if we use another import function for example readShapeSpatial (for polygons, lines or points) or by using readOGR, but in the case that the shapefile does not contain the coordinates/projection:  When checking if the shapefile has projection information and if it has not, should I add proj4string although I have put readOGR?


Today I bought one pound of fresh scallops from the seafood counter at the local market, but my dinner plans have changed - I am no longer planning to cook the scallops this evening and I don't necessarily want to freeze them. How long will they remain fresh in my refrigerator?

How do I know if a given food or ingredient I have is still good, or if I should discard it?  How can I best preserve a food or ingredient?     This broad question is intended as a "general reference" question to quickly answer many how long will food keep for? questions. Please feel free to edit this question to expand and clarify as needed.


I'm trying to set the text of the navigation drawer activity from the fetched data on my database, but when i try to do so, it throws the following error      Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference   Am I missing something or did I do something wrong in my code?  public void fetchDb(){     String email = getIntent().getExtras().getString("EMAIL");      TextView txtName = findViewById(R.id.nameText);     TextView txtEmail = findViewById(R.id.emailText);     String name, ema;      DatabaseHelper dbh = new DatabaseHelper(this);      newDb = dbh.getReadableDatabase();     Cursor c = newDb.rawQuery("SELECT * FROM user WHERE user_email = \'" + email+"\'", null);     if (c.moveToFirst()){         do {             name = c.getString(1);             ema = c.getString(2);              txtName.setText(name);             txtEmail.setText(ema);          } while(c.moveToNext());     }     c.close();     newDb.close(); }

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I was initially trying to create a program to distinguish between DOS(16-bit) and Windows(32/64-bit) executables.  I read in some other answer that a executable can be classified based on their first two bytes. (MZ/...)  But when I manually went and compared a few executables (both 16 and (32/64 bit)), I found that they all started with MZ..  Is there any reason for it or am I doing something wrong?  The 16-bit executables were written by me in assembly->compiled using TASM and the 32/64 bit executables were from the system files of my computer C:\Windows\System32  Is there any other more accurate way to distinguish an executable?

I have an .exe file that I am unable to run on Windows 10. I suspect that it is because the binary is 16 bit. Is there a simple way to check? Something like  would be great.


I m trying to install Ubuntu 12.04 on my HP pavilion g6 via Live USB using UNetbootin, but after selecting my flash to boot from, if  I select Try Ubuntu without installing or Install Ubuntu on the Live USB menu the screen of my laptop turns black. Please, can anyone knows what s happening here and how can I overcome this problem?

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


I have seen them both in my reference book, which is written by a native speaker. I wonder why there are two different phrases to describe the same meaning and am looking forward to some reasonable details to explain why this is so.

Think of the simple phrase "Bill's friend".  If you were going to turn this around using the preposition 'of' would you say:   A friend of Bill's or A friend of Bill   It appears to me that, in the US anyway, people always say "A friend of Bill's".  Even though I'm a native American English speaker, this just sounds weird to me. It seems to create a 'double possessive' (a term I just invented). I always want to respond: "A friend of Bill's what?" A friend of Bill's aunt?  So what's at work here, and do British English speakers also do this?


Your motivation and expertise already (make/makes) you a great asset to our team and we can’t wait to see you become a leader in this company.

I am in doubt as to whether the subject-verb agreement of the second sentence of this paragraph is correct :  Unfortunately, there is no such thing as the ideal home workshop because most people are limited by the space available and by their budget. However, the information and diagram here acts as a guide to help you formulate a sensible workshop layout and a machinery “wish list”.  I suppose if the compound subject is seen as a single unit, then the sentence can be considered as correct. A little further in the same book, another sentence has a singular verb with a compound subject :  Alternatively commandeer a garage, or build yourself a substantial workshop if outdoor space and permission allows – however, do consider the impact of machinery noise on your neighbours.  Can "outdoor space and permission" be seen as one thing, or would this be considered a mistake ?


So I have a webpage with a header, mainbody, and footer. I want the mainbody to fill 100% of the page (fill 100% in between footer and header) My footer is position absolute with bottom: 0. Everytime I try to set the mainbody to 100% height or change position or something it will also overflow the header. If if set the body to position absolute with top: 40 (cause my header is 40px high), it will just go 40px too far down, creating a scroll bar.  I created a simple html file since i cannot actually post the entire page/css from the actual project. With the sample code, even though the maincontent body fills the screen, it goes 40px too far down (cause of the header I assume).    html, body {   margin: 0;   padding: 0; }  header {   height: 40px;   width: 100%;   background-color: blue; }  #maincontent {   background-color: green;   height: 100%;   width: 100%; }  footer {   height: 40px;   width: 100%;   background-color: grey;   position: absolute;   bottom: 0; }      <title>test</title>   <link href="style.css" rel="stylesheet" type="text/css">

            Anyone knows the answer?

I am working on a web application where I want the content to fill the height of the entire screen.  The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom.  I have a header div and a content div. At the moment I am using a table for the layout like so:  CSS and HTML    #page {     height: 100%; width: 100% }  #tdcontent {     height: 100%; }  #content {     overflow: auto; /* or overflow: hidden; */ }

...

...

     The entire height of the page is filled, and no scrolling is required.  For anything inside the content div, setting top: 0; will put it right underneath the header. Sometimes the content will be a real table, with its height set to 100%. Putting header inside content will not allow this to work.  Is there a way to achieve the same effect without using the table?  Update:  Elements inside the content div will have heights set to percentages as well. So something at 100% inside the div will fill it to the bottom. As will two elements at 50%.  Update 2:  For instance, if the header takes up 20% of the screen's height, a table specified at 50% inside #content would take up 40% of the screen space. So far, wrapping the entire thing in a table is the only thing that works.


I've been implementing an AI system in my 2D game using MonoGame.  In some situations when a collision between two objects occurs, I need the NPC to move in different directions depending on the direction of the collision. With the simple Rectangle.Intersects method I can't handle this, because it only detects if two rectangles intersect and doesn't tell me how they intersect.  Basically I need to know if the top of the NPC rectangle collides with the bottom of a tile rectangle, and so on.   talks about something similar but I don't think there is CollisionDetection2D.BoundingRectangle in MonoGame.

I am trying to figure out how to determine the direction a collision occurs between two rectangles.  One rectangle does not move. The other rectangle has a velocity in any direction. When a collision occurs, I want to be able to set the position of the moving rectangle to the point of impact.    I seem to be stuck in determining from what direction the impact occurs.  If I am moving strictly vertically or horizontally I manage great detection.  But when moving in both directions at the same time, strange things happen.   What is the best way to determine what direction a collision occurs between two rectangles?


I am trying to subscribe to . It seems that I am in fact subscribed, but I'm not getting mail. Now, I used to get email from this filter, but around January of 2018 it just stopped sending me mail. When I view the filter page now, there's a box on the right side that says "Confirmation email sent. Please confirm your subscription." So, I clicked "resend confirmation email" but haven't gotten any confirmation email.  Advice?

I have created a custom filter in  and specified that I would like to get email updates:  However, I never got a confirmation mail nor any notifications based on my filter. I tried the "resent confirmation mail" button on the right hand sidebar:  But again nothing happens. The mail address should be fine  I used it for all kinds of notifications from Stack Exchange. For example the rep recalculation email arrived just fine on this address.  I retyped it several times to make sure there really isn't any typo  I double checked that it did not end up in the spam filter  I don't think it is a problem with my particular email provider, users with other mail providers seem to have the same problem, see     This is possibly related to , but this claims to be "status complete".   EDIT: Although the "status-completed" tag was added, the problem still persists  EDIT 2: As of Feb 2020, it finally works


I want to start learning Linear Algebra, I have no background about this subject except high school mathematics that doesn't includes complex number and matrices. I found the following books: Introduction to Linear Algebra by Gilbert Strang and Linear Algebra Done Right and I can't decide which one to choose (if you know a better book, I would like to know).  I also would like to know if there is a practice book or a website with exercises that includes solutions.

I'm starting a very long quest to learn about math, so that I can program games. I'm mostly a corporate developer, and it's somewhat boring and non exciting. When I began my career, I chose it because I wanted to create games.  I'm told that Linear Algebra is the best place to start. Where should I go?


Hi i want to know exactly what is the vnc server launcher icon in my ubuntu 16 dock is doing when i press it, is that possible ?

What is the general way to find out the command used by the dash app lens to launch an app from its corresponding icon?  I'm in the habit of clicking on the Ubuntu icon in the upper left corner (which I believe is called the "dash app lens") and typing the generic name of an application (such as "skype") to launch the application by clicking on its icon returned from the resulting search.  However, if I want to add an application via the "Startup Applications Preferences" I need to know the command used by the dash app lens when clicking on the application's icon.  For skype that's easy enough as its simply "skype", but not everything is that simple.


I want to determine if a record contains a duplicate value for a specific field and then delete the duplicate record and save the new file.  abc|123|def|456 abc|456|ghi|789 def|123|def|456   I want to save a new file with any record that duplicates field 1 removed.  abc|123|def|456 def|123|def|456   This awk code comes close, but actually does the opposite.  It creates a new duplicate row and then saves it to the new file.  awk -F'|' 'myv=a[$1] !/^myv++/' file.txt > newFile.txt

I am using awk below to print 8th column and remove duplicates in that very column.  awk -F "," '{print $8}' filecsv | awk '!NF || !seen[$0]++'   How to do it with just one awk instead running awk twice in the above pipline


I'm currently working on an adapter-design-process-based java project with test cases that use Maps. Both of these concepts are new to me. Here I'm writing an adapter class that takes map entries as part of its input and determines if the values of the keys are under a certain threshold, puts those that are under on a new map, and returns it. Here is a test case:     static Stream<Arguments> providerBankAccountsGetDelinquent() {             return Stream.of(                     Arguments.of( new BofAAdapter( new BofA() ), 500,                              Map.ofEntries(                                 Map.entry( 1, 500),                                 Map.entry( 5,  20)                             )),   Again, I'm new to Maps and so this may be an obvious error, but in my code I'm trying to access the values in the maps that are passed to me using a keySet, and I get a NullPointerException at the line where I declare the Set and utilize m.keySet(): public class BofAAdapter implements IBankAccounts {      BofA acc;     Integer thr;     Map<Integer, Integer> m;     public BofAAdapter(BofA bofA) {         acc = bofA;     }      public BofAAdapter(Integer thresh, Map<Integer, Integer> map) {          thr = thresh;         m = map;     }      @Override     public Map<Integer, Integer> getDelinquent(Integer threshold) {         Map<Integer, Integer> map = new HashMap<>();         Set<Integer> keys = m.keySet();         Integer temp;         for (int key : keys) {              temp = m.get(key);             if (temp <= threshold) {                  map.put(key, m.get(key));             }         }         return map;     }  I'm not sure what the reason for this Exception is. I'm probably doing more wrong than simply at that line of code but I'm unsure. Help?

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I want to export plots from MATLAB to tikz and use matlab2tikz to do so. Most of the data I have has dates on its x-axis. In MATLAB I use serial date numbers to store the time. I override the ticklabels with corresponding date strings before exporting. This works all very well - the only concern I have is that the decimal factor of the serial date numbers, *10^5, is not replaced or deleted. You can see it in the lower right corner of the following MWE.    My question is basically how to get rid of it? Do I have to do it in every figure, or can it be automated?    This code was used to generate it:  \documentclass{standalone}  \usepackage{pgfplots} \pgfplotsset{compat=1.8}   \begin{document} \input{figure1.tikz}  \end{document}   And the file figure1.tikz, which was generated by matlab2tikz and modified slightly by me:  % This file was created by matlab2tikz v0.4.7 running on MATLAB 8.3. % Copyright (c) 2008--2014, Nico Schlömer <nico.schloemer@gmail.com> % All rights reserved. % Minimal pgfplots version: 1.3 %  % The latest updates can be retrieved from %   http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz % where you can also make suggestions and rate matlab2tikz. %  \begin{tikzpicture}  \begin{axis}[% unbounded coords=jump, scale only axis, xmin=735367.15, xmax=735367.85, xtick={735367.228472222,735367.492361111,735367.791666667}, xticklabels={{12.05. 12:00},{13.05. 12:00},{14.05. 12:00}}, every x tick label/.append style={rotate=45}, ymin=-0.2, ymax=1.5, ylabel=$P$ in \si{kW} ] \addplot [color=blue,solid,forget plot]   table[row sep=crcr]{% 735367.179861111    0\\ 735367.230555556    0\\ 735367.252777778    0\\ 735367.40625    0.205080000014277\\ 735367.406944444    0.205080000014277\\ 735367.407638889    0.205080000014277\\ 735367.408333333    0.234419999960664\\ 735367.409027778    0.234359999994922\\ 735367.409722222    0.263640000030136\\ 735367.410416667    0.263699999995879\\ 735367.411111111    0.263639999975567\\ 735367.411805556    0.292980000031093\\ 735367.4125 0.292979999976524\\ 735367.413194445    0.292980000031093\\ 735367.413888889    0.292979999976524\\ 735367.414583333    0.292920000010781\\ 735367.415277778    0.322319999977481\\ 735367.415972222    0.322260000011738\\ 735367.447222222    0.644520000023476\\ 735367.447916667    0.644519999968907\\ 735367.448611111    0.673860000024433\\ 735367.449305556    0.644519999968907\\ 735367.45   0.644520000023476\\ 735367.450694444    0.673859999969864\\ 735367.451388889    0.673800000004121\\ 735367.464583333    0.439440000009199\\ 735367.465277778    0.410160000028554\\ 735367.484027778    0.761699999966368\\ 735367.484722222    0.849660000003496\\ 735367.485416667    0.878880000018398\\ 735367.499305556    1.05467999999746\\ 735367.5    1.05467999999746\\ 735367.500694444    1.25976000001174\\ 735367.501388889    0.966779999980645\\ 735367.502083333    0.673860000024433\\ 735367.502777778    0.703140000005078\\ 735367.513888889    0.908220000019355\\ 735367.514583333    0.908159999999043\\ 735367.515277778    0.908219999964786\\ 735367.515972222    0.908220000019355\\ 735367.516666667    0.703079999984766\\ 735367.525  0.615240000042832\\ 735367.751388889    0.410159999973985\\ 735367.752083333    0.380820000027597\\ 735367.752777778    0.38087999999334\\ 735367.753472222    0.38087999999334\\ 735367.754166667    0.380820000027597\\ 735367.754861111    0.410159999973985\\ 735367.755555556    0.410160000028554\\ 735367.75625    0.410159999973985\\ 735367.756944445    0.38087999999334\\ 735367.757638889    0.351539999992383\\ 735367.758333333    0.322260000011738\\ 735367.759027778    0.292980000031093\\ 735367.825694444    0\\ 735367.826388889    0\\ }; \end{axis} \end{tikzpicture}%

From the original data, we know that they are nearly 0.087 rather that 0.087 x 10^-2. Why is there scientific notation (10^-2)? It looks ridiculous. Please help me figure it out. Thanks very much!   MWE:  \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \definecolor{mycolor1}{rgb}{1,0,1}  \pgfplotstableread{ X           Y1 1    0.0873514639102964  2    0.0873656441069913  3    0.0873509320240032  4    0.0873490368814644  5    0.0873430960617957  6    0.0873334626756388  7    0.0873430596012905  8    0.0873485872405474  9    0.0873519301953318  10  0.0873474824394306 11  0.08735183859007     12  0.0873408783047386 13  0.0873439016123011 14  0.0873424452271129 15  0.0873452848079798 16  0.0873467228778811 17  0.087348210873026    18  0.0873464310394191 19  0.0873469131127228 20  0.0873449430894595 }\datatable  \pgfplotsset{     width=9cm,     height=6cm,     scale only axis,     xmin=0.5, xmax=20.5,     tick align = outside,     yticklabel style={/pgf/number format/fixed},   } \begin{tikzpicture}  \begin{axis}[     xtick={1,...,20},     ymin=0.08715,     ymax=0.08740,     ytick={0.08715,0.08720,0.08725,0.08730,0.08735,0.08740},     yticklabels={0.08715,0.08720,0.08725,0.08730,0.08735,0.08740},     xlabel={$x$},     ylabel={$y$},     y axis line style={mycolor1},     ytick style={mycolor1},     yticklabel style=mycolor1,     yticklabel style={/pgf/number format/fixed},     axis x line*=bottom,     axis y line*=left] \addplot [     color=mycolor1,     solid,     line width=1.5pt,     mark size=2.7pt,     mark=square*,     mark options={solid,fill=mycolor1}]     table [x=X, y=Y1]{\datatable}; \label{plot1} % So we can recall the plot style later on \end{axis} \end{tikzpicture}% \end{document}


Is the alternating group a lie group. If so what is the lie algebra corresponding to it?    This is not a homework questions. I need the dimension of the lie algebra (if one exists) to prove some theorem as part of my work.

Is it possible for a complex Lie group to be disconnected? What about a compact complex Lie group?


I started to study classical field theory using the book "Field Quantization" of Greiner and Reinhardt, and I have some doubts. First, the book write the Lagrangian $L(t)$ as a functional of a field $\phi(\textbf{x},t)$:  $$L(t) = L[\phi(\textbf{x},t), \dot{\phi}(\textbf{x},t)].$$ After, it defines the Lagrange density $\mathcal{L}$ by $$L(t) = \int d^{3}x \mathcal{L} ( \phi(\textbf{x},t), \nabla \phi(\textbf{x},t), \dot{\phi}(\textbf{x},t)),$$ and the book compute the variation in $L$: $$\delta L (t) = \int d^{3}x\  \delta \mathcal{L} = \int d^{3}x\ \left( \frac{\partial \mathcal{L}}{\partial \phi}\delta \phi + \frac{\partial \mathcal{L}}{\partial (\nabla \phi)}\delta \nabla \phi + \frac{\partial \mathcal{L}}{\partial \dot{\phi}}\delta \dot{\phi} \right),$$ Using that $\delta \nabla \phi = \nabla \delta \phi $ and integrating by parts the second term, it gives $$\int d^{3}x \nabla \frac{\partial \mathcal{L}}{\partial (\nabla \phi)}\nabla \delta \phi  = \int d^{3}x \nabla \left( \frac{\partial \mathcal{L}}{\partial (\nabla \phi)}\delta \phi \right) - \int d^{3}x \left(\nabla \frac{\partial \mathcal{L}}{\partial (\nabla \phi)} \right)\delta \phi.$$ But the book consider only the second term of the second member of the expression above. The first integral should be zero, but why?

Weinberg at page 300 of The Quantum Theory of Fields - Volume I says:  $L$ itself should be a space integral of an ordinary scalar function of $\Psi(x)$ and $\partial \Psi(x)/\partial x^\mu \,$, known as the Lagrangian density $\mathscr{L}$: $$ L[\Psi(t), \dot{\Psi}(t)]= \int d^3x \, \mathscr{L}\bigr(\Psi({\bf x},t), \nabla \Psi({\bf x},t), \dot{\Psi}({\bf x},t)\bigl) $$  So he says that $\mathscr{L} \, $ is a function. But Gelfand and Formin at page one of their book Calculus of variations say:  By a functional we mean a correspondence which assigns a definite (real) number to each function (or curve) belonging to some class.  So from that I'd say it is a functional. The notes of quantum field theory of my professor stay on this side, explicitly calling the lagrangian density a functional. I'm very confused at the moment. I always used this latter way of defining functionals (the Gelfand way) so Weinberg saying that $\mathscr{L}$ is a function confuses me. Can someone makes some clarity about this?