text:
Q: Pass Value from ListView To EditText I get an activity which one has 3 Clickables EditTexts which are 3 differents Searchables ListViews with MatchCode by ButtonClick starts a new activity
but when i get for example the first value(1° EditText) on ListView it appears in the EditText(MainActivity) how is expected and when i call the 2nd and 3rd EditText which one are other clickable and get the values, erase all the others EditTexts in the activity any ideas why this is happenning ??
I know that i might need to treat the actions with an intent to set and get the values, but i'm in trouble with that so i'm posting the code and the photo to let you guys help me,
probably its some simple solution that i don't know or with i'm not able to do that, tell me how can i get a solution for that...
Here is a photo with whats is happening:

And here is my code in my main activity
public class Formulario_ItemNota extends Formulario_Nota {
private ListView listaProblemas;
private ItemNota_Helper itemnota_helper;
private List<ItemNota> itemnotas;
private ItemNota itemnotaSelecionado;
private Intent int_conjunto;
private Intent int_problema;

private EditText ETconjunto;
private EditText ETproblema;

protected void onCreate(Bundle savedInstanceState) {
    System.out.println("Daniel: onCreate" + new Date());

    super.onCreate(savedInstanceState);
    setContentView(R.layout.form_itemnota);

    this.itemnota_helper = new ItemNota_Helper(this);

    ETconjunto = (EditText) findViewById(R.id.ET_conjunto);
    ETconjunto.setOnClickListener(new OnClickListener() {
        public void onClick(View view) {
            Intent material = new Intent(Formulario_ItemNota.this, ListaMateriais.class);
            startActivity(material);
        }
    });

    ETproblema = (EditText) findViewById(R.id.ET_problemas);
    ETproblema.setOnClickListener(new OnClickListener() {
        public void onClick(View view) {
            Intent problema = new Intent(Formulario_ItemNota.this, ListaProblemas.class);
            startActivity(problema);
        }
    });

    final EditText ETprocedencia = (EditText) findViewById(R.id.ET_procedencia);
    ETprocedencia.setOnClickListener(new OnClickListener() {
        public void onClick(View view) {
            Intent procedencia = new Intent(Formulario_ItemNota.this, ListaProcedencia.class);
            startActivity(procedencia);
        }
    });

    Intent int_conjunto = getIntent();
    String tEXT_conjunto = int_conjunto.getStringExtra("TextMateriais");
    EditText et_conj = (EditText) findViewById(R.id.ET_conjunto);
    System.out.println("conjunto: " + et_conj);
    ETconjunto.setText(tEXT_conjunto, TextView.BufferType.EDITABLE);

    Intent int_problema = getIntent();
    String tEXT_problema = int_problema.getStringExtra("TextProblemas");
    EditText et_problema = (EditText) findViewById(R.id.ET_problemas);
    System.out.println("problema: " + et_problema);
    ETproblema.setText(tEXT_problema, TextView.BufferType.EDITABLE);

    Intent int_procedencia = getIntent();
    String tEXT_procedencia = int_procedencia.getStringExtra("TextProcedencia");
    EditText et_procedencia = (EditText) findViewById(R.id.ET_procedencia);
    et_procedencia.setText(tEXT_procedencia, TextView.BufferType.EDITABLE);

    Stara_DB ItemNotaDao = new Stara_DB(Formulario_ItemNota.this);
    itemnotas = ItemNotaDao.getListaIN();
    ItemNotaDao.close();

    ArrayAdapter<ItemNota> adapter = new ArrayAdapter<ItemNota>(this, android.R.layout.simple_list_item_1, itemnotas);
    listaProblemas = (ListView) findViewById(R.id.lista_descr_problemas);
    listaProblemas.setAdapter(adapter);
    registerForContextMenu(listaProblemas);

}

private void carregaListaItemNota() {
    Stara_DB ItemNotaDao = new Stara_DB(Formulario_ItemNota.this);
    List<ItemNota> itensnotas = ItemNotaDao.getListaIN();
    ItemNotaDao.close();

    ArrayAdapter<ItemNota> adapter = new ArrayAdapter<ItemNota>(this, android.R.layout.simple_list_item_1, itensnotas);
    this.listaProblemas.setAdapter(adapter);
}

public void onCreateContextMenu(ContextMenu menuItem, View vItem, ContextMenuInfo menuInfoItem) {

    super.onCreateContextMenu(menuItem, vItem, menuInfoItem);
    listaProblemas = (ListView) findViewById(R.id.lista_descr_problemas);
    MenuItem editar = menuItem.add("Editar");
    editar.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        public boolean onMenuItemClick(MenuItem item) {
            return true;
        }
    });

    MenuItem deletar = menuItem.add("Deletar");
    deletar.setOnMenuItemClickListener(new OnMenuItemClickListener() {

        @Override
        public boolean onMenuItemClick(MenuItem item1) {
            new AlertDialog.Builder(Formulario_ItemNota.this).setIcon(android.R.drawable.ic_dialog_alert).setTitle("Deletar").setMessage("Deseja mesmo deletar ?")
                    .setPositiveButton("Sim", new DialogInterface.OnClickListener() {

                        public void onClick(DialogInterface dialog, int which) {
                            Stara_DB ItemNotaDao = new Stara_DB(Formulario_ItemNota.this);
                            ItemNotaDao.deletar(itemnotaSelecionado);
                            ItemNotaDao.close();
                            carregaListaItemNota();
                        }
                    }).setNegativeButton("Não", null).show();
            return true;
        }
    });
}

public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.itemnotamenu, menu);
    return true;
}

public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
    case R.id.addItem:
        ItemNota itemnota = itemnota_helper.pegaItemNotaDoFormulario();

        Stara_DB ItemNotaDao = new Stara_DB(Formulario_ItemNota.this);
        itemnotas = ItemNotaDao.getListaIN();
        ItemNotaDao.insereItemNota(itemnota);
        Toast.makeText(Formulario_ItemNota.this, "Dados Salvos com sucesso", Toast.LENGTH_LONG).show();
        carregaListaItemNota();
        ItemNotaDao.close();
        return true;

    case R.id.CriarOrdem:
        Intent intentl = new Intent(Formulario_ItemNota.this, Formulario_OS.class);
        startActivity(intentl);
        return true;

    default:

        return super.onOptionsItemSelected(item);
    }
}

}
And here is one of my 3 ListViews which are the same with only different values;
public class ListaMateriais extends Activity {

    private ListView listamateriais;
    ArrayAdapter<String> adapMatchMaterial;
    EditText inputSearch;
    public EditText ETclient;
    ArrayList<HashMap<String, String>> productList;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.list_material_match);

        String products[] = { "Parafuso 3x4 092387",
                          "Cabeçote redpo 09873",
                          "alavanca de ignição 027625",
                          "Pistão de arranque 093298092",
                          "Eixo dianteiro 0343232",
                          "Cabeçote parafuseta 093232" };
        listamateriais = (ListView) findViewById(R.id.list_match_material);
        adapMatchMaterial = new ArrayAdapter<String>(this, R.layout.list_item, R.id.product_name, products);
        listamateriais.setAdapter(adapMatchMaterial);

        listamateriais.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> arg0, View v, int position,  long arg3) {
                String text= (String) arg0.getItemAtPosition(position);
                Bundle bundle = new Bundle();
                bundle.putString("TextMateriais", text);
                Intent int_material = new Intent(ListaMateriais.this,Formulario_ItemNota.class);
                int_material.putExtras(bundle);
                startActivity(int_material);
                finish();
            }
        });

        inputSearch = (EditText) findViewById(R.id.materialSearch);
        inputSearch.addTextChangedListener(new TextWatcher() {
            public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
                ListaMateriais.this.adapMatchMaterial.getFilter().filter(cs);
            }
            public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
            }
            public void afterTextChanged(Editable arg0) {
            }
        });
    }

Any helps will be truly appreciate !!!O

A: After selecting an item from your list, you are opening another instance of Formulario_ItemNota. This is why you loose your editText data.
try this:
 public class Formulario_ItemNota extends Formulario_Nota {
    private ListView listaProblemas;
    private ItemNota_Helper itemnota_helper;
    private List<ItemNota> itemnotas;
    private ItemNota itemnotaSelecionado;
    private Intent int_conjunto;
    private Intent int_problema;

    private EditText ETconjunto;
    private EditText ETproblema;
    private EditText ETprocedencia;

    protected void onCreate(Bundle savedInstanceState) {
        System.out.println("Daniel: onCreate" + new Date());

        super.onCreate(savedInstanceState);
        setContentView(R.layout.form_itemnota);

        this.itemnota_helper = new ItemNota_Helper(this);

        ETconjunto = (EditText) findViewById(R.id.ET_conjunto);
        ETconjunto.setOnClickListener(new OnClickListener() {
            public void onClick(View view) {
                Intent material = new Intent(Formulario_ItemNota.this, ListaMateriais.class);
                startActivityForResult(material, 1);
            }
        });

        ETproblema = (EditText) findViewById(R.id.ET_problemas);
        ETproblema.setOnClickListener(new OnClickListener() {
            public void onClick(View view) {
                Intent problema = new Intent(Formulario_ItemNota.this, ListaProblemas.class);
                startActivityForResult(problema , 2);
            }
        });

        ETprocedencia = (EditText) findViewById(R.id.ET_procedencia);
        ETprocedencia.setOnClickListener(new OnClickListener() {
            public void onClick(View view) {
                Intent procedencia = new Intent(Formulario_ItemNota.this, ListaProcedencia.class);
                startActivityForResult(procedencia , 3);
            }
        });

        Stara_DB ItemNotaDao = new Stara_DB(Formulario_ItemNota.this);
        itemnotas = ItemNotaDao.getListaIN();
        ItemNotaDao.close();

        ArrayAdapter<ItemNota> adapter = new ArrayAdapter<ItemNota>(this, android.R.layout.simple_list_item_1, itemnotas);
        listaProblemas = (ListView) findViewById(R.id.lista_descr_problemas);
        listaProblemas.setAdapter(adapter);
        registerForContextMenu(listaProblemas);

    }

   @Override
   protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    if (requestCode == 1) {// back from ListaMateriais.class
        if(resultCode == RESULT_OK){
            String resultFromMateriais=data.getStringExtra("TextMateriais");
            ETconjunto.setText(resultFromMateriais);
        }
    } else if (requestCode == 2) { // back from ListaProblemas.class
        if(resultCode == RESULT_OK){
            String resultFromProblemas=data.getStringExtra("TextProblemas");
            ETproblema.setText(resultFromProblemas);
        }
    } else if (requestCode == 3) { // back from  ListaProcedencia.class
        if(resultCode == RESULT_OK){
            String resultFromProcedencia=data.getStringExtra("TextProcedencia");
            ETprocedencia.setText(resultFromProcedencia);
        }
    }
  }

    private void carregaListaItemNota() {
        Stara_DB ItemNotaDao = new Stara_DB(Formulario_ItemNota.this);
        List<ItemNota> itensnotas = ItemNotaDao.getListaIN();
        ItemNotaDao.close();

        ArrayAdapter<ItemNota> adapter = new ArrayAdapter<ItemNota>(this, android.R.layout.simple_list_item_1, itensnotas);
        this.listaProblemas.setAdapter(adapter);
    }

    public void onCreateContextMenu(ContextMenu menuItem, View vItem, ContextMenuInfo menuInfoItem) {

        super.onCreateContextMenu(menuItem, vItem, menuInfoItem);
        listaProblemas = (ListView) findViewById(R.id.lista_descr_problemas);
        MenuItem editar = menuItem.add("Editar");
        editar.setOnMenuItemClickListener(new OnMenuItemClickListener() {
            public boolean onMenuItemClick(MenuItem item) {
                return true;
            }
        });

        MenuItem deletar = menuItem.add("Deletar");
        deletar.setOnMenuItemClickListener(new OnMenuItemClickListener() {

            @Override
            public boolean onMenuItemClick(MenuItem item1) {
                new AlertDialog.Builder(Formulario_ItemNota.this).setIcon(android.R.drawable.ic_dialog_alert).setTitle("Deletar").setMessage("Deseja mesmo deletar ?")
                        .setPositiveButton("Sim", new DialogInterface.OnClickListener() {

                            public void onClick(DialogInterface dialog, int which) {
                                Stara_DB ItemNotaDao = new Stara_DB(Formulario_ItemNota.this);
                                ItemNotaDao.deletar(itemnotaSelecionado);
                                ItemNotaDao.close();
                                carregaListaItemNota();
                            }
                        }).setNegativeButton("Não", null).show();
                return true;
            }
        });
    }

    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.itemnotamenu, menu);
        return true;
    }

    public boolean onOptionsItemSelected(MenuItem item) {

        switch (item.getItemId()) {
        case R.id.addItem:
            ItemNota itemnota = itemnota_helper.pegaItemNotaDoFormulario();

            Stara_DB ItemNotaDao = new Stara_DB(Formulario_ItemNota.this);
            itemnotas = ItemNotaDao.getListaIN();
            ItemNotaDao.insereItemNota(itemnota);
            Toast.makeText(Formulario_ItemNota.this, "Dados Salvos com sucesso", Toast.LENGTH_LONG).show();
            carregaListaItemNota();
            ItemNotaDao.close();
            return true;

        case R.id.CriarOrdem:
            Intent intentl = new Intent(Formulario_ItemNota.this, Formulario_OS.class);
            startActivity(intentl);
            return true;

        default:

            return super.onOptionsItemSelected(item);
        }
    }
}

