Is there any other notation, like tab notation, for piano?

Question: I am a beginner in music, and I like both piano and electric bass guitar. I can spend 2,3 hours per week on music (Online Learning and playing).
I am not a musician, but I am playing for joy. I've started practice in the bass, and I like the tab notation. Is there anything similar for piano (except the standard music notes notation)?
Is it preferable to stick and learn the bass currently and later start playing the piano using the standard note notation?
Comment: There are always fakebooks, which don't capture everything, but make learning new songs very easy and fun. Typically you read a chord symbol plus as much of the melody/accompaniment as you have brainspace for. When you know your chord symbols on piano, you can get away with a lot this way.
Comment: A fret board being a two dimensional "grid" of note positions, it's well suited to shorthand like tab.  The most obvious equivalent for a piano would be numbering the keys from 0 to whatever!  ; )
Answer: There's nothing that seriously challenges standard notation for piano.  For bass guitar you need to understand both tab and notation.  For piano you need notation.   There's little point in searching for something 'easier'.  Notation already IS the 'easiest' part of piano playing, a minor skill that unlocks all the other, greater ones.  Treat it that way, rather than as an obstacle!
Comment: Who learns the piano just to be able to play one piece? No, if you want to learn it, youd want to stick with it enough that you have the skill to learn any piece that's within your ability. Even for a beginner, there are many books of easy pieces. And all written in standard notation. Learning standard notation is worth the study, even for a beginner.
Comment: The way I see it, the notation is difficult for complete beginners when all they want is learn a very simple and tiny piece. But when it comes to learning something advanced, nothing can describe it as precisely.
Comment: @RosieF I tend to agree with your viewpoint. Thing is, there's always people who just want to... "brag" among their friends without the willingness to actually learn.
Answer: In the modern world, the most popular alternative piano notation is probably the vertical scrolling layouts that you see in videos like this one:

You can't guarantee that you'll find a tutorial video like that for every piece you want to play, but then you could say the same for sheet music!
Standard notation can be awkward to learn, but it's possibly less awkward to learn it for a keyboard instrument like the piano where the layout of the instrument (with black keys and white keys) actually reflects more of the concepts that standard notation is based on (in particular, sharps and flats).
Comment: Note that as far as I know, layouts like that don't provide dynamics or other additional information that sheet music can contain.
Comment: @whatsisname that's a fair point, but you can make similar observations about standard notation - very often, a stylistically-plausible performance relies on the performer making small timing and dynamic adjustments that generally aren't (and could not practically be) marked on a score. And for many styles of music, standard notation can't hope to usefully convey the timbral characteristics that a piece may rely on. IOW if a format of presentation needs to stand alone to be considered 'notation', standard notation doesn't make the cut either.
Comment: @ArcanistLupus the graphical layout itself may not, but it's usually presented as part of a video with accompanying audio.
Comment: I wouldn't call anything that requires a video playing to be "notation", plus this style of delivery has some serious drawbacks.
Answer: There is klavarskribo (https://en.wikipedia.org/wiki/Klavarskribo), invented in 1931 to simplify music notation for keyboard instruments, to enable more people to enjoy music. It has obviously not become the new standard, but it has lasted a long time (compared to other alternative notations), and many classical songs have been transcribed in it.
It looks like tablature for key instruments:

I would not advise you to use it, but it's an interesting concept.
Comment: @Tim just add as many lines as you need. The lines of cis and dis closest to Central c are always dotted.
Comment: Interesting re-invention of the wheel, what happens when the music goes higher or lower than that span, though..?
Comment: Interesting! This notation seems to be the parent of vertical scrolling layouts (synthesia), but in paper. It looks simple and convenient. I will try to play some songs along with synthesia, before learning with notes notation. Thanks for sharing!
Comment: There's an article mentioning klavarscribo that I just looked up in one of my old Electronics and Music Maker magazines, from September 1981:    http://www.muzines.co.uk/articles/organ-talk/3561    That's the only time I've seen it mentioned anywhere in any context.
Answer: Most piano players start with r.h., and learn through the standard dots. That's good, but when l.h. comes out to play, there's often a hurdle in the way - the bass clef is similar, but not the same as the treble.
You could do yourself a favour, and learn bass guitar first, using bass clef. Then on to piano, where that will be familiar.
Also the bonus of being a bass guitar reader will pay dividends later in life - most of us aren't brilliant readers, and lose playing opportunities because of that.
Comment: Reading notation allows you to work on any instrument. While tab is useful on bass, notation will get you a further & is well worth learning. It'll allow you to easily read melody lines in fake books, or play written lines in pieces that have a line written out. And to easily share that knowledge with others in any language. Or to play music written for other instruments on your bass and/or piano.  I started on piano in 2nd grade. Moved to trumpet in 4th grade. Played that through college & then picked up bass. I still use a treble "Real Book" on bass & can noodle on piano reading sheet music.
Answer: While not a practical tablature system for contemporary music, which what the OP probably wants, some mention should be made about historic keyboard tablature. My understanding is keyboard tablature was common a long time ago, Renaissance time period, and I imagine it was popular as a less expensive notation option than engraved staff notation.
https://en.wikipedia.org/wiki/Keyboard_tablature
An example of what it looked like:
Answer: EZ Play Today song books offer a stepping stone into reading notation.  They are available in a wide variety of musical genres.  They feature melodies in single notes with the note name within the note accompanied by the lyrics and the appropriate harmonizing chord.  You gradually begin reading simple standard notation without reference to the printed name.
Comment: EZ Play is a good recommendation, but could you say a bit more about them?
Answer: I recently came up with a notation that is inspired by the vertical scrolling layouts. In fact, my first pass was a direct transcription of one. I don't know how viable it is, and I can think of many limitations, but here is an example for two hands (top line is treble, bottom is base, but of course it doesn't matter because the octave-qualified notation is absolute):

The gist of it using note name, modifier and octave to quickly pinpoint the note. The duration is represented with undescores over the note, with the default being quarter of a beat (so __ would be half and ____ would be a full beat).
It works for simple cases and I was able to trascribe an easy arrangement of Bach's Badinerie (I'm happy to share the full transcription if anyone cares). I also wrote a Python script that converts my notation to MIDI, from where it can be imported into MuseScore or just played immediately to help validate the transcription accuracy. Here is an example of score generated automatically from the example above:

I don't know if it provides significant advantages over regular notation, but as someone who has struggled reading music my entire life, I am willing to take it for a spin and see if it helps me learning new pieces.
P.S. I couldn't paste my notation as text because it was recognized as a chord :)
Comment: Welcome to the site.  Interesting piece of work.  But I am not sure how this would cope with anything even remotely complicated, for example a fugue.  And all it is showing, in your example anyway, are the pitches.  Where did the staccato dots, bar lines and the key signature come from?
Comment: Great questions! I think my notation is very mechanical, since it represents a capture of a performance (aka "the vertical scrolling layout"). In this, it is closely related to the midi format (although I only have pitch and duration while midi has velocity). Sheet music is more of a guide/blueprint on how to play a piece and is more fuzzy by definition, with a rich language of articulations and annotations I cannot hope to capture without making my format overly complex. For your quesrtions: MuseScore infers the key signature from midi and it got the measure wrong - it should have been 2/4 :)


cant install libgmail in python

Question: i'm a newbie in python , and trying to install libgmail ..
this is what i get :
C:\libgmail-0.1.11>setup.py
Traceback (most recent call last):
  File "C:\libgmail-0.1.11\setup.py", line 7, in <module>
    import libgmail
  File "C:\libgmail-0.1.11\libgmail.py", line 96
    exec data in {'__builtins__': None}, {'D': lambda x: result.append(x)}
            ^
SyntaxError: invalid syntax

i think that the libgmail is a bit older then my python version , but dont know how to solve it, please help :-)
thanks in advance
Amitos80
Comment: Looks like your Python version is too old.
Comment: @Noufal: I would guess it's too *new*
Comment: @user349063: This is a bit tangential. I used libgmail to access a Gmail inbox and found that it did not work. I later learned that libgmail is not actively maintained. Finally I switched to Python's imaplib and used it successfully to do what I wanted.
Comment: Eli : Correct. Mea culpa
Answer: Which version of Python are you using? It's possible it's 3.x which doesn't understand exec as a statement (in Python 3, exec, like print became a function and is no longer a special keyword/statement).
The solution is to either find a port of libgmail to Python 3, or install Python 2.7 for yourself instead.
Answer: What version of libgmail are you installing?
I succesfully installed mechanize( on which libgmail was depending) and libgmail by easy_install minute ago.

cant install libgmail in python


Problema ao inserir dados com métodos. Java/Mysql

Question: Recebo o seguinte erro quando tento adicionar um novo dado em uma tabela do meu Banco de Dados. Possuo uma classe cujo nome é Banco de Dados , outra cujo nome é ShowMenu e outra cujo nome é Principal.
E recebo o seguinte erro:
Exception in thread "main" java.lang.NullPointerException
    at BancoDeDados.addDespesa(BancoDeDados.java:27)
    at ShowMenu.novoTipo(ShowMenu.java:55)
    at ShowMenu.menu(ShowMenu.java:30)

Acredito que o erro estaria na comunicação dos métodos addDesp com o novoTipo.
ShowMenu.java
public void novoTipo() throws SQLException{
    BancoDeDados insertInto = new BancoDeDados();
    String nomeDesp;
    System.out.println("\nDigite o nome da despesa:");
    nomeDesp = teclado.next();
    insertInto.addDespesa(nomeDesp);
}

