Android app privacy policy

Question: I plan to include GCM into my app and now I don't know if it needs to be in the privacy policy. And where can I get a good privacy policy for an app for the play store? Are there any privacy policy creators or something like this?
Comment: This question appears to be off-topic because it is about the terms of a privacy policy, not programming. Please consult with a qualified attorney for your concerns about privacy policies.
Comment: Although this question is off- topic but targets indie-developers who dont have a team of lawyers or such resources, so should be solved here and not closed, I an reopening and ask others to vote for the same
Comment: It is a programming cycle question, so it deserves an answer since probably I wasn't the only one needlessly spending time on 'trivial' things like this: here is some boilerplate: https://gist.github.com/alphamu/c42f6c3fce530ca5e804e672fed70d78 which seems to originate from privacypolicytemplate.net — I wouldn't call it ready-to-use, some bits didn't sound right to me and needed a bit of editing, but otherwise it is a good starting point.
Answer: Yoy may take privacy policy of any app in Google Play and convert it to fit your needs.
Comment: This is a very bad advice and should NOT be followed. Copy-paste is absolutely NOT a good idea, as privacy policies need to be tailored and customised according to the data handling of YOUR SPECIFIC app.
Answer: These off-topic questions tend to be closed after a while, let's try to get your questions answered anyway:
First I would advise you to read some general guidance on the topic, like the one presented by the Attorney General of California called Privacy on the Go. When you're knowledgeable about the topic you might as well try privacy policy generators and see whether they suit your particular case.
I'm part of iubenda, a team with a mix developers/designers/lawyers who are building tools exactly for this use case: apps and websites. You can find the generator for mobile apps here. iubenda's mobile privacy policy is on a paid only plan currently, but you can always test drive the generator for your website's policy.
Now as a general caveat let me advise against copying off of other sites or apps (as suggested by the answer before me). You may infringe copyright and import several other problems. Who tells you that the pp/terms you decided to be fit for copy aren't fundamentally flawed themselves?
Today there's great guidance out there, and great help like the one provided by iubenda. Take advantage of it!
edit regarding the comment pointing out that iubenda is paid: that's right and I've added a sentence regarding this to the answer. One of the advantages of a paid policy is that you get to ask questions and request improvements any time :)
Comment: I have tried iubenda today. It does not allow you to add services as admob unless you pay. Also it does not allow you to generate an application privacy policy unless you pay. I'll keep searching for something free.
Comment: @Aebsubis have you found any?
Comment: @SomeoneSomewhere the question does NOT specifically ask for a free service, which you seem to instead imply. You may consider editing your comment to reflect the truth. The fact that an answer is downvoted because the proposed solution is not free of charge, given that the question didn't specifically ask for something free, honestly leaves me perplexed.
Comment: @HendraAnggrian I have not found an interesting privacy policy generator for apps and now it is mandatory according to the user data policy of Google Play. I am still interested in a generator. I think it would be very handy. In the meantime I am researching privacy policies that are already out there and collecting the bits that are relevant for my app.
Comment: @Simon Aesubis already said he wants a free service instead of iubenda... then you go an plug iubenda. Logical ?

Android app privacy policy


Delay on 12v sort of debouncing circuit?

