Sums $\sum_{k=1}^n \sin(2k-1)\theta$, $\sum_{k=1}^n \sin^2(2k-1)\theta $

Question: To prove:
$1.$ $$\sum_{k=1}^n \sin(2k-1)\theta = \frac{\sin^2 n\theta}{\sin \theta}.$$
$2.$ $$\sum_{k=1}^n \sin^2(2k-1)\theta = \frac{n}{2} - \frac{\sin 4n\theta}{4\sin 2\theta}.$$
Comment: Related : http://math.stackexchange.com/questions/17966/how-can-we-sum-up-sin-and-cos-series-when-the-angles-are-in-arithmetic-pro
Answer: They become easy (sums of geometric progressions) if you use
$$\sin(x)=\frac{e^{ix}-e^{-ix}}{2i}$$
and
$$\cos(x)=\frac{e^{ix}+e^{-ix}}{2}.$$
When $\sin$ and $\cos$ are replaced in this way by rational functions in $e^{ix}$, you can then replace $e^{ix}$ by $z$ and then many trigonometric identities become either polynomial identities or identities between power series.
If the equality is between rational functions in $\sin(x)$ and $\cos(x)$ then the above substitutions will give you an equality between rational functions. Clearing denominators it becomes an identity between polynomials. This can be checked just by writing the polynomials in the standard form (sums of powers of $z$). This turns the solution into an algorithm.
For example:
$$\cos(2x)=\cos^2(x)-\sin^2(x)$$
It turns into
$$\frac{z^2+z^{-2}}{2}=\left(\frac{z+z^{-1}}{2}\right)^2+\left(\frac{z-z^{-1}}{2i}\right)^2$$
Opening parenthesis, bringing all to one side, and writing as sum of powers of $z$ we get $$0z^4+0z^3+0z^2+0z+0=0.$$
In this problem you get sums of progressions with hypergeometric terms. The sum of which can also be determined algorithmically, whenever there is a nice sum.
Comment: @N.S. The role of doing plane geometry, cracking trigonometry the hard way, etc. is not only teaching them those topics. It is also to develop deductive skills. But yes, most of the problems they will be solving belong to the problems a computer can solve.
Comment: This really is the proper way to answer these types of questions.  The product formula used in other answers is just a hidden application of the exponential definition, and the exponential definition solves a much wider collection of problems.  It really is the method competition takers should get very familiar with.
Comment: @ex0du5 "The ultimate goal in mathematics is to eliminate any need for intelligent thought" Whitehead. I usually favor the way that allows to solve more problems without thinking.
Comment: @PeterTamaroff: I didn't mean to imply your solution was more difficult.  However, I do consider the exponential formulae much deeper.  They directly follow from the bisection formula of Simpson for series, immediately giving the parity of the functions.  The sum formulae follow directly from the orthogonality of the exponential, and the product are simple (matrix) inversion.  Getting good at the exponential orthogonality gets you tons of nontrigonometric series, integrals, etc. and is useful in physics and other applied fields.
Comment: @PeterTamaroff: And I don't just say this theoretically.  When I first started playing with exponentials like this, my skills across the spectrum just took off.  Very quickly, I was deriving my own q-series and hypergeometric series identities using the exact same skills.  They are that fundamental and useful.  Now, many wouldn't get as excited manipulating exponentials and series as I did and may not have the same results, but learning the skills is far more important than the specialized sum identities of trigonometrics in the field of competitions considered here too.
Comment: @N.S. Most IMO geometry problems can be solved by a computer. This is a well known application of Groebner bases. Also many of those sums of binomial coefficients and other hypergeometric terms too, although those are being less used in IMO than geometry. Complex analysis (i.e. derivatives and limits) is not necessary. You just have to be clever. Most IMO contestants know inversion. Inversion is just complex multiplication (actually division) in disguise. Complex numbers arithmetic is as elementary as inversion in geometry. The fact that it might be seen as more advanced or something is just a
Comment: ... historical handicap that comes from the mystic shadow they have been carrying since their introduction to solve the cubic equations in radicals.
Comment: @ex0du5 I disagree. One can define the trigonometric functions independently of the exponential function. It seems you're implying the identities in my answer are somehow obscure, but the trigonometric functions can be defined axiomatically with very few properties, a fundamental one being $$\cos(x+y)=\cos x\cos y-\sin x\sin y$$
Comment: (And I disagree even more with the initial phrase "...is the proper way". You're simply stating your opinion, but it comes off as if you're claiming some to posses some absolute truth.)
Comment: @PeterTamaroff I don't think s/he is implying your identities are obscure. And while you could define trigonometric functions without the exponential function, why would you want to? It's clearer and more elegant to do it with $e^{ix}$ if you're going to be doing it rigorously.
Comment: @Potato Because the trigonometric functions have their own flavour.  I don't think they should be seen as appendage of the exponential function. They can be defined over the real numbers very nicely, while the connection to the exponential function pops up with complex numbers. (And still, how would you define $e^{ix}$?)
Comment: @PeterTamaroff One of their fundamental properties is being an "appendage of" the exponential functional. There's really no reason to hide that. Perhaps for kids who are just being introduced to them via triangles, but for people who want a rigorous treatment or people doing contest math? That seems absurd to me.
Comment: @Potato Since I see we will get nowhere, I will not keep discussing this.
Comment: @PeterTamaroff Oh, I'm not trying to rile you up! This is just a view I haven't encountered before.
Comment: @PeterTamaroff (And to answer the question, you define $e^{ix}$ through power series, of course!)
Comment: @Potato Oh, well, but using power series is already "non-elementary", to my taste. Sometimes I find axiomatic approaches more appealing than constructive ones, the case of the trigonometric functions being one.
Comment: @ex0du5 I think both approaches have their upsides and downsides. But, of course, using $e^{ix}$ has tons of advantages in the practice. I agree. I just disagree with the idea that because one provides practical ease it should overrun other theoretical approaches which are also very enlightening. I think conformism and ease are not currency in mathematics.
Comment: I've been teaching some geometry to some high schools students and of course trig poped all over the place. Now I just found out that I was doing the wrong thing, I needed to wait until the learn complex Analysis to do that, since basic geometry is not really the proper way to introduce trigs.
Comment: @N.S. No one said that!
Comment: @N.S. Also, if you really want, the identities with complex numbers are purely geometrical. You just need to introduce, together with addition, which is easily seen as translation, rotation and inversion as a form of multiplication. The thing is that traditionally, books and school programs are written following a 'historicist' order. Roughly speaking, people find taboo teaching younger ages what was invented later in history, even if it makes more sense.
Comment: @RGB I really want to see a computer solving IMO type problems...And unless I teach them complex analysis, the exp/trig identities make absolutely no sense, they are actually very artificial. And I don't think we should teach young kids which are really interested in math "those formulas hold because I said so"....
Answer: Alternatively, from $\cos(a+b)=\cos a\cos b-\sin a\sin b$ we get $$\sin a\sin b=\frac{\cos(b-a)-\cos(b+a)}2$$
Giving appropriate values to $a,b$, obtain a telescopical sum on the left.
Let $a=x,b=(2k-1)x$. Then $$\eqalign{
  & \sin x\sin \left( {2k - 1} \right)x = \frac{{\cos (2k - 2)x - \cos 2kx}}{2}  \cr
  & \sin x\sum\limits_{k = 1}^n {\sin \left( {2k - 1} \right)x}  = \frac{{1 - \cos 2nx}}{2} \cr} $$
so $$\sum\limits_{k = 1}^n {\sin \left( {2k - 1} \right)x}  = \frac{{{{\sin }^2}nx}}{{\sin x}}$$
For the second one, note that $${\sin ^2}(2k - 1)\theta  = \frac{{1 - \cos \left( {2k - 1} \right)2\theta }}{2}$$ so it suffices to find $$\sum\limits_{k = 1}^n {\cos \left( {2k - 1} \right)x} $$
And again, we can use $$\frac{{\sin \left( {a + b} \right) - \sin \left( {a - b} \right)}}{2} = \sin b\cos a$$ to get $$\sin x\cos \left( {2k - 1} \right)x = \frac{{\sin 2kx - \sin \left( {2k - 2} \right)x}}{2}$$ $$\sum\limits_{k = 1}^n {\cos \left( {2k - 1} \right)x}  = \frac{{\sin 2nx}}{{2\sin x}}$$
so $$\sum\limits_{k = 1}^n {{{\sin }^2}(2k - 1)x}  = \frac{n}{2} - \frac{{\sin 4nx}}{{4\sin 2x}}$$
ADD Note that above gives $$\sum\limits_{k = 0}^{n - 1} {\frac{{\sin \left( {k + \frac{1}{2}} \right)t}}{{\sin \frac{t}{2}}}}  = {\left( {\frac{{\sin \frac{{nt}}{2}}}{{\sin \frac{t}{2}}}} \right)^2}$$ which is fundamental when computing the Fejér Kernel as the Cesaro mean of the Dirichlet Kernel.


Page body content updated only after second load

Question: I want to programmatically update the HTML contents of a page (a node of bundle type 'page') on my Drupal 7 site, by doing the following:
function my_page_generate() {
   // Find and load the page I want to update (can't do it by nid since
   // it might differ)
   $query = new EntityFieldQuery();
   $entities = $query->entityCondition('entity_type', 'node')
   ->propertyCondition('type', 'page')
   ->propertyCondition('title', 'Last News')
   ->propertyCondition('status', 1)
   ->execute();
   $node_key = array_keys($entities['node']);
   $node = node_load($node_key[0]);

   //Update its HTML contents
   $node->body[LANGUAGE_NONE][0]['format'] = 'full_html';
   $node->body[LANGUAGE_NONE][0]['value'] = '
 BREAKING NEWS
';

   node_save($node);

   return node_view($node, 'full');
}

This method is called when requesting a URL by using the hook_menu hook, like this:
function my_module_menu() {
   $items = array();
   $items['last-news'] = array(
    'title' => 'Last News',
    'page callback' => 'my_page_generate',
    'menu_name' => 'main-menu',
   );

   return $items;
}

