text:
Q: Printing a matched pattern and its next string using re in python3 I am trying to read a pdf file which is sample invoice and I am trying to fetch some sample details from the pdf like Company Name, Invoice no, GST no, Quantity of Materials etc. For this, first of all I am using PyPDF2 to get the data in the text format and then I have used NLTK toolkit to tokenize the text and remove special characters. The problem is I am not able to print 'Invoice No' and its next string containing the Invoice num. Here is the code below. Any help would be highly appreciated.
import json
import PyPDF2
pdf_file = open(path, 'rb')
read_pdf = PyPDF2.PdfFileReader(pdf_file)
number_of_pages = read_pdf.getNumPages()
page = read_pdf.getPage(0)
page_content = page.extractText()
page_content

Below is the output I am getting after extracting text from pdf file
"Bank Details :\nBank Name\n:  Hdfc bank\nAccount No\n:  50200004915008\nAccount Name\n:  GNG Electronics Pvt Ltd\nIFSC\n:  \nSr. \nNo.\nItem No.\nHSN Code\nArticle Code \nDescription\nColor\nTax %\nQuantity\nUnit Rate\nAmount\n1\nQCNBAG0035\n9\n84715000\nRefurbished DELL LATITUDE \nE7470 (CORE I7 6TH \nGEN/8GB/512GB \nSSD/WEBCAM/14'' TOUCH/WIN-\n10 HOME)\n18\n1\n28,813.56\n28,813.56\nOrder # \nQty Sum\n1\nTotal\n28,813.56\nDiscount Amount\n0\nCGST\n9%\n2593.22\nSGST\n9%\n2593.22\nNet Total\n34,000.00\nAmount in Words: ********* THIRTY FOUR THOUSAND RUPEES AND ZERO  PAISA ONLY \nBill To :\nShip To \nInvoice No.\n: PSIGHT1920000164\nEB Ghatkopar Store\nGMONEY PRIVATE LIMITED\nInvoice Date\n: 21/02/2020\nShop no.7, Raj Hans Helix 3, Shreyas \nCinema,\n1019, C WING, 215 ATRIUM\nPortal Order Id\n: \nLBS Road, Ghatkopar West\nNEXT TO COURTYARD MARRIOT, A.K.ROAD\nCust SA Code\n: \nMumbai\nANDHERI EAST, MUMBAI-400093\nCust Order No.\n: GMONEY PRIVATE \nLIMITED\nPlace of Supply: Maharashtra 400086\nMumbai  - 400093\nShipment Mode\n: \nState Code : 27\nState Code : \nStock Room\n: GHT-STR\nG.S.T. No. : 27AADCG6133E1ZV\nG.S.T. No. : 27AAICG0467G1Z\nPayment Term\n: \nAWB\nPayment Due\n: 2/21/2020\nPartner Name\nShip to Contact\n: Yash\nTerms & Conditions :\n\nPayment by way of cheque/draft shall be in the name of company only. NEFT/RTGS favouring above bank details.Interest @24%per annum shall be \nlevied for delayed payment.\n\nBank charges of Rs.500/- plus GST per cheque shall be charged in case of dishonour of the cheque.\n\nThe courts at Mumbai only shall have the jurisdiction to entertain any dispute between the parties.\n\nWhether Tax is payable on Reverse Charge basis : No\nPage  1  of  1\nRegd Off. : Unit No. 415, Hubtown Solaris,N. S. Phadke Marg, Andheri East, Mumbai-400069\nTel No.: 022-61445600 TO 615 Fax No.: \nGNG Electronics Pvt Ltd\nAuthorised Signatory\nTAX INVOICE\nGNG Electronics Pvt Ltd\nRAJHANS, HELIX-3, L.B.S  ROAD\nGHATKOPAR WEST, MUMBAI\nMumbai  Maharashtra - 400086\nG.S.T. No. : 27AADCG6133E1ZV\nState Code : 27\n"

After using NLTK, the text is cleaned below is the output:
import nltk
tokens = nltk.word_tokenize(page_content)
import string
table = str.maketrans('', '', string.punctuation)
stripped = [w.translate(table) for w in tokens]
print(stripped)

['Bank', 'Details', '', 'Bank', 'Name', '', 'Hdfc', 'bank', 'Account', 'No', '', '50200004915008', 'Account', 'Name', '', 'GNG', 'Electronics', 'Pvt', 'Ltd', 'IFSC', '', 'Sr', 'No', '', 'Item', 'No', '', 'HSN', 'Code', 'Article', 'Code', 'Description', 'Color', 'Tax', '', 'Quantity', 'Unit', 'Rate', 'Amount', '1', 'QCNBAG0035', '9', '84715000', 'Refurbished', 'DELL', 'LATITUDE', 'E7470', '', 'CORE', 'I7', '6TH', 'GEN8GB512GB', 'SSDWEBCAM14', '', 'TOUCHWIN', '10', 'HOME', '', '18', '1', '2881356', '2881356', 'Order', '', 'Qty', 'Sum', '1', 'Total', '2881356', 'Discount', 'Amount', '0', 'CGST', '9', '', '259322', 'SGST', '9', '', '259322', 'Net', 'Total', '3400000', 'Amount', 'in', 'Words', '', '', 'THIRTY', 'FOUR', 'THOUSAND', 'RUPEES', 'AND', 'ZERO', 'PAISA', 'ONLY', 'Bill', 'To', '', 'Ship', 'To', 'Invoice', 'No', '', '', 'PSIGHT1920000164', 'EB', 'Ghatkopar', 'Store', 'GMONEY', 'PRIVATE', 'LIMITED', 'Invoice', 'Date', '', '21022020', 'Shop', 'no7', '', 'Raj', 'Hans', 'Helix', '3', '', 'Shreyas', 'Cinema', '', '1019', '', 'C', 'WING', '', '215', 'ATRIUM', 'Portal', 'Order', 'Id', '', 'LBS', 'Road', '', 'Ghatkopar', 'West', 'NEXT', 'TO', 'COURTYARD', 'MARRIOT', '', 'AKROAD', 'Cust', 'SA', 'Code', '', 'Mumbai', 'ANDHERI', 'EAST', '', 'MUMBAI400093', 'Cust', 'Order', 'No', '', '', 'GMONEY', 'PRIVATE', 'LIMITED', 'Place', 'of', 'Supply', '', 'Maharashtra', '400086', 'Mumbai', '', '400093', 'Shipment', 'Mode', '', 'State', 'Code', '', '27', 'State', 'Code', '', 'Stock', 'Room', '', 'GHTSTR', 'GST', '', 'No', '', '', '27AADCG6133E1ZV', 'GST', '', 'No', '', '', '27AAICG0467G1Z', 'Payment', 'Term', '', 'AWB', 'Payment', 'Due', '', '2212020', 'Partner', 'Name', 'Ship', 'to', 'Contact', '', 'Yash', 'Terms', '', 'Conditions', '', 'Payment', 'by', 'way', 'of', 'chequedraft', 'shall', 'be', 'in', 'the', 'name', 'of', 'company', 'only', '', 'NEFTRTGS', 'favouring', 'above', 'bank', 'detailsInterest', '', '24', '', 'per', 'annum', 'shall', 'be', 'levied', 'for', 'delayed', 'payment', '', 'Bank', 'charges', 'of', 'Rs500', 'plus', 'GST', 'per', 'cheque', 'shall', 'be', 'charged', 'in', 'case', 'of', 'dishonour', 'of', 'the', 'cheque', '', 'The', 'courts', 'at', 'Mumbai', 'only', 'shall', 'have', 'the', 'jurisdiction', 'to', 'entertain', 'any', 'dispute', 'between', 'the', 'parties', '', 'Whether', 'Tax', 'is', 'payable', 'on', 'Reverse', 'Charge', 'basis', '', 'No', 'Page', '1', 'of', '1', 'Regd', 'Off', '', '', 'Unit', 'No', '', '415', '', 'Hubtown', 'Solaris', '', 'N', '', 'S', 'Phadke', 'Marg', '', 'Andheri', 'East', '', 'Mumbai400069', 'Tel', 'No', '', '', '02261445600', 'TO', '615', 'Fax', 'No', '', '', 'GNG', 'Electronics', 'Pvt', 'Ltd', 'Authorised', 'Signatory', 'TAX', 'INVOICE', 'GNG', 'Electronics', 'Pvt', 'Ltd', 'RAJHANS', '', 'HELIX3', '', 'LBS', 'ROAD', 'GHATKOPAR', 'WEST', '', 'MUMBAI', 'Mumbai', 'Maharashtra', '', '400086', 'GST', '', 'No', '', '', '27AADCG6133E1ZV', 'State', 'Code', '', '27']

I am using below code to search string starting with I as in Invoice and G as in GST.
patterns = ['Invoice No', 'GST No']

z = re.findall("[IG]\w+", element)
print(z)

Any help would be highly appreciated

A: I propose the following solution starting from the string you got after extracting text from the PDF:
s = "Bank Details :\nBank Name\n:  Hdfc bank\nAccount No\n:  50200004915008\nAccount Name\n:  GNG Electronics Pvt Ltd\nIFSC\n:  \nSr. \nNo.\nItem No.\nHSN Code\nArticle Code \nDescription\nColor\nTax %\nQuantity\nUnit Rate\nAmount\n1\nQCNBAG0035\n9\n84715000\nRefurbished DELL LATITUDE \nE7470 (CORE I7 6TH \nGEN/8GB/512GB \nSSD/WEBCAM/14'' TOUCH/WIN-\n10 HOME)\n18\n1\n28,813.56\n28,813.56\nOrder # \nQty Sum\n1\nTotal\n28,813.56\nDiscount Amount\n0\nCGST\n9%\n2593.22\nSGST\n9%\n2593.22\nNet Total\n34,000.00\nAmount in Words: ********* THIRTY FOUR THOUSAND RUPEES AND ZERO  PAISA ONLY \nBill To :\nShip To \nInvoice No.\n: PSIGHT1920000164\nEB Ghatkopar Store\nGMONEY PRIVATE LIMITED\nInvoice Date\n: 21/02/2020\nShop no.7, Raj Hans Helix 3, Shreyas \nCinema,\n1019, C WING, 215 ATRIUM\nPortal Order Id\n: \nLBS Road, Ghatkopar West\nNEXT TO COURTYARD MARRIOT, A.K.ROAD\nCust SA Code\n: \nMumbai\nANDHERI EAST, MUMBAI-400093\nCust Order No.\n: GMONEY PRIVATE \nLIMITED\nPlace of Supply: Maharashtra 400086\nMumbai  - 400093\nShipment Mode\n: \nState Code : 27\nState Code : \nStock Room\n: GHT-STR\nG.S.T. No. : 27AADCG6133E1ZV\nG.S.T. No. : 27AAICG0467G1Z\nPayment Term\n: \nAWB\nPayment Due\n: 2/21/2020\nPartner Name\nShip to Contact\n: Yash\nTerms & Conditions :\n\nPayment by way of cheque/draft shall be in the name of company only. NEFT/RTGS favouring above bank details.Interest @24%per annum shall be \nlevied for delayed payment.\n\nBank charges of Rs.500/- plus GST per cheque shall be charged in case of dishonour of the cheque.\n\nThe courts at Mumbai only shall have the jurisdiction to entertain any dispute between the parties.\n\nWhether Tax is payable on Reverse Charge basis : No\nPage  1  of  1\nRegd Off. : Unit No. 415, Hubtown Solaris,N. S. Phadke Marg, Andheri East, Mumbai-400069\nTel No.: 022-61445600 TO 615 Fax No.: \nGNG Electronics Pvt Ltd\nAuthorised Signatory\nTAX INVOICE\nGNG Electronics Pvt Ltd\nRAJHANS, HELIX-3, L.B.S  ROAD\nGHATKOPAR WEST, MUMBAI\nMumbai  Maharashtra - 400086\nG.S.T. No. : 27AADCG6133E1ZV\nState Code : 27\n"

