Why Riemannian metrics have to be smooth?

Question: Why do Riemannian metrics have to be smooth? Can you give an example of a smooth curve with a none smooth metric and show me what possibly will go wrong if our metric is not smooth?
Comment: One can do quite a bit of differential geometry with relaxed smoothness assumptions, I think. Often, "smooth" (in the sense of $C^\infty$) just means "enough smoothness for these proofs to go through". As for the metric, you begin to struggle a bit if you don't at least have enough smoothness so that the differential equations defining the geodesics have unique solutions.
Comment: By paracompactness you can always create a smooth metric using partition of unity (or, in a more fancy way, you can find a deformation retract of the general linear group to the special orthogonal). Maybe you want to know an example of a not smooth but continuous metric… If you know about vector bundles I think you can come  with an example. Anyway, at least continuity is necessary otherwise you could have an orthonormal basis on the tangent bundle going totally crazy, but since you want to differentiate, smoothness would be nice too (because of the determinant).
Answer: To begin with, nothing has to be smooth. There are deep theories concerning manifolds which are only $C^k$ for some $k$, or topological manifolds, which don't even have to be differentiable.
But when considering the category of smooth manifolds and smooth maps, certain constructions have to be smooth in order for the resulting objects to fit into this category. For example, the inverse image of a regular value under a smooth map is again a smooth manifold. If we omit the requirement that the initial map is smooth, the resulting manifold will not be smooth either (actually, sometimes it will not be a manifold at all). Alternatively, consider smooth vector fields. We know that such a vector field has a flow function which induces diffeomorphisms from the given manifold to itself. If the vector field is not smooth, the resulting automorphisms will not be smooth either, thus will not preserve the basic structure of any object in this category.
It is the same with the metric tensor. This tensor actually gives an isomorphism between the tangent and cotangent spaces at every point on the manifold. When it is also smooth, it yields an isomorphism of vector bundles between the tangent and cotangent bundles, i.e. it transforms smooth $1$-forms into smooth vector fields, and vice versa. Just one example, out of many - Let $f:M\to\mathbb{R}$ be a smooth function, so the derivative $df$ is a smooth $1$-form, and the metric induces the corresponding vector field $\nabla f$, the gradient. If the metric is smooth, then so is $\nabla f$, thus it has a smooth flow function and so on. If the metric is not smooth, then neither is the obtained gradient, and it just means that this vector field does not fit into the smooth category.
There are many other examples for things that "go wrong" if the metric is not smooth. The "bad" outcome is always that some obtained map or manifold or any other object will not be smooth either. It is worth mentioning that this "bad" outcome is not always so bad. As written above, there is a lot to do with non-smooth constructions. However, there are some results which require smoothness or at least the existence of many derivatives, and these results may fail to hold if one uses a non-smooth metric.
Comment: How does one define smoothness of a metric? In my text it is a tensorfields on the product of two modules, I dont see how one can define smoothness from that.
Comment: @user1 A Riemannian metric is indeed a tensor field. In particular, it is a map $g:M\to T^*M\otimes T^*M,$ and as such, it may be or not be $C^k$ for some $k\in\mathbb{N}$.


Mollies with Bettas?

Question: Yesterday I bought 3 balloon mollies to put in a 20L tank, which I also added my male Betta shortly after. How long should it take for them to get along? My Betta was a little defensive, not attacking the mollies, but showing signs of flaring. The mollies are hiding at the moment.
Answer: Betta can be housed with various other fish but in your case, you're short on space. 20L (5 gal) is about what is recommended for only a betta. Various sources seem to place the min tank requirement at 75L (20 gal) for mollies but some say 37L (10 gal) is fine. So as you can see, the your best guess would be to upgrade to a large tank or to split them in two tank. The betta in your current one and a larger for the mollies.
If you do split or upgrade please make sure the tank is/are cycled before getting the fish in them or you risk loosing some/all.
Comment: I agree that the different recommendations for the size exist. Since Mollies are eating machines, the lower size aquarium will need a very well monitored and maybe sophisticaed filtration. Large tanks are usually easier to manage.
Answer: You don't put any other fish with Bettas. The Bettas will stalk the other fish and from time to time bite off a big chunk of their fins. They have big mouths and sharp teeth, and are extremely aggressive.
Comment: This is definitively not true, betta can be housed with other fish, they simply need to have their personal space. I currently have a betta with a small school of neon tetra in a largish tank (75gal) and they get along pretty well. -1

Mollies with Bettas?


Number of solutions modulo n^2

Question: Let $n \ge 2$ be an integer.Prove that the number of integers $m$ such that $0 \le m \le n^2-1$ for which there are no solutions to $x^n+y^n \equiv m \pmod{n^2}$ is at least $\binom{n}{2}$.
I only proved that if $x \equiv y \pmod{n}$,then $x^n \equiv y^n \pmod{n^2}$ but don't know how to proceed.
Answer: You are almost done. Your argument shows that the number of sums you can get is the same as the number of sums if you choose $x, y$ from $\{0, \dots, n-1\}$ which gives you $n^2$ sums, but actually $x^n + y^n = y^n + x^n,$ so the maximal number of sums is $\frac{(n+1)n}2,$ which means that $n^2 - \frac{(n+1)n}2 = \binom{n}2$ sums cannot be attained.

Number of solutions modulo n^2


Has anyone tried using some custom drill bit for can openers?

Question: Just wondering if anyone has come up with a drill bit attachment that could operate handle for can opener? Yes, I'm lazy! But on those special occasions when I have to open a bunch of veggies and fruit cans I wish I had something.
Comment: You *do* know there are electric can openers, even ones small enough to use in hand like the one pictured above, right?
Comment: Yeah, just wondering if there were any creative ideas to turn the handle with a drill somehow.
Comment: If you want a drill bit that can attach to a can opener, I can 3D print you a Carbon Fiber one.
Answer: Yes. Someone jury rigged one: https://www.youtube.com/watch?v=9eK630Qm9I8
Although that video makes it look pretty smooth, manually applying power to a can opener, especially without rev control (I own that particular model of Bosch Ixo and can confirm that it doesn't), can get out of hand and might turn messy.
However, if you want to be able to open a lot of cans I would get a dedicated electric can opener, these can sometimes be attached to the side of the countertop: https://www.google.com/search?q=electric+can+opener
They're fairly simple and affordable devices, various kinds have been around for almost a century.
Comment: Note, that's a very low power screwdriver more than a drill. If you did that with a full-spec drill, you'd be wearing a lot of can's contents, if it didn't break your wrist first.
Comment: Yep, hence the warning.


Name of an angle between 0 and 180 degrees / $\pi$

Question: Is there a name for and angle larger than 0 and smaller than $\pi$ or 180 degrees?
So it covers acute, right and obtuse, it's kind of opposite of reflex angle. In my language there is a name for such an angle, so I'd be surprised if there isn't one in English. The term would then apply to every angle of a polygon iff that polygon is convex.
Comment: It may not be standard (I've never heard it, and I've been messing with geometry for a half-century), but if someone told me they had a "convex angle", I'd know that this was what they meant, so it seems like a pretty good term. :)
Comment: Not sure how standard this is, but one source calls it a "convex angle." https://proofwiki.org/wiki/Definition:Convex_Angle
Comment: Good question. But note, that some functions are defined for $\alpha \in [-\pi/2,\pi/2]$
Answer: Looks like some sources call this a "convex angle," because the interior of the angle is a convex set.
For example, PlanetMath and ProofWiki use this definition.
Answer: My GSCE maths textbook describes such an angle as an ordinary angle. Acute and obtuse angles are both ordinary angles, reflex angles are not ordinary angles. An ordinary angle is any angle from 0 to 180 degrees.


Why didn't the audience of the Prophet(Sm) ask about huruf muqatta'at?

Question: The generally held view of traditional scholarship is that its meaning is not known to us. But why didn't the Arabs raise any objection when the verses were recited?
Answer: Assalamu Alaikum,
Your question is valid. As you know, Quran has been revealed to Prophet Muhammad PBUH in Arabic in Saudi Arabia (Arabic State). They are the people of that language who took great pride in being Arabic. There were many poets, writers, and linguists who used to compete with one another. Matter of fact, Huroof Muqatta'at have their own meanings which were used in great meaning and significance. Arabs, during that time, were knowing their meanings. I'm not sure about other Huroof Muqatta'at, but 'TaHa' means 'My Dear' or 'Dearest One' which is a Chapter in Quran.
Quran challenged those Arabs to bring some example like these, in a form of a chapter, or verse, or a word (at least) to compete with the Highest standard of Arabic used in the Quran. Later, when the non-Arabs were becoming Muslims and learning the Language, they needed to know the depth of grammar and use of the language in order to understand the meaning of each verse in its true sense. The people of Arab that time understood the meaning as and when the verses were revealed. The grammar part came later which was meant to help non-Arabic speakers learn the language easily and understand the message of the Quran.
For Huroof Muqatta'at, there are few books in Arabic that explain their meaning. When you read them, you'll learn their meaning as well. These Huroof become the top standard of Arabic which was unbeatable and to make it clear that it is coming from Allah SWT, not from any human being.
I guess it has not been published in English or any other language, which raises confusion.
Please seek the help of Islamic Scholars, hope they'll offer you a satisfying answer.
Thank you.
Comment: What is the relation between a Saudi Arabia and the topic of this question your first 2-3 sentences are totally off-topic. And you claim something that none would agree about. Scholars have only potential (rather speculative but logical) answers as nobody really knows the reason.


Not able to boot into arch linux after installing arch linux

Question: Hello i'm in a pretty dangerous situation right now,i was installing Arch-Linux into my computer and my grub didn't install correctly as it was showing sector 32 was in use by flexnet and it didn't report any error, on ignoring the warning i followed rest of the instructions from www.fosslinux.com/7117/how-to-install-arch-linux-complete-guide.htm
On exiting from arch-chroot i rebooted my system only to see a grub prompt not showing options to boot into arch linux or windows.
Here are some things that i had done previously before installing:
I had created two partitions on my hard disk both ext2 to differentiate from other ntfs partitions.
I installed the base system in /dev/sda5 and created the swap system in /dev/sda6 within the same hard disk.
How do i boot into arch linux or if not possible then how do i restore to boot my system to windows back?.
Answer: You should always only follow the official guide to install Arch Linux.
The guide you linked misses a crucial step and is therefore outdated (unlike the wiki article above).
Three months ago the Arch Linux team changed how the base package is defined and you will now miss a linux kernel if you only install base (alongside some other useful software)
Things to do:

Read the ArchWiki guide as linked above
boot into your arch ISO
mount your partitions you already created
run pacstrap with your desired kernel and other software you may want
I don't use GRUB but you probably will need to re-run grub-mkconfig


Add required field to file upload

Question: I created two custom fields at the files object which are required. How can I add this fields to a flow with the file upload component?
I know how can I add fields to the Screen Flow, but the Upload start immediiately if I select a file and i have no Chance to add the field Infos.
Answer: There is a attribute on file upload in screen flow called Disabled.
If set to $GlobalConstant.True, the component is disabled. This attribute accepts single-value Boolean resources.
You can set the value of it true and false based on the values in required field in screen flow. It will make sure user can only upload file when they have selected the required fields.
or you can put the required fields on different screen than file upload. This will make sure they will only see upload file option when they have entered the required field.
Comment: Ok, but how can I put the required fields content to the new files record? If the user select at Screen 1 the required fields and in screen 2 the User Upload the file, how can I assign the fieldcontent to the record? I can Store the value in a resource, but of the User close the second Screen without finish the Flow, the resources will be lost.
Comment: Any ideas for may Problem?

Add required field to file upload


How can i decorate homemade dog biscuits?

Question: I made a batch of dog biscuits for a Christmas gift, and I want to write the dog's name on them with colored sprinkles.  The biscuits are the texture of over-baked sugar cookies.  Does anyone have an idea of how I can get crystal sprinkles to stick without using a sugar glaze?  Or another idea for a pretty way to put the dog's name on the cookies?
Comment: I am afraid this counts as off-topic :( See http://meta.cooking.stackexchange.com/questions/1108/would-a-question-regarding-making-homemade-pet-kitten-cat-food-be-considered-o
Answer: You can use animal (hide) glue to make the sprinkles stick, similar to the adhesive on some envelopes that can be licked (or moistened otherwise) to activate the 'stickyness'. The content of the glue is not really that far off from the ingredients in dog food.
Any gelatinous based adhesive would also probably do. While they offer no nutritional value, they are edible.
Non toxic paste, such as used by young school children would also work, but I don't know if the color would ruin the presentation you're trying to achieve. I'd go with the animal glue if you're able to source it. Just melt it down and use a fine paint brush to paint the dog's name, apply the sprinkles and let dry, then shake / blow off the excess.
Answer: You could use egg whites, well beaten, (from pasteurized eggs), and a fine tipped squeeze bottle or a narrow paint brush to apply it, then sprinkle and let it dry.
Answer: They also make those tubes of icing sugar to decorate cookies that come in all kinds of colors. They look like small tubes of toothpaste and some are even sugar free in this kind of gel form that you can write/decorate very easily with. I've seen them in the baking isle of a well stocked grocery store but also can be found for sure at a craft store such as michaels or AC Moore.
Comment: Thank you all for giving me such great ideas before my question got closed!! :)
Comment: I ended up using a sugar-free gel to write on some of the cookies, and for others, I got egg whites from a carton (the only pasteurized ones available).  I tried painting the whites free-hand, but because the biscuits are dark brown, I couldn't see the whites, so I cut a template of the name on cardboard, and used that as a guide for both brushing on the egg whites and pressing on colored sugar crystals.  All turned out cute, and I'm sure would work well on people cookies, too! :)