BancoDeDados.java
public class BancoDeDados {

private Statement comando;

public void conexao(){
    try {
        System.out.println("Conectando ao Banco de Dados..");
        Class.forName("com.mysql.jdbc.Driver");
        Connection conexao = DriverManager.getConnection("jdbc:mysql://localhost:3306/despesas?useSSL=true","root","local");
        comando = conexao.createStatement();
        System.out.println("Conectado. \n");
    } catch (ClassNotFoundException | SQLException e) {
        System.out.println("Erro na Conexão");
    }
}

public void addDespesa(String addDesp) throws SQLException{
    String sqlInsert, sqlSelect;
    sqlInsert = "insert into tipo_de_despesa(descricao) values ('"+addDesp+"')";
    comando.execute(sqlInsert);
}

}
Comment: Relacionada: [Buscando variável de outro método da mesa Classe Java](https://pt.stackoverflow.com/q/237976/28595)
Comment: Cara porque você não questionou na outra pergunta?
Comment: Desculpe achei que não poderia ter questionado na mesma.
Comment: Você não iniciou a variavel comando, por isso ela está null. O método conexao precisa ser chamando antes do metodo addDespesa. Você leu o link que deixei na outra resposta?
Answer: comando nunca foi inicializado e você tenta utilizar
comando.execute(sqlInsert);

Daí ocorre o erro, pois comando é null.
Antes de chamar addDespesa, lembre de inicializar seu objeto comando dessa forma:
comando = conexao.createStatement();


Renaming a TFS Server

Question: Having set-up a TFS server, I subsequently decided to rename the server (it is on a VM so it's been renamed for network purposes).  When I now go into TFS Management Console on the server, I'm getting:
SQL Access Denied

For Server URL, Noritifcation URL and various other settings.  Obviously this is caused by them still looking for the SQL Server instance at the old server name.  My question is: can I change this, or does it require a re-install of TFS Server?
I'm running TFS Server 2013 on Windows Server 2008-R2.
Below is a screenshot; the areas in blue are showing the old server name still.

EDIT:
Following @DanBig's suggestion and link below, the access denied message is now resolved (the key was editing the web.config file in the TFS directory).  However, The application tier is now pointing at the old server name (this time highlighted in yellow below):
Comment: Screenshot please
Comment: Screenshot provided
Answer: Login to SQL server through Management Studio and run this:
select @@servername

The output will likely reflect the old hostname of the server. If so, run this script, and restart the service.
exec sp_dropserver '<oldhostname>\instance'
go
exec sp_addserver '<newhostname>\instance' , local
go

Once the service is restarted, open a new query and run the first script again, it should now reflect the new hostname.
To change the data and applcation tier settings, you need to edit web.config for each.
App tier: C:\Program Files\Microsoft\"tfs dir"\Application Tier\Web Services\web.config
<add key="applicationDatabase" value="Data Source=**computer_name**;Initial Catalog=Tfs_Configuration;Integrated Security=True;" />

Comment: Take a look at this link. http://msdn.microsoft.com/en-us/library/ee248587(v=vs.100).aspx
Comment: Whilst that certainly did work in changing the servername for SQL, TFS is still listing the data tier as the old server name, and it still gives an error saying that it can't access the DB.
Comment: Many thanks for this.  I think it got me 80% of the way there; I've edited my post with what happened after following that document.
Comment: I'm not particularly sure why, but restarting the server a few times seems to have corrected this
Comment: Nice answer. Truly helped me. I wish I could plus many times.
Comment: ***Addition to the above answer for those using Team Foundation Server 2015.*** Team Foundation Server 2013 & Below: > App tier: C:\Program Files\Microsoft\"tfs dir"\Application Tier\Web
> Services\web.config Team Foundation Server 2015: > App tier: C:\Program Files\Microsoft Team Foundation Server 14.0\Application
> Tier\Web Services

Renaming a TFS Server


Salvar estado de uma CheckBox

Question: Estou precisando salvar o estado das minhas CheckBox, elas estão dentro de um Spinner, e sempre que eu abro o Spinner ele limpa as CheckBox.
AdmListagem.java
        final String[] select_qualification = {
                "Todos", "1", "2", "3", "4",
                "5", "6"};
        Spinner spinner = (Spinner) findViewById(R.id.spinner);

        ArrayList<StateVO> listVOs = new ArrayList<>();

        for (int i = 0; i < select_qualification.length; i++) {
            StateVO stateVO = new StateVO();
            stateVO.setTitle(select_qualification[i]);
            stateVO.setSelected(false);
            listVOs.add(stateVO);
        }
        MyAdapter myAdapter = new MyAdapter(AdmListagem.this, 0,
                listVOs);
        spinner.setAdapter(myAdapter);

spinner_item2.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <TextView
        android:id="@+id/text"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="25dp"
        android:paddingTop="10dp"
        android:paddingRight="10dp"
        android:paddingBottom="10dp"
        android:textSize="16dp"
        android:textColor="#000000"
        android:background="@drawable/spinner_item_border" />

    <CheckBox
        android:id="@+id/checkbox"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true" />
</RelativeLayout>

MyAdapter.java
public class MyAdapter extends ArrayAdapter<StateVO>  {
    private Context mContext;
    private ArrayList<StateVO> listState;
    private MyAdapter myAdapter;
    private boolean isFromView = false;
    String[] values;
    Boolean[] checkedStatus;

    public MyAdapter(Context context, int resource, List<StateVO> objects) {
        super(context, resource, objects);
        this.mContext = context;
        this.listState = (ArrayList<StateVO>) objects;
        this.myAdapter = this;
    }

    @Override
    public View getDropDownView(int position, View convertView,
                                ViewGroup parent) {
        return getCustomView(position, convertView, parent);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        return getCustomView(position, convertView, parent);
    }

    public View getCustomView(final int position, View convertView,
                              ViewGroup parent) {

        final ViewHolder holder;
        if (convertView == null) {
            LayoutInflater layoutInflator = LayoutInflater.from(mContext);
            convertView = layoutInflator.inflate(R.layout.spinner_item2, null);
            holder = new ViewHolder();
            holder.mTextView = (TextView) convertView
                    .findViewById(R.id.text);
            holder.mCheckBox = (CheckBox) convertView
                    .findViewById(R.id.checkbox);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        holder.mTextView.setText(listState.get(position).getTitle());

        // To check weather checked event fire from getview() or user input
        isFromView = true;
        holder.mCheckBox.setChecked(listState.get(position).isSelected());
        isFromView = false;

        if ((position == 0)) {
            holder.mCheckBox.setVisibility(View.INVISIBLE);
        } else {
            holder.mCheckBox.setVisibility(View.VISIBLE);
        }
        holder.mCheckBox.setTag(position);
        holder.mCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                int getPosition = (Integer) buttonView.getTag();
                String t = String.valueOf(getPosition);
                Toast.makeText(mContext, t, Toast.LENGTH_SHORT).show();

            }
        });
        return convertView;
    }

    private class ViewHolder {
        private TextView mTextView;
        private CheckBox mCheckBox;
    }
}

StateVO.java
public class StateVO {
    private String title;
    private boolean selected;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }
}

Ao executar a aplicação e no Spinner escolher os itens, e clicar na tela, e abrir o Spinner novamente ele está sem nenhuma marcação nas CheckBox
Comment: Use variáveis estaticas para isso ou sharedpreferences, tambem pode te ajudar a salvar o valor
Comment: @Matheus Conseguiria me dar uma ajuda me mostrando como ficaria ?
Comment: Então... é que é um processo um pouco trabalhoso, no seu caso você terá que acessar os filhos do seu spinner, e ver qual filho é o checkBox, depois quando for clicado no botão para checar, salvar em uma variavel ambiente que seria as Sharedpreferences...
Comment: @Matheus, Ah sim, então vou tentar utilizar isto que você falou
Answer: Suponho que a razão do campo selected da classe StateVO seja para isso mesmo.
No adapter use-o para guardar e recuperar o estado do CheckBox.
A parte de recuperar já você fez. Falta a parte de guardar, que deve ser feita no onCheckedChanged()
public View getCustomView(final int position, View convertView,
                          ViewGroup parent) {

    ...
    ...
    // To check weather checked event fire from getview() or user input
    isFromView = true;
    holder.mCheckBox.setChecked(listState.get(position).isSelected());
    isFromView = false;

    //holder.mCheckBox.setTag(position);
    holder.mCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if(isFromView)return;

            //int getPosition = (Integer) buttonView.getTag();
            String t = String.valueOf(position);
            Toast.makeText(mContext, t, Toast.LENGTH_SHORT).show();

            //Guarda o estado do CheckBox
            listState.get(position).setSelected(isChecked);

        }
    });
    return convertView;
}

Notas:

Não há necessidade de guardar a posição do item na tagdo CheckBox.
Desde que positionseja declarado como final é possível usá-lo dentro do método onCheckedChanged().
Usei a flag isFromView para que o método onCheckedChanged() retorne de imediato de forma a que o Toast seja apresentado apenas quando o usuário clicar no CheckBox.
Se não quiser fazer uso da flag e continuar a usar a tag, para que seja obtida a posição correcta no método onCheckedChanged(), esta deve receber o valor da posição antes da linha   holder.mCheckBox.setChecked(listState.get(position).isSelected());
Comment: Tentei fazer assim, porem as vezes ele não salva e quando salva ele embaralha as checkbox que estão selecionadas, por exemplo marcando as duas ultimas, quando eu abro ta a 2 e a 3.
Comment: Não vejo porquê. Ele também troca o texto?
Comment: Não, ele não troca a posição dos textos, eu havia tentado antes porém esqueci de mencionar na pergunta.
Comment: Eu faço sempre assim e funciona. A única diferença é que não uso a `tag` para guardar a posição, uso `position` directamente. No entanto não vejo que isso seja problema.
Comment: Nossa estranho então, devo ter feito algo errado, porém onde não sei
Comment: Julgo que descobri o problema: ao fazer `holder.mCheckBox.setChecked(listState.get(position).isSelected());`antes de "setar" a tag a posição obtida por `getTag()` no `onCheckedChanged()` ´obtida uma posição errada. 3 formas de resolver: 1 - usar a flag `isFromView`; 2 - "setar a `tag` antes; 3 - usar `position` em vez de `getTag()`. Vou alterar a resposta.
Comment: Conseguiria editar a pergunta me mostrando como alterar aqui ? Se sim muito obrigado.
Comment: Eu já inclui na resposta as alterações que deve fazer no código. A pergunta não deve ser editada senão as respostas ficam sem sentido.
Comment: Eu acabei errando no que falei deveria ter falado "Editar sua resposta"
Comment: Consegue entender as alterações que fiz? Apenas comentei algumas linhas, usei `position`em vez de `getPosition`, adicionei `if(isFromView)return;` e  `listState.get(position).setSelected(isChecked);`
Comment: Muito obrigado, entendi sim as alterações me ajudou muito e valeu pela atenção cara

Salvar estado de uma CheckBox


Como alimentar SELECT com Webservice SOAP em PHP?

Question: Tenho de listar um em um SELECT (html) produtos de uma empresa utilizando um webservice. Algum código exemplo ?
Código Cliente:
<?php
    //cliente

    //inclusao do arquivo NUSOAP
    require_once('lib/nusoap.php');

    //criacao de uma instancia do cliente
    $client = new nusoap_client('http://127.0.0.1/webservicephp/server2.php');

    //chamada do metodo SOAP
    $result = $client->call('listaProdutos');

    //exibe o resultado
    print_r($result);

Código do Server:
<?php
    //server
    //inclusao do arquivo NUSOAP
    require_once('lib/nusoap.php');

    //criacao de uma instanca do servidor
    $server = new soap_server;

    //registro do método
    $server->register('listaProdutos');

    function listaProdutos(){

        $produtos = "produto1"."produto2";
        return $result;
    }

    //requisição para uso do serviço
    $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ?
    $HTTP_RAW_POST_DATA : '';

    $server->service($HTTP_RAW_POST_DATA);

?>

Answer: Consegui resolver desta forma:
Código server
<?php
    //server
    //inclusao do arquivo NUSOAP
    require_once('lib/nusoap.php');

    //criacao de uma instanca do servidor
    $server = new soap_server;

    //registro do método
    $server->register('listaProdutos');

    function listaProdutos(){

        $produtos = array("volvo","saab","mercedes","audi","fiat","bmw");
        return $produtos;
    }

    //requisição para uso do serviço
    $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ?
    $HTTP_RAW_POST_DATA : '';

    $server->service($HTTP_RAW_POST_DATA);

