text:
Q: null value or empty string I tried to use counter to count the amount of null or empty string. But it always failed. I print them to test it.
System.out.println(samples.get(0).getAuthor2());
System.out.println(samples.get(0).getAuthor2() == " ");
System.out.println(samples.get(0).getAuthor2().isEmpty());
System.out.println(samples.get(0).getAuthor2() == null);

The result is like this.
 If these are all false, what is this blank?

A: Try to use org.apache.commons.lang3.StringUtils#isBlank(string)

A: To test String you have to use equals method so you have
System.out.println(samples.get(0).getAuthor2().equals(" "));

to be true

A: The first println statement outputs the value of getAuthor2() which is a space character (" "). This is not an empty string. It does not evaluate to a boolean (true/false) because it's a String object.  The other lines evaluate to boolean because they are printing the result of comparators and not the string itself.
The seconds println is not how you compare strings in Java. It compares references to two different strings that both happen to have a space character in them, but they are different references. To see if getAuthor2() is a single space you should use the .equals function like this and you should get true:
System.out.println(samples.get(0).getAuthor2().equals(" "));

The third println also gives false because it's not empty. It has a space in it.
Similarly the fourth println also gives false because it's not null either.

A: System.out.println(samples.get(0).getAuthor2() == " "); // This is condition , either true or false

System.out.println(samples.get(0).getAuthor2().isEmpty()); // This is condition ,isEmpty method return boolean either true or false

System.out.println(samples.get(0).getAuthor2() == null);// This is condition , either true or false

But
System.out.println(samples.get(0).getAuthor2()); // here you are printing the state of getAuthor2(), which is not a boolean condition ,so blank


text:
Q: a button that can only be clicked once, EVER as the title said
i would like to create a button that says "available" and once any one clicks it it turns to "unavailable" for all future users
any ideas ?
note : its for a school project, nothing fancy or even secured, just trying to prove a point
sorry for being vague for some, all i am trying to do is to create an article in my joomla website with a button that only the fastest user can access and click, thats it
i am not worried with security or even cheating attempts
joomla articles can have php js codes among others added to them

A: Quite complicated, really. Generate button by JavaScript to prevent people without JavaScript from clicking it uncontrolled. Keep a comet server so that when one user clicks it, the change is instantly propagated to all other connected clients, and the button is removed. Afterwards, do not authorise the generation of the button, for any new users.

A: Simplest way without using a database, here's the basic logic using a simple text (or you could use YAML, ini, xml etc.) file with either 1 (clicked) or 0 (not clicked) in it:
$filePath = './clicked.txt';

if((int) file_get_contents($filePath)){
    // put code here to display the button and mark it as disabled
    echo "Can't click";
} else {
    // code to display button
    // code to process button request and marked clicked as true in the file
    file_put_contents( $filePath, '1');
    echo "changed file";
}

You'll need to do some validation checks i.e. the file is readable, you can update the file etc. but that's pretty much all you'd need to do if you don't want to use a db.
Also, be sure to put that file below the web directory so a user can't browse to it.
EDIT: But if you're using Joomla, just use the db to do it. This way is ugly.

A: You could save a value into a database or create a text-file if the button was pressed. If the database-entry or the file exists no further pressing is allowed. Be sure to disable the button as well as not executing the server-side action when the button was pressed.

A: Do you really want this button to only be clicked once, ever? If so, then you need to store its status in a database of some sort, and update the database when someone clicks it.
It would probably also be in your best interest to not disable it by JavaScript, as someone could just turn off JavaScript and circumvent your decision.
As an aside, this requirement doesn't make a lot of sense to me. This is going to be -- at best -- hard to verify. You could create a submit button that redirects to another page, but a user could then just hit his/her browser's back button and click the button all over again. There isn't much you can do to prevent that.
Since you clarified: Your best bet is still to store the "clicked" value in a database somewhere (a file will work just fine).
When you load the page, use PHP to check the file for a "clicked" value. If it's there, you can disable the button directly in the HTML.
I'd suggest adding a second level of checks in PHP (or whatever server-side language you're using). When someone clicks the button, you can just go back out to your database/file and check for the "clicked" value. If you find that it's already been clicked, you can do nothing (or show the user a message letting them know that it's already been clicked). Otherwise, you can update the database/file accordingly.

A: Well you have a couple pieces going here.
First off you need a method to store the value (has this been clicked or not). My standard practice is to create a user_properties table (uid, property, value) in the DB to store the value to.
To manage it within the application I load the properties to a User (Profile) Object and store it to Session for reference. When the button is rendered you can do a quick check to see if the value exists in the Properties array of the User profile, if it does, disable; else leave it alone.
When the button is clicked the property in the User profile is stored and the updated to the database. Personally I check to see if something has changed in the session profile on load, if it has update database.

A: Given the nature of your problem, you may be better off blocking the users from the other end.  Meaning, since you want a link to be visited only once, have the server only serve that page once, then deny access.  The button will stay clickable for everyone, but only one user will ever actually receive the page requested, and only once.
do this the same way others have suggested hiding the button, set a value in a file, or a db, or really anywhere persistent on the server, and check that when the page loads, aborting, or redirecting to a denial page if present.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to convert first Letter of string to uppercase in erlang I have a string "data".How can I convert only the first character to uppercase and get a new string in the form of "Data"?

A: You can use the amazing function called string:titlecase/1, like this:
1> string:titlecase("data").
"Data"

Or… if you don't want to title-case your whole string, but just the first word…
5> [First|Rest] = string:lexemes("this data is Nice", [$\s]).
["this","data","is","Nice"]
6> string:join([string:titlecase(First)|Rest], " ").
"This data is Nice"

But if you want no fancy string function, you can just use pattern-matching…
11> [FirstChar|Rest] = "data".
"data"
12> [string:to_upper(FirstChar)|Rest].
"Data"
13>

A: Use the titlecase function in string module.
string:titlecase("data").


text:
Q: Java сравнить и изменить время и дату в файле Есть java class, в котором в map записаны элементы их время и дата. Приблизительно вот так:
new Map <String,String>()
.put("time1","2015-01-25T03:01:00")

Нужен метод который будет находить старую дату (before(now)), и менять на новую (буквально на 2,3 дня вперед)
Буду рад любым советам.
Сначала пробовал просто загрузить файл и изменить данные: (в коде очень много лишнего, но работает)
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Scanner;
    import java.util.ArrayList;
    import java.util.List;
    import java.io.BufferedWriter;

public class FileReplace {
    List<String> lines = new ArrayList<String>();
    String line = null;

    public void  doIt() {
        try {
            File f1 = new File("TFile.java");
            FileReader fr = new FileReader(f1);
            BufferedReader br = new BufferedReader(fr);
            while ((line = br.readLine()) != null) {
                if (line.contains("2015-01-25T03:01:00"))
                    line = line.replace("2015-01-25T03:01:00", "2016-01-06T08:01:00 ");
                lines.add(line);
            }
            fr.close();
            br.close();

            FileWriter fw = new FileWriter(f1);
            BufferedWriter out = new BufferedWriter(fw);
            for(String s : lines)
                 out.write(s);
            out.flush();
            out.close();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    public static void main(String args[]) {
        FileReplace fr = new FileReplace();
        fr.doIt();
    }
    }

Потом думаю как то сравнить даты, как то так: (только наброски )
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
               Date date1 = sdf;
             //  Date date2 = ;   data from the file

               if (date1.after(date2)) {

          date2 = data2.replace() // some random future data

               }

Не могу все до кучи свести, и еще нужно достать время и дату с файла, но как писал в начале, она вот так записана.
new Map <String,String>()
.put("time1","2015-01-25T03:01:00")

A:
нужно достать время и дату с файла

import java.nio.file.*;
import java.util.*;
import java.io.*;

public class Definition_Of_The_File_Creation_Date {

    public static void main(String[] args) {
        /*
        * Вместо / подстовляем путь к файлу или коталогу, используя статистический
        * метод parsingFolder получаем "карту" заполненую ключём - имя файла (Строка) и
        * значением даты последнего изменения файла (строка)
        */
        Map<String, String> colection = parsingFolder("/");

        // получаем все ключи нашей колекции
        Set<String> nameFile = colection.keySet();

        // выводим имя файла и его дату
        for(String name : nameFile){
            System.out.println("Имя: " + name + " DATA: " + colection.get(name));
        }

        /*
        * Можно поменять все ключи методом colection.replace("ключ", "Новое значение"),
        * Также строку можно разбить java.util.StringTokenizer token = new StringTokenizer(data, "-T:Z")
        * и соответственно записать её через colection.replace("ключ", "Новое значение"),
        */
        for(String name : nameFile){
            colection.replace(name, "2016-01-06T08:01:00");
            System.out.println("Имя: " + name + " DATA: " + colection.get(name));
        }
    }

    public static TreeMap<String, String> parsingFolder(String nameFolder) {
        // Создаём колекцию, для реализации сохранения данных
        TreeMap<String, String> temp = new TreeMap<String, String>() {};

        // устанавливаем путь к файлу, каталогу
        Path pathFile = Paths.get(nameFolder);
        // определяем является ли путь (nameFolder) каталогом или файлом
        if(Files.isDirectory(pathFile, LinkOption.NOFOLLOW_LINKS)) {
            /*
            * перебираем каждый файл в каталоге (nameFolder) и записываем
            * полученные данные в колекцию
            */
            try( DirectoryStream<Path> buffer = Files.newDirectoryStream(pathFile) ){
               Iterator<Path> iterratorDirectory = buffer.iterator();

               while(iterratorDirectory.hasNext()) {
                   Path fileDirectory = iterratorDirectory.next();
                   /*
                   * записали имя файла и дату последней модификации файла в колекцию.
                   * Files.getLastModifiedTime - является атрибутом файла, соотвественно вместо можно
                   *    записать и иные данные о файле. Посмотрите методы класса Files типа метод getFileAttrebuteView()
                   *    readAttributes(), getAttribute() в API java.. там есть все...
                   */
                   temp.put( fileDirectory.getFileName().toString(),
                             Files.getLastModifiedTime(fileDirectory, LinkOption.NOFOLLOW_LINKS).toString()
                   );
               }
            }catch(SecurityException | IOException exSecuritu){
                System.out.println("ERROR " + exSecuritu);
            }

        } else {
            /*
            * Данное условие выполняется если указанный при проверки путь являеется файлом
            */
           try{
               // записали имя файла и дату модификации файла в колекцию
               temp.put( pathFile.getFileName().toString(),
                         Files.getLastModifiedTime(pathFile, LinkOption.NOFOLLOW_LINKS).toString()
               );
           }catch(IOException ioE) {
                System.out.println("ERROR " + ioE);
           }
        }
        return temp;
    }
}

Далее я просто не пойму, что Вы хотите? зачем менять дату в *.java файле при создании Map.? Если нужно поменять дату у самого файла это один вопрос, дату в коллекции  Map это другой вопрос, если необходимо сохранить коллекцию как файл с данными — то это сериализация и соответственно другой вопрос....... Напишите более подробно пожалуйста, что Вы хотите. Ну либо я уже ответил на Ваш вопрос  :)


text:
Q: POST in PHP data format error I'm trying to POST using php. In the API it's suggested the following format.
// post url, keys are added here.

{
    "EmailAddress": "john.smith@acmeconsulting.co",
    "ActivityEvent": 112,
    "ActivityNote": "Note for the activity",
    "ActivityDateTime": "yyyy-mm-dd hh:mm:ss",
    "FirstName": "John",
    "LastName" : "Smith",
    "Phone" : "+919845098450",
    "Score": 10
}

My code in PHP :
$firstName='Test5';
$activityEvent=201;
$emailAddress='test10@test.com';
$activityNote='Note note note';
$phone='999999999';
$date='2015-07-21 12:48:10';

$data_string['ActivityEvent']=$activityEvent;
$data_string['EmailAddress']=$emailAddress;
$data_string['ActivityNote']=$activityNote;
$data_string['Phone']=$phone;
$data_string['ActivityDateTime']=$date;
//json_encode($data_string);
 try
{
  $curl = curl_init($url);
  curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_HEADER, 0);
  curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($curl, CURLOPT_HTTPHEADER, array(
                      'Content-Type:application/json',
                      'Content-Length:'.strlen($data_string)
                      ));
 $json_response = curl_exec($curl);
 curl_close($curl);
 } catch (Exception $ex) {
 curl_close($curl);
}

