Is the "is being employed" bit in this sentence grammatical?

Question:
Mr. Peter is being employed at our company as "Marketing Supervisor" as of 01.01.2010 till date with a monthly salary of 0000.0000
Comment: It's semantically odd, at least. I wouldn't call it employment if his salary is zero—more like slavery.
Answer: It's just about grammatical if it means that Mr Peter has only just been engaged. If he's already been working there for some time, you need to say 'Mr. Peter is employed at our company . . .'
Comment: @TrevorD: Either is fine, although "employed by" is more common: http://books.google.com/ngrams/graph?content=employed+at%2C+employed+by&year_start=1800&year_end=2000&corpus=15&smoothing=3&share=
Comment: Surely "... employed *by* our company."?
Answer: Your sentence would read better if written as follows:

'Mr. Peter has been employed at our company as "Marketing Supervisor"
  from 01.01.2010 to date, with a monthly salary of 000.'

(Note: The 'from.. to..' could be British English, and the 'as of.. till..' American English).
Answer: Shebeer, your sentence is ungrammatical, as, in your understood intention to convey some timespan, you have wrongly mishmashed three temporal grammatical forms, one of which involves the preposition as of, another the construction from ... to, and the last one the preposition since.
As of(*) is never later in a sentence parallelled by to/till, because as of is used for situations whose truth is enduring, or more precisely, whose truth cannot later in the sentence be syntactically limited, e.g., by using function words such as to, until, for etc. (Semantically it can, of course: you can always add something like "it is falsely believed".) The structure as of + point in time (which point is allowed to be blurred) can be used in sentences such as these (quoted mostly from dictionaries):

- Darren terminated his job as of December 31st. The project was terminated as of January 1.
  - As of last year, pupils are admitted according to where they live and go to school, and whether they already have siblings at the school.
  - We begin work as of Tuesday.
  - As of the moment, things are fine.
  - As of next month, all the airline's fares will be going up.
  (! Note that in the latter sentence the progressive aspect has special use. It will not happen that starting with the following month, the situation will be such that the action will be progressive—that the price of the fares will have increased on a certain day (commonly, the first working day of the month), then, that it will have increased some more later in the day, then some more the next day, and so on. Rather, the sentence means that the fares are set to increase once more. This use is different from the one in the op.)

