Why doesn't the stock price fall after the record date for a company splitting stock?

Question: Consider Nvidia — they are splitting their stock 4:1 through a stock dividend. What was preventing someone from buying a share before ex dividend, holding it past the record date and selling, only to receive 3 new shares on the payout date? Why wouldn't instead the price fall to counteract this? It seems like an easy way to make 75%. Instead Nvidia traded higher in this time? What am I missing?
Comment: Refer to [NVIDIA 2021 Stock Split FAQ](https://investor.nvidia.com/files/doc_downloads/doc_faq/06/21/NVIDIA-2021-Stock-Split-FAQ.pdf)
Comment: [Duplicate question](https://money.stackexchange.com/questions/129819/when-am-i-entitled-to-participate-in-a-stock-split-record-date-split-date-e)?
Answer: That's not how splits (or dividends) work. If you own one share of stock worth $100 and it does a 4-1 split, you will (eventually) have 4 shares worth $25 each. Anyone who buys stock before the split is effective gets the $100 shares; anyone who buys shares after the split is effective gets $25 shares. There's no arbitrage opportunity.
Same for a dividend. If your $100 stock pays a $5 dividend, after you the dividend is effective you will have stock that's worth $95 and (eventually) $5 in cash. Again, there's no arbitrage opportunity. Either you get $100 stock and a dividend or $95 and no dividend. (There are timing differences between when the dividend is announced, effective, and paid, but that's not germane to the arbitrage question).
Stock dividends have the same dilutive effect on the original shares, so a "3 share" dividend is the same as a 4-1 split from the shareholder's perspective. The original share represents a fourth of the ownership that it did, so they are worth 1/4 of their original value, with the other 3/4 "given" back to you in the form of additional shares.
The difference between a stock dividend and a stock split is that with a stock dividend, the _company pays cash for the new shares. So instead of just splitting the ownership into smaller pieces, the company uses cash to provide additional pieces to its owners. One benefit of this is that owners will benefit from future growth, versus a cash dividend where the cash is completely out the door.
Comment: So between the record date and the payout date if you buy a share, how does that translate to holding the same value post split if you don't get the dividend? I'm wondering about the mechanics. Is the price of your share just never adjusted down?
Comment: Suppose there's a company worth $100 per share and it announces a $5 dividend. If you buy the stock before the record date you pay $100 to get the stock and get a $5 dividend, which leaves you with a $95 stock. If you buy after the record date you pay $95 for the stock and get no dividend. So your ending wealth is the same in either scenario.  You have $95 less cash and a $95 stock.
Comment: I understand that for the monetary dividend. I think my confusion comes with the price adjustment post split. If I buy a share at $100 between the record date and the split date, after the split date will that price not be marked down to $50 (in a 1:2 split)? If you don't get the share dividend (2 new shares worth 50 each) how will the old value be reflected in my brokerage account? Is my price never adjusted?
Comment: You won't buy a share for $100 after the record date. _Before_ the record date you'll pay $100 for shares and get a second share eventually, ending up with 2 $50 shares. After the record date you should pay $50 for the shares and you won't get a dividend (stock or cash). How the broker reflects that I'm not certain, but there's no "free money", no profit, and thus no immediate tax effect.
Comment: Your shares don't actually split. Instead, you receive *new* shares to bring your total count up to 4x your holding on the record date. If you sell any shares between the record date and the split date, your broker forwards the corresponding new shares to the new owner. Only on the morning of the split date, once all parties have received the new shares they are entitled to, is the price adjusted to be 25% of the previous night's closing price. (1/2)
Comment: So effectively, the record date means nothing to you personally; it only determines who receives new shares directly from the company and who receives new shares from the broker of the person they bought shares from. (2/2)
Answer: As in most cases of splits, the stock price history is adjusted to the new stock volume and this avoids dramatic movements in the stock price.
Comment: How does this answer the question? The OP is not asking about "stock price history".
Comment: @flux the title suggests so. The OP thinks that the stock price didn't move, it did. The historical price was updated with the new number of shares.
Comment: This misses the mark a little bit- see my comment to mhoran below.
Comment: This answer explains how historical data is adjusted due to a stock split in order to maintain price continuity.  This has nothing to do with the OP's question.
Answer: If just before the split was announced you had 10 shares and the price was $100 per share, then your investment was worth $1,000.
If shortly after the split was announced it started going up and at the key moment of the split it was worth $120 per share your investment would be worth $1,200.
Just after the key moment you would now have 40 shares and they would be worth $30 per share. You investment would be worth $1,200. the number of shares is multiplied by 4 and the price is divided by 4. The splitting event doesn't change the worth of any investors investment.
This is covered in the NVIDIA 2021 Stock Split Frequently Asked Questions:

What is a four-for-one stock split in the form of a stock dividend?
A
stock dividend is a common way to implement a stock split. On the
distribution date, holders of the company's common stock will receive
three shares for each share they hold as of the record date. The
result will be a stock split where what was once one share is now four
shares, and the trading price will be divided by four.

Splitting doesn't make investors rich. It is the movement because of the announcement, and the belief that it is a good thing that increases the value of the investment. Buying between the announcement and the key moment allows some current investors to cash out, or people who buy quickly to make a profit during the short time they own the shares.
Comment: Let's ignore share price movement before and after the split as well as the details about record date, ex-date and pay date.  If a $100 stock splits 4 for one, if you own 100 shares (worth $10k), when it splits, you end up with 400 shares at $25, also worth $10k.  The simple answer is that if you pay the pre split price, you participate in the split.  If you pay the post split price, you do not participate.  There are no free lunches.
Comment: Thanks for the response. I understand that- and I know that the split doesn't affect the value of the company. My question is more along the lines of timing of buys and sells though to take advantage of the dividend. It could also be looked at by asking why anyone would buy the shares after the record date and before the split goes into effect- they would pay full price and immediately have the value slashed upon the split date as they don't receive the dividend.
Answer: Selling shares between the record date and the distribution date also sells the right to claim the special dividend that was afforded to the owner on the date of record. If you buy shares during this period you also participate in the split.

Why doesn’t the stock price fall after the record date for a company splitting stock?


Linear programming solution

Question: How to prove a linear program that is feasible and bounded is maximised at one of the basic feasible solution?
Comment: If you have 2 variables this is easy. How many variables do you have? I guess you should change the wording of the question to something like "How to prove that a given feasible solution to maximize the objective function is one of the maximum solutions".
Answer: See for example the textbook Linear Programming by V. Chvatal.  Chvatal proves this theorem constructively.  The simplex method with an appropriate anti-cycling pivot selection rule (e.g. lexicographic or Bland's rule) terminates in one of three states (1) the LP has an optimal basic feasible solution (BFS), (2) the LP is unbounded, or (3) the LP is infeasible (this is detected in phase I.)

Linear programming solution


Share folder from Ubuntu Virtualbox to Windows host

Question: My host is Windows 7, and VM is Ubuntu 12.04. I use it for web development and I need to make Git repo from virtual HDD visible for the host OS to edit files on the host.
What is the best way to do it?
Answer: There are two straight forward ways to accomplish this that are independent of the virtualization software that you are using.
1. set up a samba share folder on the guest and then add it like a shared network folder on the host.
2. Share a folder on the Windows host and then use samba to open/map it on the Ubuntu guest.
Virtual box, and I believe VMWare have an option to share folders between guest and host that uses this underlying setup but is all done through the gui of the virtualization software.
To be more specific I would need to know what path you would like to take.  Option 1 would best match the paradigm of guest to host.
Comment: It looks like you will have to set up a samba share on the guest then.  Here is a link that covers the basic install of samba and configuration of a shared folder: https://help.ubuntu.com/10.04/serverguide/samba-fileserver.html watch out for this line in the instructions as ti will kill the permissions and I dontt think it is necessary $sudo chown nobody.nogroup /srv/samba/share/
Comment: Unfortunately, SAMBA share from Virtualbox's GUI doesn't preserve file permissions because all files are located at NTFS drive. If I do `git diff`, I get many messages about file permission changes.
Thus I need some solution on the guest side.
Comment: Updated link to the ubuntu Samba file server docs: https://help.ubuntu.com/lts/serverguide/samba-fileserver.html
Answer: Right click the virtual machine in VirtualBox and select Settings. You'll see the dialog below with a button to add a shared folder.
Comment: In that case, you're talking about normal networking and virtualization is irrelevant. You might want to simply use Samba.
Comment: Thank you for your comment, but this solution doesn't preserve file permissions, because files are located at NTFS partition. I need another solution on the guest side.


Is the word "uncle-in-law" used?

Question: Is the word "uncle-in-law" commonly used when talking about the husband married to your mother's sister?
Or is this person typically still called your "uncle", even though the person is not a blood relative?
Answer: No, not in my experience.  My mother doesn't have a sister, but my father does, and his sister's husband has always been "Uncle Jim" to me.  I would not occur to me to use the term "uncle-in-law" for him.
Indeed, I would assume it would refer to someone who is the uncle of my spouse.  That is, it seems to me that, if we used such term, my spouse's parent's sibling or my spouse's parent's sibling's spouse would be my "uncle-in-law".  But we really don't.
Answer: I have never heard "in-law" used with aunt or uncle.
When you say "commonly used" in your question, this is how I think of it.
As such we used "aunt" or "uncle" for (generally) older relatives that were not direct relatives (immediate family, cousin, nephew, neice etc.), especially if the relationship was somewhat distant.
Relation by marriage did not make any difference.
Of course, you could have an aunt or uncle (-in-law) that is younger than you. In this case you would call that person aunt or uncle, as a statement of the actual relationship.
When I was a youngster one side of my family was quite extended. "Aunt" and "Uncle" were used so much.
Answer: My mother's sister's late husband was my uncle.
In American English, the suffix "-in-law" is commonly used as part of these words:

father-in-law
mother-in-law
brother-in-law
sister-in-law
son-in-law
daughter-in-law

Similarly, the prefix "step-" is commonly used as part of these words:

stepfather
stepmother
stepbrother
stepsister
stepson
stepdaughter

The terms "aunt", "uncle", and "cousin" are more general, and most Americans do not expect to know immediately the exact degree of kinship.  If it is important to say, one could say something like "She is my wife's aunt" or "She is my father's brother's second wife" or "She is my wife's stepmother."
"Cousin" can include someone who is several degrees removed.  For example, I can refer to my "third cousin once removed" as a "cousin".
I can even call someone who is probably distantly related to me (such as someone from my paternal grandmother's ancestral township who shares a family name) a "cousin" or "long-lost cousin".  However, this can be taken too far, and risks being thought "presumptuous".
Indeed, the terms "aunt" and "uncle" are often used for people who are "family friends", and are not relatives.  For example, suppose a family has a small child, and is on friendly terms with an (adult) neighbor.  Suppose they let the neighbor baby-sit the child.  The family might teach the child to call the neighbor "Uncle Jack" -- even though there is no relationship by blood or marriage -- to encourage the child to treat the neighbor with the same respect that the child treats his or her parents' siblings.
Answer: I've never heard Uncle-in-law used, although I would be able to figure out the relationship if I heard the term. In person, I would always call my mother's sister's husband Uncle. If I'm describing the relationship to an outsider, I would call him my mother's sister's husband, not my uncle-in-law. In-law is normally only used with brother-sister relations, or parent-child.
Also, I'd only use in-law with close family. So my brother's wife is my sister-in-law, but her sister is just my brother's sister-in-law, not mine.
Answer: According to Google Ngrams, 'uncle-in-law' is used about as much as 'aunt's husband'.
I occasionally use 'uncle-in-law'. My wife (who is Korean) and I (who am Australian) have been hosting her niece (who is Korean) while she studied at high school in Australia. When signing official documents together, I would add (aunt) after my wife's signature and printed name, and (uncle-in-law) after mine.
I also very occasionally use 'aunt-in-law' (I have never been as close to her as I was to my (deceased) uncle, 'niece-in-law' and 'nephew-in-law'. 'Cousin-in-law' also exists (and, is the most common of all these).
There is an ambiguity in all of these. 'Uncle-in-law' could be my aunt's husband (just as 'brother-in-law' could be my sister's husband) or my spouse's uncle (just as 'brother-in-law' could be my spouse's brother). In any case, we have the possibility of specifying: 'my mother's sister's husband' v 'my father's sister's husband' etc.
Comment: Note that [comparing with *uncle*](https://books.google.com/ngrams/graph?content=uncle-in-law%2Caunt%27s+husband%2Cuncle%2Cwife%27s+uncle%2C+husband%27s+uncle%2C+spouse%27s+uncle&year_start=1800&year_end=2000&corpus=15&smoothing=3&share=&direct_url=t1%3B%2Cuncle%20-%20in%20-%20law%3B%2Cc0%3B.t1%3B%2Caunt%20%27s%20husband%3B%2Cc0%3B.t1%3B%2Cuncle%3B%2Cc0%3B.t1%3B%2Cwife%20%27s%20uncle%3B%2Cc0%3B.t1%3B%2Chusband%20%27s%20uncle%3B%2Cc0%3B.t1%3B%2Cspouse%20%27s%20uncle%3B%2Cc0), both are vanishingly rare, which strongly suggests that uncle is the preferred term.
Answer: Before answering that, uncle is always used for people who are older than you. So your Father's brother is uncle as well as your Father's friend, who is not blood related is also called uncle.

uncle-in-law for a person married to mother's sister

Is technically correct but you will not find anyone using it. Since the meaning stays the same as simply uncle, people tend to use the latter only.
Comment: "_uncle is always used for people who are __older__ than you and are possibly engaged in a relationship_" (my emphasis) I don't think this is true. See [Collins](http://www.collinsdictionary.com/dictionary/english/uncle?showCookiePolicy=true). If my grandmother were to have a son tomorrow, he would still be my uncle, regardless of age and how unusual the circumstances. And he doesn't need to be in a relationship.
Comment: @jimsug Then that is perhaps your way of looking at the definition, although after your persuasion I also doubt the usage only when the person is married and so I would remove it from my answer but I still stand for when the person is elder to you, a younger *uncle* may formally be an *uncle* but you wouldn't really call him that.
Comment: @Invoker, you seem to be conflating _the name for somone's relation to you_ with _how you address them_.  Your grandfather's infant child is your uncle, but you will not conventionally address him as "Uncle".  The asker only mentioned the former, not the latter.  Also, your answer is ambiguous as to whether or not you meant to say that all older adults are referred to as "uncles", which is false.
Comment: @jimsug Not really, if you call someone uncle, the description is most probably somewhat around how I described him, if not, then he will himself tell you to stop calling him uncle. According to your example, Will you call a 1 year baby your uncle? Dictionaries are one thing, user experience is another, if dictionaries could salve all things then there wouldn't exist such a forum.
Comment: So then... how would you describe that relationship? And, let's say that he grows up and then is in a relationship... what do I call him? What does he call me? While there doesn't have to be a name for every single familial relationship, he would still be my uncle. At the very least, the person does _not_ need to be in a relationship - I called my uncles "uncle" long before they got married, or were in a relationship ie: relationship status didn't factor into it at all.

Is the word "uncle-in-law" used?


Why is the movie named Maratonci trče počasni krug (in English The Marathon Family)?

Question: The literal meaning of The Marathon Family's original title, Maratonci trče počasni krug, could be translated as something like "Marathoners running a lap of honor". How does the title correspond to the movie?
Answer: Movie title is ironic because Marathoners run 42,195 km (in standard race) and they don't have the energy to run the lap of honor. Movie is black comedy so title fits. Marathoners are sixs generations of family Topalović. Movie ends in bloodshed, so its their "final lap".


Kubernetes operators

Question: https://www.openshift.com/learn/topics/operators
An Operator is a method of packaging, deploying and managing a Kubernetes-native application.
I'd like to understand if the application binary itself is packaged into the operator or is the application binary available somewhere else (for eg: an image registry) and the operator knows how to fetch the application binary ?
I'd appreciate your help with this .
Answer: The binary is NOT packaged into the operator, and typically the operator does not fetch the binary either.  You install the 'operand' and then you install the operator.  This may be facilitated by Helm - either one chart or two.
The operator needs to find what it's operating on. It may be as simple as 'all XYZ applications in the same k8s namespace', or maybe it's specified via labels, annotations, etc.

Kubernetes operators


What are the differences between EAV and Flat catalogs?

Question: Can anyone provide a clarification on the differences between EAV and Flat catalogs, when accessing the sub categories of a category?
Answer: If flat catalog is enabled, then in any product list the flat tables will be used. The flat tables are generated one per store view when rebuilding the flat index. They contain all the attributes marked as 'Used in product listing', one column for each attribute. This is a big boost in performance because instead of a lot of joins to get the product attributes Magento only reads from one table (actually 2, the flat table and the prices index table).
IN the product view page the flat table is not used. Instead all the attributes are loaded from the EAV tables.
Comment: Flat Catalog, and any flat table = The old keyed relational database we've come to know and love. And pulling EAV data into flat tables has been the way to speed up data access from EAV since **way back** when EAV was conceived.
Answer: Your EAV attribute is used as a column of flat table (catalog_product_flat_*) if:

Use In Layered Navigation ->not No
Use for Promo Rule Conditions ->yes
Used in Product Listing ->yes
Used for Sorting in Product Listing ->yes
Attribute type is 'static'
And attribute is system attribute like [status, tax_class_id, price, weight]

Flat tables have great performance rather than multiple joins of EAV structure when loading collection of products.
Flat tables of category (catalog_category_flat_store_*) is also like above.
Answer: Eav ;-
EAV is an entity attribute value database model, where data is fully in normalized form. Each column data value is stored in their respective data type table.
Flat table
the Flat model uses only one table, therefore it's not normalized and uses more database space. It clears the EAV overhead
Note:- For small quantity data we use Flat table insted of EAV table, because EAV take more space that the flat table so getting data from a single table is faster that the Eav table


Can Ubuntu open and run Microsoft Word files?

Question: Looking at converting from Windows XP to Ubuntu.  Need to know if Ubuntu can open and update Microsoft Word files.
Comment: Yep, That's why Libreoffice is for?
Comment: No, Ubuntu can not (just as XP can not open Word document). Libreoffice can (and Office can). And you can install libreoffice on XP too so you can even check it upfront.
Answer: To be frank there's a lot of issues with .doc and .docx formats in LibreOffice. If your MS Office files are simple text files, it won't give you trouble. But if it contains images, specially the .docx files, you might have a frustrating experience with LibreOffice.
You can do all the things in LibreOffice that you do in MS Office. But first thing is you need to get rid of doc/docx file formats. Open Document Tex (.odt) is the default file format in LibreOffice and it is great. It even works with MS Office.
However, if you want to stick to the doc/docx file format, you can even install MS Office in ubuntu. There's a provision for that.
Comment: What does "There's a provision for that" mean?  Who's making a provision?
Comment: I meant Wine or Play on linux.
Answer: Apache Open Office, and LibreOffice are both freely available for Ubuntu. While they do support editing/creating word documents in .doc and .docx formats their support isn't 100%. If you want to test them out first to see if this will affect you both Apache Open Office, and LibreOffice are also available for Windows. Another option would be to try running Microsoft Office in Wine. Wine is a program that attempts to act a compatibility layer so that you can run Windows programs on Linux operating systems. Some programs work, some sort of work, and some don't work at all. I've never tried Office in Wine so I don't know if it works.
LibreOffice: http://www.libreoffice.org/
LibreOffice Direct Download Link (An Official Mirror): http://tdf.mirror.rafal.ca/libreoffice/stable/4.2.4/win/x86/LibreOffice_4.2.4_Win_x86.msi
Apache Open Office = https://www.openoffice.org/
Apache Open Office Direct Download Link (An Official Mirror): http://softlayer-dal.dl.sourceforge.net/project/openofficeorg.mirror/4.1.0/binaries/en-US/Apache_OpenOffice_4.1.0_Win_x86_install_en-US.exe
Comment: Please note that LibreOffice is pre-installed with Ubuntu.
Comment: Why should I download the msi or exe for Ubuntu where there are native binaries?
Comment: The context behind this answer's links to .exe and .msi files is to make it easier for *Windows users considering switching to Ubuntu* to try out OpenOffice or LibreOffice on Windows, so as to discover if it suits their needs. (mango has not suggested installing the Windows versions of those programs in Ubuntu.) With that said, the specific .msi and .exe links in this answer should probably still not be used (even in Windows) as they're obsolete: newer versions of both have come out. (We could update the links in this answer, by editing... but they'd just become obsolete again soon.)
Answer: Yes it can, Ubuntu comes with Libreoffice writer installed it can open ms word files and can save them to ms word document format it supports .doc and also .docx format. Libreoffice is freeware and preinstalled so no need to install it.
Comment: Notice although that compatibility is not 100%, sometime in very basic things (highlighting is one example). You can still use MS Office with wine or Codeweavers crossover (which works quite well).
Answer: I almost never use Microsoft Word these days as Google Docs (free if you have a Gmail account) works simply and straightforwardly in the browser on Windows, Ubuntu, Mac OS X and even on tablet devices. The other advantage your data is stored in the Cloud and therefore automatically backed up and available from wherever you need it.
If you go down this route I would recommend you download and install the Chrome browser in place of the default Firefox to get the most out of the features.
LibreOffice though is definitely a competent alternative Microsoft Word, and as noted is installed as standard in Ubuntu.
Whilst the use of open file formats is to commended you may find Windows / Word stalwarts (especially ones running older versions) complaining when they receive files with unusual extensions!
Answer: As already mentioned, as long as the .doc/.docx files are simple structured you won't have big issues. That changes with the complexity of the .dox/.docx files. A further headache is the collaboration with other users who use MS-Word only on their Windows or Apple machine or even work with customers.


How to verify if money was sent

Question: My friend was supposed to send me $800 last night. He says he sent itAs that make up ever see this as he sucked bitcoin but it doesn't show where it was sent. And my account which is new and doesn't show anything in it. It's just someone I can speak with to verify whether this occurred or not?
Comment: Hi @Rob martin, what wallet software are you using?
Answer: If you have an address or transaction id, you can look that up on a block explorer like blockchain.info. Also, you may have to wait for several confirmations (depending on your wallet) before your wallet software will count it towards your balance (each confirmation takes about 10 minutes on average).

How to verify if money was sent


Different between dual booting alongside window 10 and something else

Question: I want to dual boot ubuntu on preinstalled windows 10 but when i watch few videos on youtube I saw some are dual booting alongside windows and some are doing by manually partition(something else).
what is different between alongside installation and by doing something else
Answer: When you choose dual boot along-side of the windows linux is installed on the largest unallocated space
 whereas, choosing manually partition you can manage the partition size and then install on the partation of your choice.
See furhter desription
here
Answer: When you install Ubuntu, you are asked to chose install along side, which is basically automatic way of installing ; you let the installer allocate swap ( the hard drive space used for extra working memory ) and how much hard drive space to use for Ubuntu.
With something else option you are in control of how you want to organize hard drive space. For example, I don't need swap for solid state drive, so I used something else option to create only main ( aka root ) partition where my OS resides, and no swap. Some users use it to create separate partitions for /home directory, which is same as Users folder on windows .
In short , if you don't plan doing anything fancy with your hard drive, you probably don't need something else option.


Can I query to all contacts in contact builder

Question: Is it possible to write a query to pull records from contact builder all contacts.
Answer: Here's a workaround provided by Salesforce to query All contacts:
1) In MobileConnect or MobilePush, create a filtered mobile list that meets the condition: Contact Key is not null
2) Use a SQL Query Activity to query from this list into a new Data Extension (DE).
3) Create a new DE with one field titled SubscriberKey, make this field a Primary Key. Make the DE sendable.
4) In Automation Studio, create an SQL query that resembles the below.
<code>select subscriberkey from [name of MobileConnect/MobilePush filtered list name]
</code>
5) For the target Object, select the newly created DE. Save it, then place it in an Automation and run the Automation once to populate the DE.

Note: You must have MobileConnect or MobilePush to complete these
  steps.

Here's an article that describes this process: Permanently remove Contacts or Subscribers and associated data from Contact Builder
Comment: Along with Subscriberkey how to query  remaining fields like Mobile number, Email address, Device Id, Channel and modified date using in the same SQL Activity to query from this list to in to a new data extension(DE)
Comment: Thanks, great idea to revamp orphan contact process to export All Contacts. At first I thought this would not export regular mail channel subscribers because the starting point is a mobile list. But, a list is basically a set of subscribers, so the list being mobile (nothing to do with email studio list, which are different animals) is not important for the matter.


Output voltage in a BS270 circuit

Question: I am reading through Exploring Raspberry Pi and in a section on FETs, there is an example circuit. I understand how the controlled current is calculated $$I = \frac{V}R = (5V)(100\Omega) = 50mA)$$, but how is the voltage of 0.17V calculated?
Answer: It's calculated by looking at the BS270 datasheet:

