What should we list temperature at?

Question: When talking in terms of cooking temperatures should we stick to saying both Fahrenheit and Celsius? I think we should all convert to Celsius because it would make it easier for almost 98% of the people to understand. I'm from the U.S and I hate using F. SO the question is, should we keep it to one unit of temperature?
Comment: I answered before realizing this was a duplicate. I think my points have pretty much all been made there, and some of my answer is a specific response to the details of your question, so I won't merge it.
Answer: If you want to be helpful, keep writing both. It's strictly more useful than just writing Celsius. If you decide to do that anyway, don't be too surprised if someone edits your answer later. Same goes for the other way around, of course - I write both units in my answers when I can, despite the fact that I will probably never use Celsius in my kitchen.
We have a lot of American users who unlike you are not terribly familiar with Celsius and will have to keep converting if they don't see Fahrenheit. Your made up 98% number may be right for the world, but not for our site. Forcing some people to convert temperatures isn't going to help anyone out.
Note also that for baking temperatures, no matter how badly you want to use Celsius, in the US your oven will be in Fahrenheit, so Celsius is useless. (Even if it's digital and can do both, everyone will keep theirs in Fahrenheit because that's what all the recipes use.) And even if Celsius were strictly superior and there were few Fahrenheit users here, I'd still be saying this. I don't want this site to start making unnecessary prescriptive rules that make it less useful for some users.
Side note: I notice that you didn't also propose that we enforce metric units of weight and volume. It should be obvious that I think that'd be a bad idea too. Yes, I do like those units, they're easy to convert, providing a concrete benefit in the kitchen (unlike temperature). But all that's only useful if you happen to have a scale and metric measuring cups. The vast majority of Americans will still have to just go convert everything before it's useful. If you can magically convert the entire world to metric, then we can start making these rules. But until then, no reason not to be friendly.
Comment: Temperature is different from the other units. **a)** it's much more annoying to convert, because there's no shared zero point **b)** Celsius is _objectively, and all by itself_ superior to Fahrenheit, by way of the intuitive water reference points. I really think that's something the American users here should get used to.

What should we list temperature at?


Would a paint stripper brush remove stain and varnish from a door frame?

Question: I wonder if anyone can help me? I have a wood door frame that had been previously stained and varnished, and I would like to strip this back to its original wood. Would a normal paint stripper do the job?
Answer: That wire wheel might help if there are nooks and crannys, like fine detail. But I am afraid what you will need is a lot of elbow grease and sandpaper. Starting with coarse and working down to fine, using steel wool and/or wire bushes for the detail work. Good quality chemical strippers are helpful if you are able to cope with the mess/smell/health hazards.
Wood stains are called that because they stain the wood, by soaking in and penetrating the wood fibers. You may never be able to remove all traces of the stain and bring it back to "original wood". You should be prepared to consider a new stain, maybe a light color near to what your vision of "original" was. This will help cover inevitable areas of imperfection and help blend the door color prior to varnishing.
Comment: Cabinet scrapers can also be useful - the essence of removing stain is that you have to remove wood to remove stain.
Answer: You want gel stripper.  The gel will allow you to apply the stripper to the inverted and vertical surfaces (it will still drip, put something down on the floor).
Use several coats of stripper with a scraper until the wood starts to lighten a bit.  At that point you can either be happy and/or re-stain the wood.  If you want to get it back to the base wood color you will have to continue as Jimmy mentioned and start sanding.
If you are comfortable removing the wood of the frame you can also remove it first, this will make it much easier to work with, and as an added bonus you can use the stripper out in the garage (it is pretty nasty/smelly stuff).


How to deploy a marlowe smart contract on cardano

Question: I'm  a beginner, I have the haskell code and I wnat to know the following steps, I couldn't find specific information how can i deploy a smart contract on the mainet or testnet.
Answer: Submitting transactions on Cardano is a bit like submitting your taxes to the federal agency. The agency won't tell you how to compile the documents and how to calculate the amount due, but it will check them and tell you if you did something wrong (actually only if the mistake is at their disadvantage. It is not a perfect analogy).
The Cardano blockchain is this federal agency. It will check the transaction and validate the smart contracts. But is has no knowledge of how to construct this transaction. This logic is implemented in your off-chain code. This code is as the name says never deployed to the blockchain. It needs to be executed by someone, though. In a centralized service it is usually the server backend of the party that provides the service. But you can also make the off-chain scripts publicly available so that anyone can use them.
Answer: Here is a tutorial that should help you get started with executing your Plutus script.
Plutus scripts are not actually "deployed" to the blockchain, rather once they are serialised to Plutus (from Haskell or other languages) they are used to generate script address and then are submitted to the generated address in a transaction.
The tutorial should walk you thought on how to submit transaction once you have serialised plutus script.
Comment: The question was about Marlowe, not Plutus, and I have the same question.  It is really hard to understand why simple things seem so difficult.  Is there any way, in Feb 2022, to enter into even the simplest possible financial contract with somebody else, without writing your own Plutus script?  Thanks :)
Answer: Here are lectures that explain the process of running Marlowe contracts on the Cardano blockchain. The third lecture includes a step-by-step example.


For Kant, are we obligated to treat people who have no ability to reason or to give decisions or consents as always an end and not merely as means?

Question: For Kant, are we obligated to treat people who have no ability to reason or to give decisions or consents (concerning with mental insanity) as always an end and not merely as means? If we are, why is it? And why we wouldn't do the same to animals who are sentient?
Comment: Note that "sentient" might be a bit unspecific for this discussion, the question might be improved by being more explicit about this.
Answer: In his written works, Kant did not write about such human beings e.g. unborn humans or humans left braindead after accidents. However he wrote about animals (meaning non-rational biological agents). For animals he wrote that there is no duty to treat them as ends, but that unnecessary cruelty to animals would still make us worse.
A theoretical case of a non human living being with the ability of moral choice (called "humanity" by Kant) would however imply a duty to treat them as an end (and a duty for them to treat humans as an end).
Since Kant did not write about human lives without the ability for rational thought, it is a matter of opinion and interpretation how to apply his ethics. And that's not a good topic for this site.
Typically an indirect duty exists to the rationally enabled supporters of such a being (parents, children, friends, partners), who may have a strong emotional attachment that we'd have to respect as if we were in their situation.


How to remove html tags from database text field

Question: How do I remove html elements in a text field from SQL Server?
Comment: Do you mean removing html tags from a text field or from a blob/clob field?
Answer: I assume you mean removing html tags from a field stored in a database. If so, and if you can code the solution in .NET, I would have used the HTML agility pack to traverse the html contents, and save the InnerText (i think that's the property name) of the elements in which you are interested to a variable. Then replace the contents of the field with the contents of the variable.
Answer: You could use a CLR Procedure (SQL Server 2005 and above) to decode the HTML , stripping out the tags.
This looks like an example of what you want to achieve.
SQL Server CLR Procedure


Connecting Flask Socket.IO Server and Flutter

Question: Basically, I have a socket io flask code:
import cv2
import numpy as np

from flask import Flask, render_template
from flask_socketio import SocketIO, emit
from threading import Lock,Timer as tmr
from engineio.payload import Payload
import base64
from PIL import Image
import io

app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app)

@socketio.on('connect')
def connect():
    print("a client connected")

@socketio.on('disconnect')
def disconnect():
    print('Client disconnected')

@app.route('/')
def hello():
    return render_template('index.html')

if __name__ == '__main__':
    socketio.run(app,port=port,host= '0.0.0.0')

This code is working fine when I try to connect it to javascript
However in flutter I can not achieve that
I have stateful Widget that  has a button in it
And I am using this function to connect to my socket when the button is pressed
import 'package:socket_io_client/socket_io_client.dart' as IO;

IO.Socket socket;
  connectToSocket() {
  socket = IO.io("http://10.0.2.2:6400", <String, dynamic>{
    'transports': ['websocket', 'polling'],
  });
  socket.connect();
 }

I can not connect it please help me.
Comment: How is it you are starting the flask server here? From the main or elsewhere?
Comment: Also - where are you calling connectToSocket() ?
Answer: I know this is an older question but hopefully this answer will help someone down the road.
The issue may be caused by the lack of support for polling in flutter.
from: https://github.com/rikulo/socket.io-client-dart#usage-flutter

In Flutter env. it only works with dart:io websocket, not with dart:html websocket, so in this case you have to add 'transports': ['websocket'] when creates the socket instance.

IO.Socket socket = IO.io('http://localhost:3000', <String, dynamic>{
    'transports': ['websocket'],
    'extraHeaders': {'foo': 'bar'} // optional
});

The default Flask development server doesn't support websockets so you'll need to use another server. Thankfully it's simple to get eventlet working with Flask. All you should have to do is install the eventlet package using pip.
pip install eventlet

Once eventlet is installed socketio will detect and use it when running the server.
You can use chrome to double check what transport method is being used. Open your chrome dev tools Ctrl+Shift+I in Windows and go to the Network tab. On each network request you should see either transport=polling or transport=websocket
Comment: Thank you sir. I am sure that it will help a lot of people including me :)
Comment: Thank you. After installing **eventlet** working fine
Comment: Hi, I am trying to run flask socketio app on localhost, but i can't run it. it says running on server http://[: : 1]/5000 when i give app.host='localhost', and flutter doesn't connect to flask socket too. I am trying since past 4 days now. I can't find a fix:/. Please help. I have eventlet installed


Difference in behavior of `` and `inoremap jk ` in vim

Question: I just installed Ubuntu 12.04 on a new computer and apt-get install[ed] vim and I'm having some weird behavior with my aliased Esc - if I'm in INSERT mode and I type the Esc key, I exit INSERT mode and the cursor moves one character to the left, as expected, but if I type the jk alias, which I have defined in my .vimrc as inoremap jk <Esc>, I exit INSERT mode and the cursor moves one character to the right, which is actually quite disconcerting. Any ideas as to why this is the case?
Answer: I don't think this is because of this rule alone, something else is causing this. If I create a .vimrc file with just this rule in it:
$ more .vimrc
inoremap jk <Esc>

I get the same behavior as expected from both methods.
Example #1 - esc
Invoke vim, go into Insert mode, right arrow 1 time, hit Esc.

Example #2 - jk
Invoke vim, go into Insert mode, right arrow 1 time, hit jk.

Answer: The answer was derived from slm's answer, which is that it wasn't the rule alone which caused this issue; my rule, in full, was actually
inoremap jk <Esc>  " Recommended in http://learnvimscriptthehardway.stevelosh.com/chapters/10.html

It hadn't caused a problem on the Vim implementations I was using on Mac OS and Debian for some reason, but the two extra space characters after the Esc in the rule, before the comment were causing the cursor to move forward two spaces after exiting INSERT mode.


