Do Ferengi ever blink their eyes?

Question: I recently watched some Star Trek Deep Space Nine episodes and I noticed that the Ferengi never blink their eyes. Is it just the actors or do Ferengi as a race not need to blink their eyes?
Answer: I think it was just the episode, and/or actor -- there's nothing in Memory Alpha about it, and if you look at this clip, you see the Ferengi blink several seconds after the camera focuses on him.  (At 7 seconds.)  This clip has Nog blink at 1:11.
I'm sure there more, but I'm not up to the eyestrain of finding them :)
Comment: Thanks. Maybe it was just [Quark](http://en.memory-alpha.org/wiki/Quark) who's staring eyes confused me ;)
Comment: Seems that second video, you linked, is no longer available.

Do Ferengi ever blink their eyes?


Implement tokenfallback on an existing ERC20 Token

Question: I have an ERC20 token which is already deployed on the mainnet. I want to make a contract which accepts this token from users and pays dividends in Ethereum stored already inside the contract. In my knowledge, ERC20 doesn't have a default tokenfallback function. So how will I detect the incoming token transaction to my contract?
Answer: You don't.
That's actually the biggest drawback of the ERC20 token standard, and that's why ERC777 tokens were invented. Everyone should be using ERC777 tokens instead.
The correct way of accepting ERC20 tokens is to use the approve => transferFrom pattern.
First, the sender sends an approve message to the ERC20 contract, where the sender approves your contract to transfer funds.
Second, the send calls your contract, which is now approved by the ERC20 token, so that your contract can use transferFrom on the ERC20 token, and transfer funds to itself (or someone else).
Tokens sent directly to a contract using the transfer method (which is not the correct way of doing it) will be PERMANENTLY LOCKED in that contract!
Answer: The transaction is sent to the ERC20 contract, not to your contract.
The ERC20 contract maintains a record of how many tokens are owned by your contract.
As a result of the transfer, this record within the ERC20 contract is updated.
Holding tokens is more like putting your money in a bank rather than keeping it in your wallet.
That bank maintains a ledger which indicates how much money each client owns at any given moment.
Comment: Yeah I know that. What I was asking is, my user is sending token to my contract. Which means the receiver is my contract. How can I make my contract to detect this incoming token transaction. I know there is a tokenfallback function on erc223, but my token is an already deployed erc20


cancan for actions involving multiple objects

Question: I am using cancan for authorization.I have about 50 objects. There are actions involving 3 or 4 objects.
when I setup the ability.rb should I have to list all 50 objects?
What if a particular action involves updating more than 3 objects then on what object is the can method performed on.
Answer: You should only authorize the objects that are actually involved with your app. In doing so, you're keeping it DRY (Don't Repeat Yourself).
If more than 3 objects are involved in an action, then you need to work out what those are, because if you don't, then you might experience some problems in the future.
Can you list the actions that you've got please


Where do I go if I want to ask questions about the meta part of this website?

Question: I know that if I want to ask questions about https://gaming.stackexchange.com/ I should ask here, but what if I have questions about what questions are on topic here (https://meta.stackexchange.com/questions/ask)? Is there a http://meta.meta.gaming.stackexchange.com/questions/ask? Or do I just ask questions about this site here?
Comment: You have a meta question about asking a meta question on a meta site about meta? Too many metas
Answer: You just ask them here. Otherwise we would run into a turtles all the way down sort of never ending metametametameta site situation.
Answer: Adding to Ash's great answer: normally the meta tag is reserved for questions on meta which have to do with meta.  If you have a question about meta, ask here and use the meta tag.
Comment: What if we have questions about asking questions about meta?
Comment: I guess we should use the meta tag on questions about asking questions about meta.


Trying to flip selection on GIMP

Question: I am having trouble flipping a selection on GIMP. I use the lasso tool to select the part of the image I want to select. I then click tools > transform tools > flip but only the outline of my selection is flipped not the contents itself! How do I fix this?
Answer: There are many ways to do this in GIMP. Here are two methods:
Option 1
Make your selection, switch to the Flip tool Shift+F in the toolbox, click inside your selection with the tool to flip horizontally or hold down Ctrl before you click to flip vertically.
This will cut it from the existing layer (leaving a hole), and turn it into a floating selection. From here you can either hit the anchor button (in the layers panel) to anchor it to the existing layer, or hit the new layer button (in the layers panel) to promote it to a new layer.
Option 2
Make a selection. Ctrl+C to copy it, and do Edit > Paste as > New Layer. Then do Layer > Transform > Flip vertical/horizontal
This is probably the best way if you don't want to leave a hole in the original layer, or mess around with the anchor/new layer buttons.
Answer: If only the selection outline is flipped it is probably because you are in Transform: Selection mode and not in Transform: Layer.

Note that when you use Transform: Layer and there is a selection, the transformed part of the layer is made a "Floating selection"and should be either anchored back in the source layer [Ctrl-H] or made a new layer of its own [Ctrl-Shift-N].

Trying to flip selection on GIMP


Searching SSIS packages for the use of specific tables

Question: I have a number of SSIS packages, how can I search them to find the use of specific tables? I need to make tables changes and I am trying to assess the impact of these.
Answer: SSIS code behind is actually a XML value and all components of package will be represented as XML node values within it.This XML can be parsed to identify if it has a reference for our searched table or column.
Finding SSIS Packages having References to a Table or Column will help you.
Comment: this will not give you everything, if variables are being used you will miss things as you cannot say with 100% certainty what is being used
Comment: You can also use a text crawler or a Powershell Script to comb through your source control directory.
Answer: I was looking  for a similar solution, to find references of a table in all the SSIS packages I have.
The solution that worked for me was simple, I copied all the SSIS packages that needed to be searched to a folder and used the 'Find in Files' function from notepad++ wherein you can provide the search string and the path to this folder.
It works on the basis that dtsx can be edited as xml on notepad++. I am sure there are other solutions. Hope it helps.
Comment: For me, too:  I used Notepad++.  People sometimes forget that SSIS packages are XML, and Notepad++ makes XML easy to understand.  Of course that means that the SSIS package must be a windows file, rather than stored in msdb (package deployment model) or SSISDB (project deployment model).  In my case, I didn't know the full filename, but knew enough that the "find" feature gave me the tablenames within nodes (for example, table references within source or destination components within dataflow tasks), *and* the tablename references within SQL scripts (within Execute SQL tasks).


Find the caplet volatilities for LIBOR fixings at each interval, given the ATM implied cap volatility term structure

Question: anyone can provide solution or some idea to the following question? thanks
Answer: Cap vols are normally quoted as a flat black or bachelier volatility that when used to price all the optionlets, will give the correct market price of the cap.
In your case, you will have to strip the caplet volatilities.
Example: you have the vol for the 1y cap and you have the vol for the 2y cap.
Using the 1y vol for the caplets expiring the first year, find the vol for the caplets expiring in the second year that give you a market price equal to the 2y cap with a flat vol of the 2y vol.
Then use the same procedure for the 3y cap, with the 1y vol and the vol you found for the caplets expiring in the second year. Then same for 4th years and so forth...
Comment: @Jan: Usually that's what I've seen so far, i.e. flat below the shortest cap maturity (1y mostly) and then between tenors it's flat with jumps at the 2y, 3y, etc. nodes... or linear interpolation in vol or var
Comment: nice answer. What about the 0.25, 0.5 & 0.75 maturities though? Shall one assume flat vol for these maturities, equal to the 1Y vol?
Comment: @KevinT: thank you!


Electrolysis of Baking Soda separated by semi permeable membrane

Question: I have dissolved baking soda in battery water (de-ionized), in a glass beaker and used a food handling glove (vinyl) as a semi-permeable membrane to separate a graphite electrode from a copper electrode. This is for an experiment that will use the copper electrode for the reaction and not the graphite electrode. When I apply a voltage $(\pu{12 V})$ and use a multimeter to measure the voltage, I get roughly $\pu{11 V}$ passing through the vinyl glove, however, no bubbles are produced, but if I remove the glove and have both electrodes in the beaker, then loads of bubbles are produced. So, will my experiment still work if the voltage is passing through the glove and there are no bubbles?
Answer: The primary problem is too low permeability = too high resistence of the gloves, causing high voltage drop where it should be minimal one.
The gloves are not hydrophilic enough for electrolyte soaking to get low resistance.
The remaining voltage - after subtracting the glove voltage drop - is not high enough to cause electrolysis by significant current.
You may try to use a salt bridge, as a passthru vessel with porous glass ends, or a gel formed from an electrolyte solution.
You may also want to try a compartment created from a glued filtration paper, or other hydrophilic porous material, impregnated by an electrolyte, preferably sharing one of ions with both free solutions.
For the paper, be aware  of the same leveling on both compartments, otherwise. the paper will do its major purpose filtering. Eventually, more compact paper may be better, like the thick charts for paper painting.
Comment: Thank You Poutnik !! The filter paper worked !! Interestingly I used 12 volts but got 6.67 volts through (I used coffee filter paper), but I got fizzing at both ends of the filter paper, so I must use hydrophillic cell dividers, makes sense, a good thing to learn.
Děkuji moc za vaši pomoc Poutnik! Měj hezký den !
Comment: Ok, thanks for your help, I'll try the salt bridge and see what happens and then I'll reply on how good it was or if there are any difficulties. Your answer is much appreciated, cheers.
Comment: I used zinc with the copper and a porous plastic milk bottle as the divider and got 12 volts through, no voltage drop. But, still no fizzing, thinking that baking soda might not cause fizzing, water fizzes when electrodes are in the same container due to water splitting. Your idea of gluing filtration paper in as the divider sounds good, I'll give that a try.
Comment: A porous plastic milk bottle seems to have an internal contradiction for me. If it is a single layer plastic, it is not porous and hydrophilic. If it is porous and hydrophilic, it is a multilayer bottle with a least one layer not to be porous and hydrophilic. If it is like a foamed polystyrene cup, it is hydrophobic and gas bubbles is rather isolated then interconnected, not really porous much.
Comment: You are very welcome, and thanks for the translation. :-) If the answer satisfied your question, it is supposed to mark the answer as the accepted answer. It may be helpful for future searching for  related topics, as questions with accepted answers are marked differently.


Which Countries accept Stateless Person Certificate as travelling document for Visa

Question: Please someone can help with the list of countries who grant tourist visa for Stateless Person Certificate?
Answer: Pretty much every country that grants tourist visas well do so for those holding a stateless person's travel document, but for those countries where there is a genuine application process, the person must apply and, like all other visa applicants, must meet the qualifying criteria to be granted a visa.
Comment: It might be worth adding that stateless person may have a bit harder time to prove their strong connection to home country and intent to really leave country he/she is applying to visit.


Should ghee be kept out of light?

