How to formulate a PDE for diffusion between two different materials?

Question: Suppose I have two (connected) materials with different diffusion coefficients for which I am modelling diffusion. Consider the one dimensional case.  I am not sure what conditions to impose at the point where they are connected. Continuity of concentration makes sense. I am not sure what to impose in terms of the flux.
Answer: Perhaps counter to intuition, the concentration is not necessarily continuous. Materials tend to segregate impurities to different degrees, and Nature here requires that matter is conserved, not concentration. When formulating the equations, this means that no matter can disappear: the outgoing flux from the left side must equal the incoming flux from the right side.
Thus, for a small* amount of dissolved C near an interface between A and B, for example, we would have
$$J_C|_{0^-}=-D_{CA}\left.\frac{\partial C_C(x)}{\partial x}\right|_{0^-}=-D_{CB}\left.\frac{\partial C_C(x)}{\partial x}\right|_{0^+}=J_C|_{0^+},$$
where $J$ is the flux, $0^-$ and $0^+$ ($=0$) are respectively the left and right sides of the interface, $D$ is the diffusivity of C in the host material, and $C_C$ is the concentration of C.
At steady state, it may also be useful to work with a segregation coefficient $K$ that expresses the equilibrium concentration of C in B, say, given a certain concentration of C in A:
$$KC_C|_{0^-}=C_C|_{0^+}.$$
One could also work with the solubility coefficient $\sigma_{C}$ and permeability $P_{C}=D_{C}\sigma_{C}$; see, for instance, Crank's Mathematics of Diffusion.
Or, one can work with the chemical potential, a generalized version of concentration that incorporates interactions with the host environment. Matter moves to eliminate chemical potential gradients, so this is an example of a parameter that is equalized across an interface (at equilibrium).
*So that $D$ can be assumed to be constant and so that the interface itself doesn't move.
Comment: So the flux condition at the first equation is that flux is continuous at the boundary between AB
Comment: That's right. Flux continuity is always a good first condition to impose when you've got something mobile that can't be created or destroyed.


Recommended survey of mathematics

Question: What do you see as the most explanatory and beautiful survey of mathematics book...For short is there a book like Feynman lectures but for math?I've looked at Elementary Mathematics from an Advanced Standpoint by Klein and  Mathematics: Its Content, Methods and Meaning by A. D.Aleksandrov ,Kolmogorov and   Introductory Mathematics: Algebra and Analysis by   Geoffrey C. Smith:,which one did you read and recommend, any other suggestion,please?
Comment: Not short at all but there is The Princeton Companion to Mathematics.
Comment: I think that this question can be improved to be less opinion0-based. For example, it could ask for example of books that are widely regarded as well-written and beautiful. But asking people to argue for which particular book they think is the *most* explanatory and beautiful seems to rely too much on their personal taste.
Comment: Not beautiful?How?
Answer: There are some Soviet style mathematical survey books available. But I do not know what their American translations are. I admit in general it is difficult to find survey level books enjoyable to read while not bogging down the reader with technical details. There are some options availbe:

Try to read the Notice of AMS. It is freely available online, but mostly for a mathematical educated audience. You can also try to read American Mathematical Monthly.
One can try to find expository papers online explaining the idea behind a proof. In a lot of cases nowadays it happened to be in forums like mathoverflow and this site. Sometimes googling does not really help because no one has thought about referring this paper before; and you need to check the publication list or note list of the experts in the field. But this is very time consuming. I remember when I was an undergraduate I used to download whole Harvard math department homework database for personal review, for example.
One can try to read some introductory level books at a cheap price, especially the Dover series. Since you mentioned Kolmogorov, his other book with Fomin on real analysis is a classic that assumes almost no formal background. And there are numerous other ones available. For Klein, a good book I know is "Lectures on Mathematics". But it is not that easy to read.
I think nowadays blogging is surprisingly common among established mathematicans. So you can probably find contents from the sum of geometric series to real mathematical research online. I guess instead of reading "classics", knowing what is going on nowadays might help, especially to satiate your personal curiosity.
Comment: Of Soviet books, I particularly like Shafarevich's *Basic Notions of Algebra* from the Encyclopaedia of Mathematical Sciences.
Comment: Klein's 'Lectures' are a beautiful panorama of mathematics as seen from the end of the 19th century.
Answer: I think you find a mixed bag of things sprinkled here and there. For example:
History

The Math Book From Pythagoras to the 57th Dimension, 250 Milestones in the History of Mathematics by Pickover, Clifford A.
A History of Mathematics, Second Edition , Carl B. Boyer , Uta C. Merzbach , Isaac Asimov (Foreword)
A Concise History of Mathematics: Fourth Revised Edition, Dirk J. Struik

Topical Areas

Mathematical Thought from Ancient to Modern Times by Morris Kline
Hilbert by Constance Bowman Reid
Six Books of Euclid by Euclid
Hilbert-Courant by Constance Bowman Reid
Great Feuds in Mathematics: Ten of the Liveliest Disputes Ever by Hal Hellman
The Calculus Wars: Newton, Leibniz, and the Greatest Mathematical Clash of All Time by Jason Socrates Bardi
Prime Obsession: Bernhard Riemann and the Greatest Unsolved Problem in Mathematics by John Derbyshire
The History of Statistics: The Measurement of Uncertainty Before 1900 by Stephen M. Stigler
Episodes in the Mathematics of Medieval Islam by Lennart Berggren
Labyrinth of Thought: A History of Set Theory and Its Role in Modern Mathematics by Jóse Ferreirós

There are also specific biographies of mathematicians that are very good and show some of the correspondence between them and others.
Comment: Nice list, Amzoti! +1
Comment: Indeed, it's been a good day! Back at you!! ;-)
Answer: A really great survey of much of modern mathematics is Mathematics Form and Function by Saunders Mac Lane. The book gives the big picture on many topics and explains the interconnections between different mathematical fields. I think everyone with a serious interest in mathematics should eventually read it.
The reader should have some experience with abstract mathematics on the advanced undergraduate level though.
A more elementary, yet still demanding, text is  The Nature and Origins of Modern Mathematics: an Elementary Introduction by Andrew McLennan, which is (for now) available for free.
Answer: I've just borrowed Mathematics and Its History by John Stillwell from the library. The first couple of chapters are quite nice, and the table of contents suggests a broad coverage, if at undergraduate level.
Allow me to also second Mac Lane's Mathematics: Form and Function (not able to vote yet).

Recommended survey of mathematics


Having issues with .php files and the GAE

Question: I am trying to get a contact form to work on my GAE.  I have the app.yaml complete and it's working for everything bar the .php files it shows a No web page was found for the web address when you try to go onto the webpage.  The files are all in the correct directory.  I originally had the form as form.php but when deploying it showed: WARNING: The URL path "/form" is reserved and will not be matched. So I changed it contact.php, but it's still showing the same error.  Would you guys have any recommendations on what I should try?  The contact.php has the form in it and I also have contact_control.php to do form validation and send the email.
Thanks!
#service: default
service: test-landing
runtime: php55
api_version: 1
threadsafe: true

handlers:
- url: /
  static_files: www/index.html
  upload: www/index.html
  secure: always

- url: /(.+\.php)$
  script: assets/\1
  secure: always

- url: /home
  static_files: www/index.html
  upload: www/index.html
  secure: always

- url: /news
  static_files: www/news.html
  upload: www/news.html
  secure: always

- url: /terms
  static_files: www/terms.html
  upload: www/terms/news.html
  secure: always

- url: /privacy
  static_files: www/privacy.html
  upload: www/privacy.html
  secure: always

- url: /faq
  static_files: www/faq.html
  upload: www/faq.html
  secure: always

- url: /contact
  script: /contact.php
  secure: always
- url: /contact
  static_files: /contact.php
  upload: /contact.php
  secure: always

- url: /contact_control
  script: www/contact_control.php
  secure: always

- url: /(.*)
  static_files: www/\1
  upload: www/(.*)
  secure: always

Answer: It seems that you will need to configure your app.yaml to recognize and use the PHP files on your Google App Engine.
I would recommend you to take a look at the following documentation on how to configure your app.yaml to work with PHP.

Configuring your App with app.yaml
app.yaml Configuration File

Besides that, there is the following documentation, on how to configure your App Engine to work correctly with PHP, that I would recommend you to take a look - they are actually quickstart documentation, which seems to be the exact place where you are. :)

Quickstart for PHP in the App Engine Flexible Environment
Quickstart for PHP 7 in the App Engine Standard Environment

Let me know if the information helped you!


How Do I Defeat Yomi?

