String instrument response vs. a nice ring

Question: I've been hunting for a violin, and am wondering: do you find that response (how easy it is to articulate) is inversely proportionate to how well it rings? Does this difference somewhat go down as price goes up? Thank you!
Comment: As an instrument dealer I've played many instruments in various quality ranges and I haven't seen a correlation between response and resonance.  The spectrum of available instruments is vast, I think Carl's answer has the crux of it.
Answer: Unfortunately, the answer is "it depends."  If you're a skilled player and can tell the difference between a $50,000 (US) and a $500,000  instrument, you'll be looking not only for response and resonance, but on the shape and flavor of the resonances.  Top players often have different (expensive) bows depending on whether they want fast, bouncy response for one piece or deep , languid projection for another piece.
If you're in the sub-$10,000 range, you may find yourself making some tradeoffs depending on what kind of music you favor (or whether you can tell the difference at all).  Further, a skilled luthier can adjust the soundpost and bridge position (or swap in a different bride) and drastically change the sound of a given axe.
My seasoned advice is:  play a bunch of violins, and then take the 3 or 4 favorites to your teacher and get unbiased feedback as to their quality and how they fit your playing style.


AJAX Toolkit API Version Number Maintenance in Custom Button Javascript

Question: Is there a way to access the following string
"/soap/ajax/33.0/connection.js" in {!requireScript("/soap/ajax/33.0/connection.js")} by using custom labels in custom buttons? So that whenever there is a change in ajax version, it can be updated in custom labels & it will eventually update in all custom buttons. Please advise.
Answer: {!} denotes an evaluated formula. You could try:
{!requireScript("/soap/ajax/" & $Label.myLabel & "/connection.js")}
But why would you want to do this? Doing a mass update to every instance of this is potentially removing the very predictability that API version is designed to give you.
There was another question about autoupdating Apex classes where I discussed some of the things that can change from one API version to another. Check out that answer here.
Please read it so you understand the ramifications of a mass update of every API version...even if my suggestion works.
Comment: Although, in all fairness, there's less risk of upgrading the toolkit than upgrading a class/page/component version blindly, but I still wouldn't intentionally do that.
Comment: I agree...lower risk. Which is why I bothered to suggest a way to do it. But I could see this question being the thin end of the wedge..."well, we do it with our JS custom buttons...why aren't we doing it with Apex/VF, too!?"
Comment: Salesforce can, and has, removed some fields between lower API versions and higher ones. If one uses this technique, they still risk stuff breaking.
Comment: Thanks so much @Peter. Your solution works pretty good!.
The reason to use this (only for custom buttons of type: onclick Javascript) we got an error when the detail page of record loads, the DOM refers the ajax toolkit version of the last button in the object and applies to ajax toolkit methods used in other button in object. In our scenario, the last button in the object has very older version 13.0 which displayed some errors.
Comment: @Peter, But I'd one concern, can you please advise me on the below?
Let's say there are ajax toolkit methods which are deprecated as part of some old version (for eg: version 18.0). If I update the version of that button from 18.0 to latest version. Will that method be still supported?
P.S: If it is not supported, my plan is to not update the version for those buttons. Sorry for the late comment to your answer.
Thanks


Whining noises when accelerating

Question: 05 Nissan Altima 2.5S
Whining noise when accelerating but only when I have the heat turned on. Once I turn it off it doesn't do it. Any answers to why it's doing this?
Comment: Is the noise in the sound system (radio)?
Comment: No not coming from the radio cause I always turn it off to try and hear where it's coming from.
Answer: Just from your brief description, I'd have to say the blower motor for the HVAC system is going out. They tend to last a long time, but when they start to go out, the bushings which support them (which the shaft of the blower motor rides on) starts to wear and dry out. The first sign of it is when you accelerate, there's a specific whining noise. You could also hear it during braking. When it gets bad enough, you'll hear it all the time, then the motor will just seize up and quit working.
I don't know about your Altima, but newer vehicles have made it a lot easier to change these out. Looking at the one specific to your vehicle, if you were to purchase it with the housing and the fan wheel as a unit, it looks to be a pretty straight forward replacement item. If you bought just the motor, taking it apart from the housing and fan would be a little bit more difficult.
Answer: Does the noise appear to be coming from the engine compartment?
It might be that your A/C compressor is engaged (yes it often operates with heat on). Or its belt is loose.  Have you tried turn on the A/C and compare?
Is the sound from within the passenger compartment?
   Is it from the radio maybe? (Turn it off / on and compare to see)
Does the speed setting of the heater's fan matter?
Comment: I will have my mechanic read these comments cause I have no idea what your talking about. Lol and I'll let you guys know what we figured out. Thanks for all the possible scenarios.
Comment: It could be the AC compressor. It's an ICVDC and these tend to get louder when the heat load (i.e. cabin temperature) is high (they only start destroking themselves once the evaporator temperature is approaching the water's freezing point, unlike externally controlled ones). The OP may try opening all doors and windows and turning AC on on a warm day. That way the compressor will work at full stroke and she may rev to check for any noises related to compressor full stroke operation. For destroked, close all windows and doors and turn recirculation/MAX COOL on, rev and listen for any noises.
Comment: Piston compressors discharge and draw the fluid in pulses, so some RPM-related groaning-whining noise from the dashboard (caused by the lines vibrating due to the pulses), especially with high discharge pressures (i.e. hot ambient temperatures), can be perfectly normal with the compressor in operation. To check if the actual compressor is working look for its clutch hub. If it's stationary it's off. If it's rotating with the pulley, the compressor is working. Do that when you hear that noise.

Whining noises when accelerating


Are self pollinated plants genetically different?

Question: Gametes in pollen grain are formed during meiosis in the anther. And meiosis produces genetically different gametes. When the pollens grains are carried to the stigma to fertilise the egg cell of the different/same flower from the same plant, doesn't it produce genetically different flowers even though it is self pollinating because of the variation in gametes?
Answer: Yes, it does.
In Meiosis there is genetic recombination (by recombinase) in the Meiosis-1. So even though it is self pollination, there is significant genetic variation.
Still for higher degree of variation cross pollination is exhibited.
It should be noted that cross pollination has greater evolutionary significance.
Few plants exhibit self-incompatibility to supress self pollination (in monoecious flowers/plants).


expected number of populated blocks