Question: I have ghee in clear glass jar on a shelf in my kitchen, would it keep for longer if I try to store it in a dark place? Does light speed up oxidation?
Answer: According to IndiaCurry, it should be stored in containers opaque to ultraviolet light for long term storage:

The UV rays from sunlight, florescent lights, and other sources
  accelerate oxidation process. The storage container container for ghee
  must be opaque to filter out UV rays. Preferably ghee must be stored
  in a dark place

I was unable to find credible sources with more detailed information that indicate exactly how this affects storage life.  In fact, it was hard to find any references at all--most were far more concerned with keeping it from being exposed to air (oxygen).
However, as it is such an easy thing to arrange--just put the jar in a cabinet for example, or use an amber glass jar--that it seems worth doing.  My guess is that in practice, unless you are using your ghee very slowly, or have an extraordinarily large amount, that it makes very little difference, but again its easy, so why not?
I did find lots of references to using ghee in lamps--this is the power of Google! :-)
Answer: Did you make it yourself or is it bought?
Ideally ghee and clarified butter should be stored in the refridgerator which is dark by default. Ghee is essentially just butter that has been clarified and has the water and impurities taken out, but sometimes some can remain which is why ideally it's best to keep it in the fridge.
Comment: It's from the store. I've heard the ghee would become too hard to use in the refrigerator though, so I prefer to have it at room temperature.
Comment: Okay, I put half of the ghee in a smaller jar in the fridge for later use and at the temperature mine is at, the ghee is still soft enough to scoop out of.
Comment: @citizen That seems sensible. Just take your ghee out of the fridge an hour or so before you intend to use it, same thing you'd do with butter really.
Answer: Homemade ghee doesn't need to be stored in the refrigerator.
You can put it in an opaque container and store it in closed cupboard.
Also, the older the ghee is, the yummier and healthier it is.
When making ghee at home, make sure you over cook it a tad bit (this will not alter its taste).
This will ensure that your ghee stays good a longer time, even over a year.
Even slightly undercooked ghee starts giving a foul smell within a month and should not be consumed.
You know your ghee is perfectly cooked when you see it well granulated.
Comment: @rumtscho: Yeah, I wasn't going to start a discussion, I was just curious about what he meant by it getting healthier over time. Never heard that before.
Comment: So I'll run on the assumption that you're correct about not needing to store it in the refrigerator, but I'd take out the "healthier" bit (unless you have something to back that up). We tend to avoid "health" advice here.
Comment: @citizen please don't start a health-related discussion. As for the rest of the comment, the OP didn't say "should", he said "need not", which is true of many oils and fats.

Should ghee be kept out of light?


Are Proto-Slavic present passive participle forms from first-person singular present forms?

