Calculating the maximum number of sectors per track for a hard disk

Question: If you know the media transfer rate of a hard disk, how do you use that information to calculate the maximum number of sectors per track?
Comment: You can't. Too many other variables make it an impossibility.
Answer: You probably cannot.  Even wimpy hard drives have caches and one logical track is not the same as a physical track anymore.
Comment: I think that theoretically it's possible since this is a homework assignment for a programming class.
Comment: @Phenom if your asking homework questions, then you should really let us know that in the question, and show us what you have tried so far. Were more than happy to help you if you get stuck with homework questions, but you need to show you have put some effort in first, we are not just going to do your homework for you.
Answer: If a sector is a known size (in bytes), you know the rpm of the drive, you know the maximum transfer rate* (in Megabytes/sec or somesuch) it should be fairly straightforward to work out the maximum number of sectors on a track.
I say "should be" because you're not being given enough data for a modern drive. You'll have to assume that the number of sectors per track is constant over the area where you are measuring the maximum transfer rate for starters. It probably is but it might not be, so the best you can get using these numbers is a pretty close estimate  provided the drive is physically simple. Unfortunately drives are not physically simple anymore.
To expand on Michael Graff's answer - there is a lot going on at the physical level (remapping of sectors, variable track geometry, multiple heads and more) that will make it hard to give an absolute answer. Sector interleaving would completely throw any calculations out too but that is rare in modern drives as far as I'm aware. For drives with multiple physical platters and multiple heads you have to adjust for that too - for example on a drive with six read\write heads on three platters, there might be 200 sectors per track, (on each side of a platter) but there will be 1200 sectors per cylinder.
If you know the physical structure of the drive (number of read/write heads), you know that it's pretty healthy (so there are no significant amount of remapped sectors), you know that it doesn't use interleaving and you know that the read test you carried out was thorough enough to swamp any cache effects, then you can make a reasonable calculation based on the rpm of the drive and the maximum transfer rate.
Comment: What would the equation be?
Comment: Seriously the answer is in the first paragraph. I was hoping to help you understand the reason someone gave you this as homework (you get to understand somethings about how drives work) but you still need to make _some_ effort to work it out.


In my example, do I need a comma before which?

Question: The linear fit fails to fit the age profile because it does not really account for the changes in arrests rate which implies a large bias.
Comment: It depends what you mean. What implies a large bias? The changes in the arrests rate? Or that the linear fit fails to fit the age profile?
Answer: It is important to leave the conclusion you make The linear fit fails to fit the age profile as a sentence by itself if this is for a scientific manuscript.
The which question you ask can be avoided by splitting up the sentence into 3 parts as already suggested. Short sentences in technical writing allow readers to realize which parts of the data they are supposed to read along with the sentence. Any more than one piece of data per sentence makes digestion and comprehension difficult.
Answer: You need more than one comma, but a hyphen and some reorganisation might not go amiss.
Yours is like many things that people put on the site. It is a sentences which is infuriatingly correct in its grammar, and that because it is awkward and hard-work to read.
If it were me I would break it in three.
In the first nine words you have a repetition of 'fit'. Is that necessary?  I would , at the very least, hyphenate the first one.
'The linear-fit fails to fit the age profile'.  That is enough for a first sentence. It is short, snappy and makes its point; a single discrete thought.
'And that is because it doesn't adequately account for the changes in the arrests rate.' Note I have dropped 'really' in favour of 'adequately' as I find the former amorphous and vague. (Remember you are competing for the reader's attention with other things going on around them, office gossip in the background, or the TV, their kids, food cooking on the stove etc.) I have also added a definite article which I think helps.
Finally 'Hence it implies heavy bias'.  'Large' is not a word which leaps off the page and grabs the reader. I think 'heavy' stands a better chance.
So altogether 'The linear-fit fails to fit the age profile. And that is because it doesn't account for the changes in the arrest rate. Hence it implies heavy bias'


Create a new class object that's identical to an existing one but does not refer to it

Question: def _replace(self, **kargs):
    for item in kargs.items():
        if item[0] not in self._fields:
            raise TypeError
    if self._mutable:
        for item in kargs.items():
            self.__dict__[item[0]] = item[1]

    else:
        new_self = self
        for item in kargs.items():
            new_self.__dict__[item[0]] = item[1]
        return new_self

I am working with a class where one if its arguments is mutable which is either True or False to determine if the class willl be mutable. This is saved under self._mutable. So as you can see in this code, I tried to make a completely seperate copy of the class but it still refers to the old one when I try to call this _replace method.
Comment: You aren't making any new objects anywhere...
Answer: You can use deepcopy
import copy
new_obj = copy.deepcopy(obj)


Finding optimal categories from pairwise correlation

Question: Have say 1000 items and their pairwise correlations with each other, so 499,000 correlations. Want to use this correlation data to categorise the 1000 items into a limited number of categories that is set up front so say into 10 categories. Categories should work so that items in same category have relatively high correlation.
What is a good way to approach/solve this problem?
Answer: There are many clustering algorithms that can be used with correlation distance.
In particular, try hierarchical clustering, DBSCAN, and OPTICS.


Flows - How to skip the record that initiate the flow from the Get records?

Question: I am facing a situation like this. I am creating a New record in a custom object. Email Id is a field of that. While creating this I need to check if the there is already an existing record in that object with same email id, if so I need to check the checkbox. I need to implement it using a flow. The issue in the get records, flow is fetching my present record and since email id is already there, it checks the check box. I need to avoid the new record i am inputting and search only all other records in the system. I tried by using id doesnot equal {!$Record.Id}. But it is still fetching the record and always checking the checkbox
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Comment: In flow, I have used 'Get record' gets all the records of a custom object say obj1 . Is there a way to skip the current record of obj1 that triggered the flow and read all other records of obj1?
Answer: Your question is a bit of an "xy" problem.
That aside, it sounds like what you really want is to set a checkbox field if the email ID already exists for another record.
You don't need to query all records. Simply run a query in your flow to check for existing records with the same Email ID value as $Record. Later in your flow, you check the size of that GET element. If it is greater than zero, that means you have a match. And you can set the checkbox field to true.
Your flow will look something like this (screenshot):


How can i stop Call Broadcast massages in micromax yu yunique

Question: getting lots of msg from CB channel in my micromax yu yunique cell. Please let me how can i stop. I have checked many time in my massage setting but i didn't get hug results. can help me, So let me know
Answer: Go to Settings > More (In Android 5.1.1) > Emergency Broadcasts
There some options inside the above settings location.
Read the options carefully and set or unset whichever you want. I hope this will help you.


How to attach a workflow to a list, and how to email the assigned person?

Question: I am quite new with Sharepoint so please forgive me any errors in my understanding of how it works.
I need to create a Sharepoint site that coordinates the creation of various reports across divisions which are eventually aggregated and present to the client. Also I am using the Office 2010 suite.
My plan initially was to create a custom list with the columns, among others:

Consultant, LDI Assigned To, EDOS Assigned To, Governance Writer and
  Governance Checker

When client services create a new entry in the list and type in the reporting deadlines for this client, they select the above people, and, as it starts, I want them to get a email.
After a lot of searching, I have read that a way to do this, is something like this:
<code>    Step 1
    Wait for Consultant to be not empty
    Step 2
    if Current Item:Consultant is not empty
    Email %Current Item:Consultant%
</code>
However, despite having created this workflow by clicking on 'New' from within the Workflows box on the list settings management page within Sharepoint Designer, when I complete it and go back to the list settings page, nothing is listed. Indeed, on the Workflow settings page under 'Task List:' the correct list is not an option.
I then tried creating a list from the Task List template and creating the same workflow, this, eventually seemed to stick. But it doesn't send the email as it should, and the default template contains many columns I don't want. One named 'Type' in particular I have no idea of the purpose of, and I can't remove it.
How can I attach a workflow to a custom list, and what is wrong with my email code?
Answer: If you are really new in the SharePoint world, you should probably use a search engine of your choice and type in something like:

first sharepoint designer workflow

That should help you how to attach a workflow to your list.


Transferring changes from a dev DB to a production DB

Question: Say I have a website and a database of that website hosted locally on my computer (for development) and another database hosted (for production)...ie first I do the changes on the dev db and then I do the changes to the prod DB.
What is the best way to transfer the changes that I did on the local database to the hosted database?
If it matters, I am using MS Sql Server (2008)
Answer: The correct way to do this with Visual Studio and SQL Server is to add a Database Project to the web app solution.  The database project should have SQL files that can recreate the entire database completely on a new server along with all the necessary tables, procedures users and roles.
That way, they are included in the source control for all the rest of the code as well.
There is a Changes sub-folder in the Database Project where I put the SQL files that apply any new alterations or additions to the database for subsequent versions.
The SQL in the files should be written with proper "if exists" blocks such that it can be run safely multiple times on an already updated database without error.
As a rule, you should never make your changes directly in the database - instead modify the SQL script in the project and apply it to the database to make sure your source code (the SQL files) is always up to date.
Answer: We do this in the (Ruby on) Rails world by writing "migrations," which capture the changes you make to the DB structure at each point. These are run with a migration tool (a task for rake), which also writes to a DB table so it knows whether a particular migration has been run or not.
You could make a structure like this for your dev platform (.Net?), but I think that in other answers to this question people will suggest available tools for handling database versioning in your development platform, or perhaps for your specific DB.
I don't know any of these, but check out this list. I see a lot of pay things out there, but there must be something free. Also check this out.
Answer: I migrate changes via change scripts written by developers when they have tested/verified their changes.  (The exception being moving large data.) All scripts are stored in a Source control system. and can be verified by DBAs.
It is manual, sometime time consuming but effective, safe  and controled process.
Databases are too vital to copy from dev.
There are tools to help create/verify these scripts.
See http://www.red-gate.com/
I have used their tools to compare 2 databases to create scripts.
Brian
Answer: If the changes are small, I sometimes make them by hand.  For larger changes, I use Red Gate's SQL Compare to generate change scripts.  These are hand-verified and run in the QA environment first to make sure they don't break anything.  For large changes, we run a special backup prior to making the change both in QA and in production.
Answer: We used to use the approach provided by Ron. It makes sense for a big project with dedicated team of DBAs. But if you do not have a dedicated developers who write code only for DB this approach is time and resource expensive.
The approach to use RedGate DB compare is also not good. You still have a do a lot of manual work you can skip some step by mistake.
It needs something better. This is was the reason why we built the "Agile DB Recreation/Import/Reverse/Export tool"
The tool is free.
Advantages: your developers use any prefered tools to develop DEV DB. Then they run the DB RIRE and it makes reverseengeniring DB (tables, views, stor proc, etc) and export data into XML files. XML files you can keep in the any code repository system.
And the second step is to run DB RIRE one more time to generate difference scripts between structure and data in XML files and in Production DB.
Of course you can make as much iterations as you need.