Question: What is a working strategy for defeating Yomi? Which paradigms should I be using, which monsters in my paradigm deck, and what is the overall flow of battle?
Answer: It's actually all a matter of surviving, you only need 3 paradigms really, and I only really used the 3rd one once. Have Noel and Serah both be Sabs and have a strong sentinel (Silver choc) for one paradigm and the other have Noel and Serah both be Syns and have a good medic (Green Choc or Flanitor) then when Yomi isn't in the aura stay with the Sab paradigm and keep casting everything you got on him, mainly poison (this is how you'll defeat him mainly) then when he retreats switch to the syn/med paradigm and cast buffs and heal. Just keep doing that til he succumbs to poison and wound. The third paradigm you may need is all sentinels and that's just for when he unleashes his special attack.
Comment: Poison strategy is the quickest and most reliable that I have found. The **only** change I would make is to make whichever Sab you're controlling spam Poison until it lands. Once that happens you should switch to the `RAV RAV COM` paradigm for a lot of additional damage.
Comment: I beat it with this strategy with 5 stars. Another thing I'd add is just when you have a fair amount of debuffs on him, switch to mystic towers (rav, rav, sen) and then get him staggered and deal a good amount of damage while still being protected by a sentinel. Also, I'd recommend having combat clinic for this battle too, didn't use it too much but it's still useful it's (med, med, sen).
Comment: This worked pretty well: I tossed in a *Delta Attack (RAV/COM/SEN)* paradigm once Poison landed, but towards the end of the battle, it was hard to do anything other than land the poison before having to switch to *Tortoise (SEN/SEN/SEN)* for his ultimate attack.
Comment: I'm not understanding why you're all saying poison him. Looking at Yomi's immunities, he's immune to every single debuff
Answer: Chichu is ideal for this fight because he has the ability to take away Yomi's buffs with his physical attack. It even works while Yomi's barrier is up. I just switch to SYN (Noel) SYN (Purple Chocobo) MED as soon as he puts up his barrier and quickly buff, then switch to RAV RAV COM (Chichu) before the barrier falls to remove his pesky Bravery and Faith. With all Yomi's buffs gone and your party fully buffed, I hardly ever need a SEN. To finish him I just RAV RAV COM until he staggers then COM COM COM to own him. Keep MED SEN MED just in case you need the extra healing. I've been farming Yomi for Trapezohedrons for a day or so and I can take him down in under 5 minutes with this strategy no problem. Still only 1 Trapezohedron after 50+ battles though :(
Answer: If your low in level's with around 4-5k HP i would stick with a good first fight pack, serah-SAB noel-SEN "monster"-MED. take serah as a leader for a while till you get poison on him "spam it like crazy", then after you have it on him go with serah-RAV noel-COM "monster"-SEN. after he puts up his shield stick with serah-MED noel-SYN "monster"-SYN. going with this you should have him down to half HP if not more, but the fights not over yet "i find that he uses his one move after he hits half HP" the move can kill your entire party with one hit later in the fight so to prevent this use serah-SEN noel-SEN "monster"-SEN so as soon as you see it pop up switch it as fast as you can. with this you should be able to kill him with in the time frame.
later in the game after you finish the main storyline i wouldn't even try to farm him till your players are maxed out "easy to do if you max out a green chocobo ASAP for the bonus cp ability" and if you have the good weapons for serah and noel "again easy to do with a maxed out chocobo in the races" after you met these you can fight him with semi-ease, ok for the start of the fight start in serah- SAB noel-SYN "monster"-MED or serah-SAB noel-SYN "monster"-SYN, then when you hit him with poison switch to serah-RAV noel-COM "monster"-SYN with this pack you can keep attacking him and keep up with the buffs as he takes them off you. then after he brings out his shield go to serah-MED noel-SYN "monster"-MED/SYN "ether works. he will use his special move later in the fight so to avoid having your whole party killed switch to serah-SEN noel-SEN "monster"-SEN. after a few mins you should ether kill him or poison should kill him.
important items to have.
"FIRST FIGHT"
serah- 4 Delicate Magician's Mark
noel- 4 Delicate Power Wristband
"POST-STORY"
serah- Durable Collector Catalog
noel- Ribbon
for each fight "first/post-story" i used all chocobos
SEN-silver chocobo
SYN-purple chocobo
MED-green chocobo
max out each and they will make a devastating party.
Comment: -1 Your answer needs proper formatting and punctuation.

How Do I Defeat Yomi?


In what frame of reference is time measured, just after the big bang?

Question: We often read about the expansion of the universe in the first seconds, or milliseconds after the big bang.  What frame of reference is used for these estimates of time?  If the entire universe was compacted that small, then gravitational time dilation would be huge and a millisecond of time would equate to much longer in our earth bound time frame.  What reference is used?
Comment: https://en.wikipedia.org/wiki/Cosmic_time
Comment: *If the entire universe was compacted that small, then gravitational time dilation* Gravitational time dilation isn't a well-defined thing in an arbitrarily chosen spacetime, and it is not a well-defined thing in a cosmological spacetime.
Comment: @G.Smith  From the wiki article you pointed to: Cosmic time t is a measure of time by a physical clock with zero peculiar velocity in the absence of matter over-/under-densities (to prevent time dilation due to relativistic effects or confusions caused by expansion of the universe).   So would this mean that cosmic time would flow faster than earth time, because it doesn't have any gravity or other dilating factors to slow it down?
Comment: @foolishmuse Yes, but not by much. The Earth core is only 2.5 years younger than its crust.
Answer: The argument goes as follows.
First we model the universe as isotropic and homogeneous on the largest scale (i.e. smooth and the same in all directions and locations). Next we define a global reference frame, it is the one in which the matter in the universe does not move. The field equation of general relativity then provides a differential equation relating time in this reference frame to the energy density of the matter. This is the time measure that is being referred to when people speak of 'so and so milliseconds after the Big Bang'.
To get a feeling for what this time means in physical terms, one must look at the physical processes going on. For example, you can think of the half-life of particles such as baryons (once they had been formed in large numbers). At earlier times it can be thought of as indicated by the frequencies of the de Broglie waves. I think even experts struggle to develop physical intuition about this; one learns to rely more and more on the equations themselves. But the mathematics of general relativity also provides a metric, which is basically a set of conversion factors between the comoving reference frame (time,distance) and the (time,distance) in an inertially moving frame at any given place. It so happens that the conversion factor for the time is 1 in this example!
Answer: I gues the same reference as of today's ignoring the time dilation it's how much space formation was taking up per second that is defined by the excitation of the caesium isotope. The possibility of the dilation to have been felt by an intelligent organism was no existent. The exited state of matter back then was in form of the pure fundamental forces that we know of today. Not even quarks existed. And the universe was completely homogeneous untill the moment preceding the inflation. Tiny ripples in the universe at this stage are believed to be the basis of large-scale structures that formed much later which gave rise to relativistic approach to the universe that we use now.
Comment: This doesn't make much sense.
Comment: I downvoted; not meaning to be discouraging but answers need to rise to a greater level of precision and clarity than this. I think that unless you have at least an undergraduate knowledge of cosmology and/or general relativity you will struggle to provide a helpful answer to this question.


Django: Difference between using server through manage.py and other servers like gunicorn etc. Which is better?

Question: I have been running my beginner Django projects with manage.py runserver.  I see suggestions to use gunicorn instead.  What is the difference ?
Comment: There's a huge warning in the docs saying don't use runserver for production
Comment: This is something you shouldn't put a lot of thought into now since you are very new. Get your project going then when you are ready to push it to live then focus on this. You can use Heroku and this would still allow you to easily deploy using your manage.py file. Best of luck to you.
Answer: nginx and gunicorn are probably the most popular configuration for production deployments. Before detailing why gunicorn is recommended over runserver, let's quickly clarify the difference between nginx and gunicorn, because both state that they are web servers.
NGINX should be your entrance point to the public, it's the server listening to port 80 (http) and 443 (https). Its main purpose is handling HTTP requests, that is applying redirects, HTTP Auth if required, managing TSL/SSL Certificates and - among other things - decides where your requests is finally going to. E.g. there maybe a node.js app living on localhost:3000 that awaits requests on/foo/api while gunicorn is waiting at localhost:8000 to serve your awesome app. This functionality of proxying incoming requests to so called upstream services (in this case node.js and gunicorn) is called reverse-proxy.
GUNICORN is a server that translates HTTP requests into Python. WSGI is one of the interfaces/implementations that does that (e.g., the text parts of http headers are transformed into key-value dicts).
Django's built-in development web server (what you get when you run manage.py runserver) provides that functionality also, but it targets a development environment (e.g., restart when the code changes), whereas Gunicorn targets production.
Gunicorn has many features that Django's built-in server is lacking:

gunicorn can spawn multiple worker processes to parallelize incoming requests to multiple CPU cores
gunicorn has better logging
gunicorn is generally optimized for speed
gunicorn can be
configured to fine grades depending on your setup
gunicorn is
actively designed and maintained with security in mind

There are web servers other than gunicorn, but gunicorn (inspired by ruby's unicorn) is very popular and easy to setup, and hence is not only a good starting point, but a professional solution that is used by large projects.
Comment: You should use runserver for development and gunicorn for production, that's unrelated to your skill level.
Comment: Offer some references/confirmation, e.g. on 'Gunicorn has many features that Django's built-in server is lacking'.
Comment: I use Gunicorn and Uvicorn for production and runserver for dev, but if I am using NGINX to serve the app to the public and then run `manage.py runserver` locally on the server which is then picked up by NGINX, is that still wrong (and I should keep gunicorn) or does it not matter since NGINX is handling the requests?
Comment: It is still wrong. Both are handling requests, just in different stages and ways and runserver should never be used in Production
Answer: manage.py runserver is only a development server, it is not meant for production under any circumstance.  You need to use something like Apache, uWSGI, NGINX or some other server to serve your django project once it's ready for deployment.
Comment: It would be nice to see more detailed answer with details *why*


How to debug Unity project with iOS simulator?

Question: As somebody said, the Unity project must be run on devices, but that is a lot of trouble. Is there any way to run a project in iOS's simulator?
Answer: Prerequisites:

Mac
XCode
Unity3D for Mac

Guide:

Go to Edit > Player settings > Inspector > iOS tab. Change the Target SDK to Simulator SDK then build the project again.

Open Build Settings and switch platform to iOS.
In the same window set Run XCode as Debug, check Development Build and Script Debugging.
Click Build and Run, choose a directory for iOS builds (for example, create a new directory named Build.iOS)
Build's a long process, take a break.

Unity3D documentation - Building your Unity game to an iOS device for testing.
Answer: It was supported until Unity3D 3.3. and iOS 4.??? But the current release 3.4 crashes. See this posting in Unity3D forum.
Anyway I find it easier to run the project in in editor player for debugging and do real testing on the device. Deploying to iPhone via XCode is always annoyingly slow. So I designed my code to distinguish at startup between device and player like
<code>if (Application.platform == RuntimePlatform.IPhonePlayer) {
    // do what ever you need
} else ...
</code>
Working with the abstract factory design pattern or singletons makes it pretty easy.


How to send large Messages to the WCF Services?

Question: I have one DataContract in the WCF service.In that it has one Array and i am setting that array in the Client code. If I set the array to more than 1000 thousand its throwing up an error saying BadRequest.
 System.ServiceModel.ProtocolException : The Remote server returned an unexpected response (400) Bad Request.
How to overcome this? I want to send more data to the service.
Answer: You can try to increase the size allowed for a message. You'll need to set both the service and the client endpoint to use the binding configuration.
<code>    <bindings>
        <netTcpBinding>
            <binding name="TcpBindingConfiguration" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
            </binding>
        </netTcpBinding>
    </bindings>
</code>
If the data you are trying to send cannot fit within the message size allowed by the above configuration, you'll need to look into ways to either send less data or do it in multiple requests.
You can see this question for related information.


Different Initial Q-Values in Q-Learning

Question: When working with Q-Learning, what is the difference between having a Q_0(a) with all values zero, random or optimistic?
Answer: In the long-run, tabular Q-learning converges toward the optimal regardless of initialization.
However, the speed of convergence may be affected, similarly to an n-armed bandit setting : http://incompleteideas.net/book/first/ebook/node21.html
For more on initialization in Q learning, I recommend "Potential-based shaping and Q-value initialization are equivalent" by Eric Wiewiora.


Upper bound for index $|G:H\cap K|$

Question: This question is already answered here prove that $H\cap K$ have finite index in G But I had written solution in another way.
Let $G$ be group and $H$ and $K$ be its subgroup with finite index then we have to show bounds for index of $H \cap K$ as $[a,b]\leq |G:H\cap K|\leq ab$ where $a=|G:H|$ and $b=|G:K|$
 $|G:H\cap K|=|G:H||H:H\cap K|=|G:K||K:H\cap K|$
As $a$ and $b$ both divide $|G:H\cap K|$, we have $[a,b]$ divide $|G:H\cap K|$ that is $[a,b]\leq |G:H\cap K|$
Now the only thing that remains is to show that $|G:H\cap K|\leq ab$

This can be simplied to show by $|G:H\cap K|=|G:H||H:H\cap K|\leq |G:H||G:K|$
That is $|H:H\cap K|\leq |G:K|$
That is coset of K in G are more than Coset of $H \cap K$ in H .But How to Prove that?
How to proceed further?
Any Help will be appreciated
Comment: If $h_1,h_2 \in H$ with $(H \cap K)h_1 \ne (H \cap K)h_2$, then $Kh_1 \ne Kh_2$, so $|H:H \cap K| \le |G:K|$.
Comment: You seem to have proved it. What is your question?
Comment: I am not able to write answer of last claim second last line
Comment: @DerekHolt . coset of K in G are more than Coset of $H \cap K in H .But How to Prove that?Sir Please Help me I am still Stuck
Comment: Thanks a Lot Sir Now I understand
Answer: Here is one way to do it.
Let $x_1H, \ldots, x_aH$ be all the distinct left cosets of $H$ in $G$, and $y_1K, \ldots, y_bK$ be all the distinct left cosets of $K$ in $G$.
To show that $|G: H\cap K|\leq ab$, it suffices to show that whenever we have $z_1, \ldots, z_{ab+1}\in G$, then $z_iH\cap K=z_jH\cap K$ for some $i\neq j$.
To see this, we have by the pigeonhole principle that some $z_{i_1}, \ldots, z_{i_{b+1}}$ are in the same left coset of $H$.
Renumbering these for convenience, we may say that $z_1, \ldots, z_{b+1}$ are in the same left coset of $H$.
Again, by the pigeonhole principle, some two of $z_1, \ldots, z_{b+1}$, say $z_i$ and $z_j$ with $i\neq j$, are in the same left coset of $K$.
So we have $z_i$ and $z_j$ are in the same left coset of $H$ and the same left coset of $K$.
Thus $z_j^{-1}z_i\in H\cap K$, and consequently we have $z_iH\cap K=z_j H\cap K$.
This finishes the proof.

Upper bound for index $|G:H\cap K|$


training neural nets for OCR

Question: we are trying to build an in house OCR system to extract alphanumeric strings from images (kindly note, most of our clients cant afford to send their data onto the cloud so it rules out any API from the googles and microsofts..and also tesseract is way too slow for our purpose ..we are talking 10's of users simultaneously uploading images .. tesseract, i guess was never designed to be used as such). We have already started using a CTC based approach to train on our data sets but there's a fundamental/conceptual issue. By definition, CTC finds a happy path to the most probable unit (in this case, a word) but alphanumeric strings by definition DO NOT have a pattern ! So i have a feeling CTC will not work for us. But juxtaposed to that is the multiclass classification approach (where we just predict every individual char) which has this big problem about how to split any image into specific characters before passing it to a CNN layer. We are a little clueless about the approach to be taken here. Any pointers will be heartily appreciated :)
Answer: CTC can also work with totally random text (and thus without any "word pattern").
I know that because I trained an OCR network with CTC loss on random text which was then able to read non random text (fortunately).
The CTC just sums the probabilities of the all the paths which are "compatible" with the target text (random or not).
The higher the sum of probas of "compatible" paths, the better the prediction.
If not done yet, you should read this very good article explaining the CTC loss.
Edit to clarify and answer questions asked in comments :

do u mean specifically alphanumeric strings ?
Yes I mean random string with any character, alpha or numeric, it does not matter (even Chinese or Arabic alphabet if you want).
it needs to have seen a lot of data with patterns to generalize weights for transition from C->A->T, correct ?
No, when you train on random text, the network is not using context of previous chars to predict current time step but it is still forced to predict each time step (slice of text) correctly because of the CTC loss. The CTC loss pushes the CNN to compute good features and the RNN to give good probabilities by character for all time steps.
In other words, even with random text, the CTC loss still pushes the network to predict each char correctly independently of the other chars of the text.
And actually a system trained on random text generalizes better on unseen words than a system trained on real words because the latter is biased toward words it has seen during training.
For example a system trained on random text with Latin alphabet could read English, French and German but a system trained only on English words won't work well to read another language with same alphabet.
how can we ever generalize A623BBCEF ??
Just because a network trained on random text learnt to read each char independently of other chars.
the output of such a RNN is a matrix containing character probabilities for each time-step" ..how do we calculate character probabilities ?
The RNN takes the feature map for the current time step and compute a "score vector" from it. Sigmoid activation is used to map the scores to probabilities (between 0 and 1).
In the end it is just a fully connected layer with as many units as characters with a sigmoid activation on each unit.
Comment: ..appreciate it and am glad the model worked for you :) .. kindly clarify - when u mean random text, do u mean specifically alphanumeric strings ? ..and yes, i have read the above blog and the original paper and its quite clear, technically, that to find the "happy path" (pg5 /8 in the paper) the algo needs to generalize the transitions from label a to label b / blank ..this clearly means it needs to have seen a lot of data with patterns to generalize weights for transition from C->A->T, correct ? how can we ever generalize A623BBCEF ?? both with best path as well as prefix decoding
Comment: sorry, just to add, i also read up on this https://repositum.tuwien.ac.at/obvutwoa/content/titleinfo/2774578 and it clearly mentions "If trained with the Connectionist Temporal Classification (CTC) loss function, the output of such a RNN is a matrix containing character probabilities for each time-step" ..how do we calculate character probabilities ? only by looking at lots of examples and then generalizing that if the previous 2 chars were "D" and "O" , "G" appears with 45% and "N" appears with 25% ..this can never happen for alphanumeric strings
Comment: I updated my post to answer your questions.
Comment: appreciate the patient response :)

training neural nets for OCR


MVCContrib grid - sorting and paging

Question: Every example I've run across demonstrating paging and sorting assume that the controller action that populates the grid does a getAll on the datasource.  However in my application I am calling a web service that performs a search based on some form criteria passed in.  When the pager or sort calls the action it sends nulls for all of the form data, thus breaking the result set that I originally had.
How do I implement paging and sorting without calling back to the web service again?
Answer: instead,you can save the search criteria in session variable

MVCContrib grid - sorting and paging


Fastest way to cook a baked potato?

Question: Baked potatoes are great as everyone knows but what is fastest way to cook them (obviously preserving the taste).
Normally I do about 10 minutes in the microwave and then in the oven till the top starts to crisp.
But is there a better way?
Comment: Flame thrower..
Answer: Grilling / broiling the potato after it comes out of the microwave is quicker than baking it and achieves the same crispy outside.
If you really prefer them baked though, you can speed this up by inserting a large metal skewer into the potato while it's in the oven
Comment: Sounds like a good idea. I will need to give it a go.
Comment: As far as "achieves the same crispy outside" idea, well, it would be a much nicer world if it did, but sadly it doesn't.  This is one of those occasions where "food+heat+time" actually does require time.
Answer: Microwave would be your best bet. Don't forget to poke holes in it first.
Here's a step by step instruction guide:
http://www.wikihow.com/Bake-a-Potato-in-the-Microwave
Comment: 1+ but I would add to put the potato under the grill in the oven for a while microwaving for a crispy skin
Answer: I am normally all about cooking things quickly, but in the case of baked potatoes, that's a mistake.  Even the standard recipes you can find don't cook them long enough.  Oil, salt, wrap in aluminum foil, and bake at 425F for two hours.  Yes.  Really.  You'll get a lovely taste (due to caramelization, dessication, etc.) that these microwave recipes can't manage.
Comment: I agree with a long cooking time for baked spuds. I prefer something like 180°C for 1.5 hours with no foil though. Just because you _can_ cook something quickly doesn't mean you _should_.
Comment: That's 220°C, two hours of that will incinerate them! You shouldn't cook anything at that temperature for anything more than a few minutes
Comment: Really, honestly, give it a try.  You end up with potatoes with crisp, dry skins, caramelized just under for about 1/8 inch, and a light, fluffy interior.  Oil and salt them first, but otherwise just trust. The standard recipes and temperatures undercook potatoes criminally.
Answer: Microwave is fastest. It doesn't match the tender skin you get from wrapped in foil and stuck on a grill, but it's convenient enough I still use it most of the time.
Answer: Microwave is by far the fastest way.
I only like to cook my baked potatoes in the microwave if the oven isn't free.
Answer: Pre-cooking in the microwave while the oven heats works well if you wrap the potato in a layer or two of plastic wrap just after washing it so that it is still damp.  I usually try to turn the potato over after 5 minutes to get even baking.
Comment: make sure to be very careful when removing the plastic wrap before placing in the regular oven - it will expand while in the microwave and then shrink as soon as you take it out.
Comment: plastic wrap?? ewww cancer ...
Comment: @user18780 Plastic wrap is microwave-safe if it says so on the box. See for example http://www.snopes.com/medical/toxins/cookplastic.asp.
Answer: I like to cook the potatoes in the microwave first, and then wrap them in foil and put them on the grill..  This is a great idea to insure that the potato is cooked all the way through and its a great trick if you wrap and have them ready for the grill "before" people come over to eat...
And to people saying cooking at high temps for that long is bad...  HA..  We used to throw potatoes right in the embers camping, dig them out a while later, and I have to admit it is the best potato in the world..  And its fun to find the one you missed the next day to see a shell of a potato without anything in the center of it..

Fastest way to cook a baked potato?


Differences between brushed and brushless motors - advantanges and disadvantages of each

Question: When buying a drone I have 2 options to consider: brushed and brushless motors. Are they much different from each other? Does one have advantages over the other?
Comment: If this question is going to be considered the canonical question about general differences between brushed and brushless motors (of which other such questions are a duplicate), we might want to edit its title to a more general one.
Answer: They are very different.
Brushed motors
Brushed motors are good for toy grade drones for a couple of reasons: they are cheaper and don't require ESCs, which would add extra cost and complexity.
Brushless motors
However, in almost every way brushless motors are better: they produce much more power, are more efficient, produce more torque and, my favourite part, they don't have physical brushes and so, unlike cheaper brushes motors which are only designed to run for a number of hours, brushless motors can take a lot of abuse and can last for years. Additionally, they are very water-resistant.
There are downsides: to a brushless motor - they require ESCs and, due to the torque, can do more damage in a crash.
For info on how each works, see my answer here: https://drones.stackexchange.com/a/87/50
Comment: I reformatted your answer, feel free to change it if you don't like it
Comment: @Daniil thanks - I like the formatting. I spotted where autocorrect changed something in my original post so have changed it back.
Comment: Specifically, BLDC motors have a higher power to weight/size ratio. Bigger DC motors are (of course) able to generate more power.
Comment: Additionally, brushed motors are typically found in toy grade quadcopters, because they are cheaper and do not last as long as brushless motors.
Answer: At first brushed are fine because they are cheap and easy to replace. The more you read about specs and tuning you will take interest in brushless. For example betaflight now has rpm filtering which allows the gyro to reduce interference based on the rpm of the motors. So above tinywhoops and toys you are going to be seeing brushless.


Generating separate "model" classes from a WCF service

Question: I'd like to be able to generate individual classes (one class per file) for each Data Contract or XML type in a WCF Web Service.
I've read the svcutil documentation, and unless I skimmed a little too fast, it doesn't look like the tool supports this behaviour.
The reason I want to do this is simple - I'm trying to isolate the service's "model" from the service itself.  There are several components that rely on types from the service, but don't care about the details of service-level operations such as loading/saving.  I don't like the fact that these components need to take on dependencies to the same assembly that contains all sorts of invocation and binding logic.
I know that svcutil (and the VS integration) can be configured to use pre-existing model classes in another assembly.  This is a chicken-and-egg problem though; I don't really want to have to write 50 classes by hand that are (at least for now) almost identical to the generated classes.  And of course I have to add all the DataContract attributes with namespaces and other WCF attributes... it's a pain.
My ultimate aim is to actually have a presentation/domain model that's completely independent of the service model, but I don't really have the cycles for that yet.  I think that generating a faux-model that can eventually be molded into a genuine presentation model would be a good, quick and easy way to start down this path.  After that, I can configure the service references to use the separately-generated proxy classes and begin fleshing out something more robust.
Can this be done?  Are there options for svcutil that will get it to generate one class per file?  Or is there another tool that can do it?
Answer: I am not aware of any tool that would support this at this time - I'd love to know about such a tool myself, if it exists!
If you have the cycles to attack this yourself, you could

grab the service's WSDL from a URL (or load it from a file)
parse out the XML classes defined in the embedded XML schema
use something like T4 templates or another mechanism to generate C# code from those XML schemas

It's definitely possible - and probably not even really all that hard - but who's got the time to do it?? :-)