what is the recommended path for handling and retrying failed transactions?

Question: When dealing with failed transactions that can occur to due a program or smart contract error, a connection timeout, simulate transaction failed, or another reason, what is the recommended or possible approach to handle and retry these transactions?
Answer: This will depend significantly on the nature of the failure.
For example: after a connection timeout it may be appropriate to retry the transaction at a later time depending on the requirements around the timeliness of the information. On the other hand, retrying the same transaction that failed due to a program or smart contract error is unlikely to succeed until the program is updated to fix the error.
It may be helpful to submit examples of the failures you receive as separate questions. Having more details about the specific nature of the failure could help others generate possible approaches to handling and retrying.


Download history stock prices automatically from yahoo finance in python

Question: Is there a way to automatically download historical prices of stocks from yahoo finance or google finance (csv format)? Preferably in Python.
Comment: check out http://scrape-google-finance.compunect.com/
it's a rather new open source PHP scraper for Google finance.
It's free to use/modify and you can download all stock prices and all companies from Google. Should not be too difficult to learn from it and write the same in python.
Answer: When you're going to work with such time series in Python, pandas is indispensable. And here's the good news: it comes with a historical data downloader for Yahoo: pandas.io.data.DataReader.
from pandas.io.data import DataReader
from datetime import datetime

ibm = DataReader('IBM',  'yahoo', datetime(2000, 1, 1), datetime(2012, 1, 1))
print(ibm['Adj Close'])

Here's an example from the pandas documentation.
Update for pandas >= 0.19:
The pandas.io.data module has been removed from pandas>=0.19 onwards. Instead, you should use the separate pandas-datareader package. Install with:
pip install pandas-datareader

And then you can do this in Python:
import pandas_datareader as pdr
from datetime import datetime

ibm = pdr.get_data_yahoo(symbols='IBM', start=datetime(2000, 1, 1), end=datetime(2012, 1, 1))
print(ibm['Adj Close'])