Do sitemaps need to cover the entire site?

Question: Do sitemaps need to cover the entire site?
If I have a sitemap link to all the most important views on the site, I should expect that all the first-child pages on that site should get crawled without explicitly defining them right?
Answer: You may expect all URLs which are linked to by pages on your sitemap to be crawled, still I would advise on including them in the sitemap, as it provides meta-data.
Keep in mind that the position of a page in your sitemap doesn't matter. If you have lots of pages and want to keep things organized for yourself, you can split the map into several files. Otherwise, it's probably wisest to let the crawler figure out which pages are more important using the priority attribute.


should i really use a relation table when tagging blog posts?

Question: while trying to figure out how to tag a blog post with a single sql statement here, the following thought crossed my mind: using a relation table tag2post that references tags by id as follows just isn't necessary:
tags
+-------+-----------+
| tagid | tag       |
+-------+-----------+
|     1 | news      |
|     2 | top-story |
+-------+-----------+

tag2post
+----+--------+-------+
| id | postid | tagid |
+----+--------+-------+
|  0 |    322 |     1 |
+----+--------+-------+

why not just using the following model, where you index the tag itself as follows? taken that tags are never renamed, but added and removed, this could make sense, right? what do you think?
tag2post
+----+--------+-------+
| id | postid | tag   |
+----+--------+-------+
|  1 |    322 | sun   |
+----+--------+-------+
|  2 |    322 | moon  |
+----+--------+-------+
|  3 |   4443 | sun   |
+----+--------+-------+
|  4 |   2567 | love  |
+----+--------+-------+

PS: i keep an id, i order to easily display the last n tags added...
Answer: It works, but it is not normalized, because you have redundancy in the tags.  You also lose the ability to use the "same" tags to tag things besides posts.  For small N, optimization doesn't matter, so I have no problems if you run with it.
As a practical matter, your indexes will be larger (assuming you are going to index on tag for searching, you are now indexing duplicates and indexing strings).  In the normalized version, the index on the tags table will be smaller, will not have duplicates, and the index on the tag2post table on tagid will be smaller.  In addition, the fixed size int columns are very efficient for indexing and you might also avoid some fragmentation depending on your clustering choices.
I know you said no renaming, but in general, in both cases, you might still need to think about the semantics of what it means to rename (or even delete) a tag - do all entries need to be changed, or does the tag get split in some way.  Because this is a batch operation in a transaction in the worst case (all the tag2post have to be renamed), I don't really classify it as significant from a design point of view.
Comment: in addition they have to be reindexed on a rename
Answer: This sounds fine to me, using an ID to reference something that you delegated into another table makes sense when you have things that vary, say a user's name or whatever, because you don't want to change it's name in every place in your database when he changes it. However in this case the tag names themselves will not vary, so the only potential downside I see is that a text index might be slightly slower than a numeric index to search through.
Answer: Where is the real advantage of your proposal over a relation table containing IDs?
Technically they solve the same problem, but your proposed solution does it in a redundant, de-normalized way that only seems to satisfy the instinctive urge to be able to read the data directly from the relation table.
The DB server is pretty good at joining tables, and even more so if the join is over an INT field with an index on it. I don't think you will be facing devastating performance issues when you join another table (like: INT id, VARCHAR(50) TagName) to your query.
But you lose the ability to easily rename a tag (even if you don't plan on doing so), and you needlessly inflate your relation table with redundant data. Over time, this may cost you more performance than the normalized solution.
Answer: The de-normalised method may be fine depending on your application.
You may find that it causes a performance hit due to searching a large set of VARCHAR data.
When doing a search for things tagged like "sun*" (e.g. sun, sunny, sunrise)
you will not need to do a join. However, you will need to do a like comparison on a MUCH larger set of VARCHAR data.  Proper indexing may alleviate this issue but only testing will tell you which method is faster with your dataset.
You also have the option of adding a VIEW that pre-joins the normalised tables.  This gives you simpler queries while still allowing you to have highly normalised data.
My recommendation is to go with a normalised structure (and add de-normalised views a necessary for ease of use) until you encounter an issue that de-normalising the data schema fixes.
Answer: I was considering that too. Want a list of tags in the database, just select distinct tag from tag2post. I was told that since I wanted to optimize for select statements, it would be better to use an integer key because it was much faster than using a string.


When can you simplify the $W$ boson propagator?

Question: I have seen in several sources that the propagator of the $W$ boson is:
$$\frac{- i \left( g^{\mu\nu} - \frac{P^\mu P^\nu}{m_W^2} \right)}{p^2 - m_W^2} . $$
But then in some calculations (usually approximations) I have seen that only $$ \frac{-i}{p^2 - m_W^2}   .$$
is used as the propagator. So my question is why is this allowed and  when is it allowed to do this?
Comment: Acting on a 4-vector orthogonal to *p*, it reproduces it times the scalar you write.  Acting on a vector parallel to *p* it reproduces it times something else (what?).
Answer: You have to be careful, there are many subtleties on the quantization of a spontaneously broken gauge theory like the Standard Model (SM) electroweak sector. I recommend you to learn about the quantization of a gauge theory via path integral methods.  To quantize a gauge theory, you need to introduce a gauge fixing term (and the associated ghost Lagrangian).  For the SM, people usually consider a generic $R_\xi$ guage fixing term.  You can find Feynman rules for the SM in a generic $R_\xi$ gauge fixing in  this article
https://arxiv.org/abs/1209.6213
In particular look into Eq. 52 for the W-boson propagator.  $\xi_W$ in this Eq. is a free real parameter that comes from the gauge fixing.  When you do calculations, you are free to specify the gauge fixing terms, for instance $\xi_W=1$ corresponds to Feynman Gauge while $\xi_W=0$ to the Landau gauge.  Note that in the Feynman gauge you get rid of the $k_\mu k_\nu$ part.
As long as you do your calculations consistently, you are assured that the amplitudes for physical processes will always be gauge independent, so you can choose the gauge you prefer.


Can I have a Slideshow thats NOT fullscreen on Mac?

Question: Is there something thats not key note or quicktime that will let me just select a bunch of pictures and play them in a window that choose the size of? I don't want to convert them to video files as the selection would change daily. Something like preview, but doesn't only play in full screen? Desktop user. Thanks :)
Answer: Yes, with the app Phiewer. It's free from the MacApp Store. When you start Phiewer it will ask you to locate the images. Then you can set the window size and then select slideshow. The window size stays the same and the images are displayed.


How to describe a paper for which you have not yet submitted revisions in CV?

Question: I have submitted a paper. The reviewers might agree to accept its publication, but they have asked that I revise it. I have not yet submitted the revision to them. What can I say about the paper ? Should I say that the paper is under revision or under review, or something else ?
Comment: In general, I'd simply say "submitted to XXX", but if you specify the country you're applying to, someone more familiar with the specific hiring system can give you better advice.
Comment: The usual denomination is "under review".
Comment: For which purpose do you have to declare the state of that paper?
Comment: I am writing my resume, but besides that, I would like to know the correct way to describe the state of the paper.
Comment: Ah, I wanted to insist on the fact that it has been submitted, and that now it is "in revision". But I do not know if the correct way to say that is "in revision".
Answer: I would use some of the following:

submitted
under review
submitted to …

and do not stress that there is already a revision going on. Even revised papers may get rejected, so being in revision is no guarantee to get the paper published. I also would not state the journal to which the paper is submitted to because I do not see how this says anything about the quality of the paper. If you think, that the paper is good and interesting for whoever reads the CV, make it available as a preprint and provide a link.
I myself have a section "Preprints" in my CV where I list submitted but not published papers with links to the arXiv and add the line "submitted, month, year".
Comment: I would definitely not list whom I have submitted a paper to if it has not been accepted.
Comment: Me too. I am not really sure why, but probably I have the subconscious impression that people who do this usually shoot too high with their papers (or are bigshots who do great work, know where to submit and get everything accepted that way…).
Answer: A. Scientist. My Brilliant, Albeit Slightly Flawed Work. Journal of Sciencing. (in revision)
Is the standard way I note these on my CV, when I feel like doing so.
Comment: @Carol My issue is that "in revision" at least implies that it hasn't been desk rejected, or killed in the first round of review. It can be major, it can be minor, but it has a shot. Anything can be "Submitted" - I can submit an incoherent screed to Nature, Science and Cell today. But generally, I do agree that these should be very limited in number, and in their own section.
Comment: 'in revision' may imply to some fraction of readers that you are claiming that paper is 99%-100% accepted with 'small revisions' requested by editor. I would use @Fomite example, but as "A. Scientist. My Brilliant, Albeit Slightly Flawed Work. Journal of Sciencing. (in review) or simply just use 'submitted'.   The care that one uses probably depends on where the CV goes. (If it is to a Tenure and Promotion committee, anything that looks like a candidate is trying to be a bit sly tends to raise red flags causing everything to be scrutinized to see if there is a pattern of sly problems.
Comment: I figure a  typical consumer of a CV puts pubs in three classes  - 1) accepted/published/in-press and verifiable 2) submitted (at least it exists) and 3) 'in preparation'(wishful). Putting more precise information makes the candidate feel better but can backfire if it appears deceptive- or if it appears the candidate doesn't understand the review process (i.e., many ways to lose it until it is in print!). As you mention - it looks best to  put the in review or in revision etc in their own section away from the accepted and published. It is usually more expected in early career CV than mid/
Comment: @Carol I've encountered enough "Pfft, who do they think they're kidding" responses that I don't include submitted or in prep unless it's *super* relevant.
Answer: Be as honest as possible.
1) If the paper has been accepted pending revisions, then say this.
2) If the paper has not been accepted, and all you're doing is responding to reviewer's comments, then it has not been accepted. I would put it on my CV as "in submission" without saying where it has been submitted. Your specific field might have different norms about this.
As a practical matter, you don't want to misrepresent yourself to potential employers. You especially don't want to create a situation where they think you've accomplished something when you really haven't, and it comes out later that there was a misunderstanding. That's a real good way to kill your career before it starts.