?>

Código cliente
<?php
    //cliente

    //inclusao do arquivo NUSOAP
    require_once('lib/nusoap.php');

    //criacao de uma instancia do cliente
    $client = new nusoap_client('http://127.0.0.1/webservicephp/server2.php');

    //chamada do metodo SOAP
    $result = $client->call('listaProdutos');

?>

<select>
  <?php

        //exibe o resultado
        $top = sizeof($result) - 1;
        $bottom = 0;
        while($bottom <= $top)
        {
            echo '<option value='.$result[$bottom].'>'.$result[$bottom].'</option>';
            $bottom++;
        }
  ?>

</select>


Application does not run for domain admins

Question: I have an interesting problem I have been dealing with for 2 days now.
I have an application connectship warehouse shipping v 6.5 running on Windows 7.  I have been in contact with customer service and they unfortunately could not find a solution besides make everyone a local admin on the box.
When i launch CSWShipping.exe located in "C:\Program Files (x86)\ConnectShip\Progistics\CSW\ShippingApplication\CSWShipping.exe"

If I log in as a domain user i get run-time error -2146233036 (80131534)
If I log in as a domain admin i get run-time error -2146233036 (80131534)
If I set my domain user to a local user i get run-time error -2146233036 (80131534)
If I set my domain user to a local admin it will work just fine.

The one interesting thing is when I installed the application as a domain admin, I was able to launch it and it worked fine, the user account i used to install the application is not a local admin on the box and the application still works fine.
Things i have tried that don't work:

Changed permission on the application and folders to "everyone" and removed inheritance.
Changed the compatibility mode for all users
Changed the privilege level to "Run this program as an administrator" for all users.
Right click run as administrator

When I try to run the application I do not get any UAC warnings
No errors in the event viewer.
I'm at a loss and really do not want to install a bunch of 3rd party software.
Comment: You don't need a bunch of 3rd party software. Instead, switch your shipping solution to a product from this millennium that doesn't fail without admin rights.
Comment: Bad code is more powerful than good admins.
Answer: You can monitor what the program is doing using a special diagnostic tool called Process Monitor from Microsoft, and from there potentially determine what is not working.
https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx
I've used this tool from Mark Russinovich for probably 12-15 years now, when dealing with user rights problems trying to run cruddy old Windows 3.1 / 95 / 98 programs that demand excessive file/registry permissions on NTFS and Windows 2000, XP, and then Windows 7 with UAC.
Though be warned, this tool spews thousands of lines of status data from every running system program when you launch it, so it is often helpful to go down the list and exclude nearly every other running program it detects that you don't care about, before actually running the program you do want to test.
Ref, my own post on SysInternals about this:
http://forum.sysinternals.com/exclude-all-processes-currently-in-filter_topic27483.html
The difficulty is not overexcluding to the point that you are missing messages that you told it to suppress from other running system programs, but not also being swamped with thousands of lines of irrelevant logging data.
Explicitly ignoring all "SUCCESS" messages may also help you find errors more easily. Though this is a very advanced tool, and some things it reports are not really serious errors, such as "REPARSE" or "END OF FILE", so it can be difficult to decipher the output from it, and it may possibly not help you at all if you can't figure out how to read its logging output.
Answer: I was able to solve the issue following the steps below
Turn off UAC
Created standard user shippinguser in AD
added domain/shippinguser as a local admin on shippingpc
added shippinguser password to stored credentials.
created shortcut:
<code>%systemroot%\system32\runas.exe /user:domain\shippinguser /savecred "C:\Program Files (x86)\ConnectShip\Progistics\CSW\ShippingApplication\CSWShipping.exe"
</code>
Put shortcut  all users desktop on mm-dt-ship01
The short will launch CSWShipping.exe as local admin on the computer using domain\shippinguser
When the users double clicks the shortcut they may be prompted for a password.
The user will only have to enter the password once.
I have set the GPO to deny logon locally for this user on any PC under the domain.
Answer: I'd never heard of this software, so I googled it.  Unfortunately, in my experience some of these specialized software packages for very specific markets... well.
The actual error message is a .NET framework error:  An exception was thrown by a type's initializer.  That could be a lot of things, but I'm going to guess that those users don't have permissions to access a needed assembly (but local administrators do).
Your choices are looking for related files and granting the user running the application privileges on those files, or granting local admin rights to that user.  Since you granted the directory to everyone, maybe the app put something in Windows (or another directory).
Good luck!


Problem with Tempo in the Adagio from Violin Sonata No.1 in G minor, BWV 1001 from Bach

Question: I'm starting to studying the Adagio from Violin Sonata No.1 in G minor, BWV 1001.
Normally I have some rhythm problems, and in this case I don't feel the pulse, my teacher has told me to study with 16 clicks per measure, in other words 1 click for every semiquaver.

How can I use the metronome for studying this piece?
What is the best way to perceive and get a feel for the tempo?
Comment: It's familiarity.  Listen to heaps of different recordings.  Try and find the quaver pulse, and fit the smaller notes in naturally.  Be careful not to sound mechanical in the rhythm.  Let it flow naturally.
Answer:
I don't feel the pulse

Most people play the piece very freely, without much sense of pulse, so it's not surprising.

my teacher has told me to study with 16 clicks per measure

That's a good suggestion.  You can also try 8 or 32.  Change from one to the other.  See what works best for you.  (Hint: this will change as you become more familiar with the piece.)  If you have access to a metronome that offers clicks with different pitches to help define the meter, try using that.  Most metronome apps I've seen offer this option.
Also vary the tempo itself.  Another problem you might have with the meter in this piece is that there is such a range of note durations.  When you practice slow, to get all the notes in, you will lose sight of the crotchet beats because they are so far apart.  You can also practice faster, and just drop the notes you can't play yet.  Try playing just the first note of a group of semiquavers, or leaving them out entirely.  This will give you a sense of the meter and of the shape of the phrases that comprise long notes, so you understand the structure of the piece a little better.
Start by practicing strictly in tempo.  Then, as you become more comfortable with the piece, reduce the number of metronome clicks from 16 to 8 to 4, and so on.  This will allow you to introduce more metrical freedom into the piece.  At the end, even if you are playing the piece quite freely, you should still be hearing or feeling the metrical pulse in your mind's ear, even if it is faster or slower at certain points than at others.
Answer: Not really an answer but a few different comments:

When you're having the metronome tick 16 beats, run it a little bit slower - you naturally will play a little faster with fewer clicks.

At some point, you should have the metronome tick 4 while you're still counting 16.  If you can't do that and play, practice doing that without playing.

You should also sing the piece - you don't have to sing well; the point is to give you a chance to figure out what the piece should sound like without simultaneously devoting mental energy (even subconscious) to working out where your fingers and bow should go.


Exporting data frames to Excel using write.xls using Windows 7 (using R)

Question: I am trying to export a bunch of data frames to excel using the write.xls function in R
Desired Outcome: The selected data frames should be exported to R
Error Message: [1] "Does 'python' exist, and is it in the path?"

Reproducible Code:
purchase_year <- c(2007,2007,2007,2008,2008,2008,2009,2009,2009,2009,2009)
sold_year <- c(2007,2008,2009,2009,2010,2011,2009,2010,2011,2012,2013)
units <-c(1,4,4,8,3,1,3,1,1,0,2)
df <- data.frame(purchase_year,sold_year,units)

library(dataframes2xls)
  write.xls(df,"C:/WORK/OUTPUT.xls", sh.names = "default", formats = "default",
            t.formats = FALSE,  fnt.metr = "default",
            col.widths = 48, col.names = TRUE, row.names = FALSE,
            to.floats = "default",  python = "python",
            py.script = "default", sh.return = FALSE)

Other Information:

I am working on a 32bit windows 7 machine
Installed Python 3.2.2 as well
went through the documentation of write.xls
Did try my best looking up this and the other forums
Tried including the URL of the python 'exe' in the python argument, that dint work either

Since I'll be writing out multiple sheets across multiple worksheets, CSV does not look like an option at this point in time.
Thanks to all your help, the issue has been RESOLVED
SOLUTION

Ensuring that the correct version of Python is installed. dataframes2xls is designed to work with Python 2.x. I used 2.7.5
Python installation in my system was not accessible to R. I tried the steps outlined by David Marx which I am quoting  here: Try going to the command prompt and running the command python. If this returns an error, you need to add the path to the python executable to your PATH environment variable: computerhope.com/issues/ch000549.htm
Comment: There are other options for writing Excel files, the most popular being **xlsx** and **XLConnect** packages.
Comment: Thanks @joran will try those as well
Comment: @joran Will it be possible to demonstrate how to do this using xlsx?
Comment: Yes. The package author has demonstrated it nicely in the documentation.
Answer: I tested your code. Im running Centos though. It worked fine after I changed the output file name to just "Output.xls". Seems like either a windows problem, or perhaps you don't have python/R configured properly.
Comment: I tried installing a different version of python and its throwing up the same error. Any pointers on configuring python?
Answer: I don't know this package, but I'd bet the problem is that it's designed for python 2.x, not python 3.x (which is a slightly different language). Try installing python 2.7. You may need to uninstall your current python 3.x
Comment: I tried with Python 2.4.x and 2.7.5, and I am still getting the same error. Is there a need to specify the python version in the function argument? Any pointers on configuring python?
Comment: Try going to the command prompt and running the command `python`. If this returns an error, you need to add the path to the python executable to your PATH environment variable: http://www.computerhope.com/issues/ch000549.htm
Comment: @RaamaVi I see you're new here: welcome to the community! When a posted answer resolves your issue, you should "accept" that answer. There's a checkbox below the answer score you can click. You should accept a response here and in the other question you posted. This does several things: it alerts the community that you're issue has been resolved, it directs future people with the same problem to the answer that resolved the issue, and it increases the SO "reputation" for both you and the person who responded.


Why do my breadcrumbs see double? and How can I control them? A double question?

Question: I have a taxonomy menu that invokes a Panel variant linked to a view that uses the taxonomy term.  The display works fine, but I get a breadcrumb trail that repeats the menu path twice.  I cannot find a setting in the menu, panel or view that offers control of the breadcrumbs, in fact, since this is my first time dealing with breadcrumbs, I discovered I cannot find what controls them at all.  How do I configure breadcrumbs?
Answer: I had similar problem and find out that theme I was using had breadcrumb override function in template.php which was messing with results.


View filter, relative date

Question: Is there any way to achieve relative date in Views FILTER CRITERIA?
I need a date between 'first day of' and 'last day of'.
Views Contextual Range Filter Module does not work on Drupal 8.4.x.
Answer: The standard date Views filters in Drupal 8 have two options:

A date in any machine readable format. CCYY-MM-DD HH:MM:SS is preferred.
An offset from the current time such as "+1 day" or "-2 hours -30 minutes"