There, above, you can see that the absolute maximum drain-source resistance is \$3.5\:\Omega\$. So if you multiply that resistance by the current, \$50\:\text{mA}\$, you get \$3.5\:\Omega\cdot 50\:\text{mA}=175 \:\text{mV}\$. That is close to what they wrote.
They were being conservative here. This is at a high temperature for the device. You can pretty much plan that the resistance will be less in most common circumstances. But it is good to plan for worst-case.
Answer: I think they use the maximum Rdson value :

In practice, for Vgs=3.3V at 25°C, it's not the correct value.
Answer: The current values are rough approximations just to give a clue what is happening in the circuit, they are not calculated from exact values.
As the FET is not an ideal short circuit, there would not be exactly 5V over the resistor, so there would not be exactly 50mA current flowing through it.
Since in that circuit there is 4.83V over the resistor, there is 48.3 mA flowing. The FET has approximately 3.5 ohms of resiatance then.
In real life your resistor would not be exactly 100 ohms either, it would have some tolerance, and for general purpose a 10% or 5% resistors are cheap and common so the resistor can have more variation in the resistance (e.g. 95 to 105 ohms) than what the FET adds.

Output voltage in a BS270 circuit


Loading lazy collection in @Transactional method

Question: I try to load collection to my object (I cannot use FetchType.EAGER), but I am getting following exception:
<code>org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: Produkt.opinie, could not initialize proxy - no Session
</code>
I don't know why as I am doing it in @Transactional scope:
<code>@Service
@Transactional
public class ProduktService extends AbstractService implements IProduktService {