How do I level up an animal?

Question: My elf sorcerer 3 has a Handle Animal skill modifier of +10. How can my sorcerer level up his dogs and warhorse so that they're not extremely weak in future fights?
Comment: Welcome to the site! Take the [tour]. Normally, the system is a tag on the question rather than included in the title. Thank you for participating and have fun!
Comment: Are you asking how to have more level-appropriate animals, or how to apply XP to animals that you have tamed?
Comment: Have you talked with your DM about this?
Answer: As far as I am aware there are two ways of increasing the effectiveness of animals in combat. This is of course assuming you mean increasing the existing animals, as opposed to simply replacing the m with better animals.
1. Gain Levels: This is by far the most common. Most classes, indeed I believe all, that grant an animal of some kind, be it via Familiar or Animal Companion, offer a progression that as you increase in level, the animal companion increases in power.
2. Apply a Template: Many templates are inherited but there are some that are acquired. Perhaps the most helpful immediately for you would be the Warbeast template.
There are certainly many ways to gain better animals, but most that I am aware of are replacing the creature rather than improving an existing one.
Answer: Animals gain experience like every other creature type.
Monster Manual 1 has the following to say about levels and racial hit dice:

Monsters do not gain ability score increases for levels they already reached with their racial Hit Dice, since these adjustments are included in their basic ability scores.

In other words, racial hit dice = levels.
Therefore, racial hit dice are gained with experience points, the same as levels.

The Monster Manual gives three ways for creatures to advance:

Class levels (requires INT of 3, minimum; animals whose INT permanently increase to 3 or more convert to magical beast. )
Increased Hit Dice (see note)
Templates

Increased Hit Dice: Intelligent creatures that are not humanoid in shape, and nonintelligent monsters, can advance by increasing their Hit Dice. Creatures with increased Hit Dice are usually superior specimens of their race, bigger and more powerful than their run-of-the-mill fellows.

Creatures of the animal type are still considered monsters by the rules, despite it sounding odd.

Most groups probably won't be thrilled with splitting the XP with the party animals. But hey, if your horses manage to evade the dragon and not get eaten, they've earned their XP.
My group has two treasured horses, Tasty and Crunchy, so dubbed after The Incident. They survived a wyvern attack, and have the scars to prove it; which they love showing off to the mares.
Note: the exact details of adding xp to monsters (including creatures of the animal type) is pretty much left up to the DM.

Familiars and animal companions have separate rules governing their advancement, see the respective class features.
Comment: RE: "[R]equires INT of 3…." I've been doing some research, and I can't find this prohibition. There are lots of *recommendations* and a reader can make *inferences* that lead to this conclusion, but I haven't found any actual *text* that excludes Int 2 or less creatures from gaining class levels. I mean, I know that's kind of dumb, but I also think it'd be hilarious for the dog — that otherwise has no advancement *at all* — to gain levels in warblade or sorcerer or aristocrat.
Comment: @HeyICanChan I know it was mentioned in one of the web articles, I'll track down the reference, if it exists. Also, a headband of intellect will allow a dog to take class levels, so long as they don't lose it.
Comment: …And that, of course, begs the question *What if Fido gains class levels* then *is irresponsible?* (Besides him being called a bad dog and not getting any treats, obviously.)
Comment: And that is different from almost every player ever... how exactly? Found the reference, but it was for how to give non- intelligent monsters class levels, though it also implies the 3 minimum without stating it.
Comment: Fair enough. I guess, for instance, even the spell [*feeblemind*](http://dndsrd.net/spellsFtoG.html#feeblemind) doesn't say the affected creature *can't* still advance in levels, just that he has a hard time doing stuff that isn't done on instinct (and can't, y'know, *communicate coherently*, but when has *that* stopped an adventurer?).
Comment: It could be argued that they communicate quite coherently, if in a very simple and rudimentary fashion, with their weapons and empty bags and packs.... lol.

How do I level up an animal?


Existing 50 amp breaker to 40 amp

Question: I have an existing cooktop with a 50 amp breaker and #6 wire
Replacing cooktop with a new induction top that requires a 40 amp circuit
Is it ok to leave the 50 amp breaker box or should I swap with 40 amp breaker?
Thank you
Comment: Depends on the specs of the cooktop. Make/model?
Comment: Yeah, what make/model is the cooktop?
Comment: I could write an answer right now, but the answer would be like "If the instructions say 'foo', do this... if the instructions say 'bar', do that..."
Comment: Hello, and welcome to Home Improvement. We'll need more info before we can help you. And, you should probably [take our tour](//diy.stackexchange.com/tour) so you'll know how best to participate here.
Answer: Breakers often are tasked with two missions; protecting the conductors is always #1, and sometimes they are there to protect the equipment itself. Going from a 50A breaker to a 40A breaker is no problem from the standpoint of the protecting the conductors; you can always go down in breaker size, just never up.
So that leaves the protection for the cooktop itself. In the installation instructions (assuming you have them) or possibly on a nameplate on the unit, there should be something telling you Minimum Circuit Ampacity (abbreviated as MCA) which is addressing the MINIMUM wire size as discussed above, and there might be another listing of Maximum Over Current Protection (abbreviated MOCP) that is dealing with the protective device (fuse or breaker) that might be required in it's listing. So we cannot answer this for you other than to say "RTFM" (Read The Factory Manual).
Answer: You're always allowed to use larger wire than necessary.   By the book, a 40A circuit calls for 8 AWG cable.  You already have 6 AWG in the wall, and that's bigger, so the existing wire is totally acceptable for 40A.
Just change the breaker and recep-- oh wait.  There's no such thing as a 40A receptacle.  So there's an exception in Code that says "On 40A circuits, use the 50A receptacle".  That was easy!
On the breaker...  Consult the installation instructions.  It may say "Use 40A or 50A breaker" and then you are done.  If it says "Requires 40A breaker" you must change the breaker, because a 50A breaker won't protect the appliance.   However it's a $10 breaker.
What's that all about?  When they design the oven, they send the first run to Underwriter's Laboratories for a UL listing.  UL looks at the design, gives advice, tests it in the conditions the manufacturer pays for, and certifies it as safe in those conditions.  Those are the conditions described in the labeling and instructions.
Lastly on the wiring connection.  Some ranges use a hot-hot-ground connection and those are fine.   Most use either a hot-hot-neutral (no ground) or a hot-hot-neutral-ground connection.  For those ungrounded connections, we very strongly advise converting to a grounded connection.  If the ground wire (or metal conduit ground path) isn't present, then retrofit the ground wire.

Existing 50 amp breaker to 40 amp


Can we say, "can have to" like in,"You can have to buy me a new phone if you drop it"?

Question: As far as I know, we can say "might have to" or "may have to", but I think I am not used to "can have to." Can we say, "can have to" like in this sentence I thought of: "You can have to buy me a new phone if you drop it." I know we can say, "You may/might have to buy me a new phone if you drop it (my phone)", but how about the phrase "can have to"? Is it generally ever usable?
Answer: No, we don't say "can have to."
Generally the options are:

You may/might have to do x. (possibility)
You could have to do x. (possibility)
You will have to do x. (certainty)
Comment: Also possible is "You have to buy me a new phone if you drop it." This is also expressing certainty.
Comment: You could also say "You can buy me a new phone if you break it." (without the "have to"). Although "can" seems to express possibility, in that use it has an air of threat.
Comment: Thank you. How about "You can need to"? Is it used? It sounds like it might be wrong as well to me.
Comment: "You could have to" also sounds wrong to me unless it is used in indirect speech.


Are Rorschach (inkblot) tests still used as a diagnostic tool?

Question: Are Rorschach tests still used as a diagnostic tool today, or are they just a relic from the 60's? If they are still in use, what sort of information do they provide?
Comment: @NickStauner http://www.quickmeme.com/img/cb/cb2411a094a3c4249ea52f08dd446f80452f6eacff8d6386eb1ee12be3d97b9c.jpg
Answer: Yes, they are still in use, and they provide rather bad information. My former advisor once worked with a clinician who told him that the main reason they're any better than using the weather report as a projective stimulus is that the Rorschach tests have been in use as-is for decades. Hence we have a better understanding of how people normally react to them, and some catalog of unusual reactions that have been associated with particular characteristics. Had we started with a set of weather reports and stuck with them though, maybe not much else would be different.
Anyway, here are some excerpts from Wikipedia about usage:

United States
The Rorschach test is used almost exclusively by psychologists. In a survey done in the year 2000, 20% of correctional psychologists used the Rorschach while 80% used the MMPI.[8] Forensic psychologists use the Rorschach 36% of the time.[79]
  In custody cases, 23% of psychologists use the Rorschach to examine a child.[80]
  Another survey found that 124 out of 161 (77%) of clinical psychologists engaging in assessment services utilize the Rorschach,[81] and 80% of psychology graduate programs teach its use.[9]
  Another study found that its use by clinical psychologists was only 43%, while it was used less than 24% of the time by school psychologists.[79]
United Kingdom
Many psychologists in the United Kingdom do not trust its efficacy and it is rarely used.[82] Although skeptical about its scientific validity, some psychologists use it in therapy and coaching "as a way of encouraging self-reflection and starting a conversation about the person's internal world."[25] It is still used, however, by such prestigious mental health organisations as the Tavistock Clinic.[83]
Japan
Shortly after publication of Rorschach's book, a copy found its way to Japan where it was discovered by one of the country's leading psychiatrists in a second-hand book store. He was so impressed that he started a craze for the test that has never diminished. The Japanese Rorschach Society is by far the largest in the world and the test is "routinely put to a wide range of purposes".[26] The test has recently been described as "more popular than ever" in Japan.[83]

And about the objects of (intended / purported) measurement:

The general goal of the test is to provide data about cognition and personality variables such as motivations, response tendencies, cognitive operations, affectivity, and personal/interpersonal perceptions. The underlying assumption is that an individual will class external stimuli based on person-specific perceptual sets, and including needs, base motives, conflicts, and that this clustering process is representative of the process used in real-life situations.[33] Methods of interpretation differ. Rorschach scoring systems have been described as a system of pegs on which to hang one's knowledge of personality.[34] The most widely used method in the United States is based on the work of Exner.

References
8. Raynor, P., & McIvor, G. (2008). Developments in social work offenders (Research highlights in social work) (pp. 138). London: Jessica Kingsley Publishers. ISBN: 1-84310-538-1.
9. Weiner, I. B., & Greene, R. L. (2007). Handbook of personality assessment. John Wiley & Sons. ISBN: 0-471-22881-8.
25. BBC News. (2012, July 24). What's behind the Rorschach inkblot test? BBC News Magazine. Retrieved July 31, 2014 from http://www.bbc.com/news/magazine-18952667.
26. Fidgen, J. (2012, July 25). On A. Hall (Producer), Dr Inkblot. BBC Radio 4. Retrieved July 31, 2014 from http://www.bbc.co.uk/programmes/b01l0kch.
33. Groth-Marnat, G. (2003). Handbook of psychological assessment. John Wiley & Sons. ISBN: 978-0-471-41979-2.
34. Mons, W. (1950). Principles and practice of the Rorschach Personality Test (2nd ed., pp. 30–31). Faber.
79. Hughes, Gacono, C. B., & Owen, P. F. (2007). Current status of Rorschach assessment: Implications for the school psychologist. Psychology in the Schools, 44(3), 281. DOI: 10.1002/pits.20223.
80. Butcher, J. N. (2009). Oxford handbook of personality assessment (Oxford Library of Psychology) (pp. 290).  Oxford University Press. ISBN: 0-19-536687-5.
81. Camara, Nathan, J. S., & Puente, A. E. (2000). Psychological test usage: Implications in professional psychology. Professional Psychology: Research and Practice, 31(2), 131–154. DOI: 10.1037/0735-7028.31.2.141.
82. Guardian staff. (2013, November 8). Hermann Rorschach Google doodle asks users to interpret inkblot test. The Guardian. Retrieved July 31, 2014 from http://www.theguardian.com/technology/2013/nov/08/hermann-rorschach-google-doodle-inkblot-test.
83. Hall, A. (2012, July 25). Dr Inkblot. BBC Radio 4. Retrieved July 31, 2014 from http://www.bbc.co.uk/programmes/b01l0kch.
Answer: The whole controversy over the Rorschach test leads us to see it as a useful medium but not as a valid personality test.
In using the Rorschach test, the tester should then focus on how the subject considers the test procedure, the pictures and how he/she identifies the inkblots... or refuses to, rather than focus on what the subject tells he sees.
As @NickStauner states, in this regard you could even use weather forecasts as a test medium... Rorschach inkblots in this respect are probably appreciated because they show a rich palette of patterns and colors which have already been listed and commented.
Answer: I highly recommend the book What's Wrong With The Rorschach by Lilienfeld et al which explains the psychological reasons why clinicians use the test and believe it works even though there is no evidence at all for its validity except for highly bizarre responses correlating with thought disorders and food responses correlating with dependence needs.   This book is one of the most interesting books in psychology full stop for students and lay readers as it examines the culture, delusions of power, biases, resistances to science, and more that have affected far more psychologists than they should have given clinical psychology was supposed to be a science.  Those problems are what led to science-minded psychologists breaking away from APA to form the legitimate science body of psychology in the United States, the Association of Psychological Science.  The science of evaluation finds validity of conclusions is increased the more you can integrate: history, observations, collateral tests or interview, and personality tests (however the latter can be invalidated if the patient is unmotivated or lies in answering paper and pencil tests).  The Rorschach however adds no validity, and has the potential to reduce it.


How can I say in one word "number written in words"?

Question: If there should be numbers written in words, like "one hundred and ten" instead of "110", how can I say it in one word?
Comment: I don't think there is a single word for this.  There are several words to describe different forms of numbers, e.g. _ordinal_ and _cardinal_, but nothing that just means "written in words", other than perhaps what Jim has suggested.
Answer: I think the closest you can get is a hyphenated word:

spelled-out : 2. to write or print in letters and in full (numbers are to be spelled out)
Answer: You may have said it best in your question: in words. After all, that's how several website tutorials describe it:

This is the line underneath "Pay to the order of" where you write out, in words, the dollar amount of the check.
Amount of check in words -- Enter the amount of the check in words. Start writing at the far left side of the line. Follow the dollar amount by the word "and," then write the amount of cents over the number 100. Draw a line from the end of the 100 to the end of the line.
...the different parts of the check (date, name and address of account holder, receiver of check or payee, amount in numerals, amount written in words, memo line, signature, account information)
Writing the amount of a check in words.
The amount written in words.
The amount in words is written on this line.
Amount of check: This should be written in words.
Term: written amount
Definition: amount of check written in words
Comment: For what its worth, *In words* is a far more common and appropriate choice than *Spelled-out*. Anybody remember Cashier's Cheques........
Comment: @Sayan Indeed.  It feels a bit clumsy, I think, but it is certainly the most commonly used way to express this.
Answer: "Phobia" in one word. Jk.
Reality is that since we don't write checks anymore and the symbols are already embedded into buttons.
"Inscribe" is the word you maybe thinking of.
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).


