Wiring jquery file upload to google app engine

Question: I'm trying to add visual drag-and-drop upload capabilities to my GAE-based site using the JQuery File UPload plugin ( see https://github.com/blueimp/jQuery-File-Upload/wiki ). While there is a documentation page on the topic ( https://github.com/blueimp/jQuery-File-Upload/wiki/Google-App-Engine ), it falls short of showing the whole process and no matter how much I wrestle this around I cannot get it to work.
My starting point is a simple single file image upload to the blobstore which redirects to a list of images:
class Pic(db.Model):
    blob_key = blobstore.BlobReferenceProperty()
    url = db.StringProperty(required=True)
    creation = db.DateTimeProperty(auto_now_add=True)

class PicUploadForm_Handler(webapp.RequestHandler):
    def get(self):
        upload_url = blobstore.create_upload_url('/upload_pic/')
        self.response.out.write('')
        self.response.out.write('<form action="%s" method="POST" enctype="multipart/form-data">' % upload_url)
        self.response.out.write("""Upload File: <input type="file" name="file">
 <input type="submit"
        name="submit" value="Submit"> </form>""")

class PicUpload_Handler(blobstore_handlers.BlobstoreUploadHandler):
    def post(self):
        upload_files = self.get_uploads('file')  # 'file' is file upload field in the form
        blob_info = upload_files[0]
        pic = Pic(
            blob_key=blob_info.key(),
            url=images.get_serving_url(blob_info.key()))
        pic.put()
        self.redirect('/pics/list/')

class List_Pics(webapp.RequestHandler):
    def get(self):
        pics = Pic.all()
        pics.order("-creation")
        results = pics.fetch(5)
        html_str = ''
        for pic in results:
            html_str += '

'%(pic.url, pic.url+'=s100')
        html_str += ''
        self.response.out.write(html_str)

Now the Image Plugin has two parts on the client-side which may require customization:
This one:

and the upload form:
<form action="{{upload_url_2}}" method="POST" enctype="multipart/form-data">

            Add files...
...

After wrangling with this for a day, I cannot figure out what is the role of each one of those urls ({{upload_url_1}} and {{upload_url_2}} in that last snippet).
I have tried hooking one of them to a handler which handles the uploads and returns json with the results, and hook the other one to the handler which allocates the upload url (using create_upload_url()) but any permutation of this type of wiring failed.
Can anyone with experience wiring jquery image upload into GAE python can provide an explanation or a full example?
Answer: upload_url_2 looks like it should correspond to create_upload_url().
upload_url_1 looks like it would be invoked as a callback when a file has been selected, before it gets uploaded. If you're not actually trying to accomplish something here, you may be able to omit it. Have you tried initializing it without an add callback, just $('#fileupload').fileupload(); ?
Comment: this is one of the permutations I tried, but it does not work


Fasten adjustable perpendicular cylinders rotating on axis

Question: What part(s) make it simple to secure two perpendicular cylinders together when one of the cylinders is rotating on its axis?  In the drawing below, C(3) rotates with a simple motor.  C(1) and C(2) rotate with C(3) because C(3) is rotating on its axis.  All three cylinders are about an inch in diameter because they are just plastic right now.  I'd like to use metal later on to fasten them together, but I'm trying to make them fit together nicely.  The axle C(3) will eventually be a lot smaller in diameter than one inch.  And C(1) and C(2) need to be able to easily slide but still be secure on C(3).  The goal is to make it easy to assemble and disassemble the cylinders.  I thought of using a lock pin seen in the second picture below.  The issue is that lock pins only allow a rotation of 180 degrees before impeding and this needs to rotate almost a full rotation.  Are there any mechanical parts that would function like a lock pin but still make this rotate more than 180 degrees?
Answer: If you search on the internet on swivel joint for the rotating joint and under screwdriver joints for the fixed joint you will find manny examples.


Is it possible to export (and then import) plugins and their settings in IDEA?

Question: I have several good plugins in my IDEA and now switched to new version. All settings have been exported and then imported but plugins. How can I easily move them from 11 to 12 version? Thanks.
Answer: IntelliJ IDEA manages plug-ins compatibility when plug-ins are installed from the repository, it automatically finds the latest compatible version when downloading.
However, if you just copy version 11 compatible plug-ins to IDEA 12, it will most likely break and even not start as there were a lot of API changes and many plug-ins would require upgrading to be fully compatible with IDEA 12.
It's exactly the case why plug-ins are not automatically copied to the new version when you import the settings from the old version.
Even if a plug-in is listed as compatible, it may still not work if the maintainer didn't limit the upper compatible build number or did it incorrectly.
I would strongly recommend installing plug-ins that you need from the repository carefully checking the latest release date and compatibility information. If someting breaks and IDEA stops working, delete the incompatible plug-in manually from the plugins directory.
Considering that IDEA 12 is not even released at the moment of this writing (RC3 is available), it may take some time until all the plug-ins that you need are updated to be compatible with this version. You may want to continue using IDEA 11 version until it happens.

If you want to take the risk, just copy plug-ins directory from the old version to the new one, but you've been warned.
Comment: why doesn't idea try to download and install plugins itself?
Comment: @Eugen It does -- after successful launch (when all plugins are already loaded).
Answer: It would be a lot smarter something like what maven does about dependencies, just manage a xml file with installed plugins, and then in the export/import settings process just do whatever plug-in-compatibility-check idea does and download/install the compatible plugins.
Doesn't sound to hard to implement in further updates of IDEA 12.
Meanwhile, you can manage to make a list of plugins checking the old folder and downloading one by one, because making a copy of the old plug-in folder to the new most likely make idea 12 to crash...
Good Luck.
If anybody knows how to report a jira/ticket to jetbrains, point me in the right direction and I'll gladly report this as an improvement.


Does general relativity predict different forces on aircraft than Newtonian mechanics?

Question: When taught how airplanes fly, we are probably always given the Newtonian mechanism: that four forces act on an airplane; lift and weight on the vertical axis, and thrust and drag on the horizontal axis. Since gravity is a force in Newtonian mechanics, this seems to predict that passengers on an airplane in flight should feel both their weight due to gravity and additional force due to lift at all times, not just when taking off. However, this is not what happens; passengers in an airplane coasting at a constant velocity feel their normal weight due entirely to lift, as implied by general relativity. Is this intuition correct? What I'm really asking is, do general relativity and Newtonian mechanics predict different vertical forces on airplanes?
Comment: This question seems to be ill-posed- but just draw a free-body diagram of a passenger in a plane and you will get the right answer.
Comment: That should also depend on approximations that you made ...  What will be your gravitational potential of earth etc...
Answer:
Since gravity is a force in Newtonian mechanics, this seems to predict that passengers on an airplane in flight should feel both their weight due to gravity and additional force due to lift at all times, not just when taking off.

Whether you are coasting in an airplane or on the ground, if you have 0 net acceleration, the force you feel is the normal force of the airplane or the ground pushing you upwards. Passengers do not feel lift directly. The airplane feels lift and the passengers feel the seats or floor beneath them. Any difference they feel from their normal weight will be accompanied by a net vertical acceleration. $N = M(g+a)$: normal force provides net upward acceleration "a" after opposing acceleration due to gravity "g".
In the Newtonian description there are two opposing forces on the overall plane: lift and gravity. In the GR description the plane would travel along a falling geodesic due to gravity, but lift is a force that deviates the plane from its geodesic. I would say the descriptions are different so in a sense the described forces are different, but the predictions are (to very good approximation) the same in terms of what passengers feel and in terms of accelerations.
Answer: Newtonian mechanics emerges from General Relativity mathematically, .

When Euclidean coordinate lengths are replaced by the metric lengths of a curved geometry within Newton's second law of motion, the metric form of the second law can be shown to be identical to the geodesic equation of motion of general relativity. The metric coefficients are contained in the metric lengths and satisfy the field equations of general relativity. and energies.

So the question to ask is if the velocities and masses of aircrafts moving in the atmosphere and in the earth's field are such as to need the corrections to the vertical forces  from  special and general relativity.
These corrections are necessary for the GPS system to work at the needed accuracy, but not large enough to be felt for passengers in aircrafts.


How to give users access to the header or footer text in a view?

Question: I have a view with a "global text" header that changes once a month. It's not easy in Drupal to give users access to only certain fields in a view. And I wouldn't want to "scare" them with the views UI either ;-)
Answer: One option is to create a new Views "attachment" display, and give it different permissions than the other view.
Answer: What I did was create a "basic page" and change the author to the user that should be able to change the text.
Then I created a view with content="basic page" and a contextual filter "nid" with the nid of that page. Remove the title field and add the description field and save.
Now I just have to change my original view, remove the "global text field" from the header and add a "Global: view area" instead. Select the view just created and you are done.
Or if you have views_PHP installed you can add a "Global:php" field and add this code:
<code><?php
$nid = 342388;
$node = node_load($nid);
print $node->body['und'][0]['safe_value'];
?>
</code>
Answer: Views UI: Edit Basic Settings

"Views UI: Edit Basic Settings" places edit tabs on Views pages, similar to node pages, and allows users with the correct permission to modify their header, footer, title, empty text, or number of items to display. This module also provides a separate interface that displays a list of views. All Views are defined by you, so you can exclude certain Views.
The WYSIWYG module is supported, so users may use a rich text editor when editing Views content settings.
Answer: I've used the Views UI: Edit Basic Settings  module and it does what you want.
If you store your view in features it will reset every time you revert, which could be annoying for editors.
You can set views header to be a node by choosing rendered entity as the header. This should be editable.


To transfer attributes from a polygon feature class (that contains line feature ) to the line feature class using python script

Question: Has anyone tried to trasfer attributes from a polygon feature class to a line feature class using python script. I have done it with Spatialjoin and Identity, but the output is often another feature class-. I need to get polygon attributes and transfer them to the line feature class. Please help...
Answer: From your statement, i think you have the ArcGIS Desktop..
Identify the common id between the poly and line feature.
then do join based on the common id. have the line feature as input and polygon as join features.
Verify the join, and then export the line feature.. it will create a new line feature with all attributes from polygon..
After you practice these steps, you can easily find the python codes.


Disable save as image on smartphones using all browsers ( chrome, firefox, ie, cm, opera )