import string
exclude = set(string.punctuation)
s = ''.join(ch for ch in s if ch not in exclude)

s = s.split("\n")
s = [v.strip() for v in s]

i = [i for i,v in enumerate(s) if "Invoice No" in v][0]

print(s[i] + ": " + s[i+1])

as you can see, the value of "Invoice No" is saved in s[i+1].

A: Please see if the below code helps:
str="Bank Details :\nBank Name\n:  Hdfc bank\nAccount No\n:  50200004915008\nAccount Name\n:  GNG Electronics Pvt Ltd\nIFSC\n:  \nSr. \nNo.\nItem No.\nHSN Code\nArticle Code \nDescription\nColor\nTax %\nQuantity\nUnit Rate\nAmount\n1\nQCNBAG0035\n9\n84715000\nRefurbished DELL LATITUDE \nE7470 (CORE I7 6TH \nGEN/8GB/512GB \nSSD/WEBCAM/14'' TOUCH/WIN-\n10 HOME)\n18\n1\n28,813.56\n28,813.56\nOrder # \nQty Sum\n1\nTotal\n28,813.56\nDiscount Amount\n0\nCGST\n9%\n2593.22\nSGST\n9%\n2593.22\nNet Total\n34,000.00\nAmount in Words: ********* THIRTY FOUR THOUSAND RUPEES AND ZERO  PAISA ONLY \nBill To :\nShip To \nInvoice No.\n: PSIGHT1920000164\nEB Ghatkopar Store\nGMONEY PRIVATE LIMITED\nInvoice Date\n: 21/02/2020\nShop no.7, Raj Hans Helix 3, Shreyas \nCinema,\n1019, C WING, 215 ATRIUM\nPortal Order Id\n: \nLBS Road, Ghatkopar West\nNEXT TO COURTYARD MARRIOT, A.K.ROAD\nCust SA Code\n: \nMumbai\nANDHERI EAST, MUMBAI-400093\nCust Order No.\n: GMONEY PRIVATE \nLIMITED\nPlace of Supply: Maharashtra 400086\nMumbai  - 400093\nShipment Mode\n: \nState Code : 27\nState Code : \nStock Room\n: GHT-STR\nG.S.T. No. : 27AADCG6133E1ZV\nG.S.T. No. : 27AAICG0467G1Z\nPayment Term\n: \nAWB\nPayment Due\n: 2/21/2020\nPartner Name\nShip to Contact\n: Yash\nTerms & Conditions :\n\nPayment by way of cheque/draft shall be in the name of company only. NEFT/RTGS favouring above bank details.Interest @24%per annum shall be \nlevied for delayed payment.\n\nBank charges of Rs.500/- plus GST per cheque shall be charged in case of dishonour of the cheque.\n\nThe courts at Mumbai only shall have the jurisdiction to entertain any dispute between the parties.\n\nWhether Tax is payable on Reverse Charge basis : No\nPage  1  of  1\nRegd Off. : Unit No. 415, Hubtown Solaris,N. S. Phadke Marg, Andheri East, Mumbai-400069\nTel No.: 022-61445600 TO 615 Fax No.: \nGNG Electronics Pvt Ltd\nAuthorised Signatory\nTAX INVOICE\nGNG Electronics Pvt Ltd\nRAJHANS, HELIX-3, L.B.S  ROAD\nGHATKOPAR WEST, MUMBAI\nMumbai  Maharashtra - 400086\nG.S.T. No. : 27AADCG6133E1ZV\nState Code : 27\n"
s= str.replace(':','').split('\n')
for i,x in enumerate(s):
    if 'Invoice No' in x:
        print(x,s[i+1])

    if 'G.S.T. No.' in x:
        print(x)

Result:
Invoice No.  PSIGHT1920000164
G.S.T. No.  27AADCG6133E1ZV
G.S.T. No.  27AAICG0467G1Z
G.S.T. No.  27AADCG6133E1ZV


text:
Q: Blueshift due to kinetic energy of electron? Suppose a free electron meets a hydrogen ion. The electron drops to the ground state and emits a photon. The energy of the photon will be equal to the ionisation energy of the hydrogen atom, 13.6 eV.
Next, suppose a free electron having a kinetic energy of 0.1 eV meets a hydrogen ion. Is it possible the energy of the emitted photon is 13.7 eV, due to the initial kinetic energy of the electron?

A: Yes, it is entirely possible.  This is why emission bands in real life have a spectral width to them; it is because of the doppler shift of the light that is emitted from moving ions.  Light emitted from an ion that is moving towards you will have a slightly higher frequency than light emitted from an ion moving away.  This effect is called Doppler Broadening.
Edit:  Ok, I misunderstood the original question.  If the electron is moving before being captured by the ion, then this will also change the energy of the emitted photon as the OP suggested.  The emitted photon is the difference in energy between the electron before capture and after capture, so if the electron has some initial kinetic energy then there is a bigger energy difference between that energy state and the lowest energy state of the atom as compared to the difference between an electron at rest and the lowest energy state of the atom.  Of course, it's possible that the electron will graze by the ion on the first couple passes and lose energy gradually through emitting lower frequency photons, so that by the time it's captured its kinetic energy is close to zero.  Also, if the electron's kinetic energy is greater than the potential well of the ion, then the electron will just be scattered rather than captured.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Calling parent constructor Java So I am attempting to make a java GUI calculator and started to wonder if there would ever be a difference in the scenario where one class extends another one, to call super.functionname instead of just functionname in the extended class.
class frame extends JFrame{
       public buttonframe(){

        // any difference between this.add.. or super.add..

       }
}

I then made a couple of classes to experiment a little and I came over something I don't quite understand.
class A{
   public A(){
       System.out.println("A");
       h();
   }

   public void h(){
       String className = this.getClass().getName();
       System.out.println(className);
   }
}

class B extends A{
   public B(){
       System.out.println("B");
       h();
   }
}

Running:
public static void main(String[] args){
   new A();
   new B();
}

Produces the output:
> A calculator.A
> A calculator.B
> B calculator.B

I know that the extended class will call the constructor of the parent class, but why does it produce the result calculator.B (though I don't know why it has to do this, but I assume A classname = new B(); has something to do with it) in the second output line, instead of calculator.A when it is the constructor called from the Class A?
EDIT:
class A{
public A(){
  //Can I instantiate a new B() and somehow ouput "A"?
 //I can do it using A.hs(); but can I do it:

 //Using the method h() but with a specific keyword infront of h() so
 //that it always refers to the method h() of the class A.
 h();
}
public static void hs(){
 System.out.println("A");
}
    public void h(){
    System.out.println("A");
    }
}

class B extends A{
   public B(){
       h();
}
   public void h(){
    System.out.println("B");
   }
}

A: The result is because of the statement :
String className = this.getClass().getName();

The current object(this) when called as new B() is B and hence the class name of B.

So, the complete sequence as in your case would be :
A() => prints A => call h()  with current object of 'A' => prints classname of A

B() => calls super c'tor A()  => prints A => call h() with object of 'B'
    => prints classname of B => prints B => call h() => prints classname of B


text:
Q: Как нарисовать эллипсоид по формуле в C#? Нужно нарисовать эллипсоид по формуле.Но там получается что нужны три точки координат, я нашел только рисование эллипса по 2 точкам и высоте и ширине, подскажите пожалуйста есть ли функции чтобы реализовать это?
Функция по двум координатам:
public void DrawEllipse (System.Drawing.Pen pen, int x, int y, int width, int height);


text:
Q: How to click on the element with text as "Phone to call with" within  dropdown through Selenium and Java I am trying to automate an application which has a  type drop down.
I have tried all possible combinations like below but have not been able to select an element from drop down list.
driver.findElement(By.xpath("//span[@aria-label=\"Phone to call with\"]"));

I am not able to find xpath by ID as it keeps changing with reload.

Below is the html code. How would i achieve the same?
<md-select ng-model="ctrl.selectedLinkedPhone" class="ng-pristine ng-valid ng-empty ng-touched" tabindex="0" aria-disabled="false" role="listbox" aria-expanded="false" aria-multiselectable="false" id="select_26" aria-invalid="false" aria-label="
        Phone to call with
      " style=""><md-select-value class="md-select-value md-select-placeholder" id="select_value_label_25">
        Phone to call with
      </md-select-value>
<md-select-menu role="presentation" class="_md"><md-content class="_md">
        <md-option ng-disabled="!ctrl.isLinkedPhoneCurrentlyVerified(linkedPhone)" ng-repeat="linkedPhone in ctrl.getLinkedPhones()" ng-value="linkedPhone" tabindex="0" class="md-ink-ripple" role="option" aria-selected="false" id="select_option_29" aria-checked="true" aria-disabled="false" value="[object Object]" style="">

          Phone 1

</md-option><md-option ng-disabled="!ctrl.isLinkedPhoneCurrentlyVerified(linkedPhone)" ng-repeat="linkedPhone in ctrl.getLinkedPhones()" ng-value="linkedPhone" tabindex="0" class="md-ink-ripple" role="option" aria-selected="false" id="select_option_30" aria-checked="true" aria-disabled="false" value="[object Object]" style="">

          Phone 2

</md-option><md-option ng-disabled="!ctrl.isLinkedPhoneCurrentlyVerified(linkedPhone)" ng-repeat="linkedPhone in ctrl.getLinkedPhones()" ng-value="linkedPhone" tabindex="0" class="md-ink-ripple" role="option" aria-selected="false" id="select_option_31" aria-checked="true" aria-disabled="false" value="[object Object]" style="">

          Hangouts

</md-option>
      </md-content></md-select-menu>
</md-select>

A: This xpath works for your html:
By.xpath("//md-select[normalize-space(@aria-label='Phone to call with')]")

or you can use ccs selector:
By.cssSelector("md-select[aria-label*='Phone to call with']")

To find option, for example with text "Hangouts" you can use:
By.xpath("//md-select[normalize-space(@aria-label='Phone to call with')]//md-option[normalize-space(.)='Hangouts']")

To select dropdown you can use Action class or 2 methods below, implement waits needed:
1. let think that you don't have special button to open dropdown and click on the dropdown will open it.
2. using javascript:
WebElement selectMenu = driver.findElement(By.xpath("//md-select[normalize-space(@aria-label='Phone to call with')]"));
WebElement option = driver.findElement(By.xpath("//md-select[normalize-space(@aria-label='Phone to call with')]//md-option[normalize-space(.)='Hangouts']"));

//1. first click to open dropdown, second click on option
selectMenu.click();
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(option)).click();

//2. select using javascript
((JavascriptExecutor) driver).executeScript("arguments[0].click();", option);

A: Try using this below xpath:
driver.findElement(By.xpath("//span[contains(@aria-label,Phone to call with']"));

A: If that drop-down is developed by div tag then we have to automate that by using Action Class methods.If possible you can send that page Url I will send solution.

A: To click on the element with text as Phone to call with you need to induce WebDriverWait for the desired element to be clickable and you can use the following solution:
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//md-select[@class='ng-pristine ng-valid ng-empty ng-touched']/md-select-value[@class='md-select-value md-select-placeholder' and starts-with(@id,'select_value_label_')]//span[contains(.,'Phone to call with')]"))).click();


