Parse logs from router to database

Question: I would like to parse log files from Cisco WRVS4400N router to a specific database for detecting a DoS Attack. Any idea please?
Comment: Do you have any database in place already? Like some with the logs from other sources already?
Comment: I have already set up Barnyard2 for storing Snort logs, but i want to build a  database for storing logs from Snort, Router and Apache server.
Comment: Stand up an [ELK stack](https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-ubuntu-14-04) and parse any logs you want with the creation of GROK filters.
Answer: So first it would be good to consider what kind of database you'd like to use, and then secondly what kind of adapter you can use with it.
Regarding databases and log storage, the main factor is about storage - the storage model defines what it will be like, and these models you can categorize like this:

Unstructured text files (smallest size, fastest ingest)
Structured data (medium size, medium fast ingest)
Structured data with indexes (big size, slow ingest)
Structured data with indexes and full text search (very big size, slowest ingest)

So, based on that you can do the following:

Use BigData storage with Hadoop like processing. This is over-kill for the task.
SQL tables without indexes, MongoDB without indexes
SQL tables with indexes, MongoDB with indexes
SQL tables with index and with full text search, MongoDB with indexes and full text search, Elastic Search

SQL and MongoDB are both most user friendly due to availability of various GUIs and SDKs which are easy to use (as of 2016). There are also other engines like Cassandra, Splunk.
So now, from my experience, the best usability / scalability / easy to use is to use MongoDB table with primary index and eventually some optional when it's needed. This is because MongoDB with it's newest WiredTiger engine it compressed data so typical log entry from Apache takes approx 90 bytes of space on disk (with indexes). Compared to uncompressed SQL it is very good result, and secondly it allows you to define called collections (tables), which can be limited to e.g. 4GB which gives you 50M log entries. So then, after hitting 50M entries, it will be overwriting old ones.
Another advantage of MongoDB is that you can ingest JSON Document without need to define table structure, it just takes any JSON document.
Comparing e.g. other SQL engines, there's problem with removing old entries and sometimes the indexes has to be rebuilt (there's no way without at least primary index). This makes it lot more complex in a way that this data needs to be inserted into new table every day, so implementation of it is a lot harder.
Regarding Search Engines, the search functionality is really not needed. This is very good marketing but very little benefit for a lot of hassle when it comes to log parsing. In fact, searching is for manual operation and once you perform search of two it happens to be not needed any more, yet all data storage and ingest is designed for searching.
What is the best usage of such data is to e.g. run Nagios check (as good example), and storage the values in RRD table and generate graph with pnp4nagios. So each check run every 5 minutes checks last 5 minutes worth of logs and based on that take data point and ingest into Nagios.
For Elastic Search for example, there's front-end for viewing data but it's not reporting tool, for reporting on e.g. httpd logs you can use Sawmill instead.
Finally, you need adapter which can do one of the following:
   - Accept SNMP traps
   - Accept Syslog messages
   - Accept JSON formatted documents over HTTP/HTTPS (usually it is using keep alives)
There are few options to do it like using Syslog with Database plugin, so basically logs are passed to Syslog and Syslog is loading it to database. But then, you need to also construct SNMP trap or any kind of sink separately. There are few other commercial sinks for these tasks optimized for Splunk, there's something with Greylog2 as well.
However what seems to be easy to implement is Spring XD, so basically you can establish Syslog source and JDBC (SQL) / JSON/ MongoDB output. It is very easy to do and once running it should be OK. You do not need any extra code to have it up and running.
You can then use Syslog as source from servers and from router as well. You need to find out which Syslog format is good, and you can start many Syslog listeners with many Syslog formats. So this should work fine for router.
Now, as SQL for example would seem to be easy option, when there's more entries like HTTP etc, MongoDB performs better, and also if Syslog seems easy as well, it may not be good for large number of requests. Therefore for medium-size installations (like if you are not Facebook or any big website), MongoDB is good because it's easy with GUI, API, capped collections and small storage / RAM requirements.
Then it comes how do you ingest  HTTPD logfiles into MongoDB. For the integration sake it's good to use Adapter as well and some kind of universal one, for example HTTPS JSON -> MongoDB or SQL, and then make server on which HTTPD is running to tail the logs and ingest send it to the Adaptor as JSON documents so there's field name and field value. So when you change log format then it's no pain to change the database schema or even queries.
So this can be achieved with daemon which tails the httpd log and sends HTTPS / JSON documents to Adaptor. For example many people are comfortable with Perl but most recently with Python. This is not really difficult think to do. The Apache log format is stored in it's config, so from this you can work-out the log format and it's columns. Sometimes there's log field description in the header. The daemon is good option because it doesn;'t interfere with anything else, but making Apache writing to Syslog also works, however you need structured documents or SQL table data and not single line.
The above methods are highly reliable and scalable and you are not in any vendor lock-in. For example, Nagios is good monitoring tool and since it doesn't realy on any database itself it's very hard to break it while it's very easy to install / revert any changes as you can have them in Git. And it can do both rendering and alerting like email notifications. Plus, you have various Front-ends like Thruk which is nicely packaged for many distributions.
In overall, the above gives you the lowest cost, smallest infrastructure requirements and good flexibility. Going with any search engine is huge over-kill and it will not make it any easier even if the start looks easy. Being familiar with database APIs other than SQL is apparently needed, some bit of scripting and the Nagios. These are standards and this can scale to a lot of more devices. It's easy to make Nagios monitoring bandwidth and so on. It's not by default, Nagios plugins do miss big time plenty of things but it's easy to make it happen with a bit of SNMP experience.
Search engines are not good for being used by Nagios. They are useful for used by people. So if you want alerting it's better to use something else than Search Engines. It is just huge over-kill for the task and you might find yourself working on something which in the end has little benefit even if you have believed in it.
What you really need is:

Proper reporting like Sawmill, and Search Engines with their front-ends are nowhere close to it today
Proper alerting with Nagios (it's not as good or not at all with other alternatives)
Stable, mature database with scale-out options which works
RRD based drawings, the round-robin in MongoDB and RRD in Nagios is what it is all about
Proper front-end to Nagios like Thruk
Good database client like Mongo3T, SQLYog for MySQL etc
Good scripting language with good environment (definitely not tons of Regex).
Comment: Thank you so much for your guidance. I will use MongoDB table with primary index. By the time i read some papers and documentation about MongoDB, because i just take my first steps in this field. Your approach sounds very interesting

Parse logs from router to database


Is it possible to use I2C fast mode+ with 30m cable?

Question: I2C can reach up 1Mbps with fast mode+ and 3.4Mbps with High Speed mode. I just want to ask if it is possible to use 3.4Mbps mode with longer cable and what is the max. possible cable length.
Comment: I'd suggest you avoid using I2C for long distances - bus lockup is a design feature, so unless you can mitigate this possibility you'll be plagued with problems. Keep I2C on the pcb.
Comment: I used to have 100k~400kHz i2c wires between proto boards.  My experience is that I should keep length less than 30cm (not 30m!), and not too many devices on the bus, with a total impedance of 400pF.
Answer: Doesn't seem to be possible. As Kartman suggested in his comment, you should avoid using I2C for long-distance communications. If it was possible a lot of other communication protocols wouldn't be invented or at least wouldn't be popular today, believe me.
Anyway, generally the pull-up resistor and the cable capacitance plays a huge role at maximum frequency. For on-board FM and FM+ 1k-ish pull-up resistors work fine but you can't use this value if the line capacitance is high. Just as an example, if you use a 30-m-long cable with a capacitance of 5pF / metre then a LPF with a cut-off frequency of ~1 MHz will be formed. This will affect the rise time and pulse shape of the signals. You can decrease the pull-up resistances but this will affect the transceiver's power dissipation and you don't want to exceed the max ratings.
If placing repeaters at every, say, 1 metre seems reasonable/practicle then you can use I2C FM+ at even kilometre-long communications.
Answer: No, it is not possible to use a 30m cable for FM+ or higher modes.
FM+ allows for 550pF of bus capacitance and HS mode allows for 100pF for 3.4 MHz and up to 400pF for up to 1.7 MHz.
It is unlikely that you can find a cable with such low capacitance that would allow for anything else than a couple of meters before the total bus capacitance, including PCB, connector and IC pin capacitance hits the limit and requires to slow down the communication speed.
I would estimate based on existing bus implementations such as DDC that 30m would be viable at maybe up to 100 kHz, as even if the standard requires certain rise times and bus capacitance, it allows longer rise times and higher capacitance which allows to slow down the clock.


What text/scripture does this commonly propagated verse appear in - 'aaputrasya gatir nasti svargo naivaca naivaca'?

Question: It is commonly quoted during discourses on vAlmIki rAmAyana, but I cannot find any verse in vAlmIki rAmAyana that contains this often quoted verse, which means 'without a son you have no chance of getting into heaven'. Online sites say it is said in 'shruti'. But what text of Shruti does it appear in exactly?
Answer: The shloka you have quoted is found in Garuda Purana -Preta Kanda- Chapter 2-Shloka 4 As well as Devi Bhagavata Purana 18.104.22.168.

अपुत्रस्य गतिर्नास्ति स्वर्गो नैव च नैव च ।  येन केनाप्युपायेन
कार्यँ जन्म सुतस्य हि ।।
There is no place for sonless person , the heaven is not for him. One
must have a son by any means whatsoever.  -  Garuda Purana.
There is no prospect in the after birth of the sonless; never, never
will Heaven be his. Without son, there is none other who can be of
help in the next world. - Devi Bhagavata Purana

looking at   the above shloka  it is quite clear that it is from puranas and much different in composition than that of the style of mantras found in Vedas i.e. shruti. So it is highly unlikely that this shloka is present in shruti. And we can say that it belongs to puranas or later traditions than shruti. i.e. post panini.
Comment: @RanjivKurup Yes , you are right Putra here means either a girl child or a boy. This is translation issue. But i think most users on this site are aware of this face and this topic is  also discussed  previously here.
Comment: @YDS -Ok ,I will add note in answer with explanation ,citing some ref. if found soon.
Comment: I doubt this is about a "son". It is more likely to be used in the context of an "offspring". Hinduism is not a patriarchal tradition, so there is no preference for male/female offspring. But I guess, people will translate it to suit their or their community practices.
Comment: @SwiftPushkar It would be great if u can highlight this translation issue in answer itself... :)
Answer: The part of Vālmīki Rāmāyaṇa where the commentators cite that verse is probably this:

tam ca rājā daśaratho yaśas kāmaḥ kṛtāṃliḥ |
  ṛṣyaśṛṅgam dvija śreṣṭham varayiṣyati dharmavit || 1-11-8
yajñārtham prasavārtham ca svargārtham ca nareśvaraḥ |
  labhate ca sa tam kāmam dvija mukhyāt viśāṃpatiḥ || 1-11-9
That king, the desirer of glory, the knower of virtue and the lord of people, namely Dasharatha will be requesting that best Brahman Rishyasringa with his palms adjoined in supplication for the conduct of ritual, for progeny and even for his heavenly abodes, and that king of all the quarters of earth will accomplish those desires from that eminent Brahman Rishyasringa. [1-11-8,9]

Commentary from the same website says:

Heavenly abodes are dependent on begetting sons:

aputrasya gatir naasti svargo naivaca naivaca

There is no way out [in other worlds] for those without sons... shruti scripture. Hence the request of Dasharatha is that way.

The śruti equivalent of this can be found in the Legend of Śunaḥśepa from Aitareya Brāhmaṇa (Ṛgveda) where Nārada says there's no place in heaven for men who don't have sons:

PAÑCIKĀ VII   ADHYĀYA III
The Legend of Śunaḥśepa.
vii. 13 (xxxiii. 1). Hariścandra Vaidhasa Aikṣvāka was the son of a king; a hundred wives were his, but he had no son from them. In his house dwelt Parvata and Nārada; he asked Nārada:

Since now men desire a son,
Both those that have and those that have not knowledge
What doth a man gain by a son?
Tell me that, O Narada.

He, asked in one verse, replied in ten:

A debt he payeth in him,
    And immortality he attaineth,
    That father who seeth the face
    Of a son born living.
    The delights in the earth,
    The delights in the fire,
    The delights in the waters of living beings,
    Greater than these is that of a father in a son.
    By means of a son have fathers ever
    Passed over the deep darkness;
    The self is born from the self
    The (son) is (a ship), well-found, to ferry over.
    What is the use of dirt, what of the goat-skin?
    What of long hair, and what of fervour?
    Seek a son, O Brahmans,
    This is the world's advice.
    Food is breath, clothing a protection,
    Gold an ornament, cattle lead to marriage,
    A wife is a comrade, a daughter a misery, (sakhā ha jāyā kṛpaṇaṃ ha duhitā)
And a son a light in the highest heaven. (jyotir ha putraḥ parame vyoman)
    The father entereth the wife,
    Having become a germ (he entereth) the mother,
    In her becoming renewed,
    He is born in the tenth month.
    A wife hath her name of wife,
    Since in her he is born again
    He is productive, she productive,
    The seed is placed here.
    The gods and the seers
    Brought her together as great brilliance;
    The gods said to men