Farm Solution Vs Sandbox solution

Question: Is there anyone here can explain for me, which is better to use, and why?. In my opinion Sandbox solution is using for site collection and farm solution using for the all web application. Is that true???
Answer: The reason for introduction of Sandboxed Solutions was giving ability to work on a partially trusted environment. Without disturbing the Farm Administrators, the Site Collection Admin can handle the deployment. This runs under a set of security policies said CAS Policies. Also with this Sandboxed solutions come under several limitations.
Here are some Considerations on choosing Sandboxed Solutions. Also here are some restrictions on it.
Even a farm solution can be managed to deploy to a particular site collection if needed and the control the sites where the features get activated. Now with SharePoint 2013 and Apps comming in Sandbox solutions are considered obsolete. Still not dead.

Farm Solution Vs Sandbox solution


Will my saves carry over if I purchase My Boy! Premium?

Question: I have the free version of the 'My Boy!' GBA emulator for Android. If I were to get the full version would I still be able to carry the saved game files from the free version to the full version? I'm using a Galaxy S4 if that makes a difference.
Answer: Your current (GBA Battery) saves will work in the premium version. Based on the site's FAQ, the saves are located in a the root folder of the ROM:

In-game save files are named as XXXX.sav, in the same directory as the game file is in.

This means that if your ROM is on "/storage/sdcard0/games", then the .sav (which is the battery save) would be in that same folder.
Note: The .SAV files that have been created may not work properly with any other emulator. As long as it's made by the same team, then your saves will appear like normal.
Comment: As we're talking about the same emulator just the 'Premium' version it's almost guaranteed that the save states are stored in exactly the same location and thus will be picked up automatically