This code is not working as expected. I'm not getting any update there. Is the code correct?

A: Have you tried this?
$object = new StdClass;
$object->ActivityEvent = 201;
$object->EmailAddress = 'john.smith@acmeconsulting.co';
//add more properties here
echo json_encode($object);

A: $datastring = array(
'firstName' => 'John',
'lastName' => 'Smith',
...........);
$ch = curl_init("YOUR_URL_HERE");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $datastring );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

the result will be stored in the $result variable


text:
Q: Decrypt signaturevalue from XML c# I've signed a XML file to send with the proper securities but somehow the service I'm sending detects the file has an invalid signature (X.509 certificate validation it's ok).
I've been searching if it's possible, once I have signed an specific XML, to retrieve the XML signed informations back (like a decryption) to verify if I'm using the right nodes to sign the XML. Could anyone help me?
Ps.: I still have public and private certificate key.
This is the code I used to sign the elements "infEvento" of the XML, and after it, the XML element.
public XmlDocument retornaEvtsXMLAssinados(X509Certificate2 cert, string MensagemXML)
{
    XmlDocument xmlDoc = new XmlDocument();

    xmlDoc.LoadXml(MensagemXML);
    XmlNodeList evtsNode = xmlDoc.GetElementsByTagName("evento");

    foreach (XmlElement evtNode in evtsNode)
    {
        RSACryptoServiceProvider key = new System.Security.Cryptography.RSACryptoServiceProvider();
        System.Security.Cryptography.Xml.SignedXml SignedDocument;
        var keyInfo = new System.Security.Cryptography.Xml.KeyInfo();
        keyInfo.AddClause(new KeyInfoX509Data(cert));
        key = (System.Security.Cryptography.RSACryptoServiceProvider)cert.PrivateKey;
        SignedDocument = new System.Security.Cryptography.Xml.SignedXml(evtNode);
        SignedDocument.SigningKey = key;
        SignedDocument.KeyInfo = keyInfo;
        Reference reference = new System.Security.Cryptography.Xml.Reference();
        reference.Uri = "#" + evtNode["infEvento"].Attributes["Id"].Value;
        reference.AddTransform(new XmlDsigEnvelopedSignatureTransform());
        reference.AddTransform(new XmlDsigC14NTransform(false));
        SignedDocument.AddReference(reference);
        SignedDocument.ComputeSignature();
        XmlElement xmlDigitalSignature = SignedDocument.GetXml();
        XmlNode nodeAss = xmlDoc.ImportNode(xmlDigitalSignature, true);
        evtNode.AppendChild(nodeAss);
    }
    return xmlDoc;
}

And here is the XML element:
<?xml version="1.0" encoding="utf-8"?>
<envEvento xmlns="http://www.portalfiscal.inf.br/nfe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" versao="1.00">
  <idLote>1</idLote>
  <evento versao="1.00">
    <infEvento Id="ID2102103518064328381100910655001000067942126336601001">
      <cOrgao>91</cOrgao>
      <tpAmb>1</tpAmb>
      <CNPJ>53773073000182</CNPJ>
      <chNFe>35180643283811009106550010000679421263366010</chNFe>
      <dhEvento>2018-07-25T02:47:06-03:00</dhEvento>
      <tpEvento>210210</tpEvento>
      <nSeqEvento>1</nSeqEvento>
      <verEvento>1.00</verEvento>
      <detEvento versao="1.00">
        <descEvento>Ciencia da Operacao</descEvento>
      </detEvento>
    </infEvento>
    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
      <SignedInfo>
        <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
        <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
        <Reference URI="#ID2102103518064328381100910655001000067942126336601001">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue>BahmhJGVCbcRzzZ2a3IdfoGggSY=</DigestValue>
        </Reference>
      </SignedInfo>
      <SignatureValue>01MRXk7YiSo9g8OBqR0H4gmYxXBHCFAfoloKacDOYMZr/1Y4kl0GZcfqOCM6+AyxpNmVUYPh860tMklqdTqwXeJR4eceIafJag9lntCD3BuiXnR/O9uP6jxouPu+aGf2fpuVbsOex6WnKG5gPtOnV02cvZ0nB0pMbyhetFEOptq/F8Mv/+wcYsQGnFAFLD2jqqSD0HGeNJPh8C4M6JGh6jjgC8FOnLtihd+cqydNH/OTjDwSczhtEM/3GyeHULf+RJS4DEfRhLLcpdpJAsV9yzSIhkf1ecnVvdjncc4SZdySEOMYhtJLOhQqU6pTGhZS0D0/BiA3O6E6ZTgB1xPUQw==</SignatureValue>
      <KeyInfo>
        <X509Data>
          <X509Certificate>MIIH6TCCBdGgAwIBAgIIDsPfGUgZG6UwDQYJKoZIhvcNAQELBQAwcTELMAkGA1UEBhMCQlIxEzARBgNVBAoTCklDUC1CcmFzaWwxNjA0BgNVBAsTLVNlY3JldGFyaWEgZGEgUmVjZWl0YSBGZWRlcmFsIGRvIEJyYXNpbCAtIFJGQjEVMBMGA1UEAxMMQUMgVkFMSUQgUkZCMB4XDTE4MDMwMjIwNDQyNloXDTE5MDMwMjIwNDQyNlowgdkxCzAJBgNVBAYTAkJSMQswCQYDVQQIEwJTUDESMBAGA1UEBxMJU0FPIFBBVUxPMRMwEQYDVQQKEwpJQ1AtQnJhc2lsMTYwNAYDVQQLEy1TZWNyZXRhcmlhIGRhIFJlY2VpdGEgRmVkZXJhbCBkbyBCcmFzaWwgLSBSRkIxFjAUBgNVBAsTDVJGQiBlLUNOUEogQTExFDASBgNVBAsTC0FSIFZBTElEIENEMS4wLAYDVQQDEyVTT0ZUSU5HIEFVVE9NQUNBTyBMVERBOjUzNzczMDczMDAwMTgyMIIBIjANBgkqhk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whE2Q==</X509Certificate>
        </X509Data>
      </KeyInfo>
    </Signature>
  </evento>
  <evento versao="1.00">
    <infEvento Id="ID2102103518064328381100910655001000067986126343904601">
      <cOrgao>91</cOrgao>
      <tpAmb>1</tpAmb>
      <CNPJ>53773073000182</CNPJ>
      <chNFe>35180643283811009106550010000679861263439046</chNFe>
      <dhEvento>2018-07-25T02:47:06-03:00</dhEvento>
      <tpEvento>210210</tpEvento>
      <nSeqEvento>1</nSeqEvento>
      <verEvento>1.00</verEvento>
      <detEvento versao="1.00">
        <descEvento>Ciencia da Operacao</descEvento>
      </detEvento>
    </infEvento>
    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
      <SignedInfo>
        <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
        <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
        <Reference URI="#ID2102103518064328381100910655001000067986126343904601">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue>atbTWNxi44DcxulttJidbuNCxQo=</DigestValue>
        </Reference>
      </SignedInfo>
      <SignatureValue>+wxGkr1l7uFnzlcPFhOSnMN675j9syXlPW9L2UupO1lAienG0GQ9Ta786Wh3/RmqLywfhjob6KXXkh2iiVXAUrOVcQU9akRxwlse93auCEJRff5uQChgKryQycu6XigB/nhNPE50ay8xnhFsSR3nHGYjWcWVnKi6uQAnM69Bx6lOQpvTTh+pSNM2/lXD/eC94b3iKzEi4DkE0yfQ1LRUGd7tUnB0/Y8j+Hu+w8pFYh6Nurabmv1GjNRzpDooZUGxcuWkvtVsFd3VshVqIZ7FKIMnGw8fcsN2h+sv3/OQqe7MJ78z98fMoUv/R1FTklWYqV6vUptK1XnyJ61VbHz1XQ==</SignatureValue>
      <Key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JbOlJ2I4sJwioJc/PsAqn+VDbb7KVrUC6VXZVYs/9tsFETrNdal7BnGXts5wiZtPa1iRx90RLxFfJeJ0E2Y/0kY4VCagn+vovgyYB76i8F03lkJnW2ScpCeaunva2NurlORRiNfhy9YpBqYdIZA5I0S3qOlgi1BLdrNkNHnlAsv7VO3xzEwsX/pR8g7b97TYtjcxJpnz3zeCLJb2Fawudd6C2aubUUxotbj7W/ER1De8yDDHKd7xt62s8Qarw2EICBMQzaGKKnQXBzddtCmS1Skjbloq5s03dH2Q0NJigG7lodRrSWvndtTkmoksL/IjOVq6z4sBYB36mPr+PqMklnisU6pinHa5/vFbJiIfbbNHdcogp+ndOz9AMRS76EtJubspQ/sSALZzicp1bXtgpnaLdOC+ow8pW1XH/bZOcWDo1vieQCs7Y/T2tPIEw4FBa6BvEwbK4w31VUaoe3aac/Wlhl52f7aydp/4VeH5fzFk2sTMpOw5a8tGyO5Avoem1SCJEinjJBLBu9V3UF/4kJc7M4+8i8MdX50cJA30Go5EpMnuvB4nHe8x9RxgpFyBhoqRWkTLBvHCs84OPlu6jMN0whE2Q==</X509Certificate>
        </X509Data>
      </KeyInfo>
    </Signature>
  </evento>