and in your 3 ListActivities, you must change them like that:
listamateriais.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> arg0, View v, int position,  long arg3) {
                String text= (String) arg0.getItemAtPosition(position);

                Intent returnIntent = new Intent();
                returnIntent.putExtra("result",result);
                setResult(RESULT_OK, returnIntent);
                finish();
            }
        });


text:
Q: How do I write multiple lines to a text file in Java? So I want to create and write to a file in Java. I know how to do it with one line, but I'm wondering how I write multiple lines to a single file.
import java.io.FileWriter;
import java.io.BufferedWriter;

public class WritingToAFile {

public static void main(String[] args) {

   try{
   FileWriter fstream = new FileWriter ("P:/Computer Science/greeting.txt");
   BufferedWriter info = new BufferedWriter(fstream);

   for(int i = 1; i < 6; i++){
       info.write("Hello");
       info.newLine();
       info.write("Bonjour");
       info.newLine();
       info.write("Guten tag");
       info.newLine();
       info.write("Aloha");
       info.newLine();
       info.write("Nihao");
       info.close();
       }catch(Exception e){
          System.out.println("A write error has occurred");
    }
  }
}

I know it's wrong right now, but I'm not sure what I did wrong. Help would be much appreciated! I'm only a beginner so I'm really lost.

A: You're closing you're file each iteration - info.close(); - that's the reason you'll have the exception. You need to close the file once you'll finish to write to it.
There is nothing wrong with newLine(); approach. However you can make it shorter using new line character.
"\n" - is a new line separator for Unix-based systems.
"\r\n" -  is a new line separator for Windows systems.
"%n" is a platform independent new line separator.
for(int i = 1; i < 6; i++) {
    info.write(String.format("Hello%n"));
}
info.close();

The second issue is here that you're not closing FileWriter itself.
If you're using Java 7+, I would recommend to do it using try-with-resources to to get rid of finally blocks:
public class Main {

    public static void main(String[] args) {
        try (FileWriter fstream = new FileWriter("greeting.txt");
             BufferedWriter info = new BufferedWriter(fstream)) {
            for (int i = 1; i < 6; i++) {
                info.write(String.format("Hello%n"));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

File output:
Hello
Hello
Hello
Hello
Hello

UPDATE:
All the input-output operations require to deal with streams, channels, file descriptors (like FileWriter, BufferedWriter in your particular case). These streams should be closed carefully to release system resources. Failing to do so may lead to resources leak. Despite you closed info you forgot to close fstream in the code.
When you use the try-with-resources statement correctly, then you will never have to close streams explicitly. The try-with-resources statement ensures that each resource is closed at the end of the statement.

A: You have almost got it right, in fact, it's nothing to do with info.newLine(); but rather the syntax of your code.
Your catch is actually after your for loop, and not connected to the try.
And you also close the stream in the for loop, instead of after it has completed (this would cause an IOException).
Sample:
try {
    FileWriter fstream = new FileWriter("P:/Computer Science/greeting.txt");
    BufferedWriter info = new BufferedWriter(fstream);
    for (int i = 1; i < 6; i++) {
        info.write("Hello");
        info.newLine();
        info.write("Bonjour");
        info.newLine();
        info.write("Guten tag");
        info.newLine();
        info.write("Aloha");
        info.newLine();
        info.write("Nihao");
    }
    info.close();
} catch (Exception e) {
    System.out.println("A write error has occurred");
}

A: just add \n or \r\n  platform new line character based on system at the end of string in write method
try{
    for(int i = 1; i < 6; i++){
           info.write("Hello\n");
           info.write("Bonjour\n");
           ...

           }
    }
    catch (Exception e) {
    System.out.println("A write error has occurred");
}
finally{
    info.close();
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Cost functions for weighting sensitivity and specificity in binary classification problem I'm searching for a combination of sensitivity and specificity cost function because i want have more weight for sensitivity ( sensitivity is more impotent for me rather than specificity). After searching i found this :
Final_Cost = ( (Cb/Cg)/( 1+(Cb/Cg) )*Bg + ( 1/( 1+(Cb/Cg) ) )*Gb

Cb is misclassification cost of positive and Cg is misclassification cost of negative. Bg is number of false positive detected and Ggis number of false negative detected. We should specify Cb/Cg. Is this a good function for calculating cost? Is there any other better functions?

A: Sensitivity and specificity are in backwards time order (i.e., use reverse conditioning or Prob(X|Y)).  Hence they are not relevant to decision making.  I recommend developing a well-calibrating direct probability model then using standard decision theory.

A: (1) The ratio of FP to FN is the standard way defining a cost function. It is build into some packages: C50 and rpart or part packages I think.
(2) It is rare that I see a reasonable use of cost functions in the machine learning field. Most use the F1 score or similar metrics. If you are working in this field, I'd spend sometime finding out what the expectations are. They might not be reasonable, but you should at least know what they are.
(3) I would be think about the problem at hand before trying to develop a well-calibrated model as suggested above - unless your model is likelihood based. Most machine learning algorithms don't naturally produce well-calibrated results - they need costs defined upfront - and imagining that the output you're getting is a probability is misleading. Though much smarter people - referenced below - seem to think calibrated models are feasible. So you might want to ignore my comments.

*

*Steyerberg, E. W., van der Ploeg, T., & Van Calster, B. (2014). Risk prediction with machine learning and regression methods. Biometrical Journal. Biometrische Zeitschrift, 56(4), 601–606. doi:10.1002/bimj.201300297

*Kruppa, J., Liu, Y., Diener, H.-C., Holste, T., Weimar, C., König, I. R., & Ziegler, A. (2014). Probability estimation with machine learning methods for dichotomous and multicategory outcome: applications. Biometrical Journal. Biometrische Zeitschrift, 56(4), 564–583. doi:10.1002/bimj.201300077


text:
Q: Can a domain name be registered, but have it not appear on search engines? I need to make a personal website, but I don't want it appearing in Google or other search engines. I only want specific people to have access to it.
For example: if I buy www.example.com I want that the web pages to only be available to those who write in their browsers' URL bar that address. Not in search engines. Is that possible?
EDIT: I know about robots.txt. But that's for pages, not what I'm looking for. I'm looking for the whole domain name to be available only to those who know it.

A: The strictly correct answer is no, however you may be able to get a good part of the way there by (in addition to discouraging robots using robots.txt) get the webserver to look for a REFERER string, and behave the "Referer" is a search engine (or an unauthorised site).
Doing this depends on your server - you should be able to use mod_rewrite to match the REFERER variable if you are using Apache (Spelling is correct - its a bug in the standard).  There is nothing to stop someone from subverting this though, but it should catch a lot of automated sites.
Another solution might be to limit access to the server to your friends - for example by limiting to their IP addresses (or using a VPN), or even making sure they use specific, obscure browsers and checking for that.
Come to think of it though, the best way to do it might just be to password protect the entire site using .htaccess and give your friends the login credentials !

A: No.  When you register a domain name, it is public knowledge.  It will be impossible to keep it a secret.  The instant it appears in anything a search engine sees [facebook post, twitter message, ANYTHING], it will become "indexed".  All you can do, via robots.txt, is ask the search site to not crawl your site, but the name that got them there will still be indexed. (and, for the record, there are MANY crawlers that ignore everything in your robots.txt)


text:
Q: Relationships in different namespaces I'm a little stuck on how relationships are defined between models in different namespaces. I have created this example to illustrate my problem and have added comments with my requirements.
class User < ActiveRecord::Base
  has_one :account # meaning Account
end

class Account < ActiveRecord::Base
  belongs_to :user # meaning User
  has_many :campaigns # meaning campaigns
  has_one :account # meaning SomeCollection::Account
end

class Campaign < ActiveRecord::Base
  belongs_to :account # meaning Account
end

class SomeCollection::Account < ActiveRecord::Base
  belongs_to :account # meaning Account
  has_many :campaigns # meaning SomeCollection::Campaign
end

class SomeCollection::Campaign < ActiveRecord::Base
  belongs_to :account # meaning SomeCollection::Account
end

The one I am most confused about is the relationship between Account and SomeCollection::Account. I would expect to access an instance of this as such -
account.some_collection_account
# => <SomeCollection::Account ...>

A: You can specify a class name for each association and choose the association name like this:
has_one :some_collection_account, class_name: 'SomeCollection::Account'


text:
Q: SEF URLs i PS 1.6 returns 404 For some reason I can't get friendly URLs to work on PrestasShop installed on LAMP server. Activating returns 404 Not found. Installation located in subfolder and mod_rewrite (shared) is enabled. Custom template, but standard temp returns same error, so guess it must be a problem in .htaccess?
Any input here is greatly appreciated!
htaccess looks as follows:
# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>

RewriteEngine on
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^.*$ - [NC,L]
RewriteCond %{HTTP_HOST} ^byggbutik.se$
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>

#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

A: I really strained to make it work, but it worked eventually. In my case I solved fixing the Apache configuration.
Check the following things:

*

*AllowOverride is set to All in your virtual host Directory directive

*Directory has a full path to the website folder

This is how my virtualhost is configured:
<VirtualHost *:80>
  ServerName myclient.com
  DocumentRoot /var/www/myclient
  <Directory /var/www/myclient>
    Options FollowSymLinks Indexes
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>

  LogLevel warn
  ErrorLog ${APACHE_LOG_DIR}/myclient-error.log
  CustomLog ${APACHE_LOG_DIR}/myclient-access.log combined
</VirtualHost>

Remember to restart Apache2 after the changes.


text:
Q: Apply style setting in Activity immediately I have an Activity containing a PreferenceFragment. The user can change the app's style (light theme or dark theme) in this Activity. Now I want the change being visible immediately. That means, I want the style of the Activity changing when the user changes the style setting in the PreferenceFragment.
My idea was to listen for the preference change with OnSharedPreferenceChangeListener in the PreferenceFragment and recreate the Activity.
But I do not think this is the right way. So, what is best practice here? Thanks in advance.
UPDATE
Activity:
public class SettingsActivity extends AppCompatActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    loadSettings();

    getFragmentManager().beginTransaction()
      .replace(android.R.id.content, new SettingsFragment())
      .commit();
  }

  private void loadSettings() {
    SharedPreferences sharedPreferences =
      PreferenceManager.getDefaultSharedPreferences(this);

    boolean darkTheme =
      sharedPreferences.getBoolean(getText(R.string.pref_theme_key).toString(), false);

    if (darkTheme) {
      setTheme(R.style.DarkTheme);
    }
  }
}

PreferenceFragment:
public class SettingsFragment extends PreferenceFragment
  implements SharedPreferences.OnSharedPreferenceChangeListener {

  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.preferences);
  }

  @Override
  public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
    if (key.equals(getText(R.string.pref_theme_key))) {
      // recreate Activity
    }
  }
}

Preferences:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
  android:defaultValue="false"
  android:key="@string/pref_theme_key"
  android:title="@string/pref_theme" />
</PreferenceScreen>

A: I think your approach is correct. Listen for that preference change and then recreate your activity.
Editing for more context:
You should be saving this as a light/dark variant in your preferences and then when your activity is created call setTheme based on this before calling setContentView.


text:
Q: traceroute - What does it mean when !N appears next to a time measurement? I am running a traceroute command to host [YYY.YYY.Y.Y], and at the output is as follows:
...
e1-25-20-cr-rt-bb2-area2.ns.uwaterloo.ca (ZZZ.ZZ.ZZ.ZZ)  4.164 ms  6.741 ms  6.444 ms
 8  wms.uwaterloo.ca (MMM.MM.MMM.MM)  3.034 ms  3.612 ms  3.334 ms
 9  wms.uwaterloo.ca (MMM.MM.MMM.MM)  3.802 ms !N  5.354 ms !N  5.588 ms !N

Several sources have told me that !N means that the destination host is unreachable. However, this seems to be the case when the output is as follows:
9  wms.uwaterloo.ca (129.97.208.23)  !N  !N  !N
What does it mean when !N appears beside an elapsed time ?
I don't think I should be interpreting {elapsed_time} !N as destination unreachable since I was definitely able to reach my target destination through a web browser and through "ping".

A: wms.uwaterloo.ca sends back an ICMP Destination network unreachable message. Some protocols and port used by your traceroute are filtered. If you can create a packet capture then you will see and understand what happens under the hood.


text:
Q: Modificar DataContext de una Vista desde ViewModel WPF Buenas tardes compañeros. Me gustaría saber cómo puedo modificar el DataContext de una vista con su ViewModel, desde otro ViewModel o desde el mismo ViewModel.
public partial class Window2 : UserControl
{
    public Window2()
    {
        Window2ViewModel vm2 = new Window2ViewModel();
        DataContext = vm2;
        InitializeComponent();
    }
 }

Gracias.
Un saludo César

A: Si lo declaras fuera del constructor podrás acceder a las propiedades del VM en cualquier metodo de la clase y así modificarlo:
public partial class Window2 : UserControl
{