Question: Let $p$ be a positive integer. For each positive integer $N$, let: $$F: \{1, \ldots , pN\} \rightarrow \{1, \ldots, N\} $$
$$ F(n) = \lceil n/p \rceil$$
Let $r \in [0,1]$. I'm curious about the limit of the expected value $\mathbb E(\#F(A)/N)$ for $A \subseteq \{1, \ldots, pN\}$ a subset of cardinality $\lfloor rpN\rfloor$ selected randomly. I have no background in combinatorics; this question may be below the level of mathoverflow.
Answer: The chance each block is hit is (for large $N$) very close to $1-(1-r)^p$: the distribution of $A$ gets extremely close to a subset where each element of $A$ is included with probability $r$.
In the model where each element is included with probability $r$, one way to obtain a random $A$ is to first decide how many elements it will have - it will be a random variable, $Z$ with a binomial distribution with parameters $Np$ and $r$; secondly, given the value of $Z$, one may obtain $A$ by uniformly choosing one of the subsets of $\{1,\ldots,pN\}$ with $Z$ elements.
The relevance of this is that the distribution of $Z$ is centred at $rpN$ with width roughly $\sqrt{r(1-r)pN}$. That is $Z=rpN+O(\sqrt N)$. Hence the $A$ obtained from the process "include each element with probability $r$" is with very high probability "close" to the process you describe in the question (the $A$'s obtained by the two procedures tend to differ by $O(\sqrt N)$ elements). For the new process I have introduced, you have complete independence: $i$ and $j$ are included independently, so that in the new process, by very elementary probability arguments, each block is hit with probability exactly $1-(1-r)^p$ and the expected number of blocks hit is exactly $(1-(1-r)^p)N$.
In the original process, the number of blocks hit is $(1-(1-r)^p)N+O(\sqrt N)$, so the limit you are asking for is $1-(1-r)^p$.
The same issue occurs in random graph theory. Erdös and Renyí introduced the "Erdös-Renyí model", the random graph on $N$ vertices where exactly $r\binom N2$ edges are included. In practice, it is far easier to study the independent version where each edge is included independently with probability $r$ (because independence makes probability much easier). As $N$ gets large, the properties of the two models are essentially identical.
Comment: There are notable exceptions to the last paragraph.  For example, for constant $r$, Svante Janson proved that the number of hamiltonian cycles is asymptotically normal for the independent-edge model but   asymptotically log-normal for the edge-count model.  Even the means are different.
Comment: I remembered it around the wrong way; it is the edge-count model that gives normality and the independent-edge model that gives log-normality.  The paper is at Combinatorics, Probability and Computing (1994), 3, 97-126.
Comment: Interesting comment. I didn't know that there were interesting properties that are sensitive enough to care about adding or deleting $\sqrt n$ edges.

expected number of populated blocks


What does exactly the "status" in pthread_join represent and how to query it

Question: I'm wondering what exactly the "status" parameter in the pthread_join is for
int pthread_join(pthread_t thread, void **status);

I'm trying to make use of it but I cannot understand what exactly does it represent.
According to the documentation

status
Is the location where the exit status of the joined thread is stored.

This can be set to NULL if the exit
  status is not required.

OK. That sounds nice. How do I use it? I've looked at some examples but I cannot
get the hang of it(and some examples are plain wrong in using it). So I did go to
the source. In the glibc implementation I found the following test for pthread_join:
...
pthread_t mh = (pthread_t) arg;
void *result;
...
if (pthread_join (mh, &result) != 0)
{
  puts ("join failed");
  exit (1);
}

here follows the WTF moment ...

if (result != (void *) 42l)
{
  printf ("result wrong: expected %p, got %p\n", (void *) 42, result);
  exit (1);
}

So the value of the result(which is an address) should be 42?? Is this something global
at the library level, because I could not find anything specific in the test?
EDIT: it seems this question provides info related to what I asked
Answer: The status is set to the value returned by the function that the thread starts executing (or from the value passed to pthread_exit() if the thread exits early).
Example:
 void* thread_func(void* data)
 {
     if (fail())
     {
         pthread_exit((void*)new int(2)); // pointer to int(2) returned to status
     }
     return (void*)new int(1); // pointer to int(1) returned to status;

     // Note: I am not advocating this is a good idea.
     //       Just trying to explain what happens.
 }

 pthread_create(&thread, NULL, thread_func, NULL);

 void*  status;
 pthread_join(thread, &status);
 int*   st = (int*)status;

 // Here status is a pointer to memory returned from thread_func()
 if ((*st) == 1)
 {
      // It worked.
 }
 if ((*st) == 2)
 {
      // It Failed.
 }

Comment: It seems pretty obvious now. Thanks
Answer: Read the doc for pthread_create. The function that runs a thread is defined to return a void*. Whatever it returns, pthread_join delivers to you via the void**'. If the function chooses to return (void *)42, then '42' is what you will get.
Comment: Sounds like you've got a bad doc. Next time read the specification: http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_join.html
Comment: I don't see any pthread_start in my doc. Only pthread_create and it does not have a clear link to the fact that status in pthread_join is the void* returned by my running function.
Comment: Indeed a bad doc ... Thanks for the link!


Stolen iPhone + iMessages on MacBook

Question: My iPhone was stolen and I have filed a claim to get a new one. When I receive it the old one, wherever it is, will be deactivated. I have my messages synched onto my Macbook pro also, I have photos and some saved voicemails there that I don't want to lose, will all of my messages also be deleted or will they be alright?
Answer: When you wipe an iPhone via the Find My.. app or website it will only erase the iPhone itself. Any data you've synched to the cloud will still remain on the cloud.
Regarding photos and saved voicemails, as long as your iCloud backups were going ok on the phone you should be able to restore everything as-is back to the new phone.
Photos would also already be on your MacBook Pro if you had iCloud Photo Library enabled.
If you go to iCloud.com, sign in, then click on the Find iPhone option near the bottom right, you can put the phone into "Lost Mode", which would still allow someone to track the phone down. If you haven't done that yet you may want to enable that feature first. Then if you're sure you won't get the phone back you can click Erase iPhone as you had been planning.

Stolen iPhone + iMessages on MacBook


Black screen after 13.04. How do I get the display back through the command line

Question: This is a common problem with Ubuntu. If I open the command line, something pops up really fast that says the BIOS disabled something. It let me login on the command line. I tried a bunch of commands that I thought would have opened or updated my bios. Nothing worked. Is there a way I can get my display working again through the command line?
Comment: You mean KVM :disabled by bios right??
Comment: It said kmv: disabled by bios
Comment: *The message about **KVM** disabled may have nothing to do with your problem.* Please re-describe your problem. Are getting a black-screen (with just cursor top right), when you want to see the GUI (graphic interface)?
Answer: Have you considered looking into your BIOS settings? There is usually an "Intel VT" or "Virtualization" option that isn't enabled by default. This is being modified.
If you are unable to modify it in the Bios Try the following
First of all, you might want to see if KVM is loaded in the kernel. To do this, run something like this:
lsmod | grep kvm
If you do get any answer from that, you may want to stop kvm from running. To do that, this will help:
modprobe -r kvm
Remember to follow for any other kvm module. In my case, there is also a kvm_intel module, so I also have to run modprobe -r kvm_inteland modprobe -r kvm_amd.
To stop kvm from being enabled at boot time you have to find the file located at /etc/modules and modify it so that KVM doesn't launch at boot time. After you modify your /etc/modules file restart your computer and see if the problem persists.
I would recommend checking out the following:

Kernal modules Blocking using /etc/modprob.d
Keranal module blockin using kernal command Line(Try this if you have difficulty in booting)

If you do not use VMware you can run the following(It breaks VMWare)
sudo apt-get purge kvm

If you want to still continue using quemu with KVM
look for a more recent BIOS on the vendor's web site.
Note:

On some hardware (e-g HP nx6320), you need to power-off/power-on the
machine after enabling virtualization in the BIOS.
Enabling some BIOS features may break VT support on some hardware
(e-g Enabling Intel AMT on a Thinkpad T500 will prevent kvm-intel
from loading with "disabled by bios")
On some Dell hardware, you also need to disable "Trusted Execution",
otherwise VT will not be enabled.


The documents on sharepoint will open in 'Read Only' mode even though i try to open in 'Edit' mode

Question: The documents on share point will open in 'Read Only' mode even though i try to open in 'Edit' mode.
Answer: I have found this solution on stack overflow site, which indeed helped me to resolve a problem where I try to open a document at my workplace with Office 2010 documents on Sharepoint. The original link is also posted at the end of my post.

On the client computer experiencing the issue click on "RUN" then type "RegEdit".
go to this path HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\14.0\Common\Internet
Right click and create new "DWORD" entry and give it a name of "FSSHTTPOff"
Double click the new entry and enter 1 for the value.

Hope this helps !!
Link to the original answer : sharepoint-opens-documents-in-read-only-mode-for-users-with-office-2010


Suspended in chat on trying to make the other user compliant to etiquette

Question: I and another user @infatuated were suspended in chat after I tried to make a case that we should not speak ill of sahabas , but she hesitated and did not agree with me, this caused the only mod to suspend both of us for 7 days and one can easily see the chat log there were no abuses thrown by me at least. And the post of other user were flagged too, yet I ended up being suspended in chat due to the other user. Hence please remove the block.
Comment: The chat log has the most egregious instances of abusive messages removed. Moderators from across the network can review those parts too, but claiming the log doesn't show any abuses on your part is just disingenuous. Even the [still-standing messages](http://chat.stackexchange.com/users/126529/ahlelbayt?tab=recent) show strong evidence of _you_ being argumentative. Also the express reason for the suspensions has nothing to do with the reasons you suggest and there were at least 3 mods monitoring the situation not 1 (and more have reviewed since).
Answer: Are you seriously suggesting this kind of talk is constructive?

you quoted a dictionary defination of slander and ,see how well it defines what some shia users write.

Ali himself was "silent" and patronized the past 3 caliphs, so shias have nothing to stand upon.

You needed your suspension just for that - but for the sake of the site and the benefit it brings to those interested in Islam and the Qur'an, please spend less time complaining about your treatment and more time humbly considering your own actions. Especially whether you are willing to change how you interact with others who wish to be part of the community here.
The point of suspending you is not to punish you. It is to protect the community and give you a chance to cool down and consider your words more carefully before you speak again - that's why I say you "needed" your suspension rather than you "deserved" it.
Comment: I'm personally in two minds about Kaveh's post - I upvoted his answer but not the question. Some of what he says has merit in my view but Caleb's critique is mostly correct. Regardless, your tone and choice of words on this post does your argument no favours - if you want others to take your criticism of the mods seriously you need to present it as something more constructive that a rant.
Comment: @muslim1 I am sorry I misrepresented you when I said you were calling for removal - that's the impression I got from your post but that's my fault for not reading it carefully enough. I stand by my point that this question is not about the behaviour of a moderator *after the suspension* but the correctness *of the suspension itself*. Note the OP's assertion that he was suspended in chat "due to the *other user*".
Comment: Just as Kaveh described [the issues with moderation](http://meta.islam.stackexchange.com/questions/1312/issues-with-moderation) very recently, the problem with moderators on this site is that,
"Their attitude is that of a judge/policeman, not that of a community builder or a respectful educator" and we can see yet another clear example of this attitude right before our eyes!
Comment: And stop labeling my reasonable and legitimate opinions as 'rants'! Calling people names and defaming them never whatsoever helps settling the differences, as it hasn't so far!
Comment: @JackDouglas I am not strongly opinionated here but I would like to add. A mod used the word 'Shut up' for me in chat. He was not suspended. Also I saw the same mod bullying another user from Shia sect. No repercussions for me. The question is are mods always right. Also you see the language here "Annnnd Enjoy your suspension". We are talking about professional here. Is this professional?
Comment: @muslim1 "The question is are mods always right" no - that's a different question and of course mods are not always right. My answer here is a response to the OP's assertion that "...there were no abuses thrown by me..." - imo the suspension was warranted as I say.
Comment: @muslim1 I take your point, but this question is about what happened *before* that comment. You've laid out your stance [here](http://meta.islam.stackexchange.com/a/1224/3208) already and it appears you don't have the community behind you. It seems likely to me that many would echo the first comment: "I agree with some of your points and disagree with some others" - in other words they are not mindlessly defending all moderation but *on balance* are grateful and supportive of the work being done. Why not try and help the moderators improve instead of calling for their removal again?
Comment: Why on Earth do you expect a very new user to show an understanding quality of that of an old high rep user or moderator?! You people seem to be more interested in patronizing people by enforcing site rules than a sympathetic interest in educating them with your experience which must the true spirit of moderation instead of a dominant tendency to conceited and mechanical application of site rules which never help our community improve, as evidences by two years of this failed moderation approach!
Comment: What goes around comes around! Only when moderators treat others respectfully, they can also expect users to interact with them in the same manner. Some moderators have so far badly failed in [leading by example and being gentle and respectful](http://blog.stackoverflow.com/2009/05/a-theory-of-moderation/). In fact if I wanted to treat them like they treated me, I have not yet used any offensive words that they have relentlessly used against me and other users recently! I have shown much restraint in the (so far vein) hope that they may come to their conscience and act responsibly.
Comment: @JackDouglas the suspension language is a little troublesome here "Enjoy your suspension". I think it is terribly rude and unprofessional. You have to account for that as well. Basically if the mod does not have any etiquette what do you expect from a user. Anyways just my point...
Comment: @JackDouglas nope, not calling for their removal. Again I am misunderstood wrong. I will leave it here. Basically we just have to respect each other. I brought this point just to have fair look at the suspension. If one person is childish, the other person is also arrogant and unprofessional. That's all :)
Answer: Honestly, I don't think you even carefully and entirely read my post in the relevant meta discussion where my view was established (judging by the heavy upvotes) that since sects do not agree on the merits of sahaba they are entitled to express their distinct views about them! I had intentionally highlighted the part of the definition which defines 'slander' as "a false statement ..." and then proceeded to explain that some sects really believe (at least based on their own sources and documents) that some of the sahabas were not righteous or were even treacherous. Therefore the definition which characterizes slander as "a false statement against some one" excludes some sects negative view of sahaba.
So my just rationale was quit clear and was welcome by the community. But your failure to carefully read and understand my meta post unfortunately led both of us into an undeserving trouble! However as I explained in this meta post, goldPseudo has evidently over used his moderation powers once again, as there was nothing fundamentally wrong for us to discuss a site policy even if it was done in a serious tone so far as we both of us were genuinely interested in settling a disagreement.


Curve with CorePlot

Question: I want to plot one graph in which curve & line drawing both. I used scatterPlot. How to draw curve with Coreplot.
Thanks in Advance.
Answer: There is currently no option to have curved lines on a Core Plot scatter plot. See this issue for details. Until this is added, you might be able to fake it by adding intermediate points to your plot that approximate the desired curve.
Eric

Curve with CorePlot


How to extract hypervariable region of mitochondrial dna from its fasta file?

Question: Recently I've done some analysis on human mitochondrial DNA and now I want to run the same analysis on only hypervariable regions of mitochondrial DNA to see whether the changes that I have observed are linked to only hypervariable regions. To do that, I'll need to make new fasta files from the mitochondrial DNA entries that I have and I want to know how to extract those. Any leads will be appreciated.
Link to one of the reference fasta files that I have
Comment: Do you have the target coordinates?
Comment: No, I don't. actually, I read about it and found out that hypervariable regions(HVR) 1,2, 3 have target coordinates and I suppose they will differ in each of my files downloaded from GenBank and when I checked, there was no such information in GenBank regarding that. What should I do now? Is there any other way possible? I thought it might be pretty standard thing to extract hypervariable region from Mito DNA.
Comment: Please [edit] your question and add some more information. Show us the sequences you have, and most especially tell us what species you're working with. I imagine you've tried simply googling for "mitochondrial hypervariable regions" or searching PubMed etc, right? Didn't that bring you anything helpful?
Comment: yes, I have done those google searches already and no, it didn't answer my questions. Searching for HVRs coordinates and then extracting them one by one is what I gathered from the searches, but it will make it a very cumbersome task. I've edited my question, please see it.
Answer: You can use Mitomap to get the coordinates of the hypervariable regions in the rCRS mitochondrial sequence (the standard MT sequence in the field). I checked the Genome Loci section of Mitomap and saw that it lists three:
<code>Map Locus   Starting    Ending  Shorthand   Description
MT-HV1      16024       16383   CR:HVS1/HV1 Hypervariable segment 1
                                            [classic:16024-16365]
MT-HV2      57          372     CR:HVS2     Hypervariable segment 2
                                            [classic:73-340 ]
MT-HV3      438         574     CR:HVS3     Hypervariable segment 3
</code>
That gives you the coordinates on the rCRS sequence. What you can do now, is align all of your sequences and the rCRS together and see if you can infer where the hypervariable regions fall in your target sequences. Since, presumably, the rest of the sequence will be more conserved since it isn't hypervariable, you should be able to identify the syntenic blocks and locate the hypervariable regions in your sequences. I would expect to see a very high level of sequence identity in the non-hypervariable regions across all of your sequences (since they're all human mitochondria), so you should be able to find the hypervariable ones as the regions of low sequence similarity which also coincide with the known coordinates of the rCRS.
Comment: That's great, thank you very much. I've one more question, I'm also working with ancient mitochondrial sequences in which there is no such reference sequence, what do you suggest for them?
Comment: Also, which aligner would you recommend for this purpose?
Comment: @AkhilVerma sorry, I don't know anything about ancient sequences. If they're hominid, I would still try the same approach, but I've never worked with mitochondria so I don't know what level of conservation you can expect. Still worth a try, though. As for the aligner, any should do. These will all be very similar sequences, in principle, so not a hard problem. Since they're relatively long, I would personally go for `mafft`, but I doubt it would make much difference.
Comment: Again, Thank you so much for your help.


Show all the chatter files with icons

Question: i am creating a VF page on which i want to show all the files uploaded in chatter with its name,created by,created date and file icon . All the things are done except the icon. can anyone tell me how can i show the icon in front of files.(if a file is pdf file, pdf icon should appear and same for all other file types)
Answer: <code><apex:repeat  value="{!lstattachments}"  var="a">
  <apex:image url="{!URLFOR($Resource.TestZip, 'images/pdficon.jpg')}" width="50"   height="50" rendered="{!CONTAINS(a.ContentType,"pdf")}"/>
  <apex:image url="{!URLFOR($Resource.TestZip, 'images/excelicon.jpg')}" width="50"  height="50" rendered="{!CONTAINS(a.ContentType,"excel")}"/>
</apex:repeat>
</code>
One way to achive this is store icons in static resource and based on content type use this and render the images.
Note you can also use dynamic visualforce  components to achieve this .Logic will be based on content type you can generate apex image tag from the backend .
Note how i have used contains in the formula to detect whether the file is PDF or excel.
Update:
If the solution is for the content document then from the ContentDocument Object there is a field called parentId .From the ParentId field one has to traverse up to the Contant version and take its file type or Content URL to detect the type of file
Comment: hey i am getting all the files from contentDocument by the query [select title,createdDate,createdBy.firstname from contentdocument]. so i think contentDocument dont have any method contentType. I need all the files that were attached with feeds,comments etc in chatter. If you have any other method also, please tell me.
Comment: You will have to grab the parent Id and then look for file type to determine file type .I have updated my answer.Thanks
Comment: I guess you need to use "LatestPublishedVersionId" field on Content to go to "ContentVersion" object and then use "FieldType" to get the type of a file

Show all the chatter files with icons


Is "Om Jaya Jagadisha Hare" written for any particular deity?

Question: SOURCE

Om Jai Jagdish Hare (Hindi: ॐ जय जगदीश हरे) is a Hindu religious song. Though it is not written for any particular deity, it is mostly sung in Vishnu temples. Although the religious hymn is a Hindi-language composition, it is widely sung by Hindus. The prayer is sung by the entire congregation at the time of Aarti, a form of Hindu worship.
Comment: Pandit Shardha Ram Phillauri has composed this Aarti to raise the interest of people in bhAgwat kathA.
Comment: I think it is a prayer, to the God(any and all)
Comment: The bigger issue is with Om Jai Shiv Omkara...by this it looks like dedicated to Shiva but when we go on, it compares Trimurti gods...
Comment: @YDS - yes OM Siva Omkara is for the Trimurti.  Also both Hari and Hara ae names of Siva also:(Shiva Ashtottara Sata Namavali)  ōṃ harayē namaḥ
ōṃ pūṣadantabhidē namaḥ
ōṃ avyagrāya namaḥ
ōṃ dakṣādhvaraharāya namaḥ
ōṃ harāya namaḥ (100)
Answer:

Does the "Om Jaya Jagadish Hare" aartī, invokes any particular deity?

Short Answer: Depending on the meaning eschewed from the aartī lyrics, No & Yes.

The Origin of the aartī

The famous aartī, "Jaya Jagadish Hare", by Pandit Shardha Ram Phillauri, is originally said to have been composed as a Universal aartī by the author.
The popular imagination phenomenon might have made it limited to Lord Vishnu.
The aartī, as it's sung today might have made its first raw cinematic appearance in a song from the 1952 movie, Anand Math. In here, the Govinda damodar Stotram of Sri BilvaMangala Thakura is adapted with the 'Jai Jagdish Hare' refrain.
The rendition of the written aartī reaches its zenith in a later 1970 movie, Purab Aur Paschim. The protrayed song in the movie, playing background of the aartī, beautifully portrays the devotion towards the Radha-Krishna, and the prayer symbolizes the continuity of the Indian tradition before and after India's independence. This is probably the point which catapulted the song into the popular mass imagination, with it's characteristic background music and tone becoming a favorite aartī staple across India (or the hindi speaking belt atleast). This phenomenon is something very similar on the lines of the appearance of Santoshi Mata as a mainstream deity due to a popular bollywood film by the same name.
The aartī's various variations employing same background tune and structure, are used for specific deities such as in: Om Jai Shiv omkara, Om Jai Lakshmi mata, Om Jai Ambe gauri, Om Jai Adya Shakti, Om Jai Saraswati Mata, Om Jai Gange Mata, et al..

For which deity the aartī is written ?

View 1: It's not written for Vishnu, but the general Almighty.

Even if one looks at the wording lyrics of the aartī, it specifically doesn't point to a definitive particular deity.
An example -

...तुम पूरण परमात्मा, तुम अन्तर्यामी,
पारब्रह्म परमेश्वर, तुम सब के स्वामी ॥.....
...Tuma pūraṇa paramātmā, tuma antaryāmī,
PāraBrahma parameśvara, tuma sabkē  svāmī ॥...

Meaning:

Thou art the ancient great soul. Thou art the omnipotent master Lord,
Thou art the Lord of everything and
everyone Oh Lord of the Universe

All the known deities within the Hindu pantheon have been referred to as by the above epithets in all major works dedicated to them.
And in general, thus, can be used as an aartī for all the manifestation of the Brahman. Hence, it's actually indeed a Universal aartī.

View 2: It's indeed written for Vishnu.

For example, lets see two lines in the aartī

तुम करुणा के सागर, तुम पालनकर्ता,...
Tuma karuṇā ke sāgara, tuma PālanaKartā...

Meaning:

Thou art an ocean of mercy Lord, thou art the protector

Further,

दीन-बन्धु दुःख-हर्ता, ठाकुर तुम मेरे,
dīna-bandhu duḥkha-hartā, ṭhākura tuma mere

Meaning:

Friend of the helpless and feeble Lord, you are my overlord or thakur
ji (Shri Krishna)

Generally, it's a common paurāṇika tradtion (across all sampradāyas) to specifically refer Lord Vishnu as the PālanaKartā of the Universe. Further, the epithet ṭhākura ji, is quite a prevalent name for Vishnu in his Shri Krishna avatara.
Moreover, the word "Hare" (हरे) can be interpreted as either the vocative form ( सम्बोधन विभक्ति : sambodhana vibhakti ) of Hari, which is another name of Vishnu, meaning "he who removes illusion". Another interpretation is as the vocative of Harā, becoming Hare, which is a name of Rādhā. In any case the case is made for the aartī to be Vishnu centric, in this case.
Thus, by the above explained logic, it maybe argued that indeed, the aartī is in reverence to Vishnu only.
Conclusion:
Thus, depending on how the lyrics are analysed, one maybe to able to reach both the conclusion that

Yes, indeed the aartī is for Vishnu

and/or

No, the aartī is for the the general Almighty, Brahman and hence can be used for any saguṇa or nirguṇa form of the Supreme.
Comment: May have not read properly but you can also add: Jagadish **Hare**. Hare = sambodhan form of Hari which is Bhagwan Vishnu's name
Comment: @Vivikta When you want to address Hari, the word becomes Hare! Which is, "Oh Hari!"
Comment: Sanskrit has no proper nouns.  It is a fairly long poem and strictly stays away from specifying the deity being prayed to. It is praying to Ishwara @vivikta
Comment: @Surya, thanks!
Comment: @SK True in a broad perspective, it doesn't refer to a particular form of the Lord.
Comment: Those who state that this song addresses Parabrahman are overlooking the fact that the song addresses a male divinity, whereas Brahman is genderless.
Answer: Excellent answer from Vivikta - just adding two small items of evidence that this is for Ishwara or Trimurti and not any particular deity:
the deity is called parameshwar in addition to Hari - Parameshwar is usually Siva (not always, though).  And Hari is also a name of Siva:
https://vignanam.org/english/shiva-ashtottara-sata-namavali.html
विषय-विकार मिटाओ, पाप हरो देवा
(स्वामी, पाप हरो देवा)
It uses "har" as a verb - "destroy my sins" - Hara (noun) is Siva.
Magnificent prayer - an essence of Hinduism.


I2C VS SPI comunication

Question: I have studied the I2C and SPI communication protocols, but one thing has been confusing for me. In the case of the SPI we have shift registers at both ends and with the help of the SPI rising clock edge the data shifts from the master to the slave. In the case of I2C, I have seen that the values are only transferred if the clock is high. The first question is that if the first value is shifted and we still have a high voltage, then the second bit can also be shifted in the same clock cycle. Secondly, in i2C, it means we do not have a clock on the edges and hence shift registers are not activated on the edges therefore the same problem can occur on the receiver end. The receiver buffer continues to take the two or many values if the clock is high?? Kindly help me clarify this confusion.
Answer: In I2C, the "high" states are reached through a pull-up resistor, these aren't actively driven. As such, the rising edges are fairly round, and the exact timing of the edge detector is not entirely well-defined.
So, each bit is transferred at a rising edge of the clock, and the clock needs to be pulled low between bits.
If the data line changes while the clock is high, that is either a start or a stop condition.
Answer: When receiving, data is typically clocked in on a clock edge. This is because its convenient and the specs say the data is stable at that point. In controllers with SPI peripheral you can usually adjust when data is clocked in using some control register bit called CPOL and CPHA.
Bellow an excerpt from the datasheet of a nordic semiconductor IC:

You can see that the data is stable for some short time after a clock change.
In I2C it is the same. Here a snippet of the I2C spec from NXP:

You can see that the data USDA must be stable when the clock line USCL changes. You can pick any clock edge to trigger the data shift. Or (in this case) even randomly choose some point between the clock flanks to sample the data. Typically you will want to sample on the rising edge of the clock because some implementations will not honor the falling timings. Have a look at the timing diagram bellow:

The key parameters are Data set up time (tSU;DAT) and Data valid time (tVD;DAT)
Sources:

NXP I2C Specification
Nordic Semi NRF52811 SPI peripheral Documentation
Comment: Maximilian - Hi, Please remember the [site rule](/help/referencing) which requires that when a post includes content (e.g. text, image, photo etc.) copied or adapted from elsewhere, that content must be correctly referenced by the post's author. As a minimum, the source webpage or PDF etc. should be linked (see that rule regarding references for books / articles etc.). I saw that you mentioned the sources in the (usually invisible) HTML alt text, however actual *links* to the sources are required. Please can you [edit] your post and add those required links? Thanks.
Answer: With I2C, each clock pulse sends one bit just like with SPI. No difference there.
The data wire is updated by transmitter while clock is low and kept stable while clock is high.
An I2C device loads the data bit in from bus on the rising edge and on falling edge an I2C device sets the data bit to bus.

I2C VS SPI comunication


A rule of thumb when assuming ideal gas

Question: When to assume ideal gas law without incurring too intolerable error. I have the idea that it must be at high temperature and low pressure. Is there any specific values, and are there any other things to look for?
Comment: Is your idea of "too intolerable" an error of 10% or 0.1%? Air at room temperature is near enough an ideal gas for many purposes, so "high temperature and low pressure" are rather subjective terms.
Comment: One of my professors said the ideal gas law is generally good enough for molar volumes over 20 L/mol.
Answer: One way to describe how gasses deviate from ideal gasses is by the compressibility factor. Compressibility is defined as:
$$Z=\frac{PV}{nRT}$$
For an ideal gas, Z = 1, which leads to the familiar ideal gas law:
$$PV=nRT$$
You can look of various compressibility factors for air at different temperatures and pressures. When the compressibility deviates from 1.0, air is not behaving like an ideal gas. You can find a table of values here:
http://www.enggcyclopedia.com/2011/09/air-compressibility-factor-table/
The difficulty may be in determining how much deviation of compressibility equates to error. It's not possible to answer that without knowing more about your application and your definition of intolerable error.

A rule of thumb when assuming ideal gas


Why are switching losses proportional to switching frequency?

Question: Actually in soft switching converters an increase in frequency increases switching losses?
Can anyone explain why?
Comment: Each switching event has an amount of energy loss \$Q_{LOSS}\$ , with increasing the frequency there are more events.
Comment: can u explain some elaborate?
Comment: @raj: Can you explain what you didn't understand when you looked it up?
Comment: consider a mosfet in that for turn on we have to control vgs voltage  for switching on and off,but 5V input is equal to 5v output.
Comment: OK, I'm considering it. Now what? This is now sounding like a homework question with no attempt at research.
Answer: The key to your question is 'soft switching'. So every 'edge' in the output there is a period of time when the output device is partially on- instantaneous power loss will, of course, be the current multiplied by the voltage across the device if we ignore any parasitic reactances.
You can read more about the actual calculation of MOSFET losses here, but the key thing is that the loss is a little package of energy that has to be dissipated that occurs once per edge. The more edges in a second (higher frequency), the more total energy per second (which is power).
From the above AN:
Answer: The simple answer is that a certain amount of energy (E) is dissipated each time a transistor switches.  Each time you switch, you dissipate that same amount of energy.  If you siwtch at some rate (F) Hz, then you will dissipate that energy F times per second.  Therefore the dissipated wattage (W) due to switching losses is ....

W = F * E

The energy E consists of many parts.

1)  Capacitive losses due to Cds, Cdg, Cgd.

E1 = 1/2 Cds * Vds^2 + 1/2 Cdg * Vdg^2 + 1/2 Cgd * Vgd^2

2)  Increased conduction losses during the turn on/off times.