Question: i want to disable the option to save as images on smartphones (android and IOS) using mobile browsers like chrome, firefox, ie, cm, opera, ie. Could anyone have a solution to this?
chi
Answer: These days it is not really possible anymore to distinguish between mobile and other browsers, but you may try wp_is_mobile. There are plugins that try to do a better job.
Then, if the user agent is mobile you may try to disable saving of the image, but there is no definite way to do this. To display the image it must be sent to the smartphone. You cannot take over the smartphone, so the user will always have methods to wrestle the image from you.
That said, there are methods to make it difficult for users. The most obvious one is to set images as backgrounds with css. This disables the normal way of saving images. Here are some other options.


Fetch Probability from Random Forest Classified Image

Question:
I have performed random forest classification in Earth Engine would like to select only pixels with high probability. But I cant figure how it to be done. I see the probability value in the Inspector but cant figure out how to extract that value.
Answer: That number is not a probability. (The Inspector doesn't know anything about classification.) It is the mask of the image, which being less than 1 (100%) indicates that the particular pixel you clicked on was only partially covered by the original image data (or that some other mask manipulation occurred). The classifier does not care about mask; the mask value is the same at the output of the classifier as at the input.
Comment: Thanks for the reply, but I don't fully understand this. This particular pixel was in the middle of a farm in which all pixels were classified as '1'. I have performed crop mask and a NDVI mask, but the pixels removed due to masking are no where near this pixel. So what is the 'Original Image' here?
Comment: @GeorgeBasil By "original image" I only mean "the input to the classifier". I can't say where it's coming from exactly — it would be necessary to experiment with the actual code to answer that. The one thing that I can tell you with certainty is that the % figure the Inspector displays is the mask value.
Comment: Thank you. Can the probability value be extracted from a classified image in any way? Finding a few pixels with high confidence from the classification image is what I'm aiming for so that I can visit there and conduct some fieldwork.
Comment: @GeorgeBasil Sorry, I'm not very familiar with classifiers. I believe some of them can be _run in a probability mode_, so that the band outputs would be probabilities instead of(?) a class, but I can't do better than "check the documentation" right now.


How do I advance time?

Question: One of the missions requires that it be night, but I can't sleep. How do I make it nighttime? If I need to wait, how long? And is there really nothing I can do other than waiting several hours?
Answer: There is a story mission at the beginning of the game that requires it to be night. It will automatically become night time when you start this mission, so don't worry about that.
There are a couple of wasteland missions later in the game that also require it to be night. These do not advance time automatically, so it will need to be night before you go to these mission locations. It seems that it is either dawn or dusk when you start the game, and it is about an hour from dawn until dusk. So the worst case scenario is you turn on the game, it is dawn, and you wait an hour.
Of course, the ideal case is that you turn on the game, and it is dusk, so that you do not have to wait at all. Unfortunately, I haven't figured out if there is any rhyme or reason to which it starts as. At first I thought it was based on the actual time of day when you start the game, but if it is, it doesn't use the system clock, so there is no way to manipulate it. (I changed the time on the PS4 from 14:30 to 23:30, but it still started as dawn.) It doesn't appear to be strictly random, as I restarted it multiple times in a row, and it was always dawn. My last guess is that it's based on the time of day when you quit the game, so it might advance to night if it is more than halfway through the day, or something like that. I'll test this theory and edit if I figure out anything definitively.
Answer: On this discussion board a steam officer says this: "It goes to the correct time of day / night automatically when you start the mission."
Comment: I waited at the location until night fell and then I had to drive away a bit and drive back to trigger the sequence.
Comment: This is correct from what I remember when I played the game.

How do I advance time?


Can EUR 10.000.000 be mined in ONE go?

Question: I understood large sums of Monero can only be mined in several transactions?
Could EUR 10.000.000 be mined in ONE transaction?
Answer: Firstly, the market price of Monero in EUR has little bearing on any of this.
Secondly, mined or transferred? The question is not clear. Regardless...
There is no cap on the value amount you can transfer (so long as you obviously own that amount) and the amount of Monero that can be mined is dictated by the emission schedule.
However, when considering large transfer value amounts, you presumably own a lot of separate outputs (thus inputs funding the transfer), and whilst there is no cap on the value amounts, the more outputs you spend (so tx inputs) the larger the tx storage size becomes. Therefore the constraint becomes the tx storage size, which can currently be no larger than 1000000 bytes (src). Furthermore, there is a maximum number of transactions that can be mined in a block, 268435456 (src).
Putting this all together, if you owned one output with one Monero and the market price for 1 XMR was 1m EUR, nothing whatsoever would prevent that transfer or it being mined in a block. If you owned 1m individual outputs you wanted to spend, you would have to send them in many transactions because of the tx size constraint; a miner can still mine 1m transactions in a block though.
Comment: What would the transaction fee be like. 1Mill x 10XMR inputs :)

Can EUR 10.000.000 be mined in ONE go?


Radioactive Dating Accuracy After 60,000 years

