How do I identify apps or settings that cause performance problems?

Question: If I am having performance problems, what tools can I use to identify where my performance lags are coming from?  I have used a System Panel Task Manager, Android System Info, System Manager Free and some others but none of them have really identified the problem children.  System Panel Task Manager came the closest with it's historical look at CPU and memory usage but it didn't let me look at which apps were using how much resources over time.
Answer: Starting from Android 11 and up the security for controlling system dependent apps have been limited to root user only so modern android can do such automatically close unresponsive apps by default but if you run admin programs or debuggers it will interfere
How to activate Auto optimization
From Settings , swipe up and tap Battery & device care .
Tap More Options (three vertical dots) and then tap Auto Action .
Enable Daily Auto Optimize to automatically optimize your phone once a day.
Comment: *Starting from Android 11 and up the security for controlling system dependent apps have been limited to root user only*  -- Hi. Can you provide a link for this? I don't think root user should be involved in this at all.
Comment: Ah on latest android 13 y cant replicate that y use an app called 3c all in one toolbox (paied version) evething besids kernel settings works in none rooted devices task manager network,  battery settings including settings in the BSM board of the battery where you can set charge max ampere etc actually android 11 is kinda buggy but on android 13 you barely need root from anything  and if you really need to tweak root settings  you can use shizuku,  that supports some apps and acces the rootshell through wireless adb , and the saker app wich can reach root settings


Microsoft Kinect (For Windows)

Question: Okay so I am not sure if a lot of you have started to work on Microsoft Kinect for Windows that has been released in February 2012. I am trying to start developing and I wanted to know if there are any tutorials I can find on how to use the SDK or if someone can guide me How the RGB stream can be captured using the Kinect?
Answer: There are many tutorials. Some can be found at Channel 9's Kinect Quick Start Series , Channel 9 also has many articles on Kinect. All of the classes and variables found in the SDK can be found at MSDN, on Rob Relyea's Blog there are many tutorials. And if you ever are struggling, you can visit the Kinect Development Chatroom (assuming you have 20 rep).
Hope this helps!
Answer: Personally, I wouldn't start with Channel 9, or any tutorials for that matter. The most enjoyable way to jump into the Kinect and start messing around with stuff is to install the Developer Toolkit. It was update 3 days ago to include some really cool 3D point cloud stuff. Download/install the toolkit, run the Kinect Studio application it comes with, and spend some time checking out what the Kinect is capable of. If you see something of interest, install it to your computer and open it in Visual Studio. If you don't have Visual Studio, you can download the C# Express version for free. The source code is all very well commented and I find that's the best way to learn by example. You don't have to sit through Channel 9's sometimes painful videos or spend time reading a blog, you can just jump in and have fun with it. If you get stuck, then refer back to Channel9 or come back to Stack Overflow.
Comment: Although this is a good idea, he should go to channel 9 first to see the bery basics and then this would be a great idea +1
Answer: The best place to start learning is MSDN, and where you got the driver for kinect. They offer many tutorials and videos that explain most concepts for the kinect.
Comment: Could you tell me exactly where to look? I can't seem to find appropriate help. Keeping in mind, I'm a total newbie at it.
Answer: You can refer Kinect 1.0 for kinect for Windows SDk  1.0

Microsoft Kinect (For Windows)


Realtek RTL8822CE is unable to detect WiFi networks

Question: I bought a HP Stream 11 (Model 11-AK1035NR). I have installed Lubuntu 18.04 on a USB stick to use for it.
I have gotten the WiFi working before on this laptop after playing with it for a few hours. I had to install this again because of a crash on my USB stick. So WiFi is capable on this laptop, but I don't know exactly how I did it.
I have updated the kernel to Linux Kernel 5.2.2 with no success so far (although it does have the rtw88 which I have read is required). I've also looked around this site and saw a fix for RTL8821CE and then compiling a module and that didn't work either.
I have ran dmesg and this is what I got in terms of the WiFi hardware:
[   14.699016] rtw_pci 0000:01:00.0: Direct firmware load for
rtw88/rtw8822c_fw.bin failed with error -2
[   14.699025] rtw_pci 0000:01:00.0: failed to request firmware
[   14.706008] rtw_pci 0000:01:00.0: failed to load firmware
[   14.708202] rtw_pci 0000:01:00.0: failed to setup chip efuse info
[   14.710395] rtw_pci 0000:01:00.0: failed to setup chip information
[   14.720471] rtw_pci: probe of 0000:01:00.0 failed with error -22

Answer: The problem is this:

Direct firmware load for rtw88/rtw8822c_fw.bin failed with error -2

Please install the latest version of linux-firmware which contains it:
wget http://security.ubuntu.com/ubuntu/pool/main/l/linux-firmware/linux-firmware_1.178.3_all.deb
sudo dpkg -i linux*.deb

Reboot.
Answer: If chili555's answer doesn't work try this:
wget https://github.com/juanro49/rtl88x2ce-dkms/releases/download/5.7.3_35403_20210523/rtl88x2ce-dkms_35403_amd64.deb
sudo dpkg -i rtl88x2ce-dkms_35403_amd64.deb

Note: worked on HP Pavilion 16 laptop and Ubuntu 16.04 and 18.04
Answer: Unable to locate package rtl8822ce-dkms

However
sudo apt install rtl8821ce-dkms

Worked perfectly for Ubuntu 20.04.6 LTS


Electron flow: How does osmium tetroxide react with alkenes?

Question: This is a question that has bothered me for some time. I have always thought that the part of one molecule will only attack part of another molecule if it has a higher positive charge. So with this in mind, why does the alkene double bond attack the $\ce{O}$ atom of $\ce{OsO4}$. Isn't the $\ce{O}$ atom negatively charged?
Comment: Not all reactions are driven by simple attraction of oppositely charged atoms. Consider alkene hydrogenation, acetylene trimerization, or the Diels–Alder thing.
Comment: I am not sure whether it is the alkene that initiates bond formation. However, take a look at the mechanism. It is a cycloaddition. For all we know, the oxygen from the osmium tetroxide may be the one initiating the formation of the bond. I will try to look some journals and post what I find.
Answer: I have a suggestion that could explain the attacK of electron pair of alkene pi bond to the oxygen of osmium tetroxide : The electron pair of alkene pi bond repels the electron density of the oxygen when the osmium tetroxide approaches the alkene, creating a temporary δ+ on the oxygen that is closer to the pi bond of alkene. The electron-rich alkene then attacks the electron-poor oxygen.
Dimitrios Kariotoglou
Comment: Are these your opinions? Please put in references to literature, or else the answer is just speculation. And this explanation seems quite far-fetched to me. I could be wrong, but the right way to refute my disapproval will be to find literature and add it in. Good-day.
Answer: Yes. But check the formal charge on the Osmium. It is so very positive that it actually steals electron density from the Oxygen.


iPhone 5s with Camera + for Blurred Backgrounds in Portraits

