Translation of Vectors

Question: I am a bit confused about translation of vectors. In the first class in physics itself we  are told that we can translate vectors as we like to the desired position to do whatever that we are trying to do. For example, if someone draws two random vectors then to get the sum, we translate them, make a parallelogram and draw the diagonal as the resultant.

However I have some doubts on this. In the following example, clearly we cannot translate the vectors.

Consider this rigid body. We want to calculate the torque about origin of a force.
Now if we translate the force vector, then we would obtain the following.

Obviously the situation are very different and its not equivalent.
So are we really allowed to translate vectors?
Comment: Related posts: [1](https://physics.stackexchange.com/q/649543/260477), [2](https://math.stackexchange.com/q/4396970/768162)
Answer: Yes, we are allowed to translate vectors. To put it simply, think of coordinate geometry. When you shift the origin, it doesn't effect the orientation and length of a line segment. Similarly, in vectors, translation doesn't effect the vector as a vector is defined by its magnitude and direction. You can move it to anywhere in space and it will remain the same, provided these 2 properties don't change.
In the example you gave in the problem, although force vector doesn't change and is translated, the position vector of the point of application changes . b and a are completely different vectors in terms of magnitude and direction and hence their respective vector products with force vector are different and hence, the torque is different.
To summarize, translation of vectors means that the vector doesn't change if you move it to different points in space. However, the torque on a body also depends upon the position vector from centre of mass, which changes in this case. This doesn't contradict translation of vectors, since vector product depends upon both the vectors, not only force.
Update-Point of application matters only because position vector depends upon it and hence torque.
Comment: I believe OPs question is more "If force is a vector, and vectors can be translated freely, why does the point of attack matter/exist?"
Comment: Yes, @Nephente, I agree.  The effect of the vector does depend on position.  If a force (vector) does not act at the position of a point mass, the mass is not affected by the force.  Please see my answer.
Answer: Vectors that cannot be translated are the ones that depend on the origin of coordinates.  First and foremost in the list is the position vector $\vec r$ followed all the others with definitions that depend on the position vector.  These would be torque, $\vec \tau = \vec r \times \vec F$; angular momentum $\vec L = \vec r \times \vec p$ and so on.  That is why when you mention torque or angular momentum you have to specify the reference point about which you express these vectors in order to make sense.
Displacement, being the difference between two position vectors, can be translated. The vector from Boston to Philadelphia is the same regardless of whether you specify the positions of the two cities relative to New York or London.  This means that vectors derived from the displacement vector, e.g. linear velocity, can also be translated.
A notable exception is the linear velocity in rotational motion, $\vec v = \vec \omega \times \vec r$ because, of course, the position vector of the rotating object figures in it.  If you translate this velocity vector around the circle from the 12 o'clock to the 3 o'clock position you will have to change its direction by $90^{\text{o}}.$
Answer: What you are describing is a property of vectors. Vectors are not defined by their location in space. They are only defined by their magnitude and direction.
Intuitively speaking, a vector describes displacement from its start point to its end point. The displacement between these two points is only defined by how much space there is between them, and the direction the start point "faces" across this space. It doesn't matter where in a plane or space the vector is because the displacement it describes is the same. If I have a three-dimensional force vector with a magnitude of 10 N facing north (I use "north" very loosely), regardless of whether this vector is positioned here on Earth or on the Sun it is identical in quality.
As you say, when working with vectors algebraically their position is of no importance because the displacement they describe is not affected by their position. However, this is simply not true when describing forces in the real world. A force, as a vector, is still defined by just its magnitude and direction. The way a force interacts with the real world does not change its properties. Nevertheless, where we direct that force affects the translational, rotational, and vibrational motion of the object. The position vector is more of a mathematical tool than anything else. The way moment is defined, taking the cross product of the position vector and the force vector will give us the moment about the start point of the position vector. The position vector, similarly, is still defined only by its magnitude and direction, regardless of its application in real life.
Answer: The definition of a vector as having magnitude and direction is typically used in physics, so the exact location of the vector is not included in the definition.  This is also called a "free" vector.  As you say the effect of the vector depends on its location.  For example, a force (vector) cannot act upon a point mass unless is acts "at" the location of the mass.
Physicists typically regard a vector as a free vector, recognizing the effect of the vector depends on its location. [Davis, Introduction to Vector Analysis] [Symon, Mechanics]
Engineering texts (and some older physics texts) sometimes distinguish among free, bound, and sliding vectors.
A good discussion of a free vector and its use in transforming between coordinate systems (for example, from an inertial system to a rotating and translating system) can be found in the textbook Mechanics by Symon.
Answer:
In your given exercise, let force $\vec F$ be $\begin{bmatrix} 7 \\ -2 \\0\end{bmatrix},$ its application point $A$ be $(2,2,0),$ and $B$ be the point $(7,-2,0).$

As $\vec{OA}$ and $\vec{OB}$ are position vectors, they are "bound
vectors".
Now, the torque $\vec\tau$ about point $O$ due to force $\vec F$
applied at point $A$ is a function of (depends on) the distance
between $O$ and $\vec F.$ So, computing $\vec\tau$ intrinsically
forbids $\vec F$ from freely translating (this will change said
distance from $\left|\vec{OA}\right|\sin\theta$ to something else)
but allows $\vec F$ to freely slide along its line of action (this
does not affect said distance); in other words, for the purpose of
computing $\vec\tau,\;\vec F$ is a "sliding vector".
Finally, let's geometrically determine the sum of $\vec F$ and
$\vec{OA}.$ We do this by applying the Parallelogram Law of Vector
Addition, whose algorithm demands that the two vectors be freely
translated (but not rotated, for that would alter them). Here,
clearly $\vec F$ and $\vec{OA}$ are "free vectors".

Notice that even within a single physical setup, the vector $$\vec F=\begin{bmatrix} 7 \\ -2 \\0\end{bmatrix}=\vec{OB}$$ is variously "free", "sliding" and "bound", depending on the context; by "context", I mean what we are doing with the vector, in other words, what definition or theorem we are invoking for the task at hand.
The moral is this: after the physical scenario has been mathematically modelled (abstracted), the classification system <free vector versus sliding vector versus bound vector> is unnecessary; instead, carefully respecting the phrasing and conditions of definitions and theorems ensures that steps performed are valid.
Comment: "This answer is a continuation of this previous answer to the OP." I'm not the OP here. I was just the bounty offerer :-)
Comment: P.S. This answer is a continuation of [this previous answer](https://math.stackexchange.com/a/4397016/21813) to the OP.
Answer: Yes, you can translate vectors, because they are defined by magnitude and direction, they are not defined by their location.
In the OP's picture, torque is a vector, and defined by the cross product of two others. If one of them changes and the other is the same, torque changes.
It is not so different from the concept of a scalar. Suppose a sphere where half of its volume has a mass $m$, and the other half mass $M$, ($M > m$). If the volume with M forms an inner sphere and m is a shell covering it, we have a symmetric object with an indiferent equilibrium. But if one hemisphere is M and the other m, it has different properties, like a preferred stable position. Depending on the relative position of the scalar quantity mass, the physical situation changes, but the masses themselves don't change.
Answer:
to obtain the torque about the z-axis the tail of the vector a and the tail of vector F must be at the same point. the tip of the vector a and b point to $~(0,0,0)~$
from the fig the components of the vectors in $~(x,y,z)~$
coordinate system are
$$\vec F=\begin{bmatrix}
  F_x \\
  -F_y \\
  0 \\
\end{bmatrix}\\
\vec a=\begin{bmatrix}
  -a_x \\
  -a_y \\
  0 \\
\end{bmatrix}\\
\vec b=\begin{bmatrix}
  b_x \\
  b_y \\
  0 \\
\end{bmatrix}$$
thus the torques
\begin{align*}
&\vec{\tau}_a=\vec a\times \vec F=\begin{bmatrix}
  0 \\
  0 \\
  a_x\,F_y+a_y\,F_x \\
\end{bmatrix}\\
&\vec{\tau}_b=\vec b\times \vec F=\begin{bmatrix}
  0 \\
  0 \\
  -b_x\,F_y-b_y\,F_x \\
\end{bmatrix}
\end{align*}
so $~\vec \tau_b=\vec\tau_a~$ if $~\vec b=-\vec a~$

Translation of Vectors


To what extent can you proxy macroeconomics with broken down cars on highways?

Question: How can To what extent can you proxy macroeconomics with broken down cars on highways? be made on topic and not opinion based? Thanks.
Answer: I can't speak for others, but the reason why I voted to close down was this part of the question:

Has u/royalrush05 on r/TrueAskReddit discovered a new and improved indicator of the macroeconomy?

This question is inherently opinion-based. Anything you want can be an indicator. Also improved compared to what and across what dimensions? In its simplicity and ease of data collection? Amount of correlation with economic performance? Ability to forecast economic activity? By being theoretically appealing because there is an underlying reason for there to be a relationship between the indicator and variable you want to proxy?
To make it more objective, you could try to rephrase it in a way that makes it possible to answer the question factually. For example, rephrasing the question as:
Is there any empirical evidence for the number of broken cars being related/correlated/able to forecast macroeconomic activity? Have other economists tried to proxy macroeconomic performance with broken cars in academic literature or by any policy institutes?
Furthermore, to also make your question more narrow, you might want to specify whether the macroeconomic performance you care about is in terms of output or employment or some other macroeconomic performance because just saying macroeconomy is a bit broad.
On the same note, I used a lot of slashes / in my suggested edit because even though your question was closed as opinion-based it is also quite broad. I would recommend making some effort in figuring out what exactly you are most interested to make the question more narrow.
Comment: thanks. i've edited my post along your lines. can you please edit it, if you feel I missed something?
Comment: @d'Halluin you are welcome. I think this is much better question. I voted to reopen it and even upvoted it hopefully other people will notice the edits as well


Read the package name of an Android APK

Question: I need to get the package name of an Android APK. I have tried to unzip the APK and read the contents of the AndroidManifest.xml file but it seems that it's not a text file.
How can I extract the APK's package name?
Comment: https://www.sisik.eu/apk-tool
Answer: aapt dump badging <path-to-apk> | grep package:\ name

Comment: `aapt` command is located under `Android\SDK\build-tools\version`. on windows command can be `aapt dump badging  | findstr -i "package: name"` or `aapt dump badging `
Comment: appt dump badging  | grep package:\ name
Comment: `aapt` on macOS located in `~/Library/Android/sdk/build-tools/{version}`
Comment: @Campiador you can just type up until the pipe `|`, press enter and then just search the output for your desired parameter. Just remember that `aapt` needs to be in your path
Comment: Is there a way to call this from within Android code?  I want to be able to launch a package of an apk I download through my app.
Comment: On mac, if you still see `command not found: aapt`, try with './' i.e

```cd ~/Library/Android/sdk/build-tools/{version}``` and then
```./aapt dump badging  | grep package:\ name```
Comment: See my answer below if you need to get this programmatically (for a script).
Comment: @Campiador: for Windows, uses findstr command instead of grep
Comment: Upvoted despite that it extracts the whole line instead of the package name only, which unfortunately is not suitable for my script. But it put me on the right path.
Comment: @hackbod I have posted a question and would like a comment from someone from google, hope you can spare some time to reply http://stackoverflow.com/q/36614857/1503130 thanks.
Comment: apkanalyzer can be found under Android/sdk/tools/bin folder. Use `apkanalyzer manifest application-id ` to print package name of apk.
Comment: On Arch, download `android-sdk-build-tools` from the AUR
Answer: Install the apk on your Android device. Then

you can launch adb shell and execute pm list packages -f, which shows the package name for each installed apk.

This is taken from
Find package name for Android apps to use Intent to launch Market app from web.
Comment: to search for specific package name `pm list packages -f | grep term-to-search-for`
Comment: Also, you will have to ensure that you are running with elevated privileges. Basically, in the terminal, use the `su` command first.
Answer: Based on @hackbod answer ... but related to Windows.
aapt command is located on Android\Sdk\build-tools\<build-tools-version>.
If you need more info about what is aapt command (Android Asset Packaging Tool) read this https://stackoverflow.com/a/28234956/812915
The dump sub-command of aapt is used to display the values of individual elements or parts of a package: aapt dump badging <path-to-apk>
To view only the line(s) containing the occurrence of package: name, use findstr (in Windows PowerShell or CMD):
aapt dump badging <path-to-apk> | findstr -n /C:"package: name"
Remember to surround <path-to-apk> with quotes if it contains spaces.
Hope it help other windows user!
Answer: If you are looking at google play and want to know its package name then you can look at url or address bar. You will get package name. Here com.landshark.yaum is the package name
 https://play.google.com/store/apps/details?id=com.landshark.yaum&feature=search_result#?t=W251bGwsMSwyLDEsImNvbS5sYW5kc2hhcmsueWF1bSJd

Answer: If you open the AndroidManifest.xml using MS Notepad, search for phrase package and you'll find following:
package manifest $xxx.xxxxxxx.xxxxxxx |

where xxx.xxxxxxx.xxxxxxx is your package name, just written with a space after each character.
It's useful way when you don't have any specific tools installed.
Comment: I unpacked the APK, but AndroidManifest.xml was a binary file. Weird but true.
Comment: This is especially useful if the code for the app is on github! Much easier than the other methods, thanks!
Answer: The following bash script will display the package name and the main activity name:
apk_package.sh
package=$(aapt dump badging "$*" | awk '/package/{gsub("name=|'"'"'","");  print $2}')
activity=$(aapt dump badging "$*" | awk '/activity/{gsub("name=|'"'"'","");  print $2}')
echo
echo "   file : $1"
echo "package : $package"
echo "activity: $activity"

run it like so:
apk_package.sh /path/to/my.apk

Comment: Never combine grep and sed with awk. Using awk is enough.
Answer: Since its mentioned in Android documentation that AAPT has been deprecated, getting the package name using AAPT2 command in Linux is as follows:
./aapt2 dump packagename <path_to_apk>
Since I am using an older version of Gradle build, I had to download a newer version of AAPT2 as mentioned here :
Download AAPT2 from Google Maven
Using the build-tools in my sdk - 25.0.3, 26.0.1 and 27.0.3, executing the aapt2 command shows an error: Unable to open 'packagename': No such file or directory. That's why I went for the newer versions of AAPT2.
I used 3.3.0-5013011 for linux.
Comment: For aapt2 version 2.19, I had to do `aapt2 dump /path/to/apk | grep "Package name"`
Answer: A Programmatic Answer
If you need to do this programmatically, it's a little more involved than just getting the answer into your brain. I have a script that I use to sign all of our apps, but each use a different key. Here are 2 ways to get just the Package Name as output so you can put it in a variable or do whatever you need with it.
Example output: com.example.appname (and nothing more)
Requirements
aapt - Android Asset Packaging Tool, part of the SDK Tools download
Solution 1
Using awk specify ' as the Field Separator, search for a line with package: name=, and print only the 2nd "field" in the line:
aapt dump badging /path/to/file.apk | awk -v FS="'" '/package: name=/{print $2}'

A weakness of this method is that it relies on aapt to output the package information fields in the same order:
package: name='com.example.appname' versionCode='3461' versionName='2.2.4' platformBuildVersionName='4.2.2-1425461'

We have no commitments from the developers to maintain this format.
Solution 2
Using awk specify " as the Field Separator, search for a line with package=, and print only the 2nd "field" in the line:
aapt list -a /path/to/file.apk | awk -v FS='"' '/package=/{print $2}'

A weakness of this method is that it relies on aapt to output package= only in the Android Manifest: section of the output. We have no commitments from the developers to maintain this format.
Solution 3
Expand the apk file with apktool d and read the AndroidManifest.xml.
This would be the best method, but the AndroidManifest.xml is a binary file and all the SO answers I see for converting it to text do not work. (Using apktool d instead of a simple unzip is supposed to do this for you, but it does not.) Please comment if you have an solution to this issue
Comment: Thanks for giving more information to understand rather than just giving a single line of command to copy.
Answer: A simple solution would be Open Android Studio -> Build -> Analyze Apk... browse and select the APK now you can find the package name and pretty much you can read.
Answer: You can use Analyze APK... from the Build menu in Android Studio, it will display the package name at the top of new window.
Answer: On Mac:
Way 1:
zgong$ /Users/zgong/Library/Android/sdk/build-tools/29.0.3/aapt dump badging ~/Downloads/NonSIMCC-151-app-release-signed.apk
package: name='com.A.B' versionCode='2020111801' versionName='1.0.40' compileSdkVersion='29' compileSdkVersionCodename='10'
sdkVersion:'24'
targetSdkVersion:'29'
......

Way 2:
/Users/zgong/Library/Android/sdk/build-tools/29.0.3/aapt2 dump packagename ~/Downloads/NonSIMCC-151-app-release-signed.apk
com.A.B

Answer: I think the best and simplest way to extract only the package name in Linux is
aapt dump badging <APK_path> | grep package | sed -r "s/package: name='([a-z0-9.]*)'.*/\1/"

Explanation:

AAPT extracts the APK information
Grep "package" to keep only the line about the package information
Make sed replace the whole line with the package name only using the following regex: package: name='([a-z0-9.]*)'.* and replacing with the first (and only) matching group.
Answer: If you don't have the Android SDK installed, like in some test scenarios, you can get the package name using the following bash method:
getAppIdFromApk() {
  local apk_path="$1"

  # regular expression (required)
  local re="^\"L.*/MainActivity;"
  # sed substitute expression
  local se="s:^\"L\(.*\)/MainActivity;:\1:p"
  # tr expression
  local te=' / .';

  local app_id="$(unzip -p $apk_path classes.dex | strings | grep -Eo $re | sed -n -e $se | tr $te)"

  echo "$app_id"
}

Tested on a mac. 'strings' and 'unzip' are standard on most linux's, so should work on linux too.
Comment: This is the java package name of the Mainactivity class though, might not match the app's package name.
Answer: A very simple method is to use apkanalyzer.
apkanalyzer manifest application-id "${_path_to_apk}"

Comment: Works for me, but replacing all "${_path_to_apk}" placeholder by apk path. Example: apkanalyzer manifest application-id /Users/user/..../project/build/app/outputs/flutter-apk/app.apk
Answer: If you just want to know package name, run adb logcat, launch the activity you want , you will get a hint on the package name.
Answer: Another solution is to use aapt list and use sed to parse through that:

aapt list -a $PATH_TO_YOUR_APK | sed -n "/^Package Group[^s]/s/.*name=//p"

Comment: Package Group Name is only coincidentally the same as Package Name in some apps. You really need to be using the `A:package="com.example.appname"` in the `Android Manifest:` section if you do `aapt list -a`
Answer: There's a very simple way if you got your APK allready on your Smartphone. Just use one of these APPs:
Package Name Viewer Apps
Answer: You can use Android Studio for this. Select your APK via the GUI menu:

And open manifest as usual:
Answer: To use this in batch scripting it's handy to have the script return just the package name (e.g. for uninstalling an app when you have the APK).
Here's the script I use:
# extract the android package id from a built apk file
# usage ./getPackageName.sh <path-to-apk>
line=`aapt dump badging "$1" | grep package:\ name`

# above returns:
# package: name='com.calvium.myapp' versionCode='1' versionName='1.0'
if [[ $line =~ name=\'(.+)\'\ versionCode ]]; then
    echo ${BASH_REMATCH[1]}
else
    echo "Failed to find package name"
    exit 1
fi

available on gist
So you could write:
adb uninstall `./getPackageName.sh file.apk`
Answer: You can extract AndroidManifest.xml from the APK, remove all NULL bytes, skip everything until after the string 'manifest', and then you are at a length byte followed by the package name (and what comes after it). For the difficult task I use the great GEMA tool, so the command looks like this:
7z e -so MyApp.apk AndroidManifest.xml | gema '\x00=' | gema -match 'manifest<U1>=@substring{0;@char-int{$1};$2}'

Of course, you can use any other tool to do the filtering.
Answer: For Windows following worked for me:
:: // Initializing variables
SET adb="C:\Users\<User name>\AppData\Local\Android\Sdk\platform-tools\adb"
SET aapt="C:\Users\<User name>\AppData\Local\Android\Sdk\build-tools\22.0.0\aapt"
SET APKPath=C:\Users\<User name>\Desktop\APK\Instant_Instal\

CD %APKPath%

:: // Searching for apk file and storing it
FOR /F "delims=" %%f IN ('dir /S /B *.apk') DO SET "APKFullPath=%%f"
SET apk=%APKFullPath%

:: // Command adb install apk, run apk
%adb% install %apk%

:: // Fetching package name from apk
%aapt% dump badging %APKFullPath% | FIND "package: name=" > temp.txt
FOR /F "tokens=2 delims='" %%s IN (temp.txt) DO SET pkgName=%%s
del temp.txt

:: // Launching apk
%adb% shell monkey -p %pkgName% -c android.intent.category.LAUNCHER 1

pause

Note
Please edit the paths of adb, aapt, APKPath according to the paths of adb, aapt, and the apk location in your system.
Working:

Here I have added the apk in a folder on Desktop "\Desktop\APK\Instant_Instal\".
The command %adb% install %apk% installs the application if the device is connected.
This %aapt% dump badging %APKFullPath% | FIND "package: name=" > temp.txt fetches package name and a few other details like version etc. of the apk and stores in a temp.txt file in same location as that of the apk.
FOR /F "tokens=2 delims='" %%s IN (temp.txt) DO SET pkgName=%%sextracts the package name and assigns topkgName` variable
Finally %adb% shell monkey -p %pkgName% -c android.intent.category.LAUNCHER 1 launches the app.

In essence the above code installs the apk from given location in desktop "Desktop\APK\Instant_Instal\" to the device and launches the application.
Answer: You can get the package name programmatically by :
packageManager.getPackageArchiveInfo(apkFilePath, 0)?.packageName

Comment: other answers, use external tools but by this answer you can extract your package name in your android app.
Answer: you can instal Package_Name_Viewer.apk on your emulator and next you can see package name of all instaled app on your emulator.
Answer: I also tried the de-compilation thing, it works but recently I found the easiest  way:

Download and install Appium from Appium website
Open Appium->Android setting, choose the target apk file. And then you get everything you want, the package info, activity info.
Answer: As I don't was able to find the package name in the .apk file with editor (like suggested above), I have checked the functions in the App "ES Datei Explorer" / "ES File Explorer" (free version) that I had installed already.
In this tool, the package name is showed properly.
As I think a good file explorer should not be missing on a phone, I suggest to use this tool (if you already have installed the apk on an mobile and have to know the  package name).
Answer: If you want to read the package name of a typical APK file in your app, there's an easy way to analyze the PackageInfo:
fun getAPKPackageName(apkFile: File?): String? {
        if (apkFile == null || !apkFile.isFile || !apkFile.exists()) return null
        val apkFilePath = apkFile.absolutePath
        if (apkFilePath.isNullOrEmpty()) return null
        val packageManager = App.context.packageManager ?: return null
        val packageInfo = packageManager.getPackageArchiveInfo(apkFilePath, 0) ?: return null
        return packageInfo.packageName
    }

Read the package name of an Android APK


How to connect Sony Xperia L with Ubuntu?

Question: How do I connect my Sony Xperia L in MTP mode with Ubuntu? If I connect in MTP mode, Ubuntu fails to read my files from internal storage.
What can I do?
Answer: That might depend on which Android version your device it running. Some devices additional support USB mass storage. Also: there are some packages you might install/update on your Ubuntu side, to support mtpfs (see e.g. answers here and here).
Alternatively, you might wish to go the "ADB way" (this is how I do it on my Ubuntu box). Here you would need a basic ADB installation (see: Is there a minimal installation of ADB?) and adbfs (see my answer here). In both cases, you can use graphical file managers as well as the command line to deal with your files.
Answer: Normally mass storage mode was not supported by Sony xperia L if it doesn't had any sdcard.So,you have to connect the xperia L with Ubuntu in MTP mode to see its content.
In Ubuntu,an android device which was connected in MTP mode was not detected if it was pluggedin to any one of the USB 2.0 ports.For getting your device detected in Ubuntu,you have to plugin the phone in USB 3.0 port.
Port with black tongue - USB 2.0 port
Port with blue tongue - USB 3.0 port
Tested in Ubuntu 13.04 and 13.10.


Generic flash downloader

Question: There are several content downloaders like You_tube_downloader and many others. However i don't wnat something which is specific to one site or another. is there something like Real_player_for_windows which is capable of downoading_any flash content which it comes across any_website on the internet. I need something generic and which holds true for every website not just one or two
Comment: jdownloader is a really good all-round downloader
Comment: will it work on 90% of others' not just youtube ?
Answer: If you are comfortable in using firefox addon, use DownloadHelper.
Answer: I think, FlareGet would be an ideal choice for you. It is available for free in Ubuntu Software Center

FlareGet is a full featured, multi-threaded and multi-segment download manager and accelerator

But the free version in Ubuntu software center does not support "Browser integration", you need to pay $10 to get browser integration plugin. I guess without browser integration, download manager won't make sense.
So here is the workaround to get Broeser integration for Firefox. I have tested it on Firefox 18 and it works like a charm.

Just go to Firefox > Tools > Add ons > Extensions.
Search for addon "FlashGot", install it and Restart the Firefox.
Go to Tools > Add ons > Extension > Preferences for FlashGot.
On General tab, choose FlareGet as download manager and check the check-box against "Show in Context Menu"
On FlashGot tab, choose FlareGet as download manager and check the check-box against "Show Toolbar button".
Now restart the Firefox. FlashGot will act as Firefox integration plugin for FlareGet.

Just right click any downloadable link and choose FlareGet.

If you want you download video from YouTube just play the video, an icon will appear on right most side of the tile bar. Just click on that icon and FlareGet will capture and download the video.

I love Firefox so this is enough for me. Something similar can be worked out for Chrome.
Comment: Please avoid posting the same answer in more than one place. When tempted to do so, often the answer should be customized to account for what is different about the different questions (I recommend that here, as the questions, and thus the way this solution will be used, are substantially different), or (2) one question should be flagged for closure as a duplicate of another question. (You can flag posts once you gain [15 reputation](http://askubuntu.com/privileges/flag-posts) on the site.)

Generic flash downloader


How do I change the length of the secondary bone segments with Geometry Nodes

Question: I am trying to make spines generated on a Bezier curve and have it 95% working. The rotations are all correct and the scaling is how I like it BUT I cannot figure out how to change the length of the secondary segments (smaller horizontal bones) to match the scaling factor of the main segments. I need to somehow sample the radius of the main bone segment mesh, then add a slight value to that, convert it to a vector format and then use it as input for the start and end coordinates of the secondary segments. But I am at a loss for how to do so.
Answer: When instancing, you can use the radius (or other calculation) to change the instance scales.


Is there an encyption scheme that combines additive homomorphism with ability to proxy re-encrypt?

Question: Is there an encyption scheme that combines additive homomorphism with ability to proxy re-encrypt? I've tried digging around on the Internet but haven't found anything conclusive on the topic.
Comment: Craig Gentry's full-homomorphic scheme is a one-time multi-use proxy-reencrypt scheme (in fact, it is this property that allows him to 'bootstrap' the scheme). It's far from efficient, however, although there is a great deal of research into making it so.
Answer: The schemes by AFGH in this paper are pairing based ElGamal type non-interactive, single-use (single-hop) and unidirectional IND-CPA secure proxy re-encryption schemes.
Although by their construction they are multiplicatively homomorphic (the authors do not mention it in the paper, but it works analogously to ElGamal), you can use the same trick as in "exponential ElGamal" to make them additively homomorphic.
This means that you represent the message $m$ to be encrypted as power of the generator $g$ of the target group ($G_2$ in their paper), i.e., as $g^m$ for messages in $Z_p$ (with $p$ being the order of the prime order group). Then, you are, however, limited to "small" message spaces as decrypting involves computing discrete logs in $G_2$. I do not know your application, but in many scenarios that should be sufficient.
As far as I know it has never been used in this context and there are no papers I am aware of that use additively homomorphic proxy re-encryption.
There may also be other schemes (as the one from INDOCRYPT 2013 pointed out by xagawa - however, this scheme is multi-hop - which may render it impractical for some applications but may allow others not feasible with one-hop schemes), but this one should be a good starting point. As already stated by Reid, Gentry's scheme can also be used for that, but fully homomorphic encryption schemes are not yet practically efficient.
Answer: Very recently,
Yoshinori Aono, Xavier Boyen, Le Trieu Phong, and Lihua Wang (INDOCRYPT 2013) proposed an additively-homomorphic proxy re-encryption scheme from lattices, which is multi-hop, unidirectional, and CPA-secure.
They reported that their scheme is faster than the AFGH05 scheme.


How to map a ResultSet with unknown amount of columns to a List and display it in a HTML table?

Question: I have created a Database Application using Netbeans, GlassFish and JavaDB. Now my controller Servlet code executes some dynamic SQL queries and get back a Result Set (or I can ahange toString). Now, how can I show the returned Result Set in a tabular format ( I have no idea about structure of result set). Can anybody help me about this ?
Comment: what problem are you having exactly? gettings the rows from the result set? generating a HTML table? show us the code you have and tell us where you're stuck.
Comment: @JB Nizet,  I have a code like, - createStatement(); resultset rs = st.executeQuery(sql query). Now I got stuck here. How to show this result set in a HTML table. As I have no idea about query, I have no idea about result set structure.
Comment: @ BalusC, I have seen your reffered page. But,to apply product.setId(resultSet.getLong("id")) - this I have to know how many colums and what table the statement is returnning. I have no idea of that.
Comment: I posted an answer. Note, to reply others in comments, please do not put a space after the `@`. I did not see your comment reply.
Answer: You can use Map<String, Object> to represent a "dynamic" row, which is iterable in <c:forEach>. You can use ResultSetMetaData to collect information about the columns such as the column count and the column labels.
So, this mapping should do:
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
ResultSetMetaData metaData = resultSet.getMetaData();
int columnCount = metaData.getColumnCount();

while (resultSet.next()) {
    Map<String, Object> columns = new LinkedHashMap<String, Object>();

    for (int i = 1; i <= columnCount; i++) {
        columns.put(metaData.getColumnLabel(i), resultSet.getObject(i));
    }

    rows.add(columns);
}

You can display it in JSP as follows:

      <c:forEach items="${rows[0]}" var="column">
        <c:out value="${column.key}" />
      </c:forEach>

    <c:forEach items="${rows}" var="columns">

        <c:forEach items="${columns}" var="column">
          <c:out value="${column.value}" />
        </c:forEach>

    </c:forEach>

Comment: Thanks. However, in JSP page I can't see the result set. What I did is as follows: request.setAttribute("als",rows) in my servlet and in JSP, rows = session.getAttribute("als"); - Is anything missing ?
Comment: Just use `${als}`. Don't write Java code in JSP file. Your mistake is by the way that you tried to get it as a session attribtue instead of as a request attribute. Read on http://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files and http://stackoverflow.com/questions/3106452/how-do-servlets-work-instantiation-session-variables-and-multithreading
Comment: Sorry but I add Object rows = request.getAttribute("${als}"). however it showing rows variable not used. And problem remains same.
Comment: That's a warning, not an error. You seem to be not using the *scriptlet* variable anywhere at all. Just remove those nonsensicial *scriptlet* `<% ... %>` lines altogether and use `${als}` instead of `${rows}` as in ``, as said in previous comment (and please take some time to read the given links as well before you make more unnecessary mistakes in the future).
Answer: Use the resultset metadata to know the number of columns returned by the query, the type of these columns, etc.
See the javadoc, which also has an example.


is it possible to connect a zoom h1 to nagra 4.2 to digitze reels?

Question: Hello,
Does anyone have experience here?  I know that i can connect to the nagra with a bannana to 1/4 adapter...but will the quality suffer?
Answer: I don't think the quality will suffer, when they're digital atleast you can readily access them.
But there isn't a true line level input on the Zoom H1 so you may find you clip, try lowering the level on the H1 first considerably gage it from there where you'll need to be 6db 12db etc/.
The H1 is a great little unit, nice and light, durable (abs plastic) which makes sense no moving parts so it doesn't need to be metal, the X/Y mics are nice and handy and I've dropped mine half a dozen times and it works flawlessly and I can't see where it hit.
But if you haven't yet bought it then I'd pay a little more for the Sony PCM-M10 which does have a true pro line level input so what you get out of the Nagra you're going to capture correctly
Answer: I ended up (after much research) having my friend build a pad that provides 26.7 decibels of attenuation.  The Nagra output is much too hot for the zoom... so "internet human" maybe you shouldn't be snarky unless you know what you are talking about?  @Internet   Oh and transferring to the zoom (that I am "stuck with") works perfectly now.
Comment: ditto for hiding behind a pseudonym
Answer: The "quality suffering" is not really something to be worried about in line level signals (or audio transferred at line level over short distances). Besides, if you're stuck with having only a H1, then there aren't any options for "better A/D conversion" etc.


How does scrolling work on the Stack Overflow FAQ page?

Question: I'm curious; how did you do that widget on the SO FAQ page, where the question sidebar scrolls up with the page until it reaches the window top, then stays put while the rest of the page continues to scroll?
Comment: This should be on stack overflow with the [tag:stackoverflow.com] tag
Answer: This menu is warped with a div, starting with parameters position:relative. This div is positioned on the right place using the rest struct of the page.
Now a script runs and when the top of this div is getting out of the screen this div get the style position:fixed;bottom:0px. This now make it stay as you see, at the same fixed position.
You can call that floating menu, and I have found and use in the past relative to that style here : http://www.dynamicdrive.com/dynamicindex1/staticmenu.htm


Where should I redirect users from deleted pages?

Question: A site I work on has a lot of 404 errors. Right now a 404 page is displayed. I want to do a 301 redirect for such posts. Where should I redirect the pages to?
Answer: You should only redirect if you have a similar page - if you don't have a similar page you should just let them 404. If you redirect to a non-related page Google will consider it as a soft 404.
You should however update all internal links to these pages - a tool like Screaming Frog will help you identify the pages with the bad links.
Answer: Depending on what the pages are i'd suggest a 301 redirect to the next level of the IA or to the next most relevant page.


Costs of being an MS student in Germany

Question: I am an open-minded Indian student and I will be going to Germany to join the University of Bonn for my masters in Computer Science. I have planned a monthly budget of € 830 including studentenwerk fees, which the university noted me will be no more than € 350. Old students say that it averages to € 250 or something leaving me with € 580. Will that be sufficient for me to eat for a month at a Mensa (I plan to cook in the evenings though) or say maybe watch one movie a month or maybe take a weekend trip to Köln?
Comment: Do those "Studentenwerk fees" include rent?
Comment: All that being said, I think a good question you might want to ask here is which institutions at German universities are best equipped for helping you to answer such questions or helping you along with such issues in general.
Comment: I removed the second question entirely, as [you asked it on Expatriates](http://expatriates.stackexchange.com/q/6348/2043).
Comment: yup, they include rent @CodesInChaos
Comment: Mensa food should cost 2-5 EUR per meal, depending on which you choose and how many side dishes you buy. http://www.studentenwerk-bonn.de/gastronomie/speiseplaene/diese-woche/
Comment: FWIW, here's [information for University of Kaiserslautern](http://www.uni-kl.de/en/studies/while-enrolled/financial-aid/tuition-and-cost-of-living/). Maybe Uni Bonn has a similar site?
Answer: I've been living in Bonn for about two years now and have a monthly budget that is lower than yours (750€), but I find that this is more than enough for a relatively normal life. You should be fine as long as you live in a Studentenwerk dorm; I myself live in such a dorm and have to pay about 300€ monthly (a fee that includes both rent and utilities).
You also have to pay semester fees to your university, but that's just once a semester and it's not such a big deal (~250€ in general).
By the way, I am a scholarship holder, so I didn't mention health insurance as part of my costs; the DAAD is paying this for me. You should count on about 80€ for that as well.
Comment: @Raphael There is only one public university in Germany that takes higher fees for non-EU students (HMT Leipzig).
Comment: I don't know your background, but have you verified that there are not additional semester fees for non-EU students?
Comment: @Raphael I'm not from an EU country either (Macedonia), but I don't have to pay any additional fees.
Comment: Okay. I guess what I was remembering was extra fees for non-consecutive Master courses (650€ in RLP, iirc). While this does not discriminate foreigners per se, non-EU citizens (for us, mostly Chinese and Indians) usually enter non-consecutive courses (for lack of a Bachelor degree equivalent to ours).
Comment: So with 300 deducted, I will do fine in Bonn with EUR450???
Answer: Less than a decade ago, I lived in Bonn as a student for less than 500 € per month, doing pretty much what you describe. I do not know the exact numbers as I had more money available (I simply did not spend it). As inflation was not that bad, what you try to do should be possible.
However, here are some points to consider:

In the last years the German equivalent of high school has been reduced by one year in many states of Germany which lead to twice as many people finishing high-school in recent years. As a considerable number of these people study afterwards, this has lead to a temporal increase of the number of students and thus to a housing shortage specifically for students. After what I heard, Bonn is affected particularly strongly by this. This may increase the rent you have to expect.
The easiest way to obtain a cheap accomodation is from the Studentenwerk. It may help to apply as early as possible and look for out-of-schedule offers from them regularly. In particular, they may have a contingent of appartment that they only rent to foreign students and are thus not affected by the previous point. Another advantage is that you do not have to hassle with organising electricity, heating, Internet access yourself as you often have to with privately rent appartments.
I do not know how health insurance works for foreign students in Germany. As I am German, it was free for me. This may cause some additional costs for you.
The above assumes that you only consume what is necessary for life (and maybe not the cheapest food). E.g., if you consume relevant quantities of alcohol, coffee, cigarettes or other drugs, you have to take this into account.
Assuming that this is what you are referring to with Studentenwerk fees, there are fees of about 250 € that you have to pay once per semester. While you must pay them, they grant you free access to public transport in all of North Rhine-Westphalia (with the exception of high-speed trains) and reduced prices at the student canteen (mensa) amongst others. So, travelling to Köln is free. Something similar holds for most if not all German universities.
Comment: Are you confusing _Studentenwerk_ and registration fees in your last point?
Comment: Yes and no. I took an educated guess as to what the asker meant by *Studentenwerk fees* going by their height and name. If I recall correctly the fee that you have to pay once per semester is partially a registration fee and partially goes to the Studentenwerk for the public-transport pass, cheaper canteen food and similar.
Comment: I understood it, either way :)
Comment: Studentenwerk fees are (probably) rent (+utilities) here. And your health insurance was free?
Comment: @TheAlmightyBob Health insurance is free (under some conditions) if your parents are insured in a public health fund (as most Germans are). Most others pay around 80€ per month.
Answer: I am an international master's student in Berlin. According to this, Bonn is a tiny bit cheaper than Berlin on average. I live pretty comfortably on  €900 per month all inclusive, and I am pretty sure I could get by with less. The big question is rent, which costs me something like €260 pm. So I would say you'll be fine.
I'll add that I have to pay compulsory membership fees for the student union every term. I have to pay mine in a lump at the beginning of the term, something like €360 for the semester. Check with your university as this was a little bit of an unpleasant surprise.
I originally answered the second, slightly off-topic part of the question. I agree it is not on-topic for academia.se. I have edited it out.
Comment: I read it before you edited it. Thanks it cleared a lot of my queries.  Just curious, did you learn German from Goethe?
Comment: No, I did research at HZDR  in Dresden and they provided a free "in-house" A1 course. I was not there long enough to complete it, but it was still really useful.
Comment: Also btw, Studentenwerk fees are they monthly or semester wise?
Comment: Membership fees are paid per semester. I don't rent from them so I don't know what happens if you are staying in their accommodation,  I would guess the rent is monthly based on common sense. Though not everything in Germany is based on common sense :)
Comment: @danke_und_bitte If you are on a tight budget, I'd say the Goethe institute is out of the question.
Comment: @FedericoPoloni How would be a Hoschulle??
Comment: You mean a Volkhochschule? It's the cheapest option, but it has its downsides. Some people there are forced to follow the courses, so they aren't very motivated and may drag down the class. I had the best experiences with courses organized directly by the universities.

Costs of being an MS student in Germany


Is there more to writing than just the good guys versus the bad?

Question: This is a question that I don't know whether to release since I know that anything that is 'Good' could have an evil secret and anything that is 'Evil' could have a good secret yet there are so many cases where it has characters choosing sides. Is there more to writing than just 'Good' and 'Evil'?
Comment: Have you read any books which aren't just good guys vs bad?
Comment: @ArtemisSilver: off the top of my head: Game of Thrones, The Great Gatsby, War and Peace, All Quiet on the Western Front, Invisible Man, Of Mice and Men, Winnie-the-Pooh, Hatchet, Dragonflight, Speaker for the Dead, Oedipus Rex, Les Miserables...
Comment: I would argue that the most interesting stories are those with no clear good guys or bad guys. Remember that almost everyone considers themself to be on the side of good, and what's good from one perspective may well be evil from another. It's not just good guys hiding some evil secret--the good guys doing what they consider to be undeniably a moral good could be seen by another group as committing acts of unspeakable evil. (just look at history for lots of examples of this!)
Comment: @ArcanistLupus *Andromeda* and *2001: A Space Odyssey*.
Comment: So many examples, but felt the need to add one: Dostoevsky: Crime and Punishment
Comment: Peter Watt's "The Things" (http://clarkesworldmagazine.com/watts_01_10/) is an example of a story of having no "good" or "bad" guys but is still really interesting
Comment: In a world that stopped making sense some time during the first years of the 20th century (or, for some, around the 1700s; or, for some, around 1500; or, for some, around 450; or, for some around 24!) and never really regained its footing again there simply *is* no good and no evil. This leads to Dada works like Kurt Schwitter's [*Ursonate*](https://youtu.be/6X7E2i0KMqM) or Beckett's profound loss of sense, aim and purpose, for example in *Waiting for Godot* or *Watt*. (If you read the latter promise me not to skip any lines, or you would have read it in vain.)
Comment: @ArtemisSilver You're under no obligation to accept an answer, especially since it's only been a day. More answers may yet come.
Comment: "...half of them aren't my favorite genre." Maybe you could expand your horizons!
Comment: @DM_with_secrets Yes, but there's just not many of them around.
Comment: That is perhaps a lot of books for me to read, even though half of them aren't my favorite genre.
Comment: I read all the answers, I'm having a hard time choosing. They are all good and answered the question perfectly.
Comment: The film "My Cousin Vinny" is a legal drama/comedy which goes out of the way to show the antagonists to the heroes are not "Bad Guys" and simply doing their job and wish no ill will to the protagonists.  The Prosecutor even goes into great detail at one point to describe how he took his job after having moral qualms about getting a guilty man off on some serious charges.   There are even several scenes where the antagonists assist the protagonists when they aren't legally or ethically obligated to do so.
Comment: @F1Krazy Yes, it been a day, but that what got me worrying. All of those answers are good, it hard to choose.
Comment: This is an insane amount of comments.
Comment: The comic Doonesbury is a good example.
Comment: It would be hard to find something that didn't quickly become more than good vs evil. Even things with very, very formulaic plots (like old comic books) ended up occasionally throwing in a sympathetic villain or a questionable ally or someone who seemed good but then turned out to be a betrayer.
Comment: A character that is just good or just bad is always flat and boring, except for children.
Answer: Here is an example I sometimes use.
A story about a little child who wants to get a snack, and the mother who tells them no.  The child may try to get the snack anyway when she isn't looking, and she may worry about that and constantly check to see if the kid is up to something.
And a skilled enough writer could make such a story interesting and suspensful.
So who is the evil villain, the "bad guy", in that story, and who is the noble hero, the "good guy" in that story?
A writer could chose to make either the child the protagonist, and the mother the antagonist, or the child the antagonist and the mother the protagonist.  And a writer could make either the child or the mother very angry at the other one for a while and think for a while that the other one was an evil enemy.
But I don't see how any reader could interpret the story has having a noble hero fighting an evil villain, a "good guy" vs a "bad guy".
And there can be stories where the protagonists are people but the antagonists are not people, but animals or even forces of nature.
There are giant monster movies where giant monsters go on rampages and become the antagonists, and the protagonists try to stop them.  And though the protagonists may become heroes attampting to save the world, the monsters don't exactly become villains.  For example, when director Eugene Lourie's little daughter saw The Giant Behemoth (1959) she cried at the end out of sympathy for the palaeosaurus.
Similarly, the roles can be reversed and a human could become the predator, and animals the prey.  And in such a movie the human is usually the protagonist, but some movies can have animal protagonists trying to escape from the human and survive.
And there is a whole genre of diasaster films where the main antagonist is a natural diaster, and human antagonists are in lesser subplots if they are included at all.  It is hard to think of a volcano, or earthquake, or hurricane, as an evil villain or a "bad guy".
There is a whole genre of sports films where team A is the protagonists and the team B is the antagonists.  And usually if the roles were reversed and Team A was the antagonists and team B the protagonists it would make no difference.  The protagonists and antagonists are chosen by the creators, and the viewers naturally come to identify with the team that the film focuses on as the protagonists, thus making the other team the antagonists.
But it is usually very hard to find any evidence in the film that the antagonist team is more evil than the protagonist team, or that any real disaster that would harm anyone would happen if the protagonists lost the big game.
And what about stories about military conflicts?
In time of war, people often tend to believe that they are the good guys and the other side is the most evil side in all of history.  And more objective outside observers might think that both sides are good guys fighting for their countries, or that both sides are evil people fighting for causes which are not worth fighting, killing, and dying for, or that one side might be 20 percent more good than other side, or make other judgements.  But certainly the objective outside observers could not possibly agree with the conflicitng subjective opinions of both the sides.
Thus there are many examples of historical persons being depicted as noble heroes in some movies or stories and as evil villains in others.
For example, They Died With Their Boots On (1941) depicts George Armstrong Custer as the noble hero, the noblest he has been depicted in any movie I have seen.  His chief military antagonist is Carzy Horse, who is not exactly a villain - the role of villain goes to several scheming white men.  Other Sioux & Cheyenne leaders like Sitting Bull, Four Horns, Gall, Crow KIng, Dull Knife, etc. are not mentioned or named.
In Sitting Bull (1954), the story is just as unhistorical as in They Died With Their Boots On (1941), but Custer is depicted as the most evil Custer I remember seeing in any movie.  Sitting Bull is the title character and one of the protagonists, and is probably depicted as more noble and heroic than in any other movie I have seen.  Crazy Horse is depicted as a much less important Sioux leader.
Chief Crazy Horse (1955) is a little closer to real history, which isn't saying much.  Crazy Horse is depicted as the  main leader of the Sioux, and Sitting Bull isn't even listed in the credits, though other Sioux and Cheyenne leaders like Red Cloud, Spotted Tail, Old Man Afraid, and Dull Knife, are. General Crook is depicted as a more important miltary antagonist than Fetterman or Custer, which is rather correct, but the main villains are white men who scheme with crazy Horse's rival Little Big Man (not to be confused with the Little Big Man in the book and movie of that title).
As this example shows, most historical movies choose historical and fictional characters to be the protagonists and usually heroes, and thus depict their historical or fictional antagonists as evil villains.  And when various movies differ in how important historical persons were, and sometimes depict them as villains and sometimes as heroes, that should show that the choice of protagonists and antagonists, or "good guys" and "bad guys", in fiction is due to arbitrary decisions by the authors.
So you may need to put your protagonist(s) in a conflict with other people, animals, natural forces, or something, but you don't need to depict the protagonists as "good guys" and the antagonists as "bad guys".  Any competent writer can "trick" their readers into wanting the protagonists to win, even if the protagonists are objectively no better than, or even worse than, the antagonists.
Comment: This answer reminds me of an old Seinfeld bit about how whichever animal is the subject of a nature documentary will be the animal you root for to 'win' in any situation. When watching a documentary about antelopes you'll root for the antelope to outrun the predatory lion and avoid getting eaten. When watching a documentary about lions you'll root for the lion to catch the antelope and get dinner.  I think it is natural for people to 'support' the protagonist of any story, good or evil.
Comment: Example of child vs parents: Calvin & Hobbes :)
Answer: Engaging and interesting stories revolve around conflict.
That doesn't just mean Good v. Evil or Good v. Bad.  Stories about climbing mountains or going to the moon pit the characters against the environment, and neither are bad or evil.
Think of conflict broadly
On one end of the spectrum, conflict is epic battles and fighting and arguing.  The other end of that same spectrum can be a character wants or needs something and is frustrated in their attempts to get it or find it or lose it.
Comment: Indeed, and worth mentioning the classic conflict types: person vs. person, person. vs. nature, person vs. fate/God, person vs. self... only one of those is good vs. bad guys
Comment: @LukeSawczak It's classically just 3 types - "man vs. fate/God" would usually be lumped in with with "man vs. nature".  Sometimes a 4th one is added "man vs. society", but that's really just an extension of "man vs. man".  Of course there's all kinds of overlap even with just the original 3... (Note: I changed "person" back to the classical "man" - which in this case implies "mankind" and has nothing to do with gender.  Not trying to be anti-PC, it's just that "person" is explicitly singular, whereas "mankind" can imply multiple people on one or both sides of a conflict.)
Answer: One film I always love to point to as a great example of this is Disney's "Mulan" (1998) specifically with respect to Shan Yu, the villain of the film, and Chinese Military Culture, which is the antagonist of the film.
Specifically nothing we are given about Shan Yu speaks to why he started the war, other than he felt like the Great Wall of China was a challenge to him.  He has little established reason to invade China or kill the Emperor other than "it is there" which isn't an evil motive at all!  After all, We chose to "go to the moon not because it is easy but because it is hard."   Nothing Shan Yu says or does is personally directed at Mulan nor the people of China personally save for the Emperor.   Sure, he is practical ("How many men does it take to deliver a message?"), brutal, and tactically brilliant, but these are qualities possessed by Mulan as well, who in their first encounter decimated Shan Yu's entire army with a single rocket.  In their second encounter, it's telling when Mulan (now no longer pretending to be a man) reveals that she is in fact "Fa Ping" the man Shan Yu blames for the previous defeat, Shan Yu responds by acknowledging Mulan as "The Soldier from the Mountain".
This is contrasted with Chinese Culture and Society which the entire film shows has very strict gender roles and little tolerance for those who do not conform with them.  This is the subject of the closest thing the film has to the traditional villain song, "Please Bring Honor to us All," and the Harsh penalty of death for Mulan joining the army as a woman ("Fa Li:  You must go after her!  She could be killed [in battle]!  Fa Zhou:  If I reveal her, she will be [as punishment].").  The sexist culture is the one that Mulan is defending because it means saving her father from dying in a war.  She's willing to defend a society that would kill her for doing so because her father is that important to her, against a society where her talents and skills define her above and beyond her sex.  Mulan's own father is a symbolic representation of the Antagonist force she is fighting against.  When she speaks out against conscripting an old man who requires a cane to walk, he defiantly puts the cane aside and struts to take his conscription and verbally admonishes her in a very public setting ("Mulan, you dishonor me.") and attitude which is completely reversed in the final scene in the film when Mulan returns home (Mulan:  "Father (Kneels) I brought you the sword of Shan-Yu and the Crest of the Emperor.  They're gifts, to honor the Fa family." Fa Zhou: (Drops the gifts to the ground by his side and pulls Mulan into a tight embrace) The greatest gift and honor... is having you for a daughter.")
For a Disney Animated Film (Which has a long established history of celebrated villains) Mulan is one where the evil to overcome is not one embodied by her villain.  Shan Yu is oft considered the weakest villain of all of the Disney Animated Films... but yet Mulan herself is considered one of the greatest Disney Heroines of all their films.  It's largely because Mulan defeated a very real evil... one like her self, was hiding it's true nature in plain sight.
Answer: The story of Good vs Evil is engraved deeply in human culture.  Primitive people honestly believe that their tribe is inherently Good, while the competing tribe is inherently Evil.  Humanity lived for a very long time with that mindset.
Rational people will realize that people from the other tribe is looking at it the other way around, and that their point of view is just as valid.
Unfortunately, there are too few rational people in this world.
Back to writing.
If you write a story that is blatantly Good vs Evil, this will resonate with the primitive parts of our mind, we know who to cheer for and who to boo. When the Good side wins, we feel happy and content.  Good story.  Or is it?
One problem is that it is boring.  The Good guys should win and they will win and we know it from the start.  Boring.
It can take a number of stories before we recognize the pattern and start getting bored.  This is why these stories are common in the Young Adult segment and not so common in the Old Adult segment.
In my opinion, a more serious problem is that these stories doesn't prepare you for the real world.  The real world isn't like that.
If you enter a conflict in real life thinking that the other side is simply Evil, you will find it very hard to resolve that conflict.
If, on the other hand, you understand that the other side has a point too, it becomes easier to make a deal that leaves both sides reasonably happy.
Authors who write stories about Good vs Evil are helping to create people who cannot live in the real world.  Don't be that author.
Comment: @ArtemisSilver: If "Good guys win" is boring, then that's a failure of the writer.  The writer's job is to make the story interesting.  Sure, the good guys win - it's how they win that makes it interesting.  What's going to happen besides the good guys winning?  Who dies in battle, what horrible things might the hero have to endure (or do) to win the day?  Why does the hero continue towards the win even at moments when it looks like there's no way forward?  Those are the things that make up a good story.
Comment: Turned on its ear, just writing a story where the bad guys win doesn't automatically make it more interesting.  That's just as old and worn out as when the good guys always win.
Comment: That is probably the main point. The reason I asked this question is that every time an evil villain pops up, I would groan and say, "Yep, the heroes win. Happily ever after. The end." The Divergent series by Veronica Roth was one of the books that I enjoy the most since it has an unexpected ending.
Comment: Realizing that the other side is not evil is easy compared to realizing that you are not good, and I think that's part of the *human condition* much literature explores.
Answer: You say in a comment about books that are not good vs. evil: "There's just not many of them around". This may even be true as far as number of titles or number of copies go: After all, trivial literature, catering to the smallest common denominator and to instant gratification, finds most buyers. I often love it, too!
But.
You should read more good books. Suggestion: Read one novel or story from each year's literature nobel prize winner. If you prefer modern stuff start in the 1920s or even after the second world war. I bet you none of them will simply be about good vs. evil — unless you mean good and evil within one person, like you, me and everybody else.
Answer:
Is there more to writing than just the good guys versus the bad?

Stories need conflict: protagonist vs. antagonist.
https://en.wikipedia.org/wiki/Conflict_(narrative)
Sometimes that's Good vs. Evil, sometimes it's two morally neutral sides, sometimes it's Man vs. Nature, sometimes it's Man vs. Self, and sometimes Man vs Society.
Answer: There's something about American films that revolve around good vs evil. It's probably related to the arrival of religious pilgrims 400 years ago. Moreover, this way of storytelling has been exported to many European and Asian countries over time.
Nevertheless, there are counter examples. If you watch French films, for example, you'll notice there's so much in life apart from good and evil. There are so many colors and hues to a story. If you are trapped in the "good vs evil" echo chamber, those films can be refreshing.


How can I achieve project specific indentation in vim?

Question: I'm working on several projects, each of which uses different indentation style (for various filetypes). For example 1 tab per indentation level, 2 or 4 spaces etc. How can I automate switching between these different styles? I normaly prefer indenting with tabs, but I'm tired of having to type :set expandtabs all the time when working with space-indented code. Possible solutions would include loading a piece of vim configuration based on file path or some configuration in the project root. Is there a plugin to solve this for me in an elegant way?
Answer:
Look at the cinoptions option and softtabstop option (and expandtab, but you know that).
In your '~/.vimrc', define buffer entry auto-commands for each directory where you keep sources of some project like:
augroup ProjectSetup
au BufRead,BufEnter /path/to/project1/* set et sts=2 cindent cinoptions=...
au BufRead,BufEnter /path/to/project2/* set noet sts=4 cindent cinoptions=...
augroup END

If the project has mixture of languages and needs different settings for then, you can also
add extensions like:
au BufRead,BufEnter /path/to/project1/*.{c,h} set noet sts=0 cindent cinoptions=...
au BufRead,BufEnter /path/to/project1/*.py set et sts=4

Comment: Can you suggest a way to distinguish between languages based on vim filetypes, not file extensions? I like your answer, but this part seems like repeating parts of my configuration. Thanks!
Comment: @VoY: There is also `FileType` event for autocommands. But it's pattern matches the filetype, so you have to check the path yourself. Or you can put code in `~/.vim/after/ftplugin/.vim`, but you again have to then check the path yourself.
Answer: I use the plugin localvimrc, which does exactly what you are asking for:

Sometimes, when you work on different projects, you have the problem, that they use different indentation, tab expansion and so on. You need vimrc for each project that overrides your prefered settings from ~/.vimrc
Answer: EditorConfig and it's Vim plugin:

What is EditorConfig?
EditorConfig helps developers define and maintain consistent coding
  styles between different editors and IDEs. The EditorConfig project
  consists of a file format for defining coding styles and a collection
  of text editor plugins that enable editors to read the file format and
  adhere to defined styles. EditorConfig files are easily readable and
  they work nicely with version control systems.

Among few other things it allows you to set indentation, which will be applied only for this project. It's very simple and most importantly standardized way supported by many different editors and IDE-s, so that it will set the proper indentation not only for you but likely all people working on a project.
You just need to create a .editorconfig file in the project root and Vim automatically finds it (assuming you have the plugin installed), setting the proper values. Creating .editorconfig files for each project achieves what you need - project specific indentation.
Example config file:
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,html}]
indent_size = 2

[*.css]
indent_size = 4

Answer: Yes, there is: If you're using the Project Plugin, you could specify a file whose content is being evaluated every time you open a file of the project (this file is called in.vim). The opposite of in.vim is out.vim: this one's executed every time you leave the project.
Comment: Actually I use project plugin, but switched to the autocommands (see the other answer) for setting up project-specific options (I also set things like makeprg and such). The problem with project plugin's in/out.vim is, that it's not run if you first enter a buffer not from the project plugin but for example from quickfix list (after `:make` or `:grep`) or explicit command (`:e %:r.h` is often quite useful in C/C++).
Answer: For everything that Editorconfig supports, the right answer is to use it, see the separate answer for that.
For other settings though, you could use .vimrc files with set exrc secure.
See :h exrc:
     d. If the 'exrc' option is on (which is NOT the default), the current
    directory is searched for three files.  The first that exists is used,
    the others are ignored.
    -  The file ".vimrc" (for Unix, Amiga and OS/2) (*)
            "_vimrc" (for MS-DOS and Win32) (*)
    -  The file "_vimrc" (for Unix, Amiga and OS/2) (*)
            ".vimrc" (for MS-DOS and Win32) (*)
    -  The file ".exrc"  (for Unix, Amiga and OS/2)
            "_exrc"  (for MS-DOS and Win32)

See :h secure:
    When on, ":autocmd", shell and write commands are not allowed in
    ".vimrc" and ".exrc" in the current directory and map commands are
    displayed.  Switch it off only if you know that you will not run into
    problems, or when the 'exrc' option is off.  On Unix this option is
    only used if the ".vimrc" or ".exrc" is not owned by you.  This can be
    dangerous if the systems allows users to do a "chown".  You better set
    'secure' at the end of your ~/.vimrc then.
    This option cannot be set from a |modeline| or in the |sandbox|, for
    security reasons.


Turntable motor speed slow

Question: I have an old Sony PS 300 turntable, 110V, and the motor got damaged due to connecting it directly to 220V electricity. Since then, I've bought more than 5 new motors, replaced the damaged one, and bought a new transformer to convert from 220 to 110, but still I am unable to reach the required speed. I get 40rpm instead of 45 and 29-30 instead of 35. Can anyone suggest a solutio?
Comment: I don't know how "old" that model is, but the very "old" electronic equipment get their timing information from the AC voltage (120V @ 60Hz / 230V @ 50Hz). In other words, for "old" equipment voltage conversion is only a part of the story.
Comment: You didn't say where you are.  Is it possible that your country uses 50 Hz power and the motor's speed is based on 60 Hz?  That would make the speed 83.3% of what it should be.
Comment: thanks, this is i think the issue, I live in Dubai and the turntable is very old, actually its a vintage, so what is the best solution for this issue, I always thought its the motor and kept on buying new motors but all gave same results
Comment: The slower speed is supposed to be 33⅓ rpm, not 35.
Answer: Most countries with 110V power use a frequency of 60Hz and the majority of countries with 220V use 50Hz. This would explain the speed difference.
Those Sony turntables would have been produced for markets worldwide, so there should be motors available for 220V/50Hz. The easiest solution would be to find one.
Here's a related question from someone who has the opposite problem.
Comment: @AhmadTaher You don't need a new turntable, just the *correct* motor for your local power.
Comment: An odd exception is the Philippines which (mostly) uses 220V but 60Hz.  An IBM engineer that I knew found it very irritating.
Comment: honestly, i don't want to buy a new turntable as I love this vintage one but I am very irritated that I cannot make it reach the right speed and bought few convertors but none of it work as expected
Comment: From what I've read, you may be able to use a UPS as a frequency converter.  If it can accept whatever your local power is and produces 110V 60Hz, that would solve the problem.  And as a bonus, you can keep your turntable running even when the power is out.

Turntable motor speed slow


A person who has committed tawbah for one particular sin, but at the same time commits other sins

Question: For example, a person committed tawbah for shirk, repented never to return to it, but at the same time he commits other sins. (Listening to music, watching movies, committing adultery) Would his tauba be valid?
Answer: Yes. Al-Nawawi said:

Tawbah will still be valid even if you were persistent on other evildeeds, as Ulama explained, so if someone steals and commits adultery, him being persistent on adultery does not affect his tubah from stealing and vice versa

(from Arabic original)
Most of Ulama agree on this view (See Ibn Qayyim in Madarij Al-salikin). Also See Al-Qurtubi's Tafsir for An-Nissa:17:

Tubah is valid with having another sin of a different nature, unlike what Mu'tazilites think: you can't have tubah when you have a sin.
Comment: Sorry for the possibly dumb question, it's just this topic that's been bothering me and my cousin. He was an ethnic Muslim almost all his life. Previously, he believed in zodiac signs and even for fun quoted a passage from the Bible that he remembered from the movie Pulp Fiction. I will not hide, we quite often watch movies that sometimes have elements of shirk and kufr in them. Would watching these movies not violate his tauba, provided that we do not believe in what we are shown? Again, sorry for the stupid question, but unfortunately I have no one else to ask.
Comment: No, it won't, as long as he no longer possesses faith in the kind of shurk (like zodiac signs) he watches.
Answer:
Note: Listening to music, watching movies cannot be considered as sin,
it depends on type of music or movies you hear or watch.

It is human nature to incline towards sins and best of sinners are those who repent.

Anas (RAA) narrated that Allah's Messenger (ﷺ) said: "All the sons of
Adam are sinners, but the best of sinners are those who repent often."
Related by At·Tirmidhi and Ibn Majah with a strong chain of narrators.
https://sunnah.com/bulugh/16/41

Sinning doesn't necessarily mean doing forbidden acts like theft, adultary but also include not worshiping enough. It is said that if we count the blessings of Allah it is not countable.

And if you should count the favors of Allāh, you could not enumerate
them. Indeed, Allāh is Forgiving and Merciful. Quran 16:18

So how much we worship Allah it is not sufficient. So we need to continue to do tawbah (seek forgiveness).

Allah's Messenger (ﷺ) said: "By Allah, I seek the forgiveness of
Allah, and repent to Him more than seventy times in a day. https://sunnah.com/hisn:248


Am I commiting shirk if I sing the Indian National anthem?

Question: Does the Indian National anthem contain any lines of shirk?
Comment: Does this answer your question? [What is shirk in Islam?](https://islam.stackexchange.com/questions/516/what-is-shirk-in-islam)
Comment: Can you file the text of it in English?
Comment: Not everyone on this forum is Indian or understands Hindi (I assume that is the language of your anthem) .. if you could post the English translation here, it would help us analyze what you are referring to.
Answer: Yes, if you believe the content of national anthem to be true from the heart. No, if you disbelieve the content at heart but just utter it for the sake of it. Then there is no problem in it. But it is better to avoid because the below statement which dilutes monotheism and brings in a partner who is capable of controlling the destiny. And this is shirk in Ruboobiyyah(Lordship). According to Islamic creed destiny is controlled only by the Creator Allah. He ordains both Good and Evil to test mankind.

Thou art the ruler of the minds of all people, dispenser of India's
destiny

.


When are men supposed to start wearing a tallit?

Question: I am looking for halachic origins. I am also curious about the Sephardic and Ashkenazim halachic justifications for their choice (when to wear it). I learned that Sephardic boys start wearing theirs at a young age, whereas Ashkenazim only start wearing theirs after their wedding day. Does this just boil down to personal preference? What do other Jewish communities do, besides Ashkenazim and Sephardim? What are your sources? When (point in time) did these differences in customs emerge? What caused this event to occur? Which group's custom is a violation? How do you know?
Comment: It should be noted that some Ashkenazi communities also have boys wearing the tallis gadol from an early age, from at least bar mitzvah
Comment: @Ezra - yes it is also a Yekkish custom
Comment: @Ezra. Thank you for informing me. Please accept my apology if I was offensive because of my ignorance. I did not mean anything against any particular group. I am Ashkenazi myself. The text I read simply stated each group was different. I don't recall reading what you said in the text that I read. I am simply trying to learn the truth and to be intellectually honest, for lack of a better term. What specific Ashkenazi communities have boys wearing tallit from an early age?
Comment: @MargotJaffe The older Ashkenazi communities, such as the German, French, and English communities, and their descendants.
Answer: The page on Halachapedia gives a clear rundown. I will try and link the sources accordingly (everyone feel free to add to any I can't find):

The Sephardic custom is to wear a Tallit Gadol from the age of chinuch in mitzvot (1). Chacham Ovadia adds that this is true even for a boy studying in an Ashkenazi yeshiva (2).
However, the minhag for most Ashkenazim seems to be not to wear one until one gets married unless one goes up to the Torah or leads prayers (3). Some acharonim(4) quote a midrash which learns from the juxtaposition of גדילים תעשה לך and כי יקח איש אשה (Devarim 22:12-13), that a man should not wear a Tallit until he gets married (5). Piskei Teshuvot 8:10 writes that this minhag spread to several countries in Europe including Lithuania and Poland, while in other Ashkenaz communities of Western Europe and in Hungary it did not catch on. Later acharonim (6) questioned these earlier acharonim and simply do not understand why someone who is not married would not fulfill this mitzvah from the Torah of wearing Tzitzit. Rav Y.D. Soloveitchik (quoted in Mipninei Harav pg. 22) says that in the absence of a minhag otherwise, the correct minhag is for an unmarried boy to wear a Tallit Gadol.

(1) Kaf Hachaim 8:12, Chacham Ovadia Yosef (Yechave Daat 4:2), Chacham Yitzchak Yosef (Yalkut Yosef 17:4 and Dinei Chinuch Katan pg. 29). Halacha Brurah 17:3 says that this age begins once the child can participate in the prayers in the shul. Ohr Litzion (Chelek 2, 2:7) says that the age is around 5.
(2) Rav Eliyahu Bakshi-Doron (Binyan Av Chelek 2, OC 7:1) agrees. see further Davening with a Minyan That Uses a Different Nusach - Tallit
(3) Ketzot Hashulchan 7:7, Eliya Rabba 17:3
(4) Tashbetz Katan 464, Sefer Hamanhig Chelek 2: Hilchot Nisuin pg. 539 - (need to pay to access), and Maharil Hilchot Ishut 10 - link needs payment to view but here is screenshot of the main point in the text:

(5) Tzitz Eliezer 20:8 notes that the Maharil only meant that before getting married one does not wear a Tallit Gadol, but certainly one should still wear a Tallit Katan (i.e. Tzitzit).
(6)  Mishna Brurah 17:10 and Shiyarei Knesset Ha-gadol 17:2, cited in Ba'er Heiteiv 17:4, before him


Are there no rules for naam jap?

Question: I heard that one can do it anytime and with any activity.. Even while walking or lying on bed. Just want to know if its true?
Answer: The intention behind any japa including naama japa is to bring a single pointedness or concentration of the mind.
Concentration of the mind is one of the most difficult things to achieve, but it's the most crucial for both worldly and spiritual goals. Left to itself, the mind prefers wandering and thinking about random things.
Hence for a beginner spiritual seeker, a proper quiet place, comfortable sitting position, time of the day etc are suggested (as per Patanjali's yoga sutras). This is so that all distractions due to oneself (knee joint pain, sleepiness etc) and due to others (noise, disturbance etc) are eliminated as much as possible.
However, as one gains sufficient concentration and the power to stay focused, the person may choose to do the japa at their own convenience.
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).

Are there no rules for naam jap?


Vector Sum of Pythagorean Triples

Question: Given any finite set of linearly independent Pythagorean Triples, show that the vector sum of this set is never a Pythagorean triple.
Comment: This is puzzle / problem that I made up. Thought it was cool / fun.
Comment: Would this be better posted on the [Math.SE](https://math.stackexchange.com/) instead of Puzzling?
Comment: Ok. Boundaries are fuzzy.
Comment: [Math puzzles are welcome here](https://puzzling.meta.stackexchange.com/q/7200/69582) as long as they are [puzzles, not problems](https://puzzling.meta.stackexchange.com/a/2784/69582). See links for details. I don't know enough to determine which side of the line this falls on, but if it's on-topic here then it's on-topic here, regardless if there's another site which would also take it.
Answer: The graph of real-valued Pythagorean triples $x^2+y^2=z^2$ forms an infinite cone if we restrict to $z>0$:

A sum of $n$ independent vectors on this cone is $n$ times their average, which lies within their convex hull and so is inside the cone, and so cannot be a Pythagorean triple.
Comment: this is insanely neat - i agree now that it's well-suited for Puzzling!
Answer: By definition of (Euclidean) length, 2-dimensional vector $v_j:=(a_j,b_j)$ has length $|v_j|=c_j$ if and only if $a_j^2+b_j^2=c_j^2$ ($c_j\ge 0$). By repeated application of the

 triangle inequality

we have for any finite sum $\left|\sum_j v_j\right| \le \sum_j c_j$ with equality if and only if each $v_j$ is a nonnegative multiple of every other nonzero $v_j$. As the given vectors are assumed to be linearly independent the inequality must be strict. In particular, the sums do not form a Pythagorean triple.

Vector Sum of Pythagorean Triples


CSVLayer in the TimeSlider using ArcGIS Javascript

Question: I am trying to display the time series data in CSV using the ArcGIS Javascript API. I am working on the sample CSV layer for the timeslider, but i cant get it to show in 1 minute interval.
Answer: You use the wrong event map.on("layers-add-result", initSlider);
The documentation says layers-add-result is fired when using map.addLayers([]) method https://developers.arcgis.com/javascript/3/jsapi/map-amd.html#event-layers-add-result
but you use map.addLayer() so, you just have to delete that little s
map.on("layer-add-result", initSlider);


Can you create a font that changes based on what size you use?

Question: In other words, I want to use different letters when it's under 20pt, which are optimized for smaller rendering. Is this possible with a TTF font?
Comment: Fonts usually have specific optimised bitmaps for on-screen at sizes from 8 - 24 pt.
Comment: they have bitmaps built in?
Comment: hmmm… apparently ttf can hold bitmaps, but often don't.
Answer: Yes, it's (sort of) possible, if your TTF file is a variable OpenType font.
To start off, 20pt would not normally be considered "smaller rendering" – that's larger than most headings in books and documents, and any optical size variants for that kind of size would normally be in the 'Header' or 'Display' territory.
Most commonly, size-based variants (often called optical size variants) are created as separate fonts, and it's then up to the user/designer to decide when to switch between the 'default' (running body text) variant and other optical size variants. This is, I think, a good thing. It won't necessarily be the case that all text above 16pt should be in the Display variant, or that all text below 8pt should be in the Small variant (or whatever the type designer has called them) – that needs to be decided on a per-use-case basis.
In variable fonts, however, it is possible to use the Optical Size axis to have multiple such variants in a single font. One possible value for this axis is auto, which is intended to allow the renderer to choose the appropriate optical size based on the font size.
This is supported by all modern browsers, as well as by applications such as InDesign (since InDesign 2021, version 16.4). If you set the Optical Size axis to auto, you will get the behaviour you're asking about.
However, I don't believe there is a way to force this behaviour. If the user sets the Optical Size axis to a different value than auto, then that is the optical size that will be used, regardless of font size. There is no way that I'm aware of to override the user's selection.


Do objects besides strings, ropes, and rods have tension?

Question: Why do we define tension only in strings and ropes and rods and such? Shouldn't every object experience tension force? Like when you pull a paper from opposite sides, it gets taut, and experiences what seems like a state of tension. If every object does experience tension, can you define tension?
Comment: The structure of a roof can have parts in tension which are not string, ropes or rods...
Answer: Tension is not defined only for strings.
However, the unique thing about ideal strings is that they can ONLY experience tension, whereas rigid bodies can experience tensions and compression. Ideal strings would collapse.
Hope this helps
Answer: You can think of tension as a force that helps maintain structural integrity under a tensile 'stretching' force (being quite vague here, but hold on).
Imagine a solid cylindrical rod. You can compress its ends, and there is a normal reaction you have to overcome. This normal reaction is trying to preserve the structural integrity of the rod. Tension is, in a sense, the equivalent of normal reaction but in the opposite direction - if instead of compressing, you try to pull on both ends of the rod, you have to overcome another force trying preserve the structure of your rod (by preventing it from being ripped apart). This force is what one normally calls 'tension'.
I have stressed the similarity between the normal reaction and the tension forces because they have the same origin- they arise from intermolecular interactions that describe the structure of your object. For all practical purposes, you can call normal reaction a 'compressive tension'. The point of this discussion is that, objects try to maintain their structural integrity, and it's a matter of semantics to call this 'restoring' force a normal reaction or a tension or whatever. The molecular origin of these forces are identical.
That said, sometimes it is useful to keep this distinction for intuitive clarity. An object that is hard to compress, for example a string along its length, will provide almost no normal reaction (it is very easy to squish a string), but stretching it certainly induces a tension that one must overcome before it breaks (i.e. loses it's integrity).
Answer: "Tension" is a simple special case of the state of stress in any solid object.
But you usually start learning about mechanics using simple situations where common-sense ideas like "tension" are all you need, rather than starting by learning about stress and strain tensors and constitutive equations in continuum mechanics!
Answer: If you are thinking something really fundamental, there's only four acknowledged fundamental force, and the "tension"(of something like a string) was usual treated as a result of electromagnetic interaction(electromagnetic force) from the atoms or particles.
However, tension in sub particle level can also resulted from strong force, like protons inside a nuclei.
Depends, tension is just a more formal wording of the usual "stretch", it's basically a word commonly used by physicists to mention in a way that physicists can easily understand.
Answer: Pick up a brick. Try pulling it apart. What stops you from pulling it apart? It's the tension in the brick. Where does the tension in the brick come from? It comes from the inter-molecular forces inside the brick.
The same goes for strings. Here's a second example. If you look closely at a thick rope, it's made of many small strings wrapped around each other. Why is this? So that the friction in between the strings increases the available tension in the entire rope. In other words, the inter-molecular forces (in this case, friction) increase within the rope, making the rope "want" to stay together more; the more a rope wants to stay together, the more force it can handle when you try to pull it apart.
It's just like how normal force is the force from electron shells repelling each other (due to the Pauli Exclusion Principle), tension comes from a micro-scale force as well.


How to get SharePoint site URL associated with Microsoft Teams

Question: Is there any way (C# or PowerShell) by which we can get SharePoint Site URL associated with Microsoft Teams ? If anyone has code/script for the same , kindly share .
Any kind of suggestion will be helpful .
Answer: We came across your question while researching a similar problem.
To my knowledge there is no simple way of doing this.
In the end we decided on a combination of the Microsoft Graph API to retrieve all of the Microsoft Team IDs and then we used the DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECOLLECTIONS  list from the SharePoint admin center to connect the Team to its corresponding site collection.
This funny named list is actually used in the new SharePoint admin center and it has some useful information. Unfortunately it does not have a field that would say if it was a Microsoft Teams site,
but thankfully it does have a field that tells you if you are dealing with an Office 365 group.
We did try other more direct solutions like the Exchange Online Remote Powershell but we either could not retrieve the site URL for private Teams, or we could not determine if an Office 365 Group even was a team.
I wrote a blog post about this matter and it describes in more detail how the URLs can be retrieved.
Hopefully it helps somebody in the future.
Answer: From Microsoft Teams PowerShell run the following command:
<code>$Teams = (Get-Team |Select-Object GroupId, DisplayName)
ForEach ($T in $Teams) {$SPOURl = (Get-UnifiedGroup -Identity $T.GroupId | Select -ExpandProperty SharePointSiteURL) Write-Host "URL for the" $T.DisplayName "Microsoft Team is" $SPOURL}
</code>
The command provides us the following information:

SharePointSiteURL
SharePointDocumentsURL
SharePointNotebookURL
Answer: You can build the SharePoint url using Microsoft Teams PowerShell command
<code>Get-Team  | Select MailNickName
</code>
The SharePoint url shall then be $yourtenant.sharepoint.com/teams/$MailNickName
MailNickName looks like "team_xxxxx"


Hide specific attribute filters for each category

Question: i want to hide specific attribute filters for each one of my categories. Is that possible from category ->  custom design -> Custom Layout Update ?
Comment: Is your issue solved?
Answer: You can't hide specific attributes from the layered navigation using custom layout updates. At least not without any changes to the code (check out layer/view.phtml).
There are a few modules for a better layered navigation, and I know for sure GoMage Advanced Navigation has this feature.
I've also used custom code to filter out which attributes show up on certain categories and in what order - i think i used a helper and changed a few lines in layer/view.phtml. This would be pretty similar to using layout updates, although you might run into difficulties using the xml approach.
If you want to use custom code, I'd suggest adding an extra category attribute for setting the attributes that you want to hide and then using that field in layer/view.phtml.
Answer: it is not possible using ustom layout.You can only buy using custom condition at layer/view.phtml
<?php foreach ($_filters as $_filter): ?>

    <?php if($_filter->getItemsCount()): ?>
    <?php  if($_filter->getFilter()->getRequestVar()):?>
    <?php if(isset(Mage::getSingleton('catalog/layer')->getCurrentCategory()) && (Mage::getSingleton('catalog/layer')->getCurrentCategory()->getId()!=youcatid)){ ?>

<?php echo $this->__($_filter->getName()) ?>

<?php echo $_filter->getHtml() ?>

    <?php } ?>
    <?php endif; ?>

<?php endif; ?>

<?php endforeach; ?>

See at
https://stackoverflow.com/questions/11862967/magento-get-selected-filter-in-layered-navigation


Synergy not stopping service completely

Question: I'm using Synergy 1.4.12 (server) on windows 8 pro 64bit.
I'm getting a bug when I try to stop the service. If I click stop in to window or by right-clicking the startup icon, the Synergy service stops BUT synergys.exe remains running, I can still control clients till end the process.
DEBUG: start ipc handle data
DEBUG: ipc read: ICMD
DEBUG: finished ipc handle data
DEBUG: new command, elevate=1 command=
DEBUG: adopting new buffer
DEBUG: discarding 1 event(s)
ERROR: ipc connection error, remote host closed
NOTE: connecting to service...
NOTE: connection established

What could be causing this error? I have checked and the service IS running before I click stop. After I click stop, the service has stopped but synergy still establishes a connection.
I believe this error stops the rest of the "stop" command so synergy still believes the service is running.
This connection stops once I end synergys.exe and I get
ERROR: ipc connection error, connection refused
NOTE: connecting to service...

I'm surprised synergy can work without the service running as long as synerys.exe is around.
Oh I've also installed and reinstalled, removed leftover registries and config files with revo uninstaller. Tried nightly builds too. Oh and this is a fresh install of windows 8 pro.
Edit* I updated my Windows 7 pro and Windows 7 home from synergy 1.4.10 to 1.4.12 and I'm having the same trouble with Windows 7 pro but not home edition. Wonder if it's a bug.
Also, when clicking "Apply" synergy seems to stop the service correctly, both service and synergys.exe/synergyc.exe before restarting with a new config.
Comment: Same issue here...very strange.
Answer: This issue is fixed in the latest version of Synergy. Please update your installation to get the fix.

Synergy not stopping service completely


Why do script blocks grow endlessly in VS2010 Debugger when running ASP.Net page with partial postbacks?

Question: On an ASP.Net page that uses an UpdatePanel containing various validated controls for partial postbacks, the Visual Studio 2010 script debugger window starts to show an ever growing list of "Script Block" entries which appear to be anonymous our auto-generated functions related to the controls on the panel as it is reloaded. It appears that old script blocks from previous times the panel was updated are not disposed so the list just keeps on growing, slowing down the page and the debugger, until IE is closed whereupon it can take a long time to delete the hundreds of blocks that have appeared.
Is this a problem with the way the page is operating or an artifact of the debugger? Comparing performance of the debugged and non-debugged page it appears to be the latter, but it would be good to know what is going on and why.
Comment: I think it is occurring in both 8 and 9.
Answer: Well Well here is your answer.
First Way
http://vishaljoshi.blogspot.com/2009/06/disabling-script-debugging-with-vs-2010.html
Basically when you debug through VS2008/2010, IE8 and forward, script debugging will be enabled automatically. Which is criticized by many. However there are few workarounds.
First one is in above article which tells you to enable Silverlight debugging and tells you path for both Projects as well Websites, where to go and how to enable it.
Once you enable silverlight debugging JS debugging is turned off as both can't run side by side.
Drawback (if you really think it is ): Silverlight tools for VS need to installed
Second Way
Start the application without debugging (CTRL + F5) once app running attach debugger manually by clicking on Debug->Attach to Process.
Now for VS 2008
For VS 2008 there are several alternatives like editing registry keys and so forth.
If anyone need VS 2008 help regarding that check this out.
http://blogs.msdn.com/b/greggm/archive/2009/04/06/disabling-script-debugging-in-vs-2008-ie8.aspx
Comment: @ErikDekker It isn't, but then nobody else even tried. I think it is caused by the debugger keeping every dynamically created bit of JavaScript in it's own document panel and not removing old ones when new Ajax calls are made.
Comment: Still not sure why VS is doing that, but this is a useful workaround and deserves the bounty. Just in time!
Comment: Not really an answer to the actual question `why the script blocks grow endlessly`
Answer: Since the Timer is within the UpdatePanel the Timer will re-instantiate itself when the UpdatePanel is refreshed and therefore continue to and more javascript.
What you should do is put your Timer outside the UpdatePanel and link it with Triggers.
The following will creates a Timer that will update a Panel after it calls GetStatus from the code-behind.
<code><asp:Timer runat="server" ID="Timer1" Interval="5000" OnTick="GetStatus" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
    </Triggers>
    <ContentTemplate>
        <fieldset>
            <asp:Button ID="Button1" runat="server" Text="DoStuff"
                OnClick="Button1_Click" />
            <asp:Label ID="Label1" runat="server" Text="Blank"></asp:Label>
        </fieldset>
    </ContentTemplate>
</asp:UpdatePanel>

    protected void GetStatus(object sender, EventArgs e)
    {
        Label1.Text = "Stuff!!!";
    }
</code>