Python and EarSketch throwing an annoying, recurring error; 'int' does not support indexing on line 33

Question: I am using EarSketch for a assignment at school, a tool that allows you to program music in Python (even if you are not familiar with EarSketch please any input is appreciated, as it seems that my issue is mostly with Python and not with EarSketch, but EarSketch could be part of it which is why I mention it.) In order to complete the assignment I must feature at least one function that helps me automate the process of making a ringtone. So far my code looks like so: https://earsketch.gatech.edu/earsketch2/?sharing=WAo1CdSaae72pppDkc40Hw
In the event that the link doesn't work or something, here is a code block:
from earsketch import *

init()
setTempo(120)

starts = 7

tracklist = []
track_number = int(0)

tracklist.append("gorp") # 0

tracklist.append(COMMON_LOVE_DRUMBEAT_1) # 1
tracklist.append(HIPHOP_DUSTYGROOVEPART_001) # 2
tracklist.append(AK_UNDOG_PERC_HATS_1) # 3

tracklist.append(AK_UNDOG_PAD_1) # 4
tracklist.append(AK_UNDOG_PAD_1) # 5

tracklist.append(ELECTRO_ANALOGUE_PHASERBASS_003) # 6
tracklist.append(ELECTRO_ANALOGUE_PHASERBASS_001) # 7
tracklist.append(ELECTRO_ANALOGUE_PHASERBASS_002) # 8

def parallel_tracks(sounds = [], sounds_length = [], sound_offsets = []):
    sound_num = 0

    points = []
    points.append("gorp")

    for measure in range(1, starts):
        for i in range(1, len(sounds)):
            sound_num += 1
            points.append(measure + sound_offsets[sound_num])
            points.append(points[sound_num - 1] + sound_offsets[sound_nums])
            fitMedia(sounds[sound_num], sound_num, points[sound_num - 1], points[sound_num])

parallel_tracks(tracklist[4], 4, 0)

finish()

