Attaching tmux to an existing session, or creating a new session

Question: For a while, I used screen -dURS to solve this problem.
The goal is to be able to run a command that attaches to an existing session with a specific name, or creating a session with a specific name and running a command in that new session.  A specific example would be to load a server or daemon if it's not running, or to simply attach to the session if it is running.
I have been reading man tmux and the closest I have gotten to this goal is the following:
tmux new-session -AD -t TMUXSessionName 'echo Banana'

The -A flag makes new-session behave like attach-session if session-name already exists; in the case, -D behaves like -d to attach-session.
If -t is given, the new session is grouped with target-session.  This means they share the same set of windows - all windows from
  target-session are linked to the new session and any subsequent new windows or windows being closed are applied to both sessions.
  The current and previous window and any session options remain independent and either session may be killed without affecting the
  other.  Giving -n or shell-command are invalid if -t is used.

Am I misunderstanding these flags?  Am I trying to do something that's not supported by tmux natively?
Note:  I find tmux easier to explain to less technically savy people and because of the way it allows sessions to be shared easily, I'd like to be able to switch to tmux from screen and this issue is the only thing I haven't been able to figure out to allow me to do the switch completely.
Answer: The trick was to make the following change:
tmux new-session -AD -s TMUXSessionName 'echo Banana'

So that we are using -s and not -t.


Client Cross Frame Scripting Attack by Checkmarx scanner for visualforce component,

Question: I am Using visualforce component for insert and updating child record. this component is reusable for multiple objects, like account, contact, etc., as like we can use this. I am doing DML inside a component. this component just receives a parentId through attribute, and we need to perform adding rows (childRecords) and need to save. Please suggest me how to resolve this issue
Comment: Hi DSuresh, welcome to SFSE! Please take the time to visit the [Help] and read [How do I ask a good question](http://salesforce.stackexchange.com/help/how-to-ask). If you post the code for your component and any related controller, I'm confident you'll find plenty of people willing to assist you.
Comment: @Dupada DS Have you fixed this? If so, please add the solution as answer and accept it.
Comment: Closing this as a dupe of another question even though this one came first — they clearly relate to the same error, but the other includes some more information and has what I believe to be the correct answer.
Answer: If you are receiving parentId through the attribute then before using parentId in the DML, use String.escapeSingleQuotes(parentId) and then use it in the DML.
Hopefully it will solve your problem.
Since you have not shared the code, it is just a guess.


Is it still a good practice to use coach marks?

Question: I was presented with the question should the mobile app use coach marks or not?
It's not a very difficult app, and I think users don't have a lot of problems using it. But do users value the little helpers? and does it always help?
Answer: It's a more important good practice to do user tests. Have random users (who have never seen or used your app before) use your app while you watch. THe goal is to see how intuitive it is to random users (note the s, one test isn't enough, 30 5 is ideal). The goal of any interface is to be very intuitive. Doing this may help you see how you can improve the interface to be more intuitive without coach marks. If after several revisions it still isn't intuitive for a user then coach marks will suffice, although they feel more like a band-aid and not a solution.
Intuitive interfaces tend to stem from what a user has previously seen and used (behavioral). If you are doing something different, ask yourself if you need to or if you can go back to something standard (like a hamburger icon representing a menu).
If you do find that you need coach marks, then best practice is to let the user decide if they want it or not. Usually this is done with a screen that says something along the lines of "Take a quick tour to get the most out of this app" With a button for "Continue", "Start", or "Next" and a button for "Skip" or "Maybe Later" (in which case you need a way for them to get back into the tour from the menu or settings).

To summarize: Best practice is to have an intuitive interface that does not need coach marks. But if coach marks are necessary, the best practice is to allow the user to skip them. If you are using coach marks, the best practice is to show them one by one (in steps) as to not overwhelm the user all at once.
Answer: There can be a right time and place for using coach marks, but you should aim to design in such a way that they are not needed, and necessary actions/flow are obvious to your users.
The Nelson Norman Group has a lot of great points to make about this.
Especially:

Because users cannot read the hint overlay and use the app at the same time, they are forced to memorize the instructions and then apply them.

This is why chaining tips is an extremely bad practice common among tutorials, wizards, etc.
It also means that unless users are going to use the feature you are providing the coach mark for when it's being presented then you are relying on them remembering it for later which isn't ideal. In this case, you are also interrupting their use flow.
In short, I would say that unless you are presenting some type of novel interaction that users may not have experienced before there isn't really a need to use coach marks.
https://www.nngroup.com/articles/mobile-instructional-overlay/
When you say, "I think users don't have a lot of problems using it." you are making a dangerous assumption unless backed by user testing. It is important to remember that we as designers are expert users, and it is easy to get "too close" to a product. When we do it can be hard to think about what the experience might be like for a first time user from a different background than us.
As Rogue-OP pointed out user testing is an incredible resource when creating designing an application/website. I would, however, suggest that you could use a few smaller batches of user tests with ~5 users and then iterate on the findings of each and achieve similar results.
Processing the results from 30+ users can be a daunting task to say the least. NN Group also suggests that running a larger amount of small tests will get you the best "bang for your buck."
https://www.nngroup.com/articles/why-you-only-need-to-test-with-5-users/
I hope some of this can help!
Comment: I've updated my answer regarding the number of users to test. The number 30 was quoted from a statistician regarding the number of data points. I ran that article by him and he clarified the difference for me (data points vs. data info). Thanks.


Do higher Arena chests contain any lower Arena Rares and Epics?

Question: Do higher Arena chests contain any lower Arena Rares and Epics? I'm on Arena 3 now but only have 1 of all 6 unlockable Epics at this point. Should I stay at 3 and keep grinding up, or should I fall to 2 and 1 to collect any epics I'm not getting currently?
Answer: Yes they do.
I am on Arena 4 right now and I received an Epic Baby Dragon (which is available since the very beginning) in my last chest. I also often receive Rares from lower Arena ranks from any chests I open.
The opposite would be silly too, people would have to lose on purpose to stay in a certain threshold in order to receive some cards, it wouldn't make much sense.
Answer: As I mentioned in my answer on a similar question, it is indeed possible to get cards from previous arenas in higher tier arena chests.
In fact, it is generally better to advance as far as you can in order to obtain cards from previous arenas.  Even factoring in the lower drop chance and the longer cycle time of the shop, higher tier arenas will get your lower tier cards leveled up faster.
I put together a card upgrade calculator that does all the math for you - you can play with the various settings and see if you reach the same conclusion.
Answer: Notice that the trophy threshold is (number)+ for all arenas, meaning you can unlock the cards from those arenas once you've unlocked them


PhD Admissions Decline/ Accept

Question: I have been admitted to three PhD programs but I am leaning to program A. Program B is attractive and simply only with the admission letter and fellowship letter I'm not sure if it's the right school for me. (I am pretty sure I will be declining program C.)
So, should I still talk to my program B's advisor professor and program director professor before making the decision or should I just save their time by saying that I will decline the offer immediately?
I pretty sure its easy to meet any of these professors in the near future, so I want to be polite and leave a good impression for program B. (Is is better to appear to ponder about this program or to save their time and give them the chance to move onto their next waitlist student?)
Answer: You should decline offers only once you've accepted another written offer, ideally not until you've received some confirmation of your acceptance.
Until you've made a decision, there is nothing wrong with gathering any information that would help you make that decision. I would not recommend soliciting information that will not influence your decision in order to play any "game" with the system (e.g., to make yourself look good, make other people feel good because you considered them carefully, etc).
It's not clear to me you've made a decision yet, as you only describe yourself as "leaning".
Once you've made a decision and accepted an official, written offer, it would be most polite to decline all other offers to let those programs make decisions about offers to students they may have on a waitlist, etc.
Comment: Thank you! Your response is really helpful! Yes, I guess I'm still wanting to learn more about Program B but feel a bit guilty to ask questions because I'm currently leaning closer to Program A. I'd also like to ask if it's a good idea to bargain for additional funding from Program A mentioning that another school is offering more if I do make the decision to go there?
Comment: @HEEHEE https://academia.stackexchange.com/q/194047 might apply. I wouldn't feel guilty about asking questions while your mind isn't made up, though.

PhD Admissions Decline/ Accept


How many japa malas does one need?

Question: There are so many japa malas for so many different sadhanas.
Is it recommended to use the same mala for multiple sadhanas?
Else how many does a regular person keeps with him/her ?
Answer: For Chanting Hare Krishna Mahamantra you need a Tulsi Mala but if you are not dixit you can practice Chanting on Neem Mala or any other Mala but not Tulsi Mala because it's for the Dixit and those who follows 4 regulative principles Devotees only.
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).

How many japa malas does one need?


Get "Invalid derived query" error all over the place in our Spring Data JpaRepository interfaces in STS 3.1

Question: We have implemented our repositories exactly as demonstrated in the Spring Data documentation. Everything was fine until we upgraded from STS 2.9 to STS 3.1.  All attempts to get these errors to disappear have failed, and in some cases they don't even make sense! They don't match any properties in either the interface or the entities used!
Here is an example:
public interface CreditNotesRepository extends JpaRepository<CreditNotes, Long> {

    CreditNotes findCurrentCreditNotes(Long shipmentDetailId);
}

The findCurrentCreditNotes is a named query in our entity.  This code executes perfectly fine.
@NamedQueries({
    @NamedQuery(name = "CreditNotes.getCount", query = "SELECT COUNT(f) FROM CreditNotes f"),
    @NamedQuery(name = "CreditNotes.findCurrentCreditNotes", query =
        "SELECT creditNotes FROM CreditNotes creditNotes"
        + " WHERE creditNotes.shipmentDetail.shipmentDetailId = ?1 "
        + " AND creditNotes.notesSeqNumber =  (SELECT max(creditNotes2.notesSeqNumber) FROM CreditNotes creditNotes2"
        + " WHERE creditNotes.shipmentDetail.shipmentDetailId = creditNotes2.shipmentDetail.shipmentDetailId)")
})

And the error we get:
Invalid derived query! No property find found for type ca.cole.freight.model.CreditNotes

Although this is just a flag (doesn't affect compilation), it is annoying and confusing.  Can anyone shed some light on this?  And explain it to me like I'm 6 years old!  ;)
Answer: At the post on the Spring Forum, Spring Team announced that

It is already fixed for STS 3.3.0