    Window2ViewModel vm2 = new Window2ViewModel();
    public Window2()
    {

        DataContext = vm2;
        InitializeComponent();
    }

    private void Button_Click(object sender, EventArgs e)
    {
        vm2.PropiedadViewModel = valor;
    }
 }

A: Gracias por la respuesta. Pero el código me sigue sin funcionar.
El programa es una prueba para utilizarlo luego en otro proyecto.
Básicamente son dos UserControl dentro de una ventana, cada uno con su respectivo ViewModel. Implemento los interfaces INotifyPropertyChanged y
ICommand.
En la vista1
<Button Grid.Column="0" Margin="30" Height="120"    CommandParameter="Button1ViewModelIzdo" Command="{Binding Btn1Command}">

En el ViewModel1:
   public class Window1ViewModel : NotifyBase
   {
    public delegate void EventHandler(object sender, CustomEventArgs e);
    public event EventHandler ThrowEvent;// = delegate { };

    private ICommand _btn1Command;
    public ICommand Btn1Command
    {
        get
        {
            return _btn1Command ?? (_btn1Command = new  RelayCommand((parameter) => Bnt1Action(parameter)));
        }
    }

    private void Bnt1Action(object parameter)
    {
        String msg = parameter as String;
        ThrowEvent?.Invoke(this, new CustomEventArgs(msg));
    }

En la Vista2 hay un TextBlock
  <TextBlock TextAlignment="Center" x:Name="Data" Text="{Binding   Path=Data,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>

Y en el ViewModel2
  public class Window2ViewModel : NotifyBase
{
    private Window1ViewModel _Thrower;

    public Window2ViewModel()
    {
        _Thrower = new Window1ViewModel();
        _Thrower.ThrowEvent += ( emisor, e) => { ChangeData(emisor , e);      };
    }

    private string _data;

    public string Data
    {
        get { return _data; }
        set{
                if (_data != value)
                {
                    _data = value;
                    OnPropertyChanged("Data");
                }
            }
     }

    private void ChangeData(object emisor, CustomEventArgs e)
    {
        Data = e.msg;
        MessageBox.Show("Hell0");
    }
}

La clase CustomEventArgs tiene una propedad msg.
  Pero no me lanza el evento.
¿Qué es lo que hago mal ?


text:
Q: Problem with I2C communication with sensor TSL2572 and the board STM32L152C-DISCOVERY I'm trying to communicate between board and sensor with i2c but I can't quite figure out how to do it. in the datasheet i checked all the registers and how to access them and the address of the sensor. once this was done I retrieved the HAL_I2C_Mem_Write and HAL_I2C_Mem_Read functions from the HAL library for reading and configuration. for example, to enable the sensor clock and make the ADC work I have to write raise the last two bits of the byte of the register 0x00, so I wrote the following line:
buf[0]=0x03;
HAL_I2C_Mem_Write(&i2c2, address, 0x00, 1, buf, 1, 1000);
then when I go to read the register with HAL_I2C_Mem_Read I get the value 0. the same goes for the others, for example if I read the register 0x12 I get the decimal value of 0x12 and not its content. Where am I doing wrong?
I add that I have checked the correctness of the hardware connections between the card and the sensor.


text:
Q: mkisofs is not including tar.gz file in custom iso I am customizing centos iso, i took standard CentOS-7-x86_64-DVD-1810.iso and extract it and custom folder and add my files.
Now i am recreating custom iso with below command
mkisofs -o centos-7-custom1.iso -b isolinux.bin -c boot.cat -no-emul-boot -V 'CentOS 7 x86_64' -boot-load-size 4 -boot-info-table -R -J -v -T isolinux/

its adding all files but not including one file(tar.gz) which has size of 3GB and no error.
in output no error and strange is that from one folder it including all files except this big size file.
is there any restriction?
PS: i am running this command from mac

A: Native iso9660 doesn't support files over 2GB. You need to use iso9660:1988 instead by adding -level 3 option to you command.
man 8 mkisofs:

-iso-level level
. . .
With level 3, no restrictions (other than ISO-9660:1988) do apply
. . . .

A: If you did use a recent original version of mkisofs instead of the broken modified variant you get on Centos, you did get the following warning message:
 mkisofs: Value too large for defined data type. File xxx.tar-gz is too large for current mkisofs settings (-iso-level 3 or more required) - ignoring

So your problem was to not to use a user friendly Linux distro. The message mentioned above has been added in February 2008 already.


text:
Q: Convert column stored as text in format: yyyy-mm-ddT00:00:00.000 to date in mySQL I have a dataset where a column with the format yyyy-mm-ddT00:00:00.000 is stored in text format, how do I convert it to date format using mySQL?

A: You can use STR_TO_DATE() as shown below:
select
  str_to_date(b, '%Y-%m-%dT%H:%i:%s.%f') as converted
from a;

Result:
b                        converted
-----------------------  --------------------------
2001-02-03T04:05:06:789  2001-02-03 04:05:06.789000
2020-05-26T18:19:20:213  2020-05-26 18:19:20.213000

Data script:
create table a (b varchar(23));
insert into a (b) values ('2001-02-03T04:05:06.789');
insert into a (b) values ('2020-05-26T18:19:20.213');

See running example at DB Fiddle.


text:
Q: Can I use two Gherkin Annotations on a single step implementation? Is it possible to use two different Gherkin steps on a step implementation?
@Given('a user signs up for a new "{country}" account')
@Then('Select "{country}" on country selector')
def choose_country(context, country):
    match country:
        case "Country A":
            context.country_code = "A"
        case "Country B":
            context.country_code = "B"

A: Short answer, no. It should recognize one step as not being implemented. Perhaps some steps shouldn't exist ? Here's a link to more information about the subject.


text:
Q: Writing differnet css files for different screen sizes and mobile devices I have been trying to figure this issue all day and haven't got it yet:
I want to have these 3 css files:

*

*lowerThan960pxForDesktop.css (for fluid layout)

*MobileLandscape.css (iphone 960px android 800px etc.)

*MobilePortrait.css (iphone 640px android 480px etc.)

*I want that the Lanscape.css will use the desktop.css

*I want that the Portrait.css will use both the desktop.cssand the Landscape.css

how should my HTML should look like in order to get that right - using media queries or javascript. I have gone over through this a lot of time and each time something goes wrong (either the desktop gets the mobile.css or either the iphone read the Portrait.css even that it is in landscape mode etc.).

A: maybe the Iphone problem is related to the known viewport width problem? solved with adding this to the html.
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />

besides that use media queries to call the css. and in the css file call @import to call the referring css file (e.g landscape would @import desktop etc)
media queries 101:
<link href="css/phone.css" rel="stylesheet" type="text/css"
media="only screen and (max-width: 400px)" >

and more information about the rich world of media queries here.
also adviced to use conditional IE comments to hide the media queries from older IE and let it use just one kind of css
edit: ah I now understand the problem - you need to use different css in different Iphone situations.. you could use jquery mobile and bind a css class change acording to the change from portrait to landscape and back.
hope this helps


text:
Q: loading .php file with Jquery doesnt work as expected I want to expand an html file with a .php file and i am loading it like this:
function setTicketCreate() {
    $("#content-container").load("/UserIncludes/TicketCreate.php");
}

I am working with TinyMCE and in the .php-file is a textarea which should be replaced by the tinymce editor. This doesnt happen every time only when i load the .php file like two times
    <title>Ticket Create</title>

TicketCreate