What I was trying to do was write a function that makes multiple audio clips play at the same time for a specified length and offset each. The way I am currently trying to approach this is using a custom function called parallel_tracks() with the parameters sounds[], sounds_length[], and sound_offsets[]. So far I am trying to make it so that for each sound[] entry two entries for a new list called points[] are created, one odd and one even, with the odd one being the start number that goes in the third parameter of fitMedia(sound, track, **start**, end) (this is one of the ways music is created in EarSketch) and is hopefully equal to measure (a variable representing the current measure of the song) plus sound_offsets[*whichever sound[] is currently being fit*] (so while processing sound[1] sound_offsets = [1] and that corresponds to a value such as 1 or -3, thus allowing me to offset a sound by whatever value.) The even point created afterward is the end parameter of the fitMedia() function (so fitMedia(sound, track, start, **end**)), and should be equal to the even points[] entry plus sounds_length[] (sounds_length[] matches up with the current entry number of sounds[] as well.) What should happen is that every fitMedia() function should use the two points in tandem with sounds[] and a variable tracking which track to place the sound on to fill out all four fields, the problem is of course on line 33 and with the general structure, but I will focus on line 33's error for now and see where that gets me.
I have tried multiple designs but have encountered this same or similar error (I don't remember what errors specifically I just remember this one and that there might have been other kinds of errors; I did not save my previous versions so I could not check and see.) The error came up while using a variable that would increment to track which sound was currently being processed and which track the sounds should be placed on, then of course this same value would be used on the other two lists. Then I would loop this process for each number in a variable called starts (starts is how many times any given sound with a length of one would start; if a sound has a length of say, four, and an offset of zero, then the sound would play starting on the first measure and end on the fifth measure, then if starts was seven like it is in the script the sound would play again immediately after and end after measure 7 since 1 + 4 + 4 is 9, thus the sound would end on measure 9) until the last sound with length 1 starts on measure 7.
Then there is the error, all I really know is that apparently one of the two lists on line 33 is technically a integer for whatever reason? I saw a few other forum threads talking about the same error but they were all using SQL of some sort aside from one, which was using python to create some kind of renderer called a turtle renderer? Anyways, they had the same error as I had in a more applicable context, and someone proposed a solution that didn't seem particularly applicable to my situation but could serve as a lead (*Why does line 34 return: TypeError: 'int' does not support indexing) They seemed to have accidently overwritten their list variable with a integer variable in a for loop, so someone proposed replacing it, but other than that possible thread I didn't find anything useful; all that I could fine were the aforementioned SQL stuffs. Looking at it there doesn't seem to be a problem at first glance? I have tried many different methods I am trying to (mostly ones not involving using this crummy points system and instead just slotting an equation right into the different fields of fitMedia() but I tried this points system in the hopes I wouldn't get the error; the issue remained and it went from afflicting the fitMedia() to the points system which comes first.
tl;dr, I am getting a really strange error involving loops and lists, I think there might be a better way to do what I am doing but this error has been a recurring and seemingly unsolvable issue for me.
Comment: tl;dr but `parallel_tracks(tracklist[4], 4, 0)` You are passing an int as the 3rd parameter but the function seems to be expecting a list: `def parallel_tracks(sounds = [], sounds_length = [], sound_offsets = []):`
Comment: tl;dr. We don't know what "line 33" is. Just post the stacktrace and a [mre] of your code. We don't need these gigantic nearly unintelligible walls of text; just the simplest code that produces the error, and the full error stacktrace. You provided a ton of unneecssary info but not the necessary info of the stacktrace. Please read [ask], the [tour], and the [help] topics, as well as the [mre] page, to get an understanding of how to properly write posts on here that will get you the help you need. One obvious issue though is that `parallel_tracks` defines a bunch of mutable default arguments.
Answer: You have defined a function which takes three lists as arguments.
def parallel_tracks(sounds = [], sounds_length = [], sound_offsets = []):

However the called function has different parameter types.
parallel_tracks(tracklist[4], 4, 0)

4 and 0 are int types and cannot be indexed as a list.
Comment: wow, that was a really silly miss on my part, sorry


postfix configuration

Question: I  started to use postfix, and configured the /etc/postfix/main.cf file.  After that I runed postfix with postfix start command, but got an error parameter mail_owner: unknown user name value. Please say me, what does identify the mail_owner parameter and  what value to set for that?
Comment: Is that the whole line? A quick search suggests it should also give a user name at the end (https://forums.freebsd.org/threads/47901/ - admittedly a while ago). Maybe check your config to make sure you don't just have 'mail_owner = '
Comment: I cheked, in first time mail_owner have been postifx, I was change name to root, but nothing.
Thank you  I will follow the link
Answer: Looking at http://www.postfix.org/postconf.5.html the default is postfix, as you said yours was initially set.
The actual part is quite a long way down as it's got all the possible parameters and says

mail_owner (default: postfix)
  The UNIX system account that owns the Postfix queue and most Postfix daemon processes. Specify the name of an unprivileged user account that does not share a user or group ID with other accounts, and that owns no other files or processes on the system. In particular, don't specify nobody or daemon. PLEASE USE A DEDICATED USER ID AND GROUP ID.
When this parameter value is changed you need to re-run "postfix set-permissions" (with Postfix version 2.0 and earlier: "/etc/postfix/post-install set-permissions".

I imagine that centos will create this user for you to start with for you, so you shouldn't worry about that and leave at the default.

postfix configuration


Is there alternative to arduino IDE program ESP8266 and ESP32 with arduino toolchain?

Question: I use ESP8266 and ESP32 with arduino toolchain rather than pure arduino hardware.
Arduino IDE is standard and proven but what are the other IDE and advantage/disadvantage ?
Answer: Not an exhaustive list. Most advantages will be subjective.

UECIDE - Wide variety of boards, not only Arduino, better editor and serial monitor, plug-in based modules.
PlatformIO (Available as plugin for Atom editor, MS Visual Studio and Eclipse IDE) - Automatic library updating, one ini file that defines project settings and external libraries, making projects portable to other users without having to download all external libraries.
Arduino IDE for Visual Studio - For those who like VS?
Arduino Makefiles - More like old-school command-line coding, Linux-style development. Not an IDE.
Eclipse - Another quite popular IDE outside Arduino world.
Atmel/Microchip Studio 7 - Provided by the manufacturer of the AVR chips. "Arduino" sketches may not compile without changes to make them more like standard C++.
Comment: **VisualMicro** is a powerfull addon to Visual Studio 201x (no command line needed and intellisense work). That's the best solution for ESP/arduino developpement in my opinion. The free version is really complete to make tests.

**VisualGDB** is also a good tool to debug (JTAG necessary) but only for ESP tool chain (arduino could be added is future release said in the forum...).
Answer: For example, Eclipse IDE with Sloeber plugin is much better than Arduino IDE. You have all the features of Eclipse (coloring, error highlighting, auto-complete, open declaration ('drill down' to libraries), ...*). And every project has own settings (board settings, port, programmer ...). And the Arduino IDE buttons Upload, Verify, Session Monitor are there and the Arduino toolchain too.
*... projects management, version control, TODO lists, outline, ...
Comment: I have a very bad experience of ECLIPSE at school last year. Lot of parameters hard to adjust and too much bugs... Visual studio (and code version) are robust days after days.


How to transfer all SOL from one wallet to another using JS API

Question: I'm trying to send all SOL from one wallet to another. My main problem is that I have many wallets with a small amount of SOL so I want to save as much SOL as I can.
async function transferToMain(){
  const fromKeypair = Keypair.generate();
  const toKeypair = Keypair.generate();
  const gasFee = 0; // Is there a safe amount?
  const lamports =  await connection.getBalance(fromKeypair.publicKey) - gasFee;
  console.log(`FROM ${fromKeypair} TO ${toKeypair} AMOUNT ${lamports} BALANCE ${lamports + gasFee}`)
  const transaction = new Transaction().add(SystemProgram.transfer({
    fromPubkey: fromKeypair.publicKey,
    toPubkey: toKeypair.publicKey,
    lamports: lamports
  }));
  const signature = await sendAndConfirmTransaction(
    connection,
    transaction,
    [fromKeypair]
  )
  console.log('SIGNATURE: '+ signature)

}

Trying to send SOL exactly equal to balance will yield
SendTransactionError: failed to send transaction: Transaction simulation failed: Transaction leaves an account with a lower balance than rent-exempt minimum

I've tried to add a small amount for transfer fee, but it is prone to failure because  gas fee fluctuates.
The source code shows that it just takes BigInt/ number type for the lamport argument - and doesn't handle special input : transfer, transferParams.
On the CLI, we can do something like
$solana transfer --from <FROM_ADDRESS> <RECIPIENT_ADDRESS> ALL

I'm wondering if there is a similar way to do it on the JS API?
Answer: Try:

https://solana-labs.github.io/solana-web3.js/classes/Connection.html#getAccountInfoAndContext and get the size of the account.

https://solana-labs.github.io/solana-web3.js/classes/Connection.html#getMinimumBalanceForRentExemption to see how much needed for rent exempt.


How to tweak default Gnome to make it look like ubuntu Gnome

Question: Ubuntu comes with Gnome with a modified theme + some extensions enabled by default. Where could I download this theme and what is the list of extensions and tweaks to apply on a default Gnome to make it look like Ubuntu gnome?
Answer: The default theme is called Yaru. Development happens at https://github.com/ubuntu/yaru . You can find the rest of the defaults by looking at apt show ubuntu-desktop.
$ apt-cache depends ubuntu-desktop | grep yaru
  Recommends: libreoffice-style-yaru
  Recommends: yaru-theme-gnome-shell
  Recommends: yaru-theme-gtk
  Recommends: yaru-theme-icon
  Recommends: yaru-theme-sound
$ apt-cache depends ubuntu-desktop | grep extension
  Depends: gnome-shell-extension-appindicator
  Depends: gnome-shell-extension-desktop-icons-ng
  Depends: gnome-shell-extension-ubuntu-dock
  Depends: gnome-shell-extension-ubuntu-tiling-assistant

You can install them with apt install, but if you just want to download the Ubuntu-specific versions, you can do apt download and open them in Archive Manager.


Tor exit node is Forum spammer

Question: When I researched the exit node for the tor circuit I was given, I saw that it was a forum spammer. Even after changing my identity , the new exit node was still listed as a forum spammer. Is this common with tor or dangerous ? I was using the Tor browser for linux.
Comment: Where were you looking? If somebody maintains a list of IP addresses that are known "forum spammers", then one of the things they probably did was import the entire list of Tor exit IP addresses, and call them all forum spammers. Because that's a common thing and happens all the time.
Comment: It was on myipaddress.com . Not sure it's a trusted source. There were comments saying they were used for creating spamming forum bots.
Comment: Well, it's probably true. People use Tor for all kinds of unsociable things.
Answer: Tor relays which allow exiting can be used for forum spamming, as such they are often added to generic "blacklists" regardless of any actual abuse having occurred.
This is just the nature of blacklisting and it's not dangerous to you personally while using Tor, however you may find it inconvenient. This is the price of anonymity, you are indistinguishable from spammers (without further verification, e.g. a captcha-based solution).

Tor exit node is Forum spammer


$X$ space satisfying hypotheses used to construct a universal cover, $A$ abelian, $C^*(X, A) \cong \text{Hom}_{\mathbb{Z}[\pi]}(C_*(\tilde{X}), A)$?

Question: Let $X$ be a space that satisfies the hypotheses used to construct a universal cover $\tilde{X}$ and let $A$ be an abelian group. What is the most elementary way to see that$$C^*(X, A) \cong \text{Hom}_{\mathbb{Z}[\pi]}(C_*(\tilde{X}), A)?$$
Answer: I do it using singular cochains. Functions from $\tilde\sigma:\Delta^n\rightarrow\tilde X$ to $A$ that are invariant under $\mathbf Z[\pi]$ are precisely those functions that are invariant under deck transformations, which is how $\pi$ acts on $\tilde X$. Hence there is a natural map collapsing orbits under the deck action that puts such functions in bijection with functions sending $\sigma:\Delta^n\rightarrow X$ to $A$. Hence
$$\operatorname{Hom}_{\mathbf Z[\pi]}(C_\ast(\tilde X),A)\cong\operatorname{Hom}_{\mathbf Z}(C_\ast(X),A)=:C^\ast(X,A).$$
Answer: As soon as you have a cellular structure, it gets even easier. Pick a cellular structure on $X$, then $\bar X$ inherits a cellular structure. You get the chain complexes as $C_k(X)=\mathbb Z^{i_k}$ and $C_k(\bar X) = \mathbb Z[\pi]^{i_k}$. Considering that we have free $R$-modules for $R=\mathbb Z,\mathbb Z\pi$, the result gets pretty obvious.
You can also look at this recent answer for more details and references on this special case of twisted cohomology.


What are the Fragment Skills?

Question: I have many of the Fragment Skills in FFXIII-2 but I was wondering what all of them are? Specifically: what skill they grant you and how to attain them in the game.
Comment: Hi danRhul! Please don't rollback the edit. See here for more information: http://gaming.stackexchange.com/faq#editing
Comment: @JuanManuel Doesn't say anything about not rolling back edits. I felt the edit reduced detail. This edit makes it seem as if though I am asking three different questions. My original post clears that up to show that is what I'm looking for in my one question.
Comment: Why does this keep receiving down votes?
Answer: From http://www.gamefaqs.com/ps3/619315-final-fantasy-xiii-2/faqs/63553

Mog's Manifestation (available from start of Episode 4) - Enables gaining special rewards when you throw Mog (ie. guaranteed at least 1 gil, if nothing else).  Also needed for special one-off crystals, like Silver Chocobo.
Mobile Mog (collect all fragments in Oerba timelines, paradox ending
included) - Mog returns much quicker when you throw him.
Bargain Hunter (available from start of Episode 6) - Lowers prices (including in the casino, for prizes) by 25%.
Haggler (available from start of Episode 4) - Increases amount gained from selling items.  I believe this is 25%, will confirm later.
Chocobo Music (collect all fragments in the Monster Bits and Bounty Hunter
categories including those for the Archylte Steppe bosses) - Lets you change what music plays when you ride a chocobo.  Limited to preset chocobo riding music.
Anti-Grav Jump (available from start of Episode 6) - Allows you to float for a short period when holding down jump.
Field Killer (collect all the fragments in the Academia Reward and Great
Mog Wisdom categories) - If the monster is weak enough, autokill when you attack for pre-emptive.  Note that this does not award CP or gil.  I don't know how it calculates relative strength levels.
Monster Collector (collect all fragments from Vile Peaks timelines) - Flat +20% chance to get monster crystals.
Encounter Master (collect all fragments from Yaschas Massif timelines) - Raise or lower the encounter rate.
Battlemania (obtain all fragments for completing 100% of all maps) - Increased chance of rare encounters (Distortions, especially).
Rolling in CP (collect all fragments from Yaschas Massif timelines, and all
fragments from Bresha Ruins timelines) - Double CP awarded.
Eyes of the Goddess (collect all fragments from AF003 New Bodhum, AF005
Bresha Ruins, AF010 Yaschas Massif, AF01X Yaschas Massif, AF200 Oerba and
AF300 Sunleth Waterscape) - Lets you move the camera around during cutscenes.
Clock Master (obtain all 160 fragments) - Speed up/slow down game speed.  Note that this is basically global; you'll run around faster or slower, too, not just battles.
Paradox Scope (beat the game) - Enable certain paradox fights, along with their endings.

Just remember, you have to go back to Serendipity and talk to the lady in the left-most house.  The one where Mog is.
Comment: -1 doesn't answer what skill they grant you.
Comment: Skill explanations added.

What are the Fragment Skills?


Is 2 hours 20 minutes enough for a layover in Frankfurt Airport?

Question: I'm studying abroad in Florence this summer and I'm trying to decide on the best layover option (flying from NYC). I've narrowed it down to Frankfurt via Lufthansa, but I'm paranoid about delays...would a 2 hour 20 minute layover be enough time? Or should I opt for 5 hours instead?
Comment: Tip: the outside corridors of the Biblioteca delle Oblate are a popular place to study, the shade protects from the heat and you can even see the Duomo. Another tip: there are many, many excellent restaurants but I'd like to recommend Del Fagioli as the food is simply heavenly, the atmosphere is authentic (to the level of not bothering with an English menu). I am now returning to Firenze yearly just to visit my favorite restaurants :D
Comment: 2:20 is probably fine if everything goes smoothly. If everything *doesn't* go smoothly, your layover can turn into a race across the airport to catch your connection in a hurry. I once had a 2:30 layover disappear completely between a late departure and a problem with the jetway that delayed unboarding for 45 minutes.
Answer: Typically, an hour is already enough in Frankfurt.
However, there can always be an uncommonly long line or some other issue, and then two hours are better.
Your main concern should be that LH typically doesn't wait for connections, and those are often delayed. As a result, your next leg might leave before you ever get there. On the other hand, there are multiple flights to Florence, so it depends a bit on how bad it is for you to arrive some hours later.
I would recommend the two hours choice; you should be fine for 99%.
Comment: I'd like to disagree with the statement that an hour is already enough -- Coming from NY, the OP will have a pass through security and immigration. But 2 hours are of course very different...
Comment: I go through FRA multiple times a year (coming from the USA), and normally I'm at the next gate ready to board within 30 - 45 mins. But I walk _fast_, which also gets me to the front of most lines - your mileage may vary.
Comment: I regularly went through Frankfurt airport last year.  My company typically booked my schedule with about an hour layover.  I'm really tall and walk fast and was able to make it.  It helps if you pack light and know the drill for the security screening.  (Empty pockets, Laptop/Tablet in its own x-ray container).  Everyone that I spoke to that works in Frankfurt airport speaks English, so don't be afraid to ask for help if you get turned around.
Answer: Should be plenty. Make sure that you have this booked on a SINGLE BOOKING and a single ticket. If it's a single booking and you can't make the connection, the airline will simply put you on the next available flight. Lufthansa has six non-stops from FRA to FLR per day with the last one leaving around 9.30pm.
If it is two different tickets and you miss your connection, you are on your own.
Comment: He should also make sure that he gets all boarding passes when he checks for the first flight.
Comment: I think the assumption that the OP is male is questionable. Our unconscious biases are showing....


Variable Selection Method for Multinominal Model

Question: When dependent variable is categorical (more than 2 categories) and independent variable is continuous, is there any way i can check the predictive power of independent variable? Can i apply one-way ANOVA for variable selection? I read somewhere - one-way can be applied when the situation is opposite = Dependent Variable (Continuous) and Independent - categorical having more than 2 categories. I know i can use chi-square when both variables are categorical. My task is to reduce variables from 1000 to some top 100.
Note : I am not looking for variable selection method to remove multicollinearity.
Answer: One way to check whether a single continuous variable $X$ is predictive for a categorical variable $Y$ is to fit a multinomial logistic regression model for $Y$ using $X$ and one without any predictors, and to perform a nested likelihood-ratio test to check if $X$ is predictive for $Y$.
A simple way to generalize it to $n$ variables by repeating it for each variable separately and selecting only the most important ones.
The obvious drawbacks is that this method is not able to capture non-linear relationships and that it may select redundant variables, but it may be a good way to start.
An alternative method is to use L1 regularized logistic regression and to select the best feature set using cross-validation or some other model selection method (like BIC or AIC), similarly to LASSO for continuous outcome variables.
Answer: I suggest a boosted multinomial logit modeling strategy as implemented in the mboost package in R, and possibly in other libraries or packages in R and other platforms. This method iteratively fits a set of base-learner generalized linear models that the user specified by the set of predictors to be included. Base learners are usually specified as very simple models with one or two effects, but can include as many effects as the user desires. The base learner that leads to the smallest negative loss is chosen in each iteration to be incorporated into the averaged model. At the end, you are awarded both the average effects of each parameter as well as the probability that each base learners was selected in a given iteration, which you could consider a sort of base-learner importance score. The mboost package allows you to specify smoothed effects in a base learner. Another benefit of this package is that the boosted GLM method is resistant to multicollinearity or separation issues, as well as the curse of dimensionality. Moreover, there is only one parameter to tune: the number of iterations. You can do so using bootstrap or k-fold cross-validation methods for estimating the generalization error. I believe that mboost and the packages that depend on it are among the most useful R packages that exist.


Connection between eigenvalue problems and Lagrange multiplier rule?

Question: In Zeidler's Nonlinear Functional Analysis Part III, Chapter 43.3 contains the following statement:

$F,G$ are both functionals on a Banach space $X$. We consider the minimum problem with a side condition
  $$min_{u \in N_a} F(u) = F(u_a)$$
  where $N_a = \{ u\in X: G(u) = a \}$, and the eigenvalue problem which corresponds to the Lagrange multiplier rule:
  $$F'(u_a) = \lambda_a G'(u_a)$$
  With $  \lambda_a \neq 0, u_a \neq 0$.

How is that second equation an eigenvalue problem? My understanding of an eigenvalue problem is that if you have an operator $A: X \rightarrow X$, then the eigenvalue problem is to find a $\lambda$ for which there exists a $v\in X$ such that $$Av = \lambda v$$
What is the connection between the eigenvalue problem written in Zeidler and this more elementary statement of the eigenvalue problem here?
Answer: Let me give you an example:
The Euler-Lagrange equation can become an eigenvalue equation. For example, consider the problem in an approriate space $X$:
$$
\int_0^1(v'(x))^2dx \to min
$$
subject to
$$
\int_0^1 (v(x))^2dx=1 \\
v(0)=v(1)=0
$$
The Euler-Langrange equation with multiplier $\lambda$ becomes
$$
-u-\lambda u''=0
$$
which is indeed an eigenvalue equation.
So you can formulate some eigenvalue problems as variational problems with constraints


Chain from Queueable

Question: Is it possible to make a chain of execution with Queueable?
My task after running the first Queueable is to get a token (callout) and only when it is available (in Custom MetaData) to run the next Queueable to update the user data in a new call out.
Answer: The official documentation explains this, relevant detail and link below.

Chaining jobs: You can chain one job to another job by starting a
second job from a running job. Chaining jobs is useful if your process
depends on another process to have run first.

Chaining Jobs To run a job after some other processing is done first
by another job, you can chain queueable jobs. To chain a job to
another job, submit the second job from the execute() method of your
queueable class. You can add only one job from an executing job, which
means that only one child job can exist for each parent job. For
example, if you have a second class called SecondJob that implements
the Queueable interface, you can add this class to the queue in the
execute() method as follows:

<code>public class AsyncExecutionExample implements Queueable {
    public void execute(QueueableContext context) {
        // Your processing logic here

        // Chain this job to next job by submitting the next job
        System.enqueueJob(new SecondJob());
    }
}
</code>

You can't chain queueable jobs in an Apex test. Doing so results in an
error. To avoid getting an error, you can check if Apex is running in
test context by calling Test.isRunningTest() before chaining jobs.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm
Comment: Looks like that I can not update Custom Meta Data and run chain Queueable in the same Queueable. Or I am missing something?

Chain from Queueable


How to revitalize wood screw hole where screw won't stay tight?

Question: If I have driven a wood screw in and out of a hole more than several times, especially with shorter screws, chances are the hole will become too wide for the screw to form a tight grip, instead it will just spin when you reach the depth maximum. Is there anything I can put into the hole, like a super strong epoxy, that will revitalize the hole so that I can achieve a firm grip again, assuming a screw/hole relocation is not an option?
Comment: There's a lot of wooden sticks out there but bamboo skewers and golf tees (made of birch) seem to work a lot better than alternatives. Coat with wood glue and tap in.
Answer: The simplest option is a matchstick or two.  Push the match into the hole, and snap it off to length.
Answer: Best: drill out and glue a dowel in place, once dry drill pilot hole and use.
Or a matchstick will tighten but not for repeated reassembly.
Answer: Toothpicks
Clean the hole. Put in some glue. Stuff the hole with toothpicks (possibly dipped first in glue - depends on how big the hole is and how much glue oozes out as you stuff in the toothpicks). Cut off the ends sticking out of the hole. Let dry.
It is also a good idea to use longer screws if you can. But match the head of the existing screws, particularly if you are screwing in a lock or hinges or something else where the profile of the screw head matters.
Comment: Toothpicks tend to be higher quality wood because they need to be strong. I like using bamboo ones due to the extra strength from the grain, and they're only marginally more expensive.
Answer: If you've already had to unscrew it several times, there's a good chance you'll have to do it again, so consider replacing the wood screw with a machine screw and using a threaded insert in the wood for it to engage with. That way it won't wear out after another several times of being unscrewed.
Answer: Drywall anchor

source
These are good for any sort of hole that wont hold a screw.  They will work well in your stripped wooden hole.    I got some saggy interior doors unsaggy by  fortifying the holes for the hinge screws with some of these.
You tap them into the hole with a hammer.
Comment: I don't think these things compress enough though, and might split the wood. I've never used them in wood; primarily in concrete/brick, and sometimes in drywall if I'm desperate.
Comment: @Nelson:  in my experience they are a more lasting fix for a hole in wood than the old wad of toothpicks method.   I owned some for concrete but one day I tried one for wood and was very pleased.  Now I use them more for wood than anything else.


SQL injection in Postgres functions vs prepared queries

Question: In Postgres, are prepared queries and user defined functions equivalent as a mechanism for guarding against SQL injection?
Are there particular advantages in one approach over the other?
Answer: It depends.
Prepared statements
A.k.a. "prepared queries". These only take values when executed with  EXECUTE. No SQL-injection possible at this stage. But you have to defend against SQL-injection while generating / concatenating the statement to be fed to PREPARE in the first place. Prepared statements are very much equivalent to stored SQL functions / procedures in this regard.
SQL functions / procedures
With LANGUAGE sql they are generally safe.
Passed parameters are treated as values and SQL-injection is not possible - as long as you don't call unsafe functions from the body and pass parameters.
PL/pgSQL functions /procedures
With LANGUAGE plpgsql they are normally safe.
However, PL/pgSQL allows for dynamic SQL where passed parameters (or parts) are concatenated to a query string and executed with EXECUTE. This can convert user input to SQL code and make SQL injection possible. Tools are there to do it safely. You cannot tell from outside whether the function body handles it properly, you have to look at the code.
Plain SQL statements using parameters as values are safe against SQL injection, just like SQL functions. Only use dynamic SQL where needed and follow these guidelines:
Preferably pass values as values to EXECUTE with the USING clause. Makes SQL injection impossible on principal. Example.
Never just build strings from user input and execute. This includes identifiers, directly passed by a user or fetched from a system catalog.

When concatenating values in the SQL string, wrap 'strings' in single-quotes safely. Use:

format() with format specifier %L. Example.
quote_literal() or quote_nullable(). Example.

When concatenating identifiers in the SQL string, wrap them in double-quotes safely where required. Use:

format() with format specifier %I. Example.
quote_ident(). Example.
a cast to a registered type - regclass for table names:  _tbl::regclass. (Only works for existing objects!) Example.

Concatenating other parts of the SQL code is never safe, when allowing unchecked user input in any way.

Related:

Refactor a PL/pgSQL function to return the output of various SELECT queries
Define table and column names as arguments in a plpgsql function?

More about performance implications in this related answer:

Function Performance

Basics on SQL-injection:

http://bobby-tables.com/

Similar considerations apply to other server-side languages that allow dynamic SQL.
Comment: So, in summary: If 1) I use only language sql, I'm safe, 2) if I use plpgslq but not execute, I'm safe, 3) if I use plpgsql and execute but no identifiers and %s or %L as appropriate I'm safe, or 4) if I use plpgsql and execute and identifiers but %I or quote_ident as appropriate I'm safe. Correct?
Comment: @mickeyf: Basically yes. Plus, use the `USING` clause for passing values to `EXECUTE` whenever possible. You *could* call a PL/pgSQL function from within an SQL function and pass parameters. So, to be absolutely correct, you are safe as long as you don't call any unsafe functions directly or indirectly. If all your functions are done properly, that cannot happen.
Comment: Would "Concatenating other parts of the SQL code" be safe if done in `FORMAT` with `%s`?
Comment: @Rafs Generally no. There are exceptions, where SQLi is not possible a priori.


What is the difference between  and  in HTML, and do they affect website rankings?

Question: What is the difference between <s> and ? I have read here that there are semantic differences between  and , does this apply to <s> and ? Additionally, how are such semantic differences, if any, interpreted by search engines and what affect would they have on rankings? Are there any other tags that affect search rankings?
Comment: The only people that can tell you how the use of HTML affects Google rankings is the Google engineering team.
Comment: This question appears to be off-topic because it is about SEO; try asking on Webmasters Stack Exchange
Answer: <s> and  both still exist in the HTML specification.

The  element represents a removal from the document.
The <s> represents contents that are no longer accurate or no longer relevant.

That is to say that they actually represent different things semantically.  Specifically  would be used if you had an existing document and wanted to indicate text that was in the document, but has been removed.  This would be different than text in a document that is no longer accurate, but that has not been removed (you could use <s> for that).
You should not use or depend on either for styling even though most browsers do have them strike-through by default.  You should only rely on CSS for presentation.
Due to the mercurial nature of how search engines work, it's very difficult to say whether one tag or another will make a difference on how keywords are created and your content is indexed.  You should focus on creating good content that is semantically correct, and your website rank will follow.
Comment: The now-approved HTML5 Recommendation says about `` just what this answer quotes from an older draft, without any mention of something being "struck". The only example is about an old retail price being mentioned in addition to new price. It is absurd to call the old price "no longer accurate or no longer relevant", since it is mentioned specifically for comparison—it is accurate (as a fact about the past) and relevant. This shows that these "semantic" definitions and distinctions are on a thin ice.
Comment: This answer seems to exclude an important part of [the W3 Working Group 's `` element's reference](http://www.w3.org/TR/html-markup/s.html#s) which states "The s element represents contents that are no longer accurate or no longer relevant **and that therefore has been "struck" from the document.**" In this respect, surely `` and `` do behave in exactly the same way?
Comment: I agree with @Sprogz, while I know they are supposed to be semantically different, no matter how many ways I look at it, they are practically the same. And using `` *feels* too much like it is simple typographic markup like ``. For this reason, I lean towards using ``.
Comment: Also, increasing the inherent confusion here, the example for `DEL` in the [current "living standard"](https://html.spec.whatwg.org/multipage/edits.html#the-del-element) is not even the usual diff sample, but something one would intuitively do with `S` instead: a "done" item of a checklist (which is _certainly not_ "removed from the document" by any means, until it is, well, actually removed...)
Answer: After reading the existing answer, I left still confused about which one to use in my app.  We agree that presentationally they are the same, and the difference mostly comes down to semantics.  Mozilla's MDN docs helped clarify the semantics for me.
I think <s> is correct for most use cases, and here's why along with the four relevant options:

It's clear that  is deprecated, and therefore not correct to use anymore.
<s>
From <s> on MDN:

The HTML Strikethrough Element (<s>) renders text with a strikethrough, or a line through it. Use the <s> element to represent things that are no longer relevant or no longer accurate. However, <s> is not appropriate when indicating document edits; for that, use the  and  elements, as appropriate.**

From  on MDN:

The HTML Deleted Text Element () represents a range of text that has been deleted from a document. This element is often (but need not be) rendered with strike-through text.

The biggest key to me on this page is that , like , offers two additional (optional) attributes: cite and datetime which make sense in referring to a change in the context of a document.  As a counterexample, if I were updating a restaurant menu, citing a source for a menu item being sold out doesn't seem relevant.
No tag / use CSS
If none of the above seem correct for your use case, remember that you can still define a custom class.

.purchased { text-decoration: line-through; }

Wish list

New MacBook

Cookies

Answer: There is no practical difference between del and s, except that the tag names are different. They have the same default rendering (overstruck text), and there is no evidence of any difference in processing by browsers or search engines, and no reason to expect such differences, since the "semantic" definitions are vague and authors don't care much about them. There is no evidence of any action in search engines on these elements – they operate on text and usually ignore text-level markup, except possibly for some elements that might be regarded as giving their content greater relative weight within a page.
The default, or "expected" default rendering is explicitly specified in the Rendering section of HTML5 CR: del, s, strike { text-decoration: line-through; }
The theoretical difference is what HTML specifications and drafts say about their "meaning", which varies from one HTML version to another.
So you can use either element, or neither. Overstriking text is not such a good idea, since it easily makes some letters difficult to read. But if you need to overstrike (e.g., because an ad needs to contain old price overstruck), it is perhaps safest to use strike, which is an honest presentational element. So you avoid even the theoretical possibility that some software could interpret s or del in some special way, based on someone's reading of the HTML5 CR perhaps, possibly differing from your intentions, and thus possibly causing some rendering or processing that is no consistent with your reason for overstriking. (Historically, s and strike have been synonymous, but HTML5 CR makes an arbitrary distinction between them, making s "semantic" and strike presentational.)
Comment: This is not good practice. Refer to the accepted answer for a better explanation.
Comment: Perhaps it would be more correct to say that "There is no practical difference *in presentation*".  Semantically the two are quite different, and semantics in practice are more than theoretical.
Comment: Taylor, "The two are quite different" is quite a bit of a stretch... Not even the standard itself can make a clear-cut case for it. Study the comments below the accepted answer for a more subtle picture. The "definitions" of their semantics are ambiguous at best, and the examples the W3C uses in the specs are downright confusing (`S` for an old price tag, but 'DEL' for an old (done) todo-item...). (NOTE: obviously, there are cases where the choice is clear, like `DEL` for rendering diff outputs etc.)
Answer: I would use them the way they are semantically defined: DEL for text that has been removed, and S for text that is now inaccurate but hasn't been removed.
These may mostly appear the same, but could be handled differently by screen readers and other accessibility tools - DEL may be ignored completely (eg: not read out) and S may be read out but differentiated from normal text.


How do I fully expand the window showing the running operating system inside VirtualBox?

Question: I'm running Win7 64 bit on VirtualBox and it only takes up half the screen.  How can i expand it further?
Answer: To be able to change the screen geometry of a Virtual Box guest we need to install the virtual guest graphics driver.

This is done by installing the guest additions.

We can then set the Virtual Box guest into the following display modes from the View menu of the Virtual Box Manager or by a hotkey:

HOST +  F  Switch to fullscreen mode
HOST +  L  Switch to seamless mode
HOST +  G  Auto-resize guest display
Comment: I downloaded the guest and installed it on the VM.  I now have full screen.  Thx guys.


Degrading factors for brake fluid and suspension oil

Question: My bike's manual suggest that I shall change the brake fluid and the suspension oil every 2 years. I am curious if it is really time dependent (i.e. do these fluids go bad with time) or use dependent (and 2 years is a good approximate for an average user). I plan a long journey right as the two year mark comes along. In the previous 2 years I have not used to bike a lot and I do not have a lot of kms on it. Most of degrading currently on these fluids would be due to time and not usage. I am curious if I should change these fluids before or after a short duration of intense usage.
Comment: see https://mechanics.stackexchange.com/q/21243/10976
Comment: Do a search on here, see what has been asked...
Answer: Change both,
The brake fluid is hygroscopic which means it absorbs moisture over time - this degrades its performance and it may boil under arduous conditions.
The suspension oil can degrade with use or time and the compounds or additives become less effective.
Good maintenance is the best thing you can do for your bike (or car etc), preventative maintenance is expensive but repairing breakdowns is even more expensive...


Mishloach Manos or Shalach Manos?

Question: What is the proper grammar of giving/receiving mishloach manos/shalach manos? I've heard people use both terms as in, "I'm preparing mishloach manos for tomorrow" and "I hope to bring the shalach manos later".
Comment: The phrase שלח־מנות is perfectly good Yiddish, so I see no reason to avoid it if using-Yiddish-words-in-English is part of your dialect/register.
Comment: As a native [Israeli] Hebrew speaker, I don't know what "shalach" in "shalach manos" is supposed to mean. (In general, _Shalach_ is the masculine singular form of "sent".)
Comment: "Shalach" is shorthand for "Mishloach." It has no significance.
Answer: The phrase שלח-מנות is the accepted term in Yiddish and משלוח-מנות is the accepted term in Hebrew (based on Esther 9:22).
Here is the entry in Harkavy's Yiddish-English dictionary:

and here is the entry in Alcaly's Hebrew-English dictionary:

Which term you choose to employ will be based on socio-linguistic context and/or personal preference.
The other answers seem to want to deliberately ignore that there are other Jewish languages. For example, the term in Ladino is פלאטיקוס. I'm sure that over the millennia in the different places we've been other terms were used as well.
Comment: Shalach is also valid Hebrew as in ויהי בשלח פרעה, and that construction applied to מנות is in Beitzah 1:9
Answer:
THe proper form is "Mishloach Manot/s" - משלוח מנות as it appears in the Meggilah:

"לעשות אותם ימי משתה ושמחה ומשלוח מנות איש לרעהו ומתנות לאביונים"

Compare to לנוח - מנוח, or לקחת - מלקוח etc.
One can use derivatives of "send" - לשלוח, like "אני שולח מנות", "שלחתי מנות" etc.
There's no such form of a noun as שלח מנות in Hebrew.
Answer: As Al Berko said, the version in the Megillah is mishloach, in binyan kal.
In Mishnaic Hebrew, the word for sending things (and even sending מנות!) is written in binyan pi'el.  As far as I can tell it means the same as binyan kal in this context*.

בֵּית שַׁמַּאי אוֹמְרִים, אֵין מְשַׁלְּחִין בְּיוֹם טוֹב אֶלָּא מָנוֹת
Beitzah 1:9

My guess is שַׁלַּח comes from the pi'el form of the verb, as in ויהי בשלח פרעה.

* I don't see how this distinction can be applied here since you're sending stuff, not people

Mishloach Manos or Shalach Manos?


Yachid v.s. Echad

Question: What is the definition and difference between Yachid and Echad?
I read some where that Maimonides told HaShem is Yachid, but isn't He Echad?
Answer: "Yachid" means alone or only like in Bereshit 22:16 and Zachariah 12:10. "Echod" means one.
Both terms are used to describe HaShem.
Rambam certainly does not deny that HaShem is one. For Rambam to say such a thing would be to deny the truth of the Torah since the statement that HaShem is one is explicitly stated in Devarim 6:4. By Rambam's own definition as found in Hilchot Teshuvah 3:8, this would be apikorsus.
The use of "Yachid" is usually applied when we try to refer to G-d prior to creation. It is to emphasize that this is how things truly are even now. This is what is expressed in Malachi 3:6, "I am HaShem, I do not change." Creation makes no change by HaShem. It is the same before creation as it is after creation. The perception of change and variation is only from the perspective of the creations.
"Echod" is used to describe HaShem's unity like in Hilchot Yesodei HaTorah 1:7 which says, "HaShem is one. He is not two or more, but one, unified in a manner which [surpasses] any unity that is found in the world; i.e., He is not one in the manner of a general category which includes many individual entities, nor one in the way that the body is divided into different portions and dimensions. Rather, He is unified, and there exists no unity similar to His in this world."
All of this is part of the reflection of the Adon Olam prayer said each day.
Comment: Yachid and Echad seem to be very similar in meaning, like aqua and water, or baby and infant. Is it correct to say that Yachid translates most directly to 'the only one' or 'alone' where as Echad translates more directly to 'one'?
Comment: @Levi What you are translating is generally accurate. Anytime you are looking at translations, it is a compromise to viewing in the original language. And with Hebrew, Lashon HaKodesh, that is even more so. Hebrew is 'pregnant' with meaning, much more so than any other language.
Answer: The Rambam, in his Hilchot Yesodei Hatorah (foundations of the Torah) writes (1:7)
אלוה זה אחד הוא--אינו לא שניים ולא יתר על שניים, אלא אחד, שאין כייחודו אחד מן האחדים הנמצאים בעולם:  לא אחד כמין שהוא כולל אחדים הרבה, ולא אחד כגוף שהוא נחלק למחלקות ולקצוות; אלא ייחוד שאין ייחוד אחר כמותו בעולם.

"This God is One, not two or more than two, but One whose unity is different from all other unities that there are. He is not one as a genus, which contains many species, is one. Nor is He one as a body, containing parts and dimensions, is one. But His is a unity than which there is no other anywhere"

Translation from here, which is sourced from Louis Jacobs, "Chapter 2: The Unity of God" in A Jewish Theology (1973). Behrman House.
So the text of Maimonides uses both the word "echad" and "yachid" to describe God. One means "one" and one refers to the unique nature of God as compared to other "singular" things in the world.
Comment: Is Yachid in any way connected to Yachad
Comment: @user4762 According to Klein's Etymological dictionary, yes. Yachad means "to be one" and "to make one" (as in to set apart) and "to unite".
Comment: maybe it's good to add that Echad and Yachid and Yachad all (seem to) come from the same root.

Yachid v.s. Echad


Adobe CQ. Restrict access to site with login/password popup window

Question: I've faced with a problem. I wanna to show user the popup window when he enters my site. I mean, only specific group of users are able to visit it. How can i do it with CQ? I have investigated alot, but still nothing works. I was thinking to do it with the help of Day CQ HTTP Header Authentication Handler. I added specific path in it's config but nothing changed.  Now I am trying to write my own login service. Can you help with ideas? Maybe there is something I have missed? Thank you.
Answer: First, you need a Closed User Group on the publish instance.
Second, you need to determine if you need a popup instead of initial page load, or load a default page that runs JavaScript to create the popup if the user doesn't have an active session.


How to find pattern in sequential data?

Question: I have multiple sequential data that lead up to an event. All I want to do if find the equivalent sequential data or a pattern that leads to the event. The data is also multivariate so I want to consider multiple features rather than just a column. Help will be greatly appreciated.
Comment: Do you mean that an event corresponds to exactly one input sequence (i.e. you must have a "full" sequence for the event to appear), or that that an event may appear at any point of the sequence?
Comment: There is a sequence of inputs that result in an event to occur but I am focusing on the last 20 inputs before the event occurs because the size of the input space can be of varying size.
Answer: I'm not entirely sure but it looks like sequence labeling might be what you need:

Sequences of varying length
Supervised: you would need to train a model with a sample of sequences annotated with a label at every step (not sure that this is your use case?)
Can handle any number of features

Conditional Random Fields is the state of the art method, there are many libraries
available.

How to find pattern in sequential data?


Irreducible factors of $X^p-1$ in $(\mathbb{Z}/q \mathbb{Z})[X]$

Question: Is it possible to determine how many irreducible factors has $X^p-1$ in the polynomial ring $(\mathbb{Z}/q \mathbb{Z})[X]$ has and maybe even the degrees of the irreducible factors? (Here $p,q$ are primes with $\gcd(p,q)=1$.)
Comment: $x^p-1=(x-1)^p$
Comment: sorry, I wrote $p$ instead of $q$
Answer: It has one factor of degree $1$, namely $x-1$. All the remaining factors have the same degree, namely the order of $q$ in the multiplicative group $(\mathbb{Z}/p \mathbb{Z})^*$. To see it: this is the length of every orbit of the action of the Frobenius $a\mapsto a^q$ on the set of the roots of $(x^p-1)/(x-1)$ in the algebraic closure.
Comment: ahh, ok, thank I got it. Thank you