</envEvento>

Thanks for the attention

A: Here is what I currently use for one of mine. Some like adding an additional element may not be needed in your case but, just in case I left it in there.
private static void SignXml(XmlDocument doc, X509Certificate2 cert)
{
    var signer = new SignedXmlWithId(doc);

    signer.SigningKey = cert.PrivateKey;
    signer.KeyInfo = new KeyInfo();

    var s = new SecurityTokenReference();
    s.Reference = "uuid-639b0-fc-1";
    s.ValueType = "http://Something.com";
    signer.KeyInfo.AddClause(s);

    signer.SignedInfo.CanonicalizationMethod = SignedXml.XmlDsigExcC14NTransformUrl;
    var bodyRef = new Reference("#ID-00008");
    var messageRef = new Reference("#ID-00004");
    var usernameRef = new Reference("#ID-00001");

    bodyRef.AddTransform(new XmlDsigExcC14NTransform());
    messageRef.AddTransform(new XmlDsigExcC14NTransform());
    usernameRef.AddTransform(new XmlDsigExcC14NTransform());

    signer.AddReference(bodyRef);
    signer.AddReference(messageRef);
    signer.AddReference(usernameRef);

    signer.ComputeSignature();

    var signData = signer.GetXml();

    var nsmgr = new XmlNamespaceManager(doc.NameTable);
    nsmgr.AddNamespace("SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/");
    nsmgr.AddNamespace("wsee", "http://stuff.to.add");
    nsmgr.AddNamespace("cwsh", "http://more.stuff.to.add");

    var security = doc.SelectSingleNode("/SOAP-ENV:Envelope/SOAP-ENV:Header/wsee:Security", nsmgr);
    security.AppendChild(doc.ImportNode(signData, true));
}

//Subclass to add namespace when signing
public class SignedXmlWithId : SignedXml
{
    public SignedXmlWithId(XmlDocument xml) : base(xml)
    {
    }

    public SignedXmlWithId(XmlElement xmlElement) : base(xmlElement)
    {
    }

    public override XmlElement GetIdElement(XmlDocument doc, string id)
    {
        // check to see if it's a standard ID reference
        var idElem = base.GetIdElement(doc, id);

        if (idElem == null)
        {
            var nsManager = new XmlNamespaceManager(doc.NameTable);
            nsManager.AddNamespace("wsu",
                "http://wsssecurity.location");

            idElem = doc.SelectSingleNode("//*[@wsu:Id=\"" + id + "\"]", nsManager) as XmlElement;
        }

        return idElem;
    }
}


text:
Q: Scrapy shell ignoring export SCRAPY_SETTINGS_MODULE I've set the settings module envvar value to my_module.my_submodule.my_leaf_module. Inside is a number of constants set including a DEFAULT_REQUEST_HEADERS dictionary. Anyway I set the above and run the scrapy shell against a sample URL I want without any spider specified. When it starts up there are no exceptions or warnings but my supplied settings module is not used.
What am I doing wrong?

A: I don't think the setting modules is loaded during shell. See the documentation below
https://doc.scrapy.org/en/latest/topics/shell.html
It has no mention of it. What you can though do is create a DebugSpider and launch your url in that and invoke a debugging shell. So add below to your spiders code
class DebugSpider(scrapy.Spider):
    name = "debug"

    def __init__(self, url=None):
        if url is None:
            raise Exception("Please specify a url using -a url=....")
        self.start_urls = [url]

    def parse(self, response):
        from scrapy.shell import inspect_response
        inspect_response(response, self)

Then from terminal run
scrapy crawl debug -a url="http://tarunlalwani.com"

This will load your settings module also and make the request and give you a same debugging shell
2017-09-12 00:16:27 [scrapy.core.engine] DEBUG: Crawled (200) <GET http://tarunlalwani.com> (referer: None)
[s] Available Scrapy objects:
>>> [s]   scrapy     scrapy module (contains scrapy.Request, scrapy.Selector, etc)
[s]   crawler    <scrapy.crawler.Crawler object at 0x10562b748>
[s]   item       {}
[s]   request    <GET http://tarunlalwani.com>
[s]   response   <200 http://tarunlalwani.com>
[s]   settings   <scrapy.settings.Settings object at 0x106432c50>
[s] Useful shortcuts:
[s]   shelp()           Shell help (print this help)
[s]   view(response)    View response in a browser


text:
Q: Activity vs Fragment in my case. I need practical example to fully understand this In first I apologize for question that was answered here many times but I can't fully understand concept of activity vs fragment, and I need clarification on real example.
I'm in the middle of writing application that:

*