The first is an absolute date.  The second is a relative date string (I don't know why this is called an offset date).
So, add a filter, choose 'offset' as an option, and then enter your relative date.  These work for simple comparisons, and between/not between.
At runtime, the value you entered will be parsed by strtotime(); any date-like string that it will accept can be used.   This means that it will be dynamic and always be relative to when the view is executed and not when the view was created.  php|architect's Guide to Date and Time Programming has a nice appendix in it about what are parsable values (and some of the quirks).
Keep in mind that you may need to adjust the cache rules for the view to prevent stale data from being displayed.  Also, there is a bug1 regarding time zone handling that has not been committed to core yet, which may result in some weirdness.
1 Barring unforeseen problems, this will be fixed in Drupal 8.5.0.

View filter, relative date


Do I really need to specify library location for linking with automake?

Question: I am working on a multi-platform C program.  The makefile has become pretty complicated because of all the different compilers, library locations, etc. on each machine.  I figured Autoconf/Automake would be a good solution, though my previous experience using those tools was minimal.
My Makefile.am has the line LIBS=-lX11, but linking fails with the error "/usr/bin/ld: cannot find -lX11".  I can work around this by adding "-L/usr/X11R6/lib/" to the definition of LIBS, but should I really need to do that? When I run ./configure, it says:
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
So it seems like Automake should know where to find it.  Is there a way I can reference its location in Makefile.am without having to hardcode it, since the X11 libs will be in a different place on each machine?
Answer: Your Makefile.am should not set LIBS.  If you need to link with a library, configure.ac should include a check for the library and the configure script will set LIBS accordingly.  Also, Makefile.am should not specify paths to libraries.  Each system should be configured so that the precompiler can find the headers and the linker can find the libraries.  If the system is not set up so that the linker can find a library, the correct solution is for the user to specify the location in LDFLAGS rather than hard coding something in Makefile.am.  (eg, rather than adding -L/p/a/t/h to a Makefile, you should add LDFLAGS=-L/p/a/t/h to the invocation of configure.)
Comment: Thanks for the hint.  I had AC_CHECK_LIB(X11, XOpenDisplay) in there, but when it wouldn't compile, I tried to fix it by changings LIBS.  It turns out that I overlooked where ./configure says it cannot find the XOpenDisplay function in the X11 library.  That's probably the real issue here.


Zabbix getting info about active DB connections from tomcat datasource

Question: I am trying to configure zabbix to obtain information from tomcat about active jdbc connections from datasource i am add this property in a different ways like:
jmx["Catalina:class=javax.sql.DataSource,name='jdbc/someDB',type=DataSource",active]

And like:
jmx[Catalina:class=javax.sql.DataSource,name="jdbc/someDB",type=DataSource,active]

And like:
jmx["Catalina:class=javax.sql.DataSource,name=\"jdbc/someDB\",type=DataSource",active]

But avery time i get "Not supported" at this item.
Where do i wrong if so?
UPDATE: adding screenshot of property with jmxter

UPDATE: When i set key as
jmx["Catalina:class=javax.sql.DataSource,name=jdbc/someDB,type=DataSource",active]

In the zabbix items, than i get in logs this:
2014-11-19 05:50:40.136 [pool-1-thread-3] DEBUG com.zabbix.gateway.ItemChecker - getting value for item 'jmx[Catalina:class=javax.sql.DataSource,name="jdbc/someDB",type=DataSource,active]
'
2014-11-19 05:50:40.136 [pool-1-thread-3] DEBUG com.zabbix.gateway.ItemChecker - caught exception for item 'jmx[Catalina:class=javax.sql.DataSource,name="jdbc/someDB",type=DataSource,acti
ve]'
com.zabbix.gateway.ZabbixException: required key format: jmx[<object name>,<attribute name>]
        at com.zabbix.gateway.JMXItemChecker.getStringValue(JMXItemChecker.java:121) [zabbix-java-gateway-2.2.6.jar:na]
        at com.zabbix.gateway.ItemChecker.getJSONValue(ItemChecker.java:88) ~[zabbix-java-gateway-2.2.6.jar:na]
        at com.zabbix.gateway.JMXItemChecker.getValues(JMXItemChecker.java:96) [zabbix-java-gateway-2.2.6.jar:na]
        at com.zabbix.gateway.SocketProcessor.run(SocketProcessor.java:63) [zabbix-java-gateway-2.2.6.jar:na]
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_31]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_31]
        at java.lang.Thread.run(Thread.java:662) [na:1.6.0_31]

Comment: The last log clearly states that the format of the key is wrong: `jmx[Catalina:class=javax.sql.DataSource,name="jdbc/someDB",type=DataSource,active]` - it has four arguments, while it should have only two. It is also different from the third key in your list (which looks correct), which I suggested in one of the comments above. Could you please check that your item is set to `jmx["Catalina:class=javax.sql.DataSource,name=\"jdbc/someDB\",type=DataSource",active]` and post the log message for this item?
Comment: If you are using JConsole or VisualVM for accessing these JMX objects, could you please post their screenshot? Meanwhile, you might find http://serverfault.com/questions/582597/zabbix-jmx-jboss-monitoring useful.
Comment: Screenshot added. :)
Comment: Among the keys you listed, the last one looks correct. Could you please show some trace log from Java gateway when this item is queried? Log level can be set to trace in lib/logback.xml file by setting "level" attribute of "root" element to "trace".
Comment: This what i get it logs.
Comment: We originally talked about item `jmx["Catalina:...`, whereas now you posted a log for `jmx["tomcat.jdbc:...`, so it is hard to judge these two separate cases. A quick guess would be to consider changing "Active" to "active" in the item key, because that is how the word is written on the screenshot, although that is a totally different object.
Comment: You right, i change the key to the presented in the begining and update log depends on new value of the key.
Comment: Ok, i will check it ASAP and answer to you. Thank you for support. :)
Comment: Yes, i am sure that my key is:
    jmx["Catalina:class=javax.sql.DataSource,name=\"jdbc/someDB\",type=DataSource",active]
and this lead to error you see above. (
Comment: ^_^ Yei! It start to work! Thanx!!!!!!! XOXO! :)
It seems settings need some time to get to work.
Comment: How can i mark your answer as a answer to this question?
Comment: In Zabbix server configuration file, there is a parameter CacheUpdateFrequency, which tells how often to sync configuration data from the database. If it is set to a large value, that might explain why you experienced a delay before your changes were applied.
Answer: There was a question on ServerFault asked previously, which should help in the general case of creating JMX items for Zabbix. It shows how the values in JConsole match with the arguments one has to specify in Zabbix.
In your particular case, based on the screenshot you posted, the third key in the list looks correct:
jmx["Catalina:class=javax.sql.DataSource,name=\"jdbc/someDB\",type=DataSource",active]

Zabbix documentation page, which details item key syntax and escaping rules, should help getting the syntax right in the future.


OpenCL C/C++ dynamic binding library (win32 and more)

Question: I'm giving a try at OpenCL, and in order to put this in production I'd like to be able to bind dynamically to OpenCL.DLL (when under Windows), in order to handle 'gracefully' the case where no OpenCL is installed on the host computer.
Is there any available library (or code snippet) that takes care of this dynamic binding in C or C++, much like GLEW does for OpenGL ? I'd like to avoid the hassle to do it myself.
Thanks,
Answer: Here you go:
http://clcc.sourceforge.net/clew_8h.html
Comment: Thanks for the link, I gave it a try, and it looks mostly fine. I got bitten by a silent error though : as my project was built with Unicode character set, the `const char*` for the module name given to `clewInit` was silently cast to `LPCWSTR` when the `LoadLibraryW` function was called. The LoadLibrary call then failed without what seemed a good reason. Took some time to figure that out.
Answer: Since you're dealing with Win32, the easiest solution is delay loading. If you delay-load OpenCL, and the compiler-added stub fails to find it, it will call <code>__pfnDliFailureHook2(dliFailLoadLib)</code>. You can handle the error there; if you don't provide a handler you'll get the default behavior (program aborts). In either case the program will not have a static dependency on OpenCL.
Comment: Thanks for the advice. Dynamic binding is more flexible and allows to bind only available entry points (in case of support of multiple versions adding/removing functions, see OpenGL) ; would delay-loading OpenCL allow to handle this case ?
Comment: Yes, your `__pfnDliFailureHook2` can also handle cases where individual functions are unavailable, that's what argument  `dliFailGetProc` is for.
Answer: QtOpenCL http://labs.qt.nokia.com/2010/04/07/using-opencl-with-qt/


How to get the value of a function dependant on $\tan A = \frac{2+\cot \left(\frac{B}{2}\right)}{4+\cot \left(\frac{A}{2}\right)}$?

Question: The problem is as follows:

Find the value of:
$$R=\frac{\sec^2B-\cot A}{4+\csc^2 A}$$
Where $A$ is given by:
$\tan A = \frac{2+\cot \left(\frac{B}{2}\right)}{4+\cot
> \left(\frac{A}{2}\right)}$
Also assume this follows the relationship seen in the figure from
below:

The alternatives given in my book are as follows:
$\begin{array}{ll}
1.&\frac{1}{2}\\
2.&1\\
3.&\frac{1}{4}\\
4.&\frac{1}{3}\\
\end{array}$
My main issue with this problem is the half angle which is presented in the right side of this equation:
$\tan A = \frac{2+\cot \left(\frac{B}{2}\right)}{4+\cot \left(\frac{A}{2}\right)}$
I was able to spot that the figure might intend to say that $A$ and $B$ are complementary thus:
$A+B=90^{\circ}$
Therefore this makes the previous expression into:
$\tan A = \frac{2+\tan \left(\frac{A}{2}\right)}{4+\cot \left(\frac{A}{2}\right)}$
This helps a bit but again the half angle would produce a square root. I tried to follow such path. But it didn't ended very well.
After squaring and using other identities I ended up having a 8th degree equation. And certainly this wasn't intended.
So what's the trick here?. So far I'm still stuck and all sorts of manipulations don't give me results. Can someone guide me in the right path?. I'm also confused on how to better use the figure. Those other letters don't seem to help much.
It would really help me alot a method explained step by step so I can understand.
Comment: Is this really a right triangle?
Answer: We will use the identity: $$\cot (A/2) = \csc A + \cot A$$
We will equate
$$(4+\cot(A/2))\tan A = 4\tan A + \csc A \tan A + \cot A \tan A = 4\tan A + \sec A + 1$$
with
$$2+\cot(B/2) = 2+\csc B + \cot B = 2 + \sec A + \tan A$$
as given. (Here we used $A+B = 90^\circ.$) Hence $1 = 3\tan A \implies \tan A = 1/3$.
Using the diagram, we have $b = 3a$ and $c = \sqrt{10} a$. Using this information we can easily determine $\sec B$, $\cot A$ and $\csc A$; thus:
$$\frac {\sec^2 B - \cot A}{4+\csc^2 A} = \frac {\sqrt{10}^2 - 3}{4+\sqrt{10}^2}=\frac12$$
Answer: Alternative approach
Using the diagram and half-angle formulas:
$$\cot(A/2) = \frac{1 + \cos(A)}{\sin(A)}
~~\text{and}~~ \cot(B/2) = \frac{1 + \cos(B)}{\sin(B)} = \frac{1 + \sin(A)}{\cos(A)} \implies $$
$$\frac{\sin(A)}{\cos(A)} = \frac{2 + \frac{1 + \sin(A)}{\cos(A)}}{4 + \frac{1 + \cos(A)}{\sin(A)}} =
\frac{2\cos(A) + 1 + \sin(A)}{4\sin(A) + 1 + \cos(A)} \times
\frac{\sin(A)}{\cos(A)} \implies$$
$$2\cos(A) + 1 + \sin(A) = 4\sin(A) + 1 + \cos(A) \implies$$
$$\cos(A) = 3\sin(A)\implies$$