Question: Are Proto-Slavic present passive participle forms (e.g., *beromъ) from first-person singular present forms (e.g., *berǫ)?
Answer: No, I don't think there's a formal or semantic reason to think so, especially since Slavic -mъ is a perfect cognate with Baltic *-mas of the same meaning (cf. Lithuanian žiūrimas filmas, a film that's being watched), and thematic 1sg. in Baltic languages continues the original PIE *-oh₂, without the Slavic addition of -m.
The origin of this Balto-Slavic *-mas however is not perfectly clear. It's extremely tempting to link it to Greek -μενος and Sanskrit -(m)ānas, with the identical (and not that ubiquitous present (medio)passive) function, especially since the ending also seems to appear far from the closely related Graeco-Aryan dialects, in Tocharian, and in Latin (in two words: alumnus and femina). Unfortunately BS *-mas can't be derived from that ending (which itself poses some problems for reconstruction, but *-mh₁nos and *-menos are a couple of suggestion) without invoking a possible, but ad-hoc simplification mn>m. The fact that a lot more obviously related ending appears in one Old Prussian word (poklausīmanas) if anything only confuses the matter further.


Carbon nano Tube

Question: I am a new to this field and want to know which process (T-CVD or CVD spray pyrolysis) is better for mass production purposs. i have tried more then 50 process on TCVD and started getting good raman analysis result like (Ig/Id=9.25), but bad CNT formation.
Comment: From G/D ratio, I think that you want to make SWCNTs. There are some questions. What are the bad CNT formation, the catalyst, carbon source gases and growth temperature? If you cannot answer the information, it's no problem.
Answer: Do you want to make SWCNTs? Yes?
About bad CNTs, do they have bending portion, defects, broken and?
How did you make TEM sample of CNT? SWCNTs are damaged when it's dispersed by the sonication. So to observe the as-grown SWCNTs using TEM, SWCNTs are necessary to be directly put on the microgrid of TEM.
And how much the accelerate voltage of TEM is? Also SWCNTs are damaged by the accelerate voltage more than about 100 keV. After these factors are removed, as-grown CNTs can be observed by TEM and discussed about the formation.
If you have already clarified these factors, it is necessary for the form (crystallinity) of CNTs to consider about the catalysts and the growth condition.
I think that obtaining CNTs with G/D ratio of ~9 using acetylene gas as a carbon source is good result. So I think that high crystallinity CNTs can be obtained by considering above factors.

Carbon nano Tube


Weapons for four-armed humanoids?

Question: What are the best and most likely weapons used by a race of four armed human-like creatures?
Comment: Questions asking "What is the best weapon for x?" are often closed as too broad. The answer to "What is the best weapon for a human?" is dependent upon the time period, expected use case, cost, legality, fashion, existing logistical infrastructure, and intended enemy. The [list of human weapons](https://en.wikipedia.org/wiki/Lists_of_weapons) on wikipedia is so long that it is composed entirely of other lists. Without providing sufficient context this question is extremely broad.
Comment: Consider the following: Humans have created bazilions of different kinds of weapons over our history and we still use thousands of different weapons today.  Which one is best depends on the circumstance, not on the number of arms we have.  Considering basically all hand-held weapons fall into the categories of club, stab, slash, whip, twang, and bang I can't see that your aliens would do anything differently than we.  (But they could do it twice as often....)
Comment: Hi, Tamotamo77, welcome to Worldbuilding Stack Exchange. As @sphennings said, this is a really, really broad question. There are some things you could do to fix it and maybe get it reopened: 1) Specify some more details about the humanoids, including their biology and other characteristics. 2) Specify the technological level of the species, as well as the technological level of any other race they might fight. 3) Specify what you mean by best (lightest? deadliest? most efficient?). Also, feel free to take the [tour] and check out the [help] for more information about the site.
Comment: A [lightsaber](http://www.starwars.com/databank/general-grievous)?
Answer: Considering the parallel question: best and most likely weapon used by a human.
Technological level is not stated so humans will be considered over the entire time span of their existence.  For much of this time there was minimal technology and so the most likely weapon will be one made from natural materials.
Assuming an arm, brain and eye that works like a human: one great ability of the human is to judge distances and trajectories and one huge advantage humans have over animals is the ability to throw things.  Projectile weapons are better than weapons that require close quarters because they decrease your chance of being hurt by your adversary, especially an adversary that does not have projectile weapons, like an animal.
Most likely projectile weapon is the one most readily available.
So
1: Low tech most likely.
2:  Projectile weapon is best.
3:  Low tech projectile weapon which is most available is most likely.
Your creature's best and most likely weapon is a rock.
No joke.  Imagine a pro baseball pitcher with a pile of good rocks facing off against a pack of guys with swords starting 100 yards away.  If the sword guys were well trained, confident and did not slow down, with luck a couple might reach him.  Or maybe not.  Now imagine the pitcher has 4 throwing arms.
Comment: Please don't answer questions that are obviously too broad and opinion based. It sets a bad example, especially since you're a high rep user.
Comment: About the four-armed pitcher though... When throwing a rock, javelin or grenade to any useful distance, one needs to deploy whole body.
Throwing with several arms in rapid sequence would not neccessarily give better results.

Weapons for four-armed humanoids?


About moving ice bergs northwards to slow down all the melting a tiny bit. ( Clearing away navigation hazards is a side effect of this.)

Question: I read somewhere someone someone had the idea to try to move a 'small' iceberg with giant tugboats used to move oil-rigs. I thought if an Iceberg could be moved, why not move it $NORTHWARD$ maybe above the latitude of where it 'broke' off. Maybe it could be anchored there somehow. Is this feasible?
Comment: Relevant: https://en.wikipedia.org/wiki/Pycrete
Comment: The question is mainly about moving an iceberg north  to slow melting ,a bit.
Comment: Why was this downvoted ; it seems like a useful idea to help people and the environment?
Comment: Because this is a shipping question, not a question about any of the earth sciences.  If you had made this question more about the icebergs (as the answer suggests) it may have upvoted instead.
Comment: Moving Icebergs 'back' to where they came from ( or approximately so) to slow down all the melting Ice; good idea??
Comment: Could an iceberg be moved approximately back where it came from?
Answer: Some background. The idea of towing ice bergs to provide a source for fresh water in dry climate zones was first proposed in the 1970s by Weeks and Campbell (1973) and Hult and Ostrander (1973). This sparked interest that resulted in several studies published in conferences (Husseiny, 1980; IGS, 1980). The focus of the work was manly on the wastage of ice during transport and of course the technical aspects of towing ice. The main issue, however, concerns the integrity of ice bergs during transport. The mechanics of ice bergs is still poorly understood and it is known that bergs gradually break up. How this is affected by ocean swells and other forces acting upon a berg under tow is still investigated (see a wealth of publications in particularly Journal of Glacology and Annals of Glaciology). The idea has, however, not been forgotten and more possible technical solutions are proposed (e.g. Fast Company. So while the financial aspect of the process may be calculable, the strength of ice bergs, and the forces acting upon them in the open sea and under tow requires more research before towing could become a reality.
On top of this are legal issues. Who owns the ice? and also how can towing ice berg across busy shipping lines be safe, particularly in the event of a break-up in mid-ocean.
To respond to your specific question on towing northward and anchoring: The towing in any direction is subject to the same issues as described above. Anchoring, the ice bergs will melt and degrade over time so that moorings will continually have to be renewed. Most ice bergs in the north will go through at least one cycle of being caught in seasonal sea ice but eventually will be set free to follow ocean currents in whatever direction they move locally. Since the ocean water will carry some heat, it will not matter where the ice berg is located, it will slowly melt. On top of that is the issue of disintegration since melting will change the shape of the berg and hence its stability and centre of gravity causing stresses within the block to alter.
If one takes a longer-term perspective and ignores the practicalities (incl. costs), moving ice to a place where it melts slower would momentarily decrease the contribution but eventually one would reach a new equilibrium where the same rate of melt water will be contributed and the temporary benefit will be lost. So apart from being highly impractical from all aspects, the longer-term benefits will be nil.
References
Hult, J.L. and Ostrander, N.C., 1973. Antarctic icebergs as a global fresh water resource. Rand Corporation, Santa Monica. Report No. R-1255-NSF. 83 pp.
Husseiny, A.A. (ed.) 1978. Iceberg Utilization. Proceedings of the First International Conference, Ames, Iowa, 1977. Pergamon Press, New York. 759 pp.
IGS (International Glaciological Society), 1980. Proceedings of the Conference on the Use of Icebergs. Annals of Glaciology, 1 136 pp.
Weeks, W.F. and Campbell, W.J., 1973. Icebergs as a fresh-water source: an appraisal. Journal of Glaciology, 12, 65, 207-233.
Comment: Could moving 'small' icebergs northward towards where they first 'broke free' (or thereabouts) free up some shipping lanes and possibly slow down all the melting if only a 'bit'?
Comment: Say one iceberg has a million tons of water 'frozen' in it and it is towed to much colder waters where it doesn't melt anymore or it freezes to the surrounding ice 'landscape' ; this venture would stop a million tons of water being added to the oceans. So for this moment on for maybe a month a million tons of water was kept frozen.
Comment: My idea is if moving an iceberg southward is feasible then moving it northward to about the latitudes where it came from to possibly prevent it from melting as fast would not only get some floating icebergs out of shipping lanes but also 'slow' down all the melting..
Comment: Has any user on one of these sites promoted an idea that was read by someone else who actually caused the idea to be implemented in real life?


Does a redirected URL used in an anchor count as backlink?

Question: If another website puts an anchor to our app to https://URL1 and this link redirects to our website at https://OURCOMPANY, does Google count this as a back link to our website?
Answer: Googlebot follows redirects and passes Pagerank across them.   Links that redirect normally would count as back links and help SEO.  However, there are some things that could prevent that:

Googlebot likes 301 Permanent type redirects best.  If the redirect is some other type like 302 Temporary, meta refresh, frameset redirect, or JavaScript based; Googlebot is less likely to follow it and pass Pagerank across it.
Redirects from deep URLs to your home page are seen as "Soft 404" errors by Googlebot.   So if the redirect is from https://someothersite.example/some-deep-page.html to https://mysite.example/ (the home page), Google probably won't assign any value to the redirect.
If the content at the destination page has significantly changed since the link was created, Google may ignore the link and the redirect.    Google may monitor links and stop passing Pagerank when the destination page changes significantly.  This prevents people from getting SEO value from acquiring defunct sites.
Google doesn't like link spam.  If Google thinks the link and redirect are spammy in any way, it won't pass any value across them.  In the worst case, Google could penalize your entire site for spammy links.

So you don't need to worry about changing all the links that point to your site from before you changed your domain name.   All those links will continue to work and you will get SEO value from them.
If you are trying to grab an old URL and redirect it to your site, that probably won't help at all and will look spammy.
Comment: I'm curious about your second argument ("Redirects from deep URLs to your home page are seen as "Soft 404" errors by Googlebot.") - do you have any source for that? I agree that the value might not be the same but I'm not sure about the Soft 404 aspect (even if it is something of an umbrella term).
Comment: If you redirect a deep URL on your own site to the homepage Google will actually report it as a soft 404 in Google search console. That is why I say that Google treats deep URL redirects to the homepage as soft 404.
Comment: I think it's more of a"can" than a "will"; I recently migrated a website where the content of some internal pages where being covered by the new website's homepage and they were indexed without any issues, so it's more a relevance issue than a rule.


What's the purple thing that Lord Boros regenerates around?

Question: In his battle with Saitama, Lord Boros regenerates around a growing purple thing. What is that purple thing?
Answer: This detail - i.e. Boros's body essentially exploding into 5cm-long pieces of blood pulp, just to gather back around a glowing point placed roughly in the center of his chest - is only shown in anime continuity.
Murata's illustrations in manga One-Punch Man (chapter 36) are very similar, but the pieces are larger and less spread out. Boros's body gathers back essentially in the same position it was when Saitama started punching him and no glowing point is shown. The way I understood it, the pieces were pulled to position and then the junctions were stitched back together through super-healing.
In the webcomic by ONE (chapter 40) Boros's body is not even actually blown to pieces, but rather heavily chipped. In my opinion, that could arguably be consistent with simple regeneration.
Throughout (i.e. in all three versions), the explanation of Boros's healing process is unchanged: he only states that he can regenerate through "energy" (although apparently he has some sort of untold means to pull his body pieces back together). As far as I know, up to manga chapter 185 it is never stated that he should have a "core bead" like that minion of his who was felled by the S-class heroes.


Distance of a shrapnel ball with air resistance

Question: How can we determine the distance a steel ball inside a grenade will fly horizontally taking into account air resistance?
If we assume that the detonation velocity is 6900m/s(TNT), the ball has a diameter of 5mm and the amount of tot. explosive is 180g. Will the shrapnel immediately reach terminal velocity and how does the detonation pressure (0.86GPa) affect the terminal velocity?
Answer: Terminal velocity is the maximum velocity attainable by an object as it falls through a fluid or in this case air. "Falling" in this case means moving vertically with a constant velocity when air resistance is equal to the force of gravity so terminal velocity would not be applicable here.
If you assume the ball is moving horizontally with velocity of 6900 m/s however, without air resistance you can calculate the maximum distance using a ballistic trajectory. With air resistance you have to take into account multiple components of the drag which will make the travel distance shorter than only using ballistic trajectory.
At subsonic velocities (below 330 m/s at sea level) main components of the drag will be form drag which you can calculate knowing that the form of a ball is sphere; and skin friction which is dependent of the material - in this case steel. At transonic and supersonic velocities you also have to take into account wave drag which occurs due to the presence of shock waves. As the aforementioned speed is almost 21 mach at standard atmospheric pressure, i assume the incoming air (relative to the ball) might also get ionised due to kinetic energy being sufficient and you might encounter extra energy loss due to thermal radiation.
To solve this problem you will need to take all these components into account, but remember that that the total force of drag will be in the opposite direction of the velocity.
Also the detonation pressure will dissipate with time as the air expands and will mostly affect the speed of sound.


What commonly availible salts are strong dessicants?

Question: I'm looking into building an absorption chiller as a decidedly non-professional DIY project. For safety reasons and because temps. > 0°C are sufficient, I won't be using ammonia but some saline solution as absorber and water as cooling agent.
The obvious choice for the salt would be LiBr, as this is used in comercial installations. However, I'm not sure I can procure it (chemicals suppliers don't sell to private persons in germany) and it's not cheap (~ 30€/100g).
What other salts are strongly hydroscopic and commonly availible?
Alternativly, where can I find a concise list with the physical properties of many common (=household) salts?
Answer: Have you looked into silica gel or zeolites? Both are non-toxic, and thus likely obtainable by private persons. Zeolites are used in self-refrigerating beer kegs.
Comment: I'm looking to create a liquid aquaous solution of the salt, so silica gels or zeoliths won't work for me. I know of absorption chillers using solid absorbers, but I'm looking to build something mechanically simpler.


How do I populate these fields from existing data?

Question: I'm not sure how to make a few parts of my form to populate from data from an array I'm passing from the database.
First is this <select> object. The key estimate_lead_id in the database holds the value, and I want the dropdown to auto-select based on the value from the database.
<select name="estimate_lead_id">
    <? foreach($leads->result() as $lead) { ?>
        <option value="<?=$lead->id?>"><?=$lead->lead_name?></option>
    <? } ?>
</select>

EDIT: I'll break the second part into another question.
Answer: The selected option(s) will have the attribute selected="selected", so do a check during your loop and conditionally add this attribute:
<select name="estimate_lead_id">
    <? foreach($leads->result() as $lead) { ?>
        <option value="<?=$lead->id?>" <?php echo $estimate_lead_id == $lead->id ? 'selected="selected"' : ''; ?>><?=$lead->lead_name?></option>
    <? } ?>
</select>

I could use some clarification on the second part. What defines whether or not an item is in the estimate?
Answer: For the first question, you need to use the selected attribute in the option tag.
<select name="estimate_lead_id">
    <? foreach($leads->result() as $lead) {
        echo '<option value="'.$lead->id.'"';
        if ($lead->selected)
            echo ' selected="selected"';
        echo '>'.$lead->lead_name.'</option>\n';
    } ?>
</select>

For the second, it does need some more clarification, but I suspect the answer would involve and if clause that used in_array to check if the current field is in the array of field in the estimate. You would then only print the html data when the clause is true.


finding patent ZL 2007 3 0024190.5 portable fan

Question: I purchased a rechargeable clip on fan. This model is available from various re sellers but i want to find the manufacturer. I am hoping the patent number will get me to them. The number on the fan is ZL 2007 3 0024190.5.I cannot find any information on online, i have tried google patent search,cnpat plus others and nothing works. Your help would be much appreciated.
Comment: I also failed searching. I tried searching on The Lens specifying China as the jurisdiction and 2007 as the filing date with "fan" as the search word. Nothing at all showed up. It's China so it might be a fake patent number anyway.
Answer: The patent you are referring related to Chinese design patents and are not readily searchable through text you can find the details at http://epub.cnipa.gov.cn/gjcx.jsp
Comment: The linked page is entirely in Chinese. Is it possible to provide a link to the actual patent?
Comment: OK - I was looking at inventions and utility models. If it is a design, there is a WIPO database at "https://www.wipo.int/reference/en/designdb/news/2019/news_0001.html that says it leads to a global design database that now includes the entire China design database. Didn't find either number there.
Answer: the right patent number is ZL200730024196.9
Comment: How do you know this is the right patent number? Also, if this is the right patent number than providing an explanation on how you figured it out and a link to it would make the answer much more useful.
Comment: The English version of the site is http://220.127.116.11:8080/sipo_EN/search/tabSearch.do?method=init
Comment: And I didn't find either number there
Comment: There are about 700 application in China in 2007 (using link I provided above) with the word "fan" in the English Title. All are in the 2007 2's. None are 2007 3 anything. Trying "fan" in Abstract got 0 hits. I'm done.


How to copy migrate data to new tables with identity column, while preserving FK relationship?

Question: I want to migrate data from one database to another. The table schemas are exactly the same:
CREATE TABLE Customers(
    [Id] INT NOT NULL PRIMARY KEY IDENTITY,
    (some other columns ......)
);

CREATE TABLE Orders(
    [Id] INT NOT NULL PRIMARY KEY IDENTITY,
    [CustomerId] INT NOT NULL,
    (some other columns ......),
    CONSTRAINT [FK_Customers_Orders] FOREIGN KEY ([CustomerId]) REFERENCES [Customers]([Id])
)

The two databases have different data, so the new identity key for the same table would be different at the two databases. That is not a problem; my goal is to append new data to the existing one, not complete replacing all data of the entire table. However I would like to maintain all parent-child relationship of the inserted data.
If I use the "Generate Script" feature of SSMS, the script would attempt to insert using the same ID, which would conflict existing data in the destination database. How can I copy data using database scripts only?
I want the identity column at the destination to continue normally from its last value.
Customers does not have any other UNIQUE NOT NULL constraint. It is ok to have duplicate data in other columns (I'm using Customers and Orders just as an example here, so I don't have to explain the whole story). The question is about any one-to-N relationship.
Answer: Here's a way that scales easily to three related tables.
Use MERGE to insert the data into the copy tables so that you can OUTPUT the old and new IDENTITY values into a control table and use them for related tables mapping.
The actual answer is just two create table statements and three merges. The rest is sample data setup and tear down.
USE tempdb;

--## Create test tables ##--

CREATE TABLE Customers(
    [Id] INT NOT NULL PRIMARY KEY IdENTITY,
    [Name] NVARCHAR(200) NOT NULL
);

CREATE TABLE Orders(
    [Id] INT NOT NULL PRIMARY KEY IdENTITY,
    [CustomerId] INT NOT NULL,
    [OrderDate] DATE NOT NULL,
    CONSTRAINT [FK_Customers_Orders] FOREIGN KEY ([CustomerId]) REFERENCES [Customers]([Id])
);

CREATE TABLE OrderItems(
    [Id] INT NOT NULL PRIMARY KEY IdENTITY,
    [OrderId] INT NOT NULL,
    [ItemId] INT NOT NULL,
    CONSTRAINT [FK_Orders_OrderItems] FOREIGN KEY ([OrderId]) REFERENCES [Orders]([Id])
);

CREATE TABLE Customers2(
    [Id] INT NOT NULL PRIMARY KEY IdENTITY,
    [Name] NVARCHAR(200) NOT NULL
);

CREATE TABLE Orders2(
    [Id] INT NOT NULL PRIMARY KEY IdENTITY,
    [CustomerId] INT NOT NULL,
    [OrderDate] DATE NOT NULL,
    CONSTRAINT [FK_Customers2_Orders2] FOREIGN KEY ([CustomerId]) REFERENCES [Customers2]([Id])
);

CREATE TABLE OrderItems2(
    [Id] INT NOT NULL PRIMARY KEY IdENTITY,
    [OrderId] INT NOT NULL,
    [ItemId] INT NOT NULL,
    CONSTRAINT [FK_Orders2_OrderItems2] FOREIGN KEY ([OrderId]) REFERENCES [Orders2]([Id])
);

--== Populate some dummy data ==--

INSERT Customers(Name)
VALUES('Aaberg'),('Aalst'),('Aara'),('Aaren'),('Aarika'),('Aaron'),('Aaronson'),('Ab'),('Aba'),('Abad');

INSERT Orders(CustomerId, OrderDate)
SELECT Id, Id+GETDATE()
FROM Customers;

INSERT OrderItems(OrderId, ItemId)
SELECT Id, Id*1000
FROM Orders;

INSERT Customers2(Name)
VALUES('Zysk'),('Zwiebel'),('Zwick'),('Zweig'),('Zwart'),('Zuzana'),('Zusman'),('Zurn'),('Zurkow'),('ZurheIde');

INSERT Orders2(CustomerId, OrderDate)
SELECT Id, Id+GETDATE()+20
FROM Customers2;

INSERT OrderItems2(OrderId, ItemId)
SELECT Id, Id*1000+10000
FROM Orders2;

SELECT * FROM Customers JOIN Orders ON Orders.CustomerId = Customers.Id JOIN OrderItems ON OrderItems.OrderId = Orders.Id;

SELECT * FROM Customers2 JOIN Orders2 ON Orders2.CustomerId = Customers2.Id JOIN OrderItems2 ON OrderItems2.OrderId = Orders2.Id;

--== ** START ACTUAL ANSWER ** ==--

--== Create Linkage tables ==--

CREATE TABLE CustomerLinkage(old INT NOT NULL PRIMARY KEY, new INT NOT NULL);
CREATE TABLE OrderLinkage(old INT NOT NULL PRIMARY KEY, new INT NOT NULL);

--== Copy Header (Customers) rows and record the new key ==--

MERGE Customers2
USING Customers
ON 1=0 -- we just want an insert, so this forces every row as unmatched
WHEN NOT MATCHED THEN
INSERT (Name) VALUES(Customers.Name)
OUTPUT Customers.Id, INSERTED.Id INTO CustomerLinkage;

--== Copy Detail (Orders) rows using the new key from CustomerLinkage and record the new Order key ==--

MERGE Orders2
USING (SELECT Orders.Id, CustomerLinkage.new, Orders.OrderDate
FROM Orders
JOIN CustomerLinkage
ON CustomerLinkage.old = Orders.CustomerId) AS Orders
ON 1=0 -- we just want an insert, so this forces every row as unmatched
WHEN NOT MATCHED THEN
INSERT (CustomerId, OrderDate) VALUES(Orders.new, Orders.OrderDate)
OUTPUT Orders.Id, INSERTED.Id INTO OrderLinkage;

--== Copy Detail (OrderItems) rows using the new key from OrderLinkage ==--

MERGE OrderItems2
USING (SELECT OrderItems.Id, OrderLinkage.new, OrderItems.ItemId
FROM OrderItems
JOIN OrderLinkage
ON OrderLinkage.old = OrderItems.OrderId) AS OrderItems
ON 1=0 -- we just want an insert, so this forces every row as unmatched
WHEN NOT MATCHED THEN
INSERT (OrderId, ItemId) VALUES(OrderItems.new, OrderItems.ItemId);

--== ** END ACTUAL ANSWER ** ==--

--== Display the results ==--

SELECT * FROM Customers2 JOIN Orders2 ON Orders2.CustomerId = Customers2.Id JOIN OrderItems2 ON OrderItems2.OrderId = Orders2.Id;

--== Drop test tables ==--

DROP TABLE OrderItems;
DROP TABLE OrderItems2;
DROP TABLE Orders;
DROP TABLE Orders2;
DROP TABLE Customers;
DROP TABLE Customers2;
DROP TABLE CustomerLinkage;
DROP TABLE OrderLinkage;

Answer: When I've done this in the past, I did it something like this:

Backup both databases.
Copy the rows you want to move from the first DB to the second into a new table, without an IDENTITY column.
Copy all child rows of those rows into new tables without foreign keys to the parent table.

Note: We'll refer to the above set of tables as "temporary"; however, I highly recommend you store them in their own database, and back that up as well when you're done.

Determine how many ID values you need from the second database for rows from the first database.
Use DBCC CHECKIDENT to shift the next IDENTITY value for the target table to 1 beyond what you need for the move. This will leave an open block of X IDENTITY values that you can assign to the rows being brought over from the first database.
Set up a mapping table, identifying the old IDENTITY value for the rows form the first DB, and the new value that they'll use in the second DB.
Example: You're moving 473 rows that will need a new IDENTITY value from the first database to the second. Per DBCC CHECKIDENT, the next identity value for that table in the second database is 1128 right now. Use DBCC CHECKIDENT to reseed the value to 1601. You will then populate your mapping table with the current values for the IDENTITY column from your parent table as old values, and use the ROW_NUMBER() function to assign the numbers 1128 through 1600 as the new values.
Using the mapping table, update the values in what's usually the IDENTITY column in the temporary parent table.
Using the mapping table, update the values that are usually foreign keys to the parent table, in all the copies of the child tables.
Using SET IDENTITY_INSERT <parent> ON, insert the updated parent rows from the temporary parent table into the second DB.
Insert the updated child rows form the temporary child tables into the second DB.

NOTE: If some of the child tables have IDENTITY values of their own, this gets quite complicated. My actual scripts (partially developed by a vendor, so I can't really share them) deal with dozens of tables and primary key columns, including some that weren't auto-increment numeric values. However, these are the basic steps.
I retained the mapping tables, post migration, which had the benefit of allowing us to find a "new" record based on an old ID.
It's not for the faint of heart, and must, must, must be tested (ideally multiple times) in a test environment.
UPDATE: I should also say that, even with this, I didn't worry overmuch about "wasting" ID values. I actually set up my ID blocks in the second database to be 2-3 values larger that what I needed, to try to ensure I wouldn't accidentally collide with existing values.
I certainly understand not wanting to skip hundreds of thousands of potential valid IDs during this process, especially if the process will be repeated (mine was ultimately run a grand total of around 20 times over the course of 30 months). That said, in general, one cannot rely on auto-increment ID values to be sequential without gaps. When a row is created and rolled back, the auto-increment value for that row goes away; the next row added will have the next value, and the one from the rolled back row will be skipped.
Comment: Are the child tables parents to yet other tables? That's when things get complicated.
Comment: Thanks. I get the idea, basically pre-allocating a block of IDENTITY values, then manually alter the values in a set of temp tables until they match the destination, then insert. For my scenario though, the child table do have its IDENTITY column (I actually have to move three tables, with two 1-N relationship between them). This makes it quite complicated, but I appreciate the idea.
Comment: Think like `Customer-Order-OrderItem` or `Country-State-City`. The three tables, when grouped together, are self-contained.
Answer: I am using a table from WideWorldImporters database which is the new sample database from Microsoft.  In that way you can run my script as is. You can download a backup of this database from here.
Source table (this exist in sample with data).
USE [WideWorldImporters]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [Warehouse].[VehicleTemperatures]
(
    [VehicleTemperatureID] [bigint] IDENTITY(1,1) NOT NULL,
    [VehicleRegistration] [nvarchar](20) COLLATE Latin1_General_CI_AS NOT NULL,
    [ChillerSensorNumber] [int] NOT NULL,
    [RecordedWhen] [datetime2](7) NOT NULL,
    [Temperature] [decimal](10, 2) NOT NULL,
    [FullSensorData] [nvarchar](1000) COLLATE Latin1_General_CI_AS NULL,
    [IsCompressed] [bit] NOT NULL,
    [CompressedSensorData] [varbinary](max) NULL,

 CONSTRAINT [PK_Warehouse_VehicleTemperatures]  PRIMARY KEY NONCLUSTERED
(
    [VehicleTemperatureID] ASC
)
)
GO

Destination table:
USE [WideWorldImporters]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [Warehouse].[VehicleTemperatures_dest]
(
    [VehicleTemperatureID] [bigint] IDENTITY(1,1) NOT NULL,
    [VehicleRegistration] [nvarchar](20) COLLATE Latin1_General_CI_AS NOT NULL,
    [ChillerSensorNumber] [int] NOT NULL,
    [RecordedWhen] [datetime2](7) NOT NULL,
    [Temperature] [decimal](10, 2) NOT NULL,
    [FullSensorData] [nvarchar](1000) COLLATE Latin1_General_CI_AS NULL,
    [IsCompressed] [bit] NOT NULL,
    [CompressedSensorData] [varbinary](max) NULL,

 CONSTRAINT [PK_Warehouse_VehicleTemperatures_dest]  PRIMARY KEY NONCLUSTERED
(
    [VehicleTemperatureID] ASC
)
)
GO

Now doing the export without identity column value. Notice I am not inserting into the identity column VehicleTemperatureID and also not selecting from the same.
INSERT INTO [Warehouse].[vehicletemperatures_dest]
            (
             [vehicleregistration],
             [chillersensornumber],
             [recordedwhen],
             [temperature],
             [fullsensordata],
             [iscompressed],
             [compressedsensordata])
SELECT
       [vehicleregistration],
       [chillersensornumber],
       [recordedwhen],
       [temperature],
       [fullsensordata],
       [iscompressed] [bit],
       [compressedsensordata]
FROM   [Warehouse].[vehicletemperatures]

To answer the second of the question about FK constraints please see this post. Especially section below.

What you should do is save the SSIS package that the wizard creates,
  then edit it in BIDS/SSDT. When you edit the package you'll be able to
  control the order that the tables are processed in so you can process
  the parent tables then process the child tables when all the parent
  tables are done.
Comment: There are already two tables in the question, with a relationship. And yes, I am exporting from both tables. (No offence, but *not sure how you missed it...*)
Comment: This only inserts data into one table. It does not addresses the question of how to preserve FK relationship when the new PK is not known before runtime.
Comment: @SqlWorldWide that question seems somewhat related but not identical. Which of the answers are you referring to as a solution to the issue here?


How are electrons in conjugated molecules excited?

Question: I have recently started reading about colour in organic molecules and come across conjugation of pi bonds. My question is pretty short... In transition metal ions I understand colour is caused by molecules jumping between the d sub orbitals as a result of ligand splitting them. The concept of excitation easily applies here. So what I want to know is. How do electrons get excited in a conjugated molecule?
Comment: Maybe a look at [this question](http://chemistry.stackexchange.com/q/8910/189) helps.
Answer: This first picture shows what happens to the molecular orbitals of ethylene if we bring two ethylene molecules (the right and left sides of the molecular orbital vs. energy part of the diagram) close together and form 1,3 butadiene (center of the figure)
The next figure shows the result of adding a third ethylenic group to the molecule and form 1,3,5-hexatriene. Note how in each case the molecular orbitals combine (split) and generate a new set of molecular orbitals; and in each case the separation between the Highest Occupied Molecular Orbital (HOMO) and the Lowest Unoccupied Molecular Orbital (LUMO) decreases.  When light is absorbed an electron is promoted from the HOMO to the LUMO.  If we make the HOMO-LUMO separation small enough by extending conjugation, we can shift absorbtion into the visible region (longer wavelength, smaller HOMO-LUMO energy separation). We can add other groups too, like cyano, nitro, phenyl, carbonyl, etc. to extend the conjugation in our system.
Answer: To be able to show some color, the photons with wave length within visible light region have to be absorbed as the energy to make electron jump from lower orbital to higher orbital.
In the case of conjugated organic compound, electrons jumps between $\pi$ and $\pi^{*}$ molecular orbitals happen to be within the visible light region. The key is the energy difference, the conjugation system has to be big enough or the energy gap between $\pi$ and $\pi^{*}$ molecular orbitals is too big and the wave length will be too short to be visible.


AES encryption algorithm

Question: What is the amount of decrease in the probability of decrypting a data encrypted using an AES algorithm? (That is by introducing each round out of ten whole rounds, how the probability of decryption is reduced?)
Comment: Sorry, your question as it is is not understandable. Could you try to reword it so it makes some sense?
Comment: See also this similar (but a bit clearer) question: http://crypto.stackexchange.com/questions/6824/what-is-the-probability-of-breaking-the-aes-algorithm
Comment: Why are you asking the same question twice?
Answer: I'm assuming there are holes in your question, but I'll answer it as is and then you'll probably want to change the question. Although please also see this question as it might answer your question too.
The probability of decrypting an AES encrypted ciphertext is $1$ if you have the right key and (practically) $0$ if you have the wrong key. This is independent of rounds, key size, ciphertext length, padding, etc.

AES encryption algorithm


How can I get the most clear sound out of an electric guitar? line in, or mic'ing?

Question: I am recording a Guitar track, through mic'ing a guitar cab. I have gotten a decent sound out of it, but I am having troubles getting good clarity. I am using logic express 9. Are there any inserts or effects I can use to get a very good to excellent quality tone, or should I go line in with it? I would love any input anyone has! Thank you!
Comment: Can you elaborate on what you mean by "clarity"? Are you after a clean guitar sound that's really bright, with no hint of clipping in it? If you can, post an example of the sound you're after. And if you can give us a run down of your signal chain, starting with the guitar you're using, we can give better direction.
Comment: Also, the genre of music? detail and clarity in metal would mean really thick, controlled low end, on some others, like your pop/rock ballads would mean really bright guitar (arpeggios, lead solos, etc), funk would also be a really compressed, bright guitar etc.
Comment: for clarity i mean the most clear you can get through distortion without any unnecessary... uhm like muddy sounds. I'm recording heavy metal, and pop-punk, so examples of that would be Big wiggly style by The Devil Wears Prada for heavy metal, and for pop-punk Let the flames begin by Paramore. again thank you! and im not sure about the guitar because im recording another band on a later date. but what im all using is, a mac mini, logic express 9, and Tascam US1641. please also tell me what maybe i could buy or use to improve the tonality of the guitar!
Answer: Do not go line in. Guitars have a really high impedance that is not compatible with the line in buffers on most desks and sound cards. If you have a built in DI on your desk or soundcard, chances are it's built with a really low quality transformer (if at all - using instead really really cheap op-amps without a transformer for the output - which is present in more expensive models of active DI's).
I think we would start going of topic by mentioning the trouble of impedance on guitars but the internet is full of it. There's a great debacle on true bypass switches for pedals vs. buffers for the exact same reason.
Which leads me to the second point of not using line in. Not only you will warp the sound of your guitar pickups (which can go easily up to a grand) if you don't have buffers on your pedals and other effects you will change these too! say you spent a while dialing in a nice distortion an applying a filter on your delay line, or you calibrated the boost on your wha pedal - all gone!
Now, your amp. It's not uncommon that I have to be the mad surgeon and operate on the amp before being able to record. If you get yourself something with  valves for the amplifier st age (Something like a Marshall JCM800 and are recording some "clean" guitars for your rock album chances are you will want to drive the amp really really hard for that valve headroom slight distortion) things will rattle. Take the pegs off, other screws that are loose. If the leather cover is loose, it will also rattle. If your amp has a reverb tank (spring) you will want to decouple it and pad it somehow. I think you are getting the drift - the sound has to be clean at the source.
Now, it's not uncommon that you'll have several microphones on your cab. Say, dynamic and condenser, ribbon close by and condenser far back. I think the trick here is to consider the microphone dampening factor - this will act as a natural compression as well. For instance, the U87 is going to be much lazier than a royer ribbon, so you will probably have more of the transient coming through, hence more clarity per note. It is very important that your notes still have a nice, defined attack, specially if you are trying to cut through distortion.
When you get two or more microphones together, you should be aiming at combining them to take best part of each. Say you like that transient response of the Royer, but you feel like bottom end - a nice condenser capacitor could probably do the job - just slide it in until you are happy.
IF you have a good passive or active DI, you will have a line out and a through put. The line out feed it to your DAW (Logic isn't it?) just in case. You can always reamp it later) the through put to your amp. This is an unchanged copy of your signal - it has probably just gone through a resistor series network to get a duplicate.
Something else to consider would be mic placement in the room and in front of the cone:

A microphone directly in front of the cone will have harsh, bright tones, but also more defined transients. Ribbons that actually have a LPF slope are a good help on this, but most of the time the polar pattern of a microphone can be your friend - twist your microphone around a bit.
A microphone on the side of the cone will be much mellow-er.
A microphone place more inside the room will benefit from the room characteristic. Reverb is a natural form of amplification and equalization (by adding to the source with each reflection it gets). But it will be more washed out and defined. But you might find the microphone right at the cone as being to agressive, so maybe a mix between both is in order.

If I'm under pressure and have to get a sound quick in 15 minutes I'll get someone to just get me a DI, a C414 and a 57. Seriously, I hate to say I have a recipe, I would very much prefer a database of I tried that, didn't like that, but sometimes time is a factor, specially when renting microphones, renting a studio, having a session musician in, etc.
Also, when you DI, you have a dilemma - DI before or after the pedals! you might need to DI After the pedals to cover some more exotic effects that you might not have access to at a later stage.
And, gates can also have a nice effect on it. Have a look at this
Answer: You really should start with a good recorded signal - so consider getting a suitable amp or working on the tone before futzing around in the computer.  If you have the mic right up on the grill of the cab, you'll be getting extra bass, so pull it back a bit and you'll get a little more treble in the signal.  Moving the microphone left and right will also change eq of the signal depending on where it is on the speaker cone.
I'd recommend cutting low mids a bit and boosting above 500hz to add some brightness.  The amp simulator in Logic 9 is pretty nice and can radically change a tone - not sure if that comes in express now.
Comment: "so pull it back a bit and you'll get a little more treble in the signal" not exactly true. Proximity effect will depend on the type of microphone and polar pattern. You might also pull it back and end up in a stationary wave reinforcement point, whilst your cab is in a null point.
Comment: I think you just missed the sarcasm!
Comment: I assume every poster is using a sm57 in a perfectly tuned space, so my statement IS exactly true ;)
Comment: "perfectly tuned space"? That would require some advance thinking when building the room - golden ratio for proportions, no paralel walls, and even then probably having to use some (more or less clever) form of diffusion. Unless you are trying to dry the room out of the offending frequency for that particular node - with a material with absorption coeficient of 1 for that frequency range, at least 1/4 of the wavelength you are considering. I really don't think users that would mic a cab only with a 57 would consider this much (no offense intended :)
Comment: y I believe so :)
Answer: Line in of course. That will be the most clear.
The problem is it will also be the most clean, which is probably not what you are after.
In any case, when I record electric guitar, I usually have the guitar going into a mixer from where I can record the clean signal and send the signal to the guitarist's rig. That way he (it's usually a guy) can play how he feels best. I also record that signal as well for reference. Then I use FX prcessors to tweak the clean signal exactly how it fits well into the mix and represents the sound the guitarist/band wants.
That being said, I'm not very into a grungy sound. However, if you are, feel free to re-mic the clean signal if you want to get some cab/mic distortion. Make sure you are comfortable trashing your mic. It will sound really dirty then. ;)
The advantage this has is you can re-mic it as many times as you need without the guitarist. He won't have to play it over and over until you figured out the perfect sound.
Comment: You put the guitar through a DI before going through line in, right?
Comment: Well, yes of course, if it's really "line" level in and not an instrument input. I would have thought he knew that. Though, I probably assumed wrong. I see you've covered the topic quite well in your answer.