    public Produkt findProduktById(Integer id) {
        Produkt produkt = (Produkt) getSessionFactory().getCurrentSession()
                .get(Produkt.class, id);
            produkt.getOpinie();
        return produkt;
    }
}
</code>
Comment: till which layer is lazy initialize supported in your application configuration?
Answer: There could be many reason. For once having @Transactional annotation is not all it takes -- you need to check a transaction manager has been properly configured in your spring application context. Then you need to check your application has proper AOP support such that Spring can automatically start and finish transaction on methods annotated with @Transactional.
You also need a proper transaction manager, eg: in you case since you're using Hibernate, you need a HibernateTransactionManager configured.
It is also helpful to debug the actual SQL statement issued by Spring  / Hibernate to check if you're transaction really works properly
Chapter 11 of the spring manual is a good reading for this topic.
Comment: I am able to load Produkt object succesfully, so I think the Transaction manager is OK. The problem appears, when I add produkt.getOpinie() to this method.


Meso and achiral does both term means the same?

Question: When a molecule has plane of symmetry,  or centre of symmetry it is termed as an  achiral compound (though it contain some chiral centres).  Same goes for the meso compounds due to the internal compensation.  So both terms mean exactly same.  But I am eager to to know the applications of these terms  in different cases.  All meso compounds can be told achiral and as well as all chiral compounds as meso?
Comment: Methane is achiral, but nobody would call it meso.
Answer: From the Gold book:

meso-compound:
A term for the achiral member(s) of a set of diastereoisomers which also includes one or more chiral members

Achiral compound:
A compound that can be superimposed on its mirror image.
The difference lies in the presence of the chiral centre. All meso compounds are achiral (due to internal compensation as you have mentioned) but all achiral compunds aren't meso.

Look carefully and you'll be able to spot chiral centres in all the above compounds but you'll also notice that they have a plane of symmetry (internal compensation) which makes them achiral.

Bromocylohexane has a  plane of symmetry which makes it achiral. But it has no chiral centre, that's why it doesn't qualify to be a meso compound.
Answer: A meso compound is one which satisfies both of the following criteria: (1) it must have chiral centers and (2) it must have an internal plane of symmetry. On the other hand, an achiral compound is one which has an internal plane of symmetry. Thus you can say because a meso compound has an internal plane of symmetry, it is in fact achiral and optically inactive. You could not however say that all achiral compounds are meso... the terms are not synonymous. For an example, benzene is achiral but not meso. It has many internal planes of symmetry but does not have any chiral centers. It does not meet the first criterion for being meso. All chiral compounds cannot be considered meso as you suggested. The presence of chiral centers does not necessarily mean a compound is chiral.


Do I need to sign the cover letter to the editor?

Question: When submitting a paper to a journal, often a cover letter to the editor is submitted as well. When this letter is sent by mail / uploaded to the journal's website, do I need to sign the cover letter? And if yes, how? With a certified electronic signature, or with a digital scan of my handwritten signature?
Answer: No, you don't need to sign it. (At least that's been my experience with every journal I've dealt with.) My cover letters just tend to be PDF files (uploaded to the journal site) that end like

Yours sincerely,
< List of authors (printed names) >
Comment: @Buffy Yeah, I wanted to leave that possibility open with the parenthetical remark. Looking forward to see what exceptions people can come up with.
Comment: Probably correct in the vast majority of cases, though there could be some exceptions, depending on field and journal.
Answer: There are actually very few times when a signature (either scanned or posted) is mandatory. In the journals I've edited (mainly in the health and medical fields) we would require some form of signature for contractual arrangements such as in the case of a supplement or a commissioned piece such as an editorial, when the type of submission requires it such as a case report and the author and patient submit consent letters to us, or when we
We don't require a formal signature for cover letters, but we do appreciate it. We need to know that the author stands by the statements in the cover letter as, for example, when the author asserts that the submission is not being considered anywhere. This can be accomplished in a number of ways and a signature is one of them. At the very least, a signed letter shows respect for classic codes of etiquette.
(Who here remembers having to submit manuscripts prepared on typewriters?)
Good luck!


Can a language exist without transitive verbs?

Question: I'm developing my first conlang (no name yet) for a story and came up with an interesting idea: all verbs are intransitive, and objects are added with prepositions.
So, a sentence like "I eat fish" would be translated literally as "I eat with a fish."
Sentences with more than one object would be stuck together in whatever way makes sense, yielding sentences like "I gave from money to the man," and "I roasted with an apple and a fire."
How naturalistic would this be? The language is spoken by a remote people so I don't care how rare it is, just that it's possible at all.
Answer: I'm reminded of how every so often a conlanger will have the bright idea that "hey, what if there was a language with no verbs?" And yet, the grammatical relationships that are mediated by verbs still need to be expressed, so they inevitably end up "inventing" a new part of speech... that does exactly what verbs do... but they're too emotionally invested how creative and quirky having a "verbless" language makes them sound, to call a spade a spade and admit that they have verbs.
In your case, there isn't really a reason to do this whole song and dance about how these oblique arguments (instrumental as in "with a fish", genitive "from money", etc.) obviate the need for direct objects. If they're consistently being used where languages would normally put a direct object, for arguments that for all intents and purposes act like direct objects, then let's call a spade a spade - you have direct objects. And therefore transitive verbs.
Synchronically, your direct object case effectively just has a bunch of allomorphy. Diachronically, patientive cases often evolve from these kinds of oblique cases, so I would think I was just looking at an intermediate stage where the patientive case was in the middle of evolving. In either case "I have no transitive verbs" ends up being an unhelpful way of describing an otherwise unremarkable phenomenon.
Answer: Although I am not aware of any natural language that goes without the notion of transitivity, I think it is worth a try. For a broader point of view, you may want to study morphosyntactic alignment to see what natural languages do with transitive verbs, there is definetely more than the boring nominative-accusative system of Standard Average European languages.
I also want to bring the logical languages to your attention with Lojban as their most popular representative. Here each "verb" has a well-defined predicate structure but no place in this predicate structure can be identified as the direct object.
Answer: Let's consider a nonce version of English in which objects are prepositional phrases.  This alone will not make the verbs intransitive.
For the verbs to qualify as intransitive, those prepositional phrases have to be adjuncts.   In other words, you have to be able to omit them from sentences without making the sentences ungrammatical.
Let's assume that "throw" in your conlang can be modified by an adverbial prepositional phrase meaning "of a baseball."
We know that "Jeff threw of a baseball." means "Jeff threw a baseball."  But what does "Jeff threw," mean?  It has to have a reading, or the verb "throw" can't be intransitive because it must take an object.  Making the object a prepositional phrase is no different in this connection than giving the object an equivalent case-affix.
One way around this is to make all your verbs ambitransitive, as "eat," "write," "read," "sing," and "speak" are in real English.  Objects can be omitted from sentences with ambitransitive verbs if the objects don't denote anything important and the action denoted by the verb is the focus.  So, for example, "Jane is eating," doesn't need an object if it answers the question "What is Jane doing?" rather than the question "What is Jane eating?"
If all of your verbs are ambitransitive, you could have a sentence like "Jane is throwing" that answers the question "What is Jane doing?"
The problem with this scheme is that some verbs aren't sufficiently descriptive to tell the listener what she wants to know about the states or events that the speaker is talking about.   For example, we could say "Alvin is kicking," but, in most contexts, we couldn't do so without prompting a response such as "What do you mean 'he's kicking?   Kicking WHAT?"  So too with other verbs in sentences like "Don closed," "Mary opened," and "Morey picked up."
I'm out of time and don't see an obvious alternative to my own failed scheme, but I hope to read more about how you plan to address the issues raised by your scheme.


Problem with sound in Ubuntu 13.10 : sometimes is fine but sometimes is not work

Question: I have installed Ubuntu 13.10 beside Windows 8. When I shutdown Windows 8 in Fast Startup Mode (by default) and then run Ubuntu, Ubuntu cannot mount any NTFS partition and sound is working. But if I restart in Windows 8, partition will be mounted but sound is not working. I don't know why and how to fix it. Can anyone help me? Every advice is appreciate! Thanks all.
Answer: Fast Startup is incompatible with dual-boot configurations. It basically turns a shutdown operation into a suspend-to-disk operation, which leaves disks in an inconsistent state. At best, Linux will ignore such partitions. At worst, data corruption can result. Thus, I strongly recommend that you disable Fast Startup in Windows, as described here.
Note that the Windows Fast Startup feature is different from the firmware's feature with a similar name. Any "fast boot" or similarly-named firmware feature bypasses certain types of hardware setup. This is usually fine from a Linux perspective, although it can result in an inability to boot from an external medium like a USB flash drive. Thus, it may need to be disabled when installing Linux. Details vary greatly from one computer to another, though.


Dispersion of a Gaussian wave packet- why does momentum become more certain?

Question: So I understand from the equations, and considering the Fourier components of a Gaussian, how the wavefunction for a free particle spreads due to dispersion. However mathematically, and from the reciprocity relation, this means the momentum is becoming more certain! Is there a physical process governing this? Or is there a way to understand why this occursvwithoit simply referring to the position wavefunction and its spreading?
Answer: As momentum is conserved for a free particle, it is not obvious to me that the momentum becomes more certain for a Gaussian wave packet. Neither is it obvious to me that an initially Gaussian wave packet will remain Gaussian.
EDIT (02/11/2018): According to http://demonstrations.wolfram.com/EvolutionOfAGaussianWavePacket/ , an initially Gaussian wave packet can remain Gaussian (at least in some cases), but the momentum uncertainty does not depend on time.
Comment: Yes- turns out I made a mistake and the gaussian in momentum space remains the same width. Although I'm curious as to the implications of this....
Answer: The way I understand that is to look at what kind of information the wavefunction is giving to you, it's not a very formal way of thinking, though.
If you measure the position of the particle to be at $x=x_0$ at the instant $t=0$, then, you can measure it quickly again and it will have to be close to $x_0$, but you don't know very well where it is going. That is a distribution narrow in position and broad in momentum.
If you wait more, on the other hand, you have less certainty of where the particle will be, but the second measurement will give you a better precision of the direction and speed of it's movement. So as time passes, you lose information of the position and gain information on momentum.  Of course, the second measurement  will narrow the distribution in position again, but I think this picture still helps to see what the wavefunction is telling us.