I didn't check this version yet. But I'm using 3.5.0.RELEASE and the problem comes back! My fix is to uncheck Invalid Derived Query
Comment: The issue is still present in STS 3.9.1 as well.
Comment: Also occurs in STS 3.6.3.RELEASE
Comment: The issue is still in 3.9.4
Comment: Its still in 3.9.5
Comment: it's Still in 3.9.8
Answer: It's an IDE error explained in the following post:
http://forum.springsource.org/showthread.php?138585-Invalid-derived-query!-No-property-delete-found-for-type-java-lang-Object
In the meantime, you can turn off the validation in preferences/spring/project validators/Data validator  uncheck invalid derived query and STS wont throw the marker anymore.
Answer: There is also workaround for this. Add @Query annotation on your method definition in Your repository without JPQL/SQL query defined.
Here is example :
@Query
List<OwnerModel> findByFirstNameAndAgeNotZero(@Param(value = "firstName") String firstName);

In this case named query OrderModel.findByFirstNameAndAgeNotZero will be used. Your Eclipse error Invalid derived query should also disappear without need of disabling validation as described by @Tuan Dang
Checked on Eclipse 4.5.1 with Spring plugin installed for @NamedQuery and @NamedNativeQuery.
Comment: Pawel Deleba, java.lang.IllegalArgumentException: query source string cannot be null or empty . your solution will not work
Answer: I've just been going through this myself. Unfortunately, the implementation of Spring Data changed between 1.1 and 1.2. It no longer supports the <repository> XML declaration. You can set up a custom postfix, but by default, it expects a bean of class name <InterfaceName>Impl. If it can't find the custom repository implementation, you start getting errors like the one you're encountering. It's trying to create methods to query for objects based on names of methods in your interface.
An alternative is to back your Spring Data version down to 1.1 and specify a schemalocation of http://www.springframework.org/schema/data/jpa/spring-jpa-1.1.xsd in your XML.


ASP.NET and Visual Studio - Adding project references vs Bin Folder DLL

Question: I just started a new job yesterday and this is only my second job working in ASP.NET. We were setting up my dev box and were having trouble with some third party components like Telerik, etc. I was noticing that they were installed these third party tools, hunting down the DLL files, copying them into the bin and then adding a reference to the project which points to the file in the BIN. To me, this doesn't seem like normal practice.
I was under the impression that if you just dump a DLL in the bin folder, you don't need to add a reference, it's just available? Reason being, at my last job we used a few class libraries we built in house for data access and just dropped the DLLs in any new websites (not webapps) that we made. I don't recall every having to add a reference to get it to work.
So, can someone explain best practices on how to add third party references to your web app? Do you add the reference from wherever the DLL is installed in the system? If so, do you check copy local so it copies to the bin? Do you just copy the dll to the bin and that's it? Do you copy the dll to the bin and then add a reference to it there?
Sorry, I'm sure this seems like a simple question, but I'm confused by the two seemingly different methods I've seen used.
Answer: It depends on how your project is set up.  If you want to precompile your site (and get Intellisense to work properly) you have to have a Visual Studio reference.  But anything dropped in the bin folder will be automatically loaded by ASP.NET at runtime... so it's possible to access that assembly's controls/objects in code behind without adding a project reference.
For small projects I just throw the DLL into the bin and add reference.  For more complex sites/projects, I have a dedicated "library" folder for third party add-ons and code.
Comment: Okay that makes sense. Now, I'd like to expand a bit. The project I pulled down from source safe has references listed, but the BIN folder is empty - so (some) of the third party assemblies are showing errors because it can't find them with the other assemblies are fine. I'm assuming it's normal for a dev station to have to install these components and fix the references?
Comment: see http://stackoverflow.com/questions/868451/best-way-to-reference-an-external-library-in-multiple-projects-in-a-visual-studio
Answer: We version control our 3rd party assemblies using Subversion, then pull them down via svn:externals into a sub-directory of the solution or project in question, which then references them (and copies into bin).
This provides quite a few benefits:

Build servers are happier, need less maintenance and are less brittle.
We have a history of releases and can explicitly control versioning for each solution/project by setting the revision number on each svn:external. For example your trunk code may be using latest Telerik version, but your release branches are using old versions.
We can share 3rd party assemblies for different projects, and be confident they are using the correct versions.
We're not relying on developers installing or upgrading to the correct version, yet they can still add and test new versions without interfering with other projects (assuming you have explicitly defined the revision)
We can test new versions, but easily go back if things don't work.

So a little more working setting things up, but I think it's worth it. Note that we don't version control (svn:ignore) our bin and obj directories, and the 3rd party assemblies are in the same Subversion repository, referenced by relative pathing.
FWIW: Subversion 1.6.6 fixes an annoying bug for file based svn:externals. This means you can choose one or more files (e.g. assemblies) from a directory instead of having to pull the whole directory down.
2013 Update
With the rise of NuGet, consider hosting your own feed via a local server before opting for using svn:externals, simply because it gives you all the same benefits, plus it's baked into Visual Studio via the Extension Manager and provides for better information and meta-data, e.g. being able to let developers know when there is a new release.
The only caveat would be to host your feed using a Win2008 or higher server, as I ran into some issues with our old Win2003 server using SSL with windows authentication to secure the feed. I believe this was due to the older version of IIS used in Win2003, but couldn't verify.
Comment: Thanks, I appreciate the additional info. It may come in handy in the future.
Comment: We do the same thing, only we call our folder "includes". The files are checked into source control, so the correct version can be pulled with a project. References are added to them in the "includes" folder.
Answer: Usually I just drop them in the bin, unless it is part of something that isn't that simple.  Sitecore for example installs itself and has a couple of folders that it likes to use for putting some of its own code to give an example of something non-trivial.
Answer: Si is very correct there.
Also: keep your bin folder for results of builds/compiles. Like said before use a "library" folder to link to. I even do this with devexpress.
Normally by installing devexpress it will install its dll's in the GAC, and you can reference them like you reference the standard .Net dll's. But for version control it is much easier to use a library folder.
In that way, you can be sure that everybody uses the same version of devexpress (the one that is in sourcesafe) to test their code, and you will have less problems with code that compiles on your machine, but does not on another.
Answer: I always preffer to have project reference rather than having DLL reference. Below are the main reason for it.

The project, which is adding the reference of other project, will not be up to date.
Any change to the referred project will not directly reflect. User has to manully delete the old reference and add new reference.


Is there buoyant force when a ball is thrown onto the air?

Question: I was conversing with my professor about the forces acting on a ball that is thrown onto the air. He said that you would have the weight of the ball, air resistance and buoyant force. Although, I wonder if the buoyant force has a significant impact on the result, assuming that the ball's density is considerably greater than that of the air.
Comment: It of course depends on what a *ball* is. The difference between a balloon, a volleyball and a ping-pong ball is just the thickness of the plastic shell.
Answer: Yes, the ball does experience an upward buoyancy force equal to the weight of the displaced air - not just when it is thrown, but when it is on the ground too. However, since the density of air is about $\frac 1 {1000}$ that of water, the effect of atmospheric buoyancy on the apparent weight of a solid ball is negligible. It is about an order of magnitude less than the effect of the earth's rotation. In other words, if you are not adjusting $g$ to account for your latitude then you don't need to worry about atmospheric buoyancy either.
All of the above assumes that the ball has a density much greater than that of air. Obviously there are some objects with low average density, such as balloons, for which atmospheric buoyancy is significant.
Answer:
Although, I wonder if the buoyant force has a significant impact on
the result, assuming that the ball's density is considerably greater
than that of the air.

Not sure what "result" you are referring to. But if the question is will the ball continue to rise after release, then the answer is only if the upward buoyant force is greater than or equal to the sum of the weight of the ball and air resistance or drag force, $F_{D}$, opposing its motion.
$$ρVg≥mg+F_{D}$$
The left side is the upward buoyant force where
$ρ$= the density of the air at the location of the ball
$V$= the volume of air displaced by the ball = volume of the ball
$g$= acceleration due to gravity.
$mg$ is the weight of the ball
$F_{D}$ is the drag force, which is proportional to the square of the relative velocity between the ball and surrounding air.
In order for the buoyant force to be greater than weight of the ball, the density of the ball (mass/volume) has to be less than the density of surrounding air. That, in turn, means most of the volume of the ball would need to consist of a gas lighter than air (e.g. helium).
If the ball density is considerably greater than the air, the impact of the buoyant force would be insignificant.
Hope this helps
Comment: This does not address the question. The ball is not rising due to buoyant force.
Comment: Your question is vague. You asked "Although, I wonder if the buoyant force has a significant impact on the result" but you didn't say what result you were wondering about. I assumed you wanted to know whether or not the ball will continue to rise after being released. I'm trying to say the ball will only continue to rise if the upward buoyant force  is greater than the weight of the ball. I  will update, though I suppose it is moot since you already accepted an answer.
Comment: I am not the OP.
Comment: Sorry, thought you were


voltage divider two unknown resistors

Question:
The circuit is made of a variable resistor of 10kΩ value and two fixed resistors R1 and R2 .The output voltage V0 should be variable from 2V to 9V, i have to calculate the values of the two fixed resistors R1 and R2. I don't know how to start.
Answer: A big hint (since this is a homework question).
The voltage varies from A to B, so the variation is (B - A) volts. That should give you a good idea as to what the current through the divider must be...
Answer: Since this is a homework question, so the battery should be perfect with no internal resistor and the variable risistor should range from 0 to 10k. This come to these solution steps:
1, The V0 = 2V when the variable resistor is at zero, hence the equation: 2V = 12V*R2/(R1+R2+10k)
2, The V0 = 9V when the variable resistor is at its max, hence the second equation: 9V = 12V*(R2+10k)/(R1+R2+10k)
Hope this will help.
Comment: Doesn't the denominator of your first equation need to include 10K, same as the second question?
Comment: Oh, that should be, since the other part still participate in the circuit. My error
Comment: I don't think you can edit with a rep of just 1, so I corrected it.
Answer: Start by assuming that the output current is approx zero, and think of the circuit as a pure voltage divider.
Since the extreme values are 2V and 9V, you can analyse each of those cases individually.  Don't think of the pot as a pot, but just as a resistor where Vo is connected to one end or the other, and figure out the voltage-divider behaviour:
2 = 12*R2/(R1+R2+10k)
9 = 12*(R2+10k)/(R1+R2+10k)
That gives you a pair of simultaneous equations you can solve for R1 and R2.
Comment: It's a homework question.

voltage divider two unknown resistors


Change Page Layout of objects using Meta data API in apex