$\displaystyle \cot(A) = 3$
$\displaystyle 10\sin^2(A) = 1.$

Therefore,
$$R = \frac{\frac{1}{\cos^2(B)} - 3}{4 + \frac{1}{\sin^2(A)}}
= \frac{\frac{1}{\sin^2(A)} - 3}{4 + \frac{1}{\sin^2(A)}}
= \frac{10-3}{4 + 10} = \frac{1}{2}.$$
Answer: Let $\displaystyle t = \tan\frac{A}{2} \quad →
\tan\frac{B}{2} = \tan \left(45°\!-\frac{A}{2}\right) = \frac{1-t}{1+t}$
$\displaystyle \tan A = \frac{2+\cot\frac{B}{2}}{4+\cot\frac{A}{2}} \;\; →
\frac{2t}{1-t^2} = \frac{2+\frac{1+t}{1-t}}{4+\frac{1}{t}}\;\; → 1-t^2 = 6t
\;\; →\cot A = \frac{6t}{2t} = 3$
$\displaystyle R = \frac{\csc^2 A - \cot A}{\csc^2 A + 4}
= \frac{(3^2+1)-3}{(3^2+1)+4}
= \frac{1}{2}
$

For comparison, we solve for $\cot(A)$ with cotangent sum of angles formula.
I think it is easier to remember, negated reciprocal of tangent formula.
Trig identity: $\;\displaystyle \cot(x±y) = - \frac{1 ∓ \cot(x)\cot(y)}{\cot(x) ± \cot(y)}$
Let $\displaystyle c = \cot\frac{A}{2} \quad →
\cot\frac{B}{2} = \cot \left(45°\!-\frac{A}{2}\right) = - \frac{1+c}{1-c}$
$\displaystyle \tan A = \frac{2+\cot\frac{B}{2}}{4+\cot\frac{A}{2}} \;\; →
-\frac{2c}{1-c^2} = \frac{2-\frac{1+c}{1-c}}{4+c}\;\; → c^2-1 = 6c
\;\; →\cot A = \frac{6c}{2c} = 3$


trying to edit user profile (/user/4/edit/?destination=admin%2Fuser%2Fuser) results in error

Question: Clicking on the edit link for any user (even admin) listed in ".../admin/user/user" results in an error page.
"The page isn't redirecting properly"
Link goes something like this "edit?destination=admin%2Fuser%2Fuser"
To be honest, I don't have full access to this Drupal install so I cannot turn on/off modules to test freely.
Has anyone encountered this kind of error? Which modules could be most likely to produce this error?
Thanx in advance.
Comment: I found the culprit: Account Profile module, redirect option. I disabled that and problem solved.
Comment: Please post the solution to your question as an answer and mark it as accepted when you can.  It will make it easier for future visitors with the same problem to find a solution
Comment: I wanted too, but I'm too new here yet.
--
Last night I couldn't, but I just tried it and worked. :)
Answer: I found the culprit: the redirection option of the Account Profile module. I disabled that and the problem has been solved.


applied trigonometry: joining angles for two adjoining boards

Question: I have a trigonometic problem, as much "applied science" as it gets. (so please forgive me for asking such trivia)
I am doing wall-mounted wooden boards, made out of two planks, sitting in a corner of the room adjoined at a 45° angle. In side view they are 90° to the wall, as you would expected. Lets call this regular with a tilt angle of $\alpha=0°$:

More recently I started to slightly tilting them against a wall (so books and toys will fall off less easily), i.e. at an angle of $\alpha=5°$.

In dependency of $\alpha$, how do I calculate the angle $\beta$ (in regular design 45°)? ($\beta$ will need to grow larger than $45°$, otherwise I will have an opening gap like a draw brige…)

In dependency of $\alpha$, how do I calculate the trim angle $\gamma$ at which to cut my boards (see figure (2). How much do I need to tilt my saw blade, will have to be more "pointy" than the 90° in regular design )

(I believe, the (varying) lengths and (identical) depth of each planks does not matter and neither does thickness, if I am not mistaken. All angles measured on top surface.)
Answer: This post will probably get closed, I'm not sure if it meet the guidelines. Nevertheless, here's an attempt to help you with a basic mathematical problem involved in your woodworking.

Carefully observe how the trim angle affects elevation of horizontal plank when you join them that way.
In the first diagram $\beta$ can be noticed to be equal to $45°$ and so, $x$ will be $135°$. When the plank is cut and joined, you can see how $2x$ makes $270°$.
Now you want to reduce this $270°$ angle, or, in other words, you want to increase that $2 \beta$, or, you want to increase $\alpha$ from $0°$ to some positive angle $\alpha$
So, when your trim angle is $\gamma$ you get the sideview angle (which was earlier $\beta +\beta=90°$) equal to $\gamma+ \gamma=2\gamma$
For angle of elevation $\alpha$ from $0°$, you need $2\gamma= 90°+\alpha\;$,
i.e. ,  $\gamma=45°+\frac{\alpha}2$
Comment: At a trim angle of $\gamma= 90°$, you get the sideview angle, $180°$ (tilt angle, $\alpha =90°$). As, you decrease $\gamma$ by unit degree the side view angle gets decreased by $2°$. For $\gamma>45°$, you get positive tilt angle which you called $\alpha$, for $\gamma<45°$, you will get negative $\alpha$, i.e.,  instead of holding toys, it will make them slide off.


Check continuity of linear functionals

Question: I have to check continuity of these functionals:
1) $\mathbb{R}[X]\ni p \rightarrow X p' \in \mathbb{R}[X]$ with norm $||p||_1=\int_0^1|p(t)|dt$
2) $C[-1,1]\ni f(t) \rightarrow \frac{1}{2}(f(-t)+f(t)) \in C[-1,1]$ with supremum norm
My results are:
First of these linear functionals is not bounded, thus not continuous. The second is continuous with norm 1. Am I right?
Answer: Let denote $T$ the two linear functional.

Let the sequence $p_n(x)=nx^n$ then
$$||p_n||_1=n\int_0^1 t^ndt=\frac n{n+1}<1$$
hence the sequence is bounded but $T(p_n)=n^2p_n$ and we have
$$||T(p_n)||_1=\frac{n^2}{n+1}\xrightarrow{n\to\infty}\infty$$
hence $(T(p_n))$ isn't bounded and then $T$ isn't continuous.
We have
$$||T(f)||_\infty=\frac12\sup_{t\in[-1,1]}|f(-t)+f(t)|\le\frac12(||f||_\infty+||f||_\infty)=||f||_\infty$$
hence $T$ is bounded.
Comment: Yes, in fact by the  inequality given in my answer we have
$$||T||\le 1$$
and with $f=1$ we find that $||T||\ge1$.
Comment: And norm of the second functional is equal to $1$? (inequality is equality for $f=1$)

Check continuity of linear functionals


Mapear json utilizando jackson

Question: estou com uma dúvida em como mapear um json para um model, realmente não faço ideia para que lado ir, vi algum material na internet, mas oq me falta mesmo é entender realmente como isso funciona ali na parte do jackson. meu código segue abaixo, quem puder ajudar.
ZenviaRequest
@JsonIgnoreProperties(ignoreUnknown = true)
public class ZenviaRequest {

@JsonProperty("id")
private String id;
@JsonProperty("from")
private String from;
@JsonProperty("to")
private String to;
@JsonProperty("msg")
private String msg;
@JsonProperty("schedule")
private String schedule;
@JsonProperty("callbackOption")
private String callbackOption;
@JsonProperty("aggregateId")
private String aggregateId;
@JsonProperty("flashSms")
private boolean flashSms;

//todos os getters and setters
}

ZenviaResponse
@JsonIgnoreProperties(ignoreUnknown = true)
public class ZenviaResponse {

    @JsonProperty("statusCode")
    private String statusCode;
    @JsonProperty("statusDescription")
    private String statusDescription;
    @JsonProperty("detailCode")
    private String detailCode;
    @JsonProperty("detailDescription")
    private String detailDescription;
    @JsonProperty("mobileOperatorName")
    private String mobileOperatorName;
    @JsonProperty("received")
    private String received;

    //todos os getters and setters
    }

Minha chamada
public void senderMulti(List<ZenviaRequest> zenvia) {

   //pego a lista que recebi e faço aqui toda lógica para gerar uma String Full

    Response response = null;
    try {

        Client client = ClientBuilder.newClient();
        Entity payload = Entity.json(full); // <-----

        response = client.target("https://api-rest.zenvia360.com.br/services/send-sms-multiple")
                .request(MediaType.APPLICATION_JSON_TYPE)
                .header("Authorization", "Basic ***************")
                .header("Accept", "application/json")
                .post(payload);

        System.out.println("status: " + response.getStatus());
        System.out.println("headers: " + response.getHeaders());
        System.out.println("body:" + response.readEntity(String.class));

        // aqui meu codigo desanda, não sei oque fazer aqui
        ObjectMapper mapper = new ObjectMapper();
        String jsonInString = response.readEntity(String.class);

        List<ZenviaResponse> objList = mapper.readValue(jsonInString, new TypeReference<List<ZenviaResponse>>(){});

        response.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

O retorno do Json
status: 200
headers: {Server=[Jetty(9.2.9.v20150224)], Connection=[close], Date=[Tue, 17 Apr 2018 00:01:51 GMT], Content-Type=[application/json]}
body:{
  "sendSmsMultiResponse" : {
"sendSmsResponseList" : [ {
  "statusCode" : "10",
  "statusDescription" : "Error",
  "detailCode" : "080",
  "detailDescription" : "Message with same ID already sent"
}, {
  "statusCode" : "10",
  "statusDescription" : "Error",
  "detailCode" : "080",
  "detailDescription" : "Message with same ID already sent"
}, {
  "statusCode" : "10",
  "statusDescription" : "Error",
  "detailCode" : "080",
  "detailDescription" : "Message with same ID already sent"
} ]
  }
}

ele vem todo lindo ai, mas como consumir ele para um List de ZenviaResponse, se alguém puder me ajudar agradeço bastante.
tentando com esse código agora eu recebo esse erro abaixo.
java.lang.IllegalStateException: Entity input stream has already been closed.
    at org.glassfish.jersey.message.internal.EntityInputStream.ensureNotClosed(EntityInputStream.java:225)
    at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:832)
    at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:785)
    at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:267)
    at org.glassfish.jersey.client.InboundJaxrsResponse$1.call(InboundJaxrsResponse.java:111)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:397)
    at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:108)
    at br.com.trendplataform.rotas.ZenviaSender.senderMulti(ZenviaSender.java:122)
    at testando.main(testando.java:52)