UITableView, how do I know what Section during cellForRowAtIndexPath?

Question: I have a UITableView displaying a list of Cities.
I want to separate them by State.  I can't seem to figure out how to get it to pick the right items out of my Array.
If Section 1 (Arizona) has 2 Cities and Section 2 (California) has 2 Cities, during cellForRowAtIndexPath, Section 2, City 1 has an index of 0, even though it's the 3rd item in my array.
I thought about just turning my City Array into a State Array, where each item holds an Array of Cities, but I still don't know what section I'm on and therefore don't know which City Array under the States Array I would need to access.
Comment: Alright...apparently I failed to properly research this one.  Sorry about the dumb question.
Comment: The reason you probably failed to solve this yourself is that the row and section properties are UIKit additions to NSIndexPath. If you look up the NSIndexPath documention, they are not documented. They are however documented here: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/NSIndexPath_UIKitAdditions/Reference/Reference.html
Comment: A little dumb, perhaps; but not extremely: I had a similar question when I first started doing iPhone dev.
Comment: Not a dumb question at all. I had the same question and went looking in the wrong direction (UITableView).
Comment: This is NOT a dumb question. I've very glad you asked, saved me time looking at other crappy sources.
Answer: The method is called
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

The indexpath parameter contains a row and section property.
indexPath.section
indexPath.row

Here's documentation link for the NSIndexPath class.
Answer: you can use indexPath.section and indexPath.row
Answer: Swift 3, 4 and 4.2

Using Switch

switch indexPath.section {
        case 0:
            print("Write your code for section number one.")
        case 1:
            print("Write you code for section number two")
        default:
            return
        }

Using if else

if indexPath.section == 0 {
            print("Write your code for section number one.")
        } else if indexPath.section == 1 {
            print("Write your code for section number two.")
        }


Geographic coordinate transformation to British National Grid