Question: Is it possible to edit the page layout section of custom/standard objects using meta data API in Apex class? I have created new field using meta data api , now i have to add that field to page layout section, how can i do that? i have referenced this https://github.com/financialforcedev/apex-mdapi/blob/master/apex-mdapi/src/classes/MetadataServiceExamples.cls to create fields.
Answer: Looking at the version history of MetadataService.cls, it looks like some manual work is needed for each inner class (type of metadata). So it is possible that if you modify MetadataService.Layout following the same pattern, you will be able to insert a layout.
And you could then go on to see if an update that is just the addition of a layout item is possible. At first sight that seems unlikely: AFAIK there is no way to read just the existing layout back (in the form of the inner classes) so that you could then add your field and update it back.
The best way forward would be to contact the author Andrew Fawcett and discuss this API implementation with him and whether newer API's such a the Tooling API are more promising.
Comment: @AndrewFawcett in recent Spring14 PreRelease post has written about updating Layout. As per the post(if i understood correctly), this should happen automatically.
Comment: Looking at the code https://gist.github.com/afawcett/8108494 yes there is a readAndUpdateLayout example. So by early June when Spring '14 is fully rolled out and when Andrew releases his new API version it looks like you will be able to add a field to a layout over the API. (Not sure what you mean by "automatically".) So I think you already have the answer to your question.
Comment: If we go by documentation of Metadata API, updating layout should be possible even in Winter 14. As I am new to Metadata API, & haven't been able to do it. And yes I do have an answer now.'automatically' -  ignore that.
Comment: @AndrewFawcett, thanks for the detailed information. With this I am able to create Custom Object and Field but when I try to add the field on the page Layout using It gives me below error message "MetadataServiceExamples.MetadataServiceExamplesException: Error occured processing component null. Required field is missing: fullName (FIELD_INTEGRITY_EXCEPTION)."
Comment: guys- Is there some best practice of sort needed in updating Home Page Layouts? I have successfully executed metadata api call to Update Home Page Layouts and replaced a component with newer one, and I double checked that layouts are using the new components but when user logs in and loads his home page, the Old component is still showing up instead of new one. Is there something else also needed to be done here after update call? @AndrewFawcett
Answer: In Summer 17 Metadata Access in Apex was added. It includes the ability to retrieve, create, or update page layouts directly from Apex.
See also:

Retrieving and Deploying Metadata


What are ways to make the protagonist's relationships with other people seem realistic?

Question: For example, I am writing about my protagonist and her long time best friend. How could I convey closeness between the two characters in a way that feels like it could be a real relationship?
Comment: do you have a best friend? what do you do together? How do you speak to each other? how often? What medium? what do you say to each other? What do you say that you wouldn't say to someone else? Write that.
Comment: Also to note, just in-case you may not have a friend who is very close, think about what an ideal friendship to you would be like.  How do you want to interact with them and they interact with you?  Do you think about being able to walk in a mall with a friend and hang out? do you want to share deep dark secrets? Lauren's questions are really good ones to think about when contemplating how you want character relationships to go in general!
Answer: This is a pretty broad question and therefore this is a pretty broad answer. It all comes down to what is called the "telling detail". The word "telling" emphasises two things here. First it means "important", a detail that matters. Second it means a detail that gives information.
A warrior walks into camp. What are the telling details that let us know who he is and what his arrival means? It depends on the circumstances, of course. If he is limping, bandaged, and carrying a bloody sword in his hand, we know at once that he has come from battle and had been wounded in the fight. The limp, the bandage, and the bloody sword are the telling details that paint this picture for us. Much of the rest of his appearance we can fill in for ourselves, and if one reader imagines his tunic red and another imagines it brown, it does not make any difference to the story.
A man walks through a pair of swinging doors wearing a ten gallon hat, a six shooter, and a star on his chest. Fill in the rest of the details for yourself...
A gloved hand lifts a fine china tea cup with two dainty fingers. Zoom out. What do you see ...
A paddle glides through brown water glistening with sunlight while a harsh guttural squark breaks the deep silence. Zoom out...
If you see two best friends together, what are the telling details, the details that say instantly that they are best friends? Is it that they dress alike, or that they are constantly whispering, or that they bicker constantly but never seem to be apart? The details will be different for different friendships, but if you can find the two or three telling details (three is often the magic number in these kinds of things) that shout out to the world that these two are best friends, and a particular kind of best friends, then you have your answer.
Answer: When you've known someone for a long time, what happens?
You anticipate their needs and you know what their preferences are. You know what colors they don't like, that they use gloss instead of lipstick always, that they would never wear shoes with laces if they had a choice...sometimes silly things.
To convey that is harder without seeming trite. In older movies, a character knowing what another character drinks or takes in their coffee and tea was shorthand for this kind of thing. It was often trotted out as a way to show characters who haven't seen each other in a while having a previous connection. (And sometimes a way to show that they have changed in the interim "Still a bourbon rocks?" "No ma'm. These days it's a coke. No ice.")
What they might know about each other will depend on your world, how people interact, how old they are, and how long they've been friends. Knowing someone's favorite ice cream, while it could be a detail picked up in adulthood, is something that is more likely learned in childhood, and could be used to establish how long they have been friends, especially if it's an ice cream treat that is now hard to find.
This question is very very broad. You say "protagonist and her longtime best friend." The best friend could be a dude. Your protagonist could be 16 or 60, in any kind of culture.
So take what I have written and use the lens of whatever specificity you have for the situation--knowing how a character reacts after a break up, that they check their travel itinerary constantly before a trip, even though they've memorized everything anyway, that they don't like thick socks because they bunch up, which totally wouldn't happen if they didn't always get sneakers one size too big....what they can know will depend on the specifics of the characters and the world/culture in the story.


Reference for Ring Structure on Group Cohomology