Please also read through these: as of today and as (of) yet.
You, also, wished to express the continuity of the situation stated, so you used a progressive aspect (in passive voice, but that's unimportant). You ought not to have additionally changed the default value of that grammatical category (a.k.a simple or Simple) for your verb; the preposition as of—in its interesting way—already denotes that the stated situation is not momentary. The preposition since is somewhat similar to as of, in that it denotes a more lasting situation. The similarity, to whatever extent, is only semantical, however. Syntactically, since conveys that the sitution is not momentary, by way of signalling and governing that perfect aspect (as required by standard English!) shall be used: They have been friends since childhood. She's been skiing since childhood. Dissimilarly to since, as of coexists quite fine with verbs having simple aspect.
So, you have mishmashed these three forms (I'll refrain from a more formal notation):

is employed as of + past date
was employed from + past date + to + endpoint less in past
has been working since + past date

Additionally, you took till date ("date" meaning the time of the utterance) for your 'endpoint less in past', even though present perfect dispenses with the need for any temporal adverbial that means now such like "till date", which it does because a present perfect action implies that the endpoint less in the past is identical with the time of the utterance. Perhaps sensing this, you opted for present progressive, as it sort of resembles present perfect in that they never describe momentary situations. The result is a sentence of its own kind.
Therefore, a more grammatical sentence would be:

Mr. Peter is employed at our company as "Marketing Supervisor" as of 01.01.2010 with a monthly salary of 0000.0000.

See? Only a couple of words deleted. But for a reason.
Still, the sentence is yet to be free of any grammatical errors, to my mind. I think the use of at with employed is incorrect in a sentence written from the perspective of the employee's employer. A detached observer will commonly use the collocation employed at, but the employer should use something less detached, such as by and with (again, in my opinion). Please read through this (cf He is employed, with a friend, at the local Burger King.) and this.
So, I propose the correct version is:

Mr. Peter is employed by our company as "Marketing Supervisor" as of 01.01.2010 with a monthly salary of 0000.0000.

(*) That it is examined in Business Dictionary more carefully than in a number of other commonly used dictionaries, is illuminating as to whence this preposition came. In that light, the date of its first recorded use (1900) also suggests it's a term of business/legal register that later seeped into less formal registers, to wich as of today, for example, belongs.


Where can I find Microsoft.Build.Utilities.v3.5

Question: How can I get Microsoft.Build.Utilities.v3.5? I am using StyleCop 4.7 and it would seem that StyleCop msbuild task which is in Stylecop.dll has as a dependency Microsoft.Build.Utilities.v3.5. Do you know how can I obtain that dll? I mean what should I download and install in order to get that dll (installing Visual Studio is not an option)
Comment: StyleCop is open source, download the source, update the reference to the current version ( fix any problems ) and use that.
Comment: Same issue with CodeContracts `MsBuildCodeContracts.dll`
Answer: I had similar issue with Visual-StyleCop.MSBuild version 220.127.116.11.
I fixed it by navigating to Control Panel-> Programs and Features-> Turn Windows features on or off and installed .NET Framework 3.5 (includes .NET 2.0 and 3.0)
Comment: Note: Installing the .NET 3.5 Developer Tools in VS2017 does NOT install .NET 3.5 on your machine.
Comment: Just tried. Installing .NET 3.5 Developer tools fixes the error
Answer: Try downloading and installing the .NET v3.5 framework if it's not already explicitly installed on your machine.
http://www.microsoft.com/en-us/download/details.aspx?id=21
Comment: It was, but for some reason that dll wasn't in it, I even had .net 4.0. In the end I had to install VS 2010 to get it from there.
Answer: I know this question is over two years old, however this may prove useful to others...
Recently I needed to setup TeamCity Build Integration Server on a Windows 2012 R2 machine (which has .Net 4.5 baked in) and ran into StyleCop 4.7 issues. It is a known issue with the .Net3.5 build utility dependency that StyleCop 4.7 has.
Taken from stylecop.codeplex.com
"I'm trying to get stylecop to run as part of msbuild. I have a server 2012 R2 server that I am using as a build server, where one of the steps of the build is to run stylecop. I have Stylecop 4.7 installed on the build server, but not visual studio. When the build step executes, it complains that one of Stylecop.dll's dependencies "microsoft.build.utilities.v3.5.dll" cannot be found and therefore stylecop cannot run.
Once I copy over a microsoft.build.utilities.v3.5.dll from another machine that does have visual studio (2013) installed and put it into C:\Program Files\Stylecop 4.7, all is well."
I copied the dll from a Visual Studio 2010 only machine and it cleared up the issue.
Comment: I had to search for the file on my machine, Once I found it, I put the file in the same directory as where my build file is and the problem went away
Answer: I had a similar issue and the solution was install .net framework v.3.5.
This should be very simple on windows, just accessing Turn Windows feature on or off and then check .NET Framework 3.5 (includes .NET 2.0 and 3.0).
However I had problem to turn on this feature on my machine, because after checking, the download of resources always returned error.
After searching I found a solution for my case as follows in the video:
"How to fix .NET Framework 3.5 Error 0x800f081f in Windows 10": https://www.youtube.com/watch?v=ZHQqb7IOHZE
Basically, it's necessary to download a .CAB file, move it to C:\ and then run a command in the prompt command.
Link to the .CAB file:
http://www.mediafire.com/download/gaflwfg9tth889o/microsoft-windows-netfx3-ondemand-package.cab
Command (Requires to open command prompt as Admnistrator):
Dism.exe /online /enable-feature /featurename:NetFX3 /source:C:\ /LimitAccess
The information, link and command has been extracted from the video and its description.


What was Student's (Gosset's) contribution in formulating the t-test?

Question: A recent question, related question, and cited source, recently made me aware that the $N-1$ correction for sample estimates of population variance is referred to as Bessel's correction.  Bessel was dead by 1846 (wikipedia citation) and the t-test was published in 1908 (wikipedia citation).  For some reason, I had always assumed that the contribution of Gosset (aka Student) in formulating the t-test was the use of $N-1$ in the calculation of $s^2$.  Now it seems this contribution clearly belongs to Bessel.  In this vein, I ask what was Gosset's contribution in formulating the t-test?
Answer: E. L. Lehmann addressed this question in an introduction to a reprint of Gosset's 1908 article in Breakthroughs in Statistics, Volume II--Methodology and Distribution (Samuel Kotz & Norman L. Johnson, eds., 1992).
Lehmann first describes the state of the art in Gosset's time: it amounted to a "z test" where the estimated standard deviation was treated as if it were a constant.  Then he discusses Gosset's contribution:

However, if the sample size $n$ is small, $S^2$ will be subject to considerable variation.  It was the effect of this variation that concerned Student, the pseudonym of W. S. Gosset... .  He pointed out that if the form of the distribution of the $X$'s is known, this variation can be taken into account, since for any given $n$ the distribution of $t$ is then determined exactly.  He proposed to work out this distribution for the case in which the $X$'s are normal.

This in fact is what Gosset did, albeit without mathematical rigor: he derived some properties of the distribution of $t$ for the normal case, matched them to properties of known distributions, and correctly guessed its distribution--acknowledging that this was less than rigorous.  To support his guess, he conducted a Monte-Carlo simulation using samples of four from a dataset.
Gosset wrote pseudonymously because his employer (the Guinness brewery) apparently felt that this improved understanding of small-sample variation was a bit of an advantage in the business : it would have led to improved quality control procedures.
Comment: Monte Carlo in 1908 - men were men in those days...
Comment: Thank you. My answer got chopped up it seems. Besides, yours is better in nearly all respects.
Comment: @Corone That is very observant: he probably carried out all calculations with pencil and paper.


Accessing form attributes in custom form field type in Django

Question: I have a form that contains a foreignkey field (Place).  I've set up this field to use a custom form field type based off of CharField instead of ModelChoiceField as I want users to be able to use an autocomplete text input.  The autocomplete is working, and if the instance of the foreignkey'ed model exists, I have no issues.  However, if this instance of Place doesn't exist I want the user to be able to enter in the street address, town, state, and zip and use those to create a new Place using get_or_create in my custom field type.  My code is like so:
class PlaceAutoCompleteField(forms.CharField):
    def clean(self, value):
        super(PlaceAutoCompleteField, self).clean(value)
        place, created = Place.objects.get_or_create(name=value,
                            defaults={'street': self.form.cleaned_data['street'],
                                      'town': self.form.cleaned_data['city'],
                                      'state': self.form.cleaned_data['state'],
                                      'zipcode': self.form.cleaned_data['zipcode']})
        return place

class EventForm(forms.ModelForm):
    place = PlaceAutoCompleteField()
    street = forms.CharField(max_length=50)
    city = forms.CharField(max_length=40)
    state = USStateField()
    zipcode = USZipCodeField()

    class Meta:
        model = Event
        fields = (.....)

I get the error: 'PlaceAutoCompleteField' object has no attribute 'form'
I'm not surprised by this, but I'm unsure how to pass the form data into my custom field.  Any ideas?
Answer: This kind of logic doesn't belong on the field - it belongs on the form, specifically in the form's clean method.
Comment: How can I do this in the form clean method?  Then I get the error: "Cannot assign "u'New Place'": "Event.place" must be a "Place" instance."


is phenolate a strong or weak base? and why?

Question: is phenolate a strong or weak base? I have read somewhere that it would be a weak base. However, since phenolate is the conjugate base of phenol, which is a weak acid, I would think that phenolate is a strong base. My general understanding is that strong conjugate base or acid is formed from a weak acid or base, respectively. Could someone help me?
Comment: "I have read somewhere that it would be a weak base." Please tell us where. Without that knowledge we can not know the context within which the comment was made, and this can not answer your question fully. Yes, phenolate would normal be consider a reasonably strong base due to the reason you give. But the original might have been a comparison with sodium hydride, or in a strange solvent, or something else - we need to know.
Comment: Evaluate it quantitatively. Take the phenol acidity constant and compute the phenolate basicity constant. Then make conclusion.
Comment: There are levels upon levels upon levels of different meanings for "strong" and "weak", and on top of that there are more levels. Are you big or small? A [Stentor](https://en.wikipedia.org/wiki/Stentor%5F%28ciliate%29) can grow to 2mm, which makes it a giant among ciliates. On the other hand, an adult Indian elephant is pretty small compared to Taj Mahal. Same thing here.
Comment: The old name for phenol is carbolic acid, does that sound like a weak acid?
Comment: Phenol is a stronger acid than water meaning its conjugate base is weaker than OH- but stronger than bases such as acetate, bicarbonate or ammonia? that have stronger conjugate acids. [ Do the math to be sure.] Your reasoning is fine but you forget that water is an acid too and acid strengths are relative to its strength.
Answer: Whether a base is considered strong or weak depends heavily on context. It is thus much better to consider the relative strength of acids and of bases rather than making absolute statements that one acid is strong or weak. This is best done by comparing the pKa values of acids (or conjugate acids in the case of bases). Phenol has a pKa of about 10.0 so it is a stronger acid than water (pKa 15.7), but weaker than acetic acid (pKa 4.8). You are correct that when comparing two acids, the stronger acid has the weaker conjugate base and vice versa. Therefore, we would expect phenolate (conjugate base of phenol) to be a stronger base than the acetate (conjugate base of acetic acid), but a weaker base than hydroxide (the conjugate base of water).


Azure S2S VPN: Egress Packets Dropped due to Traffic Selector Mismatch

Question: I have set up a S2S VPN in Azure to connect to an on-prem device (PfSense) of a 3rd Party.
We have managed to establish the VPN tunnel, and I can see the status of the connection in the Azure Portal is 'Connected', but when I try a telnet connection from a VM in my VNet to a device in the on-prem network it fails.
Initially I thought it may have been a routing issue but I checked the 'Effective Routes' for the VM and the next hop type for all traffic to the on-prem address space is set to Virtual Network Gateway, so I don't think that is the issue.
After running the Troubleshooting on the Azure Portal I noticed that the Egress Packets seem to be getting dropped due to a Traffic Selector Mismatch
<code>Connectivity State : Connected
Remote Tunnel Endpoint : x.xx.xx.xxx
Ingress Bytes (since last connected) : 672 B
Egress Bytes (since last connected) : 0 B
Ingress Packets (since last connected) : 8 Packets
Egress Packets (since last connected) : 0 Packets
Ingress Packets Dropped due to Traffic Selector Mismatch (since last connected) : 0 Packets
Egress Packets Dropped due to Traffic Selector Mismatch (since last connected) : 4 Packets
Bandwidth : 0 b/s
Peak Bandwidth : 0 b/s
Connected Since : 5/24/2019 2:28:38 PM
</code>
The on-prem device that I am connecting to is Policy Based, so I recreated the Azure VPN connection with the 'UsePolicyBasedTrafficSelectors' IpSec setting set to true, but I'm still having the same issue. Can anyone suggest where to go from here?
Answer: Check for PFS and set it as None
Comment: This needs a much better explanation.


Use the locally published RA route for routing

Question: I have a Linux machine, working as a router, that has radvd configured. I have set up some basic configuration like the following:
interface wpan0
{
    AdvSendAdvert on;

    prefix 2001:db8:200::/64
    {
        AdvOnLink on;
        AdvAutonomous on;
    };
};

interface eth0
{
    AdvSendAdvert on;

    route 2001:db8:200::/64 {};
}

From other machines in the same eth0-network, I see the proper route:
$ ip -6 route
2001:db8:200::/64 via fe80::dead:beef:dead:beef dev enp11s0 proto ra metric 100 pref medium

But the machine that is advertising that route does not have that in its routing table. Is there a proper mechanism to add that? I thought that I could avoid to manually meddle the routing table, as to avoid duplicating config things. Maybe I am missing some thing to make it work? Or maybe it is not the proper way to do it? [why?]
Answer: You would get such a route automatically by configuring an interface with an IP address and prefix in that network, which suggests to me that this has not been done. If your network interface or design does not permit this, you would need to add a route yourself.


How to achieve a desired relative humidity in a sealed environment

Question: I need to find out how much water to add (in milliliters) to a sealed test tube (which has a volume of 53 milliliters) to achieve a relative humidity of 60% when the temperature is heated 80 degrees Celsius. The 80 degrees Celsius will be achieved in an oven used for Oddy tests. Oddy tests achieve an RH of 100% in the same test tube size listed above by adding 0.4 mL of water and heated to 60 degrees Celsius. The temperature of the room that this will be conducted in (the starting temperature and RH of the test tube when the water is added before it is heated) is about 75 degrees Fahrenheit with an RH of about 20%.
I have absolutely no idea what I'm doing and would appreciate any help.
Answer: A critical point to add to the previous answer: You must use a saturated salt solution. This means that the maximum amount of salt is dissolved in the water at the temperature of usage - this criterion is only satisfied if there is both solid salt and liquid salt solution present at the same time. Under these conditions the thermodynamics properties are uniquely specified. The system can also tolerate changes in the amount of water in the system. If the humidity is too high some water will condense into the solution (so lowering the humidity) and the solution will dissolve some more salt to maintain saturation. If the humidity is too low water will evaporate from the solution (so increasing the humidity) and the solution will crystallize some some salt. This arrangement is a self correcting stable system. However, for good precision the solution should be mixed and the temperature should be stable.
The referenced article contains extensive information on the properties of a variety of salt solutions and should help you select a suitable salt for your application:
https://nvlpubs.nist.gov/nistpubs/jres/81A/jresv81An1p89_A1b.pdf
Other methods, for example using water/glycerin solutions of different compositions, work but do not work well if a significant amount of water evaporates or condenses in the solution while stabilizing humidity.
Comment: thanks for the saturation specification! +1. -Niels
Answer: There is a simple way to do this, as follows.
Salt solutions of different ions often depress the vapor pressure of the water in which they are dissolved. This means that a pan of such a solution will equilibrate with a certain specific water content in the air surrounding it. If the humidity of the air exceeds that which corresponds to equilibrium, the salt solution will pull moisture out of the air, and if the air is drier than that equilibrium, then water will leave the pan.
By selecting a salt that has an equilibrium point near your desired humidity setpoint, you can dissolve it in water, pour it into a pan, and place it in your chamber and it will hold the humidity at the setpoint.
This is a classical problem from physical chemistry, so if you can find a p-chem guru they may be able to help you select the right salt for your application. NOTE! As pointed out by John Matthewson below, be sure to use a saturated salt solution


My melody looks awful

Question: I was just improvising on my piano when I came across a melody that I liked. I sat down and tried to write it down. It resulted in excessive triplets and time signatures changing every bar. So could it be possibly written down better?
Here is the midi file
Comment: I agree with Rockwell and I would add that it should be 12/8 time to make the triplets not triplets. If you have a triplet feel for almost a whole piece, it's usually better to write it in compound time, unless you're Ravel writing *Bolero*.
Comment: Well is that the meter you were playing in?  I notice that every group of 5/4 and 3/4 adds up to 8 beats, which makes me think it is possible this is really just in 4/4.  I couldn't open that audio file so I was unable to listen to it, but are you sure this is the meter pattern you are using?  If it is, then this is how it looks.  Are you really counting "1,2,3,4,5 , 1,2,3, 1,2,3,4,5, 1,2,3" as you play?
Comment: The first time I wrote down a composition I unconsciously tweaked note durations to make them more "even", and ended up with a similar result.  Are the timings in your midi file _exactly_ the same as what you would play?
Comment: You may consider using 4 sharps in the key signature instead of just 3. The melody is pretty clearly in E major, so unless you're intentionally writing it in E Mixolydian, 4 sharps would probably be a better key signature.
Answer: This isn't technically EXACTLY the rhythm of yours, but this is what I hear when I listen to the midi file, and it seems to be what you're going for:
Obviously you could make changes like making it dotted quarters + eighth note + two quarter notes, or making it in 6/4 or 4/4+2/4 or something funky, but this is how I would write the melody.
Here is a midi file
Comment: I would double the note durations because I hear the last three notes of the phrase as downbeats (the `E F♯ G♯`). This would put the rhythms at dotted quarter + eighth note + two quarter notes, as you suggested. I independently came up with that exact same rhythm when whistling the tune to myself.

My melody looks awful


Conditional logistic regression vs GLMM in R

Question: I have paired data (GWAS case/control study) and I have heard using conditional logistic regression or generalized linear mixed models (GLMM) is appropriate. Which should I use in this case? Why would you use one over the other. More importantly can you guys point me towards resources for doing these methods in R? I'm finding a lot of material for SAS, which I do not prefer. I can provide more details if necessary.
Answer:
The conditional logistic regression applies fixed effects (in the
context of econometrics),
$$ logit(p_{ij})=\boldsymbol x_{ij}^{'}\boldsymbol\beta+u_i.$$
where each pair of subjects has an individual intercept ($u_i$). It can be implemented  with clogit() of package survival or clogistic() of package Epi.
Generalized linear mixed models (GLMM) for binary data can adopt link
functions like logit, probit and cloglog. The mixed logistic
regression is as,
$$ logit(p_{ij})=\boldsymbol x_{ij}^{'}\boldsymbol\beta+\boldsymbol
   z_{ij}^{'}\boldsymbol u_i$$
where $\boldsymbol u_i$ are random variables and can have the distribution assumption (e.g. normal distribution). Of course you can use a random intercept model, i.e. $\boldsymbol z_{ij}^{'}=1$ and $\boldsymbol u_i$ is a scalar. You can estimate GLMM using glmer() of package lme4.
As to the choice between conditional logistic regression and GLMM for binary data,
some people are in favor of conditonal (fixed-effects) logistic regression and GLMM with probit link, but against fixed-effects probit or GLMM with logit link. The reason may be that some of the consistency properties break down, especially with small within-cluster sample size ($n_i=2$ for your case).
You can find the clarification of fixed effects and random effects (and marginal models) in
different contexts here.
Comment: how can case-control even be analyzed with GLMM ? isn't one assumption is that observations are independent conditioned on the strata? Case-Controls destroys this assumption...


Accessing Adventure Worlds in Lego Dimensions

Question: How do you get to the adventure world portals after this last update? The elevator no longer works, the level select on the main menu is disabled, and when I use the little console beside the portal, all of the worlds show up as question marks on both Vorton and the Shard. The characters that I've bought that have level packs do unlock the level, but not the adventure world, and the characters that don't have their own levels (Jurassic World, for example) don't appear to do anything at all. I'm certain everything has been downloaded, but there's just no way to access the worlds.
Answer: This GameFAQs thread or this reddit thread may hold helpful answers for you.
The two big suggestions seem to be:

Uninstall and reinstall all of the DLC for the game. I would add uninstalling and reinstalling the game as well, just in case that would help.
Use a flying character to access the upper levels. Either via the elevator shaft or by going to the end of the main hub and flying upwards.


What kind of black and yellow insect has a zebra like pattern?

Question: Can anyone help me identify a insect with the following features:

black and yellow
long feelers
body is tapered toward the back
zebra like pattern on the shell
about 1.5 inches long
found in central Texas

Here's what it looks like:
Comment: perhaps indicate what plant it was in, whether he had any friends, and why it's a gardening issue?
Answer: Looks like a Cottonwood Borer.  I am from Ontario, Canada and here Asian Long Horned Beetles are a concern. I do not know if this will help, but here is more information on the Ontario situation.
Answer: This is a Cottonwood Borer. I grew up in Bellaie, Houston Texas and we had 2 cottonwood trees in our from yard, we had tons of these terrifying things in yard. They'd crunch loudly on a branch all way thru intil branch fell of. They also fly...ick! If big black flying cockroaches weren't scary enough, Texas has these monster bugs too. I've heard they have a wicked bite but I never got close enough to find out. Since I'm absolutely terrified of these beetles and roaches, I moved to Colorado and haven't seen one here... I only go home to visit family and friends in Fall and Winter when these disgusting, vile critters usually hibernate.


co-supervisor from a different university?

Question: I am from a maths/physics background currently doing a PhD in fluid mechanics within the engineering department. I am not enjoying it as much as I'd liked and have raised this with my supervisor (only just, I am not sure what the outcome will be yet), and having done a little research into possible connected directions I can take it, I feel as though one of them would involve co-supervising with someone in the mathematic department, and one, if possible, by someone who is at a different university- but was at my university for around ten years, leaving around five years ago, and seems to be the only person who has worked in this area (it seems pretty niche worldwide relative to other areas) with connections to my university. Is the latter heard of for co-supervision or is it a very long-shot? many thanks in advance
Answer: It is not unheard of, certainly, though isn't especially frequent. But whether it can happen or not is up to your advisor and the university, as well as the other person, of course.
But you need to work out details in advance to make it successful. If it is typical for advisors to be co-authors on the resulting work (some fields) then you need to come to some agreement about that. Some compensation for the other professor might be available or not. It might even be needed.
But also be prepared for the distant professor to not do very much.
Comment: hey thanks for tour reply, this is another thing I am considering- who do I approach first here? my own supervisor having identified someone I would want to work with, or the potential co-supervisor first. the former seems silly if the  potential co-supervisor would not be willing to work with us, and the latter seems rude, as though I should check with my own supervisor first. Many thanks :)


How to Preview a youtube video in visualforce page without saving it in database

Question: I am new to salesforce coding (apex) and I have a requirement:
I have one text field on my visualforce page where a user will put you tube URL and there is a preview button on click of which he should be able to see the preview of the video on the same page without saving it to database.After he is done with preview there is a save button on click of which he should be able to save it(by save i mean save the YouTube URL) to  some object.I explored and came to know sales force provide preview feature only for the file attached through feeder which gets stored in content document object but since my video size can be large in size I don't want to go by that way of previewing a video.Can some one please suggest any solution or code examples to do this.Thanks In advance.
Comment: Youtube videos have very simple "embed" sample under them, all you'd have to do to display it with the pasted URL. Have you tried writing the Visualforce page yourself?
Comment: possible duplicate of [How to upload videos into custom object record](http://salesforce.stackexchange.com/questions/22428/how-to-upload-videos-into-custom-object-record)
Answer: In your visualforce page you'd have an apex:outputPanel who contains the youtube iframe and passe the field value (youtube url) as a parameter to the src attribute
<apex:outputPanel id="youtubePanel" rendered="{!url != ''}">

</apex:outputPanel>

And once you click your button the outputPanel is rerended with the video to watch.


Why aren't we encrypting data on Network level instead of transport level when using e.g. HTTP

Question: Why we are bothering to encrypt our data on a transport level, instead of just doing that on a network level with e.g. IPSec and get rid of the need to to that in upper layers. For example instead of using TLS for HTTP we just use IPsec and no need to do the same handshake stuff for other ports or protocols.
Answer: Remember that IP was a government/academic collaborative experiment, and the current Internet was never envisioned. IPv4 didn't have anything like what you suggest, and it couldn't be retrofitted (you cannot simply do something like that and break every IP device in existence). What was done, instead, was to use an encrypted tunnel.
On the other hand, IPv6 was built from the start with something like you describe. Unfortunately, it didn't really take off because people were used to the idea of tunneling, rather than encrypting in the original packet. OSPFv3 for IPv6 does as you suggest, and it may be that it becomes more common, but it is very hard to get people to change.
Comment: So there isn't really a factual reason but it more developed in that way due to history? That's really interesting
Comment: The experiment called IP didn't have anything to deal with bad guys the way we have today. The original Internet was simply based on trust, and people who violated that trust were simply excluded. It wasn't until after the Internet went public that the real problems developed, and it was simply too late to be able to do something like you suggest with IPv4. IPv6 is a great improvement in many ways, including the addition of security headers and encryption, but it is very difficult to get people out of "IPv4-thinking." That has been a major problem in the conversion to IPv6.


Imported bitcoin address

Question: A person I met online asked me to pay small miner fee to get big funds in bitcoin. After sending him the fee, he injected huge funds into my bitcoin wallet, which fell into a bitcoin address imported into my wallet. But now I cannot send these bitcoins, if I want to transfer it is asking private keys, but I don't have private keys, what shall I do to transfer imported bitcoin to my wallet?
Comment: This sounds very much like a scam.  As MeshCollider says, if this guy just gave you an address (alphanumeric string starting with 1) and not a private key (which would be a silly way to transfer funds anyway), he didn't actually give you any money.  The whole idea of "big funds" in exchange for a small "miner fee" is very suspicious in the first place; mining does not work like that.
Comment: Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Answer:
imported bitcoin address which I can not transfer to anybody, if I want to transfer it is asking private keys, but I don't have private keys

It sounds like you have imported the address as a watch-only address, meaning your wallet watches for transactions involving it, but as you say, cannot spend any coins because it doesn't have the private key. This would have happened if you had used importaddress instead of importprivkey. Without the private key you do not own those bitcoins, you are simply looking at someone else's transactions.

Imported bitcoin address


de novo assembly applications

Question: Hey I hope this question supposed to be in this forum.
I'm not from the biology community, I'm from the data security community so im not familiar with the words you might use for answers
I need to use an algorithm that very similar to the de novo assembly algorithm.
I'll try to explain myself better I've some sequences of '1' and '0' all of them are pieces of one big sequence.
I've seen some applications that work with this algorithm such as SPAdes tadpole and Geneious but i couldn't make any of them to work for me except the Geneious because it was the simplest.
Geneious is not good for me because i need something that i can use by command line in the terminal
what application do you recommand me to use that i give input the sequences and the output will be the big sequence.
BTW, in the Geneious I've used a FASTA file for my sequence where my '0' and '1' translated to 'C' and 'D'
Thank you very much wait for your answers :))
Comment: Can you elaborate on what kind of data you're trying to assemble de novo? I've never heard of anything like this before.
Answer: You can try Velvet, but you'll likely end up with thousands of contigs unless your expected reference genome is pretty simple. This question hits many of the difficulties with de novo assembly. I'm also not sure what you mean by this:

BTW, in the Geneious I've used a FASTA file for my sequence where my '0' and '1' translated to 'C' and 'D'

Are you trying to use this for a purpose other than actual genome assembly? You say you're from the data security field, so it's unclear what's your end goal. If you only have a binary sequence, you better have a really long read length and hope there aren't too many repeats or you'll really have issues finding a consensus sequence.

de novo assembly applications


Ubuntu on Asus EeePc VX6s?

Question: Does Ubuntu 11.10 works on Asus EeePC VX6s? Does all of the features work or what doesn't?
Answer: Quoted from Ubuntu Wiki's hardware support:

Asus VX6 Lamborghini
Ubuntu 10.10 Netbook Remix
Works great. Havent tested everything but most day-to-day required things worked out of >the box. The Broadcom STA wireless driver, and NVIDIA driver, required proprietary >drivers, but these were easily installed through System>Administration>Additional >Drivers. 720p Video works fine with ffmpeg, havent setup vdpau yet.
Audio output through headphones hasnt worked out of the box (havent tried fixing). >Havent tried bluetooth, hibernate, microphone, or HDMI out.
Install Tip: no need to change BIOS. Insert thumbdrive (with Ubuntu install), press ESC >many times during boot, then select USB.

As far as headphones are concerned, upon installing you might follow the advice I gave here.

Ubuntu on Asus EeePc VX6s?


Can a USB 2.0 cable support USB 3.0 charging?

Question: I have some USB 3.0 ports on my motherboard which can deliver up to 900 mA of current I believe.  If I plug in a USB 2.0 cable, I can still get up to 900 mA right? I have some devices that uses USB charging and outputs from 1A to 2A but I'm not sure if the cable provided is a factor or not since I'm just using a generic USB cable for this.
Comment: USB 2 supports up to 500mA and USB 3 supports up to 900mA (are you sure your devices pull the full 900mA?) The specs are more for supporting the higher data transfer speed than the higher power draw. A USB 2 cable may get hotter than a USB 3 cable when drawing 900mA, but I highly doubt that a USB 2 cable is going to "burn" from having 900mA drawn through it (at least not if used briefly as a short-term stop-gap).
Comment: You have it wrong. The power adapter says it supports *up to* 1A, meaning that *a* device (whatever it happens to be) that is connected to it can draw no more than 1A from it. That does not mean the device itself actually draws that much (especially when merely charging). Don't look at the power-adapter; look at the device itself (near the power connector or on the bottom) to see what the actual *input* current rating is; it may easily charge from a USB 2 cable if it is low-power enough to not use the extra USB 3 conductors. Is the device even a USB 3 device?
Comment: @Synetech No, I know that.  You don't get my point.  The fact that the charger can output 1A or 2A with the supplied USB cable must mean that the cable is capable of supporting 1A or 2A of current.

You're not reading my question correctly.  I'm not asking about the device.  I'm asking about the USB cable.

And most devices only supply a 700 mA charger because it's cheaper.  There is absolutely no point for them to supply a more expensive charger 1A+ if the device can't draw at least that much.  I'm looking at what is being supplied to me by the manufacturer.
Comment: I doubt it. The USB 3 cable is different to USB 2, so I would expect the maximum to be dependent on the USB 2 cable.
Comment: @Synetech Well the power supply/charging adapter that came with the devices output 5V 1A+ so I'm pretty sure it supports that much at minimum.  Since that is the case, I know that at least the USB cables that came with the charger can support 2A but I'm not sure if that's the general case for all other USB cables.
Comment: I suppose if it it's a high-quality product from a reputable manufacturer that goes to great pains to pay attention to every little detail, then sure, that assumption could be made, but in practice, that is not really guaranteed. Like I said, it depends on the device. For example, if the device never draws more than 200mA and they could get a bunch of 1A power-adapters cheaper than 200mA adapters, then they may very well have shipped a 200mA cable since that is good enough for the device and they know the power-adapter will/should not pull more than 200mA the cable is rated for.
Answer: I think the answer you are looking for is all about the cheap cables some companies supply, and if they can cope with carrying the full 900mA.
No, not all cables are capable of carrying the full 900mA. It will depend on what size the wires are in both diameter (gauge) and length. The length is seldom considered when using cables. If you try to draw 900mA down a short cable then you may be able to, but if you try to draw the same 900mA down a 3 meter cable then most likely you will fail and it could even cause a fire by either the connector or the cable getting hot.
Some of the makers of USB cables try saving money by using wire so small that it cannot cope with the extra 400mA difference between the 500mA of a USB2 and the 900mA of USB3.
If you do go ahead, then make sure you test to see if the cable or plug gets hot after using it for a while. 10 to 15 minutes at least, and do not just plug it in and then come back after the time is up - make sure you keep an eye on it for the full duration. I personally keep one of those laser thermometers next to me to check the temperature of the wire and plugs before starting the test, and the temperature as time passes.
Answer: WHY is this so difficult? Because people keep talking about the SPEC and not the hardware! The spec refers to how much power a USB device CAN use and therefore how much power the USB connector must supply. USB2 is 500ma, so all USB2 connections supply 500ma. USB3 is 900ma, so all USB3 connections supply 900ma (some may supply more to comply with the charging spec).
HARDWARE wise, the power pins on a USB3A or B connector are the SAME pins as on a USB2A or B connector. The USB3 connector simply adds 5 pins which are +Rx, -Rx, +Tx, -TX, and GRD/DRAIN. Notice, not more power pins. SO, if you plug a USB2 device into a USB3A or B connector you can draw up to the limit of that connection.
What this means in real life. A USB2 device will charge faster in a USB3 connector. A USB2 portable HDD will probably work without the need to plug in both A connectors or to add an external power source. If the USB3 port supports charging currents, you could probably use a USB2 4 port expander without an external power source. If you plug a USB3 device into a USB2 socket, it may or may not work depending on how much current the USB3 device needs. If it is labeled as backward compatible, then is must draw 500ma or less.
PLEASE note: Current or AMPS or ma is the amount of current AVAILABLE. How much current the device DRAWS is a function of the device. You could have 10,000 amps available, and no harm will come to your device because it only needs 500ma and that is all it will draw - unless of course your DEVICE is broken, then it might be a pretty fireworks show - or not so pretty.
VOLTS on the other hand is the pushing force of electricity. Applying 120V to a 12V device will push the electricity clear thru the device and out the other side taking no hostages. This is where you research Wall Wart VOLTAGES. 12V on a 5V device is not good.
I hope that helps
Answer: If the output is only 900 mA, your device will still charge, albeit, a little more slowly.
USB 3.0 is designed to be backwards compatible with USB 2.0, and for this, I believe it is. See everythingusb.com and the Power Requirement Comparison table (from Buzzle.com for details.
Comment: Oh I know it will still charge, I just wondered if a USB 2.0 cable can support 900 mA.
Comment: "maximum current drawn by the device may be as high as 1.8 A" [Wikipedia.org](http://en.wikipedia.org/wiki/Universal_Serial_Bus#USB_2.0).
Comment: there are 2 modes of charging.  most laptops usually max out at 250 or 500ma i cant remember off hand.  many wall worts are designed for high speed charging of up to 2A. Some systems may support such high speed charging from bios but that depends on the system.  The wire size inside the chargers and usb cables are the same size as far as I know, though cheepos may not be.  wire size is what limits charging capibility in the cables. I havent read the usb spec to see if its required or not but suspect considering wire size they wouldent want to have to mess with more sizes of wire.
Comment: Powered usb hubs should be able to handle high speed charging as well. My usb2 powered hub is rated for 1A.
Answer:
Can a USB 2.0 cable support USB 3.0 charging?

USB 2.0 and USB 3.x (3.x includes 3.0, 3.1, and 3.2) have the same charging capability.  What muddies the water is that some ports support USB-BC and USB-PD.
The current provided by USB 1.1, 2.0, and 3.x breaks down something like this...
100 mA - The maximum allowed by a USB 1.1 or USB 2.0 device before being "enumerated", that is being recognized by the host as connected.  After this the device can request more.
150 mA - The maximum pre-enumeration current allowed by USB 3.x.
450 mA - Minimum allowed current supply by a host to meet USB 1.1 spec.
500 mA - Minimum allowed current supply by a hub to meet USB 3.x spec.
900 mA - Minimum allowed current supply by a host to meet USB 2.0 and USB 3.x spec, maximum current device can draw under USB 1.1 spec.
1.5 A - Maximum allowed current draw by a single device under USB 2.0 and USB 3.x.
But it doesn't end there.  With the trend to people using USB-A ports as a means to charge batteries on portable electronic devices there's there's a means by which a USB-A port on a computer, hub, or charger to supply more than 1.5 A.
1.0 A - USB-BC minimum allowed current from a charger to meet spec.
1.5 A - USB-BC maximum current draw from a host.
2.4 A - USB-BC maximum allowed current for a charger, some computers will source this much current using USB-PD.  There are some older USB-BC specs that had lower maximum allowed current than 2.4 amps, there are few chargers built to such spec in circulation in my experience.
3.0 A - USB-PD maximum allowed current for USB-A, but few ports on computers and chargers are built to supply this current, at least to my knowledge.
Because USB 2.0 and USB 3.0 use the same voltage and current for power supplied to any device no device will charge faster under either.
But...
When there's USB-PD involved then a computer will supply 2.4 amps to devices, but not all host and devices support this.  As other people answering have pointed out the actual current draw depends on the device.  A well behaved USB device will ask the host how much current it can draw and then draw no more than given permission to draw.  Not so well behaved devices will simply take however much current it likes.
USB 2.0, USB 3.x, USB-PD, and USB-BC are independent standards.  By that I mean a USB-A port can support any one, all, or some mix of them.  The exception to that is USB 3.x must support USB 2.0, going forward though I would not be surprised if USB 2.0 becomes optional under USB 3.3 or something.
While USB 3.x and USB-PD are independent specs there is a trend for a host that supports USB 3.x to also support USB-PD.  Newer computers will have USB 2.0 "charge and data" ports built to include the USB-BC and/or USB-PD and therefore supply more power than any USB 3.0 port that doesn't support USB-PD or USB-BC.

If I plug in a USB 2.0 cable, I can still get up to 900 mA right?

Yes.

I have some devices that uses USB charging and outputs from 1A to 2A but I'm not sure if the cable provided is a factor or not since I'm just using a generic USB cable for this.

All USB cables built to spec will handle the current.  If you have some old USB 1.1 cables, or cables not built to spec (indicated by a lack of the USB trident icon on the cable ends) then they can be unreliable in making a connection.
Clear as mud now?
Answer: No, it can't because a USB 2.0 cable is different than a USB 3.0 cable, and both the cables have different outputs. For example, USB 2.0 delivers 500 mA and USB 3.0 delivers 900 mA.
Comment: The difference is more data wires. Power transmission isn't changed.


What is the definition of 'original'

Question: Original may be something like the first instance of an artifact. So an original hand-written letter may be the piece that carries the writer's ink. But,  what about a letter written on a computer? Is the original the electron configuration on the hard disk? How can the original be distinguished from a copy, in that case?
Comment: If you had a physical piece of paper with an original DaVinci sketch on it, dead center on the table before you, when all of a sudden a leprechaun appears, does a little jig, and poof! with a loud crack and a cloud of smoke, disappears, and when the smoke clears there are now two, absolutely, perfectly, down-to-the-sub-atomic-level identical sketches on the table, one on the left, one on the right, which one is the original? Is either? Is neither? I think this is the same situation as electronic copying, and there is no good, satisfying answer in any practical sense.
Comment: I'm voting to close this question as off-topic because it is more appropriate here: http://english.stackexchange.com
Comment: The question is philosophical, it just lacks sufficient philosophical context; adding the tag 'terminology' doesn't help.
Answer: You could look at Walter Benjamins essay The Work of art in the age of mechanical reproduction for context.
It's actually an old problem; for example lithography allows for prints, so which of these can one say is the original; are they all originals? Studios get by this problem by having a limited run of prints with each being signed to authenticate it.
In the digital realm this isn't going to work since copying is essential to it; to transfer a digital picture from this computer to that computer means to copy it from this computer to that computer, and then to delete the 'original'.
Comment: @JohnAm: ah, yes; you're right; I'll correct it.
Answer: I can't help but agree with Dan here. This going to entirely depend on your view on the matter and whether it is the atoms or not.
In your given situation though, my personal view is that the original version of the writing on the computer, is the initial thoughts in the writer's mind. Although saying that, you could potentially trace that back further and say that he has only written those things due to personal views and experiences, so are they the original concept for the idea?
As indicated already, I think the true definition of something original is something we hold personal, and will differ from matter to matter.

What is the definition of 'original'


How do I respond politely to a salesperson?

Question: When a sales assistant asks "Can I help you?", can I respond with "No, thanks" ?
Or are there more common ways of responding, instead of using "No, thanks" ?
Comment: In, say, an American department store, *no, thanks* or *no, thank you* are fine, as are *that's all right, thanks* or *I'm fine, thanks* or any of hundreds of other phrases. But this question is on the broad side: how to respond and whether or not to respond at all depends on where in the world you are and the the type of establishment you are in. In, say, a Marrakechi souk, the "best" response is to completely ignore the tout, as any kind of response will be taken as engagement and the first step on the long path to a purchase.
Answer: You can say: "I'm just looking, thanks."
Answer: You can use a positive sentence instead of a negative one. Examples are:

I'm fine, thank you.

or

I got it, thanks.

There are also responses that will signal to the salesperson that you will need their assistance soon:

Not at the moment, thanks.

If you are just browsing and not sure you want to buy anything you can say:

I'm just looking, thanks.

Those responses are more pleasant in my view, and they leave place to ask for help later.


Is it safe to share our published PCT Application with an Investor before entering the National Phase?

Question: Following our PCT application process, as we enter the National Phase next month, we have been approached by a large potential investor. In reviewing potential investment, the investor has asked to receive our current PCT application as it stands. Is it "safe" to send it to them in their process of reviewing the status of our company/merits of our app? Or could they take our PCT specifications and go on a "first to file" campaign because they have more resources? Or does our confirmed PCT documentation and National Phase process next month give us any lead time advantage/protection against them as we already have the PCT application done?
Answer: Sharing "PCT application as it stands" should be ok.
As you have already filed your specification with WIPO you have priority from date of first filing with patent office of your country or from filing date with WIPO for all 'National Phase' countries. So, first filing is not an issue.
Only thing, patent begets patents. If any idea strikes them to better your idea then possibility is, they can try for some uncovered areas or for improvement. Of course, you have recourse to continuation, division and revision of claims.
If assigning is your object, than don't worry much. Assignor will take care of things that follow.
Comment: Good answer if the application was not already published.
Answer: If you are at the 30 month national stage deadline you are obviously past the 18 month point where it was published for all to see. The content is available for anyone to read. Unless they do not know the name of an inventor or of the applicant they must be fairly naive about patents to have not looked it up on their own.
Comment: "Unless they do it know" is odd. Did you mean "Unless they do not know"?
Answer: You have to be transparent with your investor if he is planning to invest in your patent. You can make yourself safe by signing an agreement with the investor before disclosing the ideas of your patent to him and this will prevent him from using the idea without your permissions.


Color symmetries in variant QCD

Question: Suppose we only have two colors, for example, red (R) and blue (B) to construct the wave functions of baryons and mesons and that the color symmetry is SU (2) and not SU (3). In this situation, baryons would consist of systems bound quark and antiquark in a state of total neutral color. How can we determine the wave functions for baryons and for mesons if there is a color missing for baryons for example? Thank you.
Comment: Mesons would be quark-antiquark states; and baryons would be quark-quark ones with the two respective colors antisymmetrized, so with fractional charges, all else kept equal.  Colorwise, anti-color doublets will resemble colored ones, since the conjugate doublet rep of SU(2) is equivalent to the doublet itself, but the baryons would still have nonzero baryon number, however you'd define it. So, what's this stuff about baryons being quark-antiquark??
Comment: @Phys_BR  Anything made of an even number of fermions will be a boson, so baryons and mesons would both be bosons if the color symmetry were $SU(2)$.  To put the comment by Cosmas Zachos into a larger context: if the gauge group were $SU(N)$, then a baryon would be "made of" $N$ quarks, and an antibaryon would be "made of" $N$ antiquarks. It's a fermion if $N$ is odd, and a boson if $N$ is even.
Comment: Excuse me, but I think I made a mistake on this part of baryons being quarks and antiquarks. Just to understand the subject, in this case then for the availability of existing SU(2) colors, would baryons be fermions or bosons?
Answer: The snag in quark models is the baryon sector, where you need as many quarks in the state as colors, to get a color singlet antisymmetrizing them. So, N fermions for N colors, as @ChiralAnomaly reminds you.
So, for your 2 colors, your baryon is $\epsilon^{ab} q_a q_b=q_R q_B- q_B q_R $, hence now a boson (just as for all even - N color groups). The rest of the wave function will be spin-color symmetric, (with integral spin!), from Fermi statistics.  You'd be advised to assign your quarks baryon number 1/2, then.
Your mesons will be automatically color singlets, $\bar q^a q^a$, but here the antiquark will be in the conjugate representation of the fundamental of SU(2), here, exceptionally, basically the same rep as the quark, with the identical color structure. (The Young tableaux for the fundamental and anti fundamental are just a box, here... You'll never see this again.)   But, still, the baryon numbers of the mesons will be zero, so your won't have, e.g. a baryon decaying to two mesons...
Comment: I am a bit curious, what is the fundamental difference between the 2-color Bosonic hadron you described and a usual hydrogen atom (which is also a bound state of two fermions)? I understand the constituents of the above two cases are not the same. The question is about whether there is a tangible characteristic distinguishing them (one is confined and the other is separable?).
Comment: @MadMax Fundamental? Hard to define...  It might well depend on your focus. Confinement of the former is striking, and strong interactions would lead to bosonic nuclei, unprotected against Bose condensation, among other things...
Answer: I don't really think it's possible to have only two colors. The color symmetry of such particles consists of three colors, that's how the theory works.
Besides, how would you construct a symmetry with only two colors? Would the third color of baryons be a linear composition of the two colors?
Comment: With gauge group $SU(N)$, any combination of $N$ quarks that is completely antisymmetric in the color indices is color-neutral (that is, invariant under an $SU(N)$ transformation), because an $SU(N)$ matrix has unit determinant. This works for any $N$, including $N=2$.

Color symmetries in variant QCD


Troubles with Unicode string encoding in Android

Question: I get strings in different encodings (ID3 tags).
I use e.g. new String( bytes, "UTF-16LE" ) to decode them.
On my device (Motorola Milestone) and in the emulator, this works fine.
But some users complained they get results like "T i t l e   n a m e".
I've tried the Sun codepage names instead (e.g. "UnicodeBigUnmarked"), with the same result - works for me, not for the user. (Reported and tested on Samsung Galaxy, but according to Market comments, this doesn't seem to be the only device...)
Is there some alternative that works on all devices, like other codepage names or a convertion class? Or is it a bug in the runtime environment I can't work around?
Comment: What happens if you specify "UTF-16"?
Answer: if you want to know whether they have the Charset on their device, try getting them to download "Dalvik Explorer" from the Market, and check to see that the ones you need are actually available.
(do you know their ID3 tags are valid? do you know your parser is choosing the right encoding? i wrote my own ID3 tag parser because i couldn't find one that was correct.)


Linq query need correct sum

Question: I am using .NET 4 Data Visualization Charts and am using a Linq query to get the data for the chart. I am new to Linq so not sure on how to word this query. Here is what it does, I have the follwoing tables its pulling data from

Orders
ShipmentSchedule

The orders table has the Product that was ordered, the OrderId, the amount that was shipped and the remaining quantity for that order. One order can only have a single product in it. I am trying to get all the Ordershipments in the class OrderShipment, make a List<> for it and group it by each product and show the total quantity for each product that was ordered and what has been shipped. The query below sums up the quantity shipped for all orders which is correct but because it is making a list of OrderShipments, I want the remaining quantity for each order across all shipments and sum that up by the product. Right now its adding up the remaining quantity for all the shipments which is wrong since an Order has the same Remaining Quantity across all shipments.  how can I get the remaining quantity for each product so thw query adds up the Remaining quantity by each order correctly?? Please provide an example with code how to accomplish this if you have a suggestion, your helps really appreciated, thanks
 private class ChartDataPoint
    {
        public string ProductName { get; set; }
        public double QtyRemaining { get; set; }
        public double QtyShipped { get; set; }
    }

    private class OrderShipment
    {
        public string ProductName { get; set; }
        public double QuantityRemaining { get; set; }
        public double QuantityShipped { get; set; }
        public int OrderId { get; set; }
    }

      List<OrderShipment> productsOrdered =
          (from os in Statistics.OptimalShipments
           from o in Statistics.OrdersPlaced
           where ((os.Date >= Statistics.ShippingWindowStartDate) &&
                   (os.Date <= Statistics.ShippingWindowEndDate) &&
                   (os.OrderId == o.OrderId) &&
                  ((o.ClientLocationId == ClientLocation.ClientLocationId)))
           select new OrderShipment()
           {
               ProductName = o.Product.Name,
               QuantityRemaining = o.RemainingQuantity,
               QuantityShipped = os.QuantityShipped,

           }).ToList();

        var query = productsOrdered.GroupBy(p => p.ProductName);
        List<ChartDataPoint> chartDataPoints = new List<ChartDataPoint>();
        foreach (var productGroup in query)
        {
            chartDataPoints.Add(new ChartDataPoint()
            {
               ProductName = productGroup.Key,

               // This is obv wrong this sums up the Remaining quantity across
               // all shipments for a order when we should be only taking the
               //Remaining quantity once for each order across all shipments.
               QtyRemaining = productGroup.Sum(po => po.QuantityRemaining),
               QtyShipped = productGroup.Sum(po => po.QuantityShipped)
            });
        }

Answer: As I understand it your productGroup should have a lot of OrderShipment objects grouped by their product name. You then want to sum the QuantityShipped and the QuantityRemaining should all be the same and you want to just take this value?
If so then this should do you:
QtyRemaining = productGroup.First();

If I have misunderstood you may want to simplify the explanation, perhaps with an example...

Linq query need correct sum


Unnatural selection trophy in Red Dead Redemption?

Question: I want to get this trophy, and it says to kill one of every species in the game. I've looked at my stats and it says that I have killed at least one of all of the animals. But the trophy still hasn't been achieved? Any idea as to why this is?
Answer: There are different reports about which animals are required for this trophy (see here and here). So you could check if you really got every animal. One important thing is that you have to kill each enemy either in offline or in online mode. Killing for example 50% in each mode will not unlock the trophy.
Comment: Can i still get this trophy If I'm not actually playing online?
Comment: Of course. As I said either hunt the animals in offline OR online mode. So no problem achieving it when solely playing offline.


Force WP to use a certain search template

Question: Any way to do this? I'd like for all the search results to be run through wp advanced search ( https://github.com/growthspark/wp-advanced-search ) so they appear on the wp advanced search page template instead of the default way provided by my theme.
Comment: The code in question doesn't seem to come with template, just with instructions how to integrate it. Please elaborate on what code you have implemented already and what you have trouble achieving.
Answer: You can use template include filter to use it on every search request.
Let's assume the advanced search page template you are using is 'wp-advanced-search.php' you can use locate_template to get its path:
add_action('template_include', 'advanced_search_tmpl');

function advanced_search_tmpl( $template ) {
  if ( is_search() ) {
     $t = locate_template('wp-advanced-search.php', false);
     if ( ! empty($t) ) $template = $t;
  }
  return $template;
}

Comment: Don't we still have to change the query itself because if you run a search in wp advanced search it looks like this in the url `http://localhost:8888/wordpress/?page_id=1706&search_query=test&orderby=blankℴ=&wpas=1` but the regular search looks like `http://localhost:8888/wordpress/?s=test&submit=Search`
Comment: @Jagst3r15 you ask how to force to use a template, and I answered how to force to include a template. If you need the search offered by plugion, whay don't you use that plugin?


Curtain rod came off

Question:
What type of wall is it? I am new to this . How do i fix it and hang rod again. My curtains are heavy
Answer: This will require you to repair the area (similar to the repaired areas a few inches to the right of your current problem, which looks to be a previous issue identical to your current issue).
After repair, you will need to select and use appropriate hollow wall anchors, of which there are many types available depending on the weight and service of the material being attached. My presumption would be that either your curtains are heavy, or there is some other reason that the bracket was torn from the wall.
Use your Google-Fu to research different styles/types of anchors for different applications; there are just too many options to go into depth about here...
BTW, I have had good luck with these:

You will have the best luck if you are able to choose a new bracket location where you have some confidence that the wall is sound, rather than trying to anchor in a location where there was previous damage...
Comment: To be honest the damage is due to a bad installer using straight wood screws into drywall.  The inside of the wall shouldn't be damaged since it wasn't an anchor that got ripped out.  This specific damage can still handle an anchor fine, assuming it is all installed properly and the hole is drilled properly.
Answer: It's very difficult to get hardware to hold for long in drywall. I had this problem with my toilet paper holder. For a long time it was just kind of hanging off the wall a little, but because I didn't fix it, eventually it came off. I used a nice piece of stained wood to backplate the holder, fixing the wood to studs and then the tp holder to the wood. That looked OK for a bathroom toilet holder, but it might not be attractive on a window unless the curtains could hide the wood. Get a stud finder from a hardware store (they are cheap) and try to find a stud (sturdy wood behind the drywall) near where you need to anchor the window hardware. Screw into the stud instead of just drywall. Studs are usually 16" apart. Use drywall patch to fix the tear in the wall and then touch up the paint. Maybe you need to use more support brackets in the middle of the rod to take pressure off the main brackets.
Comment: Proper heavy duty drywall anchors like a toggle bolt can hold a lot.  Placing one down every 3 inches will easily hold some of the heavier furniture.

Curtain rod came off


Calculated field on mail

Question: I want to add some information on a mail which is in fact calculated based on existing fields. More specifically, I want to send a mail to all members with an expired membership. In the mail I want to add (what we call in Belgium) a structured message which is in my case "membershipID & (membershipID mod 97)". What is the best way to accomplish this?
Answer: You could create a custom token to do the calculation and use the token in your mail.  See eg https://wiki.civicrm.org/confluence/display/CRMDOC/Customized+%28and+Custom%29+Tokens

Calculated field on mail


Find a differential equation whose solutions are the circles $x^2+y^2=2ay$

Question: I had to find differential equation of the family of circles which touch the $x$-axis at origin. Centering the variable circle at $(0,a)$, its equation will be
$$x^2+y^2=2ay .$$
Solving conventionally by differentiating once and substituting the value of a in the equation of circle, the differential equation is
$$(x^2-y^2)y_1=2xy$$
Now I might be missing some concept because I've just started with ODE, but what is wrong with the following process? Differentiating the circle equation
$$x+yy_1=ay_1 ,$$ dividing both sides by $y_1$, and differentiating both sides gives the equation
$$y_1-xy_2+{y_1}^3=0 .$$
Does this not represent the family of circles? In that case the differential equations are of different orders.
Comment: If I understand your notation, you are writing $y_1$ for $y'=\frac{dy}{dx}$ and $y_2$ for $y'' = \frac{d^2y}{dx^2}$?
Comment: Yes you are right
Answer: Differentiating an equation in general discards information.
A first-order differential equation
$$\phantom{(\ast)} \qquad F(x, y, y_1) = 0 \qquad (\ast)$$
(with nice $F$) has a $1$-parameter family of solutions. And in the example in the question, this is exactly what we want to produce---a first-order differential equation whose solutions are precisely the given family of curves. This is exactly what we achieve when isolating $a$ as $$\frac{x^2}{2 y} + \frac{y}{2} = a$$ and differentiating w.r.t. $x$ to produce (after clearing denominators) a first-order o.d.e.
$$(x^2 - y^2) y_1 = 2 x y $$
that does not depend on $a$, that is, for which every equation $$x^2 + y^2 = 2 a y$$ is a solution.
Regardless of whether $F$ in $(\ast)$ depends on a parameter like $a$, however, differentiating $(\ast)$ gives a second-order o.d.e., $$\frac{d}{dx}F(x, y, y_1) = 0,$$ that is,
$$\phantom{(\ast\ast)} \qquad \frac{\partial F}{\partial x} + \frac{\partial F}{\partial y} y_1 + \frac{\partial F}{\partial y_1} y_2 =0 \qquad (\ast\ast)$$
which (again under nice conditions) has a $2$-parameter family of solutions. So, many---in a sense that can be made precise, most---solutions of $(\ast\ast)$ are not solutions of $(\ast)$. So, in general producing a second-order equation---if you like, differentiating twice---means we have produced a differential equation with too many solutions to satisfy our original prescription.
As a toy example if we want to find a differential equation whose solutions are (all) the horizontal lines $$y = c ,$$ the parameter $c$ is already isolated, and differentiating gives the desired equation $(\ast)$: $$y_1 = 0 .$$ But differentiating again gives $y_2 = 0$ (our $(\ast\ast)$), whose solutions are precisely the affine functions, $$y(x) = a x + b .$$ In particular, the solutions of $(\ast\ast)$ with $a \neq 0$ are not solutions of the original differential equation $(\ast)$.
Answer: It's not so much that the two equations are of different orders.  We could differentiate both sides of the first equation and get a second-order equation.  The difference is that you have treated $a$ differently in the two processes.
In the first, $a$ is a parameter which depends on $x$ and $y$ (Each point on the plane, other than the origin, is on exactly one circle tangent to the $x$-axis at the origin).  In the second, you're treating $a$ like a constant.
If you solve the second equation (before you differentiate a second time) by separating variables, you get
\begin{align*}
    \frac{x}{y'} + y &= a \\
\implies
    x &= (a-y) y' \\
\implies
    x \,dx &= (a-y)\,dy \\
\implies
    x^2 &= -(a-y)^2 + C \\
\implies
    x^2 + (a-y)^2 &= C
\end{align*}
So for each $a$, the family of solutions is the set of circles centered at $(0,a)$.  That's quite different from the family of circles tangent to the $x$-axis at $(0,0)$.
Comment: So the order two differential equation I got at the end is invalid ?
Comment: Like Yves says, if you differentiate twice, the solution set is a two-parameter family, also not what you want.
Comment: Sorry, this answer is simply wrong.  Not every circle centered at $(0,a)$ for some value of $a$ touches the $x$ axis at the origin.
Comment: That's my point.  OP asked what was wrong with his proposed solution, and I wanted to point out that it doesn't solve the problem he was asked.  I'll edit the answer to underscore.
Answer: An ODE of order $n$ has a solution with $n$ independent parameters. So your second equation represents a double family of circles, not just the given one (you might differentiate once again, and describe a triple family…).

For a quick solution, write
$$\frac{x^2+y^2}{2x}=a$$ and differentiate, giving
$$(2x+2yy')2x-(x^2+y^2)2=0$$ (denominator omitted).
Answer: $$
x^2+y^2 = 2ay
$$
Take the derivative wrt. $x$
$$
2x + 2yy' = 2ay' \implies y' = \frac{x}{a-y}
$$
This will have one constant too many; eliminate that by eliminating $a$ using
$$
x^2+y^2 = 2ay \implies a = \frac{x^2+y^2}{2y}
$$
So
$$
y' = \frac{x}{a-y} = \frac{x}{\frac{x^2+y^2}{2y}-y} = \frac{2xy}{(x^2+y^2)-2y^2}
$$

$$
y' =\frac{2xy}{x^2-y^2}
$$

As a check, note that when $y = \pm x$ the slope $y'$ is infinite, as woould be expected since a $45^\circ$ line from the origin intersects the circle at a place where the tangent is vertical.


Is it possible to use the laptop's audio via headphone jack and Bluetooth speakers at the same time?

Question: Lolo Joe wants earphone jack to plug and use big speakers but at the same time he wants to partner the music coming out the earphone jack and his Bluetooth system and speakers. Is it even possible to use the earplug connection and the Bluetooth system and devices at the same time?
Answer: Yes.
You can do this by aggregating your audio devices.
This is a function that is built into macOS; you don't need to purchase or install any additional software.
Under MIDI Audio Setup (under Applications -> Utilities), you create a new "virtual" device that aggregates audio devices:

While the pictures posted are for an input device, you can do this with output devices as well; Bluetooth, USB, and physical.
Once you create your aggregated output device of both the speakers and BT speakers, you set your application to use that device and sound will play from both devices.


Relation between wavenumber and propagation constant

Question: What is the exact difference between wavenumber and propagation constant in an electromagnetic wave propagating in a medium such as a transmission line, cause i am a bit confused. Does it have to do with loss in the medium?
Comment: Did you check Wikipedia? http://en.wikipedia.org/wiki/Wavenumber and http://en.wikipedia.org/wiki/Propagation_constant
Answer: Here is the consensus for microwave engineering. Other fields of science may vary.
$\newcommand{\j}{{\rm{j}}}$$\newcommand{\e}[1]{\,{\rm{e}}^{#1}}$
It was shown by Hertz that an arbitrary electromagnetic field in a source free homogeneous linear isotropic medium can be defined in terms of a single vector potential $\vec{\Pi}$.
Assuming $\e{\,\j\omega t}$ time dependency, a wave in the Hertz vector potential field can be written as:
$$\vec{\Pi}(x) = \vec{\Pi}(0) \e{-\gamma x}$$
The propagation constant $\gamma$ is a complex quantity:
$$\gamma = \alpha + \j\beta$$
where
$\alpha$ is the attenuation constant, and
$\beta$ is the phase constant.
However, since the attenuation in an air medium is negligible, it is customary to write the wave equation solely in function of a complex phase constant $\beta$:
$$\vec{\Pi}(x) = \vec{\Pi}(0) \e{-\j\beta x}$$
where $\beta = \beta' -\j \beta''$,
such that $\gamma \equiv \j \beta = \j (\beta' -\j \beta'') = \beta'' + \j \beta' \Rightarrow \beta'' \equiv \alpha$.
The free space angular wave number $k_0$ is defined as:
$$k_0 \equiv \frac{\omega}{c_0} = \frac{2\pi}{\lambda_0}$$
The unit is $\frac{\text{rad}}{\text{m}}$
Only for TEM waves:
$$\beta = k_0 = \frac{2\pi}{\lambda_0}$$
Whereas for TE and TM waves, separation of variables in a Helmholtz equation results in a transcendental dispersion function that needs to be solved involving the free space wave number $k_0$ and a transverse wave number $\tau$.
In such cases,
$$\tau^2 = -\left(\gamma^2 + {k_0}^2\right) = \beta^2 - {k_0}^2$$
$$\Rightarrow \beta = \sqrt{{k_0}^2 + \tau^2}$$
Some worked out examples for EM surface waves can be found here.
Answer: See "Mathematical descriptions of opacity", Wikipedia.
The propagation constant has a real and an imaginary part. One of those is equal to the angular wavenumber, the other is proportional to the absorption coefficient.
Which is which (which is the real part and which is the imaginary part) depends on what definition you're using for the term "propagation constant". There is more than one definition in common use.
Answer: The attenuation constant is specifically the imaginary part of the wave number (ki), while the wave number in dissipative media is the real part of the wave number (kr). Let me know what you think, because I just started studying this.
Comment: This answer is very unclear. What does "the wave number in dissipative media is the real part of the wave number" mean?


Save a deque in a text file

Question: I am writing a crawler in Python, in order to make Ctrl+C not to cause my crawler to start over in next run, I need to save the processing deque in a text file (one item per line) and update it every iteration, the update operation needs to be super fast. In order not to reinvent the wheel, I am asking if there is an established module to do this?
Answer: As an alternative, you could set up an exit function, and pickle the deque on exit.
Exit function
Pickle
Answer: You should be able to use pickle to serialize your lists.
Answer: I am not sure if I understood the question right, I am just curious, so here are few questions and suggestions:
Are you planning to catch the Ctrl+C interrupt and do the deque?
What happens if the crawler crashes for some arbitrary reason like an unhandled exception or crash? You loose the queue status and start over again?
from the documentation:

Note
The exit function is not called when
  the program is killed by a signal,
  when a Python fatal internal error is
  detected, or when os._exit() is
  called.

What happens when you happen to visit the same URI again, are you maintaining a visited list or something?
I think you should be maintaining some kind of visit and session information / status for each URI you crawl.
You can use the visit information to decide to crawl a URI or not  when you visit the same URI next time.
The other info - session information - for the last session with that URI will help in picking  up only the incremental stuff and if the page is not change no need to pick it up saving some db I/O costs, duplicates, etc.
That way you won't have to worry about the ctrl+C or a crash. If the crawler goes down for any reason, lets say after crawling 60K posts when 40K more were left, the next time crawler fills in the queue, though the queue may be huge but the crawler can check if the it has already visited the URI or not and what was the state of the page when it was crawled - optimization - does the page requires a new pick up coz it has changed or not.
I hope that is of some help.
Comment: As I've tested, atexit registered function gets called in both cases of CTRL+C and unhandled exceptions, and I have figured out that visited set also needs to be pickled in order to restore program state. Your advice is helpful, thank you very much.
Answer: Some things that come to my mind:

leave the file handle open (don't close the file everytime you wrote something)
or write the file every n items and catch a close signal to write the current non-written items

Save a deque in a text file


UHF band repeater

Question: I want to make a device which gets the TV antenna signals and transmits it again.  Is there any module available in market which simplifies construction or i should make from scratch? Since my background is in software, please explain simple.
Comment: I'm voting to close this question as off-topic because such a device is illegal.
Comment: Transmit at same frequency or a different frequency and, what power output?
Comment: Encouraging an illegal act is generally illegal.
Comment: @LeonHeller I can't see any correlation between on-topicness and legality.
Comment: @LeonHeller nothing encouraging about answering this question. Still, legality != on-topicness. Also, pretty sure that answering a question is covered by free speech, and also, not anyone's job to censor knowledge of how things can be done, and also, what's illegal encouragement is subject to individual *jurisdiction*; and as far as I can tell, neither of us is a judge,
Comment: He says he wants to make such a device.
Comment: and I say I'm not encouraging him if I explain why that's hard. Seriously, don't self-censor engineers.
Comment: Also note that it's only illegal for where *you* or *I* are, @LeonHeller, and not for OP, per se, and even so only iff ehsan decides to forward that TV on a licensed band. If he builds a local legislature-compatible transverter, I don't see the slightest legal problem. I don't know OP's legislation, and neither do you. I'm not a fan of people crowding spectrum, but this is a legit question and shouldn't be closed just because you feel it *might* or *should* be illegal *where you are*.
Comment: @LeonHeller: Such a device is not illegal in most jurisdictions, but it would need to be licensed. Indeed, they are quite common in mountainous rural areas where receiving signals directly is impossible.
Comment: @LeonHeller Given the OP's likely location the assessment ion of 'legaility' **may** need to include the validity and actions of the state. Are you an unquestioning  supporter of all oppressive regimes or do you feel that local circumstances MAY have some relevance. Or may not.
Answer: What you describe definitely contains an amplifier; small-amplitude signals go in, high-amplitude signals go out.
Now for problems:

If you're on the same frequency as the received signal, your amplified signal will interfere with the received, weak signal. Hence, same-frequency forwarding can only work if the "end receiver" only gets one of the two signals, not a combination of both. For cable TV, that is the case, so that's why you can get very cheap UHF amplifiers. For antenna TV, that's not the case, so you can't have same frequency relaying.
If you need to change the frequency while relaying, you need what is often called a transverter: The received signal is pre-amplified, mixed with a single tone that shifts everything in frequency, and transmitted through a power amplifier. This is significantly more complex.

In either case, you'll need proper input and output filters (which will be very complex, considering the TV spectrum isn't necessarily one continuous block) and you will be operating illegally, with a device that, per definition of what it does, is easy to find. I don't know where you live, but I don't think there's any place on earth I'd do this.
Regarding the question of building such a device yourself:
Well, it's certainly not a starter project for electronics beginners; TV signals, even the ones that "look bad on screen" are sent with relatively high power by the "official" TV towers, compared to the powers that e.g. are in the cell phone signals that reach your telephone. So this will  be a challenge in amplification, testing, power supply, filtering, mixing, tone generation and general RF design, which is a discipline on its own.
Comment: The idea of making such device is in my home the Tv should be near the antenna plug that limits me for proper tv place. I wanted this device to connect to antenna plug and the other receiver to the TV _Av in_ port
Comment: um, use a longer cable?
Comment: It is neater solution to be cable-less!
Comment: no, in this situation, I'd disagree.
Comment: If you're just trying to distribute TV within your house, there are commercial products designed specifically to do this.

UHF band repeater


Anchor element becoming display:block in HTML5 instead of display:inline with cufon

Question: I got  elements that are display:inline in html4 and page displays fine (like I want it to).
Now I am updating my page with new html5 and as a result following cufon link becomes display:block instead of display:inline, which is not desired by me.

I would like them to remain inline though because since they are display:block now they are centered according to their total height, and when link is underscored for example it aligns vertically and looks not like links in the same row which don't have underscore for example.
I wonder what can be done to either remain inline or to stop from that vertical centered alignment. Just to be clear I want my text to have fixed top, regardless of [letter + underscore].[actual height].
UPDATE I actually was able to get rid of such behaviour. I have no idea what has really helped, I noticed that on some pages same links were displayed as inline actually, and that page was referencing a smallish additional css. I added a css reference on buggy page and it worked. However I cannot see anything in that CSS that I can consider to be the reason of a fix.
basicly all it has which is relevant to part of html in question is this:
body, html, form
{
    display:block;
    list-style:none;
    text-align:left;
}

Since theres already a bounty Ill go ahead and change question a little: I wonder how this helped. Or what is going on actually with this  and cufon here. Im puzzled a little.
Answer: Add a display:inline !important to proper tag.


Adding a Step to the One Page Checkout

Question: Are there any extensions, open-source Magento modules, or tutorials that make adding a step to the one page checkout any easier?  I've poked at the core code for this a few times and it seems like there's a lot of hard coded step information.
Comment: Unfortunately the Checkout code doesn't seem to be very flexible, a lot of the information is hardcoded from templates to the javascript accordion files.
Comment: I've followed this tutorial and was able to add a new step in onepage checkout. Anyway lots of core files need to be override to achieve this step. Hope this will helpful http://excellencemagentoblog.com/magento-onestep-checkout-add-step
Answer: The short answer to this question ended up being "No".  From a high level, adding a new checkout step meant

Adding a new Block to the one step checkout page
Having that block register itself as a step
Connect that block with a prototype object that handled all interactions
Rewriting several core Magento methods to insert the block as a step
Some ajax trickery to get the progress stuff working.

Covering this in total is beyond the scope of a single Stack Overflow question. The tutorial linked in another question has a lot of what you'll need, and I also created a new commercial extension to make all this easier.
Answer: By default magento gives some checkout steps. But Sometime you need to add extra information from the customer for future reference. A common requested customization is to add the Custom Form in default checkout process.
This is not good practice to touch core files. You can do this via overriding Modules.
In this example Comapnyname is Ipragmatech and Module name is Checkoutstep.
Step1: Add Custom step in the checkout process
Open the Ipragmatech > Checkoutstep > Block > Onepage> Checkoutstep.php file and write the following code
<code>    class Ipragmatech_Checkoutstep_Block_Onepage_Checkoutstep extends Mage_Checkout_Block_Onepage_Abstract
    {
       protected function _construct()
       {
          $this->getCheckout()->setStepData('checkoutstep', array(
          'label'     => Mage::helper('checkout')->__('Invitation to participation'),
          'is_show'   => true
        ));
        parent::_construct();
       }
     }
</code>
Step2: Add steps which and where you want in the checkout process
Open the Ipragmatech > Checkoutstep > Block > Onepage> Checkoutstep.php file and write the following code
<code>    class Ipragmatech_Checkoutstep_Block_Onepage extends Mage_Checkout_Block_Onepage
    {
      public function getSteps()
      {
             $steps = array();

             if (!$this->isCustomerLoggedIn()) {
                $steps['login'] = $this->getCheckout()->getStepData('login');
             }

            $stepCodes = array('billing', 'shipping', 'shipping_method', 'payment', 'checkoutstep', 'review');
         foreach ($stepCodes as $step) {
             $steps[$step] = $this->getCheckout()->getStepData($step);
          }

    return $steps;
   }
}
</code>
Step3: Grab the submitted value of custom form and set the values of Custom form
Open the ipragmatech > Checkoutstep > controllers > OnepageController.php and write the following fucntion
<code>    public function saveCheckoutstepAction()
    {
      $this->_expireAjax();
      if ($this->getRequest()->isPost()) {

     //Grab the submited value
     $_entrant_name = $this->getRequest()->getPost('entrant_name',"");
     $_entrant_phone = $this->getRequest()->getPost('entrant_phone',"");
     $_entrant_email = $this->getRequest()->getPost('entrant_email',"");
     $_permanent_address = $this->getRequest() ->getPost('permanent_address',"");
     $_address = $this->getRequest()->getPost('local_address',"");

     Mage::getSingleton('core/session') ->setIpragmatechCheckoutstep(serialize(array(
    'entrant_name' =>$_entrant_name,
    'entrant_phone' =>$_entrant_phone,
    'entrant_email' =>$_entrant_email,
    'permanent_address' =>$_permanent_address,
    'address' =>$_address
     )));

    $result = array();
    $redirectUrl = $this->getOnePage()->getQuote()->getPayment() ->getCheckoutRedirectUrl();
        if (!$redirectUrl) {
            $this->loadLayout('checkout_onepage_review');
            $result['goto_section'] = 'review';
            $result['update_section'] = array(
                'name' => 'review',
                'html' => $this->_getReviewHtml()
            );

        }

        if ($redirectUrl) {
            $result['redirect'] = $redirectUrl;
        }

        $this->getResponse()->setBody(Zend_Json::encode($result));
    }
}
</code>
Step4: Save Custom Form information
When checkout_onepage_controller_success_action
event hook is called. Open the Ipragmatech > Checkoutstep > Model >Observer.php and write the following
<code>    class Ipragmatech_Checkoutstep_Model_Observer {
      const ORDER_ATTRIBUTE_FHC_ID = 'checkoutstep';
      public function hookToOrderSaveEvent() {
      if (Mage::helper('checkoutstep')->isEnabled()) {
         $order = new Mage_Sales_Model_Order ();
         $incrementId = Mage::getSingleton ( 'checkout/session' )->getLastRealOrderId ();
         $order->loadByIncrementId ( $incrementId );

       // Fetch the data
       $_checkoutstep_data = null;
       $_checkoutstep_data = Mage::getSingleton ( 'core/session' )->getIpragmatechCheckoutstep ();
       $model = Mage::getModel ( 'checkoutstep/customerdata' )->setData ( unserialize ( $_checkoutstep_data ) );
       $model->setData ( "order_id",$order["entity_id"] );
       try {
           $insertId = $model->save ()->getId ();
             Mage::log ( "Data successfully inserted. Insert ID: " . $insertId, null, 'mylog.log');
        } catch ( Exception $e ) {
            Mage::log ( "EXCEPTION " . $e->getMessage (), null, 'mylog.log' );
          }
        }
    }
</code>
}
Magento – Add Custom Form in Checkout Extension is a complete solution to add extra step in Checkout process for your ecommerce website. It allow admin to export data from custom table in CSV format.
Visit the link to get this free extension http://www.magentocommerce.com/magento-connect/custom-form-in-checkout.html
Answer: yes there is a good tutorial about this here "http://excellencemagentoblog.com/magento-onestep-checkout-add-step"
Comment: I agree with you, the explanation in the link is wonderful, but take a look at how the answers should be on SO websites: http://meta.stackexchange.com/a/8259/224252 and this: http://magento.stackexchange.com/help/how-to-answer
Comment: You should explain a little what is found at the end of that url. Single link answers are not the best answers.
Comment: the url itself says magento-onestep-checkout-add-step and this is what the question is asking for.

Adding a Step to the One Page Checkout


Can i ask a question about the correctness of a tab being transcribed by me

Question: I'm trying to train my ear by transcribing/tabbing parts of a song. can i ask about the correctness of the tab i wrote ?
Answer: If you are asking us to review tabs you have created for correctness, that is out of scope for this site. It is effectively proof reading.
If you are having problems working out how to transcribe music into tablature, then questions on that topic can be in scope, eg 'how would I transcribe into tab a piece of music where I have a low B slide up to middle C at the same time as a pick slide from 22nd fret to the nut'
Comment: To explain further why it's out of scope: Such a question would never be useful to any other person.  Questions can be specific, but they need to be worth keeping on the site.
Comment: Programmers have a Code Review SE site. Maybe musicians could have a Score Review site someday.
Answer: While your entire work would be out of scope, asking about specific problems in notating that you have are in scope I believe.  So for example asking how to notate a glissando, a tapped harmonic or whammy bar dive would be on topic because others may come across the same problem.