That dissipated energy is proportional to the load current, the supply voltage, and the switching time.

E2 is proportional to V_ds * I_load * T_off

3)  Body diode conduction losses during "dead-time" in half bridge configurations.

E3 is proportional to the dead-time and I_load
Answer: Every time a switching circuit switches, even when it is unloaded, the stray capacitance at the output node has to be charged or discharged, in order for the output node to change voltage level. Since the switching element is not ideal, i.e. it has some resistance, the current needed to charge/discharge must flow through that element and this causes losses.
Since losses happen only when the switch changes states (assuming zero losses when the switch is completely on or off), more switch events per second means more losses per second, i.e. an increase of power loss.
I assumed zero loss during static operation (no switching), because if the switching element is good enough it has either zero current flowing through it or zero voltage across it when it is not switching, so zero static power loss (ideally). The case is different when the switch is in the process of switching: in this case both current and voltage are non-zero, hence their product is the power lost in the switch.
Assume, just for example, that an unloaded switch must charge a stray capacitance of 100pF at 5V. This means that at the end of the switching action, after \$\Delta t\$ seconds, the capacitance has been charged with a charge \$Q=C\cdot V=100pF \cdot 5V = 500pC\$. Let's assume, for simplicity, that the switch has an \$R=100m\Omega\$; resistance. Since on average \$Q=I\cdot \Delta t\$, then the power loss in the switch is, on average (I say on average because here Q and I are related by an integral in the general case):
$$
P=R\cdot I^2=R\cdot\left( \frac{Q}{\Delta t} \right)^2 = R \cdot \frac{Q^2}{(\Delta t) ^2}
$$
From this last equation you can see that the switching loss average power is inversely proportional to the square of the switching time, i.e. the losses are indeed proportional to the square of the switching frequency.
(Choose different values of \$\Delta t\$ and plug-in the values if you need actual numbers to convince yourself).
Answer: Dynamic losses are the main losses in logic unless they are "asleep" with just static leakage current. The same occurs in switching converters except they also have real load currents in the power transfer.
Each switch has an ESR or RdsOn which dissipates power from each current pulse driving the input capacitance of the CMOS load only during the transition Ic~Cdv/dt
Therefore the power dissipation increases with each pulse and is proportional to frequency depending on number of average gates making this transition.
Smaller lithographic reduces the load capacitance and power while a reduction in RdsOn With low voltage CMOS from ~50 to ~25 Ohms also reduces the dynamic losses.
The soft switching effect in converters is to reduce the dv/dt peak currents.
WHen load capacitance is significant raising the switching frequency results in more dynamic losses, just as in logic to the point where it is less efficient.  While raising the frequency allows smaller choke inductance to be used ,which is beneficial at higher load currents.
It should also be noted that in a common switch family with different RdsOn values,  Ciss*RdsOn product is a constant with the same topology and FET design and comparing vendors, voltage limits and this product may lead to better performance with lower values. We call this a Figure of Merit (FoM) in making MOSFET switch selection among other choices.