This is your mother again.
A sonless one cannot attain heaven, (nāputrasya loko 'stīti)

All the beasts know this;
    Therefore a son his mother
    And his sister mounteth.
    This is the broad and auspicious path
    Along which men with sons fare free from sorrow;
    On it beasts and herds gaze
    For it they unite even with a mother.

Thus he told him.
Comment: Thank you for the answer. I appreciate it. I read the link you shared in your response and it is clear to me that the authors of that book mis-translated that sentence in bold. 'naputrasya lokOstIti' means 'without sons our world/human world won't exist'. 'loka' does not mean swarga/vyOma, but means our plane of existence, i.e. the human/mortal life world. So that is an incorrect translation and that verse in Rk Veda means our world will cease to exist without sons, but not 'a sonless one cannot attain heaven'.
Comment: Ok, if you read that verse in isolation, but what about: "And a son a light in the highest heaven. (jyotir ha putraḥ parame vyoman)"? You can find the Sanskrit verses from AB [here](http://titus.uni-frankfurt.de/texte/etcs/ind/aind/ved/rv/ab/ab.htm?ab236.htm). And an alternate translation [here](https://archive.org/details/aitareyabrahmana04hauguoft/page/315) says: "9. He who has no child has no place (firm footing)..." - no place on earth or no place anywhere including the higher lokas? @Vijay
Comment: I agree with "a son a light in highest heaven", but the 2nd translation is incorrect imho but that translator is not alone. It appears that these translators were influenced by garuda purana verse in making these translations. I did not read that verse in isolation btw, the context from verses preceding & succeeding it render my translation of it to be correct. Because the context is saying that this world doesn't exist without male children and even animals know it. Think about it, Janaka had no sons, yet he went to heaven (per Padma Purana).
Comment: From my reading of the scriptures, I think the highest benefit from having a son is discharge of 'pitr runa' or debt to ancestors. That is again of course if that son performs his dharma of conducting vedic rites at appropriate times. In the definition of what dharma is, Manu did not include progeny in his 10 requisites - dhArti Kshama DamOstEyam indriya-nighraha dhIr vidya satyam akrOdho dashakam dharma lakshanam per Manu Smriti.
Comment: 'Think about it, Janaka had no sons, yet he went to heaven (per Padma Purana)' - that must be an exception, not the norm? Since you mention Manu, he also talks about a hell called Put in [9.138](https://www.wisdomlib.org/hinduism/book/manusmriti-with-the-commentary-of-medhatithi/d/doc201511.html): "Because the Son delivers his father from the hell called Put, therefore has he been called Putra" @VijaySekhar
Comment: I think he saves father from hell because his birth satisfied pitr runa of his father, but not from other hells. Goes back to what I said earlier.
Answer: अपुत्रस्य गतिर्नास्ति स्वर्गो नैव च नैव च
I think it simply means a person without a son has no future neither here nor in the heavens. I think we should stick to Occam's razor in such matters.
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).


If you only know the name of someone, is it OK to call him Mr. John or Ms. Jane?

Question: If you have to send an email to someone acquaintance and you only know the first name, would you address him/her as Mr. John or Ms. Jane? The intention is to sound as formal as possible. So, no 'Hello John/Jane'
Answer: I think this answer will depend very much on exactly what culture you're in; I can only address the United States.
In mainstream US culture, you don't say Mr./Mrs./Ms. Firstname.  Titles like Mr. or Mrs. are only used with last names.
If you are trying to be as formal as possible, you don't use someone's first name, so it doesn't matter whether you know it or not.  Someone whose last name you don't know can be addressed in mail as Dear Sir or Dear Madam.

Now for a side note:
In some US subcultures, Mr./Mrs./Ms. Firstname is used, but only semi-formally.  You would use that form of address for someone you were familiar with and wanted to address respectfully (like someone older), but not a stranger.  For example, my wife is from the Deep South of the US, and before we were married, her nephew called me Mr. Firstname, and my wife calls her friend's mother Mrs. Firstname.  There are some good discussions of the practice at Southern U.S. use of "Miss FirstName" -- racial or class connotations? and Can "Mr", "Mrs", etc. be used with a first name?
In the northeastern US where I grew up, this form of address is not used.
Comment: It's not used on the (US) west coast either.
Comment: That exception is 100% only -- and distinctly -- a culturally Southern usage. In Florida, which is geographically Southern but culturally a mixture of mostly Northeastern US and Cuban influences, I've basically never heard it. There's only one exception: in my high school English class, while reading a book taking place in the South, and with a class discussion of using the title that way being uniquely Southern.
Answer: british-english
You should only use "Mr" or "Ms" with last names, or with full names. Never use it with the first name alone.
So "Mr Smith", or "Ms Jane Smith" are correct, but "Mr John" or "Ms Jane" are not correct.  In British English, there should be no dot after abbreviation "Mr", "Ms" or "Mrs"
You may, occasionally, see "Mr John" in old books. It would have been used by a servant to speak to a child who was senior in rank. But this use is no longer current.
The same applies to most honorific titles:  "Dr Smith", "Prof Smith", "Revd Smith" and so on. But with the title "Sir", this should be used with first names. So "Sir John", not "Sir Smith".
In your specific situation, something is very odd. How could you be in a situation in which you need to be highly formal, but know only a person's first name? You have roughly three choices. Either accept that the fact that you know someone's first name means that you are now "on first name terms" and so formality is not expected (and may be felt as being cold and unfriendly). Or find out the person's last name; is there a mutual acquaintance?  Or pretend you don't know the person's name at all and begin "Dear Sir,..."  But note that this risks being thought to be unfriendly.


Is there any applicable close reason for questions for which the answer can be found by compiling the code?

Question: I found this question; it is asking about if final object references can be initialized as null, but the answer can easily be found by compiling the code (it is possible that OP may want to know when to use it). Can we close these types of question? If so, what is the close reason?
Comment: There are many situations where using a particular compiler to compile a particular piece of code may lead to a conclusion which doesn't agree with one someone familiar with the language definition may reach.
Comment: Possibly "no longer can be reproduced" since it isn't really a "problem" any  more - although thats stretching it. Your best option would be to close as a duplicate that explains whatever error you'd get by doing it (if applicable) or what the behaviour would be used for.
Comment: Very often, "unclear" or "too broad" can be used, because it isn't clear why the asker couldn't do that, or he needs a complete explanation from first causes. Whether one could go for "no MCVE"? Maybe, due to the OP omitting the errors/warnings, though it's a stretch.
Comment: However, in this case: _"Just try it"_ is the only proper answer. Questions like that really don't add any value to SO.
Comment: Close-voted as _"Can no longer be reproduced"_: _"this question was resolved in a manner unlikely to help future readers."_
Comment: Sometimes the compile it and find out argument is not a valid way to find out something.  The compiler could have a bug or a extension that allows a piece of code that should not compile to compile.
Comment: @Cerbrus I dare say I strongly disagree. Many languages have constructs which cause undefined behavior or implementation defined behaviour. In such cases just running code can give wrong and deceptive results.
Comment: @Vality: Straw man. The linked question is simply a case where the OP just had to compile his code.
Comment: @Cerbrus I agree for this question that was the case. But without sufficient familiarity with a language it can be hard to tell which questions can or cannot be answered reliably through trying to compile. Only a person can really confirm for sure if it is well defined.
Comment: @Vality: _"However, __in this case__: "Just try it" is the only proper answer."_ What are you even trying to discuss here? I'm not disagreeing with Nathan. I'm just saying that ___in this case___, the question can be closed.
Comment: @Cerbrus sorry for my lack of clarity. What I am trying to say, is it was impossible for the OP to know if just trying it was a valid solution until they had been told so. Say they did run it and didn't ask here. How could they have known if the result was specified and reproducible without examination of the language standards or asking?
Comment: @Cerbrus however in this case it appears to now be closed anyway so this is fairly irrelevant, sorry for wasting your time
Comment: @Vality: The OP _literally_ asks: _"Can we do X?"_, __with__ example code. He's asking if it would compile. It's far from impossible to to know if "just trying it" is a valid solution. "Just trying it" ___is___ the first, middle and last step of finding an answer on something as basic as _"does this compile?"_
Comment: To the general inquiry... I could still see rare(?) benefit to such a question. A future coder may wish to get quick verification on the same questionable construct without resorting to compilation for various reasons (writing code off platform, still designing, has other incomplete code hindering compile), in addition to that outlying possibilities that the requester has valid need (inconsistent compilers, seeking help just part of larger code). All examples probably do point to the need to improve the question, but it'd be great to see people default to trying to help rather than to close.
Answer: While the question is rightfully downvoted (it doesn't show any research effort at all), that does not mean it needs to be closed. It is on-topic, it can be answered (with a simple 'yes'), I couldn't find a duplicate, so I see no reason to close it.
Comment: But, whenever I try to answer with "yes" it rejects me with "Body must be at least 30 characters; you entered 3."


How to promote expats.se

Question: I think we are a small but successful site with a number of core users who provide high quality answers to the questions we get. I think we also get some high quality questions. While bigger is not always better, I think we can stand to grow a little bit. What should we be doing to promote expats.se?
Comment: I'm not sure what all else we can do at this point. If you look at the most successful user-driven sites for immigration topics (one of which I'm also very active on), they tend to be message boards where discussions, and even debates, can carry on. This format is great for straightforward answers, even if the answer is 'we don't know', but it's not so great for complicated situations and drawn out discussions. We have stuff in place for that obviously, but the comment/chat functionality is a primary driver here. Maybe expats could modify its presentation a bit to encourage that type of ....
Comment: ...interchange. Otherwise, as a Q/A site, it will be a challenge to grow at a much faster rate than we already are growing.
Answer: Been thinking about this.  We're meeting quite a few of the graduation criteria - but where we're really not doing great is the answer rate.
It may help to have a drive to go through the unanswered questions, answering what we can, marking some as dupes where applicable, and also close those that are off topic, incomplete and so on. This should help boost us.
Questions per day will just come with growth, but solid answers will attract that growth.
Also finding related questions on, say, travel.SE, and linking to the expats site may help.
As a result, to track the uptick (hopefully) of answered questions, I've started this meta post.
Answer: I feel we should actively promote ourselves on the popular immigration forums. There is a few I know of and will list them here. The advantage for this site over others is, some of those discussions get long winded and hard to find the quick response one is looking for. The predictability of the UI here is good as well as the search is awesome

Immihelp.com
H1bwiki.com
Reddit(will look for immigration related
channels there)
Quora forums
Comment: you may like https://expatriates.meta.stackexchange.com/q/333/97 ;)

How to promote expats.se


How to disable media gallery permission of Hill Climb Racing 2?

Question: I have installed Hill Climb Racing 2. It asked for access to my gallery. For installation I permitted it. But now I want to disable it. How can I do it?
Answer: Its quite easy to do so. All you need to do is to change your App Permissions. All you need to do is the following:
1. Goto Settings of your mobile phone
2. Find the option Apps
3. Scroll down the list to find out Hill Climb Racing 2
4. Look for Permission Tab
5. Search the list of permissions for the permission you want to disable
6. Click it and disable it
For more information and detailed overview, I recommend you to see this video for further details:
How to Manage App Permissions on Android
Comment: Amazing. I got it done easily.
Answer: Another way to disable app permissions is to use a tiny but powerful utility. This utility is known as Lucky Patcher. However, you will not be able to find it from Play Store. Download Lucky Patcher. Follow some simple steps to install it and use it to manage app permissions.
Comment: It is best if you mention how to use that app within the answer because link-only answers lose their usefulness once the link expires.
Comment: Are you affiliated with the website freeluckypatcher.com? Our policy on promotion requires full disclosure of affiliation in all such posts where the affiliated product/link is mentioned.
Comment: @Firelord Not to mention the website isn't the official one.


URL: following rules for relative path with trailing slash

Question: I've found lots of answers on the server side for the relative-path-with-trailing-slash question, but none on the client side. Help me out here.
I'm writing a web crawler to take statistics on a set of websites, and am running into a problem. One website I'm working with has a navbar with relative paths with trailing slashes, and intends those paths to be treated as absolute, like so:
on page http://www.example.com/foo/bar
navbar links addresses -> foo/, baz/, quox/
intended absolute urls -> http://www.example.com/foo/, http://www.example.com/baz/, http://www.example.com/quox/
The problem is, as far as I can tell, this is nonstandard behavior - and yet Firefox and Chrome both handle those paths as absolute. According to RFC 1808, and RFC 2396, these should be handled like relative paths, like this:
spec-correct absolute urls -> http://www.example.com/foo/foo/, http://www.example.com/foo/baz/, http://www.example.com/foo/quox/
In particular at section 5.1 in RFC 1808 and C.1 in RFC 2396, the 4th example shows this case specifically being treated as a relative path. In Ruby, which I'm writing the crawler in, the Addressable gem handles these according to spec.
What's worse is the server in question is happy to return 200 OK for these paths, and all of them have this navbar: so I end up crawling http://www.example.com/foo/ which is the same page as http://www.example.com/foo/foo/, http://www.example.com/foo/foo/foo/ and so on, combinatorially to bizarre URLs like http://www.example.com/foo/baz/quox/foo/
So here's the question: Am I missing something that allows Chrome and Firefox to both interpret these urls as absolute paths? Is there any way to disambiguate the case where the spec is correct and the absolute path is what is intended?
Answer: There must have been a <base> tag defined inside of  element which is used to specify base URL for relative paths in a page.
RFC-1808


Do any countries allow leaders to be impeached by low approval ratings?

Question: It seems logical that a leader be removed if a high majority of people no longer want the leader in power. Are there any countries that allow leaders to be removed from power if their approval ratings are extremely low?
Answer: The term you are looking for is recall.
The wikipedia article suggest Venezuela is the only country with a national process to unseat a leader by petition. But the US, Canada, Switzerland and Ukraine have options for removing lessor leaders.
Most notably the governor of the state of California was changed by recall in 2003. This isn't a country exactly, but it is a very large and important district.
Comment: @user4012 It's true I focused on the first sentence in the body to the exclusion of the two with question marks. I think my opinion that this was an xy or naming problem is supported by the green check mark. You could also upvote another answer to help future readers looking for a literal view.
Comment: We have no option for removing elected executive people (aka "lessor leaders") in Switzerland, other than wait the next elections to remove them.
Comment: @Bregalad all my knowledge of Swiss recalls comes from this one wiki article. It says 6 Cantons have a process, and it has only been used once in Aargau in the year 1862. The article cites Jankovsky, Peter (22 March 2011). "Der Versuch, eine Exekutive zu stoppen" which I am entirely unqualified to evaluate.
Comment: -1 - recalls are NOT what the question was about (a recall is independent of low approval ratings, aide from it helps the recall to succeed).
Answer: No, since impeachment means charging a government official with a crime or misdemeanor. As Wikipedia phrases it:

Impeachment is the process by which a legislative body formally levels charges against a high official of Government. Impeachment does not necessarily mean removal from office; it is only a formal statement of charges, akin to an indictment in criminal law, and is thus only the first step towards removal. Once an individual is impeached, he or she must then face the possibility of conviction via legislative vote, which then entails the removal of the individual from office.

Doing this by public opinion polls would be ridiculous.

If you mean "allow leaders to be removed from office by low approval ratings", then also no, I can't find any examples of countries that have codified that.
For better or worse, your vote is for a period of about 4 years (depending on your location etc.) Changing leaders/direction every year based on a whim or a temporary setback/scandal/downturn is probably not a great idea.
Answer: Practically any country with a prime minister allows leaders to be removed by unpopularity.  They aren't "impeached" but just replaced.
The prime ministers could be unpopular with their own party and replaced as party leader.  That happened to Margaret Thatcher for example.
Prime ministers tend to be chosen by coalitions.  A member of the coalition can leave and join the opposition.  Then a vote of confidence can be called, fail, and a new government formed.  The exact procedure of course differs from country to country.  The new government does not necessarily need to include the leading party of the old government.
If a government can't be formed, some countries may have provisions to force a new election.
In the United States, two presidents have been impeached and put on trial.  Neither was removed from office.  In both cases, the impeachment reason was something of a pretext.  Andrew Johnson was deliberately baited into violating a possibly unconstitutional law.  Bill Clinton gave misleading answers to improper questions about his personal life.  So effectively an unpopular president could be removed by impeachment.  They'd just need to find an excuse to do so.
Comment: The term you were looking for in your Bill Clinton sentence is "perjury". It's illegal, no matter what one's excuse is.
Answer: Yes, by definition all democracies have the function you describe.  An election is a mechanism for measuring a candidate's public approval relative to other candidate's. An elected official's term eventually ends and they can be removed from power or brought back solely due to their relative approval rating.
Many, but not all, democracies have a function is used to remove an officer from power based on their approval ratings without waiting for their term to end.  These may be called recall elections, although they  may have other names in other localities.
Answer: NSBD did a great job pivoting with your question--

Impeachment is a process that can only be invoked following a crime (though, as history has shown, the individual does not always wait for the results of an impeachment proceeding, and may resign preemptively -- e.g. Richard Nixon). In the case of Richard Nixon, Senate confirmation of the impeachment was all but certain, but this not always the case -- Bill Clinton was impeached by the House (i.e. articles of impeachment based during House impeachment proceeding), but was acquitted during the Senate proceeding.
Numerous U.S. states have procedures for recalling executives. In fact, the recall (along with the ballot initiative and referendum) are key achievements of so-called progressive reform in the U.S. They are also examples of direct democracy. While California's recall of Gray Davis is one of the more well-known examples of the use of a recall, eighteen U.S. states have recall provisions.
To add my "two cents" here, it is a good thing that presidents can not be removed due to low opinion polls for three main reason: 1) polls are an imperfect measure of popular opinion so it's possible a poll does not precisely reflect "true" popular opinion); 2) unpopularity is a reflection of a president's personal and political shortcomings, and these shortcomings should be addressed through political means (elections, but also other features like federalism and checks/balances between the executive and other branches); and 3) [this one is a bit more of a stretch] like the Judicial Branch sometimes makes decisions contrary to popular opinion, so does the President sometimes have to make unpopular decisions. For example, it would be inopportune for a President to be impeached during a war or natural disaster as opposed to afterwards as a reflection of their incompetence, ineffectiveness, etc.