How do I get past the lasers?

Question: In Detroit, there is a storage area behind a level 5 security lock.  Inside is a set of lasers guarding what looks like a bunch of stuff.  If I trigger the lasers, it sets off a deadly gas that will kill me within a few seconds.  How do I get past this part?
Answer: The switch is to your right. The keycode can be found the safe in Seurat's apartment, up the opposite fire escape.
If you like, the codes are:

 1904 (door)
 6542 (laser)

You can find a list of codes here.
Comment: Good answer but...use codes instead of hacking? You lose all that juicy experience!
Comment: @jprete Which bugs me to no end, since you're essentially rewarded for sneaking around in the airducts, then going BACK to knock everyone out, finding all the codes and passwords, then rewarded for hacking the machines instead of using the codes.  Silly game designers and their rewards for extra (unnecessary) effort.
Answer: Right behind those green barrels on the inside is the keypad for controlling the lasers.
Comment: as soon as I try to hack that keypad the gas is triggered, is this a bug?
Comment: I think it is a bug. I was able to get past it without getting gassed during my first visit to Detroit, but on the second (returning from another city-hub) it seemed bugged. If you have Praxis in cloaking, you can use cloaking to jump past the beams. You can also use an upgrade to be immune to gas.
Answer: There is just enough room to access the panel without hitting the laser if you stay right at the wall; either move the barrels or jump on them.
Otherwise:
Cloak and move heavy to get to the valve.
Rebreather so the gas doesn't bother you.