        <textarea></textarea>

The Title is shown correctly and everytime but not the editor


text:
Q: icefaces configuration I am trying to work with icefaces3. I made some examples and they perfectly work,
but when I try some examples from
http://icefaces-showcase.icesoft.org/showcase.jsf?grp=compatMenu&exp=menuBar
I get errors in:
import org.icefaces.samples.showcase.metadata.annotation.ComponentExample;
import org.icefaces.samples.showcase.metadata.annotation.ExampleResource;
import org.icefaces.samples.showcase.metadata.annotation.ExampleResources;
import org.icefaces.samples.showcase.metadata.annotation.Menu;
import org.icefaces.samples.showcase.metadata.annotation.MenuLink;
import org.icefaces.samples.showcase.metadata.annotation.ResourceType;
import org.icefaces.samples.showcase.metadata.context.ComponentExampleImpl;

Eclipse can find these classes instead the  necessary jars are automatically added to my project.
There are  icefaces jars shown in  package Explorer (which are automatically added by eclipse).
icefaces.jar
commons-logging.jar
icefaces-compat.jar
jxl.jar
krysalis-jCharts-1.0.0-alpha-1.jar
icefaces-ace.jar
icepush.jar
Please how can I solve this problem?

A: You don't need any of these classes. Remove all showcases annotations like @ComponentExample, @ExampleResources and @Menu. These annotations are just needed for icefaces showcase portal. Not very well done by icefaces...


text:
Q: Add Background image to sonata admin I work in symfony project and I use SonataAdminBundle for the Back-End.
I like to Override the template of the sonata to add a background-image to the content-section.
How can I get It ? Someone have idea ? thank you


text:
Q: Alternative form of $y = \frac{1}{1 - \left(\frac{x}{a}\right)^2}$? I solved the differential equation $y'(x) = \frac{2}{a^2}xy^2(x)$ (with $y(0)=1$ and $x\in(-|a|,|a|)$) and came to
$$
y(x) = \frac{1}{1 - \left(\frac{x}{a}\right)^2}.
$$
This looks like some trigonometric thing to me. Do you know a better form for $y$?

A: You might think of $$
\tanh'(x)=\frac1{1-x^2}.
$$
So you get
$$
y(x)=\frac{1}{1-\left(\frac{x}a\right)^2}=\tanh'\left(\frac{x}a\right)
$$


text:
Q: Adobe Analytics- Scroll depth tracking In Adobe Analytics is there a way to capture the 'Time spent' before the user scrolls?

A: You may want to check out Time prior to event.
If you send an event as a link beacon when the user starts scrolling—e.g. using Adobe Launch—the Time prior to event dimension will tell you how much time has passd before the user scrolled.
This seems to only work on the site-level, not page-level. If you need numbers for a specific page, perhaps you can create a segment that only includes hits on that particular page. That might give you the time-to-scroll on the specific page.


text:
Q: SQL / Access Object Requires Error I am intending to use the code below to insert a record into the database. However, it is throwing an object required error. I have checked and all the variables contain data.
Dim vblMealType As String
Dim vblMealQual As String

If txtMealID.ItemsSelected.Count = 0 Then

        MsgBox "Please Select a Meal Type", _
               vbOKOnly + vbInformation
Else

 MsgBox "Customer Charge Succesfull.", _
              vbOKOnly + vbInformation

Dim qdf As DAO.QueryDef

 ERROR ON THE VALUES LINE
Set qdf = dbs.CreateQueryDef("", _
        "PARAMETERS prmCustomerID Text(255), prmMealID Text(255), prmTransactionAmount Currency, prmTransactionDate Text(255);" & _
        "INSERT INTO dbo_Transactions (CustomerID, MealID, TransactionAmount, TransactionDate) " & _
        "VALUES ([prmCustomerID], [prmMealID], [prmTransactionAmount], [prmTransactionDate])")

qdf!prmCustomerID = txtCustomerID.Value
qdf!prmMealID = txtMealID.Value
qdf!prmTransactionAmount = txtCharge.Value
qdf!prmTransactionDate = Date
qdf.Execute dbFailOnError
 MsgBox "Customer Charge Succesfull.", _
              vbOKOnly + vbInformation

Set qdf = Nothing
Set dbs = Nothing

DoCmd.OpenForm "Charge Form"
DoCmd.Close acForm, Me.Name

A: In order to avoid that "object required" complaint, first declare and initialize dbs before you attempt to use it with CreateQueryDef.
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef

Set dbs = CurrentDb
Set qdf = dbs.CreateQueryDef("", _
        "PARAMETERS prmCustomerID Text(255), prmMealID Text(255), prmTransactionAmount Currency, prmTransactionDate Text(255);" & _
        "INSERT INTO dbo_Transactions (CustomerID, MealID, TransactionAmount, TransactionDate) " & _
        "VALUES ([prmCustomerID], [prmMealID], [prmTransactionAmount], [prmTransactionDate])")


text:
Q: FirestoreRecyclerAdapter how do I get the key With new firestore how do I get the key (document ID) from adapter?
With Firebase Database we get this with
String key = this.getRef(position).getKey();

A: Was just having the same problem.  This works for me.  FirestoreUI version 3.1.0.
Within your onBindViewHolder, (and note you will need to make "position" final):
                        String docId = getSnapshots().getSnapshot(position).getId();

                        Log.d("GETREFTEST", docId);

Happy coding.

A: If you're using FirestoreRecyclerAdapter from FirebaseUI, you can get the ID for the document at position using the following snippet:
String id = getSnapshots().get(position).getId()

A: Try this one I got using this

intent.putExtra(Activity.KEY_ID, model.getId());

activity = replace with your own activity and
model = replace with your own model


text:
Q: Compiling multiple .aux files with multibib? I am trying to have two separate bibliography, one for the main text, the other for the appendix. I use the following code. The file Paper.bib includes all my references.
\documentclass[12pt]{article}

\usepackage{multibib}
\newcites{apndx}{Appendix References}

\bibliographystyle{ecca}
\bibliography{Paper}

\bibliographystyleapndx{ecca.bst}
\bibliographyapndx{Paper}

\end{document}

I use F11 to compile Paper.aux through bibtex. But how should I compile apndx.aux file through bibtex?

A: You have a .bst you have to delete (see the marked line <======== in the following code mwe.tex):
\documentclass[12pt]{article}

\usepackage{multibib}
\newcites{apndx}{Appendix References}

\bibliographystyle{ecca}
\bibliography{Paper}

\bibliographystyleapndx{ecca} % <====================================
\bibliographyapndx{Paper}

\end{document}

After completing the full cycle
pdflatex mwe.tex
bibtex mwe.aux
bibtex apndx.aux
pdflatex mwe.tex
pdflatex mwe.tex

you will get a pdf file compiled without errors ...

A: For future reference; in Texmaker you need to go to "Tools" and "Open Terminal". Then type "bibtex apndx". This will give you .bbl file.


text:
Q: Understanding the potential energy of the Atwood machine So this might be a pretty simple (dumb?) question. I don't understand the choice of the potential energy on this problem. I really can't see how the "height" in the potential energy of the masses is the same as the leght of their rope sections.

A: The horizontal line passing through the center of the pulley is being used as the reference for measuring heights. So, clearly, the height of each block of mass would be the (negative) length of the section of the rope that is connecting them to the pulley. Notice the "negative" sign. This is why the potential energy is to be written as $$U=-m_1gx-m_2g(l-x)$$ and not as $m_1gx+m_2g(l-x)$.
You can equivalently choose the actual ground (the local Earth-surface) to be the reference for measuring heights. Let's say that the center of the pulley is at a height of $H$ from the ground. Then, you can easily see that the heights of the blocks would be $H-x$ and $H-(l-x)$ respectively. Thus, the potential energy would be $$U=m_1g(H-x)+m_2g(H-(l-x))=(m_1g+m_2g)H-m_1gx-m_2g(l-x)$$ Notice that this is different from the potential energy calculated earlier but only by a constant $(m_1g+m_2g)H$. Since a shift in the potential energy by a constant doesn't affect the dynamics, both these expressions are physically equivalent and you can choose whichever convention you like.


text:
Q: Is there a closed form for $\sum_{|\gamma|=k} \gamma!$ Consider the multi-index $\gamma=(\gamma_1,\ldots, \gamma_n)$. Is there a closed form for the sum $\sum_{|\gamma|=k} \gamma!$ in terms of $n$ and $k$? Asymptotics, or good upper bounds are also very helpful.
Here is what I have tried. Let $f(x)=\sum_{i=0} i! x^{i+2}$. This generating function satisfies the ODE $x^2f'(x)=f(x)-x$. Then the sum $\sum_{|\gamma|=k} \gamma!$ is the coefficient of $x^{k+2n}$ in $f(x)^n$. However I don't have any means to find this coefficient.

A: Dividing by $(\gamma_1+\cdots+\gamma_n)!$ you are trying to estimate $$\sum_{\gamma \vdash k}\binom{k}{\gamma_1,\dots,\gamma_n}^{-1}$$
One way to start would be to write it as an integral over the probability simplex (sum of generalized beta functions) or to try to find some information from the generating function. For $n=2$, for instance the integral representation is $$\sum_{i=0}^k \binom{k}{i}^{-1}=(k+1)\int_{0}^1 \frac{(1-t)^{k+1}-t^{k+1}}{1-2t}dt$$
and the generating function is $$\sum_{k=0}^{\infty} \left(\sum_{i=0}^k \binom{k}{i}^{-1}\right)x^k=\frac{2x}{1-x}-\frac{2x}{2-x}-\frac{2x \log(1-x)}{(2-x)^2}$$
from which it is not very hard to see that
$$\sum_{i=0}^k \binom{k}{i}^{-1} \sim 2+\frac{2}{k-1}$$ so $$\sum_{i=0}^k i!(k-i)!\sim k!\left(2+\frac{2}{k-1}\right)$$

A: Let's try $n=2$.  Maple says:
$$
\sum_{j = 0}^{k} j!(k - j)! = -\Biggl(\mathrm{LerchPhi} (2,1,k) k^{2} +
\mathrm{LerchPhi} (2,1,k) k + \frac{i \pi k^{2}}{2^{k}} + \frac{i \pi k}{2^{k}} - 3 k - 1\Biggr) \frac{\Gamma (k)}{2}
$$
but doesn't know asymptotics for $\mathrm{LerchPhi}(2,1,k)$.


text:
Q: envelope icon disappeared after using \includepdf I am using \inludepdf to attach a pdf file, which has an envelope icon, into a new document.

After attaching this pdf file, this envelope icon disappeared in the new document.

How can I fix this problem? Thanks in advance for any help!


text:
Q: cascading foreign key 'X' cannot be created where the referencing column 'Y' is an identity column I'm trying to upgrade the OwnedTypes sample to EF Core 3.0 Preview 8 but when I run the project it can't create the database.
When Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.EnsureCreated() is called the following exception is thrown:

Microsoft.Data.SqlClient.SqlException: 'Cascading foreign key 'FK_OrderDetails_DetailedOrders_OrderId' cannot be created where the referencing column 'OrderDetails.OrderId' is an identity column.
  Could not create constraint or index. See previous errors.'

What previous errors?
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    #region OwnsOneNested
    modelBuilder.Entity<DetailedOrder>().OwnsOne(p => p.OrderDetails, od =>
    {
        od.OwnsOne(c => c.BillingAddress);
        od.OwnsOne(c => c.ShippingAddress);
    });
    #endregion