Question: Before I wade into writing my own function, is anybody able to confirm whether MMA has an inbuilt method for converting longitude and latitude geographic coordinates (as used to specify the position of a point on the earth's surface in the GeoPosition function) to British National Grid coordinates (and visa versa)?
Answer: You need the datum "OGB7" and the projection
proj = {"TransverseMercator", "Centering" -> {49., -2.}, "GridOrigin" -> {400000, -100000}, "CentralScaleFactor" -> 0.9996012717, "ReferenceModel" -> "OGB7"}

If you start with a position
p = GeoPosition[{lat, lon}]

then you need (this performs a change of datum and a projection simultaneously):
GeoGridPosition[p, proj, "OG7B"]

Let us separate the two steps in this example:
In[]:= bigben = GeoPosition[Entity["Building", "ElizabethTower::4brf8"]]
Out[]= GeoPosition[{51.5006, -0.124611}]

Those {lat, lon} are in the "ITRF00" datum, which is nearly identical to "WGS84". We first convert to "OGB7" with GeoPosition:
In[]:= GeoPosition[bigben, "OGB7"]
Out[]= GeoPosition[{51.5001, -0.123018}, "OGB7"]

Now we can project, obtaining the coordinates you need:
In[]:= GeoGridPosition[%, proj]
Out[]= GeoGridPosition[{530268., 179630.}, {"TransverseMercator", "Centering" -> {49., -2.}, "CentralScaleFactor" -> 0.999601, "GridOrigin" -> {400000, -100000}, "ReferenceModel" -> "OGB7"}, "OGB7"]

You can go back with GeoPosition:
In[]:= GeoPosition[%]
Out[]= GeoPosition[{51.5001, -0.123018}, "OGB7"]

But that is again in the "OGB7" datum. We can get the original {lat, lon} with
In[]:= GeoPosition[%, "ITRF00"]
Out[]= GeoPosition[{51.5006, -0.124611}, "ITRF00"]

Comment: Thanks Jose.  I worked out how to do this a while back and now have a couple of simple functions that implement the transformation system both ways.  All the best, Ian


How to reduce size of icons on Ubuntu (GNOME) desktop?

Question: How do I reduce the size of icons on my Ubuntu (GNOME) desktop? All the icons are too big since I am using a 12.1" laptop so it looks horrible.
Answer: two solutions i know of -

right click the icon, select Stretch Icon...
Open a terminal
type nautilus (this open a file browser)
Edit -> Preferences -> Icon View Defaults and select the size you like
Comment: no need to open a terminal; type Alt+F2 to run the commandline, or just open one of the entries on the **Places** menu (**Home Folder** is a good choice).  the Edit -> Preferences... directions are correct tho.
Answer: Going below 48px requires changing the Nautilus source code and recompiling. (Yes, they hard-coded icons sizes.)
**** INSTRUCTIONS FOR NAUTILUS 3.20.4 ON UBUNTU-GNOME 17.04 ****
1. Install the following dependencies:
libgd-dev autotools-dev libexif-dev libexempi-dev libselinux1-dev libtracker-sparql-1.0-dev libext-dev libxml2-dev libgnome-desktop-3-dev
Each one installs a bunch of other stuff, so hopefully I've given you the correct parent package name. I apologize for not recalling with 100% accuracy exactly what I installed, but this looks fairly correct to me immediately after my install. (Notify me if I'm inaccurate anywhere.)
2. Download from the Nautilus snapshots website (https://download.gnome.org/sources/nautilus/) the version of Nautilus that you are currently using. To find that out, run "nautilus --version" from the terminal. After downloading the archive, unzip it to whatever directory you want to work from.
3. From within the unzipped package, open the file "nautilus-icon-info.h". Within the first several lines you will see various sizes designated for the particular scroll-setting options. For instance, within the file for version 3.20.4 the icon sizes start on line 36. Change each of those levels to whatever you want to use so that you can make the icons much smaller (or larger).
4. After editing and saving the file, it's time to configure, compile, and install. Run the following commands from the terminal from within the base directory of the version of nautilus that you have downloaded and unzipped. Make sure that you are within the base of the folder structure of the nautilus directories!
./configure
make
sudo make install
This can be run altogether with the command "./configure && make && make install".
If the ./configure command fails it's because you are missing some other dependencies. I apologize if my list of dependencies above was incomplete. Google (or whatever search engine you want) to find what package it is that you need. You can use Synaptic to search for what you need if you're unsure even after Googling.
Once installed, I suggest a reboot just to make sure that every single thing is reloaded properly. You can now tweak your icon sizes as you wish.
Have fun!


Why is Propensity Score called a distance measure as well?

Question: I had to use Propensity score matching for my study. I used the MatchIt function in R and I studied what it actually does. I understand that the propensity score is calculated using Logistic regression and it is the probability (p)  of the treatment ( or log[p/(1 − p)] ) which is used to balance the Case and control group, conditional upon the covariates.
But I have read papers saying the propensity score is the same as a distance measure.. why is PS a distance? Aren't they slightly different?
Shouldn't a distance be just an absolute difference of two propensity scores instead? (one from the Case and one from the Control group?)
Also when I ran the MatchIt function and viewed the result after matching, the column (or variable) name for propensity scores was 'distance'...
Am I understanding it wrong?
Comment: I think it has to do with the fact that you compute the propensity of receiving a given treatment (say A instead of B), thus apparently you would compare two individuals according to their difference in propensity score, but eventually you need to factor in also their actual treatment, and thus propensity scores comprehensively takes into account the distance between predicted treatment and actual treatment, and thus is more a distance metric...
Comment: ^ This is not why. "Distance" refers to the distance between two individuals, not between an individual's propensity score and the actual treatment received. Anything can be a distance score; it doesn't have to be related to the propensity score.
Answer: One way to conceive of distance scores is as you have stated, which is a value that represents the distance between two individuals. Thus, each individual would have a distance score for all other individuals. In this sense, the difference between propensity scores is indeed a distance score. The Mahalanobis distance would also be a distance score.
The way MatchIt conceives of a distance score is the value for each individual that is used to compute the distance score as described previously. A precise way to describe this might be to call it a "position score," so that the difference between two position scores is a distance score. This is just an issue of terminology. Note that when you request Mahalanobis distance matching in MatchIt, no distance value is produced in the output. Clearly they are relying on this latter use of distance scores.
Comment: So are 'position score' the same as propensity score.. in Matchit function? When I try to view the matching result, I only find a column called distance but cannot find a column for 'propensity scores'
Comment: The `distance` column is the propensity score (or whatever you chose to be the distance score, in the second sense). "Position score" is something I just made up right now, but yes, as I have used it, propensity scores would be position scores. That's not an actual term used. I was just pointing out that it might be a more intuitive way of thinking about it.
Comment: Thanks for double checking on this ! I was very confused with the terminology. Now it makes sense!


How Can You Get Thumbnails for Jekyll Posts When the Post Has No Images?

Question: If I'm using Jekyll to build a blog and I want to share the link to posts. I'd like to have a preview thumbnail for the posts, however, the post itself has no images on it, and I'd like to keep it that way. Any ideas on how do that?
Comment: It's not Jekyll specific, but you need to use Open Graph Metadata (http://ogp.me/) to provide this to work. Also, http://vrepin.org/vr/JekyllMeta/#open-graph-metadata might be helpful to start – the author has link to example source code.
Answer: I found the solution I needed.
Following the Open Graph Protocol, if a post has a thumbnail image available for sharing via Facebook, Twitter, etc., you can specify your  open graph metadata like this.
{% if page.image %}
  <meta property="og:image" content="path/to/post/image.jpg">
{% else %}
  <meta property="og:image" content="path/to/page/image.jpg">
{% endif %}

If the post doesn't have a specified image it will use the image specified for the page. Then add the following to the post's front matter:
---
image: path/to/post/image.jpg
---

Answer: You could define a thumbnail attribute in each post's front matter, then use that when you create the page containing links to your posts.
Here is an example blog post:
---
layout: default
thumbnail: "/path/to/the/thumbnail.png"
---
This is a blog post!

And then in your blog's index.html page, you'd do something like this:
{% for post in site.categories.blog %}

        {{ post.title }}

{% endfor %}

Comment: Thanks, Kevin. That solution seems to add the thumbnail to the page and display it. I'm not looking to display it on the page but have a thumbnail show when the link is to the page is shared.
Comment: @MattSmith Maybe I misunderstood what you were going for. I thought you wanted your blog posts to not contain images, but still use thumbnails when you created links to them (like on a listing of all your blog posts). If you're talking about sharing this to facebook or something, that's a different thing. Although you could use the thumbnail frontmatter variable to set the opengraph metadata!
Comment: Thanks for following up Kevin. Yes, I want to have no pics on my blog post but have a thumbnail available when sharing to Facebook or Twitter or something else so it displays with the link. I'll look into using the frontmatter for that.


If charged in two separate states, what determines which state has priority?

Question: If someone were to commit crimes such as murder in two different states and both states file charges against the person, which state processes the case? More specifically, can someone who is charged in a state without a death penalty be extradited to another state with the death penalty?
Answer: If the suspect is in custody in a state in which he is charged, that state has priority. That state may opt to allow another state to prosecute first.
If the suspect is in custody in a state where he is not charged, it is up to that state who gets him first.
A suspect can be extradited from a state without a death penalty to a state that has one.


What software can I use on my pi to take a screenshot?

Question: I have created a game that only runs on a pi and I want to upload to the Pi Store, but I need to take a screenshot of the game. Anyone know some good software for taking screenshots on a pi?
Answer: There are several programs to take screenshots. One that I have used is ImageMagick. Install by running the command:
sudo apt-get install imagemagick

To grab the whole desktop:
import -window root screen.png

Another one that I use is scrot, a useful, simple command line utility. To install:
sudo apt-get install scrot

Then run scrot -s and click on the window you want a screenshot of. You will get a timestamp-based .png in the working directory of your terminal. See man scrot for more options.
Answer: You can use >Scrot<
Install:

sudo apt-get install
   scrot

To take a screenshot press >Print Scr< as in Windows, and go to filemanager to see your screenshot.
To display  the list of scrot command:

sudo scrot -h
Comment: the page you gave url to is not 100k piece of text with plenty of embedded pictures, therefore it might be much more helpful, if you copy-paste the contents to save hundreds of people about 10 seconds when clicking the link and waiting for the content to appear. also it will keep your answer relevant when the original web page will disappear.
Comment: Okay, i changed it to something that can be useful, and that was not mentioned in other answer for not delet my answer or leave it as a thing that can't help neither a little.


Can every transcendental number be expressed as an infinite continued fraction?

Question: Every infinite continued fraction is irrational.  But can every number, in particular those that are not the root of a polynomial with rational coefficients, be expressed as a continued fraction?
Comment: Yes. The infinite continued fractions with $0$ integer part are precisely the irrational numbers in $(0,1)$.
Comment: how do you prove it?
Answer: The infinite continued fractions are precisely the irrational numbers; you will find a proof here, along with a proof that the expansion is unique.
Comment: The link you posed does not exists anymore, please posed then content if possible.
Comment: @Peter: Apparently they rearranged their site, but the page still exists, and I've updated the link.
Comment: Thank you. I have not read a proof that an infinite continued fraction with only positive integer convergents are irrational.

One corollary, of course, is that an infinite continued fraction with opnly rational convergents would be irrational.

The converse is easy to prove. A finite continued fraction with rational convergents would in effect be a finite sequence of arithmetic operations among the rationals, so the result must be rational.
Comment: If one or more convergents are allowed to be irrational, anything goes. Lambert proved that the tangent of $x$ radians has an infinite continued fraction representation. In particular, an infinitude of convergents are powers of $x$. Set $x=\pi/4$, and the infinite continued fraction is equal to 1. (This also establishes the irrationality of $\pi$.)
Answer: To express an irrational number $\alpha$ as a continued fraction, do this:

Put $\alpha_0 = \alpha$ and $n=0$.
Let $a_n = \lfloor\alpha_n\rfloor$, the greatest integer not exceeding $\alpha_n$.
Put $\alpha_{n+1} = {(\alpha_n - a_n)}^{-1}$.
Add 1 to $n$.
Go back to step 2.

The continued fraction expansion of $\alpha$ is then:
$$\alpha = a_0 + \cfrac{1}{
           a_1 + \cfrac{1}{
           a_2 + \cfrac{1}{
           a_3 + \cdots}}}$$
For example, let's take $\alpha  = \pi = 3.141529\ldots$. Then

$\alpha_0 = 3.141529\ldots$ and $a_0 = 3$.
$\alpha_1 = {(0.14159\ldots)}^{-1} \approx 7.06251$ and $a_1 = 7$.
$\alpha_2 = {(0.06251\ldots)}^{-1} \approx 15.9966$ and $a_2 = 15$.
$\alpha_3 = {(0.09966\ldots)}^{-1} \approx 1.00341$ and $a_3 = 1$.
…

And so we have
$$\pi = 3 + \cfrac{1}{
           7 + \cfrac{1}{
           15 + \cfrac{1}{
           1 + \cdots}}}$$
which is correct.
Note that since $a_n = \lfloor\alpha_n\rfloor$, we know that $\alpha_n-1 < a_n \le \alpha_n$, and therefore that  $\alpha_n - a_n$ must be at least 0, but less than 1. If  $\alpha_n - a_n$ is nonzero, its reciprocal, which is $\alpha_{n+1}$, must be strictly greater than 1.  Then $a_{n+1}$ must be a positive integer, as required.
If you take $\alpha$ to be a rational number, the process will terminate when one of the $\alpha_n$ is zero.  If $\alpha$ is an irrational number, the process can't terminate in this way, since if it had, you would be able to write $\alpha$ as a finite continued fraction, which you would be able to put into standard $\frac ab$ form, which is impossible.  That is a (somewhat handwavy) proof that you were looking for.
Comment: If the transcendental number is nonreal, then its continued fraction representation must have at least one nonreal convergent.

All infinite continued fractions with real (let alone rational) convergents are real numbers.
Answer: Any arbitrary complex number (and I spect, any number in a normed division algebra) can be expressed as an infinite continued fraction.
Irrational numbers have a unique continued fraction expression consisting solely of integers. See here.
https://sites.millersville.edu/bikenaga/number-theory/infinite-continued-fractions/infinite-continued-fractions.html
As such, real transcendental numbers (being irrational) all have a unique continued fraction expression with integer convergents.
An infinite continued fraction with only rational convergents must be irrational, per that same article. As such, nonzero rational numbers can only be represented by an infinite continued fraction if at least one convergent is irrational.
An infinite continued fraction expression with real convergents must be real. This means that for nonreal transcendental numbers, any infinite continued fraction expression must have at least one nonreal convergent.
Answer: The set of non-computable numbers is a strict subset of the transcendental numbers. If infinite continued fractions are computable, then I believe that they would not include all the transcendental numbers. Chaitin's constant is transcendental, but cannot be represented by an infinite continued fraction. Chaitin's constant cannot be represented through an algorithmic process.
Comment: Where is there any restriction that the continued fractions be computable? (Specifically, the sequence of $a_i$s is not required to be computable.)


Embedded software running for long time

Question: I have this question suppose we tested the software at bench level and in production it works for some days, but If you find issues after let us say some months. Is it possible for bugs to come after many months? How to identify those test cases? Generally how to plan debugging for such cases? Any software tools which can help me? Any other suggestions? I am speaking about embedded systems for microcontrollers.
Comment: What kind of issues do you see? Can you tell if they are hardware or software related? What kind of tests do you run?
Comment: I believe Boeing recently discovered an issue with 777 FADECs that was only possible if a jet was running for many months continuously -- their long term test lab was the only reason they found it.
Comment: One of the older versions of Windows (95?) had a counter overflow bug that  only triggered after 48 days uptime.It was years until it was discovered.
Comment: @pjc50 If I remember, older versions of Windows seldom ran for 48 hours.  At least it seemed that way.
Comment: I believe this is a common problem. We had to meet requirements for 100s of thousands of hours MTBF for our devices, but without 100s of thousands of hours available to do the testing. Accelerated MTBF testing relies on putting the Device-Under-Test into an unrealistically high-stress test procedure to simulate long term usage and wear in a short space of time. I am assured it can also be carried out for devices running embedded software. Unfortunately, I do not know how it was done. I only know that we had special build variants for MTBF testing, and someone else wrote that test code. Sorry.
Comment: I mis-typed my comment -- it was the Boeing 787. If left on for 248 days continuously, the aircraft will lose **all** AC electrical power due to every single generator control unit going into fail-safe at the same time. Luckily, the 787 is so new that most 787s in the field weren't this old, or had been power-cycled once or twice. Here is the directive from the FAA: https://s3.amazonaws.com/public-inspection.federalregister.gov/2015-10066.pdf
Answer: These bugs can be in the following cases:
1) The testing did not cover the full range of use cases, and the system encountered some untested input or sequence of inputs, engaging an untested logical path
2) The system has some time-dependent feature (something that is happening on a specific date or time, or after some specific long time.)
3) The system has some counters, which are stored in some wide variables, and then they overflow at some point causing some undefined behavior.
4) Hardware failure.
It is not easy to debug such a bugs after they happen, as it is hard to reproduce them. You can:
1) Log essential diagnostic data in order to examine it if something happens
2) Make the FW run in short cycles of time, resetting it every X  days/hours/weeks.
Answer: I've seen it done with logging data stored or sent to servers over time. Keepalive signals, process monitors that restart the routine if it freezes.
Typical cases can be:
 - Long time span memory leaks (I've seen as slow as 2kb/h that would eventually fill the RAM)
 - Storage space fills up with logs
 - Issues with communication to other equipment, like servers. What happens if they are down ?.
If you have 100% code coverage, and tested with 100% of possible input combinations and made sure your setup is not sensitive to SEU's it should be pretty robust. But shit will still happen. The most important part IMO is the 100% code coverage.
Comment: In many cases having *all* the possible input combinations is simply not possible; thats why all the test methods like equivalency class partitioning or boundary value testing exist. I would agree that measuring coverage is a good thing, but 100% code coverage using bad test cases will not help.
Answer: not deterministic.  there are cases already mentioned, something date specific (leap year, Y2K, etc), using an 8 bit variable or math that demotes to 8 bits for day of the year (clipping at 255 days somewhere in october, being broken until jan 1st).
some problems are analog related, like single bit errors in ram, that the expected failure rate is one failure in N units of time, which might be years, so you may have to have that long of a test plus some, or have N test fixtures (millions?) and have it fail in one unit of time, or N/2 fixtures fail in 2 units of time and so on.
some problems require multiple related or unrelated things to happen at the same time or in a particular order and that may take time for randomizers or whatever is feeding the test fixture to hit that pattern.  and it may take that much time to repeat it.
the biggest mistake made is to put too much fear based code in or do too much fear based testing.  the longer a company or individual engineer is around the more painful bugs they have worked through and fear seeing them again so add code/tests for that going forward.  Every line of code you add to the logic or the software adds risk.  So if you add a handler, or checkpoint, or test in the code or in the tester, now you need another test to test that test, and another test to test the test which is testing the test. and another and another.  this by definition cannot end.  I have seen this fear take a products yield down to around 5% (yes 95% failure mostly due to the tester simply not working because it was overburdened by this fear and unable to function properly.  Even with a government project  infinite time and infinite money you cannot overcome this.  there are simply things you cannot test, and you cannot get around affecting the unit by adding a test.
check the obvious stuff, the individual components are tested separately, resistors, chips, boards, so when they come together as your product, first focus on the connections, the solder points, the connectors plugged in etc, dont initially need to worry or care about the inside logic of a chip, you want to exercise the soldered down pins (a full blown memory test exercises something that was already tested, should you waste time on that yes or no? a much shorter test will cover all the address bits, control signals and data lines).   Then there may be other categories, there have always been problems with bgas, but we see in the news big companies having problems with bgas a year or two into the products life, do you, can you even, do something about testing that?  maybe not.  maybe it is just cheaper to replace the broken units in the field than try to instrument something to test them not knowing for a year or two if your test really did anything.
the big bugs or the tough bugs often require their own special tooling software and/or hardware to find.  Some of it may be re-usable but some of it is specific to that bug, once that bug is found, much of that work now goes in the trash or some of it goes into the test fixture depending on what the bug was.  The next big bug you start over.   There will be big bugs from time to time, you cannot predict all of them and should not try to.  As a company with some set of employees, facilities, etc you may have systemic problems that keep occuring, some you can fix with training, etc some you should actually check for for some period of time until they go away (ideally due to training, dont use an ic as a fulcrum for prying off a connector)(a design engineer/team that doesnt handle multiple clocks properly or latching or rollovers in counters)(a software engineer/team that habitually forgets to check their math, clipping or allowing divide by zeros in, etc)
Yes there are categories of problems that only time will find (sometimes but not always increased by running more tests in parallel).  Some can be found with simple/available tools, some you have to craft a new tool for that bug and after found that tool has no more value.  Leave some budget for the latter, having some issues that you simply cannot predict, and have to craft a tool/fixture/software to find.  Take a floating point unit, 32 bit only, a = b (operation) c.  Multiply out the combinations for 32 bits for each variable, then multiply that by the number of operations, figure out how much code it takes to run each operation, even assuming somehow you have all the right answers computed and tested those as right answers, how long to run that test at the speed of the processor?  Now try two operations back to back with the result of the first feeding the input of the second.  How long does that take.  now multiply that by the number of registers in the core for each of the variables to feed that alu/fpu.  pretty quickly you exceed the known age of the universe.  you dont have billions of years to try every combination, so dont bother.  try some and budget for something to break in the future.
Answer: One topic that has not really been addressed is programs running wild or programs locking up.
In the first case, the program may end up executing a bad instruction (usually because it jumps off into a data section instead of code).  This can happen, for example in C when a function is called through a pointer and the pointer has a bad address (including 0).  If you are lucky, the processor will have a exception that catches this behavior.  Usually about all you can do is restart the program from the beginning.  It can also happen if a program incorrectly jumps into the middle of an a multi-byte instruction.
In the other case, a program locking up, this can be caught by a watch-dog timer. If you have a WDT enabled, then it needs to be "tickled" at a rate quickly enough to avoid causing it to time out. But don't put this code into a periodic timer interrupt, for example, as that defeats the purpose.  In a non-preemptive multitasking system, this usually means putting code to reset the WDT into every task, to catch tasks that don't give up control when they should.
A common cause of watch-dog timeouts, are systems where the program is waiting in a busy loop for a bit in a peripheral register to become set or reset by the hardware, and it never happens.  This of course is bad programming practice, but it happens nevertheless.
Like the bad address exception, about all you can do after a watch-dog timeout is to reset the processor and start over.
For both of these cases, you might want to log their occurrence in some way (i.e. to an SD card or other non-volatile storage) if you have a way of interrogating the counts later on.  This is particularly useful if you also have a real-time clock and can log the date and time too.
In one system I designed, after doing a firmware upgrade over the air, the system looked to see if it got any watch-dog timeouts for some period of time after the upgrade, and if so, reverted to the previous version of firmware.

Embedded software running for long time


Proof that $v=\frac{dE}{dp}$ at relativistic speeds?

Question: This is a formula I have seen stated in two different places in a relativistic context, but I do not know the proof and seem unable to derive it on my own. $E$ is the energy of a free particle, $v$ is its speed and $p$ its momentum.
Answer: The fundamental energy-momentum relation in special relativity is $E^2=p^2+m^2$ (let's ignore factors of $c$, since they will factor out in the end — that is, let's work in natural units).
Taking the derivative with respect to $p$ on both sides gives
$$2E\frac{\partial E}{\partial p}=2p,$$
since $m$ is a constant. Thus,
$$\frac{\partial E}{\partial p}=\frac{p}{E}.$$
Now, noting that $E=m\gamma$ and $p=mv\gamma$, where $\gamma=1/\sqrt{1-v^2}$, the result is proven.
In the last step, we could have instead used the fact that the four-momentum is given by
$$p^{\mu}=m\frac{\mathrm{d}x^{\mu}}{\mathrm{d}\tau},$$
So that $E=m\,\mathrm{d}t/\mathrm{d}\tau$ and $p=m|\mathrm{d}\vec{x}/\mathrm{d}\tau|$ (this only works in the massive case of course, but proving your identity is trivial in the massless case, since $E=p$). Thus,
$$\frac{\partial E}{\partial p}=\frac{p}{E}=\frac{|\mathrm{d}\vec{x}/\mathrm{d}\tau|}{\mathrm{d}t/\mathrm{d}\tau}=\left|\frac{\mathrm{d}\vec{x}}{\mathrm{d}t}\right|,$$
which is the definition of the speed. Note that in the second step we used the chain rule.
I hope this helps!
Comment: Doing these manipulations using $\gamma$ and normalized velocity vectors is needlessly complicated and, as you note, forces you to handle the massless case separately. It's both simpler and more general if you just prove $v=p/E$ from the fact that the energy-momentum vector has to be parallel to the velocity vector (which can be unnormalized). (If it weren't parallel, then we would have a violation of rotational symmetry.)
Answer: We have $E=\gamma mc^2$ (relativistic total energy) and $p=\gamma mv$, where $\gamma=1/\sqrt{1-v^2/c^2}$. Therefore, we can write:
$$E=\frac{pc^2}{v} \space,$$
differentiating both sides WRT $p$ implies:
$$\frac{dE}{dp}=c^2\left(\frac{v-p\frac{dv}{dp}}{v^2}\right)=\frac{c^2}{v^2}\left(v-\frac{p}{\frac{dp}{dv}}\right) \space. \tag{*}$$
Moreover, we have:
$$\frac{dp}{dv}=\frac{d(\gamma mv)}{dv}=m\frac{d}{dv}\left(\frac{v}{\sqrt{1-\frac{v^2}{c^2}}}\right)=\frac{m}{\left(1-\frac{v^2}{c^2}\right)^\frac{3}{2}}={\gamma^3}m \space. \tag{**}$$
Substituting both $p=\gamma mv$ and its derivative [Eq. $(**)$] into Eq. $(*)$ infers:
$$\frac{dE}{dp}=\frac{c^2}{v^2}\left(v-\frac{\gamma mv}{\gamma^3 m}\right)=\frac{c^2}{v}\left(1-\frac{1}{\gamma^2}\right)=\frac{c^2}{v}\left(1-1+\frac{v^2}{c^2}\right)=v \space.$$
Comment: This is *much* more complicated than necessary, and only works in the case where $m>0$.
Answer: I use the signature convention $(+,-)$.
Any spacetime-displacement vector can be written as
$$\tilde T=a\hat t+ \tilde s,$$
where $\hat t$ is unit and future-timelike and $\tilde s\cdot\hat t=0$ (that is, $\tilde s$ is purely spacelike to the observer with 4-velocity $\hat t$).
Assume $a \gt  0$.  Since $a$ is the "temporal displacement" and $\tilde s$ is the "spatial displacement", then
we can define the "spatial velocity according to the $\hat t$-observer" as
$$\tilde v\equiv \displaystyle\frac{\tilde s}{a}.$$
So, $\tilde T=a(\ \hat t+\tilde v\ )$.
For non-spacelike vectors ($\tilde T\cdot\tilde T \geq 0$), we have
$1=\left\|\hat t\right\|^2=\hat t\cdot \hat t\ \ \geq\  -\tilde v \cdot \tilde v=\left\|\vphantom{\hat t}\tilde v\right\|^2=v^2$.
Similarly, any [future-pointing non-spacelike] energy-momentum vector can similarly be decomposed into
$$\tilde P=E\hat t+ \tilde p,$$
where $E$ is the relativistic-energy and $\tilde p$ is the relativistic momentum.
When $\tilde T$ is chosen to be parallel to $\tilde P$ (so the particle with this  constant momentum $\tilde P$ will traverse this displacement $\tilde T$), we have
$$\tilde v =\displaystyle\frac{\tilde p}{E},$$
as suggested by @Ben Crowell .
Now, as @Bob Knighton does,
\begin{align}
m^2 \equiv \tilde P\cdot \tilde P
&=E^2(\ \hat t\cdot \hat t\ )+(\ \tilde p\cdot \tilde p\ )\\
&=E^2 - p^2
\end{align}
and, by differentiation,
\begin{align}
0 &= 2 E \frac{dE}{dp} - 2p,
\end{align}
so that
\begin{align}
\frac{dE}{dp} = \frac{p}{E} =v, \quad \mbox{where the last equality uses the relation above}.
\end{align}
This should be in line with @Ben Crowell ,
who hints that a good proof should be able to cover both the timelike ($m^2>0$) and lightlike ($m^2=0$) cases.
Comment: Sweet coordinate-independent presentation. At the point where you say $\tilde{v}=\tilde{p}/E$, it seems to me that you ought to invoke the fact that the energy-momentum is parallel to the displacement. Otherwise it's not obvious why this $\tilde{v}$ is the same as the earlier $\tilde{v}$.
Comment: You start off with a displacement that can be in any direction regardless of light-cone, then make some remarks about norms in the non-spacelike case, then make an argument about the $\tilde{P}$ vector that's restricted to future non-spacelike $\tilde{P}$. It's not clear to me where you ever used the facts about the norms (maybe you didn't?), or whether the restriction to future non-spacelike $\tilde{P}$ was ever necessary. Is there something in the argument that fails for tachyons?
Comment: I agree that it should be specified that $\tilde P$ is parallel to $\tilde T$. Thanks... I'll make the change. I restricted the displacement's temporal component to avoid the $a=0$ case (infinite velocity in $\hat t$'s frame) and to keep it pointing forward in time (in $\hat t$'s frame). I also wanted $\tilde P$ to be future-pointing causal.


Handling dependencies in blackberry development

Question: How can I handle 3rd party dependencies in a .jad file?  Is it possible to bundle a  .jar?  Do you need to unpack it and include the .class files?
Answer: JAR files can NOT be combined with COD files. You first need to convert these JAR files to COD files (and you should sign them as well). If additional JAR files are supposed to be used as library COD files you need to use the -library switch instead of -midlet for the rapc.exe compiler.
Once you got your COD files you need to refer in your JAD file to all of the COD files including file sizes. The COD file might look like:
Manifest-Version: 1.0
MIDlet-Data-Size: 2048
MIDlet-Version: 1.4.1
MIDlet-Jar-Size: 136999
MIDlet-Icon: /icons/myprogram.png
MicroEdition-Configuration: CLDC-1.1
MIDlet-Jar-URL: myprogram.jar
MIDlet-Name: myprogram
MIDlet-1: myprogram,/icons/myprogram.png,com.stackoverflow.myprogram
MicroEdition-Profile: MIDP-2.0
MIDlet-Vendor: My Company
Ant-Version: Apache Ant 1.6.5
Skylab-Build-Number: 2968:2970
Created-By: 1.5.0_01-b08 (Sun Microsystems Inc.)
RIM-COD-Module-Dependencies: net_rim_cldc,lib_1,lib_2,lib_3,lib_4,net_rim_locationapi
RIM-COD-URL: myprogram.cod
RIM-COD-Size: 77576
RIM-COD-URL-1: myprogram-1.cod
RIM-COD-Size-1: 29960
RIM-COD-URL-2: lib_1.cod
RIM-COD-Size-2: 28668
RIM-COD-URL-3: lib_2.cod
RIM-COD-Size-3: 8712
RIM-COD-URL-4: lib_3.cod
RIM-COD-Size-4: 18232
RIM-COD-URL-5: lib_4.cod
RIM-COD-Size-5: 12752
RIM-MIDlet-Flags-1: 0
RIM-MIDlet-Position-1: 0
RIM-COD-Module-Name: myprogram
RIM-MIDlet-NameResourceId-1: 0
RIM-COD-Creation-Time: 1143020761
RIM-COD-SHA1: 0b 9f b1 da 47 bc 6f 97 62 eb 32 66 77 ca a9 6f 24 4d 10 8a

Comment: however if you are compiling the JAR file yourself, you CAN include it in a project without any extra COD files (using Eclipse) - http://stackoverflow.com/questions/9976940/blackberry-use-own-jar-file-in-own-project
Answer: See approach of working with kXML2 open source library:

for release you have to preverify it & build proj with ant:
Ahmad Ferdous Bin Alam - How to Import kxml jar File to Your Project
Slashdev - BlackBerry Development with Ant & Eclipse
UPDATE:Tutorial: How To Use 3rd Party Libraries in your Applications
for debug you have to add kXML sources and org.xmlpull.v1 sources to your BB project
Answer: Can't speak too much for J2ME generically but for BlackBerry you can turn compiled .jar files into .cod files (the BlackBerry binary file format - basically an optimized .jar) and include those along with your application .cod files.  You will have to list the additional .cod files in the .jad.
This link from the BlackBerry knowledgebase should help.
Answer: If library is not a BlackBerry COD file but a plain MIDP 2.0 JAR file then what you have to do to bundle that with your application is to do the following using the Eclipse JDE plugin:

Right-click your project file and select: "Build Path" > "Configure Build Path...". This will open the Properties screen with "Java Build Path" option showing.
Click on the "Libraries" tab and click "Add JARs..." (or "Add External JARs...") and pick the JAR you want in the next dialog and "OK" it. You should see the JAR that you picked in the list.
Now, click on the "Order and Export" tab and check the checkbox next to the JAR that you added. This makes sure that the build step actually merges this JAR file into your applications output and creates a COD file that includes both.

The above method works for me but has two problems:

Everytime I change anything related to the "BlackBerry Project Properties" of the project (such as changing the Title or Version of the application), this setting reverts so I have to go through it again. This is a major inconvenience but the steps to follow are not that complicated.
You have to preverify the JAR files that you include as explained in the kXML2 link given in this answer. Failing to do so will result in random verification errors (random in the sense that I don't get them all the time).