What is the definition of the moment of inertia tensor?

Question: I can find volume integrals for the moment of inertia in 2D and 3D, but is there a definition that works in an arbitrary number of (spatial!) dimensions?
Comment: Related: https://physics.stackexchange.com/q/303069/2451
Answer: I actually have no real idea, so this answer is kind of just me trying to talk through what the answer might have to look like.
What describes an orientation in $N$ dimensions?
You have an $N$-dimensional rigid object in $N$ dimensional space, and fixing $N$ points on it should in principle fix it in the space. You can take one of those to be the center of mass, later relaxing that; the other $N-1$ points can be characterized as vectors from the center of mass to their destination. Since it's a rigid body each of these vectors will not change in length but only in angle. Even then if you think about adding them as constraints, each one has a fixed angle with the constraints you've already added, so one starts with $N-1$ degrees of freedom for the first, then $N-2$ for the second, on down to $1$ for the last. So a rigid body in $N$ dimensions presumably has an orientation with $N(N-1)/2$ dimensions. In 2D this predicts that orientation is one-dimensional (just an angle), in 3D this predicts that it is three-dimensional (the vector $\vec \omega$), presumably in 4D it is 6-dimensional.
If that's correct then probably the right way to describe orientation in an arbitrary number of spatial dimensions is with an antisymmetric [0, 2] tensor $\omega_{ab}$. In 3D we have that a point at position $\vec r$ from the center of mass has velocity $\vec v = \vec \omega \times \vec r$ around that center of mass; in fact $\bullet\mapsto\vec \omega \times \bullet$ is precisely such an antisymmetric tensor, suggesting the analogue that $$v^a = g^{ab}~\omega_{bc}~r^c$$ in $N$ dimensions. (Of course your metric tensor $g = \operatorname{diag}(1,1,\dots 1)$ in Cartesian coordinates so you do not have to maintain the Einstein summation convention as such if you want to be sloppy, but I will endeavor to not be sloppy here.)
What about angular momentum?
The angular momentum meanwhile is I think something more than just an antisymmetric tensor, as $\vec L = \vec r \times \vec p$ would seem to generalize to $\epsilon_{ab\dots yz} ~r^y ~p^z$ which gets complicated because the orientation tensor $\epsilon$ has valence $[0,N]$ in $N$ dimensions, so in 2D it's just $\epsilon_{ab}$ but in 3D its $\epsilon_{abc}$ and in 4D it becomes $\epsilon_{abcd}$.
This suggests that the true moment-of-inertia tensor, which must generate a $[0, N-2]$-valence angular momentum tensor out of a $[0, 2]$-valence orientation, is a $[2, N-2]$-valence tensor, and that would make it very hard to give a perfect formula. But most of its components appear to simply be shuffled around by the orientation tensor so maybe that's inessential and there's just a $[4, 0]$-valence tensor sitting underneath there? If so one would expect to define a "pre-angular-momentum" tensor $P^{ab} = \frac12\big(r^a~p^b-r^b~p^a\big)$ or so, expecting that any symmetric part gets destroyed by the orientation tensor anyway when we form $L_{a\dots x} = \epsilon_{a\dots xyz}~P^{yz}$.
How would that answer your question?
If all of that hand-waving reasoning is right, then putting those two expressions together with some mass density $\rho$ and momentum density $p = \rho~v$, one would find that
$$P^{ab} = \int_{\mathbb R^N} d^Nr~\rho(r)~\frac12\left(r^a~g^{bc}~\omega_{cd}~r^d - r^b~g^{ac}~\omega_{cd}~r^d\right),$$ and thus that there is a $[4,0]$-valence moment of inertia tensor that looks like $$P^{ab} = I^{abcd}~\omega_{cd},\\
I^{abcd} = \frac12~\int_{\mathbb R^N} d^Nr~\rho(r)\left(r^a~g^{bc}~r^d - r^b~g^{ac}~r^d\right).$$
Comment: This doesn't quite agree with equation (A2) in https://arxiv.org/abs/2207.03560, which has a couple additional index permutations.


What happens when you create/edit a menu

Question: I need to know this for a plugin I'm developing: What happens when a user creates a menu, add/remove menu items in the admin, what updates are made in the database, what  tables/columns are affected?
Answer: I just got into the database after trying this myself, so beware of inaccuracies. I'm also assuming the database-prefix is wp_.
What I found was that a refrence to the menu itself is stored  in both wp_termsand wp_term_taxonomy. The one in term_taxonomyalso stores the number of elements in the menu.
The relationships between menu items and posts are stored in wp_term_relationships as refrences to post_id's and taxonomy_id's. I hope this was somewhat helpful.
Comment: Yeah, thanks. That means I can programatically create a menu by inserting into wp_terms and wp_term_taxonomy, which I did.


BJT biasing and operating points

Question: What exactly is the definition of an operating point in the context of Bipolar junction transistors. What is their physical significance? I was going through few books on electronics and found that a load line is drawn (Linear relation between collector emitter voltage and collector current) and the point of intersection  with the output characteristics provides us with the operating points. Why is it necessary  to  fix the operating point in the linear part of the output characteristics so as to operate the transistor as a D.C. amplifier?
Answer: Re: Why is it necessary to fix the operating point in the linear part of the output characteristics so as to operate the transistor as a D.C. amplifier?
The AC signal can be regarded as a waveform superimposed on the DC operating point, causing positive and negative displacements from that middle position.
The operating point is chosen so that there is maximum "headroom" in either direction before the onset of clipping. If the operating point is too close to saturation or cutoff, then that limits the amount of gain that can be achieved prior to the onset of distortion.
The middle point of the load line is chosen because it is the middle point, not because the behavior is linear there. It's not really any more or less linear than away from the center.
A transistor isn't precisely linear. The use of negative feedback makes the amplifiers (more) linear. If you want a linear device with, say, a voltage gain of 100, then you cascade two "swamped" common emitter stages with gain 10, rather than a single stage with gain 100.
Note that, for instance, in class AB push-pull amplifiers, the biasing is different. The quiescent point is such, in fact, that both transistors in the AB stage are close to cut-off. Considered individually, the behavior of each transistor is very nonlinear because it amplifies only half of the signal! And yet, the amplifier stage as a whole is linear.
You have been studying a particular kind of amplifier stage in those text books with particular biasing; that is not the full story. Have a look at other kinds of BJT topologies.
Answer: When using a transistor to amplify a AC signal, the output has to go both up and down from some center point.  You also want the output to be reasonably linear with respect to the input, unlike in switching applications.
To allow a transistor circuit to go both up and down from a center point, the transistor has to be partially on.  You turn it on more to go one way, and off more to go the other way.  Either way, some headroom is required.  The operating point is the choice of DC bias voltages and currents to keep the transistor in the partially on state.  For linear operation, you want this to be far enough into the linear range of the transistor so that it is still in the linear range when it gets turned off a little at one and, and not too far so that it has room to turn on more at the other end.
Answer: Look at the output load-line below. With the operating point set at 30mA, as the base current changes, we move between the blue traces and Vce & Ic change accordingly. If we were to choose 55mA as the operating-point (about 1V Vce), all the blue traces converge so that changes in base current have little effect on Vce or Ic.

BJT biasing and operating points


Alternatives to "Unknown error"

Question: What would you suggest as a better alternative from a UX perspective to "Unknown error" when the error is not found in the error registry?
Comment: Are you looking for an alternative statement? Such as "error is not found in the error registry"? Or something broader like a feedback form? Can you share some examples of you're looking for?
Comment: There is no such thing as an unknown error. It always has a code, a stacktrace or something similar. Unknown error is "It's not your business what we messed up". The helpful way is to communicate a bit of high-level information. Not "SELECT x FROM y failed", but still "Error getting data from the database". This will also help, when the user sends information about the error he's getting by mail, so you at least know "Its a error retrieving the information and not an error connecting to the db"
Comment: What issues do you have with "unknown error"? What issue are you trying to address?
Answer: Here's a few example from other companies:

Google: "An unknown error has occurred. Please try again later"
EA: "EA Desktop encountered an unknown error. Try again a bit later"
Apple, Samsung, Meta: "An unknown error has occurred"

Considering that these companies with large UX teams use very simple error messages it might be best to follow their example and not try to change the wording too much.
Hope this helps!
Answer: Error messages should always be informative and actionable for the average user.
This means that your average user should be able to either fix the error based on what you tell them or be able to escalate the issue to someone who can fix the error.
In the case of known errors, we should tell the user exactly what the problem is and what steps they need to take to fix the issue.
In the case of an unknown error, there may be steps we can offer the user ("turn it off and on again") or there may be nothing we can tell them beyond the fact that there is a problem.
At these times you need to be able to fall back on your product/corporate "tone of voice". This should tell you when you can say "Oops, something went wrong!" or when you should say "Sorry, there is a problem." - These two both mean the same thing but say it in different ways.
The way we use microcopy helps our users to engage with the product on a more personal level but we must choose our tone of voice wisely: Being too formal or not formal enough can actively disengage users. A piece of medical software that says "Oops" implies a level of carelessness that very few users will be comfortable with. On the other hand, an entertainment website that says "danger!" sounds like something much more involved than a user should expect.
Another thing we could do is to offer the user a way to escalate the issue. Adding a "Report this error" function to the page can go a long way to making the user feel more confident that someone actually cares about their experience. If this is not entirely possible (due to engineering overheads for example), then just telling the user that the event has been recorded and will be investigated (using the correct tone of voice) could be enough to prevent a serious drop-off.
Finally, when there is an unknown problem, we need to offer a path back to safety. This could be as simple as a link to the home page or something more complex like returning to a previously stored state.
Answer: Depends on the context and importance of the action that failed. If its a end action (shoping cart, registration etc) -> Then any sort of redoing the action, or contacting support in a quick way could be offered.
If its something unimportant it can be just link to redo it or to homepage.
For the error self neat tone like "Something went wrong and we're on it" should be sufficient.
Answer: What is your context of use? The solutions will depend on this context. Do you have examples? Can you be more precise?
A good thing to do is to give feedback to the user to help him do his action. So you can think about a generic sentence that explain why the system does not respond to the specific action.

Alternatives to "Unknown error"


Techniques for hiding slight gaps in joinery