text:
Q: Create a model and insert value with a @Query i have this class:
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class ViewOrderRTO {
    private List<LineProductModel> products;
    private OrderModel order;
}

that i use for display data saved in db. LineProductModel is a class that has these field: total price, quantity,id, a @ManyToOne relationship with productModel and a @Many to one relationship with OrderModel.
The question is: can i use @Query in something like this "SELECT new alongpath.ViewOrderRTO(....) ..." and insert a list of lineProduct and the other fields all in one query? or i have to split the work and get all the single LineProductModel and put in a list first and then create the ViewModel?
btw is a spring boot project and i'm using mysql

A: I "solved" the problem removing the @ManyToOne mapping inside the LineProductModel and adding the @OneToMany mapping in the Order Model now i have this:
    @Entity
    @Table(name = "order_commission")
    @Getter
    @Setter
    @ToString
    @AllArgsConstructor
    @NoArgsConstructor
    public class OrderModel {
        @Id
        @SequenceGenerator(name = "order_sequence",
                sequenceName = "order_sequence",
                initialValue = 0,
                allocationSize = 1
        )
        @GeneratedValue(strategy = GenerationType.SEQUENCE,
                generator = "order_sequence")
        private Long id;
        @OneToMany(cascade = CascadeType.ALL,
                fetch = FetchType.EAGER,
                orphanRemoval = true)
        private List<LineProductModel> linePoducts;

        private BigDecimal total;
        private LocalDateTime orderedAt;
        @ManyToOne(fetch = FetchType.EAGER)
        @JoinColumn(name = "fk_user")
        private UserModel user;

        public OrderModel(List<LineProductModel> lineProducts,
                          BigDecimal total,
                          LocalDateTime orderedAt,
                          UserModel user) {
           this.linePoducts = lineProducts;
            this.total = total;
            this.orderedAt = orderedAt;
            this.user = user;
        }
    }

and this is the json i get while performing a @GetMapping:
{
  "id": 0,
  "linePoducts": [
    {
      "id": 0,
      "quantity": 2,
      "lineProductPrice": 6,
      "product": {
        "id": 0,
        "eanCode": "1111111111111",
        "name": "pipo",
        "price": 3,
        "quantity": 8,
        "weight": 10,
        "description": "test",
        "category": {
          "id": 0,
          "name": "cibo"
        }
      }
    },
    {
      "id": 1,
      "quantity": 7,
      "lineProductPrice": 21,
      "product": {
        "id": 1,
        "eanCode": "2111111111111",
        "name": "pipobevanda",
        "price": 3,
        "quantity": 3,
        "weight": 10,
        "description": "test",
        "category": {
          "id": 1,
          "name": "bevanda"
        }
      }
    },
    {
      "id": 2,
      "quantity": 1,
      "lineProductPrice": 3,
      "product": {
        "id": 2,
        "eanCode": "3111111111111",
        "name": "pipoverdura",
        "price": 3,
        "quantity": 9,
        "weight": 10,
        "description": "test",
        "category": {
          "id": 2,
          "name": "verdura"
        }
      }
    }
  ],
  "total": 0,
  "orderedAt": "2022-08-10T20:48:15",
  "user": {
    "id": 0,
    "firstName": "-------",
    "lastName": "------",
    "email": "--------",
    "password": "------",
    "countryOfResidence": "italy",
    "birthdate": "-------",
    "balance": 100
  }
}

i have to make some changes about the information that displays, but is there a better solution or this one is ok?


text:
Q: Element type is invalid. Expected string
When I try this code it shows this strange error. And most interesting part is that there was not any change in render method. It worked perfectly unless I add mapvew inside the view. Here is the code:
import React, {Component} from "react";
import {View, Image, MapView} from "react-native";
import {
  Container,
  Header,
  Content,
  Footer,
  FooterTab,
  Button,
  Icon,
  Text,
  Left,
  Right,
  Body,
  Title,
  Thumbnail,
  Grid,
  Row,
  Col,

} from "native-base";

import  typographystyles  from '../styles/typographystyles';
import { primary, secondary } from '../styles/variables';
class PostScreen extends Component {

  render() {
    return (
      <Container style={styles.container}>

        <Content>

        <View>
              <Grid>
              <Row>
       <Col style={styles.col} >

        <Text style={typographystyles.heading1}> Jennifer </Text>
        <Text style={{marginTop:-20, fontSize:16, marginLeft:15}}> Vew and Edit Profile </Text>
       </Col>
<Col style={styles.col}>
        <Thumbnail style={{marginTop:20}} source={require("../img/profile2.jpg")}/ >
     </Col>
     </Row>
     </Grid>

       </View>
       <View style={{marginLeft:15, marginBottom:20}}>
       <Text style={{marginTop:10,marginBottom:10, fontSize:18}}> 90 EUR per night </Text>

           </View>
           <Text style={{marginLeft:5, marginRight:5}}>
           Lorem ipsum dolor sit amet, eum iisque accommodare cu, ex enim eligendi appareat nec. Magna quando aliquid mel ea, exerci nonumes maiestatis eum ei, harum possim sed ut. Mea omnis bonorum posidonium ne, pri ne illud suavitate assentior. His choro numquam ad, mei te integre vituperatoribus. An vim nobis similique theophrastus, mazim mandamus assentior pro id.

Ad bonorum senserit postulant eum, quo et virtute feugiat. Reque laudem referrentur ex mei. Eu vel dico sonet iudicabit. Eos et falli fabulas, eam quis timeam voluptatum ea. Nullam persequeris ne nec. Reque error vivendum sit id, te sit partem aeterno feugait.
</Text>
<View style={{flex: 1}}>
<MapView
  style={styles.map}
  showsUserLocation={true}/>
</View>
                </Content>

      </Container>
    );
  }
}

const styles = {
  img: {
height:200,
width: null,
flex:1,
  },

col:{
  marginTop:30,
  justifyContent: "center",
alignItems: "center",
},
 map:{
    flex:1
  },

}

export default PostScreen;

What is wrong with this code? How can it be fixed?
As I said it was caused only after trying to add mapvew.
Thanks in advance :)

A: MapView component is not present in react-native sdk.
You must install it from Here
Or, if you created your app with expo, just import it with import { MapView } from 'expo';
 as mentionned here


text:
Q: Pass variable to JS and Output it in HTML if got a dynamic generated table (php foreach) that has an id it. I want to pass the ID of the clicked row to a JS function and output it inside a popup. The Popup also opens by clicking on the selected row.
Input from HTML
                <form>

                      <?php echo $row["ID"];?>

                            <?php echo $row["Vorname"] . "
"; ?>

                            <?php echo $row["Nachname"] . "
"; ?>

                            <?php echo $row["Vorname2"] . "
"; ?>

                            <?php echo $row["Nachname2"] . "
"; ?>

                            <?php echo $row["Vorname3"] . "
"; ?>

                            <?php echo $row["Nachname3"] . "
"; ?>

                            <?php echo $row["Vorname4"] . "
"; ?>

                            <?php echo $row["Nachname4"] . "
"; ?>

                          <?php echo $row["Titel"];?>

                            <?php echo $row["Standort"] . "
"; ?>

                            <?php echo $row["Klasse"] . "
"; ?>

                            <?php echo $row["Beginn"] . "
"; ?>

                            <?php echo $row["Abgabe"] . "
"; ?>

                            <a href=<?php echo "uploads/" . $FileActualName?>">Link

                            <?php echo $row["Genehmigt"] . "
"; ?>

                            <?php echo $row["Erstellt"] . "
"; ?>

                </form>

JS
document.getElementById("dialog_title").innerText = document.getElementById("id_element").innerText;
function dialogOeffnen(dialogId) {
    document.getElementById(dialogId).classList.add("sichtbar");
    document.getElementById("body-overlay").classList.add("sichtbar");
}

function dialogSchliessen(dialogId) {
    document.getElementById(dialogId).classList.remove("sichtbar");
    document.getElementById("body-overlay").classList.remove("sichtbar");
}

Output here

My suggestion was, giving the span of the ID an id="id_element" and pass it to JS. However the output does only display the first ID of my table no matter which row im clicking.

A: When you're dealing with passing data to JavaScript via HTML elements, the best approach is to set a data-* attribute:
<span class="id_element" data-id="<?=$row['ID']?>">this is my ID: <?=$row["ID"]?>

And in JavaScript you can simply access it via myElement.dataset.id.
In your case, instead of sending a name of an element to your function, you can send the row element itself, and simply search for its child element to get the id element:

    <?=$row["ID"]?>

const elBodyOverlay = document.getElementById("body-overlay"),
      elDialogTitle = document.getElementById("dialog_title"),
      elLoslegenDialog = document.getELementById("loslegen-dialog");

function dialogOeffnen(elRow) {
    //find our "id" element
    const elId = elRow.querySelector(".id_element");
    //display ID in the popup
    elDialogTitle.innerText = elId.textContent;
    //open popup
    elLoslegenDialog.classList.add("sichtbar");
    elBodyOverlay.classList.add("sichtbar");
}

However, a better solution is to simply send the ID itself instead:
<tr onclick="dialogOeffnen('<?=$row["ID"]?>')">

    <?=$row["ID"]?>

const elBodyOverlay = document.getElementById("body-overlay"),
      elDialogTitle = document.getElementById("dialog_title"),
      elLoslegenDialog = document.getElementById("loslegen-dialog");

function dialogOeffnen(id) {
    //display ID
    elDialogTitle.innerText = id;
    //open popup
    elLoslegenDialog.classList.add("sichtbar");
    elBodyOverlay.classList.add("sichtbar");
}

Note that  changed attribute id to class, this allows you to use the same name on multiple elements.


text:
Q: Windows 8 64 bit - Automatic Repair loop This is not the first time I have face this problem. Last time when I stuck in this loop I just reinstall my computer.
But right now I don't have the CD Win 8 or iso file so I find the solution from here: Automatic Repair fails to repair my PC
Since their solution doesn't work, I tried my self to accest to SrtTrail.txt throught command promt. There was only one problem listed in SrtTrail.txt:

Root cause found:
—————————
Boot critical file d:\windows\system32\ntoskrnl.exe is corrupt.
Repair action: File repair
Result: Failed. Error code =  0×3
Time taken = 1188 ms

So I used the HIREN BOOT disk, went to Mini windows 7 to look up to this "ntoskrnl.exe" file but I didn't find it. I think the file was missed somehow.
I looked up in the Internet but couldn't find any solution to fix this problem, especially when it's come ntoskrnl file. I know it would be simple if I just reinstall my computer, but it's so waste of time.
Any help?

A: You cannot take ANY ntoskrnl.exe from somewhere !
ntoskrnl is the most important part of a Windows system.
I would save my user files like documents, pictures etc. and do a fresh installation.
You can download Windows 8 with your product key from Microsoft.
Alternatively download Windows 8 virtual machine and extract ntoskrnl.exe from there.


text:
Q: Showing the User photo profile From Facebook with bad quality I'm getting the user photo profile from Facebook and using the Picasso library to show the image rounded, the problem is the image is showing with a bad quality, I can't see well the image. But in other apps for example Tinder, etc the same photo is showing very well.
This is my code:
CircleTransformation transformation;

Picasso.with(this)
        .load(urlImage)
        .placeholder(R.drawable.avatar)
        .resize(50, 50)
        .centerCrop()
        .transform(transformation)
        .into(ivPhoto);