How do I get past the lasers?


How do you match even numbers of letter or odd numbers of letter using regexp for mysql

Question: Does anyone know how to match even numbers and odd numbers of letter using regexp in mysql? i need to match like a even number of A's followed by an odd number of G's and then at least one TC? For example: acgtccAAAAGGGTCatg would match up. It's something for dna sequencing
Answer: An even number of A's can be expressed as (AA)+ (one or more instance of AA; so it'll match AA, AAAA, AAAAAA...). An odd number of Gs can be expressed as G(GG)* (one G followed by zero or more instances of GG, so that'll match G, GGG, GGGGG...).
Put that together and you've got:
/(AA)+G(GG)*TC/

However, since regex engines will try to match as much as possible, this expression will actually match a substring of AAAGGGTC (ie. AAGGGTC)! In order to prevent that, you could use a negative lookbehind to ensure that the character before the first A isn't another A:
/(?<!A)(AA)+G(GG)*TC/

...except that MySQL doesn't support lookarounds in their regexes.
What you can do instead is specify that the pattern either starts at the beginning of the string (anchored by ^), or is preceded by a character that's not A:
/(^|[^A])(AA)+G(GG)*TC/

But note that with this pattern an extra character will be captured if the pattern isn't found at the start of the string so you'll have to chop of the first character if it's not an A.
Comment: 0 is an even number
Answer: You can maybe try something like (AA)*(GG)*GTC
I think that would do the trick. Don't know if there's a special syntax for mysql though
Comment: didn't work for me as i did something like this to test it out if it would return false for me
Comment: select 'AAAAAGGGGGTCA' regexp '(AA)*(GG)*G';


Is an SSL VPN instead of a normal VPN a good idea?

Question: I'd like to reach some webservices on my home microserver when I am not at home. Since I don't want to reach other services like SMB, SSH, etc. I thought it might be better to use SSL VPN with a self-signed cert I would add to my client computers manually before using the webservices. Afaik. there are SSL security testers like comodo, so it will be much easier to check whether the VPN is secure or I need to update something. Is it true that if somebody manages to hack it, then they can access only the webservices but not the whole local network like by hacking a normal VPN server? Are there any advantages / disadvantages I did not mention?
Comment: If somebody can hack a SSL encapsulated VPN, then what prevents them to hack an actual SSL connection? It's not about security. VPN over TLS is an obfuscation technique to hide VPN traffic from ISP's DPI.
Comment: SSL VPN is a vague term which encompasses a variety of technologies (see [wikipedia](https://de.wikipedia.org/wiki/SSL-VPN) for more). Similar VPN also encompasses various technologies. Thus, it is unclear what you exactly mean with SSL VPN and what you mean with "normal" VPN. Which also means that it is not really possible to answer the question since it is unclear what exactly you are talking about.
Comment: @defalt What's your point? VPN is about reaching a local network through the internet securely.
Comment: @SteffenUllrich I think the difference is that a normal VPN uses IPSec and an SSL VPN uses SSL. On client side you can connect to an SSL VPN with a browser, so you don't need a dedicated VPN client app. I am far from being an expert in the topic though.
Comment: @inf3rno: it might actually useful to know the common meaning of the terms you are using in the question before asking a question. *"...connect to an SSL VPN with a browser, so you don't need a dedicated VPN client app..."* - this is only true for "VPN" where you can only access web applications. These are not considered a true VPN since it does not provide network level connectivity (note that the N in VPN stands for network). SSL based real VPN need a specific client - contrary to some "normal" VPN where the client is already build into the OS.
Comment: @SteffenUllrich I wrote in my question that I need to access only webservices on a single server...
Answer: In general I don't understand why you want a VPN if you only want to access web services anyway. I mean if you don't want to access the local network why use a VPN? Just use a reverse proxy and htaccess, like this example.
Trying to answer the question:
Maybe you can add more information about what exactly you mean by SSL VPN and normal VPN. Using this SSL VPN definition the answer is probably not necessarily.
According to that website:

SSL VPN delivers the following three modes of SSL VPN access:
•Clientless—Clientless mode provides secure access to private web
  resources and will provide access to web content. This mode is useful
  for accessing most content that you would expect to access in a web
  browser, such as Internet access, databases, and online tools that
  employ a web interface.
•Thin Client (port-forwarding Java applet)—Thin client mode extends
  the capability of the cryptographic functions of the web browser to
  enable remote access to TCP-based applications such as Post Office
  Protocol version 3 (POP3), Simple Mail Transfer Protocol (SMTP),
  Internet Message Access protocol (IMAP), Telnet, and Secure Shell
  (SSH).
•Tunnel Mode—Full tunnel client mode offers extensive application
  support through its dynamically downloaded Cisco AnyConnect VPN Client
  (next-generation SSL VPN Client) for SSL VPN. Full tunnel client mode
  delivers a lightweight, centrally configured and easy-to-support SSL
  VPN tunneling client that provides network layer access to virtually
  any application.

But this only defines the access mode, so what the client does to access the VPN not what the VPN supports. So, it would depend on if your VPN server allows you to allow clientless mode only.
Comment: I wanted to do more than just webservices that's why I thought a VPN would be a good solution. Good point.
Comment: Hmm probably a VPN would be another layer of defense. But I think doing it with SSL would be a mistake because that uses the same encryption as HTTPS. Thanks for your answer!
Answer: First, as @Elias already said, you don't need to use a VPN for this case at all, no matter if "normal VPN" (whatever this is) or "SSL VPN" (no matter what of the several SSL VPN technologies you actually mean).
But, to get to the second part of your question:

Is it true that if somebody manages to hack it, then they can access only the webservices but not the whole local network like by hacking a normal VPN server?

The impact of hacking your specific web service is not clear. But hacking web applications often results in the ability to executing attacker controlled code at the server. This usually also means that the attacker now can access other systems reachable by the system running the web service and/or that the attacker might use privilege escalation attacks to gain administrative access to the system.
In summary: restricting the access by using a SSL VPN or port forwarding is not magically more secure compared to using a "normal VPN". But the attack vector differs.


What are the common abbreviation for minimum in equations?

Question: I'm searching for some symbol representing minimum that is commonly used in math equations.
Comment: @awesomeguy I assume it is the same as the difference between the operation **+** and a theoretical function **plus(x,y)**.
Comment: Wait - what's wrong with 'min'?
Answer: If you are looking for a symbol (and for some reason want to avoid the clear, and much more common notation "$\text{min}$"), I believe that some people use $\wedge$ -  see here.
Comment: Indeed, $\wedge$ is a common abbreviation for min, and similarly $\vee$ for max. Especially, it seems, in probability theory. For example, in stochastic processes, a process $X_t$ stopped at a time $T$ is often written as $X^T_t\equiv X_{t\wedge T}$. Using $\vee$ and $\wedge$ is less cumbersome that max/min, especially in subscripts and superscripts.
Answer: The choice of symbol, depends mainly on the mathematics, physics, or programming discipline the equation is used in.
Merrian-Webster defines minimum as "the least quantity assignable, admissible, or possible."
For ordering, minimum means 'less than or equal to', which
is symbolized in some/many mathematics disciplines as ≤.
List A = [1 0 1 0], List B = [1 1 0 0];  List (A[i]≤B[j] = [1 0 0 0].
For Boolean algebras, just multiply the two lists to generate the minimums:
List (A[i]*[j] = [1 0 0 0].  For Boolean Algebra * is a 'minimum' operator,
whereas + is a 'maximum' operator.
But, as mentioned above,  'min' is OK, as most programming languages
use some variant of min(). but C does not. Program comments would use either
'min' or '<=, both easy ASCII typing.
Stochastic processes use ∧ for minimum; however mathematical logic uses ∧
to mean logical conjunction or AND.


adobe illustrator line enhancer

Question: I am Greg.  I am trying to find out if Adobe illustrator, or any other software will do the following:  I have a pencil hard-copy drawing, and I want to scan it into the software then I want to program to change all my pencil lines the same width and the same darkness for me, but otherwise make no changes to my drawing.  Does anyone know if Adobe, or any other company,has a design-editing program that can do this?  And if they do, what is the software called and what are the commands the user needs to make it happen? Understand I do NOT want to perform any new drawing while I'm in the program to achieve the above goal, just leave the lines where they were on the virtual page and have the software change my lines in the fashion outlined above. Thankyou!  -Greg.
Comment: I think you're asking too much. Draw **in** software, even with something like an IPAd where paths are dynamic from the start. The scanning/tracing is most likely **never** going to yield 100% 1:1 results without "additional" drawing in whatever software is used. Scanning/tracing is an "as good as it gets" process, but it's never 100% accurate.
Comment: Illustrator has an Image Trace feature- you will need to play with the settings to try and get the results you want and there are several criteria you can define. You can also check the box to create strokes and then select them all and make them the same stroke weight and/ or color. Without seeing your artwork it is hard to say how successful you will be. Another approach would be to use your artwork as a template layer and draw your stokes manually over it- you would have much better control.
Comment: If you want to have it done properly, then it needs to be done properly. The tracing option is very sensitive to the quality of your digitisation process. Some take the view that time is better spent on manually tracing he image in first place than to waste time of preprocessing it for autotracing, some do half and half. But it really depends on the quality of your image.
Answer: What you are describing sounds like centreline auto tracing.
Illustrator CC does have such a function, however it only works with fairly clean line drawings that are simple and have no shading or stray lines. Also tracing is not perfect and may require further editing.  You may have to edit the scan in Photoshop to clean it up a bit, and also increase the contrast a bit using a curves adjustment.
Anyway, in Illustrator import the scan, and hit the Image Trace button. Open up the image trace dialog. Hit the Outline button, increase the threshold until you get the desired result.

You can then Expand the trace, and adjust the stroke width

For those that don't have access to Illustrator CC, the Open Source free vector image editor Inkscape also has similar centreline auto tracing.

adobe illustrator line enhancer


Example of the time-independent Schrödinger equation having a complex solution?

Question: We know $\Psi(x,t)$ is complex, but can $\Psi(x)$ be complex? I have seen particle in a box, well and harmonic oscillator. All have real solutions for time-independent Schrödinger equation. Hence, I am curious to know examples where it is complex. This question says that it is possible, hence my request is for examples and references.
Answer:
Rajesh: That means time independent Schrodinger equation does not demand complex numbers if one chooses to avoid them. right?

NOTE: This answer is sort of cheating due to the degeneracy, and thus doesn't really answer the OP's question. Hopefully someone with better knowledge can answer Rajesh's answer with real rigor.
Here's an example of a physical system which admits eigenstates which are nontrivially complex-valued. In molecular physics in the limit of the separability of vibrational motion from the other degrees of freedom, polyatomics with doubly-degenerate vibrational eigenbases have stationary states which can be represented via their occupation numbers in $\nu$ and $l$, the total vibrational quantum number and the vibrational angular momentum quantum number, respectively.
In polar coordinates with radius $\rho$ and angle $\theta$, the stationary states of $H$ are given via their expansion in terms of the generating function
$$G=\pi^{-1/2}\rho^{1/2}\mbox{exp}\left[-\frac{1}{2}\rho^2+\frac{1}{\sqrt{2}}\rho e^{i\theta }su+\frac{1}{\sqrt{2}}\rho e^{-i\theta}s u^{-1}-\frac{1}{2}s^2\right]$$
$$=\sum_{\nu,l}\frac{\left<\rho,\theta|\nu,l\right>s^\nu u^l}{\left\{2^\nu[\frac{1}{2}(\nu+l)]![\frac{1}{2}(\nu-l)]!\right\}^{1/2}}$$
where $l\in\{-\nu,-\nu+2,...,\nu-2,\nu\}$.
For example, here is a complex plot of the function $|\nu=3,l=1\rangle$ state:

Here is a plot of the $|\nu=6,l=0\rangle$ state:

And here is a plot of the $|\nu=7,l=3\rangle$ state:

The plots are generated in a Hue colorspace, with the brightness proportional to amplitude, and color cyclically coded according to phase angle in the complex plane.
With the exception of zero vibrational angular momentum states, it is visually apparent that none of the wavefunctions can be represented as a real function multiplied by a phase factor $e^{i\alpha}$. Hopefully you find this sufficient as an example where a system has stationary states which are non-trivially complex-valued. I'm sure there are lots of other examples of cases where the time-independent Schrodinger equation has eigenbases which are nontrivially complex-valued, but this is the first example which came to mind.
Comment: Not that it's worth changing here but I leave this comment any time I see pictures like this -- choose different color maps! If it has red and green in it, particularly close together, those of us who are color-blind have a really tough time with it. Spectrum, rainbow, etc are all poor choices for displaying most data, despite them being the default in most viz. software! Single color changes, saturation changes, and so on make better color maps for everybody, but especially those who are color-blind. Just some friendly advice :)
Comment: Yeah, they are complex-valued... too bad they are also degenerate. You can choose such linear combinations of them (e.g. $\left|+m\right>+\left|-m\right>$ where $m$ is magnetic quantum number) which will become real and still remain eigenstates. Of course, they won't have some observables (like $L_z$) definite, but they will have others.
Comment: @Ruslan: Haha, yeah I figured somebody would point that out. Still though, that leaves the OP's question a bit unanswered, ie, whether non-degeneracy implies that the wavefunction can be represented as a real function times a constant factor. I'm curious if there's a theorem which supports or negates this.
Answer: A charged particle in external magnetic field has the following Hamiltonian:
$$\hat H=\frac1{2m}\left(\hat{\vec p}-q\vec A\right)^2+qV,$$
where $\vec A$ is vector potential, $V$ is scalar potential and $\hat{\vec p}=-i\hbar\nabla$ is momentum operator.
If you set $\vec A\not=0$, you'll get non-trivially complex wavefunction, and there will be no degeneracy due to time inversion symmetry as is the case for usual running wave, because magnetic field breaks time-inversion symmetry.
Comment: Right, but this time it's not arbitrary. It's a phase which depends on spatial coordinate. You can't just simply multiply the solution by phase coefficient or take linear combination of some eigenstates to form a real wavefunction which would also be eigenfunction. Thus this complexity does have physical significance, and you can't avoid it.
Comment: Equation 6 in http://arxiv.org/ftp/arxiv/papers/0712/0712.4201.pdf gives the solution in 2-d polar cordinates. It is complex in the sense there is an $e^{il\theta}$ factor which is a complex sinusoid.
Answer: Before starting, let me be pedantic and define the phrase "real up to an overall phase." I will say a function $f(x)$ is real up to an overall phase if I can find a real number $\alpha$ such that $e^{i\alpha}f(x)$ is real everywhere. [Incidentally, note that if a wave function is real up to an overall phase, it is also imaginary up to an overall phase].
Now that we've established that terminology, I claim that the question of whether or not the wave function is real up to a phase must be considered in two cases:

If the energy eigenfunction $\Psi(x)$ is associated with a non-degenerate energy eigenvalue will be real up to an overall phase.
If the energy eigenfunction $\Psi(x)$ is living in the energy eigenspace associated with a degenerate energy eigenvalue will generically be complex. While there will always be special eigenfunctions living in this space that are real up to an overall phase, the general eigenfunction is complex and you cannot restrict yourself to the "real subspace" without losing the ability to describe some physical systems.

The examples you gave (particle in a box, harmonic oscillator) fall under case 1: there are no degenerate energy levels, so the eigenfunctions are real up to an overall phase. However I can easily give you physical examples that fall under case 2 (and I will later, and DumpsterDoofus and DarenW have already done so).
Before going into some gory detail, I should just say that whether or not the wave function is real up to an overall phase is sort of irrelevant, physically speaking. You should think of the wave function as being a complex valued quantity. For example, if the state is a momentum eigenfunction--which is the case in particle accelerators, which measure the momenta of particles very precisely--then the wave function is complex $e^{ipx}$ and is certainly not real up to an overall phase. In certain cases it happens to turn out that the wave function is real up to an overall phase, but this is frankly something of a mathematical accident and doesn't have any interesting physical consequences. You certainly should not make the leap from "there exist wave functions that are real up to an overall phase" to "all physical situations can be described by a wave function that is real up to an overall phase."

With that said, let's discuss case 1. We are looking for eigenfunctions $\psi(x)$ that obey the energy eigenvalue equation [working in the position representation]
\begin{equation}
\hat{H}\psi=E\psi
\end{equation}
where $\hat{H}=-\frac{\hbar^2}{2m}\nabla^2+V(x)$ is the Hamiltonian operator.
Since the Hamiltonian must be a hermitian operator, we have that $(\hat{H}f)^*=\hat{H}f^*$ for any function $f(x)$. Meanwhile, $E=E^*$ since $\hat{H}$ is hermitian so it has real eigenvalues.
As a result, $\psi^*(x)$ is also an eigenfunction of $\hat{H}$ with eigenvalue $E$.
However, we are assuming that the energy eigenvalue $E$ is non-degenerate. In other words, there is only one eigenfunction with eigenvalue $E$, up to an overall factor. So it must be that there is some $\lambda$ such that
\begin{equation}
\psi(x)=\lambda \psi^*(x)
\end{equation}
Clearly this equation is only consistent if $|\lambda|=1$, so we may write $\lambda=e^{-2 i\alpha}$ for a real $\alpha$ without any loss of generality. But then $\psi(x)$ is real up to an overall phase, because $\phi(x)=e^{i\alpha}\psi(x)$ obeys $\phi(x)=\phi^*(x)$.
That establishes case 1.
Before going on to case 2 it is interesting to see why the particle in a box falls under this case.
The hamiltonian for a particle in a box is the same as the hamiltonian for a free particle
\begin{equation}
\hat{H}=-\frac{\hbar^2}{2m}\frac{d^2}{dx^2},
\end{equation}
with the boundary conditions
\begin{equation}
\psi(0)=\psi(L)=0.
\end{equation}
Since the hamiltonian is the same as for a free particle the eigenfunction must have the form
\begin{equation}
\psi(x)=Ae^{ikx}+Be^{-ikx}
\end{equation}
where $A$ and $B$ are complex coefficients. You can see that the general solution is not real up to an overall phase! This is because there are TWO solutions with energy $E$: one is $e^{ikx}$ and the other is $e^{-ikx}$. It is only after we impose the "particle in a box" boundary conditions that we find that the eigenfunction must have the form $\psi(x)=N\sin\left(\frac{\sqrt{2mE}}{\hbar}x\right)$. The boundary conditions essentially "project out" one of the two eigenfunctions with the energy level $E$. We are left with one linearly independent solution that can satisfy the boundary conditions, and by the general argument I gave above this eigenfunction has to be real. (And indeed, explicit calculation shows it is--it is the sine function). If you want me to go into more detail about this part, I would be happy to update the answer to be more precise.
The 1D harmonic oscillator is slightly different. There are two solutions for a given energy eigenvalue $E$. However only one will be normalizable. So for each energy level $E$ there is only 1 energy eigenfunction, and thus this eigenfunction is real up to an overall phase.

OK, case 2. It is easy to see that in general a member of a degenerate eigenspace won't be real. $\psi(x)$ and $\psi^*(x)$ are still both solutions since $\hat{H}$ is hermitian. However there is no reason that $\psi(x)=\lambda\psi^*(x)$.
Even more to the point, since the energy eigenspace is degenerate it means that there are at least two distinct, orthogonal eigenfunctions $\psi(x), \phi(x)$ that have the same energy $E$. Any linear combination of them will also have the energy $E$. So it's very easy to construct a complex energy eigenfunction living in this subspace, even if $\psi$ and $\phi$ happen to be real: I just take $a \psi+b\phi$ with complex $a,b$.
On the other hand it's also easy to see that there are always special eigenfunctions in the eigenspace that are real. For example, $\psi(x)+\psi^*(x)$ is real.
It's useful to give an example. A good example is actually the particle in a periodic box. This is just like the particle in a box in that the Hamiltonian is the same as for a free particle. However, instead of imposing the boundary conditions $\psi(0)=\psi(L)=0$ we will impose the periodic boundary conditions
\begin{array}
\ \psi\left( 0 \right)&=&\psi \left( L \right) \\
\psi'\left(0\right)&=&\psi'\left(L\right)
\end{array}
where $\psi'(x)=d\psi/dx$.
These boundary conditions are appropriate in many situations, for example:

Electrons in a solid will experience periodic conditions because of the periodic nature of a crystal
In extra dimensional models where the extra dimension is compact, the wave function has to be periodic
If you work in polar coordinates in 2D or spherical coordinates in 3D, the angle $\theta$ will obey periodic boundary conditions

Starting with the general solution $\psi(x)=A e^{ikx}+Be^{-ikx}$, the boundary conditions amount to the single condition $e^{ikL}=1$, so $k=2\pi n/L$ (which quantizes the energy levels). Crucially, the boundary conditions do not impose any conditions on the coefficients $A$ and $B$. So it for any allowed energy level $E$, there are TWO allowed energy eigenfunctions. Thus in general, a state with energy $E$ is not real up to an overall phase.
There are two special states with energy $E$ that are real. They are
\begin{equation}
\psi_c(x)=\frac{1}{2}\left(e^{ikx}+e^{-ikx}\right)=\cos kx, \psi_s(x)=\frac{1}{2i}\left(e^{ikx}-e^{-ikx}\right)=\sin kx
\end{equation}
However there is no reason to think that nature will "prefer" these states over other possible states with the same energy with complex valued wave functions. If we set up a periodic particle in a box in the lab and fixed the energy to be $E$, in general we would get a state that wasn't $\psi_s$ or $\psi_c$.
As I said, there are many interesting examples that fall under case 2. Another one is the 2D harmonic oscillator, with $V(x,y)=m\omega^2(x^2+y^2)$. In general, as you go to dimensions greater than 1, the solvable problems tend to have degenerate eigenvalues. So even though you start off with examples that are of the form of case 1, you should expect to see many more examples in case 2 as you advance in quantum mechanics.
Comment: Thanks for the great answer. But point 2 being complex solution is still not a worry for me.
Comment: @Rajesh D Do you mind elaborating on what you mean? I don't mind expanding my answer. I think point 2 is very important. For example, all scattering problems fall under point 2. In scattering it is actually very important that the wave function is complex, and not just real up to a phase. A related statement is that it is very important to use the Feynman propagator, and not the usual retarded propagator, when doing scattering in quantum mechanics.
Comment: i fully agree that it has to be complex. I am working on ways to make $\psi(x)$ a real function all the time by tweaking the theory a bit. Crazy thing to do, but anyway its not relevant to mention here. sorry about that.
Comment: I see. It sounds like an interesting thing to try--even if you ultimately fail you will probably learn a lot. One thing you might find interesting if you haven't heard of it is the "wick rotation"--you use analytic continuation to deal with real quantities to do quantum calculations.
Answer: For example, you can start with any real solution and multiply it by a phase factor $\exp(i\alpha)$, where $\alpha$ is constant and real, but is not a multiple of $\pi$.
Comment: @RajeshD Yes, and that means that having strictly real solutions *also* has no physical significance and is preferred only because most people are more comfortable in $\mathbb{R}$ than in $\mathbb{C}$.
Comment: I'm still thinking about that.
Comment: but that has no physical significance!
Comment: @dmckee : That means time independent Schrodinger equation does not demand complex numbers if one chooses to avoid them. right?
Comment: @RajeshD : If you have some degeneracy for a energy $E_n$, you could have different and linearily independent real solutions $\psi_n^i$. Now, because of the linearity of QM, any complex linear combination of the $\psi_n^i$ is also a solution, for instance $\psi_n^1 +  i \psi_n^2$ is a complex solution.
Comment: @Trimok : thanks for the comment. But any linear combination is a solution and hence any complex linear combination..this again seems contrived!
Comment: @RajeshD You have chosen a simplified system and are wondering if you get simplified solutions. I believe that you do, but that is not interesting unless you can find simplified solutions to the *general* problem.
Comment: @dmckee : What are the physical situation for applying general problem, that was my first intention and would be a nice motivation
Comment: The time-dependent problem is the general one, and $\exp i \omega t$ type solutions falls out naturally as soon as you include time.
Comment: @RajeshD : Boundaries conditions may demand the complexity of the wave function, see [step potential](http://en.wikipedia.org/wiki/Solution_of_Schr%C3%B6dinger_equation_for_a_step_potential)
Comment: @dmckee : Ofcourse exp iwt appears multiplying $\Psi(x)$, but thats always there...by general means $t$ appearing implicit in $\Psi(x,t)$ and not just as a multiplying factor like $exp(j\omega t)$, I wonder is there any physical problem readily available which involves such a thing?
Comment: @dmckee: You said: "...that is not interesting unless you can find simplified solutions to the general problem." You may wish to look at my answer to http://physics.stackexchange.com/questions/32422/qm-without-complex-numbers , where I say that, in general, the Klein-Gordon equation (or the Dirac equation) is equivalent (via a gauge transform) to an equation for just one real function, and I give the references.
Comment: @akhmeteli Certainly not my area of specialty, but does not *"if some linear combination of electromagnetic fields does not vanish"* (from the abstract) mean that this is a different special condition and not fully general?
Comment: @dmckee: This condition just excludes a "non-transversal" (or "extremely rare") case. Furthermore, for any such exceptional electromagnetic field you can find an arbitrarily close non-exceptional electromagnetic field. To offer an analogy, I guess one can say that two linear algebraic equations in two unknowns generally have exactly one solution. While this is not "fully general", as the determinant can vanish, the exceptions are "extremely rare" in some sense.
Comment: @akhmeteli Interesting. I can see that a fourth order strictly real problem can be equivalent to second order complex problem in terms of degrees of freedom, and if it is effectively general then the next question to ask is *"Are there problem for which it is easier?"*.
Comment: @dmckee: I don't know... I suspect that such second order complex problem would involve both the complex function and its complex conjugate. Maybe in some special cases that would be easier, but I am not sure.
Comment: Sorry. The usual quantum mechanics was the second order complex problem. I was wondering when this 4th order system would be easier. Normal I run from high order problems, but I know that optics people are pretty good with them.
Comment: @dmckee: I wonder if there can be some misunderstanding here. We should compare apples to apples. We get the 4th order equation for one real function as an equivalent of the Dirac equation, which is a system of 4 first order equations for 4 complex functions. In case of the Klein-Gordon equation, which is a 2nd order equation for 1 complex function, we get as an equivalent a 2nd order equation for 1 real function.
Answer: In one dimension, a running wave, as eq. (2) in that question.  There isn't any more one can do in 1D that won't come out seeming contrived.
In two dimensions, a good example is a circular box, or any spherically symmetric potential.  The wavefunction can be written as a radial factor times an angular factor.  The angular factor may be a linear combination of $\sin(n\theta)$ and $\cos(n\theta)$ or, equivalently, of $\exp(i n \theta)$ and $\exp(-i n \theta)$.  The latter are nicer to deal with in terms of eigenvalues and angular momenta.  It's the same as in 3D, without 'z', so let's go there.
In three dimension, in atomic physics, the 'm' quantum number for orbitals.  You can have an electron in, for example, some mix of  $2p_x$, $2p_y$, and $2p_z$ orbitals, or you can use $2p_+$ $2p_-$ and $2p_z$, where $2p_\pm = 2p_x \pm i2p_y$. (likewise for n=3, 4, ... and similar combinations for the d, f ...)   The $\pm$ orbitals are better when dealing with magnetic fields, spin-orbit coupling, conservation of angular momentum in scattering, and so on.
Comment: I don't understand the later part. What is your answer? 2-d and 3-d demand complex $\Psi(x,y,z)$?


How can I save data on Mobile using Phonegap

Question: I'm working on a To-do list for Mobile using phone gap. I use sqlite to save the data, but when I close the simulator  & reopen it, the data is lost, so I'm wondering if it won't be lost when I put it on a real mobile, & is there a way to check the mobile database from the mobile itself.
Comment: Perhaps this [question](http://stackoverflow.com/questions/7750857/how-permanent-is-local-storage-on-android-and-ios) may help you.
Answer: Yes absolutely, when you close the simulator your database will remove (when u run the simulator from start, it will assume the application is a fresh one). If you want to check if your data is remain within the mobile when the application is closed. Press the home button and go back again.
Answer: Just to clarify - this actually depends upon which platform you're developing for; and whether the SDK provides a "simulator" or an "emulator".
Example:
Android Emulator - This is an emulator which means it emulates the device as a real device; like a virtual computer it's capable of saving it's data and state. The Android emulator is built upon QEMU - an emulation package akin to a simplistic version of VMWare. This is one reason why starting the Android Emulator is akin to starting an Android device with regards to how long it takes: it actually takes a while for Android to load, initialise and so on.
In contrast to the iPhone Simulator - this is just a simluator of what the device would do; it doesn't actually run iOS it just simulates the app running in such an environment. Hence it isn't capable of saving data, even if it is very fast in comparison with the Android Emulator.
This might not seem a big point - but in a production environment it really can be. If you're testing an application across multiple platforms then these differences can look as though the implementation for one platform can't save data; which ultimately leads to hours of debugging and reading just to find out it's to do with the SDK tools - not your code!


Connecting Java Applet with Database

Question: I've got a simple problem... I've got an Java applet running on my client machine which needs to communicate with a database at my end. I'm not sure how I go about it. There are numerous problems such as untrusted applet coming up. Please point me in the right direction.
Thanks in advance.
Answer: You don't want to give an applet direct access to your database, rather you want a layer of business logic in between to prevent abuse. This is known as an multitier, (aka n-tier) system. Most web apps are designed in 3 tiers:

Presentation (in your case the Java applet)
Logic (business logic handling authentication, authorization, request validation, detailed processing, etc)
Data (your trusty database)

Java applets can communicate with your server in many ways, but you'll find it easier to deal strictly with HTTP requests returning simple data structures (like JSON or simple XML, SOAP was designed to be simple but is often accepted to be anything but). This way clients can easily get through firewalls, and if you redesign your front end using flash or html5 in the future, you're back end won't need to change as much.
You'll need to decide what makes most sense for your Logic tier, as there are many options in many languages. To be consistent in language, Java servlets running on a web server (e.g. Tomcat) can provide your logic layer, and there are many tools (e.g. Spring and Guice as a framework, Hibernate and MyBatis for ORM) to make writing and maintaining servlets easier - each with their own learning curve that you'll need to decide if it has value to you.
Also don't forget to search here on StackOverflow for more explanation and alternatives - this is hardly a comprehensive answer, but hopefully a pointer in the right direction.

Connecting Java Applet with Database