Question: OK - - i have an opto sensor that runs on 12v (5-30 actually) and that is power by a battery/charge regulator/ 19v power supply and is used for counting how many times somebody goes past it on a site entrance ... HOWEVER .. the counter is sensitive ... and between the opto sensor and the counter you could flap your hand in fromt of it and count upto 20 in a heart beat ... SO  .. id like to limit the amount of inputs the counter receives to 1 every couple of seconds .. even a minute would do ... the pin on the counter ( an 7111hv ) just takes a high input ... the opto sensor (baumer i think) outputs an 11v high on one of its wires when the beam is broken ... but its all fairly low current and im trying not to use relays as i, trying to put the new circuit somewhere on the cable that supplies the opto sensor and id like to keep it from drawing too much current ... anyway ... the opto sensor has 3 wires ... 12v pos and neg plus signal wire ... so in my mind i need a delay on circuit that effectively 'debounces' multiple inputs into one single high so that the counter just sees one 11v signal of whatever length so that it just registers 1 not 2 million :) ... any thoughts ?
Comment: Welcome, to EE.SE. Sorry, maybe English is not your first language but your post is not intelligible. Can you reformat using proper sentences, capitalisation and punctuation?
Comment: Welcome to EE.SE! This appears to be a reverse engineering, modification and/or repair question. Please be aware that this type of question must involve specific troubleshooting steps and demonstrate a good understanding of the underlying design of the device, so that you can ask specific, focused questions that can be answered concisely. More information can be found [here](http://meta.electronics.stackexchange.com/q/2478/11683).
Answer: What you are looking for is a RC filter.  example circuit


System freezes when swapping

Question: I have a raspberry pi which swaps to an external NAS (please don't judge me :) ) over CIFS (link is a direct 100Mbit full duplex Ethernet connection). Swap works fine until a certain threshold which is about 100MB. The system then freezes and network connection with NAS stops. Samba share is mounted with automount. Where do I start if I want to find out why the Pi stops using the swapfile? I dont mind the slowdown because I'm just compiling heavy programs but when it freezes I'm forced to reboot.
Comment: I'm surprised swap to CIFS works *at all*... Swap over network is hard w/o deadlock... Any chance you can use [NBD](https://nbd.sourceforge.io/)? That is supposed to work.
Comment: It "worked" because I set up a loop device, tricking the operating system. NBD is not a choice because my NAS is an ARM and pretty closed as far as firmware is concerned
Comment: If you can't use any of Austin Hemmelgarn's suggestions, you can probably use a separate machine to run a NBD server, with that server writing to the CIFS share... Then you can do swap on NBD. NBD servers are available for just about anything, even Windows. (Performance will no doubt be terrible. I suggest a USB disk attached to the Pi.)
Comment: I tried NFS and it works perfectly. No more freezing.
Answer: Just looking at kernel code, this shouldn't even let you swapon a file that's on a CIFS mount, so I'm rather surprised this works at all.  There are two generic issues with swap on a networked filesystem:

Swap on Linux requires a static block mapping.  This is why swap files can't be sparse unless they use unwritten extents, and why you need a loop device to put a swap file on copy-on-write or log structured filesystems.  You can work around this in theory using a loop device, but that should be a last resort.
Some protocols or authentication setups require userspace components, and if those don't mlock() their entire address space, you may end up in a situation where you can't swap anything because you can't run the userspace code because you have no memory to load it into.

CIFS suffers from the first issue, and also the second if you are using authentication and the system does not maintain a constant connection.
You mentioned you're using a Pi, I'd suggest looking into using ZRAM, and possibly a local swap file (decent SD cards are inexpensive).  You can even use a USB flash drive if need be instead of the SD card.
Alternatively, and more generically, if you have a reasonable NAS system, you could look into swapping via (in general order of preference) NBD, ATA over Ethernet, or iSCSI (which depending on how it's set up on the Pi may also suffer from the second limitation listed above).

System freezes when swapping


End Kernel panic - not syncing: Attempted to kill init

Question: I have a problem when starting my Raspberry Pi (Rasberry Pi 3 Model B). Everything worked fine. After the last reboot I've got this error. Any help would be appreciated.
Comment: On your picture top right corner, the yellow flash is an undervoltage warning. "If the power supply to the Raspberry Pi drops below 4.63V (+/-5%), the following icon is displayed." https://www.raspberrypi.org/documentation/configuration/warning-icons.md
Comment: If you have a spare SD card and flash a new image on to that, does it work OK? Is using a new image an option?
Comment: This portion of the log only shows the CPU stopping after an error. The first error where you'll see a stack trace and more addresses is actually above it. I know the errors may scroll by pretty quickly, but is it possible you can get a picture of the first error before it goes offscreen? Sometimes this comes about due to installing a new kernel module, and can be addressed by removing it. And even if the goal is to get your original system back, Aurora0001's advice still holds. Testing a fresh image can identify whether this is a software or hardware issue.
Comment: Thanks guys. I've followed Aurora0001's advice and everything works. Is it possible to fix old image somehow?
Comment: I think booting from a new SD-Card with a new image is no proper solution. I have exactly the same problem. The RPi booted without any problems. From one day to another I got this error. But most times I won't see anything and the display stays blank. This is the second time one of my sd-cards crashes in this way. That's why I'm interessted in repairing the image instead of formatting the card. It seems to be that the Pi can't read the sd-card properly. Maybe it's a partition problem?
Answer: The problem could have several reasons. Until now I found out the following:

Some 16GB SD-cards seem to have problems after apt-get upgrade && reboot
Have a look at: https://github.com/raspberrypi/linux/issues/1416
Sometimes the power supply causes problems like this. You should try another one if yours is to weak (5V and at least 2 Ampere for Raspberry Pi 3 Model B).
One of the sd-cards partitions could be damaged.
In my case I took the sd-card, mounted it on a Linux system and backuped all my data at first because there is a chance that following commands will produce some data lost on your card.
After that I listed the partition names of the sd-card. Simply open a terminal and type lsblk or df -h
Usally the card name is mmcblk0. In this case the name of the boot partition should be mmcblk0p1 and the name of the root partition mmcblk0p2.
Now you have to unmount them. Type: umount /dev/mmcblk0p*
(no 'umount' is spelled correctly)
After that I run fsck on every partition in this way: sudo fsck /dev/mmcblk0p1 && sudo fsck /dev/mmcblk0p2
This command will check the filesystems of your card and offer you the opportunity to fix errors. In this case you can force the program to fix all errors automatically (type a  Enter) after the first error was found or type y for every single error to fix.
Hopefully your system will boot now.


How to remove the date pattern from tomcat logs

Question: By default Tomcat appends the date to log files e.g., localhost.2010-12-22.log and same with the catalina log.  I don't want the date in the log file and I can't seem to find how to remove it.  The logging documentation doesn't say anything about the date pattern.  Any ideas are greatly appreciated.
http://tomcat.apache.org/tomcat-6.0-doc/logging.html
Comment: This is similar to http://stackoverflow.com/a/6669348/354767
Answer: None of the other answers helped me much, though Thomas's was closest.  The documentation I found was:

http://tomcat.apache.org/tomcat-6.0-doc/logging.html
http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/juli/FileHandler.html

So I added the following to Tomcat's logging.properties file. This removes the date from the localhost logs, and the other three log types that Tomcat dates by default:
    1catalina.org.apache.juli.FileHandler.rotatable = false
   2localhost.org.apache.juli.FileHandler.rotatable = false
     3manager.org.apache.juli.FileHandler.rotatable = false
4host-manager.org.apache.juli.FileHandler.rotatable = false
   #
   # default is true, which causes a date to be added to the filename

    1catalina.org.apache.juli.FileHandler.suffix = log
   2localhost.org.apache.juli.FileHandler.suffix = log
     3manager.org.apache.juli.FileHandler.suffix = log
4host-manager.org.apache.juli.FileHandler.suffix = log
   #
   # default is .log, but without date, the extra dot is not needed

Comment: These properties are also supported by AsyncFileHandler in Tomcat 8.5.
Comment: If the log file does not have an entry in logging.properties it probably is configured using a Valve in the server.xml file. See the answer by SalmanMalik to configure rotation there.
Answer: de_simakov's answer was correct for the most part - but it had a one letter typo. Find a configuration similar to this in conf/server.xml
<Valve className="org.apache.catalina.valves.AccessLogValve"
      directory="logs"  prefix="http_access" suffix="log"  pattern="common"
      rotatable="false" resolveHosts="false" />

Notice the rotatable="false" attribute.
Answer: The documentation you link to is for logging within your application, not for logging by the Tomcat server itself. As mentioned in another answer, the appropriate documentation is here. On an Ubuntu Server system, you'll want to change the settings in /etc/tomcat7/server.xml. This file may be in another location on your system.
A configuration similar to this will prevent Tomcat from putting the date in the log file name -- but it will also prevent your access log from ever being rotated by Tomcat, which is probably a bad idea unless you set up an appropriate logrotate configuration for the server.
<Valve className="org.apache.catalina.valves.AccessLogValve"
      directory="logs"  prefix="http_access" suffix="log"  pattern="common"
      rotateable="false" resolveHosts="false" />

Answer: This should be easy on Tomcat 7: see this docs
renameOnRotate attribute

By default for a rotatable log the active access log file name will
  contain the current timestamp in fileDateFormat. During rotation the
  file is closed and a new file with the next timestamp in the name is
  created and used. When setting renameOnRotate to true, the timestamp
  is no longer part of the active log file name. Only during rotation
  the file is closed and then renamed to include the timestamp. This is
  similar to the behavior of most log frameworks when doing time based
  rotation. Default value: false
Comment: @Dialecticus it did not work for me on modifying _logging.properties_, but **did work** on modifying Valve attributes in _server.xml_
Comment: On my Tomcat 7.0.64 setting either of `fileDateFormat` or `renameOnRotate` in `logging.properties` file makes no difference, as if those properties are ignored. For example if I add the line `1catalina.org.apache.juli.FileHandler.renameOnRotate = true` the log file still has the date in the name.
Answer: The magic property for the default JULI logging in Tomcat is "rotatable".
Usually there are two places where logging is defined in default installations: logging.properties and the server configurations (server.xml).
For the logging.properties you should use this:
1catalina.org.apache.juli.FileHandler.rotatable = false
For the server configuration it would look like this:
<Valve className="org.apache.catalina.valves.AccessLogValve" directory=" prefix="access_log" suffix=".txt" rotatable="false" pattern="%h %l %u %t "%r" %s %b" />
Please look here for further details:
http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Access_Log_Valve
Answer: The more appropriate answer to your direct question is the boolean "renameOnRotate".  The assumption is that you want daily logging, but do not want the timestamp.  This will name the file based on prefix/suffix, and append the timestamp to the log file after the log file has been rotated:
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
           prefix="localhost_access" suffix=".log" renameOnRotate="true"
           pattern="%a %A %h %H %l %m %t %u %U "%r" %s %b " resolveHosts="false" />

Answer: Tomcat's logging is governed by the <Valve> config elements, usually in server.xml or context.xml. These allow you to control things like the data suffix.
Here's the docs for the access log value, which I assume is what you mean by localhost.2010-12-22.log. Not sure about catalina.out, but that must use a similar mechanism.
Comment: I saw that but this isn't the access log.  The localhost log contains webapp logging (e.g. spring failed to load).  The catalina log contains tomcat errors (e.g. web.xml is malformed).
Answer: I know this is old, but for a complete example using logrotate.d, remember to replace  with your tomcat version. You have to edit both, server.xml and logging.properties then edit/create a logrotate config. Also, your path to the config files might be different.
logrotate config:
vi /etc/logrotate.d/tomcat<version>

/var/log/tomcat<version>/catalina.out
{
    daily
    rotate 12
    compress
    copytruncate
    create 640 tomcat adm
}
/var/log/tomcat<version>/*.log
{
    daily
    rotate 12
    compress
    copytruncate
    missingok
    sharedscripts
    postrotate
      if invoke-rc.d tomcat<version> status > /dev/null 2>&1; then \
        invoke-rc.d tomcat<version> restart > /dev/null 2>&1; \
      fi;
    endscript
}

server.xml config: I also removed _log. from the prefix so it becomes localhost_access.log
vi /var/lib/tomcat<version>/conf/server.xml

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
  prefix="localhost_access" suffix=".log" rotatable="false"
  pattern="%h %l %u %t "%r" %s %b" />

logging.properties config:
vi /var/lib/tomcat<version>/conf/logging.properties

1catalina.org.apache.juli.FileHandler.level = FINE
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
1catalina.org.apache.juli.FileHandler.suffix = log
1catalina.org.apache.juli.FileHandler.rotatable = false

2localhost.org.apache.juli.FileHandler.level = FINE
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.
2localhost.org.apache.juli.FileHandler.suffix = log
2localhost.org.apache.juli.FileHandler.rotatable = false

3manager.org.apache.juli.FileHandler.level = FINE
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.
3manager.org.apache.juli.FileHandler.suffix = log
3manager.org.apache.juli.FileHandler.rotatable = false

4host-manager.org.apache.juli.FileHandler.level = FINE
4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.FileHandler.prefix = host-manager.
4host-manager.org.apache.juli.FileHandler.suffix = log
4host-manager.org.apache.juli.FileHandler.rotatable = false

Answer: The answers quoting "renameOnRotate" are wrong. This only applies to the access log, not to the "main" logging (which is what the question wants since he's quoted 'localhost' log.
If you need both log rotation and not to have the timestamps (which is generally the case), the bad news is that it is not possible out of the box with tomcat :(
The best solution in that case is to configure it to use log4j globally, which is more flexible and will allow you to be setup in that way.
Comment: localhost log is the access log, i.e. those logs are the webserver logs (tomcat).


I'm trying to make a module that searches LDAP for users

Question: I want to be able to search LDAP users by first name, last name, or email, and in the results show the user's picture, first/last names, role, and email.  I've looked into it a little and found the LDAP module for drupal, but all I see is syncing with users.  Is this something I can do using this module? Am I going to have to sync the LDAP db with a table in my MySQL db and then reference that table?
Answer: I think you'll find that LDAP modules for Drupal are primarily for allowing LDAP users to use Drupal.
My understanding of what you're saying is that you just want to display the LDAP users, sort of like a directory system?
If Drupal doesn't have to really interact with your LDAP users,  you should be able to create your own module for this pretty easily.
There are quite a few LDAP functions in PHP:  https://www.php.net/manual/en/ref.ldap.php
Create a module that makes use of them, and then passes the data over to a node for display purposes.
Answer: I have toyed alot with the LDAP module. It can do exactly what you want assuming you're not a newb with LDAP or Drupal. I highly recommend you read the official drupal LDAP documentation -- pretty much all your answers may be found there.
If the LDAP module seems complex -- it's in my opinion because LDAP (and the ldap vendors) simply are complex.
The LDAP module lets you connect to and query an LDAP service. It has many submodules:

LDAP Servers. Stores connection information for ldap servers and relationships between ldap and drupal users. Also contains api
  functions for LDAP project.
LDAP User (7.x-2.x branch). Controls provisioning and synching mappings of Drupal user fields and properties to and from LDAP Entry
  attributes.
LDAP Query. Stores individual queries that can be leveraged by other modules such as LDAP Feeds and LDAP Views.
LDAP Authentication. Authentication via user credential checking or single sign on methods such as NTLM.
LDAP Authorization. Conversion of ldap user data to drupal roles, organic group memberships and other authorization consumers.
LDAP Feeds. Fetchers for LDAP Queries and LDAP Users to integrate with Drupal Feeds module.
LDAP Views. Views module integration for LDAP Query resultsets
LDAP Help. Helper module for debugging configuration issues with other LDAP Modules.
LDAP Test (7.x-2.x branch). This is simply for automated test coverage and never needs to be enabled; the simpletests will enable it
  while running. It contains the mock ldap server and related helper
  functions.

I have bolded the key submodules found in the documentation relevant to your question. You can save an LDAP Query (a raw LDAP search query -- this has nothing to do with Drupal and 100% pure LDAP usage knowledge) and use it within a Drupal View or via the Feeds module.
Understanding whether you want a drupal View or leverage the Feeds module to populate a content type or something else is where you're understanding of Drupal will be helpful -- and specifically these 2 modules.
As an example here is a stored query to run against ldap:

And its test result:

EDIT
In short, yes LDAP lets you Sync or create/add LDAP "users" into Drupal. It may also be used to simply query and essentially use and "show" LDAP data on your site. What modules you choose to do that with -- and your approach is up to you (Views or Feeds processing). Writing this stuff from scratch sucks. Use the LDAP modules and the tools outlined here :)


1990s cartoon about going to another dimension

Question: There was this cartoon I watched in 1990s in which the heroes used to wear certain spectacles and were transported to another dimension with green lines in the background. It featured a father, son and others.
Comment: Hi, welcome to SF&F.  What others?  Were all of them transported?  What happened in the other dimension?  Were they seeking something, fighting something, trying to hide?
Answer: A possible answer to this one is The Real Adventures of Jonny Quest; it aired 1996-7 so the timeline fits.
The premise involves the protagonist (Jonny Quest), his father (Dr Benton Quest), friends Hadji Singh and Jessie Bannon, and bodyguard Race Bannon investigating various odd phenomena.
The new twist on the older versions of Jonny Quest was the QuestWorld, a VR environment. I don't recall much of this, but accessing it appears on videos to involve a band of green light covering the eyes; I wouldn't call them spectacles but may be close enough for your memory to recall them as such.
The opening sequence featured green lines very prominently. I don't believe they are always present in the QuestWorld, but do appear to have been a feature in at least some of the scenes set in that world.
Answer: Are you talking about Digimon?

There were many clips of moving between worlds... here's one of the oldest ones:
https://www.dailymotion.com/video/x80dey4
( at 05:30 )
Comment: Hi, welcome to SF&F.  Is there a father and son?  Does the alternate dimension have green lines?
Comment: I added a video that showed some green lights but as I said, there were lots of transition-scenes between the worlds. sometimes when a monster digi-grow it will also have some green lights ( mostly on the old episodes ).

Regarding father/son - there are some episodes where the parents are more involved but it did not happen on most of them. Some of the more memorable episodes (IMHO) did included the parents
Answer:
Maybe the animation you are describing sounds like "Captain N: The Game Master" that aired in the late 1980s and early 1990s. The show featured a teenage youth chosen Kevin Keene the one, in addition to his dog Duke, is transported to the "Videoland" place he becomes the hero "Captain N" and leads a team of characters from differing video games, containing a father and son duo, in battles against the evil Mother Brain.


What is the difference between liquidation and receivership of a company?

Question: What are the legal differences between a company that is in "liquidation" as opposed to "receivership" under Australian law?
Answer: There are 4 types of "insolvency" in Australia, three apply to incorporated entities and the last, bankruptcy, only to individuals.

Receivership A receiver is appointed by a secured creditor, usually a bank, under the terms of the loan. Their job is to manage the company in the interests of the person that appointed them.
Administration An administrator is appointed by the directors (voluntary administration) or, less frequently, by a receiver, liquidator or the court. Their job is to inspect the company and make a recommendation as to if the company should enter a deed of company arrangement with its creditors, be liquidated or, very rarely, be returned to the directors' control.
Liquidation A liquidator's job is to sell of the assets of the company and from the cash generated pay off the creditors and, if anything is left, the shareholders and then deregister the company. A company may also be voluntarily liquidated if it has assets of less than $1,000 and no liabilities.
Bankruptcy an insolvent person can enter into a Personal Insolvency Agreement with their creditors or go bankrupt.


What's the best way to implement a real time show board to show results from concurrent result producers in Java?

Question: I'm making a load test tool that launches multiple thread to simulate load on the target server. Each thread executes a predefined set of commands in the structure of TestSuite - TestCase- TestStep and each level returns results objects (of respective types). Each thread loops its predefined commands, so a series of TestSuite results are generated and it takes a while for all the loops to finish.
I'm trying to find the best way to show results generated in the still running threads. I've thought about a few possible ways:

Use BlockingQueue and producer - consumer pattern. This requires heavy concurrency programming and I haven't been very clear on how I should handle different levels of results - suite results, case results and step results.
Use a concurrent map to hold reference to results, and poll that map periodically to show what's available. This can be very inefficient. How do I just get the new results every time I poll?
Develop a custom Log4J logger, so I can add appenders which will receive results on-the-fly. I haven't researched on how much work is involved if I use this approach. Is it even possible? Considering the level of result types it needs to handle.
Answer: This sounds like a pretty standard multi-threading problem which can be solved by well-established techniques.
My suggestion would be:

Set up a singleton class whose job in life is to log events. Synchronize the methods to ensure it is thread safe.
Have each test regularly call the thread-safe logger to do any logging work. Make sure that the logging message includes a thread ID.

As your logging class is thread-safe, you are free to attach whatever appenders suit.


Making sorting discoverable on a table with no default sort

Question: We have a table that orders results of clients (can be searched on name, address, email, phone, etc.) based on an algorithm, so there isn't a "default" sort we can mark with an arrow to indicate the table is sortable. However, there are two columns that are sortable, but you can only see a sort arrow indicator after you discover that and sort one of them. What is the best way to make this discoverable?
Answer: Tell them with text, or show them with a control.
I don't know what the rest of your UI looks like, but if you need to make it clear, you could try a couple of approaches.

A: UI text can be small, and live above the table, telling them what's possible.
B: Sort control, starting with your applications 'default' (a tricky word here, I know), can show them that a sort is possible. By using the control, the user can always go back to 'default' (meaning your applications algo sort), which might be helpful(?).


Haskell sort function

Question: Why does Haskell's sort of Data.List ignore the third digit?
Prelude>sort ["1","200","234","30"]

["1","200","234","30"]

EDIT: Sorry, I did not realize those were strings. My fault.
Answer: No, but it does sorts strings as it's supposed to do: Lexicographically
The relation "200" < "30" holds for the same reason as "Hello" < "World" does.
So if you want Haskell to sort by the numeric value, you'll have to sort actual numbers.
import Data.List
import Data.Function

sortNumeric = sortBy (compare `on` (read :: String -> Int))

sortNumeric ["1", "200", "234", "30"]

But: Why does your list full of "numbers" contain strings? Consider using a proper [Int] instead.
Answer: I'm no Haskell expert, but it would seem to be doing a lexical sort on strings.  Can you make them integers instead?  (Maybe something like [1, 200, 234, 30]?)
Answer: You are using strings, not numbers.
You should consider parsing the strings to numbers.
Try removing the "" characters and see if it starts working.
Answer: You're sorting strings, not number--it's ordering them "alphabetically", so it sorts by the first character, then the next, and so on. It's the same reason that you'll often see files with names like "File 1", "File 2", ... "File 10", and such sorted "incorrectly".

Haskell sort function


Can matter be annihilated to form kinetic energy

Question: I don't know much about conversion of energy and all, but I had a simple question: Can the energy released by converting matter into energy be used to set other particles in motion (increase their kinetic energy)? If yes, does this imply that particles can travel faster than light?
$$E=E_k$$
$$mc^2=\frac12mv^2$$
$$c^2=\frac12v^2$$ [assuming mass destroyed is equal to mass not destroyed (which will receive the kinetic energy)]
$$2c^2=v^2$$
$$\sqrt{2c^2}=v$$
$$v=\sqrt2c$$
$$v>c$$
Comment: Your formula for kinetic energy doesn't take relativistic effects into account.
Comment: How can the mass that has been annihilated, still be around to receive the kinetic energy? The mass of the lightest particle after the annihilation is many times greater than the mass annihilated.
Comment: Possible duplicates: http://physics.stackexchange.com/q/91501/2451 and links therein.
Comment: Kinetic energy isn't a "stuff", it is a *property of an object or system*. I know, I know. We talk about energy using language that treats it as a thing, but you have to keep in mind that it is not something that you can isolate and say *"Ta da! I have a beaker of energy!"*.
Answer: Yes, and this happens all the time in beta decay.
In beta decay a neutron turns into a proton, an electron and an anti-neutrino. If you add up the masses of the proton, electron and anti-neutrino you get a total mass slightly smaller than the mass of a neutron. This missing mass has been turned into the kinetic energy of the electron and anti-neutrino.
For more on this have a look at my answer to What keeps mass from turning into energy?.
However your suggestion about accelerating a particle to FTL speeds is flawed because you're using the wrong expression for the kinetic energy. The expression $KE = \tfrac{1}{2}mv^2$ is a low energy approximation, and if you're considering speeds approaching the speed of light you need to use the relativistic equation for the total energy (including the rest energy):
$$ E^2 = p^2c^2 + m^2c^4 \tag{1} $$
where $p$ is the relativistic momentum and is given by:
$$ p = \frac{mv}{\sqrt{1 - v^2/c^2}} \tag{2} $$
The total energy, $E$, is equal to $mc^2$ plus the energy from the amount of matter you're proposing to convert to energy, $M$, so:
$$ E = mc^2 + Mc^2 $$
In this case you're suggesting we annihilate an amount of matter equal to the mass of our particle so $M = m$ and therefore $E = 2mc^2$. Putting this in for the energy in equation (1) we get:
$$ 4m^2c^4 = p^2c^2 + m^2c^4 $$
and this simplifies to:
$$ p = mc\sqrt{3} $$
If substitute equation (2) for $p$ we get:
$$ \frac{mv}{\sqrt{1 - v^2/c^2}} = mc\sqrt{3} $$
And this gives:
$$ v = c\sqrt{\tfrac{3}{4}} \approx 0.866c $$
I won't prove it here, but you'll find it takes an infinite amount of energy to get your particle to the speed of light, so however big you make the amount of matter, $M$, you're annihilating you'll never get your particle up to the speed of light.


Hide grey volume overlay when using MPVolumeView?

Question: I've put a MPVolumeView over a movie I'm playing. The trouble is, whenever I adjust the vol using the MPVolumeView, then the standard grey volume overlay appears (the one that appears when you use the rocker switch on the iPhone). Is there a way to disable the standard grey overlay?
Comment: Did you find a solution for this ? Unfortunately, myyellOw's answer didn't work for me.
Comment: @user1349663 I think I've gained some insight into a more repeatable solution. Take a look at my answer below.
Answer: I might be a bit late, but I think I have something useful to add. If you're just looking for an answer, skip to How did I fix it?
What is MPVolumeView?
The MPVolumeView class is used to put a slider onscreen that controls the system volume. It's supposed to prevent the system volume overlay from appearing while it is onscreen, but sometimes does not. I ran into this issue when I added my own MPVolumeView to the view hierarchy, but still saw the overlay appear when I dragged the slider.
How does MPVolumeView tell when it is visible?
This is the question I asked myself. Somehow, the class detects whether or not it is visible, and tells the system to hide or display the system volume overlay accordingly. This is because Apple does not really want you using the class just to prevent the overlay from appearing, without actually displaying the slider UI to the user (as in myell0w's answer).
Here's how I believe MPVolumeView tries to check if it is really visible:

When the view is added to a superview, as detected by viewWillMoveToSuperview: and viewDidMoveToSuperview, it starts a short timer.
When the timer fires, the view traverses its view ancestor tree by recursively examining the superview property.
MPVolumewView checks that each of its ancestors has hidden = NO and alpha greater than some small value (likely 0.05).

There could be other checks that I'm not aware of, since this code is of course closed-source. The timer in step 1 is there so that code like the following will not "fool" the view:
MPVolumeView *volView = [[MPVolumeView alloc] init];
[self.view addSubview:volView];
volView.hidden = YES;

because it will check the hidden property not immediately, but in a bit, after it is already set to YES.
How did I figure all of this out? A key find was that the instance of MPVolumeView was calling isHidden on its superview, as shown in the following stack trace:

What was my problem?
In short, I did something like this:
- (void)viewDidLoad {
    // Add an MPVolumeView to my view
    self.volView = [[MPVolumeView alloc] init];
    [self.view addSubview:self.volView];
    self.volView.hidden = YES;
}

- (void)someButtonTouched {
    // Show the MPVolumeView (and hopefully hide the system overlay)
    self.volView.hidden = NO;
}

But when I dragged the slider of the newly revealed MPVolumeView, the overlay still appeared. I realized that this was because during the MPVolumeView's instantiation, its superview was hidden.
How did I fix it?
Once I had realized how the MPVolumeView class judged whether it was visible, I had an easy way to "fool" it. I added the following method to the class responsible for the MPVolumeView:
- (void)refreshVolumeView {
    [self.volView willMoveToSuperview:self];
    [self.volView didMoveToSuperview];
}

and called it each time I need to force the view to reevaluate whether it was visible. This method simply pretends to re-add the view to the hierarchy. Once I've satisfied the conditions that the view evaluates (each ancestor is not hidden or of very low alpha), I call it, and the overlay stops showing up. In my example code above, I would add one line:
- (void)viewDidLoad {
    // Add an MPVolumeView to my view
    self.volView = [[MPVolumeView alloc] init];
    [self.view addSubview:self.volView];
    self.volView.hidden = YES;
}

- (void)someButtonTouched {
    // Show the MPVolumeView (and hopefully hide the system overlay)
    self.volView.hidden = NO;
    [self refreshVolumeView];  // <<< This line was added
}

Comment: Great answer! Worked like a charm. Thanks.
Comment: You can also just add the view too your key window and place it outside of view.
Comment: @SarenInden yes, but I'd like my users to actually be able to use the control as well.
Comment: @ravron Could you please confirm if this solution still works on iOS 10+
Comment: @WorksOnMine I do not know whether this solution is still valid, but it should be easy to test — I encourage you to do so and report back!
Answer: Normally when a MPVolumeView is visible the HUD doesn't appear. I'm using the following method in my App and it is working fine:
+ (void)preventSystemVolumePopup {
    // Prevent Audio-Change Popus
    MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame:CGRectMake(-2000., -2000., 0.f, 0.f)];
    NSArray *windows = [UIApplication sharedApplication].windows;

    volumeView.alpha = 0.1f;
    volumeView.userInteractionEnabled = NO;

    if (windows.count > 0) {
       [[windows objectAtIndex:0] addSubview:volumeView];
    }
}

It basically just adds a volume view to the first window at a position where nobody can see it and thus prevents the system volume HUD from showing. I wonder why you see this HUD, even though you put a volume view above your movie.
Comment: @myello0w: but when can you change the volume from application?
Answer: This may help.
-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    self.volumeView.hidden = NO;
    [self.volumeView willMoveToSuperview:self.volumeView.superview];
    [self.volumeView didMoveToSuperview];

}

Answer: Easiest way to do this.....
- (void) viewDidLoad
{
    [super viewDidLoad];
    MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame: CGRectZero];
    [self.view addSubview: volumeView];
    ...
}

taken refrence from this thread applicationMusicPlayer volume notification


Should I use singular or plural in this sentence?

Question: Mrs V, together with her children, jog or jogs in the park every weekend.  Thank you.
Answer: To choose between the singular 'jogs' and the plural 'jog', delete the parenthetical clause "together with her children", and consider each verb form.
Mrs V jog in the park
Mrs V jogs in the park
Which one is right? The second one. Mrs V, she of the curiously short surname, is one person, a singular entity.
Comment: Indeed! And if the children were joint subjects, it would be otherwise - "Mrs V and her children jog in the park". This is a handy illustration of the difference between additional subjects and adverbials/prepositional phrases etc, which can be hard for the novice to distinguish - especially when they are parenthetical.


Is it right to say 'You destiny is in your hand'?

Question: Is it right to say 'You destiny is in your hand'?
Or it's better to say 'Your destiny is in your hands?
Comment: As an aside, I have a friend who only has one hand, and he always uses the plural form when saying things like, "I'm going to wash my hands", even though he is only going to wash one hand :)
Comment: *Your hands* is the idiom. *Your hand* doesn't make sense.
Answer: in your hands is a set phrase in this context. Makes sense since it is unlikely you do many important things with only one hand.
So:

Your destiny is in your hands.

Or a famous insurance company slogan:

"You are in good hands with ..."


Does a field gain energy or does the mass/charge?

Question: My textbook reads that when a mass/ charge is moved into the influence of a gravitational/ electric field the field gains/ loses energy rather than the mass/ charge. How can this be explained?
Answer:
My textbook reads that when a mass/ charge is moved into the influence
  of a gravitational/ electric field the field gains/ loses energy
  rather than the mass/ charge. How can this be explained?

$\let\eps=\varepsilon \let\sig=\sigma \def\half{{\textstyle{1 \over 2}}}
\def\cE{\mathcal E}$
In a sense they are both true. They are alternative descriptions of
the same phenomenon. Sometimes one is more useful, sometimes the
other.
Consider e.g. the gravitational case, in the framework of Newtonian
physics. Although it would be possible to think of energy of the
gravitational field, when it comes to computing planets' motions
nobody does it. Instead it helps very much to attribute a gravitational
energy to Sun and planets themselves, as a function of their
reciprocal distances.
In e.m. case both viewpoints may be of use, according to the problem.
Consider e.g. a plane capacitor. Then it's easier to think of energy
as due to the electric field between plates. Maybe you know the
formula:
$$\cE = \half \eps_0 E^2 V \tag1$$
where $V = S\,d$ is volume of space between plates (I assumed a
uniform field).
We may play with eq. (1), using the espression for electric field
$$E = {\sig \over \eps_0}.$$
We find
$$\cE = \half\,\eps_0\,S\,d\,{\sig^2 \over \eps_0^2} =
  {Q^2 d \over 2\,\eps_0\,S} = {Q^2 \over 2\,C}.\tag2$$
I've used $Q = \sig\,S$ and capacity formula:
$$C = {\eps_0\,S \over d}.\tag3$$
Remember that eq. (2) is usually arrived at by another way, so this is
a useful check. But one could turn the argument around, deriving
ffirst (3), then energy (2), and arriving at eq. (1) for energy as a
function of field.
Viewing energy as a property of fields is also important in more
complex cases but I don't write on that because I'm not sure you heard
of the relevant physics (e.g. e.m. waves).


Moved site now only frontpage works

Question: My directory structure is var/www/html and my website was installed in the html folder.  I created a new directory called myfirstwebsite so now the directory structure is var/www/myfirstwebsite.  I am doing this because I am trying to host two different websites using apache virtual host.  I updated the httpd.conf to directory root /var/www and added   Now the front page of the website loads perfectly fine, but the problem is none of the navigation links work (i get the error: requested url was not found on this server).  Anyone have any idea what could be wrong here? I could really use the help.
Comment: Sounds like the .htaccess doesn't work. If you have access to httpd.conf make sure to remove .htaccess and copy all the settings into the vhost conf, so apache doesn't need to read .htaccess on every request. Cheap performance gain.
Comment: thanks for replying.  i am still a beginner at a lot of this, i don't know much about .htaccess.  I figured that might be the problem, my limited understanding is it somehow works with httpd.conf on allowing or denying access.  So if you don't mind can i ask what you mean by remove .htaccess and copy which settings into vhost conf?
Comment: I'm not expert too about this, but I'll give it a try.
Answer: Apache knows at least two different types of configuration:
.htaccess
If apache is configured the right way, you can have a file called .htaccess which contains a lot of configuration settings. Have a look into magentos to get an impression.
The problem is, every time someone requests a page, apache is reading .htaccess (in case something changed). This is slow, but easy to update!
I think your problem is:
To use an htaccess file, you need to define AllowOverride All.
More at digitalOcean
vhost configuration
The better thing is, to put all the configuration into the vhost configuration. The configuration file is read once, when the httpd(eamon) starts and then any changes are only used, if you restart the server (or at least reload the config).
Have a look into the documentation of apache, to know which is a vhost specific configuration and what needs a  entry.
default
I assume there is some kind of default configuration, but no clue.
Comment: thanks now i know what AllowOverrride does.  Unfortunately that wasn't the problem, still getting 404 error.  I think this is the right path though, i'm sure there is something wrong with allowing access somewhere.
Comment: Just write "Allow Over ride" in the .htaccess if you then get a 503 you at least know, that it is read and parsed (not whether you are allowed to change things). But imho you get a 503 too, if you try to change things you are not allowed to.

Moved site now only frontpage works


Is it possible to view detailed GSM information on my Android phone?

Question: I'm trying to find such an app, but I can't, which leads me to suspect that it's not possible, either because of software or hardware limitations. What I'd like to see is a list of cell towers that my phone can reach (both from my carrier and other carriers); signal strengths from each; perhaps an option to lock on to a specific tower or forbid the use of some tower. And, generally, the more data available, the better. So - have I just missed the right app; is there no such thing out there (and I'm free to write the first one); or is such data simply unavailable and I can just give up?
Answer: There is this app called Antennas. It can't do everything you have asked for. But it can show you the tower you are connected to, the signal level, and other towers from you carrier that your phone can see/connect to and their signal level.

Map the GSM/CDMA antennas in your neighborhood. This app monitors the
  GSM/CDMA cellular network connection; displays a map of approximate
  cellular antenna locations and their RF signal strength; and can log
  the data to a text or KML file.
Does not work on Verizon 3G & CDMA Support is limited by Android, not by the application CDMA requires Eclair Works
  best with 2G GSM. 3G/CDMA support is very limited.
Comment: Well, that's at least something. I really wanted to see data about other carriers too though, to see which one has the best signal in my remote location. I guess I can buy cheap pre-paid SIM cards from them... but that's a lot of hassle. :P
Answer: Open Signal Map does some very similar stuff, its accuracy depends on how much data its got for your current area, but seems pretty good in built up areas.
I used it to help work out why I always had such a terrible signal at my parents house, turned out my phone kept connecting to a cell tower on the island you can just see from the end of their road, rather than the cell tower two roads down.
Comment: But they just use statistically gathered data, not what my phone can actually sense, right?
Comment: @Vilx- Yes, but your phone contributes to the data. Even Google doing their coarse location detection via cell-tower triangulation only have statistical, crowd-sourced data (for most phone networks at least). I don't think the phone companies release the exact location details of all their phone masts to anyone.


What time period is used by yahoo finance to calculate beta

Question: On the stock page in yahoo finance, there is specified a beta value for the stock. Now is there a way to know what time period was used to calculate the beta? Is it the trailing 12 months? Does yahoo finance give a way to find beta's for customised time periods?
Comment: +1 - We hear the term all the time, a discussion of its definition or calculation seems appropriate.
Answer: Citing the Yahoo Finance Help page,

Beta: The Beta used is Beta of Equity. Beta is the monthly price
  change of a particular company relative to the monthly price change of
  the S&P500. The time period for Beta is 3 years (36 months) when
  available.

Regarding customised time periods, I do not think so.
Comment: @franktheshark - +1 I edited your answer for formatting only. There's a quote feature that offer the look as shown now. Also, a direct link, no link services. Welcome to money.SE.
Comment: hey how can it be monthly and also for 3 yrs?
Comment: @Kaushik - beta addresses how a stock moves compared to the S&P, it's a volatility calculation. When I first looked at the question, it occurred to me that beta might change over time, and needs a timespan for the calculation, but beta itself shouldn't be thought of as "1 month beta" or "1 year beta", it's a pure number.
Comment: I'm wondering how Google Stock Screener calculates Beta. http://www.google.com/finance/stockscreener
Comment: @Victor123... think of Beta as the correlation coefficient between the stock market (SP500) and the individual stock you're examining. The '3 year' period is the period over which the correlation is calculated.
But the 1 month period is the time over which the data points are taken.
I.e. they don't take the change in daily prices of the SP500 vs change in daily price of the stock and calculate correlation, they use the monthly prices.


How do I tell the difference between bike brands

Question: I have a 20 inch BMX bike. It was given to me with no stickers or identifying marks on it. How do I tell the difference between brands?
Comment: If you post pictures of the bike, we may be able to help. Check the identify-this-bike tag for examples of such posts.
Comment: Do you mean the difference in quality, or the different brand names?
Comment: I would vote to bring you headline and actual question in sync. Do you want general advice on how to distinguish bike brands or ways to identify which bike in question you have. The latter is also awfully localized and should maybe rephrased on how to identify the brand of a given bmx bike.
Answer: You can try to find a serial number engraved somewhere on the bike. For road bike it is sometime under the bottom bracket, so you can try to look there first. Manufacturers might have different serial number pattern so you can start your search there.
Other than that, posting a picture on a forum or here might be a good idea since some people might recognize which  bike it is.
Answer: Basically you can't tell the difference between most BMX "brands" as all of them made in china (exclude of aluminum BMX that are pretty expensive and therefor pretty rare).
The major difference in BMX bikes is quality of their bearings, spokes etc. - things that you can't see.
The only thing you can check (and it is very important to do) is the assembly of the bike. The pedal axle and the fork must be tightened well. If there is play in them, it says that it's assembly wasn't professional (or it was ridden much, if the bike is old). To save the bike in good condition for long time, it's have to be set up.
Comment: I was going to try and edit this, but after several read throughs I am very unclear on what you are trying to say.


Calculating energy loss from laser when shining through a material

Question: When attempting to trap a particle in a laser beam i was able to achieve the effect.

Pretty cool but now when i put of piece of plexiglass that is 1/8" thick i can no longer achieve the effect. The beam hits a focal lens when its diameter is around 6mm and focuses 50mm away. I put the piece if plexiglass 15mm after the focal lens. Now it is obvious that my 25mW laser will lose power but i wonder how, where, and how much? I imagine reflection and scattering accounts for most of it but there is more that plays a part. I want to know if theres a equation that takes a material, thickness, laser wavelength and power and will maybe give me my power on the other side of the material.
Answer: There are a number of things to deal with.  The plexi has a reflectivity of around 4% per surface (see, e.g.   this spec sheet , but minimal absorption.  So pure loss is 8% (but will increase dramatically if you tilt the plexi sheet)
However, if you've placed the sheet between the lens and the focal point, you have not only moved the focus (see "equivalent optical thickness") but almost certainly induced some coma or astigmatism, thus spoiling the power density in the focussed spot.  If you can track down a ray-trace application or even a webpage-based one, you may be able to get an estimate of these effects.
Answer: The equation you are looking for is
$$I(z) = (1-R) \cdot I_0 \cdot e^{-\alpha z}$$
where
$I(z)$: intensity of the laser beam after the distance $z$
$R$: reflectance of material
$I_0$: intensity of laser beam on the surface
$\alpha$: absorption coefficient (NOT the same as absorptance)
$z$: thickness of the material
When you plug the thickness of the plexiglas plate in as $z$, you get the intensity of the laser beam after it passes through the plate.
Note that the equation considers intensity instead of power, so you need to find the beam diameter on the surface of your plexiglas plate.
Further, you need to find the absorption coefficient of the material for the given wavelength. The absorption coefficient (or attenuation coefficient) is not a dimensionless number like the absorptance, but has the dimension $m^{-1}$, so they should not be mixed up.
Comment: Intensity vs. power doesn't really matter, since we assume uniform value of all coefficients across the plexi surface & volume.
Comment: @CarlWitthoft As long as we don't know the beam parameter product of the laser source, I wouldn't neglect the intensity change over 1/8", even if the power stays constant


Does the dark matter halo rotate with the galaxy?

Question: If the dark matter halo is stationary related to the arms of the galaxy then tidal effects should slow the galaxy rotation.
If it rotates with the normal matter in the galaxy then shouldn't it flatten out into a disk?
Answer: It would probably be more proper to say that the galaxy rotates with the dark matter halo, since the mass of the halo is greater than the baryonic mass of the galaxy that we observe. Generally, dark matter halos have triaxial shapes, and shortest axis of the visible part of the galaxy will also be shortest axis of the dark matter halo.
EDIT: I should have been rather more careful. My answer is generally correct, I think, but there may be some more variation than I thought. A paper looking at spin of dark matter halos in the presence of baryons in the Millennium simulation sees a median misalignment between halo and baryonic (visible) galaxy of 30 degrees, and quite a total distribution. They further note that this misalignment seen in simulations will complicate mapping of dark matter halos with lensing measurements.
Comment: Can you say a few words about the source of this? Model, micro-lensing, other?
Comment: There have been some 2-d density profiles of dark matter halos from gravitational lensing. I'm not sure if anyone has stitched together 3-d halo shapes on the basis of lensing and ... not sure what else would be used. I was mainly referencing the standard models of dark matter halos, which mostly seem to agree with observations in areas where they can currently be compared.
Answer: The deduction of Dark Matter is caused by the wrong idea that Kepler's laws would be valid in disc galaxies. In reality however, Kepler is only valid for one large central mass and a tiny orbiting one.
As LeVerrier has proven for our 8 planets, an additional planet will alter that orbit by a precession due to their gravity. For each added planet, all the orbits of the other planets will be altered! This results in Mercury's Newtonian part of its perihelion precession.
However, in disc galaxies, there are many millions of stars that alter each-other's orbits many million times, resulting in orbit speeds that became totally different from Kepler's.
The only way to do it right is to integrate a plausible mass distribution according to Newton's rules of integration, and to calculate the gravity upon a given orbit.
The consequence of that calculus is that the velocity curves of disc galaxies become indeed very flat outside the bulge, as observed.
This is also the reason why no need for Dark Matter was found in the DF2 galaxy cluster. In the case of DF2, the small number of globular clusters in the galaxy are more comparable to our planetary system, which indeed doesn't need any presence of Dark Matter, because the mutual influence of the few cluster's orbits is very limited.
However, the mainstream theory advances that disc galaxies are not stable with stars alone, and that the need of Dark Matter is in any case legitimate, even if the velocity curves are solved. They conclude this because computer simulations result to that.
In order to solve this issue, we need to come to the insight that moving masses are inducing the surroundings by a second gravitational field, just like moving electrons cause induced magnetic fields and Lorentz forces to other moving charges.
This gravitational effect, caused by the velocity of masses, occurs in the bulge of disc galaxies by many fast spinning stars and (pseudo-) black holes, which generate a global gravitational angular momentum in the bulge, transmitted by gravity to the surroundings.
This is not a fancy theory or hypothesis. It has been proven by the Gravity Probe B experiment, which found that the orbital motion and the spin of the Earth cause gyroscopes' axes in satellites to be altered.
The proof of this behavior can be seen in bar galaxies: the bar is in fact caused by a re-oriented gravitational angular momentum of the bulge, after important collapses of stars, which have dramatically increased the spin rates. Hence, the bar is in fact an inclined part of the disc's central part in formation. The gravitational angular momentum will further be transmitted to the rest of the disc, and the whole disc will eventually be re-oriented.
With galaxy clusters, a similar problem arized with the wrong use of the virial theorem. This theorem is applicable if the side with the virial can be set to zero. In the present case, it would be so if either the system is fully cyclic or if the average velocity can be found if the system can be extended to an infinite time.
None of the cases are valid for galaxy clusters, but it is assumed so by the mainstream, and this gives indeed a wrong use of the virial theorem.
Since the virial theorem is used to determine the mass of the system, this estimation will be totally wrong.
With best regards,
Thierry De Mees
http://gsjournal.net/books/De-Mees-Gravitomagnetism-and-Coriolis-Gravity-2011-A4.pdf
http://gsjournal.net/Science-Journals-Papers/Author/58/Thierry,%20De%20Mees
Comment: *The deduction of Dark Matter is caused by the wrong idea that Kepler's laws would be valid in disc galaxies* who says that DM stems from Kepler's laws? Isn't it the measurement of the rotational velocities not matching the *gravitational potential* of the galaxy?


is there a php library to proccess credit card information?

Question: First, I've research this topic and many adjacent topics and know the risks with storing and processing credit card information. We have taken all the necessary steps to harden our servers and we're also PCI Compliment. Now, let's try to stay on topic here :)
Our system will allow our customers to add their bank account information so they can accept payments from their customers. What we're trying to do is support the most popular/common banks for our clients to use. We can't force our clients to use authorize.net and all the other payment gateways, most are old-fashioned and just have a business bank account.
I was trying to find an open source php library where most banks are already setup, but couldn't find anything. Have someone written something like this? of course we will carefully analyse the coding and add our own security features.
Answer: Take a look at Stripe. It's not exactly what you are looking for but somewhat close.


Why do you have to downgrade foreign packages before upgrading Linux Mint?

Question: Just curious, when upgrading from Linux Mint 19 to 20, why is it necessary to downgrade foreign packages? Why can't the upgrade utility simply ignore them? (note: this may be applicable to many Linux disttos, but I only have Mint so that's the only one I can speak to).
Answer: The recommendation isn't to downgrade foreign packages, but to remove them.
Upgrades from one release to another, in any distribution, can involve significant changes to the set of "base" packages that are used. For example, the upgrade from Debian 10 to Debian 11 involves many (automatic) changes to packages to handle the switch from libgcc1 to libgcc-s1. Getting such transitions right, so that the upgrade tools can resolve the set of dependencies and calculate the required upgrade steps, can become rather complex; in fact the GCC transition in Debian took a while to sort out.
These preparations, by definition, can't account for all possible foreign packages, and the maintainers of foreign packages can't be expected to follow all the intricacies during the development of new releases of the distributions they support. In fact, in many cases foreign packages will only start being made available for new releases of distributions once that release has happened, which is too late for at least some upgrading users.
As a result, the recommendation is always to remove foreign packages before upgrading. This reduces the risk of failure in the upgrade process itself. The foreign packages will still be available afterwards, so users can try to reinstall them after the upgrade, or ask the foreign package maintainers to provide updated versions (instead of complaining to the distribution maintainers because the upgrade failed).
Comment: Excellent explanation, thank you! I'm slowly transitioning from Windows, so I guess I'm used to having a Windows program installed, and even if you update from Win Vista to Win 10, for example, it's not like the OS upgrade would really affect installed programs, or vice versa.


fprintd can't login with fingerprint Arch Linux

Question: I have Arch Linux installed with deepin desktop environment and lightdm. Greeter is lightdm-deepin-greeter. I have installed fprintd, configured fingerprint, i can successfully login to sudo with fingerprint, but not login in greeter. I have set files in /etc/pam.d to contain auth sufficient pam_fprintd.so.
Answer: Try to set auth sufficient pam_fprintd.so in /etc/pam.d/lightdm instead of lightdm-greeter, it works for me. BUT that's still far away from unlock with finger from resume to suspended state. In case you may ask about it soon, I afford the useful answers that I gathered here: fprint timing out and  Fingerprint reader doesn't work after sleep.
I personally don't figure out a workaround yet ╮(╯▽╰)╭.
Answer: Do you have your home dir encrypted? If yes, then it is not possible to easy way login with fingerprint.
You need your encryption passphrase to decrypt our home folder and fprintd does not have it. So it can log you in, but with no files in your home. So it just fails.


Sue a restaurant for serving food against religion

Question: I ordered food from a Mexican restaurant through Uber eats . I ordered chicken burrito but they made it beef burrito. I called the restaurant but they said sorry and hung up. What should I do about it any suggestion if I can sue the restaurant serving me beef which is against my religion to eat
Answer: You may sue the restaurant for breach of contract, since your contract with them was for chicken and not beef. If this had been a self pick-up order, you'd get back the cost of the meal and perhaps gas costs, and normally the restaurant would just refund your costs. A bit of a complication is that you involved a third party, so it may be that your contract is with Uber Eats who subcontracts with the Mexican restaurant, indeed since it is likely that you paid Uber, your contract is with Uber, so you need to sue Uber (which you can't do). Though more effective would be to complain to Uber and ask about a refund, and they can take it out of the restaurant's hide.
Your agreement with Uber includes an arbitration clause, which requires you to submit to binding arbitration rather than small claim's court. The core requirement is that "the arbitrator ("Arbitrator"), and not any federal, state, or local court or agency, shall have exclusive authority to resolve any disputes relating to the interpretation, applicability, enforceability or formation of this Arbitration Agreement, including any claim that all or any part of this Arbitration Agreement is void or voidable". If they say "It's not our problem, under the terms of the contract", you have to get the matter sorted out with the arbitrator. So starting with a simple complaint and request for refund from Uber is the wisest first step.
Comment: Do you suppose the contract with Uber actually binds them to deliver the food which you ordered?  I'd guess that, at best, it commits them to transmit your order to the restaurant and bring you whatever food the restaurant comes up with.


Show that $PQ - I_n$ is singular when $Q - I_n$ is not

Question: Let $Q$ be an $n \times n$ real orthogonal matrix and $u \in \mathbf{R}^n$ be a unit vector. Let $P = I_n - 2uu^\top$ be the Householder reflection. Show that if $Q - I_n$ is not singular then $PQ - I_n$ is singular.
Comment: An idea... Not sure it is a good one, but may worth a try. Use the [canonical form](https://en.wikipedia.org/wiki/Orthogonal_matrix#Canonical_form) for $Q$ and then work separately in the two dimensional spaces of the $R_i$ by dealing first with the case $n=2$.
Answer: When $n$ is odd, $Q$ has a fixed point whenever it has determinant $1$. When $n$ is even, $Q$ has a fixed point whenever it has determinant $-1$. These facts can be seen by considering the eigenvalues of $Q$: there are always $n$ of them, they are closed (as a multiset) under conjugation, and they must multiply to the determinant. It follows that, when $Q$ does not have a fixed point, multiplying it by any negative-determinant orthogonal matrix produces a matrix with a fixed point.
Comment: You should clarify that a matrix $M$ has a fixed point if and only if $M-I$ is singular
Comment: Your answer is correct, but not easily readable to an audience that is just learning linear algebra
Answer: This answer isn't as neat as Christopher Gadzinski's, but it gives an explicit non-trivial solution to $(PQ-I)v=0$. Note that
\begin{aligned}
(I-Q)^{-1}+(I-Q^T)^{-1}
&=(I-Q)^{-1}\left[(I-Q^T)+(I-Q)\right](I-Q^T)^{-1}\\
&=(I-Q)^{-1}\left[(I-Q)(I-Q^T)\right](I-Q^T)^{-1}=I.
\end{aligned}
Since the LHS is the double of the symmetric part of $(I-Q)^{-1}$, the above implies that $2(I-Q)^{-1}=I+K$ for some skew-symmetric matrix $K$. Hence $1-2u^T(I-Q)^{-1}u=0$,
\begin{aligned}
-P(PQ-I)(I-Q)^{-1}u
&=(P-Q)(I-Q)^{-1}u\\
&=(I-Q-2uu^T)(I-Q)^{-1}u\\
&=\left[1-2u^T(I-Q)^{-1}u\right]u=0
\end{aligned}
and $PQ-I$ is singular.


iPhone multi-touch move, scale and rotate, how to prevent scale?

Question: I have existing code for tracking multi-touch positions and then moving, rotating and scaling the item - in this case an image - appropriately.
The code works really well and in itself is perfect, however for this particular task, I need the movement and rotation ONLY. I have spent time trying to work out what is going on in this routine, but maths is not my strong point so wanted to see if anyone could assist?
<code>- (CGAffineTransform)incrementalTransformWithTouches:(NSSet *)touches
{
    NSArray *sortedTouches = [[touches allObjects] sortedArrayUsingSelector:@selector(compareAddress:)];
    NSInteger numTouches = [sortedTouches count];

 // No touches
 if (numTouches == 0) {
        return CGAffineTransformIdentity;
    }

 // Single touch
 if (numTouches == 1) {
        UITouch *touch = [sortedTouches objectAtIndex:0];
        CGPoint beginPoint = *(CGPoint *)CFDictionaryGetValue(touchBeginPoints, touch);
        CGPoint currentPoint = [touch locationInView:self.superview];
  return CGAffineTransformMakeTranslation(currentPoint.x - beginPoint.x, currentPoint.y - beginPoint.y);
 }

 // If two or more touches, go with the first two (sorted by address)
 UITouch *touch1 = [sortedTouches objectAtIndex:0];
 UITouch *touch2 = [sortedTouches objectAtIndex:1];

    CGPoint beginPoint1 = *(CGPoint *)CFDictionaryGetValue(touchBeginPoints, touch1);
    CGPoint currentPoint1 = [touch1 locationInView:self.superview];
    CGPoint beginPoint2 = *(CGPoint *)CFDictionaryGetValue(touchBeginPoints, touch2);
    CGPoint currentPoint2 = [touch2 locationInView:self.superview];

 double layerX = self.center.x;
 double layerY = self.center.y;

 double x1 = beginPoint1.x - layerX;
 double y1 = beginPoint1.y - layerY;
 double x2 = beginPoint2.x - layerX;
 double y2 = beginPoint2.y - layerY;
 double x3 = currentPoint1.x - layerX;
 double y3 = currentPoint1.y - layerY;
 double x4 = currentPoint2.x - layerX;
 double y4 = currentPoint2.y - layerY;

 // Solve the system:
 //   [a b t1, -b a t2, 0 0 1] * [x1, y1, 1] = [x3, y3, 1]
 //   [a b t1, -b a t2, 0 0 1] * [x2, y2, 1] = [x4, y4, 1]

 double D = (y1-y2)*(y1-y2) + (x1-x2)*(x1-x2);
 if (D < 0.1) {
        return CGAffineTransformMakeTranslation(x3-x1, y3-y1);
    }

 double a = (y1-y2)*(y3-y4) + (x1-x2)*(x3-x4);
 double b = (y1-y2)*(x3-x4) - (x1-x2)*(y3-y4);
 double tx = (y1*x2 - x1*y2)*(y4-y3) - (x1*x2 + y1*y2)*(x3+x4) + x3*(y2*y2 + x2*x2) + x4*(y1*y1 + x1*x1);
 double ty = (x1*x2 + y1*y2)*(-y4-y3) + (y1*x2 - x1*y2)*(x3-x4) + y3*(y2*y2 + x2*x2) + y4*(y1*y1 + x1*x1);

 return CGAffineTransformMake(a/D, -b/D, b/D, a/D, tx/D, ty/D);
}
</code>
I have tried to read up on the way matrix's work, but cannot figure it out entirely. More likely to be the issue is the calculations, which as I mention is not my strong point.
What I need from this routine is a transform that performs my movement and rotation but ignores scale - so the distance between the 2 finger touch points is ignored and scale is not affected.
I have looked at other routines on the internet to handle multi-touch rotation but all the ones I tried had issues in some way or other (smoothness, jumping when lifting fingers etc), whereas the above code is spot on for move, scale and rotate actions.
Any help appreciated!
Answer: Do something like this:
<code>CGAffineTransform transform = self.view.transform;
float scale = sqrt(transform.a*transform.a + transform.c*transform.c);
self.view.transform = CGAffineTransformScale(transform, 1/scale, 1/scale);
</code>
At the end of your touchesMoved:withEvent: and updateOriginalTransformForTouches methods. Basically, you calculate the current scale value, then multiply your transformation matrix with the reversed scale value.


How to make an ideal diode model in LTspice

Question: I would like to make an ideal diode model and have tried to achieve this using different settings in the .model statement, but there is always a voltage drop. I would like to make an ideal diode with no voltage drop even at mV values.
Comment: You should really take time to read the manual. It may be spartan, but it can help you most of the times. ltwiki.org also has valuable information. In this case, you could have gotten the answer straight from the description of the diode.
Answer: You can use this diode model
.model Didl D(Ron=0.0001 Roff=100G Vfwd=0)
Comment: Setting too low, too high, or a too great difference between the magnitudes of the values, is not recommended, the same way null values can be problematic. To avoid this, you can simply set `Vfwd=1m Ron=1m Roff=1G` and you're set. It's unlikely these values would interfere too much with your circuitry. If you want to avoid possible 'hiccups" due to the ideal sharp knee in the transfer function, you can also add `epsilon=1m revepsilon=1m` to force a convergence-friendly quadratic region. `ilimit`, though useful, should be used with care, as it can cause problems due to the forced limitation.
Comment: Somewhat related - but not really - if you add "Ilimit = " to the parameter list, you can make an ideal diode a current limiter !
Comment: Will this increase with accuracy (to being ideal) as Ron decreases? You can set is using exponential notation i.e. **Ron = 1E-10**.
Comment: @loudnoises for sure you can use 1E-10


In a PN diode, does current flow between the conductors attached to the P and N types valence bands as well as their conduction bands?

Question: Although I've seen the typical no-bias, reverse-bias and forward-bias band diagrams associated with the PN junction and seen the overlapping valence and conduction bands of a typical metallic conductor, I can't find any example that include all four sandwiched together (conductor-Ntype-Ptype-conductor).  I'm curious about the physics of electron flow between the conductors' bands and those of the doped semiconductors in between.  Does that flow include not only their conduction bands, but their valence bands as well?
Answer: If there is no bias, then there is no current flowing in the conductors on the sides of the PN junction. In this case, there is only a drift and diffusion current in the space charge region that cancels each other.
If there is a bias, then there is a net current flowing through the whole structure. In the metallic conductors, the current is carried by the free electrons near the Fermi level. In the N-doped semiconductor, the current is mainly carried by the electrons in the conduction band. In the P-type semiconductor, the current is mainly carried by the holes in the valance band.
Comment: That is correct what you are saying. Depending on the position of the fermilevel in the metal and semiconductor there can be a barrier at the interface. Here you can find a band diagram of the metal-semiconductor contact: https://eng.libretexts.org/Bookshelves/Materials_Science/Supplemental_Modules_(Materials_Science)/Semiconductors/Metal-Semiconductors_Contacts#:~:text=As%20the%20name%20implies%2C%20the,Non%2Drectifying%20Ohmic%20contact
Comment: Thanks.  I agree.  So, you're saying that both valence and conduction bands of the doped semiconductors are able to transmit electrons to and from the conductors' overlapped valence and conduction bands.  And the exception to 'mainly' is minority carrier holes in the N-type valence band and minority carrier electrons in the P-type conduction band produced by thermal ionization?  Does a barrier exist also between the conductors and their respective semiconductors as well?  Can you refer me to a conductor-P-N-conductor band diagram?  Thanks.
Comment: Thanks.  I assume that's a typo at Eq. 3. and should be X = Eo - Ec


Do applications usually use dynamic linked libraries?

Question: If I want to compile an application which needs packages that are not provided by distribution's package manager and I want to generate a distribution package from it, do users who use this distribution package need all those extra libraries installed or will these libraries packed into the binary? I know that it could depend from application to application but how can I recognize if a package needs dynamic linked libraries?
Answer: The ldd command will tell if a binary of yours is using shared libraries. For those that do not belong to a distribution package, it is up to you to either point the users of your package to the location where to download them, or to bundle the libraries in your package which is certainly the simpler way for the users, assuming the library license allows you to do it.
If you bundle them, make sure the binaries you build will find these libraries by using LD_RUN_PATH at compilation time which is a better practice than to rely on LD_LIBRARY_PATH to fix broken executables.
See http://www.eyrie.org/~eagle/notes/rpath.html for details.
Comment: @Alfe Link added
Comment: And if you bundle them, the user (or your install or start script) can set the `LD_LIBRARY_PATH` to point to the location of the libraries.
Comment: @Alfe Answer updated, although suggesting an alternative safer way.
Comment: That's interesting.  Can you point to some documentation on LD_RUN_PATH?
Comment: Due to that information and the link, I can easily ⁺¹ this answer :)
Answer: Most applicaiton on a regular distribution does use libraries and are not compile statically because the overload of RAM and disk would be much more important.
When you include libraries inside a executale it became much more heavy, so the loading of that executable is much more slow and ram costy.
If you want to deploy an application that does not use standard system library and you do not want to install them on your system, you can considered the static compilation so your program will not rely on any system library. The command ldd youprogram will tell you if your program is static or not.
If you want to put your application into a sub folder using the library inside that directory instead the one of the system, you will have to set LD_RUN_PATH when lunching your application to include the library you pack with it and not the system library.


Bitcoin Trading

Question: How can we trade Bitcoins? Please suggest any procedures that could I follow. I am a newbie in this field. I have just started researching about bitcoins. I don't know much about them, like how to earn them, what is the right place to find bitcoins, etc.
Comment: Welcome to Bitcoin SE.  This is a very broad question.  How to trade will depend greatly your legal jurisdiction.  On top of that, you will want to learn about storing and transferring bitcoin.  This site is a great place to start, but you are unlikely to get a single answer that covers all of your questions.  I recommend figuring out the specific questions you have, searching the site for existing answers, and posting new questions if you can't find them.  Best of luck exploring the world of Bitcoin!
Comment: Thank you for help, however I just wanted to earn Bitcoins and trade them.
Comment: You might be interested in this related topic: [I am new to Bitcoin, how can I get started?](http://bitcoin.stackexchange.com/a/22840/5406)
Comment: Thank you for this suggestion. I got good knowledge regarding Bitcoins.
Answer: You can purchase bitcoin from various locations. As you're just starting out, I recommend coinbase. Coinbase is mainly used to easily purchase bitcoins by using credit card or bank transfer. Coinbase owns another website called GDAX, which is used for crypto-currency trarding. I recommend using this as well and get the hang of things like looking at charts to get to know the market. Once you have done so, you can do everything on GDAX, including buying and selling of bitcoin with USD. The good thing is, funds from coinbase and GDAX can be instantly transferred from one to the other.
I should mention that cryptocurrency is very volatile. Before you trade, I recommend you keep up to date with bitcoin news by going to certain places like reddit.com/r/bitcoin and you paper trade.
I hope this helps.

Bitcoin Trading


Powering Atmega328p from 4.5V

Question: I want to use Atmega328p controller to handle some very simple signals. I'm using the chip and not the whole arduino board because it is a lot cheaper. The problem is that chip itself doesn't have voltage regulator so I need to think of a rechargeable power source. My idea is to use 3 rechargeable AA batteries (~4.5V). I read that it can handle somewhere from 1.5V to 5.5V but I also read that clock speed is then reduced and a lot other complications. So, finally, the question, If I were to use described power source, what challenges should I be ready to face and how will it impact the performance and is it even possible to pull it off.
Answer: From the ATmega328P datasheet:

Within the range 2.7 V – 4.5 V, the maximum frequency is a
linear function of Vcc. From this graph, you can compute the minimum
value of Vcc required to run the microcontroller at 16 MHz: it's
3.78 V.
If you do want to run at 16 MHz, in order to emulate an Arduino
Uno, it may become unreliable once the supply voltage drops below
3.78 V, i.e. 1.26 V per cell. Whether this is a serious issue or
not depends on the cell chemistry. For reference, alkalines reach about
1 V at the end of their useful life, and NiCd has about 1.2 V
when fully charged. You will have to find the relevant voltage for the
chemistry you plan to use.
If you can afford running the microcontroller at 8 MHz, then you
will most certainly be safe.
Edit: If you want to run the microcontroller at 8 MHz, and you
are programming it with the Arduino IDE, you have to select a
board/processor combination that runs at 8 MHz. For example,
"Arduino Pro or Pro Mini" / "ATmega328P (3.3V 8MHz)". This will ensure
that the time-related functions (millis(), delay(), etc.) and the
baudrates of Serial.begin() provide the correct timings. Other than
that, the drawback of running at a lower clock speed is that the
CPU-bound functions (computations) take twice as long.
Comment: @Mirakul It also affects your choice of PWM frequencies and UART speeds. But mostly just... everything takes twice as long :)
Comment: +1, but I got 3.6 V.
Comment: @tim: The linear interpolation formula is `Vcc = 2.7 + (f-10)/(20-10)*(4.5-2.7)`.
Comment: Ah, thanks, I see where I went wrong. There are two different gradients which I didn't initially spot and was using the gradient between 1.8 V to 2.7 V to calculate for 16 MHz which is on the second gradient between 2.7 V and 4.5 V.
Comment: What are side effects of running your board at lower clock speeds? I can see that it would be slower but is that really it?
Comment: Personal anecdote: I've observed an ATmega644p running seemingly fine at 20 MHz on only 3.3 V.   You can operate outside the safe operating area, it's just not "safe" outside of it.
Comment: @Mirakul: See edited answer.
Comment: Thank you, that is what I needed.
Answer: They make SEPIC converters that will hold the voltage at 5V for you. The reason for the SEPIC is during charge what happens to the battery voltage and especially if the battery open circuits. If there is no chance for the battery voltage to go to high a boost converter will work just fine. This solution will allow it to run at full speed without degrading performance etc. The new converters are not very expensive and are generally greater than 95% efficient depending on the unit. If you can up the battery voltage things will get a lot more efficient but you would then need to change the boost to a buck, the SEPIC would be fine. I tend to use the China Nanos, they are inexpensive, probably less then your parts and readily available. I have not had problems with them. I like to supply them with about 8 volts via Vin, that gives me the additional filtering of the onboard power supply.
Comment: I am surprised that you claim an efficiency of 95%. The figures I have seen tend to be in the 70 to 90% range, and that is with currents of 500mA, An ATMEGA typically takes a few mA, and with consumption that low, the overheads of the switcher are likely to exceed the throughput (ie efficiency less than 50%).

Powering Atmega328p from 4.5V


what is the easiest way to remove the power supply from a Dell precision-390

Question: The fan in the power supply is making a lot of noise and I need to remove the power supply and inspect it. The wires run under the heat sink, do I need to remove the heat sink to get the wires out?
Comment: you should be able to just disconnect the wires and unscrew the psu from the case.
Answer: Dell service manuals, which have full disassembly instructions, are available online online at support.dell.com. Here's the Precision 390 one: ftp://ftp.dell.com/Manuals/all-products/esuprt_desktop/esuprt_dell_precision_workstation/precision-390_user%27s%20guide_en-us.pdf
Unfortunately, the only relevant instruction appears to be:

Disconnect the DC power cables from the system board and the drives.
Note the routing of the DC power cables underneath the tabs in the
  computer frame as you release the tabs and remove the cables from the
  system  board and drives. You must route these cables properly when
  you replace them to prevent their being pinched or crimped.

If it does turn out that you have to remove the heat sink to get the cables out - page 96 of the service manual - make sure to clean off and replace the thermal paste between the heat sink and processor. (general thermal paste instructions)


SQL Server 2014 "Relocate all files to folder" option

Question: In SQL Server while restoring database .bak file are are two option "Relocate all files to folder" and "Restore As". I can change the location of database using "Restore As" option, what is the purpose of "Relocate all files to folder" option?
Answer: This "Relocate all files to folder" option is like using WITH MOVE to restore a COPY of the same DB, which the [BAK] backup file is derived, on an instance of SQL Server where [the original source DB] it already exists but with no duplicated physical file path and file names, and you can optionally change the logical file names too if you wish to make these values different.
This basically tells it to restore this database from this backup file, but rather than using the metadata SQL recognizes for the restore parameters for the physical (and optionally the logic) file names, use these explicit values instead. This should update the system tables in msdb, etc. accordingly as well.

Relocate all files to folder (1)
Relocates restored files


Does having large chakra reserves for a child ninja indicate what one can achieve as an adult?

Question: Does having a large chakra supply for a child indicate one can potentially gain large chakra supplies for an adult? Does Rock Lee, have the potential for large reserves?
Answer: Strictly, no. It also has to do with training, but given that almost every ninja gets good training,  and some are just born smart like Sasuke, I think yes. Look at what happened to all the Jinchūriki, despite having those massive chakra reserves, they were killed ( but they had Akatsuki members as enemy, so uhh.?)
But it does gives a ninja a good head start if they have large chakra reserves, as that person, if dedicated enough, can practice and excel at any jutsu because they don't have to worry about depleting their chakra.
Just look at Naruto.He practiced and mastered every jutsu not only because of his incredible dedication, but also because he had Kurama's chakra as well.
Rock Lee doesn't seem to have an exceptional chakra reserve. However, he is an amazing Taijutsu user, having opened 6 gates while being a teenager is an incredible feat.
He might have even surpassed Might Gai, and that is saying something, considering Might Gai fought well against Madara.


Set gamemode of a player within a radius to Survival with Command Blocks

Question: I've been trying it for two weeks and it still doesn't work. How do I set the gamemode of a player within a certain radius Survival with Command Blocks?
Comment: What commands have you tried?  Pocket edition or Java editon? What version of Minecraft?
Answer: The way I do it doesn't make a radius, but does make a vicinity. The command to use would be "/gamemode survival @p[dx:,dy:,dz:]" With this command, you have to put the command block in the corner where the numbers imputed ends up outlining your designated area. For example, if you put the command block at 0,0,0 and your dx was 10, dy was 2, and dz was 10 then all coordinates would have that number added on the the 0,0,0 so the complete opposite corner of your area would be x:10, y:2, z:10. Hope this helps.
Answer: If you're playing on minecraft bedrock  edition, the simplest way is to grab two command blocks, assuming you want people to be in survival only when they are within that radius and that the radius is 10 (I'm just using this as an example, replace this number with the radius you actually want to use). Otherwise, just use the first command block and forget the second.
In a repeating command block: gamemode s @a [r=10]
In another repeating command block: gamemode c @a
Edit: Of course, set the first command block to "always active" after placing the second one. Otherwise, you're going to have to use a setblock command to delete it and restart again.
Answer: Give yourself a command block, place it, set it to repeat
Use this command (console):
/gamemode s @a[r=10]

or this command (Java):
/gamemode survival @a[distance=..10]

you can choose any other radius instead of 10.


More than a few hundred NFTs?

Question: Is is possible to use Tezos to make more than 100ish NFTS? Using this template it seems that if over ~100 NFTs are minted, the contracts storage runs out. This is also concerning because it seems if someone transfers an nft to and from someone ~1000 times it will also fill up the contract storage. Is Tezos fundamentally limited by these contract storage constants? If not, how would I modify this contract to allow for potentially unlimited number of NFTS and transfers?
Answer: That is not true, the contract by default allows you to mint as many tokens as you want without the risk to get gas locked.
You probably set the flag assume_consecutive_token_ids to false which creates a set with all created token ids. The default behavior uses a nat which indicates the number of existent tokens.
Templates are not supposed to serve every single use case, users should always use them as references and adapt them to their needs.
Answer: I figured it out. If you add a lot of data to a smart contract you might need to manually raise the Adjust storage limit. This fixes the Status: backtracked
Answer: Contract storage is not bounded, only the storage size difference for each operation is bounded. If you want to go beyond the storage size difference limit you need to either clear some data from the contract storage or split the operation into several ones.

More than a few hundred NFTs?


Is it permissible to use the Xcode 3.0 DeRez and Rez command line tools for purposes other than localization?

Question: I have an Apple Mac that has Mac OS X 10.5.8. On this Mac, Xcode version 3.0 is installed. From what I can tell, there are also the DeRez and Rez command line tools. The Xcode software may have been installed from one or more DVDs that came with the Mac.
In the Xcode documentation (which can be viewed by launching the Xcode application and then choosing Documentation from the Help menu), there is a page, "Command-Line Tools," which mentions the DeRez and Rez tools. The path to this page is ADC Home > Reference Library > Guides > Mac OS X > Mac OS X Technology Overview > Mac OS X Developer Tools >. It may be possible to find this page in the Xcode documentation by doing a full-text search over all documentation sets with the search term "DeRez" (without quotes) and the "Contains" option (as opposed to "Starts With" or "Exact") chosen.
In the "Command-Line Tools" documentation page, there is a "Localization Tools" section. In this section, there is the statement "Table C-15 lists the applications and command-line tools for localizing your own applications." Afterwards, there is a statement about the directory locations of the tools and then there is a table with information about the DeRez, genstrings, and Rez tools. The description for the DeRez tool includes the statement "You can use this utility to find strings for localization purposes, for example." The description for the Rez tool includes the statement "You can use Rez to recompile the resource files you decompiled with DeRez after you have localized the strings." Given these statements about localizing and this categorization of the DeRez and Rez tools, the following question comes up:
Is it permissible under the licensing for the Xcode software and the DeRez and Rez command-line tools to use the DeRez and Rez tools for purposes other than localization (or, put another way, for purposes that do not involve localization)?
I have a software project and there is a resource file (with the .rsrc extension) in the project. For the purposes of this posting, I am using the name MyGreatProject.rsrc to refer to the file. One way to edit resources in the file or to add new resources to the file would be to use DeRez to decompile the file into a Rez source file with a command along the lines of DeRez -useDF MyGreatProject.rsrc Carbon.r > MyGreatProject.r. (As a side note, when using the DeRez or Rez tools, it would hopefully be permissible to refer to an Apple-supplied Rez type declaration file such as Carbon.r in order to make the Rez source file contents easier to understand. The DeRez man page talks about the function of type declaration files. Also, I hope this command line example does not implicate any copyrights regarding the DeRez man page or the Rez man page.) After that step, it would be possible to add or edit or remove resources by editing the MyGreatProject.r Rez source file. After that, it would be possible to regenerate the MyGreatProject.rsrc file by using a command along the lines of Rez -useDF Carbon.r MyGreatProject.r -o MyGreatProject.rsrc. (Once again, I hope this command example does not pose any copyright issues regarding the DeRez man page or the Rez man page.)
Answer: Yes, that is definitely permissible.


How to judge the distance of nodes in biological evolution tree

Question: I would like to know the method of judging the distance between two nodes in the phylogenetic tree. For example, in the diagram below, is node 299 closer to node 151, or closer to node 201?
Comment: Welcome to SE Biology. Please finish reading the [Tour] to find out how this site works, and the Help on asking questions. Generally we like posters to research questions before posting and explain why they were unable to find an answer. Did you?
Answer: It depends somewhat what you mean by "closer", but phylogenetic distances are usually judged by "branch length". By this logic, just eyeballing it, node299 is almost certainly closer to node151 than node201.
This means roughly "how far you have to travel up and down the tree to connect 2 nodes". From node299, it looks like you have to actually go back down the tree to pass through node151 to get to node201, so node151 is really in the middle here. Note that branches represent evolutionary time, so that the branch length distance between two descendants of the same ancestor can be expected to be around twice the evolutionary time experienced by each descendant relative to ancestor.
The arrangement of the tree in the left to right axis is arbitrary, for example for any subgroup you can flip it 180º and there is no change in the actual topology of the tree.
This is harder to see in a circular layout like this, but in a standard cladogram it is more obvious:

As one example, you can take the "Dinosauria" clade and flip it so that the chicken is closer to the the crocodile, and there is no difference.
In this specific case, you are noting the "root" of the tree as one of your nodes (node151). The placement of the root is generally the most uncertain/poorly estimated part of the tree, so making arguments based on it is non-ideal, but from the point of view of computation, the answer is unambiguous.
Comment: Thanks a lot for your answer. But I have another problem. I want to know why the distance between two nodes evolved from the same ancestor is farther than the distance between the two nodes and the ancestor node.
Is this situation caused by the introduction of genes from other species during the evolution of these two nodes?
Comment: @rona not sure that i understand. The distance (ancestor to descendant 1) or (ancestor to descendant 2) is always going to be shorter than the distance (ancestor to descendant 1) + (ancestor to descendant 2), if we're talking about the same ancestor. Negative branch lengths are technically possible but so rare they're not worth considering. Each of those lineages has experienced evolutionary time. Updated answer in bold to be explicit.


Custom Authentication - WS02 Identity

Question: I am planning to use WSO2 Identity Server as an Oauth2 provider. However the authentication is to be provided by my enterprise service which uses SOAP Protocol.
Basically I have to send a username/password combination to my service and it provides an authentication response. I understand that I need to implement a custom authenticator but I am not sure how to plug into ws02 IS, having read some of the custom auth docs. The questions are the following

Should I implement a LocalApplicationAuthenticator or FederatedApplicationHandler ?
I understand there is a method called canHandle() in AuthenticationHandler but not sure what to write in my scenario.
What are the various configurations that I need to apply to make custom authentication handler work?
Can I build my custom authentication handler as a normal jar file since I am not comfortable building OSGI bundles?

Thanks
Answer: I'd suggest to implement a custom user store, see:
http://pushpalankajaya.blogspot.be/2013/09/how-to-write-custom-user-store-manager.html
there is a method 'doAuthenticate' you may implement as you see fit.
Have fun
g.

Custom Authentication - WS02 Identity