*Has hamburger menu and three activites there, I navigate between them
like that:
public boolean onNavigationItemSelected(MenuItem item) {

int id = item.getItemId();

if (id == R.id.nav_searchForNew) {
    startActivity(new Intent(this, SearchActivity.class));
} else if ...

*First activity lets user type TV show name and sends request to web
api for basic information about the show, user can click button to
subscribe the show. If he does the show is added to list.

*Second activity shows list of subscribed shows and lets user
unsubscribe them.

*Third activity presents a list of upcomming episodes of subscribed
shows.
So far I have only searchActivity written and I think that I should rewrite it as Fragment but I can't explain why.
Could I ask for a little clarification?

*

*What is the difference in this particular project?

*How different is sending list of subcribed shows between Activities
and Fragments?

A: Given what you've explained of your project, you should use activities for all three of those functions.  A fragment is most useful when you plan to reuse a chunk of code in multiple places (ie. you want to use Fragment X in Activity A and in Activity B).  You don't seem to have a need for that.  Fragments are also useful if you want to have the ability to display different things on different size screens (on a phone, you could display one fragment per screen, but on a tablet, you could display all three fragments side by side).  That is a more complex undertaking and given that you are new at this, you should stick with activities for now.
For more on fragments, read this: http://developer.android.com/guide/components/fragments.html


text:
Q: How do I get artifacts in Risk of Rain 2? How can I find the codes for all of the artifacts in risk of rain 2? I have command but that's all.

A: You need to find a code, use it to unlock a challenge in a hidden part of Sky Meadow (stage 5) and then complete it:

Unlocking
To unlock Artifacts you need to use the correct Artifact Code in Sky Meadow, using the Compound Generator below the map, then interacting with the laptop. A Portal to the trial for that Artifact in Bulwark's Ambry will spawn.
The Compound Generator will cycle in the order: square, circle, triangle, diamond (■ ● ▲ ♦)
In Bulwark's Ambry, the Artifact whose trial is being attempted will be active and an Artifact Key will be on an elevated block in front of the Artifact Reliquary. The player must give the Artifact Key to the Artifact Reliquary, which will cause monsters to start spawning, with more Artifact Keys dropping from randomly killed monsters. Using an Artifact Key will remove them from all player inventories.
Upon destroying the Artifact Reliquary, the Artifact can be taken and a portal to a First Stage will appear.

I think so far every stage or environment (including hidden ones) have exactly 1 hidden artifact challenge code. You should search for codes on tablets like this one:

If you want to find all artifacts by yourself, I recommend this Artifacts Hints page: it has some vague hints about stages and where to search for the code.
If you just want to unlock them without searching, here are all artifact codes under this spoiler:

Sources: source 1, source 2 .


text:
Q: Navbar hiding a div My navbar is hiding my the div that should be above it
Not complete replica of my own but here is the fiddle
HTML:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Burger Corner</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/scrolling-nav.css" rel="stylesheet">
    <link rel="icon" href="images/favicon.png" type="image/x-icon">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                    Toggle navigation

                </button>

Welcome

About us

Reservation

Contact us

Login

Burger Corner

Welcome section

About Section

CSS for the problematic div and the one that works :
.top_title{
    font-family: 'Playball', cursive;
/*    background-image: url(../images/intro.jpg) no-repeat center center;*/
    background-size: cover;
    width: 100%;
    height: 100px;
    background-color:#990000;
    text-align:center;
    padding-top: 150px;
}

.intro-section {
    height: 100%;
    padding-top: 150px;
    text-align: center;
    background: #fff;
    z-index: 1;
}

CSS for the navbar:
.color_animation {
    text-decoration: none;
    margin-right: -5px;
    margin-left: -5px !important;
    color: white !important;
    -webkit-transition: color 0.3s ease-out;
    -moz-transition: color 0.3s ease-in-out;
    -o-transition: color 0.3s ease-in-out;
    -ms-transition: color 0.3s ease-in-out;
    transition: color 0.3s ease-in-out;
}
.color_animation:hover{
    color: #990000 !important;
}

.main-nav a {
        font-size: 20px;
        font-weight: 700;
        text-decoration: none;
        color: #000;
        display: block;
        text-align: center;
        padding: 2px 0;
        transition: color 0.3s ease-in-out;
}

.main-nav {
        padding: 0;
       /*margin:  auto 0 auto;*/
}

    li{
    color: white !important;
    word-spacing: 5px !important;
}

Extra CSS:
body {
    width: 100%;
    height: 100%;
}

html {
    width: 100%;
    height: 100%;
}

@media(min-width:767px) {
    .navbar {
        padding: 20px 0;
        -webkit-transition: background .5s ease-in-out,padding .5s ease-in-out;
        -moz-transition: background .5s ease-in-out,padding .5s ease-in-out;
        transition: background .5s ease-in-out,padding .5s ease-in-out;
    }

    .top-nav-collapse {
        padding: 0;
    }
}

I even tried using the intro-section  class and modified it, changed its name and added some code but it genuinely doesnt work.The navbar hides it, it doesnt have the background i told it to have or even the height
I made the navbar invisible just for the testing and as you can see the div is under the navbar and the orange section is the one i said i took its css and modified it.

A: I don't think there is a CSS solution to your code. You can check the scroll position to make the navbar fixed and back to static, by removing or adding the navbar-fixed-top class, like this:
 $(window).scroll(function() {
   if ($(window).scrollTop() > 50) {
     $('.navbar').addClass('navbar-fixed-top');
   }
   if ($(window).scrollTop() < 51) {
     $('.navbar').removeClass('navbar-fixed-top');
   }
 });

Updated FIDDLE.


text:
Q: angularjs: ngAnimate not working I am new to angularjs. I am trying angularjs with rails (using "angularjs-rails" gem). I am having trouble using ngAnimate. The functionality works fine i.e. angular is properly installed and "addEntry" function adds up the new entry, but animation is not working. I am not sure what I am missing here.
app = angular.module("MyApp", ['ngAnimate'])

@MainCtrl = ($scope) ->
  $scope.entries = [{name: "Dummy1"}, {name: "Dummy2"}]

  $scope.addEntry = ->
    $scope.entries.push({name: "Dummy3"})

Here is the html file:

  <button ng-click="addEntry()"></button>

    {{entry.name}}

Here is CSS to support ngAnimate:
.demo-enter {
  -webkit-transition: all 1s linear;
  transition: all 1s linear;
  background: #000;
}

.demo-enter.demo-enter-active {
  background: #ccc;
}

A: The ng-animate attribute is deprecated in 1.2 and no longer used. Instead, animations are now class based.
If you want your ng-repeat enter animaiton to be named 'demo' you have to decorate it with some additional classes following a special naming convention:
.demo.ng-enter {
  transition: all linear 500ms;
  opacity: 0;
}

.demo.ng-enter-active {
  opacity: 1;
}

Then just put the 'demo' class on the element containing the ng-repeat:

Demo: http://plnkr.co/edit/kNeXtl6TpGNvtQEpErwh?p=preview
Good source on the subject: http://www.yearofmoo.com/2013/08/remastered-animation-in-angularjs-1-2.html

A: If you want the fade animation, set opacity to 0 at the setup class, and opacity to 1 at the active
.animate-enter {
    -webkit-transition: 1s linear all; /* Chrome */
    transition: 1s linear all;
    opacity: 0;
}

.animate-enter.animate-enter-active {
    opacity: 1;
}


text:
Q: Analogue of Temperley-Lieb algebra of higher rank In Piunikhin's Turaev-Viro and Kauffman invariants for 3-manifolds coincide, the exact relation between Kauffman algebra and the representation of the quantum group $U_q(sl_2)$ is shown.
This seems to be a coincidence due to low rank $n=2$, because all irreducible representations can be obtained as symmetric products of the lowest nontrivial one, which is not the case for higher $n$. Also, the smallest nontrivial one is small enough to impose Kauffman bracket relation!
What then is an analogue of TL-algebra that corresponds to the representations of $U_q(sl_n)$?

A: There are a lot of references. Here is a paper by Sussan on link invariants associated to $sl_k$. Another pair of papers (a) & (b) by Cautis-Kamnitzer also work on this problem.
More recent approaches using the idea of "categorification" are described by Lauda, see results by Khovanov-Lauda (and references therein) and this paper by Webster.


text:
Q: change setInterval interval from 100ms to 50ms With my setInterval I add my data value 0.0152 in every 100ms after my data value becomes more than 1 I want 0.0152 to be added in every 50ms and i've no idea how, I wrote it but even if not working any solutions ?
  data:{
    crashValue: 0,
  },
  mounted(){
    setInterval(this.crashFunction,100);
  },
  methods:{
    crashFunction: function() {
      this.crashValue += 0.0150;
      if(this.crashValue == 1){
        setInterval(this.crashFunction,50)
      }
    },
  }

{{ crashValue.toFixed(2) }}x

A: You need to stop the old interval timer when you start the new one. So you need to save the timer in a variable.
You should check that you're actually crossing the threshold, so you need to check that the old value of crashValue is less than 1 and the new value is at least 1. this.crashValue == 1 is never going to happen because 1 isn't a multiple of 0.015 (and you should also avoid using == with floating point, because of roundoff errors).
data:{
    crashValue: 0,
    timer: null
  },
  mounted(){
    this.data.timer = setInterval(this.crashFunction,100);
  },
  methods:{
    crashFunction: function() {
      let oldcrashValue = this.crashValue;
      this.crashValue += 0.0150;
      if(oldCrashValue < 1 && this.crashValue >= 1){
        clearInterval(this.timer);
        this.timer = setInterval(this.crashFunction,50)
      }
    },
  }

A: You could potentially write it using setTimeout instead of setInterval, dodging the problem of clearing the original timer:
data: {
  crashValue: 0,
},
mounted () {
  this.startTimer();
},
methods: {
  crashFunction () {
    this.crashValue += 0.0150; // Should this be 0.0150 or 0.0152?
    this.startTimer();
  },
  startTimer () {
    setTimeout(this.crashFunction, this.crashValue > 1 ? 50 : 100);
  }
}

A: Existing interval cannot be changed, only cancelled. As other answers explain, another 50ms setInterval or setTimeout should be set instead of 100ms when the time comes.
If intervals are multiples, this can be done with single interval that is a common denominator:
crashFunction: function() {
  if (this.crashValue < 1 && this.i % 2)
    return; // skip every second time

  this.i++; // not tied to exact crashValue
  this.crashValue += 0.0150;
},


text:
Q: If $u \in H^1(0,T;L^2(0,L))$ then for a.e. $x\in (0,L)$ we have $u(\cdot, x)\in H^1(0,T)$ Idea of the proof:
First of all, one can prove that $u \in H^1(0,T;L^2(0,L))$ implies $u\in L^2((0,T)\times (0,L))$, $\partial_t u \in L^2((0,T)\times (0,L))$ ( with $\partial_t$ in the sense of $\mathcal{D}'((0,T)\times (0,L))$) and that $ \partial_t u(t,x)=\dot u (t,x)$ for a.e. t and a.e. x.
Let $(\varphi_n)$ dense in $C^\infty_c(0,T)$ in the $C^1$ norm. We know that
$$ \int_0^T \dot u(t) \varphi_n(t) dt = -\int_0^T  u(t) \dot \varphi_n(t) dt \quad \forall \,n$$
where the integral are in the sense of Bochner.
Let $\psi \in C^\infty_c(0,L)$ arbitrary. We have
$$ \int_0^L \int_0^T \dot u(t, x) \varphi_n(t, x) dt \psi(x) dx = -\int_0^L \int_0^T u(t, x) \dot\varphi_n(t, x) dt \psi(x) dx \quad \forall \,n, \forall \psi$$
which implies that there exists a negligible set $N_{u,\varphi_n}$ such that far any $x\in (0,L) \setminus N_{u,\varphi_n}$ we have
$$ \int_0^T \dot u(t, x) \varphi_n(t, x) dt = -\int_0^T u(t, x) \dot\varphi_n(t, x) dt \quad \forall \,n.\quad (*)$$
Let $N_u=\cup_n N_{u,\varphi_n}$. It is negligible and for every $x\in N_u$ we have $(*)$. Taking the limit for $n \to \infty$ in $(*)$ we have conclude.

Can you give a check ? Can you suggest a faster proof ?
Thanks.


text:
Q: When installing Kubuntu on a laptop with pre-installed windows 10, is there anything i need to preserve? Do i wipe the entire physical drive? or just the C: partition?
Is there anything that's essential to keep in order for the laptop to function? and is there anything that might be worth keeping but isn't essential?
that EFI system partition looks like it might need to be there?
will keeping the recovery partitions help me reinstall windows later if i want to change it back to windows? [i'm a bit worried about losing the OEM license]

A: if you think you might want to reinstall windows, keep the EFI and both recovery partitions. Delete the C: partition and install ubuntu there. you may then need to change boot priority in system settings.
If you don't want windows, you can erase the whole drive, ubuntu will recreate the efi partition.

A: I suggest dual-booting Kubuntu with Windows. You should resize "Windows C:" and leave some unallocated space for kubuntu (don't create a new partition). Then, use the unallocated space to create your kubuntu and swap partition. I will link a tutorial for you: Dual-boot Kubuntu with Windows


text:
Q: How to prevent image upload XSS attacks? I recently did a CTF challenge where we needed to do an XSS attack on a site with a Content Security Policy ...  script-src 'self' ... . This was made possible because the website offered the possibility to upload images, which we used to upload a file containing Javascript code with a GIF header like GIF89a=alert(document.cookie)//;.
All we had to do after successfully uploading that image was call that image with something like http://website.com/<script src=url_to_our_image> and the code was executed despite the CSP.
Now my question: How could you prevent that? I assume you want to keep CSP at ...  script-src 'self' ... (you want to trust your own scripts, right?). But what other option would then be left to prevent such an attack? Blacklisting some content of the image, so that it cannot contain code? (I heard that blacklists a generally a bad idea)


text:
Q: Linq: Selecting specific columns using DTO
I know that in manual way I can choose what columns are fetched from database (simplified examples):
db.Products.Where(...).Select(p => new {p.Id, p.Name...})

But, when i have DTO object:
public class ProductDTO {
    public int Id { get; set; }
    public string Name { get; set; }

    public ProductDTO(Product p) {
        Id = p.Id;
        Name = p.Name;
    }
}

and query:
db.Products.Where(...).Select(p => new ProductDTO(p))

from database are fetched ALL FIELDS, not only Id and Name. It's waste of resources.
Why linq can't see what properties are in DTO and fetch only them?
I guess that's what the DTO is for, so that I don't have to write a manual query every time.

A: In your case, when you create a new instance of ProductDTO, unfortunatelly LINQ doesn't have any information about the properties of the ProductDTO class. But it knows that your ProductDTO waits for Product objecy, and therefore downloads the full entity from the database, as you tell to get the FULL Product p into your ProductDTO constructor.

db.Products.Where(...).Select(p => new ProductDTO(p))

The possible solution is to define the mapping of needed properties EXPLICITLY in your LINQ query:
db.Products.Where(...).Select(p => new ProductDTO(p.Id, p.Name))

You could also use AutoMapper for that to avoid code repeating. It gives you access to ProjectTo<T>() extension method that should help you:
db.Products.Where(...).ProjectTo<ProductDTO>()

Note: make sure you configured the mapping properly:
Mapper.Initialize(cfg => {
    cfg.CreateMap<Product, ProductDTO>();
});


text:
Q: How to find who last modified the Key vaults in Azure Portal? How to find who last modified person name in the Key vaults in Azure Portal?.
I am trying to find the user details who are changing the key vaults public or secret keys in KeyVault in Azure Portal. Please share your input on this.

A: As @GauravMantri said You can by checking user activity log like this way:

Note:

*

*Go to your key-vault resource

*Click on Activity log

*Set your Filter  By Key vaults (Microsoft.KeyVault/vaults)

*Select Your timestamp

Hope you would get your expected results as shown on screen shot.

A: In order to find the last modified modified name, you can use the Actitiy Log and then apply a filter with Resource and select your resource(Keyvault)


text:
Q: Is it possible to define a class-scope objet from a method? This may seem totally unreasonable to ask, but I have been designing a multi-panel, real device simulator, that has many different screens and my current approach is to add all the screen objects from the code only and dispose them when I switch to another screen.
I have some fixed objects, that are the real device buttons that are already defined and in place. The thing is, I am separating each panel construction in methods, for example: buildLogin(), buildMainScreen(), etc, and I need to edit some of the screen objects from those methods, like changing the color of an enabled function label to green if enabled or white if disabled.
My question is: would it be possible to declare an object from a method that would be accessible in the whole class, like if it were defined in the variable declaration section? It would be something like the GLOBAL in PHP.
I can't declare it on top of everything like they would always be because when I dispose the objects, I can't "re-create" them, because of parenting, or re-using a disposed object or something...
[EDIT] Sample code:
public partial class frmMain : Form
{
    //I could as well do this:
    //Button button1 = new Button();

    public frmMain()
    {
         buildLogin();
    }

    private void buildLogin()
    {
        Panel panel1 = new Panel();
        Controls.Add(panel1);

        //But then, there is no way to do this:
        // if (button1.IsDisposed == true) //because of the panel, or smthing
        Button button1 = new Button();
        panel1.Controls.Add(button1);

        button1.Click += (s, f) => { panel1.Dispose(); buildMainMenu(); };
    }

    private void buildMainMenu()
    {
        Panel panel2 = new Panel();
        Controls.Add(panel2);

        Button button2 = new Button();
        panel2.Controls.Add(button2);
    }

    //This was created from the Designer and is class-scoped
    private void btn_Frame_TSK1_Click(object sender, EventArgs e)
    {
        //Here, I have no access to the objets I've created programatically.
        //button1.Text = "Text changed!";
    }
}

A: If you want to make sure things are always completely dynamic and always done in the code behind, you may want to look at searching for the controls you've created in the Controls collection.
For example, make sure to give button1 an ID value (button1.ID="textUpdatedButton") that will identify it uniquely from other controls you create.  Then use FindControl or search on the Controls collection to find the control with the ID you want to locate in your event handler.
//This was created from the Designer and is class-scoped
private void btn_Frame_TSK1_Click(object sender, EventArgs e)
{
    Control control = this.FindControl("textUpdatedButton");
    if(control != null && control is Button){
        Button button1 = (Button)control;
        button1.Text = "Text changed!";
    }
}

Alternatively, to make things look more like a variable, you can use a Property to hide the control finding (as mentioned previously):
private Button Button1 {
    get { return (Button)this.FindControl("textUpdatedButton"); }
}

//This was created from the Designer and is class-scoped
private void btn_Frame_TSK1_Click(object sender, EventArgs e)
{
    if(this.Button1 != null){
        this.Button1.Text = "Text changed!";
    }
}

The actual implementation will vary with how you build up your controls, but essentially this approach can let you build everything dynamically in your code behind if you need to do it that way.  Just remember to use identifiers to let you find things later.

A: Define your object at the class level, as Static. This way it will be accessible from all methods of all instances of the class(disposing an instance will not affect it).


text:
Q: How do I turn my urls into readable names? I have been creating a Hackernews type clone recently and bumped into some trouble with adding a more readable url. I believe it's called a Slug from what I've read.
Basically, my urls read something like: localhost/1/, localhost/2/ which are taken from the Category model. Instead of reading /1/, /2/ etc, I would prefer it to take the category_name field and populate the url. For instance localhost/engineering, localhost/science.
Here is my category model:
models.py
class Category(models.Model):
    category_name = models.CharField(max_length = 50)
    created_at = models.DateTimeField(auto_now_add = True)
    updated_at = models.DateTimeField(auto_now = True)

    def __unicode__(self):
        return self.category_name

    class Meta:
        verbose_name_plural = "categories"

Here is my current url.py:
url.py
url(r'^(?P<category_id>[0-9]+)/$', 'stories.views.category'),

and my views.py:
views.py
def category(request, category_id=1):
    template = 'stories/category.html'
    category = Category.objects.get(id = category_id)
    return render_to_response(template, {
        'category': category
        })

How should I go about implementing something like this? I've read things about Slugify, but could never get it to work properly. Thankyou.

A: Your urls.py should be,
url(r'^(?P<category_name>\w+)/$', 'stories.views.category'),

while, the views.py should be something like,
def category(request, category_name):
    template = 'stories/category.html'
    category = Category.objects.get(category_name = category_name)
    return render_to_response(template, {
        'category': category
        })

the above, might work if you are not using slugified category_name. If you do, then use a slug field in your model as mentioned by this stack overflow answer


text:
Q: DVD Menu Creation in .NET Does anyone know of a good component for .NET that will allow me to create a menu and .iso for a DVD?  For each DVD I have several video files and photos that I'd like to turn into a DVD automatically.

A: YMMV, but it is unlikely that you would find a drop-in component that would do this. DVD authoring is a very involved task, and generally only implemented in full software packages that support the whole process end-to-end.
That said, there are some OSS projects out there that do DVD authoring (e.g., dvdauthor, DVDStyler, etc.) that you might be able to incorporate into your project, subject to their respective licenses of course. I'm not aware of any .NET ones, and again the focus of these is generally to actually do the authoring, not expose an API, but a lot of them do use XML (or similar) files to describe menus and such, so you may be able to generate these from .NET and then shell out to them to do the work. That's about as close as you'd likely get without doing a LOT of work yourself, however.
The other option would be to find a commercial package with a scripting or automation engine, although these tend to be the higher-end ones that are very expensive.

A: RocketDVD Professional may be what I'm looking for.


text:
Q: Space between components in UIPickerView
Does anyone know how I can decrease the spacing between year and month? Also I want minute and seconds more closer, I have been trying to do this for a long time, but could not figure it out. It seems that widthForComponent in UIPickerView has nothing to do with the spacing between components. Do you guys have any thoughts?
This is how widthForComponent looks like in my code.
 func pickerView(pickerView: UIPickerView, widthForComponent component: Int) -> CGFloat {

            switch component {
            case 0 : return 65
            case 1 : return 50
            case 2 : return 30
            case 3,4 : return 40
            case 5: return 50
            default : return 30
            }
    }

Do I have to use viewForRow or attributedTitleForRow methods to get this? Right now I have not used it.


text:
Q: Jquery binding woes I've read a number of explanations but it seems I just can't grasp the concept of binding. In the following code how would I make 'this' refer to the object rather than the element that called the 'search' function?
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 >
<title></title>
</head>
<body>
<input id="inpt">
<script>
obj = {
  theElement: null,
  func1: function(inpt) {
    this.theElement = $(inpt);
    this.theElement.keyup(this.search);
  },
  search: function(e) {
    alert(this);  //'this' refers to the input element (#inpt) but I want it to refer to 'obj'
  }
};
obj.func1('#inpt');
</script>
</body>
</html>

Hope that makes some sense...

A: Change this line:
    this.theElement.keyup(this.search);

to this:
    this.theElement.keyup(function() {
        obj.search();
    }

or this:
    this.theElement.keyup($.proxy(this.search,this))

...which uses jQuery.proxy()(docs) to return a function that will invoke search() with the proper this value.
There is also the .bind() method that can be used to bind context and parameters to a function, but it isn't widely supported yet.

A: Two ways:
1. Use your own closure:
obj = {
  theElement: null,
  func1: function(inpt) {
    var self = this;
    this.theElement = $(inpt);
    this.theElement.keyup(function() {
        self.search();
    });
  },
  search: function(e) {
    alert(this);  //'this' refers to the input element (#inpt) but I want it to refer to 'obj'
  }
};

More reading: Closures are not complicated
Edit: Although as patrick points out, you already have a reference to it in obj and so technically don't need self. The above is more of a general solution (particularly when you use factory functions rather than singleton objects).
2. Use one jQuery creates for you:
...via jQuery.proxy:
obj = {
  theElement: null,
  func1: function(inpt) {
    this.theElement = $(inpt);
    this.theElement.keyup(jQuery.proxy(this.search, this));
  },
  search: function(e) {
    alert(this);  //'this' refers to the input element (#inpt) but I want it to refer to 'obj'
  }
};

More reading: You must remember this


text:
Q: CSS file not updating when using GulpJS with Browser sync I'm using GulpJS as a build tool to concat and minify my styles into 1 script. I'm watching my css files for changes and then doing the necessary performance things in a css gulp task before reloading the page with browser sync. For some reason the browser reloads and the css changes are not applied. If i attempt to put a background: red on body to test, no change occurs. If I then go in to the new styles.css file I see that the css task does its job of combining the files (including the change) and pushing it to 1 unified file, but that file is not used. After a few hours of researching I think it may have to do with Chrome caching the old css file? Here's the relevant part of my gulpfile.js:
// css task
gulp.task('css:dev', function() {
    return gulp.src('app/assets/css/src/*.css')
        .pipe(plumber())
        .pipe(sourcemaps.init())
            .pipe(concat('styles.css'))
            .pipe(prefix({
                browsers: ['last 2 versions']
            }))
            .pipe(cssNano())
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('app/assets/css'))
        .pipe(browserSync.reload({stream:true}))
});

// watch for file and changes and reload browser
gulp.task('watch', function() {
    gulp.watch('app/assets/css/src/*.css', ['css:dev']);
});

I'm also noticing the output in my terminal when the css:dev task runs:
GET /assets/css/styles.css?v=2388785908 200 21.388 ms - -
styles.css?=############# seems like an older version?? I'm a little lost. Any help would be greatly appreciated!


text:
Q: What enchantments can I use in the nether? What enchantments do I need to use in the Nether to collect all the potion ingridients like ghast tears and others in a really efficient way. Even if I get a potion of strength and fire resistance , ghast fire balls and the wither effect take me down.

A: None are really needed, but if you want to be able to kill ghasts and such faster, you can do the following:
Enchant a Bow with power (For Ghasts)
Enchant a sword with sharpness and/or knockback (For Blazes and ground creatures)
These should make it a little faster. If you want to make it an even faster process, you can give yourself a strength potion to increase attack damage or a speed potion so you can move around quicker.
Hope I could help,
-Nick


text:
Q: Distance from line to point less than I have two layers of data: a line layer containing information about roads (including a column for the type of road, such as "A" or "B") and a point layer containing information about settlements (including columns for the name of the settlement and the population in the year 2000). I would like to calculate the total population in 2000 who lived within settlements that were less than 300 meters from roads of type "A" and "B."
IN QGIS

A: In QGIS, you can use the "Join Attributes by Location" tool to combine the information from the line layer and the point layer.
First, make sure both layers are loaded in QGIS and are in the same projection.
Go to the "Vector" menu and select "Data Management Tools" then "Join Attributes by Location."
In the "Join Attributes by Location" dialog box, select the point layer as the "Target vector layer" and the line layer as the "Join vector layer."
Set the "Geometric predicate" to "are within distance of" and enter "300" in the "Distance" field.
Select the "Type" column in the "Join field" and select "Name" and "Population 2000" columns in the "Target field"
Click "OK" to run the analysis.
Once the analysis is complete, a new layer will be created containing the combined information from both layers. To calculate the total population in 2000 who lived within settlements that were less than 300 meters from roads of type "A" and "B", you can use the "Select by Expression" tool and then select the "Population 2000" column, and sum the values of the selected features.


text:
Q: Compound variables? Is this the correct term? I asked this yesterday in Cross-validated (the statistics equivalent of here) but got few views and no answers.  So I thought that I would ask it here.
I am looking for a term to describe the concept of a multi-characteristic variable. Examples of this are a) vectors - have both magnitude and direction b) Olympic records - have both event (categorical) and measurement - particularly races which have set distances and record times c) cell identifiers - have both row and column d) coordinates - x, y and z, + other coordinate systems
As can be seen, this term may or may not include relationships between the specified dimensions, but the "variable" lacks meaning without all its components.
Whilst "object", borrowed from programming, may be used, this is perhaps too general for the application. I am looking for a term that falls between "object" and "variable", where the relationships between the various elements are easily visualised/understood.
I thought that compound variable may fit the bill. But is that used for a different concept? If so, what would be a better term?