Why is Jupiter so sharply defined?

Question: In photographs of Jupiter, the limb seems extremely definite. Being a gas giant, my naive self thinks that the atmosphere should have a more gradual cut off, creating a hazy effect similar to that on Titan. I am aware of Jupiter's immense size, so each pixel in the linked photograph is likely tens or hundreds of kilometers. Even so, wouldn't there be some small smudge? Does perhaps Jupiter's terrific gravity have any effect on the apparent edge of its atmosphere?
Answer: Your first inclination is correct.  It's a matter of scale.  Jupiter is HUGE.  I'll resist quoting Douglas Adams here, but the human brain just isn't equipped to deal with those sort of dimensions.  Add to that the distance from which that photograph was taken.  You are actually beyond the orbit of the moon Io in that picture, so scale will be even more set off than usual.
In looking at the specific photograph you posted, there may have been some post processing effects as well in terms of colour and clarity (due to some pixelation effects on the limb), although in this case I may have to claim some ignorance.  However, there have been experiments done where the Galileo probe actually watched a star as it passed the limb of Jupiter, and measured the atmospheric extent.  I can't find that exact experiment, but here is a UV shot that again appears pretty defined, until you realize the distances you are dealing with.

Image Source:  NASA

The images, which show the limb between 60.6 degrees and 62.2 degrees North latitude (planetographic) and near 295 degrees West longitude, were obtained on December 20, 1996 Universal Time. The spacecraft was about 1,561,000 km (21.8 Jovian radii) from the limb of Jupiter and the resolution is about 16 kilometers per picture element.