public class CircleTransformation implements Transformation {
    @Override
    public Bitmap transform(Bitmap source) {
        int size = Math.min(source.getWidth(), source.getHeight());

        int x = (source.getWidth() - size) / 2;
        int y = (source.getHeight() - size) / 2;

        Bitmap squaredBitmap = Bitmap.createBitmap(source, x, y, size, size);
        if (squaredBitmap != source) { source.recycle();  }

        Bitmap.Config config = source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;
        Bitmap bitmap = Bitmap.createBitmap(size, size, config);
        //Bitmap bitmap = Bitmap.createBitmap(size, size, source.getConfig());

        Canvas canvas = new Canvas(bitmap);
        Paint paint = new Paint();
        BitmapShader shader = new BitmapShader(squaredBitmap, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP);
        paint.setShader(shader);
        paint.setAntiAlias(true);

        float r = size/2f;
        canvas.drawCircle(r, r, r, paint);

        squaredBitmap.recycle();
        return bitmap;
    }

    @Override
    public String key() { return "circle"; }
}

How can I show correctly the user photo profile from Facebook?
Thanks in advance


text:
Q: BaseAdapter - how to use notifyItemRemoved I have a BaseAdapter which is responsible for my SwipeCardView. Now I need to add something like this notifyItemRemoved to remove one specific item and show the new list.  I need to remove the item at the bottom of my code at the AlertDialog part. Everything is working, its just I don't know how to remove it. Unfortunately, I can't find the right syntax for it. FYI I removed method like the constructor etc. to keep the post small:

public class FeedAdapter extends BaseCardAdapter {
private List<EventObject> ideen;

private Activity context;
@Override
public void onBindData(final int position, View cardview) {
    if (ideen.size() ==0 || ideen == null){
        return;
    }
    ImageView bild = cardview.findViewById(R.id.imageView);
    TextView name = cardview.findViewById(R.id.name);
    final EventObject eo = ideen.get(position);
    name.setText(eo.getName());
    TextView adress = cardview.findViewById(R.id.address);
     Geocoder geocoder;
     List<Address> addresses = null;
     geocoder = new Geocoder(context, Locale.getDefault());

    try {
        addresses = geocoder.getFromLocation(Double.parseDouble(eo.getLat()), Double.parseDouble(eo.getLng()), 1); // Here 1 represent max location result to returned, by documents it recommended 1 to 5
    } catch (IOException e) {
        e.printStackTrace();
    }

    String address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()
    String city = addresses.get(0).getLocality();
    String state = addresses.get(0).getAdminArea();
    String country = addresses.get(0).getCountryName();
    String postalCode = addresses.get(0).getPostalCode();
    String knownName = addresses.get(0).getFeatureName();
    String[] separatedadress = address.split(",");

    adress.setText(separatedadress[0]+" , "+city);

    TextView date = cardview.findViewById(R.id.date);
    date.setText(eo.getDate());

    Button teilnehmen = cardview.findViewById(R.id.teilnehmen);
    teilnehmen.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            String userid = FirebaseAuth.getInstance().getCurrentUser().getUid();
            DatabaseReference ref = FirebaseDatabase.getInstance().getReference().child("Users").child(userid).child("acceptedEvents").child(eo.getId());
            ref.setValue(true);
            getPLZ(eo.getId(), eo, position);

        }
    });

            bild.setImageResource(R.drawable.blau);

}

private void getPLZ(final String id, final EventObject eo, final int position) {
String userid = FirebaseAuth.getInstance().getCurrentUser().getUid();
DatabaseReference ref = FirebaseDatabase.getInstance().getReference().child("Users").child(userid).child("plz");
ref.addListenerForSingleValueEvent(new ValueEventListener() {
    @Override
    public void onDataChange(DataSnapshot dataSnapshot) {
        String plz = dataSnapshot.getValue().toString();
        setParticipantInEvent(plz, id, eo, position);
    }

    @Override
    public void onCancelled(DatabaseError databaseError) {

    }
});

}

private void setParticipantInEvent(String plz, String id, EventObject eo, int position){
    String userid = FirebaseAuth.getInstance().getCurrentUser().getUid();

    DatabaseReference ref = FirebaseDatabase.getInstance().getReference().child("Events").child(plz).child(id);
    ref.child("participants").child(userid).setValue(true);

    askForCalendar(eo, position);
}

private void askForCalendar(final EventObject eventObject, final int position) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setMessage("Event in deinem Kalender speichern?")
            .setCancelable(false)
            .setPositiveButton("Ja", new
             DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {

                    Intent intent = new Intent(Intent.ACTION_EDIT);
                    intent.setType("vnd.android.cursor.item/event");
                    intent.putExtra("beginTime", Long.parseLong(eventObject.getTs()));
                    intent.putExtra("allDay", true);
                    intent.putExtra("endTime", Long.parseLong(eventObject.getTs())+60*60*1000);
                    intent.putExtra("title", eventObject.getName());
                    context.startActivity(intent);

                }
                })
            .setNegativeButton("Nein", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                //Here i have to remove one item:

                    dialog.cancel();

                }
            });
    AlertDialog alert = builder.create();
    alert.show();
        }

      }


text:
Q: Alternative to Thread.sleep method in Android I have this button that when clicked saves the details entered in my textfields to Google App Engine, right after the call to that onClickListener, i have an intent that starts a new activity, which displays the details I just entered.
Here is the code for this:
submitButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            if(v.getId() == R.id.userDetailsCaptureButton) {
                new EndpointsTask().execute(getApplicationContext());
            }

            startActivity(userProfileDisplayIntent);
        }
    });

Now i want to be able to wait for a couple of seconds before making a call to startActivity after new EnpointsTask().execute(getApplicationContext) has been called. I read that using Thread.sleep causes the UI to freeze and as such isn't best suited for this. What other options are there?

A: The solution is to use a handler with a runnable and use of the method 'postDelayed'. Example:
new Handler().postDelayed(new Runnable() {
    public void run () {
        // Do delayed stuff!
    }
}, 5000L); //5 seconds delay

A: Start activity in
onPostExecute()

of
EndpointsTask

Your EndPoints task should look like that
public final class EndpointsTask extends AsyncTask {

    private final Intent mUserProfileDisplayIntent;
    private final WeakReference<Activity> mActivityReference;

    EndpointsTask(final Activity activity, final Intent userProfileDisplayIntent) {
        mActivityReference = new WeakReference<Activity>(activity);
        mUserProfileDisplayIntent = userProfileDisplayIntent;
    }

    @Override
    protected void onPostExecute(Void result) {
        final Activity activity = mActivityReference.get();
        if (activity != null) {
            startActivity(mUserProfileDisplayIntent);
        }
    }
}

And then
    @Override
    public void onClick(View v) {
        if(v.getId() == R.id.userDetailsCaptureButton) {
            // make sure only one task can be launched
            if (endPointsTask == null || endPointsTask.getStatus() != AsyncTask.Status.RUNNING) {
                 endPointsTask = new EndpointsTask(YourActivity.this);
                 endPointsTask.execute();
            }
        }
        startActivity(userProfileDisplayIntent);
    }

// always cancel AsyncTasks in onStop(). You don't want it to launch anything when minimized, do you?

@Override
protected void onStop() {
    super.onStop();
    if (endPointsTask != null && endPointsTask.getStatus() == AsyncTask.Status.RUNNING) {
        endPointsTask.cancel();
    }
}

Don't pass a Context as a parameter to any thread since it can cause leaks. This means as well that inner classes should be static.
Store Context as a WeakReference (use mActivityReference for Context in current example)

A: Try it with a Handler and postDelayed-method inside onClick


text:
Q: Setting environment variables for Windows cmd temporarily, to run a program, in a single line? I have seen Setting and getting Windows environment variables from the command prompt?, but my question is slightly different.
Say I have a terminal program, myprogram.c -> myprogram.exe, which reads environment variables; say:
...
char *valueMYVAR = getenv("MYVAR");
printf("MYVAR is %s\r\n", (valueMYVAR==NULL)?"":valueMYVAR );
...

Now, if I'm in Linux bash, I can set the environment variable temporarily, just for that execution of the program, by simply writing it out on the command line, as in:
$ MYVAR=1 ./myprogram.exe

How could I do the same, if I am using the Windows Command Prompt (cmd.exe)? I have tried:
> SET MYVAR=1 myprogram.exe

... but it doesn't work - in the sense that myprogram.exe is not run at all, probably being interpreted as being part of the command line for the SET command.
Is this kind of a thing doable in Windows Command Prompt? If relevant, I use Windows 10.

EDIT: Found these:
Is there something like Command Substitution in WIndows CLI?

In Windows the '( )' operator has a similar behavior as the Bash command substitution.

https://stackoverflow.com/questions/8055371/how-do-i-run-two-commands-in-one-line-in-windows-cmd

Like this on all Microsoft OSes since 2000, and still good today:
dir & echo foo

So, I've tried:
> (SET MYVAR=1 && myprogram.exe)

... and this actually works - except, it seems the parentheses in Windows are not a "subshell" (or "subprocess"), and therefore setting the value "leaks" onto the current shell, which I don't want (in other words, if I just run myprogram.exe after the above command, it will still pick up MYVAR=1, whereas on Linux, MYVAR in that case would remain unset).
So, is there a way to do this on a single command line - and temporarily?

A: You could run a batch file with a setlocal
or on cmd line start another cmd.exe which inherits the current environment but changes are volatile.
cmd /c "SET MYVAR=1&myprogram.exe"

A: Try this command:
set Foo=bar & abc.exe & set Foo=

This command does:

*

*Set Foo variable with bar value.

*Run abc.execommand.

*Unset Foo variable by adding blank value.


text:
Q: How to check equality with combination of two columns data in Hibernate? @Entity

public class Employee{

private String Id;
private String preId;

}

I've a Entity like above and i want to get the search results on the combination of both fields. (preId+Id)

Is it possible through Restrictions eq method to verify the above combination of fields with my searching input value?
Any help would be appreciated...

A: Yes you can. You can add 2 restrictions for the Id and preId as follows.
public Employee getEmployee(Session session) {
    Criteria crt = session.createCriteria(Employee.class);
    crt.add(Restrictions.eq("Id", "1"));
    crt.add(Restrictions.eq("preId", "123"));
    return (Employee ) crt.uniqueResult();
}


text:
Q: Preventing "combining signed and unsigned types widened both operands" compiler warning This code, which is used to setup a component, produces a compiler warning:

[DCC Warning] Unit1.pas(742): W1024 Combining signed and unsigned types
                            - widened both operands

var
  iPrecision: cardinal;
  iRadius: cardinal;
  iActive: boolean;
  iInProximity: boolean;

iPrecision := Max(50, 100 - (3 + 2 * ord(iActive and iInProximity)) * iRadius);

Can this be typecast somehow to prevent a compiler warning?

A: In your case, ord() returns an integer, so needs to be explicitely type-casted to cardinal, by changing ord() into cardinal() as such:
iPrecision := Max(50, 100 - (3 + 2 * cardinal(iActive and iInProximity)) * iRadius);

You will get rid of the warning, and your code will be almost the same.

A: Arnaud has explained that ord() returns a signed value which is the source of the warning. Both Arnaud and Ken have suggested how to remove the warning by avoiding the use of unsigned operands.
I would like to offer an alternative opinion and suggest that you instead choose to use signed operands. Let's suppose that you perform the calculation using only signed operands. Consider the following program:
{$APPTYPE CONSOLE}

uses
  Math;

function CalcPrecision(Radius: cardinal; Active, InProximity: boolean): Cardinal;
begin
  Result := Max(50, 100-(3+2*Cardinal(Active and InProximity))*Radius);
end;