text:
Q: Angular project creation failed because of deprecated circular-json I used following command to create new angular project
ng new hello-world

It failed showing
npm WARN deprecated circular-json@0.5.9: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! Unexpected end of JSON input while parsing near '...rocess":"~0.7.0"},"_h'

Then I installed flatted using...
npm i flatted

But the error still occurs.
How to use flatted instead of deprecated library circular-json?

A: Run following commands that will clean NPM cache

npm cache clean --force

after this run following command

npm install -g @angular/cli@latest

then you can create angular project.

A: If it doesn't work, even after clearing the cache, which happened in my case:
Make sure you try the ng new create-app command using Powershell in administrator mode.
This worked for me.

A: I had the same problem. None of the above mentioned answers worked for me.
So I removed the content of .npmrc, ran the generate command and it worked.
After that, you can restore the content of your .npmrc if needed.


text:
Q: Improve file_field_tag appearance Further to the answer provided to this question regarding the appearance improvement of the file_field_tag, how can I replace the "Choose file" text with the filename after selection?

A: Solved it using the method described here .


text:
Q: Is transaction scope available in Entity framework 6.0 Entity framework 6.0 articles shows only "UseTransaction" and "BeginTransaction". Is transaction scope still available in Entity framework 6.0. If yes, how to use it and which dll to include?