Answer: O método readEntity(Class<T> entityType) só pode ser utilizado uma única vez por resposta, já que quando é executado, o input stream é consumido e a conexão é fechada (caso a resposta seja lida como um input stream, ele deverá ser fechado para que a conexão também seja).
No seu código, ele está sendo evocado duas vez nos seguintes trechos:
System.out.println("body:" + response.readEntity(String.class));

E:
String jsonInString = response.readEntity(String.class);

Para evitar que a exceção ocorra, inverta a ordem das linhas acima e passe a variável jsonInString como argumento para o método println:
String jsonInString = response.readEntity(String.class);
System.out.println("body: " + jsonInString);

Quanto ao uso mapeamento, você precisa fazer com que sua classe corresponda ao formato do JSON. Então você deveria ter as seguintes classes:
SendSmsMultiResponse:
public class SendSmsMultiResponse {

    @JsonProperty("sendSmsMultiResponse")
    private SendSmsMultiResponseList sendSmsMultiResponse;

    //getters e setters
}

SendSmsMultiResponseList:
public class SendSmsMultiResponseList {

    @JsonProperty("sendSmsResponseList")
    private List<SendSmsResponse> sendSmsResponseList;

    //getters e setters
}

SendSmsResponse:
public class SendSmsResponse {

    @JsonProperty("statusCode")
    private String statusCode;
    @JsonProperty("statusDescription")
    private String statusDescription;
    @JsonProperty("detailCode")
    private String detailCode;
    @JsonProperty("detailDescription")
    private String detailDescription;

    //getters e setters
}

E, para desserializar o JSON:
ObjectMapper mapper = new ObjectMapper();
SendSmsMultiResponse sendSmsMultiResponse = mapper.readValue(jsonInString, SendSmsMultiResponse.class);

Obs: o Jackson pode ser integrado ao Jersey utilizando a dependência jersey-media-json-jackson (que deve estar na mesma versão do Jersey utilizada), nenhuma configuração adicional é necessária. Caso você a adicione, você poderia ler a entidade diretamente da resposta dessa forma:
response.readEntity(SendSmsMultiResponse.class);

Mapear json utilizando jackson


Xamarin Android to edit axml. where to switch Design/Code?

Question: I'm trying to make Android app with VS2012+Xamarin.
As a WPF programmer, I usually toggle Design/Code with F7/Ctrl+F7 during XAML editing.
However, I cannot find in axml editting. (I use 'Open With...' to call XML editor).
I found Xamarin Studio has this button at the bottom left corner of the editor.
Does Xamarin+VS miss this feature? or is there any keyboard shortcut?
Answer: As there's no formal link between a layout file (the .axml file) and an Android Activity class, there's no real way for it to know what you'd want to switch to/from.
A single Activity might use more than one layout file or a single layout file might be used by more than one Activity.
I usually just arrange the tabs so that the layout file and Activity class are next to each other.
Comment: Thanks for the answer but my asking is switching between axml WYSIWYG view and its code. not Activity and axml.
Answer: This is an old one, but if you "Open With" the .axml file with

Automatic Editor Selector (XML)
Or via Resharper CNTL-T

there is a chance it will just open in XML view with no obvious way to get to Design mode.
If you "Open With" -

Android Designer (probably then Set As Default)

Then opening the file from VS (2015 at time of writing) will open in design mode and you can switch back and forth.


Is it correct to compute Bhattacharyya distance for Cauchy like, Bell shaped function?

Question: I have the algorithm (MF (Membership function) ARTMAP Neural network). Output from this algorithm are clusters in n-dimensional feature space. Over each cluster (in n+1 dimension) there is some membership function (Cauchy like - Bell shaped function), that says the membership value of some point to some cluster.
Now I want to compute overlap between two clusters. I found the Jeffries-Matusita distance. But JM use Bhattacharyya distance (I am using bhattacharyya.dist() function in R) and the reference to this R function say: Computes Bhattacharyya distance between two multivariate Gaussian distributions.
Is it correct to use this Bhattacharyya distance with Cauchy like - Bell shaped function?
Answer: If you have two Cauchy distributions, the definition of the Bhattacharyya distance (and coefficient BC) applies.  But, you cannot expect to apply the formulas you can find for multinormal distributions. Those formulas depend on the mean and covariance matrix, which do not exist in the Cauchy case!
But, we can find expression for the Bhattacharyya coefficient for the case of two Cauchy distribution. Here I will only look at the scalar case.  The cauchy density function (generalized to form a location-scale family) is
$$
   f(x; \mu, \sigma) = \frac1{\pi \sigma (1+ (\frac{x-\mu}{\sigma})^2)}
$$
The Bhattacharyya coefficient
$$
   BC(f,g) = \int \sqrt{f(x) g(x)} \; dx
$$
can be found, maybe with numerical methods, or we can try to find a formula. I will try to use maple:
z := 1/sqrt( Pi^2 * sigma1 * sigma2
        *(1+((x-mu)/sigma1)^2) * (1+((x+mu)/sigma2)^2) );
                                  1
  z := -------------------------------------------------------
                                                         (1/2)
          /              /            2\ /            2\\
          |              |    (x - mu) | |    (x + mu) ||
       Pi |sigma1 sigma2 |1 + ---------| |1 + ---------||
          |              |           2 | |           2 ||
          \              \     sigma1  / \     sigma2  //
int(z, x=-infinity..infinity) assuming sigma1 > 0, sigma2 > 0, mu > 0;
/   (1/2)          / (1/2) //     4       2       2
\2 2      EllipticK\2      \\16 mu  + 8 mu  sigma1

         2       2         4           2       2         4\//
   + 8 mu  sigma2  + sigma1  - 2 sigma1  sigma2  + sigma2 / \16

    4       2       2       2       2         4
  mu  + 8 mu  sigma1  + 8 mu  sigma2  + sigma1

             2       2         4     /     4       2       2
   - 2 sigma1  sigma2  + sigma2  + 4 \16 mu  + 8 mu  sigma1

         2       2         4           2       2         4\
   + 8 mu  sigma2  + sigma1  - 2 sigma1  sigma2  + sigma2 /^(1/2)

    2   /     4       2       2       2       2         4
  mu  + \16 mu  + 8 mu  sigma1  + 8 mu  sigma2  + sigma1

             2       2         4\             2   /     4
   - 2 sigma1  sigma2  + sigma2 /^(1/2) sigma1  + \16 mu

         2       2       2       2         4           2       2
   + 8 mu  sigma1  + 8 mu  sigma2  + sigma1  - 2 sigma1  sigma2

           4\             2\\      \\//   /      1       /    2
   + sigma2 /^(1/2) sigma2 //^(1/2)// |Pi |------------- \4 mu
                                      \   \sigma2 sigma1

           2         2   /     4       2       2       2       2
   + sigma1  + sigma2  + \16 mu  + 8 mu  sigma1  + 8 mu  sigma2

           4           2       2         4\      \\      \
   + sigma1  - 2 sigma1  sigma2  + sigma2 /^(1/2)/|^(1/2)|
                                                  /      /

In this expression $\mu$ is the midpoint of $\mu_1, \mu_2$: $\mu=\frac{\mu_1+\mu_2}{2}$ rewriting the integral using $\mu$ before invoking maple results in a simpler and more symmetric expression.
Maple gives the result in terms of the complete elliptic integral of the first kind, $K$, available in R in the CRAN package gsl.  See https://en.wikipedia.org/wiki/Elliptic_integral
Answer: Here is a more readable version of the answer by Kjetil and also here. Let the two Cauchy distributions be
$$f_\pm(x) = \frac{b_\pm}{\pi} \frac{1}{(x\mp 1)^2 + b_\pm^2}$$
where I normalized the means to unity. The Bhattacharyya coefficient between them is
$$BC = \frac{4}{\pi}\sqrt{\frac{b_+ b_-}{A_+}} K\left(\frac{A_-}{A_+}\right).$$
Here, I have introduced:
$$A_\pm = 4 + (b_+ \pm b_-)^2,$$
and $K$ is the complete elliptic integral of the first kind as defined by Mathematica's EllipticK[].
It also equals the Chernoff coefficient in this case. See this newly published reference and, less directly, this reference.


How to express these sets mathematically?

Question: I'm conducting an optimization where I have a set of ordered pairs, L. In my case:
L = (1,2) (2,1) etc.

I also have a set Wplus which is the combination of all possible combination of the ordered pairs.
Wplus = (1,1) (1,2) (2,2) (2,1) etc.

I also want a set which is like that in L, but the "reversed". In my optimization I have that L = (i,j) for a Company j and facility i. In this set, R, I want the "Company part" constant, but change the i for those of other companies. In this example:
R = (2,2) (1,1)

How do I express these mathematically? What I've done thus far is to define Wplus as:
Wplus = I union J

Where I is the set of all facility locations i and J the set of all companies j. It "feels" like this is not the correct way to do this when handling tuples, or ordered pairs? Is it correct to say that it is a union of these?
What I have done with R is:
R = Wplus \ (set difference) L

but then again, is it correct to use set unions and differences when having tuples? Is there some other more "elegant" way of achieving the definitions of the intended?
Answer: Sets do not care about order, and even merges identical elements. Union of two sets likewise just dumps all elements in both sets into one big set, where identical elements are really identical. So $\{1,2,3\} \cup \{1,3,5\} = \{1,2,3,5\}$. What you want is the cartesian product $I \times J$ which can be understood as the set of pairs with first element from $I$ and second element from $J$.
If $I = \{1,2\}$ and $J = \{a,b,z\}$ then $I \times J = \{(1,a),(1,b),(1,z),(2,a),(2,b),(2,z)\}$. Now you restrict $L \subseteq I \times J$. For example, we could have $L = \{(1,a),(2,b),(1,z)\}$.
I think you typed "other companies" when you meant "other facilities". You also didn't specify whether $L$ has only one pair for each second element (company), so your question is not well-defined. I will assume that a company may use more than one facility, and you want to specify pairs for the unused facilities. Mathematically, for each $j \in J$ you want all the pairs $(i,j)$ with $i \in I$ that do not appear in $L$. When you collect all these together you get:
$\{ (i,j) : i \in I \land j \in J \land (i,j) \notin L \}$   ["$\land$" means "and"]
This has a shorter expression:
$(I \times J) \setminus L$   [everything in $I \times J$ but excluding anything in $L$]
If you specifically want the collection for a single company $j$ it would be:
$\{ (i,j) : i \in I \land (i,j) \notin L \}$
Comment: Thank you! Yes you interpreted my lack of information correct. A follow-up question, you defined basically a set of tuples which is not present in L, which is understandable. Is there a way to define the initial set L neatly? Now, I've basically said that "L is a set of ordered pairs (i,j) where i represents the supply facilities owned by Company j".
Comment: @GustavDanell: How to define $L$ unless we know what $L$ is defined as? Your last sentence in your comment is sufficient. There will always be an interface between the real-world and mathematical language, and it will necessarily be in some natural language such as English.