    #region OwnsOneTable
    modelBuilder.Entity<DetailedOrder>().OwnsOne(p => p.OrderDetails, od =>
    {
        od.OwnsOne(c => c.BillingAddress);
        od.OwnsOne(c => c.ShippingAddress, sa =>
        {
            sa.Ignore(p => p.IgnoreMe);
        });
        od.ToTable("OrderDetails");
    });
    #endregion
}

Full project
I assume there is something in the 3.0 breaking changes list I need to follow?

A: *

*You can remove od.ToTable("OrderDetails"); to map OrderDetails to the same table as DetailedOrder

*You can add od.Property("OrderId").ValueGeneratedNever(); to disable marking the OrderId column as identity


text:
Q: How to call another javascript function within a javascript function after previous codes have been executed? I got this seemingly simple problem, yet I cannot find the correct way of execution.
I have 2 select tags, the first one is COLOR and the second one is SIZE. The second one is dependent on the first one.
To retrieve the price of the products (which is from the database), I intend to call a function within another function. The code stated below.
    function checksizes(id)
    {
    var color=document.getElementById('colors').value;
    $("#sizediv").show();
    $("#sizediv").load('sizes.php?id='+id+'&color='+color);
    var size = document.getElementById('size2').value;
    alert(id+size+color);
    confirmprice2(id,size,color);
    }