A: yes its available and you can use System.Transactions dll file.
check this link (http://msdn.microsoft.com/en-us/data/dn456843)


text:
Q: Are weighted metrics still metrics? I am trying to find any result regarding the properties of metrics that are weighted: are they still metrics? If the weights are fixed, it's clear they would still satisfy the properties of a metric. However, what about weights that are dependent on each pair of elements in the metric space?
For example:
$$d(u,u') = d'(u,u')\,w(u,u')$$


text:
Q: XCode does not build Unity3D Project: lib not found I have Unity3D project and I built it for iOS. If I run it using XCode's simulator it works fine. But if I want to compile it for "iOS Device" or for a physical device connected to my Mac, I get lots of errors and as a result I can't create an Archive.
For a testing purpose, I even created an empty Unity3D project, built it for iOS and still get the same errors, although this project does absolutely nothing.
The errors are the following:

ld: library not found for -liPhone-lib
clang: error: linker command failed with exit code 1 (use -v to see invocation)

And these are the settings I use:

*

*Architectures: armv7, armv7s, arm64  (also tried removing arm64 without any positive result)

*Base SDK: iOS 7.1

*Build active: no

*Supported platform: iOS

*Valid arch:  armv7, armv7s, arm64

I use XCode 5.1.1 and Unity 4.5.1 (previously even tried 4.3.2)
How can I build the project and create the Archive?

A: I've run into the same issue some time ago and it was fixed by replacing quotes under library search path:
replace
"$(SRCROOT)/Libraries"

with
$(SRCROOT)/Libraries

more: http://answers.unity3d.com/questions/538363/error-when-i-updated-to-xcode-5-to-get-import-to-i.html


text:
Q: file upload not validating on null input I am using $_FILES for multiple file upload the problem is it is not validating the null condition i have two multiple input files and I want to check whether an image has been uploaded to a specific input type file and on the basis of that I am validating if input 1 has no image uploaded then do nothing I went through dozens of examples on the internet but still it is running both blocks. Here's my code:
<form method="post" action="flyers_admin_process.php" enctype='multipart/form-data'>

Add flyers for Canada(You Can Choose multiple Files)

                            <input type="file" id="fileName" name="fileName[]" multiple>

Add flyers for USA(You Can Choose multiple Files)

                        <input type="file" id="fileName2" name="fileName2[]" multiple>

                        <input type="submit" />
                    </form>

flyers_admin_process.php file
<?php
include "db.php";
if($_SERVER['REQUEST_METHOD']=="POST") {

    if(!empty($_FILES["fileName"]["name"])) {
        echo "inside 1";
        $path = "flyers_canada/"; // Upload directory
        $count = 0;
        foreach ($_FILES['fileName']['name'] as $f => $name) {
            if(move_uploaded_file($_FILES["fileName"]["tmp_name"][$f], $path.$name))
                $filetmp = $_FILES["fileName"]["tmp_name"][$f];
            $filename = $_FILES["fileName"]["name"][$f];
            $filepath = "flyers_canada"."/".$filename;
            $query="INSERT INTO `flyers_canada`(`path`) VALUES (?)";
            $stmt = $db->prepare($query);
            if($stmt){
                $stmt->bind_param("s",$filepath);
                $stmt->execute();
                $stmt->close();
            }

            $count++; // Number of successfully uploaded file
        }

    }

        if(!empty($_FILES["fileName2"]["name"])) {
        echo "inside 2";
        $path = "flyers_usa/"; // Upload directory
        $count = 0;
        foreach ($_FILES['fileName2']['name'] as $f => $name) {
            if(move_uploaded_file($_FILES["fileName2"]["tmp_name"][$f], $path.$name))
                $filetmp = $_FILES["fileName2"]["tmp_name"][$f];
            $filename =  $_FILES["fileName2"]["name"][$f];
            $filepath = "flyers_usa"."/".$filename;
            $query="INSERT INTO `flyers_usa`(`path`) VALUES (?)";
            $stmt = $db->prepare($query);
            if($stmt){
                $stmt->bind_param("s",$filepath);
                $stmt->execute();
                $stmt->close();
            }

            $count++; // Number of successfully uploaded file
        }

    }

    ?>

    <?php
}
?>


text:
Q: Term or phrase for attempting to gaslight a large group
Gaslighting or gas-lighting is a form of psychological abuse in which a victim is manipulated into doubting their own memory,
  perception, and sanity.  -Wikipedia

But gaslighting "a victim" implies a single victim and a single perpetrator, and carries a connotation of intimacy.  Is there a term or phrase that describes more or less the same general methods, (sans matrimony), but systematically applied to a body of people, and as perpetrated by some covertly adversarial group?
Propaganda would not be the precise term, (though it might encompass such practices), since not all propaganda requires lying, nor requires the propagandist directly denigrating their own audience.  Terms like whitewash, blackball, and smear campaign do imply lying, but the lie or lies more often tend to be about an object or third party.
If no English terms or phrases come to mind, loan-words or foreign phrases would also be useful.

Since this question was first posted, gaslighting has been used in a political sense, for example in this title:

*

*Gaslighting America: Why We Love It When Trump Lies to Us
But it seems uncertain whether that's more of a nonce usage which mainly serves as a form of branding just short of a trademark, by which to distinguish that book's marketing from several similar current talking-point books.  Answers forwarding this usage as a likely future standard term should provide several actual found usages, (that are not attempts at definitions), as evidence.
A somewhat more ambiguous usage here:

*

*Donald Trump in "Gaslight": Trapped in a House with a Psychopath

A: Although originally used with reference to an individual, viz. the "action or process of manipulating a person by psychological means into questioning his or her own sanity" (OED, Third Edition, December 2004; emphasis mine), rather than a group, the term 'gaslighting' (and the verb 'to gaslight') is now commonly used more broadly to include groups.
With or without the qualifier 'political', the broader use is seen in, for example, Taegan Goddard's Political Dictionary, where 'gaslighting' is defined as "a form of psychological manipulation that seeks to sow seeds of doubt in a targeted individual or group." Wikipedia also supports broader use:  "Gaslighting is a form of psychological manipulation that seeks to sow seeds of doubt in a targeted individual or in members of a targeted group", as do other contemporary reference sources.
Aside from contemporary reference sources, use of the term in popular news venues also includes the broader application to groups. For example, this from NBC News:

Psychologists use the term "gaslighting" to refer to a specific type of manipulation where the manipulator is trying to get someone else (or a group of people) to question their own reality, memory or perceptions.
— From the Jul. 13, 2018 article "What is gaslighting? And how do you know if it's happening to you?", in the NBC News publication Better (Health section). Emphasis mine.

After I posted my original answer (above), the question was changed substantially multiple times. The edits and rethinking of the question make an answer a moving target. However, just to be sure, 'to gaslight' has taken groups as appropriate and natural direct objects since at least as early as 1992:

Sometimes they [an unscientific panel of 12 US residents — ed.] wonder if his [George H.W. Bush's — ed.] much-publicized, pre-Christmas trip to a JC Penney store and his more recent excusion to Japan were merely attempts to gaslight the public into believing that he was on their side.
Detroit Free Press, Detroit, Michigan, 26 Jan 1992.

A: Since OP welcomed loan-words and foreign phrases, I'd like to contribute  the Russian word maskirovka. Perhaps not exactly what you're looking for, as the word encompasses a broader range of manipulation and disinformation tactics than just gaslighting. However, I think it's a fairly close fit: it's got a distinctly negative and deceptive connotation, as opposed to "propaganda" (which, as OP notes, does not ALWAYS require deception), and I found evidence that it is often used to describe tactics levied against a body of people or multiple persons.
https://en.oxforddictionaries.com/definition/maskirovka
https://blog.oxforddictionaries.com/2017/04/28/kompromat/

A: Interestingly, when I read through the OP's question, the first word that popped into my head was 'brainwashing'.
I have not seen this word used in American usage in a political context - it is typically used to report home-grown terrorist stories - but it is what it says: altering one's thinking/ideology through deceitful means.


text:
Q: Unable to locate package php8.1-geoip I am upgrading a system from PHP 7.4 to 8.1 using as base Ubuntu 22.10.
In the old image, we are using php7.4-geoip, but this package doesn't exist in PHP 8.1.
apt install php8.1-geoip

Unable to locate package php8.1-geoip

What is the procedure to migrate to a newer version?

A: This package isn't available yet, however you can install via composer.
Ensure GeoIP is installed on the machine:
apt install -y geoip-bin geoip-database
geoipupdate -v

Install via PHP Composer:
curl -sS https://getcomposer.org/installer | php
php composer.phar require geoip2/geoip2:~2.0

Quick test script to ensure it's all working:
<?php

require_once 'vendor/autoload.php';

use GeoIp2\Database\Reader;

$geoip = new Reader('/usr/share/GeoIP/GeoLite2-City.mmdb');
$reader = $geoip->city('12.87.118.0');

echo "I should be United States.... ".$reader->country->name."\n";

Output:
root@cc19c55aedef:/# php test-geoip.php
I should be United States.... United States


text:
Q: Reentrant Lock - possible outputs? given lock situation:

I think I got this right but I need to be sure so I'm asking you guys if I made a mistake.
I got two possible outputs for variables "x" and "y" in this programm:
1. Lines 1.1 - 1.7: y = 5,
   Lines 2.1 - 2.3: x = 15.

2. Lines 2.1 - 2.3: x = 11,
   rest             y = 25.

are there any other outputs in this exact situation?

A: The lock block on the right had side can occur in one of three places:

*

*Before 1.1

*Between 1.3 and 1.5

*After 1.7

The values of x and y for these three cases are

*

*x = 11, y = 25

*x = 11, y = 5

*x = 15, y = 5


text:
Q: jQuery: Move element by relative value (Meaning an elements left-value):
What's the easiest way to move an element - e.g. 10px to the left (from its current position)?

A: Here is a quick example using jQuery:
$("#el").css({
    left: $("#el").position().left - 10 + "px"
});

Note: the element that you want to move must either be positioned absolutely or relatively.

A: Assuming your element has the id 'myElement':
$('#myElement').css(
{
  'position': 'relative',
  'left': '-10px'
});

A: It might be that jQuery is overkill and setting margin-left: -10px will do the trick.
You can get an element's offset() relative to the document: http://docs.jquery.com/CSS/offset
That'd give you the left,top,etc.
Then you might have to position the element using the css like so.
 subMenu.css({
            position: 'absolute',
            zIndex: 5000,
            left: left,
            top: top
        });

A: As of 1.6 you can use relative values in css() so you could use this:
$('#myElement).css( "left", "+=15" );

As long as the element already has a defined value for left and is absolutely positioned.
Ref: http://api.jquery.com/css/

A: Since none of the other answers are true jQuery-style solutions, i'll resurrect this old issue.
This solution can move ALL of the selected elements by a relative value:
$('.selected').each(function() {
    $(this).css({ left: $(this).position().left - 10 });
});


text:
Q: How to unescape HTML entities but leave XML entities untouched? This is the input:

The price is < 5 €

It is a valid HTML but is not a valid XML (because € is not declared in DTD). A valid XML would look like:

The price is < 5 €

Can you recommend some Java library that can help me to unescape HTML entities and convert them to XML entities?

A: Using apache commons lang 3, a class that only replaces the HTML-specific entities:
import org.apache.commons.text.translate.AggregateTranslator;
import org.apache.commons.text.translate.CharSequenceTranslator;
import org.apache.commons.text.translate.EntityArrays;
import org.apache.commons.text.translate.LookupTranslator;
import org.apache.commons.text.translate.NumericEntityUnescaper;

public class HtmlEscapeUtils {

  /**
   * @see {@link org.apache.commons.text.StringEscapeUtils#UNESCAPE_HTML4}
   */
  public static final CharSequenceTranslator UNESCAPE_HTML_SPECIFIC =
      new AggregateTranslator(
          new LookupTranslator(EntityArrays.ISO8859_1_UNESCAPE),
          new LookupTranslator(EntityArrays.HTML40_EXTENDED_UNESCAPE),
          new NumericEntityUnescaper());

  /**
   * @see {@link org.apache.commons.text.StringEscapeUtils#unescapeHtml4(String)}
   * @param input - HTML String with e.g. " & ä
   * @return XML String, HTML4 Entities replaced, but XML Entites remain (e.g. " und &)
   */
  public static final String unescapeHtmlToXml(final String input) {
    return UNESCAPE_HTML_SPECIFIC.translate(input);
  }

}

A: The list of all HTML named character references is available at http://www.whatwg.org/specs/web-apps/current-work/multipage/entities.json
If you can tolerate the occasional mistake, you could just go over that file and replace all named character references that are not allowed in stand-alone XML with the corresponding numeric character reference.
That simple approach can run into problems though if your input is HTML, not XHTML:

contains a script element whose content is not encoded using entities, so naively replacing the < here will break the script.  There are other elements like <xmp> and


text:
Q: How replace words by SED command? I have a little question about sed.
I have to put what is behind: before and vice versa
example:
sometext1:sometext2

output:
sometext2:sometext2

currently i have sed 's/.*:// filename - this show me text after :

A: EDIT: In case your Input_file have control M characters then try following.
sed 's/\r//g;s/\([^:]*\):\(.*\)/\2:\1/'  Input_file

Could you please try following.
sed 's/\([^:]*\):\(.*\)/\2:\1/'  Input_file

Using back reference capability of sed here. Where saving matched regex in 2 temp memory(back reference) and latter while doing substitution part switching there number(means placing 2nd part 1st and 1st part later).


text:
Q: Jasper Chart Customizer to display vertical line based on category value I am using Line Chart element chart wizard to display a line chart in JasperReport based on the data read from a csv file. The line chart came out fine. The problem is for me to display a vertical line marker based on certain category value. I have tried using Multi-Axis Chart and setting up the second chart as I needed. But the moment I combined it, it will either make my first line chart haywire or my second line chart goes horizontal!
So, I have tried using Chart Customizer, export to jar, add it in Build Path, add it in Chart's Customizer properties. But, it fails to display what I wanted. Below is the code:
public class Lot_VerticalLine implements JRChartCustomizer {

    public static void main(final String args) {
       @SuppressWarnings("unused")
       final Lot_VerticalLine demo = new Lot_VerticalLine();
       //demo.customize(null, null);
    }

    public void customize(JFreeChart jfc, JRChart jrc)  {
        CategoryMarker marker = new CategoryMarker("Category Axis");
        CategoryPlot plot = jfc.getCategoryPlot();

        marker.setLabel("Band Y");
        marker.setPaint(Color.red);
        marker.setOutlinePaint(Color.red);
        marker.setDrawAsLine(true);
        marker.setAlpha(0.5f);
        marker.setLabelAnchor(RectangleAnchor.TOP);
        marker.setLabelTextAnchor(TextAnchor.TOP_CENTER);
        marker.setLabelOffsetType(LengthAdjustmentType.CONTRACT);
        plot.addDomainMarker(marker, Layer.BACKGROUND);
    }

    private void addMarker(Plot plot, Marker marker) {
            ((CategoryPlot) plot).addDomainMarker((CategoryMarker) marker);
            CategoryItemRenderer renderer = (CategoryItemRenderer) ((CategoryPlot) plot).getRenderer();
    }
}

What did I do wrong?


text:
Q: spring-boot saml: configure service provider entityId Is there a way to configure the entityID of the service provider in the following configuration:
spring:
  security:
    saml2:
      relyingparty:
        registration:
          myapp:
            signing:
              credentials:
                - private-key-location: "classpath:private.pem"
                  certificate-location: "classpath:public.pem"
            identityprovider:
              entity-id: idp
              singlesignon:
                sign-request: false
                url: https://.../auth/realms/saml-demo/protocol/saml

Currently the identity provider is always receiving the following format:
{baseUrl}/saml2/service-provider-metadata/{registrationId}

For example:
http://localhost:8080/saml2/service-provider-metadata/myapp

Can this format be customized when using the yaml config?


text:
Q: In SSRS/Report Builder, is there an attribute to evaluate placeholder value? When building an SSRS report, I have an expression set for one of the tablix fields like this:
=IIF(IsNothing(MyField.Value)=0,MyField.Value,"fubar")

So if there is not value in the cell, "fubar" is instead displayed in the cell as a placeholder.
My question: Is there a way to evaluate this placeholder value in a formula?
For example, I want to color all cells that contain "fubar". I can't use MyField.Value because "fubar" is not a value in my dataset, it's just a placeholder. Is there some attribute like MyField.Placeholder or something that looks at these superficial cells values instead of the actual dataset value?

A: Either ReportItems!MyTextbox.Value or Me.Value should give you what you need. So to control the background colour, you could use:
=IIF(ReportItems!MyTextbox.Value = "fubar", "Pink", "White")

https://msdn.microsoft.com/en-us/library/dd255285(v=sql.105).aspx

A: You can use the name property of the textbox to refer to the cell.
Suppose I have the following expression similar to yours:
=IIF(Isnothing(Fields!Thing.Value),"Foo Bar", Fields!Thing.Value)

It will put Foo Bar in the cell where Thing field is null.
If I want to color the background color of that cell I can reference it using ReportItems collection.
=IIF(ReportItems!Textbox86.Value="Foo Bar","Red","Transparent")

Note Textbox86 is the cell where I used the first expression it will
  contain the hardcoded value Foo Bar when the Thing value is null.

To see the Textbox name of the cell select it, right click on it and go to Textbox properties you will see Textbox#.
Let me know if this helps.


text:
Q: How can I make a python thread count down and then perform an action? I have a script that accesses the api for Telegram bots, but it unfortunately can only process one message at a time.
My end goal is to have it start a timer thread when someone starts a game, and after a certain time (if they haven't already won the game) it would reset the game to avoid preventing another user in the group from playing a game (I set it up to only have one game at a time to avoid confusion).
So for example:
With a word unscramble game I tried:
import time
import telepot

def handle(msg):
    message_text = msg['text']
    message_location_id = msg['chat']['id']
    global game_active
    global word_to_unscramble
    if message_text == '/newgame':
        game_active = True
        <game function, defines word_to_unscramble>
        time.sleep(30)
        if game_active:
            game_active = False
            word_to_unscramble = None
            bot.sendMessage(message_location_id, 'Sorry the answer was ' + word_to_unscramble)
    if message_text == 'word_to_unscramble':
        game_active = False
        bot.sendMessage(message_location_id, 'You win!')

# I added this part in as an echo, just to see when it processed the message
    if 'text' in msg:
        bot.sendMessage(message_location_id, message_text)

game_active = False

word_to_unscramble = None

bot = telepot.Bot('<my api token>')

bot.message_loop(handle)

With this code, however, it would receive and process the first message, then wait 30 seconds, send the failed code, and then process the second one.
I'm not too familiar with the process of threading, so is there a way I can set it up to start a new thread to handle the countdown timer so it can continue to process messages or is that all a lost cause?
If there's not a way to set up a timer using my current method of accessing the telegram api, what would the smarter way be?

A: Haven't worked over python-telegram-bot yet, But all I know about the timer use in Python is using sched gives you leverage to timer abilities to your python code. Since in your app multithreading will make more sense and for that you can look out for threading.Timer class.


text:
Q: What is recommended way to store dictionaries and json file type in python I'm pulling json data from an API. My script will store this data and add information about this data to a dictionary.
To store the json data, i'm planning on using:
with open('data.json', 'w') as f:
     json.dump(data, f)

What would be an appropriate way to store the dictionary ? Would it be appropriate to convert the dict to json format with
json_str = json.dumps(dict1)

and save it in the same way as above ?

A: You should save JSON data in a Python list or a dict, depending on the structure of your JSON data.
From http://www.json.org/:

JSON is built on two structures:

*

*A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed
  list, or associative array.

*An ordered list of values. In most
  languages, this is realized as an array, vector, list, or sequence.

The json library is what's commonly used to load JSON data and store it in a Python object. Note however that the load method will return (recursively) a Python list if the JSON data is like [...] and a Python dict  if the JSON data is like {...}.
To read a JSON file containing a {...} and save its content to a dictionary data structure use:
>>> with open('data.json', 'r') as f:
...   data = json.load(f)
...
>>> type(data)
<type 'dict'>

If the file contains a JSON list [...] then:
>>> type(data)
<type 'list'>

Similarly when reading JSON data from a URL:
>>> response = urllib2.urlopen(URL)
>>> data = json.load(response)

You can always convert a list to a dictionary for example like this:
>>> dataD = dict([i,data[i]] for i in xrange(len(data)))

By doing so however you lose the order information provided by the JSON array structure.

A: Usualy i use dicts for storing data, and convert from/to JSON only for transfer data via web. JSON is not native type for Python, so it would be better to work with native Python types.


text:
Q: Symfony Exception while trying to subscribe to an existing event As the title says i want to extend a email entity so i'm trying to subscribe to the MAPPING_REGISTER_CUSTOMER event. When the user submit the form i want to extend the outgoing email. Currently im struggeling with this exception
This is the exception:
Argument 1 passed to RegistrationExtension\Subscriber\RegisterExtensionSubscriber::onCustomRegister() must be an instance of Shopware\Core\Framework\DataAbstractionLayer\Event\EntityLoadedEvent, instance of Shopware\Core\Framework\Event\DataMappingEvent given, called in /app/vendor/symfony/event-dispatcher/Debug/WrappedListener.php on line 126

And here my code :)
<?php
namespace RegistrationExtension\Subscriber;

use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityLoadedEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Shopware\Core\Checkout\Customer\CustomerEvents;
use Shopware\Core\Checkout\Customer\CustomerEntity;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Shopware\Storefront\Controller\StorefrontController;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;

class RegisterExtensionSubscriber implements EventSubscriberInterface{
    public static function getSubscribedEvents(): array{
        return [
            CustomerEvents::MAPPING_REGISTER_CUSTOMER => 'onCustomRegister'
        ];
    }
    public function onCustomRegister(EntityLoadedEvent $event , SalesChannelContext $context){
         /**
         * @var EntityRepositoryInterface $mailTypeRepository
         * @var EntityRepositoryInterface $mailRepository
         */
        $mailTypeRepository = $this->container->get('mail_template_type.repository');
        $mailRepository = $this->container->get('mail_template.repository');

        $mailEntity = $mailTypeRepository->search(
            (new Criteria())->addFilter(new EqualsFilter('mail_template_type.technicalName', "customer_register")),
            $context->getContext()
        );

        $mailTypeId = $mailEntity->getEntities()->first()->getId();

        $mailEntity = $mailRepository->search(
            (new Criteria())->addFilter(new EqualsFilter('mail_template.mailTemplateTypeId', $mailTypeId)),
            $context->getContext()
        );

        //$mailEntity->getEntities()->setContentHtml("test");
        $mail = $mailEntity->getEntities();

        return $this->renderStorefront(
            '@Storefront/storefront/page/checkout/address/index.html.twig',[
                'page' => $context,
                'mailEntity' => $mail
            ]
        );

        /** @var CustomerEntity $customerRegisEvent */
        foreach ($event->getEntities() as $customerRegisEvent) {
            $customerRegisEvent->addExtension('custom_struct', new RegisterStruct());
        }
    }
}

Any help is apreciated :)
[EDIT]
<?php
namespace RegistrationExtension\Subscriber;

use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityLoadedEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Shopware\Core\Checkout\Customer\CustomerEvents;
use Shopware\Core\Checkout\Customer\CustomerEntity;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Shopware\Storefront\Controller\StorefrontController;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
use Shopware\Core\Checkout\Customer\Event\CustomerRegisterEvent;

class RegisterExtensionSubscriber implements EventSubscriberInterface{
    public static function getSubscribedEvents(): array{
        return [
            \Shopware\Core\Checkout\Customer\Event\CustomerRegisterEvent::class => 'onCustomRegister'
        ];
    }
    public function onCustomRegister(\Shopware\Core\Checkout\Customer\Event\CustomerRegisterEvent $event){
        /** @var CustomerEntity $customerRegisEvent */
        foreach ($event->getMailStruct() as $customerRegisEvent) {
            $customerRegisEvent->addExtension('custom_struct', new RegisterStruct());
        }

    }
}

A: Probably you need another event
\Shopware\Core\Checkout\Customer\Event\CustomerRegisterEvent:class => 'onCustomRegister'

and also you need to change the definition of onCustomRegister method
try
public function onCustomRegister(\Shopware\Core\Checkout\Customer\Event\CustomerRegisterEvent $event)

After that, you can get customer inside the method by
$event->getCustomer() and context by $event->getSalesChannelContext()


text:
Q: Help on a rational recursive relation: $T[n+1]=\frac{E[n+1](D+T[n])}{E[n+1]+D+T[n]}$ I am trying to solve this rational recursive relation:
$$T[n+1]=\frac{E[n+1](D+T[n])}{E[n+1]+D+T[n]}$$
where $T[1]=\frac{E[1]*D}{E[1]+D}$ for constant $D>0$ and $E[n]>0$.
When $E[n]$ is replaced by a constant $E$ (independent of $n$), Wolfram Mathematica's RSolve (after FullSimplify) yields the following:
$$T[n]=\frac{2E}{1+\sqrt{1+4E/D}-\frac{2\sqrt{1+4E/D}\left(D+2E-\sqrt{D(D+2E)}\right)^n}{\left(D+2E-\sqrt{D(D+2E)}\right)^n-
\left(D+2E+\sqrt{D(D+2E)}\right)^n}}$$
I assume that for constant $E$ Mathematica used methods for solving rational difference equations (but I really have no knowledge of the inner workings of that software package).  It's not helpful when function $E[n+1]$ is inserted in lieu of constant $E$.
To extend the result above to function $E[n]$ I've tried writing out the first few iterations of it (using RecurrenceTable function in Mathematica with and without Simplify and FullSimplify), however, no pattern emerged to me (though, perhaps the community can see something -- I can try to post it to the question if that would be helpful).  I am not very familiar with recurrence relations beyond some basic facts s.t. the Master Theorem.  Is this thing even soluble? I would be very happy with a solution involving sums and products of $E[n]$.  Any help would be very much appreciated.
This arose out of my question on the stats forum regarding Bayesian inference using noisy observations of a Brownian motion process.

A: Mitchell "An Analytic Riccati Solution for Two-Target Discrete-Time Control", Journal of Economic Dynamics and Control 24(4), 615-622 (2000) uses an interesting trick to solve the Ricatti recurrence:
$$
w_{n + 1} = \frac{a w_n + b}{b w_n + d}
$$
Use the replacement $x_n = 1 / (1 + \eta w_n)$, select $\eta$ such that the result is a first order, linear recurrence in $x_n$. If $a$, $b$, $c$, and $d$ are functions of $n$, so will be $\eta$, and the resulting recurrence is linear, first order and thus has a explicit solution even if the coefficients aren't constant. But unless you are as lucky as textbook writers are with all the problems that come their way, the result will be a much worse mess than just iterating the recurrence.

A: Let $f(z) = \frac{az + b}{cz + d}$ be a fractional linear transformation. ($a, b, c, d$ can be taken to be complex numbers if you want but what I'm about to say works over any field.) The problem of studying a sequence $z_n$ of numbers satisfying
$$z_{n+1} = f(z_n)$$
reduces to the problem of iterating $f$. Perhaps surprisingly, this can be done using matrix multiplication.
Lemma: Let $f(z) = \frac{az + b}{cz + d}, g(z) = \frac{pz + q}{rz + s}$ be two fractional linear transformations. Then $(fg)(z) = \frac{tz + u}{vz + w}$ where
$$\left[ \begin{array}{cc} t & u \\\ v & w \end{array} \right] = \left[ \begin{array}{cc} a & b \\\ c & d \end{array} \right] \left[ \begin{array}{cc} p & q \\\ r & s \end{array} \right].$$
An alternate group-theoretic statement is that the invertible transformations of the form $\frac{az + b}{cz + d}$ form a group, the projective general linear group $\text{PGL}_2(F)$, and there is a natural surjective homomorphism from the general linear group $\text{GL}_2(F)$ of invertible $2 \times 2$ matrices to this group. The way I stated it above doesn't require the assumption of invertibility, but if the associated matrix is not invertible then the transformation is a constant and the lemma isn't interesting anyway.
The lemma can be proven by direct computation, but a more conceptual explanation is given by a study of how $\text{GL}_2(F)$ acts on lines through the origin in $F^2$; see this blog post.
In this way the problem of iterating a fractional linear transformation reduces to the problem of taking powers of a $2 \times 2$ matrix, and to do this it suffices to find its Jordan normal form. If the associated matrix is diagonalizable then we just have to take powers of the eigenvalues and using that idea you can derive the Mathematica formula in the case where $E$ is a constant.
In the case where $E$ is periodic with small period $j$, just restrict your attention to what happens when you run the iteration $j$ times. This will be described by some specific fractional linear transformation which you can iterate by the above method until you get close to $n$.


text:
Q: Kinect v2 Game Development in C# I'm trying to make a Kinect game using custom gestures and the Kinect v2. It should be able to detect a gesture then perform a certain action.
I only have experience in XNA but it seems like XNA cannot be used with the Kinect, or I just can't figure out how using XNA Refresh.
What is a good framework or library to use to make a simple 2D kinect game with custom gestures? Or, how do I get XNA to work with custom gestures.