Identify a story about time travel with a prehistoric child and a modern-day carer who grows attached to him

Question: It's a short science fiction story about the invention of a time machine in the future. The tale revolves around scientists sending a child from the prehistoric era, who is cared for by a woman who grows attached to him. Later, a decision is made to return the child to the past. Because the woman has developed feelings for the child, she chooses to accompany him back without informing anyone.
Answer: "The Ugly Little Boy" a.k.a. "Lastborn", a novelette by Isaac Asimov, first published in Galaxy Science Fiction, September 1958, available at the Internet Archive. You may have read it in one of these compilations.
It was adapted to a 1977 TV movie, and in 1991 it was expanded by Asimov and Robert Silverberg into a novel which was published in the U.K. as Child of Time and in the U.S. as The Ugly Little Boy.
Wikipedia plot summary:

A Neanderthal child is brought to the present day as a result of time travel experiments by Stasis Inc, a research organization. He cannot be removed from his immediate area because of the vast energy loss and time paradoxes that would result, and is kept in the present by way of a Stasis module. In order to care for the boy the organization hires Edith Fellowes, a children's nurse.
Initially repelled by the boy's appearance, Edith soon begins to regard him as her own child, learning to love him and realizing that he is far more intelligent than she first imagined. She dubs him 'Timmie' and attempts to ensure that he has the best possible childhood despite his circumstance. She is enraged when the newspapers refer to him as an "ape-boy." Edith's love for Timmie brings her into conflict with her employer, for whom he is more of an experimental animal than a human being.
Eventually, her employer comes to the conclusion that his organization has exacted all the knowledge and publicity it can from Timmie and that the time has come to move on to the next project. This involves bringing a medieval peasant into the present, which necessitates the return of Timmie to his own time. Edith fights the decision, knowing the boy cannot survive if returned to his own time due to his acquisition of modern dependencies and speech. She attempts to smuggle the boy out of the facility, but when that plan fails she disrupts the integrity of the Stasis module and returns to the ancient past with Timmie.
Comment: Thank you so much ! I asked this question several LLMs and they all failed to come with correct answer. Feels so good to get help from a human)
Comment: You're welcome!


State of mutli-cycle processor during execution of instruction