Question: As a graded $\mathbb{Z}$-module, the structure of the group cohomology $H^{*}(\mathbb{Z}/n\mathbb{Z};\mathbb{Z})$ is extremely well-known. Yet, I am having difficulty finding a reference concerning its cup product structure. I assume this is also well-known, but I would appreciate a reference containing a precise statement of the $\mathbb{Z}$-algebra structure.
Answer: See Example 3.41, p. 251 of Hatcher's Algebraic Topology. This example computes the cohomology ring of finite Lens spaces. Since the infinite Lens space is a $K(\mathbb{Z}/n,1)$, and is a increasing union of finite Lens spaces, the same computation holds for the infinite Lens spaces.
Edit: My original answer was incomplete, since Example 3.41 computes the ring $H^*(\mathbb{Z}/n,\mathbb{Z}/n) \cong \mathbb{Z}/n [ \alpha, \beta]/(\alpha^2-k\beta)$ (where $k=0$ if $n$ is odd, and $k=n/2$ if $n$ is even, see Hatcher's comment below, and this is an graded-commutative ring with $\alpha$ of degree $1$, and $\beta$ of degree $2$), whereas you want $H^*(\mathbb{Z}/n,\mathbb{Z})$.
We have $H^{2i}(\mathbb{Z}/n,\mathbb{Z}) \cong \mathbb{Z}/n$ for $i>0$, $H^0(\mathbb{Z}/n,\mathbb{Z})\cong \mathbb{Z}$, and $H^{2i+1}(\mathbb{Z}/n,\mathbb{Z}) \cong 0$ by universal coefficients (or Poincare duality). Let $\beta\in H^2(\mathbb{Z}/n,\mathbb{Z})$ be a generator, then the map from $H^*(\mathbb{Z}/n,\mathbb{Z})\to H^*(\mathbb{Z}/n,\mathbb{Z}/n)$ is a ring isomorphism for even degrees above zero, so we see that $H^*(\mathbb{Z}/n,\mathbb{Z})\cong \mathbb{Z}[\beta]/(n\beta)$, where $\beta$ has degree $2$ (and is torsion of order $n$).
Comment: Just for the record, here's a minor correction which doesn't affect the overall argument in this answer. In $H^\ast({\mathbb Z}/n,{\mathbb Z}/n)$ the 1-dimensional generater $\alpha$ satisfies $2\alpha^2=0$ by commutativity of cup product, which forces $\alpha^2=0$ when $n$ is odd but not when $n$ is even. In fact $\alpha^2\neq 0$ when $n$ is even. This is well known for $n=2$, and for larger even $n$ this is shown in Example 3.9 in my book. Thus for $n=2k$ we have $H^\ast({\mathbb Z}/n,{\mathbb Z}/n)={\mathbb Z}/n[\alpha,\beta]/(\alpha^2-k\beta)$.
Comment: Comment on my previous comment: It is an interesting little exercise to determine which powers of $\alpha$ are nonzero.
Answer: I don t recall seeing the computation, but you can almost immediately obtain a description as follows. Let me write $C$ for the infinite cyclic group, so as not to have too many $\mathbb Z$s.
Consider the Lyndon–Hochschild–Serre spectral sequence corresponding to the extension of groups $$0\to C\to C\to\mathbb Z/n\mathbb Z\to0$$ whose $E_2$ page looks like $H^p(\mathbb Z/n\mathbb Z,H^q(C,\mathbb Z))\Rightarrow H^\bullet(C,\mathbb Z)$. It is very easy to see that $H^q(C,\mathbb Z)$ is $\mathbb Z$ for $q\in\lbrace 0,1\rbrace$ and zero otherwise.
It follows now from convergence of the spectral sequence and the distribution of the zeroes in the $E_2$ page (we only have two rows) and  in the limit, that the differential $d_2^{p,1}:H^p(\mathbb Z/n\mathbb Z,\mathbb Z)\to H^{p+2}(\mathbb Z/n\mathbb Z,\mathbb Z)$ is surjetive for $p=0$ and an isomorphism for $p>0$. Now $d_2$ is given by the cup product with the class $\zeta=d_2^{0,1}(1)\in H^2(\mathbb Z/n\mathbb Z,\mathbb Z)$ (Here the $1$ is that of $H^0(\mathbb Z/n\mathbb Z,\mathbb Z)$)
This is enough to get the whole ring structure. Indeed, the spectral sequence degenerates at $E_2$, so gives us an exact sequence (values in $\mathbb Z$ everywhere) $$0\to H^1(\mathbb Z/n\mathbb Z)\to H^1(C)\to H^0(\mathbb Z/n\mathbb Z)\xrightarrow{\zeta\cup(\mathord-)}H^2(\mathbb Z/n\mathbb Z)\to0$$ and isomorphisms $$\zeta\cup(\mathord-):H^p(\mathbb Z/n\mathbb Z))\to H^{p+2}(\mathbb Z/n\mathbb Z)$$ for all $p\geq1$. We know that $H^1(\mathbb Z/n\mathbb Z)$ is torsion, and according to the exact sequence it is also a subgroup of $H^1(C)=\mathbb Z$, so $H^1(\mathbb Z/n\mathbb Z)$, and along with it all the odd-degree groups, is zero.
The map $H^1(C)\to H^0(\mathbb Z/n\mathbb Z)$ is easily computed (it is one of the maps appearing in the usual «$5$-term sequence», as in Hilton-Stammbach, Th. VI.8.1) to be multiplication by $n$, so $H^2(\mathbb Z/n\mathbb Z)\cong \mathbb Z/n\mathbb Z$ generated by the class $\zeta$. The isomorphisms above then imply that $H^{2p}(\mathbb Z/n\mathbb Z)$ is cyclic of order $n$, generated by $\zeta^p$.
Answer: Well, it's kind of a homework exercise. In particular, in Ken Brown's "Cohomology of Groups" it's Exercise V.3.2 which recommends using diagonal approximation. Here is my solution for completeness, using only the basic machinery:
Let $G=\langle t\rangle$ be a finite cyclic group of order $n$ and let $F$ be the periodic resolution $\cdots\rightarrow\mathbb{Z}G\stackrel{t-1}{\rightarrow}\mathbb{Z}G\stackrel{N}{\rightarrow}\mathbb{Z}G\stackrel{t-1}{\rightarrow}\mathbb{Z}G\stackrel{\varepsilon}{\rightarrow}\mathbb{Z}\rightarrow 0$, where $N=\sum_{i=0}^{n-1} t^i$ is the norm element.  Let $\Delta:F\rightarrow F\otimes F$ be the diagonal approximation map whose $(p,q)$-component $\Delta_{pq}:F_{p+q}\rightarrow F_p\otimes F_q$ is given by  $\Delta_{pq}(1) =$
$\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;1\otimes 1\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;$ for $p$ even
$\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;1\otimes t\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;$ for $p$ odd and $q$ even
$\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\sum_{0\le i < j\le n-1}t^i\otimes t^j\;\;\;\;$ for $p$ and $q$ odd
(Check that this is a diagonal approximation!)
Consider the cohomology groups $H^{2r}(G,M)\cong M^G/NM$ and $H^{2r+1}(G,M')\cong Ker(N:M'\rightarrow M')/IM'$ where $I=\langle t - 1\rangle$ is the augmentation ideal of $G$.
The cup product in $H^*(G,M\otimes M')$ is given by $u\smallsmile v=(u\times v)\circ\Delta$ with $\langle u\times v,x\otimes x'\rangle=(-1)^{deg(v)\cdot deg(x)}\langle u,x\rangle\otimes\langle v,x'\rangle$.
Choose representatives $\langle u,x\rangle=m\in M$ of $H^i(G,M)$ with $m\in M^G$ for $i$ even and $m\in Ker(N:M\rightarrow M)$ for $i$ odd, and choose representatives $\langle v,x'\rangle=m'\in M'$ of $H^j(G,M')$ with $m'\in M'^G$ for $j$ even and $m'\in Ker(N:M'\rightarrow M')$ for $j$ odd.
If $i$ is even then $(-1)^{deg(v)\cdot deg(x)}=(-1)^{deg(v)\cdot i}=1$, and if $j$ is even then $(-1)^{deg(v)\cdot deg(x)}=(-1)^{-j\cdot deg(x)}=1$, and if both $i$ and $j$ are odd then $(-1)^{deg(v)\cdot deg(x)}=(-1)^{-j\cdot i}=-1$.
Thus the cup product element of $H^{i+j}(G,M\otimes M')$ is represented by $m\otimes m'$ for $i$ or $j$ even and is represented by $-\sum_{0\le p < q\le n-1} t^pm\otimes t^qm'$ when $i$ and $j$ are both odd.
Comment: Since the question asked for a reference, I will say that Chris Gerig's calculation esssentially appears with some more elaborations in section 7 of chapter XII (pages 250-252) of the book "Homological algebra" by Cartan and Eilenberg. There the calculation is phrased in terms of Tate cohomology, which agrees with group cohomology in positive degrees (including the ring structure).
Comment: I get stuck with this computation, especially about the sign convention. Given this diagonal approximation, do we succeed to find a commutative differential graded algebra representing $\mathbb Z^{hG}\simeq\operatorname{RHom}_{\mathbb ZG}(\mathbb Z,\mathbb Z)$?


What happens if i delete goals on CM?

Question: what happens when i delete Web-forms and it goals on CM?
is there any impact in analytic or else?
I don't need the goals and that Web-forms anymore, because its not used anymore and it become junk on my CM so i want to delete it.
Answer: As far as I know, there is no impact on the analytics or elsewhere as long it is not being referenced in the code. Once you delete it from CM, on CD also it will get removed. Since there will be no content / forms associated with the goals, nothing will trigger.
Analytics data that have already been captured will still remain. However, as new data is being captured in the analytics table, the goals that have been deleted will become old and may not come up based on the amount of analytics data captured.
Comment: oh thanks, is there any impact on visitor value?
Comment: No the visitor value is already in the database but note that tomorrow if you recreate the goals, it will have another Id. So you may need to migrate the data to map the new goal Id

What happens if i delete goals on CM?


Diffusing a laser?

Question: I haven't been able to find much information about this, maybe I'm searching the wrong thing but, how would you diffuse a laser beam from a thing collimated beam, into a "cone" of light? More directional than an LED, but much more spread out than a laser. Thanks in advance.
Comment: Wouldn't a diverging lens (like double-concave or plano-concave) of appropriate radii of curvature do the trick?
Answer: It is not clear whether you want to simply spread the beam, or want to diffuse the beam.  If you spread the beam, you will end up with a relatively smooth distribution of light.  If you diffuse the beam, you will end up with a speckle pattern.
To spread a thin collimated beam into a smooth conical distribution, the best way is to send the beam through a low-power (long focal length) lens and place a pinhole aperture at the focal point.  The pinhole aperture will "scrape off" the noise in the beam and produce a smooth distribution.
To diffuse the beam, you can send the beam through, e.g., a ground glass diffuser or an opal glass diffuser; or you could bounce the beam off of a white-painted surface.  This will cause the beam to scatter in a wide range of directions, and you can place an aperture downstream to limit the beam to a cone of angles.
If you diffuse a very thin beam, you will end up with large widely spaced speckles in the conical beam.  If you first spread the beam to, say, 1/4 inch wide using a lens, then diffuse the beam, you will end up with small closely packed speckles.

Diffusing a laser?


In Clan Wars, what would happen if both clans get full stars (100% destruction)?

Question: With the introduction of the new tie breaker, if the amount of stars is the same it will compare the average of the destruction % of best attacks. But what would happen if, for example, both clans get full stars (which is 100% average destruction for both clans)?
Comment: Then its a tie still
Comment: So, in a league war, no one gets the extra 10 stars I guess?
Answer: Average destruction is rarely ever tied, as the number goes up to four numbers, two on the right and left of the decimal. But assuming that the destruction averages are the same, it will be a draw as sourced from the Clash of Clans Wiki:

Should both clans deal the same amount of stars and total destruction, the war will be considered a draw. This, however can be considered rare, as total destruction dealt is different in each attack and hardly sync with the enemy clan.

So draws are possible... but much,much less likely.
Answer: Your logic is quite confusing to follow here, however, I will do my best to explain.
Since your first and last statements contradict, I will tackle the first, and follow with the second.
If both clans tie in stars, the clan who has the highest total destruction on their best attack. There is no avaraging. The best attack is in theory determined by destruction, stars, level of attacker, level of defender ((town hall included)), as well as time used, clan castle troops killed, and remaining heroes. The clan with the highest percentile wins.
Now for your second statement, there seems to be a lot of confusion going around. Both clans having the same stars before the tiebreaker would cause a draw. After this update, whichever clan has the highest percentile of destruction in their clan best attack wins the war.
In short, it's not based on average destruction, it's based on each clans' best attacks.
The best attack is near about never 100%, as pointed out here.
Answer: Assuming a straight up tie--every attack from both sides being a perfect 3 stars (average destruction still being 100%)--then it is still a draw.
Essentially, when it comes to percentages, it's likely that no building is a round figure. For example, assuming each building held the same value, 101 buildings holding the same weight would essentially be 100/101 = 99.0099% each.  It's the .0099% that would ultimately cause deviations between the two "average destructions", even if they appear similar to the hundredths decimal point--one would outweigh the other to the thousandths and tenthousandths.
Comment: I've removed your insults from your answer.  That took out three of your five paragraphs.  If there was something useful in them, feel free to add them back, without the insults, please.


What is the hash-rate of the Bitcoin network that results in the maximum difficulty?

Question: According to https://en.bitcoin.it/wiki/Target the target is a 256-bit number.
As the total hash-rate of the Bitcoin network rises, this number decreases to increase the difficulty. How much hash-rate (in terms of GHash/s) would cause the target to reach the minimum value? will the target ever get to 0? Does that mean it will be impossible to find a new block? (the minimum of a SHA256 hash is 0 which is not less than 0)
Answer: The hardest possible target is all zeros plus a one (0000000...1). If such a block were ever mined (which is extremely unlikely: on average you'd need 2^255 hashes per 10 minutes, which is 9.6e73 hashes per second), it would definitely crash the network : there can only be one hash at that difficulty, which means that there can only be one block mined at that difficulty.
Of course, if the target is zero, no block can be mined at all.
Comment: Yes. Block hashes must be unique, and the hash zero is already reserved as the `prevblock` for the genesis block, so a block with all zeroes is an impossible block.
Comment: The network would probably crash before that, because collisions would increase as the target approached the minimum, which would also cause unconfirmed transactions to pile up.
Comment: Also if block `0000000...1` was mined (by coincidence) today while the target is much higher, it would be harmless.
Comment: Do you mean that there's only one block with the hash zero?
Comment: This is slightly off: a block is valid when its hash is less than **or equal to** the target. So if the target is 0, there is still one valid block hash possible.


The only positive integers that divide successive numbers of the form $n^2+3$ are $1$ and $13$

Question: I stuck with this problem, I don't know how to start with.
Prove that the only positive integers that can divide successive numbers of the form $n^2+3$ are 1 or 13.
Comment: what are successive numbers of the form $n^2+3$.. Give some examples..
Comment: A start: We are looking for common divisors of $n^2+3$ and $(n+1)^2+3$, that is, $n^2+2n+4$. Any such common divisor must divide their difference $2n+1$.
Comment: @kklm 13 divides both 39 and 52 which are two consecutive integers of the form.  I took me a while to realize the OP did meant "ass" of the form but that there exists at least one pair of consecutive integers of the form.
Answer: We apply the euclidean algorithm on the polynomials:
$n^2+3,(n+1)^2+3$
We get:
$(n+1)^2+3=(n^2+3)+(2n+1)$
$2(n^2+3)=n(2n+1)+(-n+6)$
$2n+1=-2(-n+6)+13$
From here:
If $d$ divides $(n+1)^2+3$ and $(n^2+3)$ then $d$ divides $2n+1$.
If $d$ divides $n^2+3$ and $(2n+1)$ then $d$ divides $(-n+6)$.
If $d$ divides $2n+1$ and $-n+6$ then $d$ divides $13$.
Putting it all together we have that if $d$ divides $n^2+3$ and $(n+1)^2+3$ then $d$ divides $13$.
Comment: "the d divides -n + 6" so if n = 19... $19^2 + 3 = 28*13$ and $20^2 + 3 = 31*13$.  Cool!  And if n = 32......$32^2 + 3 = 79*13$ $33^2 + 3 = 84*13$.  Neat....
Comment: @fleablood:  in fact, $(13k+6)^2+3=169k^2+156k+39$ is divisible by $13$, as is $(13k+7)^2+3=169k^2+182k+52$
Answer: This answer is essentially the same as the first answer, by dREaM, but written down in a different form which I personally find easier to understand.  (In this answer, all variables range over the integers.)$
\newcommand{\calc}{\begin{align} \quad &}
\newcommand{\op}[1]{\\ #1 \quad & \quad \unicode{x201c}}
\newcommand{\hints}[1]{\mbox{#1} \\ \quad & \quad \phantom{\unicode{x201c}} }
\newcommand{\hint}[1]{\mbox{#1} \unicode{x201d} \\ \quad & }
\newcommand{\endcalc}{\end{align}}
\newcommand{\ref}[1]{\text{(#1)}}
\newcommand{\then}{\Rightarrow}
\newcommand{\when}{\Leftarrow}
\newcommand{\true}{\text{true}}
\newcommand{\false}{\text{false}}
\newcommand{\divides}{\mid}
\newcommand{\abs}[1]{\lvert #1 \rvert}
$
The mechanism which we will use here is the basic step of Euclid's algorithm for calculating the greatest common divisor of two numbers: for any $\;a,b,c,d\;$, $$
\tag{0}
d \divides a \;\;\land\;\; d \divides b \;\;\equiv\;\; d \divides a \;\;\land\;\; d \divides b + c\cdot a
$$ where often $\;a<b\;$ and $\;c<0\;$.  (Of course $\;\divides\;$ stands for "divides".  I've chosen to avoid confusing extra brackets by giving this relation lower precedence than arithmetical operators, but a higher precedence than logical operators.)
Armed with this, for any $\;n,d\;$ where $\;d\;$ is positive, let's calculate which $\;d\;$ satisfy the stated condition:
$$\calc
    d \divides n^2 + 3 \;\;\land\;\; d \divides (n+1)^2 + 3
\op=\hints{a 'Euclid step': subtract LHS from RHS, i.e., $\ref{0}$ with $\;c := -1\;$}
       \hint{-- to get rid of the square on the RHS}
    d \divides n^2 + 3 \;\;\land\;\; d \divides ((n+1)^2 + 3) - (n^2 + 3)
\op=\hint{simplify RHS}
    d \divides n^2 + 3 \;\;\land\;\; d \divides 2n+1
\op\then\hint{LHS: property of $\;\divides\;$}
    d \divides 2(n^2 + 3) \;\;\land\;\; d \divides 2n+1
\op=\hints{a 'Euclid step': subtract $\;n\;$ times RHS from LHS, i.e., $\ref{0}$ with $\;c := -n\;$}
       \hint{-- to get rid of the square on the LHS}
    d \divides 2(n^2 + 3) - n(2n+1) \;\;\land\;\; d \divides 2n+1
\op=\hint{simplify LHS}
    d \divides 6 - n \;\;\land\;\; d \divides 2n+1
\op=\hints{a 'Euclid step': add 2 times LHS to RHS, i.e., $\ref{0}$ with $\;c := 2\;$}
       \hint{-- to get rid of the $\;n\;$ on the RHS}
    d \divides 6 - n \;\;\land\;\; d \divides (2n+1) + 2(6-n)
\op=\hint{simplify RHS}
    d \divides 6 - n \;\;\land\;\; d \divides 13
\op\then\hint{logic: weaken}
    d \divides 13
\op=\hint{13 is a prime number; $\;d\;$ is positive}
    d = 1 \;\;\lor\;\; d = 13
\endcalc$$
This proves that at most $1$ and $13$ satisfy the condition.
Answer: Let $p$ be a prime such that $p$ divides the GCD of $n^2+3$ and $(n+1)^2+3$.
It follows $$2n+1=Np\iff n=\frac{Np-1}{2}$$ Hence $$\left(\frac{Np-1}{2}\right)^2+3=Rp\iff N^2p^2-2Np+1+12=4Rp$$ Consequently $p=13$, only possibility for primes $p$, the other factor being the trivial one $1$.
We must, of course, see at the other condition $(n+1)^2+3$ in order to verify compatibility.It gives immediately, $p|13$ also.
An easy calculation gives the numbers in question: $$\color{red}{n=13N+6}$$


What is the most professional way to handle disagreement over technical problem or code review with a colleague?

Question: I would like to get a consensus from more senior level colleagues here on how to handle a situation where you may disagree on a technical problem or code review with a colleague in an environment that has no standards.
Comment: @Daniel Who is actually writing the code? You or another dev? In most "flat" organisations, this matters. If there are two, more-or-less equally valid ways of doing something with no clear winner, the responsible dev "owns" the implementation and so gets to make the decision. The concept of ownership is pretty important to job satisfaction.
Comment: Is there a process or precedent in your organization for determining "correctness" of technical solutions? Any standard you develop to? Are you asking us to help you approach the senior colleagues to create a standard, or to resolve a specific disagreement?
Comment: @dwizum, there is no process or precedent. Typical hierarchical organization, usually the higher on the totem pole, makes you correct and anyone lower is wrong. What would be the best approach in the typical hierarchical environment?
Comment: Typical approach to do what? Try to get a standard/process in place, or resolve a conflict/question on a specific technical review (in an environment that apparently has no standards)?
Comment: @dwizum, hmm, so what would you recommend in an environment with no standards?
Answer: I always try to sell ideas from a position of confidence and assertiveness. I do my best to defend my ideas, not shut down if someone disagrees. I would come back and tell them that I considered what they want to do and why I decided on the other approach as well. If I knew a more senior person that agreed with me, I would try to get them to present the idea and utilized that, not to get my way, but to learn how to disagree and resolve disagreements in that organization.
Answer: Basically, depends on the situation. If it is something that you are experienced on and if it is your responsibility, and if someone is talking without having a clue, I would possibly suggest to put your reasoning with examples. Be assertive that it is your responsibility but be open to hear the other side and ask questions to understand where your colleague is coming from.
In case you think what your colleague is trying to sell is not any good, list the disadvantages of his/her approach.
Answer: A lack of standards seems to be the particular issue here. I am a senior developer (15+ years) and in most of my experience there are usually established patterns in existing code that can be followed when solving new problems.
In the absence of any precedent, if your colleague is of the same experience level as you, then can you not seek the opinion of a more senior staff member? If I disagree with the approach someone with less experience has taken, I try to explain it by exploring some of the issues that can arise with the approach and why other solutions may mitigate them.
That said, in software development there are usually many "right" ways of doing something, just as there are many "wrong" ways. Most modern software teams adopt the Agile methodology and the KISS principle ("Keep It Simple, Stupid") which advocates that if two or more solutions achieve the desired outcome, the optimal choice is the simplest one to implement.
Anecdote: in my earlier years as a developer I struggled with this principle because I wanted to perfectly engineer my code and use lots of design patterns and abstractions, partly to make the solution elegant and also to future-proof my work. Only through experience have I learned that it's as likely any future-proofing is wasted effort due to the ever-changing nature of software systems. Trying to forward-engineer usually makes it harder in the long run, except in that rare case where your early optimization happens to fit the change you didn't know was coming.
Answer: First of all, you can support your claims with evidence from people who have studied these sorts of problems longer than either you or your colleague.  Read some books from the likes of Bob Martin, Kent Beck, Martin Fowler, and Michael Feathers.  Learn how to describe the problems with code in more concrete terms than, "This way feels cleaner."
Second, code talks louder than words.  People are often easier to convince when looking at real code, instead of just a theoretical better implementation.  Also, sometimes you might be surprised yourself when you think a certain way to write it will be cleaner, so you write it that way and find out there are problems you didn't consider.
Finally, people are more willing to make changes when it's earlier in the process.  A code review feels like the last step before calling a change "done," and people are loathe to make significant changes at that point.  Try to foster a culture of doing design reviews earlier, before you spend a lot of time coding.  Start by asking for whiteboard design reviews of your own code.  When other people see how it improved your design, they will start asking for it for their own code.


How to create new tags?

Question: I would like to post a question for NodeOS, but I didn't find this tag.  How do I create the new tags?
Comment: Notice, that unless is something strongly tied to a programing task, your question would be very likely be closed. Just tagging node.js should be enough most (always) of the times.
Comment: What is this NodeOS you speak of?
Answer: Users over 1500 reputation can create tags. You can't.
They simply type the name of the new tag into the "tags" line of the question create/edit form. This results a confirmation popup, after accepting that the tag is created.
(And tags not having question will be automatically removed in a day.)
P.s. post a comment below your question with your request, I am sure around the first visitor over 1500+ will do what you want.
Comment: This answer and the preceding comment are both severely deficient. To initiate
the creation of a new tag by **suggesting** it, all it takes is a mere 5 in
reputation. See the procedure described as
["you can request the creation of a tag by starting a new **meta discussion**"
](https://meta.stackoverflow.com/a/252945) and the five bullets of that answer
which are required to be diligently pursued.
Comment: yes, you have to get 1500+ reputation

How to create new tags?


How java web application are bundled as jar

Question: I know for any restful web service the packaging should be in .war format so that it can be delpoyed to any servlet container eg: tomcat or jetty. Currently i am working in some project and I cannot see any file with a .war extensio. All i see is a .jar file and i guess the jar is itself getting deployed. I want to understand how and why it is working.
Answer: It can be something else but, right now, the most obvious explanation I can think of is that your application is using one of the java frameworks designs to help to build web applications, like Spring Boot or Dropwizard. These frameworks pack their own webserver and they generate a <code>.jar</code> when packaged to be able to run them easily on containers or everywhere is needed. Spring Boot usually uses Tomcat and Dropwizard uses Jetty for example.
Answer: Java Web project is packaged or deployed as a jar package because it is packed in jar package. Like spring boot, Tomcat or underlow or jetty are embedded in the jar package. java -jar is used The command starts the container from the main method entry of a main startup class, then initializes the container and loads the web project related resources.
you can get demo quickly by spring boot :https://spring.io/projects/spring-boot


Recommended pixel size for labels for mobile?

Question: In the same way that the minimum tap area for mobile should be 44px according to apples documentation, is there a recommendation for label sizes?
Comment: Do you realize Apple's recommendations are specifically for Apple devices?
Answer: I don't believe Apple has a recommendation for a specific size in pixels, but their Human Interface Guidelines includes a section on labels that essentially just says they need to be legible:

You can use a label to name or describe parts of your UI or to provide short messages to the user. A label is best suited to display a relatively small amount of text.
Take care to make your labels legible. Don't sacrifice clarity for fancy fonts or showy colors.

If you're looking for some more general indicators of size, you may want to look at their Icon and Image Creation Guidelines, which include many recommendations for the sizing of particular types of images and icons.  For example, the following guidelines for icon size may give you some sense of how large to make your text if you want it to look reasonable in comparison with them.

For toolbar and navigation bar icons on iPhone, iPod touch, and iPad, create an icon in the following sizes:
About 20 x 20 pixels
  About 40 x 40 pixels (high resolution)
For tab bar icons on iPhone, iPod touch, and iPad, create an icon in the following sizes:
About 30 x 30 pixels
  About 60 x 60 pixels (high resolution)
Answer: The size of the button is wholly dependent on the resolution of the device. On a 300dpi display, a 44 pixel wide image will be fairly hard to hit at about 1/6th of an inch.


Can I record using electric guitar to Zoom G3 to M-Audio Fast Track?

Question: I have an electric Fender and the Zoom G3 pedal; a friend of mine is going to provide his M-Audio Fast Track interface. Is it possible to record my guitar by plugging my Zoom G3 into this interface? My idea is plugging my guitar into the Zoom G3, and then to plug the Zoom G3 into the interface (M-Audio Fast Track). Besides that I would be using Reaper as the digital audio workstation.
Comment: Adding effects later is often suggested, but usually by people who don't play guitar :-)   They are an integral part of the guitar sound, and you play to the effect, it isn't something to be bolted on later.  Even vocalists like to hear some reverb in their headphones while recording.
Comment: Consider, if possible, recording your tracks pre-effects. This allows you to alter or tweak the effects chain during mixing without having to re-record the performance.
Comment: The answer to your question would require an entire textbook. There are many textbooks available on the subject of home recording. I do not believe that we can educate you on this subject in a few short posts on this site.
Answer: You should be able to plug your guitar in into the Zoom G3 and plug the G3 into the computer.  The Zoom G3 has a computer interface to plug directly into your computer through a USB cable.
From the description from Zoom "G3 operates as an audio interface, letting you record directly to your computer via USB. All of your sound settings used during rehearsals or live performances can be recorded to your favorite DAW ..."
There is no reason to use the M-Audio unless you want to simultaneously (at the same time) record vocals and guitar or record more than one source at the same time.
Plugging directly from the Zoom G3 into the computer would reduce latency (the delay between what you play and what you hear if you monitor the output).  If you just want to record the guitar output from the Zoom G3 into Reaper and then add other instruments or vocals separately, I would just plug the G3 straight into the computer.  There is no need for a separate interface in between the Zoom G3 and the computer.
Pro Tools should have no problem accepting input from any class-compliant USB audio device. As far as using them both, that's actually what you can't do, at least not in Windows.


Approximate weight ratio between 50/60 Hz and 400 Hz electric machines

Question: I need a fast (not to much elaborated) approximation figure of how lighter will be a transformer or motor designed to run on 400 Hz compared with an equivalent machine with the same power capacity designed to run on 50/60 Hz.
Comment: Assuming the same transformer is used (to avoid long "elaboration"), the core cross-section is the same and it can support the same flux density. That means the same number of Webers (flux.) The wire will have the same cross-section too and can support the same maximum (peak) current. So both (X) Webers and (Y) Amps hasn't changed. The only remaining thing that has changed is frequency. Power = Webers * Amps * f. So about 8 times more power for the same transformer. It's pretty easy from there to work out the weight savings.
Comment: Or also see: [core volume](https://electronics.stackexchange.com/questions/268814/why-ac-supply-is-rectified-first-before-stepping-voltage-down/268840#268840). (Note that in the above I didn't comment further on how well such a transformer designed for a lower frequency might work for a higher one (eddy current losses differences, for example.)
Comment: To put it succinctly: A lot lighter.
Comment: Can you think of any physical reasons that would determine the ratio?
Answer: With motors, the rated torque is fairly closely related to the size/weight of the machine. The rated power is not so much related. A 400 Hz motor of a given size/weight will produce about the same torque as a comparable 50 Hz machine, but the rated speed will be eight times as fast. Since rated power is rated torque X rated speed X units of measure factor, the rated power will be multiplied by eight. That does not take into account some increase in losses due to increased speed and frequency.
In order to produce 8X power at the same torque and current, 8X voltage would be required. The core would support that magnetically, but the winding insulation would not. Higher voltage rated insulation might require some additional space.


Unused Ethernet pins

Question: I want to use the LAN9500AI controller in an application. This is a USB <-> Ethernet bridge with access to the MII interface. Since I just need the USB and MII interface, the ethernet interface (RXP, RXN, TXP, TXN) will be unconnected. But what's the "default" state of these pins if they are unused? Should I connect pull ups/downs to these pins? (I assume, this is not necessary for TXP, TXN).
Comment: The typical ethernet connection for those pins require 50ohm pull-ups to 3.3V, for all four pins. Not sure what the MII interface requirements for it would be. Have you emailed Microchip/SMSC support?
Answer: In principle, the device should work damage free without anything connected.
But, since you can't be sure without direct input from Microchip or whatever SMSC is, just hook up resistors like on page 8 of this datasheet and leave out the inductor and other nodes that remain floating. Or, put differently: As Passerby comments all lines up to 3.3V with 50Ohm.
Unless you can obtain an app-note I failed to find explicitly saying otherwise, that seems to be the best idea.

Unused Ethernet pins


a question on compactly supported function (CSIR-2014)

Question: Let $a,b,c$ be positive real numbers, $$D:=\{(x_1,x_2,x_3)\in R^3:x_1^2+x_2^2+x_3^2\leq1\}, \\E:=\{(x_1,x_2,x_3)\in R^3:\frac{x_1^2}{a^2}+ \frac{x_2^2}{b^2}+\frac{x_3^2}{c^2}\leq1\}$$ and $$A=diag\left [{\begin{array}{cc} a & b&c \ \      \end{array} } \right]$$ with det$A>1$. Then, for a compactly supported continuous function $f$ on $R^3$, which of the following is correct?$$1.\int_D f(Ax)dx=\int_Ef(x)dx \\2.\int_D f(Ax)dx=\frac{1}{abc}\int_Df(x)dx\\3.\int_D f(Ax)dx=\frac{1}{abc}\int_Ef(x)dx\\4.\int_{R^3} f(Ax)dx=\frac{1}{abc}\int_{R^3}f(x)dx$$ My approach here is to find some easy example of compactly supported function on $R^3$ and try to see each option for its validity but I am not able to find any simple one except those bump types. Other idea is to look for some nice theorem on integrals that could help here but there too I don't find any.   (I am not good in latex typing, so for any mistakes or not be able to follow the standard typing patterns I apologize.) (Thanks for any help )
Comment: Your typesetting is fine.
Answer: The nonsingular linear transformation $A$ maps $D$ onto $E.$ Thus
$$\int_E f = \int_D f\circ A |\det A|$$
for any $f$ continuous on $E.$ This follows from the standard change of variables formula in several variables. This shows $3$ is true. Therefore $1,2$ don't hold. I'll let you think about 4.


How can I seal doors and windows to keep air out?

Question: My problem is that my door has a wide crack under it. It lets in insects and lets out the air or heat. I know you can use a foam seal but need something to go all around the door. I haven't tried any thing yet because I dont know what to start. Can anyone provide a suggestion for the method I should use?
Answer: You need to add a threshold to the door to seal under it.  There a number of thresholds where you can then adjust the height to meet the bottom of the door.  Around the other 3 sides you need to add weather stripping.
Answer: if you are not allowed to add anything to the door you can buy a long round cushion that you put in front of the door (or train your dog to do that :) )
If you are allowed to add something to the door you can install a sweep:
Comment: That doesn't look like it would block air movement like a compressible gasket would.
Comment: A brush-style sweep does help reduce airflow, though it isn't a gasketed seal. There are variants which have multiple plastic ridges or other protrusions that attempt to achieve a better seal; I'm not sure whether they actually work significantly better.


Umbrella: "Take Three" lyrics

Question: In Umbrella by Rihanna and JAY-Z, JAY-Z says "Take three, action" 7 seconds in. Does this mean that they had previously recorded this song 2 times and these attempts weren't as successful?
Answer: "Take three" could have been a reference to recording a song fifty years ago when whole songs were recorded at once in a studio, but "action" makes it a reference to shooting a movie. You'd never hear the word "action" in a sound studio.

Umbrella: "Take Three" lyrics


How do I record internet radio stream from banshee?

Question: Maybe present some extension?? I have use banshee 1.9.0
Answer: It doesn't work for me, and I doubt it will work for you. There is an extension for Banshee to accomplish this, but it normally causes banshee to hang, sometimes crash.
If you are using 1.9 from a ppa, install the community-extensions, and then enable stream recorder. When you go to the radio browser, you can then click on the record button and see if it works for you. If it doesn't work I would suggest using rhythmbox to record.
Comment: your english is fine to me :)
Comment: I was installed community-extensions and enable stream recorder, and when i open radio browser and pick the stream, banshee was crashed. [ my english so bad :( ]
Answer: The issue has now been fixed in the developer version. To get it working with the current version, all you have to do is to make sure to configure the StreamRecorder plugin to point to an existing directory before using it, otherwise it will crash.


Should there be an Apple logo on the hard drive of a MacBook?

Question: I was installing an update on my MacBook Pro mid 2012 when it crashed. Kernel Panic. I brought it to an authorized service center for repair. The following day, I got a call that the center is refusing to repair my laptop because when they opened it, apparently there was no Apple logo on the hard drive. Hence the question.
Answer: There should be. Many, if not all, MacBooks have in fact shipped with hard drives with Apple logos on them.
Comment: What to do then? It was bought from the Apple Store. The serial number was even verified to check its warranty.
Comment: I'm not sure what "Many, if not all" means.  I would be surprised if a non-reconditioned Mac from Apple had a drive without a sticker.  If you're sure the computer hasn't been repaired since you bought it, you might to ask Apple or the store to look into it.  Ask for an email or written note about the problem as they see it.


AVR atmega328p - Can I use port C as digital output pins?

Question: I'm currently trying to connect a 7x5 dot matrix to an AVR ATMega328p. I'm already using port B/D and I would like to use port C so that I have extra output pins. My question is, can I use port C as digital output pins without ruining the microcontroller? I know that this port is normally used for analog-digital conversion. If so, do I need to add additional configurations inside my C program?
Comment: It does not have PORT A. Do you mean PORT C?
Comment: Yes, sorry I mean Port C
Answer:
can I use port A as digital output pins without ruining the
  microcontroller?

Yes you can.

Below table describes about Sink and source capabilities:
VOH is when you try to output a high signal. The current should be less than a particular value which you can find in the same table. VOL is when you output a logic zero. Microcontroller can sink current and you should also care about limiting the current. Excess current may lead to damage of the IO Pin or the whole MCU.

Below are some notes about the analog function rich port C (in some packages, other ports) describing the GPIO capabilities and precautions to be taken.

do I need to add additional configurations inside my C program?

Follow the normal routine as configuring other pins.
Comment: It has been a while since I used this part, but I recall port C being supplied by AVCC instead of VCC for digital functions as well.
Comment: When it is the case, if the user is notnusing analog function, He/She can connect Digital VCC to AVCC as well
Answer: An analog pin is actually a normal pin with the alternate function of analog to digital conversion may be activated when needed, so you can use it as a digital pin in case if you don't activate ADC.


What's simplest way to measure mass or weight with Arduino

Question: I want to track the mass of a hanging window farm project. It seems like I should be able to get some sort of load cell device to interface with my arduino. What is the simplest way to do this?
Comment: Could you use an accelerometer to measure weight?
Answer: If you want ease of implementation, value for money, and good accuracy - then a cheap commercial 2 kg scales interfaced by whatever means is possible is liable to seve you well.
You can buy load cells and instrumentation amplifiers and roll your own, but the Chinese already make just what you want by the millions at a price which is liable to be far less than you can buy the parts for new.
The best (and in some cases also the cheapest) kitchen scales use a "real" load cell with 4 strain gauges in a bridge plus hopefully a 5th temperature compensating strain gauge (places on the load cell where stress/strain is caused only by temperature changes. The photo below shows a typical load cell used in low cost scales.

These can be converted to "hanging" operation either by removing the load cell from the scales body and custom mounting it (not very hard)

or by placing the scales on a beam and using a "question mark" shaped stiff wire to convey the force (weight) out around the scale body and onto the pan. I use a similar arrangement with the scales described below to suspend objects for weighing in an out of water for 'Archimedes' density measurements with good success.
Performance oc cheap kitchen scales varies from not-overly-marvellous through to unbelievably superb.I bought some end of line 2 kg kitchen scales here a few years ago for about $10 each, that were so good that I went back and bought the rest that were available - about 10 sets.
Mine looked very like these. Similar appearance no guarantee.

These are now about 'used up' and hopefully some equally good and cheap ones will turn up shortly.
Factors which relate are accuracy, linearity, repeatability and temperature independence. The first 3 are close travelling companions but not identical.
Obtain several hundred one and two cent coins. These will probably weigh close to 1.000 gram and 2.000 gram each. If not that then some other fixed mass. This is partially so banks can check amounts by weighing. They are amongst the best value for money calibration wights you can but. Make a few larger test weights by using eg coins to calibrate them. Say 100 200 400 800 gram would be easy. These can be made out of almost anything stable. Even eg plastic screwtop jars with water in - as long as they are airtight.
My scales would track linearly for any number of coins aded or removed and whether removed or added one by one or N at a time. Superb. Some scales are not so good.
Some scales are poorly temperature compensated. Mine can have a hairdrier waved over them on high until they are toasty hot (50C plus) with little of no display deviation. Superb.
Once you have found ones which are accurate enough for you, you nee to interface them to the Arduino. Most will have an anlog voltage(amplified strain gauge signal) which is converted to digital by the display controller. Signal level should be in the volt or few range - easy for an Arduino ADC to measure.
If you can't get at the analog signal you may be able to access the controller at the digital stage. Long ago people have gone so far as decoding 7 segmont multiplexed display signals for processor interface - but if it's that hard then finding ones with analog signal access would beeasier.
Some may use a V to F (Voltage to frequent) converter. These are easy to read by either pulse counting in finite time or by seeing how long it takes to make N clock cycles.
Comment: I have one of those sensors sensors striped from one of those scales. Any idea how exactly to interface them?
Comment: @Faken: "Standard" instrumentation amplifier and ADC BUT the scales has the implementation amp in and may have the ADC equivalent. Read my anser again above about that part.
Comment: Current US Pennies are 2.500 grams, while nickels are 5.000g.  http://www.usmint.gov/about_the_mint/?action=coin_specifications
Answer: Since it's a hanging system you're going to want to use something like a stretch sensor:
A load cell wouldn't work to well in this particular case. You can calibrate the stretch sensor using a weight calibration kit to map the sensor values.
http://www.arduino.cc/en/Reference/Map
Comment: Even a load cell beam of the sort shown in my answer can be used with complete ease in a hanging arrangement. Only issues are mechanical ones and these are minor.
Comment: There are load cells for hanging configurations too.
Answer: I wrote a comment "how about using accelerometer?" I was curious, googled and found out many smart people before me found the answer. You can use a simple spring and an accelerometer.
This message board discussion has the data.
What they don't say though, you need to calibrate your system since the spring constant will probably change over time. So, if you can have a known weight and do a calibration mode once in a while, this could be very low cost measurement system.


VTK: Basic visualization of heightfield

Question: I've got a basic hello world program of libvtk working as follows:
#include "vtkGraphLayoutView.h"
#include "vtkRandomGraphSource.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"

int main(int, char*[])
{
  vtkRandomGraphSource* source = vtkRandomGraphSource::New();

  vtkGraphLayoutView* view = vtkGraphLayoutView::New();
  view->SetRepresentationFromInputConnection(source->GetOutputPort());

  view->ResetCamera();
  view->Render();
  view->GetInteractor()->Start();

  source->Delete();
  view->Delete();

  return 0;
}

compile with:
$ g++ -I/usr/include/vtk-5.6 hello_vtk.cpp -lvtkInfovis -lvtkViews -lvtkFiltering

execute with:
$ ./a.out

I have two sets of data I want to visualize, both as heightfields:
The first is of the form:
double x1[N*M];

representing an N x M heightfield where height at (i, j) is x[N*j + i]
The second is of the form:
map<pair<double, double>, double> x2;

where there is a sample of a continuous surface from (i,j) of height h represented by:
x2[make_pair(i,j)] = h

Clearly an instance of x2 could be interpolated if necessary into an x1.
My question is which classes should be used and what is a sketch of the implementation necessary to visualize x1 and/or x2 in VTK?
(Is there any top down documentation of VTK?  It seems to be an extremely large library and the only reference I could find is the doxygene which requires linear time searching to find what you are looking for)
Answer: You have to get your data into a VTK data structure (probably a vtkImageData or vtkStructuredGrid). You can check out this example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/Color_a_mesh_by_height that should have a lot of elements you need to do this.
Note: the example uses a vtkPolyData data structure, but this is probably overkill for this type of regular/grid data.

VTK: Basic visualization of heightfield


Not able to remove components in Editable Template AEM

Question: I have been following the tutorial I have linked here to create a custom layout component https://helpx.adobe.com/experience-manager/using/bootstrap_grid.html but I noticed that removing this component from an Editable Template is not possible. How should I solve my problem?
Answer: TLDR;

Add content to the parsys in the component you are trying to delete (assuming it has a parsys or area to drag components to).
Refresh the page
Delete the structure component

Long Term Fix
For a more long term fix, have the component in question generate the missing content using a cq:template node.
Whats really happening
This is a bit wonky - but I'll do my best to explain.
If you are referencing content within your structure components via data-sly-resource using the @ resourceType option, you can't delete your structured component.
I just went through the ringer with this one. I had a very simple structure component:

And when I dragged it onto my editable template I could never delete it.

When you use @resourceType in a rendering script and the content doesn't actually exist, it creates whats known as a SyntheticResource.
So in my example, I went to the JCR and there is no content node underneath my content-container:

If I manually create the missing content (because of the data-sly-resource="${'content' from my code above) I can then delete the component.

As you can see the delete option is now there:

For a quick fix - just drag something into the parsys to create the node.
For a more long term fix, have the component in question generate that content using a cq:template node.
Answer: FYI, this page is NOT using editable template.

When a page has a relative path in sling:resourceType like this: 'grid-aem/components/structure/page', it is using static template.
Editable templates are created under /conf folder.
More differences between static and editable templates.

The static template provided in the sample includes only 1 parsys component in /apps/grid-aem/components/structure/page/partials/main.html.
So components added within the parsys can be easily delete on the page itself using delete button:

If you are looking to remove a parsys within the colcontrol component, this is a custom colcontrol with logic implemented to change number of columns. You need to author the component with desired number of columns. For example selecting 3 columns shows 3 parsys:

Selecting 2 columns on same component shows 2 parsys like this:

Hope this helps you.
Answer: Listen to the inspectable-added event and add the child nodes with Javascript:
STEP 1: Create a ClientLibraryFolder and add the cq.authoring.dialog.all category:

STEP 2: Write Javascript to listen to the inspectable-added event.  The callback function should add the child-nodes to the editable-template that are needed for the component to have all functionality such as EDIT, DELETE, MOVE, COPY etc.
(function($document, $) {
  $document.on('cq-inspectable-added', cb_inspectableAdded);
  function cb_inspectableAdded(evt) {
    try {
        var inspectable = evt.inspectable;
        var ajaxConfig = {
            url: evt.inspectable.path,
            data: {
                'sling:resourceType': inspectable.type
            },
            async: false
        };

        if(inspectable.type.indexOf('myApp/components') > -1) $.post(ajaxConfig); //  replace myApp/components with your partial-path
    } catch(e) {
        console.error(e);
    }
  }
}($(document), jQuery));

That's it! Now, when you add a component which has nested components such as a custom-layout-container or parsys or custom components-inside-components; it should have all the functionality.
Good Luck...


Would I gain from this?

Question: I used to lift weights every other day. But 2years have passed and I've probably lost most of what I gained in 1year of lifting. If I started back, I would only want to lift on Friday, Saturday, and Sunday. How effective would that be? Should I even bother with it?
Answer: Yes. Any exercise is more effective than no exercise.
Depending on how much you used to lift, it will come back quicker than it would in an untrained person. Part of the lifting process is neural adaptation as well as other physiological adaptations that don't really disappear.
It will still take a while to get back to where you were, and you will still feel soreness as you get back into it, but it will take less time than it did initially, and will be better for you than doing nothing.
Answer: As JohnP said. Yes! I would like to add if you are stacking days that it may be wise to switch between primary muscle groups on alternating days. Especially when starting back.
It may be tempting to get full body workouts each day since you have only the 3 days, but it could lead to injury.
If it were me. I would alternate the primary muscle groups on day 1 and 2, and have a fun full body workout to finish it up on the last day. I'd even include a little uptempo strength routine on that last day to get that heart going!
Comment: @HoneyBadger - I would point out that only working the "trophy" muscles will produce imbalances that can be unhealthy in the long run. You should be putting in effort to be healthy, not just pick up chicks/dudes.
Comment: Slow down now, I'm not going to a gym or anything its just casual lifting. Mainly upper body: Bench press, curls, and "nose breakers" if you know what those are.
Comment: @HoneyBadger The same can apply to casual lifting! Enjoy it, and don't stop! :)
Answer: Actually, this answer can vary. If you are lifting 3 days in a row and are doing only upper body as you say in your comment and are working on the same muscle groups day after day, then your muscles are probably not getting enough time to rest to grow back stronger in between your workouts. However, if you are doing the bench press on Friday, curls on Saturday, and "nose breakers" on Sunday you are getting enough rest but may not be exercising each individual muscle group enough; not to mention that nose breakers can cause elbow tendonitis. You should be training each muscle group at least 2 times a week. And not to even mention, where are your leg days? Legs and glutes are the strongest muscle groups on the human body, so why would you deny them? Overall, I think you need a real workout plan. Try something like this:
Monday: Full body workout(chest, back, legs, biceps, deltoids)
Wednesday: Full body workout
Friday:Full body workout
And take the other days for rest. Don't worry about working abs individually, as they will be worked through squats and deadlifts. This way you are exercising your entire body 3 days a week and giving it time to heal back up.

Would I gain from this?


How can I send ethereum

Question: I want to send ethereum, but by writing code directly, not from the wallet or interface, like "sendrawtransaction" in bitcoin.
How can I do that I need the codes or algorithm
Comment: With [web3.js](https://web3js.readthedocs.io/en/v1.3.4/index.html) you can use [`web3.eth.sendTransaction`](https://web3js.readthedocs.io/en/v1.3.4/web3-eth.html#sendtransaction).
Answer: There are a number of ways to use the command line to send an ETH transaction. Some of them will depend on whether you are running your own node (like using Geth's console). We'll try to detail a few here.
Seth
For a first recommendation, we'd like to point to Seth by DappTools. If you're used to a Linux-y way of doing things, you'll probably find this tool very intuitive, and it has great docs. The only possible downsides are key management (it relies on other services for key generation, which can have a learning curve if you haven't dug into it yet), and that you'll need the nix package manager if you don't already have it.
Once you have an address set up, using seth is as simple as setting that address as the ETH_FROM in the .sethrc, and using a syntax like this (taken from their docs):
$ seth send --value 1 0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359

(that would send 1 wei to the Ethereum Foundation after prompting you for your password)
Geth
If you are running a Geth node, you can send directly using your node. Geth uses a tool called Clef to handle account creation, here's a link to the official docs about how to setup an account:
$ clef init
$ clef newaccount

once you have a Geth node synced, in a terminal (not the one with the node's output, if there is one, it'll need to be a fresh terminal), use:
$ geth attach

to activate the Geth console. Taken from the Geth docs linked above, this would be the syntax for sending 1 ETH from one address to another from inside the console:
eth.sendTransaction({from:"<ADDRESS_0>",to:"<ADDRESS_1>", value: web3.toWei(0.01,"ether")})

Writing a Script
Using a variety of tools you can write a script or use a REPL to generate a transaction. Rather than go through each, we'll leave some links:
JavaScript

Ethers.js: link to Transaction Methods
Web3.js: link to web3.eth.sendTransaction (used in the Geth console, and mentioned by Ismael in the comments)

Python

Web3.py: link to Making Transactions

These will most likely need you to set up a provider (a connection to the blockchain), and will involve either importing an account (and maybe unlocking it) or generating one internally.
Good luck!

How can I send ethereum


What type(s) of compressed files was the MS-DOS EXPAND command able to decompress?

Question: What type(s) of compressed files was the MS-DOS EXPAND command able to decompress?
And what command was its counterpart?
Answer: EXPAND.EXE is a tool specifically created for installation of Microsoft products. Its file format is a proprietary Microsoft definition, not following any existing standard. It is only good to expand their own 'SZDD' (and later 'KWAJ') formats, not any other.
Its counterpart is COMPRESS.EXE which, AFAIK was not delivered with MS-DOS.
It uses of course well known algorithms. The original format, up to version 1.3, was identified by the 4-byte magic number of 'SZDD' at the start of the file. The compression method used is a rather straight LZSS. Later, with 1.4, the file format changed and the magic word became 'KWAJ'. This version supported five storage methods:

No Compression
No Compression, but all data inverted as camouflage against typing
LZSS as with prior versions
LZH
(MS-)ZIP (as used with later Windows .CAB files)

So, while more common compression got added, the file format stayed still MS-specific. Nonetheless, some programs, like 7-Zip, recognize the magic numbers and decode accordingly.
A look at this fine page will show more technical detail.
Comment: @zomega Well, Inverted means all zeros are stored as ones and all ones as zeros. Doing so will prevent a type command or other basic file viewer from showing any readable text.
Comment: What does "all data inverted as camouflage against typing" mean? I don't understand this sentence.
Comment: Thank you for the very detailed answer. The specific magic numbers would have been my next question :)


Residue Theorem, Find the sum of residues when z is an integer

Question: We have the function
$$ f(z)=\frac{\pi \cot(\pi z)}{(u + z)^2} $$
I already found the residue at the pole when $z = -u$. However there are more poles when z is an integer. How do I go about finding the sum of these poles? I don't think it's too difficult but I'm probably overlooking something simple. Just a kick in the right direction should do it. Thanks
Answer: As you found, poles exist at integer $z$.  Assuming $u$ is not an integer (to avoid double poles), and let $n \in \mathrm Z$:
$$\operatorname*{Res}_{z = n}\, f(z) = \lim_{z \to n}\, (z-n)f(z) = \lim_{z \to n}\, \pi \frac{(z-n)}{\sin(\pi z)}\frac{\cos(\pi z)}{(u+z)^2} = \frac{1}{(n+z)^2}$$
by L'Hopital's rule.


Salary Disparities Between Fields

Question: Have professors just come to accept that there are significantly higher salaries in certain academic fields (generally engineering, some business, law, etc.)?  Does it ever cause tension within a university faculty?  The irony is that not only do certain academic fields pay higher professor salaries, those same fields often allow for greater ability to do consulting and other income supplementing activities.
Comment: where in the world are you basing this on? in Germany all professors in all disciplines get the same amount of state fixed salary, so this statement is simply untrue for some countries.
Comment: I am definitely talking about the US.  As with most things, the US tends to be more market based and willing to have salary differentials.
Comment: I agree with Sursula. In many countries I worked before, in Europe and South America, all academic positions in public institutions have the same salary range independent of the field. Is this a question about private universities?
Comment: @Sursula See e.g. [University of California](https://www.ucop.edu/academic-personnel-programs/compensation/2023-24-academic-salary-scales.html), which has separate scales for business/economics/engineering, law, health sciences, and veterinary medicine.
Answer: This is certainly specific to the country you're asking for. It is true in the US, but it is not true in Germany where professors are (largely) paid the same regardless of the field they teach and research in.
Underlying your question is a suggestion that different salaries are unjust -- if that were not the case, "just come to accept" would not be an issue. But, I think your premise is at least open to debate. In the end, at least in the US, salaries are subject to market forces. If new PhD students in computer science, for example, can earn starting salaries well into the 6 digits, then universities will not have a choice but pay professors starting salaries that are substantially higher than, say, professors teaching medieval music who do not have a market that provide such high competing salaries. Perhaps one decry that these music professors do the same job and should earn the same salary, but meeting in the middle would then simply imply that computer science departments would be very empty -- because nobody would be willing to do the job.
So yes, there is an element to unfairness about this, but at the same time it's also reasonably pragmatic.
Comment: Note that the example of Germany you quote shows that the fear that CS departments would be empty seems relatively baseless. CS PhDs in Germany definitely also have much better paid job options compared to medieval music PhDs, professors teaching the two subjects are paid essentially the same and nevertheless CS professorships are all filled and quite competitive to get.
Comment: Yes I am definitely talking about the US.  The US tends to have more market-based compensation in just about everything hence the disparities.
Comment: From what I heard recently, there are actually quite extreme salary differences between professors in Germany, with individual professors having negotiated to receive twice the default salary (according to "W-Besoldung"). I don't know how the situation is between different fields, though.
Comment: @quarague If you talk to department heads in CS in the US, these fears are not without merit. Starting salaries for assistant professors of CS in the US (~$120k for 9 month salaries, plus grant funding in the summer) are about as high as W3 (full professor) salaries in Germany, In part that is because the CS salaries in industry in the US are very substantially higher than they are in Germany.
Comment: Also, did not mean to imply that I thought salary differentials was unjust.  My question was more around whether this affects how the different faculty get along and whether the salary differentials cause tension.
Comment: I see. Of course there is envy, but in the end people make it work. It's also nothing you can change, so there is only so much complaining about it that is useful.

Salary Disparities Between Fields