Why the code goes into Infinite Loop

Question: I have just started with C and have been following "The C Programming Language" 2nd Edition by Kernighan and Ritchie. I am solving the Excercise 1.14 to print histogram for the frequencies of characters. Heres my code
#include<stdio.h>
#define FIRST_GRAPHIC_CHAR 32
#define LAST_GRAPHIC_CHAR 126
#define NUM_GRAPHIC_CHARS (LAST_GRAPHIC_CHAR - FIRST_GRAPHIC_CHAR + 1)
int main(void)
{
  int c,thisval,maxval,i,j;
  int frequency[NUM_GRAPHIC_CHARS] = { 0 };
  c=getchar();
  while(c>=FIRST_GRAPHIC_CHAR && c<=LAST_GRAPHIC_CHAR && c != '\n')
    {
      ++frequency[c-FIRST_GRAPHIC_CHAR];
      c=getchar();
    }
  printf("CASE \t\tOccurences\n");
  for(i=0;i<=NUM_GRAPHIC_CHARS;i++)
  {
    if(i+FIRST_GRAPHIC_CHAR == ' ')
    {
      printf("<space> |\t");
      for(j=0;j<frequency[i];j++)
       {
          printf("*");
       }
      printf("\n");
     }
   else
   {
     printf("%c \t|\t",i+FIRST_GRAPHIC_CHAR);
     for(j=0;j<frequency[i];j++)
     {
        printf("*");
     }
     printf("\n");
    }
  }
 return(0);
 }

Now my question is when I run this code the program goes into an Infinite loop however when I use the expression
j<frequency[i] istead of
j<=frequency[i]

in the for loop it works perfectly.Now I am unable to understand why is it going into an infinite loop? Do tell if something is wrong with the code.
Comment: I have edited the question kindly check it again. Only when I press ctrl+c the program stops otherwise it keeps on printing the *'s.
Comment: which loop is endless?
Comment: How do you know that it goes in an infinite loop? Do you know that the terminal input is character buffered, so you need to press enter or otherwise `getchar` keeps waiting?
Comment: No infinite loop here. Please be more specific.
Answer: You have undefined behavior in your code. The outer loop goes from 0 to NUM_GRAPHIC_CHARS inclusive, but you have to remember that arrays have indices from 0 to their size minus one, so you step out of bounds for the frequency array.
What will be value be of that out-of-bounds entry? No one knows, but as it might be large your inner loops might take quite some time, maybe even seem infinite.
Comment: @Abhish Yes, because when `i` equals `NUM_GRAPHIC_CHARS` you don't know what the value of `frequency[i]` will be. What if it will be 2 billion? Then you will loop two billion times!
Comment: Oh yeah...thnx for that one. I will change that in the outer loop. But actually the inner loop is the one giving the trouble. It keeps on printing the *'s until I press ctrl+c.

Why the code goes into Infinite Loop


Copiar um arquivo do servidor para uma pasta local

Question: Estou desenvolvendo uma rotina com o objetivo de copiar arquivos do servidor para uma pasta local, mas, infelizmente não copia. A ideia é que há cada um minuto os arquivos sejam copiados.
Deixei um Sleep(5000) menor para facilitar o teste. Não tem domínio no servidor e a pasta no servidor está mapeada. Poderiam dar uma olhada?
Código:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.IO;

namespace WindowsService1
{
    public partial class Service1 : ServiceBase
    {
        public Service1()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            ThreadStart start = new ThreadStart(CopiarArquivo);

            Thread thread = new Thread(start);

            thread.Start();
        }

        protected override void OnStop()
        {
        }

        public void CopiarArquivo()
        {

            for (int i = 0; i < 600; i++)
            {
                Thread.Sleep(5000);

            File.Copy(@"Z:\PARAM.SAC", @"C:\SACTRM\PARAM.SAC");
            }
        }
    }
}

Comment: Qual erro está ocorrendo ? É possível que o usuário que executa o programa não tenha permissão de acessar a pasta mapeada.
Comment: Olá Rafael. Fiz uma outra rotina faz um acesso à pasta no servidor e exibe o nome do arquivo em questa na tela. Funcionou perfeitamente, por isso não estou considerando a possibilidade de permissão.
Comment: Não mostra nenhum erro, simplesmente não copia.
Answer: Aparentemente o problema é a permissão. Mesmo que não tenha domínio no servidor, você pode criar um usuário local em cada computador, mas o nome e senha devem ser iguais em ambos os computadores. Depois execute a aplicação com esse usuário, o windows interpreta que é o mesmo usuário. Não esqueça de dar permissão de leitura (Arquivo no servidor) e escrita(pasta destino) a esse usuário.
Answer: Pode utilizar a nomenclatura UNC nos caminhos.
File.Copy(@"\\SVR\PARAM.SAC", @"C:\SACTRM\PARAM.SAC")

Também ficar atento a permissões de leitura no arquivo de origem e de escrita ao caminho de destino.
Answer: A mesma rotina, só que ao invés de um Windpws Service utilizei um Windows Form. Funcionou. Só que necessito que seja um serviço. Não tentei a solução sua Rafael pois não gostaria de utilizar usuários. Mas mesmo com este teste com WF acha ainda necessário configurar usuários ?. Obrigado.


How to fix failure of PHP code in windows:exec("rm -rf F:/tmpJob/*")

Question: I've installed UnixUtils that's why I can run this kind of commands on windows.
It's executed when browsing a PHP file(http://localhost/filename.php) on windows.
The web server is Apache.
I think it should be divided into 2 steps:
1.found user of Apache threads
2.give enough permissions to that user towards "F:/tmpJob/"
I checked httpd.conf and found:
<code>User daemon
Group daemon
</code>
But there is no "daemon" user on windows.
How to find the real user of apache threads?
Answer: 1 - Look at the properties of the Apache service in the service control manager.  Under the "log on" tab, it should have the user that the service runs as; it's "local system" by default.
2 - I don't know if you'd want to give the local system account that permission; you may want to change the Apache user, and give the new user the permission instead.