How does Jesque work with Huge Payload?

Question: I read about Jesque at https://github.com/gresrun and I would like to understand how does it perform under huge payload. Is the only way of queuing a job to create an instance of Job class and then using a Thread to start off the worker or are there any other approaches? I am a little skeptical about using java.lang.Thread objects like it is done in the example on this link for batch jobs where data payload is huge.
Answer: Actually spawing threads without control is never a good idea.
I would suggest the approach to put your workers in a BlockingQueue and then spawn a very limited number of threads (as much as your CPUs, in order to reduce contention) to start off those workers. Once the work has finished, the thread pick up a new worker and start the process again. Once there are no worker in the queue, the threads just hangs on the queue, waiting for new workers.
You can have a look at the Thread Pool Pattern
Comment: Any example of that implementation !?

How does Jesque work with Huge Payload?


How to create shared folder between my on-premise Windows Server and Azure VM Server?

Question: I'm trying to migrate my on-premise SQL Server to Azure VM using 'Microsoft Data Migration Assistant'. But it is asking for shared folder to be accessed by both source and target. How to achieve this?
Answer: If you are new to Azure I would suggest ticking the "Copy the database backups to a different location that the target server can read and restore from" and manually copy the backup files to the target.
I tried setting up an SMB share in Azure to use as the backup location as per this article. The issue I ran into was that Azure does not allow anonymous access to files share (the request for the feature has been under review for more than 2 years)and you also can't enter the credentials in the Microsoft Data Migration Assistant, so this route doesn't seem like a solution at the moment.
The only other way I can think of is creating a permanent link with either ExpressRoute or VPN and then creating a share that can be accessed by both subnets.
Answer: You would need to create a site to site VPN beteen the on-prem site and the Azure site. This would allow the Azure VMs to see all the same resources, then you can just migrate as expected.
Frankly I wouldn't use the Azure Migration Utility unless you're databases are pretty small as the outage may be longer than allowed for.  Setting up log shipping between the on-prem server and the Azure VM is probably the best bet. We do this for client's all the time and it works great.