Question: I've got an iPhone 5s with Camera + app. Even though it's aperture is fixed 2.2 I'm unable to take nice sharp portraits ( subject sharp and background blurred). I think this is due to the small sensor (?).  I wonder what would be the best option available to take photos like below? I don't mind to use an extra accessory.
Comment: Phone cameras are not made for ultra-thin depth of field, and yes, the sensor is the culprit. To compensate, you can either focus far in front of the subject (and use sort-of hyperfocal distance) and/or you need to get very close to the subject (if the photo above is from an iPhone, I'd guess that it was made this way).
Comment: As others have noted, it's not really possible to get super bokeh on a phone camera. But, you did get me thinking and I posted this question to learn more: https://photo.stackexchange.com/questions/96006/how-do-phone-attachment-lenses-affect-depth-of-field
Comment: Issue relates to how the Bokeh is done on the iphone, this is done after the image is taken and cause some issues because it's done post.
Comment: At a glance, this photo looks like the bokeh/blur is probably fake: the spot where the foreground leaf occludes the background leaf (3/4ths the way right, up near the top) — or is it the other way around? — the weird white artifact in the upper right corner, the inconsistent bokeh ball shapes, the crazy number of superimposed bokeh balls in the upper left, and a foreground that looks like it has greater depth of field than makes sense with the leaves right behind them being so out of focus.  But I can't be 100% certain.  Either way, the best accessory for this would be a large-sensor camera.
Comment: Oh, and bokeh balls in the middle of dark areas, where they don't make sense at all (absent dust or water on the lens).
Comment: An entry-level DSLR could be considered an accessory, no?
Answer: The way that sensor size, lens focal length and DoF works, there's no physical way you're going to be able to blur the background in this kind of effect with a smartphone. The sensor is so small that the lens's focal length is tiny, and that guarantees a very deep depth of field. Using an add-on lens (which is all you can really do with an iPhone) is going to have a negligible effect.
The only way you're going to achieve something like this is with post-processing. You're going to have to look for an app like Big Lens that can mask off the subject and add background blur with a gradient to simulate thin DoF, or maybe use a tilt-shift effect like SynthCam's.
See: https://iphonephotographyschool.com/depth-of-field/
Comment: @nish1013, I've updated the answer to clarify that I meant "no physical way" includes add-on lenses.
Comment: can I use a lens kit ?
Comment: I took this https://imgur.com/a/2Vld5 with my iPhone 6s and an Olloclip 10x macro lens. It works but you will get extreme zooming. The white lines are a spiderweb. It works for pictures of insects but not portraits.


I saw a ghost on fallout shelter

Question: I was just taking care of my vault and out of the corner of my eye it looked like someone was standing in the back of the storage room once I saw him he disappeared and then this weird music started to play like dun dun daaaaaa I waited for awhile and I herd that music again but I didn't see it in time. Who is this figure?
Answer: I think this may what you're looking for:
What is the mysterious stranger doing in my vault?
The question here doesn't mention any ghost-like features, but you seem to both  mention a sound cue, which is also mentioned in that question.
EDIT:
I just realized that Lex asked about this under your post, but I hope this helped :P
Comment: While you are correct, it is for the same reason that this question will likely be closed as a duplicate. For questions that are duplicates, it is best not to post another answer, as this just makes clean up more troublesome.

I saw a ghost on fallout shelter


Cellphone astronomy cams

Question: How long until cellphone cams became so good that we could watch planets with their focal power like a telescope lens? Neglecting SpaceX and Bezos satellites (at least from the moment), how far are we from cellphone "binocular"/telescope vision of celestial bodies like planets or other objects?
Comment: I can't quite figure out what do you want to ask. 'How long' was what?
Comment: How much time? MOnths, years? Having into account the progress in lens makers for cellphones and the software development to come...
Comment: It might be worth mentioning that, while objects in our own solar system can be seen with refracting telescopes, the vast majority of modern telescopes use reflecting telescopes, using mirror optics that can never physically be found in a phone, as the dimensions would never be practical for a handheld device. That being said, refraction is an option for certain objects, but depend in a square relation to the diameter of the lenses, making smaller lenses especially less capable than larger ones.
Answer: With something like the virtual telescope project you can "drive" a remotely located telescope from your phone, but I don't think that's what you mean.
A few years ago I asked Milky Way with a cell phone, how is this possible? and every generation phones are improving even further for sky shots (star trails, Milky Way, etc.). But I don't think that's what you mean either.

...how far are we of cellphone "binocular"/telescope vision of minor/main major solar system planets?

I don't think you meant exoplanets, I think you mean "our" planets like Mars, Jupiter, etc.
Mars and Jupiter are about 25 and 50 arc seconds in diameter when they are closest to us. Due to atmospheric seeing the best we can hope for for a telescope is 1 arc second. That's hard to do in astrophotography but people improve their chances with things like lucky imaging
Let's say we'll settle for 2 arc seconds or 1/25 the diameter of Jupiter. If the atmosphere cooperates we can resolve the great read spot. Putting that into the familliar Airy relationship
$$\Delta \theta \approx 1.22 \frac{\lambda}{d}$$
gives us 7 centimeters, or 2.7 inches. It's not a coincidence that many first telescopes (like mine for example) are 2.4 or 3 inch refracting telescopes!
A cell phone's pixels are of order 1 micron, so if your 7 cm diameter lens had a focal length of 10 cm it would be a f/1.5 lens.
Right now
we just can't get the resolution to see anything on Jupiter without a large, circular glass aperture of many centimeters and an imaging distance of about 10 cm. Basically a really really specialized monocular.
We don't currently have a way to make a flat phased array for light with broadband polychromatic response. We really need the volume of a soda can or so to do it properly.
But how long until we can do it with a cell phone?
Well we could make cell phones the size and shape of soda cans!
If not, I don't know of any technology even on the horizon that can do this.
Once nano-fabricated antennas and amplifiers can work at optical frequencies, maybe we can make some fancy flat phased arrays for light. But there's nothing even close currently.
Comment: Though, cellphone cameras technology came from technologies, serving space exploration (coming from NASA, JPL), the use of them and roadmap are different.
Cellphone cameras are more likely to be aimed as a class of 'normal digital cameras.
With current technology additional lenses is the best that can be proposed from the optical enhancement point.

Here is a digest of cellphone development:
https://techarena24.com/smartphone-camera-list-of-classes-and-types-of-cameras-used-in-smartphones/#7--types-of-smartphone-camera-
Comment: Though, cellphone cameras technology came from technologies, serving space exploration (coming from NASA, JPL), the use of them and roadmap are different.
Cellphone cameras are more likely to be aimed as a class of 'normal' digital cameras. With capabilities as wide cameras, ultra-wide cameras, macro-cameras (PRO - mode proposed by vendors).
With current technology additional lenses is the best that can be proposed from the optical enhancement point.
Answer: Well. Firstly, Mobile phones are still using fixed lenses to capture images, all the effective zoom are still done digitally, which is artificial and inefficient. So If you want to see a variety of Celestial objects, for example, If you want to see all the 7 planets (excluding Earth) in our solar system using a cellphone, you need 7 different lenses/ cameras with seven different focus .
Secondly, definitely the future technology will enable to adjust the focus within the mobile phone, there comes another problem, the aperture, or simply the light gathering capacity, is not enough for space exploration. For example take the Samsung galaxy K zoom, which has a mechanical camera, has an aperture good enough to see the craters of our moon, but not even close enough to see anything beyond that clearly. To see our neighbor ,take Venus (Mars is too small for the following aperture size), to see its changing phase We need at least 55 mm of aperture.
Thirdly, Sensors. Even some of the best cameras for astrophotography, is quite inefficient to what it is really intended for, noise and camera's pixel rate plays a crucial role in delivering good-quality image.
Next, Spherical and Chromatic aberrations will be a disaster when we see distant celestial objects (Jupiter?). As we will be packing wide variety of lenses in a small place, these problems starts to appear.
We do have Some accessories that acts as a zoom, powerful enough to see moon 20x closer, but with this power, we can't even dream seeing anything beyond that. Even seeing the moon with these equipment, you can definitely see noticeable inefficiency. Smartphones today are already capable to deliver good images of our Moon "digitally".
So, after resolving/finding alternative solutions for these problems, There is a chance that one day Smartphones can replace amateur telescopes. But that wont happen for the next 3-4 decades.

Cellphone astronomy cams


Do items "found" through Dice Rooms rerolls show as unlocked in the items sheet?

Question: The only times I've been able to find Dice Rooms with a 1 or 6 face ( that randomly reroll your equipped items) it has been while doing Challenge runs, that don't count in terms of unlocks or achievement. So what I'd like to know is: if my equipment gets rerolled to items I still have to find through normal means, does it counts as found for achievements such as Platinum God? Will it appear on the Items Sheet?
Comment: Probably that's enough to "unlock" them in the Items Sheet, because I've never found a Lucky Foot but Cain starts by default with that item and I can see it in the inventory. Maybe this works with the Dice Room, too.
Comment: I got the achievement *Lord of the Flies* by standing in 1-dice room.
Comment: @BlaXpirit Lord of the Flies is unlocked by simply having both Skatole and Halo of flies on yourself. What I'd like to know is, if I have never found Skatole, for example, and the Dice Room gives me it, will it appear on the Items Sheet?
Comment: @Kappei I've updated my answer, I've found a different response.
Answer: I've asked the same question on the SteamCommunity Forum, and this is the outcome:

Nope, they don't sadly.
  I know because I've tried it, was getting
  nothing but Breakfast which meant I had exhausted the entire pool. But
  none of the items that I needed to find were in the collection page.

EDIT:
There are different opinions, so it's a bit confusing, another guy posted this answer:

I haven't unlocked these yet and somehow they're there.

Meaning that he hasn't unlocked The Lost items (The Soul, The Body and The Mind) but they are shown in his collection page.
So it appears to be true.
Comment: That's weird, the screenshot above is pretty clear, and I don't find a reason to troll people with this kind of lies.
Comment: Your "other guy" has some bug. because even with the d4/ dice rooms you can't roll items you don't have unlocked yet.


Error: cannot access android.app.Activity class file for android.app.Activity not found

Question: I've looked at the similar questions at: Javah Error android.app.Activity not found
and
Javah still won't find class files in OSX / Android Studio
But my error still isn't resolved. The first link suggests adding Android 8, I don't have Android 8 as I am building for Android 15 or higher. So I do have the correct Android15 in my classpath.
The other link isn't too specific for a beginner like myself.
This is what I have so far as my Javah file, I've included additional classes into my classpath to try to fix the error. This is my one Javah line:
<code>javah  -classpath <path-to-sdk>/Android/sdk/platforms/android-15.android.jar:<path-to-sdk>Android/sdk/extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar:<path-to-sdk>/sdk/extras/android/support/v7/appcompat/libs/android-support-v4.jar:./build/intermediates/classes/debug  -d src/main/jni com.tawu.MainActivity
</code>
By adding "android-support-v7-appcompat.jar" and "android-support-v4.jar" I thought it would fix the issue but it hasn't.
I appreciate any help and thanks in advance!
Answer: The error was solved by removing the .jar files and actually using the CORRECT path to the Android SDK version.
This ended up working:
    javah -classpath ./build/intermediates/classes/debug://Android/sdk/extras/android/support/v7/appcompat/libs  -d src/main/jni
:)


Can I move apps to home NAS and run its from NAS in my MBP 2017?

Question: I've just bought MBP 2017 with 128Gb and I'm new to macOS. I know that I can use external HDD or sd-card to store and run apps from it. But I want to buy home NAS. Question is can I configure and use NAS so powerfull and efficient as external HDD or even like 2nd local mount drive? I mean run apps or games from NAS or work with files not downloading to MBP ssd? When I am at home, my connection to NAS would be by ethernet to get the most speed, when I'm outside I have stable 4g-connection.
Answer: Yes and no.
Can you technically do it?  Yes, you can.  You can mount a volume on a NAS device in the same way you would an external storage device and offload your data and applications there.  They would even run from that volume.
Would you want to? No.
First, just comparing USB 3 with Ethernet, you're opting for a connection that's 1/5 that of USB 3 (Ethernet = 1Gbp/s; USB3 = 5Gbp/s).  Then, if you're intending to run this over 4G LTE, you'd be going from 5Gbp/s to 50Mbps - 1/10th the speed.  This is not practical in any sense.
Get a high quality external USB drive for supplemental storage and keep it with you; it's cheaper and more practical.
Comment: Note there are some apps that will not run if not in /Applications but most will
Answer: I disagree with the answer above to some extent. The answer seems to be predicated on the notion that running an app mounted on a remote device entails continually transferring data to and from this device while you're using the app. But I think of apps as programs that load into memory once when you start using them, and then they allow you to do things, like edit audio, create documents, query databases, view photos, etc. It is true that some apps, like a photo viewer, will send a lot of data back and forth to the disk while you are using them. Even so, where the app's data store is located is logically a separate question from where the app is stored. If an app is data intensive or uses a database (or databases), it should always be configurable, as to where its data is located. In fact, I plan to do exactly what this question asks about with my Mac, because my internal drive is almost full, and I do not like having an external solid state drive hanging off of my Mac book pro when I am using it. Much more convenient to park my large apps, like XWorks, which is huge, on the network. Why not? Because it'll take a whole three seconds to load the binary image into memory before I can start to work? So what. Once the program is in memory, I'm developing code, and only teeny, tiny amounts of data are going back and forth to the disk. So at that point, I don't really care if the app's data is stored locally or on the NAS, although I'm sure I could set it up either way.
So go for it! I say you've got a good ideas. And you get bonuses, as well: maybe a VPN with no subscription fee, maybe a "private cloud", where you can access your files from anywhere without paying a monthly fee for the privilege.
About the only drawback I see for storing your huge apps on the NAS is that you may not (or may, I don't know for sure) be able to run the apps when you're accessing your NAS through the Internet. So say I'm in a hotel room somewhere, and I want to look at some code in XWorks, and suppose that running from the "private cloud" Internet drive that comes with my NAS does not work (probably doesn't). What do I do? Well, since all my heavy weight apps are stored on the NAS and not filling up the internal drive of my Mac Book Pro (which I was told when I bought it is not expandable after-the-fact), I have plenty of room on the internal drive, and I can just download over the hotel WiFi the one or two heavy weight apps I might want to use while traveling (for example, maybe Photoshop, as well as XWorks).
I hope this different perspective might help.
If anyone out there disagrees with me, I am open to your input. Maybe I've overlooked something? I'm not an expert in Xos system administration, because I've used Windows and Linux a lot more--unfortunately in my view, due to work requirements,