    function confirmprice2(id,size)
    {
    $("#price").show();
    $("#price").load('price.php?id='+id+'&size='+size);
    }

The alert is to check whether the invoked values to be passed on the next function are correct.
Code is working, but returning different results. It seemed that the function checksizes() passes values which are from the previous select (from the size). It calls the second function even before it finishes executing this: $("#sizediv").load('sizes.php?id='+id+'&color='+color);
Help is much appreciated. Thank you!

A: The load function is an asynchronous function. When the function is "finneshed" does not mean that the result is loaded.
You need the completed Callback for that. See http://api.jquery.com/load/
function checksizes(id)
{
    var color=document.getElementById('colors').value;
    $("#sizediv").show();
    $("#sizediv").load('sizes.php?id='+id+'&color='+color, function(){
        var size = document.getElementById('size2').value;
        alert(id+size+color);
        confirmprice2(id,size,color);
    });
}

function confirmprice2(id,size)
{
    $("#price").show();
    $("#price").load('price.php?id='+id+'&size='+size, function(){
        alert('price is loaded');
    });
}

A: That's because .load() is asynchronous.  It basically forks off another thread to continue its work while the calling code continues what it was doing.  If you have code which needs to happen in response to .load() then it needs to be placed in a callback function, not after the function.  Something like this:
function checksizes(id) {
    var color=document.getElementById('colors').value;
    $("#sizediv").show();
    $("#sizediv").load('sizes.php?id='+id+'&color='+color, function () {
        var size = document.getElementById('size2').value;
        alert(id+size+color);
        confirmprice2(id,size,color);
    });
}

Passing this function as a parameter to .load() will invoke this function after .load() completes.

A: As from the jQuery documentation, $.load does indeed not finish before it returns. You should use the callback function:
$( "#result" ).load( "ajax/test.html", function() {
  alert( "Load was performed." );
});

http://api.jquery.com/load/
In your case, everything in the checksizes function under the load function call should be placed in the callback.


text:
Q: How to create a constant buffer with valid dimension Good evening,
I'm trying to send a XMFLOAT3X3 to a constant buffer (see code below).
ZeroMemory(&constDesc, sizeof(constDesc));
constDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
constDesc.ByteWidth = sizeof(XMFLOAT3X3);
constDesc.Usage = D3D11_USAGE_DEFAULT;

result = m_pDevice->CreateBuffer(&constDesc,0,&m_pTexTransformCB);

if (FAILED(result)) {
    MessageBoxA(NULL,"Error creating constant buffer m_pTexTransformCB", "Error", MB_OK);
    return false;
}

But the compiler tells me that XMFLOAT3X3 is an invalid dimension for the constant buffer bytewidth:
D3D11: ERROR: ID3D11Device::CreateBuffer: The Dimensions are invalid. For ConstantBuffers, marked with the D3D11_BIND_CONSTANT_BUFFER BindFlag, the ByteWidth (value = 36) must be a multiple of 16 and be less than or equal to 65536. [ STATE_CREATION ERROR #66: CREATEBUFFER_INVALIDDIMENSIONS ]

However, I'm sort of new to HLSL, so I'm not sure if I set the bytewidth to 48, the float3x3 in the cbuffer of the shader will register properly. How should I handle this best?
If you need any more information, comment and I'll edit the question. I hope it's clear enough.

A: In your case, you can just change the ByteWidth to 48 and it will be fine. If you want to group more than one value together, you're going to need to make sure that your data is aligned to 16 byte boundaries. To do this you can just add __declspec(align(16)) before defining your structures.
__declspec(align(16))
struct Data
{
    XMFLOAT3X3 a;

    //other stuff here
};

This way you can use sizeof(Data) and be guaranteed that your ByteWidth will be valid. I apologize for giving you an incorrect answer earlier, you do not need to manually pad.

A: "If the bind flag is D3D11_BIND_CONSTANT_BUFFER, you must set the ByteWidth value in multiples of 16"
See the MSDN
,notably the remarks.


text:
Q: How to assert action returns correct text? Is there a standard or best-practices way to test that an action in rails is returning the correct text?  For example, I have a simple action that is used for doing ajax validation that does the following:
def get_object_id
  if params[:id].blank?
    return render(:text => -1, :layout => false)
  end

  my_object = MyObject.find_by_id(params[:id].strip)

  # If the object is valid return the object id
  if my_object and my_object.active?
    return render(:text => my_object.id, :layout => false)
  end

  # Otherwise, return -1
  return render(:text => -1, :layout => false)
end

Right now, I'm using the @response object in my tests ... i.e.:
def test_get_object_id_returns_invalid_for_non_existent_id
  # Act
  get :get_object_id, :id => 999

  # Assert
  assert_response :success
  assert_equal "-1", @response.body
end

But, though being mostly new to rails, what I have seen so far seems to suggest that there's probably a better way to do this other than checking @request.body.
So, my question to you ruby experts is: Is this the best way?

A: I think your spot on already.
assert_select only really works for XML content, so for other formats you have to roll your own. I would probably add a named assertion method to ActionController::TestCase if I was doing a lot of these.
e.g.
def assert_response_equals(v)
  assert_equal v.to_s, @response.body, "Expected response body to be #{v.inspect}"
end

This would allow you to skip the quotes.


text:
Q: Automatically run goalseek when cell value changes by a formula I need to run a goalseek every time the value of cell "E9" changes, cell E9 = Rand(), is there a way to do this? The goalseek and cell E9 are on different sheets. The VBA script I found online is as follows and it is not working. Once I hit F9, my Excel just keeps iterating and gives me "#NUM!" What am I missing here? My goalseek is related to cell E9. Cell 70 is a function of E9.
In Sheet1 I have:
Private Sub Worksheet_Calculate()

 Dim KeyCell As Range
 Set KeyCell = Range("E9")

If Not Application.Intersect(KeyCell, Range("E9")) _
Is Nothing Then

Backsolve

End If
End Sub

In Module1 I have:
Sub Backsolve()

Sheets("Backsolve").Select
Range("C70").Select
Range("C70").GoalSeek Goal:=0, ChangingCell:=Range("C71")
Sheets("Sheet1").Select

End Sub

Help please!

A: may be this will work:
In Sheet1:
Private Sub Worksheet_Calculate()
     Backsolve
End Sub

In Module1
Sub Backsolve()
    Sheets("Backsolve").Range("C70").GoalSeek Goal:=0, ChangingCell:=Range("C71")
End Sub


text:
Q: JavaScript google maps API - one one infowindow open at a time.. This questions relating to infowindow in the google maps API v3..
Currently I loop this function and place markers..
function addPostCode(zip, html)
{
   geocoder.geocode( { 'address': zip}, function(results, status)
   {
      if (status == google.maps.GeocoderStatus.OK)
      {
         map.setCenter(results[0].geometry.location);
         var marker = new google.maps.Marker({
         map: map,
         position: results[0].geometry.location,
         name: zip
      });
});

Now I would like to add an info windows with unique HTML, however I would like the following behaviour..
When an infowindow is opened by an event, any current infowindows will close leaving only the new one present..
Is this possible and how would I go about it? Finding documentation on this issue is proving difficult..

A: Create a single infowindow in your initialization. In your event/listener where you want to open the infowindow, you'd set the content and open the infowindow on the marker/location on the map.
// Initialize infowindow
var infowindow = new google.maps.InfoWindow({content: ''});

function add_marker(point, name, content)
{
   var marker = new google.maps.Marker({
      map: map,
      position: point,
      dragable: false,
      clickable: true,
      name: name
   });
   marker.content = content;
   google.maps.event.addListener(marker, 'click', function()
   {
      infowindow.content = marker.content;
      infowindow.open(map, marker);
   });
   return marker;
};

function addPostCode(zip, html)
{
   geocoder.geocode( { 'address': zip}, function(results, status)
   {
      if (status == google.maps.GeocoderStatus.OK)
      {
         map.setCenter(results[0].geometry.location);
         var marker = add_marker(results[0].geometry.location, zip, html)
      });
});

This question and answer helped me out quite a bit with the single or multiple Info Window issue:
Google Maps API v3 adding an InfoWindow to each marker

A: var currentInfoWindow = ''; //Global variable

google.maps.event.addListener(marker, 'click', function()
   {
      if(currentInfoWindow != '')
      {
        currentInfoWindow.close();
        currentInfoWindow = '';
      }
      var infoWindow = new google.maps.InfoWindow({content: 'COntent'});
      infowindow.open(map, marker);
      currentInfoWindow = infowindow;
   });

A: You are probably better off asking the Google Groups for the Google Maps API v3  about this one, and any other related questions.
I haven't used API v3, but as far as I know, you can only have one info window open at a time, so this would happen automatically.

A: There are two ways to do this ... the first is to create a single info window and just use the .setOptions method of the info window to update the content.
The second way to do it is to simply set a module-level variable in your code to contain the "active" window ... and then if any infoWindow is open, call it's .close method before you open the new one.


text:
Q: Clojure: CSS / DOM like UI for Java Notes:
The answer is NOT clojurescript. I want to code in Clojure, not ClojureScript.
Context:
I like the CSS/DOM model for user interfaces more than I like Java's Graphics2D.
Question:
Is there some way / some project that embeds a WebKit of sorts into a Java Application? I would like to be able to code in Java, but also be able to have a GUI which I can control/manipulate via CSS/DOM.
Thanks!

A: The JavaFX 2.0 scene graph is somewhat similar in concept to a DOM, and you can skin it using CSS.
There is a Java API, so you should be able to use this fairly easily from Clojure.

A: It's not exactly CSS/DOM, but seesaw allows to query Swing widget hierarchies with CSS-like selectors.

A: You can find a list of more-or-less mature GUI libraries here.
An above-mentioned Seesaw can fit. GUIFTW uses a CSS-like stylesheets for describing the UI and may also meet your needs but it wasn't updated for a year now.


text:
Q: Change Azure Mobile App service url in client I have upgraded a backend service to use Azure Mobie App SDK and support for OData queries. I make requests using Postman and recieve desired responses. It is working fine. Now I want to upgrade my client to use Azure Mobile App SDK. The problem I face is that the client SDK uses a hardcoded tables in the generated URL. This code:
class SiteRepository
{
    private MobileServiceClient client;
    private IMobileServiceSyncTable<Site> siteTable;

    private SiteRepository()
    {
        client = new MobileServiceClient("http://{{host}}/");
        Task.Run(() => InitLocalStoreAsync());
        siteTable = client.GetSyncTable<Site>();

        siteTable.PullAsync("Site", siteTable.CreateQuery());
    }

    private async Task InitLocalStoreAsync()
    {
        if (!client.SyncContext.IsInitialized)
        {
            var store = new MobileServiceSQLiteStore("localstore.db");
            store.DefineTable<Site>();
            await client.SyncContext.InitializeAsync(store);
        }
    }

    public List<Site> GetSites()
    {
        return Task.Run(() => siteTable.ToListAsync()).Result;
    }

sends requests to:
GET http://{{host}}/tables/site$filter=(updatedAt%20ge ...
But I want it to send the requests to:
GET http://{{host}}/api/local/sites?$filter=(updatedAt%20ge...
Can I somehow change tables part to something else?
Update:
Here is SiteController on the backend:
[RoutePrefix("api/local/sites")]
[MobileAppController]
public class SiteController<T> : TableController<T> where T : Model.Entity
{
    protected SiteService<T> service;
    public BaseController(IEntityService<T> _service)
    {
        service = _service;
    }

    [Route("")]
    [HttpGet]
    [EnableQuery]
    public virtual IQueryable<T> Get()
    {
        var entities = service.GetAll();
        if (entities == null || entities.Count() == 0)
        {
            return null;
        }

        return TableUtils.ApplyDeletedFilter(entities.AsQueryable(), Request.AreDeletedRowsRequested());
    }

A: With IMobileServiceTable and IMobileServiceSyncTable, requests always use the /tables endpoint. To change this behavior, attach a delegating handler to your MobileServiceClient and change the request URI before it is sent.
Here's an example of a delegating handler that does logging, which shows where you'd add this code: Log outgoing requests in mobile client.


text:
Q: DataPoint [] does not accept float variables I was trying to make a graph based on the two array values, i.e conc and optical density. I have created two activities for saving those arrays and pass the array list using bundle and intent to the third activity using string.
Whenever I try to run the code, my app crashes.
GraphView gpView;
String co;
String od;
Float x,y;
int l1,l2;
DataPoint [] dp;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main3);

    Bundle bundle1 = getIntent().getExtras();
    ArrayList<String> array1 = (ArrayList<String>) bundle1.getStringArrayList("Conc");

    Bundle bundle2 = getIntent().getExtras();
    ArrayList<String> array2 = (ArrayList<String>) bundle2.getStringArrayList("Od");

    gpView= findViewById(R.id.graph);
    LineGraphSeries <DataPoint> series = new LineGraphSeries<>();

    l1 = array1.size();
    l2 = array2.size();

    if((array1.contains(true))&&(array2.contains(true)))
    {
        for (int c1 = 0; c1<l1; c1++)
        {
            for(int c2=0; c2<l2; c2++ ) {
                co = array1.get(c1);
                od = array2.get(c2);
                x = Float.parseFloat(co);
                y = Float.parseFloat(od);
                dp[c1] = new DataPoint(x,y);
            }
        }
        gpView.addSeries(series);
    }

}

Alternately I tried to run a simple input method and it worked using this
    private DataPoint[] getDataPoint ()
    {
        dp = new DataPoint[]
                {
                        new DataPoint(10, 0.2),
                        new DataPoint(20, 0.38),
                        new DataPoint(30, 0.45),
                        new DataPoint(40, 0.69),
                        new DataPoint(50, 0.81),
                };
        return (dp);
    }

A: I think you haven't initialized your dp array. Initialize your array
dp = new DataPoint[l1];

before if statement if((array1.contains(true))&&(array2.contains(true)))
Edit:
May be you are having NullPointerException. Check array1 and array2 is not null
if(array1 == null){
  Toast.makeText(this, "array1 is null", Toast.LENGTH_LONG).show();
}

if(array2 == null){
  Toast.makeText(this, "array2 is null", Toast.LENGTH_LONG).show();
}

if(array1 != null){
   l1 = array1.size();
}

if(array2 != null){
   l2 = array2.size();
}

if(l1 > 0){

 dp = new DataPoint[l1];

 for (int c1 = 0; c1<l1; c1++)
 {
     for(int c2=0; c2<l2; c2++ ) {
         co = array1.get(c1);
         od = array2.get(c2);
         x = Float.parseFloat(co);
         y = Float.parseFloat(od);
         dp[c1] = new DataPoint(x,y);
     }
 }
 gpView.addSeries(series);
}

if array1 and array2 is null then make sure you are passing both arraylist via Intent.


text:
Q: Como corrigir as falhas de instalação do react-native para rodar no IOS? Olá,
Seguindo a documentação do react-native pareceria simples se fosse apenas fazer o que é indicado, só que não é bem assim, é um ledo engano acreditar que todo o processo irá funcionar da maneira que é orientada pelo site, até porque algumas pessoas já possuem algumas das ferramentas pré-instaladas, além também do fato das versões de algumas bibliotecas serem diferentes, então tudo é relativamente diferente para cada usuário.
Durante o decorrer da instalação, descobri que há várias etapas e processos que não foram muito bem esclarecidas, como por exemplo a instalação dos pods, com os cocoapods, fora as várias inconsistências, além de ter que instalar uma série de dependências, ficou bem confuso entender quem eu devo dar prioridade, se é a documentação do site com uso do npm ou a comunicação dos processos em si, que pedem para utilizar o yarn, além dos vários conflitos internos, devido a uma série de elementos pré-instalados que receberem mensagens do tipo warning, de conteúdos depreciados, fora os problemas de uso de porta, tive que pesquisar muito para conseguir rodar alguma coisa neste sentido, e não pareceu ser uma tarefa tão fácil.
Para corrigir alguns dos problemas, que na documentação não fornece, só consegui através do stackoverflow, todavia, também acabei seguindo receitas falhas, pois são n variáveis, e riscos a serem considerados, no final eu entendi como fazer tudo de uma forma funcional, isso se fez valer da experiência que tive e das minhas frustrações do que não conseguia, o problema é que depois que você aprende a fazer, é tarde, você já encheu sua máquina de coisas que não precisava, e de configurações que afetaram outras camadas de desenvolvimento, a coisa toda descambou, e agora, eu tenho variáveis de ambiente que ficaram eternizadas com falhas, e eu não tenho ideia de como consertar isso.
Há muitas respostas, porém nenhuma funcionou até agora, estou com um projeto de teste chamando HelloWord que era o esqueleto inicial para eu aprender a instalar o react-native, eu apaguei esse projeto do computador, e agora, toda vez que faço o passo a passo direitinho de uma nova aplicação, não importa como, esse maldito aparece por traz, parece pegadinha, ele vem e fala, "oi, eu ainda existo para estragar seus futuros projetos... kkkk", então deixo aqui aberto para um especialista, já que existem muitos acredito eu, vir aqui e me dizer o que eu tenho que fazer para corrigir isso:

Aqui tem exemplos do mesmo problema.


text:
Q: Akka pipe play promise http://doc.akka.io/docs/akka/2.0.2/java/untyped-actors.html#Ask_Send-And-Receive-Future
I want to use this pattern.
I make a WS call in my Actor which returns a F.Promise. Now I want to pipe this promise to another actor.
Patterns.pipe works with Akka future. How can I achieve this pattern using F.Promise?

A: In Akka 2.0.2 a Promise IS-A Future, so just: promise pipeTo actor
http://doc.akka.io/api/akka/2.0.3/#akka.dispatch.Promise

A: You can use the "sender" command if you are traversing in 3 layer of actor system.
it will send back a data to the actor who is using the future and by this you can pipe it to another actor you want.


text:
Q: Backward-compatible SQL query against table with renamed column Let t be an Oracle 11g table with columns a, b. The b column is later renamed to c.
How to develop an SQL query which works against both database versions? "Works" means:

*

*returns columns a, c

*behaves as select a, c from t on new version

*behaves as select a, b as c from t on old version

The background is, the module with SQL query (it is actually based on Pentaho Data Integration) has deployment lifecycle which does not strictly match the deployment lifecycle of database changes. Also there seems to be no clean way of feature-flagging multiple versions of SQL query. Hence one-SQL-fits-all solution seems to be the simplest one for 100% compatibility.

A: The simplest solution I could figure out is based on CTE:
with x(a,c) as (select * from t)
select a,c from x

Db fiddle demonstration on two different tables.
The obvious limitation is the number of column must stay same and there must not be any change in column order.

A: You may add a virtual column that projects a new column with an old name. And after you migrate all the consuming code to the new column names, you may drop old virtual columns for free.

create table t (
  a int,
  b int
)

insert into t
select 1, 2 from dual union all
select 3, 4 from dual

create function f
return int
as
  res int;
begin
  select sum(a) + sum(b)
    into res
  from t;

  return res;
end;/

alter table t
rename column b to c;

alter table t
add b int generated always as (0+c) virtual

select f()
from dual

| F() |
| --: |
|  10 |

create or replace function f
return int
as
  res int;
begin
  select sum(a) + sum(c)
    into res
  from t;

  return res;
end;/

alter table t
drop column b

select f()
from dual

| F() |
| --: |
|  10 |

db<>fiddle here


text:
Q: What is the physical meaning of Wilson loops? I'm a mathematician trying to get some very basic physical intuition on gauge theories, so I apologize if what follows is really naive. My first super elementary question is:

Am I right to think that in magneto-static, the Wilson loop for a
  simple curve is nothing but the exponential of the magnetic flux
  through any surface bounded by that curve ?

This seems obvious but I've never seen it explicitly written so I fear I'm missing something obvious. Now of course this is special to electromagnetism because the gauge group is abelian (hence holonomy of the one form $A$ describing the magnetic potential is exp of the integral of $A$ along the curve, which by Stokes theorem is the integral of $dA$ over any surface bounded by the curve), and as far as I understand classical non-abelian Yang-Mills theories do not quite describe any "real" physics, still:

Do classical Wilson loops have some sort of physical meaning?

Wilson loops are still well-defined for self-intersecting loops. But if I understand correctly, when going to the quantum picture using the Feynman integral formulation there is some "regularization" issue, and one way to deal with it is to equip the curve at hand with a framing, which in particular forces to consider only simple loops. This is beautifully explained in Witten's Jones polynomial paper, and in a way is the very reason why Chern-Simons knot invariants are non-trivial (which as you may have guessed is the reason why I'm asking those questions).

Is there some intuitive/layman physical explanation as to why quantum Wilson loops are only well defined on simple curves? I would already be interested in an answer in the abelian case, perhaps something related to the fact that in that case it's only for simple curves that the classical ones are related to the magnetic flux?

Edit I realize my question was unclear, mostly because I don't really know how to use the jargon accurately. By "quantum Wilson loop" I really meant its vacuum expectation value. Is there a simple explanation of what this quantity means ? Now this has, I believe, a divergence when you take the limit as the size of the loop goes to 0. For the classical Wilson loop for a given $A$, this basically gives the field strength at the point which is the limit of the loop. As far as I understand, the reason why the VEV is divergent in that situation, is that it doesn't quite make sense physically to measure the field at one point. Rather, all we can do is measure the flux going through a very small loop near that point, and somehow quantum physics is sensitive to that. Does that make sense ? Is there a similar explanation as to why the VEV of a WIlson loop diverge for self-intersecting loops ?

A: I'm a physicist in training who doesn't know any math, so hopefully I'll have good naive answers for your naive questions.

Am I right to think that in magneto-static, the Wilson loop for a simple curve is nothing but the exponential of the magnetic flux through any surface bounded by that curve ?

Yes, for a purely spatial Wilson loop that's perfectly correct. For a temporal Wilson loop, such as one lying in the $zt$ plane, you instead get
$$\int E(z, t) \, dz dt$$
which, roughly speaking, integrates the potential difference between the two temporal sides of the loop over time.

Do classical Wilson loops have some sort of physical meaning?

The quantum Wilson loop yields the phase a quantum particle picks up upon going around the loop, but the quantum phase is nothing but the classical on-shell action. So the spatial Wilson loop tells you the extra action cost for a spatial path when there's a magnetic field around. It's trickier to talk about a temporal Wilson loop since a single classical particle can't go back in time, but you can use it to compare the actions of two classical particles that start and end in the same place.
Upon quantization, the spatial case gives you the Aharanov-Bohm phase, while the temporal case simply gives you the dynamical $e^{-iEt/\hbar}$ phase where the energy $E$ includes the electric potential.

Is there some intuitive/layman physical explanation as to why quantum Wilson loops are only well defined on simple curves?

If you're asking whether you can understand this classically, I think the answer is no. Witten states that this restriction has to do with regularization of inherently quantum effects. I don't think the nonapplicability of Stokes' theorem really has anything to do with it, as you can still apply it if you split the curve into simple pieces.

A: *

*Yep, Stokes' theorem:

$$e^{i \int_{\partial D} A} = e^{i \int_D dA}.$$

*Wilson loops measure the Aharonov-Bohm phase of an infinitely massive probe particle.

*It's possible to consider networks of Wilson loops in 3d TQFT. See this paper. It's not obvious how to do it in Chern-Simons theory though.


text:
Q: Bhoechie tab not working after ajax call I am using Bhoechie tab which is made with JQuery when the page loads, everything works perfectly. However, after I make my ajax request which changes my tab menu content, it doesn't work properly anymore. What can I do to make it work at all times?
Here is my tab menu jQuery code :
$(document).ready(function() {
$("div.bhoechie-tab-menu>div.list-group>a").click(function(e) {
    e.preventDefault();
    $(this).siblings('a.active').removeClass("active");
    $(this).addClass("active");
    var index = $(this).index();
    $("div.bhoechie-tab>div.bhoechie-tab-content").removeClass("active");
    $("div.bhoechie-tab>div.bhoechie-tab-content").eq(index).addClass("active");
});
});

Tab Html

 TAB1   TAB2  TAB1   TAB1

AJAX
function showVehicle(id){
var container = $("#id_administrator");
var form = "";
$.ajax({
    url: "forms/show.php",
    type:'POST',
    data:{"vreg":id},
    async:false,
    }).done(function(data){
        form= data;
    });

 container.html(form);
}

A: Script also need to call it from AJAX so just modify the script like this mentioned below, so that it would run on AJAX load.
function showVehicle(id){
var container = $("#id_administrator");
var form = "";
$.ajax({
  url: "forms/show.php",
  type:'POST',
  data:{"vreg":id},
  async:false,
}).done(function(data){
    form= data;
});

container.html(form);

$("div.bhoechie-tab-menu>div.list-group>a").click(function(e) {
  e.preventDefault();
  $(this).siblings('a.active').removeClass("active");
  $(this).addClass("active");
  var index = $(this).index();
  $("div.bhoechie-tab>div.bhoechie-tab-content").removeClass("active");
  $("div.bhoechie-tab>div.bhoechie-tab-content").eq(index).addClass("active");
});

}

please check and do let me know in comment.


text:
Q: SSO - No OpenID endpoint found I'm trying to get SSO openid working with dotnetopenauth.
I have two separate projects, being debugged separately (both on localhost but two different ports), one acting as the provider and one as the relying party.
The relying party is running on localhost:1903.
The provider is running on localhost:3314.
Relying party code:
    public ActionResult Authenticate()
    {
        UriBuilder returnToBuilder = new UriBuilder(Request.Url);
        returnToBuilder.Path = "/OpenId/";
        returnToBuilder.Query = null;
        returnToBuilder.Fragment = null;

        Uri returnTo = returnToBuilder.Uri;
        returnToBuilder.Path = "/";
        Realm realm = returnToBuilder.Uri;
        realm = "http://localhost:3314/OpenId/";
        returnTo = new Uri("http://localhost:3314/OpenId/");
        var response = openid.GetResponse();

        if (response == null) {
            if (Request.QueryString["ReturnUrl"] != null && User.Identity.IsAuthenticated) {
            } else {
                string strIdentifier = "testidentifier";
                var request = openid.CreateRequest(
                    strIdentifier,
                    realm,
                    returnTo);

                var fetchRequest = new FetchRequest();
                request.AddExtension(fetchRequest);
                request.RedirectToProvider();
            }
        } else {
            switch (response.Status) {
                case AuthenticationStatus.Canceled:
                    //stuff got cancelled for some reason
                    break;
                case AuthenticationStatus.Failed:
                    //response.Exception.Message;
                    break;
                case AuthenticationStatus.Authenticated:
                    //a bunch of applying roles that i don't think we care about
                    break;
            }
        }

        return new EmptyResult();
    }

Provider code:
    public ActionResult Index()
    {
        IAuthenticationRequest iR = (IAuthenticationRequest)Request;

        if (iR.IsReturnUrlDiscoverable(ProviderEndpoint.Provider.Channel.WebRequestHandler) != RelyingPartyDiscoveryResult.Success) {
            iR.IsAuthenticated = false;
            return new EmptyResult();
        }

        if (iR.IsDirectedIdentity) {
            if (User.Identity.IsAuthenticated) {
                iR.LocalIdentifier = BuildIdentityUrl();
                iR.IsAuthenticated = true;
            } else {
                if (iR.Immediate || ImplicitAuth) {
                    iR.IsAuthenticated = false;
                } else {
                    if (!Request.Path.EndsWith("Login", StringComparison.OrdinalIgnoreCase)) {
                        return RedirectToAction("Login", "User");
                    }
                }
            }
        } else {
            string userOwningOpenIdUrl = ExtractUserName(iR.LocalIdentifier);

            iR.IsAuthenticated = userOwningOpenIdUrl == User.Identity.Name;

            if (!iR.IsAuthenticated.Value && !ImplicitAuth && !iR.Immediate) {
                if (!Request.Path.EndsWith("Login", StringComparison.OrdinalIgnoreCase)) {
                    return RedirectToAction("Login", "User");
                }
            }
        }

        if (iR.IsAuthenticated.Value) {
            var fetchRequest = iR.GetExtension<FetchRequest>();

            if (fetchRequest != null) {
                var fetchResponse = new FetchResponse();
                //roles and stuff

                iR.AddResponseExtension(fetchResponse);
            }
        }

        return new EmptyResult();
    }

I get the error when I run the relying party code, on the openid.CreateRequest method. I enabled debugging on my provider code and it never gets hit.
Researching the error, I found a lot of suggestions about proxy problems but that shouldn't be an issue for me as I'm only going to localhost.
Perhaps it's something fairly obvious but I'm at a loss as to what I'm doing wrong.
Thanks in advance for the help!
EDIT: FYI, I got this code from the DotNetOpenAuth samples.

A: Well, I ended up stepping through the source manually and somewhat figured out the problem.
Turns out dumdum was somewhat correct - my first issue was that it did want a URI as a the identifier, so once I changed my identifier to http://localhost:3314/OpenId/ (even though that's not valid, per se) I got over that exception.
The second problem was that I forgot to add information to web.config - so localhost was not whitelisted and CreateRequest failed there.
After I fixed those two issues my provider code got hit fine - I'm running into other errors there but that's for a separate question I imagine.
Web.Config:
<configSections>
  <sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth">

    </sectionGroup>
</configSections>

<dotNetOpenAuth>
<openid>
  <relyingParty>
    <security requireSsl="false">

    </security>
    <behaviors>

      <add type="DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth"/>

    </behaviors>

  </relyingParty>
</openid>
<messaging>
  <untrustedWebRequest>
    <whitelistHosts>

      <add name="localhost"/>
    </whitelistHosts>
  </untrustedWebRequest>
</messaging>

<reporting enabled="true"/>
</dotNetOpenAuth>

A: I'm not sure if you are have the same issue as me, but... For me I got this error after it prompted me for an openid if I entered something like "bob" as the user name.  When I entered a valid open id such as dumdum@yahoo.com, it got past this issue.  It seems like the exception handling for completely improbable open ids needs to be buttoned up.

A: I had the same problem recently and it turned out that the problem was not in my application but on the side of the openID server.
When calling the openID server it returned 500 - internal server error and my application threw protocol exception - No OpenID endpoint found on line openId.CreateRequest(Identifier.Parse(openIdServer)).
I contacted the administrator of the OpenID server who fixed the internal server error and everything work just fine (as befor the error).
Why is the DotNetOpenAuth trowing such a stupid exception that is a question...


text:
Q: WiX CustomAction to Register Custom ADFS Authentication Provider I'm following Microsoft's Build a Custom Authentication Method for AD FS in Windows Server guide to build a custom authentication provider for ADFS and I'm at the deployment step, which states that:

Adapter providers must provide an installer which performs the
  necessary installation actions including installation in the GAC, and
  the installer must support registration in AD FS.

I was successfully able to install the adapter to the GAC using WiX and manually register it with ADFS using PowerShell, but I'm getting an error from Windows Installer when trying to have WiX handle registering the provider with ADFS automatically via a CustomAction: Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor.
The full logs are shown below:
MSI (s) (E4:78) [10:02:27:412]: Executing op: ActionStart(Name=RegisterAdfsProvider,,)
MSI (s) (E4:78) [10:02:27:413]: Executing op: CustomActionSchedule(Action=RegisterAdfsProvider,ActionType=3106,Source=C:\,Target=Register-AdfsAuthenticationProvider -TypeName "MyAuthenticationAdapter.MyAdapter, MyAuthenticationAdapter, version=1.0.0.0, culture=neutral, publicKeyToken=D006C127CE4A16A7, processorArchitecture=MSIL" -Name MyAuthenticationProvider,)
MSI (s) (E4:78) [10:02:27:416]: Note: 1: 1721 2: RegisterAdfsProvider 3: C:\ 4: Register-AdfsAuthenticationProvider -TypeName "MyAuthenticationAdapter.MyAdapter, MyAuthenticationAdapter, version=1.0.0.0, culture=neutral, publicKeyToken=D006C127CE4A16A7, processorArchitecture=MSIL" -Name MyAuthenticationProvider
MSI (s) (E4:78) [10:02:27:416]: Note: 1: 2205 2:  3: Error
MSI (s) (E4:78) [10:02:27:416]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1721
MSI (c) (0C:B0) [10:02:27:429]: Font created.  Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: RegisterAdfsProvider, location: C:\, command: Register-AdfsAuthenticationProvider -TypeName "MyAuthenticationAdapter.MyAdapter, MyAuthenticationAdapter, version=1.0.0.0, culture=neutral, publicKeyToken=D006C127CE4A16A7, processorArchitecture=MSIL" -Name MyAuthenticationProvider
MSI (s) (E4:78) [10:02:28:198]: Note: 1: 2205 2:  3: Error
MSI (s) (E4:78) [10:02:28:198]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1709
MSI (s) (E4:78) [10:02:28:198]: Product: MyAuthenticationAdapter -- Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: RegisterAdfsProvider, location: C:\, command: Register-AdfsAuthenticationProvider -TypeName "MyAuthenticationAdapter.MyAdapter, MyAuthenticationAdapter, version=1.0.0.0, culture=neutral, publicKeyToken=D006C127CE4A16A7, processorArchitecture=MSIL" -Name MyAuthenticationProvider

Action ended 10:02:28: InstallFinalize. Return value 3.

If I copy the command from the logs and manually run it in PowerShell, it will complete successfully. My code in the .wxs file is as follows:
<SetProperty  Id="ADFS_PROVIDER_TYPE_NAME"
              Value="MyAuthenticationAdapter.MyAdapter, !(bind.assemblyFullName.MyAuthenticationAdapter)"
              Before="RegisterAdfsProvider"
              Sequence="execute"/>
<CustomAction Id="RegisterAdfsProvider"
              Directory="TARGETDIR"
              ExeCommand="Register-AdfsAuthenticationProvider -TypeName "[ADFS_PROVIDER_TYPE_NAME]" -Name MyAuthenticationProvider"
              Execute="deferred"
              Impersonate="no"/>
<InstallExecuteSequence>
  <Custom Action="RegisterAdfsProvider" Before="InstallFinalize">NOT Installed AND NOT REMOVE~="ALL"</Custom>
</InstallExecuteSequence>

What is wrong with my WiX file that causes this error during installation?

A: The original error was correct. I worked through several different methods of executing a command before I realized that the command I was trying to run was actually a PowerShell Cmdlet, which cannot be executed though the ExeCommand attribute of a CustomAction. I discovered this by running gcm "Register-AdfsAuthenticationProvider" in PowerShell and getting this output:
CommandType   Name                                  Version   Source
-----------   ----                                  -------   ------
Cmdlet        Register-AdfsAuthenticationProvider   1.0.0.0   ADFS


text:
Q: Control which network interface is used by default My mainboard hast two ethernet ports
So far i have only used one (eth1), which is connected to a router with a dhcp-server.
However, I want to use the other port (eth0) simultaneously to connect to another wlan router. The desktop is supposed to act as a hub, i.e. forward the dhcp services and all packages to the wlan, while still being a client in the network itsself.

*

*Is there any tutorial on this topic? (I couldn't find anything useful on google)

So far I am using a static ip setup for the wlan router (eth0).
As soon as I simply plug in the cable and connect with the network-manager, the internet connection is lost (even though the network manager shows, that both networks are connected). It appears that by default eth0 is then used for communication.

*

*using firefox or any piece of software, (how) can i control which network interface is used individually and by default?

A: You can temporarily disable the unwanted interface - ifconfig eth0 down. Otherwise, if you want an interface disabled by default you can add the same command to /etc/rc.local.  I suppose you could also set up xbindkeys to disable interfaces with keystroke as well.


text:
Q: JavaFX animation not working I am trying to make an application where an object moves across the screen, only changing its x value. I am not getting any errors but it is not working when I run it. the objects are showing but the rectangle is not animating. I am not sure what to do
import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
import javafx.util.Duration;

public class Main extends Application {

    private BorderPane root;
    private Stage stage;
    private Scene scene;
    private AnchorPane anchorPane;
    private Rectangle player;
    private Circle circles;
    private Button up, down;
    private Timeline timer;

    @Override
    public void start(Stage primaryStage) {
        stage = primaryStage;
        root = new BorderPane();
        scene = new Scene(root, 600, 500); //width and height of application
        stage.setScene(scene);
        stage.setTitle("Hoop runner");  //text for the title bar of the window

        scene.getStylesheets().add("hoop.css");

        anchorPane = new AnchorPane();
        anchorPane.setMaxHeight(500);
        anchorPane.setMinHeight(500);
        anchorPane.setMinWidth(600);
        anchorPane.setMaxWidth(600);
        player = new Rectangle();
        circles = new Circle();
        up = new Button("˄");
        down = new Button("˅");

        root.setCenter(new VBox(new VBox(circles),
                new HBox(player)));

        root.setCenter(anchorPane);

        player.setX(5);
        player.setY(380);
        player.setHeight(80);
        player.setWidth(120);
        anchorPane.getChildren().add(player);

        timer = new Timeline(Animation.INDEFINITE);

        timer.setCycleCount(Animation.INDEFINITE);

        timer.getKeyFrames().add(new KeyFrame(Duration.INDEFINITE, event -> maverick()));

        timer.play();

        stage.show();

    }

    private void  maverick() {

            timer.play();
            System.out.println("hi");
            player.setX(player.getX() + 2);
            timer.play();

    }

    public static void main(String[] args) {
        launch(args);
    }
}

A: *

*Use setTranslateX instead of setX if you want to position or animate Nodes.

*Change timer = new Timeline(Animation.INDEFINITE) to timer = new Timeline().

*Change new KeyFrame(Duration.INDEFINITE, event -> maverick()) to new KeyFrame(Duration.millis(500), event -> maverick()) (for example).

A KeyFrame has to have a point in time. If, like the example, you use 500ms, then the KeyFrame's EventHandler will get called after 500ms. Since your TimeLine has a cycleCount of INDEFINITE, it will loop and execute the KeyFrame every 500ms.


text:
Q: What is the fastest / best compression for large dar archives I'm using dar (like tar, but optimized for hard disks) for backing up RAID volumes.  They're modest sized for RAIDs, at perhaps 3 - 10 TB.  I'm aiming to put the results on 8 TB external drives, but it would be neat to be able to fit more than one backup on a drive.  This is for my personal hobby so price matters.
Anyway, I started one that's 3.4 TB with dar, using the xz:0 compression and I'm 24 hours into it and the result is only 740 GB, and I have no idea what percentage of the job has been finished.  This is on a dual-xeon machine with 32 hyperthreads, but not all that fast; 4 GHz)
So I want a compressor that can handle 3 TB in a day.  Better compression is nice, but right now I just want to control the amount of time it's taking.  Is there a study with this kind of info?  Has anybody got experience with compressing large archives?
Oh, and because of the way dar works, it has to be able to compress a stream.  Dar compresses each component so it knows when to switch slices (the output may go to multiple slices on multiple disks or sticks).

A: ZSTD at the ultimate compression level is comparable to XZ but compresses a lot faster (up to 20 times) and its decompression speed is simply insane.
I extremely recommend creating par2 recovery records for all your compressed files regardless. A single bit error can render your entire archive completely broken.


text:
Q: Get index of current selected object in NSCollectionView I want to have the index of the current selected Dictionary of an NSCollectionView.
I have this code but it always returns "0".
- (IBAction)selectItem:(id)sender {
    NSInteger index = [[CollectionView subviews]  indexOfObject:self.representedObject];
    NSLog(@"%ld", (long)index);
}

I don't know what I am doing wrong.


text:
Q: Setting path in ubuntu 13.10 In Ubuntu 13.10 I installed :
stable_Ubuntu-13.10-i686.deb and Ubuntu-13.10-i686.deb, but when starting GNURadio the following message appears :
Cannot import gnuradio.

Is the python path environment variable set correctly?
All OS: PYTHONPATH

Is the library path environment variable set correctly?
Linux: LD_LIBRARY_PATH
Windows: PATH
MacOSX: DYLD_LIBRARY_PATH

*

*How can I set python path and the library path environment variable to the correct value?

A: First try running this command to configure the libraries:
sudo ldconfig

If that doesn't solve it, you'll need to add these lines to ~/.profile file:
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

This assumes that you actually have python2.7 installed and that /usr/local/lib/python2.7/dist-packages is not empty. See here for more details.


text:
Q: Userforms and List Boxes I'm having a little trouble setting up my list boxes.  I want my user form to have two list boxes (one for months (jan-dec), and one for years (two digits).  I know that you have to put the values separated by semicolons but I'm not sure where I type this.
Please assist!

A: Private Sub UserForm_Initialize()

    With Me.ListBox1
        .Clear
        .AddItem "Jan", 0
        .AddItem "Feb", 1
        .AddItem "Mar", 2
        'etc...
    End With
End Sub