What commands show pending/scheduled tasks in Terminal?

Question: What commands can I use in Terminal to see pending or scheduled tasks for today or tomorrow.
For example how can I detect pending system shutdown?
Answer: There is util called cron. Usually cron handle task scheduling in Linux. But there is also few another ways to do it.
In case of cron, you can just run crontab -l to see all task scheduled by current user.
If you want to check task for another user use -u $username key
TO check root user tasks: sudo crontab -u root -l
To understand crontab format please read wiki
If you want to detect exactly system shutdown
The one of possible solutions is to wrap shutdown command in a script.
Another solution is to write a trap detecting SIGTERM signal, but this solution do not give you time when system will start halting.  Read about trap here
Also there is another one tricky solution:
If you run sudo shutdown -r 20:00, you spawn a process that will start shutdown at 20:00.
You can find this process using ps
$ ps -ef | grep shutdown
root     32222 32032  0 15:55 pts/8    00:00:00 sudo shutdown -r 20:00
root     32223 32222  0 15:55 pts/8    00:00:00 shutdown -r 20:00
c0rp     32382 32233  0 15:55 pts/10   00:00:00 grep --color=auto shutdown

And you can see a time here. If you kill this process, shutdown will be canceled
Comment: thanks for the link to wiki documentation its helpful but for example I just run `sudo shutdown -r 20:00` for example and when I run any of your suggested commands it says `no crontab for root` so my question is how can I list command like that in case I forgot about that it was supposed to restart at 20:00 or any other hour.
Comment: Thank you! `ps` works just great :-)


Can we see built in class and interfaces of Apex in an IDE?

Question: Is there any way to see all built in classes and interfaces as we can see in NetBeans for Java?
Comment: By "see" do you mean an equivalent of Javadoc?
Comment: As we can see built in classes on netBeans by (ctrl + clicking)  on built in className in java. Means what is written in standard built in classes and in built in interfaces ....
Comment: I've modified your question to be more specific. Please re-edit if I've got it wrong.
Comment: No issue,Thanks, now its better.... for understanding...
so is there any way...?
Answer: There are several code editors for Apex typically built into an IDE and what you are looking for is a feature of those. The Apex can be parsed locally to offer code completions, but it is the Salesforce server that has a full (and up to date) model of the Apex source code, the platform provided APIs, the SObjects and other component definitions. So using a server API such as the relatively new Tooling API's "code completions" is a good way for the editor to go.
The code editor in the Developer Console supports this feature.
Of the available IDE's that support this feature, MavensMate is frequently recommended. Support for this feature is work in progress in the Force.com IDE provided by Salesforce. There are other editors/IDEs too that others may comment on.
Here is an example of the code completion available in the Developer Console:
Comment: Thanks for your response @Keith C, i used force.com iDE in eclipse. But in this ide where i can view schedulable interface and other things, for example when we use list Lstr;   Lstr.size() returns size of collection and size method is defined somewhere in library so where i can see standard built in list collection size() method. are u getting my question....
Comment: @AmitChaudhary The Force.com IDE is behind other editors/IDEs at the moment (and what you get depends on what version you are using). I've added a screen shot from the Developer Console that shows the list size method and the same code completion is available in MavensMate.
Comment: This shows size() method return type and parameter, i want to see defination of this method..
Comment: @AmitChaudhary In Java, Eclipse code completion also links you into the Javadoc (which is nice but not critical), but there isn't a direct equivalent to Javadoc for Apex. The Apex code completion provides the signature - the method name and parameter names and types - and that most of the time gives you all the information you need - `size` and `sort` are pretty self documenting. If you need more detail you'll have to Google for it.


Append text at the end of a specific line

Question: I have a file with multiple lines. What I am trying to accomplish is add a string at the end of a commando.
I have a script that installs a tool automatically. Now some things have changes in the sources.
I need to add contrib non-free at the end of this line:
deb http://ftp.us.debian.org/debian/ wheezy main

It should look at this:
deb http://ftp.us.debian.org/debian/ wheezy main contrib non-free

How can I accomplish this?
Answer: Since you're using Linux, you'll have the GNU version of sed (which has an -i option for 'in-place' editing of files):
sed -i '/deb http:\/\/ftp.us.debian.org\/debian\/wheezy main/s/$/ contrib non-free/' file.sh

In the sed command, the stuff between the first two // tells sed to search for a line containing that -- so sed '/foo/' would search for lines containing 'foo'. Because your line contains forward-slashes, those need to be escaped. the s/$/ contrib non-free tells sed to replace the end of the line (represented by the dollar sign) with ' contrib non-free'. The general form is s/replace this/with this/. Taken together, this searches for the lines you want and then tacks your text onto the end.
If you just want to alter the end of every line in the file:
sed -i 's/$/ contrib non-free/'

Using the standard text editor, ed, is very slightly more portable, but in general you'll find yourself using sed for these tasks more often (or, preferably, a decent text editor such as vim).
printf '%s\n' 'g/deb http:\/\/ftp.us.debian.org\/debian\/wheezy main/s/$/ contrib non-free/' w q | ed file.sh


How to allow a user to create databases only with a certain prefix?

Question: We're having a multi-user Linux server. I'd like to give each user the ability to create and manage databases at will, but to keep things sane, force them that each database name they create must start with their user name as prefix. For example, user joe would be only allowed to create databases like joe_app1 and joe_app2 but not app1 or jack_app1. Is this possible in PostgreSQL? Or is there another way how to separate name-spaces for user-created databases?
Comment: Why not give every user only one database and let them use schemas to separate the name spaces?
Comment: @a_horse_with_no_name Yes, that would be an option, but since our users work on different projects and they need to backup/restore their respective databases separately, it could make things a bit complicated for them.
Comment: You can't really do this inside PostgreSQL.  However, I imagine you could set up a script (with the appropriate ownership and permissions) which can create new DBs, checking the prefix first.  It should then set the ownership of the DB as well.
Answer: PostgreSQL does not allow you to do this inside PostgreSQL.  You cannot create a database inside a transaction so procedural language functions cannot create databases or drop databases.  I hope some day this is corrected, but it is the one piece of DDL that does not work inside a transaction.
What this means is you have to do it from outside the database with a separate application that runs whatever checks you want to run.  Some key things to keep in mind are:

You probably want to have a dedicated user (role with login, noinherit) for the database creation process.
You do not want to give the permission to create dbs to the general users.
The script should create the database and then ALTER DATABASE ... OWNER TO ... in order to ensure that the user has full permissions to it.
Comment: +1 as this is the answer I was lazy to write :)  On the other hand, I see the `CREATE/DROP DATABASE` exception a quite logical choice.  Encasing it in a transaction could raise quite a few interesting effects.
Comment: I am not sure how the side effects would be much more unmanageable than with `drop table` or `drop user` both of which can be rolled back.  I don't know why one couldn't wait until commit to do essentially an rm -rf and block connections in the mean time.


"Find next" in Vim

Question: To search forward in Vim for cake, I'd type /cake, but the cursor jumps to the first match when I press return. Is there a Vim command analogous to "find next"?
Comment: Get used to using `:help`. `:help /` shows help about searching, and the answer to your question appears just a little bit down the page.
Answer: It is n for next and N for previous.
And if you use reverse search with ? (for example, ?cake) instead of /, it is the other way round.
If it is installed on your system, you should try to run vimtutor command from your terminal, which will start a tutorial of the basic Vim commands.
Rob Wells advice about * and # is also very pertinent.
Comment: @GPcyborg : `n` like most vim operator can be prefixed with a number to repeat the command. If you type `10n` it will move to 10th result (after the initial one). It also works for all motion operator like `3j` to go down 3 lines.
Comment: Press Enter to exit search typing before you press n or N.
Comment: @XavierT. any idea, how i can jump a fixed number of results in search. I mean for example jump to the 10th matching line
Answer: The most useful shortcut in Vim, IMHO, is the * key.
Put the cursor on a word and hit the * key and you will jump to the next instance of that word.
The # key does the same, but it jumps to the previous instance of the word.
It is truly a time saver.
Comment: And in case it wasn't obvious, `n` and `N` take you forward and backward through the `*` matches once you've pressed `*`.  (Or you can just keep pressing `*` to go forward or `#` to go backward, but using those shifted-keys is generally sub-optimal.)
Comment: @Herbert, actually n and N don't take you "forward" and "backward" resp. As @Xavier noted above, n is **next** and N is **previous**. Control of forwards and backwards searching is done by stating the search with either the '/' key and the '?' key or with the '*' key and the '#' key.
Comment: I don't think * is that useful... most of the time I'm searching for a fragment of a word (for example, a part of a function name). I don't want to `/Func`, have it take me to `SomeFunc` and then press '*' to go to the next instance of `SomeFunc` when the next instance of `Func` is in `SomeOtherFunc`.
Comment: Even worse, with C++ I find it doesn't go from method invocation to method implementation because `/\` does not match `"className::foo()"`
Answer: When I was beginning I needed to watch a demo.
How to search in Vim

type /
type search term e.g. "var"
press enter
for next instance press n (for previous N)
Comment: Typing `*` is incorrect. I.e. a file `aa aaa`. Search `/aa`, you have to matches. On the first match pressing `*` changes the search term.
Comment: n isn't 'next' but "repeat last search". So entering ?var will start searching upwards from your current position for 'var'. And 'N' is actually "repeat last search in opposite direction" so for this example that would search downwards for 'var' from current position.
Answer: You may be looking for the n key.
Answer: Typing n will go to the next match.
Answer: As discussed, there are several ways to search:
/pattern
?pattern
* (and g*, which I sometimes use in macros)
# (and g#)