What is the best power source to use?

Question: I have used all of them, but I still cannot figure out which one is the best overall. What is the best overall power plant/ power source to use?
Answer: I recommend the Solar Power Plant due to low upkeep and pollution. However, it really depends on what you mean by "best".
The best plant in terms of cost per MW and upkeep per MW is the Fusion Plant. To build it, however, you have to unlock and build several unique buildings. Assuming you want to build something other than the Fusion Plant:

In terms of initial cost per MW, the Nuclear Power plant is best. The Oil, Coal, and Solar plants take 2nd, 3rd, and 4th place, respectively.
In terms of weekly upkeep per MW, the Solar Plant is best. Advanced Wind, Wind, and Nuclear plants take 2nd, 3rd, and 4th place, respectively.
In terms of polluting factor, Solar, Advanced Wind, Wind, Nuclear, and Hydro are all zero pollution.
In terms of noise pollution, the Solar plant is best, followed by a tie between Nuclear, Oil, Coal, and the Incineration Plant.

Hydro is a bit of a wildcard as the cost and upkeep vary wildly. Overall, it's not a reliable bet.
Personally, I maximize for upkeep and pollution/noise pollution as initial cost isn't a huge concern for me. Because of this, I build Solar plants as soon as they are unlocked. Until then, I usually build Advanced Wind or Wind turbines as they have reasonable upkeep (assuming you can find a windy spot to place them).
FYI: The SkyLines wiki contains a table listing all power plant options. You can sort the columns to learn more about the best plant for each category.
Answer: The list is outdated, it was made in 2015.
Here is an updated list:
Best energy buildings:
Fusion (for huge cities, con: only end game)
Hydro (100k cities, high initial energy per ₡, con: complex to use)
Solar & Wind are 3rd & 4th place respectively.
Weekly upkeep per MW (lower the better):
Fusion   .5
Solar     7.5 (varies, 70% at night)
Wind     10 (varies)
Nuclear 12.5
Hydro    13(varies on placement)
Coal      14 (varies)
Oil          16 (varies)
Incinerator 120
Initial price compared to energy produced  (lower the better): 10 hydro (approx), 62 fusion, 312 nuclear, 416 oil, 475 coal, 555 solar (approx), 600 advanced wind, 750 wind, 2,500 incinerator.

What is the best power source to use?


Why do we need token authentication?