Question: I have a slight gap in a mortise & tenon joint. anyone have a cover-up or fix for slight gap in joinery?
Comment: Presume the piece can't be taken apart to actually fix it? And is the gap at the shoulder line?
Comment: yes, and yes. I'm thinking of putting glue in the gap and then some sawdust i saved from sanding. thoughts?
Comment: Yes that can work, but best results are not achieved using regular wood glues. I'll put in an Answer in a short while.
Answer: Obviously the best solution here is to avoid the gap in the first place by careful test-fitting of joints prior to final glue up and then during final assembly using sufficient clamp pressure to close up joints to their full extent.
When you do get a gap (and everyone does on occasion!) there are of course commercial wood fillers, but it seems the commonest solution given on the Internet is to use a mix of sanding dust from the same species and glue. I wish it were that simple but see this previous Answer:
Making wood filler from sawdust
As I covered previously, despite claims to the contrary this is almost never a good colour match to the surrounding wood unless you use hide glue. But if you were you'd be unlikely to have a gap like this in the first place since, unlike with other glues, the joint could be opened with careful application of heat and moisture and then the cause of the gap fixed.
Helping to prevent gaps at the shoulder in future

Slightly undercut your shoulders by paring with a sharp chisel.
Make your mortises a fraction deeper than the tenon is long (also provides a glue reservoir to prevent all excess being squeezed out when you clamp up).

Don't apply too much glue as this can cause a hydraulic seal in the joint which can physically prevent the tenon going fully home. You do however need to ensure you use enough adhesive so that all glue surfaces are fully wetted.
Comment: To go with "don't apply too much glue" and "make the mortises deeper": no need to apply glue to end-grain surfaces. Including the end of the tenon, and the end grain on the shoulders. Glueing these surfaces confers little additional strength and it makes a mess!
Comment: @init_js, yes, I've seen few people who put glue on the shoulders..... deliberately at least, some glue does tend to get on those surfaces unintentionally of course :-) As for the tenon's end, it's often well clear of the bottom of the mortise, and that surface is usually quite rough to put it mildly, so only if you were using epoxy and applying enough to fill the voids in the joint would you get any hold there worth nothing.


Do I need a transistor if my relay has an optocoupler?

Question: I'm looking to use this relay  with my arduino. It has an optocoupler and correct me if I'm wrong but this should prevent any back EMF from affecting my arduino. Do I still need to use a transistor?
Comment: I'm voting to close this for inactivity. Since it has been two weeks after a good answer and we haven't heard anything of the (relatively new) person who asked the question. So the question is likely to be abandoned.
Comment: I'm not sure why everyone wants to close this question as off-topic. But driving relays (especially relay boards) with an Arduino is, in my opinion very on topic.
Answer: That isn't just a relay you are linking to. That's an entire board that, among others, contains a relay (blue box). This board already has a transistor to drive the coil inside the relay. It also has a diode to handle back EMF.
It even has a opto-coupler, thought that isn't that useful as in most cases both sides of the opto-coupler are powered by the same 5V coming from the arduino.
Answer: Gerben is right. That is a complete board, not a relay. I have used some of these and they do not require a transistor to drive them (although you could use one if power output from the ports are a concern).
I beg to differ from Gerben, as the optocoupler isolates the pin from the driving circuit (even if it does not isolate the regulator) it still retains much of its safety characteristics.


Why don't we use cascoding in RF amplifiers?

Question: I need to design an RF amplifier with high gain. It seems every RF book teaches cascading, but not cascoding. Is there a disadvantage to cascoding? It seems like we don't need to match impedances with cascoding, making our lives easier.
Comment: Cascodes are pretty common for high frequency bands (10 - 40 GHz). Often the parts are sold as "travelling wave" amplifiers rather than cascode amplifiers.
Comment: They are also popular at HF (like 1-30 MHz), and in IF amplifiers.
Answer: You do need to match input impedance with cascoding because the emitter, as an input can be very low (circa 10 ohms or less). Also, RF amplifiers do tend to use cascode configurations and I've certainly designed a cascode input in a couple of designs. I'm thinking of professional metal detection products, radios and photodiode amplifiers.
It seems trite to mention the disadvanges because these are largely down to the circuit not being applied for the right reason so, the main advantage is the first transistor's miller capacitor has very little effect (no negative feedback) because the collector is held constant by the 2nd transistors emitter.
Answer: I think cascode is great .I use a  MPF 102   JFET      on the bottom and a BJT on the top . When the supply volts is 12V I use a BC547 for the BJT . For higher supply voltages such as found in Valve radios I use MJE 340 on top .                       It has been stated that a disadvantage is the need for a higher supply voltage .This can be got around by inverse cascode or other schemes .I have run inverse cascode with MPF102 and BC557 for a 6V supply  .                In the old days the need for two devices was a drawback due to cost .This just is not true anymore.


Online event in civievent

Question: How do you design an online event?
An online event needs the time to automatically reconfigure by the participant's location.
As an online event, the organizer's location is irrelevant. It may include several places (and thus time zones) with an organizing team.
More important location-wise is to indicate which online platform the event will be on: Zoom, Teams, GoogleMeet, something else...
Answer: Yes, timezones are critical to online events where you may have people participating from more than one timezone.
The bad news is that CiviEvent isn't timezone aware. You can certainly use links to the online platform of your choice, and lots of CiviCRM users do make use of CiviEvent for virtual events, but you'll want to specify the timezone in the title and/or text of the event to avoid confusion.
There are some timezone aware bits in CiviCRM, maybe most of them, but CiviEvents is tricky and an earlier attempt to fix it failed.
https://lab.civicrm.org/dev/core/-/issues/2122
Answer: Likewise, CiviEvent doesn't itself know what platform you're using - you have to put the event information in the description and the email sent out (unless you're using an extension that is connected to your event platform).
I use a Drupal webform to handle the registration process and in the email sent out specify the time and link.

Online event in civievent


Reduced resultant of monic polynomials

Question: Let $f(x)$ and $g(x)$ be coprime monic polynomials in $\mathbf{Z}[X]$ of positive degrees $m$ and $n$ respectively. It seems that in this case their reduced resultant can be obtained from the expression $uf + vg = 1$ over $\mathbf{Q}[X]$ with $\deg u < n$ and $\deg v < m$. Namely - reduced resultant in this case is the smallest natural $D$ such that $Du$ and $Dv$ are in $\mathbf{Z}[X]$? For the notion of reduced resultant see: this MO question of Felipe Voloch. Shortly it is the generator $D>0$ of the ideal $I=(f(x),g(x))∩\mathbf{Z}$.
Comment: Are you asking the same questions as in here: http://mathoverflow.net/questions/17501/the-resultant-and-the-ideal-generated-by-two-polynomials-in-mathbbzx ?
Comment: Yes, about that notion - the reduced resultant
Answer: The ideal generated by $f$ and $g$ in ${\bf Z}[x]$ is the set of all $uf+vg$ with $u,v$ in ${\bf Z}[x]$.
Now suppose $uf+vg=d$ for some integer $d$. Assuming $f$ and $g$ are monic, we have $$v=fq_1+r_1,\qquad u=gq_2+r_2$$ with $q_i$ and $r_i$ in ${\bf Z}[x]$, $\deg r_1<\deg f$, $\deg r_2<\deg g$. Then $$fg(q_1+q_2)+r_2f+r_1g=d$$ But $\deg (fg)>\deg(r_2f+r_1g)$, so we must have $q_1+q_2=0$, and $$r_2f+r_1g=d$$ It follows that the smallest positive integer in the ideal generated by $f$ and $g$ (that is, the reduced resultant of $f$ and $g$) can be expressed as $uf+vg$ with $\deg v<\deg f$ and $\deg u<\deg g$.

Reduced resultant of monic polynomials


Which algorithm is used by Google Maps to estimate travel time?

Question: I am able to find the sources of data used by Google Maps for travel time estimation but what is the actual algorithm used by Google Maps to calculate estimated travel time?
Answer: The algorithm to estimate travel time, according to this Forbes article, is based on various things which include:

Official speed limits and recommended speeds, likely speeds derived
  from road types, historical average speed data over certain time
  periods (sometimes just averages, sometimes at particular times of
  day), actual travel times from previous users, and real-time traffic
  information.

The actual algorithm though is a trade secret.


Issue with wp_insert_post when modifying permalinks with ".html" extension

Question: I'm trying to obtain for products and products category the following permalinks structures:
https://mm.mtgeeks.com/product-name.html
https://mm.mtgeeks.com/parent-category-name.html
https://mm.mtgeeks.com/parent-category-name/subcategory-name.html
In order to obtain this I have modified the permalink using the following filters and actions:
<code>add_filter( 'request', 'change_requerst_vars_for_product_cat' );
add_filter( 'term_link', 'term_link_filter', 10, 3 );
add_filter( 'post_type_link', 'wpp_remove_slug', 10, 3 );
add_action( 'pre_get_posts', 'wpp_change_request' );
add_action( 'create_term', 'mee_new_product_cat_edit_success', 10, 2 );//fix 404 errors
add_action('init', 'mee_product_category_rewrite_rules');
add_action('wp_insert_post', 'mt_woo_new_product_post_save');//fix 404 errors
add_action('init', 'mt_woo_product_rewrite_rules');
</code>
After updating the permalinks from the wordpress admin, on the frontend I obtain the needed permalinks structure, but on the backend I have only one issue.
When trying to do modifications to products I get the following message displayed by google chrome:
"This page isn't working mm.mtgeeks.com is currently unable to handle this request.
HTTP ERROR 500"
After doing some debugging in the wordpress core, I have observed that the product updating process remains blocked in the function wp_insert_post from wp-includes/post.php at line 3962 (do_action( 'wp_insert_post', $post_ID, $post, $update );)
How can I fix this issue? For which purposes is this line of code used?
I've observed that if this line of code is commented out, the updating process is working correctly.
Answer: Hmm, I would use the Permalink Manager Lite plugin (free).
or it's PRO version ($39): https://permalinkmanager.pro/
Makes life easier :)

Issue with wp_insert_post when modifying permalinks with “.html” extension


Can not repeat in-app-purchase we build in the Android app

Question: I have used Android in-app-purchase in my app. When I test buying the item, the first time is OK, but for the second time, the UI only shows the account name, no CreditCard info. On the center button, it shows "accept & download". But if you press button, nothing happens. Could sombody tell me what is wrong?
Answer: The item the you bought is probably a managed item. Search for "Purchase Types" in http://developer.android.com/guide/google/play/billing/billing_overview.html#billing-types for more information. So, the second time you try to buy it Google Play won't let because you already bought. Nothing happens because Google Play cannot force your app to initiate a download of the already bought product. I'm not sure but I think that a PURCHASE_STATE_CHANGED broadcast Intent is not sent when the a person press the "Accept & Download" buttom.
To avoid this situation you can either use an unmanaged product (unfortunately you cannot change your existing product to unmanaged), or you can make the buy button disappear once it item is bought. In the later case you might also want to use RESTORE_TRANSACTIONS in the case the app is reinstalled.