plus, navigating prev/next with N and n.
You can also edit/recall your search history by pulling up the search prompt with / and then cycle with C-p/C-n. Even more useful is q/, which takes you to a window where you can navigate the search history.
Also for consideration is the all-important 'hlsearch' (type :hls to enable). This makes it much easier to find multiple instances of your pattern. You might even want make your matches extra bright with something like:
hi Search ctermfg=yellow ctermbg=red guifg=...

But then you might go crazy with constant yellow matches all over your screen. So you'll often find yourself using :noh. This is so common that a mapping is in order:
nmap <leader>z :noh<CR>

I easily remember this one as z since I used to constantly type /zz<CR> (which is a fast-to-type uncommon occurrence) to clear my highlighting. But the :noh mapping is way better.
Comment: If you're feeling inspired by `q/`, you should also play with `q:`. Both are really handy! (Not really related to this question, though.)
Comment: Thanks, Micah.  I knew about 'q:' already, although I don't use it that much.   But 'q/' was entirely missed in my vim education, and I think will get a lot of use.
Answer: If you press Ctrl + Enter after you press something like "/wordforsearch", then you can find the word "wordforsearch" in the current line. Then press n for the next match; press N for previous match.
Comment: "When we execute a search, Vim scans forward from the current cursor position,stopping on the first match that it finds. " As Practical Vim points out.

"Find next" in Vim


Good list of books for Year 13 about to apply for a BSc in Mathematics