However, when I navigate to /last-news on my site, the old contents of the page are displayed. If then I reload the same page again (using the same path), the new contents I created show up. I have tried to disable the page cache for this page by calling $GLOBALS['conf']['cache'] = FALSE, but it keeps showing the same behavior.
Any ideas how to solve this?
Answer: Check http://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook_node_view/7
You should clear cache programmatically if you want to use current solution or just load node again (http://api.drupal.org/api/drupal/modules!node!node.module/function/node_load/7) after save.
Third argument of node_load must be true
Comment: Thank you, loading the node again using node_load after saving it fixed it.


Comparisons of Conditional Expectations

Question: Suppose $X_1,X_2,...,X_m$ are $m$ independent random variables. Let $L(k)$ be the $k$ largest random variables among them. Do we always have $$E[X_i\mid X_i \in L(k)]\ge E[X_i\mid X_i \not \in L(k)]?$$
Comment: Why do you think this is false?
Comment: I believe it is true, but I can prove it only for the i.i.d. case.
Comment: Fanqi, I am unsure if you are using the basic definition of conditional expectation or the sigma-algebra definition, but since the event $\{X_i \in L(k)\}$ has positive measure, both definitions reduce to the classic/basic one and the exercise is quite easy and the answer below applies.
Comment: @WillM. What is the point of your comment? It comes across as trivializing OP's question, which is not needed at best and rude at worst.
Comment: @MikeEarnest con can it possibly be trivialising or be construed as rude? When I learned conditional expectation, I was unable to "click" that the basic definition coincided with the sigma-algebra one until far later in my doctorate (i.e. for 5 years or so I thought the two of them as parallel without much connection beyond intuition). So, maybe OP has a similar difficulty. Anyway, I cannot possibly understand how my comment is either rude or trivialising, maybe you are projecting your own insecurities?
Answer: Let $Y$ denote the $k^\text{th}$ largest value among all of the variables except for $X_i$. Then $E[X_i\mid X_i\in L(k)]=E[X_i\mid X_i\ge Y]$, where $X_i$ and $Y$ are independent. Therefore, your question is equivalent to:

If $X$ and $Y$ are independent, is $E[X\mid X\ge Y]\ge E[X\mid X<Y]$?

Obviously, this is true when $Y$ is deterministically equal to the real number $y$, since $E[X\mid X\ge y]\ge y\ge E[X\mid X<y]$. Therefore, it is true when you average over $y$ according to the distribution of $Y$.
To add some more detail, letting $f(y)$ be the pdf of $Y$, then
$$
E[X\mid X\ge Y]=\int E[X\mid X\ge y]f(y)\,dy\ge \int E[X\mid X<y]f(y)\,dy = E[X\mid X<Y]
$$
Comment: If $Y$ is the $k$th-largest largest one other than $X_i,$ then the event that $X_i$ is one of the $k$ largest ones is the event that $X_i>Y$ (in which case $Y$ is the $(k+1)$th-largest), not $X_i\ge Y. \qquad$
Comment: @MichaelHardy Let $k=2,i=1$, and consider $(X_1,X_2,X_3,X_4)=(2,1,2,3)$. Here, $X_1$ is not greater than the second largest of $\{X_2,X_3,X_4\}$, so according to your comment, the event that $X_1$ is one of the largest two values has not occurred. I say this event has occurred, since $X_1=2$, and the set of two largest values is $\{1,2\}$.

Comparisons of Conditional Expectations


Swift Avplayer - Stop all other tableviewcells from playing, when 'Play' is tapped

Question: My home page is a table view and each cell has a play button (when clicked an AVAudioPlayer instance is created). The problem is I can click Play on multiple cells and they will all play simultaneously. I am trying to figure out how to pause the other cells when any Play button is clicked.
Here is my play button code from my TableViewCell file:
@IBAction func playButtonTapped(_ sender: UIButton) {

    if self.audioPlayer != nil {
        if self.audioPlayer.isPlaying {
            self.audioPlayer.pause()
            self.playbutton.setImage(#imageLiteral(resourceName: "bluePlay"), for: .normal)
        }
        else {
            self.audioPlayer.play()
            self.playbutton.setImage(#imageLiteral(resourceName: "bluePause"), for: .normal)
        }
        return
    }
    do {
        self.audioPlayer = try AVAudioPlayer(data: self.audioFile!)
        self.audioPlayer.prepareToPlay()
        self.audioPlayer.delegate = self as? AVAudioPlayerDelegate
        self.audioPlayer.play()
        self.playbutton.setImage(#imageLiteral(resourceName: "bluePause"), for: .normal)

        let audioSession = AVAudioSession.sharedInstance()
        do {
            try audioSession.overrideOutputAudioPort(AVAudioSession.PortOverride.speaker)
        } catch let error as NSError {
            print("audioSession error: \(error.localizedDescription)")
        }
    } catch {
        print(#line, error.localizedDescription)
    }
    self.timer = Timer.scheduledTimer(timeInterval: 1, target: self,   selector: (#selector(HomeTableViewCell.updateProgress)), userInfo: nil, repeats: true)
}

I have been trying protocols, trying to edit the TableViewVC and the TableViewCellVC, but I can't quite get it.
Answer: Since you have an audio player inside one cell, you need a way of informing ALL the other cells that an audio player has been clicked. You can achieve this by creating a closure inside each UITableViewCell and assigning it inside of cellForRow. Whenever the play button is clicked, the closure will get fired and inside your UIViewController you will iterate over all visible cells and pause them before playing the player in your clicked cell. Something like this:
class CustomTableViewCell : UITableViewCell{

    var playButtonTapped : (()->())?
    @IBAction func playButtonTapped(_ sender: UIButton) {
         playButtonTapped?()
         //rest of the code comes below
    }
}

class TableViewController : UIViewController, UITableViewDataSource{

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell{
        ....
        cell.playButtonTapped = {
             for tempCell in tableView.visibleCells{
                 if let ultraTempCell = tempCell as? CustomTableViewCell, ultraTempCell != cell /* or something like this */{
                    //pause the player here
                 }
             }
        }
    }
}

Alternatively, what you can do is, instead of having a player inside each cell, just make a player inside the UIViewController and depending on the cell clicked, just change the song inside.
Comment: Yes that is a valid bug but easy to fix. Maybe try checking the `indexPaths` inside the closure! Just skip pausing the cell that was tapped inside of `cellForRow`. Check the edit for a hint.
Comment: Hm this seems to be working,I paused the player and changed the image in the closure. However , it doesnt work if I click on the same cell twice. IE playing one cell, click play button on another, cell - it works and the first one paused (and its button turned to play) but, if i Click the current one Im listening to again, it isnt pausing like normal, it keeps playing. PS thank you so much for taking time out of your day to help me
Comment: Thank you sir , I got it to work perfectly, you helped me a ton =) Cheers
Answer: You can try to call self.audioPlayer.replaceCurrentItem(with: nil) after calling self.audioPlayer.pause(), so your code would look something like this.
if self.audioPlayer != nil {
    if self.audioPlayer.isPlaying {
        self.audioPlayer.pause()
        self.audioPlayer.replaceCurrentItem(with: nil)
        self.audioPlayer.prepareToPlay()
        self.playbutton.setImage(#imageLiteral(resourceName: "bluePlay"), for: .normal)
    }
    else {
        self.audioPlayer.play()
        self.playbutton.setImage(#imageLiteral(resourceName: "bluePause"), for: .normal)
    }

    ...

}

Comment: Value of type 'AVAudioPlayer' has no member 'replaceCurrentItem'
Thank so much for taking time to help
Comment: Thank you. The answer above actually worked out perfectly but thanks again for helping.
Comment: Oh, didn't notice it's an `AVAudioPlayer`. With it you can try to
1) confirm to the `AVAudioPlayerDelegate`
2) add `func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool) {}`
3) call  `self.audioPlayerDidFinishPlaying(self.audioPlayer, successfully: true)` when you want it to stop

P.S. I will edit an answer if that works for your case


Removing old "empty" Datastores that still contain .nvram/.dvsData files/folders

Question: I have several old Datastores from which i moved all VMs via Storage vMotion to new Datastores.
Now the VMs themself don't show any link to these old DSs anymore, but if you browse the DSs they still contain .dvsData Folders and .nvram Files.
My google search just showed that the .dvsData Folders contain data used for the distributed Switches and that the .nvram basicly contain the "BIOS". Also that .nvram will be created.
My question is, do i have to migrate these too? or are those just left over? will/are they newly generated with all current data or will something be lost because default settings are used?
On VMware vCenter Server 4.1
EDIT: for anyone intressted here is the KB-Article for acutally removing DSs in 4.1.
Answer: If you are certain no virtual machines are on that datastore then according to this KB article you can safely remove the .dvsData folder.
The nvRAM files store virtual BIOS information, which if you have moved the machines you can safely delete these files as well.  Just note that any custom BIOS settings in the guest machines may need to be reconfigured.
Comment: to be honest that's what i thought too, but it's good to have a second opinion before actually deleting something.
Comment: Definitely agreed.  Glad to help.


Active Directory and Apple's Workgroup Manager

Question: I thought I'd share my experiences here. I work for a small business with only ~20 users. I wanted the ability to use managed client preferences to assign things like the software update server. Basically the ability to manage my Macs easily and in a native way.
At first I tried the magic triangle solution, but I found this to be very complicated. Not only does it require a Mac OS X Server, but it gives you two points of failure. Additionally each Mac workstation must be bound to both servers.
Eventually I sucked it up and went with the schema changes documented here. I was hesitant at first, because the instructions require a lot of manual work. However it was fairly basic and only took me about an hour and a half. Below you'll find the schema changes file that was a result of my work. I followed the instructions exactly and double checked everything, after six months of having this in place things have been running great. Too good to not share. I hope I save someone a couple of hours.
<code># ==================================================================
#
#  This file should be imported with the following command:
#    ldifde -i -u -f Apple AD Schema Changes.ldf -s server:port -b username domain password -j . -c "cn=Configuration,dc=X" #configurationNamingContext
#  LDIFDE.EXE from AD/AM V1.0 or above must be used.
#  This LDIF file should be imported into AD or AD/AM. It may not work for other directories.
#
# ==================================================================

# ==================================================================
#  Attributes
# ==================================================================

# Attribute: apple-category
dn: cn=apple-category,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 22.214.171.124.220.127.116.110.1.1.1.10.4
ldapDisplayName: apple-category
attributeSyntax: 184.108.40.206
adminDescription: Category for the computer or neighborhood
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-computeralias
dn: cn=apple-computeralias,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.22.214.171.1240.1.1.1.20.3
ldapDisplayName: apple-computeralias
attributeSyntax: 220.127.116.11
adminDescription: XML plist referring to a computer record
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-computer-list-groups
dn: cn=apple-computer-list-groups,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.22.214.171.1240.1.1.1.11.4
ldapDisplayName: apple-computer-list-groups
attributeSyntax: 220.127.116.11
adminDescription: groups
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-computers
dn: cn=apple-computers,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.22.214.171.1240.1.1.1.11.3
ldapDisplayName: apple-computers
attributeSyntax: 184.108.40.206
adminDescription: computers
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-data-stamp
dn: cn=apple-data-stamp,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 220.127.116.11.126.96.36.1990.1.1.1.12.2
ldapDisplayName: apple-data-stamp
attributeSyntax: 184.108.40.206
adminDescription: data stamp
oMSyntax: 22
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-dns-domain
dn: cn=apple-dns-domain,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.126.96.36.1990.1.1.1.18.1
ldapDisplayName: apple-dns-domain
attributeSyntax: 18.104.22.168
adminDescription: DNS domain
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-dnsname
dn: cn=apple-dnsname,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.184.108.40.2060.1.1.1.19.4
ldapDisplayName: apple-dnsname
attributeSyntax: 22.214.171.124
adminDescription: DNS name
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-dns-nameserver
dn: cn=apple-dns-nameserver,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 18.104.22.168.18.104.22.1680.1.1.1.18.2
ldapDisplayName: apple-dns-nameserver
attributeSyntax: 126.96.36.199
adminDescription: DNS name server list
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-group-homeowner
dn: cn=apple-group-homeowner,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 126.96.36.199.126.96.36.1990.1.1.1.14.2
ldapDisplayName: apple-group-homeowner
attributeSyntax: 126.96.36.199
adminDescription: group home owner settings
oMSyntax: 22
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-group-homeurl
dn: cn=apple-group-homeurl,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 18.104.22.168.220.127.116.110.1.1.1.14.1
ldapDisplayName: apple-group-homeurl
attributeSyntax: 22.214.171.124
adminDescription: group home url
oMSyntax: 22
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-imhandle
dn: cn=apple-imhandle,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 18.104.22.168.188.8.131.520.1.1.1.1.21
ldapDisplayName: apple-imhandle
attributeSyntax: 184.108.40.206
adminDescription: IM handle (service:account name)
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-keyword
dn: cn=apple-keyword,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 184.108.40.206.184.108.40.2060.1.1.1.1.19
ldapDisplayName: apple-keyword
attributeSyntax: 220.127.116.11
adminDescription: keywords
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-mcxflags
dn: cn=apple-mcxflags,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 184.108.40.206.188.8.131.520.1.1.1.1.10
ldapDisplayName: apple-mcxflags
attributeSyntax: 188.8.131.52
adminDescription: mcx flags
oMSyntax: 64
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-mcxsettings
dn: cn=apple-mcxsettings,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 18.104.22.168.188.8.131.520.1.1.1.1.16
ldapDisplayName: apple-mcxsettings
attributeSyntax: 22.214.171.124
adminDescription: mcx settings
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-neighborhoodalias
dn: cn=apple-neighborhoodalias,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 22.214.171.124.220.127.116.110.1.1.1.20.2
ldapDisplayName: apple-neighborhoodalias
attributeSyntax: 184.108.40.206
adminDescription: XML plist referring to another neighborhood record
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-networkview
dn: cn=apple-networkview,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.220.127.116.110.1.1.1.10.3
ldapDisplayName: apple-networkview
attributeSyntax: 184.108.40.206
adminDescription: Network view for the computer
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-nodepathxml
dn: cn=apple-nodepathxml,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 220.127.116.11.126.96.36.1990.1.1.1.20.1
ldapDisplayName: apple-nodepathxml
attributeSyntax: 22.214.171.124
adminDescription: XML plist of directory node path
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-service-location
dn: cn=apple-service-location,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 220.127.116.11.184.108.40.2060.1.1.1.19.5
ldapDisplayName: apple-service-location
attributeSyntax: 184.108.40.206
adminDescription: Service location
oMSyntax: 64
systemOnly: FALSE

# Attribute: apple-service-port
dn: cn=apple-service-port,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.188.8.131.520.1.1.1.19.3
ldapDisplayName: apple-service-port
attributeSyntax: 126.96.36.199
adminDescription: Service port number
oMSyntax: 2
systemOnly: FALSE

# Attribute: apple-service-type
dn: cn=apple-service-type,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 184.108.40.206.22.214.171.1240.1.1.1.19.1
ldapDisplayName: apple-service-type
attributeSyntax: 220.127.116.11
adminDescription: type of service
oMSyntax: 22
systemOnly: FALSE

# Attribute: apple-service-url
dn: cn=apple-service-url,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 22.214.171.124.126.96.36.1990.1.1.1.19.2
ldapDisplayName: apple-service-url
attributeSyntax: 22.214.171.124
adminDescription: URL of service
oMSyntax: 22
systemOnly: FALSE

# Attribute: apple-user-authenticationhint
dn: cn=apple-user-authenticationhint,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 18.104.22.168.184.108.40.2060.1.1.1.1.15
ldapDisplayName: apple-user-authenticationhint
attributeSyntax: 184.108.40.206
adminDescription: password hint
oMSyntax: 64
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-user-class
dn: cn=apple-user-class,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 22.214.171.124.22.214.171.1240.1.1.1.1.7
ldapDisplayName: apple-user-class
attributeSyntax: 22.214.171.124
adminDescription: user class
oMSyntax: 22
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-user-homequota
dn: cn=apple-user-homequota,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 126.96.36.199.126.96.36.1990.1.1.1.1.8
ldapDisplayName: apple-user-homequota
attributeSyntax: 18.104.22.168
adminDescription: home directory quota
oMSyntax: 22
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-user-homesoftquota
dn: cn=apple-user-homesoftquota,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 126.96.36.199.220.127.116.110.1.1.1.1.17
ldapDisplayName: apple-user-homesoftquota
attributeSyntax: 18.104.22.168
adminDescription: home directory soft quota
oMSyntax: 22
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-user-homeurl
dn: cn=apple-user-homeurl,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 184.108.40.206.22.214.171.1240.1.1.1.1.6
ldapDisplayName: apple-user-homeurl
attributeSyntax: 126.96.36.199
adminDescription: home directory URL
oMSyntax: 22
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-user-mailattribute
dn: cn=apple-user-mailattribute,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 184.108.40.206.188.8.131.520.1.1.1.1.9
ldapDisplayName: apple-user-mailattribute
attributeSyntax: 184.108.40.206
adminDescription: mail attribute
oMSyntax: 64
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-user-picture
dn: cn=apple-user-picture,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 184.108.40.206.220.127.116.110.1.1.1.1.12
ldapDisplayName: apple-user-picture
attributeSyntax: 188.8.131.52
adminDescription: picture
oMSyntax: 64
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-user-printattribute
dn: cn=apple-user-printattribute,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 220.127.116.11.188.8.131.520.1.1.1.1.13
ldapDisplayName: apple-user-printattribute
attributeSyntax: 22.214.171.124
adminDescription: print attribute
oMSyntax: 64
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-webloguri
dn: cn=apple-webloguri,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 220.127.116.11.220.127.116.110.1.1.1.1.22
ldapDisplayName: apple-webloguri
attributeSyntax: 184.108.40.206
adminDescription: Weblog URI
oMSyntax: 64
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: apple-xmlplist
dn: cn=apple-xmlplist,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 18.104.22.168.220.127.116.110.1.1.1.17.1
ldapDisplayName: apple-xmlplist
attributeSyntax: 188.8.131.52
adminDescription: XML plist data
oMSyntax: 64
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: ipHostNumber
dn: cn=ipHostNumber,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.22.214.171.124
ldapDisplayName: ipHostNumber
attributeSyntax: 22.214.171.124
adminDescription: IP address
oMSyntax: 22
systemOnly: FALSE
rangeUpper: 128

# Attribute: macAddress
dn: cn=macAddress,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.184.108.40.206
ldapDisplayName: macAddress
attributeSyntax: 188.8.131.52
adminDescription: MAC address
oMSyntax: 22
systemOnly: FALSE
rangeUpper: 128

# Attribute: mountDirectory
dn: cn=apple-mountDirectory,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 220.127.116.11.184.108.40.2060.1.1.1.8.1
ldapDisplayName: mountDirectory
attributeSyntax: 188.8.131.52
adminDescription: mount path
oMSyntax: 64
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: mountDumpFrequency
dn: cn=apple-mountDumpFrequency,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.184.108.40.2060.1.1.1.8.4
ldapDisplayName: mountDumpFrequency
attributeSyntax: 22.214.171.124
adminDescription: mount dump frequency
oMSyntax: 22
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: mountOption
dn: cn=apple-mountOption,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.188.8.131.520.1.1.1.8.3
ldapDisplayName: mountOption
attributeSyntax: 220.127.116.11
adminDescription: mount options
oMSyntax: 22
systemOnly: FALSE

# Attribute: mountPassNo
dn: cn=apple-mountPassNo,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.220.127.116.110.1.1.1.8.5
ldapDisplayName: mountPassNo
attributeSyntax: 184.108.40.206
adminDescription: mount passno
oMSyntax: 22
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: mountType
dn: cn=apple-mountType,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 22.214.171.124.184.108.40.2060.1.1.1.8.2
ldapDisplayName: mountType
attributeSyntax: 220.127.116.11
adminDescription: mount VFS type
oMSyntax: 22
isSingleValued: TRUE
systemOnly: FALSE

# Attribute: ttl
dn: cn=ttl,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: attributeSchema
attributeId: 188.8.131.52.220.127.116.11.60
ldapDisplayName: ttl
attributeSyntax: 184.108.40.206
oMSyntax: 2
isSingleValued: TRUE
systemOnly: FALSE

dn:
changetype: modify
add: schemaUpdateNow
schemaUpdateNow: 1
-

# ==================================================================
#  Classes
# ==================================================================

# Class: apple-computer
dn: cn=apple-computer,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: classSchema
governsID: 126.96.36.199.22.214.171.1240.1.1.2.10
ldapDisplayName: apple-computer
adminDescription: computer
objectClassCategory: 3
# subclassOf: top
subclassOf: 22.214.171.124
# rdnAttId: cn
rdnAttId: 220.127.116.11
# mayContain: apple-category
mayContain: 22.214.171.124.220.127.116.110.1.1.1.10.4
# mayContain: apple-computer-list-groups
mayContain: 220.127.116.11.18.104.22.1680.1.1.1.11.4
# mayContain: apple-keyword
mayContain: 18.104.22.168.22.214.171.1240.1.1.1.1.19
# mayContain: apple-mcxflags
mayContain: 18.104.22.168.184.108.40.2060.1.1.1.1.10
# mayContain: apple-mcxsettings
mayContain: 22.214.171.124.188.8.131.520.1.1.1.1.16
# mayContain: apple-networkview
mayContain: 188.8.131.52.18.104.22.1680.1.1.1.10.3
# mayContain: apple-service-url
mayContain: 220.127.116.11.18.104.22.1680.1.1.1.19.2
# mayContain: apple-xmlplist
mayContain: 22.214.171.124.126.96.36.1990.1.1.1.17.1
# mayContain: macAddress
mayContain: 126.96.36.199.184.108.40.206
# mayContain: ttl
mayContain: 126.96.36.199.22.214.171.124.60

# Class: apple-computer-list
dn: cn=apple-computer-list,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: classSchema
governsID: 220.127.116.11.184.108.40.2060.1.1.2.11
ldapDisplayName: apple-computer-list
adminDescription: computer list
objectClassCategory: 1
# subclassOf: top
subclassOf: 184.108.40.206
# rdnAttId: cn
rdnAttId: 188.8.131.52
# mayContain: apple-computer-list-groups
mayContain: 188.8.131.52.18.104.22.1680.1.1.1.11.4
# mayContain: apple-computers
mayContain: 22.214.171.124.184.108.40.2060.1.1.1.11.3
# mayContain: apple-keyword
mayContain: 126.96.36.199.18.104.22.1680.1.1.1.1.19
# mayContain: apple-mcxflags
mayContain: 220.127.116.11.18.104.22.1680.1.1.1.1.10
# mayContain: apple-mcxsettings
mayContain: 184.108.40.206.220.127.116.110.1.1.1.1.16
possSuperiors: organizationalUnit
possSuperiors: container

# Class: apple-configuration
dn: cn=apple-configuration,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: classSchema
governsID: 220.127.116.11.220.127.116.110.1.1.2.12
ldapDisplayName: apple-configuration
adminDescription: configuration
objectClassCategory: 3
# subclassOf: top
subclassOf: 220.127.116.11
# rdnAttId: cn
rdnAttId: 18.104.22.168
# mayContain: apple-data-stamp
mayContain: 18.104.22.168.22.214.171.1240.1.1.1.12.2
# mayContain: apple-keyword
mayContain: 184.108.40.206.220.127.116.110.1.1.1.1.19
# mayContain: apple-xmlplist
mayContain: 18.104.22.168.220.127.116.110.1.1.1.17.1
# mayContain: ttl
mayContain: 18.104.22.168.18.104.22.168.60
possSuperiors: organizationalUnit
possSuperiors: container

# Class: apple-group
dn: cn=apple-group,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: classSchema
governsID: 22.214.171.124.22.214.171.1240.1.1.2.14
ldapDisplayName: apple-group
adminDescription: group account
objectClassCategory: 3
# subclassOf: top
subclassOf: 188.8.131.52
# rdnAttId: cn
rdnAttId: 18.104.22.168
# mayContain: apple-group-homeowner
mayContain: 126.96.36.199.18.104.22.1680.1.1.1.14.2
# mayContain: apple-group-homeurl
mayContain: 188.8.131.52.220.127.116.110.1.1.1.14.1
# mayContain: apple-keyword
mayContain: 220.127.116.11.18.104.22.1680.1.1.1.1.19
# mayContain: apple-mcxflags
mayContain: 18.104.22.168.220.127.116.110.1.1.1.1.10
# mayContain: apple-mcxsettings
mayContain: 18.104.22.168.188.8.131.520.1.1.1.1.16
# mayContain: apple-user-picture
mayContain: 126.96.36.199.22.214.171.1240.1.1.1.1.12
# mayContain: ttl
mayContain: 220.127.116.11.126.96.36.199.60

# Class: apple-location
dn: cn=apple-location,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: classSchema
governsID: 22.214.171.124.126.96.36.1990.1.1.2.18
ldapDisplayName: apple-location
objectClassCategory: 1
# subclassOf: top
subclassOf: 184.108.40.206
# rdnAttId: cn
rdnAttId: 22.214.171.124
# mayContain: apple-dns-domain
mayContain: 18.104.22.168.220.127.116.110.1.1.1.18.1
# mayContain: apple-dns-nameserver
mayContain: 126.96.36.199.18.104.22.1680.1.1.1.18.2
possSuperiors: organizationalUnit
possSuperiors: container

# Class: apple-neighborhood
dn: cn=apple-neighborhood,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: classSchema
governsID: 22.214.171.124.220.127.116.110.1.1.2.20
ldapDisplayName: apple-neighborhood
objectClassCategory: 1
# subclassOf: top
subclassOf: 188.8.131.52
# rdnAttId: cn
rdnAttId: 188.8.131.52
# mayContain: apple-category
mayContain: 126.96.36.199.126.96.36.1990.1.1.1.10.4
# mayContain: apple-computeralias
mayContain: 18.104.22.168.22.214.171.1240.1.1.1.20.3
# mayContain: apple-keyword
mayContain: 22.214.171.124.220.127.116.110.1.1.1.1.19
# mayContain: apple-neighborhoodalias
mayContain: 126.96.36.199.184.108.40.2060.1.1.1.20.2
# mayContain: apple-nodepathxml
mayContain: 126.96.36.199.184.108.40.2060.1.1.1.20.1
# mayContain: apple-xmlplist
mayContain: 126.96.36.199.188.8.131.520.1.1.1.17.1
# mayContain: ttl
mayContain: 126.96.36.199.18.104.22.168.60
possSuperiors: 126.96.36.199
possSuperiors: container

# Class: apple-serverassistant-config
dn: cn=apple-serverassistant-config,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: classSchema
governsID: 220.127.116.11.126.96.36.1990.1.1.2.17
ldapDisplayName: apple-serverassistant-config
objectClassCategory: 1
# subclassOf: top
subclassOf: 184.108.40.206
# rdnAttId: cn
rdnAttId: 188.8.131.52
# mayContain: apple-xmlplist
mayContain: 18.104.22.168.184.108.40.2060.1.1.1.17.1
possSuperiors: organizationalUnit
possSuperiors: container

# Class: apple-service
dn: cn=apple-service,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: classSchema
governsID: 22.214.171.124.126.96.36.1990.1.1.2.19
ldapDisplayName: apple-service
objectClassCategory: 1
# subclassOf: top
subclassOf: 184.108.40.206
# rdnAttId: cn
rdnAttId: 22.214.171.124
# mustContain: apple-service-type
mustContain: 220.127.116.11.220.127.116.110.1.1.1.19.1
# mayContain: apple-dnsname
mayContain: 220.127.116.11.22.214.171.1240.1.1.1.19.4
# mayContain: apple-keyword
mayContain: 184.108.40.206.126.96.36.1990.1.1.1.1.19
# mayContain: apple-service-location
mayContain: 22.214.171.124.126.96.36.1990.1.1.1.19.5
# mayContain: apple-service-port
mayContain: 22.214.171.124.184.108.40.2060.1.1.1.19.3
# mayContain: apple-service-url
mayContain: 22.214.171.124.188.8.131.520.1.1.1.19.2
# mayContain: ipHostNumber
mayContain: 18.104.22.168.18.104.22.168
possSuperiors: organizationalUnit
possSuperiors: container

# Class: apple-user
dn: cn=apple-user,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: classSchema
governsID: 22.214.171.124.188.8.131.520.1.1.2.1
ldapDisplayName: apple-user
adminDescription: apple user account
objectClassCategory: 3
# subclassOf: top
subclassOf: 220.127.116.11
# rdnAttId: cn
rdnAttId: 18.104.22.168
# mayContain: apple-imhandle
mayContain: 220.127.116.11.18.104.22.1680.1.1.1.1.21
# mayContain: apple-keyword
mayContain: 18.104.22.168.18.104.22.1680.1.1.1.1.19
# mayContain: apple-mcxflags
mayContain: 184.108.40.206.18.104.22.1680.1.1.1.1.10
# mayContain: apple-mcxsettings
mayContain: 22.214.171.124.126.96.36.1990.1.1.1.1.16
# mayContain: apple-user-authenticationhint
mayContain: 126.96.36.199.188.8.131.520.1.1.1.1.15
# mayContain: apple-user-class
mayContain: 22.214.171.124.220.127.116.110.1.1.1.1.7
# mayContain: apple-user-homequota
mayContain: 126.96.36.199.220.127.116.110.1.1.1.1.8
# mayContain: apple-user-homesoftquota
mayContain: 220.127.116.11.184.108.40.2060.1.1.1.1.17
# mayContain: apple-user-homeurl
mayContain: 188.8.131.52.220.127.116.110.1.1.1.1.6
# mayContain: apple-user-mailattribute
mayContain: 220.127.116.11.220.127.116.110.1.1.1.1.9
# mayContain: apple-user-picture
mayContain: 18.104.22.168.220.127.116.110.1.1.1.1.12
# mayContain: apple-user-printattribute
mayContain: 126.96.36.199.18.104.22.1680.1.1.1.1.13
# mayContain: apple-webloguri
mayContain: 188.8.131.52.220.127.116.110.1.1.1.1.22

# Class: mount
dn: cn=apple-mount,cn=Schema,cn=Configuration,dc=X
changetype: ntdsschemaadd
objectClass: classSchema
governsID: 22.214.171.124.22.214.171.1240.1.1.2.8
ldapDisplayName: mount
objectClassCategory: 1
# subclassOf: top
subclassOf: 22.214.171.124
# rdnAttId: cn
rdnAttId: 188.8.131.52
# mayContain: mountDirectory
mayContain: 220.127.116.11.184.108.40.2060.1.1.1.8.1
# mayContain: mountDumpFrequency
mayContain: 184.108.40.206.126.96.36.1990.1.1.1.8.4
# mayContain: mountOption
mayContain: 22.214.171.124.220.127.116.110.1.1.1.8.3
# mayContain: mountPassNo
mayContain: 22.214.171.124.18.104.22.1680.1.1.1.8.5
# mayContain: mountType
mayContain: 220.127.116.11.184.108.40.2060.1.1.1.8.2
possSuperiors: 184.108.40.206
possSuperiors: container

dn:
changetype: modify
add: schemaUpdateNow
schemaUpdateNow: 1
-

# ==================================================================
#  Updating present elements
# ==================================================================
# Add the new class to the user object
dn: CN=User,CN=Schema,CN=Configuration,DC=X
changetype: modify
add: auxiliaryClass
auxiliaryClass: apple-user
-

# Add the new class to the computer object
dn: CN=Computer,CN=Schema,CN=Configuration,DC=X
changetype: modify
add: auxiliaryClass
auxiliaryClass: apple-computer
-

# Add the new class to the group object
dn: CN=Group,CN=Schema,CN=Configuration,DC=X
changetype: modify
add: auxiliaryClass
auxiliaryClass: apple-group
-
</code>
Comment: Thanks for sharing this... this should help alot of folks!
Answer: Thanks for posting this!
Apple professional services will also handle this for you. It took them 1 day to test the schema change, deploy the schema change to production, and train the administrators about the changes.  However APS (apple professional services) can get expensive! (depending on your company/city, could be as much as $2000/day)
Answer: I've been looking for this!!! Great!
A little question though...
Uou have apple-configuration as an Auxilary Class (3), but in this video they mention only apple-user, apple-group and apple-computer to be Auxilary Classes.
There are also 39 attributes and the video specifies 36 attributes and 10 classes.
Should I worry about this?
The guide I was looking at is this one:
http://seminars.apple.com/seminarsonline/modifying/apple/index.html?s=301
Thanks!
/Brian


What is the velocity of an orthogonal matrix?

Question: Consider an orthogonal $n\times n$ matrix $\boldsymbol{A}$ so that$\boldsymbol{A}^T \boldsymbol{A} = \boldsymbol{A} \boldsymbol{A}^T = \boldsymbol{I}$. Suppose this matrix can vary with time, hence denoting it as $\boldsymbol{A}(t)$. I would like to obtain the velocity matrix $\frac{d}{d t} \boldsymbol{A}(t)$, which I denote as $\dot{\boldsymbol{A}}$.
The conditions that $\dot{\boldsymbol{A}}$ needs to satisfy can be easily obtained by differentiating all sides of the identity $\boldsymbol{A}^T \boldsymbol{A} = \boldsymbol{A} \boldsymbol{A}^T = \boldsymbol{I}$ with respect to $t$:
\begin{equation}
\boldsymbol{A}^T \dot{\boldsymbol{A}} + \dot{\boldsymbol{A}}^T \boldsymbol{A} = \boldsymbol{A} \dot{\boldsymbol{A}}^T + \dot{\boldsymbol{A}} \boldsymbol{A}^T = \boldsymbol{O}
\end{equation}
This essentially gives a linear system that $\dot{\boldsymbol{A}}$ needs to satisfy. My question is, whether the solution $\dot{\boldsymbol{A}}$ has a nice closed form expression in terms of $\boldsymbol{A}$ or its elements.
Thank you!
Golabi
Comment: It is an interesting question for a lot of reasons, for example it is used to define what is a tangent vector to the Lie Group of orthogonal matrices. In that case for instance we assume $A(0)=\mathbb{I}$ matrix and from this follows that, the matrix $\dot{A}(0)$ is skew-symmetric, i.e. $\dot{A}(0)\in \text{skew}(n)$. It was just a comment but I don't know how to answer to your question in full generality.
Comment: My intuition on this is no. As @Dadeslam noted, the tangent space to the Orthogonal Group at $I$ is the space of skew-symmetric matrices. So suppose you have $A(t)$ as Dadeslam noted, where $A(0) = I$. Then this is a curve in the manifold $O(n)$. It is known that for any tangent vector $X$ at any point $p$, there is a smooth curve passing through $p$ whose velocity is $X$ at $p$. Thus $A'(0)$ could be any skew-symmetric matrix, so how would we derive one from $A(0) = I$? I recommend Tu's _Introduction to Manifolds_, esp. $\S$15 on Lie Groups & Algebras.
Answer: Having reflected more on my comments, I think I can formulate this as an answer: No.
Let $\mathcal{A}$ be the set of smooth curves through the manifold of $O(n)$ of of orthogonal $n\times n$ matrices (i.e. time dependent orthogonal matrices, as in your question) such that for all $A \in \mathcal{A},$ $A(0) = I$. It can be shown that the tangent space to $I \in O(n)$ is the space of skew-symmetric $n\times n$ matrices.
It is known from the theory of smooth manifolds (see Tu, An Introduction to Manifolds, Prop. 8.16) that for every tangent vector $X$ at a point $p$ in a smooth manifold, there exists (locally) a smooth curve through $p$ whose velocity at $p$ is $X$. This means that for every skew-symmetric $n \times n$ matrix $B$, we can find $A(t) \in \mathcal{A}$ such that  $\dot A(0) = B$. However, as defined above, $A(0) = I$ for all $A \in \mathcal{A}$. Therefore, there can be no prescriptive formula which determines $\dot A(0)$ in terms of $A(0) = I$.
Now, if we allow ourselves to consider the functions of $t$ for each matrix element of $A(t)$, since we cannot just use the values of these functions at a time $t$ to find $\dot A$ at $t$ as I have just shown, the only other logical option here is use a derivative of these functions. However, then we have a fairly easy and completely tautological answer:
$$
\dot A(t) = (\dot a_{ij}(t))_{ij} = \dot A(t).
$$


How to convert string with mix of upper and lower case randomly

Question: I would like to convert the string with a mix of upper and lower case. For example, if I have string Mark, I need an output as mARk, or Lewis to convert as lEwIs. How can I achieve this in vanilla JavaScript?
Note: The rule of conversion is random.
I've tried Camelize function, but that not giving me an expected output:
function camelize(str) {
  return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(letter, index) {
    return index === 0 ? letter.toLowerCase() : letter.toUpperCase();
  }).replace(/\s+/g, '');
}

Comment: `Array.from(str).map(v => Math.random()>.5 ? v.toUpperCase() : v.toLowerCase()).join('')`?
Comment: In that case @Denys comment should do the trick and need to get more up-votes
Comment: What is the logic that determines `Mark` should be `mARk`, but that `Lewis` should become `lEwIs`?
Comment: Hi All - It should be random
Answer: This will do the trick.  Edited to make random
function flipCase(str) {
  var flip = '';
  for (var i = 0; i < str.length; i++) {
    if(Math.random() > .5){
      flip += str.charAt(i).toUpperCase();
    } else {
      flip += str.charAt(i).toLowerCase();
    }
  }
  return flip;
}

Answer: I know you mentioned in comments that you wanted it to be random, but for other readers who are looking for a function to invert the casing, here is one way of doing it:

function camelize(str) {
  var inverted = "";
  for (var i = 0; i < str.length; i++) {
    if (str.charCodeAt(i) >= 65 && str.charCodeAt(i) <= 90)
      inverted += str.charAt(i).toLowerCase();
    else
      inverted += str.charAt(i).toUpperCase();
  }
  return inverted;
}

console.log(camelize("Mark"));
console.log(camelize("Lwies"));

And here is another way using Array.map():

function camelize(str) {
  return Array.from(str).map(l => (l.charCodeAt(0) >= 65 && l.charCodeAt(0) <= 90) ? l.toLowerCase() : l.toUpperCase()).join('');
}

console.log(camelize("Mark"));
console.log(camelize("Lwies"));


limit superior of alternating series

Question: I was asked in an exercise to check whether the following series converges or not: $$\sum_{n=1}^{\infty}\left(1+\frac{(-1)^n-3}{n} \right)^{n^2}$$
I used the fact that if a series $(a_n)_n$ converges, then:
$$\limsup_{n \to \infty} \sqrt[n] a_n<1$$
So I calculated $$\limsup_{n \to \infty} \left(1+\frac{(-1)^n-3}{n} \right)^{n} $$
I got $\frac{1}{e^2}$ but the thing is that, I've never calculated a limit superior before, only regular limits. While evaluating the limit I made the assumption that:
$$\limsup_{n \to \infty} \left(1+\frac{(-1)^n-3}{n} \right)^{n} =\lim_{n \to \infty} \left(1+\frac{1-3}{n} \right)^{n} $$
My question is, is this assumption correct?
$$\limsup_{n \to \infty}(-1)^n a_n = \lim_{n \to \infty} a_n?$$
And the same way:
$$\liminf_{n \to \infty}(-1)^n a_n = \lim_{n \to \infty} -a_n?$$
Comment: well $\lim_n -2=-2$ while $\limsup_n (-1)^n (-2) = 2$
Comment: let's assume then that $a_n > 0$
Answer: The series converges by the root test, once we note that $0<\left(1+\frac{(-1)^n-3}{n} \right)^{n^2}\le \left(1+\frac{-2}{n} \right)^{n^2}$ and $\left(1+\frac{-2}{n} \right)^{n}\to e^{-2}<1.$
Comment: Sorry, I misread the problem. The series converges, as you surmised. You can avoid the limsup by applying the inequality $first$, then using the root test. Please see my answer.
Comment: So this series is divergent?
Comment: Then, how would you calculate $\limsup_{n \to \infty} \left(1+\frac{(-1)^n-3}{n} \right)^{n} $? because if this series is divergent $\limsup_{n \to \infty} \left(1+\frac{(-1)^n-3}{n} \right)^{n} > 1$ but I got $1/e^2$
Comment: I was trying to check the convergence with the root test. That is where that limit came from
Comment: Thanks @Matematleta
Comment: You are welcome...
Answer: When you want to calculate a limit superior first find an expression in terms of $n$ for $\sup\ \{a_m:m>n\}$, you can call this sequence $s_n:=\sup\ \{a_m:m>n\}$. And then, when you have that expression, just take the limit.

limit superior of alternating series


JBoss application behind apache ajp proxy with subdomain - duplicated context

Question: In my application, I'm making some standard scenario where Java web app is deployed on JBoss with apache proxy upfront. The webapp is accessible from /esp context so direct url would be (but I've turned off HTTP for Jboss, only AJP):
http://22.214.171.124:8080/esp

Now, I've created subdomain and tried proxy move through apache root context. So I'd like apache to proxy:
https://mysubdomain.domain.com -> ajp -> Jboss /esp context app

I believe that I'm missing something obvious with my configuration, cause only root application context is accessible, and rest of url have dulicated context which ends with 404. For example request are proxied like this:
https://mysubdomain.domain.com/css/somecss.css -> ajp -> /esp/esp/css/somecss.css

Apache configuration looks like this:
<VirtualHost 188.8.131.52:80>
        ServerName mysubdomain.domain.com
        RewriteEngine on
        RewriteCond %{SERVER_PORT} !^443$
        RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost 126.96.36.199:443>
        ServerName mysubdomain.domain.com

        ProxyPass / ajp://localhost:8009/esp/
        ProxyPassReverse / ajp://localhost:8009/esp/

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/mantis>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/esp.log combined

        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
                Options Indexes MultiViews FollowSymLinks
                AllowOverride None
                Order deny,allow
                Deny from all
                Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>

        SSLEngine on

        SSLCertificateFile    /var/keys/server.crt
        SSLCertificateKeyFile /var/keys/server.key

        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>

        BrowserMatch "MSIE [2-6]" \
                nokeepalive ssl-unclean-shutdown \
                downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

</VirtualHost>
</IfModule>

Moreover, when I add additional proxies upfront, everything works:
        ProxyPass /esp/ ajp://localhost:8009/esp/
        ProxyPassReverse /esp/ ajp://localhost:8009/esp/

Except that app is accessible from apache on both context: / and /esp while I want only root. How can I fix it?
Answer: I had already similar trouble like the one you have here, and finally found my relevant configuration (adapted to the configuration you posted):
ProxyRequests Off
ProxyPass / ajp://localhost:8009/esp/
ProxyPassReverse / http://mysubdomain.domain.com/esp/
ProxyPassReverse / https://mysubdomain.domain.com/esp/
ProxyPassReverseCookiePath "/esp" "/"

Initially I had troubles with ProxyPassRevers but also with the cookie path, even perhaps you could need a ProxyPassReverseCookieDomain Directive (in my case I didn't need it).


Training and validating a naive gaussian bayes classifier

Question: I've been reading up on the theory of naive bayes classifiers, specifically the ones in which the probability $p(x|c)$ is a random vector. The problem which I'm trying to solve takes a 4 dimensional vector and tries to classify it into 3 classes. It is known that out of the given 15000 samples the first 5000 belong to class 1, the next 5000 to class 2 and the last third to class 3. It is clear to me that I need to arrive at a $\mu$ and $\sigma$ for each $x_i$ in the feature vector $X$. However, I do not see how to use the resulting parameters in the classification script to classify an incoming sample from the test set.
I hope I defined the problem clearly and look for any pointers that can help me
Answer: From what I've seen people choose whatever class has the highest likelihood given the (naive) estimates for $\mu$ and $\sigma$ under the independence assumptions.  That is, they choose the class $k_i = {\underset {k}{\operatorname {arg\,max} }} \prod_{p=1}^4 N(x_{ip} | \hat \mu_{p k}, \hat \sigma_{p k})$; where $p=1, \ldots, 4$ indexes the features, and $k_i \in \{1, 2, 3\}$ are the class predictions.
Here's what I mean using R:
<code># Simulated data ----------------------------------------------------------
K <- 3 # Number of classes
P <- 4 # Dimension of x
n.obs <- 15000
class.vec.tr <- rep(1:K, each=n.obs/K)

# Create true values of mu randomly.  Each row of mu.tr has the true mean vector
# for that class.
mu.tr <- matrix(nrow=K, ncol=P)
sd.tr <- matrix(nrow=K, ncol=P)
for(k in 1:K) {
    mu.tr[k,] <- rnorm(P, sd=1.5)
    sd.tr[k,] <- rgamma(P, 3, 1)
}

# Randomly generate the data
X.train <- matrix(nrow=n.obs, ncol=P)
X.test <- matrix(nrow=n.obs, ncol=P)
for(i in 1:n.obs) {
    class.idx <- class.vec.tr[i]
    mu.class <- mu.tr[class.idx,]
    sd.class <- sd.tr[class.idx,]
    X.train[i,] <- rnorm(P, mean=mu.class, sd=sd.class)
    X.test[i,] <- rnorm(P, mean=mu.class, sd=sd.class)
}

# "Train" the model -------------------------------------------------------
# Calculate the mean within each class using the training data
mu.hat <- t(simplify2array(by(X.train, factor(class.vec.tr), colMeans, simplify=TRUE)))
# Calculate the standard deviation within each class using the training data,
# assuming feature independence
sd.hat <- t(simplify2array(by(X.train, factor(class.vec.tr), function(X.class) apply(X.class, 2, sd))))

# Evaluate performance on training data -----------------------------------
predicted.classes <- vector(length=n.obs)
for(j in 1:n.obs) {
    X.observation <- X.test[j,]
    x.dens <- vector(length=K)
    for(k in 1:K) {
        mu.hat.class <- mu.hat[k,] # Estimated mean for class k
        sd.hat.class <- sd.hat[k,] # Estimated sd's for class k's features
        x.dens[k] <- prod(dnorm(X.observation, mean=mu.hat.class, sd=sd.hat.class))
    }
    predicted.classes[j] <- which(x.dens==max(x.dens))
}
# See how we did:
table(predicted.classes, class.vec.tr)
</code>
Results in:
<code>> table(predicted.classes, class.vec.tr)
                 class.vec.tr
predicted.classes    1    2    3
                1 3843  545  642
                2  318 3168  799
                3  839 1287 3559
>
</code>
Comment: So if I understand correctly, during testing you obtain a gaussian distribution, using the $\mu$ and $\sigma$ obtained from the testing phase. Am I correct?
Comment: I think you meant "using the $\mu$ and $\sigma$ estimates obtained from the _training_ phase".  If so, then yes.  You get estimates for $\mu$ and $\sigma$ during training, and then evaluate the likelihood on the test data to make predictions.  I also probably should have mentioned in my answer that sometimes people put priors in for the class distributions.  In my answer I assumed all three classes were equally likely a-priori.
Comment: Oh yes, I meant training. Thanks for providing a very helpful code to understand as well


How to protect power strips from accidental shut-offs/"cleaning lady" attack?

Question: Are there any power strips or products designed to defend against a "cleaning lady" attack (cleaning crew is vacuuming the floor and bumps the power strip switch, turning off all the connected equipment)?
I have some curious felines in my house that always seem to work their way behind my desk and accidentally step on the power strip switch.
Is there some sort of switch cover I can get, or a power strip that is less susceptible to this kind of problem?
Comment: tape the switch.
Comment: http://diy.stackexchange.com
Comment: Mount the strip to the desk. seriously?
Comment: Thank you for the feedback, but I can't accept any one of these answers unless they are put in an actual answer :)
Comment: @voretaq7 Closed, Reopened, Closed again, Reopened again. And now I can't vote to close again because "You have already voted to close this question" ಠ_ಠ
Comment: @ChrisS Dunt lookit me -- I'm refraining from voting on this one 'cuz I done editititedidied it :)
Answer: One cheap way is to get yourself a dozen or so 9-12" zip-ties.

Use a staple-gun to place a 2-3 zip-ties on the underside/back of your desk.  Place a couple staples spaced to the the width of your power strip.
Look at your power strip to get the spacing right.
Put the power-strip in place and then close the zip-tie.

A bit neater is to simply get a few cable mount rings.  If get 5-6 and space these out about every 8-12" then you can collect a large number of cables to the under-side of your desk. This should make the cables/power strips immune from vacuums and so on.
Comment: +1 for cable management options.  (though I would suggest [Velcro straps](http://www.amazon.com/Velcro-Cable-Tie-Roll-yards/dp/B000I97FJ2) (cut thinly) over zip ties.
Comment: Those too.  I just mentioned zip-ties and staples because it is really cheap.  You could do the entire project for less then a $1.  Velcro would be a little more expensive.
Answer: Aside from completely replacing your power strip (with one that has a key switch), try a switch cover.
That particular site is where we got AC panel covers at my last job, but there are other places that probably have small versions suitable for power strips.
Comment: That site has the correct size for power strips, but they're $30+.
Answer: You could use a master/slave power distributor. Put your PC/whatever your main device is into the master-slot, all other (secondary) devices to the slave-slots. If you turn on the device on the master-slot all other slots get power, too (and vice versa).
This works without a manual switch and should solve your problem.
Comment: This stops the cat from walking on the power switch how exactly??
Comment: @ChrisS well - there is no switch to step on.
Answer: I had thought of inventing some sort of cover but found it has already been done! Google "power strip power button cover". There are plenty of little covers that easily attach to the strip and protect the bower button from accidental shut offs.
Comment: I searched as you suggested and didn't find any.
Answer: I always just open up the power strip and solder the two leads on the power switch together. I generally make a notation on the side of the power strip that the switch has been disabled.
Comment: I can't think of any specific reason it's not safe, but I admit, I've always had a slightly uneasy feeling about it.
Comment: That sounds safe...
Comment: It's safe if (1) you know what you're doing, and (2) you're not an idiot and doing it on live power.  Given the choice I'd epoxy the switch in the "on" position instead: Nearly equal permanence, and I don't have to unscrew anything :)
Comment: @voretaq7: I didn't think of that. I like that better. It's easier, safer, and in the unlikely chance of some bizarre emergency, it makes it much more obvious that trying to flip the switch will not cut power.
Answer: Two drops of hot-glue suffice to temporarily fixate a power plug.
Comment: Why not?  It's non-conductive.
Comment: One probably won't even reach there, when injecting 2 drops, to the left & right... and I wouldn't be too certain it's not conductive, while it's still liquid; I have no clue... and electrical work made me paranoid (only trusting voltmeter & rotary field tester).
Comment: Hot glue is non conductive even when liquid.
Answer: I always duct tape a quarter over the power button to keep the cats from switching it off.
Comment: Better switch to goldfish.
Comment: That could get expensive after a while.
Comment: I've been recycling the same quarter for the last 10 years! Very cheap compared to the other options! Simple, too!
Comment: I have a lot of power strips. :)
Comment: On some power strips the power switch is also the circuit breaker.  Putting tape and/or coinage on such setups is a fire hazard.
Answer: Use switch guard -- effective against accidental switch trip while avoiding the dangers of preventing emergency switch flip.
find on Amazon:
https://www.amazon.com/Option-Switch-Guards-Clear-Toggle/dp/B00DTXKOTM
This is NOT an affilate link -- pure information.
Comment: That is completely useless for a power strip.  That only works for wall switches.


How to prove a norm identity for a Banach space and its dual

Question: Is the following claim true? It feels like it should be true, but I don't really know how to show it.

Let $X$ be a Banach space, and $x \in X$ an element of it. Then there exists a functional $\phi \in X^*$ such that $\| \phi \| = 1$ and $\| x \| = | \phi(x) |$.

If I'm not mistaken, it would suffice to say that there exists a sequence $(\phi_k)_{k = 1}^\infty$ of unit functionals for which $| \phi_k (x) | \to \| x \|$, since the unit ball in $X^*$ is compact in the weak topology. However, I don't know how to prove the former result.
EDIT: I forgot to actually define $\psi$ as $\psi(\lambda x) = \lambda$.
My intuition is that I should be able to invoke Hahn-Banach and define a linear function $\psi$ on $\mathbb{C} x \subseteq X$ bounded by the norm $\rho(x) = \| x \|$ on $X$, then extend it from $\mathbb{C} x$ to all of $X$. Is this a correct application of Hahn-Banach?
Comment: @Nephanth Wouldn't that require a Hilbert space?
Comment: Oopsie comment deleted, I read wrong
Answer: You don't need completeness of $X$. This is true in normed spaces. Your last idea is a good one:
We may assume $x \neq 0$.
Define the functional
$$\varphi: \Bbb{C}x \to \Bbb{C}: \lambda x \mapsto \lambda \Vert x \Vert$$
Then it is easily checked that $\Vert \varphi \Vert =1$ (the inequality $\leq$ is obvious, and then note that $\varphi(x/\Vert x \Vert) = 1$ so also $\Vert \varphi\Vert \geq 1$). By Hahn-Banach, we can extend to a functional $\tilde{\varphi}: X \to \Bbb{C}$ with $\Vert \tilde{\varphi} \Vert =1$ and this is the functional you are looking for.
Comment: Yes, that's the one I had in mind! I just forgot to actually say what $\psi$ was.
Comment: Yeah, so you pretty much had it proven. All you had left to do was check that the functional on the one-dimensional subspace has norm $1$ and then Hahn-Banach allows you to extend the functional to the entire space while preserving the norm.
Answer: Yes, this is a perfect application. You can start by defining a functional on the one-dimensional space spanned by $x$ as $\phi(ax)=a\|x\|$ which has norm $=1$ and extend using HB.
Answer: W.l.o.g say $x \neq 0$. As you said then look at the subspace $\mathbb{C}x$ and the map $\phi(\lambda x) = \lambda \| x \|$ defined on $\mathbb{C}x$. Then $\phi$ is of course well-defined, linear, bounded and it holds
\begin{align}
\phi(x) = \| x \| \, \text{ and } \, \| \phi \| = \sup_{\| \lambda x \| \leq 1, \, \lambda \in \mathbb{C}} |\lambda | \| x \| = 1.
\end{align}
Using Hahn-Banach you can then extend $\phi$ to and element $\Phi\in X^*$ with $\| \Phi \| = 1$.


Styling Container background?

Question:
Possible Duplicate:
How to deal with floated elements?

I have a probably basic html css styling question:
If I have:

Then... when I style the columns with a background-color they get the background color.
BUT the container somehow does not stretch until the bottom of the content: it only fills content with a background color or any other property if I put "content" in it e.g.:

one line of background color

Now I get one line behind the whole thing that is "green" while I want it to stretch the complete thing.
Why does the container not know where the bottom is? Is there anything I can do here?
Answer: If you've floated the inner divs, you'll need to add overflow: auto to the container element.
Answer: You need to clear your floats. I usually just overflow:hidden the container.

Styling Container background?


Create subdomain and set home and stats value for plesk 10.4.4 using API

Question: I was able to create a subdomain in my plesk panel (linux serverm and plesk 10.4.4 ) using API (with a PHP script).
But I'm not able to find a documentation online for just two things:

How can I set the stats property to be "awstats" instead of "Nothing"?
How can I set (if is it possible) the home directory for the created subdomain to be, for example /subdomains/my-subdomain?

Thank you very much...
Comment: Do you want change stat and httpdoc for what entery: main domain or subdomain?
Comment: For the subdomain...  I know that for setting one property I have to insert a new **property** in the packet, but I'm not able to find the correct property for setting the awstats and the subdomain folder
Answer: Try this one:
HTTP_AUTH_LOGIN: <login here>
HTTP_AUTH_PASSWD: <password here>
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<packet version="22.214.171.124">
  <subdomain>
    <add>
      <parent>parent domain name here</parent>
      <name>subdomain name</name>
      <property>
        <name>ftp_password</name>
        <value>qweqwe</value>
      </property>
      <property>
        <name>webstat</name>
        <value>awstats</value>
      </property>
      <property>
        <name>www_root</name>
        <value>httpdoc</value>
      </property>
    </add>
  </subdomain>
</packet>

In case of set request will be:
HTTP_AUTH_LOGIN: <login here>
    HTTP_AUTH_PASSWD: <password here>
    Content-Type: text/xml
    <?xml version="1.0" encoding="UTF-8"?>
    <packet version="126.96.36.199">
      <subdomain>
        <set>
          <filter><id>ID</id></filter>
          <property>
            <name>webstat</name>
            <value>awstats</value>
          </property>
          <property>
            <name>www_root</name>
            <value>httpdoc</value>
          </property>
        </set>
      </subdomain>
    </packet>

Comment: Wait...the property `www_root` works correctly, but there's no way form me to let work the property `webstat`. I always recieve the error mentioned above...
Comment: No, sorry...it don't works. I've just only tryed to set the awstats property for a subdomain, but it fails.    Myrequest code is   `

27

webstat
awstats

`  and I get this error:  `error 1019 Wrong name of property webstat `
Comment: Yes, request returns error answer, but it seems to be a plesk's bug. Also I tried to set `webstat` via `site` operator and it does not work  expected.
Comment: Infact...I suppose that It could be a plesk's bug or perhaps it may be because the awstats are external modules of plesk...in any case, thanks a lot for your help
Comment: I have the same problem: www_root is fine, when I add webstat the subdomain is not created: did you solve this in some way, please?
Comment: It's a plesk's bug that webstat does not work. And I do not see any workaround. Maybe it work in current stable version.


Question about the definition of the degree of a continuous map $f : S^n \rightarrow S^n$.

Question: From Rotman's algebraic Topology:

A continuous map $f : S^n \rightarrow S^n$ (where $n \gt 0$) has degree $m$, denoted by $d(f) = m$, if $f_*:H_n(S^n) \rightarrow H_n(S^n)$ is multiplication by $m$.

What does "is multiplication by $m$" mean for n-th homology groups?
Comment: Every abelian group $A$ is a $\mathbb{Z}$-module, meaning that "scalar multiplication" by integers is defined by the formula $$na=\underbrace{a+...+a}_{\text{$n$ times (for positive $n$)}}$$ and satisfies a few basic laws such as $n(a+b)=na+nb$ and $n(mb)=(nm)b$.
Answer: $H_n(S^n)\simeq\mathbb{Z}$ and so every homomorphism
$$f:H_n(S^n)\to H_n(S^n)$$
is actually a homomorphism
$$f:\mathbb{Z}\to \mathbb{Z}$$
and every such homomorphism is given by
$$f(x)=mx$$
for some unique $m\in\mathbb{Z}$.


Example of a three-way interaction plot in R

Question: Is this an example of interaction plot?
However, in the bottom of the article it is wrtitten, that it's not a 3-way-interaction (link to article). How should I understooth it? If it's not a 3-way-interaction plot then how can it been done in R?
<code>library(MASS)
library(effects)

wvs.2 <- polr(poverty ~ country*(gender + religion + degree + ns(age, 4)),data = WVS)

plot(Effect(focal.predictors = c("country","age","gender"), mod = wvs.2, xlevels = list(age = 20:80), latent = TRUE), rug = FALSE, ylim = c(0,3.5))
</code>

Edited - new question:
WHat does ns(, 4) exactly do? I know that if we didn't use this the the lines will be linear but I just didn't understooth what it exactly does. Is it similar to something like agea^2? Or boes ns(age, 4) for instance take the 4th number for age and then plot and that's why it's curved instead of linear? in the paper by John fox they use bs(, 4) instead. It does the same. I know that it is explained in the article and in the paper by JOhn FOx but I didn't understooth their explanation.
EDIT 2
The summary of the estimated model shows interactions between countryage and countrygender which are the 3 variables plotted in the picture above. My question is then is the plot actually a plot/visualization of 2 different interactions? 1 for countryage and 1 for countrygender?
I'm asking because I have to write about a similar plot with different data and variables etc. But I used the same method, however I'm in doubt about what I should write. Is it a two-way interaction with the effect of gender added or is it 2 different 2-way interaction plots combined in multiple plots?
<code>> Anova(wvs.1)
Analysis of Deviance Table (Type II tests)

Response: poverty
                 LR Chisq Df Pr(>Chisq)
country           250.881  3  < 2.2e-16 ***
gender             10.749  1  0.0010435 **
religion            4.132  1  0.0420698 *
degree              4.284  1  0.0384725 *
age                49.950  1  1.577e-12 ***
country:gender      3.049  3  0.3841657
country:religion   21.143  3  9.833e-05 ***
country:degree     12.861  3  0.0049476 **
country:age        17.529  3  0.0005501 ***
</code>
Comment: Your edit is really a separate question. `ns(, 4)` transforms your data using *natural splines*, with 4 knots. `bs()` transforms using *basis splines*. The transformations are (AFAIK) different, but the fits can of course be similar. Take a look at the help pages, `?ns` and `?bs`. Frank Harrell's *Regression Modeling Strategies* has a very good discussion of splines. We also have a [tag:splines] tag. [This search](https://stats.stackexchange.com/search?q=%5Bsplines%5D+ns+bs) may be helpful.
Answer: This is not an interaction plot in the strict sense of the term. An interaction plot has a single plot and multiple lines. The horizontal axis shows a predictor (categorical or continuous), the vertical axis is a response, and the multiple fitted lines show how the fitted response depends on the predictor, where each line corresponds to one level of a grouping factor. Take a look at the figure in the Wikipedia article: the horizontal axis is education level, the vertical axis is proclivity to care about sea level rise, and the grouping factor is political stance with three levels, thus we get three lines.
Your plot is paneled. It does show (or can show) a three-way interaction, simply not in a single plot, but in eight plots, because you have one continuous predictor (age, on the horizontal axis) and two categorical predictors (gender in rows and countries in columns). This is a very good representation, which allows us to see how the response-age relationship varies by country and gender.
Your confusion stems from the fact that this could show a three-way interaction, but in this particular case, no three-way interaction was modeled. The model included a two-way interaction between country and age and an additional main effect of gender. Thus, the curves differ between countries (that's the country-age interaction), but they have the same shape between genders within each country, they are just shifted up or down between the genders (that's the main effect of gender). If the model hadn't included gender at all, then you could of course still create a plot like this, but then both rows would be identical, because there would be no fitted difference between genders.
Comment: If you really want a 3-way interaction, then something like `polr(poverty~gender*religion*ns(age,4), data=WVS)` should do the trick, depending on your dataset. Try it and take a look at the results. I'm afraid I don't quite understand your last comment... The model plotted is something like `poverty~country*ns(age,4)+gender`. Does this help?
Comment: Thanks for yuor answer! So it's not a 3-way interaction but a 2-way interaction of country*age and they just added an extra variabel which is gender to see how the the effects vary? But the curves does not vary for gender because they did not fit a 3-way interaction between country, age and gender? If I want to fit a 3-way interaction I can then plot `polr(poverty ~ country*(gender + religion + degree + ns(age, 4) + ns(age, 4)*gndr),data = WVS)` Is all this correct understooth and enough?
Comment: I edited the post with a new question after the plot. I would really appreciate if you could give an answer on that if possible of course.
Comment: one last question: should plot in my post actually not be understooth at two different interactions visualized in 8 panels/plots Because in the fitted model it is `country*(gender + ... + ns(age,4)`  so it's actually the interaction of `country*age` and `country*gender` so can it be interpretted as two different interaction combined into 8 plots? Hope my explanation makes sense


Use of sharps and flats when writing altered notes to chords in key

Question: A quick question about the conventions of writing music. I have a song I am working on where I am going from a G major to a F#-b9. The song is in G major for most of it before going into a middle which is A-9, Ab#5#9 then back into G and then the F#. So G Major has 1 sharp which is F#. When I write out the chord on the staff do I note the 5th as Db or a C#? Does it matter?
Also I am looking at the Ab altered as a tritone sub of D7 in G major. Should this be written as Ab or G#?
Answer:
When I write out the chord on the staff do I note the 5th as Db or a C#? Does it matter?

If this is the fifth of the F♯(♭9) chord, then you would want to notate this as a C♯. This is because the fifth of the chord is so named because it is a fifth above the root. Since the root is some kind of F, the fifth must be spelled as some kind of C. The D♭ is enharmonically equivalent to this C♯, but technically speaking the fifth is C♯, not D♭ (which would be a sixth or thirteenth of some kind).

Also I am looking at the Ab altered as a tritone sub of D7 in G major. Should this be written as Ab or G#?

You would spell it as A♭. Since this chord will typically resolve to G, it will be easier to notate A♭ moving to G instead of having to move from G♯ to G♮ (with all of the natural signs to remind the performer not to play G♯). Furthermore, the G♯ chord would involve a B♯, and although this won't bother any performer worth their salt, it's typically better to notate music in as friendly a way as possible when there are multiple options.
Answer: Since the piece is mainly featuring sharps, anyone who is reading the written version will have their 'sharp hat' on. So it is easier for them to continue thinking in sharps. Why not? And while you're at it, keep it all the same for the tritone. To some, it won't matter, as they are sufficiently good sight-readers to merely read what is presented on the chart, but others may think theoretically, and keeping sharps together may help.
Missed a bit! If you're talking about the chord of F#anything, then the fifth of it has to be C♯, not D♭. So if that F# chord was F#+, the 5th would be Cx - not D. I realise it isn't, just underlining the 'C-ness' of that 5th.


Referencing CSS file from theme library inside Embedded Widget Paragraph type

Question: I have an article page in Drupal 8 that contains a chart (inserted into the page using Text paragraph). The chart uses CSS classes that I have created inside the global stylesheet. It works, but I don't want these CSS classes to be loaded on every single page on my website.
I'm thinking that I would move the CSS classes into a separate file. Then I would move the HTML code for the chart into an Embedded paragraph and reference the theme library.
I'm new to Drupal 8 theming so I'm not sure how I would go about doing that. Can someone give me the general steps?
I think need to do the following.

Move CSS classes to a new file
create a library refencing the new CSS file that is not loaded by default
Add the CSS file URL to the embedded widget "Javascript Source" field

I'm not sure how to add the library refence to my theme or to make it not load by default.
Answer: Your thought process is correct. To implement below script tag is to be referenced inside the embedded widget
Like: Js

Like : Css
<link href="/custom.css" rel="stylesheet" />

Thanks


HashMap and ArrayList confusion in retrieval

Question: I have  a problem on arraylist and hashmap
As according to my requirement, I am storing the data into HashMap and after that I have created a List as List>.
        HashMap<String,String> hashmap;
        static List<HashMap<String,String>> hashmap_string;

And while retrieving the value from database and putting it on HashMap and ArrayList like:
                    contract_number=c.getString(c1);
                    Log.i("c1.getString,contract_number", contract_number);
                    String service_level=c.getString(c2);
                    hashmap=new HashMap<String, String>();
                    hashmap.put(contract_number, service_level);
                    hashmap_string.add(hashmap);

And now I want to retrieve the value as String,String
And when I am applying the code as:
                for(int i=0;i<hashmap_string.size();i++)
                {
                    Log.i("arraylist", ""+hashmap_string.get(i));
                }

I am getting a single string value in the formet as
               {Contract,ServiveValue}

but I want to split this into 2 string values...Also these values are redundant and if am using hashMap then it will not showing me the redundant value.
Please help me on this..
Comment: Why you are not using only HashMap instead. If you need to get `Contract` and `ServiveValue` as single values I think it is better option to do.
Comment: It seems you are moving to design your data very badly. what you are trying to solve this way?
Comment: Beacause HashMap does not retrieve duplicate values and my contract and service level value has duplicate values
Comment: I just want to show this key and value in a listview .. And this key and value is having duplicate data..please suggest ..
Answer: It seems you are missing something. When you execute hashmap_string.get(i), you will get the <HashMap<String,String>. So, This is the right value from code.
What you can do is :
        HashMap<String, String> hashMap2 = hashmap_string.get(i);
        String value = hashMap2.get("your_key");

Other way, you already have two splited string values. you can get that by using keySet() and values() methods over hashMap2 Object.
Comment: Still it does not retrieve duplicate data
Answer: HashMap (and Maps in general) are used for multiple one-to-one mappings of keys and values. Are you sure you need that? Looking at your code it appears you're using the map as a "Pair" class. I would skip the list, and put everything in the same map, and then iterate over the pairs in the map:
// using tree map to have entries sorted on the key,
// rather than the key's hash value.
Map<String, String> data = new TreeMap<String, String>();
data.put("c1", "s1");
data.put("c2", "s2");

for (Map.Entry<String, String> entry : data.entrySet()) {
    String contract = entry.getKey();
    String level = entry.getValue();
    Log.i("data", contract + " : " + level");
}

would output (assuming TreeSet):
c1 : s1
c2 : s2

Alternatively, create e.g. a ContractServiceLevel class that holds two strings (the contract number and the service level), and put instances of that class in your list.
EDIT:
public final class ContractServiceLevel {
    public final String number;
    public final String serviceLevel;

    public ContractServiceLevel(String c, String s) {
        number = c;
        serviceLevel = s;
    }
}

List<ContractServiceLevel> contracts = new ArrayList<ContractServiceLevel>();
contracts.add(new ContractServiceLevel("c1", "s1.1"));
contracts.add(new ContractServiceLevel("c1", "s1.2"));
contracts.add(new ContractServiceLevel("c2", "s2.1"));

for (ContractServiceLevel contract : contracts) {
    Log.i("data", contract.number + ":" + contract.servicveLevel);
}

would output:
c1 : s1.1
c1 : s1.2
c2 : s2.1

Comment: data.put("c1","s1"); and again data.put("c1",s1");    Now it will only return 1 pair as "c1","s1"...and my key and value both contain duplicate values..So how can I solve this
Answer: String value = hashmap.get("contract");
u will be getting the value as ServiveValue


asymmetrical rows and columns in table with div's

Question: I am using divs to make tables (div's because I had some complicated design).
I want to my first row to have multiple columns and second row is just a single row which spans through the whole row and next row is again a multiple column row.
This first row, second row is not static, its dynamically decided from data.
My css:
#table-holder {
    margin: 0 auto;
    display: table;
    border: solid 2px #b7ddf2;
    background: #ebf4fb;
    font-family: Verdana, Geneva, sans-serif;
}

#row {
    display: table-row;
    border: solid 2px #b7ddf2;
    padding: 2px 2px 2px 2px;
}

#column {
    display: table-cell;
    border: solid 2px #b7ddf2;
    padding: 2px 2px 2px 2px;
}

my html:

      I want this to span for my whole row, instead of just 1st column.

any ideas ?
Thank you
Comment: You should not be duplicating an id attribute. By definition these should be unique to a single object on the screen. CSS won't complain but any js would. Use classes instead for things that aren't strictly singleton.
Comment: ok. I never knew that. Thank you. will changing the id attribute to class will fix the issue ?
Comment: possible duplicate of [HTML colspan in CSS](http://stackoverflow.com/questions/2403990/html-colspan-in-css)
Answer: You may be running into trouble because this really isn't what divs are made for. They're block-level elements. If you want to create a table, you should be using table, tr td, etc.
This gets your middle row to span the width of the container but I think it may take away the functionality you were looking for.
I'd recommend investigating floats and a clearfix method for the columns if you're set on using divs.


Physical meaning of one dimensional heat equation.

Question: Consider heat conduction in a $1$-D material.  The temperature distribution  $u$ after sufficiently long time can be modeled by $$-(a(x)u_x)_x = f(x), \qquad x \in [0,1]$$ where $a$ is heat conductivity, $f$ denotes internal heat sources.
Now i want to understand how this equation is modeled? Can anyone explain it plz? Also what is the difference between this equation and general heat equation?
Answer: You can start from the derivation of the general heat equation in one dimension. For example, you can look at the https://en.wikipedia.org/wiki/Heat_equation. You just need to account for the fact that the heat conductivity is position dependent. You should get:
$$\partial_tu-\partial_x(a(x)\partial_xu)=f(x)$$
Now all you need to do is assume that the system reaches an equilibrium when $t\rightarrow\infty$. If the system is in equilibrium, it does not change with time, so $\partial_tu=0$
Comment: @kapil from the same webpage, https://en.wikipedia.org/wiki/Heat_equation#Internal_heat_generation, they have the example of a filament of an incandescent light bulb. When the current is passing through, the electrical resistance of the filament heats up
Comment: what is the meaning of internal heat sources here? Can you give any example to clarify it?
Comment: great sir. Thanks.


How to Calculate Batting Index and Bowling Index?

Question: I was wishing to understand the formula to use to calculate the Batting Index and Bowling Index in Cricket.
This is for limited overs cricket (50 overs) for my club players
Comment: What is batting/bowling index? Can you provide an example?
Comment: never heard these terms before
Comment: The batting index is calculated by adding the strike rate and the average runs.
Comment: A batting index for limited-overs cricket http://www.espncricinfo.com/thestands/content/story/752205.html
Answer: The Bowling index is the Bowlers average multiplied by runs conceeded per ball (This calculation is mentioned in this article).
The Batting index (at least as defined by NatWest T20) is the sum of the batsmans run rate and his strike rate. (As mentioned in this article).
Answer: Batting Index:
The batting index is the Strike Rate multiplied by the Average Runs then that is divided by 50
BI = ((SR*AVG)/50)
E.g.
The batting index of a player with SR of 123.4 and an average of 45.33 runs:
(123.4*45.33)/50 = 112 (rounded)
As for Bowlers Index, I'm not sure that exists. Or at least I haven't seen it.
Answer: Batting index, at least in the matches telecasted by skysports (the recent t20 between England and India) is a simple addition of a batsman's average and strike rate.
So if a batsman has an average of 23 and a strike rate of 120 , his batting index will be 143.
http://www.telegraph.co.uk/sport/cricket/international/england/10841469/England-should-continue-placing-great-faith-in-statistics-under-Peter-Moores.html
In the link above there is aline explaining what I said.


Writing Custom Transaction Times during Visual Studio Load Test

Question: Is there a way to write custom transaction times during a loadtest in VisualStudio. Normally to log the transaction time, you put the transaction between the BeginTimer and EndTimer methods like below:
TestContext.BeginTimer("TransactionName");
// Do stuff for the transaction here
TestContext.EndTimer("TransactionName");

In my code, I already have the timing for the transaction stored. Is there a way for me to report this? Something like this:
WriteTimer("TransactionName", time);

I would like to see the results in the test summary that Visual Studio creates.
Answer: Use the BeginTransaction and EndTransaction methods in place of BeginTimer and EndTimer:
TestContext.BeginTransaction ("TransactionName");
// Do stuff for the transaction here
TestContext.EndTransaction ("TransactionName");

The results for "TransactionName" will be displayed in the test summary.
Comment: Will it also be added in the LoadTest Database? If not how could we add it?


Printmail Form inside Colorbox

Question: I am actually trying to load the printmail form inside a colorbox. But when I am trying to build up a link like this:
Send as email

The colorbox opens, but returns "This content failed to load."
Someone got an idea how to workaround that?
Answer: You should use the colorbox-node instead of colorbox-load First check have you already installed the Colorbox and the Colorbox Node modules.
Then, your link would be similar to the following one.
Als E-Mail versenden

Printmail Form inside Colorbox


Can random point process generator generate pattern that is not random?

Question: I am using esri arc to generate random points. I then analyze the pattern from this process using Average Nearest Neighbor which is also in esri gis but lets say it can be in any other software.
Is there a chance that it comes as dispersed or clustered or will the random generator make sure it is always random?
Answer: That's a false distinction.
A random variable generator -- presumably in this case based on independent and uniform probabilities for point coordinates within a defined region -- will produce clustered or dispersed patterns with approximately the probabilities that they are defined to have.
An analogue is generating random integers that are uniform on 1 to 6, as when dice are thrown. All ones or all sixes are expected to occur with their associated (small) probabilities. The larger the number of throws, the smaller the probability of all ones or all sixes, or of any other "extreme" result.
There is no feedback whereby a software function rejects its own results because they have low probabilities in certain senses. That wouldn't even be a coherent idea. Much of the point here is that under a null hypothesis of random patterns (a Poisson point process) you could get patterns that you want to call dispersed or clustered; and you are assessing how likely that is.
So random point patterns necessarily will produce dispersed or clustered point patterns some of the time; the point is rather that the variability is pre-defined so that you can assess that possibility.
Consider also that point patterns do not fall into three distinct classes except for qualitative discussion. There is a continuum from clustered to dispersed.