How to fix failure of PHP code in windows:exec(”rm -rf F:/tmpJob/*”)


Learning guitar for absolute beginners

Question: I suddenly have the urge to start learning guitar as a hobby and ended up buying a classical guitar, but I'm not where to start!
My goal is to adopt a fingerstyle similar to Sungha Jung and Andrew Foy, but what should my priority be when learning the guitar? I have no prior music theory knowledge except on how to identify the strings on a guitar (EADGBe). Some guidance would be very much appreciated :)
(I did take guitar lessons 5-6 years ago but quit after the first month or two because my guitar broke)
Comment: By far the simplest and most straightforward will be to resume lessons.
Comment: look here: https://music.stackexchange.com/questions/58588/need-learning-path-for-beginner-guitarist and here: https://music.stackexchange.com/questions/50822/a-beginner-looking-for-direction
Comment: What was it specifically on the guitar that broke? (If you don't know, that's okay, but it would help to know because then we'd likely know how to either find someone to fix it or offer advice)
Comment: _... what should my priority be when learning the guitar?_  The priority should be to **enjoy** it and have fun. If a classical guitar and particular style is what you think is fun, then go for it. That is one of the harder types of guitar (instrument and style) to start with, so if it doesnt feel fun consider something different (electric + blues, acoustic + country, etc).
Comment: Also, if learning scales and theory and reading sheet music seems like a drag, you should remember that you are not compelled to learn any of it in order to play the instrument _or even to master it_. I've played guitar (and bass, etc) for more than 25 years now, including 14 years in a working band - >= 3 weekends a month, paid properly, at 50-500 head count local clubs - and cant read a note of sheet and my ear was terrible for several years. Find tabulature books for the songs you want, then follow the numbers and try to mimic the song.
Answer: Your priorities should be (1) finding a decent teacher and taking lessons every other week or so, and (2) locating a music store or repair shop in your neighborhood so you can get you guitar fixed if it breaks again.
You don't want to wait 6 years again to start over.  Also, learn to take care of your guitar.  If you are lucky you might find that your local music store has a repair shop and a few local music teachers working there.  I wouldn't look for a Guitar Center or other big store.  No offense to them but they typically do not have their own repair staff.  They have a guy come in every so often and do all the jobs that have piled up.  Sometimes the work is good, sometimes not.  When you find a good luthier you want to keep them (like a good doctor or mechanic).
Classical guitar is a different beast than electric and I would not trust the average Joe to teach proper right hand technique.  If you really want to self teach I'd recommend one of two books:
Classical Guitar Method by Carcassi
The Christopher Parkening Guitar Method Vol 1
A professional classical guitarist may charge a lot for lessons.  If you live in a city with universities you will likely find music students who will be good teachers and charge a lower rate.  You may have to shop around until you find the right fit.
Comment: Would I have any luck self teaching through Youtube, seeing that there are quite a large variety of videos? In doing this, should I learn the common chords etc and become fluent and quick in transitions between chords before even considering fingerstyle? (My old guitar dropped when I hung it and snapped so I did not bother fixing it as it probably costs more than the guitar)
Comment: Youtube is a risk because (1) you cannot verify the quality of the person teaching, (2) they cannot see, hear, or feel your technique.  A teacher needs to be present in case you misunderstand what they are doing.  Some vids are blatantly wrong and following them would cause injury instead of any type of learning.
Comment: As for what to learn, technique.  You want to learn proper technique first.  Most beginner books will start with one note melodic lines first then introduce chords.  You need to develop coordination between both hands and you can't do that if you spend a year on chords then try to wake up your right hand.
Answer: its good to have ambitions, and "heroes" but take care of the walking before you run. I would seek out a recommended teacher and start there. Its a pretty lousy teacher who cannot guide a student through fixing a break in their instrument either through repair advice or a loan of an instrument.
Comment: there exist indeed lousy teachers - but also lazy students!
Comment: Did you read the OP comment on how they broke it?  Perhaps no one could've fixed it.
Comment: @ggcg he said "I did take guitar lessons 5-6 years ago but quit after the first month or two because my guitar broke" - I did not see anything saying _how_ and still don't. My point remains, a guitar is not exactly rocket science and almost everything is fixable; a decent teacher should have been able to advise a novice.
Comment: In his response to my answer the guitar dropped from the strap and "split".  It may have cost more to fix than it was worth and if the split had splayed the grain would not fit together.  Replacing a neck (for example) is not fixing a neck.
Comment: @ggcg but if you look at the post times, that _was not there_ when I answered - it follows my post by more than 30 minutes (14:41, 15:27). I do accept that it NOW is (but am unable to edit my comment to correct my statement).
Comment: Yeah but you assumed.  He also said that he quite, not that he went to his teacher with the ax.  Perhaps he didin't try and his teacher was not lazy.
Comment: My teacher was not at all lazy. The guitar neck (where the bridge is and up to the tuners) completely snapped off and I did not fix it because I figured it was way too expensive and hard to do so. Plus, I stopped guitar altogether because I was not as passionate at the time and now I'm regretting it hahaha
Answer: The priority when first starting to play guitar is to play a little guitar every day. What gets practiced gets better, when practicing focus on making clear and distinct sounds. go slowly then start ramping up the speed and complexity. Scales are a good exercise to learn as are the basic chords (E, G, and D)
I  wouldn't stress yourself out about playing a certain style, with sheet music or to a metronome. Finger style guitar is very pretty and revolves around giving each string it's own voice and plucking the strings independently mainly instead of in a chord.  Start training your ear to hear what sounds better or worse based on how your fretting and plucking the string.
Remember, part of the fun of playing guitar, like anything else, is playing with other people. Join a local acoustic guitar group and start experimenting.
A Steel String Acoustic Guitar is easier to learn on than a classical nylon string guitar. Look into the theory of chords to start learning the basic patterns.
Comment: thanks! So I should familiarise myself with scales and chords first? What kind of things should I search for in theory of chords?
Comment: yep yep, I would search for " what makes a major chords " then read about every word or phrase you don't understand.
Comment: i recommend a mix of "for fun" and "study" otherwise it becomes "too restricted in extent" or "too much information and no fun"

Learning guitar for absolute beginners


MacOSX Snow Leopard on VMWare ESXi

Question: Is it possible to run the latest version on osx snow leopard on vmware esxi? I've seen lots of documents on how to install osx snow leopard on vmware fusion and workstation but not on esxi.
Thanks
Answer: It's only supported on vSphere 5, which is released in 8 days!
Answer: Found a discussion regarding to my question.
http://www.insanelymac.com/forum/index.php?showtopic=216945&st=0
Answer: Vanilla out of the box you'll be able to install Mac OS X Snow Leopard Server, for Snow Leopard "Client" you'll need some tricks due to lack of EFI boot on VMWare ESXi

MacOSX Snow Leopard on VMWare ESXi


$\|Re(f)\|_{op}$ = $\|f \|_{op}$

Question:
Let $X$ be a linear space over $\mathbb{C}$, and $f$ ∈ $BL(X, \mathbb{C})$. Show that Re$(f) \in BL(X, \mathbb{R})$, regarded as a linear space over $\mathbb{R}$. Further, Re$(f)$ determines $f$ as follows: $f(x) = Re(f(x)) − iRe(f(ix))$, $x \in X$. If $\|\cdot\|$ is a norm on $X$, then $\|Re(f)\|_{op}$ = $\|f \|_{op}$.

The first two parts of the problem follow easily. Now, we want to show that $\|Re(f)\|_{op}$ = $\|f \|_{op}$. Define $g(x):= Ref(x)$. Clearly $\|f\|_{op} \ge \|g\|_{op}$. Indeed, $\|f\|_{op} = \sup_{\|x\|=1} |f(x)| \ge \sup_{\|x\|=1} |g(x)| = \| g\|_{op}$. Let $\epsilon >0$, then there exists $x_{\epsilon} \in X$ with $\|x_{\epsilon}\| = 1$ such that $|f(x_{\epsilon})| > \|f\|_{op}-\epsilon$. For an argument $\theta_{\epsilon} \in [0,2\pi)$ depending on the point $x_{\epsilon}$, $e^{i\theta_{\epsilon}}f(x_{\epsilon}) = f\left(e^{i\theta_{\epsilon}} x_{\epsilon} \right)$ is real. Notice that $\|e^{i\theta_{\epsilon}} x_{\epsilon}\| = \| x_{\epsilon}\| = 1$.It follows that $f\left(e^{i\theta_{\epsilon}} x_{\epsilon} \right) = Re\{ f\left(e^{i\theta_{\epsilon}} x_{\epsilon} \right)\} = g(e^{i\theta_{\epsilon}} x_{\epsilon} )$ and $$  \|g\|_{op} \ge |f(x_{\epsilon})| = |f(e^{i\theta_{\epsilon}}x_{\epsilon})| = |g(e^{i\theta_{\epsilon}} x_{\epsilon} )| > \|f\|_{op} - \epsilon. $$
Taking Infimum over $\epsilon$ both sides (I am not sure about this part, as $x_\epsilon$ depend on $\epsilon$), we get $\|g\|_{op} \ge \|f\|_{op}$. Which finishes the proof. Is this correct ?
Answer: Your proof is fine, but I would change a couple of things:

I think is much more clear if you write your last line of inequalities like: $$\|g\|_{\rm op} \ge |g(e^{i\theta_{\epsilon}}x_{\epsilon})| = |f(e^{i\theta_{\epsilon}} x_{\epsilon} )| = |f(x_{\epsilon})| > \|f\|_{\rm op} - \epsilon.$$
Instead of saying "Taking infimum over $ϵ$ on both sides" I would say something like:

Since we have proved that $\|g\|_{\rm op} > \|f\|_{\rm op}-\epsilon$ holds for every $\epsilon>0$, then we can conclude that $\|g\|_{\rm op} \ge \|f\|_{\rm op}$ (otherwise $\|g\|_{\rm op} < \|f\|_{\rm op}$, and so for $\epsilon := \|f\|_{\rm op}-\|g\|_{\rm op}>0$ we have $\|g\|_{\rm op} > \|f\|_{\rm op}-\epsilon = \|g\|_{\rm op}$).

$\|Re(f)\|_{op}$ = $\|f \|_{op}$


Quantifying statistical confidence from combining separate tests

Question: Start off with a population of 200 balls. There are 2 types of tests that can be performed: call it A and B. The results of each test is either true or false. If we randomly select 100 balls and perform only test A on it. Then perform only test B on the remainder. If we get for the first hundred, A is true = 98, A is false = 2. And for the remainder, B is true = 89, B is false = 11. What sort of quantitative statements can I make about the underlying population of 200 balls?
At at even simpler level, if we get A_(true) = 100, B_(true) = 100, chances are 100% that the underlying population is homogeneous (i.e. of a single type). But how does one compute the confidence of this statement? Do we compare it to a population of A_(true) = 50 and B_(true) = 50? But one is then comparing it to a random population. Is a Bayesian approach corresponding to different possibilities, i.e. underlying population of 1 species, 2 species, 2 species, etc., the right way to proceed?
It would be enough if people can share the thinking behind how they would go about working out the above scenario.
Answer: I'm very confused by your description, but here are some remarks that will hopefully be helpful.
If you only apply exactly one predicate to each ball, as in the example in your first paragraph, then you have no information about how the predicates are related to each other. You can estimate the univariate distribution of each predicate's values across all the balls, but not the bivariate distribution, which is what you seem interested in.

At at even simpler level, if we get A_(true) = 100, B_(true) = 100, chances are 100% that the underlying population is homogeneous (i.e. of a single type).

I disagree. It seems quite possible, in your scenario, for any number of the 100 balls not tested with A to be false on A, and similarly for B.

But how does one compute the confidence of this statement?

Careful with your terminology. "Confidence" is a term from frequentist statistics, where we don't attach probabilities to hypotheses about populations.
Comment: Thanks for your helpful comments.

For the first scenario, I see your point regarding the two predicates. If the distribution is continuous, we don't have an idea of what the joint distribution is going to look like without further assumptions.

For the second scenario, I guess I am trying to come up with something similar to a best estimator. Can't I say something like the best estimate for the underlying population is A and B are true? Can I make the statement more rigorous? This "estimator" is on the high side. How would one quantify the bias?
Comment: The distribution of predicate values has to be discrete, not continuous, but you're right, the joint distribution is a mystery without more assumptions or more data.
Comment: "Can't I say something like the best estimate for the underlying population is A and B are true?" — You can certainly make reasonable estimates for the univariate distribution of each. For example, you can treat A as determined by a [hypergeometric distribution](https://en.wikipedia.org/wiki/Hypergeometric_distribution), where you have a sample of 100 trials, all of which are successes, from a population of 200 trials, and you want a confidence interval for the population number of successful trials.


PIP MVC - PHP Controllers

Question: Hi I'm pretty new to MVC framework. I decided to build a small application in MVC to get better understanding.
I googled around and found PIP framework that i can use for simple application and then modify once i will get complete understanding.
PIP can be found here
Now i have one question that by looking to PIP framework, do i need to design to new controller for every page that i will use.
For e.g
applications/
      views/
        home.php
        about.php
        contact.php
      controllers/
         main.php
         aboutus.php ??
         contactus.php ??

For eg. my default controller and view is main.php and home.php and i have a controller for main.php as below:
<?php
     class Main extends Controller {

     function index()
     {
        $template = $this->loadView('home');
        $template->set('title', "Welcome Homepage");
        $template->render();
      }
  }
?>

So, in this way, do i need to create new conrollers for about and contact.php
Comment: Yes you need a controller for every request. However, most MVC frameworks have **routes**, where you can select default controllers, or specific routes that might let you select a "main" controller to handle different method pages.
Answer: PIP's routing is internalized and requires a specific scaffolding of your controllers:
When you go to:
example.com/main

It looks for the controller main and then the function index by default.
If you were going to have 1 controller per view, then it would be something like:
example.com/main
class Main extends Controller

example.com/about
class About extends Controller

example.com/contact
class Contact extends Controller

However, if you went with a default page controller, this would greatly simplify the scaffolding:
example.com/page/{about|contact|main}

class Page extends Controller {
    public function about (){

    }

    public function contact(){

    }

    public function main(){

    }
}

Now 1 controller will handle the delivery of each of these pages.
Comment: can't i modify to use routing file??
Comment: and with ur approach, `page` will always be visible in my URL nd that is something not nice.
Comment: @Gags While that's absolutely true, you can change the Routing structure yourself ( i don't know how PIP's works ) and point to to a specific action within a specific controller.
Comment: Okii.  But then how can i make sure that page does not appear even in routes.php. I am not aware if page will be visible or not in url if i am using routing.
Answer: With pip the URL defines the controller and function that will be executed. If you want the contact page to be at mysite.com/contact, you do need to add a Contact controller.
You do not need to create a new controller for every page. Lets assume you had a forum. You could have the following urls:

mysite.com/blog/write
mysite.com/blog/view/15

These different URLs would all be handled in one controller, blog.php
<?php

class Blog extends Controller {

    public function write()
    {
        echo 'Hello World!';
    }

    public function view($postId)
    {
       echo 'Viewing post: ' . $postId;
    }
}

Comment: no, but here you are again emphasizing on one blog page which have write and view. but i am talking about multiple pages
Comment: Lets talk about pages as separate URLs. In my example you have 2 pages, `.com/blog/write/` and `.com/blog/view/13`. You can re-use the controller as long as you don't mind the first path being the same `.com/blog/`. If you want to have different paths eg: `.com/path1` and `.com/path2` you'll need different controllers.
Comment: This helped me now when i was designing blog of the website.
Answer: I also used PIP as a starter framework, and extended it to include some additional functionality.  I even started to document my efforts, but other projects have taken me in other directions.
Happy to share what I have, and some documentation on my PIP efforts can be found at http://www.shed22.com/pip.
Let me know if you would like a copy of the source code and a sample application.
Stephen

PIP MVC - PHP Controllers