begin
  Writeln(CalcPrecision(1000, True, True));
  Readln;
end.

I'm sure that you would hope that the output of this program would be 50. It's not. The output is 4294962396.
What happens is that you perform 100-X in an unsigned context where X>100. When you do this you have integer overflow and the result is a very large positive value. Since you are using unsigned arithmetic, you cannot expect this to be a negative value because there are no negative values in unsigned.
Of course, if the compiler option for overflow checking was enabled, you would encounter a runtime error. But even that is not what you want. The simple way to get the answer you need is to perform the operation using signed arithmetic.
{$APPTYPE CONSOLE}

uses
  Math;

function CalcPrecision(Radius: Integer; Active, InProximity: boolean): Integer;
begin
  Result := Max(50, 100-(3+2*ord(Active and InProximity))*Radius);
end;

begin
  Writeln(CalcPrecision(1000, True, True));
  Readln;
end.

And this program produces the desired output of 50.
If for some reason, you need to store the value back to an unsigned variable, then do that outside the calculation. It's important for the reasons illustrated above that the calculation is performed with signed values.
....
var
  Precision: Cardinal;
begin
  Precision := CalcPrecision(1000, True, True);
  Writeln(Precision);
  Readln;
end.

Of course, it's true that you can come up with input values that will overflow the calculation, even if it is written using signed arithmetic. But in practise you will find that such input is exceptionally unlikely. On the other hand, it's very easy to trip your equation up when it is performed unsigned, using quite reasonable input data.

A: You can avoid the compiler warning by either

*

*Changing your Cardinal variables to a signed type such as Integer

*Use a slight workaround like this:

var
  ...
const
  BoolValues: array[Boolean] of Cardinal = (0, 1);
begin
  ...
  iPrecision := Max(50, 100 - (3 + 2 * BoolValues[iActive and iInProximity]) * iRadius);
end;


text:
Q: Java "Formatter" vs. "FileOutputStream": Very simple explanation desired of when to use which I am learning the basics of Java IO and cannot find what I would think would be covered in basic discussions of IO in java: without getting into subtleties or complexities (unless necessary), what is the very basic explanation of when you would choose one vs. when you would choose the other for output to a file (Formatter vs. FileOutputStream)?
I assume the same explanation will hold for Scanner vs. FileInputStream.

A: *

*You use an OutputStream (possibly a FileOutputStream) to write bytes.

*You use a Formatter to write formatted text.

The first is very efficient but you have to know what bytes to write. The second gives you flexible formatting features, but is limited in what it can write, and is likely to be less efficient than the first.

A: The Formatter and Scanner constructors that take file specifications as arguments are just a convenience for combining a file output or input stream with a Formatter or Scanner that operates on a stream. Use them whenever you were going to wrap your stream in a Formatter or Scanner anyway and you have no separate need for the stream object.


text:
Q: PHP Header Exceptions I have a seperate navigator.php included on top of every page that I have for public.And it has a login form.If users have an account,they can login and be sent to the current page that they are at.
I pass the current URL adress to a hidden input as it's value.And post it to giris.php(login).Then redirecting the user with Header.
But when it comes to register.php(when no sessions were set);Im trying to login there and it still sends me back to the register.php.But SESSION is being set.Thats where I need an exception and want to send user to the index.php through register.php.
navigator.php

Anasayfa

İletişim

Hakkımızda

    <?php
    if (isset($_SESSION["giris"]))
    {
    echo '
Panel

Çıkış Yap
';
    }
    else
    {
    $url= $_SERVER["REQUEST_URI"];
    echo '
Kayıt Ol

    <form method="post" action="giris.php">

    <input type="hidden" name="location" value="'.$url.'">
    <input type="text" name="username" placeholder="Kullanıcı Adı" class="loginField" required>
    <input type="password" name="password" placeholder="Şifre" class="loginField" required>
    <input type="submit" name="login" value="Giriş" id="logBut">
    </form>

';
    }
    ?>

    ☰

Topluluk Bloğu

