Sorting lists element by element
Are there functions or packages in Mathematica to sort subsets in lex order, colex, revlex, etc.?
How to create id with AUTO_INCREMENT on Oracle? K-means - comparing solutions with SSwithin elbow-method: minimum "too early", or non-monotonic curve How do I tell if matrices are similar? I have two $2\times 2$ matrices, $A$ and $B$, with the same determinant. I want to know if they are similar or not.  I solved this by using a matrix called $S$: $$\left(\begin{array}{cc} a&amp; b\\ c&amp; d \end{array}\right)$$ and its inverse in terms of $a$, $b$, $c$, and $d$, then showing that there was no solution to $A = SBS^{-1}$. That worked fine, but what will I do if I have $3\times 3$ or $9\times 9$ matrices? I can't possibly make system that complex and solve it.  How can I know if any two matrices represent the "same" linear transformation with different bases?  That is, how can I find $S$ that change of basis matrix?  I tried making $A$ and $B$ into linear transformations... but without the bases for the linear transformations I had no way of comparing them.  (I have read that similar matrices will have the same eigenvalues... and the same "trace" --but my class has not studied these yet. Also, it may be the case that some matrices with the same trace and eigenvalues are not similar so this will not solve my problem.)  I have one idea. Maybe if I look at the reduced col. and row echelon forms that will tell me something about the basis for the linear transformation? I'm not really certain how this would work though? Please help. Can magnetic fields be "blocked"? For example, in the game, TitanFall, a robot stop bullets with ( presumably ) a magnetic shield.  I wish to calculate the magnetic force required to stop a bullet within a few microseconds.  But the problem I have is that my entire electronic system or the vehicle ( most likely even a building ) will be subjected to massive fields most likely destroying it as well.  Does any know of a way to "block" or divert the field around my vehicle? Is it even possible? My knowledge in magnetic fields are quite limited at this time. Center of mass in n dimension, possible? Is it possible to calculate the center of mass for some 20-dimension ($x_i, i=1,\ldots,20$) particles? If it is possible, how can I do that? How do I change the GRUB boot order? Gravity as a gauge theory Currently, (classical) gravity (General Relativity) is NOT a gauge theory (at least in the sense of a Yang-Mills theory).   Why should "classical" gravity be some (non-trivial or "special" or extended) gauge theory? Should quantum gravity be a gauge theory?  Remark: There are some contradictory claims in the literature to this issue. To what extent gravity is "a gauge" theory?Obviously, GR is not a YM theory. So, why do some people say that gravity "IS" a gauge theory? I found this question relevant, e.g., then we handle GR in the Einstein-Cartan theory or any other theory beyond GR, like teleparallel theories or higher-derivative gravitational theories. So I think it could be useful to discuss the "gauge flavor" of gravity here. Do I cast the result of malloc? How fast does gravity propagate? UIToolbar tint on iOS 4 What benefit do plasterboard/drywall screws have? I have some plasterboard screws like this:     However, without a drill I have a job getting them into the wall. Am I safe to use normal screws on hangings that aren't going to be taking a great deal of weight? In this case it is a rack of coat hooks. Mis-aligned shapefiles in QGIS? I have a sprite that moves from waypoint to waypoint. It turns to face its velocity vector, but not instantly (there's a rotation speed).  The problem I'm having is, from one direction to another, the sprite will often turn in wild, unnecessary ways instead of appearing like you might expect a car to appear (turn such that the minimum delta in angle occurs).  Right now I'm using the following formula to calculate the rotation float for the current velocity:  MathHelper.PiOver2 + -Math.Atan2(anotherVector.Y - vector.Y, -(anotherVector.X - vector.X));   And then I lerp the current rotation by the new rotation by the rotation speed (10f):  rotation = MathHelper.Lerp(rotation, targetRotation, 10f * (float)gameTime.ElapsedGameTime.TotalSeconds);   But unfortunately, it's causing the sprite to spin in wild directions before reaching the correct angle. Any suggestions? There is by now a captcha-problem Where can I get more favourable exchange rate, in general?changing baht to Canadian dollars in Thailand or Canada or make a bank transfer to my Canadian account For a given inner product space $V$, I would like to prove the inequality $$\|\mathbf{x}+\mathbf{y}\|^2 + \|\mathbf{x}-\mathbf{y}\|^2 = 2(\|\mathbf{x}\|^2 + \|\mathbf{y}\|^2).$$  We see that $$\|\mathbf{x}+\mathbf{y}\|^2 + \|\mathbf{x}-\mathbf{y}\|^2 = \langle\mathbf{x}+\mathbf{y},\mathbf{x}+\mathbf{y}\rangle + \langle\mathbf{x}-\mathbf{y},\mathbf{x}-\mathbf{y}\rangle,$$  which by linearity $$=\langle\mathbf{x},\mathbf{x}+\mathbf{y}\rangle + \langle\mathbf{y},\mathbf{x}+\mathbf{y}\rangle + \langle\mathbf{x},\mathbf{x}-\mathbf{y}\rangle - \langle\mathbf{y},\mathbf{x}-\mathbf{y}\rangle.$$  I've been trying to figure out how to go about this proof using linearity in the second argument of an inner product, but my textbook does not say that linearity necessarily holds in the second component. If it does, how would I go about the rest of this proof? If not, should I be potentially using some aspect of conjugate symmetry to prove this statement? How to make Arduino (Snap) access serial port /dev/ttyUSB0 (or /dev/ttyACM0)? I have Ubuntu 18.04 LTS installed.  I installed Arduino IDE v1.8.5 as a snap with  snap install arduino-mhall119   I have added my user to dial-out group and rebooted:  sudo usermod -a -G dialout $USER  $ groups  username adm dialout cdrom sudo dip plugdev lpadmin sambashare   I connected my Arduino Nano to the laptop, it is detected on port /dev/ttyUSB0 (ch341-uart).  $ ls /dev/ttyUSB0 -al crw-rw---- 1 root dialout 188, 0 авг 13 11:59 /dev/ttyUSB0   I tried to upload the simpliest Blink sketch and get the following errors in the terminal:  $ arduino-mhall119.arduino    avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied   Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.**   Also I have installed arduino 1.8.5 with umake - it can access serial port in usual way.  Note: we already have  here, but the solution was to use , not fix for the Snap.  So my question is: How to make Arduino (Snap) access serial port /dev/ttyUSB0 (or /dev/ttyACM0)?  Update: connecting serial-port to the snap fails with the following message  $ snap connect arduino-mhall119:serial-port  error: snap "core" has no "serial-port" interface slots   Current interfaces are:  $ snap interfaces | grep arduino :home                            arduino-mhall119,gedit,organize-my-files,vlc :network                         arduino-mhall119,gedit,organize-my-files,pulsemixer,vlc :unity7                          arduino-mhall119,gedit,organize-my-files,vlc :x11                             arduino-mhall119,organize-my-files,pulsemixer,vlc -                                arduino-mhall119:serial-port   Changing permissions of serial port to 777 with sudo chmod 777 /dev/ttyUSB0 does not help.  The following do not work too (because of syntax errors):  $ sudo snap connect arduino-mhall119:arduino error: snap "arduino-mhall119" has no plug named "arduino"  $ snap connect arduino-mhall119:/dev/ttyUSB0 error: snap "arduino-mhall119" has no plug named "/dev/ttyUSB0"  $ snap connect arduino-mhall119 error: cannot resolve connection, plug snap name is empty   Information about YAML-manifest:  $ ls -l /snap/arduino-mhall119/current/meta/snap.yaml -rw-r--r-- 1 root root 353 июл 28 00:20 /snap/arduino-mhall119/current/meta/snap.yaml  $ cat /snap/arduino-mhall119/current/meta/snap.yaml |grep -A 12 slots  $ cat /snap/arduino-mhall119/current/meta/snap.yaml |grep -A 5 plug     plugs:     - x11     - unity7     - home     - network     - serial-port Hi I was looking to install this with or under VMware on windows 7 64bit, is this possiable and where can I find instructions on how to do so? I have searched the site and can not find anything for help on installing this with VMware.  Also I have VMware Workstation do I need VMware player? I have a significant 2x2 interaction in a between-subjects design.  I would normally report omega-squared as my effect-size measure, but I've been asked to provide Cohen's d instead?  Can Cohen's d be computed for an interaction?  If so, how? Im trying to run the following code as a powershell script,but I cant get it to work. 1st,the following works with one -Include item but I cant seem to get it to work with multiple ones. 2nd, the -Exclude perimeter doesn't seem to work. I still get files from the C:\Windows and C:\Program Files directorys .  $Include = "*.zip","*.rar","*.tar","*.7zip" $exclude = "C:\Windows","C:\Program Files" Get-ChildItem "C:\" -Include $Include -Exclude $Exclude -Recurse -Force -ErrorAction silentlycontinue | Select-Object -ExpandProperty FullName   Note: The purpose of this script is to find all compressed files on the system. I know this is probably really simple but I just cant seem to get it to work.