Is there any way to use a JTAG programmer with the Arduino IDE?

Question: I am doing a lot of work with custom boards I've designed with the ATSAMD21G. I'd like to get away from using USB to program my boards since the USB port takes up space on the PCB and consumes extra pins. Is there any recommended way to configure the Arduino IDE to simply dump out the compiled program into a JLink debugger, much like the Atmel Studio IDE can?
Answer: For a one-click upload, you can make a custom hardware definition that calls any executable of your choosing.
Answer: The IDE makes a .hex file which you can then program onto your chip with a suitable programmer.


Can I as a programmer depend on elementary OS Loki instead of Windows 10 as single boot?

Question: Can I as a programmer depend on elementary OS Loki instead of Windows 10?
Should I uninstall Windows 10 and use elementary OS Loki as my default OS for web & application programming?
Comment: I use it as my primary development platform and it only boots elementary. As long as you're not doing any Microsoft development or any development that requires Visual Studio, you will be well equipped on elementary.
Answer: It depends on the tools you rely on and their dependencies. Elementary OS should be fine for web development as the tools you need will only be a few installs away. You also don't need to worry much about compatibility with Microsoft's native browsers like Edge and IE as Microsoft is generous enough to provide minimal VirtualBox images for free without the need for rebooting to a full Windows installation just to test a website.
If you're using Node.js or similar cross-platform tools to build your applications, you can probably forgo Windows.
If you need to develop games or applications that needs to be also available natively on Windows, I suggest keeping the Windows 10 for compiling and testing your builds.


Up-to-date documentation on how to create metadata for fungible token program?

Question: We are trying to deploy our token (AIDS) on mainnet: https://explorer.solana.com/address/ExCgGC6CEegjjif7yqxpcreEaarb83K8YaXzmf3PRWAZ . When we are trying to create metadata for this token, we cannot find up-to-date methods and documentation, in general. Can someone point us to up-to-date documentation and examples on how to create metadata for a fungible token on mainnet?
Answer: Sure:
Solana Metadata Pointer - newer, with less fees, but less widely supported.
Metaplex token metadata docs - older and more expensive, but more popular.
Answer: I have created a tool to create tokens (or add metadata to an existing token), if you want to use it :)
https://token-metadata.effe2.xyz/
Feel free to contact me on my twitter account if you have any problem using it


IKEv2 in remote access scenarios

Question: Can someone explain why, in remote access scenarios, IKEv2 EAP password-based user auth combined with IKEv2 PUBKEY gateway auth is preferable over mixed IKEv2 PSK/PUBKEY auth using the same password on the user side and the same certificate on the gateway side?
Comment: Is it because IKEv2 with PSK is vulernable to active PSK sniffing attacks? But strong PSKs are resistant to MITM attacks.
Comment: No, the PSK is exchanged using a secure key agreement mechanism.
Answer: There are a few reasons why EAP is preferred over PSK:

PSK requires the use of a (relatively) low-entropy password, which is (relatively) easy to bruteforce.
PSK requires the passphrase to be stored on the server, which may result in key theft.
EAP allows clients to authenticate using different credentials in each direction, so a server might authenticate itself to the client with a completely type of credential than the client uses to authenticate itself to the server.
EAP allows clients to authenticate using their own digital certificate, which is much more secure than a password. The user just has to unlock their certificate (or certificate store) using their password on the local device.
IKEv2 supports EAP-only authentication, which theoretically allows any form of add-on authentication mechanism to be used.
Comment: @Moo I'm not exactly sure on the specifics. I would imagine that you could hash the password on the server side, but I'm not exactly sure what hash functions / key derivation functions are supported. There's no length limit that I'm aware of on the PSK, but the point is that the entropy of a password is _much_ lower than that of a certificate. To gain 256 bits of entropy, you need 43 perfectly random upper/lower alphanumeric characters to represent that randomness as a password. Rather difficult to remember!
Comment: is the passphrase stored in cleartext on the server or just the hash of it? what do you mean with add-on authentication mechanism?
Comment: does a length limit for PSK exist or why does it REQUIRES the use of a realtively low entropy password?
Comment: The bolt-on authentication mechanisms are anything you like. It's designed such that you can implement your own authentication tokens, as long as both your client and server applications support it.

IKEv2 in remote access scenarios


Resize/position canvas in a custom SurfaceView (Android)

Question: I'll try to short my question:
I'm trying to make a little game and got a class inheriting SurfaceView, and also a class with a Thread which will handle the SurfaceView's Holder.
In the thread loop I lock the Canvas I get from the Holder and the I call the methods update() and draw() inside the SurfaceView class.
The canvas represents everything on the screen. Now that's my question:
Is there any way to resize the canvas (maybe using Matrices as we do with Bitmaps) and then position it?
If you ever wanna know why, it's because the "target screen" I'm working has to be of a specific ratio, so, depending on the actual screen size I would have to resize the canvas and reposition it.
Thanks in advance!
Answer: Never mind, I just had to apply the matrix to scale and translate to the entire canvas.


Why do you need more energy to return an object to ordered state?

Question: Someone said that you need more energy to put together broken glass than it took to shatter it. But wouldn't we be creating energy in such a closed system?
Comment: At zero temperature, the energies would be the same. For finite temperature, the second law of thermodynamics says that there must be some heat associated with the entropy and the temperature. I think this is what "someone" meant.
Comment: @marius I don't understand why you don't add that as an answer? Why not? I would have upvoted?
Comment: Sorry, I did not have time to post something detailed and what I wrote seemed a little shallow to me. Please see my posted answer.
Answer: The reason you need to supply more energy than was used to shatter the glass, is that a macroscopic piece of glass is subject to the laws of thermodynamics. Remembering that the definition of temperature is given by the derivative of the internal energy wrt. entropy,
$$ T := \frac{\partial U}{\partial S} $$
this leads to the classical formula
$$ dQ = T dS $$
where $dQ$ is the heat generated by the change in entropy $dS$ at temperature $T$. Note at zero temperature, the energy of restoration would have been the same as shattering. But at finite $T$, there is always some heat, and that energy has to come from somewhere.
Comment: So isn't it a bit of a misnomer? Heat remains thermal energy in a closed system, so we just use that same amount of heat to "glue" the glass.
Comment: No, if we could do that then we would be violating the second law of thermo. The heat is generated when we interact with the glass from "the environment", because we have to interact from outside the glass system in order to repair it in the first place.
Comment: @Marius Ladegård Meyer, I do not quite understand what kind of change in entropy $dS$ is involved? Or do you think the process of breaking a glass on macroscopic pieces is similar, for example, to evaporation?
Comment: @Marius but what if we were already part of the glass system? For example, what if we shattered it with a hammer?
Comment: @JosseCalderon I don't understand this commemt. You shatter glass by interacting with the glass system and the external hammer through a non-spontaneous process.


Do I need an airport transit visa in Dublin when flying from the US to Manchester, England (US citizen)?

Question: I'm originally from Nigeria. I have a US passport. Do I need an airport transit visa at Dublin when flying from the US to Manchester in UK? I also have my Nigerian passport.
Answer: US citizens do not need a visa to fly into Ireland or the UK as a tourist, in general, so you will not need a visa to transit Dublin.  Just be sure to use your US passport.  (Nigerian citizens very likely need a visa.)
Comment: @SisterAgatha Indeed, do not present your Nigerian passport unless asked for it, because you'll need a visa if you use it.  If the immigration officer asks if you have other citizenships, of course, answer honestly.  But you must enter as a US citizen to avoid needing a visa.  (There may be some visa-free transit possibilities even with the Nigerian passport, but using the US passport will save you having to investigate this.)
Comment: @JimMacKenzie Indeed, Nigeria is on the very short list of "Appendix 1" countries that require a separate Irish visa to transit Ireland even when holding a UK visa in the British-Irish Visa Scheme. The situation was supposed to be repaired by now, but I think the British and Irish governments have been busy with other matters...
Comment: So I will not need to present my Nigerian passport then?


How to load & deserialize a token account in anchor?

Question: I want to load & deserialize a token account which is inputted as AccountInfo<'info> into an anchor program
Comment: The data contained within an `AccountInfo` is just raw bytes that can be interpreted in many different ways.  You may want to narrow the scope of the question to something specific that you're trying to deserialize, e.g. a token account, or a mint account.
Answer: Anchor has a try_from method implemented for all anchor accounts and for some special accounts, like the spl token program accounts.
Loading a regular anchor account struct called OpenOrders looks like this
let mut user_open_orders: Account<OpenOrders> =
                    Account::try_from(user_account_info)?;

When trying to load one of the custom structs, you can check the anchor source for SPL tokens. TokenAccount implements the required traits, namely AccountDeserialize so try_from should also work here. Though I haven't run this code.
use anchor_spl::token::TokenAccount;
...
let mut this_token_account: Account<TokenAccount> =
                    Account::try_from(token_account_info)?;