This picture does show some apparent haze, but I only have a few details on it (i.e. New Horizon's image courtesy NASA as posted on the Boston Globe).  I have no idea the wavelength or any other parameters.

So again, our scale of perspective is thrown off because of the huge size of the planet.
Comment: For more info, see Dr. Phil Plait's blog entry on this:  http://blogs.discovermagazine.com/badastronomy/2012/03/19/stunning-jupiter-and-io-picture-heres-the-scoop/  It's a photo mosaic.
Comment: I agree that the image that I posted was edited. For one thing, the phases of Jupiter and Io are different though their centers lie in about the same camera direction.
Comment: But it isn't just scale, there is a physical reason why the atmosphere height is small compared with the planet.
Answer: [Great answer, Larian. Just wanted to add a bit.]
Some graphs that didn't make the cut for this paper show the density of a self-gravitating sphere in hydrostatic equilibrium as a function of radius. A defining feature of the equations that determine the structure of a fluid sphere like Jupiter (or stars, white dwarfs, neutron stars, etc.) is that the pressure and density hold relatively steady for a while and then exhibit this crash to zero.
With the caveat that you have to be prepared to evaluate words like "thick," "thin," "fast," and "crash" on not-human scales, as Larian mentioned, the crash to zero pressure and density is quite fast in the sense that it happens within a very thin, uppermost layer of the sphere.
EDIT: Aha! But one of them made it into this paper. See figure 8, bold line.
Comment: Thanks. Looking through the paper I see lots of formulae with `r^2` but nothing that would suggest a sharp cutoff, such as `(r-n)^2` or the like. Where is there mention of a sharp cut off for the pressure and density at some specific `r`? Thanks for the reference, it does seem to address quite what I am asking about.
Answer: Irrespective of issues like image processing etc, you would expect the limb of Jupiter to look sharp because its larger radius, high gravity and low temperature mean that it has a very small atmospheric scale height compared with its radius.
We can make the very rough approximation of an isothermal atmosphere, in which the exponential scale height of the atmosphere would be
$$ h \sim \frac{k_B T}{\mu g}\, ,$$
where $g$ is the gravitational field, $\mu$ is the mean mass of a particle and $T$ is the temperature (in Kelvin).
i.e. The pressure/density of the atmosphere falls exponentially, with an e-folding height given by the above expression.
I suppose what matters when you look at a photo, is how this height compares with the radius of the planet.
$$ \frac{h}{R} \sim \frac{k_B T}{\mu g R}$$
Jupiter's atmosphere is roughly half the temperature of Earth's, it has 11 times the radius and 3 times the "surface" gravity. However $\mu$ is about ten times smaller (hydrogen vs nitrogen/oxygen). Overall that means $h/R$ for Jupiter is of order 5 times smaller than for Earth and so it will appear "sharper" than the limb of the Earth in equivalent pictures.
Putting in some numbers: $T \sim 130$ K, $g\sim 25$ m/s$^2$, $R\sim 7\times 10^7$ m and $\mu\sim 2m_u$, we get $h/R \sim 3\times 10^{-4}$.
Thus if your image of the whole planet is about 2000 pixels across, the atmospheric scale height is less than a pixel.

Why is Jupiter so sharply defined?


Electric fields and electric potentials in semiconductors

Question: The zener diode is heavilier doped than a normal diode , that is why its depletion region is smaller than the delpetion region of a normal diode and that is why the electric field is very strong.Zener diodes are able to undergo Zener breakdown by pulling charge carriers out of pairs of electrons(chemical bond between atoms).Why don't normal normal diodes do the same thing?Energy is required for a bond to be broken.Work is the transformation of energy from one kind to another and the transfer of energy from one object to another . Because the potentials of a zener diode and a normal diode are the same ,  the electric field of those two can produce the same work on an electron.
Answer: The reason for this is quantum tunneling . Because the depetion region is smaller electrons can "borrow" energy and overcome the barrier potential of the chemical bond.


Is it proper to express the answer to a fill-in-the-blank as 'blank-filling word'?

Question: I have come up with a term on my own to describe the word that fills a fill-in-the-blank. I have named it a 'blank-filling word'. Can this be used? Is it proper to use this? I understand that it isn't an established phrase yet. But, will other people get it when they come across it?
Comment: Can you provide an example of how you'd use it?  "I wrote a blank-filling word in the blank"?
Comment: Suppose, "I don't think that your blank-filling word is correct."
Answer: It depends whether the answer is opinion-based or if it is objectively correct/incorrect.
For example, if someone is completing an opinion-based survey, the "blank-filling word" might be described as a word that you feel best matches the prompt (or the sentence that contains the blank). However, if there is an objective correct or incorrect answer, the "blank-filling word" might simply be described as the correct answer.
These will change, of course, depending on whether the actual answer is a number, word, letter, etc.
Answer: It would be better to say fill-in-the-blank word.  For example:

Please don't just give me a fill-in-the-blank word.  I really want you to think about this sentence I'm trying to write, and come up with something well thought out.

Note, if you're just trying to talk about the word that goes in the blank, then just say "word."  (If a phrase was requested, then "phrase.")  For example:

I gave my students a fill-in-the-blank exercise today.  I have to tell you the word my charming older gentleman student chose.  I thought he had made it up but it turns out it is in the dictionary!


How can I differentiate between product creation and saving existing products?

Question: I want to create an observer that will execute some code when a new product is added. However, it seems that catalog_product_save_before, catalog_product_save_after and catalog_product_save_commit_after will all fire when an existing product is being saved. Is there an event that will fire exclusively for new products or alternatively a way to differentiate between an existing product being saved and a new one being created with the previously mentioned events?
Answer: For me the isObjectNew() was available in catalog_product_save_before, but was not available in catalog_product_save_after.  I simply created my own isNew variable in the Observer and set it to true in beforeSave and checked it in the afterSave methods.
<?php
class Some_Module_Model_Observer
{
    protected $isNew = false;
    public function beforeSave($observer)
    {
        $product = $observer->getEvent()->getProduct();
        if ($product->isObjectNew()) {
            $this->isNew = true;
        }
    }

    public function afterSave($observer)
    {
        $product = $observer->getEvent()->getProduct();
        if ($this->isNew) {
            /*Add Logic Here*/
        }
    }
}

Answer: You should be able to rely on $product->isObjectNew(), this gets set in _beforeSave before the event catalog_product_save_before is triggered. It essentially performs a check on whether $product->getId() has a value before save is called and persists that value for the life of the object within that request.
Comment: Thank you for your fast answer. This works fine for `catalog_product_save_before` but doesn't persist for the other events. Is this the only event where you can differentiate or can it be done with the others too?
Comment: Whilst I haven't actually tested it, since `Mage_Core_Model_Abstract::_beforeSave` calls `->isObjectNew(true)` which sets a protected property to true before triggering the `_save_before` event, the `_save_after` and `_save_commit_after` events passed the same instance should also return true for `$product->isObjectNew()`, since this favours the cache variable over `->getId()`.
Comment: @browndesk965 Did you ever get this to work outside of `catalog_product_save_before`?  `isObjectNew()` is true in `save_before`, but not in `save_after` every time I try.


Is it possible to execute a delete query on the default retention policy in influxdb?

Question: Influx database named "metrics" with two retention policy and assign one as default out of the two.
CREATE RETENTION POLICY basic ON "metrics" DURATION 2h  REPLICATION 1 SHARD DURATION 6m DEFAULT
CREATE RETENTION POLICY downsample ON "metrics" DURATION 60d  REPLICATION 1 SHARD DURATION 2h

There is also bunch of continuous queries runs at every 10 mins and downsample the data to write influx downsample retention policy tier. The entries available at the basic retention policy tier got cleared every 2h and downsample retention policy clears after 60 days.
Continuous query sample looks like this
CREATE CONTINUOUS QUERY "cq_reads" ON "metrics" BEGIN SELECT sum(reads) as reads INTO downsample.stats_io FROM "metrics".basic.stats_io GROUP BY time(10m),* END

metrics is the database name and stats_io is the measurement here.
I have memory constraint of specified GB allowed for influx in my product. At some point influx started to fail in scaling to hold 60 days data.
I am trying to clear oldest 10 mins data in basic retention policy after hitting my memory limits. The corresponding downsampled oldest 10 mins data are still need to be available at downsample retention policy.
Following command deletes last ten mins data in both basic and downsample retention policies.
delete stats_io where time>1609457374835790623 and time < 1609457374835790623 + 10m

I don't want to delete the downsampled data available at downsample retention policy. So tried to delete basic retention policy alone.
delete basic.stats_io where time>1609457374835790623 and time < 1609457374835790623 + 10m

unfortunately this query ends up in error and doesn't allow to delete based on retention policies.
ERR: error parsing query: found basic, expected FROM, WHERE at line 1, char 8

However select query works properly with specific retention policy. But delete doesn't work as the same way. Example: select query
select count(*) from basic.stats_io // Properly get the count for the measurement with specified retention policy

I am wondering why the delete doesn't support retention policy based deletes. Is it any other approach or queries exist to clear the default retention policy data alone ?
Any suggestions are much appreciated. Thanks!
Answer: I think you need to use the syntax delete FROM
delete FROM basic.stats_io where time>1609457374835790623 and time < 1609457374835790623 + 10m

More info here in DELETE documentation


Passing IDbConnection after BeginTransaction()

Question: I have a few methods which gets called sequentially and they all execute queries into a MySQL database, sequentially:
UpdateInvoice() - > UpdateOrderItems(connection)
      |---------- > UpdateGrandTotal(connection)
      |---------- > UpdateAdvances(connection)

I have a using block for connection and transaction as follows:
using (var connection = ConnectionManager.GetConnection()){
    using (var transaction = connection.BeginTransaction(){
        UpdateOrderItems(connection)
        UpdateGrandTotal(connection)
        UpdateAdvances(connection)
    }
}

My question is, once I have created a transaction from connection.BeginTransaction(), do I need to pass the transaction object around to get it to work atomically? According to my knowledge since BeginTransaction() was called upon the connection, it is in transaction mode, and that a single connection can have only one transaction at a time.
Am i getting something wrong?
P.S. I am using dapper to execute queries inside these methods
Answer: You can only have 1 transaction per connection (regardless of IsolationLevel if you are wondering). However you can nest multiple transactions by using System.Transactions.TransactionScope.
I hope this shed some light.


Object oriented analysis and real life OOP differences

Question: I usually try to do TDD with not much analysis (no diagrams) before start coding. Usually I find myself spliting a class into other classes to separate concerns. I wonder if a deeper analysis would prevent that. I think that much of OO analysis can't predict some of those cases. What do you think?
Answer: For me, the splitting of classes is usually part of a learning process. Either about the problem domain or the process of coding. And usually I do it while coding. Sometimes I bring a co-worker or two to a whiteboard to discuss things.
TDD should let you focus on the problem you're trying to solve. The fact that you're learning about the structure of the problem as you're solving it is an intrinsic part of TDD. Don't go into large up-front analysis/design processes.
Answer: "Usually I find myself spliting a class into other classes to separate concerns. I wonder if a deeper analysis would prevent that. I think that much of OO analysis can't predict some of those cases."
I have similar experience in this regard. TDD does help you to design classes better which
I do not get in A&D.
However, I have found prior analysis as much helpful. It's like laying out foundations with analysis and then you get detailed design while coding.
Certain things just need to be looked from a bigger perspective.
Answer: Most of the time, when I start a programming/design project, I have a good idea not only of what I want it to do at first, but also some of the directions that the requirements are likely to evolve.  This drives the choice of initial features (which drives Test Driven Development) and can give me an excuse to split classes in a direction that I think will be useful later.
If you just start choosing test cases randomly from the vast list of features you're considering, then the direction of development of your initial classes will also be somewhat random.  So I think part of being an experienced developer is choosing the directions carefully to begin with--not necessarily with a lot of formal analysis, but at least by instinct about what features are going to matter architecturally as the project grows.
One of the main points of XP and TDD is that you don't want to spend too much time on features and directions that aren't called for by your initial requirements, since the customer will change their mind when they see what you've done so far, so you don't want to spend too much time thinking it out.  But part of developing your skills and instincts as a developer is exercising and growing your ability to predict which undisclosed may turn out to be important later.
OTOH, the promise of XP and refactoring is that you can fix problems in the initial factorization of the problem when the requirements push you in that direction.  I think that's true, but you'll still be a more valuable contributor to the extent that you can make these decisions right the first time.  And making it look like luck--"The tests forced me to factor it this way" is part of the skill.
Answer: I think pre-planning out a lot of your class structure (and all of the different interfaces as well) is extremely important in Object Oriented Design/Programming. You won't find hardly any books out there on the subject that won't first spec out the design using UML and other modeling methods before diving into the code.


Qt creates dylib instead of bundle on MacOS ignoring the flags

Question: I have stuck with Qt and it's flags to force bundle compilation instead of dylib on Mac. I have found and read next posts: http://qt-project.org/forums/viewthread/1119, Qt Creator or qmake on MacOSX build library as ".so" not dylib, however, I still can't make things working.
I have following .pro:
macx {
    TEMPLATE = lib
    CONFIG += plugin
    QMAKE_LFLAGS_PLUGIN -= -dynamiclib
    QMAKE_LFLAGS_PLUGIN += -bundle
    QMAKE_EXTENSION_SHLIB = bundle

    # Sources, headers etc.
}

And it doesn't work at all. Whatever options I push - it's still dylib. CONFIG += lib_bundle produces framework, which doesn't work for me again...
I guess I'm missing something simple, but so far I have spent few hours trying to figure out where the problem lays with no success.
I'd appreciate any help with this.
Comment: same problem. did you solved your problem? mind sharing how?
Answer: Later Qt versions might not need quite so much tweaking, but this works with Qt 4.8.1:
TEMPLATE = lib

macx {
    CONFIG += lib_bundle
    QMAKE_LFLAGS += -bundle
    QMAKE_LFLAGS_SHLIB -= -dynamiclib
    QMAKE_LFLAGS_VERSION = ""
    QMAKE_LFLAGS_COMPAT_VERSION = ""
    QMAKE_LFLAGS_SONAME = ""
}


Keeping Gmail messages in the inbox after they are answered

Question: My Gmail inbox moves answered messages to the sent mail folder, attached to my reply. How do I set up Gmail to keep the answered messages in the inbox? I use the Gmail online and off-line clients and they both behave the same way.
Answer: Gmail has an option to add the send and archive button to the toolbar:

Once you enable the setting, you'll see a new button at the bottom of
  the page when you reply to messages. When you're done writing, click
  Send & Archive to send the reply and archive the previous message in
  one step, or click Send to send your reply but leave the original
  message in your inbox.

To remove that option, do the following:

Click the Gear Icon/Settings
In the General tab you will see the "Send and Archive" section:
Select Hide "Send & Archive" button in reply
click "Save Changes"
Answer: The answer from @mhoran_psprep looked great!  But it didn't solve my problem.  Here's what finally worked for me:

Go to Setting, then chose General tab. Scroll down to the option "Send and Archive"
Choose the option: "Hide "Send & Archive" button in reply".
Scroll down and click "Save Changes" and go back to inbox.
Now, when replying to messages you will click using the button that says "Send" instead of "Send & Archive". This will solve it.
In some cases, you might possibly need one more change, in Settings:

Within Settings, choose "Inbox" tab
Choose "default" from the dropdown instead of "unread first"
Save changes


How to check laser beam polarization

Question: Just like in my question. How to check laser beam polarization? What's the easiest experiment to do that will help me understend what type of polarization is present in my laser beam?
Answer: What you want to do is measure the Stokes Parameters.
The Stokes vector is defined by $\vec{S}= \left(\begin{array}{c}S_{0} \\ S_{1} \\ S_{2} \\ S_{3}\end{array}\right)$
Where $S_0$ represents the total intensity of the beam, $S_1$ represents linear polarization i.e Vertical and Horizontal polarization. $S_2$ represents linear polarization along $45^\circ$ and lastly, $S_3$ represents circularly polarized light.
From this you can determine every degree of freedom your polarization can possibly have by using the appropriate stokes vector.
https://en.wikipedia.org/wiki/Stokes_parameters
The easiest way to experimentally determine the Stokes parameter is straight forward and requires a half waveplate and a polarizer. You just need to find the following intensities:
$I(0^\circ,0^\circ) = \frac{1}{2}(S_0+S_1)$
$I(45^\circ,0^\circ) = \frac{1}{2}(S_0+S_2)$
$I(90^\circ,0^\circ) = \frac{1}{2}(S_0-S_1)$
$I(45^\circ,90^\circ) = \frac{1}{2}(S_0+S_3)$
Where the first argument is the polarizer angle and the second argument is the half-wave plate angle. Now you can solve for any parameter.

How to check laser beam polarization


Cosmic string & grandfather paradox

Question: Cosmic string was proposed several decades ago and there are claims stating it can span across the length of the universe and is less than an atom thick. How does a broken pieces of these cosmic string with immerse gravitational force in theory can allow an observer to travel back into the past? Wouldn't Einstein's general relativity forbids it? Is this cosmic string a mere fairytale to coax young children to go to bed early? If this method of travel backwards through time is true how will it resolve the grandfather paradox?
Comment: I don't see how this permits time travel.
Comment: @0celo7 many sources claimed that these cosmic string have very strong gravitational force and they can wrap the space-time greatly, it is proposed that a "spaceship" can travel along within this string super fast. The trick is that when these strings get entangles and break away something is supposed to happen like the spaceship is send back through time or something like this I'm not really sure if it's true or not.
Answer: Firstly, note that there are multiple objects that go by the name "cosmic string." Usually, it indicates some one-dimensional topological defect in the universe, but the other properties of it might vary. The theory to which you seem to be referring is one originally due to John Richard Gott III, a professor of theoretical astrophysics at Princeton. He points out that under the conditions of two infinitely long, rapidly separating strings with a kind of anti-gravitational tension, there exist paths in spacetime called closed time-like curves (CTCs); these CTC solutions are fully compliant with Einstein's general relativity. The time-travel associated with a CTC is the fact that one could travel along it at subluminal speeds for nonzero, finite time and, upon returning to one's starting point in space, find that one had also returned to one's starting point in time. Unfortunaly, I don't know the details well enough to elaborate much beyond that, but you might find this book of interest: Time Travel in Einstein's Universe: The Physical Possibilities of Travel Through Time, J. Richard Gott, Boston: Mariner Books, 2002, ISBN 0-618-25735-7.
Answer: Strangely enough, the mathematics probably allows for a set of laws that in each point of space-time locally follows special relativity and yet there exists a state of the universe with no solution to what future state it will evolve into while following those laws. For example, there exists a set of laws other than those of general relativity that the universe could have obeyed that allows you build a track through space with time contraction inside the track allowing objects to travel faster than light in it as observed from outside the track but does not allow you to build such a track in the first place faster than light. It also permits you to start building a second track right beside it that contracts time in a different frame of reference whose velocity differs enough that it would actually create a closed light like curve and unless the state that led to a light like curve satisfies an exact condition, there is no solution for the state of any points in space-time that are in the future light cone of any point in that closed light-like curve other than those at the very edge. One possible solution is that, points of space-time that are in the future light cone of any of those points without being at the edge don't exist so the creation of a closed light-like curve will nucleate the destruction of the universe at the speed of light before a closed timelike curve even gets a chance to evolve. https://www.quora.com/If-a-car-runs-at-the-speed-of-light-will-the-headlights-work/answer/Timothy-Bahry I'm not sure if general relativity also allows for a state of the universe with no solution to what future state it will evolve into. Maybe a closed light like curve has formed in a black hole and it did nucleate the destruction of space but the destruction of space never escaped the black hole because it would have to travel faster than light to escape the black hole.

Cosmic string & grandfather paradox


Embedded web parts in sharepoint

Question: So I made a link to a document from one subsite to another subsite in sharepoint.
I have used the embed web part and have inserted the link to the document instead of the iframe code. The document is an excel file but only half of the document is shown and there are no side bars to scroll across. how do I adjust the size of the embedded web part or the excel file? Any suggestions would be much appreciated.
Answer: Why not use the file viewer web part instead?
Comment: I would have preferred to have it embedded, but using the file viewer was my back up. Just wanted to see if there were any possibilities out there.
Answer: This is design. The excel file in the embed web part can only be displayed a part. You could not adjust the size of the embedded web part or the excel file. The only way is click the Full Screen at the Lower right corner of the web part. This would open a new tab for the file.

Embedded web parts in sharepoint


Money put down on home

Question: My boyfriend and I bought a house together. I put down my life savings of 20,000 dollars, and he put down 1,900. We are no longer together. If we put the house back on the market and get fair market value of the home which is more than the payoff am I able to get back the money that I put down and then split the difference?
Comment: The other information needed is what did the agreement between the two of you say - was it 50/50 ownership despite the difference in initial layout?
Comment: At a minimum, the answer to this is going to depend on where you are located. Several countries call their currency "dollars", so that's not something we can go by; I can think of Singapore, Canada, Australia and the USA that does, but there could be others. Please tell us where you are located.
Answer: I cannot emphasize enough how important it is, when you buy a house with someone you are not married to, to make a legal agreement on how the money should be divided when you sell. I know it's too late for you, but I write this for anyone else reading this answer.
From a legal point of view, if you made no agreement otherwise, you each own 50% of the house. If you want to divide it any other way, you will have to agree what an appropriate division is. Dividing according to the amount each of you paid towards it is a good way. Decide for yourselves if that means just mortgage payments, or also taxes, repairs, utilities etc.
You should also be aware that if you have been living together a long time, like more than a year, some jurisdictions will allow one party to sue the other as if they were getting divorced. Then the courts would be involved in the division of property.
Comment: A legal point of view requires knowing the jurisdiction in which the house lies, something we do not know.
Comment: "if you have been living together a long time" a _de facto_ common law marriage?
Comment: I'm shocked all mortgage companies don't *require* this. When my sister-in-law tried to get a mortgage with her BF, they (or the title company) required it (in Virginia).
Comment: @AaronD.Marasco what would be the benefit to a mortgage company to do so?
Comment: @iheanyi To know who to go after in the case of default I assume?
Comment: @AaronD.Marasco the person(s) to go after are those on the loan. That's the purple who are legally responsible. I'm not sure how personal relationships change this.
Answer: You should have drafted a contract of purchase that stipulated out equity stake in the home based of his down payment and yours, along with future monthly payments.
But morally, if the house sells, yielding 100,000 profit (after fees/taxes/etc), you should get (
To Calculate Your Cut:
(20,000 + Your Total Mortgage Payments Applied to Principle) / (1,900 + His Total Mortgage Payments Applied to Principle Only) * Profit on Sale of House After All Fees = Your Cut
His would be:
(1,900 + His Total Mortgage Payments Applied to Principle Only) / (20,000 + Your Total Mortgage Payments Applied to Principle) * Profit on Sale of House After All Fees = His Cut
You'd then take mortgage payment totals for each; and calculate the payments made towards interest; and claim the correct amount each of you paid on payments for the mortgage interest deduction when you file your taxes. Although, depending on how the loan is written, the banks may issue 1099s which dont reflect actual payments made... Talk to an accountant.
Comment: Any attempt to define the 'morally correct' answer on limited information is a bit suspect.
Answer: To quote Judge Judy:  "Our courts are not in the business of settling assets of couples who decide to play house".
This is one of the reasons we put off buying houses with a partner until we are married.  The courts have rules for couples who marry, then split,  but none for those who don't.
In the scenerio you spelled out, you are at the mercy of your ex-boyfriend as far as getting your downpayment back.  Legally, you are entitled to 50% of the funds remaining after the sale and expenses.
Comment: " The courts have rules for couples who marry, then split, but none for those who don't." That may be true in Judge Judy's jurisdiction, but it's not true everywhere. Some places treat common law relationships like marriage.

Money put down on home


How to get information about which display server is running?

Question: I'm using Ubuntu 15.10 and i want to know which display server is running. In first version of Ubuntu it is definitely X server, but recently i got updated my Ubuntu 15.10 and i came to know that some Mir Server packages are going to be installed so how will i know that either Mir is running or X Server?
Answer: (Trying to improve @shcherbak answer.)
To get info about the running display server write in the console:
ps -e | grep tty

The out put might be, for example:
 1475 tty2     00:00:00 gdm-x-session
 1478 tty2     00:00:40 Xorg
 1489 tty2     00:00:00 gnome-session-b

One of the tty* results is the terminal where you have the GUI in your linux system (usually tty7 though I use tty2 in my example). Therefore, this should be the terminal where the display server (X11, Mir, or whatever) is running.
For example, the results show 1478 tty2     00:00:40 Xorg, so this would be running Xorg (that is, X11).
Shscherbak answer would just output the running processes that contain a capital X, "X". Among others, of course, Xorg, in case it is present. But if another display server is running, you miss the information. :)
Comment: It output nothing on my computer.
Comment: @ElouanKeryell-Even the `ps` and `grep` command are really basic commands of linux, therefore I can only infer that your computer does not uses the `tty7` for the GUI. I am sorry. https://askubunt-u.com/questions/27339/what-is-tty7-in-the-commandline#27444
Answer: try look your process list:
ps -e | grep X

Comment: This would return the running processes that contain a capital X (e.g., Xorg), but would not show another display server if it is running.
Answer: with Ubuntu Ubuntu 22.04.2 LTS
I needed a slightly different approach:

ps -ef  | grep -i tty

shows me an entry that contains

/var/run/sddm

so I currently use SDDM Display Manager.
next step:
Find out if Wayland or X is active ...


Why did the Hunter x Hunter manga quality randomly deteriorate?

Question: In the manga Hunter x Hunter, the manga is amazing up until around chapter 184, where the drawings start noticeably deteriorating to the point of scribbles.  This is fixed a little later, but every now and then the quality goes back down slightly.  Is there a reason for this?  Was the mangaka just pressed for time?
Comment: So wait, admins deleted an answer with image links and didn't move it to a comment? That's really useful.
Answer: He had several problems of health. His arms get illness, I heard. So, his wife (author of Sailormoon) helps him draw Hunter X Hunter. And other works, as usual, belong to assistant.
That's why the quality is not the same over time.
Per wikipedia;

Togashi suffered from an immense amount of stress while working on
  YuYu Hakusho, which caused him inconsistent sleep patterns and chest
  pain. Togashi has taken numerous breaks in recent years while writing
  Hunter × Hunter, the first of which was due to illness

But I think the storyline is still great, huh?
Comment: Does anyone have pictures of the panels?
Comment: Ahhh I see.  I had no idea his wife was the author of sailor moon.  Yeah, the storyline is definitely still great, by far my favorite manga / anime (although I haven't seen the reboot).


What to do with aftermarket radiator as far as installing engine coolant sensor

Question:
2002 buick century custom 3.1
I bought an aftermarket radiator for 2002 buick century custom 3.1. The new radiator doesn't seem to have a place for the engine coolant sensor. What should I do? Is it the wrong radiator or do I hook it up in different place?
Comment: A picture of the car is not really helpful, but a picture of both radiators would be.
Answer: You may have multiple options available. Check with whoever sold you the part before assuming any of the following are possible.

Take it back and get a refund.
Take the new and old radiator back and have them see the differences. They might have given you the wrong one and having the original part to compare will make it useful to find the one that fits.
Modify the new radiator to use the coolant sensor. This is not recommended because it can end up damaging the part or costing more than buying it again.


Would "percentage of correct answers" be considered interval or ratio data?

Question: I'm currently working on a research assignment an I'm trying to determine whether a dependent variable like "percentage of correct answers" would be considered interval or ratio data. I was originally thinking ratio because it does seem like there would be a true zero (i.e. getting 0% correct), but I keep finding mixed results online. Plus, I know percentages can be tricky in this sort of situation. Any advice?
Comment: Arguably, either the answer doesn't matter or it depends on contingencies like how many answers there are *in toto* and the purpose of your analysis.  That would explain why online researches do not produce a consistent answer.  For instance, if there are only two questions then the possible values of the variable are 0, 50, and 100: in many circumstances it would be more fruitful to analyze that as a nominal variable and treating it as ratio or interval might obscure, rather than reveal, useful information.
Answer: All percentages are ratios: the percentage of correct answers is the ratio of correct answers to total answers.
Comment: This is not the sense in which the question intends "ratio" to be understood.


How to communicate with a deployed token?

Question: Using Truffle, I am trying to deploy the following contract:
pragma solidity ^0.4.13;

contract ERC20Events {
    event Approval(address indexed src, address indexed guy, uint wad);
    event Transfer(address indexed src, address indexed dst, uint wad);
}

contract ERC20 is ERC20Events {
    function totalSupply() public view returns (uint);
    function balanceOf(address guy) public view returns (uint);
    function allowance(address src, address guy) public view returns (uint);

    function approve(address guy, uint wad) public returns (bool);
    function transfer(address dst, uint wad) public returns (bool);
    function transferFrom(
        address src, address dst, uint wad
    ) public returns (bool);
}

contract TimedChest {

    /** The address allowed to do withdraws */
    address public withdrawer;

    /** Owner / creator of the contract */
    address public owner;

    /** Address of the token we're time-locking */
    ERC20 public token;
    // CryptoHuntToken public token;
    // StandardToken public token;

    /** Times at which specific amount becomes available */
    uint[] public releaseTimes;

    /** List of amounts which can be withdrawn after a specific timestamp */
    uint[] public amounts;

    modifier onlyAfter(uint _time) {
        require(now >= _time);
        _;
    }

    modifier onlyBy(address _account) {
        require(msg.sender == _account);
        _;
    }

    function changeOwner(address _newOwner) public onlyBy(owner) {
        owner = _newOwner;
    }

    function TimedChest(uint[] _releaseDelays, uint[] _amounts, address _withdrawer, address _tokenAddress) public {
        owner = msg.sender;

        require (address(_tokenAddress) != 0x0);
        require (address(_withdrawer) != 0x0);
        require (_releaseDelays.length == _amounts.length && _releaseDelays.length > 0);

        for (uint8 i = 0; i < _releaseDelays.length; i++) {
            require(_releaseDelays[i] > now);
            require(_amounts[i] > 0);
            if (i == 0) {
                releaseTimes[i] = now + _releaseDelays[i];
            } else {
                releaseTimes[i] = releaseTimes[i-1] + _releaseDelays[i];
            }
        }

        releaseTimes = _releaseDelays;
        amounts = _amounts;
        withdrawer = _withdrawer;

        token = ERC20(_tokenAddress);
        // token = CryptoHuntToken(_tokenAddress);
        // token = StandardToken(_tokenAddress);
    }

    function withdraw() onlyBy(withdrawer) external {
        uint256 amount = token.balanceOf(this);
        require (amount > 0);

        for (uint8 i = 0; i < releaseTimes.length; i++) {
            if (releaseTimes[i] < now && amounts[i] > 0) {
                token.transfer(withdrawer, amounts[i]);
            }
        }
    }

    function withdrawAll() onlyBy(owner) external {
        uint256 amount = token.balanceOf(this);
        require (amount > 0);

        token.transfer(owner, amount);
    }

}

This should allow an initial list of release delays and amounts to be specified on deployment, along with sending any ERC20 token to this contract and a withdrawer. The withdrawer can call withdraw after specific time has elapsed and withdraw the allocated amount for that timeframe. It's like periodic vesting for any pre-deployed token.
I'm getting the error:
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: The contract code couldn't be stored, please check your gas amount.

After searching far and wide, I've tested many theories - deploying an abstract contract is a problem (to test this, I changed all ERC20 interface methods to stubs, replacing ; with {}, gas limit is the problem, truffle version is the problem (tried downgrading) to no avail.
What could be the problem, or where can I find out a more specific error message?

Edit:
It would appear constructors are not very fond of loops. Moving loops out of there made it work. I'm investigating further to get to the bottom of this specific error and find out why it's occurring.
Comment: Did you get why this error showed? I just noticed that the "view" was introduced later in solidity than 13. But I guess that was not the issue.
Comment: Nothing definitive yet. I just removed loops from the constructor and made the calls in a separate method, then it started working. I'm on a tight schedule so could not investigate deeper yet.
Answer: That is kind of general error when there is an error in the contract. I had the error when I had an abstract function from parent  that wasn't implemented
Answer: Maybe this issue will shed some light: https://github.com/trufflesuite/truffle/issues/476


What is a spool in any jet engine, what is its funtion?

Question: I am a student and I'm trying to determine how a spool works in an engine. What effect does it have depending on the number of spools on the performance of the engine?
I tried to find it on Google but did not got any solid answers.
Answer: A spool in a gas turbine consists of a compressor (or fan), a connecting shaft and a turbine, see this answer. The purpose of the spool is to compress air driven by combustion gasses through the turbine. If not all energy is used in the turbine, it is either used in the next turbine or expanded in an exhaust nozzle.
The image below depicts in dark/light blue the high pressure spool (typically called the N2 spool), on the left the individual compressor stages that form the High Pressure Compressor, HPC, in the middle a connecting shaft piece (or drum) which connects to the turbine. The light blue shaft parts are also known as hubs and form the start and the end of the spool:

HP rotors of CFM56-7B. Adapted from CFM56-7B Familiarization Manual
The rationale behind using multiple spools is given by the type of gas turbine and the maximum compression ratio. To increase the propulsive efficiency, large amounts of flow need to be accelerated a little, this leads to large blades (typically called the fan) which may not be rotated too fast to prevent the tip speed to reach the speed of sound (for the sake of losses and structural integrity). Furthermore, given the fact that gas turbines operate at different power settings than the design value, where the axial flow through the machine is constant, a lower power setting will cause less fuel to be added to the cycle and as such less power generated in the turbine to drive the compressor resulting in a lower spool speed and thus lower compression ratio. This (less) compressed air is in volume larger than the design (high power) situation and will therefore increase the axial speed. This increase of axial speed causes blades to stall unless measures are taken (variable stator vanes, or air bleed). A compression ratio of 8:1 is typically the maximum for a single spool. To obtain higher compression ratios, to increase the cycle efficiency, multiple spools can be added to mitigate the problems at part power.
Answer: Start with the background: in a jet engine the air flows through the inlet into the compressor (to increase pressure), then through the burner (combustion chamber) to increase energy, then through the turbine (to extract power to turn the compressor) and finally out through the nozzle to provide thrust. In a single spool engine, the compressor and turbine stages are connected by a single shaft - so that is a one spool engine.
High compression ratio is needed for efficiency and it is difficult to increase on a single shaft so the dual spool engine was created. The air goes from inlet to the "low pressure compressor" then the "high pressure compressor" (LPC and HPC). The turbine has stages attached to each compressor (the HPT and LPT).
Comment: Spool is a term to  link the compressor, turbine and the shaft that connects them. Generally, the rotation is in the same direction. For example, at full thrust the F100 in the F-15 or F-16 has the fan at N1= 10 000 rpm and the HPC at about 12500 rpm so the difference is only about 2500 rpm. If they were counterrotating, some one would have to design and build real high speed bearings. They have, the F119 in the F-20 is similar  in size but is counterrotating. The gyroscopic effect should be better in the latter.
Comment: Does the lpc and hpc rotates in different directions to each in 2 and 3 spool engines, and Does the shaft drives spool ?
Answer: I like Oscar's answer about what is a spool. I'd like to add more information on the number of spools
Going from 1 spool to 2 spools takes you from a turbojet (1 spool) to a turbofan (2 spools).  There are many good existing questions on this site regarding turbojet vs turbofan so I won't go into that.
2 spools vs 3 spools is different.  Both configurations would be turbofans, with one spool being the fan, aka a low pressure compressor, driven by a low pressure turbine. The fan generates the majority of the thrust of the engine. The remaining 1 or 2 spools form the core of the engine, which generates the hot gas flow necessary to power the low pressure turbine.  GE generally chooses 2 spool designs, whereas Rolls Royce generally chooses 3.  The difference is a tradeoff between mechanical complexity and aerodynamic complexity.
With a two spool design, there is only one spool for the high pressure compressor.  Each individual compressor stage only gets a small compression ratio, so to get the overall compression ratio that you want, you need to stack multiple compressor stages together, say 9 - 11 of them.  Now, at one particular design condition, say cruise, every single stage can be completely matched to work together perfectly.  But at any other design condition, say takeoff, the stages aren't perfectly matched. The front stages might be pumping more air than the back stages really want to handle.  You'd really like it if you could slow down the front stages a little bit and speed up the back stages.  But you can't, they are all one one shaft.  So make it work (with good efficiency, good stall margin, etc) you have to play all kinds of games with the aerodynamics: variable geometry like VSVs, bleed valves, very detailed CFD models, etc.
Now with the three spool design, you have two spools for the core.  So instead of single high pressure compressor, you can split that into an intermediate pressure compressor and a high pressure compressor.  So now you have more flexibility. On those off design conditions, you can slow down the front stages a little bit and speed up the back stages, because they are on different spools, so you don't need fancy aerodynamic design.  But the price you pay for that is mechanical complexity.  Every spool is a rotating shaft that has to be supported by bearings.  So now you need more bearings.  Bearings have to be supported by something, so now you need frames and internal supports to hold them, and they need lubrication, etc. All these parts need to be bolted together somehow. Overall you have a lot more parts to the structure.
Comment: @Bianfable Also the P&W J57, a 2 spool turbojet. But, I don't think there are many.
Comment: Are you sure turbojets are always 1 spool? AFAIK, the [Olympus 593](https://en.wikipedia.org/wiki/Rolls-Royce/Snecma_Olympus_593) that powered Concorde was a 2 spool design.


iBook G4 won't boot

Question: Mac iBook G4 won't boot. When I hold down the Option key as it is booting, a blue screen appears. In the center of the screen is my hard drive icon with an x in the lower right hand corner. On the left and just below the icon is the refresh symbol and on the right, just below the icon is a straight arrow pointing right. What does this mean? How can I get past this screen to my desktop?
Answer: That symbol means your drive has crashed - or at least the system can no longer "see" the drive.
Do you have an install disk to boot from?  If you do, use that, go into Disk Util and see if you can access your drive from there.  If not, I would look at getting a replacement drive from eBay as your's is IDE/PATA and those are hard to come by new these days.
Answer: As @Allan said, your hard drive has a problem. You may be able to fix them with DiskWarrior and/or SpinRite. DiskWarrior will fix Mac-specific errors and will boot directly on your iBook (talk to their support to make sure they mail you something that you can boot from). SpinRite can fix drive-level data errors, but only runs on PCs (soon Intel Macs, which your iBook is not), so you'll need to completely remove the drive from the iBook and find a PC you can attach it to.
If you need to buy a new hard drive, these should work. The process for replacing the drive is here. It's not easy (I've done it), but is doable. (ifixit will happily sell you all the tools you need and a compatible hard drive.)
Allan's advice about finding the boot disk that came with your iBook (or another similar computer) is excellent, so I won't repeat it.
As to what you're seeing, you're in the boot-choice screen. (The refresh button tells the system to redo its search for bootable disks in case you plugged in an external disk or inserted a bootable CD.) The list of bootable discs show as the big square buttons and the rightward-pointing arrow tells the computer to attempt to boot the selected drive.

iBook G4 won't boot


Example of a metric.

Question: I am looking for an example of a metric $d(x,y) $ on a vector space $X $ such that is neither a discrete metric nor induced by a norm and satisfies:
$$d(0,ax+(1-a)y)\leq {ad(0,x)}+(1-a)d(0,y),\ \forall x,y \in X, \ \forall  a\in[0,1]$$
But I could not find or construct.  Please give some hint or any example.
Comment: The inequality resembles a concave function very much. Maybe you can look into that?
Answer: When $x=(x_1,x_2)\in X = \mathbb{R}^2$, then $f : X\rightarrow
\mathbb{R},\ f(x)=x_1^2-x_2^2$.
Then graph of $f$ is a saddle surface $(S,d_S)$ in $\mathbb{E}^3$
where $d_S$ is a intrinsic metric. Here $d(x,y)
=d_S\bigg((x,f(x)),(y,f(y)) \bigg)$.

Example of a metric.


How To Configure Django Authy For Two Factor Authentication

Question: I have been researching Django 2 factor for the last couple days.  I've finally come to a point where I've gotten the Django Twilio phone verification to work.  Here is the code the working code...
<code>from authy.api import AuthyApiClient
from django.conf import settings
from django.shortcuts import render, redirect

from .forms import VerifyForm, TokenForm

authy_api = AuthyApiClient(settings.ACCOUNT_SECURITY_API_KEY)

def SetupView(request):
    if request.method == 'POST':
        form = VerifyForm(request.POST)
        if form.is_valid():
            request.session['phone_number'] = form.cleaned_data['phone_number']
            request.session['country_code'] = form.cleaned_data['country_code']
            authy_api.phones.verification_start(
                form.cleaned_data['phone_number'],
                form.cleaned_data['country_code'],
                via=form.cleaned_data['via']
            )
            return redirect('token_validation')
    else:
        form = VerifyForm()
    return render(request, 'registration/verify.html', {'form': form})

def token_validation(request):
    if request.method == 'POST':
        form = TokenForm(request.POST)
        if form.is_valid():
            verification = authy_api.phones.verification_check(
                request.session['phone_number'],
                request.session['country_code'],
                form.cleaned_data['token']
            )
            if verification.ok():
                request.session['is_verified'] = True
                return redirect('verified')
            else:
                for error_msg in verification.errors().values():
                    form.add_error(None, error_msg)
    else:
        form = TokenForm()
    return render(request, 'registration/token_validation.html', {'form': form})

def verified(request):
    if not request.session.get('is_verified'):
        return redirect('phone_verification')
    return render(request, 'registration/verified.html')
</code>
Using the code above along with specifying the ACCOUNT_SECURITY_API_KEY in my settings.py file is all that was required to get the code above to pass a 4 digit code to my phone.  Progress...
However, what I'm really trying to accomplish is to leverage the AUTHY app to provide the login code....I've looked at the following page...https://www.twilio.com/docs/authy/quickstart/two-factor-authentication-python-django#linkcode And the code does not load on this page...does anyone have experience or know where to look so that I can get Django to work with Authy and get the code that changes every 20 seconds as opposed to the 4 digit pin example shown above?  Thanks in advance for any thoughts.
Answer: Twilio developer evangelist here.
Your issue here is that you are using the verification API, which is for one time phone number verification and doesn't use the Authy app.
Instead you want the APIs for one time passwords. I don't know what's wrong with the tutorial you linked to, but all the code for the app can be found here: https://github.com/TwilioDevEd/account-security-quickstart-django.
Let me know if that helps at all.