Question: I'm an international student about to go into my last year of high school, and I haven't found many mathematical books that interest me. I'm looking for a mixture of interesting, but respected books, as it's also a way to show my passion for Mathematics in my personal statement. So far I've read Schaum's Theory & Problems with Modern Algebra, and I've started reading the Physics version. I've written papers in Machine Learning which is another field of Mathematics that I enjoy, however, I think something more fundamental might be more insightful. If you had any recommendations for a concise (Not a 378 page proof of 1+1=2) read, or a like STPMD a book that focuses' on problems as well. Thank you.
Answer: When I was in high school, the book "Nuts and bolts of proofs" helped me gain insight into what proof writing would look like. It has tons of examples, and it walks you through the common proof techniques and basic logic, like proof by contradiction and proof by induction. It's also pretty short. Mathematics is more than calculation, and I think this book is a good introduction to what Math has to offer.
Comment: That seems interesting, but I've already covered proof via induction, contradiction as well as basic group and ring theory in class so it might be a bit repetitive. Perhaps you know something more abstract?
Answer: In a comment to Ninja Hatori's answer, you say that the books suggested by Ninja Hatori are third-year books. That's true, but in the U.S. (which I understand from your question is where you'll be attending university) most undergraduates don't have serious contact with proofs until their third year. Well-prepared students can read at least some of these books out of high school. Since you've already read a book on abstract algebra, albeit one that is not very advanced, you have enough preparation to at least try these kinds of introductory algebra or analysis books, or slightly easier ones.
You also say that you'd prefer to avoid reading something that you'll learn later in university anyway - but the basic courses in algebra and analysis are usually where people form the habits of thought that allow them to learn other areas of mathematics (in addition to being direct prerequisites for many of them), so you certainly can't avoid these things indefinitely if you want to progress in math.
You can find a large number of suggestions in the syllabus for the undergraduate program in math at Cambridge. You could look at some of the books recommended for first or second-year courses (Parts IA and IB). https://www.maths.cam.ac.uk/undergrad/course/schedules.pdf
Some of the recommended books, especially those published in Britain,  tend to be quite concise because Cambridge students have a large number of small courses.
That being said, I can recommend a few books that are outside the central core of the undergraduate math curriculum and would be accessible to you now, as they don't have any advanced prerequisites.

Stark, Introduction to Number Theory.
Hopcroft, Ullman, Introduction to Automata Theory, Languages, and Computation.
Feller, An Introduction to Probability Theory and Its Applications, Vol. 1.

The first edition of the second book is supposed to be significantly better than later ones (which I haven't seen).
Comment: Actually, I'm applying to Cambridge and I've already ordered A Mathematician's Apology by Hardy, New Applications of Mathematics by C. Bondi, and The New Quantum Universe by T. Hey & P. Walters from the Reading List for undergraduates. But just going back to what I was saying I'm not against reading algebra and analysis, I just do not want to make sure it's written well and not basically a textbook for linear algebra and mathematical analysis. Introduction to Number Theory and the last one seems interesting too.
Comment: Yes, as I recall, Cambridge recommends a bunch of non-math books about math, but no math books, to incoming undergraduates, for reasons only they know. I would ignore the advice and read actual math. If you absolutely want to avoid duplication, you could read a textbook that you know is not the primary textbook for a given course. Also, you will need to decide what your level of interest in physics is so you can make appropriate decisions about what to pursue in university. Schaum's Outlines risk being rather dull. Kleppner/Kolenkow and Purcell are more likely to pique your interest.
Comment: My interests in Physics are purely theoretical, and there are many modules in the Mathematics course at Cambridge, or in any mathematics BSc in the UK, that have theoretical physics as it overlaps heavily with applied mathematics. I also think books such as "A Mathematician's Apology" are interesting in that universities want you to not only be able to read and understand your subject, but want to be there, and hopefully become a researcher which is, from what I have understood, the principle of the book.
Comment: I'm not against reading books on the history of math, biographies of mathematicians, and so on. It's just odd that Cambridge recommends against students reading ahead.
Answer: I was in your position some years ago so I can pass on what I found great reading. Both are very well known classics but as no one mentioned them..

Enjoyment of mathematics (Rademacher and Toplitz). Amazing book that includes many vignettes on different parts of mathematics. Totally recommend it. I learnt a lot of mathematics from this little book.
Mathematics:it's content,method and meaning (The Russian giants of math i.e Gelfan'd, Kolmogorov, Aleksandrov, etc) This is one of the best books to read in my opinion. I read the first volume while in high school and it was such an amazing experience. It's a compendium (almost encyclopedic) of articles written by experts about the different branches of mathematics. I'm still reading it to this day. I think the notation is a little bit dated but not terribly so.

I think both of these books will give you a nice coverage of mathematical ideas to play with and discover. After that you can very well jump into what interested you the most, for that search here for recommended bibliography or ask a question if none has. Best of luck!
Comment: Both these books seem really interesting, I've already ordered them. Thank you.


Multiple regression and multivariate - unsure which I should use

Question: I have 6 outcome variables (each with data at multiple time points) and four predictor variables.  I am aware I can use separate multiple regression analysis for each outcome variable for each time point.
I would like to understand what benefit multivariate analysis would bring?  (I am struggling because of the mixed usage of multivariate when it should be multivariable!) Does multivariate analysis look at the relation between the outcome variables as well?  I have a small sample size so unsure if multivariate analysis would be appropriate.
Answer: If the statistical model you choose provides sufficient accuracy, a multivariate model provides more insight and statistical power.  An example of insight is obtaining estimates of correlations between outcomes.  For Bayesian modeling you can compute posterior probabilities of compound statements involving multiple outcome tendencies.  Power comes from combining information.  For accuracy consider Bayesian models.


How much do bikes improve over the years?

Question: I have a Giant Escape 3 hybrid from 2013.  I am curious if I were to buy a Giant Escape 3 2021 model, would it be equivalent to a 2013 Giant Escape 1 or even better?  How much do bikes improve over the years?  Giant tiering for hybrid bikes is Escape 1 > Escape 2 > Escape 3.
Comment: It depends on how much the CEO wants to siphon off.
Comment: There's a strong argument saying the newer one is acutally worse -- though there's a disc brake option now!
Comment: There are two questions here. 1. Is the 2013 Giant Escape better, worse or the same as a 2021 Giant Escape? 2. How much do bikes improve over the years? Michael has answered question 1 very well below. The answer to question 2 is - it depends. If improvement is measured by the quality of the parts (as opposed to performance, utility, to name two) - there are many variable economic factors that come into play to determine what parts will end up on a bicycle at a given price point. When part prices go up newer bikes tend to get cheaper parts to hold it at a price point.
Comment: Replacing a 2013 bike by its 2021 equivalent wouldn't make sense for me, especially for entry level bikes. If your frame is in a good state, for the price of the 2021, you can upgrade the transmission, the wheels (to mid-range, like Deore or maybe GRX400/APEX with appropriate shifters) and small fixtures. Like this you would probably have something better than the 2013 Escape 1, and better on some aspects than a 2021 Escape 1. You wouldn't have disk brakes (if you live in dry area, v-brakes are fine) and internal cable routing (which is often done wrong on entry level bikes).
Answer: I don't think there is much room for improvement in entry level bikes. Their main priority is to be as cheap as possible. Adding features would increase price. They have been pretty much perfected on a cost vs. features/weight basis. It's generally a cheap aluminium frame, 7 or 8 speed shifting (doesn't require tight tolerances to work reliable-ish) and rim brakes.
Mid-level and obviously high-end bikes have seen a lot more new features and improvements. Most new features will be expensive for the manufacturer (because they require Research&Development, new manufacturing lines etc.). However, because they are new and unique they can be sold at a high price. As a feature becomes more commonplace and easier to mass-produce it trickles down to mid-level where it's sold at more moderate prices.
That's how things like carbon frames, 11 speed shifting, hydraulic disc brakes, electronic shifting (to some extent), internal cable routing, press fit bottom brackets, integrated headset bearings etc. have trickled down from high-end to mid-level.
To bring innovation and change to entry level bikes it would have to be cheaper to manufacture than existing bikes and their components.

The Escape 3 2013 is actually comparable to the current Escape 3 2021 or even better. The Escape 1 2013 is still better than both.
For both model years of the Escape 3 the components are on the very low end, but the 2013 version had 3x8 shifting with Shimano Altus components while the 2021 has 3x7 with Shimano Tourney. The current version has slightly wider tyres (38mm vs 32mm) if that's important to you.
The Escape 1 2013 had 3x9 Shimano Alivio shifting and a carbon fork.
Unfortunately Giant feels too insecure to state the weight of their bikes, so we don't know which direction weight took.
Escape 3 2021 specs:

Escape 3 2013 specs:

Escape 1 2013 specs:
Comment: Good job hunting those old specs down.
Answer: There is trickle-down in bike technology, so in some cases, a top-tier bike from about 10 years ago might be considered roughly on par with a 3rd-tier bike today (this is all subjective and in many cases the bikes might not be comparable).
In this particular example, it seems all the Giant Escape bikes are at the cheaper end of the spectrum. It takes a lot longer for innovations to trickle down, and it's a lot harder to entice the buyers in this segment with the new and shiny, so the companies don't have the incentive to churn their specifications the way they do at the top of the range. It looks like these models have changed very little since 2013.
Comment: so your saying if it was giant tcr it would be a different story and lowest tcr would > top end tcr 10-15 years ago?
Comment: Something like that, yes. [GCN had an episode on this subject recently](https://www.youtube.com/watch?v=TUfyUUauuoY).
Answer: The Giant Escape 3 bike indicated in the question is a unisex hybrid bike. In the 2021 spec, it has a triple chainring, a 7-speed cassette, V brakes, and a Tourney drivetrain. The frame is aluminum, with a hi-tensile steel fork.
I am not familiar with the evolution of Shimano's Tourney group set, or groups at that price point. However, a brief inspection of the 2013 Giant Escape on Bicycle Blue Book appears to show the same general specifications, with a slightly better 3x8 speed drivetrain. The frame construction even appears to be similar (hydroformed aluminum tubes). I would guess that in this space, if you are not talking about comparing bikes that have gained hydraulic disc brakes to rim brakes, current day bikes may be quite comparable to bikes from 10 years ago.
If you are comparing bikes with vastly different braking systems, this may be another story. My qualitative judgment, and keeping mind I don't own bikes at this price point, is that rim vs non-hydraulic disc is comparable, and I would actually favor rim brakes. Rim brakes are less complex. Lower end mechanical disc brakes don't always have great braking power, and you really do need better cable housing to maximize their potential. Discs do stop better in the wet than rim brakes, but many people don't ride in the wet. Maintenance requirements are probably less on rim brakes. Comparing hydraulic disc to rim is potentially different. Hydraulic discs are more complex and pricier. However, it is possible that they need less maintenance over time versus rim brakes - you may need to bleed the system less often than you would need to replace cables, and if you don't need a bleed, the hydraulic lines may not wear out the same way that cables do. That said, any maintenance you do need on a hydraulic disc brake will be more complex than a rim brake.
For performance mountain biking, the frame geometries and suspension designs have evolved very considerably in the last 10 years, so those types of bikes would obsolete a lot faster. Additionally, the drivetrains have evolved considerably as well, going from 2x drivetrains to 1x.
In performance road biking, if we are focusing on the highest level bikes, a lot of the evolution has been in aerodynamics. The groups have also evolved, basically going from rim brakes to hydraulic disc brakes. Qualitatively, I would judge the difference between road bikes from 2000 and 2010 to be a lot smaller than 2010 vs 2020. In some ways, the road bike space has seen less drastic changes than MTBs, at least if we exclude the top end performance road bikes. There has, however, been a substantial change in design paradigms for drop bar bikes in general. Endurance road bikes, I.e. more leisure-oriented road bikes that are not narrowly aimed at going very fast on smooth roads, have become a thing. They were not quite a thing 10 years ago. Also, the gearing has changed a lot, with road bikes getting much lower gears that are more suited for everyday riders.
Basically, the question is difficult to answer. Many categories of bicycles and components may not have evolved substantially over the last 10 years. My understanding is that for performance MTBs, the improvements are really substantial. For performance road bikes, the gain is less obvious if you are not going really fast.
Comment: Oh yes, MTBs evolve ridiculously fast. A bike from 2001 vs 2011 vs 2021 are no comparison for geometry, features, components, etc.
Answer: Juhist gets a lot right but not everything:

Index shifting has... been available for 30+ years.
Tubeless tires... have been available for decades. Some professionals prefer them.
Although weight reduction... Yes, and recreationalists need not spend $1000s on these bikes.
Wheels used to have 36 spokes... and still do but there is a lot more available options to meet many more purposes and preferences.
Since disc brakes were introduced... they continue to get better and the kinks resolved. They have yet to reach maturity.
Toe clips and straps are no longer used... Yeah, been that way for 30+ years.
Comment: Hi, welcome to bicycles!  Please don't post responses to other answers as an answer; if you're posting an answer it should be complete and stand on its own.  You might want to read [answer] and take the [tour].
Comment: Welcome to the site - this question is not a good example of how things should work around here, so question was closed.  Other Q&A might be a better example, and you can browse the [tour] to see how it should work.   Do have a go at answering other questions posted on the main page.
Answer: My opinion is that the improvement in bike technology has mostly stopped decades ago, and in many matters the technology continues not to improve but to worsen.
Some recent changes:

Index shifting has become available. This is a genuine user friendliness improvement.
Trigger shifters like Rapidfire and STI have become available. On the mountain bike side, the Rapidfire shifters can be bought separate from brake levers and they are quite cheap too. Unfortunately, on the road bike side, the STI shifters are integrated to the brake lever and are very expensive. This has displaced all other types of shifting, so if you for example want to buy a Shimano compatible hydraulic road disc brake lever, you can't buy such a lever without STI shifting.
Number of gears has increased. However, this not only increases costs but also makes the chain thinner. Engineers have had a very hard job to find improved materials and better manufacturing techniques to make the chains and sprockets last long enough. The end result is that the chains and sprockets are about as durable as they used to be, but if engineers would have used the better materials and techniques with old-style sprockets and chains, the longevity of the components would have skyrocketed.
Disc brakes have become available. For someone who rides in the rain, they offer genuine reliability in wet weather. However, the rest, those who don't ride in the rain have to suffer from ridiculously low pad life nowadays, along with far more expensive pads than with rim brakes.
Cables are often routed under the bar tape for drop bar bikes. However, in some situations this means you can't change the inner wire without undoing the bar tape. For example, I have BL-R400 levers for which changing the inner wire requires undoing the bar tape.
Brake cable anchors have a notch to help keep the cable in if the user doesn't tighten it enough. While it makes the brakes more reliable for careless mechanics, it also damages the cable once tightened so reusing a brake inner cable may not be advisable anymore
Chainrings and sprockets have shifting aids (Hyperglide). However, this makes them unidirectional and positional so you can no longer turn the sprockets around to get double wear life, and if you rotate the chainring to spread out its wear the shifting aids no longer do their job. Unfortunately, recently Shimano has introduced non-even chainring bolt patterns, making the rotation of chainrings impossible. The improvement of manufacturing techniques and materials has made it possible to make the sprockets durable enough, but applying the same techniques and materials to old-style sprockets would have made them last practically forever.
Tubeless tires have become available. They require messy sealant, are tricky to set up (in fact so tricky bike manufacturers won't bother and sell practically all bikes with inner tubes, requiring the buyer of the bike to set up the tubeless system) and the tires require so tight fit that if you decide not to use tubeless but put an inner tube in on a tubeless ready rim, after an hour of fighting with mounting the tire, you have hurt your fingers, damaged the inner tube by puncturing it and you still won't have the tire on the rim.
Aluminum as a material: it's good for many parts, for example aluminum rims have superior braking in the wet when compared to steel rims and it's easier to make aluminum double wall rims, but aluminum has become the material of choice for frames where it decreases the fatigue life over a steel frame and makes welding repair impossible without heat treat (that would require you to remove all parts and strip the paint). Also many handlebars are today aluminum, and are arguably fatally dangerous due to their short fatigue life.
In an effort to decrease weight more over what aluminum can offer, some bike parts use carbon fiber nowadays. While it solves aluminum's fatigue problem, it has its own problem. For example if you crash on a bike with carbon fiber structural parts, you never know if the carbon fiber has damaged invisibly. Thus, many riders who have crashed with carbon fiber parts continue riding, and then suddenly a carbon fiber part fails fatally, hurting the rider, when "just riding along".
Although weight reduction has always been a priority for bicycles, today it has been applied to very ridiculous levels. You can't expect such lightweight bikes to last long.
Threaded headsets and quill stems have been replaced by threadless headsets and ahead stems. The headset is superior because it's so simple and easy to adjust. The stem is superior because it allows removing the stem from the handlebar without untaping the bars (the old-style quill stems had only one bolt, the new-style ahead stems have four bolts). Unfortunately, for aluminum handlebars having a "gap" on the top of the handlebar results in pretty nasty stress distribution that can reduce the fatigue life of the handlebar.
Gapless stem: some stems have nowadays reduced the gap of 4-bolt ahead stems over the top of the handlebar. You should choose such a stem if it's available because it increases the fatigue life of the handlebar at a very vulnerable point.
Double wall rims have become common. They are vastly superior to old single wall rims.
Bottom bracket technology has moved from square taper to Hollowtech II. The new style bottom bracket have room for a hollow large-diameter lightweight axle that is very durable and durable large diameter bearings. Unfortunately, in some frames the alignment of the bottom bracket shell is questionable so bearing lifetime can be reduced due to bad bottom bracket alignment.
Wheels used to have always 36 spokes. Today, you'll see wheels with as ridiculous spoke count as 20 (or even less!). Such wheels can't carry any useful road and repairability is questionable. If one spoke fails, the wheel generally becomes instantly unrideable.
Hubs have become available in the straightpull configuration, having spokes with a straight head as opposed to bent head. This is arguably a bad choice, because a straightpull hub dictates the rim size you can use with the wheel and it also dictates the spoke pattern you can use. Nowadays with straightpull hubs we have to choose the hub based on the rim diameter and spoke pattern. Many choices are unavailable.
Cantilever straddle cable has been replaced with link wire. This is a safety feature: if the main cable breaks and the link wire falls on a knobby tire, it won't lock the brake and send the rider over the bars.
Chains are today of bushingless design. The old-style bushing-type chains could last tens of thousands of kilometers if taken care of well. Also the old-style chains retain their lubrication long. The new-style bushingless chains require relubricating every 1000 km even in dry conditions and won't last many thousands of kilometers.
Chains have today "punched" pins. This is made to make the chain last under misuse such as shifting under load. However, the mushroom head "punched" pins can't be used to re-join a chain once disconnected, but rather you must use a new reinforced connecting pin. Some manufacturers have introduced "quick links" that can't be disconnected without pliers once the chain becomes dirty. Because they are so difficult to disconnect, they should be called "slow links" instead.
Since disc brakes were introduced, it was found the front quick release skewer was insufficient for holding the front wheel in on the fork. Braking causes forces that attempt to remove the front wheel from the fork. While the quick release skewer prevents this immediately, gradually after many brakings, the skewer becomes loose and no longer can hold the wheel in. This has been solved by using thru axles instead of quick release skewers.
Toe clips and straps are no longer used. Instead, clipless pedals are available. This is a very useful upgrade.
Cantilever brakes have mostly been replaced by V brakes. They are easier to set up and their mechanical advantage doesn't change as the pad wears. However, they require different style "long pull" levers that pull about twice the amount of cable that old-style levers pull.

Do I see a major drive to improve technology? No I don't. I see one step forward, one step back, one step forward, one step back, and so on...
About the only thing that is certain is that standards are removed from use for no good reason at all. If you buy a bike today and want to repair it 30 years from now, many parts can't be found anymore.


Developer trying to delete a field in a managed package

Question: We are developing an upgrade to a managed package and want to delete a custom field on the Contact object.  There is no option to delete it.  Are there are any suggestions to delete or hide the field?
Answer: You cannot delete a custom field after releasing a Managed Package. In the ISV docs there is a chart showing what objects are Customer/Developer Editable and Deleteable. Custom fields are no by both parties as far as ability to delete.
You can certainly make a new page layout and not include that field. Additionally you can edit the profile and/or Permission set (since you are referring to Contact which is a Standard object it would be the Profile in this case) and make the field inaccessible by that profile.
Those are your only options.
Comment: I'm confused the doc here says they're developer deletable on page 29: https://na15.salesforce.com/help/pdfs/en/salesforce_packaging_guide.pdf
Comment: The initial question was posted 7 months ago. You are reading the current, Spring 14, Salesforce release notes. Salesforce has since added the ability to do this. It was not available before this release.


Serialized form data via ajax only returns one letter ("r")

Question: I have a form that I am submitting via ajax to a php function like so:
var formData = $(form).serialize();
    $.ajax({
        type : 'post',
        dataType : 'json',
        url : myAjax.ajaxurl, //we can use this value because in our php file we used wp_localize_script
        context:this,
        data : {action: 'tps_save_rental_details', formData:formData },
        success: function(response) {
            alert (response.testing);
        }
    });

I thought that by using .serialize() it would pass the form data in json form and then I could use it in my php function like so:
$formData = $_REQUEST['formData'];

$rentalType = $formData['rentalType'];

$result['testing'] = $rentalType;

(rental type is the name/id of the first text input field)
But when I alert the returned value of $results['testing'] in my ajax success function I just get one character, the letter "r" which doesn't even appear in the value of that field (which is "class-education").
Is this the best way to pass form input values via ajax? If so, what might I be doing wrong here.
Answer: The serialize method just takes the form elements and puts them in string form. "varname=val&var2=val2"
You can get these values in php like:
$params = array();
parse_str($_GET, $params);

Specific to the OP's case:
$formData = array();
parse_str($_REQUEST['formData'], $formData);
$result['testing'] = $formData['rentalType'];

Comment: Aha! That makes sense, I was assuming serialize spit out a different format.


How do I prevent my fingers from hurting when playing fighting games with a gamepad?

Question: I'm practicing for when Fighting is Magic comes out and I bought a pair of Sega Saturn USB game pads which, the Internet says, are the best ones for fighting games. They're pretty good alright, but my left thumb starts to hurt soon from doing quarter and half circles. What's wrong and how do I deal with this?
Comment: some tape on your thumb can help
Comment: When you say your thumb hurts, are you having problems with the pad of your thumb from rubbing/chafing/bruising, or are you having tendonitis?
Comment: The pad of the thumb hurts.
Comment: A good set of gloves can help.  Ones that are preferably leather and well-fitted to your hand.
Answer: I had the same problem with original NES and SNES controllers (Sabin's Bum Rush requires a full circle...  although there's a really easy way of doing it that I kick myself for not knowing at the time, but I digress...).  I'm pretty sure I've permanently damaged the fleshy pad on my left thumb from this kind of thing.
There's a few things that can help here:

Use less pressure on the pad.  It's likely that you're pressing the pad much harder than you honestly need to in order to make the button register.  This is going to cause you pain.  Try to relax and use less pressure.  I, personally, have had very little success with this advice, especially in a competitive game situation.
Take frequent breaks.  Another piece of advice I have a tough time taking, personally.
Change the surface between your thumb and the pad.  If there are any sharp corners on the pad, try filing or sanding them down.  Alternatively, you could apply a silicone cap or coating of some other material to the D-Pad or wear one on your thumb.  However, this will change the coefficient of friction between you and the pad, which might make things difficult.  Some experimentation might be warranted.
Use a stick instead.  Although you'll have to watch out for different kinds of injuries (ie, rubbing the skin off your palm), there's a reason why most fighting games in arcades use sticks rather than D-Pads.
Answer: Try using a rubber finger grip. Just get a size L or XL and use it on your thumb, like the ones people use to count money or separate paper!
Comment: I have no idea what you're referring to. Can you please provide pictures and/or links?


What if an airspeed prescribed by a published procedure isn't safe for a particular aircraft's operations?

Question: Departure and arrival procedures often prescribe airspeeds which must be maintained at certain fixes. 14 CFR 91.117 sets rules for airspeeds but has a paragraph which states that the airspeeds don't apply if the aircraft can't operate safely within those limits. Does any regulation or published recommendation alleviate aircraft from the airspeeds prescribed on instrument procedures for similar reasons?
Comment: "Unable JEBBB arrival, can't fly that slow"
Comment: The most powerful word in the [pilot/controller glossary](https://www.faa.gov/air_traffic/publications/media/pcg.pdf) is `Unable`.
Comment: @voretaq7: Ye link breaketh.
Comment: https://www.faa.gov/air_traffic/publications/media/pcg_4-03-14.pdf
Answer: If you are unable to comply with a published procedure, you simply inform ATC and the controller will tell you what to do instead. The controller will most likely be authorized to make this decision, even if there is no written regulation covering the specific case.
Answer: The wording of your question seems to suggest that 91.117 doesn't apply to instrument procedures, but there's nothing in the regulation itself to say that. Specifically, 91.117(d) is very broad (emphasis mine):

If the minimum safe airspeed for any particular operation is greater
  than the maximum speed prescribed in this section, the aircraft may be
  operated at that minimum speed.

Having said that, if you can't comply with any procedure or instruction you should inform ATC and let them tell you what to do. The AIM mentions airspeed in the context of holding (section 5-3-8), but it's reasonable to assume that you should inform ATC in any scenario where you can't comply:

Pilots unable to comply with the maximum airspeed restriction should
  notify ATC

From the ATC side, the ATC orders have an entire section (5-7) on speed adjustments, but one of the first things it says is:

It is the pilot's responsibility and prerogative to refuse speed
  adjustment that he/she considers excessive or contrary to the
  aircraft's operating specifications.

So if you can't comply with an airspeed restriction (or any other restriction) just tell ATC "unable" and work it out with them; that's what they expect, based on the ATC orders.
Answer: From the same regulations:

§ 91.3 Responsibility and authority of the pilot in command.
(a) The pilot in command of an aircraft is directly responsible for,
  and is the final authority as to, the operation of that aircraft.
(b) In an in-flight emergency requiring immediate action, the pilot
  in command may deviate from any rule of this part to the extent
  required to meet that emergency.
(c) Each pilot in command who deviates from a rule under paragraph (b)
  of this section shall, upon the request of the Administrator, send a
  written report of that deviation to the Administrator.
Comment: I'm not sure why emergency authority is relevant here?
Comment: Indeed, being unable to comply with an approach clearance is not, in itself, an emergency.


Why does my sculpting not working like how it does on this video

Question: Ok, i am watching this video by blender guru https://www.youtube.com/watch?v=6OTX3ZdYvEA&t=430s and when he starts sculpting at 5:58 his brush seems to have a  "plus" sign for a cursor, "+". mine doesnt. i dont know what this is called or how to fix it but i think it is messing with my sculpting because mine is not doing what his is doing. help would be appreciated. i have been searching for help for hours.
ps here is what is happening to mine: https://1drv.ms/u/s!AkjW5v_qJtM7j2v6-AJhqNbGJH0D?e=Jh4WlO
Answer: Maybe you need to subdivide the mesh further to increase detail.
Try subdividing once more to increase the number of faces for the brush to work on.


The constraint commute with Hamiltonian in Gauge theory

Question: When canonical quantizing gauge theory,  we find that the canonical momentum corresponding to $A_0$ vanish since the Lagrangian contains no $\dot{A_0}$ . Thus we need to choose a gauge, for example, $A_0=0$. However, this will impose a constraint. The equation of motion reads
\begin{align}
D_\mu F^{\mu\nu}=0
\end{align}
here the $D_\mu$ take adjoint representation on $F$, which is just $\partial_\mu$ in Abelian case. If we set $A_0=0$, the zero component of this equation of motion is now not an equation for dynamic variables: generally, a EOM from Lagrangian could be get by using  $\dot{q}=i[H,q],\dot{p}=i[H,p]$ when $p,q$ are canonical variables, but here we've set $A_0=0$ and the canonical momentum vanish. Thus this will be a constraint on the physical states (since its also easy to find that this operator itself is not zero)
\begin{align}
D_i F^{i0}|\psi\rangle=0
\end{align}
However, it's also said that we will have $[D_iF^{i0},H]=0$ so it is enough to restrict the initial state in the physical space. I know how to check this here by directly calculate commutators, and it quite make sense too. However I wonder is it a general principle that any gauge fixing procedure by gauge redundancy will give constraints and these constraints will commute with Hamiltonian, and how we prove this commutation relation in a general way.
Answer:
In general, as part of the Dirac-Bergmann analysis, one introduces secondary constraints to ensure that the Hamiltonian  commutes weakly$^1$ with the primary constraints, and so forth.
As a result, the Hamiltonian commutes weakly with all constraints.

In contrast, the Hamiltonian does not need to commute with the gauge-fixing conditions.

--
$^1$ Weak equality means equality modulo constraints.
Comment: Thanks!But I do not quite understand what you said. What does "weakly" mean?I know here the primary constraints is the canonical momentum is zero.So the $D_i F^{i0}|\psi\rangle=0$ is the secondary constraints and do not come from gauge fixing?
Comment: I updated the answer.