Question: Why is radioactive or Carbon 14 dating only accurate for 60,000 years? In theory, there should always be at least SOME Carbon 14 in everything that was living at any given time. This is because no matter how many times you multiply something by 2, there will always be an answer (as long as the number is real). So why only to 60,000? Also, there are records of things existing for upwards of 4.28 billion years old (link:https://www.livescience.com/57942-what-was-first-life-on-earth.html), if Carbon 14 dating is only accurate for 60,000 years, how do we know how old some of these microfossils are?
Answer: There is no exact date beyond which carbon 14 decay is/is not useful. However, given that the half life of carbon 14 is 5730 years, then there really isn't much carbon 14 left in a sample that is 60,000 years old.
The decay constant is $\lambda = \ln 2/t_{1/2}$, so the fraction of carbon left would be $\exp[-\lambda t]$, which, for $t=$60,000 years, would be
$0.07$%.
Of course, these small traces probably could be found with modern techniques, but then you have to factor in systematic uncertainties associated with present-day contamination (the air contains carbon 14 !). Any small uncertainty in the contamination could easily be magnified into a huge age error in an old sample with a very small amount of carbon 14 present.
Your final question about age dating techniques is too broad for a Physics SE question. However, there are other radioactive dating techniques that can be used to find the ages of rocks and minerals, using isotopes with half-lives of many billions of years (Samarium/Neodymium dating is referred to in the article for which you provide a link).
Comment: exactly. This is why uranium isotopes were used to date the formation of the solar system
Comment: That link would be better pointing to https://en.wikipedia.org/wiki/Radiometric_dating#Modern_dating_methods
Comment: Re, "The air contains carbon 14", well yes. That is why carbon dating works. $^{14}C$ is produced in Earth's atmosphere by the action of cosmic rays. It gets oxidized to CO2, and it eventually is absorbed by green plants, which then are consumed by other living things. The production and the decay of atmospheric $^{14}C$ are in equilibrium, so the ratio of $^{12}C$ to $^{14}C$ in all _living_ organisms is pretty much a constant. When an organism dies though, its tissues stop exchanging carbon with the environment, and the ratio changes as the $^{14}C$ decays
Comment: @jameslarge  Hence the exclamation mark. I think the point is that external Carbon 14 can *contaminate* a sample and it is rather difficult to stop that contamination occurring.
Comment: Oops! I see that now.
Answer:
Also, there are records of things existing for upwards of 4.28 billion years old, if Carbon 14 dating is only accurate for 60,000 years, how do we know how old some of these microfossils are?

Don't use C14!
In the case of ~4by you typically use uranium/lead. The problem with this method is that both lead and uranium are still around, so if you want to measure the relative quantities of the two, you need to be sure to exclude any contamination.
It turns out we're lucky here: zircon crystals eject all lead while they form. So if you find a zircon today, any lead inside must have come from uranium. So you measure the two and there's your date. It's good to about 4.5 by +-0.1% That's super-good, but it does mean you need to find some zircons. Good thing they're relatively common.
I went to a great talk at UToronto where someone was explaining all of this. Then he pulled out a rock and passed it around. It was found in antarctica after falling from space and then slowly moving with the ice flows until it reached the ocean where someone picked it up. They dated it, and found that it formed within 10,000 years of the lighting-up of the sun.
It's that accurate.
There's a bunch of different decay chains you can use for different time periods. The trick is to find one where the resulting mixture isn't entirely dominated by one or the other today. After U-Pb, you move into potassium-argon, and so on through a bunch of methods until you get to C14, which is typically used only for the most recent sorts of objects.


Can I combine Hex & Greenflame Blade in the same turn?

Question: Since Greenflame Blade is a 1 action cantrip and so can be used in conjuntion with a spell that can be cast as a bonus action, can I cast Hex (a bonus spell that requires concentration) initially then follow it with Greenflame Blade, and so combine the damage from both? Or does casting Greenflame Blade interrupt concentration on Hex so the Hex damage cannot be added?
Answer: Yes you can combine them.
There are only three general ways to lose concentration (PHB, p. 203):

Casting another spell that requires concentration (this includes spells, with
longer casting times (PHB, p. 202))
Taking damage (and failing the saving throw)
Being incapacitated or killed

Other ways to lose concentration are explicitly mentioned in the relevant game feature, for example, in the Earthquake spell, and in the Barbarians Rage feature.
The DM can also decide that certain circumstances require you to succeed on a Constitution saving throw to maintain concentration, as mentioned in the PHB on p. 204

Hex is a 1st-level bonus-action spell and Green-Flame Blade is a cantrip with the casting time of 1 action. As you already mentioned you are able to cast them both.
Will you lose concentration on Hex when casting Green-Flame Blade?
You are neither taking damage nor are you incapacitated/killed when casting Green-Flame Blade, so we can exclude those causes. Since the casting time is 1 action it does not count as a spell with a longer casting time as for PHB p. 202. The duration of Green-Flame Blade is instantaneous, requiring no concentration. There is no reason for you to lose concentration on Hex.

The bonus damage from Hex will only affect the cursed target though.
Comment: It's worth a mention that this is not only allowed but a potentially very good method of attack for a Bladelock (before Extra Attack) or even for a shillelagh tomelock, although you can't cast shillelagh and hex in the same turn.
Comment: @GreenstoneWalker thanks, added those to my answer.


Is it ok to tell jokes?

Question: I have read a Hadith but I don't remember it perfectly that we should not make people laugh by telling a lie.so is it permissible to tell a joke?
Comment: Presumably the hadith you're thinking of is [Sunan Abi Dawud 4990](https://sunnah.com/abudawud/43/218): "Woe to him who tells things, speaking falsely, to make people laugh thereby. Woe to him! Woe to him!." or a variant thereof.
Comment: Does this answer your question? https://islamqa.info/en/answers/22170/conditions-of-permissible-joking
Comment: Listen to some Mufti Menk talks on YouTube. You will learn about comedy easily done by a Mufti. Just analyze his comedy and you will come to your conclusion.
Answer: Good Sense of humor is a indication of healthy mind. Prophet Muhammad PBUH also told jokes like:
HE said to old women no old people will go in heaven. The woman start crying then He said because old people will become young in heaven. This is just telling the truth in a way that becomes humorous.
So the jokes shouldnt have lie or humiliation for others because it can hurt other's feelings which is prohibited in Islam. This type of humor is from Low IQ or sick mind to just degrade others and for point scoring which is unfortunately very common in our society. Thats why there are lot of fights and separations in relationships.
HE had a great chemistry with Mother Ayesha RA. Why? because of HIS humorous and cheerful nature at home.
Comment: Let's take an example of a joke; Santa: what are you doing? Banta: recording baby voice. Santa: why? Banta: when he grows up.i will ask him what he meant by this.   There is no man like santa banta who said this ever.so is it not a lie ? Almost every joke is like this.
Comment: The humor i have mentioned is not a lie. Please read it again.
Comment: @Obaid The joke didn't contain a lie, It's the truth old people never go to paradise, instead they are turned young again.
Answer: والسلام عليكم ورحمة الله وبركاته
Yes it is. The Prophet himself told jokes. https://sunnah.com/shamail/35. Make sure jokes have no lies on them. Also, keep them nice and not bad.

Is it ok to tell jokes?


How to differentiate various guns with adding as little mechanic as possible?

Question: Currently I'm creating a setting which includes real firearms models (no limitations, any gun I know about or find in the internet can appear) and I aim for each gun to be different from each other, however, I don't like complicated mechanics (in fact, I don't like mechanics at all) and basically everything is decided by simple d20 rolls. And I've already run into problems like "how exactly do I make HK 416 feel different from the M4"? Or how to differentiate between an AK 47 and AKM? Or various Glock pistols? M16A2 and M16A4? For example, I don't want all the AR-15 style rifles and carbines end up being the same in practice. So I ask all those gun nuts out there, how to achieve a system in which every firearm would behave as realistically as possible while keeping as little mechanics as possible?
Comment: As a reply to your aside: I know those two factors are at odds, but it happens so often in life in general and I believe it's all about optimization and balance, after all. And yes, a game needn't do everything, but detailed guns is a must-have for me as a gun nut.
Comment: Hello and welcome to RPGSE. Are you asking for a specific system, or do you want the general principles for when designing a system (with guns) from scratch? If the former, please add a system tag to the question, if the latter, then the system-agnostic tag and/or the design tag.
Comment: Rather general principles, because I'm a beggining GM and I'm not into following the specific system. I;ve also never liked it as a player. However, maybe the word "system" is too much. I'd like it to stay on the d20 rolls level. Nothing too fancy.
Comment: In that case please add the appropriate tags to classify the question and attract the appropriate types/context of answers.
Comment: The site's not very good at generating ideas, and that makes this question better suited to one of the forums in [this link.](https://rpg.meta.stackexchange.com/q/5449/8610) Once you've developed these rules, though, I'm certain the site would be happy to critique them for accuracy and playability. As an aside, it seems to me that here your goal ("realisitic and differentiated firearms") is at odds with your vision ("a system where the mechanics are barely there"). I know this is what you want, but, honestly, a game needn't do everything. `:-)` Thanks for participating and have fun!
Answer: In general, the amount of characterisation of weapons that is possible correlates very significantly with the existence of game-mechanical representations of various parameters to the optimisation of which the weapon caters.
Keep in mind that as a designer of a new system, it will be up to you to design and/or vet the weapon tables, likely while trying to make them representative of the real-world models of the weapons (and keep in mind that accuracy of knowledge of the latter can be non-trivial to ascertain).
Stat-Based Differentiation
Here are some parameters that may be relevant, and when they are likely to be or not be handled by a system. You will need to balance between simplicity and detail, and decide which ones you need and which ones you don't; I can't make the choices for you, but what I can do is provide some broad-strokes techniques for implementing a given type of weapon differentiation in a system. As per your comment, I'm focusing on dice-based systems, and not touching primarily card- or bidding-based systems.

Accuracy. Almost all dice-based systems have some sort of roll to see if you hit. If so, weapons can vary by accuracy, giving a flat bonus or penalty. But on a d20 roll (as per your comment), a +1 is +5% chance of success, so weapons from the same class are unlikely to differ much.
Damage. For systems which have a damage roll that is separate from the to hit roll, and that measure stopping power and wounds in hit points or other quantifiable units, differences in damage can be implemented quite easily.
Range. There are several ways of implementing range differences in weapons. The simplest one is only having a maximum range past which attacks are considered ineffective (whether due to having no plausible chance to hit, or for more energy-loss and end-of-arc reasons). A more complex approach would be setting a range increment, each multiple of which gives a cumulative penalty to hit (Note: some system have a fixed table of range bands that are identical for all weapons). An even more complex one would be adding range increments that reduce damage (either gradually, or in big chunks).
Automatic Fire, Rate of Fire, Controllability etc. In systems that distinguish between making a single attack per roll and making a burst or series of shots, maximum rate of fire may be an important parameter. There are many different ways RPG systems handle autofire, and depending on that, there may be parameters such as a bonus/penalty for the balance between the complications of recoil and benefits of walking the burst. This is some complex stuff and the design of autofire rules in RPG systems deserves a big separate question.
Ammo Count and Typical Trained Reload Time. These are pretty self-explanatory. Black powder weapons can take a minute to reload, for example. Even modern weapons vary depending on the design, action type etc.
Handling Parameters. These are usually complicated to implement. They can include such things as penalties for rushed aiming, for trying to shoot in close quarters, or trying to track a target with a high transversal speed. Most systems don't implement these parameters.
Reliability. The chance of the firing mechanism jamming. Inconvenient to implement with a single d20 roll because that gives increments of 5% when it comes to chances, so at a minimum you'll need to use rerolls. Probably not worth the trouble, especially since reliability differences tend to be exaggerated in tales of gun enthusiasts.
Concealability. A modifier to attempts to hide the weapon, which is likely to differ in combat-ready and disassembled form.
Volume / Report. Weapons can differ either by the modifier to hear and/or see them from a distance, or by the distance at which the roll to see and/or hear them is unmodified and/or possible (depending on how the system implements perception rolls).
Special Sighting, Targeting and Similar Add-Ons. Like scopes. Some systems have advanced rules on shooting with scopes, or on effects of other aiming systems. These are probably also worth their own separate question, being potentially complex.
Cost and Availability. Some guns may be harder to buy for purely monetary reasons (takes more coins or requires a higher wealth attribute, depending on system). Others may take long time and effort to even find, possibly requiring difficult rolls of contacts-oriented skills.

Tag-Based Differentiation
An alternative to stat-based differentiation is a tag-based differentiation. That means that each weapon has some number of concise descriptive tags. Instead of applying all the time, the tags can be used as cues (whether system-supported or freeform) to occasionally enable tag-appropriate events. For example, Standard Issue in [Military] may let a character carry it without raising suspicion while pretending to be a member of said military, while Reliable, but Maintenance-Heavy may mean that the gun works fine even in bad conditions so long as it's regularly cared for, but becomes more prone to misfire than other guns when not (and adventurers do get into situations where they don't have enough free time to do that).
Admittedly, tag-based differentiation is more geared towards descriptor-oriented systems (like various FATE games). I'm not sure if those are what you're looking for.
Answer: First up: I've never held a gun, I don't know what feels different about firing one gun to another. As such, I'm not going to provide you with an exact answer of how to model a pistol vs a rifle, and especially not how to make one pistol feel different to another. Instead I'm going to aim to give you good questions to think about, and suggest some dials you can turn to produce different effects.
It's also worth remembering that your two requirements of "a few systems as possible" and "as much differentiation as possible" work in opposition to each other. You are going to have to find a compromise somewhere in the middle that works for you.

Questions:
Your answers to these may be the same for all guns, or vary wildly between guns, it's up to you.

How do you want the game to feel?
Are you aiming for simulation or arcade fun? Somewhere in between? Do you want your players storming into a room and shooting from the hip, or hiding behind cover and looking down sights?

How deadly do you want the guns to be?
This will have a huge impact on how the players interact with the game. The deadlier the guns, the more realistic and tense the game will be, but the fewer risks your players will take. There's two parts to it: how often do the guns hit, and when they hit how much is it going to hurt? Inaccurate, but very dangerous guns will make for a "swingy" game which is much more reliant on random chance. This can be tense when well-tuned, or frustrating and unfair when poorly tuned. Accurate pea-shooters will level out the RNG, but can lead to the game feeling like a grind. As a rule the guns should be more effective on the NPCs than the players

What effect will range/armour/cover have?
Does it affect damage or accuracy? How safe should a riot shield / solid wall make you? Does flanking someone behind cover offer a significant bonus (ala XCOM)? Is there any way to force an enemy out of cover? The safer cover is the less your players will want to leave it.

How frequently should the player fire?
This can take several different forms. They might be able to fire multiple times per round, or need to a take a round to reload every 5 shots.

Mecahnics you can use:
Here are a few different systems you could use and tweak to suit different guns. Again, you could choose to use two entirely different systems for different gun types. This increases the complexity of your game, but will make them feel very different, and means there isn't necessarily a numerical-mechanical solution to your game.
Roll to hit, constant damage
This is a very simple system that allows for some differentiation. Each character has an armour class, each weapon has a bonus to hit and damage rating. d20 + bonus to hit => deal appropriate damage.
Roll to hit, damage based on accuracy
A slight modification on the first one. Could be fun for a scoped-style of weapon to give a mechanical flavour to head shots & the like. Each weapon has a set of damages based on how high the to hit roll was. e.g. 1-5 above AC 1 damage, 5-7 above AC 3 damage, 7+ above AC 5 damage.
Always hit, roll for damage
This might work well for a Looper-style blunderbuss. If you have line of sight within 15', you hit, otherwise you miss. Roll for damage. Weapons can have different ranges, damage dice to roll, and modifiers to those dice.
How dice are used
There's a lot of different ways you can use and combine dice that produce very different feelings. For a machine gun you could model the high fire rate by rolling a fistful of d4s, adding up the result and using that as damage. For a sniper rifle you might roll 2-3 d20s and take the highest/lowest/middle result. The bigger and fewer the dice the swingier the result. The number of dice could be affected by armour & range, or other environmental effects.

How to get started
This is a big task. It's a fun task, but it's big. To start with, don't worry about details. Pick 3-5 classes of gun, make them as different as possible. Different ranges, different damage, different everything. Try to find a combination of mechanics that simulate each class well. Don't worry about precise numbers, just rough ranges. Once you have those sorted then you can start to differentiate within the classes.
Importantly make sure you don't just pick some numbers and ideas in your head, actually have a play with them. Roll some dice, see what's fun. Once you think you have something interesting invite friends over and see if they enjoy it. Find what works and doesn't then make tweaks.

As a final note, there's an old podcast from 10 years ago I'm going to try to dig up where Mike Mearls discusses adding guns to DnD 4e and how they could be different to bows. It's worth listening to if you can find it.


What are the topic names for the JMS interface for OpenNMS

Question: I am trying to make a JMS connection from a Java program to OpenNMS. I am able to connect to OpenNMS over JMS but I do not know what topics I can subscribe to. Is there a list of topic names? Do they have associated JNDI names? Thanks, David
Answer: Not sure if this works for OpenNMS, but the good JNDI implementations support listing of entries. Such as this:
<code>NamingEnumeration<NameClassPair> list = ctx.list("");
while (list.hasMore()) {
  System.out.println(list.next().getName());
}
</code>
And also you can check the User Guide for some of the event (topic) names:
https://docs.opennms.org/opennms/releases/latest/guide-user/guide-user.html


Transitional sections

Question: As I mentioned in my other recent question, my novel in progress has three main locations.  I feel those three settings are strong, fully imagined places, with interesting storylines.
However, they aren't side by side, and this is a setting where travel takes time and effort. So I have two more locations that are basically transitional places between the other locations. The problem is that I'm not enthused about those locations. They're just places to pass through.
Do I need to put more thought and effort into those liminal locations?  Or can I just drop them? They feel necessary both geographically and psychologically. But I'm not (yet) finding the magic in them. They're meant to be a slog for the characters, but I don't want them to be one for the readers.
Answer: I suppose it depends entirely upon what you're hoping to acheive. If the liminal location isn't there for any other reason to show geographical distance, then you probably don't spend any time focusing on the traveling there. I think it was "The Wise Mans Fears" that basically implied an entire pirate adventure and ship wreck for the main character in a paragraph. The paragraph before he gets on a boat. The paragraph after he gets off the boat. Apparently nothing too important happened in any of that because we only have a brief "btw, this" and then we move on.
All stories should have a beginning middle & end. What is the story for these locations? If there isn't one, its not important. For your larger story you might want to think about what sorts of problems you're actually dealing with. It sounds to me like you're writing a work similar to one I abandoned (not because it couldn't be done or wasn't interesting) but because it wasn't a coherent story that I could describe to someone else.
[not to be answered here] What is your book about? In a sentance? In a paragraph? As a pitch? Do these locations matter to that? Do the individual sections of your story help build towards that aboutedness?
Consider MICE:

Milieu - The story begins by entering a place/ends by leaving the
place
Idea - The story centers around the information you intend to
explore before the end of the book
Character - The story is about who
the character is, who they want to be, who they must become.
Event -
The story is about what happens around an event

These are framing devices. You can use many of these multiple times in a story. Each scene is usually one of these. But books themselves tend to work better when they have a primary objective. If you've ever coded, then when you open a paren its because you're opening one of these types of stories, when you close a paren you're closing this type of story. It can be confusing if you open/close separately or if your entire story isn't bounded by one type of frame. When you resolve these sections close together they tend to ramp up the emotional impact and the final close is what can give readers a feeling that they've consumed a whole work and reached a satisfactory ending.
The Hobbit is a Milieu story: Leave the shire - Return to the shire. It has events/characters/ideas; but the primary story is one of overcoming the difficulties of a travel. Having 3+ locations that matter means that Mileu is a framing device for your story. But is it the point? Idea probably isn't very important to the story. (Also, The Martian, which is also an event story, but primarily Milieu)
Game of Thrones: Arguably this is a bunch of character stories in a largely meta-character story. Its about the character of the people of Westeros. There are events. There are places (there's definately a frame of leaving/returning to the north); but the story is all in who these people are and what they're going to become. Lots of stuff, but every device always points back to a kind of character sketch, right down to the way the individual chapters take on different view points. We don't spend a lot of time traveling, though this does happen; but we do spend a lot of time thinking about who these people are, what they should, what they will become and what that will do to everyone else. Ideas actually seem to fall back here. Not super important.
The Prestige is an idea story. It's exploring sacrifice, dedication, duplication, and what is real/imagined? Character is important, but it's not the story. Mileu is the frame for the chapters around Tesla, but it's not the story. Who is in the box? That's the story. Everything else supports that thing.
Deep Impact (picking a movie since these tend to exemplify the frame) is an event story. Everything the ideas, characters and places all revolve around the event. A meteor is going to hit earth, everyone must cope and adapt to this thing no matter where they are. Character and Idea are 2nd tier framing devices and location (since we're not escaping earth/coming back) is a relatively minor affair; though it is the final frame for the final act and it is closed (at the same time we're closing some serious character/idea frames) before we deal with resolving the event.

The point of all of this was that if you're not writing a Milieu story, it is much more acceptable to have hard cuts and simply re-introduce your characters as worn out or slightly changed from their travels. You can explore that travel if it is important only in as much as it impacts the actual things you want to write about. But even in a Milieu story, you might gloss over the details that aren't important.
What do these locations/moments in these locations do? Represent? You can imply time and space with a few sentances. Harry Potter is excellent at this, maybe study it. Tons of locations. Very solid time-frame. Every transition is hard wired into the readership's nostalgia calendar; super effective in a small space and the entire scenery is painted, but the how we transition from one place to another gets very little attention. It doesn't need it. It's not important what happens to the kids between the moments where they learn/grow and are challenged.
Answer: If you drop these scenes/locations from your story, where does it leave you? Does your plot still flow smoothly? Are your characters developing the way you want them to? If your plot and characters are the same with or without them the you can probably sum up their traveling in a few short lines.

Three weeks on the road had been hell, if you could call it a road.
  By the time they reached Storyville, Frances was desperate for a hot
  bath and a meal he didn't have to skin himself.

If you try dropping these locations, but you feel something is missing, then definitely try fleshing them out a little. It doesn't need to be extravagant, but something important to your story should happen at these places.  They could be good areas to work on character development, foreshadowing, or setbacks to the characters progress. They could be opportunities for you characters to practice some skills they might need later on.
Answer: TL;DR The magic is not in the place, but in the characters' reaction to it.
The story is told from the POV of the characters. They may find your three main locations interesting, and the places in between a wasteland of boredom. It does not make the in-between places any less interesting in the context of your story. Quite the contrary, you can pack quite a lot of character development in these transitions. You could just show that.
Consider a modern-day commuter. Every morning she walks to the station. Punches the seasonal ticket, waits on the platform, boards the train and spends the next 30 minutes looking at the distant horizon while the countryside just zips by. Every single day.
How well does she know the countryside? Not at all.
Even with such a lack of detail about the countryside, we both can imagine an entire novel centered on the commuter's thoughts and feelings during the daily travel. Such a novel would not even need to mention the destination. The magic is in the character.
In addition, the lack of a fancy background should find a natural counterbalance in a boost to the character development part so that the story remains interesting to the reader. This is not to say that all character development should occur against a grey backdrop, but that the necessity of a grey backdrop transition is an opportunity to focus on the character without any external distraction.
With all that, you should welcome your liminal locations, and by all means, leave them blurry, grey and boring.

Transitional sections


Bias and variance in the model o in the predictions?

Question: This topic confuses me. In the literature or articles, when talking about bias and variance in automatic learning, specifically in cross-validation, do they refer to the high bias (underfitting) and high variance (overfitting) in the model? Or do they refer to the bias and variance of the predictions obtained in the iterations of the cross-validation? How to handle each case?
Comment: I think this question is related to the "bias variance trade-off" https://en.m.wikipedia.org/wiki/Bias–variance_tradeoff
Answer: In some cases, you may have a model that's a black box - you feed input features and get output predictions, without knowing or caring what happens in the middle. In those situations, the model is, in a way, defined by its output - two models that produce the same predictions are indistinguishable from one another, even though they may be entirely distinct models. In these situations, saying a model is biased or has high variance is equivalent to saying the predictions of the model are biased or have high variance. It's acceptable to describe both the model and its output in terms of bias/variance. Cross validation provides an unbiased estimate of bias/variance for your model/predictions.
Comment: First.Thanks for your answer.
Comment: Other question, in this book: https://books.google.com.mx/books?id=BDB50Ev2ur4C&pg=PA13&dq=10+times+10-fold+cross+validation&hl=es-419&sa=X&ved=0ahUKEwi6qM6it4XjAhUXCs0KHd09AyoQ6AEIOjAC#v=onepage&q=10%20times%2010-fold%20cross%20validation&f=false, on page 13, the following is mentioned: "To reduce the influence of randomness introduced by data split, the k-fold cross validation can be repeated t times..." I understand that this randomness produces high variance in the results of the predictions, then, that high variance produces an model with overfitting?
Answer: I finally understood "Bias and Variance" with Logistic Regression (LR). LR is known to have a high bias but low variance. For example, LR accuracy might be only at 90% while you'd get 95% with a Decision Tree (tends to overfit). But with LR in production feeding new data, you're very likely to see 90% accuracy ... while the Decision Tree had massive accuracy swings (variance) with new data (70% - 95%).
Hope that helps.
Answer: Bias and variance are used to describe the predictions of models and they define if it is a good one or not.
As a perfect model (low bias, low variance) does not exists, you often have to chose if you prefer
a model with high bias/low variance or a model with low bias/high variance.
This applis to the distribution of the predictions.
Cross validation helps you have a more accurate value of your metrics (like accuracy),
as the stochastic nature of the way models are calculated can give you different values for the metrics
each time your run it: because of some randomness (random seeds) and because of the way the train/validation/test split is done...
So it is good practice to do cross validation as the metrics will be averaged over several train/validation split
and so the mean values will be more realistics to compare the different cases/models/parameters.
Answer: I also had much confusion, as many just talk about the trade-off but don't really make u understand the real thing. The variance is ML basically talks about the fitting, and high variance indicates the model's having overfitting. And bias here means, the difference between the real value and the predicted value. So, naturally when its not overfitting the training set means its simple. The ideal model is the one whose predicted values are closer to the real values and the its not over fit, hence low bias and low variance, but in practice its not possible. Hence, we talk about the tradeoff.


X-Ray Diffraction

Question: In X-ray diffraction when we accelerate the electron with some potential say $V$ and make collision with plate that produces $X-$ray (frequency $\nu$).
$$h\nu_{max}=eV$$ But as we know that the accelearated charge particle radiate electromagnetic radiation which have energy. Why we don't take it into account in our calculations?
Answer: One can do a rough non-relativistic calculation to compare the energy radiated, $E_{\rm radiation}$, and the kinetic energy gained, $E_{\rm kinetic}$, by an electron when traversing a distance $d$ which has an accelerating potential difference $V$ across it.
The electric field is assumed to be uniform $E = \dfrac Vd$ and the transit time for an electron being $t$.
$E_{\rm kinetic} = \frac 12 m \,a^2\,t^2$ where $a$ is the acceleration of the electron.
The Larmor formula states that the power of the emitted radiation from an accelerating electron, charge $e$ and mass $m$,  is $P = \dfrac{e^2\,a^2}{6\,\pi\,\epsilon_0\,c^3}$ where $c$ is the speed of light.
With  $E_{\rm radiation} = \dfrac{e^2\,a^2\,t}{6\,\pi\,\epsilon_0\,c^3} \Rightarrow \dfrac{E_{\rm radiation}}{E_{\rm kinetic}} = \dfrac{e^2}{3\,\pi\, \epsilon_0\,c^3 \,m\,t}$.
$s= ut+\dfrac 12 at^2 \Rightarrow d = \dfrac 12 \dfrac {e\,V}{m\,d}\,t^2 \Rightarrow t = \sqrt{\dfrac{2\,m\,d^2}{e\,V}}$
With $V= 30 \,\rm kV$ and $d=0.1\,\rm m$ the transit time $t \approx 2\times 10^{-9}\,\rm s$.
Putting in the values relating to an electron gives $\dfrac{E_{\rm radiation}}{E_{\rm kinetic}} \approx 6 \times 10^{-12}$ which gives a reason to the question

But as we know that the accelerated charge particle radiate electromagnetic radiation . . . . . . Why we don't take it into account in our calculations?
Comment: That's great! Thanks for Help.
Answer: Hope this link might help you.
Does a constantly accelerating charged particle emit EM radiation or not?
This relationship is not an absolute formula.It is just a precise relationship , which has been derived experimentally.
Also it is not only frequency $\nu$ mentioned but its maximal value $\nu_{max}.$
This formula only tells you maximum frequency.which you will get corresponding to small
energy losses.
In the experiment also when you are applying such a high voltage , and the kinetic energy is very much huge and its take negligible time to cross the tube in (very minimal time).so one can very much safely ignore that.
Comment: There is also the work function, which is usually ignored. That is a much larger effect than any radiation loss due to electron acceleration.

X-Ray Diffraction


Additional exercise to backstroke swimming

Question: I've started backstroke swimming around 3 times a week and want to add just a little strength training to it. The problem with swimming is, that it seems to use so many muscle groups that it seems you shouldn't even work out anymore otherwise not to hinder recovery.. What is the usual strategy to deal with this? Or should I just ignore it and still do biceps curls or pushups whatever in between the swimming days? Which exercises/muscles could I best train while only minimally disturbing their recovery from the swimming?
Comment: Just started - Are you a beginner swimmer? Experienced? How much distance and intensity per swimming session? Do you do only backstroke? Those will help formulate a better answer.
Answer: Almost all competitive swimmers incorporate some form of dryland/weight training in their program. I competed at the D1 college level and can say it was 9 swims, 3 lifts, and 1 dryland session a week. If you have a competitive event approaching that matters, the lifting gets cut out 2-4 weeks prior to competition so the athlete can fully recover.
Our weight program was obviously the secondary focus of training, so load and volume were kept on the lower side. We did a lot of front and back squats, lat pulls from various angles, tricep work, and dumbbell work.
Without knowing much about the OP and their goals or physical statistics, I would recommend adding in a weight session or two for 45-60 minutes and see how it goes. Don't be afraid to try a movement, and if it doesn't work, change it up.
Remember that some soreness is a good thing when exercising. The first time you do something new will be rough, but your body will adapt quickly to the new stimuli. Give movements a couple weeks before you determine they don't work for your body. Pain caused from a movement should be treated differently than soreness.
Answer: Swimming is so versatile as an exercise that it can really be whatever you choose. You can use it as high intensity training, as an off day recovery activity, or you can target muscle groups with different drills. If your pool has anyone giving lessons (beyond just how-to-swim type stuff) they could show you different approaches to swimming workouts, so that if you want to push it on upper body weights one day and try to target core and legs in the pool the next, you absolutely can.
This may sounds like a pretty generic answer, but the question is fairly vague so it's hard for me to be more specific. Because of course some folks are doing extremely high volume, high intensity swimming and cross train with weightlifting and such. Without knowing you, your limits, your goals etc it's hard to give advice like this.
Answer: If you're swimming for exercise purposes and not, say, national or international level competition, then I don't think you should worry about it at all, and just do your swimming and strength training on whatever schedule is most convenient for you. The reasons for this are twofold:

If you're only swimming three days per week, there shouldn't be much difficulty in scheduling strength workouts to be on different days to your swimming. (Whereas a competitive athlete doing 6-8 swim sessions per week would not be able to always schedule strength training on non-swimming days.) With any sensible strength training program, you shouldn't be so sore or fatigued that it would significantly affect your swimming workouts a day later.
Even if a strength workout does adverse affect your swimming ability, what's the consequence of that? Having a swim session where you're 2% slower than your usual speed might cost you a gold medal if you're competing in the Olympics, but if you're just exercising for fitness then it's inconsequential.

I'll also note that further exercise "hindering" recovery isn't really a thing. Lack of sleep or nutrition can hinder recovery, but it's not like your body needs to fully recover in between bouts of exercise. The second bout of exercise (as in another exercise session when not fully recovered) will add an additional training stimulus and additional fatigue, but it doesn't stop the body recovering from the fatigue of the first session, nor does it interrupt the training stimulus that the first session provided.


Eigenstates of half Harmonic Oscillator

Question: This might be a stupid question so pardon me! If I am looking for energy eigenstates to the 1D quantum problem such that there is an infinite barrier at $x<0$ and for $x>0$ the potential is $kx^2$, what would it be like? Please prove that your set of eigenstates forms a complete set.
Comment: Heres a not very subtle hint: if there is an infinite wall at x=0 what condition must you impose on the wavefunction there? Furthermore, which wavefunctions that come up in solving the normal harmonic oscillator obey this condition?
Showing completeness should then be trivial. The statement of completeness comes down to saying that you have an infinite set of orthonormal functions that you can expand in. For more background and rigor I'd read up on Sturm-Liouville theory.
Comment: The "half harmonic oscillator" is also discussed in [this](http://physics.stackexchange.com/a/13490/2451) Phys.SE answer.
Answer: The eigenstates will be the odd eigenstates of the harmonic oscillator.
(This follows from the requirement that $\psi(0)=0$.)
If we accept that the eigenstates for the harmonic oscillator form a complete set for functions on $\mathbb{R}$, it then follows that the odd eigenstates form a complete set for odd functions on $\mathbb{R}$.
Since any function on the half space can be represented by restricting an odd function on $\mathbb{R}$ to the half space, it must follow that the odd eigenstates form a complete set on the half space.
Comment: "Since any function on the half space can be represented by restricting an odd function on R to the half space" gosh! I feel stupid...thanks!
Comment: Nice, concise answer!
Comment: @NoobRevB: Glad to help.
Comment: Though I had forgotten the argument why odd states are complete for half harmonic oscillator, I was actually after a general problem. Let me know what you guys think. So if I place my infinite wall at an arbitrary $x$(not necessarily at x=0) there is no obvious way to find the eigenstates and eigenvalues right? And even if someone were to give me an infinite set of eigenstates there is no obvious way to argue that its complete? Its the parity symmetry which saves the day for us in the original question or am I missing something?
Comment: @NoobRevB: Yes, this trick does not work for your more general problem. In this case it would probably be best to follow David Meltzer's advice and turn to Sturm-Liouville theory.
Answer: A Schroedinger (time independent) equation with a potential of the form
$$V(x)=\begin{cases}
\infty \quad(x<0)\\
\frac12m\omega^2 x^2\quad (x>0)
\end{cases}$$
will necessarily have $\psi(x)=0$ as solution for $x<0$, because the infinite potential barrier prevents the negative x region from being accessed.
For the positive part, the Schroedinger equation is the same of the Simple Harmonic Oscillator problem, so to find the solutions we can use the same reasoning used for the original problem, having care to replace the boundary condition for $x\rightarrow\infty$ with the requirement that the wavefunction be continuous in $x=0$, i.e.:
$$\lim_{x\rightarrow 0^+}\psi(x)=0$$
We recall that the solutions to the original SHO problem were $|n\rangle\in\mathcal H_{SHO}$ such that:
$$\psi_n(x)\equiv \langle x|n\rangle=\frac1{\sqrt{x_0}\sqrt[4]\pi}\frac1{\sqrt{2^n n!}}H_n(x/x_0)e^{-x^2/2x_0^2}$$
where $x_0=\sqrt{\frac\hbar{m\omega}}$ is the characteristic length of the SHO, and the $H_n(x/x_0)$ are the Hermite polynomials, whose parity is defined by $n$ in the following way:
$$H_n(0)=\begin{cases}
0\quad(\text{$n$ odd})\\
(-1)^{n/2}\frac{n!}{\left(\frac n2\right)!}\quad (\text{$n$ even})
\end{cases}$$
So, we conclude that only the odd solutions of the previous problem can satisfy the new boundary conditions, so are the best candidates to build the new ones, and we can define new eigenfunctions $|\tilde n\rangle$ identifying them with $|2n+1\rangle$ up to a constant, and in the right portion of the domain:
$$\tilde\psi_n(x)\equiv \langle x|\tilde n\rangle=\begin{cases}
0\quad(x<0)\\
\alpha \psi_{2n+1}(x)\quad(x>0)\end{cases}$$
The coefficient $\alpha$ is determined by the condition of normalization:
$$\int_{-\infty}^\infty dx |\tilde\psi_n(x)|^2=|\alpha|^2\int_{0}^\infty dx |\psi_{2n+1}(x)|^2=|\alpha|^2\frac{1}2$$
from which we need to set $\alpha=\sqrt2$ (choosing it real by convention), so that finally
$$\tilde\psi_n(x)=\begin{cases}
0\quad(x<0)\\
\sqrt2 \psi_{2n+1}(x)\quad(x>0)\end{cases}$$
While the Hilbert space of the SHO problem was spanned by the odd and even eigenfunctions, but in the half oscillator (HHO in the following) the Hilbert space is spanned only by the odd ones: in particular, the ladder operators $a,a^\dagger$ as they were defined in the SHO, cannot belong to the operator algebra of the new Hilbert space, as their action would bring a vector $|2n+1\rangle\in\mathcal H_{HHO}$ into a $|2n\rangle$ or a $|2n+2\rangle$ which $\notin\mathcal H_{HHO}$. I don't know if a suitable redefinition exists, but maybe this topic has been already thoroughly studied and the answer is well known.
To answer to the last question: the half oscillator is a regular Sturm Liouville problem, exactly as the SHO was, so its solutions (at least their restriction to the positive $x$ axis) are guaranteed to be orthogonal and complete (ref., for example Arfken pag. 386, $7^{th}$ edition). But please note that they will not be a complete set for all continuous functions, defined on $\mathbb R$: they are a complete set only for the subspace of Hilbert space $L^2[0,\infty)$ formed by the functions $f(x)$ such that $f(0)=0$.

Eigenstates of half Harmonic Oscillator


Meaning of "去你的头"

Question: I just heard "去你的头" in a joke, and while it sounds like an approving "go ahead" OR "go with your head/what you think" I realized at the end of the joke it's kind of an equivalent of "go f*** yourself" in English.  Can someone confirm this is what it means. What are some other sayings that are similar to this?
Comment: It is just a way to express disapproval to someone's *stupid* idea. Not really equivalent to the F word.
Comment: In Singlish, the direct translation "your head" is a widely used colloquialism. It means the same thing, roughly on par with 'you dumbass' in American English.
Answer: Well, it's not the entire phrase 去你的头... 去你的 alone roughly means f*** you.
Even though you should be learning more useful phrases... here are some more ambiguous favorites:
Numbers:

三八(n) san1 ba1: stupid, foolish (typically used to describe a naive, ditsy female
二百五 er4 bai3 wu3: stupid, idiot

From stories:

猪八戒 zhu ba jie4: fat, pig-like (Pig character from Journey to the West)

Others:

冷 leng2: boring, lame... like 冷笑话 = boring joke (lit: cold)
臭屁 chou4 pi: arrogant, show off (lit: smelly fart)
闪啊 shan3 a: kind of like a  "get outta town..."
妈的: ma de: Damnit! (lit: mom's thing)

I'll try to think of more.
Comment: To me, "去你的" looks like the incomplete form of "去你的头"; neither of these mean anything as strong as 'f*** you' in any context.
Comment: now `你妹` (your sister), `尼玛`(the homophonic form of 你妈, your mother) are popular. The meaning of `verb/adj + 你妹/尼玛` is like `verb + 你的头` and `adj + 个头`. Sometimes, they are written in homophonic characters, e.g. 泥煤, 尼煤, or 尼妹(你妹).
Comment: BTW, I think the impression of 三八 wouldn't be stupid or foolish. Generally `三八婆` describes a woman who is frivolous, reckless, lunatic, womanishly fussy, and fond of saying gossip and listening to gossip and meddling in others' business.
Comment: Very helpful and I am looking forward to more.  In American slang, I would just say to you "right on!"
Comment: also, i know of 吊丝 (diao si) which I would consider something like a "creepy" unlikable nerd or geek.
Comment: @user43633 屌丝/吊丝 is just the opposite of 高帅富(a man who is tall, handsome, and rich). Not exactly mean nerd or geek.
Answer: Expanding on @simonmysun's answer "你的头" at the end of a sentence can be used as a gentle rebuke and said with a mocking or sarcastic tone.
Similar to "that's what you think" or "yeah, right!" at the end of an English sentence.
Sometimes my son might ask to eat chocolate right when dinner is served and the English conversation goes something like this:
My son: "I'm just going to eat some chocolate now" (while opening the fridge door)
My wife: "Chocolate, yeah right! Go and wash your hands"
In our house this would be in Chinese and go something like this:
儿子: "我要吃一个巧克力吧!"
妈妈: "巧克力你的头!你快点去洗手。"
You see in this case "你的头" is suitable for use with children and not like telling someone to go f*** themselves.
Answer: it's usually used among friends, when A told a joke or B laughed at somebody, you can use "去你的" as a response.
I mean "f*** you" is a little bit strong tongue.
You can take it as " Come on~ " " You are joking " ...
Some similar phrase: 少来了(not serious);*你说笑呢(you're joking)* ;
一边儿去(get away from me)

PS : there is a different context, when argue happens. It means "f**k off"  "get out ".  (Chinese: 滚蛋)
Answer: Go ahead!
Here's the joke:
A employee said to his Chinese employer, 'Can I go for a trip?' 'Go ahead!' he responsed. The employee started packing his luggage happily. His colleague reminded:'At the employer's level, his word "go ahead" must means "去个头!"'
23333 (which means, LOL)
P.S. "去个头" and "去你的头" are the same meaning. And "Go a head" is just paraphrased "去" "个" "头".
Actually, the phrase "verb. + 个头" or "verb. + 你的头" itself can be an negative answer to a question. But used when the two know each other very well. Or the one who answers is at a higher level.
Answer: There's actually a very similar expression in English "my foot", as in the following conversation:
A: He said he's sorry. B: Sorry my foot. He did it on purpose!
I can imagine an almost literal translation in Cantonese:
A: 佢話對唔住。B:對佢個頭!/對佢條命! 佢根本係故意!
Answer: But 你起的头 means " you started it first"
When arguing
And 走你的头 is " go, do whatever you want"
Or " go, use your head "or " go, do as you wish"
Answer: I don't agree that it means fuck you.  This phrase and similar ones are most commonly similar to english phrase "my ass".  As in, "You're going to the party my ass!"
So, I don't know the joke, but it is calling  a bluff or disbelief of whatever it is a response to :)
Answer: In the Simplified Chinese context, 去你的头 generally means to tell you to f**k off.
Answer: i've never heard such a phrase.
as what i know,去你个头 means i will never go,you better deal with it alone。
去你的头,i doubt about that。

Meaning of "去你的头"


Can riding a bicycle increase stamina?

Question: As in our daily busy life we have to do some exercise to make our self fit and fine .Me as a student and also a working women surely needs a lot of exercise. I'm found of riding bicycle but it tired me up so much but on the other i have to know that riding a bicycle really cheer you up and increase your stamina.Please guide me in best way so that i that i continue my exercise.
Comment: It is a known fact that exercises helps us to gain physical strength, stamina and GOOD MOOD. As you are a student + working women I believe you should do exercise of any kind not cycling only. you can do rope skipping, squats etc indoor exercises if you always don't get time to cycle.
I would suggest mixing of indoor exercises and cycling (to office / work) as you will have variety in exercises and health together with following your hobbie.
Comment: I think it is more about the time actually. 5 minutes of cycling won't increase your stamina, but gradually increasing (cycling for longer periods) will.
Answer: Yes, it can definitely. It's an endurance sport, from which top athletes are known for having extremely low resting heart rates, due to the strenghtening of their cardiac muscles, and lungs :
https://www.cyclingweekly.com/fitness/miguel-indurain-vs-your-body-34288
Also, women who does endurance sports like biking or running tend to have nice legs ;)
Keep in mind that in any sport, you have to rest enough and eat accordingly to recover and be able to progress.

Can riding a bicycle increase stamina?


Posterior: normal likelihood, uniform prior?

Question: Assuming that given a mean $\mu$, the data are normally distributed with variance $10$ and assuming a uniformly distributed prior density on the interval $(90, 110)$, we are asked to show that the posterior density on (90, 110) looks something like:
$$p(\mu|x) = \frac{1}{\sqrt{\pi}}\frac{1}{\Phi(\frac{110 - \bar{x}}{1/\sqrt{2}}) - \Phi(\frac{90 - \bar{x}}{1/\sqrt{2}})}\exp\left( - (\bar{x}- \mu)^2 \right)$$
I tried to calculate $p(x) = \int p(x|\mu)p(\mu)d\mu$, but so far my results look little promising. So far I have been trying to rexpress the exponent in $p(x)$ so I could integrate over a normal density of $\mu$, but this doesn't help much. Any input would be greatly appreciated. :)
Answer: The integral in the question is
$$f_X(x)=\int f_{X|M}(x|\mu)f_M(\mu)d\mu=\frac{1}{20}\int_{90}^{110}\frac{1}{2\sqrt{\pi\cdot 10}}\exp\left(-\frac{(\mu-x)^2}{2\cdot 10}\right)d\mu$$
The integral in RHS is the probability that normal random variable $M\sim N(x, 10)$ takes value in $[90,110]$, and you can find the probability by 'standartizing' the normal, that is using $$Y=\frac{\mu-x}{\sqrt{10}} \sim N(0,1)$$
We are interested in $P(90<M<110)$ which is the same as
$$P\left(\frac{90-x}{\sqrt{10}}<Y<\frac{110-x}{\sqrt{10}}\right)=\Phi\left(\frac{110-x}{\sqrt{10}}\right)-\Phi\left(\frac{90-x}{\sqrt{10}}\right)$$
and from here your final formula does not look correct to me.
Comment: Sorry, this is not correct, you are only considering one observation. But the hint with the standardization helped me solve it myself. I wll post my solution asap


How to see all assigned color IDs in object mode

Question: I've been adding Color ID mapping to many objects in my current model. What I can't find in Blender is a way to see all those color IDs at the same time in object mode. Even if I select all objects (in Object Mode) the only color ID mapping I see is the selected object. The reason I want to do this is so I can not only see parts that haven't been color ID'd yet but also to make sure I'm applying my colors coherently. My goal is to export the model into Substance Painter. thanks!
Comment: Hello, could you be more precise about what you call Color ID ?
Comment: To Gorgious... I call it Color ID mode but vertex paint is a better description, sorry about that. But I found my answer already, here it is. In Viewport Shading dropdown box there's an option called Color which has six options. I chose Vertex and that works perfectly. I found the answer here: https://blenderartists.org/t/seeing-vertex-paint-in-object-mode/1158358
Answer: In Viewport Shading(Solid) -- Settings -- Color -- select Attribute parameter


Meaning of crystal orientation

Question: If I have a crystal, say (001)-oriented ABO3, what does the 001 imply, from an experimental perspective? I understand that the 001 is referring to a plane as described by Miller indices, but what is it about this plane that is relevant? Is it that this plane is the same plane as the surface of the sample?
Answer: When someone says (hkl)-oriented anything, they almost always mean the surface normal of the sample is parallel to (hkl). So Si-(111) would mean silicon oriented so the surface normal is along the (111) direction.
If you have a layered material, then having a (001) orientation means the c-axis is perpendicular to the surface of the sample. This is an extremely common orientation for layered crystals for example.
Answer: It depends on context. In a surface science experiment, it would be the surface. In experiments on bulk properties, the surface could be irrelevant and rough, but one would measure some property along a cubic axis (or maybe paricularly along the c-axis), like velocity of sound or conductivity, etc.

Meaning of crystal orientation


Esri Navigator for Android

Question: I want to build a navigation system for IPhone and Android.
Does Esri Navigator support Android?
Comment: I'm voting to close this question as off-topic because it shows a total lack of research effort.
Answer: According to Esri's Navigator for ArcGIS page it requires iOS Version 8 or later, so no it doesn't currently support Android.
Further down the page however it indicates that an Android version is in development.

Esri Navigator for Android


Cross product as a tensor

Question: In the three dimensions, the cross product $A \times B$ is said to be a $(1,2)$ tensor. But the definition I know about tensors is that $(1,2)$ tensor is a multilinear map $T : V^* \times V^2 \to \mathbb{R}$ where $V^*$ is the dual space of $V$. So how does the cross product fit in this definition? Could anyone explain?
Answer: So recall that $V^*$ is the dual space of $V$, i.e. the space of linear maps from $V$ to the ground field $\mathbb{R}$.
So what do we mean by a $(1,2)$-tensor? Well, a tensor of type $(k,l)$ is defined as an element of the vector space $\otimes_k V \bigotimes \otimes_l V^*$. Now, I claim that we can identify tensors of type $(1,l)$ with $l$-multilinear maps taking values in $V$. You are perhaps already familiar with the case $l=1$: There is an identification $\mbox{Lin}(V,V) \cong V \otimes V^*$. The identification map we want to consider for general $l$ is rather similar, and I can elaborate if you want.
Clearly then, the cross product is a bilinear map from $\mathbb{R}^3 \times \mathbb{R}^3$ to $\mathbb{R}^3$ and hence falls in the category above, for $l=2$. I hope this helps!
You can also view a tensor of type $(1,2)$ as a map in the way you described it, but this may be a little confusing. Can you explain how you came to this point of view?
Comment: Could you explain for higher $l$? What do you mean by $\otimes_k V \bigotimes \otimes_l V^*$? Also is $Lin(V,V)$ the vector space of linear maps from $V$ to $V$?
Comment: Can you tell me what your definition of a tensor / tensor product is? I mean the tensor product of $k$ copies of $V$ and $l$ copies of $V^*$. And yes, $\mbox{Lin}(V,V)$ is the spaces of linear maps from $V$ to $V$. There, the identification with tensors of type (1,1) is given by sending an elementary tensor $\alpha \otimes v$ to the linear map which sends $w \in V$ to the vector $\alpha(w)v$.  For $l=2$, we have a map which sends $\alpha_1 \otimes \alpha_2 \otimes v$ to the bilinear map $(w_1,w_2) \mapsto \alpha_1(w_1)\alpha_2(w_2)v \in V$. Do you see the pattern?

Cross product as a tensor


What does the -f flag mean in the fifth parameter in the PHP mail function?

Question: What does the -f flag mean in the fifth parameter in the PHP mail function?
Answer:
The additional_parameters parameter can be used to pass additional flags as command line options to the program configured to be used when sending mail, as defined by the sendmail_path configuration setting. For example, this can be used to set the envelope sender address when using sendmail with the -f sendmail option.
The user that the webserver runs as should be added as a trusted user to the sendmail configuration to prevent a 'X-Warning' header from being added to the message when the envelope sender (-f) is set using this method. For sendmail users, this file is /etc/mail/trusted-users.
Comment: Well, copied straight out from the manual :) Do I need to restart sendmail if I modify the trusted users file?
Answer: The fifth parameter is for sending command line flags to the server that actually handles sending the email. So not knowing what that really means, I did a google search and found a list of command line options for command line options for sendmail.
If I had to guess, not based on that page but on almost all other sites that mention that option in passing, it's for setting the "from" header at the server level rather than at the Header level. So you'd do
<code>  mail($stuff, $junk, $blah, $headers, '-email@example.com');
</code>


Logout of MetaMask with API

Question: Is there a way to logout of MetaMask from my own frontend, allowing the user to logout with a button rather going up to the Metamask extension and logging out through the traditional manner?
Answer: No, there is no way. This is by design, for security reasons (no change of address, login, logout, or any other sensitive operation that MetaMask requires the user to do himself).
Comment: A popup could have been implemented asking the user "do you want to disconnect?" in the same way every other action requires user confirmation.
Comment: How is it safer to keep the account that was logged in once logged in forever? I was looking for this feature especially because I don't like my app skipping the "select wallet" screen just because I logged in once 2 months ago
Answer: You can use Moralis for this.
This is how you would be able to logout through a react or a next frontend:
<code>import { useMoralis } from "react-moralis"

export default function Home() {
  const { isAuthenticated, logout } = useMoralis()
  // If you are logged in isAuthenticated is set to true
  return (
    <>
    {isAuthenticated ?
       (<button onClick={logout}> </button>)
     : (<div> <!-- Handle you login here --> </div>)}
    </>
  )
}
</code>
That's just a basic snippet for logout on click of a button. Read the npm docs for more info: link

Logout of MetaMask with API


How to extract data from Wikipedia for a specific category like Person?

Question: I want to extract articles from Wikipedia belonging to a specific category,for example company or person. Is there a good way to do this? Right now, I have a wikipedia data dump from which I can extract the page content, but I can't filter the data based on category. Also, can I get an exact number of articles from the wikipedia dump for the given category?
Comment: (1) please provide the code you were trying to write on your own; (2) What's a "wikipedia data dump"? In what format? How can one reproduce your question?
Comment: You question is too general to be answered. Here is an article of mine that introduces a library can scrap content from Wikipedia. https://towardsdatascience.com/three-out-of-box-web-content-scraping-applications-in-python-e342a6836ba4?source=friends_link&sk=8dc8dcab5f4eb76c41a47c7c86a35c04
Comment: @Roy2012 By wikipedia data dump, i mean the dump files which one can download from [here](https://dumps.wikimedia.org/enwiki/), this is a bz2 file consisting of xml document. What i want to do is the following: I want to extract articles which belong to a specific category like person or company. Currently, I am able to extract all the content into a txt file, but not category wise.
Comment: @Christopher I have used the ```wikipedia``` module which your article suggests. This module requires that I have the page title before I can get its content, which is not what I want to do. I want to extract all articles of a category all at once, instead of searching again and again.
Comment: Is the category part of the XML document you're referring to?
Answer: Not sure what "extract" means in your question, but let's try to help.
If I want article titles, what I would do is to go to https://petscan.wmflabs.org/ and construct the query to tell me the titles. If I want content, I would then make a simple script asking either for the source wikitext, or using &action=render, one could download the HTML directly, see https://en.wikipedia.org/w/index.php?title=Stack_Overflow&action=render.
If you want to use the XML dumps, there are several readers listed at https://en.wikipedia.org/wiki/Wikipedia:Database_download, or you could write your own XML reader. If you run into an issue, feel free to ask a new question :-).
Answer: If you want an SQL solution, you can find the articles of a category by searching up rows in categorylinks.sql where cl_to=category_title. It gives all the page ids of the subcategories, articles. Then you can count all the rows where cl_type='subcat' to find the number of subcategories. cl_type='page' give the number of pages.
To find the corresponding title of the articles or the categories, you can use page.sql.
An alternative way is to just get the category.sql dump. It has the number of subcategories and articles of each category.
The actual names of the dumps in the latest enwiki dumps would be:

enwiki-latest-categorylinks.sql
enwiki-latest-page.sql


Old passport number mentioned in visa for Kuwait

Question: I am living in India and I applied for an employment visa from Kuwait. I got all visa documents now, but my old passport number is mentioned in all documents. I renewed my passport and it has a new passport number. Is there any problem in travelling to Kuwait with my existing visa?
Answer: If you have your old passport with you:
No problem. You still can use the visa as long as you bring both passports. Even if the passport is cancelled (clipped).

If you do not have your old passport with you:
Big problem, you need to visit the Kuwaiti embassy to issue a new visa.
Comment: I'm not convinced this is correct. I'm quite sure that even if you have your old passport and the new passport does not explicitly state it replaces the old passport, mentioning it by its number, it will not work.
Comment: I'd call that embassy anyway to confirm whether this is correct or not. Cheaper and more peace of mind than fretting over whether you'll be allowed through customs upon arrival...
Comment: If not have old passport you can also go to the passport issuing authority ( minister, consulate ) and ask for an official document stating that new passport No.xxx was given in lieu / to replace old passport   No.YYY . This is an official document generally accepted in most countries / border controls . I have used it myself for a Driver's licence .
Answer: Assume there is. Due to unobservant officials, you might be able to get away with this, but, having visa documents made out for a passport you will not be traveling with will simply mean that the visa documents will not apply to the passport you have, thus that your visa won't apply to you.


Does 'z' act as a coda or onset in the syllable structure for the word crazy?

Question: I am working on drawing the syllable structure for the word crazy. So far within kreizi, ei and i are nucliet, kr is an onset, but I am stuck on the 'z'. There are many words that start with z in the English language so I am inclined to say it is an onset as onsets are greedy.
Comment: What theory of syllable structure are you operating with? The answer is very theory-dependent.
Answer: Nobody has devised a satisfactory test for syllabification especially in English. The literature is chock full of contradictory claims as to the syllabification of words, all supported with a bit of evidence. There are some undeniable facts, such as that the word big begins with a labial. There are some facts whose analysis is theory dependent but the variation is limited, for instance big is said to begin with a voiced stop (or you could use the term plosive, or you could say "unaspirated" or "lenis", but not "nasal" or "ejective"). Not only are the criteria for syllabification judgments highly variable, the set of structural entities posited by prosodic analysis is extremely variable. The very existence of an object "syllable" is contentious. In Strict CV phonology, there is no representational object "syllable", nor "onset" as distinct from "coda", instead there are Cs and Vs and lateral relations between Cs and Vs. Even Clements & Keyser's original CV phonology did not have objects "onset" vs "coda", it simply assembled Cs and Vs under a syllable node.
As for English, consonants in the context ˈCVCV have been subject to very many analyses. One hypothesis, popularized by Kahn 1975, is that consonants are attracted to a preceding syllable which ends with a vocoid (vowel, glide or r in some dialects), thus the consonant is both in the first syllable and in the second (it is "ambisyllabic"). An alternative hypothesis is that the consonant is exclusive in the preceding syllable therefore the second syllable begins with a vowel. Whether or not that relates to "onsets" or "codas" depends on whether you also have such nodes in your representational arsenal (and what is your theory of what onsets or codas can be or do?).
There seems to be agreement that in hanger, the consonant [ŋ] has to be in the first syllable, because words cannot begin with [ŋ] in English therefore syllables cannot begin with [ŋ], therefore [hæ.ŋɹ̩] would be theoretically impossible, therefore it must be syllabified [hæŋ.ɹ̩]. That kind of argument does not help with "crazy".
There is a line of reasoning to the effect that "busy" must be syllabified [bɪz.i], because no word in English ends in [ɪ] (or any short / lax vowel), therefore syllables cannot end in a lax vowel, therefore "busy" must be syllabified [bɪz.i]. But "busy" is different from "crazy" in the vowel quality of the stressed syllable. There is also the matter of aspiration and flapping, where we often say that /t/ is aspirated in syllable-initial position. But there is no aspiration of /t/ in "crater", therefore /t/ cannot be sylable-initial, or (following Kahn's analysis) exclusively syllable-initial. Of course, /t/ is not /s/ so that evidence does not directly prove or disprove a particular analysis of crazy. Plus, there is an alternative statement of aspiration and flapping in terms of initial position in the stress foot, and it is generally agreed that /t/ in crater is not foot-initial.
In short, yes or no, depending mainly on your theoretical premises. It is almost trivial to identify a theoretical premise that precludes z as onset or as coda in this instance, it is totally non-trivial to prove that that theoretical premise is correct.
Answer: /z/ is the onset of the second syllable, not the coda of the first syllable. If /z/ were geminated, then it would have been both. But it's not geminated.
The correct syllabification of ⟨crazy⟩ is /kreɪ.zi/. Note that in IPA notation, syllables are separated with a period.
Comment: Says you and whose army? ;-) Longmans Pronuncing Dictionary gives the /z/ as the coda of the first syllable. There are several reasons to think that this is the case.
Comment: @Araucaria-him I think Longman's lexxed the word like that because -y is a morpheme boundary. But syllabification is not a faithful mapping to morpheme boundaries.


How to merge text layer to multiple visible layers in GIMP?

Question: I want to make a GIF and I need to merge text with all layers. If there is a more efficient way to do this instead of:

Dublicate Text Layer
Merge Down
and repeat if it's not the last layer
Answer: You can use the ofn-interleave-layer script that you will find here.
Once installed, you want Image > Interleave layers > Interleave single layer of stack (title mode). But read the HTML doc for some usage hints.
Answer: A faster way:
GIF does not have vector texts, so you can well use rasterized text. Make a selection from your text area by holding the Alt key + Clicking  the text icon in the Layers panel:

Now you can stamp the text to every layer by selecting the layers and by clicking with a solid and big enough painting brush. The selection stays the same until you remove it or make a new selection.
Unfortunately I cannot tell any method how to select multiple layers to paint on everyone at the same time.
People have wished multiple layer selections as long as I can remember. The developers surely have got also 1000 other wishes, so there's probably a good reason to priorize somehow. But GIMP is free and using it is 100% voluntary, so no reason to complain.
Comment: Multiple-layer selection has recently been added in the Gimp 3.0 development stream. Still some rough edges (this has lots of impacts everywhere).
Answer: You can do it with shortcuts if you don't want to install a script/plugin. Obviously, if you have hundreds of frames this can become tedious, so the script @xenoid refers to might be better. But for shorter GIFs this technique is pretty quick.
Text layer on top, then right click the text layer in the layers panel and choose Alpha to Selection. Choose a foreground colour for the text, and then fill on each layer using the following shortcuts repeatedly, until finished.

Ctrl+comma to fill with foreground colour
 Down Arrow to select the next layer down


Old iPod that won't upgrade to iOS 7

Question: I have an old iPod and I started a clash of clans game on it. I want to link it to an iPad because it's so small. The problem is that it won't let me link it because the iOS version isn't 7 or greater. Is there any way I can link this old iPod to an iPad so I can play the game on the iPad?
Answer: If you're using a fourth generation iPod or earlier, you're out of luck - the most recent version of iOS supported by any of those models is 6.1.3.
If you're using a fifth generation iPod, you should be able to update your operating system by using the software update functionality ( Settings > General > Software Update).

Old iPod that won't upgrade to iOS 7


VLC doesn't work properly on ubuntu 14.04

Question: I've installed vlc but when I try to open it no window pops up, only the icon shows up on the taskbar. Furthermore when I open video files there is only sound and no picture.
Comment: try to reinstall vlc by running `sudo apt-get install --reinstall vlc`
Answer: I was getting a similar (possibly the same) error: when running from the console:
<code>$ vlc
VLC media player 2.1.2 Rincewind (revision 2.1.2-0-ga4c4876)
[0x25f4978] main interface error: no suitable interface module
[0x25af058] main libvlc error: interface "globalhotkeys,none" initialization failed
[0x25af058] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
</code>
Running Avinash's command fixed things for me:
<code>sudo apt-get install --reinstall vlc
</code>
Answer: Go to Tools→Preferences→Video
Remove the tick for Accelerated video output (Overlay)
Try and play the movie again, you should now see output.
Answer: Go to vlc menu  > tool > preferences  > video  >   untick the accelerated video output(overlay)  > select x11 video output(xcb) in output option
now vlc will run smoothly.


Features module working confusion

Question: I want to use features module. Can i use this module as stand alone and get it working or do i need help of modules like strongarm or context module. Will have have any added advantage if i user these modules along with features module ?  Any good flow chart of how to use features module?
Answer: You can use Features without additional modules. In fact, the module page is quite clear about it. Quote:
<code>Features also provides faux-exportable functionality for the
following Drupal core and contrib components:
- CCK fields
- CCK fieldgroups
- Content types
- Input filters
- User roles/permissions
- Custom menus and menu links *
- Taxonomy vocabularies *

  * Currently in development.
</code>
In other words, these things can be exported using features out-of-the-box. That said, I recommend installing Strongarm right away, because some of the things above are lined to variables that you will want to export as well. For instance, if you export a content type, you probably want to export its comment settings too.
Answer: Features Module can help you export nodes, content types and almost any kind of entity. But if you want to export things like a settings value (eg: login settings) then you need strongarm to export these variables.
Comment: That's not correct, 'no anonymous user access' is controlled by permissions, not by variables.

Features module working confusion


Phone is plugged into computer via USB, charging but not entering adb mode

Question: I am on Linux, so this is not a driver problem. I have a Huawei Union, USB Debugging is enabled in developer options, and I have previously been able to use ADB when the device is plugged in via USB. The phone displays, "USB debugging is on" in the notification tray, and ADB just works. Now, when I plug in the phone, the phone does not show this notification and adb devices shows nothing. Is this a problem with my USB cord or one of the ports on the devices? Because it worked just fine when I got all three parts (the laptop, the phone, and the cord) two weeks ago.
Answer: Are you using the usb cable that came with your device? Check another usb port on the laptop, reboot the laptop if another port doesnt work either. If that does not help, check another usb cable. Good luck.
Answer: USB debugging on Linux works far better if the adbd deamon is running as root. Try these commands:
adb kill-server
sudo adb start-server


How can I preserve the original data and add the new data to my account when using the realloc method?

Question: So when increasing the data size of my account I of course would add some additional fields in my Struct. So on the basis of new Struct I won't be able to deserialize the previous data. Do i need to keep a copy of the previous struct to deserialize the data and use it to add the data to the new struct but the publicKey would be of the created account? In doing so the previous struct would be used to deserialize the older accounts and the new struct would be consuming the data and adding more info to the account while the address remains the same?
Answer: Yes, you would basically do an account migrate on read. As a best practice, including a version field in the original struct would make it easier to read that field as a discriminator on when to convert from the old to new.
There is a simple example in the Solana cookbook that demonstrated migrating structs. It was written prior to the realloc feature but is generally the same approach: Solana Cookbook
Comment: I see, alright and once the data would added to the account, of course I would need to deposit more sol to the account for it to be rent exempt. I would have to transfer that sol from the client side into the account for it to be able to accommodate for the increased size rent?