Using Cloudflare caching on wordpress with front-end user logins

Question: I use Cloudflare heavily on all my sites. On https://pokerdiy.com I use the MyListings Theme which uses an AJAX login and Woo Commerce. The user never sees the default wordpress dashboards and control panels.
I now have caching issues with logged in users - My theory is that Cloudflare cannot determine when a user is logged in or not, so it is displaying the cached anonymous logged out view.
When I disable cloudflare the site works fine.
Reading on Cloudflare it sounds like "Bypass Cache by Cookie" is the only option to tell whether or not a user is logged in. However, this is a $200 Business license on Cloudflare which is out of the question for a hobby site.
https://support.cloudflare.com/hc/en-us/articles/218411427-Understanding-and-Configuring-Cloudflare-Page-Rules-Page-Rules-Tutorial-
https://support.cloudflare.com/hc/en-us/articles/236166048
https://support.cloudflare.com/hc/en-us/articles/228503147-Speed-Up-WordPress-and-Improve-Performance
This is a long read, but halfway down someone suggests that the headers WP returns should be respected by CloudFlare:
https://support.cloudflare.com/hc/en-us/articles/236166048
How can I use Cloudflare caching on a Wordpress site that uses front-end user logins?
Answer: I have found the answer there:
http://jhewitt.net/2018/12/improving-wordpress-speed-with-cloudflare-workers/
Using Workers you can examine a request for WP cookies and exclude it from the cache. This solution works well as I have implemented it.


Do PhD students get the 3 year contract in the beginning in Germany like they do in Sweden?

Question: I am about to finish my masters from Sweden and have a PhD offer from Germany and in Sweden. I recognise the pros and cons of each offer, but I would like to have a more generalistic view on doing a PhD both the countries.
P.S. The university in Sweden is: Chalmers university of technology
The university in Germany is A research institute and with collaborations with industries.
Comment: You need to ask the person offering you the position in Germany about your initial contract time. This vary quite a bit, as far as I know.
Comment: Your question is unclear to me. On one hand, you said you recognise the pros and cons of each offer. On the other, you would like to have a more generalistic view. Your question title is about the length of the contract. What exactly do you want to ask?
Comment: Can you clarify what it is you want to know? In the title you refer to "the 3 year contract", but in the text you state that you "would like to have a more generalistic view". So – is your question about contracts or about doing a PhD in general?
Comment: I want to know about the contract system in Germany and also the difference in doing a PhD in Sweden and in Germany
Comment: Small warning though - when you ask, I would frame it as important for visa or housing matters. Just asking whether you get a 3-year contract immediately without context may give the impression that you are not very confident in your fitness for the position, and want to know whether it will be hard to get rid of you if you don't perform.
Answer: In Germany, there are many possibilities for funding PhD studies:

Scholarship: The research group can offer a monthly scholarship, but this depends on the financial power of the group, and his interest in the candidate. Otherwise, many programs offer scholarships to young talents (e.g. DAAD)
GRK position: The German government ( Represented by the DFG) supports some field in some universities by introducing a limited program called "GRK: Graduiertenkolleg". This program offers full/half positions to PhD candidates to finish their studies.
Project position: If a research group has a research project (German or European) with a budget for positions, it is possible to hire PhD candidates. However, their work must be within the project purpose. Usually, PhD candidates employed by projects write their dissertations in the same context of the project. Otherwise, it is tough to work on two different projects.

Almost in all the above cases, the duration is limited to 3-to-4 years. However, people can get another contract to finish their PhDs and in the same time help in other projects.
Comment: I'd break down #2/#3 in a quite different way. There are (a) faculty positions *with* obligation to teach and opportunity to write a thesis (initially limited to 3 yrs, with extension option), a so-called "Landesstelle", because the money comes from the state. And there are (b) project positions usually with obligation *not* to teach (funded by any 3rd party, like DFG, which is interested in the project only, not in upholding teaching). In the latter case, contract duration depends on whatever the professor negotiates with the PhD student (within the limits of  project funds being available).
Comment: "However, their work must be within the project purpose. Usually, PhD candidates employed by projects write their dissertations in the same context of the project." - these statements should be qualified with an extremely bold and large "in theory".


Alternatives to native LDAP

Question: We've implemented an LDAP to NIS solution and have begun transitioning some systems to native LDAP binding for authentication and automount maps. Unfortunately we have a very mixed environment with more than 20 *nix environments. The setup for each variant is of course unique and has required various workarounds to get full functionality. We're now at the point where we're willing to revisit the solution and possibly migrate toward something like Likewise (http://www.likewise.org), but would like to know what others are using to solve this problem.
Comment: I think the big unnamed question hanging over people's answers here is - are you needing file services for Windows clients, aka. Samba services?  If this is a pure-play \*nix setup then there are a wild number of options that might work for you.  I've revised my answer with some useful info...
Comment: The domain for likewise would be http://www.likewise.com/, not .org.
Answer: @Avery,
This is essentially what Likewise Open does. It makes use of Kerberos (via PAM) to authenticate the user. It also provides NSSWITCH modules to perform SID->ID mapping (using various algorithms, some LDAP based, some hash based).
It has several advantages over plain old pam_krb5:

Support for AD "sites" including smart DC failover to the nearest DC
Support for offline authentication (if the network is down or you're on a disconnected laptop)
Automatic configuration of PAM and krb5.conf

Cheers,
Manny Vellon
CTO, Likewise
Answer: I used to have 40ish Linux servers, all with local authentication. Life was hell.
I finally solved the problem by building an Active Direcotry infrastructure and implementing Likewise Open to authenticate all of my machines (plus samba, ftp, jabber, and half a dozen web apps).
Now I've got 80-100 servers all using the same authentication and my users love it (but not nearly as much as I do).
I have never once regretted using Likewise. I talked about it so much on my blog that they sent me a T-shirt!
Comment: How is the performance? Have you had any experience with the non-Linux variants? We've got 5,000+ hosts globally and LDAP performance has been lacking.
Comment: Our performance has been very good. The only minor quibble that I have is that I find myself occasionally clearing the cache after a user's information changes in the directory. It sounds like your infrastructure is a little more advanced than mine ;-)
Answer: We have "solved" the problem by standardizing on RHEL/CentOS. That solves a boatload of other portability problems as well.
As for LDAP, we use it too, but the interface between ldap and NSS is far from perfect (same goes for any other network service). If I had the time, I'd look into deploying nsscache instead of nss_ldap. Or maybe even replace pam_ldap and nss_ldap with winbind, to better integrate with our windows environment (likewise is a variant of winbind, no?).
Comment: I'm jealous, I wish we could solve the problem in that way.
Answer: many companies are using Likewise and it is working very well.  We had around 20 Servers using native users and we moved to Likewise and life is a lot simpler.

Alternatives to native LDAP


Bitcoin 101, need some knowledge

Question: I am new to bitcoin. How do I check if my blockchain is working? I have tested some free bitcoin sites but neither of them have worked.
Comment: What do you mean with "your blockchain"? Do you wish to know whether your client is up to date with the status of the network, or are you asking how to test whether your blockchain.info account is able to receive bitcoin transactions? As it is, this question is not clear. That's why I am downvoting it, and voting to close as "unclear what you are asking". Please improve your question, then flag for reopening.
Answer: As I can understand you entered your bitcoin address to some faucets, but do not receiving nothing from it? You should check https://blockchain.info/ and enter your bitcoin address in "Search" field. If someone sent you something, you'll definitely see transaction there.
Comment: If you don't own the private keys you don't own the coins. Faucets pay out en masse - if at all - so don't expect your work to be rewarded as advertised.

Bitcoin 101, need some knowledge


Ubuntu 12.10 trouble Installing Netbeans 7.3 and JAVA ME 32 bit

Question: I tried CHMOD, updating, simple terminal line commands and nothing seems to work. When I try install NetBeans 7.3 the screen is blank and if I try to do something it gives me the error that states the application will close and asks for a force quit option and says all progress will be lost.
Any ideas? I have been to both the NetBeans forums and asked as well as the Java boards which directed me back to NetBeans forum page.
Answer: From the netbeans forum:

Post subject:
  Setting Up Netbeans for java ME installation question
Reply:
  If you use the packages from netbeans.org then you can install different NetBeans versions side-by-side. Newer version even
  try to import settings and plugins from the previous version.

By markiewb
Comment: its not solved though. the required installation is unzipped but not available to add as a platform, nor has JAVA ME been made available through the same means; by using the tools menu to 'add NB platform' and 'add java me platform'the IDE doesnt see the files so I cant add them with the feature
Comment: Well, if you think that you can wait for other answer *solving* your issue, then it's ok.
Comment: what choice do I have? I need version 7.3 to use java ME and I cant upgrade the version I have. I answered the question before trying to see if it worked because it seemed like a no brainer. 4 days later....
Comment: as it turns out, I had a second look at the NetBeans forum and i found this,
Comment: Am 15.03.13 15:33, schrieb johnye2e:
Quote:
Hi guys,

I have Netbeans 7.2.1 installed, and I was just wondering why is it showing that it's up to date (Help -> Check for updates), even though Netbeans 7.3 is released? And is there a way to automatically update to 7.3?

No, deinstall 7.2.1. and install 7.3.

--
Comment: The IDE should be removed and reinstalled with the desired version as it seems that this is the only way to make this work. There doesnt seem to be alot of interest on the Netbean boards to confirm or deny this.


How to extract parameters in the CIR model from data?

Question: I want to extract CIR parameters from monthly LIBOR data in the EULER-MARYAMA method in MATLAB language.
I found the data but I can't extract parameters from it.
What is the process? What is the formula?
Answer: As You Know, CIR model is the square root process given by the following stochastic differential equation
$$d{{r}_{t}}=\kappa (\theta -{{r}_{t}})dt+\sigma \sqrt{{{r}_{t}}}d{{W}_{t}}$$
Let $\Theta=(\kappa,\theta,\sigma)$. It is well-known that conditional on a realized value of $r_t$, the random variable $2c_t\,r_{t+\Delta t}$  follows a non-central chi-square distribution with $d = 4\kappa\theta/\sigma^2$ degrees of freedom and non-centrality parameter
$2c_t\,r_te^{−κ\Delta t}$, where
$$c_t=\frac{2\kappa }{{{\sigma }^{2}}\,[1-{{e}^{-\kappa \Delta t}}]}$$
Indeed the density of $r_{t+\Delta t}$ is
$$P(r_{t+\Delta t}|r_t;\Theta)=c\,e^{-u-v}(\frac{u}{v})^{\frac{q}{2}}I_q(2\sqrt{uv})$$
where
$$\,\,\,u_t=c_t\,r_te^{−κ\Delta t}$$
$$v_t=c_t\,r_{t+\Delta t}$$
$$\,\,\,\,\,\,\,q=\frac{2\kappa\theta}{\sigma^2}-1$$
and $I_q(2\sqrt{uv})$ is modified Bessel function of the first kind and of order $q$. The transition density has been originally derived in this.
Parameter estimation is carried out on interest rate time series with N observations We consider equally spaced observations with $\Delta t$ time. The likelihood function for interest rate time series with $N$ observations is step
$$L(\Theta )=\prod\limits_{i=1}^{N-1}{P({{t}_{t+\Delta t}}}|\,{{r}_{t}}\,;\,\Theta )$$
It is computationally convenient to work with the log-likelihood function
$$\ln L(\Theta )=\sum\limits_{i=1}^{N-1}{\ln P({{t}_{t+\Delta t}}}\,|{{r}_{t}}\,;\,\Theta )$$
from which we easily derive the log-likelihood function of the CIR process
$$\ln L(\Theta )=(N-1)\ln c+\sum\limits_{i=1}^{N-1}{\left( -{{u}_{{{t}_{i}}}}-{{v}_{{{t}_{i}}}}+\frac{1}{2}q\,\ln \left( \frac{{{v}_{{{t}_{i+1}}}}}{{{u}_{{{t}_{i}}}}} \right)+\ln {{I}_{q}}(\sqrt{2{{u}_{{{t}_{i}}}}{{v}_{{{t}_{i+1}}}}} \right)}$$
You can find maximum likelihood estimates $\widehat{\Theta }$ of parameter
vector $\Theta$ by maximizing the log-likelihood function last equation over its parameter space:
$$\widehat{\Theta }=arg\,\underset{\Theta }{\mathop{max}}\,\,\ln \,L(\Theta )$$


How do I select all the bones in the middle?

Question: I have a biped armature. And I want Blender to ignore the Right and Left bones. I want to select the bones that their names don't end with either R or L (want to select in Edit mode).
Answer: Blender doesn't treat bone suffixes as case sensitive, so I used a regex to match both cases. The thing you might have missed if you tried yourself is that there are 3 different bone definitions, there are bones, edit bones, and pose bones. You edit edit bones, pose pose bones and leave bones pretty much alone.

import bpy
import re # regular expression library

arm = bpy.context.active_object

if arm == None or arm.type != 'ARMATURE':
    raise ValueError('You must select an armature')

# Set edit mode
if bpy.context.mode != 'EDIT':
    bpy.ops.object.mode_set(mode='EDIT')

for ebone in arm.data.edit_bones:
    # a regular expression that matches names ending in a period followed by l,L,r,R
    if re.match('.+\.[RrLl]$', ebone.name):
        ebone.select = False
        print('{} selected'.format(ebone.name))

    else:
        ebone.select = True
        print('{} not selected'.format(ebone.name))

Answer: I see that you've added scripting tag, but this task is not too complicated to use Python!
Press menu Select → Select Pattern...
In the window input * [LR]* if you have L and R separated by space and *.[LR]* if it separated by dot. Also if L and R is at the end of the name you can use *.[LR]
Then press Enter in the field to activate selection. (The is no Apply (Select) button, so this can be a little tricky)

Then you have all L and R bones selected, simply invert selection by pressing Ctrl + I
Comment: If you put ! between [ and L you don't have to invert.
Comment: @MartyFouts it looks like you give good hint, but this will not work, because it still searches for separator (`.` or `_` or space)
Comment: You need to remove the last * for my comment to work.  You're searching for L or R anywhere in the string.
Answer: The simplest way to do this is to select by pattern and use the pattern *[!LR]. Putting the exclamation point ! as the first character of a character selection list says to invert that list, that is select any character except those in the list, so this pattern will select any bone name that does not end in L or R.
You may want to enable case sensitive if you have center bones that end in lower case l or r.
No scripts or extra steps are required.

Since you included the scripting tag
import bpy

bpy.ops.object.select_pattern(pattern='*[!LR]')

Comment: Genius! thanks a ton!
Answer: Select centre bones.
To do this in any mode, can for all but edit mode set the select attribute of an Armature.bone
Select Pose Bones Per Script In Blender 2.8
For edit bones, can either toggle out of edit, do as above and back into edit mode, or set the select on an edit bone.
Either way selections are reflected in all modes.
Edit left and right to suit, for example if your bones end with "_Left"
left, right = "_Left", "_Right"

".L" and ".R" have been used here as default.
`
import bpy

context = bpy.context

left, right = ".L", ".R"

ob = context.object
arm = ob.data

assert ob.type == 'ARMATURE', "Select an Armature"
col = "edit_bones" if context.mode == 'EDIT_ARMATURE' else "bones"
for b in getattr(arm, col):
    b.select = not (
        b.name.endswith(f"{left}")
        or b.name.endswith(f"{right}")
        )

Note: can make this case insensitive, by converting both name and suffix to lower case, with
b.name.lower().endswith(f"{left}".lower())


Why does the resistance of a brushed Dc motor from an experiment kit vary?

Question: I am currently performing an experiment in which I measure the Current and Voltage of a motor that experiences changes in load. I am using a 3V (3V battery) supply however the voltmeter's (connected to the terminals of the motor) reading changes from 3V at no load down to 1V at max load. I understand how the current changes since less back-emf is produced at lower speeds. I also understand how using V = IR could result in that change of Volts. But wouldn't that require constant resistance and that is not the case with the values I have. For example, I tried calculating R using the equation and each time I got a different answer, Which itself increased in respect to the load. Is this a case of simple experimental error or am I missing something rudimentary? And if the voltage is changing is calculating power with
P = I*3(V) all through the experiment incorrect?
Comment: _"I tried calculating R using the equation"_ - which equation did you use, and what were the results (volts, amps, rpm)?
Answer: A motor isn't just a resistor. It's not just a resistor and BEMF source either. You cannot use V=IR to try and calculate a motor winding resistance while it is spinning because a bunch of other variables are also present.
At the absolute minimum, your model should also include an inductance:

simulate this circuit – Schematic created using CircuitLab

simulate this circuit
You can then measure the current and voltage at the motor terminals at various supply voltages and RPM/loads to figure out what the kV (BEMF voltage per RPM), inductance, and winding resistance are.
But you will need to be able to measure the RPM for this since the impedance drop presented by the inductance varies with frequency which varies with RPM (and so too does the BEMF voltage).
But if you have a smart meter to measure things that is able to separate out the reactive voltage drop due to the inductance from the resistive voltage drop, it will still measure a higher resistance while running, and the faster it runs the higher this resistance will measure.
The rotating magnetic field induces eddy currents to circulate with the iron core itself. These only appear while the motor is running and increase with frequency (RPM). They manifest as a voltage drop and with all the characteristics I listed, at first glance you would think they appear to be just like the voltage drop due to the inductance. But they are not. They have one critical difference: They are still resistive losses that permanently remove energy from the system unlike the inductance which absorbs energy only to release it later in the future. So there is actually a fixed resistor in the motor due to winding resistance but eddy currents in the core also produces the equivalent of a second resistor which is frequency dependent.
If this is for a science fair you can try to weed out those parameters and if you do it well, you should be able roughly predict things how it will behave.
Comment: @AnderMaxwell Well that would give you the input power. But input power is not the same as output power which is considerably more difficult to obtain. There are power supplies where you can dial in a voltage or dial in a current and it will provide either a constant voltage OR a constant current.
Comment: I am simply playing around with motors and I wish to understand it better. That said your answer actually clears a lot of stuff up thank you. However, It wouldn't be possible for me to simply use the cells voltage and the ammeter reading to calculate the power into the motor right? Is there a way to keep the voltage constant?
Comment: Don't forget the mechanical commutator. The configuration of the commutator in a DC motor allows more than one winding to be connected at certain rotation angles.
Comment: @ScienceGeyser I don't know of a simple way to convey that in a schematic. The assumption above is that even though you're feeding the motor DC the inductance is being subject to a frequency based on the RPM via the commutator and not the actual 0Hz DC of the supply.
Comment: It may be better to model as an AC circuit since all motors inherently are AC operated. In this case you would replace the DC supply with an AC supply that represents the commutation ring on the armature.
Comment: @ScienceGeyser Yeah. I would agree with that.


Should the import of local spatial vector files in different formats be handled Server side?

Question: I'm working on a Esri Silverlight Web API app and wondering the best way to handle the import of local spatial vector data files.  Sometimes these will be your standard shape file but often these will be in vendor specific proprietary file formats that will have to use special API's to parse out the data within them.  My question is whether it would likely be a better practice to handle the data conversion on the server side vs. attempting to do it on the client side?
Comment: +1 after thinking about this a bit, I've decided to upvote this.  It would be useful to be able to simply preview relatively small files that have been published on the internet without loading them on a server.  (Dwg files of subdivision plats especially).
Comment: Is your silverlight running in Out of Browser mode with elevated permissions?  Can you set a reference to the assemblies provided by your special API's without visual studio complaining?
Comment: This is still in the planning stages so making it a Out of Browser app is a possibility but not sure that will even matter since we will likely be using SL5.  Also unsure on the assembly reference problems but that could likely be a problem.
Answer: Doing that kind of thing server side would be a more scaleable option. Using your app to upload that data into ArcGIS Server DataInterop or Safe/FME which can them publish to a webservice for display on your app is the easiest to maintain.
As then you are removing the dependency of your App speaking all these differnet formats and it just is needed to push up and display the data; let the backend handle the data format or conversion.
You can even if you want a lowest cost option look at some of the OSGeo stuff; host that on a server, then write some webservices that you call from your SL app to push up to them; reshape the data to be overlayed in your front end.
Silverlight is really just a Rich-UI tool; you don't want to make it too burdensome on the client machine; much like a web-app its really geared to display rich information and not be a replacement for dedicated tools.
Comment: thanks for answer.  I completely agree with what you're saying and agree it is probably the best approach.  My only worry with doing it server side is one of performance and speed as well as the need to be connected. Do you think doing it server side could be similar in speed as doing the conversion client side?  If so, the only draw back would not being able to do it when disconnected from server.
Comment: Doing it client side means you will also have to support all the needed dependencies on each of your users machines. Which starts to negate the benifits of SL to begin with. SL is first and foremost just a UI; to do rich presentation of data; less about being a complete SDK to replace dedicate thick-client apps. It that is your direction then you might be better off just using .Net to build a App.
Comment: I completely agree once again with what you are saying.  Crazy to try to support everyone client side.  It's good to get your feedback, thanks.


Why is it necessary for black to defend e5 pawn after 1. e4 e5 2. Nf3?

Question: Why is it necessary for black to defend the e5 pawn after 1. e4 e5 2. Nf3? What do you think of 1. e4 e5 2. Nf3 a6 3. Nxe5 d6? Now white should move his knight to c4, d3 or f3 and black can develop more pieces.
Comment: I think we should answer why 2...a6 and 3...d6, as suggested by Populara Salaj, is bad for Black, rather than talking about the Latvian, Petroff or else...
Answer: It's not necessary; the solid Petrov's Defence continues with the counterattack 2... Nf6. There's also a less stable option in 2... f5, the Latvian Gambit but it rarely sees play at the top level.
Otherwise, the real problem for Black is not the knight on e5. It's the fact that you're giving away a center pawn without any compensation whatsoever. If you want to develop pieces, you're even better off playing 2... Bc5 than 2... a6.
Comment: I'm not sure 2...Bc5 is better, because the bishop will have to move again after White's eventual d4. But maybe 2...h6 is better than a6 because it provides a square for the queen: 3.Nxe5 Qe7 4.Nf3 Qxe4+ 5.Be2 Qh7!!
Comment: Yeah, maybe 2... Be7 is better then.
Comment: Why not 3.d4 then and if 3...d6 4.Nf3 Qxe4 5.Be2 and Black is behind in development with Queen exposed?
Comment: @bof What exactly is the queen doing on h7 though?
Answer: The purpose of protecting e5--or counter-attacking by Nf6--is to prevent the lose of material.
After 1. e4 e5 2. Nf3 a6 3. Nxe5 d6, white is up a pawn and has equal development.  Black doesn't have enough compensation for the sacrificed pawn.  3... Qe7 regains the pawn, as white can't protect both e5 and e4, but the resulting position will leave black's queen exposed to attack from white's minor pieces and gives white a greater advantage.
To keep the game equal, black must protect the pawn with Nc6 or d6 or counter-attack with Nf6.  Protecting e5 with f6 loses to a famous chess trap(https://en.wikipedia.org/wiki/Damiano_Defence).
Answer: The idea of offering a pawn for a lead in development is called a "gambit."
Gambits are mostly played by White, who has the advantage of the first move, and who gets the advantage of a second or even third move for the sacrificed pawn. This can make it worth doing for White.
It is not worth doing for Black, because he would have only "switched colors," gotten White's normal first move advantage, but with a pawn down.
Comment: In the line given (2...a6 3 Nxe5 d6), I can't even see that Black has taken White's usual role, as White is still (slightly) ahead in development and space, on top of the pawn.
Comment: @Annatar:I gave the "best case" for Black. Of course, you're right, that the example was not even a best case scenario for Black.
Answer: Your proposed line 1.e4 e5 2.Nf3 a6? 3.Nxe5 d6 simply loses a pawn for nothing.  Black gets no compensation in the form of development, because time has been lost by the pointless move 2...a6.
The two main replies to 2.Nf3, 2...Nc6 and 2...Nf6, both have the advantage of developing a piece and not losing a pawn.
Answer: Only defend the pawn because you coincidentally develop your pieces as well.
Playing 2...d6 to defend the pawn because you're SCARED it will get taken is a bad attitude.
Even 2...f5 is a super, hyper-aggressive move that I'd play instead of the timid and mediocre 2...d6.
But you see the attitude? If you decide to play 2...d6 with a solid strategy, and you REALLY know what you're doing, then it's playable. See Philidor, Hanham.
Playing 2...Nc6 develops a piece at the same time.
Even 2...Qe7 can be played, but it's a bad strategy. Good night, King's bishop. No pun intended.
P.s. please forgive the caps. I'm on my phone and don't know how to italicize.
Comment: Are you calling 2...d5 "timid" or was 2...d5 a typo and you meand 2...d6?


Which data to share in CTR mode?

Question: Suppose I've got two clients $A$ and $B$. Client $A$ encrypts data in CTR (Counter) mode to get a ciphertext. What information will client $B$ have to receive from $A$ to decrypt the ciphertext? Just the "key", "IV" (nonce), and "counter start value"?
Comment: @CodesInChaos it's CTR(Counter) mode, i've corrected my question
Answer: As you specified in the question, the key, nonce, and initial counter value are what is required in addition to the ciphertext and algorithm used.
However, it is best practice to have the initial counter always be 0. Common standards place no specific restrictions on the size of the nonce unless it is used in an authenticated encryption mode, but it is generally 96-bits, leaving 32-bits for the counter. A 32-bit counter allows 64 GiB of data to be encrypted per nonce using a 128-bit block cipher. A 32-bit 0-start counter is also more simple for software implementations. If you expect to send more than 64 GiB in a single message, you will need to reevaluate the counter size.
If you plan on having both the clients encrypt data with the same key, care must be taken so that there is no nonce overlap. 2 ways of doing this are prenegotiating a client to only use even or odd nonces, or having one of the clients use only nonces with the high bit set to 1.
Comment: Thanks for your answer. I'm thinking generate nonce randomly before encryption and prepended as plaintext to ciphertext. Is it safe enough to transmit  nonce with ciphertext in such way ?
Comment: Having the nonce be random is not a requirement, having it be unique per message is. If you are generating them randomly there is a probability of overlap; it is best to start with a random nonce and then increment by 1 for each message. The nonce is fine to send in plaintext, but should be included as part of any authenticated data.

Which data to share in CTR mode?


gender as a model from a SQL statement in django 1.8

Question: I want to generate SQL code and take from that code, generating a Django model to avoid errors.
They will say that you first create the model and run the syncdb or migrate but my case is unlike the database is already created and I now want the model
Comment: Check this http://stackoverflow.com/questions/1545714/reverse-engineer-mysql-database-to-create-django-app
Comment: database != django model
Answer: Run this command to auto-generate models from an already existing database. But first make sure you've properly linked database to django app .
python manage.py inspectdb > models.py

Do check models.py file and make some changes if you something isn't rendered correctly.
For inspectdb approach, read this: https://docs.djangoproject.com/en/1.8/howto/legacy-databases/
Alternatively, you can write all the models by yourself and set managed = False. No database table creation of deletion will be executed by Django on this model. But it is somewhat complicated and puts some limits on model relationships.
For managed=False approach, read this: https://docs.djangoproject.com/en/1.8/ref/models/options/#managed


Can you breed fish in Minecraft?

Question: While I play Minecraft, my spawn is usually far away from a coral biome, and sometimes I like to bring fish back in buckets. Is there something that you can do, maybe place certain blocks (Like to breed pandas) to make your fish breed with each other? Is there a way to breed fish, so I don't have to go back to the coral biome every time one of my fishes dies?
Answer: No.

You cannot breed Fish. There are no Baby Fish in Minecraft. Fish spawn naturally in Ocean Biomes, like passive mobs do on land.- How do you breed fish? - Reddit

The Wiki article also never mentions anything about breeding.

Fish can only spawn underwater at a Y level of 12-32.
Cod spawn in normal, cold, and lukewarm oceans, and their deep variants in groups of 4-7.
Pufferfish spawn in lukewarm, warm, and deep lukewarm oceans in groups of 3-5.
Tropical fish can only spawn in warm ocean in groups of 3-5.
Salmon spawn in groups of 3-5 in cold and frozen oceans, and their deep variants. Unlike the other types of fish, they also spawn in normal and frozen rivers. Salmon can spawn in 3 sizes which are small, normal and large.- Fish (mob) - Minecraft Wiki

So the ways listed above are the only ways fish can spawn.
Comment: What do you think that the "Small" salmon are supposed to represent my dude?
Answer: Fish cannot breed. There is no mention of them having the ability to breed on the Official Minecraft Wiki, especially not in the spawning section.
Answer: You cannot breed any fish in Minecraft.
You can spawn them with a spawn egg, or they will spawn naturally
Comment: This doesn't seem to add any information that the other answers don't already mention.
Answer: You can not, but on the mobile version of Mine craft, there are baby squids.

Can you breed fish in Minecraft?


I am having trouble running slither and mythril on contracts that import more than 1 library

Question: I'm trying to audit some of the damn vulnerable defi challenges using static analyzers slither and mythril. I can run these tools on the challenges that use the openzeppelin library exclusively thanks to the remapping. However, I am not being able to remap more than 1 library(uniswap and gnosis for the puppet-v2 and backdoor challenges respectively). If you have any suggestions, please go ahead.
Answer: To use static analysis tools like Slither and Mythril to audit contracts that use multiple libraries, you can use the --remap flag to specify multiple libraries and their corresponding file paths. For example, if you are using Slither to audit a contract that uses both the Uniswap and Gnosis libraries, you can use the following command:
<code>slither --remap Uniswap:/path/to/uniswap.sol,Gnosis:/path/to/gnosis.sol /path/to/contract.sol
</code>
This will tell Slither to use the files uniswap.sol and gnosis.sol as the source code for the Uniswap and Gnosis libraries, respectively, when analyzing the contract at /path/to/contract.sol.
You can use a similar approach with Mythril by using the --remap flag in a similar way.


Magento 2.3: How Magento knows that a certain patch is already executed while it didn't use any versioning?

Question: As Magento introduces patches instead of upgrade data and upgrade schema. In earlier version of Magento upgrade data and upgrade schema works by versioning but in Magento 2.3 it only executed the one patch files only one time. So how should Magento knows that this patch file is already executed??
Answer: Magento stores the list of all the patches that has already been applied in the database table patch_list.
An unapplied patch will be applied on running the setup:upgrade.
Answer: For Magento 2:
From the magento root directory run below
php bin/magento indexer:reindex


If I speed up time, what are the consequences?

Question: Is there any way to expedite tomorrow or advance when the town is depleted? If I change my clock in system settings, will that mess up my town? (How?)
Answer: I have seen the future and the past. I have time traveled for hundreds of years (by adjusting my Switch system clock) and this is what I learned:

There is no major effect. No nagging, no obvious penalties, despite what IGN said. Indeed, on the plus side, progressing into the future earns interest on your Nook Bank balance (in the ATM/ADM), maxing out at 99k bells at a time.
No residents left town, in my case. Caveat emptor: I did this before actively recruiting new townspeople. For what it's worth, I ignored townspeople when I time traveled (man on a mission), which might have stopped the game from registering that I had "ignored" the residents. For example, if I progress into the future and talked to a resident, they'll remember that it's been weeks/months/longer since we last spoke, but once I returned into the past and talked with the residents, they wouldn't say anything about the time passed.
I also didn't especially notice more weeds or anything falling into disarray, but that might have been because I traveled between winters, when snow covered the ground.
Not specific to time travel but to putting down the game in general, if you haven't been "in-game" in a while, there may be changes that are not recapped in Isabelle's morning announcement, such as new residents who came and were ostensibly announced while you were gone.
Answer: In addition to the other answers about time travelling forward having no penalty, I feel like there should be mention of the only penalty I'm aware of for time travelling backward: any turnips you own instantly go bad. Presumably this is to prevent you from jumping around the days of the week to find the best turnip prices.
Answer: There doesn't seem to be any sort of penalty -- at least from advancing the game a day at a time.
I wanted to have the museum built, so I forwarded my system a day:

I listened to Tom Nook's daily announcement where he also discussed the museum finally opening
I was able to visit the museum and talk to Blathers
I changed the system time back to the current time and re-launched Animal Crossing
My current Bell amount did not change, nor did the miles change, nor did my daily bonus from the Nook Terminal change, and the museum was still built where I could talk to Blathers.
Answer: There are few downsides to time travel, but there are some not covered in other answers:

Time traveling forward a month (or not playing for a month) will give you bedhead and infest your house with cockroaches.  The bedhead goes away on its own in a second.   The cockroaches hurt your happy home academy rating.   To get rid of the cockroaches you have to go around to each room of your house and step on them.   After you step on 12 of them, your character says that they are glad they are all gone.
Time traveling forward a week or more will cause weeds on your island to have sprouted like crazy.   You'll have to go around and clean them up.
Time traveling forward past Saturday causes any turnips to spoil.  Time traveling backwards AT ALL causes turnips to spoil.
When you wish on shooting stars you must pick up the star fragments on the beach the next morning.  If you wish on shooting stars and then time travel other than to the next morning, the star fragments will be lost.
If you water flowers and then time travel backwards, the flowers stop sparkling without reproducing.  You'll need to water them again to get them to breed or clone.
Nintendo is now releasing new versions of ACNH for new special events just days before the special event happens.   If you are always way ahead of real time, you'll never see new special events because you won't get have the software version that shows them when you play the date on which they happen.
Time traveling by two ore more days (either forward or backward) randomly resets the order of visiting vendors to your island (Redd, Flick, CJ, Gulliver, etc.)   However if you limit yourself to traveling one day at a time, you can go back and forth between days and get the same vendors.
Time traveling backwards (even by months or years) doesn't cause a new day to start.  You won't get Isabelle's announcements, trees and flowers won't grow, rocks and trees won't get replenished (except money rocks for some reason), mail is delayed (except Redd's for some reason).  You'll have to wait until the next morning (or time travel forward to it) for a new day to truly start.


Tag wikis for wide angle and ultra wide angle

Question: Hey @Imre — I approved your tag wiki edits for wide-angle and ultra-wide-angle since there was nothing at all there before, but, citation needed on your sensor-size-related definitions. Sounds plausible but I'd like to see a reference, and maybe an update to:
What is an ultra-wide lens?
Answer: I think I heard this first at an open university photography course some years ago (a real one, not the imaginary one that gives me hard assignments). I don't even remember the name of my mentor there, so I can't pass this as a reference. Wikipedia seems to agree, but cannot be used as a credible reference by itself and is missing citation also.
I added link to our relevant question into those tag wiki bodies, and will add my answer there when I find some better references.


Content of array in bash is OK when called directly, but lost when called from function

Question: I am trying to use xmllint to search an xml file and store the values I need into an array. Here is what I am doing:
#!/bin/sh

function getProfilePaths {
    unset profilePaths
    unset profilePathsArr
    profilePaths=$(echo 'cat //profiles/profile/@path' | xmllint --shell file.xml | grep '=' | grep -v ">" | cut -f 2 -d "=" | tr -d \")
    profilePathsArr+=( $(echo $profilePaths))
    return 0
}

In another function I have:
function useProfilePaths {
    getProfilePaths
    for i in ${profilePathsArr[@]}; do
    echo $i
    done
    return 0
}

useProfilePaths

The behavior of the function changes whether I do the commands manually on the command line VS calling them from different function as part of a wrapper script. When I can my function from a wrapper script, the items in the array are 1, compared to when I do it from the command line, it's 2:
$ echo ${#profilePathsArr[@]}
2

The content of profilePaths looks like this when echoed:
$ echo ${profilePaths}
/Profile/Path/1 /Profile/Path/2

I am not sure what the separator is for an xmllint call.
When I call my function from my wrapper script, the content of the first iteration of the for loop looks like this:
for i in ${profilePathsArr[@]}; do
    echo $i
done

the first echo looks like:
/Profile/Path/1
/Profile/Path/2

... and the second echo is empty.
Can anyone help me debug this issue? If I could find out what is the separator used by xmllint, maybe I could parse the items correctly in the array.
FYI, I have already tried the following approach, with the same result:
profilePaths=($(echo 'cat //profiles/profile/@path' | xmllint --shell file.xml | grep '=' | grep -v ">" | cut -f 2 -d "=" | tr -d \"))

Comment: What's wrong here? The loop does iterate over the two array elements. Please post a complete script that doesn't reference local files (so that we can run it on our machine), and explain clearly why the output is unexpected.
Answer: Instead of using the --shell switch and many pipes, you should use the proper --xpath switch.
But as far of I know, when you have multiple values, there's no simple way to split the different nodes.
So a solution is to iterate like this :
profilePaths=(
    $(
        for i in {1..100}; do
            xmllint --xpath "//profiles[$i]/profile/@path" file.xml || break
        done
    )
)

or use xmlstarlet:
profilePaths=( $(xmlstarlet sel -t -v "//profiles/profile/@path" file.xml) )

it display output with newlines by default
Answer: The problem you're having is related to data encapsulation; specifically, variables defined in a function are local, so you can't access them outside that function unless you define them otherwise.
Depending on the implementation of sh you're using, you may be able get around this by using eval on your variable definition or with a modifier like global for mksh and declare -g for zsh and bash. I know that mksh's implementation definitely works.
Answer: Thank you for providing feedback on how I can resolve this problem. After investigating more, I was able to make this work by changing the way I was iterating the content of my 'profilePaths' variable to insert its values into the 'profilePathsArr' array:
# Retrieve the profile paths from file.xml and assign to 'profilePaths'
profilePaths=$(echo 'cat //profiles/profile/@path' | xmllint --shell file.xml | grep '=' | grep -v ">" | cut -f 2 -d "=" | tr -d \")

# Insert them into the array 'profilePathsArr'
IFS=$'\n' read -rd '' -a profilePathsArr <<<"$profilePaths"

For some reason, with all the different function calls from my master script and calls to other scripts, it seemed like the separators were lost along the way. I am unable to find the root cause, but I know that by using "\n" as the IFS and a while loop, it worked like a charm.
If anybody wishes to add more comments on this, you are more than welcome.


Rolling n m-sided dice - number of outcomes that are less than the first roll

Question: Say I roll 2 fair 6-sided dice and sum the outcomes. If I roll these dice again , in how many ways can I get a new sum that is less than the previous one?  I know that if one die is rolled instead, there are $(m^2-m)/2$ outcomes that will be less than the first roll. Can this be extended to rolling n dice?
Comment: Deos the order of the outcomes count? If you roll, say, 1,2,4 is it a different "way" from 4,1,2? If you provide this information I will be able to help you.
Comment: @Vlad the order doesn't count.
Answer: Let $X_1$ be a random variable equal to the sum of the first roll of the $n$ dice with $m$ sides, and let $X_2$ be the sum of the second roll. By symmetry, $P(X_1>X_2)=P(X_1<X_2)$, which together with $P(X_1<X_2)+P(X_1=X_2)+P(X_1>X_2)=1$ implies that
$$
P(X_2<X_1)=\frac12\Big(1-P(X_1=X_2)\Big)
$$
There is a clever trick we can use to simplify calculating $P(X_1=X_2)$; it turns out that
$$
P(X_1=X_2)=P\big(X_1+X_2=n(m+1)\big)
$$
In other words, the event that the two rolls are the same has the same probability that the two rolls have "complementary" sums. To see this, given an outcome where $X_1=X_2$, consider what happens when you replace each value $i$ in the second roll with $m+1-i$. The resulting rolls will now be complementary. Since this is a bijection of outcomes, the probabilities of the events are the same.
Note that $P(X_1+X_2=n(m+1))$ is the probability that the sum of $2n$ dice with $m$ sides is equal to $n(m+1)$, which is the middle value. This can be calculated explicitly as follows:
$$
P(\text{$2n$ dice with $m$ sides sum to $k$})=\sum_{k=0}^{\lfloor (k-1)/(m+1)\rfloor} (-1)^j\binom{2n}j\binom{k-1-j(m+1)}{2n-1}
$$
Asymptotically, using this answer, the probability is about $\frac1m\sqrt{\frac{3}{\pi n}}$.
Answer: If $(2,1)$ is considered same as $(1,2)$, here is how it would look for $2$ dice for example -
Number of ways to get a sum of $n$ with two dice is say, $p$.
Then, $p = \lfloor \frac{n}{2} \rfloor$ where $\lfloor \, \rfloor$ is floor function.
Say, number of ways to get a sum lower than $n$ in the second roll of two dice is $q$.
Then, $q = \sum \limits_{i = 2}^{n-1} \lfloor \frac{i}{2} \rfloor \, (3 \le n \le 12)$. If $n = 2$, number of ways to get lower sum is obviously zero.
So it turns out to -
a) If $n$ is even then $q = \frac{n(n-2)}{4}$
b) If $n$ is odd then $q = \frac{(n-1)^2}{4}$


Designing a siren to vary pitch with port width/pattern. Advice needed

Question:
Background: I am trying to design a multi-pitch port siren with one central shaft at 3300 rpm. I've calculated the number of ports needed for each frequency to be n = f(60/rpm). This approach gives me fractional n for many values, which I want to remedy. I am not super knowledgeable about waves, I am just learning them in university.

Question: I am curious about the effect of changing port/hole width on the sound produced. I know pitch is dependent on frequency, but if the width of each hole was shortened what effect might that have on the pitch/tone? Would an elongated 'trough' or 'crest' (forgive me I don't know what the term would be for this) effect the pitch at all? Another idea I had was to create an irregular hole pattern, and then maybe the resulting frequency would be some kind of average between the periods between the holes? Any other ideas for modifying frequency with a set number of holes? Thanks in advance. pic for reference
Comment: In relation to the musicality of the tones generated, the simplest ratios give the most pleasing result. 1:1 = unison. 2:1 = one octave. 3:2 = perfect fifth. 4:3 = fourth. 5:4 = major third. 6;5 = minor third. Good 'ol Pythag did a load of work on this. More here: https://en.wikipedia.org/wiki/Interval_(music)#:~:text=Frequency%20ratios,-Main%20article%3A%20Interval&text=When%20a%20musical%20instrument%20is,%3A5%20(minor%20third).
Comment: Seen real ones that look like this - have you researched them?
Comment: That's an interesting question. My first thought was that the port width might affect the harmonics of the fundamental and that tone would change. Two seconds later I thought, "But the harmonics have to be integer multiples of the fundamental so how would that relate to the infinitely variable port width?" Five minutes later and I haven't got past that!
Answer: A siren works by suddenly opening a valve (one of the ports) and allowing a burst of air to escape, then closing that valve. for slow openings and closings that burst represents a square wave pressure pulse with a width determined by the duration of the opening and the rotating speed of the valve disc or cylinder.
That square wave is rich in higher harmonics, which you can actually hear when the siren is running very slowly.
Since the air being flung out the opening possess mass, it takes time to accelerate to full speed and thus the square wave pressure pulse has its sharp edges smoothed off, which suppresses the higher harmonics at higher speeds.
As we increase the siren speed or make the openings narrower there then comes a point where the valve is not open long enough for the escaping air to reach full speed before it closes again and the pressure pulse starts looking more like a sine wave than a square wave. So the timbre will depend on the siren speed.
The problem of generating noninteger frequency notes is solved by constructing a second siren that is geared to run at a different speed than the first one. In this way you can generate all the sharps and flats needed to play a complete scale by switching between the two sirens.
This principle is used in the Hammond Organ (google it) to electromechanically  generate musical scales with all sharps and flats.
Comment: So you are suggesting I create different sirens with the 'integer' frequency tones to get all the notes I desire. Thank you for the suggestion, I will look up the hammond organ. I am still curious what would happen if you had a varied spacing between the ports for one note, if you have any insight into this. Thanks!


What is drift speed in electricity and how is it related to the cross sectional area of the conductor?

Question: In fluids dynamics, I learnt that as rate of flow is constant for an ideal fluid, Area(cross sectional area of the tube) x velocity is constant.I had a doubt whether the same relation exists between drift speed and cross sectional area of conductor.
Answer: In the case of a pipe, what is conserved is $$\frac{dm}{dt} = \rho A v. $$
In a wire, the current is conserved:
$$\frac{dq}{dt} = nAu $$ where $u$ is the electron drift speed and $n$ is the charge density.
You should look up the Drude model for more information.
Answer: The relation between drift speed and cross sectional area in a conductor with constant current and different cross section is the same as for an incompressible  fluid flow in a tube with changing cross section, i.e., $$v_1 A_1=v_2 A_2$$ as long as the charge carrier density $n$ (e.g. electrons in a metal) is constant. This follows from the conduction current continuity for stationary currents: The conduction current $I$ stays constant along the conductor $$I=I_1=A_1 n_1 e v_1=A_2 n_2 e v_2=I_2$$ This follows from the law of charge conservation which in the stationary case reads $$\nabla · \vec j=-\frac {\partial  \rho}{\partial t}=0$$ In its integral form this means that the closed surface integral $$\int_{\Sigma} \vec j d \vec a=0$$ where the current density is given by $\vec j=n e \vec v$.


All tags on the main ux.se site have become unlinked from their questions.

Question: All of the tags come up with '0 Questions Tagged with this Tag' message. It works correctly here on Meta but not on the Main site.
Answer: I suspect you are on the wrong tab. Our tabs are sticky. Can you look again?
Comment: Jeff - I saw the same thing as Jon. It was taking you to the "Featured" version of the page from the home page. I clicked on "Questions" and it took me to the "Featured" questions. I then clicked on "Newest" and went back to the home page. Clicking on a tag again now took me to the proper page results (showing tags). Looks like the tags page is remembering that I had last viewed the "Featured" view for the questions page and carried it over to the tags page (which doesn't actually show in the sub-nav).
Comment: No, still a problem. On the main site I click any of the tags against any question and it opens up the 'Tagged Questions' tab, but shows the message "0 questions tagged". I do the same thing here on Meta and I get a list of several questions tagged with that tag.
Comment: @jon No repro at all on my end. Can you humor me and try clicking different tabs in the question list?
Comment: Yes, Charles is right. I was being taken to the Featured questions tab even though I chose a tag against one of the questions on the main front page. I've now chosen a tag from the Featured tag, and this seems to have fixed the tags for the Main questions section for me. If I can find the re-creation steps for it getting out of line I will post that here.
Answer: I have some recreation steps here:

Select Questions/Featured
Now return to the main screen via the
UX logo
Choose one of the Tags against any
question
This takes you to the 'Featured'
questions page for the tag selected
(i.e. nothing).

This also happens on the Meta site: if the last section in the Questions section you visited was the FAQ then choosing any tags from the front screen will only show you the tags for the FAQ section.
As it doesn't actually show you that the 'Featured' tab is the currently active one (it's not even displayed in the tab list) then you can't easily change to the 'Active' tab.


Where is evidence to support Jews have a different soul from non-Jews in Torah?

Question: At what point in the Neshamah: Levels of Soul Consciousness is the separation between Jews and Non-Jews?
Comment: I don't understand why my question is downvoted? Have I said anything offensive or out of line? If so I can take down my question but I don't appreciate the negative response without a valid reason.
Comment: It's vaguely written. Perhaps edit it?
Comment: https://hakirah.org/Vol%2016%20Balk.pdf
Comment: @MauriceMizrahi Thank you
Comment: See this related post: https://judaism.stackexchange.com/a/25749/27180
Answer: In regard to the exact difference in the level of Soul Consciousness, Rav Shneur Zalman Liadi writes in Tanya (Likkutei Amarim, ch. 1-2) that the Jewish Nation has both a Godly Soul and an Animalistic Soul whereas Gentile's have only an Animalistic Soul. Furthermore, the nature of the Animilatic Soul of a Jew is inherently different than that of a Gentile. A Jew's Animalistic Soul is from the place known in Kabbalistic literature as "קליפת נוגה" - "the Illuminated Shell" which represents the potential for both Good and Evil and thus has an element of Good within it, it is thus compared to the "עץ הדעת טוב ורע" - "The Tree of Knowledge of Good and Evil." A Gentile's animal soul however is seen to stem from a place that is purely evil and thus even the Good found within it is ultimately self-centered, as the Talmud (Bava Basra 10b) writes:

תַּנְיָא אָמַר לָהֶן רַבָּן יוֹחָנָן בֶּן זַכַּאי לְתַלְמִידָיו בָּנַי מַהוּ שֶׁאָמַר הַכָּתוּב צְדָקָה תְרוֹמֵם גּוֹי  וְחֶסֶד לְאֻמִּים חַטָּאת נַעֲנָה רַבִּי אֱלִיעֶזֶר וְאָמַר צְדָקָה תְּרוֹמֵם גּוֹי אֵלּוּ יִשְׂרָאֵל דִּכְתִיב וּמִי כְּעַמְּךָ יִשְׂרָאֵל גּוֹי אֶחָד בָּאָרֶץ וָחָסֶד לְאֻמִּים חַטָּאת כׇּל צְדָקָה וָחֶסֶד שֶׁאוּמּוֹת הָעוֹלָם עוֹשִׂין חֵטְא הוּא לָהֶן שֶׁאֵינָם עוֹשִׂין אֶלָּא לְהִתְגַּדֵּל בּוֹ כְּמוֹ שֶׁנֶּאֱמַר דִּי לֶהֱוֹן מְהַקְרְבִין נִיחוֹחִין לֶאֱלָהּ שְׁמַיָּא וּמְצַלַּיִן לְחַיֵּי מַלְכָּא וּבְנוֹהִי

"It is taught in a baraita: Rabban Yoḥanan ben Zakkai said to his students: My sons, what is the meaning of that which the verse states: "Righteousness exalts a nation, but the kindness of the peoples is sin" (Proverbs 14:34)? Rabbi Eliezer answered and said: "Righteousness exalts a nation"; these are the people of Israel, as it is written: "And who is like your people Israel, one nation on the earth?" (I Chronicles 17:21). "But the kindness of the peoples is sin," meaning that all the acts of charity and kindness that the nations of the world perform is counted as a sin for them, since they perform them only to elevate themselves in prestige, as it is stated: "That they may sacrifice offerings of pleasing aroma to the God of heaven, and pray for the life of the king and of his sons" (Ezra 6:10). Even though they donated offerings, they did so only for their own benefit."
Comment: Check the following note on the end first chapter of Tanya: https://www.chabad.org/library/tanya/tanya_cdo/aid/7880/jewish/Chapter-1.htm#footnote33a7880                                      "It should be noted that among the nations of the world, there are also to be found those whose souls are derived from kelipat nogah. Called 'the pious ones of the nations of the world,' these righteous individuals are benevolent not out of selfish motives but out of a genuine concern for their fellow". (Siddur Im Dach. (Shaar Chag Hamatzot 287c; Likkutei Biurim by Rabbi Hillel of Paritch 47b.)
Comment: So if the gentile nations perform acts of kindness and charity and it's considered a sin, since it's derived from selfish reasons, what's the point of being kind and performing charity for them? Do non-Jews have no part in Tikkun Olam? How is the world going to heal if non Jews showing loving kindness and charity is a sin? Does that mean Jews are only obligated to do acts of kindness and charity only for other Jews?
Comment: On the surface, that passage from the Tanya doesn't sound so nice. Is there a charitable understanding of this concept somewhere? What does R. Steinsaltz say in his comments on this section?
Comment: See this link for a charitable understanding of this concept: https://judaismsanswer.com/The%20Soul.htm
Comment: Plus note that the Tanya quotes the Gemara, it is not a innovation of the Tanya.


Counting certain digits - How to do this efficiently?

Question: I'm currently struggling with an algorithmic problem and I can't help but think this can be done with some mathematical trick I'm missing.
Knowing that a digit is considered 'pretty' in a number only if it's strictly greater than its adjacent digits and 'ugly' if it's strictly less than it's adjacent digits, we assign to each number a certain score defined as $\text{score} = |\text{ugly digits}| + \text{|pretty digits|}$.
Note that marginal (i.e. first and last) digits in a number can't be ugly or pretty since they have only one neighbor.
We are asked to do the following :

Find the sum total of the scores of each number in a particular interval, provided its endpoints.

Example:
Given the interval $[101, 105]$, we compute the score for each value in this interval and get the sum. So :

$score(101) = |\text{ugly digits(101)}| + \text{|pretty digits(101)|} = 1 + 0 = 1. $
$score(102) = |\text{ugly digits(105)}| + \text{|pretty digits(105)|} = 1 + 0 = 1.$
$$.....$$
$score(105) = |\text{ugly digits(102)}| + \text{|pretty digits(103)|} = 1 + 0 = 1.$

Hence, the sum total would be $5$ for the given interval. But the interval can get extremely large, with its right endpoint reaching up to $10^{12}$ and the left one going down to $1$.
I've looked for patterns in the binary representations and that didn't work. Then I thought there might be some combinatorial approach if we try to look at each possible digit and put it in every place it could be in the given range and count the cases when it's pretty or ugly, but I couldn't get anywhere with this either.
Any ideas would be welcome.
Answer: `
1. Let interval is [L, R]
if L>1  F(L, R) = F(1, R) - F(1, L-1)

Split
F(1, X)  to F(1, 9) + F(10, 99) ...  + F(10^k, X)

To calculate F in such intervals, use dynamical programming.
Point in space is the length of number prefix and two last digits of the prefix
`
Comment: Сonst *  K for the  F(10^k, X)
You can precalculate  F(1,9), F(10, 99), ...


Weird usage of "&" for a novice C++ programmer

Question: I have some code here, and don't really understand the ">>" and the "&". Can someone clarify?
buttons[0] = indata[byteindex]&1;
buttons[1] = (indata[byteindex]>>1)&1;
rawaxes[7] = (indata[byteindex]>>4)&0xf;

Answer: These are bitwise operators, meaning they operate on the binary bits that make up a value. See Bitwise operation on Wikipedia for more detail.
& is for AND
If indata[byteindex] is the number 4, then in binary it would look like 00000100. ANDing this number with 1 gives 0, because bit 1 is not set:
00000100 AND 00000001 = 0

If the value is 5 however, then you will get this:
00000101 AND 00000001 = 1

Any bit matched with the mask is allowed through.
>> is for right-shifting
Right-shifting shifts bits along to the right!
00010000 >> 4 = 00000001

Comment: @Simon: Your examples are good, but try to clarify to the OP what "bitwise" means.
Answer: One of the standard patterns for extracting a bit field is (reg >> offset) & mask, where reg is the register (or other memory location) you're reading, offset is how many least-significant bits you skip over, and mask is the set of bits that matter.  The >> offset step can be omitted if offset is 0.  mask is usually equal to 2width-1, or (1 << width) - 1 in C, where width is the number of bits in the field.
So, looking at what you have:
buttons[0] = indata[byteindex]&1;

Here, offset is 0 (it was omitted) and mask is 1.  So this gets just the least-significant bit in indata[byteindex]:
    bit number ->   7 6 5 4 3 2 1 0
                   +-+-+-+-+-+-+-+-+
indata[byteindex]  | | | | | | | |*|
                   +-+-+-+-+-+-+-+-+
                                  |
                                  \----> buttons[0]

Next:
buttons[1] = (indata[byteindex]>>1)&1;

Here, offset is 1 and width is 1...
    bit number ->   7 6 5 4 3 2 1 0
                   +-+-+-+-+-+-+-+-+
indata[byteindex]  | | | | | | |*| |
                   +-+-+-+-+-+-+-+-+
                                |
                                \------> buttons[1]

And, finally:
rawaxes[7] = (indata[byteindex]>>4)&0xf;

Here, offset is 4 and width is 4 (24-1 = 16 - 1 = 15 = 0xf):
    bit number ->   7 6 5 4 3 2 1 0
                   +-+-+-+-+-+-+-+-+
indata[byteindex]  |*|*|*|*| | | | |
                   +-+-+-+-+-+-+-+-+
                    | | | |
                    \--v--/
                       |
                       \---------------> rawaxes[7]

EDIT...

but I don't understand what the point of it is...

Mike pulls up a rocking chair and sits down.
Back in the old days of 8-bit CPUs, a computer typically had 64K (65 536 bytes)  of address space.  Now we wanted to do as much as we could with our fancy whiz-bang machines, so we would do things like buy 64K of RAM and map everything to RAM.  Shazam, 64K of RAM and bragging rights all around.
But a computer that can only access RAM isn't much good.  It needs some ROM for an OS (or at least a BIOS), and some addresses for I/O.  (You in the back--siddown. I know Intel chips had separate address space for I/O, but it doesn't help here because the I/O space was much, much smaller than the memory space, so you ran into the same constraints.)
Address space used for ROM and I/O was space that wasn't accessible as RAM, so you wanted to minimize how much space wasn't used for RAM.  So, for example, when your I/O peripheral had five different things whose status amounted to a single bit each, rather than give each one of those bits its own byte (and, hence, address), they got the brilliant idea of packing all five of those bits into one byte, leaving three bits that did nothing.  Voila, the Interrupt Status Register was born.
The hardware designers were also impressed with how fewer addresses resulted in fewer address bits (since address bits is ceiling of log-base-2 of number of addresses), meaning fewer address pins on the chip, freeing pins for other purposes.  (These were the days when 48-pin chips were considered large, and 64-pins huge, and grid array packages were out of the question because multi-layer circuit boards were prohibitively expensive. These were also the days before multiplexing the address and data on the same pins became commonplace.)
So the chips were taped out and fabricated, and hardware was built, and then it fell to the programmers to make the hardware work.  And lo, the programmers said, "WTF?  I just want to know if there is a byte to read in the bloody serial port, but there are all these other bits like "receiver overrun" in the way."  And the hardware guys considered this, and said, "tough cookies, deal with it."
So the programmers went to the Guru, the guy who hadn't forgotten his Boolean algebra and was happy not to be writing COBOL.  And the Guru said, "use the Bit AND operation to force those bits you don't care about to 0.  If you need a number, and not just a zero-or-nonzero, use a logical shift right (LSR) on the result."  And they tried it.  It worked, and there was much rejoicing, though the wiser ones started wondering about things like race conditions in a read-modify-write cycle, but that's a story for another time.
And so the technique of packing loosely or completely unrelated bits into registers became commonplace.  People developing protocols, which always want to use fewer bits, jumped on these techniques as well.  And so, even today, with our gigabytes of RAM and gigabits of bandwidth, we still pack and unpack bitfields with expressions whose legibility borders on keyboard head banging.
(Yes, I know bit fields probably go back to the ENIAC, and maybe even the Difference Engine if Lady Ada needed to stuff two data elements into one register, but I haven't been alive that long, okay? I'm sticking with what I know.)
(Note to hardware designers out there: There really isn't much justification anymore for packing things like status flags and control bits that a driver writer will want to use independently.  I've done several designs with one bit per 32-bit register in many cases.  No bit shifting or masking, no races, driver code is simpler to write and understand, and the address decode logic is trivially more complex.  If the driver software is complex, simplifying flag and bitfield handling can save you a lot of ROM and CPU cycles.)
(More random trivia: The Atmel AVR architecture (used in the Arduino, among many other places) has some specialized bit-set and bit-clear instructions.  The avr-libc library used to provide macros for these instructions, but now the gcc compiler is smart enough to recognize that reg |= (1 << bitNum); is a bit set and reg &= ~(1 << bitNum); is a bit clear, and puts in the proper instruction.  I'm sure other architectures have similar optimizations.)
Answer: These are bitwise operators.
& ands two arguments bit by bit.
'>>' shifts first argument's bit string to the right by second argument.
'<<' does the opposite. | is bitwise or and ^ is bitwise xor just like & is bitwise and.
Answer: In English, the first line is grabbing to lowest bit (bit 0) only out of Button[0].  Basically, if the value is odd, it will be 1, if even, it will be 0.
 (bit 1)
The second is grabbing the second bit.  If that bit is set, it returns 1, else 0.  It could have also been written as
buttons[1] = (indata[byteindex]&2)>>1;

and it would have done the same thing.
The last (3rd) line is grabbing the 5th throuh 8th bits (bits 4-7).  Basically, it will be a number from 0 to 15 when it is complete.  It also could hav been written as
rawaxes[7] = (indata[byteindex]&0xf0) >> 4;

and done the same thing.  I'd also guess from context that these arrays are unsigned char arrays.  Just a guess though.
Answer: The '&' (in this case) is a bitwise AND operator and ">>" is the bit-shift operator (so x>>y yields x shifted right Y bits).
So, they're taking the least significant bit of indata[byteindex] and putting it into buttons[0]. They taking the next least significant bit and putting it into buttons[1].
The last one probably needs to be looked at in binary to make a lot of sense. 0xf is 11112, so they're taking the input, shifting it right 4 bits, then retaining the 4 least significant bits of that result.


Circuit with Contradiction

Question: What would happen in real life if you made a paradoxical circuit (a circuit whose output is on iff its output is off). Something like this:

Would the discrete model break down and the output end up being analog? Would something else happen?
Comment: This is the basis for clocks.  Output depends on propagation delays of components. Depends on an odd number of inversions.  Many ASICs connect unused gates on the chip together to form a free running oscillator, which can give an indication of doping process.
Comment: It is likely to settle at half-on and half-off, because these gates are really analog circuits.
Answer: If the switch is ON then the OR gate output will turn on. The NOT gate will not affect the OR gate.
If the switch is turned OFF (having been on) then OR will turn off which turns NOT on which turns OR off again and the cycle repeats.
The speed of oscillation will be determined by the propagation delay of the gates.

Would ... the output end up being analog?

Actually, all digital circuits are analogue in that there are ranges of input voltage level which will give a logic 0 and logic 1. The outputs will have some maximum slew rate so that with a suitably fast oscilloscope you can see the rise and fall times.
In this case you might observe that the logic levels do not quite reach the supply rails before being switched the other way.

Figure 1. A CircuitLab simulation. (You can try this out on  Electronics StackExchange.

Figure 2. The results of the CircuitLab time-domain simulation indicate that it will oscillate with a period of 40 ns (25 MHz).
I have no idea how accurate the CircuitLab models are or what logic family they're based on but it gives you an idea of the likely result.
In practice we don't build oscillators like this because of the lack of control of the frequency. With the addition of a resistor and capacitor a predictable time delay can be generated and a more stable frequency generated with less variance with temperature and voltage fluctuations.
Comment: Another problem trying to build this with no timing resistor and capacitor is that if you use CMOS gates for example, they may simply "lock up" with the input and output half way between the power rails. That is bad news, because in that condition the power consumption is high and might be high enough to overheat the chips. FWIW a "ring" of 3 NOT gates with RC connections between them (and a phase shift of 120 degrees in each RC circuit) will make a well-behaved oscillator, if you don't need high accuracy or stability in the frequency.
Answer: In actual world, realization of the logic is not absolute binary.
The circuitry is used in actual world, often with additional parts, because of the "negative feedback" nature, but nothing about paradox. The usage depends on the physical characteristics of the devices and parasitic around the circuitry. The operating speed (sensitivity & delay) is interpreted to Gain and Phase. Thus, the circuitry can be an Oscillator or Amplifier. OR-gate in your illustration works as a "gating"/"enable"/"additional gain"/"delay insertion".
Amplifier

Oscillator

Circuit with Contradiction


linkedin API framework 403 error for searches in PHP

Question: I'm using this linkedin api framework I found online which was extremely helpful but this issue I'm having is I'm able to access the information in my account after I login and am redirected to the demo.php page but there's a facebook employee search that is returning a 403 Access denied.
linkedin site says that i don't have access or that the throttle is full.  I can see it not being able to access it because it can't read my oAuth code.
After doing a var_dump on the variable that I want to echo, it's returning a null.  My guess is that it's not reading the authorization but when I var_dump the $linkedin variable, the oAuth is there.
Like I said i'm able to get output when it comes to my profile but when I try to make other calls, that's when the error arises.
If it helps I had to put CURLOPT_SSL_VERIFYPEER, flase to the code in order to access the login page.
everything works fine except this one thing.  The login, the redirect and me being able to access my own information.
Any thoughts or suggestions?
Thanks
Edit - I just tried out the simple-linkedin and I'm still getting the 403 error.
So it's got to be the permission.  In all the demo pages they are able to access this information, how come I can not?  I login, even people in my contacts I can't search.
Figured it out.  in the linkedin.php file, you have to modify the '= $this->base_url . "/v1/..."
to what you are looking for.
Hope this helps with someone.
EDIT-------I'm still getting the 403 error when I try to search people.  Can someone explain why this is happening and how other people are able to access this information.
this is the line that i'm using :
http://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,picture-url,headline))
Answer: From the asker's edit to his original question:

Figured it out. in the linkedin.php file, you have to modify the '= $this->base_url . "/v1/..." to what you are looking for.
Hope this helps with someone.


Reference request for books and papers that defend necessitarianism

Question: I am someone who believes that only the actual is possible, that everything that is, is necessarily the case. I believe that position is a strong form of actualism, often called necessitarianism. I know it is not a very popular position among philosophers. But I wonder, what are some texts and books and papers that defend necessitarianism? I ask because I think necessitarianism has some unwelcome or at least unintuitive implications in my view. Some such implications are: that every true statement about the physical world is a law of physics, and that modal scientific definitions are vacuous. I would be especially interested in some texts that both advocate necessitarianism while at the same time preserve our intuitions.
Comment: "Necessitarianism" is a dated term that is mostly used in historical contexts today (as applied to [Spinoza](https://plato.stanford.edu/entries/spinoza-modal/), for example). The currently most defended form of  necessitarianism is hard determinism. Arguments for/against it are [reviewed by SEP](https://plato.stanford.edu/entries/determinism-causal/#StaDetPhyThe), as well as how chance/probability and natural laws fit with it.
Comment: See also [Actualist Responses to the Possibilist Challenge](https://plato.stanford.edu/entries/possibilism-actualism/#ActuRespPossChal), and PhilPapers bibliography of [Necessitism and Contingentism](https://philpapers.org/browse/necessitism-and-contingentism).
Answer: Necessitarianism has more than one sense. In a general sense it means that everything that is true, or everything that happens, could not be otherwise. In the philosophies of the continental rationalists, this is related to the principle of sufficient reason. It is also understood to be in opposition to libertarian theories of free will. The classic defenders of this position are Spinoza and Hobbes.

Hobbes, Of Liberty and Necessity, 1654.
Spinoza, Ethics, 1677.

Some philosophers defend a version of necessitarianism under which all the laws of nature are necessary and hence hold in all possible worlds.

Brian Ellis, Scientific Essentialism, Cambridge, 2001.
Christopher Swoyer, "The Nature of Natural Laws", Australasian Journal of Philosophy, 60: 203–223, 1982.
Sydney Shoemaker, "Causal and Metaphysical Necessity", Pacific Philosophical Quarterly, 79: 59–77, 1998.

In more recent metaphysics, necessitarianism has been applied to the doctrine that everything that exists does so necessarily. Timothy Williamson is an important defender of this position, which he describes using the phrase, "Necessarily everything is necessarily something".

Timothy Williamson, Modal Logic as Metaphysics, Oxford, 2013. For a shorter exposition of Williamson's position, there is a paper called "Necessary Existents" from 2002 on Research Gate.

Some other literature on this subject:

A.N. Prior, "Past, Present and Future" (Oxford: Clarendon Press, 1967), 149-151.
Alvin Plantinga, "On Existentialism", Philosophical Studies 44 (1983), 9-10.
Kit Fine "Plantinga on the Reduction of Possibilist Discourse", in Alvin Plantinga, J. E. Tomberlin and P. van Inwagen (eds) (Dordrecht: D. Reidel, 1985), 160-180.
Timothy Williamson, "Bare Possibilia", Erkenntnis 48 (1998), 257-273.
Timothy Williamson, "The Necessary Framework of Objects", Topoi 19 (2000), 201-208.
Christopher Peacocke, "Principles for Possibilia" Nous, Vol. 36, No. 3 (2002), 486-508.
Answer: There are two ideas, developed by two very different thinkers, which I don't think call themselves necessitarianism, but which I think I could make a coherent argument are necessitarian philosophies.
Max Tegmark's Mathematical Universe
Stephen Wolfram's Ruliad
I would argue these ideas are isomorphic to each other - synonymous but defined from different angles - so which you should focus on just depends on if you prefer to conceive of the universe as Mathematical or Computational. Go for the Ruliad if you prefer a computational model, and Mathematical universes, of course, if you prefer Mathematical.
These ideas both amount to something like the following: ANY universe which is mathematically definable, or algorithmically definible, DOES EXIST. Thus, everything that is "possible" as strictly defined by those criteria must exist - somewhere in the multiverse. And YOU exist in this universe, with me, because this universe is among the universes that are definable, and thus we exist because we must exist, as beings in a definable universe.
These ideas may not be exactly what you had in mind when you said 'necessitarianism', but I think they should be considered as qualifying philosophies. And I think they're compelling as well.
When it comes to ideas of physics in this universe that can be described as necessitarian, there are some interpretations of Quantum Physics that fit the bill, like Many Worlds and Pilot Wave Theory.


Peugeot 307 51 plate trailer hitch issues

Question: I have a Peugeot 307 it is a 51 plate. I have a trailer hitch on the back, was there when I brought the car. It doesn't have the electric plug in bit though is this difficult to get?
Comment: Welcome to Motor Vehicle Maintenance & Repair. I have reworded your question because when you say "tow bar", I believe you are referring to a trailer hitch (allows car to tow something). Keep in mind, because this is an international site, we would not know if it is expensive where you live.  Lastly, purchasing/shopping questions are off topic.
Answer: You should be able to find a wiring kit at any place that handles trailer hitches.
A vehicle specific wiring kit will plug directly into the vehicle wire harness without issue. No wire cutting is required. These are easy to use, but a little more expensive.
Universal wiring kits provide the same thing, except you have to splice into existing wires to make the connections. You will need more tools and have the vehicle wire diagram available to complete the work.


What is the best way to connect 3D printed parts?

Question: I want to print a model of an animal cell.
What I have so far: I managed to use different colors to print out the different parts of the cell.
My question is: what is the best way to connect plastic 3d printed parts?
Glue? Melted plastic? I need it to have a strong connection and not very visible when used well, and preferable dries fast.
Comment: I disagree with closing this topic. The problem is very specific to 3D printing because of the materials that are being used that are specific to 3D printing. For example, where do you find PLA plastics commonly used other than in 3D printing? So what's the best way to connect PLA 3D printed parts together? If you have a combination of PLA objects and ABS objects, what do you do? These are not questions that would come up in a non-3D-printing forum. A person doing 3D-printing needs these techniques as part of their toolkit - choosing the right glue / cement / epoxy is extremely relevant.
Comment: @TomvanderZanden When prints are too large, they need to be printed in multiple pieces.  To assemble them they must be connected.  Even though this connecting not because of size, I think it is a valid question.
Comment: I think it is on-topic, for the reasons @TonyHansen gives. However, "the best" makes it opinion-based and it might also be too broad. I suggest rewording it ("How to make a strong/durable connection") and specify the material used.
Comment: What printing technology and material are you using?
Comment: I am voting to close this question as off-topic, since it is not specifically about 3D printing: as it is currently worded it is just a question about how to (generally) fasten objects, and the fact that they are 3D printed is secondary. At the very least the question should specify a 3D printing process and material so answers can focus on that.
Comment: @EricJohnson My objection is that the question doesn't change if you leave out "3d printed". "How to drill a hole in a 3d printed part?" reduces to "How to drill a hole?" because the fact that it's 3d printed is irrelevant. The same goes for gluing, smoothing, painting, etc... Questions should make clear how the fact that the part is 3d printed is relevant.
Comment: Please, please, please! If you're closing as off-topic, please fill in a custom reason to explain why, *inside* the close reason box. This help everyone.
Comment: This question, I agree, if off topic, but very similar questions would be on topic.  The examples of gluing pieces together because of machine limits would be on topic.  The example of drilling a hole would be on topic -- I've drilled holes in 3D printed objects and it is NOT like drilling holes in other materials.  Because closely related questions would be on-topic, is there a middle ground?  Can we answer with 3D printing specific information and suggest that a further answer could be better found elsewhere?
Comment: Moreso, this question is, at least part, about what adheres well to the ABS plastics which is alot more specific to 3D printing.  Also not this is also "rapid prototyping".
Comment: I feel this is on topic, but as it is, it might be either too broad or too opinion based asking for a *best* over a broad range of materials
Answer: For ABS print, I recommend acetone. It is not a glue, but it will dissolve the plastic a bit and if you apply it to both connecting parts and push them together, they will stay connected after the acetone dries. However, it does not dry very fast and you have to be careful not to destroy the object.
For PLA I usually use regular super glue (Cyanoacrylate).
Comment: And you _should_ always have proper ventilation when working with acetone.
Answer: For ABS I use a gel super glue (Loctite is my current favorite), it seems to slightly melt the ABS parts together and makes for a great bond. A slurry of old scrap ABS and acetone also works well, though I find that it will evaporate even if left in a closed mason jar over time. The small nozzle applicator and the fact it doesn't seem to evaporate makes super glue the better choice for me.
The gel super glue works "OK" for PLA but I've had parts fail after taking a small tumble. I just started using this acrylic cement for PLA. It cures very fast but seems to slightly melt the PLA in the same way the ABS options do.
For internal seams I like to put a bead of "high performance" hot glue over the seam. It's just a bit flexible and seems to do a good job taking drops.
Lastly I really like (but haven't mastered) friction welding parts together using a Dremel. Matt Griffin at MAKE Magazine did a great write up on the technique here.
Comment: I second the friction welding suggestion. It creates very strong bonds. It takes a lot of practice though. Currently I limit my use to welds I can do that will end up hidden.
Answer: After doing the processes that hroncok described, the edges of the print can be finished with a 3D printing pen.  The pen extrudes filament as a regular print head does, but is hand held.  The filament can be extruded on the previous gap between the two prints.  It will melt between the two sides and can be finished to create a smooth connection point.