Community Blog

    <?php if(isset($_SESSION["giris"])){echo '
Hoşgeldin '.$_SESSION["kullanici"].'
'; }?>

giris.php
<?php
session_start();
ob_start();
    include 'func/constr.php';
    if(isset($_POST["login"]))
    {
    $kullanici = $_POST['username'];
    $password = $_POST['password'];
    $URL = $_POST["location"];
    $query = mysqli_query($connect,"SELECT * FROM kullanicilar where kullanici_adi='$kullanici' and sifre='$password'");
    $count = mysqli_num_rows($query);
    if ($count == 1)
    {
    $_SESSION["giris"] = true;
    $_SESSION["kullanici"] = $kullanici;
    $_SESSION["sifre"] = $password;
    header("Location:$URL");
    }
    else
    {
    $invalid = "Kullanıcı adı ya da şifre yanlış";
    $_SESSION["invalid"] = $invalid;
    header("Location:index.php");
    }
    }
    ob_end_flush();
    ?>

A: try this but not tested, if your other code is ok and redirect problem then
header("Location:$URL");

to
header('Location: ' . $URL);


text:
Q: Make fixed positioned div inherit width of parent instead of body I am trying to implement a sticky header on my HTML page where when the user scroll downs the header sticks to the top of the page.
I have implemented the sticky header functionality but I am facing a problem that when the div class="header-content" becomes fixed at the top of the page it overflows the width of the container it is in and tries to take the width of the whole 'body'. I want this sticky header to be 100% of its container's width.
My HTML is here:

                <form id="searchForm" action="#" method="get">
                    <input class="form-control search-input" name="q" id="q" placeholder="Search..." type="text" required />

                        <button class="btn btn-default" type="submit">Button</button>

                </form>

List Item

List Item

List Item

List Item

Sample Logo

Heading Goes Here

Lorem ipsum dolor sit amet. The quick brown fox jumped over the lazy dog.

Lorem ipsum dolor sit amet. The quick brown fox jumped over the lazy dog.

Lorem ipsum dolor sit amet. The quick brown fox jumped over the lazy dog.

Second Heading Goes Here

Lorem ipsum dolor sit amet. The quick brown fox jumped over the lazy dog.

Heading Goes Here

Lorem ipsum dolor sit amet. The quick brown fox jumped over the lazy dog.

Lorem ipsum dolor sit amet. The quick brown fox jumped over the lazy dog.

Lorem ipsum dolor sit amet. The quick brown fox jumped over the lazy dog.

Second Heading Goes Here

Lorem ipsum dolor sit amet. The quick brown fox jumped over the lazy dog.

The CSS:
.container {width: 600px; margin: auto; background: #eee;}
#header {width: 100%;}
.header-content {width: 100%; z-index: 400;}
.sticky {position: fixed; top: 0; transition: all 0.4s ease; background: red;}

The jQuery for the sticky header:
     $(window).scroll(function() {
        if ($(this).scrollTop() > 30){
            $('.header-content').addClass("sticky");
          }
          else{
            $('.header-content').removeClass("sticky");
          }
      });

I also made a JSFiddle so you can see this issue in real-time. You can view it here:
https://jsfiddle.net/eng94871/
Notice that when you scroll down and the header is sticky at the top(the div with the red background) it overflows its container (the div with the gray background). I want to force it to have 100% width of the gray background.

A: The issue is because position: fixed elements are not in the usual document flow, and so their width is taken to be 100% of the window. You can fix this by specifying the same width property on the element as on .container. Also note that you would need to change transition: all to transition: background-color otherwise the width is animated, which I don't believe is the effect you're after. Try this:
.sticky {
    width: 600px;
    transition: background-color 0.4s ease;
    /* other properties... *.
}

Example fiddle

A: Try setting .sticky width to calc(100%) , which should be 100% of sticky parent #header element
jsfiddle  https://jsfiddle.net/eng94871/5/embedded/result/

A: Try setting containers to one width:
.container, .sticky, .header-content {
     width: 600px;
}

jsfiddle


text:
Q: Polynomial entropy of topological dynamical systems For a continuous mapping $\varphi: X \to X$ on a compact Hausdorff space $X$ we define the entropy as follows:
Given open covering $\mathcal{U}$, $\mathcal{V}$ of $X$, we call $\mathcal{V}$ a refinement of $\mathcal{U}$, if for all $V \in \mathcal{V}$ there exists $U \in \mathcal{U}$ such that $V \subseteq U$. We call
$$ \mathcal{U} \vee \mathcal{V} := \{U \cap V; \, U \in \mathcal{U}, \, V \in \mathcal{V}\}$$
the common refinement of $\mathcal{U}$ and $\mathcal{V}$.
For $n \in \mathbb{N}$ we set $\mathcal{U}_n := \bigvee_{i = 0}^{n-1} \varphi^{-i}(\mathcal{U})$, where $\varphi^{-i}(\mathcal{U}) := \{\varphi^{-i}(U); \, U \in \mathcal{U}\}$. Now denote by $N(\varphi, n, \mathcal{U})$ the minimal cardinality of a refinement of $\mathcal{U}_n$. (Notice that, since every subcover is a refinement and $X$ is compact, $N(\varphi, n, \mathcal{U})$ is always finite.) We now set
$$h_{\mathcal{U}}(\varphi) := \lim_{n \to \infty} \frac{1}{n} \log \big(N(\varphi, n, \mathcal{U})\big)$$
and call
$$ h(\varphi) = \sup \{ h_{\mathcal{U}}(\varphi) ; \, \mathcal{U} \text{ is an open covering of } X\}$$
the (topological) entropy of $\varphi$.
Notice that the constant $h_{\mathcal{U}}(\varphi)$ asymptoically satisfies
$$ N(\varphi, n ,\mathcal{U}) \sim e^{n h_{\mathcal{U}(\varphi)}}$$
for $n \to \infty$, so we can think of $h_{\mathcal{U}(\varphi)}$ as the exponential growth rate of $N(\varphi, n ,\mathcal{U})$ as $n$ grows larger.
Similarly we can define the polynomial (topological) entropy, namely by setting
$$p_{\mathcal{U}} (\varphi) := \lim_{n \to \infty} \frac{\log \big(N(\varphi, n, \mathcal{U})\big)}{\log(n)},$$
then
$$ p(\varphi) = \sup \{ p_{\mathcal{U}}(\varphi) ; \, \mathcal{U} \text{ is an open covering of } X\}$$
is called the polynomial (topological) entropy.
Similar to the classical entropy we now have asymptotically that
$$N(\varphi, n, \mathcal{U}) \sim e^{\log(n) p_{\mathcal{U}}(\varphi)} = n^{p_{\mathcal{U}}(\varphi)}.$$
This justifies the name "polynomial entropy".
Now to my question:
Is there any interesting literature that treats properties of polynomial entropy. I am particularly interested in the polynomial entropy as a topological invariant. It would also be interesting to know of any classes of topological dynamical systems for which $p(\varphi)$ is a complete topologic invariant. (An exemplary class of TDS for which the entropy is a complete topologic invariant is that of Bernoulli shifts.)


text:
Q: `test -s` for stdin is different on Ubuntu Bash 4.4 vs macOS bash 4.4, is there a portable alternative? I have a tiny script that should read from the stdin as long as it's open, but I get a different behaviour when I run it on bash 4.4 on Ubuntu (from a Docker image) and on bash 4.4 macOS (installed with brew)
The script is:
$ cat test.sh
#!/bin/bash
while test -s /dev/stdin; do read A; echo "-- $A --"; done

On macOS, it does:
$ (echo one; echo two) | ./test.sh
-- one --
-- two --

On Ubuntu, it does:
$ (echo one; echo two) | ./test.sh
# empty output

Is there another way to test that stdin is open and nonempty? I've played around with read too but it also didn't seem portable.

A: You can change your all stdin reading loop to this to make it work on both systems:
[[ ! -t 0 ]] && while IFS= read -r A; do echo "-- $A --"; done

[[ ! -t 0 ]]: Checks if data is coming from a terminal.
Tests:
$> { echo one; echo two; } | ./test.sh
-- one --
-- two --

$> ./test.sh <<< $'abc\nfoo'
-- abc --
-- foo --

$> ./test.sh
$>


text:
Q: extracting a text with awk I want to grep a file and extract the third part of this line
#define SIM_VERSION_COMPAT 1302

with awk. So I wrote:
grep "#define SIM_VERSION_COMPAT" global.h | awk '{ print $$3 }'

The result should be 1302 but I get nothing (blank).

A: No need to use grep and pipe you can use awk like this:
awk '/#define SIM_VERSION_COMPAT/{print $3}' global.h

A: Just using grep:
$ grep -Po '(?<=#define SIM_VERSION_COMPAT )[0-9]+' global.h
1302

This uses positive lookbehind to match lines containing #define SIM_VERSION_COMPAT but only prints the digit string following.

A: [spatel@tc01 ~]$ echo "#define SIM_VERSION_COMPAT 1302" | awk '{ print $3 }'
1302

A: You can also use cut command as well
grep "#define SIM_VERSION_COMPAT" temp.txt | cut -d" " -f 3


text:
Q: jboss as 7 Unable to connect to oracle 11.2.0.1.0 I am on jboss as 7 and i defined an oracle datasouce to oracle 11.2.0.1.0
when i use sql developer to connect to this database it works but throuw jboss it's impossible i've got this error
[org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (HttpManagementService-threads - 4) IJ000604: Throwable while attempting to get
a new connection: null: javax.resource.ResourceException: Could not create connection
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:277) [ironjacamar-jdbc-1.0.9.Final.jar:1.0.9.Final]
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:235) [ironjacamar-jdbc-1.0.9.Final.jar:1.0.9.Final]
    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:761) [ironjacamar-core-impl-1.0.9.Final.jar:1.0.9.Final]
    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:343) [ironjacamar-core-impl-1.0.9.Final.jar:1.0.9.Final]
    at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:397) [ironjacamar-core-impl-1.0.9.Final.jar:1.0.9.Final]
    at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:365) [ironjacamar-core-impl-1.0.9.Final.jar:1.0.9.Final]
    at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:627) [ironjacamar-core-impl-1.0.9.Final.jar:1.0.9.Final]
    at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:88) [ironjacamar-core-impl-1.0.9.Final.jar:1.0.9.Final]
    at org.jboss.as.connector.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:121) [jboss-as-connector-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.connector.pool.PoolOperations$1.execute(PoolOperations.java:60) [jboss-as-connector-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:385) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:272) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:200) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.connector.pool.PoolOperations.execute(PoolOperations.java:74) [jboss-as-connector-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:385) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:272) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:200) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.ModelControllerImpl$DefaultPrepareStepHandler.execute(ModelControllerImpl.java:466) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:385) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:272) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:200) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:121) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.ModelControllerImpl$1.execute(ModelControllerImpl.java:309) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.ModelControllerImpl$1.execute(ModelControllerImpl.java:299) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.domain.http.server.DomainApiHandler.processRequest(DomainApiHandler.java:294)
    at org.jboss.as.domain.http.server.DomainApiHandler.doHandle(DomainApiHandler.java:201)
    at org.jboss.as.domain.http.server.DomainApiHandler.handle(DomainApiHandler.java:208)
    at org.jboss.as.domain.http.server.security.SubjectAssociationHandler.handle(SubjectAssociationHandler.java:51)
    at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)
    at org.jboss.sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:69)
    at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)
    at org.jboss.sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:710)
    at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)
    at org.jboss.as.domain.http.server.RealmReadinessFilter.doFilter(RealmReadinessFilter.java:54)
    at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)
    at org.jboss.sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:682)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]
Caused by: java.sql.SQLRecoverableException: Erreur d'E/S: The Network Adapter could not establish the connection
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:249) [ironjacamar-jdbc-1.0.9.Final.jar:1.0.9.Final]
    ... 39 more
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
    at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:439)
    at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:454)
    at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:693)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:251)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
    ... 44 more
Caused by: java.net.SocketTimeoutException: connect timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method) [rt.jar:1.7.0_79]
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) [rt.jar:1.7.0_79]
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) [rt.jar:1.7.0_79]
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) [rt.jar:1.7.0_79]
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) [rt.jar:1.7.0_79]
    at java.net.Socket.connect(Socket.java:579) [rt.jar:1.7.0_79]
    at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:149)
    at oracle.net.nt.ConnOption.connect(ConnOption.java:133)
    at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:405)
    ... 49 more

here is my standalone.xml
<?xml version="1.0" encoding="UTF-8"?>

-<server xmlns="urn:jboss:domain:1.2">

-<extensions>

<extension module="org.jboss.as.clustering.infinispan"/>

<extension module="org.jboss.as.configadmin"/>

<extension module="org.jboss.as.connector"/>

<extension module="org.jboss.as.deployment-scanner"/>

<extension module="org.jboss.as.ee"/>

<extension module="org.jboss.as.ejb3"/>

<extension module="org.jboss.as.jaxrs"/>

<extension module="org.jboss.as.jdr"/>

<extension module="org.jboss.as.jmx"/>

<extension module="org.jboss.as.jpa"/>

<extension module="org.jboss.as.logging"/>

<extension module="org.jboss.as.mail"/>

<extension module="org.jboss.as.naming"/>

<extension module="org.jboss.as.osgi"/>

<extension module="org.jboss.as.pojo"/>

<extension module="org.jboss.as.remoting"/>

<extension module="org.jboss.as.sar"/>

<extension module="org.jboss.as.security"/>

<extension module="org.jboss.as.threads"/>

<extension module="org.jboss.as.transactions"/>

<extension module="org.jboss.as.web"/>

<extension module="org.jboss.as.webservices"/>

<extension module="org.jboss.as.weld"/>

</extensions>

-<management>

-<security-realms>

-<security-realm name="ManagementRealm">

-<authentication>

<properties relative-to="jboss.server.config.dir" path="mgmt-users.properties"/>

</authentication>

</security-realm>

-<security-realm name="ApplicationRealm">

-<authentication>

<properties relative-to="jboss.server.config.dir" path="application-users.properties"/>

</authentication>

</security-realm>

</security-realms>

-<management-interfaces>

-<native-interface security-realm="ManagementRealm">

<socket-binding native="management-native"/>

</native-interface>

-<http-interface security-realm="ManagementRealm">

<socket-binding http="management-http"/>

</http-interface>

</management-interfaces>

</management>

-<profile>

-<subsystem xmlns="urn:jboss:domain:logging:1.1">

-<console-handler name="CONSOLE">

<level name="INFO"/>

-<formatter>

<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

</formatter>

</console-handler>

-<periodic-rotating-file-handler name="FILE">

-<formatter>

<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

</formatter>

<file relative-to="jboss.server.log.dir" path="server.log"/>

<suffix value=".yyyy-MM-dd"/>

<append value="true"/>

</periodic-rotating-file-handler>

-<logger category="com.arjuna">

<level name="WARN"/>

</logger>

-<logger category="org.apache.tomcat.util.modeler">

<level name="WARN"/>

</logger>

-<logger category="sun.rmi">

<level name="WARN"/>

</logger>

-<logger category="jacorb">

<level name="WARN"/>

</logger>

-<logger category="jacorb.config">

<level name="ERROR"/>

</logger>

-<root-logger>

<level name="INFO"/>

-<handlers>

<handler name="CONSOLE"/>

<handler name="FILE"/>

</handlers>

</root-logger>

</subsystem>

<subsystem xmlns="urn:jboss:domain:configadmin:1.0"/>

-<subsystem xmlns="urn:jboss:domain:datasources:1.0">

-<datasources>

-<datasource use-java-context="true" enabled="true" pool-name="ExampleDS" jndi-name="java:jboss/datasources/ExampleDS">

<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>

<driver>h2</driver>

-<security>

<user-name>sa</user-name>

<password>sa</password>

</security>

</datasource>

-<datasource enabled="true" pool-name="Argos" jndi-name="java:/Argos" use-ccm="false" jta="false">

<connection-url>jdbc:oracle:thin:@10.10.61.1:1521:SID</connection-url>

<driver-class>oracle.jdbc.OracleDriver</driver-class>

<driver>OracleJDBCDriver</driver>

-<security>

<user-name>argos14</user-name>

<password>oracle</password>

</security>

-<validation>

<validate-on-match>false</validate-on-match>

<background-validation>false</background-validation>

</validation>

-<statement>

<share-prepared-statements>false</share-prepared-statements>

</statement>

</datasource>

-<drivers>

-<driver module="com.h2database.h2" name="h2">

<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

</driver>

<driver module="com.oracle.jdbc" name="OracleJDBCDriver"/>

<driver module="org.postgresql" name="postgres"/>

</drivers>

</datasources>

</subsystem>

-<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">

<deployment-scanner relative-to="jboss.server.base.dir" path="deployments" scan-interval="5000"/>

</subsystem>

<subsystem xmlns="urn:jboss:domain:ee:1.0"/>

-<subsystem xmlns="urn:jboss:domain:ejb3:1.2">

-<session-bean>

-<stateless>

<bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>

</stateless>

<stateful cache-ref="simple" default-access-timeout="5000"/>

<singleton default-access-timeout="5000"/>

</session-bean>

-<pools>

-<bean-instance-pools>

<strict-max-pool name="slsb-strict-max-pool" instance-acquisition-timeout-unit="MINUTES" instance-acquisition-timeout="5" max-pool-size="20"/>

<strict-max-pool name="mdb-strict-max-pool" instance-acquisition-timeout-unit="MINUTES" instance-acquisition-timeout="5" max-pool-size="20"/>

</bean-instance-pools>

</pools>

-<caches>

<cache name="simple" aliases="NoPassivationCache"/>

<cache name="passivating" aliases="SimpleStatefulCache" passivation-store-ref="file"/>

</caches>

-<passivation-stores>

<file-passivation-store name="file"/>

</passivation-stores>

<async thread-pool-name="default"/>

-<timer-service thread-pool-name="default">

<data-store relative-to="jboss.server.data.dir" path="timer-service-data"/>

</timer-service>

<remote thread-pool-name="default" connector-ref="remoting-connector"/>

-<thread-pools>

-<thread-pool name="default">

<max-threads count="10"/>

<keepalive-time unit="milliseconds" time="100"/>

</thread-pool>

</thread-pools>

</subsystem>

-<subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="hibernate">

-<cache-container name="hibernate" default-cache="local-query">

-<local-cache name="entity">

<transaction mode="NON_XA"/>

<eviction max-entries="10000" strategy="LRU"/>

<expiration max-idle="100000"/>

</local-cache>

-<local-cache name="local-query">

<transaction mode="NONE"/>

<eviction max-entries="10000" strategy="LRU"/>

<expiration max-idle="100000"/>

</local-cache>

-<local-cache name="timestamps">

<transaction mode="NONE"/>

<eviction strategy="NONE"/>

</local-cache>

</cache-container>

</subsystem>

<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>

-<subsystem xmlns="urn:jboss:domain:jca:1.1">

<archive-validation enabled="true" fail-on-warn="false" fail-on-error="true"/>

<bean-validation enabled="true"/>

-<default-workmanager>

-<short-running-threads>

<core-threads count="50"/>

<queue-length count="50"/>

<max-threads count="50"/>

<keepalive-time unit="seconds" time="10"/>

</short-running-threads>

-<long-running-threads>

<core-threads count="50"/>

<queue-length count="50"/>

<max-threads count="50"/>

<keepalive-time unit="seconds" time="10"/>

</long-running-threads>

</default-workmanager>

<cached-connection-manager/>

</subsystem>

<subsystem xmlns="urn:jboss:domain:jdr:1.0"/>

-<subsystem xmlns="urn:jboss:domain:jmx:1.1">

<show-model value="true"/>

<remoting-connector/>

</subsystem>

-<subsystem xmlns="urn:jboss:domain:jpa:1.0">

<jpa default-datasource=""/>

</subsystem>

-<subsystem xmlns="urn:jboss:domain:mail:1.0">

-<mail-session jndi-name="java:jboss/mail/Default">

<smtp-server outbound-socket-binding-ref="mail-smtp"/>

</mail-session>

</subsystem>

<subsystem xmlns="urn:jboss:domain:naming:1.1"/>

-<subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="lazy">

-<properties>

<property name="org.osgi.framework.startlevel.beginning"> 1 </property>

</properties>

-<capabilities>

<capability name="javax.servlet.api:v25"/>

<capability name="javax.transaction.api"/>

<capability name="org.apache.felix.log" startlevel="1"/>

<capability name="org.jboss.osgi.logging" startlevel="1"/>

<capability name="org.apache.felix.configadmin" startlevel="1"/>

<capability name="org.jboss.as.osgi.configadmin" startlevel="1"/>

</capabilities>

</subsystem>

<subsystem xmlns="urn:jboss:domain:pojo:1.0"/>

-<subsystem xmlns="urn:jboss:domain:remoting:1.1">

<connector name="remoting-connector" security-realm="ApplicationRealm" socket-binding="remoting"/>

</subsystem>

<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"/>

<subsystem xmlns="urn:jboss:domain:sar:1.0"/>

-<subsystem xmlns="urn:jboss:domain:security:1.1">

-<security-domains>

-<security-domain name="other" cache-type="default">

-<authentication>

-<login-module flag="optional" code="Remoting">

<module-option name="password-stacking" value="useFirstPass"/>

</login-module>

-<login-module flag="required" code="RealmUsersRoles">

<module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>

<module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>

<module-option name="realm" value="ApplicationRealm"/>

<module-option name="password-stacking" value="useFirstPass"/>

</login-module>

</authentication>

</security-domain>

-<security-domain name="jboss-web-policy" cache-type="default">

-<authorization>

<policy-module flag="required" code="Delegating"/>

</authorization>

</security-domain>

-<security-domain name="jboss-ejb-policy" cache-type="default">

-<authorization>

<policy-module flag="required" code="Delegating"/>

</authorization>

</security-domain>

</security-domains>

</subsystem>

<subsystem xmlns="urn:jboss:domain:threads:1.1"/>

-<subsystem xmlns="urn:jboss:domain:transactions:1.1">

-<core-environment>

-<process-id>

<uuid/>

</process-id>

</core-environment>

<recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>

<coordinator-environment default-timeout="300"/>

</subsystem>

-<subsystem xmlns="urn:jboss:domain:web:1.1" native="false" default-virtual-server="default-host">

<connector name="http" socket-binding="http" scheme="http" protocol="HTTP/1.1"/>

-<virtual-server name="default-host" enable-welcome-root="true">

<alias name="localhost"/>

<alias name="example.com"/>

</virtual-server>

</subsystem>

-<subsystem xmlns="urn:jboss:domain:webservices:1.1">

<modify-wsdl-address>true</modify-wsdl-address>

<wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>

<endpoint-config name="Standard-Endpoint-Config"/>

-<endpoint-config name="Recording-Endpoint-Config">

-<pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">

<handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>

</pre-handler-chain>

</endpoint-config>

</subsystem>

<subsystem xmlns="urn:jboss:domain:weld:1.0"/>

</profile>

-<interfaces>

-<interface name="management">

<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>

</interface>

-<interface name="public">

<inet-address value="${jboss.bind.address:127.0.0.1}"/>

</interface>

-<interface name="unsecure">

<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>

</interface>

</interfaces>

-<socket-binding-group name="standard-sockets" port-offset="${jboss.socket.binding.port-offset:0}" default-interface="public">

<socket-binding name="management-native" port="${jboss.management.native.port:9999}" interface="management"/>

<socket-binding name="management-http" port="${jboss.management.http.port:9990}" interface="management"/>

<socket-binding name="management-https" port="${jboss.management.https.port:9443}" interface="management"/>

<socket-binding name="ajp" port="8009"/>

<socket-binding name="http" port="80"/>

<socket-binding name="https" port="8443"/>

<socket-binding name="osgi-http" port="8090" interface="management"/>

<socket-binding name="remoting" port="4447"/>

<socket-binding name="txn-recovery-environment" port="4712"/>

<socket-binding name="txn-status-manager" port="4713"/>

-<outbound-socket-binding name="mail-smtp">

<remote-destination port="25" host="localhost"/>

</outbound-socket-binding>

</socket-binding-group>

</server>

and my module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.oracle.jdbc">
    <resources>
        <resource-root path="ojdbc6.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
    </dependencies>
</module>

Telnet is OK on 1521
and sql developer can connect from the same pc

A: OK I resolved with putting  xa-datasource-class on <drivers> in standalone.xml
<driver name="OracleJDBCDriver" module="com.oracle.jdbc">
<xa-datasource-class>oracle.jdbc.driver.OracleDriver</xa-datasource-class>

</driver>

A: In My case, the DB user was locked so I had to alter the user by the following command and it worked.
Command-> alter user [username] identified by [password] account unlock;
To check how it was locked just do

*

*sqlplus and hit enter

*it will prompt your DB's username and password enter the DB username and password

*then it will tell you that the account is locked


text:
Q: I get the output when i run the curl request in command line but not able to get the output when using python subprocess.call('curl https://api.smartsheet.com/1.1/sheets -H "Authorization: Bearer 26lhbngfsybdayabz6afrc6dcd" -H "Content-Type: application/json" -X POST -d @test.json' )
My test.json has:
{
   "name":"newsheet",
   "columns":[
      {
         "title":"Favorite",
         "type":"CHECKBOX",
         "symbol":"STAR"
      },
      {
         "title":"Primary Column",
         "primary":true,
         "type":"TEXT_NUMBER"
      },
      {
         "title":"Status",
         "type":"PICKLIST",
         "options":[
            "Not Started",
            "Started",
            "Completed"
         ]
      }
   ]
}

A: Try this:
from subprocess import PIPE, Popen

p = Popen('curl https://api.smartsheet.com/1.1/sheets -H "Authorization: Bearer 26lhbngfsybdayabz6afrc6dcd" -H "Content-Type: application/json" -X POST -d @test.json', stdin=PIPE, stdout=PIPE)

out, err = p.communicate()
print "Output %s" % out
print "Error %s" % err

Although you could use urllib2 library because is made for those kind of operation
Check this example using urrlib2 and reading the response http://www.2maomao.com/blog/python-http-post-a-binary-file-using-urllib2/


text:
Q: On the Product of Congruence Classes over $\mathbb{Z}$ Is it possible to multiply an element $a$ of $\mathbb{Z}_4$ to an element $b$ of $\mathbb{Z}_2$? If so, what are the needed conditions? To which set ($\mathbb{Z}_4$ and $\mathbb{Z}_2$) does $a\cdot b$ belong?

A: Yes, it is possible. $ab$ will belong to $\mathbf{Z}_2$ in this case. This can be done with any elements $b \in \mathbf{Z}_2$ and $a \in \mathbf{Z}_4$. The reason this is possible is because $2$ divides $4$.
However, before multiplying an element of $\mathbf{Z}_2$ by an element of $\mathbf{Z}_4$, a mathematician would probably say something like "Consider the $\mathbf{Z}_4$-module structure on $\mathbf{Z}_2$," because it's not that common.


text:
Q: What are the Drawbacks/ Caveats / Limitations of using a Non-Authoritative Server over a Fully Authoritative Server for Multiplayer Networking? Our Team is  developing a Fast-Paced Arena FPS game with a maximum of 10 Players per match(5v5) for Mobile Platforms using Unity.
 We're really in a dilemma on whether to use a Non-Authoritative or Fully Authoritative  Server.

Non-Authoritative Approach : Each player just  sends snapshots about it's current position to other Players and Remote Procedure Calls are called for special events like Firing a Weapon or triggering an Explosion. Physics is simulated Locally.
Thinking on Using Photon Unity Networking (PUN) for this approach, because of Mature API and Master-Client Model and Advanced Relays.

Authoritative Approach : The clients just send their Input Snapshots to a Dedicated Server, where the game is simulated using the Inputs and the game state is sent back to the clients, who just Renders it.
Thinking of Using Photon Bolt for this approach, because of Built-In Client-Side Prediction and Lag Compensation which is crucial while using a Dedicated Server.

So, Apart from making it easy for Cheaters to hack my game, what are the drawbacks/Limitations of using a Non-Authoritative Server over Authoritative one? Is Server Authority required in a mobile game? What are your recommendations for the type of game we're trying to make?
Also, How bad(or good) is the overhead of running an Unity Instance on a Dedicated Server(In Headless Mode)?
Thank You!

A:
So, Apart from making it easy for Cheaters to hack my game, what are
  the drawbacks/Limitations of using a Non-Authoritative Server over
  Authoritative one?

De-synchronization is a considerable drawback. It is ok if the physics simulated locally does not affect the functional outcome of the game.
However, for example, if the trajectory of a rocket from a launcher is simulated locally with physics, and whether it hits another player or not is decided locally too, you will end up with players getting killed despite seemingly not being hit by one.
In more serious cases, you might end up with players experiencing completely different outcomes of the match on their machines.

Is Server Authority required in a mobile game?

Not necessarily.

What are your recommendations for the type of game we're trying to
  make?

For multiplayer games, typically its recommended to have an authoritative server that does calculations for important events (e.g hit by a bullet).
To prevent choppy movement and actions, you would need to implement some form of interpolation/prediction/dead reckoning client side, and do corrections when your authoritative server replies.

Also, How bad(or good) is the overhead of running an Unity Instance on
  a Dedicated Server(In Headless Mode)?

Im not sure what overhead you are comparing to, but typically a Unity instance ran without graphics and in batchmode as a server is able to effectively handle a multiplayer game of 10 people pretty well.


text:
Q: Supress message after running draw.pairwise.venn I am using the function draw.pairwise.venn from the package VennDiagram to create a markdown document with Rstudio. When I knit the document into html I see a similar message for every Venn diagram:
(polygon[GRID.polygon.118], polygon[GRID.polygon.119], polygon[GRID.polygon.120], polygon[GRID.polygon.121], text[GRID.text.122], text[GRID.text.123], text[GRID.text.124], text[GRID.text.125], text[GRID.text.126])
This does not go away if I set message = FALSE
How could I get only the Venn diagram in the final html without such message?

A: Set chunk option include = FALSE. It preserves plot but discards any text outputs. See https://yihui.org/knitr/options/#text-output
Alternative chunk option: results = FALSE


text:
Q: How do I publish a fat JAR (JAR with dependencies) using sbt and sbt-release? I need to build a single jar, including dependencies, for one of my sub-projects so that it can be used as a javaagent.
I have a multi-module sbt project and this particular module is the lowest level one (it's also pure Java).
Can I (e.g. with sbt-onejar, sbt-proguard or sbt assembly) override how the lowest level module is packaged?
It looks like these tools are really designed to be a post-publish step, but I really need a (replacement or additional) published artefact to include the dependencies (but only for this one module).
UPDATE: Publishing for sbt-assembly are instructions for a single project, and doesn't easily translate into multi-project.

A:
Publishing for sbt-assembly are instructions for a single project, and doesn't easily translate into multi-project.

People have been publishing fat JAR using sbt-assembly & sbt-release without issues. Here's a blog article from 2011: Publishing fat jar created by sbt-assembly. It boils down to adding addArtifact(Artifact(projectName, "assembly"), sbtassembly.AssemblyKeys.assembly) to your build.sbt (note that the blog is a little out of date AssemblyKeys is now a member of sbtassembly directly).
For sbt 0.13 and above, I prefer to use build.sbt for multi-projects too, so I'd write it like:
import AssemblyKeys._

lazy val commonSettings = Seq(
  version := "0.1-SNAPSHOT",
  organization := "com.example",
  scalaVersion := "2.10.1"
)

val app = (project in file("app")).
  settings(commonSettings: _*).
  settings(assemblySettings: _*).
  settings(
    artifact in (Compile, assembly) ~= { art =>
      art.copy(`classifier` = Some("assembly"))
    }
  ).
  settings(addArtifact(artifact in (Compile, assembly), assembly).settings: _*)

See Defining custom artifacts:

addArtifact returns a sequence of settings (wrapped in a SettingsDefinition). In a full build configuration, usage looks like:
...
lazy val proj = Project(...)
  .settings( addArtifact(...).settings : _* )
...


text:
Q: Enabling cgroup cpu real-time runtime in ubuntu kernel I am trying to use real-time scheduling in a docker container running on Ubuntu 18.04.
I have already installed a realtime kernel following the method given here. I have selected kernel version 5.2.9 and its associated rt patch.
The output of uname -a confirms that the realtime kernel is well installed and running:
Linux myLaptop 5.2.9-rt3 #1 SMP PREEMPT RT ...

To run my container I issue the following command:
docker run --cpu-rt-runtime=95000 \
    --ulimit rtprio=99 \
    --ulimit memlock=102400 \
    --cap-add=sys_nice \
    --privileged \
    -it \
    myimage:latest

However, the output I got is:
docker: Error response from daemon: Your kernel does not support cgroup cpu real-time runtime.

I have seen that this can be linked to the missing CONFIG_RT_GROUP_SCHED as detailed in the issue here. Indeed if I run the script provided at this page to check the kernel compatibility with Docker I get:
- CONFIG_RT_GROUP_SCHED: missing

Which seems to confirm that Docker is using this for realtime scheduling but is not provided in the kernel, although patched to be realtime.
From there, I tried to find a solution in vain. I am not well versed in kernel configurations to know if I need to compile it with a specific option, and which one to choose, to add the missing CONFIG_RT_GROUP_SCHED.
Thanks a lot in advance for recommendations and help.

A: When talking about real-time Linux there are different approaches ranging from single kernel approaches (like PREEMPT_RT) to dual-kernel approaches (such as Xenomai). You can use real-time capable Dockers in combination with all of them (clearly the kernel of your host machine has to match) to produce real-time capable systems but the approaches differ. In your case you are mixing up two different approaches: You installed PREEMPT_RT while following a guide for control groups which are incompatible with PREEMPT_RT.

By default the Linux kernel can be compiled with different levels of preempt-ability (see e.g. Reghenzani et al. - "The real-time Linux kernel: a Survey on PREEMPT_RT"):

*

*PREEMPT_NONE has no way of forced preemption

*PREEMPT_VOLUNTARY where preemption is possible in some locations in order to reduce latency

*PREEMPT where preemption can occur in any part of the kernel (excluding spinlocks and other critical sections)

These can be combined with the feature of control groups (cgroups for short) by setting CONFIG_RT_GROUP_SCHED=y during kernel compilation, which reserves a certain fraction of CPU-time for processes of a certain (user-defined) group.
PREEMPT_RT developed from PREEMPT and is a set of patches that aims at making the kernel fully preemptible, even in critical sections (PREEMPT_RT_FULL). For this purpose e.g. spinlocks are largely replaced by mutexes.
As of 2021 it is being slowly merged into the mainline and will be available to the general public without the need to patch the kernel. As stated here PREEMPT_RT currently can't be compiled with the CONFIG_RT_GROUP_SCHED and therefore can't be used with control groups (see here for a comparison). From what I have read this is due to high latency spikes, something that I have already observed with control groups by means of cyclicytests.
This means you can either compile your kernel (see the Ubuntu manual for details)

*

*Without PREEMPT_RT but with CONFIG_RT_GROUP_SCHED (see this post for details) and follow the Docker guide on real-time with control groups as well as my post here. From my experience this has though quite high latency spikes, something not desirable for real-time system where the worst-case latency is much more important than the average latency.

*With PREEMPT_RT without CONFIG_RT_GROUP_SCHED (which can also be installed from a Debian package such as this one). In this case it is sufficient to execute the Docker with the options --privileged --net=host, or the Docker-compose equivalent privileged: true network_mode: host. Then any process from inside the Docker can set real-time priorities rtprio (e.g. by calling ::pthread_setschedparam from inside the code or by using chrt from the command line).
In case you are not using the root as user inside the Docker you furthermore will have to have give yourself a name of a user that belongs to a group with real-time privileges on your host computer (see $ ulimit -r). This can be done by configuring the PAM limits (/etc/security/limits.conf file) accordingly (as described here) by copying the section of the @realtime user group and creating a new group (e.g. @some_group) or adding the user (e.g. some_user) directly:
@some_group     soft    rtprio          99
@some_group     soft    priority        99
@some_group     hard    rtprio          99
@some_group     hard    priority        99

In this context rtprio is the maximum real-time priority allowed for non-privileged processes. The hard limit is the real limit to which the soft limit can be set to. The hard limits are set by the super-user and enforce by the kernel. The user cannot raise his code to run with a higher priority than the hard limit. The soft limit on the other hand is the default value limited by the hard limit. For more information see e.g. here.
I use latter option for real-time capable robotic applications and could not observe any differences in latency between with and without the Docker. You can find a guide on how to set up PREEMPT_RT and automated scripts for building it on my Github.


text:
Q: Center an object on screen after removing an iframe I've got a centered p that I use to hold my embedded live stream object and an iframe for the chat like so

Now, I have a JQuery call that hides the chat,
[Hide Chat]
But that ends up with the stream box pulled way off to the left

I'd love to have the chat re-align itself in the center of the screen without the ugly box on the right. I've tried setting a float:left; but the text below it wraps around and generally breaks the entire layout.
Is this possible with my current layout?
CSS:
    p
    {
        margin-left:auto;
        margin-right:auto;
        margin-bottom:1%;
        background-color:#121212;
        max-width:53%;
        max-height:75%;
        padding-top:25px;
        padding-left:25px;
        padding-right:25px;
        padding-bottom:25px;
    }
    p.streamblock
    {
        padding-top:25px;
        padding-left:25px;
        padding-right:25px;
        padding-bottom:25px;
        max-width:1000px;
    }

Embed code:
<object type="application/x-shockwave-flash" height="378" width="620" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=mychannel" bgcolor="#000000">
    <param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" />
    <param name="flashvars" value="hostname=www.twitch.tv&channel=mychannel&auto_play=true&start_volume=25" />
</object>

A: New HTML Markup ->

[Show Chat]
    [Hide Chat]

  <object width="620" height="378" style="margin: 0px auto;" type="application/x-shockwave-flash" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=tronasaurusx" bgcolor="#000000">
    <param name="allowFullScreen" value="true">
    <param name="allowScriptAccess" value="always">
    <param name="allowNetworking" value="all">
    <param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf">
        <param name="flashvars" value="hostname=www.twitch.tv&channel=tronasaurusx&auto_play=true&start_volume=25">
      </object>

New CSS markup ->
div.streamblock{
  margin: 0px auto;
  text-align: center;
  max-width:1100px;
}
p{
  background-color: #121212;
  color: #FFFFFF;
  font-family: "Palatino Linotype",Tahoma,Serif;
  margin-bottom: 1%;
  margin-left: auto;
  margin-right: auto;
  max-height: 75%;
  padding: 25px;
  text-indent: 10px;
}

I used the console to edit your HTML and make these changes on the fly. The above (when used exactly as I've given) will produce the desired result.

A: Hey now you can do this as like this
.streamblock > a{
float:right;
margin-right:xx; // required to your design
}


text:
Q: Magento 2: "404 Not Found" when calling a controller I created a simple module, it is registered and shows up in Stores -> Configuration -> Advanced -> Advanced, then I created routes.xml and Display.php.
app\code\Jurgis\Twilio_settings\etc\frontend\routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="Jurgis" frontName="Twilio_settings">
            <module name="Jurgis_Twilio_settings" />
        </route>
    </router>
</config>

app\code\Jurgis\Twilio_settings\Controller\Index\Display.php
<?php
namespace Jurgis\Twilio_settings\Controller\Index;

class Display extends \Magento\Framework\App\Action\Action
{
  public function __construct(
\Magento\Framework\App\Action\Context $context)
  {
    return parent::__construct($context);
  }

  public function execute()
  {
    echo 'Hello World';
    exit;
  }
}

But when I go to: "http://localhost/magento2/Twilio_settings/index/display" I get the 404 not found error. What have I done wrong?

A: You need some little modification.
Jurgis/Twilio/registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Jurgis_Twilio',
    __DIR__
);

Jurgis/Twilio/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Jurgis_Twilio" setup_version="2.0.0">
    </module>
</config>

Jurgis/Twilio/etc/frontend/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="Jurgis" frontName="Twilio_settings">
            <module name="Jurgis_Twilio" />
        </route>
    </router>
</config>

Jurgis/Twilio/Controller/Index/Display.php

namespace Jurgis\Twilio\Controller\Index;

class Display extends \Magento\Framework\App\Action\Action
{
    public function __construct(
        \Magento\Framework\App\Action\Context $context)
    {
        return parent::__construct($context);
    }

    public function execute()
    {
        echo 'Hello World';
        exit;
    }
}


text:
Q: RunTimeError when using tensorboard RuntimeError: Output 0 of ViewBackward is a view and is being modified inplace. This view is an output of a function that returns multiple views. Inplace operators on such views is forbidden. You should replace the inplace operation by an out-of-place one.
this is an error when I use tensorboard to visualize my neural network model, What's the matter, please


text:
Q: Jquery .focus().select() not working on first interaction I am working on a pretty simple solution where I want a enter press to cause focus on the object next to it.
Console logging nextInput shows the correct input field, and the code is "working", if you press enter twice, it will actually go to the object, but it is not going to the object on the first enter press
I hope someone might be able to explain to me what I am doing wrong here?
Thanks in advance!
_onKeydown(ev) {
        if (ev.keyCode === 13) {
            ev.preventDefault();

            var nextInput = this.$el.parents().find("input.o_input").not(this.$el).not(".ui-autocomplete-input");
            nextInput.focus().select();
        }

A: Solution for me were to change .focus to .click and it worked :)


text:
Q: How to control mac volume using python? I am trying to use gesture control to Control Volume on my MacOS in OpenCV. Since, pycaw can only be used for Windows, is there any alternative for macOS? I tried oascript but, it decreases the Frame Rate. Appreicate your help! Thank:)
import osascript

osascript.osascript("set volume output volume 100")