Downloading from Google Finance is also supported.
There's more in the documentation of pandas-datareader.
Comment: When I try it, the imports work fine but when I call the 'goog' line I receive an error: "IOError: after 3 tries, Yahoo! did not return a 200 for url 'http://ichart.finance.yahoo.com/table.csv?s=GOOG&a=0&b=1&c=2000&d=0&e=1&f=2012&g=d&ignore=.csv'" How could this be fixed?
Comment: @Cleb Seems to be because `GOOG` is not accepted by the API (don't understand why, after move to Alphabet GOOG ticker was kept). Works fine for `GOOGL` and various other symbols. Example adjusted just in case.
Answer: Short answer: Yes. Use Python's urllib to pull the historical data pages for the stocks you want. Go with Yahoo! Finance; Google is both less reliable, has less data coverage, and is more restrictive in how you can use it once you have it. Also, I believe Google specifically prohibits you from scraping the data in their ToS.
Longer answer: This is the script I use to pull all the historical data on a particular company. It pulls the historical data page for a particular ticker symbol, then saves it to a csv file named by that symbol. You'll have to provide your own list of ticker symbols that you want to pull.
import urllib

base_url = "http://ichart.finance.yahoo.com/table.csv?s="
def make_url(ticker_symbol):
    return base_url + ticker_symbol

output_path = "C:/path/to/output/directory"
def make_filename(ticker_symbol, directory="S&P"):
    return output_path + "/" + directory + "/" + ticker_symbol + ".csv"

def pull_historical_data(ticker_symbol, directory="S&P"):
    try:
        urllib.urlretrieve(make_url(ticker_symbol), make_filename(ticker_symbol, directory))
    except urllib.ContentTooShortError as e:
        outfile = open(make_filename(ticker_symbol, directory), "w")
        outfile.write(e.content)
        outfile.close()

Comment: I get the following error: `AttributeError: module 'urllib' has no attribute 'ContentTooShortError'`
Comment: This answer was written 7 years ago, for Python 2.7. In the intervening timespan, Python 3 has modified the `urllib` module to be broken into submodules. The exception class you're looking for can be found here: https://docs.python.org/3/library/urllib.error.html#urllib.error.ContentTooShortError
Answer: Extending @Def_Os's answer with an actual demo...
As @Def_Os has already said - using Pandas Datareader makes this task a real fun
In [12]: from pandas_datareader import data

pulling all available historical data for AAPL starting from 1980-01-01
#In [13]: aapl = data.DataReader('AAPL', 'yahoo', '1980-01-01')

# yahoo api is inconsistent for getting historical data, please use google instead.
In [13]: aapl = data.DataReader('AAPL', 'google', '1980-01-01')

first 5 rows
In [14]: aapl.head()
Out[14]:
                 Open       High     Low   Close     Volume  Adj Close
Date
1980-12-12  28.750000  28.875000  28.750  28.750  117258400   0.431358
1980-12-15  27.375001  27.375001  27.250  27.250   43971200   0.408852
1980-12-16  25.375000  25.375000  25.250  25.250   26432000   0.378845
1980-12-17  25.875000  25.999999  25.875  25.875   21610400   0.388222
1980-12-18  26.625000  26.750000  26.625  26.625   18362400   0.399475

last 5 rows
In [15]: aapl.tail()
Out[15]:
                 Open       High        Low      Close    Volume  Adj Close
Date
2016-06-07  99.250000  99.870003  98.959999  99.029999  22366400  99.029999
2016-06-08  99.019997  99.559998  98.680000  98.940002  20812700  98.940002
2016-06-09  98.500000  99.989998  98.459999  99.650002  26419600  99.650002
2016-06-10  98.529999  99.349998  98.480003  98.830002  31462100  98.830002
2016-06-13  98.690002  99.120003  97.099998  97.339996  37612900  97.339996

save all data as CSV file
In [16]: aapl.to_csv('d:/temp/aapl_data.csv')

d:/temp/aapl_data.csv - 5 first rows
Date,Open,High,Low,Close,Volume,Adj Close
1980-12-12,28.75,28.875,28.75,28.75,117258400,0.431358
1980-12-15,27.375001,27.375001,27.25,27.25,43971200,0.408852
1980-12-16,25.375,25.375,25.25,25.25,26432000,0.378845
1980-12-17,25.875,25.999999,25.875,25.875,21610400,0.38822199999999996
1980-12-18,26.625,26.75,26.625,26.625,18362400,0.399475
...

Answer: There is already a library in Python called yahoo_finance so you'll need to download the library first using the following command line:
sudo pip install yahoo_finance

Then once you've installed the yahoo_finance library, here's a sample code that will download the data you need from Yahoo Finance:
#!/usr/bin/python
import yahoo_finance
import pandas as pd

symbol = yahoo_finance.Share("GOOG")
google_data = symbol.get_historical("1999-01-01", "2016-06-30")
google_df = pd.DataFrame(google_data)

# Output data into CSV
google_df.to_csv("/home/username/google_stock_data.csv")

This should do it. Let me know if it works.
UPDATE:
The yahoo_finance library is no longer supported.
Comment: Affirmed - 21/02/2018 - `yahoo_finance` no longer works.
Comment: At the time that was the only library I could find in relation to pulling Yahoo Finance Stock Prices. However, it doesn't seem to be working anymore.
Comment: Yahoo finance API is no longer supported.
Comment: Just curious -- what benefit does yahoo-finance provide over pandas_datareader (or vice versa)?
Comment: Thanks for this 3kstc
Answer: You can check out the yahoo_fin package.  It was initially created after Yahoo Finance changed their API (documentation is here: http://theautomatic.net/yahoo_fin-documentation).
from yahoo_fin import stock_info as si

aapl_data = si.get_data("aapl")

nflx_data = si.get_data("nflx")

aapl_data.head()

nflx_data.head()

aapl_data.to_csv("aapl_data.csv")

nflx_data.to_csv("nflx_data.csv")

Comment: Thank you for this reference, this was the only ready solution that work for me.
All other packages mentioned here seem to be outdated and don't work, probably because of the API changes in Yahoo Finance.\
Comment: typo: aapl.to_csv("aapl_data.csv")`  should be `aapl_data.to_csv("aapl_data.csv")`
Answer: It's trivial when you know how:
import yfinance as yf
df = yf.download('CVS', '2015-01-01')
df.to_csv('cvs-health-corp.csv')

If you wish to plot it:
import finplot as fplt
fplt.candlestick_ochl(df[['Open','Close','High','Low']])
fplt.show()


Is an event formally a 4-vector?

Question: An event is a 4D point in spacetime. At every point in spacetime there is a tangent space. 4-vectors live in the tangent space. One can contract two events using a metric tensor. Is there a process that moves the event as a point in the manifold to the tangent space?
Comment: In flat Minkowski spacetime, the answer is a 4D point can be considered a 4-vector, but that is a happy accident of flat Minkowski spacetime. That was what most of my experience happened to be. For any curved spacetime, the answer is no.
Answer: On a manifold, there is a separate tangent space around every point. The vectors in the tangent space consist of a direction and a magnitude, but they are keyed to the point in question. You can't, in general, move them to other points without assuming special properties of the manifold.
The tangent bundle of a manifold consists of all pairs with a point and a tangent vector in the tangent space of that point. (The tangent bundle is also a manifold, but larger than either the original manifold or the tangent spaces.) See for example Wikipedia: https://en.wikipedia.org/wiki/Tangent_bundle
Consider a point particle with speed. The particle resides on the manifold, its speed on the tangent space at the point, and the pair (point, speed) on the tangent bundle.
The speed and the location of the particle are separate concepts, even though the speed only makes sense at a given point. The tangent bundle combines the information.

Is an event formally a 4-vector?


Is the Westerosi heraldry similar to western europe medieval heraldry?

Question: Similar to our world, heraldry play an important role to distinguish noble Houses or singular character. But did the westerosi heraldry follow the same rules as ours ?
Answer: TLDR:
Inspired, but not similar in all points
Long answer:
There are some diferences between westerosi and european heraldry, as there are lot of rules in real world that are not followed in westeros:

No particular jargon: In our world, there is a particular jargon to describe coats of arms, for colors and figures. For example, we don't say "a golden lion on red background" but "gules, a lion or". Westerosi seems to lack this specific kinds of terms
Rule of tincture: One basic rule of heraldry is the rule of tincture: metal should not be put on metal, nor colour on colour. Metal refers to gold and silver, while colors are azure(blue), gules(red), sable(black), vert(green) and purpure(purple).

Therefore, some sigils like Targaryen (gules and sable are both colors) don't follow the rules.

Limited number of tinctures: in real world, there are only two metals and five colors, and for example, two variant of greens are both considered "vert". Therefore, some sigils like Stark's (as grey and white are both considered "argent") or Duncan's(using a color gradient) don't follow the rules.
Comment: I'm disinclined to upvote, 1. Because of the lack of a sourced confirmation on the level of inspiration from Western European medieval heraldry, and 2 because there certainly exist heralds that are colour on colour. **tl;dr** me likey sources
Comment: @Edlothiad - you mean there are coats of arms that are color on color.  In English heralds are persons whose functions sometimes include heraldry.
Comment: @Kepotx - in English a sigil means a seal.  Many medieval and later people and institutions used and still use their coats of arms on their seals.  In Westeros a sigil may mean something similar to a coat of arms.  But in English the word sigil is not used to mean a coat of arms and it would be an error to to use it outside of discussion of Westeros emblems.  And I feel a little uncomfortable that you didn't mention that fact in your discussion.  However good a story the world of Westeros may be, it will have a bad influence if it leads to people calling coats of arm sigils.


Dental plosive with no apical obstruction

Question: Can I have a paper which describes dental plosives by the two rows of teeth as opposed to contacting the dental area with the tongue ?? I mean the air needs obstructed and the posterior most place of articulation defines the phoneme but nobody who I socialize with is doing it. they just use the two teeth rows, so can I have a reference please?
Comment: To clarify: are you looking for a paper or book on phonetics that describes a consonant (likely a fricative) that is produced, either in natural language or in impaired speech, by contacting the top and bottom teeth, with the tongue remaining in its resting position?
Comment: Its just a plosive consonant with the teeth though.. "A bidental plosive" as the other comment suggests.
Comment: Well, I didn't think of a plosive, despite you saying "plosive", because that seemed clearly impossible as lines of teeth are not airtight, and the rest of what you wrote was also unclear, probably explaining the close vote and my clarification request.
Comment: So really in a dental plosive the air is coagulated behind the tongue while it is contacting the teeth????
Comment: I don't think a *purely* dental plosive, with the tip of the tongue touching the teeth but the blade not contacting the upper palate's alveolar ridge *at all*, is common in non-impaired speech. Denti-alveolar stops (where the tip of the tongue does touch the teeth, but the airflow is primarily stopped by the blade touching the upper palate) are common, and then you can have distinctions between laminal and apical alveolar stops, and stops made with the tongue making contact further back in the palate. My point is that a "purely" dental stop won't be a stop for most people, as it'd let air out.
Answer: I have not seen all papers in phonology, but I don't think that a bidental plosive or a bidental stop (that would be technical terms for that sound) was ever described in literature. A bidental fricative /h̪͆/ is described as a marginal phoneme occurring as an allophone of another voiceless fricative in Northeast Caucasian languages, see Are there conlangs using constructed sounds? and the answer of J. Siebeneichler there. The bidental fricative is also observed in distordered speech. In disordered speech, there is also a bidental percussive, [ʭ], produced by striking the teeth against each other (gnashing or chattering the teeth).
Comment: Moreover, a bidental plosive would be just too hard for most people to perform consistently. The air isn't obstructed enough. Even just using one set of teeth and the lips to fully occlude the air and produce a labiodental plosive is vanishingly rare, according to Wikipedia: https://en.m.wikipedia.org/wiki/Voiceless_labiodental_stop


How is microcode loaded to processor?

Question: I read that microcode is loaded in the processor on each reboot. It resides on flash memory and when the machine is booted, it gets copied to the CPU. Or in the case of Linux, the OS itself has the microcode copy for the processor.
But how does the microcode get copied to the processor?
All data moves in a computer by the consent of the CPU. CPU is given instructions in machine language.
As microcode is imperative for execution of these machine language instructions, so without the microcode being present in the processor, how the instruction for accessing the flash memory and doing the consequent operations are done by CPU?
Does this mean that hard-wired non-microcoded instructions copy the microcode in real mode?
Comment: @Kraken You're being a bit too pedantic. ROM programming *is* a form of hard-wiring. And *microcode* is just another conceptual abstraction layer (of many). You can put microcode into RAM, ROM, or "etch it directly on the circuitry" if you want. It's still microcode though, regardless of *how* you physically implement it in the CPU.
Comment: @sawdust CPU microcode does get loaded at every cold boot, either by the system BIOS or OS early in its boot process.
Comment: @misha256 -- *"CPU microcode does get loaded at every cold boot,"* -- That implies a chicken-or-egg conundrum.  Are you confusing the (possible) ***update*** of microcode with (an alleged) *loading* of microcode?  There's a world of difference between the two.
Comment: @sawdust Good point. I need to be more clear. Modern CPUs come with *hard-wired microcode*. Microcode *Updates* are then applied by the BIOS or OS as required. The CPU contains a small amount of volatile "patch" RAM for this purpose.
Comment: *"I read that microcode is loaded in the processor on each reboot."* -- Your source/premise in not correct.
Comment: http://www.webopedia.com/DidYouKnow/Hardware_Software/BootProcess.asp
Comment: You already figured it out on your own. Modern CPUs still work without microcode updates. Just like a fresh install of Windows 7 works without updates. Then you can load updates that fix bugs, security vulnerabilities, or enhance functionality. With microcode, the updates get applied each time you boot.
Comment: @misha256 do -- Hard-wired as in "made up of logic and etched on the circuitry" or as in "present on permanent memory, ready to be executed."
Comment: I still don't understand why this is a bad question. I never even knew what microcode was in relation to a conventional CPU.
Answer:
I read that microcode is loaded in the processor on each reboot.

The BIOS can issue a microcode update during boot.  So can the operating system.
 Frequently these updates are required, especially with later Intel CPUs.

It resides on flash memory and when the machine is booted, it gets copied to the CPU. Or in the case of Linux, the OS itself has the microcode copy for the processor. But how does the microcode get copied to the processor?

Modern Intel and CPUs have  a mechanism called "Model Specific Registers", and special CPU instructions to read (RDMSR) and write to them (WRMSR).  While these registers affect CPU settings, writing to a specific one with the address of the new microcode tells the CPU to read a region of memory and apply over the existing microcode.

All data moves in a computer by the consent of the CPU. CPU is given instructions in machine language. As microcode is imperative for execution of these machine language instructions, so without the microcode being present in the processor, how the instruction for accessing the flash memory and doing the consequent operations are done by CPU?

There is always a microcode.  The mechanism above updates the microcode.  Intel/AMD don't really publish specifics on how it works, they only provide an update mechanism.  Obviously somehow it is copying a ROM microcode to some sort of CPU internal memory.  But there is some microcode there when the CPU starts.  Some recent Intel and possibly AMD CPUs won't work reliably after boot without a microcode update done by the BIOS but evidently they will function well enough to perform an initial microcode update.

Does this mean that hard-wired non-microcoded instructions copy the microcode in real mode?

The initial microcode setup is done internally by the CPU and no instructions are executed to achieve that.  It's setup before the first CPU instruction is executed.
To update the BIOS the appropriate RDMSR and WRMSR instructions must be executed.
Reference: "This instruction must be executed at privilege level 0 or in real-address mode; otherwise, a general protection exception #GP(0) will be generated."  If it's not executed in real mode it must be done in ring 0 or kernel mode.  You can update the microcode anytime.
Comment: Thanks for reading through my ill-formulated, year(s)-old question in the first place. Your answer is very precise and full of insight. +1. Thanks again.
Answer: Modern CPUs come with complete microcode already installed. This microcode resides in a special ROM area on the CPU itself and cannot be changed/erased. Thus, the CPU can function out-of-the-box.
The system BIOS and/or Operating System can then initiate the loading of a microcode update into the CPU. Such an update is not a complete microcode, but rather a small patch to address bugs. The CPU contains a small area of volatile RAM for this purpose.
A useful reference: https://www.dcddcc.com/pubs/paper_microcode.pdf
Comment: *"Modern CPUs have hard-wired microcode"* -- That's an oxymoron, since it's "hardwired" versus microcoded (aka microprogrammed).  A better descriptor might be "built-in".
Comment: @Kraken Like any complex system, CPU design consists of a number of layers. But in the end, all the layers are considered, as a whole, to be *hardware*. For example, when designing a CPU, you might separate things out like this: Logic/gates-layer --> Micro-operations layer --> Micro-instructions layer --> Micro-code layer, --> Machine-code layer. These layers are *conceptual* rather than physical. Once you have your design, you are free to implement these layers how you like. In the end, everything ends up hard-wired in silicon. Including the microcode.
Comment: @Kraken *"What? "Built in" microcode, ...  a built-in hardwired combinatorial-logic system?"* -- Now you're just being argumentative. The "built-in" adjective was to differentiate that microcode with the "updated" microcode.  Also the classic conceptualization for microcode (as I learned in college) was that it resided in the "control store", which implies some sort of memory device. See [A Brief History of Microprogramming](http://people.cs.clemson.edu/~mark/uprog.html)
Comment: Hard-wired as in "made up of logic and etched on the circuitry" or as in "present on permanent memory, ready to be executed."
-- Because if they are hardwired, they should not be labeled microcode anymore.
Comment: What? "Built in" microcode, that is present on a non volatile memory inside CPU. Or a built-in hardwired combinatorial-logic system?
Comment: @misha256 there some simple instructions that are directly executed by hardware?
Comment: @Kraken I found something for you: https://en.wikipedia.org/wiki/Micro-operation.
Comment: @Ramhound -- You seem to have problems following the discussion.  I offered constructive criticism to misha256, and the response was an appropriate correction to the answer.  Kraken's response to that critique was a ridiculous recombination of terms.
Comment: @sawdust - You win; I withdraw my feedback; do what you want;
Answer: The microcode update is a patch only to the existing CPU microcode which is burned into ROM permanently. The CPU has a permanent ROM and a patch RAM which can contain new code. There is also a table of "match" values that is in RAM. This table has an entry for every patchable part of the ROM. When the CPU executes a patchable instruction, it checks this table. If there is an entry, then it uses the code in RAM. If it has the default value, then it jumps to ROM. So, to patch the CPU it is necessary to upload the new code to RAM and then modify entries in the match table appropriately. The procedure for doing this is roughly as follows:

Clear EAX, read the current processor signature using CPUID, and load the matching microcode update into kernel memory.
Clear EAX and EBX, and read the current microcode revision using the RDMSR instruction from the revision match specific register.
Write the memory address of the microcode update using the WRMSR instruction to the update match specific register.
Read the new microcode revision, and return success if it matches that of the update. Otherwise, return failure.

In Linux-based operating systems, this process is done on boot by a specific kernel module called "microcode". You can read the source code for this module to see the exact process.
Note that the patch files have a documented header, but the patch data itself, the actual code, is encrypted by a secret key which is hard-coded into the processor. Unless you know this key, you would have no way of writing your own patches.
Answer: The question is ill-formulated. There are many "microcodes" in modern x86/IA64 CPU, and there is a difference between "microcode patch" and microcode.
The microcode in its classic understanding (as step-by-step elements of execution of long CPU instructions) is almost certainly en-carved in silicon, as there is no reason to keep bugs unfixed along many generations of CPU, when new silicon/RTL is compiled with every new manufacturing node.
However, all recent CPUs have several internal units that are controlled by independent microprocessors that are embedded inside the x86 CPU chip.
Most notable/known is so-called "P-unit", a processor that controls dynamic power management of the CPU. As core frequencies went up and leakage went up with further miniaturization of CPU transistors, the only way to keep power in reasonable limit is by aggressive clock throttling and dynamic power gating. The problem is that the CPU can execute infinite varieties of software codes, and each reaches a certain peak of power consumption. Some patterns of "power viruses" may not be known at the moment when CPU was finalized for retail, and some parameters of managing algorithms must be corrected. This is done via dedicated "microcode patches".
There are several more microprocessors of this sort that control other CPU blocks like graphics and memory.
The details of patching process are top secret, to prevent malicious interference. Here is some hacker's report on the attempt to reverse engineer the mechanism.
In short, the x86 architecture microcode is not loaded in modern CPUs, but microcodes for various auxiliary embedded microprocessors can have patches.

How is microcode loaded to processor?


How to get node id from URL?

Question: I want to pass a URL to a function. This function should get the node ID from the URL.
How to do this?
Answer: You can try the following code (please note that about-us is merely an example page - you can put whichever page you want here):
$url = 'about-us';
$path = drupal_lookup_path('source', $url);

if ($path) {
  $node = menu_get_object('node', 1, $path);
  return $node->nid;
}
else {
  //Error handling in case path provided does not exist
}

The code above returns a whole node object though, which might be expensive depending on how often you run it - another option would be to run explode() on the output of drupal_lookup_path() and just take the NID that way.
References:
drupal_lookup_path();
menu_get_object();
Answer: You may try the following one-liner:
$nid = end((arg())); // Get the last number from the URL.

Answer: You can read the URL values using arg() function.
For Example,
If your url is node/100 then
$argument_one = arg(0); // This will store "node" to the variable.
$node_id = arg(1); // This will store 100 to $node_id variable.

Like above using arg() function you read the URL components.
Hope it solves your issue !
Comment: what if i wanted to get the node ID of some other URL (refferal)
Comment: What do you mean by some other URL ? Can you post example URL ?
Comment: yes , for example : $nid = getNodeId($URL); ... i want to pass the URL to a function . i didn't mean with my question that i want to extract the node ID of the current URL
Answer: Theirs tonnes of different ways to "pass the url to a function" which way suits best depends on the situation and preference really.
What is the exact purpose of passing this URL with the node id? is there going to need to be multiple Node ID's passed at any one point? More details would mean a more detailed answer also.
$URL = $_SERVER['REQUEST_URI'];
OR
$URL = $_GET['q']
// if using this then the full path needs prepending as this only gets node/nid
OR
$URL = current_path(); // same as GET[q] basically

// then this passes to that function you wanted
$nid = getNodeId($URL);

Comment: He is asking for a function which will give him node id of any path(alias) passed to the function
Answer: You could break the url string  into an array as
$url_arr = explode('/', $url);

Then you can access the url parts from the array.
Comment: $url variable is not defined by default.
Answer: Pass the variable (node id) appending it to url like this:
    <?php
    $nodeid = $node->nid;
    ?>

<a href="http://www.mysite.com?nodeid="<? php print ($nodeid) ?>">

and then in  get the value from url like:
<?php
$nodeid=$_GET["nodeid"];
?>

And then pass the value to the function.
http://php.net/manual/en/reserved.variables.get.php

How to get node id from URL?


Am I supposed to be able to vote up twice?

Question: So, recently I was looking at an answer, I clicked on the vote up button because it was good and then noticed I already had. The score changed to 2 and I un vote-upped it. Is this supposed to happen? The answer is here
Answer: Remember that you aren't the only one voting on questions and answers, more people do, actually, voting is the way to show your appreciation.
It can happen that if you upvote, somebody else might have done that too since you loaded the page. So after voting, the counter would have increased by 2 as if you did that, but in fact it is just more people voting while your page hasn't been refreshed yet. The system won't allow you to vote multiple times.
Please remember to vote often! That is much appreciated!
Comment: @Jonathan - Probably just some weird browser bug. It happens from time to time (unrefreshed pages etc.)
Comment: Just to clarify, I said I already voted the post up. That was the problem I was getting to.


Load multiple layers into multiple maps - python

Question: import arcpy
import arcpy.mapping
import os
import sys
from arcpy import env
#import string

env.workspace = r"G:\GIS"
mxds = arcpy.ListFiles("*.mxd")
lyrs = arcpy.ListFiles("*.lyr")

for maps in mxds:
    df = arcpy.mapping.ListDataFrames(mxds, "Layers")[0]

    arcpy.mapping.AddLayer(df ,lyrs ,"AUTO_ARRANGE")

    maps.save()

del mxds, maps, df, lyrs

Answer: Your code is not going to work for these reasons:

You need to add  a wildcard "*" to ".mxd" and ".lyr" so that these return something (lines 3 and 4)
You referenced "mxds" instead of "maps" on line 6, and it needs to be referenced as a arcpy.mapping.MapDocument because you need to save later.
You need to nest the add each layer in a loop (line 8)
You need to save the changes to the MapDocument object, not the mxd name (line 11)

Credit to this answer on adding layers.
Try this fix:
import arcpy
arcpy.env.workspace = r"G:\GIS"
mxds = arcpy.ListFiles("*.mxd")
lyrs = arcpy.ListFiles("*.lyr")
for maps in mxds:
    mxd = arcpy.mapping.MapDocument(maps)
    df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
    for layer in lyrs:
        addlayer = arcpy.mapping.Layer(layer)
        arcpy.mapping.AddLayer(df ,addlayer ,"AUTO_ARRANGE")
    mxd.save()


How to play a speex file in Flex?

Question: When i am pointing to an FlV it's playing successfully. But when it comes to a speex file.
I am getting an error StreamnotFound. How to resolve this issue?
Answer: The Flash Player does not support Speex codec and does not support adding codecs not built-into the player.
Answer: While it would be difficult, you could implement the speex codec in Actionscript and use the Sound object's sampleData event to play it.
It would likely be far easier to convert speex to mp3 server-side.

How to play a speex file in Flex?


Calendar Themes

Question: Are there any themes for the Calendar module? The out-of-the-box theme is not great. It be nice to find a new base theme without rolling my own.
Answer: I do not know of any contributed themes that specifically cater to calendars. However, there are several sites that provide themes that are more likely to have considered Calendar module:

Fusion Drupal Themes
Adaptive Themes
Omega Framework Group
Answer: You could also try the FullCalendar module; I think it looks nice.

Calendar Themes


Who is Eliakim? Could he be both a son of the son of Hilkiah and Josiah?

Question: In Kings II 18, Eliakim is the son of Hilkiah the kohen gadol, in Kings II 23 he is referred to as Jehoiakim son of Josiah. How could he be both?
Answer: Based off of Wikipedia (and as per @JoelK's comment) they seem to be 2 different people.
1) Eliakim son of Hilkiah

Eliakim  son of Hilkiah, succeeded Shebna to become finance minister for King Hezekiah of Judah

Wikipedia says King Hezekiah's reign was between 715 and 686 BC.

2) Jehoiakim son of Josiah (fka as "Eliakim")

was a king of Judah from 609 to 598 BC. He was the second son of King Josiah.

The discrepancy of dates and positions seem to indicate they were 2 different people.


Could you give me some examples of work slangs?

Question: I'd like to know some idioms that are used at work by workmates or bosses.
Comment: For what situation?
Comment: You're more likely to hear formal terms or professional jargon than slang at work.
Answer: I think the 36 strategies of ancient China contains plenty of "slangs" that you can refer to at a work context, and fell under the requirement that you're seeking for. There is translated books about it that you can purchase online easily. Even though you don't want to read a whole book, you can easily search some general or detailed descriptions online.
Among those 36 strategies, I would say 抛砖引玉 is the most commonly used at a work context, and the meaning has been evolved when you use at work, and it is understood as "put forward a few pointers for discussion and comment". It also shows your attitude to the audience that you're being humble, and open and ready to listen to opinions.
And I'm sure there are a lot other slangs that are commonly used at work context, and I hope this answer can attract real "jade" from my "brick".:)
Answer: The most common slang words/phrases I know is sha2 instead of shen2me for 什么.
Aside from that, there maybe also is wo3bu4er1dao instead of wo3bu4zhi1dao for 我不知道 (Please not this is only used for the negation!).
Those are not work or boss specific, but they are pretty common. Nevertheless I do not recommend using them, as it is commonly seen as 'uneducated'.
Comment: "不儿道" /puɻ55 tao51/,"啥" /ʂa35/
Comment: These are not specific to work. They can be used anywhere.
Comment: @fefe that's absolutely correct. But OP didn't define any work context either. 'Not-so-good' questions generally receive 'not-so-good' answers. An answer still, but the quality is consistent at least.


Communicating between PICs over 30 feet

Question: I have a PIC24F based device that normally connects to a PC via USB. The device can be controlled through PC software this way. I want to add an optional hand control box that can also be plugged into a separate connector on the main device and can be used to control the device and read/display data from the main device. This hand control box will also be PIC based. I am trying to decide which communication technique to use between the main device and the optional hand control box. I like the idea of SPI but I know that is not intended to be used over long distances. Do you think my best option would just be to use the UART modules with RS-232 line tranceievers to boost the signal to +/-12 volts? Are there really any other options?
Comment: There is RS485, but 30ft is easy in quiet env. Is it quiet?
Comment: Do you have a strong preference with respect to wired/wireless protocols?
Comment: Lots of options below, based on USB RS232 devices are cheap and easy, I would use RS232. 30 feet will have a maximum speed. http://www.lammertbies.nl/comm/info/RS-485.html
Answer: One option (assuming your desired device supports it... many Microchip PIC's do) is a CAN messaging system. It's extensively used in automobiles, e.g. so a tire rotation speed sensor and an accellerometer can communicate with the airbag computer. The protocol is designed such that you can have an unlimited number of devices communicating on one bus without collisions.
I use it at my company to communicate up to about 200 feet between a product and a controller. Highest standard baud rate is 1Mbit/s. It's fairly easy to implement in C. You'll need a CAN transceiver if you choose to do this; something like Microchip's MCP2551.
Here's the specification, here's pertinent app notes AN713 and AN754
Comment: +1 CAN is robust. However, I don't think it specifies hardware/physical layer. What voltage and cable scheme do you use?
Comment: We usually 5VDC along shielded twisted pair. This is uncommon, most automotive applications use 12 volts. For a 30 foot run in anything less noisy than a microwave I'd first try using CAT5 driven at 5VDC, because it's cheap and will probably work just fine.

edit: I work in industrial lighting, not automotive
Comment: +1 for CAN.  Hardware layer is defined esp. if you go for a protocol such as CANopen
Answer: I've implemented the DMX protocol used for theatrical lighting systems which is a flavour of RS-485, and this worked in a noisy environment at least as far as 100ft. This was using a PIC16F877A and a RS-485 line driver to transmit, and several other receiver units with the same microcontrollers, daisy chained together along the 100ft line with a terminating resistor at the end.... it worked well.
Microchip actually has a very good datasheet on the subject with some circuit diagrams and example assembler code.
Answer: RS-485 will work well, but you will need to add a RS-485 transceiver between your UART and the RS-485 bus. There are many software protocols that use this physical layer. Modbus is one of them that I've used in the past. It's very simple to implement and there are lots of industrial controllers out there that support it.
Answer: Yes, RS232 will work.  Keep the baudrate nice and low, and 30 feet is no problem.  But long cable runs are a hassle, so wireless seems attractive.  Especially since a quality 30' RS-232 cable costs some money.
Other ideas to consider:

if one way communication is acceptable, put an IR receiver on the box and program it to listen to a consumer IR control.  Use a popular remote's codes so that an $8 universal remote will work.
if you control the host software on the PC, have it open an ethernet port and serve web pages with the desired functions and controls on them.  Any wifi-enabled iPad or smartphone becomes a remote control, and remote monitoring is easy.  You could even replace the USB with an ethernet port, but that will add some complexity to the box.
Look at the ISM-band wireless modules like the 24L01 stuff from Nordic and the CCxxxx parts from TI.  Sparkfun sells some on modules.  If this is for a real product, using FCC precertified modules can save some money because FCC cert is expensive.  I would say modules make sense in product volumes up to 5000 pieces.

Edit: You should use this remote.
Comment: To add to the *RS232* answer: ensure you implement improved error checking on top of parity (CRC or whatever). You may be able to use CAT5e or CAT6 cable, depending on your environment, which is cheap.
Answer: I have used these,RF Link 4800bps Receiver - 315MHz and RF Link Transmitter - 315MHz
i have 2 different frequencies one for send and one for receive. I have successfully used them up to 30 feet using 5v to power them. Sparkfun has other wireless communication devices as well.
Comment: xbee, from what i have heard work great, I probably will be picking a few up soon.
Comment: I have just been looking at the xbee and bluetooth products
Comment: It's worth mentioning that I believe the linked RF modules have no error-checking or correction. It's entirely up to the user to check the transmitted data is valid. Any noise during the data transfer can cause errors, which will not be detectable unless you do parity or CRC checking.
Comment: @Fake Name Yes you are correct there is no error checking in the linked RF modules, they are very simple devices, so no bells and whistles.
Answer: There are various ZigBee devices that can be used just like a UART and should be simple to control from a PIC device.  For example, the XBee is quite easy to use and is very affordable.  In my experience I've been able to transmit and receive data in a crowded office at distances greater than 100 ft, and in a wide open space we could do much better, especially with good antennae.  In my opinion wireless is much preferred to a 30-ft. long cable!
Comment: I agree. Digi xbee modules can be cheaper than a cable! They will go 10-20m with no antenna and 100m through walls with even a 1/4 wave length piece of wire as antenna. They also provide full error checking and even encryption.
Answer: The MIDI interface was designed to reliably communicate over 50 feet.
The hardware required (an optoisolator and a diode and a few resistors and an IC or transistor inverter) costs less and has better performance over long lines than the hardware required for +/- 12 V RS232 communication.

official MIDI interface schematics
beautiful MIDI IN schematic

Communicating between PICs over 30 feet


Min b'sh'eino mino requires bitul b'shishim rather than bitul b'rov, d'rabbanan or d'oraisa?

Question: The rule that min b'sh'eino mino requires bitul b'shishim rather than bitul b'rov, is this d'rabbanan or d'oraisa?
Comment: For the sake of outsiders, we try to avoid [unnecessary jargon](https://judaism.meta.stackexchange.com/questions/1606/site-policy-on-jargon) at Mi Yodeya. If possible, please try to find an English equivalent to make your post more understandable.
Answer: If your question is if the taste that comes out of an item needs sixty times it size to nullify it min haTorah, then your question really is, is Ta"am k'ikur M'Dioraysa.
That is a three way Machlokes in the Rishonim, based on the Gemorah in Pesachim 44b,
(1) it is from the Torah and you would get the same punishment as the original forbidden food,
(2) it is from the Torah but you do not get malkus on just the taste, or
(3) it is only m'dirabonon.
Here is how the sefer קובץ יסודות וחקירות summarizes it:
Comment: @jonahalpen I would be shocked if Hebrew National hotdogs contained cheilev
Comment: Actually my question is if one eats b'mezid God forbid stam non-kosher ground beef or non-kosher beef hot dogs or Hebrew National hot dogs or non-kosher ground sirloin or round or McDonald's french fries which are known to be fried in beef fat, would he God forbid get kares because of the cheilev issue?  Or no, because the cheilev would be batel b'rov d'oraisa, considering that the chelev and the non-chelev in the hot dog are min b'mino since the fat and meat are ground up together and it's lach b'lach?  Or maybe they are min b'sh'eino mino, and you would need batel b'shishim?
Comment: But my question is, is the entire inyan of min b'sh'eino mino d'rabbanan, so even if the chelev and the non-chelev in the mixture were min b'sh'eino mino, still the chelev would be batel d'oraisa?
Comment: @jonahalpen - You are making an assumption that Cheilev and meat are not the same "min". That is actually a discussion in the Shach YD 88/1. Assuming it is min b'sh'ayno mino, then it would depend on the Rishonim mentioned in the answer.
Answer: Rambam Hilchot Maachalot Assurot 15:1-2:

When a forbidden substance becomes mixed with a permitted substance of another type, [it causes it to become forbidden] if its flavor can be detected...
What is implied? When the fat of the kidneys falls into beans and becomes dissolved, the beans should be tasted. If the taste of fat cannot be detected, they are permitted. If [not only] the taste, [but also] the substance of the fat is present, they are forbidden according to Scriptural Law. If the flavor could be detected, but there is no substance, they are forbidden by Rabbinic Law.

In paragraph 3 Rambam goes on to define what he means by 'substance', and in paragraph 30 to discuss what to do if there is no one available to taste the suspect mixture (which often involves estimating based on a ratio of 1:60).


On Ubuntu 18.04, I cannot change the owner of folders that are in my shared VirtualBox folder; how can I make myself, not root, owner?

Question: I am using a virtual machine with Ubuntu 18.04 desktop, and I am working on a Wordpress project with Nginx. I installed VBox guest additions, but I cannot change the owner of the shared folder, which I have set to auto mount in the /opt folder; the path to the shared folder is /opt/myfolder/THISFOLDER. I want to edit contents (files) inside THISFOLDER. I have tried the command sudo chmod -aG vboxsf myusername and rebooted to no avail. When I do sudo chown -R myusername /opt/myfolder, it also doesn't do anything. How can I fix this?
Answer: Try this:
cd /opt/myfolder ; pwd - verify that pwd prints /opt/myfolder and nothing else, then sudo chown -R myusername:mygroup *

to run sudo in "local" folder is a bit safer w.r.t. errors.
(hint: try echo * and press enter)
Also set group, this might be your actual problem - i.e. keeping the current group attempting to set yourself as the owner. If you're not member of that group it will likely fail (not verified).
Comment: it didn't work.
Comment: Have a look at what numbers you have in `cat /etc/group` (groups) and `cat /etc/passwd` (user IDs) - then compare to what you see with `ls -ln` in the folder and possibly in some subfolders. Also check inside the virtual machine in the same way... a virtualbox/vmware document check might reveal something.


Basement ceiling/wall construction

Question: I'm finishing my basement and need to use 2x2 furring strips to clear some plumbing and gas line runs. Should I install the furring strips first and build the walls up to the furring strips or walls first? Basically do you need a top plate to secure your dry wall or are the studs in the wall good enough support? Thanks.
Answer: The furring strips go up first. You will need a top plate and a bottom plate to secure the drywall. You might find you need 2x4's depending on the thickness of your plumbing and gas lines. Don't forget the nail stop plates to protect the plumbing/electric lines.

Basement ceiling/wall construction


What happens to a killed lich if their phylactery is in a really inconvenient spot?

Question: I'm thinking, if the players place the phylactery at the bottom of the ocean or weight it down in a sea of lava somewhere.  Would the lich be able to be rejuvenated at the bottom of a sea of lava or under the pressure of the ocean floor?  What about dropping it into the Sun?  What would happen to the lich if that doesn't destroy the phylactery (magically protected) but wouldn't be all too convenient to reappear within a few feet of?
Answer: RAW, the lich would reform
The lich's stat block describes rejuvenation (MM, p. 202):

Rejuvenation. If it has a phylactery, a destroyed lich gains a new body in 1d10 days, regaining all of its hit points and becoming active again. The new body appears within 5 feet of the phylactery.

No mention is made of what would happen if there is no unoccupied space within 5 feet of the phylactery, of whether anything else might block it (pressure on ocean floor, etc), so RAW, it simply reappears there. This is also not expanded on in the lore (MM, p. 203):

Death and Restoration. [...] Within days, a new body forms next to the lich's phylactery, coalescing out of glowing smoke that issues from the device.

Nothing more is said about it, so unless the DM were to rule that it would not be possible (such as if it were surrounded on all sides by 10 foot thick walls with only a tiny pocket for the phylactery in the middle, and even then, the DM may rule that it simply waits until it does have room, or that it reappears in the nearest unoccupied space, etc), the lich would reform.
For what it's worth, I am as DM would rule that it would be able to reform at the bottom of the ocean, that the magic of the phylactery somehow ignores the water pressure, but if it were in a small pocket of space (i.e. only just enough room for the phylactery, definitely not enough room for a lich) surrounded on all sides by at least 10 feet of solid wall, then it couldn't reform and would have to wait until there was room (i.e. walls moved/destroyed or phylactery magically removed).
But if the environment would kill it, it would be locked into a cycle of death and rejuvenation
If, for example, we assume that the phylactery was at the bottom of a pool of lava, and if we assume that the phylactery is unharmed by this lava, then unless the lich has a way to magically escape its surroundings before it loses all of its HP, then it would die and reform again in the exact same spot... locked into a cycle of death and rejuvenation until the lava pool stopped existing somehow or the phylactery was somehow removed from the lava pool.
Comment: @Sdjz However, when I wrote the part on escaping, I was thinking of the fact that the MM says "_a destroyed lich gains a new body in 1d10 days, **regaining all of its hit points** and becoming active again_", but makes no mention of regaining spell slots, so it might be the case (likely, if the lich was destroyed through combat with a bunch of pesky adventurers) that the lich doesn't have any spell slots left with which to magically escape. Then again, the lich might also keep a spell slot reserved for exactly this reason, they are smart enough to potentially plan for this...
Comment: Oh we actually have a [question on that](https://rpg.stackexchange.com/questions/107928/does-a-reformed-lich-come-back-with-all-its-spell-slots)
Comment: A note on escaping: The lich has access to Dimension Door to help it escape a hostile environment (and depending on what the phylactery is, might be able to bring it along).  It also has Plane Shift though it is unlikely to have the necessary material components
Comment: @Sdjz Fantastic! I'm glad there's some backing on that interpretation, since that's how I read it...
Comment: Related: https://rpg.stackexchange.com/a/95862/38834 - Can you cast spells underwater? The general idea is yes, if you can breathe. But obviously liches do not need to breathe so it's not that helpful. But by the same reasoning, can a lich cast a spell with a mouthful of lava?


Problems importing gluon.html from outside web2py

Question: I want to try to code some gluon-derived components (web2py html helpers), outside from web2py. This way I can test components on the command line, and generate simple html files which I can analize before integrating them with the complete web2py application stack. This speeds up my development cycle, since I can concentrate on finetuning the HTML of the component without worrying about any other issues (redeploys, databases, ...). Fast and easy: prepare a web2py component with gluon.html helpers, see if the HTML generated looks good, and then use it from within web2py.
The test has been mostly successful. I just had to:
from   gluon.html                import A, TABLE, DIV, SPAN, THEAD, TR, TH, TBODY, URL, H1

def T(txt):
    return txt

def my_simple_component(title):
    return H1(T(title))

def test():
    print my_simple_component('Hello')

Which produces the expected output:
$ python test_web2py_components.py

Hello

(I do not care about T in my tests. And for my any test URL that I want to use, I just pass a fake application / controller / function.)
The only problem that I have found is that I need to have a symbolic link to web2py for the gluon.html import to work, even though gluon is on the PYTHONPATH.
ln -s /install_dir/web2py/gluon/ .

Is there a way to import gluon components without having that extra link?
Consider that during the test phase my components are outside of the web2py application tree.
This is the error I get:
Traceback (most recent call last):
  File "lib_test1.py", line 4, in <module>
    from   gluon.html                import A, TABLE, DIV, SPAN, THEAD, TR, TH, TBODY, URL
  File "/install_dir/web2py/gluon/__init__.py", line 15, in <module>
    from globals import current
  File "/install_dir/web2py/gluon/globals.py", line 24, in <module>
    from serializers import json, custom_json
  File "/install_dir/web2py/gluon/serializers.py", line 11, in <module>
    from languages import lazyT
  File "/install_dir/web2py/gluon/languages.py", line 264, in <module>
    PLURAL_RULES = read_possible_plurals()
  File "/install_dir/web2py/gluon/languages.py", line 250, in read_possible_plurals
    for pname in os.listdir(pdir):
OSError: [Errno 2] No such file or directory: '/current_dir/gluon/contrib/rules'

(Do not consider install_dir and current_dir: they have been introduced for this question)
Answer: You should not have to make the link.
If you want the import to find "gluon", the folder that should be at PYTHONPATH is its parent: sys.path.insert(0,'/install_dir/web2py').
This works, (here the zip contains the gluon folder):
>>> import sys
>>> sys.path.insert(0, 'C:\web2py\library.zip')
>>> from gluon.html import H1
>>> print H1("Hello")

Hello


Is calling destructor manually always a sign of bad design?

Question: I was thinking: they say if you're calling destructor manually - you're doing something wrong. But is it always the case? Are there any counter-examples? Situations where it is neccessary to call it manually or where it is hard/impossible/impractical to avoid it?
Comment: Look at "rules" that contain the words "always" and "never" that don't come directly from specifications with suspect: in the most of the cases who is teaching them wants to hide you things you should know but he doesn't know how to teach. Just like an adult answering to a child to a question about sex.
Comment: @peachykeen: you would call placement `new` to initialize a new object in place of the old.  Generally not a good idea, but it isn't unheard of.
Comment: How are you going to deallocate the object after calling the dtor, without calling it again?
Comment: I think it's fine in case of manipulating with constructing objects with placement  technic http://www.stroustrup.com/bs_faq2.html#placement-delete (but it's rather low level thing and is using only when you optimize your software even in such level)
Answer: All answers describe specific cases, but there is a general answer:
You call the dtor explicitly every time you need to just destroy the object (in C++ sense) without releasing the memory the object resides in.
This typically happens in all the situation where memory allocation / deallocation is managed independently from object construction / destruction. In those cases construction happens via placement new upon an existent chunk of memory, and destruction happens via explicit dtor call.
Here is the raw example:
{
  char buffer[sizeof(MyClass)];

  {
     MyClass* p = new(buffer)MyClass;
     p->dosomething();
     p->~MyClass();
  }
  {
     MyClass* p = new(buffer)MyClass;
     p->dosomething();
     p->~MyClass();
  }

}

Another notable example is the default std::allocator when used by std::vector: elements are constructed in vector during push_back, but the memory is allocated in chunks, so it pre-exist the element contruction. And hence, vector::erase must destroy the elements, but not necessarily it deallocates the memory (especially if new push_back have to happen soon...).
It is "bad design" in strict OOP sense (you should manage objects, not memory: the fact objects require memory is an "incident"), it is "good design" in "low level programming", or in cases where memory is not taken from the "free store" the default operator new buys in.
It is bad design if it happens randomly around the code, it is good design if it happens locally to classes specifically designed for that purpose.
Answer: Calling the destructor manually is required if the object was constructed using an overloaded form of operator new(), except when using the "std::nothrow" overloads:
T* t0 = new(std::nothrow) T();
delete t0; // OK: std::nothrow overload

void* buffer = malloc(sizeof(T));
T* t1 = new(buffer) T();
t1->~T(); // required: delete t1 would be wrong
free(buffer);

Outside managing memory on a rather low level as above calling destructors explicitly, however, is a sign of bad design. Probably, it is actually not just bad design but outright wrong (yes, using an explicit destructor followed by a copy constructor call in the assignment operator is a bad design and likely to be wrong).
With C++ 2011 there is another reason to use explicit destructor calls: When using generalized unions, it is necessary to explicitly destroy the current object and create a new object using placement new when changing the type of the represented object. Also, when the union is destroyed, it is necessary to explicitly call the destructor of the current object if it requires destruction.
Comment: Instead of saying "using an overloaded form of `operator new`", the correct phrase is "using `placement new`".
Comment: @RemyLebeau: Well, I wanted to clarify that I'm not only talking only of `operator new(std::size_t, void*)` (and the array variation) but rather about all overloaded version of `operator new()`.
Comment: @Adrian: calling the destructor and recreating the object very easily changes the type of the object: it will recreate an object with the static type of the assignment but the dynamic type may be different. That is actually an issue when the class has `virtual` functions (the `virtual` functions won't be recreated) and otherwise the object is just partially [re-]constructed.
Comment: What about when you want to copy an object to do an operation in it without altering it while the operation is computing? `temp = Class(object); temp.operation(); object.~Class(); object = Class(temp); temp.~Class();`
Comment: `yes, using an explicit destructor followed by a copy constructor call in the assignment operator is a bad design and likely to be wrong`.  Why do you say this?  I would think that if the destructor is trivial, or close to trivial, it has minimal overhead and increases the use of the DRY principle.  If used in such cases with a move `operator=()`, it may even be better than using swap.  YMMV.
Comment: @DietmarKühl, having an assignment operator, for an inherited class object is problematic already, so I would say that your argument is moot.
Comment: This may not actually be correct if you have overloaded the user-defined placement allocation functions since you can override the delete operator to function properly with these functions. You might do this in a large project to support various custom allocators.
Answer: No, Depends on the situation, sometimes it is legitimate and good design.
To understand why and when you need to call destructors explicitly, let's look at what happening with "new" and "delete".
To created an object dynamically,  T* t = new T; under the hood: 1. sizeof(T) memory is allocated. 2. T's constructor is called to initialize the allocated memory. The operator new does two things: allocation and initialization.
To destroy the object delete t; under the hood: 1. T's destructor is called. 2. memory allocated for that object is released. the operator delete also does two things: destruction and deallocation.
One writes the constructor to do initialization, and destructor to do destruction. When you explicitly call the destructor, only the destruction is done, but not the deallocation.
A legitimate use of explicitly calling destructor, therefore, could be, "I only want to destruct the object, but I don't (or can't) release the memory allocation (yet)."
A common example of this, is pre-allocating memory for a pool of certain objects which otherwise have to be allocated dynamically.
When creating a new object, you get the chunk of memory from the pre-allocated pool and do a "placement new". After done with the object, you may want to explicitly call the destructor to finish the cleanup work, if any. But you won't actually deallocate the memory, as the operator delete would have done. Instead, you return the chunk to the pool for reuse.
Answer: No, you shouldn't call it explicitly because it would be called twice. Once for the manual call and another time when the scope in which the object is declared ends.
Eg.
{
  Class c;
  c.~Class();
}

If you really need to perform the same operations you should have a separate method.
There is a specific situation in which you may want to call a destructor on a dynamically allocated object with a placement new but it doesn't sound something you will ever need.
Answer: As quoted by the FAQ, you should call the destructor explicitly when using placement new.

This is about the only time you ever explicitly call a destructor.

I agree though that this is seldom needed.
Answer: Any time you need to separate allocation from initialization,
you'll need placement new and explicit calling of the destructor
manually.  Today, it's rarely necessary, since we have the
standard containers, but if you have to implement some new sort
of container, you'll need it.
Answer: Found another example where you would have to call destructor(s) manually. Suppose you have implemented a variant-like class that holds one of several types of data:
struct Variant {
    union {
        std::string str;
        int num;
        bool b;
    };
    enum Type { Str, Int, Bool } type;
};

If the Variant instance was holding a std::string, and now you're assigning a different type to the union, you must destruct the std::string first. The compiler will not do that automatically.
Answer: There are cases when they are necessary:
In code I work on I use explicit destructor call in allocators, I have implementation of simple allocator that uses placement new to return memory blocks to stl containers. In destroy I have:
  void destroy (pointer p) {
    // destroy objects by calling their destructor
    p->~T();
  }

while in construct:
  void construct (pointer p, const T& value) {
    // initialize memory with placement new
    #undef new
    ::new((PVOID)p) T(value);
  }

there is also allocation being done in allocate() and memory deallocation in deallocate(), using platform specific alloc and dealloc mechanisms. This allocator was used to bypass doug lea malloc and use directly for example LocalAlloc on windows.
Answer: What about this?
Destructor is not called if an exception is thrown from the constructor, so I have to call it manually to destroy handles that have been created in the constructor before the exception.
class MyClass {
  HANDLE h1,h2;
  public:
  MyClass() {
    // handles have to be created first
    h1=SomeAPIToCreateA();
    h2=SomeAPIToCreateB();
    try {
      ...
      if(error) {
        throw MyException();
      }
    }
    catch(...) {
      this->~MyClass();
      throw;
    }
  }
  ~MyClass() {
    SomeAPIToDestroyA(h1);
    SomeAPIToDestroyB(h2);
  }
};

Comment: This seems questionable: when your constructor trows, you don't know (or may not know) which parts of the object had been constructed and which hadn't. So you don't know for which sub-objects to call destructors, for instance. Or which of the resources allocated by the constructor to deallocate.
Comment: The way you wrote the `ctor` here is wrong, exactly for the reason you provided yourself: if resource allocation fails, there's a problem with cleanup. A 'ctor' should not call `this->~dtor()`. `dtor` should be called on **constructed** objects, and in this case the object is not yet constructed. Whatever happens, the `ctor` should handle the cleanup. Inside the `ctor` code, you should use utils like `std::unique_ptr` to handle the automatic cleanup for you in cases when something throws. Changing `HANDLE h1, h2` fields in the class to support automatic cleanup could be a nice idea as well.
Comment: @VioletGiraffe if the sub-objects are constructed on stack, i.e. not with "new", they will be destroyed automatically. Otherwise you can check if they are NULL before destroying them in the destructor. Same with the resources
Comment: This means, that the ctor should look like: `MyClass(){ cleanupGuard1 tmp_h1(&SomeAPIToDestroyA) = SomeAPIToCreateA(); cleanupGuard2 tmp_h2(&SomeAPIToDestroyB) = SomeAPIToCreateB();  if(error) {
 throw MyException(); } this->h1 = tmp_h1.release(); this->h2 = tmp_h2.release(); }` and **that's it**. No risky manual cleanup, no storing handles in partially-constructed object until everything is safe comes as a bonus. If you change `HANDLE h1,h2` in the class to `cleanupGuard h1;` etc, then you may even not need the `dtor` at all.
Comment: Implementation of `cleanupGuard1` and `cleanupGuard2` depends on what does a relevant `xxxToCreate` return and what parameters does a relevant `xxxxToDestroy` take. If they are simple, you might even not need to write anything, as it often turns out that `std::unique_ptr` (or similar one) can do the trick for you in both cases.
Answer: I found 3 occasions where I needed to do this:

allocating/deallocating objects in memory created by memory-mapped-io or shared memory
when implementing a given C interface using C++ (yes this still happens today unfortunately (because I don't have enough clout to change it))
when implementing allocator classes
Answer: I have never come across a situation where one needs to call a destructor manually. I seem to remember even Stroustrup claims it is bad practice.
Comment: @JimBalter: creator of `C+`   ☺
Comment: You are correct. But I have used a placement new. I was able to add the cleanup functionality in a method other then the destructor. The destructor is there so it can "automatically" be called when one does delete, when you manually want to destruct but not deallocate you could simply write an "onDestruct" couldn't you? I would be interested to hear if there are examples where an object would have to do its destruction in the destructor because sometimes you would need to delete and other times you would only want to destruct and not deallocate..
Comment: And even in that case you could call onDestruct() from within the destructor - so I still don't see a case for manually calling the destructor.
Comment: @MarkKCowan: what is C+ ? It should be C++
Answer: I have another situation where I think it is perfectly reasonable to call the destructor.
When writing a "Reset" type of method to restore an object to its initial state, it is perfectly reasonable to call the Destructor to delete the old data that is being reset.
class Widget
{
private:
    char* pDataText { NULL  };
    int   idNumber  { 0     };

public:
    void Setup() { pDataText = new char[100]; }
    ~Widget()    { delete pDataText;          }

    void Reset()
    {
        Widget blankWidget;
        this->~Widget();     // Manually delete the current object using the dtor
        *this = blankObject; // Copy a blank object to the this-object.
    }
};

Comment: You must not call the destructor explicitly in this situation. You'd have to implement an assignment operator, anyway.
Comment: Wouldn't it look cleaner if you declared a special `cleanup()` method to be called in this case *and* in the destructor?
Comment: A "special" method that is only called in two cases?  Sure... that sounds totally correct (/sarcasm).  Methods should be generalized and able to be called anywhere.  When you want to delete an object, there is nothing wrong with calling its destructor.


Intuitive way to arrive at the maximizing argument for the binomial probability

Question: The binomial probability term $q^{n}(1-q)^{N-n}$ is maximized when $q=n/N$. This can be easily arrived at by differentiating the given probability term with respect to q. Is there a more intuitive way to arrive at this value of q that maximizes the probability ?
Answer: Yes; $N\choose n$$q^{n}(1-q)^{N-n}$ is the probability of obtaining $n$ successes in $N$ independent trials given a probability of success for each trial of $q$. To maximize the probability of obtaining $n$ successes, choose $q$ such that the expected number of successes in $N$ trials is $n$, i.e., $q = n/N$.
Comment: Thank you. When N=2 and n=1,the product is $q(1-q)$.Now, even without looking into the probabilities, we know that(which can be proven in a number of ways) this quadratic function is maximized when both q and 1-q are equal. I was wondering if there is something along that line which would help generalize q=n/N without resorting to differentiation or necessarily invoking the probability. I was looking at it like this. Given two numbers n and N such that N>n, then the pair (a,b) that maximizes $a^{n}b^{N-n}$ will be (n/N,1-n/N).I was wondering if there is something intuitive behind this.
Comment: With regard to the above comment, the maximization of the function is done under the constraint a+b =1 .
Comment: Can't think of anything off the top of my head. The constraint $a + b = 1$ really suggests a probabilistic setup, but there may be some angle along other lines.
Answer: This is how I usually explain the situation:
I repeat some experiment (make up one that makes the most sense) 1000 (or any large number) and find that I get a particular result 50 times. What do you think the probability of the result is?
Almost everyone immediately would say 50/1000.
I then use your result to actually show that this makes the most sense.
I carefully avoid terms like a-posterori or maximum likelihood


Will filling gaps with epoxy in a new hardwood floor look ok?

Question: I installed a floor made from locally produced, 3 1/4" hard maple. There are a few gaps under 1/16th of an inch that I don't like. I normally buy the best product for the application, but the stores will be closed tomorrow. What I do have access to is epoxy. Most wood fillers are a two part epoxy anyways. One video shows epoxy mixed with sawdust to fill knots and cracks. Gaps seem a little different, though. Will mixing up a thick sawdust-epoxy paste be a definite, long term, aesthetic improvement? The floor isn't sanded or finished yet.
Comment: Are you having this professionally sanded and finished, or is it diy?
Comment: I use sawdust from sanding the floor and wood glue to fill needed areas but filler never looks the same even if using the dust from the same install. When putting down varathaine I do use a clear epoxy to fill after staining the color is the same but it creates magnification rings that some think look like water on the floor but the color is uniform.
Comment: Wood glue is yellower.
Answer: The epoxy glue products are not made for this situation. It will stick out like a sore thumb.  It will not accept stain.  There are any number of good quality wood filler products that are made specifically for this application. The manufacturers of these products state that they will accept stain however, I have found that to be only partially true.  They are still the best choice for this job. Wood that is properly seasoned and good tight installation is the best defense against having to fill the cracks.
Comment: Are you talking something available at a regular hardware store, like Minwax wood filler? I imagine that the most common kind is the epoxy or bondo types that are made for filling in rotten wood, and probably to be painted over. I'm not sure that these are made to be seen. I think they are darker. Could you give me an example of a product?
Comment: Minwax, Elmers, J-B, Dap, Durham's
Answer: I used contractor-grade wood filler (specifically, Elmer's ProBond Max) along all the grooves between beams in one room that I resurfaced using a dark stain, not knowing for sure how it would turn out.  Although there were some spots that had to be re-patched after the floor sander shook some filler loose, I did end up with a result that I liked a lot - to the point of wishing I'd done the whole house that way.  (Whether it's more attractive is quite subjective, but it definitely is easier to keep clean.)
There are some caveats though.  Even with water popping, the filler absorbed more stain than the wood.  So I do have darker lines between beams - it's just slender and subtle enough that you have to get down to the floor to see it.  I even had some gaps up to 1/8" (and maybe more) that I also patched, and they are more perceptible but still not ugly.
I also tried mixing my own filler with wood or white glue and dust from the floor, but had too much difficulty producing a substance with usable consistency.  If you need to match natural wood grain, this seems to be the conventional wisdom* and I know no better alternative.  If you're staining, you might as well take the easy route and use general purpose wood filler.  In either case, you should expect that the filled area - even if it matches hue quite closely - will be darker.
*For more detail, see: https://woodworking.stackexchange.com/questions/5873/making-wood-filler-from-sawdust


Matshita UJDA 760 DVD/CDRW not working

Question: I have a Panasonic Toughbook CF-30 with a Matshita UJDA 760 DVD/CDRW running Ubuntu 12.04. I have tried everything I can think of to try and resolve this issue but nothing works. The drive shows up in the disk utility and I'm able to eject the dive from here. However the drive can't read anything and won't auto play. I'm running windows 7 paralleled on this machine and the drive works just fine in that. Please help me with this problem. I much prefer your Operating system over Windows and must be able to use this CD drive for work.
Answer: It maybe something to do with CDFS.  Try this.
Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:
<code>sudo apt-get update && sudo apt-get install cdfs-src
</code>

Matshita UJDA 760 DVD/CDRW not working


How to create a MySQL stored procedure from PHP?

Question: My attempts to query MySQL from PHP with a create statement of a store procedure (SP) have all failed. Is this not possible ?
If indeed possible, please give an example.
Comment: http://forums.mysql.com/read.php?98,161275,161275
Answer: Besides of the privileges, what quite probably might cause your problem is, that actually mysql_query($query) can only work one command per call !
So what you have to do is to split up the commands into sevaral mysql_query($query) -calls.
What i mean is something like this:
$query = "DROP FUNCTION IF EXISTS fnElfProef (accountNr INT)";

mysql_query($query);

$query = "CREATE FUNCTION fnElfProef (accountNr INT)
    RETURNS BOOLEAN
       BEGIN
          DECLARE i, totaal INT DEFAULT 0;
          WHILE i < 9 DO
             SET i = i+1;
             SET totaal = totaal+(i*(accountNr%10));
             SET accountNr = FLOOR(accountNr/10);
          END WHILE;
       RETURN (totaal%11) = 0;
    END";
mysql_query($query);

$query = "SELECT * FROM mytable";
mysql_query($query);

Answer: As long as:

You're using MySQL 5.0+
Your account has been authorized for creating stored procedure
You're using the valid CREATE PROCEDURE syntax

Then it should be working. Check these and get back to us.
Answer: The MySQL manual has a clear overview about how to create stored procedures (13.1.15. CREATE PROCEDURE and CREATE FUNCTION Syntax).
The next question is: does the account you use to access the MySQL database the propper rights to actually create a procedure?
Details about this question can be found here: 19.2.2. Stored Routines and MySQL Privileges
Answer: You can't use the DELIMITER statement from within PHP. Therefore,
1) remove the DELIMITER statements
2)and change all your delimiters to ;

It is annoying because now you have to have a version with DELIMITERS for development and testing in MySQL command line or a MySQL tool like sqlyog or MySQL workbench, and a version without DELIMITERS to use via your PHP program.
If someone knows a better way, I'd like to hear it - (but not by calling a OS shell script - that has too many residual issues.)
And you need SUPER permissions.
Answer: Have you got sufficient privileges on the account you are connecting from PHP with? From the manual

As of MySQL 5.0.3, to execute the
  CREATE PROCEDURE or CREATE FUNCTION
  statement, it is necessary to have the
  CREATE ROUTINE privilege

See also Stored Routines and MySQL Privileges in the manual.
Answer: Replace
mysql_query($query);
To
mysql_unbuffered_query($query,$link_connection);


moving object in html/css/javascript detecting collision with other objects

Question: I want to make a moving man in css/html/javascript, also detect collisions with other objects. Any idea how to do it? or any pointers to the same will do great.
Answer: The first try is look at rapahel js project it uses canvas, second it is a pretty hard thing to do as you want your own physics engine at 2 D level, but i guess with some math formulas you could do it, but everything that you need as an object should be scripted in js to be sure to get the collision effect.
Some design patterns should help you to make your code better.
Good luck.
Answer: Pretty much any basic game tutorial covers the topics you asked.
If you can't find a javascript version of that, just get anything in a language you are familiar and try to code the same thing in javascript.
to draw things somewhat in the same way these tutorials probably do, use a div with "position:relative" and its children with "position:absolute" and use "top" and "left" css style proprieties to position the boxes/sprites/whatever.
I am pretty sure you can figure out what to do if you follow these tips.


Laravel how to retrieve the recently uploaded values

Question: I have a database in mysql.  I upload a set of data to the database table from a .csv file or .xls file.  During retrieval I need to retrieve only the set of values which I have recently uploaded to the table in the database. I should not get all the values which stored in the table.(only values recently uploaded to the table should be retrieved).  How can I do that using Laravel?
Comment: Do you want to achieve this during the same request?
Comment: Not in the same request
Comment: Use `insertGetId` method to retrieve the recently added records into DB. Check *Auto-Incrementing IDs* section from [document](https://laravel.com/docs/5.4/queries)
Answer: Lets say you have a table/model named Users;
$getLatestUsers=Users::orderBy('created_at','desc')->take(5)->get();

this will take 5 recent records from database.
Comment: The problem I have is the number of recent records is unknown. It depends on the values that .xls or .csv has
Comment: pk use timestamp column then; ->where('created_at', '<', Carbon::now()->subMinutes(10)->toDateTimeString())
Comment: @Leo_Kelmendi I do back that approach
Answer: Well it depends on what you consider "recent" but you could tweak a function like this to fit your needs:
->where('created_at', '<', Carbon::now()->subMinutes(5)->toDateTimeString())

This would retrieve the elements created the last 5 minutes, but Carbon offers a wide variety of substractors.
PD: Remember to add use Carbon\Carbon; under your namespace declaration.
Hope this helps you.
Answer: $latest= Users::orderBy('created_at','desc')->take(10)->get();

this will return 10 recent values

Answer: (1)
In the table where you store the data from CSV and XML, using a migration, create a flag to mark the records you didn't process yet, e.g. is_processed. Give it the default value of 0.
(2)
If you have data you already retrieved (processed), set those to 1, so they don't get processed again. You can do this manually with a query, based on the conditions that make sense in your case.
(3)
Then, after you store new data, they will be automatically set to is_processed = 0. This means you can identify them afterwards, like this:
$unprocessedData = MyModel::where('is_processed', 0)->get();

You can also order them if you need to, but - in general - that's the approach I would take.