Answer: Here's how Account does it:
pub fn try_from(info: &AccountInfo<'a>) -> Result<Account<'a, T>> {
    if info.owner == &system_program::ID && info.lamports() == 0 {
        return Err(ErrorCode::AccountNotInitialized.into());
    }
    if info.owner != &T::owner() {
        return Err(Error::from(ErrorCode::AccountOwnedByWrongProgram)
            .with_pubkeys((*info.owner, T::owner())));
    }
    let mut data: &[u8] = &info.try_borrow_data()?;
    Ok(Account::new(info.clone(), T::try_deserialize(&mut data)?))
}

so your implementation might be something like
pub fn deserialize<T>(info: &AccountInfo<'a>) -> Result<T> {
    if info.owner == &system_program::ID && info.lamports() == 0 {
        return Err(ErrorCode::AccountNotInitialized.into());
    }
    if info.owner != YOUR_PROGRAM {
        return Err(Error::from(ErrorCode::AccountOwnedByWrongProgram)
            .with_pubkeys((*info.owner, YOUR_PROGRAM)));
    }
    let mut data: &[u8] = &info.try_borrow_data()?;
    Ok(T::try_deserialize(&mut data)?)
}

Comment: It's possible to just call `try_from` directly rather than reimplementing it. I posted a response showing how
Comment: thanks but how can i do it in anchor. so now I have AccountInfo<'info>. it is `TokenAccount` Account. how can I check the data?

for example:

`token_vault.owner` or `token_mint.decimal`
Comment: `let new_account_info = next_account_info(account_info).unwrap();
  let token_a_vault =  new_account_info.try_borrow_data()?;`

what should i do next?


Virtual box (5.x) add a USB bzw. serial device

Question: I installed ubuntu 14.04 LTS within oracle box version 5.1.8. In this system I installed Ros indigo. I then want to connect this pc to a roomba 521 (vaccuum cleaner with an open interface for controlling) via USB to MIN DIN cable. Next I launch a simple launch file to send some commands to the Roomba (This did not work, if I do this within oracle box).
If I type lsusb in a terminal I see:
Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
This is the Port or USB connection I want to use. Now my question:
(1) Do I have to setup a Serial or USB connection for the communication?
In case of a USB connection I already did the following:
1. Adding the USB device to the USB filters.
2. I also tried to FIX group permissions and installed:
gnome-system-tools (via Software Center)
-> then I went to users -> vboxfs and selected the USER
(as described in this tutorial)
3. I also installed virtual box guest editions
Adjusting a serial connection did not work for me yet. As virtual box is always giving me the following error after changing the Settings of my Ubuntu 14.04 machine as described here Takkat answer.
Failed to open host device 'dev\ttyS0' (VERR_PATH_NOT_FOUND).
I kind of cannot solve this error as even if I type dev**/**ttyS0 in the serial settings vm box is always changing it to ****. Does that even matter?
Additional Links:
http://answers.ros.org/question/243609/boostexception_detailclone_impl/
Answer: Finally solved the error when following this instruction here:
http://jjmilburn.github.io/2016/04/04/ttyUSB-to-vagrant-virtualbox/


Were the events in "Passion" really happening or a dream?

Question: I have just seen the film Passion (2012), and seriously, I don't get any of it. Wikipedia does not have a detailed storyline of the movie and other sites just have a review. I would like to know what the story really is — Is it a dream or really happening?
Answer:
Isabelle was at her last wits and her life was crumbling down in
front of her eyes as she killed Dani and since Dani sent the videos
she knew her life was over.
So in order to find justification in her actions and "relieve" her of
her guilt, she DREAMS of Clarissa (twin sister killing herself) kind
of like a full circle in the plot.
If that really did happen the way Isabelle dreamt it then she
would've been fulfilled in her guiltiness and finally freed from her
pain.
BUT as the twist ending shot shown, Isabelle awakens and finds
herself in the SAME situation that she left ----A murderer, a double
murderer now in deeper sh!$ because the videos the implicate her are
sent and she has no more tricks or ideas left in her bag.
and having to deal with that "REALITY" (real life) is going to be
even more pain and agony then she could've ever dream of.
now that is the real twist/theme to the ending.
Answer: It does seem pretty confusing from the plot descriptions on Wikipedia and IMDB, and even the trailer seems confusing. But, Wikipedia says the movie is really a remake of a French movie named Love Crime. The plot description of Love Crime on Wikipedia seems a lot more detailed and reads as follows:

Set in and around Paris, France, the story revolves around two women who work in a multinational corporation. Christine (Scott Thomas) is a cold, ruthless business executive who enjoys using and betraying people. Isabelle (Sagnier) is Christine's young, ambitious and intelligent administrative assistant who regularly suffers from professional and personal humiliations at the hands of Christine.
A subplot revolves around Christine's boyfriend, Philippe, who is cheating on her with Isabelle. When Christine discovers accounting irregularties in Philippe's business accounts with the firm, Christine threatens him instead of reporting him, hoping to use him to her own advantage.
Midway through the movie, Isabelle, after suffering one-too-many implied threats and humiliations by Christine, murders her by staging a break-in at Christine's suburban house and stabs her to death. Isabelle then implicates herself in the crime, a seeming sign of a nervous breakdown, when she allows herself to get arrested and incarcerated. At this point, the imprisoned Isabelle embarks on a quest to prove her innocence of a murder that she actually committed, but her defense may prove to be even more difficult than she anticipated due to her history with Christine and of the circumstantual evidence that Isabelle herself planted.

So based on what I've seen and read so far, the movie is not a dream.
Comment: This doesn't really relate to the specific plot of *Passion* at all, in particular the quite ambiguous ending that presents the most confusion. It only gives a rough rundown of the story of the original, but fails to mention the character of *Dani* (or any possible pendant of hers in the original), let alone what is and what is not truth at the ending, which is completely left out of the summary. Sure, the *whole* movie is not a dream, so much is pretty clear, but which *parts* of the movie are real or possibly a dream is absolutely not adressed here.


Statistical significance test between 2 partial correlations

Question: does anyone know of an appropriate analysis for testing for a significant difference between two partial correlations? For example, say there are independent variables X and Z and dependent variable Y. How might I test for a significant difference between the relationships of X on Y partialling Z and Z on Y partialling X? Could I just use the same formula as when comparing dependent correlations and use the partial correlation values? The formula I have found for comparing dependent correlations is as follows:
$$T_{difference} = (r_{xy} – r_{zy})\frac{\sqrt{(n-3)(1+r_{xz})}}{\sqrt{2(1-r^2_{xy}- r^2_{zy}- r^2_{xz}+2r_{xy}r_{zy}r_{xy})}}$$
Comment: One way to do this within a structural equation modeling framework (using, for example, the lavaan package in R).  The approach depends on whether the measures were taken on the same people or different people. If you post  a reproducible example then I (or someone else) might be able to help.
Comment: cannot read your equation. You need to fix it. Go onto another equation on this site and see how they are structured by right clicking on a selected equation and copying it.
Comment: I don't know much about this, but I wonder, why not just using multiple linear rigression with X and Z as covariates and Y as the outcome?
Answer: There are several calculators online that can perform this task for you. I would recommend the one by Preacher's group out of Vanderbilt. Note that the Steiger (1980) reference listed on the site suggests using a z-transformation prior to calculating the differences for small samples, which is different from the equation above. The reason for making this transformation is that correlations are not normally distributed statistics (as a result the $T_{diff}$ approach above can lead to increased type I error under conditions of smallish $N$s).
UPDATED:
After some additional searching it does not appear as though it is common to calculate the significance of partial correlations in the way described in the OP. I did find one reference in which the authors (Willis, Dodd, & Palermo, 2013) used William's $T_2$ to do so, however. The formula for Williams' test (slightly different from above) statistic is:
$$T_2=(r_{xy} – r_{zy})\frac{\sqrt{(n-1)(1+r_{xz})}}{\sqrt{2(\frac{n-1}{n-3})|R|+\bar{r}^2(1-r_{xz})^3}}$$
where
$$|R| = (1-r^2_{xy}- r^2_{zy}- r^2_{xz}+2r_{xy}r_{zy}r_{xy})$$
and
$$\bar{r} = \frac{1}{2}(r_{xy} + r_{zy})$$
It is important of course to note that based on the OP, it is not really the difference between $r_{xy}$ and $r_{zy}$ that is of interest but rather, $r_{xy.z}$ and $r_{zy.x}$. As I know of no methodological paper supporting the use of partial correlations in place of zero-order correlations when using the $T_2$ formula, I am hard pressed to advocate its usage here (even if other authors have published results doing so in a refereed journal).
Instead, I am more inclined to suggest an approach along the lines of the one @Jeremy Miles suggested in the comments above. Structural equation models have the ability of addressing this question in a fairly straightforward manner. For instance, using lavaan syntax in R, one could setup two regression models, one with the paths x --> y and z --> y constrained to be equal, and one in which the paths are freely estimated:
 mod1<-'
 y~a*x+a*z
 '
 fit1<-sem(mod1, data=your.DF)

 mod2<-'
 y~a*x+b*z
 '
 fit2<-sem(mod2, data=your.DF)
 anova(fit1, fit2)

If the constrained model is no worse than the unconstrained model in terms of data-model fit, then the chi-square difference test returned by the anova() function will be non-significant. Practically speaking that means that the two paths do not differ from one another. (Side note: this chi-square difference test should be the same as the model chi-square for model 1 - if the model becomes more complex, this basic approach can still be used, however it may be the case that the chi-square difference test and the model 1 chi square statistic are no longer equivalent).
In order to appropriately test the null hypothesis $\rho_{xy.z}=\rho_{zy.x}$, you will just need to make sure that x and z are on the same scale (standardized is probably the most obvious choice) prior to running the models above.
Steiger, J. H. (1980). Tests for comparing elements of a correlation matrix. Psychological Bulletin, 87, 245-251.
Willis, M. L., Dodd, H. F., & Palermo, R. (2013). The relationship between anxiety and social judgments of approachability and trustworthiness. PLOS One, 8(10).
Comment: That's the difference between two correlations though (isn't it?), not two partial correlations. A partial correlation has a larger standard error than a correlation (I think).
Comment: Hmmm... A very fair point. I think I focused more on the equation presented above than the OP's question. I will do some digging to see if I can come up with a more comprehensive answer. That being said the approach above, while not focused on partial correlations does "correct" for the fact that $X$ and $Z$ are correlated.
Comment: Based on my digging, I think your initial instinct to go an SEM route is probably the best considering the problem presented in the OP. I couldn't find much material on hypothesis tests for differences in partial correlations outside of more complex models.


Does installing a bunch of unnecessary fonts slow computers down?

Question: Several sites and blogs advise users to remove the excess fonts from their OS. Does this help in performance or is this just a myth? If it is true, why is that so?
Comment: Why is it these blogs suggest moving the fonts? That'd be a helpful point.
Answer: The reason that it is recommended is that Windows (at least, not sure about Mac and Linux) has to load font information on boot. Not only can this slow the boot process (though I don't think you would actually notice this on a modern computer) but, more importantly, each font requires an amount of in-memory storage. This is then no longer available to other OS processes and so can slow down the OS due to paging.
So on a modern computer with plenty of memory and a fast drive, you won't notice any difference under normal circumstances.
Answer: The main performance hit is not the fonts on their own, but the extended load times for applications using them (Word, Excel, Corel etc.).
Graphics-Unleashed
SourceDaddy
Comment: If you're not actively using the fonts, then why load them and consume system resources?
Comment: @da4 I'm not OT, I on my own have to develop and test software with different fonts, an since I've to use chinese for testing too, a few others won't harm me.
Answer: From my own experience, I have to say yes, installing many fonts will slow down a system. My own anecdotal evidence is as follows:
In early 2011, I wanted to see if there was any truth as to whether a lot of fonts slowed down a system. To test it out, I used FontFrenzy on a Windows 7 machine to unload all but the fonts installed with Windows 7 by default. In all, I disabled about 250 fonts I had accumulated. That being the only change I made, my boot time (from BIOS screen to useable Desktop screen) lowered by 6 seconds (from 50 seconds to 44 seconds). Programs like Word, Photoshop, etc. felt like they loaded faster (however, I didn't actually time them).
I don't recall the exact system specs, but it was an i5 machine running Win 7 Home Premium with 6GB RAM and a 750GB Caviar Green 5400RPM drive.
The problem with anecdotal evidence like this is that I'm sure that no one is going to have the exact software/hardware setup I had. However, for the one test I ran, it cut the boot time slightly by having less fonts.
Answer: Just an idea:
If you need many fonts sometimes, then you'd better to have those fonts in other folder like c:\my1 and make a symlink of those inside files into c:\windows\fonts.
Everytime you close Photoshop (or other software you need many fonts for), then you can just rename that folder to to C:\my2 (so, all those fonts will be delinked automatically from c:\windows\fonts).  And, whenever in the future you want to include all those fonts again (before you open Photoshop or etc), then rename the folder back to c:\my1,so the fonts will be resolved again.
Comment: A more practical implementation would be to create a batch file that renames the folder, launches the software, then renames the folder again when you terminate the application.  Use the batch file rather than the application executable to launch the software.
Answer: Yes it does, as windows reads all fonts on start up and must validate all fonts in:

C:\windows\fonts

before resuming start up.
If you install new fonts in windows, you will experience slower boot by windows.
That is why it is recommended that you only keep the main fonts in windows listed in this link and keep also fonts you are using in special editing software like Photoshop or CorelDraw, or installed software or games on your system that require special fonts.


Stuck in cardano node

Question: Running any cardano-cli command returns this error,Cardano-node is already running in another terminal,CARDANO_NODE_SOCKET_PATH is set in environment variable. Confirmed through echo. It leads to node.socket file white_check_mark eyes raised_hands
Comment: Did you update your terminal with `source ~/.bashrc`?
Comment: Verify that your current user can read the socket file with `ls -l $CARDANO_NODE_SOCKET_PATH`
Answer: As per my comment, verify that your current user can see the socket file with ls -l $CARDANO_NODE_SOCKET_PATH
The error that you see will be due to either:

The node is not running (but you confirmed that it is running so not that)
Environment variable CARDANO_NODE_SOCKET_PATH is not set for the current user (but you confirmed that it has a value)
CARDANO_NODE_SOCKET_PATH having a value that is different to the actual path of the socket file

Most likely is option 3 which could be due to a typo when setting CARDANO_NODE_SOCKET_PATH
Another possibilty is that the current user might not have permission to read the socket file, but the error normally states if there is a permissions issue so I don't think it's that in your case.

Stuck in cardano node


Legality of making a Custom Asset

Question: I would like to create a custom token but I cannot seem to find any dos and donts as far as legality goes with making one. Is it legal to just create an asset and start selling it or is there something I need to read over and follow before doing so? I am planning on making just a fun meme coin and build a community. Help is appreciated!!
Answer: It is legal to create whatever token you like.
What would be illegal pretty much everywhere is to advertise your token as a way of making money.  Make it clear that it isn't a get-rich-quick scheme or anything that could be construed as such.
You may get better legal information on https://law.stackexchange.com/ - we on tis site aren't lawyers.
Answer: Pretty much depends on your location and business case. You better ask an expert for financial law and a tax consultant in your jurisdiction.
If it's just a fun thing, you might consider simply distributing your tokens to your community for free, which should most likely not have any legal requirements at all.
Here is a basic overview for bitcoin regulations worldwide, I think those will also apply for stellar tokens: https://en.wikipedia.org/wiki/Legality_of_bitcoin_by_country_or_territory

Legality of making a Custom Asset


Difference between being at/of/in someone's service

Question: What's the difference between being at someone's service, of someone's service, and in someone's service?
Answer: This sentence should help clarify the differences between these:

The butler Mr. Dawkins, previously in the service of Lord Halsey as his valet, and having been of service to Lady Bucket by helping her find her lost Persian cat, said to Lord Bennett, "I am at your service, sir."

To be in (someone's) service means that you are employed by that person in some kind of service role.
To be of service (to someone) means that you have assisted or will assist them in some way.  It is not necessary for you to work in service to do this. Anyone can be of service to anyone else.
To be at (someone's) service means that you are offering (or someone else has offered) your (usually temporary) help to someone, in a formal and deferential manner.  Again, anyone can be at anyone else's service.
The use of the word "service" in all three relates to an older meaning of the noun, related to servant, a collective term for the various professions employed by a wealthy (or at least nominally upper middle class) family to do domestic tasks.  These included such jobs as butler, valet, housekeeper, maid, chauffeur, groundskeeper, footman, cook, etc.
This was much more common a hundred years ago than it is today.  Still, there are still many people who work "in service" -- but who are not called "servants", which nowadays is considered demeaning.  Instead they may be collectively referred to as "the help".
If you are "of service" you have helped someone in the way a servant would have done.  To be "at someone's service" is to offer your help as if you were their servant.  Neither is particularly negative, however, since the acts are presumably voluntary.
Note this does not include "customer service" or "food service" or any of the many jobs that interact with the public, nor does it (usually) include people who work in hotels, spas, cruise ships, and other temporary lodgings, which are considered part of the "hospitality industry".  While any of these may be "of service" or "at someone's service", I think they would not describe themselves as "in service".
At least not in the US.  It might be different in other countries.
Comment: Also from the UK and all looks good but I'd note that the phrase "at your service" is mostly a polite idiom that really doesn't mean very mean at all other than conveying respect. Saying "at your service" doesn't necessarily imply that you'd actually carry out services for the other person beyond anything already implicit to your position.
Comment: "_At least not in the US. It might be different in other countries._" All sounds good from my UK perspective.
Comment: @Rache Perhaps, bu  I think of these as "service **industry**" jobs rather than working "in service" -- which is a somewhat archaic but more dignified term for "professional domestic" type of jobs that require a somewhat different skill set, because they work with a specific household and not the public at large.  But I admit most of what I know about working "in service" I get from watching *Downton Abbey*.
Comment: I would argue that the hospitality industry does include these roles, since a hotel concierge is at the service of guests and hopefully of service to them, but in the service of the hotel itself
Answer: If you are in someone's service, you have some sort of duty, obligation or desire to serve that person.
The expression at someone's service is pretty much an idiomatic expression of the same thing, with perhaps a slight connotation that the service is more voluntary, as opposed to being some legal obligation. The expression at your service, in particular, is common enough that it might even sound a bit hackneyed or old-fashioned.
The expression of someone's service is not really idiomatic, but you may still find it in writing, in contexts such as "We have heard of your service in West Africa."
The Ngram is rather interesting as it shows how at your service is the most common, and was much more so a hundred years ago when it was more prominently used.
Comment: Hmmm, I don't think _"We have heard of your service"_ uses the prepositional phrase in the same sense as the OP intends to ask about. Maybe _"May I be **of service**"_ is closer to the mark.
Comment: @P.E.Dant - True, but the OP is asking about the phrase _of someone's service_, not _of service_.


Transition between 2D and 3D quantum systems

Question: Quantum Hall effect and anyonic particles are examples that occur in a two-dimensional system. However, experiments for such systems can only be realized in a pseudo-2D environment, where the third spatial dimension is much smaller than the other two dimensions. How do we expect the results from such experiments to differ from a true 2D system? In particular, how/when does an anyon begin or cease to exist when we transit between a 2D and 3D system?
Answer: The results from the experiment does not differ significantly from the "true 2D"  system, in fact, this is why experiments and theory agree so well!
Consider a semiconductor heterostructure GaAs/GaAsAl. At the interface, alignement of the Fermi level at both sides of the semiconductor crystals creates a triangular potential well at the GaAs side of the interface. This potential well is quite narrow so that quantization in one direction can be effectively assumed. In fact, putting numbers for GaAs, $m^{\ast}=0.067m_e$, $n_{2\text{D}} \simeq 10^{15}m^{-2}$, $\epsilon^\ast=13\epsilon_0$ you get that the typical quantization energy is $\Delta E \simeq 20 $meV.
Due to the triangular well, the $3\text{D}$ electron wavefunction [consider nearly-free electrons in the effective mass approximation] is modified as
$\Psi_{k_x,k_y,n\sigma}(\mathbf{r})=\dfrac{1}{A^{1/2}}{\rm e}^{i k_x x}{\rm e}^{i k_y y}\zeta_{n}(z)\chi_\sigma$
with $\zeta_n(z)$ the $n$-th eigenfunction of the triangular well with energy $\varepsilon_n^z$. THe total energy can be written as
$\varepsilon_{k_x,k_y,n} = \dfrac{\hbar^2}{2m^\ast}(k_x^2+k_y^2) + \varepsilon_n^z$
The Fermi energy can be obtained using that $k_F^2=2 \pi n$, $\varepsilon_F\simeq 10$ meV.
The difference between the highest occupied energy is $\Delta E -\varepsilon_F \simeq 10$ meV. This yields $T \simeq 100$ K.
Conclusion A quick conclusion of this calculation is the following: at temperatures $T \ll 100$K all the occupied electron states have the same orbital in the $z$ direction and promotion to other orbital requires an excitation energy of at least $10$ meV. If this is not provided, the system has indeed lost one degree of freedom and it is dynamically a true $2\text{D}$ system. Thus $2\text{D}$ systems can exist in Nature!
Concerning the second question, anyon statistics exists only in two-dimensional systems. It cannot exist in $3\text{D}$, and the reason is topological: in two dimensions the configuration space of $N$ particles is multiple connected and closed path of a particle which encloses another particle cannot be "shrinked" to a point [mathematically this is called "compatification"]. On the other hand, for higher dimensions, the configuration space is simply connected and we lose the possibility of distinguish between the interior and the exterior of a closed path.Hence, in the transition from $2\text{D}$ to $3\text{D}$ you simply lose the possibility of interpolate between Bose and Fermi statistics.
Comment: For the first question, if the temperature is slowly raised, do the energy levels gradually get smeared out? For the second question, since experiments are only pseudo-2D, how can we similarly argue (like in the first question) that anyons exist?
Comment: First question: If you do not touch the Fermi level of the semiconductors via the voltage gates, I think yes. However, the interest is to have this 2D electron gases, isn't it?.
Comment: Second question: it is very difficult to prove that anyons exist! I only know this result about an interferometer with edge states [Laughlin quasiparticles], see link at http://arxiv.org/abs/cond-mat/0502406. Appart from the excitations in the FQHE for Laughlin fractions, [nonabelian] anyons are also believed to be related to certain fractions in the quantum Hall regime, see this Physics Focus, http://physics.aps.org/articles/v3/93.
Comment: I asked a question [here](http://physics.stackexchange.com/questions/64444/why-is-the-coulomb-potential-in-pseudo-2d-experiments-proportional-to-the-logari), inspired by this question
Answer: Leongz, DaniH has already given you an excellent discussion of the issues and parameters involved, so I'm not going to attempt to make any additions to that. What I will mention instead is just a heuristic that can be helpful in understanding pseudo-2D and pseudo-1D systems.
The heuristic is this: If for the effect you are looking at there are one or two dimensions of the apparatus that are smaller than the smallest possible wavelength of the effect, then a pseudo-2D or pseudo-1D analysis has a good chance of working well, possibly very well indeed.
This is principle behind single-mode optical fiber, which is the foundation of modern ground-based and intercontinental data communications. By restricting two dimension of the fiber so much that light (analogy!) cannot "bounce back and forth" between the sides of the fiber, the result is a simplified waveform that is vastly superior for carrying data.
Finally, applying that to your specific question: Pseudo-2D and pseudo-1D effects do not in general have smooth transitions into 3D, for the same reason as with the fiber example I just gave. What happens instead is that you just start getting 3D wave effects that add noise and uncertainty to whatever effect you were really interested in.


Condition for an operator on a quantum Hilbert space to behave like vector

Question: In QM we work with $H=L_2(\mathbb{R}^3)$ as a Hilbert space of square-integrable complex-valued functions. Now we define a special set of three operators $L_x, L_y, L_z$ by $L_i = \varepsilon_{ijk} \hat{x}_j \hat{p}_k$, where $\hat{x}_j$ is the operator that multiplies by $x_j$ and $\hat{p}_k$ is the operator $-i \hbar \partial_k$. We say that a set/tuple of three hermitian operators $A_i: H \to H$ is a vector $\vec A=(A_1, A_2, A_3)$/behaves like a vector/ is a vector operator, if $[L_i, A_j]=\varepsilon_{ijk} i \hbar A_k$. My question is, how many of such $\vec{A}$ are there? If I know for example $A_1$, I guess under some conditions there are unique $A_2, A_3$ to make $(A_1, A_2, A_3)$ a vector operator by the above definition? Is this true and what are such conditions?
Answer: It depends on the precise rigorous definition of a vector of selfadjoint operators. Usually, there is a dense invariant subspace for the operators and the generators of rotations, where all linear combinations of the three operators are essentially selfadjoint. In that domain, the exponentials of the  angular momenta can be integrated obtaining that
$$U(R) A_k U(R)^\dagger = \sum_{j=1}^3 R_{kj}A_j\tag{1}$$
for every 3 rotation $R\in SO(3)$.
Since every unit vector in $\mathbb{R}^3$ can be mapped to any other such vector by a rotation, it is clear that, e.g., from   $A_1$ we can reconstruct $A_k$ for $k=2,3$ using $(1)$.
In summary,
the condition for $A_1$ to be part of a vector of operators is that there are other two operators $A_2, A_3$ satisfying the commutation relations you wrote (plus some technical hypothesis).
However,
if $A_k$ is a component of a vector of observables under the action of the rotation group, that component determines the other two components uniquely.
Answer: If you multiply $A_k$ by the same scalar function $f(r)$, then $f(r)\vec A$ remains a vector so since $f(r)$ is otherwise pretty arbitrary there are (up to some technical stuff like domains etc.) infinitely many of those.
In addition you can also have combinations of vector operators coupled to yield another vector operators.  Whereas $\vec r=(\hat x,\hat y,\hat z)$ is clearly a vector, so is $\vec p=(\hat p_x,\hat p_y,\hat p_z)$ and so is
$\vec L=\vec r\times \vec p$.  More generally, if $\vec A$ and $\vec B$ are vectors, so will be $\vec C$ with (spherical) components
$$
C_k=\sum_{mm'}A_{1m}B_{2m'}C^{1k}_{1m;1m'}
$$
where $C^{Lk}_{\ell_1m;\ell_2m'}$ is a Clebsch.  Of course you can do triple coupling of vector operators as well, or you could couple an $\ell_1=2$ operator with an $\ell_2=1$ operator to get another $L=1$ operator.
Obviously the combinations are infinite.  All these tensor operators will just differ by their reduced matrix elements, which will explicitly depend on this $f(r)$ or on the reduced matrix elements of the various components of the composite tensor.


How to make grid scale in 3d view?

Question: While working in blender I accidentally pressed some buttons from keyboard and mouse which made the grid look strange in 3d view (attached screenshot). How can I get the grid to it's default state, like when you open blender for the first time?
I tried to make a new file, but when I append the object the grid changes back, like in the image.
Answer: In the properties panel right from your viewport (press N if not visible) you can change grid settings as you need them.
Comment: Changing the scale fixes the problem. It's strange because by default it's 0.1, after I pressed the buttons the grid shrunk, but that scale value was still 0.1, it hadn't change. I'll set it to 1 and move on. Will be more careful not to press random keys in blender, no telling what I might brake :)). Thanks you both for your help.
Answer: I think the scale of your object was (accidentally?) changed, please check that rather than investigating the grid.
The only settings of the grid is available in the N panel:

How to make grid scale in 3d view?


cyrus-makedirs or mkimap missing on Ubuntu Server 14.04

Question: The Cyrus manual says that tools/mkimap should be run to configure the directories. It appears that this command does not not exist, however.
With a bit of research it looks like there is a debian/Ubuntu version of this called cyrus-makedirs (http://manpages.ubuntu.com/manpages/trusty/man8/cyrus-makedirs.8.html), but that doesn't appear to be a valid package name, and it looks like it should have already been installed by the meta package, but the command does not exist.
Cyrus was installed via package. What is the proper was to run this command (or make the mail spool dirs) on Ubuntu 14.04 with packaged Cyrus?
Answer: I installed cyrus using apt-get on Ubuntu 14.04 and then makedirs is located in:
/usr/lib/cyrus/bin
I created the imap folders using:
su cyrus -c '/usr/lib/cyrus/bin/makedirs /etc/cyrus/imapd.conf'

Hope that helps.


SQL Server Partially Contained Databases and Linked Servers

Question: What is the work around for using linked servers with partially contained DBs?  Additionally, how would this work with Always on and a secondary replica?
Answer: There does not seem to be an issue for me querying a Linked Server from a partially contained database when logged in as a contained user. I would always recommend using a synonym. I did this on a stand alone SQL 2014 instance, using 4 part naming or the synonym worked fine. When logged in as a contained user you cannot see the Linked Server, but it works fine to call it.
Don't see why it would be a problem with Always On Availability Groups...just create the Linked server on each replica, and call it. Not sure what you mean by secondary replica, do you just mean in a 2-node AG? Give it a try on your instances and see what happens.


What are daily life examples of SAT problems?

Question: What are (good) daily life examples of SAT problems?
I've thought about this one. The problem of placing a bunch of different kinds of glasses in a shared cabinet in such a way that some constraints would be satisfied, such as putting the longer ones in the back of the shorter ones, so it will be easier to take them when we need.
Is it a good one, or can you think of any other better one?
Answer: SAT problems are decision problems that can be categorised as NPC. This informally means although there has not been any solution that can solve these problem in the polynomial order, the solutions of such problems can be satisfied in $O(n^c)$.
About your question, first, you should see your problem has exponential space and cannot be solved in polynomial order; after that, you have to investigate whether its solutions can be satisfied in polynomial time or not. An easy way to model this is to consider the boolean table and an expression to satisfy. Your problem can be considered as the boolean equation and different possibilities of variables can be possible solutions that you may want to verify.


Ubercart payment

Question: How can I configure payment for ubercart?
I want default checkout to be worked or credit card option to get money to my paypal account. How it can be done?
Answer: Check the following abstract from the link for ubercart payment using paypal:
PP Account Settings:
Signup for a PayPal account.
Before you can use WPS you need to sign up for a PP account. We recommend using this link to tell PayPal you registered through Ubercart. They in turn support the continued development of our project.
Open a business account (optional).
Although this step is optional, it is recommended for you to keep your personal and business PayPal accounts separate. Opening a business account is preferable because it allows you to use a business name on the PayPal checkout pages and in theory allows you to keep your private name separate. Presenting a business name to customers will help build customer confidence.
Go through the approval process to verify your account. This will require a bank account and correct contact information, possibly more. You can always contact their customer service if you get stumped here.
Configure PayPal account settings.
Login to your PayPal account and go to the profile page/tab. There are many options here but only a few are required to get WPS working with UC.
Setting up WPS:
Click on "Website Payment Preferences" under the "Selling Preferences" section.
Enable "Auto Return".
Set the "Return URL" to http://www.yourdomain.com/cart/checkout/complete
Enable "Paypal Account Optional" (optional). This will make it so customers are not forced to create a PayPal account during checkout.
Save your settings.
Setting up IPN:
Click on "Instant Payment Notification Preferences" under the "Selling Preferences" section.
Make sure that "Instant Payment Notification (IPN)" is not
checked.
Make sure that no IPN URL is set. UC provides this automatically.
* Note: When you login to PayPal, you may get taken to a "Getting Started Steps" page. Steps 1 and 2 are required and involve opening your business account and getting verified. However, step 3 is not required. You do not have to create any buttons or links as UC handles redirecting users to PayPal automatically.
Ubercart PayPal Settings
Enable uc_payment and uc_paypal modules at "admin/build/modules".
Configure PayPal WPS settings at admin/store/settings/payment/edit/methods:
Click the "Enable" checkbox for WPS.
Expand the "PayPal Website Payments Standard settings" fieldset and make the following changes:
Enter your PayPal account e-mail address in the appropriate field.
Set the "PayPal server" to "Live" (versus Sandbox) when you're ready to process orders.
The other fields are self-explanatory and based upon your requirements. Be sure to set them per your needs.
Configure your Checkout Settings at admin/store/settings/checkout. You probably want to make sure you've enabled the following two options:
New customers receive an e-mail with their account details.
Anonymous checkout.
Enable Automatic order update in WorkFlow-NG module by going to "admin/build/workflow-ng"
Click "Edit" for the Update order status on full payment
Tick "Active" checkbox.
Click "Submit"
For using Report module first you have to enable the Statistics
module by going to "admin/build/modules"
Now enable Report feature by going to "admin/store/settings/reports"
Choose "Payment Received" under "Report Statuses"

Ubercart payment


iPhone 4s wifi problem

Question: My iPhone is no longer on I'm using it as an iPod for now but I cant connect to the wifi ; like the wifi is greyed out. I restarted and rest it , it's not on air plane mode or anything. How do I fix my phone?
Answer: that is a trick you may tried it out, it's work for me for now.
1) use air dryer heat up your phone at the top part(you can aim on the headphone jack) until you iphone shown up the temperature screen.
2) When the temperature screen show up , turn off you phone (caution! the phone is very HOT).
3)After it is off pit it into a zip lock bag.
4)Let it rest for 1-2min and then put into the freezer for 30Min
5)When you take it out let it remain in zip lock bag and turn on the phone ( it may show battery low screen. If it's happen wait for a while and try turn it on again)
6) You are done!! you fix your wifi.
It will grayed out again whenever you update to a newer version of ios, so if that happen redo this proccess. So far it work for me, you may give it a try..
Comment: This seems to be a rather dangerous procedure...
Comment: @patrix if we have no choices , that will be an option then...
Comment: @patrix Well, it is a little dangerous. Still you can skip the freezer part and just let it slowly cool down while it is off. I have successfully performed this "fix" (without the freezer) many times. However, it is not a permanent fix... Moreover, I would say that heating you phone that much and regularly, will slowly reduce your battery's efficiency
Answer: So you can see the wi-fi networks list but you can't connect to your specific wi-fi or...?
To be sure it's not some weird problem with iOS you should probably just "Restore iPhone..." with iTunes and check for an iOS update while you're at it.
from Apple's instructions

iPhone 4s wifi problem


RichFaces: Displaying a notification "popup" when AJAX operation succeeded

Question: We are currently developing a B2B web shop based on Java EE 5, JSF, Facelets and RichFaces. The technology has really worked very well so far, but now I am facing a small problem I just can't figure out how to solve:
Products are listed as tables, where every item can be added to the shopping basket by clicking on a small icon at the end of the row. Adding the product is done via AJAX to avoid the full reload of the page. This works without any problems just by using a h:dataTable and an a4j:commandLink to call an action-method which adds the selected product to the basket. Even the re-rendering of the basket total always visible in the side-bar is working properly.
Due to the nature of AJAX, there is no visible indication (except the changing total at the side) that the operation was successful or has been completed at least. Now I want to add a little "popup" box, which is made visible next to the add-icon when the AJAX-operation is completed, stating that the item was added to the basket. This box should automatically go away after a few seconds.
This is what I think should work (the popup_message and popup_content css-classes make the box float above the position where its markup is):
<h:dataTable ....>
    ...
    <h:column>
        <a4j:commandLink action="...">
            <rich:effect event="oncomplete" targetId="addedMessage"
                 type="Appear" />
            <rich:effect event="oncomplete" targetId="addedMessage"
                 type="Appear" params="{delay:3.0, duration:1.0}" />
        </a4j:commandLink>

        <a4j:outputPanel id="addedMessage" styleClass="popup_message"
            style="display: none">
            <a4j:outputPanel layout="block" styleClass="popup_content">
                <h:outputText value="Item added!" />
            </a4j:outputPanel>
        </a4j:outputPanel>
    </h:column>
</h:dataTable>

Unfortunately, it doesn't display the box at all. If I change the event of the "Appear" effect to onclick it works almost as expected. It is immediately shown when the icon is clicked and it dissapears 3 seconds after the AJAX operation was completed. But I don't want it to appear immediately after the click, because it would be wrong to indicate that the item was added to the basket, when in fact the operation hasn't even started yet. This becomes even more important, when I want to indicate some error or want to include some item specific information into the box, which is only available after the item was added.
So any ideas how to do this? And why adding two effects for the same event does not work?
(I've already looked at the effect-example from the RichFaces live demo. The examples do almost work the same, execept that they add the second effect with explicitly stating the for attribute. But even this does not work for me.)
Update: I've tried using the rich:toolTip for this purpose, which actually seems to be quite flexible. But no matter what I do, I can't attach anything to the "oncomplete" (I've also tried just "complete") event of the a4j:commandLink, except one effect... seems there is some bug/undocumented behaviour regarding that event. I've just found this bug report: RF-3427
Answer: Your defining targetId outside the parameters. What you want to do is:
<rich:effect event="oncomplete" type="Appear" params="targetId:'addedMessage',delay:3.0, duration:1.0" />

Try that, and I think it will work.
Comment: I don't know if I've tried that already, but we'll see. If it works, the RichFaces docs need some serious work...
Comment: Tried it but it does not work, but thanks anyway. I have looked at the generated html/javascript, and as it seems, only one rich:effect can be per event (The last effect overrides any previously defined effects for that event). Now I'd like to know, how the example of the live demo works...
Answer: you can try rich:notify for this
http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=notify&skin=blueSky


Karaites and the Maan

Question: The Malbim in Shemot 16:36 makes reference from other Meforshim to a Karaite, who says that Maan is a natural phenomenon. Does this phenomenon still exist?  Does anyone know what it is called in English? Any articles would be appreciated.
Comment: You're just assuming the Karaite is correct?!
Comment: http://jewishfood.wordpress.com/2010/11/18/mohn-poppy-seed-cookies/
Comment: Dave why would I think he would make up a concept like that
Comment: So if he said it, that means he *knew* what the Monn was, and that it is a naturally occurring substance? More likely he was making an educated guess, and you are just trying to figure out what was the subject of his imagination.
Answer: I don't know about Karaites, but see this post at RationalistJudaism that this was the position of Rambam, as well as that of some Yemenite midrashim:
http://www.rationalistjudaism.com/2010/06/manna-and-maimonides.html
"Rambam seems to have shared the view found in certain Yemenite Midrashic texts (and see too Ibn Ezra to Shemos 16:13), that manna is essentially a naturally-occurring substance. It was miraculous in it occurring with unnatural properties (according to the Epistle Against Galen) and with constantly fortuitous timing (according to the Guide). (See the extract from Rabbi Nataniel ben Yeshayah, Nûr al-Zalâm, written in 1329, published in Y. Tzvi Langermann, Yemenite Midrash: Philosophical Commentaries on the Torah, pp. 216-217.)"
He also links there to a NY Times article about a similar naturally occurring phenomenon:
http://www.nytimes.com/2010/06/09/dining/09manna.html?_r=1&ref=dining
Also, to Ibn Ezra who rejects someone (possibly a Karaite) who suggests that it is natural:
http://www.daat.ac.il/daat/olam_hatanah/mefaresh.asp?book=2&perek=16&mefaresh=ezra
ירקב שם חוי שאמר:
כי המן הוא הנקרא בלשון פרסי תרנגבי"ן ובלשון ערבי מ"ן ובלשון לע"ז מנ"א.
כי קושיות רבות עמדו עליו. האחת כי איננו יורד היום במדבר סיני כי ההר ידוע ואני ראיתי זה הדומה למן במלכות אלצכי"ר. והוא יורד בניסן ובאייר ולא בחדשים אחרים.
ועוד: אם תשימהו לשמש לא ימס.
ועוד: כי בלילה לא יבאש.
ועוד: כי איננו חזק ואין צורך שידוכנו אדם במדוכה, שיעשה ממנו עוגות.
ועוד: כאשר יושם בלשון יומס.
ועוד: כי איננו משביע שיוליד דם טוב, רק הוא נכנס ברפואות.
ועוד: כי ביום השישי היה יורד משנה.
ועוד: כי לא היה יורד בשבת.
ועוד: כי ירד לכל מקום שיחנו.
ועוד: כי עבר עימהם את הירדן, ולא שבת עד חצי ניסן על דרך הפשט.
Note that Ibn Ezra says ירקב שם חוי, may the name of Chivi rot. This would appear to be a reference to Chivi al Balchi. See here:
http://en.wikipedia.org/wiki/Hiwi_al-Balkhi
where scholars think he was either a Jew or a Gnostic Christian.
If some Karaite said it, I assume Ibn Ezra would have known who said it and been able to name him. Rather he gives this Chivi character as saying it, as well as those who follow after him. (See here:
http://hebrewbooks.org/pdfpager.aspx?req=39939&st=&pgnum=255
in this longer version of Ibn Ezra, where he refers to Chivi haPoshe vechol hazonin acharav). Perhaps Malbim was aware that this was actually a Karaite, or else falsely inferred that the fellow was a Karaite because Ibn Ezra opposed him, and Ibn Ezra often opposed Karaites.
I've looked at a Karaite peirush myself (namely, Aharon ben Yosef) and don't see any mention or endorsement of this idea.
By the way, here is the Malbim on the Torah.
http://hebrewbooks.org/pdfpager.aspx?req=40081&st=&pgnum=236
Can you locate the page where he makes this comment?
kol tuv,
josh
Comment: I was told that the Ibn Ezra and the Abarbnel reject this theory
Comment: Its Page 250 Josh
Comment: Maybe a direct English translation? maybe comment on the other Beshalach related questions
Comment: Thanks for answering and also making this into a blog post. http://parsha.blogspot.com/2011/01/karaites-and-naturally-occurring-manna.html
Comment: yes, ibn ezra takes pains to reject it, in the quote above. you are right that Abarbanel rejects it too, and indeed refers to it as a Karaitic position. See here: http://hebrewbooks.org/pdfpager.aspx?req=14386&st=&pgnum=136
But this is via Ibn Ezra, so he doesn't know the fellow is a Karaite.
And the Malbim, here:
http://hebrewbooks.org/pdfpager.aspx?req=40081&st=&pgnum=250
brings down both Ibn Ezra and Abarbanel and follows Abarbanel in labeling this the words of a Karaite.
Thanks!
Josh
Comment: for a direct English translation of this Ibn Ezra, see here:
http://parsha.blogspot.com/2011/01/who-asks-that-manna-doesnt-fall-today.html
Answer: I don't know if this is exactly the same type of plant that the Malbim is talking about, because he seems to be referring to a medicinal plant, but in The Bible As History by Werner Keller, he identifies mann as being the plant known as Tamarix Manifera Ehr. According to him, this is some kind of sweet-tasting sap-like substance that falls or appears in the early morning in the Sinai Peninsula. Wikipedia also writes that the Tamarisk is one of the opinions on the identity of the mann.

Karaites and the Maan


What probability methodology is electronic payment using?

Question: Just curious. You pay electronically, and you get a string of numbers. My question, what is the likelihood for a person to type in the same serial number to say, top up their mobile credit? What is the range of probability electronic payment companies are using?Then, does electronic payment in China have longer serial number?
Comment: Well, how many digits are there in the serial number? You also have a further combinatorial explosion if you include letters and other characters as well in the serial.
Answer: Credit card transactions generally involve an input of much more information that just the credit card number (usually there is name, address, security code, card type as well.
Even assuming just the card number is required, assuming it is 16 digits (15 with AMEX), since each digit can be anything from $0-9$, there are $10$ possibilities for each place, and hence $10^{16}$ possible card numbers. The current population of the world is of the order of $10^{10}$. Even if everyone in the world owns a card issued by the same company, the chances of someone just "guessing" someone else's number are pretty slim (of the order of $10^{-6}$). Of course as I said above there are more security measures in place and most merchants generally don't allow multiple attempts to enter card info beyond a certain threshold.


Visual C# 2010 Express SP1 installation error

Question: I got an error 13EC when installing SP1 for MSVS. This problem is described here Microsoft Visual Studio 2010 Service Pack 1 Installation
But how can I add the feature "Microsoft Office Developer Tools" in Visual C# 2010 Express?
Answer: Don't you get the list of features which will be installed, where you can add remove features, before the installation starts? You should find Microsft Office Developer Tools in the list. So, just try reinstalling and make sure you enable that feature.
Also, one of the answers in the link you provided has

So customize your Visual Studio 2010
  Installation via the control panel (add/remove programs) and add the
  feature "Microsoft Office Developer Tools (x64)". After adding this
  feature, you will be able to start the SP1 Setup.
Comment: But the problem lies in the fact that the tools are not available for express editions.
Answer: Just ran in to this error 13EC while installing the MS Visual Studio 2012 SP 1 through Windows Update. I'm running VS 2010 Ultimate - ENU and had removed the original installation source. (Don't know whether that matters)
As these threads suggest, low disk space might be the problem. The first thread mentions the limit to be 5.5GB, which I can't comment on, but increasing my HD free space from 3.7GB to >10GB did to fix the problem. I had three back-to-back failed installs (with intermediate restarts) but after increasing the free disk space it finished successfully on the fourth try, although it did take an incredibly long time to finish. (the progress bar's last 5% or so took up more than 90% of the time)


How can 2-indanone be prepared?

Question:
Would adding phosgene to ortho-xylene lead to the formation of 2-indanone?
Comment: I don't think so. Also, you should avoid phosgene like the plague. It will kill you faster than that. How about just [buying it](http://www.sigmaaldrich.com/catalog/product/aldrich/146692?lang=en&region=US)?
Comment: http://orgsyn.org/demo.aspx?prep=CV5P0647.. this might help you.. if there is any confusion or want the proper answer.... plz comment. i would be writing the procudure clearly..
Answer: If you need to start with ortho-xylene, then you should use fazekazs's approach. I searched through SciFinder and found that the most commonly reported synthesis of 2-indanone involves oxidation of indene using a variety of conditions.
The following Organic Synthesis prep highlights this approach, although it certainly uses some outdated methodology (distillation by aspirator vs. rotary evaporation, for example). Newer reports use a variety of oxidations, including oxone or the the Wacker process.
In this example, indene 1 is added to a mixture of formic acid and hydrogen peroxide to afford the monoformate ester of indene 1,2-diol 2. The monoformate ester was hydrolyze with sulfuric acid to give 2-indanone 3.

However, when I first saw your question, I wanted to propose a synthesis based on a Dieckmann condensation on diethyl phenylene-1,2-diacetate 4 followed by decarboxylation of the $\beta$-ketoester 5. However, I did not find this approach in the literature, and both the diacetate ester and its parent diacid are of comparaple price to 2-indanone.

Another interesting idea that I did not find in the literature is a pericyclic approach based on photolysis or thermolysis of beznocyclobutene 5 in the presence of carbon monoxide. Following electrocyclic ring opening, intermediate 6 can react with CO in 4+1 cycloaddition. An isocyanide could be used instead of CO, and hydrolysis of the imine would give 2-indanone. Alternatively, there may be a transition metal species that could mediate this transformation.
Answer: If you want to start from ortho-xylene 1 I would recommend dibromination using N-bromosuccinimide to obtaining ortho-di(bromomethyl)benzene 2, followed by the addition of 1,3-dithianide anion 3 (prepared from formaldehyde and 1,2-ethanedithiol followed by treatment with NaH). While formaldehyde is electrophylic, 1,3-dithiane is nucleophylic if deprotonated (eg. with NaH, forming 1,3-dithianide ion) and can attack on the bromomethyl side of the molecule to get 4. This polarity inversion is called umpolung. A second treatment with NaH gives the cyclized product 5. Deprotection of the thioacetal gives 2-indanone 6. With this reversed polarity approach no phosgene is needed for the synthesis.
Comment: Care would need to be taken in the NBS reaction. NBS is also a source of electrophilic bromine and will brominate activated aromatic rings in polar solvents (personal experience).
Comment: 1,3-ditianide??
Comment: @Tetrahydrocannabinol Yes, it is the dithioacetal of formaldehyde. While formaldehyde is electrophylic, 1,3-dithiane is nucleophylic if deprotonated (eg. with NaH, forming 1,3-dithianide ion) and can attack on the bromomethyl side of the molecule. This polarity inversion is called umpolung. If you are not familiar with it I suggest you to look it up, because it is very interesting and useful.
Comment: If memory serves me correctly, the anion 3 of 1,3-dithiolane undergoes fragmentation. That is why 1,3-dithiane is used.

How can 2-indanone be prepared?


Unsupported SD format renders my micro SD card useless. Is there a way to fix it?

Question: I have just flashed a new ROM and the microSD card is gone. It appears in the notifications as "unsupported SD card". Is there a way to fix it?
Answer: Plug it into PC and format it to FAT32. That should done the trick. Or maybe you can format it trought phone take a look for that option in storage settings.
Comment: Done. I have just reformatted it into FAT32 using an SD card adapter. Thanks.
Comment: It is not recognized at all (PC, mobile...neither can see it). I have formatted it by the ROM but it is still not recognizable.
Answer: I tried all the suggestions I could find on the web, including third-party-software, but none of them worked! My SD card was neither accessible on the device itself (via file explorers) nor on a PC. (I didn't expect to be able to access it on the PC, though, as I had "adopted" it as internal storage on my (non-rooted) Android device, so it was encrypted.)
Surprisingly, I was able to access the SD card with adb:

adb shell ls \$EXTERNAL_STORAGE: List all folders on sdcard
adb shell du -hs \$EXTERNAL_STORAGE/*: Check size of folders on sdcard
adb shell echo \$EXTERNAL_STORAGE: Print out SD card folder name; in my case: /sdcard
adb pull <SD card folder>, e.g. adb pull sdcard: Download all files and folders from sdcard to current directory. Depending on the folder size and number of files, this may take very long. It may be better to download only the folders required: adb pull <SD card folder>/<path to be downloaded>.

I was even more surprised to find out that some of the files on the SD card were updated that very day, e.g. the WhatsApp backup, even though I had not been able to access the SD card for months and was always getting the "unsupported SD card" on start-up. I seems that a number of apps were still able to access it.

EDIT:
I just saw that sdcard is a symbolic link to my primary storage: /storage/self/primary! So it may not have been my original sdcard content I was viewing and copying but data added since my SD card got corrupted (and Android added the symbolic link to allow apps to use the internal storage as if it was an sdcard). The alternative is that adopting an sdcard as internal storage leads to this symbolic link. I find the former more likely, but cannot evaluate that in my case, as my SD card had been corrupted for a long time now.


About the limit of a function

Question: We know that if $A\subseteq\mathbb{R}$ and $x_{0}\in \mathbb{R}$ a cluster point of $A$. Then the real number $L$ is called limit of $f:A\rightarrow \mathbb{R}$  at $x_{0}$ if for all $\epsilon>0$, there is a $\delta_{\epsilon}>0$ such that $\forall x\in A$ such that $0<|x-x_{0}|<\delta_{\epsilon} \Rightarrow |f(x)-f(x_{0})|<\epsilon$.
My questions are (i) Why we take a cluster point here instead of any real number?
(ii) $\delta$ depends on $\epsilon$ but in the example $f(x)=\frac{1}{x}$ for all $x\in A=(0,\infty)$, we have for all $\epsilon>0$, a $\delta$ is
$\delta=\inf\{\frac{x_{0}}{2},\frac{x_{0}^{2}}{2}\}$ so that $f(x)\rightarrow \frac{1}{x_{0}}$ as $x\rightarrow x_{0}$. Clearly $\delta$ depends on $\epsilon$ and $x_{0}$. In continuity, we called uniform continuity. Can we called here the convergence uniform convergence if $\delta$ depends only on $\epsilon$.
Answer: (i) Because if $x_0$ is not a cluster point, then any real number $L$ is a limit of $f$ at $x_0$.
(ii) No. Uniform convergence is about sequences of functions. But it is true that, in general, $\delta$ depends upon $\varepsilon$ and $x_0$.

About the limit of a function


Import Page with Web Part

Question: Why when I import a publishing page with web part in the page content, the web part is declared "closed" and goes into closed web parts?
Answer: When you import a Web Part in the Page Content, it is not assigned to any particular Web Part Zone, and thus it shows in the Closed Web Parts category.
The reference to the Web Part is embedded into the HTML for the Page Content (or Content Editor Web Part).
Comment: I note it, but, try this:
1. Import on page with a web part in page content
2. Edit the page and put the closed(s) web parts in any place of the page content.
3. DON'T SAVE the page. CANCEL EDIT.
4. DISCARD the check-in.
5. Reload the page

To me, the web parts back on display usually. This is strange because it seems he knew associated content, only there was no such link-level database or something

Import Page with Web Part


Help me to identify this bike

Question: Can someone help me to identify this bike model and where can I find it?
Comment: Have you seen it for real? If so can you get a picture of the headtube badge? If not, what's the source?
Comment: Not, I haven't seen for real. I found the picture months ago on Pinterest :/
Comment: Google Image Search is your best friend for searches like this.  Give it a try, the answers appear to be useful.
Answer: It's one of State Bicycle Co.'s city bike models.
Found via a quick Google reverse image search. That particular image showed up on an Amazon page for the front and rear baskets, also made by State Bicycle.
They have a store locator on their website.
Comment: Be aware that it might not be road legal everywhere. From the picture it seems to have a back-pedalling rear brake only and no front brake. Many legislations require two independent brakes.
Comment: True @Carel in 2015 we saw a flood of Chinese made "City bikes" they called them. They're a dime a dozen in China to the point where sadly a greedy rent to ride system has made them disposable. So someone started pushing marketing over here, I suspect.

Help me to identify this bike