Question: If I'm creating an authorization service for my application, why can't I just hash the password and save the the username and hashed password in my User table? Why should I use a token authentication service like JWT? I don't think I'm right but I feel like I'm missing something here.
Answer: Well, for starters, a token can be expired in a relatively short period of time, forcing a user to re-authenticate.  A password is generally has a much longer life.  Thus, if a token is stolen by an attacker it is useful for a relatively short period of time (this is one reason that when you have to change a password a good system will force you to enter the current password).
In addition, if you put a hashed password on the client then it can be stolen and used by an attacker in "pass the hash" attacks, which have been around for over twenty years now.  It'd be nice to get rid of them :-)
Answer: Sure your backend can store hashed passwords in a table. This is how Linux does authentication, for example. But..
Implementing your own security is discouraged, because there are notoriously many common subtle pitfalls that require specialised expertise to avoid. For example, if you choose a weak or broken hashing algorithm, or neglect to salt users individually, or concatenate the password and the salt in the wrong order, or (as Swashbuckler pointed out) if your client interface transmits credentials in the same form as your backend server stores them, etc. Any of these unnecessarily increases the severity if you do have a security incident. But even if you get everything right..
That approach isn't scalable. You might need to distribute load over multiple backend servers. (Furthermore, you might want the authenticated user session not to be tied to a specific server, so that you can reboot servers without disrupting users.) Alternatively, you might want multiple applications to share the same pool of user accounts. Now, you could try to engineer a complicated way of reliably syncing the user tables between multiple servers, but that approach is vulnerable to having any single component instance compromise everything else (so every application has to be hardened to the highest level, which for monolithic applications will be very onerous to maintain). Alternatively, you set up a central authentication microservice for your application servers to rely on. In that case, you're practically reimplementing OpenID Connect. Again there are subtle pitfalls in the flows/protocols (thwarting various attacks, controlling which applications are authorised to use which resources on the user's behalf, etc) that can be avoided by just adopting the standard.
Lastly, your potential users may find there is less friction to use social (federated) logins rather than filling out a signup form, verifying their details, and managing separate credentials for every new service provider they interact with.

Why do we need token authentication?


Intuition between determinants and matrix inverses

Question: I have witnessed that the determinant of a matrix can be used to find the inverse of that matrix, however, I am unable to prove that this method of finding inverses works for any square matrix of dimension $m$. For, for me, it seems that although determinants can be used to find inverses their use in inverses are purely arbitrary and coincidental. So, I was wondering if there is any intuition for understanding the relation between determinants and inverses such as maybe a geometrical interpertation or something else.
Comment: I'm not sure what answer you are looking for. At sounds like you are familiar with [Cramer's rule](https://en.wikipedia.org/wiki/Cramer's_rule) and you're looking for the intuition behind this result?
Comment: No not really, I was just looking for an intuition as to why determinants can be used to find the inverses of a matrix because it seem s rather coincidental to me.
Answer: The determinant can be interpreted as the signed volume of the epiped spanned by the images of the standard base vectors. Then "the volume is zero" is equivalent to "the image vectors live in a lower-dimensional subspace" is equivalent to "the linear map is not onto" is equivalent to "there is no inverse"
Comment: To your first Comment, yes, this is an if-and-only-if fact:  A square matrix has an inverse if and only if its determinant is nonzero.  [More about this here.](http://math.stackexchange.com/questions/661633/prove-that-the-determinant-of-a-1-frac1deta-linear-algebra)
Comment: There is an explicit formula for the inverse of $A$, any square matrix, in terms of [signed cofactors](http://math.stackexchange.com/questions/590164/geometric-interpretation-of-the-cofactor-expansion-theorem) divided by $\det A$.  You may find this previous Question, [Cramer's rule: Geometric interpretation](http://math.stackexchange.com/questions/615021/cramers-rule-geometric-interpretation), relevant.  There $Adj(A)$ denotes the matrix of signed cofactors corresponding to the entries of $A$.
Comment: It might help to think of the inverse of $A$ as solving $AB = I$, so for each column of the identity matrix, we get the corresponding columns of $B = A^{-1}$.
Comment: Is this conversely true for when "there is an inverse", and could you possibly provide an example to show your explanation please?
Comment: Also, my question was asking as to why the determinant can be used to find the inverse of a matrix, not why determinants can show whether a matrix has an inverse or not. It would be very helpful for me if you could edit your question.
Comment: @hardmath So, do you think having an intuition of Cramer's rule will help obtain me intuition of the relation between inverses and determinants?
Answer: Consider a square matrix $A$ as a list of column vectors from a vector space $V$:
$$A = \begin{pmatrix} \vdots & \vdots & \ldots & \vdots \\
\mathbf{a}_{1} & \mathbf{a}_{2} & \ldots & \mathbf{a}_{n} \\
\vdots & \vdots & \ldots & \vdots
\end{pmatrix}$$
The determinant $\det(A)$ is the coefficient of the wedge product of every column of $A$:
$$\mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge \ldots \wedge \mathbf{a}_{n} = \det(A) \; \mathbf{x}_1 \wedge \mathbf{x}_2 \ldots \wedge  \mathbf{x}_n$$
And is said to live in the (1-dimensional) space $\wedge^n V$.
The wedge product is a generalization of the cross product that's good in any dimension. It is antisymmetric, meaning that $\mathbf{u} \wedge \mathbf{v} = - \mathbf{v} \wedge \mathbf{u}$, and $\mathbf{u} \wedge \mathbf{u} = 0$. Therefore if any factor appears in it twice it is 0: $\mathbf{v} \wedge \mathbf{a} \wedge \mathbf{b} \wedge \ldots \mathbf{v} = 0$ (via using the antisymmetry property to move one vector 'down the line' until it annihilates with its pair), hence the determinant property that if any column of $A$ is a linear combination of the others then $\det(A) = 0$.
If we consider the column vectors in $A$ as the sides of an $n$-dimension parallelepiped, gives the volume of that parallelepiped. See exterior algebra or this question for details.

Now consider wedge products of $n-1$ columns of $A$ at a time. For example, every column except the first, with alternating negative signs such that $\mathbf{a}_i \wedge \mathbf{c}_i = \det(A)$:
$$\mathbf{c}_1 = \mathbf{a}_{2} \wedge \ldots \wedge \mathbf{a}_{n} \\
\mathbf{c}_2 = - \mathbf{a}_1 \wedge \mathbf{a}_3 \wedge \ldots \mathbf{a}_n$$
If we wedge it with any other column, it will give 0, since that column will appear twice in the product. Therefore, we have:
$$\mathbf{a}_{i} \wedge \mathbf{c}_{j} = \det(A) \; \mathbf{1}_{i = j}$$
$\mathbf{c}_i$ is an element of $\wedge^{n-1} V$, but we can treat them as elements $\in V$, which makes the wedge product just a vector dot product, giving:
$$\mathbf{a}_i \cdot \mathbf{c}_j = \det(A) \; \mathbf{1}_{i=j}$$
$$C = (\mathbf{c}_1,  \mathbf{c}_2, \ldots \mathbf{c}_{N}) $$
This (considered as an element of $V$) is the cofactor matrix, and its transpose $C^T$ is called the adjugate matrix $\text{adj}(A)$.
Finally, we can write:
$$A \cdot C^T = A \cdot \text{adj}(A) = (\mathbf{a}_1, \mathbf{a}_2, \ldots , \mathbf{a}_n) \cdot \begin{pmatrix} \mathbf{c}_1 \\ \mathbf{c}_2 \\ \vdots \\ \mathbf{c}_n \end{pmatrix}  = \det(A) I$$
Which shows that (assuming $\det(A) \neq 0$, which is the condition for $A$ being invertible anyway) the inverse of a matrix is its transposed cofactor matrix divided by its determinant:
$$A^{-1} = \frac{1}{\det(A)} \text{adj}(A) $$
In summary, the fact that determinants can be used to find inverses is anything but arbitrary and coincidental. The two are fundamentally related -- the only thing that can annihilate every column of an invertible matrix except for one is a multiple of the wedge product of those columns.
(I am not entirely sure what is the best way to handle the minus signs in the cofactor matrix. We know that $A \cdot A^{-1} = A^{-1} \cdot A = I$, so the result must be the same, but it's not clear to me how to make that obvious in the construction.)


Seeking help diagnosing leaf health, pictures attached

Question: Newly transplanted plants both appear to have unhealthy leaves. Seeking help identifying and treating said problem. Help is appreciated ty!
Comment: Welcome! Do you suspect the same problem on both plants? If not, please ask two separate questions. The [tour] and the [help], especially [ask], will explain more about how the site works and get you started.
Answer: Looks like whitefly damage, they suck sap from under the leaf. Check if you see small white kind of moths around the plant and leaves. Try to move the leaves to see if they fly away from it. Whiteflies are actually tiny moths.
They are difficult to control, I have tried chemicals from the store last year, they all seem not to really work. You might want to try biological control methods, especially when they are on your vegetables. What I tried this year is to sow a lot of plants in the garden that attract ladybirds, I got a special ladybird sow mix. It seems to work, I have seen a lot of these ladybirds in my garden now, and they feed on aphids and whiteflies.


Where do you place your custom entry point definitions?

Question: I add all my custom entrypoints in this file: \custom\Extension\application\Ext\EntryPointRegistry\customEntryPoint.php
Is there a better way or place to handle this?
Answer: Your location is the recommended location as per the 6.5 documentation. All of the files within custom/Extension/application/Ext/EntryPointRegistry/ are compiled into the file custom/application/Ext/EntryPointRegistry/entry_point_registry.ext.php when a Quick Repair and Rebuild is done.
As you've tagged this with SuiteCRM, I assume you're using their fork of the 6.5 CE. However, if you want to use your code with later versions (7.7+) of SugarCRM, take note that they have noted their intention to deprecate Entry Points in the near future in favour of extending "Endpoints" for their REST API (v10).
Answer: That is the best way to handle your custom entry points.
Answer: There are two best-practice options that utilize the Extension framework in SugarCRM 6.x. Which to use depends on the use of the entry point. The entry point you've specified is best general-purpose, application-wide entry points.

File Location: custom/Extension/application/Ext/EntryPointRegistry/customEntryPoint.php
Provides for an entry point URL like index.php?entryPoint=customEntryPoint

If instead you find that an entry point could be more focused to a single Sugar module, you can make it module-specific. An example use case might be creating a webhook-type functionality to allow a third party payment service to interact directly with a custom Invoice module. The advantage here is organization; custom code placement is as specific and granular as possible.

File Location:
custom/Extension/modules/abc_InvoiceModule/Ext/EntryPointRegistry/third_party_webhook.php
Provides for an entry point URL like
index.php?module=abc_InvoiceModule&entryPoint=third_party_webhook


Do fibers have priorities?

Question: Fibers are defined as lightweight threads, and threads have priorities because they are preemptively scheduled. However, since fibers are cooperative do they too have priorities?
Answer: No, they intrinsically don't have priorities, as in cooperative multi-tasking, the context switch target is always determined by the piece of code handing off control (e.g. calling Fiber.yield(), or however it might be called in your implementation).
This doesn't keep you from implementing a scheduler to determine the next switching at the application level, though, which could then decide based on a priority again.

Do fibers have priorities?


Confusion Matrix for Generated Signatures in Snort

Question: How do we come with True Positives and False Negatives rates when creating signatures in IDS? How do we measure the signatures efficiency? I've seen so many papers that discuss the same, but how do they come up with these numbers?
Answer:
How do we measure the signatures efficiency?

You don't want too much false positives, or your users will be impacted for being denied access to legitimate sites. On the other hand, false negatives allows attackers to bypass the filters and attack your infrastructure. So an IDS with the lowest false positives/negatives rates is better than the others.

how do they come up with these numbers?

They create a list of URLs, both malicious and clean, and send to the IDS, recording the result. This is how they get the amount of false positives and negatives.
You can create the same list by checking your log files and manually labelling them as malicious or not. Check those labels against the IDS log file, and you will end up with the Confusion Matrix.
Comment: Thank you so much for your response @ThoriumBR ! So, the idea is to feed snort a pcap file that has both the good and bad traffic and outputs the alerts in a csv file, right? For this, we can also convert the pcap file to csv and can then check which all created alerts and which didn't.
Comment: Yes, exact that. You can now test more than one IDS and decide if you care more about positives or negatives.


Why is pressure greater at the bottom end of a box submerged in water?

Question: It is my understanding that the pressure acting on the bottom end of the box would be greater than on the top. But if we place a box under water, then the height of water above the top end of the box and the bottom end of the box is still the same, assuming there is no water inside the box, so why would the pressure be greater at the bottom?
Answer: I assume you talk about a water reservoir subject to the gravitational field of the earth, and that you consider a thermodynamic equilibrium situation (which implies also mechanical equilibrium within the water). To find an answer to your question, first look at a column of water with lateral cross section $A$ in the absence of the box. We cut a thin horizontal slice of height $dz$ out of the column at vertical position $z$. The pressure above the slice is $p(z)$, the pressure below the slice is $p(z+dz)$. The force pushing downward on the slice is
$$ F_\downarrow = p(z)A,$$
the force pushing upwards on the slice is
$$ F_\uparrow = p(z+dz)A.$$
In addition, a gravitational force
$$ F_\mathrm{G} = g\rho\cdot A\cdot dx$$
acts downwards on the slice. Here, $\rho$ is the mass density of water (we assume it to be independent of pressure here, which is a good approximation for water in most practical cases).
For the slice to be in mechanical equilibrium, we must have
$$ F_\downarrow + F_G = F_\uparrow.$$
Inserting our expressions from above, we find
$$ p(z)A + \rho\cdot A\cdot dz = p(z+dz)A\quad\Rightarrow\quad \frac{p(z+dz)-p(z)}{dz}=\frac{dp}{dz} = g\rho.$$
This means, with increasing depth below the water surface, there is a linear increase of the pressure, with the rate of increase given by $\rho g$. We find the pressure as a function of depth $z$ below the water surface
$$ p(z) = p_0 + g\rho z, $$
where $p_0$ is the pressure at the water surface.
Now that we know $p(z)$ of the water in the absence of the box, we can come back to your box problem: think of two points at depth $z$ below the bottom of the submerged box, one having a water column above it, the other having a bit of water column but also the box above it. The key insight is, that there cannot be a pressure difference between these two points in equilibrium. The absence of the pressure difference is clear from the fact that the water is in mechanical equilibrium; a lateral pressure gradient would indicate a non-equilibrium situation and start water to flow laterally at the same height.
Suppose, the box is a cuboid with lateral area $A$, height $h$ and negligible weight, filled with air. The top surface is at a depth $z$ below the water surface. The pressure acting onto the top surface of the box is $p(z)$, that at the bottom surface is $p(z+h)$. This leads to an imbalance of pressure forces on the box, which is
$$ p(z)A-p(z+h)A = -g\rho A h.$$
This force, called the buoyancy force, has a negative sign, because it pushes the box upwards. In order to keep the box submerged at constant depth, you have to push it with a force of exactly the same magnitude downwards to balance the buoyancy force.
If the box were filled with water, the pressure forces would be the same, but an additional gravitational force $g\rho A h$ would act downwards. You see that this force exactly balances the force due to the pressure difference. This is Archimedes' principle. The upward buoyant force is exactly equal in magnitude as the weight of the fluid that the submerged box displaces.


Hot cup on wood made mark

Question: I'm in trouble, I put this mark on an antique cupboard by putting a lot cup on it, is there anything I can try to make it go away?
Comment: Sand and stain.
Answer: I had a wooden countertop in my island with this same issue and one trick I found was if you put a teatowel over the area and then with an iron on low hold it a ways above the towel and move it around over the area.  Be careful not to get too close or too hot or you could make the mark worse.  Did this successfully to a good half dozen 'hot rings' on the counter.

Hot cup on wood made mark


How to save an array of objects

Question: So, I'm making a trivia game and so I created a custom array of questions. I have an xml file in the raw folder that holds all the questions, and parses everything into my array. I want to have the ability to shuffle all the questions after the user is done with a game and starts a new one.
This is really easy to implement - just shuffle the array! The problem I run into is saving things. With Shared Preferences, I can save the index (question the user was at) when they close the app. But when I shuffle the array, and they leave the app and go back in - the array is back to the default array so the shuffle is kind of moot. You obviously can't save arrays with shared prefs - so does anyone know a simple/easy way to save the shuffled array?
Answer: Serialize and http://developer.android.com/guide/topics/data/data-storage.html#filesInternal
Comment: Right - I could do that. But...isn't it kind of overkill to go to all the work to serialize things just to save one array? Is there really no simpler alternative?

How to save an array of objects


Exporting Blend Skinning Weights for a Character Model

Question: So I'm very new to Blender, and I've downloaded a 3D model consisting of a mesh and an armature. I'd like to write the data needed to pose the model via linear blend skinning (namely its rest pose joint transforms, rest pose vertex positions, and blend skinning weights) to some file format that I can access in python (such as a .h5 or .npy file) for use in some computer vision work I'm doing. While saving the joint transforms and vertex positions via scripting was pretty straightforward, I have no idea how to access the model's blend skinning weights (which are bound by vertex group). Is there any way to access the blend skinning weights of a model as a $V \times J$ matrix, where $V$ is the number of vertices in the mesh and $J$ is the number of joints in the armature? Thanks.
Answer: After a bit of digging, I was able to adapt a solution based on this forum post. Here's the code in case anyone else finds it helpful:
<code>def get_skinning_weights():
    ## create the dict for the groups attache the index to the name
    obj = bpy.context.active_object

    # get the names of the bones in the armature associated with the object
    for modifier in obj.modifiers:
        if modifier.type == 'ARMATURE':
            armature = modifier.object.data
            armature_bones = {bone.name for bone in armature.bones}
            break

    # get the mapping from group indices to bones
    group_to_bone = {i: group.name for i, group in enumerate(obj.vertex_groups)}

    # determine the bone weights associated with each vertex
    mesh = obj.data
    for vertex in mesh.vertices: ##in each vertex of the mesh
        print('Vertex', vertex.index)
        for group in vertex.groups: #first loop to calculate the total weight and the space allowed if some are locked
            group_index = group.group
            group_bone = group_to_bone[group_index]
            if group_bone in armature_bones: ##if it's a bone
                print('\t', group_bone, group.weight)
            else:
                print('\t', 'NOT A BONE:', group_bone, group.weight)
</code>


What is the past participle of the verb open?

Question: I'm French and I'd like to be precise on the conjugation of the verb "open".
On this picture, I'd write "opened" instead of "open". Could you tell me more about why they have written "open"?
Answer: Because "open" is the simplest form of the word as adjective. "Opened" is more often used as a verb. So we say "Is the door open or is it closed?
Comment: In that sense, this answer is spot-on: opened, even when used as an adjective, references the associated action on the item, whereas open has mainly to do with the item itself.
Comment: @Gael, consider in French _la porte était ouverte_ vs. _la porte a(vait) été ouverte_; the difference is more or less the same. _Open_ is a pure adjective that describes the **state** of something, while _opened_ is a participle that focuses on the **action** of opening the door.
Comment: So, is there any meaning differences between "the door had been opened" and "the door was open" (regardless to the tenses)? Is it also correct to write: "the door was opened"?
Comment: @Gael "The door had been opened" signifies that, at some fixed point in the past, someone observed that someone had opened the door previously. "The door was open", on the other hand, signifies not only that the door had been opened, but that it had not been closed. So the door might have been opened, but may not have remained so. Note that it's also possible to manufacture a door in the open position. In that case, one would say "the door was open", but it would be technically incorrect to say that "the door had been opened".
Answer: "Open" is correct because it's an adjective.
An open world is a world with fewer closed doors (barriers), presumably.
But I wouldn't trust anything that guys says about his company's "mission."
Comment: I do not know who is this guy. I found that picture on a joke website:)
Comment: For anyone who doesn't know, it's Zuckerberg, the bazillionaire who started/runs Facebook.


Is connecting an inductor in series with capacitor bank a good idea to reduce inrush current?

Question: I need to connect capacitor bank to a 240VAC supply. I understand at the instance of switching on the capacitor bank there will be an inrush current since capacitor act like a short to ground. I'm thinking of just connecting an inductor in series with the capacitor to reduce the current. Will this practically work? If so, for a 1 microfarad capacitor, is there any formula to calculate the inductance I need to connect so the inrush current can be reduced to a certain level?
Comment: What's the purpose of connecting the caps to an AC supply? Is it for power factor improvement?
Comment: Yes, it is for power factor improvement.
Comment: Define all the variables and expectations with tolerances if you want the best advice  A ZCS Triac might be the best solution with some damping R , but you may also need line filters CM and DM to limit emissions or use active PFC . The question lacks too many  details
Comment: What level do you want to reduce the inrush current to?
Comment: To be honest, I don't know what the in rush current I needed to reduce to. I asking this as I experienced fluctuation in ACS712 current sensor zero cross voltage when relay turning on pure capacitor load so i suspect this may due to in rush current as I don't encounter this problem when turning on other load. At the moment, I am able to get much stable result by connecting a 32.17 ohm resistor in series with a 8micro farad capacitor.
Answer: Using a current limiting resistor burns off the energy that is otherwise held in the inductor and potentially turned into an unwanted surge voltage across the capacitor bank. You have to be careful of this; the peak voltage across the capacitor bank could be nearly double the supply voltage.
I recommend that you simulate this and see for yourself.
Answer: You can use a resistive network to control the magnitude of the inrush current and to distribute the power dissipation over several resistors. But you don't want that network to stay in series with the power supply once inrush is complete. You can use a MOSFET in  parallel with the network, letting it block current during start-up and pass current after that. It's on-resistance will be very low and so essentially all current will bypass the resistors once the transistor is switched on.  You can use a processor to operate the MOSFET, but if you don't want to include one you could use an RC timer circuit to control the duration of the inrush phase and a comparator's output to operate the transistor's gate when the capacitor's voltage is high enough..
Answer: You're probably looking for something like Hitachi Power Dynacomp. They describe the internals of the design there too.
In most cases, unless the load is very static, you'll need several steps of compensation, i.e. several capacitor-reactor banks that can be switched into and out of the power supply. The step size could be say 5% to 10% of the peak reactive load [var] you want to compensate.
In a nutshell: use static switches (thyristors, triacs or mosfets) to do zero-current switching. Turn the switch on when the phase-to-capacitor voltage is zero. Turn the switch off when the switch current has decayed to zero. Thyristors and triacs do this automatically.
The circuit to control the switch cycling can be a simple analog one. A top-level controller needs to measure the reactive power of the load, and select a capacitor combination that will compensate for it. The controller selects the capacitors, and the low-level switch controls ensure that the switching is transient-free.
To make it practical, you'll likely also need the detuning reactors in series with the capacitors.
The circuit can compensate for not only the reactive load, but also for line voltage sag due (see the Dynacomp pamphlet).


How can I record a macro on the fly with Black Widow Ultimate?

Question: I believe that Black Widow Ultimate can record macros on the fly. However, they are recorded with a delay in the time you take to press the keystrokes by default. Is it, in fact, possible to do this without delay/on the fly?
Answer: I have the Black widow Ultimate and here's how you do recording on the fly
Function F9
type your key combination that you wish you record
Function F9 again to stop (a flashing indicator will show you it has stopped)
Then hit the key combo that you want it to be recorded on like M1
To get rid of the timing you have to manually delete the timings in the macro after it is recorded.  A new macro will show up in your macro list that was not there before.  That will be your newly recorded macro.  There is no way of setting the automatic key recording to have no time recorded with it.  You simply have to remove it manually.
You can however export the macro which will export in xml, insert it into a text editor like TextPad and change the entire macro's delays all at once doing a search and replace using RegEx in the Find/Replace dialog.  Turn on the RegEx find feature and use
<Delay>[\d]*</Delay>

as your search feature.  This will find all of the Delay references with numbers in them.  In the replace part of the dialog put
<Delay>0</Delay>

Now you can reimport the XML code with no delays. A little tedious however worth it for long macros.
Answer: Yes, you can delete the delay by going into the driver, going to the Manage Macros tab, your on the fly macro should show in the "Macro Name" drop down as "New Macro1" or so, and you can highlight the delays and click the Delete option above it.
Answer: As of software version 1.18 there is an option to do this.
In Razr synapse go to the Macros section where you can edit the macro you recorded. They now have options for Recording Delay, Default the delay to a second value, or No Delay.
Answer: From looking over the documentation provided by Razer I do not see a way to default the "on the fly" macro recording to remove the delay in between key presses.
You can, however, set the delay in key presses if you prerecord your macros. See pages 5-6 in the user manual for how to edit the delay in your macro buy using the Razer BlackWidow Ultimate Configurator that is included with the driver package.


macbook 2016 21w charger replaced with 61watt

Question: I have a late 2016 macbook with a charger that fails often.  I bought one that I thought would work but am afraid to try it until I know for sure.They are both c chargers, but the original one is 29W and the new one is 61w. I think that using one with higher wattage is ok, am I right?
Comment: "I have a late 2016 macbook with a charger that fails often."  Is it a *genuine* Apple charger?
Answer: From: Find the right power adapter and cable for your Mac notebook

Power adapters for Mac notebooks are available in 29W, 30W, 45W, 60W,
61W, 85W, 87W, and 96W varieties. You should use the appropriate
wattage power adapter for your Mac notebook. You can use a compatible
higher wattage power adapter without issue, but it won't make your
computer charge faster or operate differently.

Also:

Make sure you're using the correct USB-C charge cable
For the best charging experience, you should use the USB-C charge
cable that comes with your Mac notebook. If you use a higher wattage
USB-C cable, your Mac will still charge normally. USB-C cables rated
for 29W or 30W will work with any USB-C power adapter, but won't
provide enough power when connected to a power adapter that is more
than 61W, such as the 96W USB-C Power Adapter.


Garage door down, will not open and no access inside

Question: I have a garage door that started to act up by not closing completely, I ignored it (bad move on my part).  It has now closed and will not open, I have tried the emergency release cable and it is now disengaged, still will not open. I can hear the motor running when I try the remote.  I do not have a door into the garage and the windows are super small and high (I am 68 years old and not agile).  Is there any way to force the door open ??  It also does not have a handle on the outside of the door making it difficult to get a grip on the door.  Do I just have to trash the door and buy a new one?  Any answers are appreciated.
Comment: Are you able to tell if the emergency release disengaged?  Have you ever practiced using it from the outside?
Answer: The emergency release cable on my garage door is inside the garage. When it is pulled, the door operates manually by lifting. If the springs are weak, it will take some effort to get the door moving.
You have two questions.
The first answer may be that your door has weak springs. A lever of some sort is indicated. Consider a two-by-four of some length, perhaps with a steel strap affixed to the end to get under the door. A fulcrum attached to the lever close to the end will give you some lifting to the door. Block the door at the height accomplished, then re-position the fulcrum, perhaps lengthening it to afford additional height. Block the door each time a gain is made. There are also devices known as fence post jacks which will allow straight vertical lifting once you have sufficient elevation to access the underside of the door. Even an old-style auto jack could be pressed into service, but I've not seen one of those in years.
At some point, you should be able to lift the door by hand, as the springs take over the load.
Rather than trashing the door should the above option be out of reach, consider to contact a garage door company for suggestions. With sufficient desperation, many other options are available. My neighbor has a bobcat type loader with fork-lift blades. If my door were stuck badly enough, it would certainly open under the force of the loader.
That leads my train of thought down another track. One could construct a simple set of wedges and tap them into place with a hammer. As the door began to lift, the wedges would be stacked onto additional spacers in order to continue the progress until the springs engaged.
If your release cable snapped and did not disengage the mechanism, it is necessary to perform the lift and remote actions together or risk damaging the opener. When my opener sheared the teeth on the motor, it was strong enough to prevent manual opening but not strong enough to lift the door. Had the release not operated properly, there would have been little to no additional damage to the already worn gear.
Comment: Good answer. Imho, the best parts are try leverage, then call a specialist.
Comment: Your first sentence raises doubt about the emergency release.  It's likely arranged for outside use. There are [many of these](http://m.lowes.com/pd/Chamberlain-Outside-Quick-Release-Lock/3658606) or similar in our area for detached garage. Making the emergency release available outside.
Comment: I wasn't aware of the key aspect of an external release. With such a design, I can understand why there might be difficulty getting the door open. Knowing now the configuration, I would also suggest "rocking" the door up and down while activating the release, to facilitate removing a possible binding on the mechanism. There does not appear to be much travel, but one does not need much travel with sufficient mechanical advantage. The key lock design does not provide much mechanical advantage. The design puts the key at risk of breaking.


Why does information loss in quantum collapse not threaten determinism?

Question: When Hawking argued that information is lost in black holes, this triggered the "black hole war" because it threatened determinism, which would mean the laws of physics are only true on average. But quantum collapse was also considered to lose information, but this was not seen as such a threat. Can anyone explain why these two issues are different?
Comment: Quantum collapse can also be considered as *creating* information.
Comment: Information loss in black hole evaporation would require a (small) change to quantum mechanics that would make it even less deterministic, in the sense that even the usual probabilistic dependencies would be lost. That debate originated with issues specific to quantum gravity and was not just a symptom of the zeitgeist.
Comment: That also violates the law of conservation of information I believe - as in the no xerox theorem.
Comment: Quantum collapse doesn't exist in standard quantum mechanics. It's a fictitious process introduced in the Copenhagen interpretation.
Comment: Stéphane Rollandin: I forgot to say I love the idea of information creation by quantum collapse.
Answer: Quantum collapse absolutely does threaten determinism. In fact, it not only threatens it but smashes it in the usual sense of the word. There is no amount of information I can gather (even asymptotically) so that I can predict the precise output of a single instance of a general quantum experiment.
This is something that theorists have mulled over so much that they stop mentioning it at some point. But it is no less true.
What the information loss paradox is concerned with is a weak, quantum form of determinism. This determinism can be, strictly speaking, only formulated within quantum mechanics. It states that if we are able to repeat an experiment an infinite number of times and thus to reconstruct the quantum-mechanical wavefunction corresponding to its output, then we can deduce the evolution of this wavefunction to be deterministic. Technically, this is tied to the unitarity of the evolution of the quantum state.
The information paradox could mean that even the evolution of the wavefunction itself will not be deterministic. This is a violation of determinism on a different level then the quantum-mechanical collapse.

However, I cannot personally say that I understand the amount of attention the information loss paradox receives. This is because the operational definitions of wavefunctions and quantum states are inherently non-cosmological. Once we start asking about global, cosmological questions, we cannot assume that, for instance, we can let a universe evolve an infinite amount of times to reconstruct its wavefunction. Quantum theory is by construction a local, lab theory and it comes - at least to me personally - as no surprise that it runs into difficulties once applied outside of that context.
Answer: Quantum collapse case:
Quantum collapse is just a phenomena of collapsing a set of quantum information to one of the quantum information upon measurement. By repeating the measurement we can achieve the whole set of quantum information. And thus not to consider as a deterministic threat(more accurately: "quantum information is never lost"). Also, looking through many world interpretation gives the meaning that the set is never collapses to one, but exist all along the way in different realities.
Black hole case:
Black hole evaporation via Hawking radiation leads to information paradox because after the evaporation, there is no way to recollect the lost information. But there may exist  solution(s) to this paradox like Black hole never evaporate completely and thus information can never lost.
Also, for the comment of @Charles: No cloning theorem says that you cannot clone a quantum state in anyways or in other words, quantum information can't be copied. This doesn't tell you about wavefunction Collapse or lost quantum information.


Why boil adzuki beans for anko twice?

Question: This anko recipe calls for boiling the adzuki beans twice, draining and re-filling the water in between. Why is this done? Is this necessary?
Comment: I won't answer because I've never made it, but I looked at several recipes. They all call for straining after the first boiling, and refilling with clean water. Some call for an overnight soak first, some don't. Your recipe is right in line.
Answer: Please see the excerpt below from this  site . All of the recipes I've seen for anko recommend changing the water but this is the only explanation I've found.

Amy Escobar MARCH 12, 2014, 3:13 PM
Hey Nami, do you know why the boiling water is emptied and then refilled? Cooking With Dog uses the same method and I don't know the reason.
REPLY
Nami MARCH 14, 2014, 12:52 AM
  Hi Amy! Thank you for asking the question.
Traditional method usually includes a process of emptying water for 1-2 times. The reason is to remove impurities (we call it "aku" – English translation is "scum" – not sure if that's the right word) from the azuki beans. They taste bitter and you don't want to cook with them, so we get rid of it by changing the water. Some people do once, some do twice, but you don't want to lose too much of azuki flavor, so I believe one time is good. Hope this helps.

Why boil adzuki beans for anko twice?


How to find vertices on borders of geometry

Question: I trying to highlight vertices which are on "borders", imagine half of sphere for example. Also for example I added image geomtry with triangles and highlighted necessary vertices. Any ideas? Thanks
Comment: How are you currently storing your mesh data? For example do you have a  half-edge data structure, or just vertex/index buffers, or something else?
Comment: There is a similar question in stackoverflow which could help you: https://stackoverflow.com/questions/14108553/get-border-edges-of-mesh-in-winding-order
Answer: I'm assuming you are rendering this object as a set of triangles. To do what you are trying to do, you will need to store all your triangles (and vertices) in some sort of buffer or list. Then, for each triangle, test if all three of its sides are matched with another triangle side. If so, it is enclosed and inside the object. Otherwise, it is outside the object. Some basic pseudo-code (I apologize for all the foreach loops :) )
<code>foreach t in triangles:
    all_sides_touched = True
    foreach side_t in t:
        this_side_touched = False
        foreach u in triangles.exclude(t):    // run through all other triangles to test
            foreach side_u in u:
                if side_t.equals(side_u):  this_side_touched = True
        all_sides_touched = all_sides_touched and this_side_touched
    if not all_sides_touched:
        foreach side in t:
            foreach point in side:
                // do whatever you want to do with outside vertices
</code>
Answer: A close solution would be like How to detect border vertices of an open mesh 3d model? | Stack Overflow
For edge, you test in the edge is connected to at least 2 triangles. If it is not the case, the edge is a border under the assumption that the mesh is a manifold.


What are the causes of Reaction Wheel Failures/Anomalies?

Question: What are the mechanisms of reaction wheel anomalies? Are there any fish bone or fault tree analyses on these issues?
Comment: [This question](http://space.stackexchange.com/questions/1314/why-do-reaction-wheels-fail-so-frequently) has most of your answers, yet no fault tree analysis. I'm still voting to close as a duplicate, because if anyone has that data it can be added there. BTW I found this answer as *the first hit* Googling for 'reaction wheel failures'. Maybe you should do some homework before asking a question?
Comment: I've added a new response on a specific failure mode, bearing cage instability, to the other question, http://space.stackexchange.com/questions/1314/why-do-reaction-wheels-fail-so-frequently/13768#13768, to keep those answers together.
Answer: I'm going to presume that a related question linked in the comments answers the first part of the question and will focus on the latter part of it as a reference request follow-up to the linked one. Since no specific mission's methodology was inquired about, here are some arbitrarily selected publications on the topic of fault detection and management:
Example:

A Systematic Risk Management Approach Employed on the CloudSat Project, R. R. Basilio et al., Jet Propulsion Laboratory, California Institute of Technology, California, 2000 (PDF)

General references:

A Fault-Tree Approach for Identifying Causes of Actuator Failure in Attitude Control Subsystems of Space Vehicles, A. Barua, Department of Electrical and Computer Engineering, Concordia University Montreal, Canada, 2004 (PDF)
A novel fault-tree approach for identifying potential causes of satellite reaction wheel failure, A. Barua et al., Department of Electrical and Computer Engineering, Concordia University Montreal, Canada, 2005
Goal-Function Tree Modeling for Systems Engineering and Fault Management, S. B. Johnson et al., Jacobs ESSSA Group, American Institute of Aeronautics and Astronautics, 2014 (PDF)
Innovative Fault Detection, Isolation and Recovery Strategies On-Board Spacecraft: State of the Art and Research Challenges, A. Wander & R. Förstner, Bundeswehr University Munich, Institute of Space Technology and Space Applications, Neubiberg, Germany, 2012 (PDF)
Root Cause Investigation Best Practices Guide, R. J. Duphily, Acquisition Risk and Reliability Engineering Department, National Reconnaissance Office, 2014 (PDF)
Effective Fault Management Guidelines, S. L. Hogan, Digital and Integrated Circuit Electronics Department, Air Force Space Command, El Segundo, California, 2009 (PDF)
Comment: Excellent documents. I'll review these documents immediately...Thanks and best regards.......


Why do I have GRUB and GRUB2 in my boot directory?

Question: I'm running F17 and my boot directory has grub and grub2. Why do I need both of these? I thought only one grub was required to boot. Does each one have specific properties?
Answer: On my F17 box, I still have /boot/grub/splash.xpm.gz which is meant to be the grub splash screen. It's contained in the fedora-logos package. The directory contains nothing else. My guess is this will be fixed sooner or later.
Comment: I have the same 'splash.xpm.gz' in 'grub'; however within grub2 I have 'device.map fonts grub.cfg grubenv i386-pc locale themes'


Where can I find datasets for all confirmed exoplanets, terrestrial exoplanets, and Super-Earth exoplanets?

Question: The NASA Exoplanet Archive has a Planetary Systems dataset offers celestial mechanical data for 5,197 confirmed exoplanets. The Exoplanets Catalog classifies these exoplanets as terrestrial, super-earth, Neptune-like, or gas giant. Where can I find spectroscopic data, estimates of composition, and/or data on water (or rock) for these exoplanets?
Comment: Most data that we call 'composition' is the mean density interpreted on some equi-density line. There is no unique composition that we know of for most non-gas giants, so if you want scientific scrutiny, then unfortunately there are no answers yet for all those classes of exoplanets.
Answer: The slightly more comprehensive catalogue on exoplanets and especially the related research papers is found on http://exoplanet.eu/catalog/
It offers direct link to the publication of each planet and other works which also reference it. Apply your search criteria to this catalogue (it is only different size ranges you want), and then check the links to references. Some will be papers which offer analysis of spectra etc for a select few systems. Most systems won't be observed nor analysed in that regard though. I am not aware of a ready-made list covering all in a fashion like this planets overview table, you will have to check references.
Comment: I would caution against the .eu exoplanet catalog. It seems to be poorly maintained and contains many errors in references as well as in units and data given.


Cut on my car's tyre

Question: I noticed that my car's back tyre has some damage. It doesn't look that worse but not sure if I should replace it. my car is Kia Rio.
Comment: Tire flanks are constantly churned on by the weight of the car while driving. This is the most delicate part of a tire and the tire needs to be replaced when the flank is even slightly damaged.
Comment: @Janka - You're saying if you get one little scratch on the sidewall you should replace the tire? While the sidewall is most assuredly the weakest part of the tire, it doesn't mean it's delicate. It can stand up to abuse. In most cases, as long as the sidewall or tread doesn't get out of shape (bubble or deformed), there's no issue. There is rubber there for a reason. Just because a little bit rubs off doesn't mean you need to replace the tire.
Comment: Well, the picture above certainly isn't "a little bit rubbed off".
Answer: Via the picture it is hard to tell how deep that damage goes, but it certainly doesn't look like a minor scuff. I'd certainly be concerned about using this tyre and it would be on my mind say whilst traveling on fast roads etc
In this case I would advise that the tyre be replaced. Damage like this certainly would be cause for the vehicle to fail an MOT test, here in the UK anyway.
Comment: Maybe it's not that dangerous, maybe but the anxiety is always there. I am gonna replace asap.
Comment: It's the hidden damage that is the issue - best to replace it - good decision.
Answer: Given the sidewall damage evident in the photo, I would be inclined to replace the tire.
Even though your photo is clear, it is not clear how much rubber has been removed, and that is why an in-person inspection would be good. Certainly, if you are near any kind of cord in the sidewall, I would replace.
A sidewall failure can be quite disconcerting, and can happen quickly.  It may not be an issue today, but as the tire wears, and under conditions such as mild underinflation, or high temperatures, the sidewall would be more likely to fail with some thickness removed, as the photo evidenced.
Keep in mind that the sidewall in that region is the thinnest portion of the tire, and they are not repairable.
Comment: Almost everyone suggested me to replace the tyre and I have already done it so. Peace of mind.

Cut on my car's tyre


Confusion regarding sinusodial function in SHM

Question: A block is connected to a spring. The block is pulled from the initial position $t=0$ and $x=0$ to lets say Zcm and released. Now if I have to write the SHM equation when the body is Z/2 distance away from mean position, do I use sine or cos?
I get it that Z is the Amplitude. So do I start measuring time from t=0 or t=t i.e. when body is at Z
Answer: You have to start measuring time when the block is at $x=Z/2$ because you don't really know how the block is moved to $x=0$ to that position. You can consider the moment when the block is released as $t=0$ because choosing a different time origin won't affect the behaviour of the system (you have no friction).
It doesn't matter if you choose sine or cosine if you match the initial condition and you can do that with both choosing a different phase ($\delta$) depending on whether you use sine or cosine. However, $\cos(0)=1$ so you won't have to choose a phase if you use the cosine.
Answer: The initial moment of time $(t=0)$ is generally taken when the motion started, i.e., in your case when the block is at $x=Z cm$. However, you can choose any moment of time as $(t=0)$ after the motion started as per your convenience.
You can think of it this way - You closed your eyes when the block was at rest at $x=0$ and some naughty kid pulled the block to $x=Z cm$ and when you opened your eyes $(t=0)$, the block was at $x=\frac{Z}{2} cm$ and was moving towards the mean position $x=0$.
So, after observing for sometime, you will write the equation as -
 $$x=Zsin(\omega t + \delta) $$
 and as the block was at $x=\frac{Z}{2} cm$ at $t=0$,
$$\frac{Z}{2}=Zsin(\omega (0) + \delta) $$
which gives $\delta = \frac{\pi}{6}$.
So, the equation of motion will be -
$$x=Zsin(\omega t + \frac{\pi}{6}) $$.
Note that if you use $cosine$ instead of $sine$, only $\delta$ will change but the initial phase of both equations will be same as $cosine$ and $sine$ have a phase difference of $\frac{\pi}{2}$, i.e., $sin(x) = cos(x - \frac{\pi}{2})$


Wiring for smart switches

Question: Can anyone tell me what the blue and yellow wires are? I know the red is the hot. Is the blue or yellow wire a neutral wire?
Comment: What country are you in? That affects wire colors.
Comment: Each of those two switches controls something.  Is that "something" also controlled by another switch somewhere else, i.e. Can you switch it on/off at either location?
Comment: Can you post a photo of the inside of the other switch location?
Answer: Won't work.
From the 3-core cable, and from the fact that all wires of each cable go to 1 switch, it's perfectly clear that this is a 2-way (USA: 3-way) switch.
And further, it is the switch on a "spur" line.
In this location, those three wires will be 2 travelers and a switched-hot.  None of the wires are hot or neutral.  So it is not possible to add a smart-switch here,  except by greatly reconfiguring the entire circuit.
However, it may be practical to fit a smart-switch at the other 2-way location, depending on which wires are there.    If it, too, is a spur, then smart switches will require a dramatic reconfiguring of the whole circuit, and to help you there, you'll need to supply a lot more information about what is going on inside the other switch box and at the lamp.
Answer: According to this chart, if you are in UK and red is hot (as you stated) then neutral should be black, and yellow & blue are hot wires.
It also looks like you have two identical switches, but more description - and/or a picture of the front of the switches - would help.

Wiring for smart switches


Use of MOSFETs body diode

Question: I have an N-MOSFET array IC and I don't need to use all of them, but I do need to use a diode. Is it OK to use the body diode of one of the MOSFETs as a regular diode to decrease component count and footprint? Can I just tie source to gate and use the MOSFET in place of a diode in the circuit?
Comment: I think you should insert more details about the application of this diode. What are you going to do with it?
Comment: One use would be a flyback diode for 3V 40mA motor. Another just a diode to isolate a tactile switch from digital output
Answer: If the MOSFETs in the array are isolated from each other and the body diode rating is not exceeded, the voltage rating of the MOSFET is suitable, and the specs (current rating and reverse recovery time, especially) of the body diode are acceptable it should be fine.
It might not be a good choice in something like a switching regulator where trr is important.
Answer: The below figure shows a typical diode-connected MOSFET (for NMOS). It performs a rectifying function similar to a diode. It is not necessary to connect bulk and source as in the figure, it is an artifact of the lack of a true 4-terminal device in the schematics editor for electronics.stackexchange. The source terminal which is tied with bulk in the figure could be at a voltage higher than bulk.
Bulk is typically shared among many devices and the lowest voltage is used for bulk. In bulk CMOS and NMOS technologies the NMOS transistor body is made of P-type material (excess positive charges), while source and drain are made of N-type material (excess negative charges). There are therefore also some "parasitic" PN-junctions you could exploit: Bulk(P)-Source(N) and Bulk(P)-Drain(N) are real PN junctions - however this is normally not done! For ICs the body material is usually shared by many transistors, and fixed (by specification) to 0 Volt. It then only makes sense if the voltage you need on bulk (for the P-side of the diode) is 0 Volt. Source implants usually have very high number of dopants. Therefore the diodes are somewhat weak - you need a higher forward voltage to send the same amount current through them - compared to a device with more moderate doping.

simulate this circuit – Schematic created using CircuitLab
Comment: The unedited circuit does not work as a single diode. It will work as 2 diodes **in antiparallel**: the first one is the body-drain diode as you showed. The second one is not technically a diode and will not show an exponential I-V behavior, but a quadratic behavior (and its "anode" is on the top). When Vth is exceeded, the current will be K*(Vgs-Vt)^2, as the mosfet will be always in saturation. To make your circuit work, you should short the gate to the source. (I have requested edits to the schematics)
Comment: Thanks for the attention. In my post I was trying to point the asker to a diode-connected transistor, rather than the drain-body junctions (which are normally weak devices with forward bias, with strong limitations). I have updated the post!
Comment: I see now :) But however, let me point out that discrete MOSFET arrays (I mean chips containing more than one MOSFET. And I think that the OP was referring to these) are made with vertical structure, and the source is always connected to the bulk (like in discrete MOSFETs). In analog and digital ICs, instead, MOSFET are planar and the bulk is just connected to the rails (gnd or VDD), unless triple well is adopted, therefore your diode works (still one must ensure that the body is at the lowest - in nMOSFET, highest for pMOSFET- potential on the circuit).

Use of MOSFETs body diode


What are the differences between a repeater bridge and WDS?

Question: I've read about both repeater bridge mode and WDS in the DD-WRT documentation.  It sounds like they solve the same problem, but it's not clear from the DD-WRT documentation where they differ, if at all.  What are the advantages and disadvantages of each?  Should I prefer one to the other if my routers support it?
Comment: may help: http://serverfault.com/questions/466670/what-is-difference-between-wireless-universal-repeater-and-wireless-distribut
Comment: The ddwrt has a detailed wiki writeup here: http://www.dd-wrt.com/wiki/index.php/Repeating_Mode_Comparisons
Answer: WDS is supposed to be guaranteed to work if both devices support it. The other AP must be specifically configured for WDS mode and for the hardware address of this device. The two APs synchronize their lists of clients, and each accept traffic from (and for) each other's clients. It's the official "right way" to do things.
DD-WRT's repeater bridge mode tries to provide the same basic capability as WDS without requiring any special support from the remote AP. Essentially, it pretends to be a wireless client of the existing AP for every device connected to it, whether wired or wireless. This convinces the existing AP that all those devices are connected directly to it, and it "just works".
One downside of repeater bridge mode -- clients can't move seamlessly from one AP to the other. I would suggest you use WDS if you can, and fall back to repeater bridge if WDS is not an option.
Answer: You don't specify what your end goal is, but here is a link to some good info that is likely to help you out regardless of what you are doing.  The link has a table that indicates when you should choose WDS over repeater bridge and vice versa.
Since you don't say what your end goal is it may I should mention client bridge as a possible solution.  WDS and repeater bridge both share a common downfall, that is, for every hop, the effective bandwidth is reduced by half.  This may not be of concern to you, but if it is a client bridge might be the answer.  A client bridge is basically a wireless connection between an AP and a client router.  Other wireless connections can be made to the AP, but the not to the client.  Only wired connections can be made to the client (unless the router in question is dual band which is optimal for this situation because you can create the client bridge on one band, but still allow other devices to connect to the client on the other band).
Answer: I partially disagree with the posts suggesting WDS and Client Bridge, though both have their strengths.
WDS requires identical or nearly identical hardware for all of the units and configuration of all of them. If your two routers/access points are not using the same internal firmware and chipsets, there is a great likelihood that WDS just will not connect.
Client Bridge on DD-WRT is excellent, if you don't need wireless capability at the remote end. I use a client-bridge for my X-Box, TV, and Dish unit -- none of these need to move. It is true, as ubiquibacon notes, that Repeater Bridge mode will halve the bandwidth, but if your purpose is Internet browsing, unless you have an Internet connection at 20Mbps or higher, you're probably still going to get that much even after cutting your Wi-Fi's speed in half. On the other hand, if your main point is for continual large file transfers between computers, then this bandwidth reduction will be noticeable, but usually it's for a laptop or mobile device to have good Internet access throughout the house, in which case a bandwidth reduction is generally not even detectable.


Traffic ticket for violating Seat belt law

Question: I received my first ticket (27360 A) yesterday for not buckling my child to car seat in California. I'm a Texas resident. Can I be given first offense fine reduction?
Comment: I'm voting to close this question as off-topic because this is asking for legal advise for someone in his/her home country, maybe even home city.
Comment: @pnuts It's an existing practice that first time offenders are given a somewhat lighter sentence in hopes that they may see the error of their ways and not do this again.  But I have never seen it applied to traffic fines.
Comment: @pnuts see assessments in CA law in the answer
Comment: Have you spoken to a lawyer?
Comment: I second @Karlson and especially that it's in California and is a child-safety violation.
Comment: @Willeke Laws and some of the accepted practices change from state to state in the US.
Answer: A reduction may be sought, according to California law

Responsibilities of the Courts

To charge the full fine unless the violator shows the court proof of economic disadvantage. The law does not permit the violator to bring a car seat to court or attend an education program in lieu of the fine.
To allocate the fine money collected for 27360 and 27360.5 to a special revenue fund that supports a program operated by the local city or county health department that provides education and low-cost car seats to needy families. According to the California State Controller, the fine money must be allocated
  to this special revenue fund, even if the violator attends Traffic Violator School to have the point removed from his or her record.
To refer certain violators to a violator education program that provides certification that the defendant has presented for inspection a child restraint that meets federal safety standards. If the fine is reduced or waived, the court must require any violator cited for V.C. 27360 or 27360.5 to show proof of
  attendance. If the fine is paid in full, the court may require participation in the program.
To charge one point for each violation of 27360 or 27360.5. The violation must be reported to the DMV, whether the fine is reduced, waived, or paid in full.
Fines
The fine for failing to properly secure any child under age 16 is $100 per child plus penalty assessments (almost $500 total).
The fine for a second or subsequent offense is $250 plus penalty assessments (over $1000).
Comment: @pnuts not at all; the assessments raise the cost to about $500, and I've included what grounds can be used to reduce such a fine. California makes it very, very difficult to reduce such a fine, as the OP is asking, as do many States, particularly in this type of violation.
Comment: @pnuts no problem; the courts are not inclined to be lenient when a child's safety is ignored; it may be the first time the person was ticketed, but possibly not the first time the child was not secured as the law requires.
Comment: when the fine is just $100 how the total penalty assessments go to $500 ?
Comment: I am fine to have the ticket on my history, as I dont have a car. I got this ticket using a rental car. I drive car may be twice or thrice an year and that too a rental car.  When I consulted a California traffic attorney , he asked to $299 for his fee and if he wins the case I need not pay any fine to California. 80% of his cases he is able to reduce the fine. So is is advisable to consult a attorney where I could end up paying just $299 or simply pay the fee (if it comes out anything less than $300)
Answer: You should see if you can attend traffic school instead. This also drops the points from your license. It is, I believe, only for first-time offenses.
And please use a child seat.
Comment: @pnuts Traffic school is an option you can request from the traffic court. "If you've received a traffic ticket, [your California county traffic court](http://www.dmv.org/ca-california/traffic-schools.php) may allow you to complete traffic school to dismiss the citation and avoid having points added to your driving record." However, in reviewing the details, it is available only to CA license holders. Maybe there is a similar program in Texas that the OP can use.
Comment: I was wondering, in California, at what age (and/or weight?) is it OK for a child to not use a child seat, ie, to just sit in the normal seat with a seat belt?
Comment: @JoeBlow Child seat if under 8 years _and_ under 4-foot-9.
Comment: @JoeBlow and a for child older than 8/taller than 4'9", the seat belt has to fit properly with the lap belt low on the hips, touching the upper thighs, and the shoulder belt crossing the center of the chest. If children are not tall enough for proper belt fit, they must ride in a booster or
car seat.


What are good approaches for migrating data format in schemaless databases?

Question: If you use schemaless database (particularly document-oriented databases like CouchDB, Couchbase, MongoDB) and want to change format of data representation for a particular object you may leave existing records with old format and create new records in new format. It's declared as one of major advantages of schemaless databases (I think because you can avoid downtime). On the other hand it's inconvenient and inefficient to deal with many formats of the same kind of data. So what are the good approaches/strategies to migrate data from one format to another in schemaless databases?
Answer: Like everything there are many different ways to handle this. In schemaless development, you generally are cognizant of the data you are storing. It's not that the schema is missing, all data has an implicit schema, so what we are really saying is that the database is not enforcing a schema. If I have a user object with 10 instance variables that I store in json, there IS a schema there!
Case 1: values might have different possibilities, single value, array, or a nested structure
Case 2: value needs to be changed from one format to another, ex. from single value to array of values
Case 3: existence or non-existence of a json key, this is pretty straightforward
For Case 1: if you are expecting variety in a json value, the variety of a particular value will need to be written into your App Code logic, if it's a string, do this, if it's an array, do that.
For Case 2: One approach can be to handle this as an "On Request" or "On Demand" so that you bake in the transformation logic into your class methods, so that data is transformed from one format to another format. This means that you transform data from one format to another when it is retrieved. You can also flag it to indicate you have transformed it. Since it's On Demand, you could have data that isn't "transformed" in your document store, but if it does get requested, it'll be transformed.
Alternative approach for Case 2: Iterate through and transform the data through worker processes. So rather than wait for it to be requested, you actually create a job to change data as you want it to be changed, baking in the transformation logic into the workers themselves (which can use the same class definitions in your App Code). In Couchbase you can create a View (Secondary Index) or use Elastic Search to iterate through documents of a particular type. If you create a workflow system, you can do a lot of this in parallel with many workers.
>>>>
When I do transformations I generally transform one json k/v into another json k/v in a non-destructive way so that if I have made an error in my process, I do not alter original data. I can then have a later phase to remove old json k/v "On Demand", if I even feel that is necessary. This is a safer approach to this type of operation.
Appended
Case 1 & 2: Data Transformation
Original JSON Document
user::101
{
  "uid": 1234,
  "type": user,
  "my_comment": "the quick brown fox jumped over the lazy dog"
  "version": 1.00
}

Now let's say I want to change it in a non-destructive way, I can easily just add a new json key that has the transformed data:
user::101
{
  "uid": 1234,
  "type": user,
  "my_new_comment": ["the quick brown fox jumped over the lazy dog", "comment2"]
  "my_comment": "the quick brown fox jumped over the lazy dog",
  "version": 1.01

}

Notice it's non-destructive, the old json key is still there, alternatively I can do this,  save the old data as a new key, and change the expected json key to a new format (array) instead of a string:
user::101
{
  "uid": 1234,
  "type": user,
  "my_comment": ["the quick brown fox jumped over the lazy dog", "comment2"],
  "my_comment_v1.00": "the quick brown fox jumped over the lazy dog",
  "version": 1.01
}

Obviously there are quite a variety of different schemes you could use, depending on your preferences.
Comment: Could you give an example, how you the migration in a non-destructive way? Basically you want to replace k/v1 with k/v2. As far as I can understand, this means that k/v1 should be 'destroyed'.
Comment: Basically from your answer I see one of a possible migration procedures as following. When I change a format of data 1) app code should be able to work with old and new format and distinguish one from another 2) app code that uses the data should be able to convert on the fly the old format to new and work with new 3) worker process is started that convert records in old format to new format and save them
Comment: let's see if I can do this in a comment on SO... let's say the document is:
ah, can't do return chars, let me create a gist... I'll edit my answer to help understand and throw in a gist.
Comment: didn't need a gist, just put it into the answer, make sense? if not, please feel free to ask more questions!


Is there a limit to the amount of caps you can have?

Question:
My cap amount is stuck at the amount on the screen shot. Is this a bug, or have I hit a hard limit?
Comment: Does it stay like that when you spend any as well?
Comment: I recommend spending those caps on demolishing all of those 1 space and many of the 2 space rooms and turning them into 3 space rooms. I'd also demolish all the first tier production rooms and replacing them with their second tier replacements, except fewer of them. You should be able to make your vault smaller, more efficient and easier to manage.
Answer: Congrats on being a super rich vault!
Vaults can hold a maximum of 999,999 caps. Any more you collect from production rooms, level ups, exploring the wasteland, selling items, or anything other than lunchboxes will not increase your caps beyond 999,999.
As with all other lunchbox related things, lunchboxes ignore the cap on caps. Any cap cards you pull from a lunchbox (x100, x500, etc) will add their full amount of caps to the total, even if it puts you over 999,999.
You will accumulate caps normally again once you spend enough caps for your total to drop below 999,999.