Question: I was reading something about single-cycle and multi-cycle processors and I have (it seems to be) banal question: how does multi-cycle (that doesn't have pararell pipeline) processor save its state so next instruction isn't executed until currently executed one isn't done? Is it blocking start of first phase somehow?
Answer: Indeed, the start of the next instruction is blocked.
The usual way to model multi-state systems is using "finite state machines" - it is a HW logic which switches between numerous states based on:

The current state
The inputs

The outputs of a module controlled by FSM is also defined by the FSM's state and the inputs.
What happens in our case? New instruction may only be fetched in the initial state - lets call it IDLE. Once the instruction was fetched, the FSM starts to switch between operational states (for example: IDLE->DECODE->EXECUTE->WRITE-BACK->IDLE). When in a state which is not IDLE, the logic is forbidden from fetching new instructions. Therefore, the new instruction will start to execute only after the previous one ended.
Answer: Different processors differ in the designs of their state machines, but in many cases every instruction starts in some state zero (opcode fetch), and the progression of states is set in motion by the opcode which is fetched and any given opcode will always perform the same sequence of operations except that there may be provisions to early-exit instructions in certain cases such as "branch not taken".
On the 6502, state zero, in addition to fetching an opcode, may perform the last steps of the previous instruction if it entails nothing more than computing an ALU result and storing it to a register.  The 6502 does not allow deviation from the step sequence for any opcode other than via early exit, but an instruction like "ADC #$1234,X" behaves as follows:
0 -- Finish previous instruction and fetch opcode
1 -- Fetch first byte following opcode [done unconditionally]
2 -- Fetch second byte following opcode into upper-address register
     while adding just-fetched byte to X
3 -- Concatenate upper-address register with ALU result and read mem into data register
     while feeding upper-address register and 1 into ALU.
     If step 2 didn't generate carry, exit.
4 -- Load ALU result into upper half of address register and read mem into data register.
(next cycle)
0 -- Feed newly-fetched value into ALU along with accumulator; store ALU into acc.

It's interesting to note that instructions that read a value from an indexed memory location, operate on it, and put the result in a register can early-exit if there is no carry out of the lower 8 bits of the address, but instructions which need to do more with the fetched result cannot skip any steps.  For INC $1234,X
0 -- Finish previous instruction and fetch opcode
1 -- Fetch first byte following opcode [done unconditionally]
2 -- Fetch second byte following opcode into upper-address register
     while adding just-fetched byte to X
3 -- Concatenate upper-address register with ALU result and read mem into data register
     while feeding upper-address register and 1 into ALU.
4 -- If carry, load ALU result into upper half of address register (otherwise leave alone)
     ...and read mem into data register.
5 -- Store data register to memory
     While feeding data register and 1 into ALU; latch ALU to data register
6 -- Store data register to memory

Note that if the address computation in step 2 doesn't generate a carry, it would be possible to skip from step 4, but the instruction-sequencing logic has no concept of how to any skip part of an instruction other than the tail, and steps 5 and 6 are still needed.
Curiously, although the largest number of cycles required for any documented 6502 opcode is seven (illustrated above), a vintage 6502 that encounters certain undocumented opcodes will execute them in logical fashion as eight-cycle opcodes.  The CMP instruction 110xxx01 can accept any of eight addressing modes, two of which take a cycle longer than the indexed absolute addressing mode shown above, but the instruction doesn't have do do anything after computing the address.  The documented DEC (110xxx10) only accepts five addressing modes (it does not accept the more complicated ones), but an opcode byte which "ovelaps" those (110xxx11) will combine the effects of DEC and CMP, and will support all the addressing modes that CMP does, even those which end up taking a total of eight cycles.  I wonder why the "normal" read-modify-write opcodes can't use those addressing modes, since the circuitry obviously exists to make such addressing modes work correctly with read-modify-write instructions.


Mono for Android Visual Design for Visual Studio 10.0?

Question: I've installed Mono For Android Trial on my computer And I want to use with Visual Studio.
But there is a visual design for it or only I must write every thing ?
Thankyou for information
Piercarlo
Answer: No there is no visual designer included. You can however use the Android Development Tools (ADT) Plugin for Eclipse which includes a Forms Designer to design your forms (granted you do need to install Eclipse for that) - the resulting XML you can just copy and paste into your monodroid project.
Comment: MMM... I think I will use directly eclipse for gratis
Answer: Xamarin: As of Mono for Android 4.2 we now include an integrated UI Designer for creating Android layout resources in either MonoDevelop or Visual Studio.


About Selling the bitcoins for normal person

Question: It's Aashish Sharma from Nepal. I have been mining bitcoins online for a few months. I want to, if I can, sell them online for cash or USD into my PayPal account. I don't know what can I do for few bitcoins. Or can I do normal online shopping with those few coins? Help me out.
Comment: In the Netherlands we got https://bitonic.nl/, where you can send them Bitcoins and they send the value (minus transaction costs) in euro (local currency) on your bank account. Maybe something similar exist in Nepal. But make sure you can trust the company. Just out of curiosity, how have you mine them? With ASIC/FPGA/GPU/CPU? Did you make any profit after subtracting the power cost?
Answer: In the Philippines we have "coins.ph". I can easily transfer bitcoins to my bitcoin wallet at coins.ph then convert it to my local currency that is available for withdrawal on banks and remittance center. You should look for similar website that supports your local currency


how to show all layers with hotkey (emulate numpad enabled)

Question: How can I show all layers with a hotkey? ~ key does not work. (correkt key according to blender wiki) https://en.wikibooks.org/wiki/Blender_3D:_HotKeys/3D_View/Object_Mode
 - Because (I have sensei format and a swedish keyboard).
I want to quickly be able to view a background image only, hiding all objects, in use when sculpting to see my ref image for one second. - this is possible with show all layers hotkey, and so how can i find or change the hotkey for show all layers in the user pref? Thanks.
Answer: First check that you aren't in local view as this disables the 3Dview layers. When in local view you won't see the layer buttons in the 3Dview header and if you have the view name at the top of the viewport you will see (local) there.
You can find the shortcut settings in the Input Preferences, if you enter layers into the search box you will see a list of actions involving layers with the shortcut keys, clicking the key will allow you to change the shortcut used and then you can click Save User Settings to enable that shortcut each time you start blender.
Answer: The ` key (tilde) should work with Emulate Numpad activated. It might have been remapped to something else, refer to the answer by @sambler for relevant details.
There are several other ways to work out this problem:
Use the Local View on some empty object

Local view isolates the selected object or objects, so that they are the only ones visible in the viewport.

Local View

Add an emtpy from Shift+A > Empty.
With it selected, press Numpad Slash on the keyboard (if Emulate Numpad is used, / button is accessible for that).

The viewport will enter Local View for the empty object; as it is small and doesn't reflect any geometry it won't mess around in the scene. The background reference image will be available for fast and easy previewing.
Note:

you can also use any object from the scene for that; select it and enter Local View.
this way is accessible from the keyboard, however you should have some dummy object for it to work.

Use background image settings
Background images can be set up to be visible behind the scene objects or in front of them.

Front / Back
Choose whether the image is shown behind all objects, or in front of everything.

Note:

in order image to fully cover the objects the Opacity setting should be increased to 1 (or something higher than default).

this setting is inaccessible from the shortcut; you'll need to use Background Images rollout a lot from the Properties shelf.
Answer: The default key for "show all layers" on a Swedish keyboard is Ö.


Is the cosmological horizon of an accelerated observer spherical?

Question: I guess the question says it all. If you move across the universe (I mean: across the cosmic background radiation) with accelerated motion, does your cosmological horizon (I mean: the one you see) remain spherical - or does it become oblate or prolate?
Answer: For our universe the geometry of the horizon for an accelerated observer is a complicated problem, and most importantly depending on the nature of the dark energy, which is unclear for now, so instead, let us consider a simpler question of the horizon of a uniformly accelerated observer in a de Sitter universe (a universe without ordinary matter and with cosmological constant).
Since de Sitter space is maximally symmetric, we can offer a simple intuition for a uniformly accelerating observer in such  spacetime. First, let us pick an inertial (non-accelerating) observer, and rigidly attach to her a second observer held at a fixed distance (and fixed angular variables) from the first one. This second observer would be experiencing constant acceleration toward the first, inertial observer. The situation could be visualized as a first observer dragging the second against the Hubble flow with a rope of fixed length. The horizons seen by both observers are the same, since any signal that could reach one could also reach the other. So a horizon seen by an accelerated observer is simply a spherical cosmological horizon of an inertial observer located forward along the direction of acceleration.
While the internal geometry of the horizon of an accelerated observer is spherical, because the spacetime is curved, its appearance would be distorted, more so for larger accelerations.

Technical details
The de Sitter universe as seen by an accelerated observer could be best understood with the help of accelerated coordinates, defined for example in the paper:

Podolský, J., & Griffiths, J. B. (2000). Uniformly accelerating black holes in a de Sitter universe. Physical Review D, 63(2), 024006, doi:10.1103/PhysRevD.63.024006, arXiv:gr-qc/0010109.

The metric in this coordinates takes the following form:
$$
d s^2 = {\ 1\over[\sqrt{1+a^2A^2} + A\,r\cos\theta]^2}
 \Bigg\{{d r^2\over1-{r^2\over a^2}}
 +r^2(d \theta^2+\sin^2\theta\,d\phi^2) -
 {\textstyle \left(1-{r^2\over a^2}\right)d t^2\ }\Bigg\} \>.
$$
Here $a$ is de Sitter length parameter, $A$ is the absolute value of 4-acceleration of observer at $r=0$,  $|A|\equiv |\dot u^\mu |$ (it is identical to the modulus of the 3-acceleration measured in the natural local orthonormal frame of the observer in units with $c=1$). This metric is conformal to the standard static form of the de Sitter metric  to which it reduces when $A= 0$. Cosmological horizon in this coordinates is located at $r=a$, but because the conformal factor depends on the angle $\theta$ there is no spherical symmetry anymore. In the direction of acceleration (it corresponds to $\theta=\pi$) the distance to the horizon is larger than in the non-accelerating case while  in the opposite direction ($\theta=0$) horizon is closer.
For small accelerations, ($aA\ll 1$) the distance between accelerated observer and the corresponding inertial one is approximately $a^2 A$, so the cosmological horizon  is a sphere observed from a slightly off-center position.
For large accelerations $aA \gg 1$ the horizon is a short distance $A^{-1}$  behind the acceleration direction while in the forward direction the distance to the horizon is double the distance from  inertial observer. At a length scales much smaller than $a$ the horizon behind could be interpreted as a planar Rindler horizon.
Note, that if we approximate our universe by a de Sitter space, the accelerations for which $Aa=1$ are very small from the everyday viewpoint, about $10^{-9}\,\text{m/s}^2$.
Comment: You write "The horizons seen by both observers are the same, since any signal that could reach one could also reach the other." This may be the case if the observer at the end of the rope is dragged behind. But there are many other geometries, and there the statement seems not obvious or even wrong - at least at first sight?
Comment: You also wrote: "While the internal geometry of the horizon of an accelerated observer is spherical, because the spacetime is curved, its appearance would be distorted, more so for larger accelerations." What does this mean exactly?
Comment: If in the far future our causal patch of the universe is asymptotically de Sitter, then the horizons of inertial and accelerated observer would be the same. And my rope analogy still applies, only the rope must be spooled and unspooled as the universe evolves to maintain its constant tension. In the opposite direction, if the dark energy in the universe decays fast enough, there would be no cosmological horizons at all for inertial observer, but accelerated observer would still have a horizon, that is indistinguishable from Rindler's h. at late times.


Alcatel Onetouch Idol 3 won't work with bluetooth

Question: I have an Alcatel Onetouch Idol 3 that I purchased in January.  It has static, breaks up and sounds muffled when I have my bluetooth on and wifi is on.  If I turn my wifi off it works ok. I have tried 4 bluetooth and returned the Alcatel once. Has anyone else had this problem or does anyone have a solution?  I am ready to cut my losses and purchase another phone.
Answer: Wi-Fi and Bluetooth both operate in the 2.4 GHz frequency band.  As such, interference is to be expected; it's not your particular phone.  Here is an interesting paper on it.
You could see if your home Wi-Fi router supports the 5.0 GHz band, and switch to using that exclusively.  You could also try changing the Wi-Fi channel.
Comment: Thanks for your response, but the paper is from 2002 and this is the first time I have had this problem.  My router does support 5.0, however, the problem I have happens when I am in my car also, and there is no wifi, but my wifi is turned on on my phone.  The static is not just interference that can be overlooked, it is so bad that I would be repeating myself every few minutes or less and the same for the person on the other end.  It sounds like they are in water trying to talk.  I will try the 5.0 GHZ band at hoe and see if it makes a difference and update.


Campagnolo 1x13 crankset (Ekar) with Sram Rival eTap AXS XPLR 1x12s Disc Groupset

Question: Can a Campagnolo 1x13 crankset (Ekar) be used with Sram Rival eTap AXS XPLR 1x12s Disc Groupset? I really dig the look of Campagnolo crankset, hence the question.
Thanks!
Answer: With its 12s AXS road groups (but not its 12s MTB groups), SRAM departed from the industry-standard roller size. SRAM felt they had to use larger rollers because the chain was now thinner - although Shimano and Campagnolo have somehow been able to make chains with standard size rollers.
An AXS chain will not mesh precisely with the Campy ring. It could cause faster and undesirable wear on the Campy ring. Adam Kerin of Zero Friction Cycling cautions that such a setup might cause the drivetrain to run rough. Thus, I would not do this. However, in practice, the setup might work - or it might appear to work, but it might wear faster than desired, and it might wear in such a way that it precipitates a failure under power. The probability of the latter is probably very low, but it also can't be quantified. If it's greater than zero but you can avoid it with trivial effort, then why not do so?


How to compare two columns in two different Sharepoint lists

Question: I am trying to compare the value of two columns where their origin is two different Sharepoint lists, in the first column called 'Solicitante' belongs to list A where the column type is a line of text, the second column called 'Usuario' belongs to list B equally the column type is a line of text.
I need to validate and compare is that if the two columns are the same, it starts an approval and in case they are not the same, it will send an email.
As help I have consulted the following topic where he comments that he also wants to compare two columns, I have tried to replicate it in my flow but I am presenting the problem that emails begin to be sent for each record that I have my list A taking into account that the value of the column 'Solicitante' and the value of the column 'Usuario' are the same, case that should not happen since if they are the same no mail is sent.
I have built the flow as follows:

First I get the items from list A and then I get the items from list B respectively called 'get items' and 'Get items 2'

Then I have a validation (really nothing important for the question) but I use it to validate if the reason is New or replacement, it is really not important to comment on it in this case since this validation works correctly.

Here comes the important thing, when the reason is New in the previous validation will enter to perform the validation that I am looking for to compare the two columns, following the indications of the topic that I commented above I make the comparison of the two columns adding an Apply to each for each value obtained from the elements.

As you can see in the 'Apply to each 6' I refer to the value I get from the step 'Get items 2' and in the 'Apply to each 7' I refer to the value I get from the step 'get items', later in the condition (Valid user leader) 3 I perform the validation of comparing the two columns 'Solicitante' and 'Usuario' these columns are obtained from the steps of 'get items' and 'Get items 2' respectively.

So far my complete flow, in summary as I already mentioned the problem I am presenting is that for each record I have in list A an email is sent, a case that should not happen because if the columns of list A and list B are the same, the emails will not be sent.
Another point to keep in mind, is the validation if it is being fulfilled successfully since it also initiates the approval along with that also sends the emails, is there something that is wrong in my flow ?
Answer: How to compare items in two SharePoint lists in Power Automate
Define the synchronized columns. The flow begins with the definition of the columns that are synchronized.
Get items from both lists. To compare the items, you must get the items.
Compare the items.
Compare the values in synchronized columns.
Get the changes.
Regards,
Peter
Comment: Thank you for your answer, do you think that part of what I have built so far in the flow can be solved as you mention? Could you add an example based on what I have built from my flow to complete it?


OnePlus 8T battery capacity

Question: Using the AccuBattery app I'm told that the design capacity of the battery is 4500 mAh, but after 3 significant charging sessions the current capacity is 2095 and has never reached 50% of the design capacity. I've tried contacting AccuBattery and OnePlus to see if I should be trying to exchange this brand new phone given this report. I haven't gotten an answer yet. Does anyone else have any info about OnePlus 8T actual battery capacity or how to deal with this?
Answer: This is the answer from AccuBattery support (OnePlus 8T has a dual battery apparently):

Unfortunately there's no solution for this at the moment as the system
isn't reporting the values in the correct manner. It looks like more
devices with dual batteries have this issue but we currently don't
have these devices to test with so we can't figure out the exact
underlying problem and build a workaround for it, but the most
apparent issue is that the device reports half of the charge current.
The health estimate can still be calculated if you do a manual
benchmark like this:
https://accubattery.zendesk.com/hc/en-us/articles/213575425-How-to-manually-benchmark-your-battery-health
but the maximum you will get is half the design capacity so you will
need to multiply the mAh estimate by 2 (or change the design capacity
so it's half the original value) and make the assumption that the two
batteries are used at the same rate; which is probably not what's
actually happening (one battery might be used to charged the other for
example).
Comment: you can mark this as an answer, while there is not better solution

OnePlus 8T battery capacity


Phaser Controls

Question: In star trek, how does the crew change different  attributes with only two buttons. In the films and series, they change: intensity, width, frequency setting, security clerance (authorisation to fire), self-fire (when wesley uses it as a decoy), self-destruct. How can this be when there is only two buttons, also, how is this shown when again, there is only a single stat indicatior bar (strip atop the phaser)
Comment: It's worth noting that my iPhone only has two buttons.  Phasers don't have interactive screens, but "number of buttons" doesn't necessarily relate to "number of controls."
Comment: Sure, I can imagine the buttons being reassigned, but how is that done, through multiple buttons pushing in a sequence?
Comment: Yeah, I don't really know.  Though, in the world of pure speculation, if I were designing phasers, I'd have them tied to the communicators.  Computer hears you say "Set phasers to stun," and then a "confirm?" button lights up.  You hit Confirm, and you're good to go.
Answer: It's not really made that clear. It seems that those who've been trained on phaser operations have been told how to access the additional features.
The TNG Technical Manual has some additional info but no real answers.

There's also some info on how to cause an explosion (basically, by dickering with the safety interlock).

As a result of the basic physics required to produce a phaser
discharge, an undesirable but unavoidable process exists, namely that
of phaser overload. The accepted methods employed for energy storage,
flow, control, and discharge allow for an amplified rebounding to
occur from the storage cell to the prefire chamber, and simultaneously
back to the storage cell.
While the total energy within the system
remains the same, the flow pressure is elevated during the rebound, to
the point where the storage cell cannot reabsorb the energy fast
enough. The barrier field will be reinforced during this buildup,
effectively preventing normal discharge through the emitter.
Comment: Thanks, good info, perhaps pressing the two function buttons cycles through options?
Comment: @pioneer - that seems very likely. Setting it to overload, for instance seems to require a non-trivial level of knowledge
Comment: @Pioneer It could also be that they are each similar to a d-pad, which would essentially allow each button to act as four (with pairs being mutually exclusive).

Phaser Controls


How to host a webpage with AWS using IP address

Question: I have a free tier AWS server. It is a Ubuntu server and I a beginner. I don't have a registered domain name, I have HTML and CSS code for the webpage. I normally see that I can access websites using their registered IP addresses. So are there any tutorials or documentation where I can find out how to deploy my HTML code to become a public website that can be accessed through the IP address that Amazon has provided.And note I haven't yet installed apache as I have not figured out what I should do with it. It would be great if someone can direct me to on how to make the HTML code public where anyone can view it using the IP address. Thanks in advance....Caio.
Comment: You should start learing using a non-public Virtual Box or something similar.
Answer: In AWS, go to elastic IP address, and associate a public ip with your instance. Then, install a LAMP stack on your instance and upload your html files to /var/www/
The trick is the elastic public IP address.
For more on the Apache / LAMP etc, ask a more direct question about those, or follow a tutorial on Ubuntu.com


Interpretation of logistic regression with normalized features

Question: With logistic regression, a one unit change in $X_1$ is associated with a $\beta_1$ change in the log odds of 'success' (alternatively, an $\exp(\beta_1)$-fold change in the odds), all else being equal. But if one applies an initial normalization to cross-correlated features (e.g. subtract by mean and divide by standard deviation), is it valid to simply apply that inverse transformation to $\beta_1$ to interpret a one unit change in the un-normalized value when considering the raw data? The normalization explained above has no effect on the cross-correlation of the features themselves, but I am curious if it would affect the outputs (and signs specifically) of the $\beta_i$ that are being trained.
Answer: The interpretation of logistic regression coefficients is similar in the case where you've standardized the data (subtract mean, divide by standard deviation of each feature). By standardizing, you effectively change the units to standard deviations above/below the mean. So, a one standard deviation increase in $X_1$ corresponds to a $\beta_1$ increase in the log odds. If you fit to standardized data, you can transform the coefficients back to the original units (or vice versa).
If you fit a vanilla logistic regression model to standardized vs. non-standardized data, the coefficients will take different values in each case, but both models will fit equally well (or poorly). But, this is not necessarily true if you're fitting a regularized model (e.g. $\ell_1$ or $\ell_2$ penalties on the coefficients). In this case, it's common practice to standardize first, so that all features are penalized equally.
Comment: There is also the effect that if you mean zero your y axis for linear regression, the regression coefficients become uncorrelated (and normally distributed, so thus, independent). But I am unsure if this applies to logistic as well.


Proving that $(u+v,u+w,v+w)$ is linearly independent

Question: Let $V$ be a vector space over field $f$ with characteristic not equal to 2. Prove that $(u+v,u+w,v+w)$ is linearly independent if and only if $(u,v,w)$ is linearly independent.
Comment: Welcome to Stackexchange. You'll find that simple "Here's the statement of my exercise, solve it for me" posts will be poorly received. What is better is for you to add context: What you understand about the problem, what you've tried so far, etc. Something to both show you are part of the learning experience and to help us guide you to the appropriate help. You can consult [this link](http://meta.math.stackexchange.com/q/9959) for further guidance.
Comment: One implication is obvious. For the other one: $u-v=u+w-(v+w)$.
Comment: What are you approaches?
Answer: Suppose $\{u,v,w\}$ are linearly independent, and further that there are constants $a,b,c \in F$ such that $a(u+v)+b(u+w) + c(v+w) = 0$.
Distributing, we see $au+av + bu + bw +cv + cw = 0$, but collecting like terms, we get $(a+b)u+(a+c)v+(b+c)w = 0$, but since $u,v,w$ are linearly independent, $a+b = 0$, $a+c = 0$, and $b+c= 0$. But then $a=b=c=0$. So $\{u+v,u+w,v+w\}$ is linearly independent.
The other direction is similar.
Comment: I like this answer much better
Comment: @JonWarneke It's more elementary, just using the definition of independence/dependence. But your method works fine too, I think. Especially once you know elementary matrices and the determinant manipulation thereof, it works just fine.
Answer: Suppose $u$, $v$, and $w$ are independent; then we can extend this list to a basis of our vector space. The determinant of a matrix with these basis vectors as its columns is nonzero iff the columns are independent, so it is indeed nonzero. Moreover, the determinant is invariant under elementary column operations, and the other list you suggested can be obtained in this way. Hence the other list is part of another basis, and is independent.


Binomial data and PCA and cluster analysis

Question: I have obtained responses on around 48 items measuring employer attractiveness. The goal of my analysis is to cluster respondents according to these employer attractiveness dimensions. I plan to reduce the dimensionality with PCA and also confirm the structure with CFA before getting to cluster analysis. 48 items were measured in forced 4-point Likert scale, but the data I obtained for analysis was transformed by another research to binomial level - important or not important (0 or 1 values). I was wondering what effect that can have on PCA and cluster analysis that these data are binomial. Can these analysis techniques be executed on binomial data?
Answer: Using a "common sense" approach the trasformation from 4 level variables into dicotomic variables have clearly reduced the richness of information expressed in each variable, so I would expect more difficulty in extracting conclusions from statistical analyses on such dataset than if you would have analyzed original data.
Considering the topic you have addressed, PCA/Factor analysis and Cluster analysis for binary data, I would give a look to:
* Homogeneity analysis: (see  http://www.r-bloggers.com/finding-patterns-amongst-binary-variables-with-the-homals-package/), a sort of factor analysis that can be used to analyze binary data.
* The mona function in R cluster package: a cluster analysis tailored for binary data (see Cluster analysis of boolean vectors in R)


Is $(-1)^{1/8} + (-1)^{7/8}$ ever a value whose real component is $0$?

Question: Is
$$(-1)^{1/8} + (-1)^{7/8}$$
ever a value whose real component is $0$?
Is this ever true in modular arithmetic, hypercomplexes, and/or both?
Comment: If a number has a "real component", that usually implies it also has an imaginary component. In modular arithmetic there's no such thing as a "real component".
Answer: If I look in the complex plane at the eight numbers that when raised to the eighth power form $-1$, they are $\exp(\frac {2k+1}8\pi i)$ for $0 \le k \le 7, k$ integer.  The seventh powers of these are the same set.  I can certainly pick two that have a real part of their sum being $0$, for example $\exp(\frac {1}8\pi i)$ and $\exp(\frac {-1}8\pi i)=(\exp(\frac {9}8\pi i))^7$
Working modulo $2$, the eighth root of $-1$ is $1$.  The seventh power of $1$ is $1$ and $1+1=0 \pmod 2$.
Comment: LOL at the mod-2 solution.
Comment: @Joe Z: OP did ask about modular solutions. I tried some others first, but they didn't work.
Comment: That's an interesting problem, actually. Are there any other systems besides $\mathbb{Z}_2$ where there exists that root?
Answer: I'm pretty sure that in just the plain old complex numbers, $Re((-1)^{1/8} + (-1)^{7/8})$ is $\cos(\frac 18 \pi) + \cos(\frac 78 \pi) = 0$.
In fact, in general, if $a+b=1$, $(−1)^a+(−1)^b$ will have a real component of $0$.

However, you seem to be focusing on modular arithmetic and number systems, so I'll try to give you an answer in modular arithmetic as well.
In $\mathbb{Z}_n$ (the numbers modulo $n$), $(-1)^{1/8}$ doesn't really mean anything the way we usually talk about it, so we need to redefine it from first principles.
When we talk about $n^{1/k}$ or $\sqrt[k]n$, really what we mean is some number $m$ so that $m^k = n$.
So we define $(-1)^{1/8}$ as some number $m$ such that $m^8 \equiv -1 \pmod n$. Note that this number might not always exist — for example, in $\mathbb{Z}_3$, neither $1$ nor $2$ has an eighth power of $-1$. And there might be more than one — say, in $\mathbb{Z}_{17}$, the numbers $3, 5, 6, 7, 10, 11, 12, 14$ are all possible values of $(-1)^{1/8}$.
So we have $(-1)^{1/8}$, now we need $(-1)^{7/8}$. Well, going by the rules of exponents, we can just do $(-1)^{7/8} = ((-1)^{1/8})^7$, so supposing you still have that $m$ from above, $m^7$ will be your $(-1)^{7/8}$.
To recap, this means that in $\mathbb{Z}_n$, we're looking for a number $m$ that satisfies both $m^8 = -1$ and $m + m^7 = 0$, which fits your expression of $(-1)^{1/8} + (-1)^{7/8} = 0$.
As Ross Millikan pointed out in his answer, $\mathbb{Z}_2$ is one system in which this works — the number $1$ has $1^8 = 1$ and $1 + 1^7 = 0$.
But unfortunately, in $\mathbb{Z}_{17}$, none of those eight numbers we listed above satisfy both these equations. ($4$ and $13$ actually satisfy the latter one, but they're not eighth roots of $-1$.)
Try other values of $n$ and see in which ones a suitable $m$ exists.
Answer: If we are assuming that $(-1)^{7/8}=\left[(-1)^{1/8}\right]^7$, then no matter which eighth root of $-1$ we take, we get
$$
\mathrm{Re}\left[e^{i\pi(2k+1)/8}+e^{i\pi(14k+7)/8}\right]=0\tag{1}
$$
The exponents sum to $i(2k+1)\pi$ which means the real part of the sum in $(1)$ is $0$ since
$$
\cos(x)+\cos(\pi-x)=0\tag{2}
$$
Thus, no matter which eighth root of $-1$ we take, we get that
$$
\mathrm{Re}\left[(-1)^{1/8}+(-1)^{7/8}\right]=0\tag{3}
$$


MS Word footer and chapter numbering issues

Question: I hope someone can help. I am editing a book that a colleague formatted (he has since retired). The first section is numbered in roman numerals. All is well until the beginning of Chapter 1. In the footer we use a hyphenated system Chapter 1, page 1 would be 1-1.
For some reason, My chapter 1 starts with 2-1. The rest of the book (9 more chapters and an appendix) is numbered correctly. When I format page numbers in the header and footer tools, nothing changes. As far a I can tell the footers are identical! Any ideas?
John
Comment: Check the fields for section numbering, make sure they are updated, compare them with those of correctly numbered sections. Hard to be more specific without more details
Answer: John, this is actually pretty simple to fix.  First, verify that your footer for Chapter 1 is not linked to the footer for the front matter.  From the Tell Me box, enter Edit Footer.  This will open the footer in your document.  Advance to the Chapter 1 section.  On the Header/Footer Design menu, verify that "Link to Previous" is not selected (callout 1).

Once you've verified that your footer isn't linked to the previous section footer, select the "Insert" ribbon, then select the small arrow to the right of "Page Number" (callout 2). This will open the Format Page Numbers dialog box (callout 3).

Next, you'll want to select the number format (1, 2, 3 ...) (callout 4); select "Include chapter number" (callout 5); and select the correct format for page numbering ("Start at 1") (callout 6).

Select "OK."  If you don't have a list style applied to your Section 1 heading, you will get a warning.  In this case, apply the appropriate list style to your Heading 1 style.  If you need help with List Styles, please create a new question.
Good luck and respond back to let me know if this solves your problem.


to fire/ terminate/ lay off

Question: What verb would sound more like a legal term (to be used in documents) if one wants to write that he fires a worker from director's position? To fire? To terminate position?
Comment: The problem is, I definitely will not be able to find out the exact reasons. I need to translate Shareholder's resolution, which contains just two sentences in which he resolves to fire the old worker and to hire a new one to the same position. I guess I need a legal yet general term.
Answer: I've seen "terminate" used in most documents. I does indicate that it was an intentional firing, and for cause, rather than more gentle verbiage such as "released" which could mean that the company merely couldn't maintain the salary, or even that it was relatively mutual.
Answer: It depends on the circumstances in which it is happening. If it is a sudden 'summary dismissal' for misconduct, probably 'dismiss', is the right term.
If it is redundancy (what Americans call 'lay off') then one of those terms might be best used.
If it is dismissal with notice etc for poor job performance, then 'severance of contract', 'termination', might be appropriate. If this happens in the UK, it is likely to be subject to intense legal scrutiny, if the former employee decides to go to an Industrial Tribunal.
For a senior position most employers are nowadays advised to come to an arrangement by consent, and agree a termination package. The employee in question would be given a termination agreement for signature (known in the UK as a 'compromise agreement' on which he or she would be advised by any responsible employer to take independent legal advice).
In America, employment law is heavily weighted toward 'hiring practices'. You have to be desperately concerned about the manner in which you hire people so as to show no discrimination. In Europe it is weighted far more toward 'firing practices'. Sacking a senior person can involve negotiating a legal minefield.
Comment: Sadly, the circumstances cannot be disclosed to me. I think I will use more general "dismiss" rather than "terminate" ("terminate" I suppose is more likely to be used in the passive form, and I need an active form).
Answer: In US usage, it is common to overuse the term to fire. Correctly construed, firing = termination with cause (i.e., the employee has violated the employee handbook, performed poorly over time, or broken a law). However, as applied especially to terminating executives, cause is virtually irrelevant, hence the overuse of the term to fire (e.g., as we see on the television show The Apprentice). By comparison, termination without cause = layoff (which by definition is a decision that considers the economics of maintaining the affected job position or number of employees in a given position). In US practice, a layoff under this definition requires reporting to the state, for purposes of recalculating the employer's unemployment insurance premium (because the probability of a layoff with that employer has just increased if one uses past statistics to predict future likelihoods). For this reason, the difference between a layoff and a firing in the US is actually quite substantive, especially for wage-grade (FLSA-exempt) employees. The term dismissal in US usage is synonymous with termination but has a gentler quality. For even greater gentleness, one can say that one has let go of the employee. Because a reference to termination (or dismissal, or letting go) by itself leaves cause unspecified, one can use it in reference to a firing if one wishes to be vague on the matter.

to fire/ terminate/ lay off


How is the squeaking sound produced, if you rub a finger over a wet, smooth, solid surface?

Question: If you rub a finger over a variety of wet, smooth, solid surfaces (like glass, plastic, metal, etc.) you hear a squeaking sound.
How is that squeaking sound produced?
Comment: Have you looked at https://en.wikipedia.org/wiki/Stick-slip_phenomenon?
Comment: Is it not resonance?
Answer: Your finger first sticks to the glass, then slips, then sticks again, then slips and so on.  Each time it sticks it exerts a force on the glass.  If those forces occur at a steady rate that matches the glass's resonant frequency, it causes the glass to vibrate at that frequency with enough amplitude to be audible.  The same principle applies to violin strings rubbed with a bow, squeaky door hinges, fingernails on a chalkboard, etc.
Comment: @RichardHDowney-I can even feel it now when I rub my finger slowly on a glass snowball filled with water.


How do I set icons and description of file types associated with Notepad++?

Question: I tried using Nirsoft's File Type Manager to change the icons and file descriptions of individual file types associated with Notepad++. However, if I change the icon of one file type, all of the other file types associated with Notepad++ also change. How can I make each file type have a different icon?
Answer: You might need to change it for individual file types one by one. Please check this http://www.winhelponline.com/blog/change-file-type-icon-windows-7-vista/
Be careful while editing registry since it can cause boot failure. Make sure you have back ups too.


Which is better to use baking soda or baking powder for making cakes?

Question: I'm confused. I would like to know which is better to use: baking powder or baking soda for making cake. Or which is best for what recipes.
Answer: They are different ingredients and one does not replace the other. Baking soda is an alkali which can react with acidic ingredients in a recipe to produce carbon dioxide which helps baked goods rise. Baking powder includes baking soda (or similar) and an acidic ingredient, so it is more 'self-contained' rather than relying on something else in the recipe. (Self-raising flour is basically flour with baking powder mixed in, to be even more self-contained.)
But you should just follow whatever is in the recipe you are making or adapting. If you have found a recipe you are trying to follow which does not make it clear you could post it in your question and we could try to work it out from the other ingredients.
Comment: I want to make cakes and and bake some breads. In those recipes it was mentioned baking soda and somewhere it is mentioned baking powder. That's why I got confused. Thanks for your answer.


Is there a risk-neutral measure if there are two stocks with different drift terms?

Question: There are two stocks: $S_t$ and $P_t$
$$dS_t = S_t(\mu dt + \sigma dB_t)$$
$$dP_t = P_t((\mu + \varepsilon) dt + \sigma dB_t)$$
Is there any risk-neutral measure?
My thoughts are pretty simple: $μ$ is for the physical measure, so there's no risk-neutral measure. Please shed light on this question.
Answer: Well there can definitely be a risk-neutral measure but only one of the processes is a tradable. For instance, consider the total return process of a stock $S_t$
$$
dS_t = \mu S_t dt + \sigma S_t dW_t
$$
and its price return
$$
dP_t = (\mu - q)P_t dt + \sigma P_t dW_t, \quad P_0 := S_0
$$
Under the risk -neutral measure you have exactly the same SDEs with $r$ replacing $\mu$, but only one of them is tradable. In this example the total return process is tradable, the price return is not.
Comment: Which is proof that multiple choice should be forbidden in the (applied) sciences. I have no clue what the assumptions are for the multiple choice test. Is it stated that $S_t$ and $P_t$ are both tradable? If so that would lead to arbitrage since one of them would have drift $r$ and the other $r-q$ and yet both are tradable. I'm not going through all the other possibilities, it all depends on assumptions, and I'll leave that to you.
Comment: Thanks for your answer, so the method is to modify dPt and there's one unique risk-neutral measure? This is actually a multiple-choice question with:
(a) There exists a unique risk-neutral measure.
(b) There does not exist a risk-neutral measure.
(c) There does not exist an arbitrage.
(d) There exists more than one risk-neutral measure.
Comment: Just feeling weird because I think risk-neutral measure means no arbitrage, then (c) actually includes (a) (d)
Comment: Thanks, they are both tradable. I could leave the multiple choice behind, but still curious about the definition of having a risk-neutral measure. So how can I tell if there's a unique measure or more than one measure?
Comment: Good question. Short answer: there is a unique risk-neutral measure if and only if all possible claims on a process is traded (and therefore replicable), no bid-ask and no transaction costs, and infinite liquidity. Clearly too much to ask for, hence unique risk-neutral measure will always be wrt to a certain set of instruments and assumptions. I think there could be quite a few questions on this topic asked already. Otherwise post a new question maybe.
Comment: Thanks, but can I simply post this multiple choice thing as a question? Just want to discuss based on the question.


Two check-box's in one check-box list

Question: I am currently working on converting an application from access to C# and have come across an odd control I need to replicate. In access there is a list of check-box's, for the current month the user is looking at, which has everyday of that month with two check-box's beside it, D and N (for day and night). So my question is what would be the best way to implement this. I am thinking of creating it programatically with two check-box lists side by side but wondering if you can put two box's in one list
<code>June 1 [D] [N]
...
June 31 [D] [N]
</code>
Comment: I see no reason for the ms-access tag here, as it is completely tangential to the actual question.
Answer: You could use a DataGridView and create two CheckBoxColumns in it
Answer: If you really want to maintain the exact look and feel, you can use two checkboxes side by side with a separate Label control, then pop them in a DataRepeater to repeat them for each row of data.
However, using a DataGridView with two checkbox columns will be much easier.

Two check-box's in one check-box list


Is "Toll fee" correct or not?

Question: I saw a tweet on twitter and he was asking if "toll fee" is correct because it is "redundant". I am unsure about the answer because here in the Philippines, we tend to, sometimes, double the noun -- the same with the double negatives Americans do. I then searched whether words like "charge fee" and "tax fee" exist and there was nothing to look up for -- at least not "tax service fee". Is it correct to consider the word "toll fee" or it depends on the Linguistics of our country?
Comment: It seems redundant to me, because a toll is the fee for using a bridge or section of road.
Comment: Just because a term or phrase seems to be redundant does not mean it is "incorrect." The language is full of idiomatic pleonasms like *join together*, *temper tantrum*, or *the weather outside*.
Comment: @KateBunting - I'll believe it's redundant when I read the certificate of redundancy certificate from the Department of Redundancy Department.
Comment: Sometimes, special usages arise (perhaps in an attempt to disambiguate locally, perhaps through ignorance of standard usages) but these are non-standard unless they gain wider acceptance (and they are thus off-topic on ELU).
Comment: Well, you could have a toll road or a tool booth, so a toll fee emphasizes the amount you pay at the toll. It's like "Cash, only, no checks", which may be repetitious but avoids the next question ("What about a personal check?")
Comment: Is a "death toll" a fee?
Answer: Yes, it can be correct.  It would usually refer to a fee charged for a toll generally paid by someone else.
Such fees are common on rideshares ("Toll fees are included in the individual ride breakdown in your ride history"), rental cars ("you may be charged an extra fee on top of the $6.00 toll fee"), etc.
Anecdotally, it also appears to see some less common colloquial usage in the redundant sense, similar to "ATM machine" or "PIN number".
Answer: It is not an American English idiom. If you are asking could it be an idiom, then sure it could be in another culture. Often doubled or act as intensifiers or as sarcastic commentary, so toll fee might fit right in there.

Is "Toll fee" correct or not?


How do I communicate with the internal and external stake holders about project delay?

Question: We have committed a one month timeline to the client for a project delivery. We needed some data from the client for meeting this dead line. We have emailed the requirement before timeline commitment. It has been 3 weeks and the client has not sent the data, but we have not done any follow-up on it as well. We are delayed on the project delivery.
How do I communicate this with the internal and external stake holders as a project manager?
Comment: Hopefully you had a clause in the contract that cancels any penalty clause if the client does not deliver data crucial to the project.
Comment: Just as a side note: if your role is Project Manager, communicating with stakeholders is a fundamental part of your role. Once this is over, you may want to consider training to make sure you're up to speed.
Comment: _Should I apologize for not following up?_ No. They'll make it your fault. Start chasing your client contact daily and cc your internal stakeholders. If you have no adequate response, ask internally which other client contacts should be copied in.
Comment: And point 4 [deleted] - if your developers create dummy data, make certain you have the correct spec, if necessary asking the client to review a sample of your data and confirm in writing that it's correct.
Comment: When you requested the data, did you let the client know what the delivery deadline was? I'd typically add that to my project risks adding each day past that deadline will add 1 day to the project timeline.
Comment: _"We have committed a one month timeline"_ Did you commit to a _duration_ of one month (i.e. concerning billable hours and cost), or did you promise to get it done exactly 1 month from then (i.e. concerning timing)?
Answer:
How do I communicate this with the internal and external stake holders as a project manager?

First, you need to follow up with the client and get the required data.  After you have acquired this data, speak with all the stake holders and let them know that the project will not be completed by the current timeline and propose a new timeline.
In the future, do not commit to a timeline when you do not have all of the requirements ready or at least factor in the time required to gather all the requirements into the timeline.  The other thing you should do, especially for critical roadblocks, is to follow up with requests.  Three weeks is a ridiculous amount of time to let pass without a followup.  Learn your lessons from this project so that you can avoid making these same mistakes again.
Answer: I think that 'sf02' does point a good way forward for you now, but you did err very seriously by not immediately following-up with the client.
Anytime you ask for input, you must make it clear "when and why you need it."  You also need to maintain a written "contact log," and a reminder system.  As soon as a contact is completed, immediately write down a record – "minutes" of the meeting.  What you talked about, who you talked to, what you discussed, what you agreed to, and when you can expect it.  Add all of these to your schedule.
Software used by salesmen – such as the venerable Act! – routinely includes this sort of functionality and it can be very valuable.  You need to learn to "live by a schedule" and to explicitly document everything that occurs when it happens.


How many doses does brewing potions create?

Question: How many doses does brewing potions create? I know there is a similar question floating around that dealt with poisons. I ask cause one potion dosage may differ depending of its use (alchemically, ingested, etc). Is a single brewing only a single application? Is there rule/s for a cost effective mass production? How do apothecaries make potions in bulk and make a viable profession with it?
Comment: I am noticing a trend with your questions where they often require quite a bit of basic editing. I understand if English is not your first language that some of the copy-edit can be complicated and don't mind that so much, but with 1.4k reputation you really ought to use tags correctly. Please take a bit more care and effort with your questions before asking others to expend care and effort helping you.
Answer: A character creates a single dose of potion for every potion created.
There is no mention of doses at all in the magic item creation rules or potion creation rules, but each potion can only be used once, as they are Use Activated magic items:

Use Activated: This type of item simply has to be used in order to activate it. a character has to drink a potion, swing a sword, interpose a shield to deflect a blow in combat, look through a lens, sprinkle dust, wear a ring, or don a hat. Use activation is generally straightforward and self-explanatory.

And that can only be used once (from Potions):

A potion is a magic liquid that produces its effect when imbibed. Potions vary incredibly in appearance. Magic oils are similar to potions, except that oils are applied externally rather than imbibed. A potion or oil can be used only once. It can duplicate the effect of a spell of up to 3rd level that has a casting time of less than 1 minute and targets one or more creatures or objects.

This is evidenced by the Dilution Alchemy discovery for alchemists, which also allows them to increase their daily limit of doses created by one.

Once per day, the alchemist can dilute any one potion or elixir, creating two doses of the same potion from one.

However, it seems you have the wrong idea how profiting from magical item creation is supposed to work in Pathfinder, I suggest you take a look at the Crafting Magic Items for Profit topic.
A character is also allowed to create up to four potions in a single day (if they cost up to 250 gp), rather than the usual one magic item per day, usually limited to one day per 1000 gp limit.

Creating an item requires 8 hours of work per 1,000 gp in the item's base price (or fraction thereof), with a minimum of at least 8 hours. Potions and scrolls are an exception to this rule; they can take as little as 2 hours to create (if their base price is 250 gp or less). Scrolls and potions whose base price is more than 250 gp, but less than 1,000 gp, take 8 hours to create, just like any other magic item.

Which means that creating potions is just as profitable as any other magic item.
Answer:
Is there rule/s for a cost effective mass production? How do apothecaries make potions in bulk and make a viable profession with it?

The Pathfinder rule system adamantly does not model any kind of economics. There is absolutely no concept of supply, demand, or fluctuating prices with either. Even the barest scrutiny will find many instances of pure nonsense if you try to apply them rigorously. Breaking the in-game "economy" such as it is is trivially simple.
This is because there is no call for such modeling for the games that Pathfinder is designed to model. Prices and costs only exist for the purposes of deciding how easy or difficult various items are to use in an adventure—because Pathfinder is almost-solely about adventure. They are designed to be player-interfacing, while the actual economy of the game world operates through pure fiat hand-wave and the rules shown are just the facets of the economy that the players actually interact with. If you are looking for a game of deeper economic simulation, you either need to augment Pathfinder rules with something else, or use another system entirely. Pathfinder is not designed for such a game and cannot support one without rather significant changes and additions.
So your question on the whole is based off of a seriously-skewed premise that potion shops are run by the same rules that players see. They aren't. They aren't, in fact, run by any rules at all, barring some suggestions for the GM about market availability based on the size of the town. They instead run off of world-building: the potion shop exists, and has the stock that it does, because the GM (or module author) decided it would be there and have those potions, and for no other reason. And the players cannot do whatever it is the potion shop owner is doing because the players are adventurers and not potion shop owners, and Pathfinder doesn't have rules for them to become potion shop owners. Pathfinder is not a game in which players can play potion shop owners running a potion shop: they can only play potion shop owners who have closed up shop to go on an adventure. (Even the seriously-flawed rules for investing in businesses are almost-purely about investment and not about actually running the shop and stocking it and so on.)
Armed with this understanding, the rest of your question is fairly simple to answer: the apparent answers that you doubted are no longer doubtful when you consider things in this manner.
First, the definition of "a potion" per the rules:

A potion is a magic liquid that produces its effect when imbibed. [...] A potion or oil can be used only once.

So "a potion" is specifically a single dose of this kind of liquid. Then we get to the potion-brewing rules:

Creating an item requires 8 hours of work per 1,000 gp in the item's base price. [At minimum, potions] can take as little as 2 hours to create (if their base price is 250 gp or less).

So each "potion" takes a minimum of 2 hours. And a "potion" is defined as a single dose. So yes, you can create a maximum of four potions in a day. And no, potion shop owners may very well not be limited in the same fashion, but no, you can't do whatever it is they are doing in a game of Pathfinder.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](http://chat.stackexchange.com/rooms/69701/discussion-on-answer-by-kryan-how-many-doses-does-brewing-potions-create).