text:
Q: nginx reverse proxy worked on LAN but not public I am setting up a Nginx reverse proxy using these docker images

*

*nginx

*jwilder/docker-gen

*jrcs/letsencrypt-nginx-proxy-companion
The host where these containers are located is given public IP address so that the web app can be accessed from the internet. We registered the subdomain and set the public IP address to that subdomain.
When I test the configuration, the web app worked and https also worked but from LAN only (we have local DNS server that has the subdomain paired to a local server IP address.
But when I tried accessing it from internet it gives 301 redirected too many times. And yes I saw in the Nginx log the server logged around 20s 301 redirections and then stopped.
I am still clueless about what is wrong with the configuration. I used this template https://raw.githubusercontent.com/jwilder/nginx-proxy/master/nginx.tmpl for the auto-generated configuration files with a little modification in the location part (proxy_connect_timeout, proxy_send_timeout, proxy_read_timeout, proxy_send_lowat) to make our web app not 502 gateway timeout from long processing.
Can anyone point where my configuration failed?
# fhij.abcd.co.id
upstream fhij.abcd.co.id {
                                ## Can be connected with "nginx-proxy" network
                        # fhid_web_1
                        server 172.20.0.8:8069;
}
server {
        server_name fhij.abcd.co.id;
        listen 80 ;
        access_log /var/log/nginx/access.log vhost;
        return 301 https://$host$request_uri;
}
server {
        server_name fhij.abcd.co.id;
        listen 443 ssl http2 ;
        access_log /var/log/nginx/access.log vhost;
        ssl_session_timeout 5m;
        ssl_session_cache shared:SSL:50m;
        ssl_session_tickets off;
        ssl_certificate /etc/nginx/certs/fhij.abcd.co.id.crt;
        ssl_certificate_key /etc/nginx/certs/fhij.abcd.co.id.key;
        ssl_dhparam /etc/nginx/certs/fhij.abcd.co.id.dhparam.pem;
        ssl_stapling on;
        ssl_stapling_verify on;
        ssl_trusted_certificate /etc/nginx/certs/fhij.abcd.co.id.chain.pem;
        add_header Strict-Transport-Security "max-age=31536000" always;
        include /etc/nginx/vhost.d/default;
        location / {
                proxy_pass http://fhij.abcd.co.id;
                proxy_connect_timeout      9990;
                proxy_send_timeout         9990;
                proxy_read_timeout         9990;
                proxy_send_lowat           12000;
        }
}

These are the access.log I got from accessing from internet
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:42 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:43 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:43 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:43 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:43 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:43 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:44 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:44 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:44 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:45 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:45 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:46 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:46 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:46 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:46 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:46 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:47 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:47 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:47 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"
fhij.abcd.co.id 162.158.178.186 - - [22/Nov/2019:03:57:47 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Linux; Android 9; YAL-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36"

And these are from LAN
fhij.abcd.co.id 192.168.130.127 - - [22/Nov/2019:05:21:29 +0000] "GET / HTTP/2.0" 303 215 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"
fhij.abcd.co.id 192.168.130.127 - - [22/Nov/2019:05:21:29 +0000] "GET /web HTTP/2.0" 303 227 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"
fhij.abcd.co.id 192.168.130.127 - - [22/Nov/2019:05:21:29 +0000] "GET /web/login HTTP/2.0" 200 4383 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"
fhij.abcd.co.id 192.168.130.127 - - [22/Nov/2019:05:21:29 +0000] "GET /web/content/269-ceb8fb1/web.assets_common.0.css HTTP/2.0" 499 0 "https://fhij.abcd.co.id/web/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"
fhij.abcd.co.id 192.168.130.127 - - [22/Nov/2019:05:21:29 +0000] "GET /web/content/276-771d39e/web.assets_frontend.0.css HTTP/2.0" 499 0 "https://fhij.abcd.co.id/web/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"
fhij.abcd.co.id 192.168.130.127 - - [22/Nov/2019:05:21:29 +0000] "GET /web/webclient/qweb?mods= HTTP/2.0" 304 0 "https://fhij.abcd.co.id/web/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"
fhij.abcd.co.id 192.168.130.127 - - [22/Nov/2019:05:21:29 +0000] "POST /web/webclient/bootstrap_translations HTTP/2.0" 200 87 "https://fhij.abcd.co.id/web/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"

Why it is so different? Nginx response to internet request was 301 and response to LAN was 303

A: Turned out there is a mistake in our Cloudflare DNS and WAF configuration. Modifying these configuration fixed this issue.


text:
Q: How to select all records without an association? SQL I have 4 tables that I'm pulling from:
Company
    ID
    Code
Department
    ID
    Name
Cost_Center
    ID
    Number
Company_Department_Cost_Center
    CompanyID
    DepartmentID
    CostCetnerID

There are 3 companys, 33 departments, and 25 Cost Centers.
I am designing a web form with drop downs, one for each table, that allows a user to update the Company_Department_Cost_Center table.  When the User selects the Company from the first drop down I need to filter the second two to only contain the the data in the Department table and Cost_Center table that do not have an existing relationship.
So if the user selects company 1, I need to select all the Departments that do not have a relationship with company 1, and subsequently all the Cost Centers without a relationship.
I'm not sure how to approach this, I'm ok with SQL but this one is eluding me.
Any suggestions on how to tackle this?

A: using not exists(), and @CompanyId represents your parameter.
select d.*
from Department d
where not exists (
  select 1
  from Company_Department_Cost_Center cdcc
  where cdcc.CompanyId = @CompanyId
    and cdcc.DepartmentId = d.Id
  )

And for the second query for Cost_Center
select cc.*
from Cost_Center cc
where not exists (
  select 1
  from Company_Department_Cost_Center cdcc
  where cdcc.CompanyId = @CompanyId
    and cdcc.DepartmentId = @DepartmentId
    and cdcc.CostCenterId = cc.Id
  )

redpajama_set_name: RedPajamaStackExchange


text:
Q: java replaceAll() What is the regular expression for replaceAll() function to replace "N/A" with "0" ?
input  : N/A
output : 0

A: Why use a regular expression at all? If you don't need a pattern, just use replace:
String output = input.replace("N/A", "0");

A: Assuming s is a String.
s.replaceAll("N/A", "0");

You don't even need regular expressions for that. This will suffice:
s.replace("N/A", "0");

A: You can try a faster code. If the string contains only N/A:
return str.equals("N/A") ? "0" : str;

if string contains multiple N/A:
return join(string.split("N/A"), "0")
            + (string.endsWith("N/A") ? "0" : "");

where join() is method:
private String join(String[] split, String string) {
    StringBuffer s = new StringBuffer();
    boolean isNotFirst = false;
    for (String str : split) {
        if (isNotFirst) {
            s.append(string);
        } else {
            isNotFirst = true;
        }
        s.append(str);
    }
    return s.toString();
}

it is twice as fast


text:
Q: How to add a command button in VBA? I am trying to add a button to an Excel workbook so that it shows up in every sheet. A great answer to my original question gave me a macro to create the buttons on each sheet:
Sub AddButtons()
    Dim ws As Excel.Worksheet
    Dim btn As Button

    For Each ws In ThisWorkbook.Worksheets
        Set btn = ws.Buttons.Add(X, Y, W, H)
        [set btn properties]
    Next ws
End Sub

I am now having trouble with setting the button properties so that the button prints the sheet when pressed. Again here is my print macro:
 Dim WS_Count As Integer
 Dim i As Integer

 ' Set WS_Count equal to the number of worksheets in the active workbook.
 WS_Count = ActiveWorkbook.Worksheets.Count
 'allows user to set printer they want to use
 Application.Dialogs(xlDialogPrinterSetup).Show
 ' Begin the loop.
 For i = 5 To WS_Count
   Worksheets(i).Activate
   With ActiveWorkbook.Worksheets(i).PageSetup
     .PrintArea = "A1:O48"
     .Orientation = xlLandscape
     .Zoom = False
     .FitToPagesTall = 1
     .FitToPagesWide = 1
   End With
   ActiveWorkbook.Worksheets(i).PrintOut

There have been some good suggestions about how to go about incorporating this macro into the button properties (passing variables and creating a new print sub) however I am pretty new to VBA and have been unsuccessful in getting this to work. Ideally I would have a button macro that creates the button and every time it is pressed calls the print macro for each sheet.
One last thing, I am trying to change the button code so that it only adds buttons to sheet 5 onwards. It would be great if anyone knew how to do that as well?
Any advice is helpful and greatly appreciated!

A: Try this:
Sub AddButtons()
    Dim ws As Excel.Worksheet
    Dim btn As Button

    For Each ws In ThisWorkbook.Worksheets
        Set btn = ws.Buttons.Add(X, Y, W, H)
        btn.OnAction = "MySub"    ' MySub is executed when btn is clicked
        ' Substitute the name of your printing subroutine
        btn.Caption = "Print"
        'set additional btn properties as needed
    Next ws
End Sub

X and Y determine the location, W and H determine the button size.

A: This will add a button (Form Control) and assign an existing macro to it.
Sub test()
    Dim cb As Shape
    Set cb = Sheet1.Shapes.AddFormControl(xlButtonControl, 10, 10, 100, 25)
    cb.OnAction = "PrintMacro"
End Sub

Private Sub PrintMacro()
    MsgBox "Test" ' for testing pursposes
    ' you actually put your print code here
End Sub

Now to add buttons from Sheet 5 onwards only, you can try:

*

*Producing a list of all your sheet names (if there's only a few of them)
Dim shname
For Each shname In Array("Sheet 5", "Sheet 6", "Sheet 7")
    test Sheets(shname) ' note that you'll have to use below test sub
Next

*Do it the other way around. Make a list of what to exclude and test every sheet if it is on the list or not.
Dim sh As Worksheet
Dim xcludesheet: xcludesheet = Array("Sheet1", "Sheet2", "Sheet3", "Sheet4")
For Each sh In Worksheets
    If IsError(Application.Match(sh.Name, xcludesheet, 0)) Then
        test Sheets(sh.Name)
    End If
Next

Your test sub to be used in above samples.
Sub test(ws As Worksheet)
    Dim cb As Shape
    Set cb = ws.Shapes.AddFormControl(xlButtonControl, 10, 10, 100, 25)
    cb.OnAction = "PrintMacro"
End Sub


text:
Q: Monotonic Functions in Java of Comparables I am trying to implement an algorithm that checks if an array of comparable elements is increasing or decreasing. So far I have written this method:
class Solution {
    public boolean isMonotonic(int[] A) {
        int store = 0;
        for (int i = 0; i < A.length - 1; ++i) {
            int c = Integer.compare(A[i], A[i+1]);
            if (c != 0) {
                if (c != store && store != 0)
                    return false;
                store = c;
            }
        }

        return true;
    }
}

I changed the method signature, by passing a generic method of comparables, but I'm struggling to implement the compareTo method. I am probably using the bounded generics wrong, but I'm not too sure?
My attempt:
public boolean Test(T[] n)
    {
        if (n.length < 3)
            return true;

        int direction = n[0].compareTo(n[1]);
        for (int i = 1; i < n.length-1; i++){
            int step = n[i].compareTo(n[i+1]);
            if (step == 0)
                continue;

            if (direction == 0)
                direction = step;
            else if  ( sdtep < 0 && direction > 0
                    || step > 0 && direction < 0)
                return false;

        }

        return true;
    }

A: In order to make your method take a generic argument, change its header:
public static <T extends Comparable<? super T>> boolean isMonotonic(T[] A)

You can then compare items of the array using the Comparable::compareTo method:
int c = A[i].compareTo(A[i+1]);

A: Strictly monotone function:
public static boolean isMonotone(int[] a) {
    boolean monotone = true;
    if(a[0]>a[1]) {
        for(int i=0;i<(a.length-1);i++) {
            if(!(a[i]>a[i+1])){
                monotone=false;
            }
        }
    }
    if(a[0]<a[1]) {
        for(int i=0;i<(a.length-1);i++) {
            if(!(a[i]<a[i+1])){
                monotone=false;
            }
        }
    }
    if(a[0]==a[1]) return false;
    return monotone;

}

A: Monotone function:
public static boolean isMonotone(int[] a) {
    boolean monotone = true;
    int i=0;
    while(a[i]==a[i+1]) {
        i++;
    }
    if(a[i]>a[i+1]) {
        for(int j=0;j<(a.length-1);j++) {
            if(!(a[j]>=a[j+1])){
                monotone=false;
            }
        }
    }
    if(a[i]<a[i+1]) {
        for(int j=0;j<(a.length-1);j++) {
            if(!(a[j]<=a[j+1])){
                monotone=false;
            }
        }
    }
    return monotone;
}


text:
Q: How does interface helps in hiding details I was going through an interface in Java from W3c
In Why And When To Use Interfaces?, they have mentioned

1) To achieve security - hide certain details and only show the important details of an object (interface).

but I wasn't able to comprehend how is interface helps in hiding details or security.
In their notes of an interface, they have the following point

*

*Interface methods are by default abstract and public

*Interface attributes are by default public, static and final

Based on my understanding of interface, it looks more like interface helps in decreasing the number of error in code because

*

*Interface methods do not have a body - the body is provided by the "implement" class

*On implementation of an interface, you must override all of its methods

So we declare all the methods with their accessibility, return type and name and when we implement those methods, if we forgot to create a method which we haven't declared in our interface, it's going to throw an error.
Can someone help me in comprehending the relation of the interface in security?

A:
1) To achieve security - hide certain details and only show the
  important details of an object (interface).

Interface contains only those methods which are mandatory to be implemented by its implementing concrete class (omitting default methods since Java 8)
For example,
interface StudentOps {
    void insert(Student);
    void delete(Student);
    void update(Student);
}
class JdbcStudentOpsImpl implements StudentOps {
    public void insert(Student s) {
       // code
    }
    public void delete(Student s) {
       // code
    }
    public void update(Student s) {
       // code
    }

    public void validate(Student s) {
       // code
    }
}

In the above StudentOps is interface and it contains only 3 methods insert, update, delete. When we create an object without knowing the underlying impl, for example,
StudentOps studentOps = Factory.createFor("JDBC");
StudentOps studentOps = Factory.createFor("Kafka");

We cannot access validate() method, which could be hidden for those who are not aware of the JdbcStudentOpsImpl class.
Considering that there are 2 implementations, one for storing the data into a database via JDBC, another is to push it to Kafka.
The implementations may be provided at runtime and the actual programmer's job is to not worry about the implementation as to where the data will be stored, but to just invoke the  corresponding operations based on runtime parameters like JDBC, Kafka etc.
JdbcStudentOpsImpl, KafkaStudentOpsImpl can be there in different jars (libraries) which should be included in the classpath at runtime, for example.
In such a case, the programmer who calls Factory.createFor() might not know about those classes. So, he does not know what other methods are there in those classes apart from those in the StudentOps. He is just given an interface to access and he has to look after only those methods defined in the interface.
So, according to the example, insert(), update(), delete() are the important details where as validate() is not.


text:
Q: Swift remove aspect ratio constraint Is there a way to remove an aspect ratio constraint?
For example
let aspectRatio = messageImage.constraint(withIdentifier: "aspectRatio")
aspectRatio?.isActive = false

I need to keep all constraints of the object but remove just the aspect ratio

Something in this nature...

A: You can create an IBOutlet of the constraint and then set isActive to false in code.

A: Assuming you have a reference of the imageView and have given the constraint an identifier.
In your case, you have named the constraint with the identifier: aspectRatio.
So for the above, you can do this:
//Get constraints filtered against a user-defined identifier
let filteredConstraints = imageView.constraints.filter {
    $0.identifier == "aspectRatio"
}

//Get the first constraint (...as per your case)
let aspectRatio = filteredConstraints.first

//Deactivate it
aspectRatio?.isActive = false

Extension Solution
To improve this further, you can extend UIView as:
extension UIView {

    func constraint(withIdentifier identifier: String) -> NSLayoutConstraint? {
        let filteredConstraints = self.constraints.filter {
            $0.identifier == identifier
        }

        return filteredConstraints.first
    }

}

and now you can finally do what you initially wanted, i.e:
let aspectRatio = imageView.constraint(withIdentifier: "aspectRatio")
aspectRatio?.isActive = false

A: You can use func removeConstraint(_ constraint: NSLayoutConstraint) method to remove a constraint added.
It is also mentioned that, This method will be deprecated in a future release and should be avoided.  Instead set NSLayoutConstraint's active property to NO.


text:
Q: netezza Double Precision Output Truncates Vaules I've noticed that the nzsql and 'nzunload' just truncates double precision column's mantissa values. Here is the issue:
select tot_amt from table1;
tot_amt
~~~~~~~
123.124
567.678

while when I use other clients like Aginity for Data analytics - the output I get is
tot_amt
~~~~~~~
123.1240535
567.6780122

Also I've found the 'truncation' happens when netezza encounters 0 after 3 mantissa digits.
We are trying to migrate this db to oracle and due to this issue the entire project is messed and the client doesn't trust our migration scripts. Has anyone encountered this issue? The only workaround, even frmo IBM engineer is to cast it TO_CHAR( '999,999.999', col ) This will kill the unload scripts if I have to do it for billions of rows.

A: I can reproduce this issue where I have a table created with column as FLOAT(6) such as:
USERDB.USER(USER)=> create table ZZ (
USERDB.USER(USER)(> YY FLOAT(6)
USERDB.USER(USER)(> );
CREATE TABLE
USERDB.USER(USER)=> insert into ZZ (yy) values (123.123456789);
INSERT 0 1
USERDB.USER(USER)=> insert into ZZ (yy) values (12.123456789);
INSERT 0 1
USERDB.USER(USER)=> select * from ZZ;
   YY
---------
 123.123
 12.1234
(2 rows)

USERDB.USER(USER)=> select CAST ( YY as FLOAT(15) ) from ZZ;
    ?COLUMN?
----------------
 123.1234588623
12.123399734497
(2 rows)

USERDB.USER(USER)=>

I can cast the column values to a wider type, however the problem I see is that the value I inserted is not the same as the value returned. And the same is true if I use Aginity also to query, the values are incorrect.
Check the precision (and scale) of the 'tot_amt' column in table1, I guess the data type used to store values is quite small (FLOAT(6) maybe?), and NZSQL is telling you the correct values as enforced by the data type.


text:
Q: Edit Web Part - HTTP 403 Forbidden Error I have a webpart in a SharePoint 2007 site. This web part is written in object Model code. I am given Full Control to this Site Collection and can access the page with no issue.
When I tried to Edit it by clicking 'Site Actions--> Edit Page', I got the following error
Error:
The website declined to show this webpage- HTTP 403

Most likely causes:

•This website requires you to log in.
 What you can try:

Go back to the previous page.

**More information**

This error (HTTP 403 Forbidden) means that Internet Explorer was able to connect to the website, but it does not have permission to view the webpage.

For more information about HTTP errors, see Help.

A: is that a user control or something like that which is accessing the File System path ?
if yes then you have to use SPSecurity.RunWithElevatedPrivilages(delegate() {}).
Have a look at this
Thanks

A: I resolved the HTTP 403 Forbidden issue. The root cause of the issue is, in my code has access to the file system on the server,to which the logged in users do not have the access while Editing the web part.
I have used RunWithElevatedPrivileges but only for getting the site info and updating the list. The code reading the config file and logging into the log file does not covered under ElevatedPrivileges.
I included them with Elevated Privileges, the users are able to Edit the web pat.  We can also resolve this issue by giving ther read, write permissions to that particular files to 'SERVER\USERS'


text:
Q: PDFLib (PHP) - Characters not Displaying We use PDFlib (not sure exact version, should be recent) and I'm trying to have a Barcode appear using BCW Code 128 3 (Not A, B or C, but standard) using the same formula we have in an old Crystal Reports 8.0 formula (which DOES display correctly) which starts with Character #205 and ends in Character #206.
The problem is that the Barcode is not appearing at all, BUT ALSO the string is not displayed when I set to another another Textflow field just using the default font, so it is probably some Escaping issue or something like that. I've experimented changing the "escapesequence" and "charref" values to no avail.
The Barcode WILL display (now that it's set to Unicode) for standard characters like "111111111", but the moment a character like chr(205) displays, it displays nothing.
Any ideas?
Thanks!
$p = new PDFlib();

$p->set_option("errorpolicy=return");
$p->set_option("stringformat=utf8");

$p->begin_document("", "");
$doc = $p->open_pdi_document("/usr/local/PDFlib/templates/CertifiedMail.pdf", "");
$page = $p->open_pdi_page($doc, 1, "");

if ($page == 0) throw new Exception("Error: " . $p->get_errmsg());

$p->begin_page_ext(0, 0, "width=letter.width height=letter.height");

$p->fit_pdi_page($page, 0, 0, "");

$sText = chr(205).chr(103).chr(122).chr(232).chr(38).chr(96).chr(42).chr(232).chr(108).chr(115).chr(76).chr(206);

$p->fill_textblock($page, "sReturnAddress", $sText,  "encoding winansi");
$p->fill_textblock($page, "uniBarcode", $sText,  "encoding unicode");

$p->close_pdi_page($page);

$p->end_page_ext("");

$p->end_document("");

$buf = $p->get_buffer();
$len = strlen($buf);

header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=font_resource.pdf");
print $buf;

A:
We use PDFlib (not sure exact version, should be recent)

You can simply determine this, by checking your phpinfo() output.
I would suggest to embed the font, which is always recommended for custom fonts, like a Barcode font. (Otherwise the font must be installed on the system where you view the PDF). Use the option "embedding" in your case in the fill_textblock() option list. Otherwise in the load_font() option list.
Potential additional problem, when your code is a symbol font, you have
to load the font with the encoding "builtin". And then you have to address the glyphs by there code points, not via a Unicode String. Please see PDFlib 9 Tutorial, chapter 5.4.2 "Selecting an Encoding for symbolic Fonts" and 5.4.3 "Example: Selecting a Glyph from the Wingdings Symbol Font" for further background information.
And I'm sure, for further detailed help, the guys from PDFlib will give you a proper help. Then you can also share your resources etc. http://www.pdflib.com/licensing-support/opening-a-support-case/


text:
Q: Object doesn't support this property error when execute userform controls in VBA I have a VBA code for finding type of the Userform controls and add comments to some of the cells in my excel sheet. These Useform controls are dynamic. I meant, This controls like Textbox, label, etc are inserted by using another macro. It works fine. I use something like this format to add those controls:: set Label1i = UserForm2.Controls.Add("Forms.Label.1", "Test" & labelCounter, True). When I call below sub from the commandbutton on same userform. I am getting "Runtime 438 error: Object doesn't support this property or method"
Below code was running successfully. However, when I add one more manual "Textbox" to this program, it showed this error.
Private Sub CommandButton1_Click()
Dim cCont As Control
Dim Commnts As String
Commnts = ""
For Each cCont In Me.Controls
    If TypeName(cCont) = "TextBox" And cCont <> "" Then
        Commnts = cCont
        Sheet1.Range(cCont.ControlTipText).AddComment Commnts
    End If

Next cCont

If Commnts <> "" Then
    Unload UserForm2
    MsgBox ("Comments updated")
    Call Graphic16_Click
Else
    MsgBox ("Nothing to update")
End If
End Sub

Could someone please help me on this.

A:
cCont <> ""
I am getting "Runtime 438 error: Object doesn't support this property or method"
@SiddharthRout: Yes. There is an image already in controls. Yes..yes.. after introducing that, I go this issue. – user3342652 7 mins ago

You will get that error if you have a control on your userform which doesn't have a defualt property. For example an Image control. This control doesn't have a defualt propery like a Textbox/Range/CommanButton etc has one.
You can get away with saying
Debug.Print Textbox1
Debug.Print Range("A1")
Debug.Print Commandbutton1

but the below will give an error
Debug.Print Image1 '<~~ This will give error

So when you say cCont <> "", you are trying to compare a String with the control's default property (which in this case there is none) and hence you are getting the error Runtime 438 error: Object doesn't support this property or method
Try and handle the error and see what exact control is it talking about?
 Private Sub CommandButton1_Click()
    Dim cCont As Control

    On Error GoTo Whoa

    For Each cCont In Me.Controls
        If TypeName(cCont) = "TextBox" And cCont <> "" Then

        End If
    Next cCont

LetsContinue:

    Exit Sub
Whoa:
    MsgBox Err.Description & vbNewLine & _
           "Control Name : " & cCont.Name & _
           vbNewLine & _
           "Control Type : " & TypeName(cCont)
    Resume LetsContinue
End Sub

For example

Solution:
To handle this, break the IF in 2 parts as shown below. The second If will only be checked when the 1st condition is met.
If TypeName(cCont) = "TextBox" Then
    If cCont <> "" Then

    End If
End If


text:
Q: Material Container Transform animation not working in Java Im trying to use Material Container Transform in Recyclerview Adapter as described by this post MaterialContainerTransform transition is not Working on Return , but after implementing this in my project im getting null pointer exception error.
As everyone know Material Container Transform animation tutorials are in kotlin and im doing it in java.
So if anyone know how to properly use material container transform animation in recyclerview and point out my mistakes i will be very much thankful to him.
RecyclerView Adapter Class(source)
public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.ViewHolder> implements Filterable {

    private Context context;
    private List<Astadhyayi> wordList;
    private List<Astadhyayi> filwordList;
    private DictionaryDB dictionaryDB;

    private OnclickListenerInterface listener;

    public RecyclerViewAdapter(Context context, List<Astadhyayi> itemList, DictionaryDB dictionaryDB) {

        this.context = context;
        this.wordList = itemList;
        this.dictionaryDB = dictionaryDB;
        filwordList = new ArrayList<Astadhyayi>(itemList);

    }

    public void setClickListener(OnclickListenerInterface onclickListener) {

        this.listener = onclickListener;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        LayoutInflater inflater = LayoutInflater.from(context);
        View view = inflater.inflate(R.layout.wordslist_two_rv, parent, false);
        ViewHolder viewHolder = new ViewHolder(view);

        return viewHolder;
    }

    @Override
    public void onBindViewHolder(final ViewHolder holder, int position) {

        Astadhyayi word = wordList.get(position);
        holder.rsutras.setText(word.mSutras);

        // Animation******

        holder.rsutras.setTransitionName(word.getMSutras());

        if (word.mStatus != null && word.mStatus.equals(DictionaryDB.BOOKMARKED)) {

            holder.bookmark.setImageResource(R.drawable.cards_heart);
        } else {

            holder.bookmark.setImageDrawable(null);
        }
    }

    @Override
    public Filter getFilter() {
        return Searched_Filter;
    }

    private Filter Searched_Filter = new Filter() {
        @Override
        protected FilterResults performFiltering(CharSequence constraint) {
            List<Astadhyayi> filteredList = new ArrayList<>();
            if (constraint == null || constraint.length() == 0) {
                filteredList.addAll(filwordList);
            } else {
                String filterPattern = constraint.toString().toLowerCase().trim();
                for (Astadhyayi item : filwordList) {
                    if (item.getMSutras().toLowerCase().contains(filterPattern)) {
                        filteredList.add(item);
                    }
                }
            }
            FilterResults results = new FilterResults();
            results.values = filteredList;
            return results;
        }
        @Override
        protected void publishResults(CharSequence constraint, FilterResults results) {
            wordList.clear();
            wordList.addAll((ArrayList<Astadhyayi>)results.values);
            notifyDataSetChanged();
        }
    };

    @Override
    public int getItemCount() {
        return wordList.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

        private TextView rsutras;
        private ImageView bookmark;

        public ViewHolder(View itemView) {
            super(itemView);

            itemView.setOnClickListener(this);

            rsutras =  itemView.findViewById(R.id.tvSansTerm);
            bookmark = itemView.findViewById(R.id.bookmarkBtn);

        }

        /*
         @Override
         public void onClick(View view) {

         if(listener!=null) listener.onItemClicked(getAbsoluteAdapterPosition(), rsutras);

         }
         */

        @Override
        public void onClick(View view) {

            int position = this.getAbsoluteAdapterPosition();
            Astadhyayi word = wordList.get(position);

            //*************** Bundle  **************\\
            Bundle bundle = new Bundle();

            bundle.putParcelable("allData", word);

            bundle.putString("transition_name", word.getMSutras());

            Fragment detailsFragment = new TermThreeDetailsFragment();
            detailsFragment.setSharedElementEnterTransition(new MaterialContainerTransform());
            detailsFragment.setArguments(bundle);

            FragmentTransaction fT =((AppCompatActivity)context).getSupportFragmentManager().beginTransaction();
            fT.setReorderingAllowed(true);
            fT.addSharedElement(rsutras, rsutras.getTransitionName()); // Shared element!
            fT.replace(R.id.fragment_container, detailsFragment);
            fT.addToBackStack(null);
            fT.commit();

        }

    }

}

RecyclerView Fragment Class(source)
public class ShowtermsTwoFragment extends Fragment {

    private RecyclerView rv;
    private EditText tV;

    private Toolbar toolbar;
    private LinearLayoutManager layoutManager;
    private static DictionaryDB db;
    private RecyclerViewAdapter rvAdapter;

    private SearchView searchView = null;
    private SearchView.OnQueryTextListener queryTextListener;
    private List<Astadhyayi> wordsList = new ArrayList<>();

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

        setExitTransition(new MaterialElevationScale(false));
        setReenterTransition(new MaterialElevationScale(true));
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_terms_recyclerview, container, false);
        return view;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        toolbar = ((Toolbar) view.findViewById(R.id.toolbar_rv));
        rv = view.findViewById(R.id.rvTerms);
        tV = view.findViewById(R.id.tVinput);

        //*********** TOOLBAR
        AppCompatActivity activity = (AppCompatActivity) getActivity();
        activity.setSupportActionBar(toolbar);
        setHasOptionsMenu(true);

        // new Get_DbData().execute();

        databaseCheck();
        recyclerCheck1();

        postponeEnterTransition();
        ((ViewGroup) view.getParent()).getViewTreeObserver()

            .addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
                public boolean onPreDraw() {
                    startPostponedEnterTransition();
                    return true;
                }
            });

        }

    private void databaseCheck() {

        String sanskritWord = getActivity().getIntent().getStringExtra("sanskritWord");

        //*********** @@@ DATABASE OPENING @@@ ***********\\
        db = DictionaryDB.getInstance(this.getActivity());

        wordsList = db.getWords((sanskritWord));
    }

    private void recyclerCheck1() {

        layoutManager = new LinearLayoutManager(getContext());
        rv.setLayoutManager(layoutManager);
        rv.setHasFixedSize(true);

        DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(rv.getContext(), layoutManager.getOrientation());
        rv.addItemDecoration(dividerItemDecoration);
        rvAdapter = new RecyclerViewAdapter(getContext(), wordsList, db);

        rv.setAdapter(rvAdapter);
     /////**********   rvAdapter.setClickListener(this);
        rvAdapter.notifyDataSetChanged();
    }
}

Details Fragment Class(destination)
public class TermThreeDetailsFragment extends Fragment {

    private TextView sutraTV,vrittiTV,padaTv,adhyayTV,sutraIdTV ;
    private CoordinatorLayout coordinatorLayout;
    private FloatingActionButton fabBtn;
    private static DictionaryDB db;
    private Astadhyayi word;
    private BottomAppBar bottomAppBar;

    private TextToSpeech pronunciation;
    private AudioManager audio;
    private String ttsID , trans;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MaterialContainerTransform transform = new MaterialContainerTransform();
        transform.setScrimColor(Color.TRANSPARENT);
        setSharedElementEnterTransition(transform);
        setSharedElementReturnTransition(transform);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.show_three_details, container, false);

        view.findViewById(R.id.tvSutra).setTransitionName(word.getMSutras());
        return view;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        sutraTV = view.findViewById(R.id.tvSutra);
        adhyayTV = view.findViewById(R.id.tVAdhyay);
        padaTv = view.findViewById(R.id.tVPada);
        sutraIdTV = view.findViewById(R.id.tVSutraId);
        vrittiTV = view.findViewById(R.id.tvVritti);

        fabBtn = view.findViewById(R.id.favFAB);
        coordinatorLayout = view.findViewById(R.id.parentCordlayout);
        bottomAppBar = view.findViewById(R.id.bottom_app_bar);

        bundleCheckWithDb();
        WordCheck();

    }

    private void bundleCheckWithDb() {

                            //***********  Geting Parcelable Data
        word = new Astadhyayi(Parcel.obtain());
        Bundle bundle = this.getArguments();

        if (bundle != null) {
            word = bundle.getParcelable("allData");
            trans = bundle.getString("transition_name");

            adhyayTV.setText(word.getMAdhyay());
            padaTv.setText(word.getMPada());
            sutraIdTV.setText(word.getMSutra_id());
            sutraTV.setText(word.getMSutras());
            vrittiTV.setText(word.getMVritti());
        }

                           //*********** DATABASE OPENING
        db = DictionaryDB.getInstance(this.getActivity());
    }

    private void WordCheck() {

        if (word.mStatus != null && word.mStatus.equals(DictionaryDB.BOOKMARKED)) {
            fabBtn.setImageResource(R.drawable.cards_heart);
        } else {
            fabBtn.setImageResource(R.drawable.cards_heart_white);
        }

        fabBtn.setOnClickListener(new View.OnClickListener() {

                public void onClick(View v) {
                    bookMarkWord(word, fabBtn);
                }
            });
    }
}

Error im getting
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.sanskrit.mysearcher.models.Astadhyayi.getMSutras()' on a null object reference
at com.sanskrit.mysearcher.fragments.TermThreeDetailsFragment.onCreateView(TermThreeDetailsFragment.java:69)

A: From the current given information, I think you should do something like this:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    word = new Astadhyayi(Parcel.obtain());
    Bundle bundle = this.getArguments();
    if (bundle != null) {
        word = bundle.getParcelable("allData");
    }

    View view = inflater.inflate(R.layout.show_three_details, container, false);
    view.findViewById(R.id.tvSutra).setTransitionName(word.getMSutras());
    return view;
}

Again, I am not sure what getMSutras() actually returns and if it's right to use that here.


text:
Q: Air Pressure & Atmospheric Pressure I know that when air is heated it expand, and thus it makes density decrease, pressure increase, and temperature increase. But, why hot air cools off when it expands and rise ?
Please answer with a long sentence.

A: Unless it is in a closed container, the pressure of a heated sample of air is determined by the surrounding atmosphere.  As the density decreases, it rises, expands as the pressure drops, does work against the surrounding atmosphere, and loses internal energy.

A: Look temperature of any gaseous system depends upon the kinetic energy of the molecules  and if the separation between two molecules is increased then the probability of collision decreases and thus their kinetic energy doesn't change to heat energy due to less collision. So when hot air expands the temperature decreases. So what is responsible for temperature of the gases is collision rate and their kinetic energies. Since there is no more collision the kinetic energy is then released finally.


text:
Q: blur function not being first I am using regex to disable registering with a apple email
if (str.match('(@me.com)') || str.match('(@icloud.com)') || str.match('(@mac.com)'))

The code is working fine if I run it with the browser console but I cant get it to work initially, Ive wrapped it in a $(document).ready(function () { .. } as well the blur function just never seems to fire. Here is the code below as well as CodePen
Html

  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" role="form">

A non-Apple email address is required due to issues with our mail server. Sorry about that!

    <input type="text" name="email" placeholder="" value="" id="Email"/>
    <input type="password" name="password" placeholder="Password" value="" />
    <input style="font-size: 1.5rem;" type="submit" value="Login" class="btn btn-default" />

Don't have an account? Register

    Forgot your password?
  </form>

JS
function emailValidate(){
  var str = $('#Email').val();
  $('#Email').blur(function() {
    if (str.match('(@me.com)') || str.match('(@icloud.com)') || str.match('(@mac.com)')) {
      $('.email-warning').css('display', 'block')
    }
  });
}
emailValidate()

A: You need to re-assign the value using val() to variable str inside blur event callback.
function emailValidate(){

  $('#Email').blur(function() {
    var str = $(this).val();
    if (str.match('(@me.com)') || str.match('(@icloud.com)') || str.match('(@mac.com)')) {
      $('.email-warning').css('display', 'block')
    }
    alert(str)
  });
}
emailValidate()

A: you must get value of target object #Email when the blur event trigger. In your code, you get that value when you bind blur event.
Try with

function emailValidate(){

  $('#Email').blur(function() {
      var str = $('#Email').val();
    if (str.match('(@me.com)') || str.match('(@icloud.com)') || str.match('(@mac.com)')) {
      $('.email-warning').css('display', 'block')
    }
  });
}
emailValidate();

  <form role="form">

A non-Apple email address is required due to issues with our mail server. Sorry about that!

    <input type="text" name="email" placeholder="" value="" id="Email"/>
    <input type="password" name="password" placeholder="Password" value="" />
    <input style="font-size: 1.5rem;" type="submit" value="Login" class="btn btn-default" />

Don't have an account? Register

    Forgot your password?
  </form>

Hope this helps.
Regards.


text:
Q: What is the purpose of Charts now that uiapp is deprecated? Now that uiapp is deprecated, it seems that there aren't really many ways to use Charts. HTML service doesn't support Charts, rather you have to use the other google Charts API.
Source
I have a few questions:

*

*Is there any use for Charts without uiapp?

*Is it still possible to create a Charts dashboard using Charts?

A: Maybe here you can find what you need!

A: You might want to check these issue tracker 1 and issue tracker 2 for references:

Note that for static charts you can use Chart.getBlob().getImageUrl() to acquire an image to present.  You can also use Google Charts to create and manipulate charts with JavaScript and HtmlService.

Also in the blog - Converting from UiApp + Chart Service to Html Service + Google Visualization API:

For users of Google Apps Script, there are two alternatives for visualizing data:
1 Continue using Charts + UiApp. While deprecated and not supported for auto-completion in the editor, UiApp still works. There has been no announcement that it will actually be shut down… yet.

*Follow Google's recommendation, and use HtmlService instead. A feature request to have Charts supported by the HtmlService has been declined. So this seemingly-simple recommendation entails the additional requirement that you use Google's other Charts offering, also known as the Google Visualization API, or GViz.

You can use HtmlService but as Mogsdad said "this seemingly-simple recommendation entails the additional requirement that you use Google's other Charts offering." There are steps and sample in the issue tracker and blog for code implementation purposes.
Hope this information helps.


text:
Q: Deploy iOS 5 app on an iPad 1 I am currently developing an application for iOS and while it works fine on the simulator, I would like to run it on an actual device.
Unfortunately, I only have an iPad 1.
I'm using OS X Mavericks and Xcode 5.1 and I set the iOS Deployment Target for the project to iOS 5.1.
I understand that I won't be able to run it on the iOS 5.1 Simulator with Mavericks, but I was wondering if I would still be able to run it on an iPad 1 ?
I can't find that information anywhere and I just want to be sure it will work before paying the 99$ fee to deploy on the real hardware.

A: You can update a first generation iPad up to iOS 5.1.1, which will work for testing iOS 5.1 apps.
If you intend to release your app to Apple's App Store, keep in mind that Apple has released a statement saying that all apps "must be optimized for iOS 7", so you may still need a newer device for testing. (source)


text:
Q: How does implementing servers with different languages work in discord.js API? Im learning about discord.js coding and want to support having servers where there is a dedicated  server for each of a few languages.
I know once a bot gets huge, you can have thousands of servers. My questions are:

*

*Does each server have an auto assigned region code, or can I pick the region?

*How would I set up the code/sharding to have support for a user having the ability to enter a server thats language is local to the users language?

*How does discord servers work? Once you reach 10k+, does the user see all those servers in a list, or do they just join 1 room but the 10k servers is really just discord's abstraction for how they split it up in the backend?

How do servers grow for a bot? Does the count specify how many times a person has add a bot to a unique server? I assumed that the server you created for the bot is the 1 place everyone has to join to use the bot because it has all the role configuration and patron bot you set up, but that would mean its just 1 server, yet people have 2.5k+ (to use sharding too). Or does a server count mean the owner has manually created that many servers and set up the same configuration on each of them?
Thanks


text:
Q: Unable to parse Array Type Query string to List of Object I am trying some paging and sorting stuffs in ASP.net core MVC 6 application. But when I pass array like query string MVC action unable to parse it to list.
Query String looks like :

take=10&skip=0&page=1&pageSize=10&sort%5B0%5D%5Bfield%5D=price&sort%5B0%5D%5Bdir%5D=asc

Model for it looks like:

This is the query string which i am getting at server:

Count for Sort Array or List is always 0.

Can you please suggest a work around. It should parse it correctly but not getting where things are wrong.

A: Your current decoded query string looks like
take=10&skip=0&page=1&pageSize=10&sort[0][field]=price&sort[0][dir]=asc

So use following format to pass query string parameters from your client application
sort[0].field=price&sort[0].dir=asc

A: Someone may have a better answer, but if it were me I'd simplify my query string a bit and flatten the model. So the query string might be:
take=10&skip=0&page=1&pageSize=10&sortfield1=price&sortdir1=asc&sortfield2=otherfield&sortdir2=desc
Then in the model replace public List<Sort> Sort with the flattened properties:
 public string SortField1 {get; set;}
 public string SortDir1   {get; set;}
 public string SortField2 {get; set;}
 public string SortDir2   {get; set;}

You can add as many of these flattened properties as needed.  It's not elegant, but it gets the job done.  Then if you need your Sort list built you can build it from these properties easily.


text:
Q: Is it possible to define preprocessor directives for an Unreal project at build time? I am looking for a way to easily define macros / preprocessor directives at project build/cook time for an Unreal Engine project.
For example, if I want a defined C++ macro MY_BUILDTIME_VAR to be 0 in certain builds, and 1 in others, without having to modify source code every time, in a similar approach to environment varibles in many tools (i.e. NODE_ENV in node.js), or to the  command-line approach of i.e. g++ (see here).
I am aware it's possible to define target-wide macros in a project's target.cs with GlobalDefintions.Add("MY_TARGET_VAR=0") or module-wide macros in a module's Build.cs with PublicDefinitions.Add("MY_MODULE_VAR=0"). It helps to have all things defined in one place, but those definitions are still baked in the source file, and can't be changed at build time.
The official documentation mentions several ways of building/cooking an Unreal project with custom parameters, such as the Project Launcher tool and the RunUAT script file. Do any of them allow for build-time macro definitions?
Note: I am not using MS Visual Studio, but JetBrains Rider with .uproject only, so I can't define them in an .sln solution file.

A: Use an environment variable and read it in your build.cs file. Based on the environment variable set the value of your macro.
This is a handy utility method I use for this purpose:
private void AddEnvironmentVariableDefinition(string variableName, string defName, string defaultValue = "0")
{
    string value = System.Environment.GetEnvironmentVariable(variableName) ?? defaultValue;
    PublicDefinitions.Add(String.Format("{0}={1}", defName, value));
}


text:
Q: Return Select-String results with context from Invoke-Command (appear blank) I'm trying to search log files on multiple servers using Invoke-Command and return the results with context but I'm having no success.
This is the command:
Invoke-Command -Session $session {
  cd C:\LogDir\Log1
  sls -Pattern "ThingImLookingFor" -Path * -Context 1,5
}

This returns a deserialized MatchInfo object with most info dropped.
How would I get results that look similar to running Select-String locally?
This is the result of running sls on an svg in my home dir with the same context settings as an example:
  horizontalBlock.svg:30:     id="base"
> horizontalBlock.svg:31:     pagecolor="#ffffff"
  horizontalBlock.svg:32:     bordercolor="#666666"
  horizontalBlock.svg:33:     borderopacity="1.0"
  horizontalBlock.svg:34:     inkscape:pageopacity="0.0"
  horizontalBlock.svg:35:     inkscape:pageshadow="2"
  horizontalBlock.svg:36:     inkscape:zoom="1.3289991"

A: Pipe sls to Out-String:
Invoke-Command -Session $session {
  cd C:\LogDir\Log1
  sls -Pattern "ThingImLookingFor" -Path * -Context 1,5 | Out-String
}

A: For some reason, the custom format from the returned psobject appears blank.  Here's another workaround.
Invoke-Command -Session $session {
  cd C:\LogDir\Log1
  select-string -Pattern "ThingImLookingFor" -Path * -Context 1,5 | select line
}

Or
Invoke-Command -Session $session {
  cd C:\LogDir\Log1
  select-string -Pattern "ThingImLookingFor" -Path * -Context 1,5
} | select line, pscomputername


text:
Q: handling iOS crash report- EXC_CRASH (SIGSEGV) I've encountered a problem with my app, if I let it running for 24 hours, after returning to it, it crashes. It is a location based app and should work in background for unlimited time. As you can see, the crash occurred in some "native" thread. Is suggests some faulty memory access?
The crash report is:
Incident Identifier: 37244DF8-8792-4686-9FB4-867559F8B520
CrashReporter Key:   07002531b592d4c6d047876998efef8745326d1e
Hardware Model:      iPhone3,1
Process:         Freight Alerts [2659]
Path:            /var/mobile/Applications/1AF70899-D23F-43E4-9398-4F206CD01325/Freight Alerts.app/Freight Alerts
Identifier:      Freight Alerts
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2012-09-12 10:29:08.076 +0100
OS Version:      iPhone OS 5.1.1 (9B206)
Report Version:  104

Exception Type:  EXC_CRASH (SIGSEGV)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread:  1

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib          0x31301848 0x312f1000 + 67656
1   Freight Alerts                  0x0000c7f8 0x1000 + 47096
2   libsystem_c.dylib               0x33a097e6 0x339b2000 + 358374
3   UIKit                           0x30f78f0e 0x30e1c000 + 1429262
4   UIKit                           0x31171ac2 0x30e1c000 + 3496642
5   Foundation                      0x379bc92c 0x37921000 + 637228
6   CoreFoundation                  0x3711fa2c 0x37092000 + 580140
7   CoreFoundation                  0x3711f692 0x37092000 + 579218
8   CoreFoundation                  0x3711e268 0x37092000 + 574056
9   CoreFoundation                  0x370a149e 0x37092000 + 62622
10  CoreFoundation                  0x370a1366 0x37092000 + 62310
11  GraphicsServices                0x33860432 0x3385c000 + 17458
12  UIKit                           0x30e4dcce 0x30e1c000 + 203982
13  Freight Alerts                  -[SBJsonWriter appendString:into:] (in Freight Alerts) (SBJsonWriter.m:184)
14  Freight Alerts                  -[SBJsonWriter appendDictionary:into:] (in Freight Alerts) (SBJsonWriter.m:175)

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1 Crashed:
0   libsystem_kernel.dylib          0x312f23a8 0x312f1000 + 5032
1   libdispatch.dylib               0x30277ea4 0x3026b000 + 52900
2   libdispatch.dylib               0x30277bc2 0x3026b000 + 52162

Thread 2 name:  WebThread
Thread 2:
0   libsystem_kernel.dylib          0x312f2004 0x312f1000 + 4100
1   libsystem_kernel.dylib          0x312f21fa 0x312f1000 + 4602
2   CoreFoundation                  0x3711f3ec 0x37092000 + 578540
3   CoreFoundation                  0x3711e124 0x37092000 + 573732
4   CoreFoundation                  0x370a149e 0x37092000 + 62622
5   CoreFoundation                  0x370a1366 0x37092000 + 62310
6   WebCore                         0x32a4ac9c 0x329a1000 + 695452
7   libsystem_c.dylib               0x339c072e 0x339b2000 + 59182
8   libsystem_c.dylib               0x339c05e8 0x339b2000 + 58856

Thread 3 name:  com.apple.NSURLConnectionLoader
Thread 3:
0   libsystem_kernel.dylib          0x312f2004 0x312f1000 + 4100
1   libsystem_kernel.dylib          0x312f21fa 0x312f1000 + 4602
2   CoreFoundation                  0x3711f3ec 0x37092000 + 578540
3   CoreFoundation                  0x3711e124 0x37092000 + 573732
4   CoreFoundation                  0x370a149e 0x37092000 + 62622
5   CoreFoundation                  0x370a1366 0x37092000 + 62310
6   Foundation                      0x37931bb2 0x37921000 + 68530
7   Foundation                      0x37931a7a 0x37921000 + 68218
8   Foundation                      0x379c558a 0x37921000 + 673162
9   libsystem_c.dylib               0x339c072e 0x339b2000 + 59182
10  libsystem_c.dylib               0x339c05e8 0x339b2000 + 58856

Thread 4 name:  WebCore: CFNetwork Loader
Thread 4:
0   libsystem_kernel.dylib          0x312f2004 0x312f1000 + 4100
1   libsystem_kernel.dylib          0x312f21fa 0x312f1000 + 4602
2   CoreFoundation                  0x3711f3ec 0x37092000 + 578540
3   CoreFoundation                  0x3711e124 0x37092000 + 573732
4   CoreFoundation                  0x370a149e 0x37092000 + 62622
5   CoreFoundation                  0x370a1366 0x37092000 + 62310
6   WebCore                         0x32a740d2 0x329a1000 + 864466
7   libsystem_c.dylib               0x339c072e 0x339b2000 + 59182
8   libsystem_c.dylib               0x339c05e8 0x339b2000 + 58856

Thread 5 name:  com.apple.CFSocket.private
Thread 5:
0   libsystem_kernel.dylib          0x31302570 0x312f1000 + 71024
1   CoreFoundation                  0x3712363a 0x37092000 + 595514
2   libsystem_c.dylib               0x339c072e 0x339b2000 + 59182
3   libsystem_c.dylib               0x339c05e8 0x339b2000 + 58856

Thread 6:
0   libsystem_kernel.dylib          0x31302cd4 0x312f1000 + 72916
1   libsystem_c.dylib               0x339baf36 0x339b2000 + 36662
2   libsystem_c.dylib               0x339bacc8 0x339b2000 + 36040

Thread 1 crashed with ARM Thread State:
    r0: 0x00000004    r1: 0x00000000      r2: 0x00000000      r3: 0x2fe80630
    r4: 0x00000001    r5: 0x2fe8074c      r6: 0x2fe8074c      r7: 0x2fe8076c
    r8: 0x00000000    r9: 0x00000000     r10: 0x3e0b8060     r11: 0x00000000
    ip: 0x0000016b    sp: 0x2fe8061c      lr: 0x30277eab      pc: 0x312f23a8
  cpsr: 0x60000010

Binary Images:
    0x1000 -    0x1afff +Freight Alerts armv7  <6238e95d195a3818980dfcffdcbf9692> /var/mobile/Applications/1AF70899-D23F-43E4-9398-4F206CD01325/Freight Alerts.app/Freight Alerts
0x2fedf000 - 0x2ff00fff  dyld armv7  <77eddfd654df393ba9c95ff01715fd08> /usr/lib/dyld
0x30073000 - 0x300bffff  CoreTelephony armv7  <b8f80d5d594c31d2b5d8fba9fdedb7e1> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony
0x3026b000 - 0x30281fff  libdispatch.dylib armv7  <9ecfaef4110a3bf9a92d12f0fe8d1d78> /usr/lib/system/libdispatch.dylib
0x30282000 - 0x30298fff  DictionaryServices armv7  <6ed2e967136f37d4a4b9b318d6c43b83> /System/Library/PrivateFrameworks/DictionaryServices.framework/DictionaryServices
0x30299000 - 0x3029dfff  FTClientServices armv7  <21de970d7ebb3e7fb502a0a5451b0806> /System/Library/PrivateFrameworks/FTClientServices.framework/FTClientServices
0x302aa000 - 0x302b3fff  libMobileGestalt.dylib armv7  <4a15e845dc6f3a4a980de66c1cc44c42> /usr/lib/libMobileGestalt.dylib
0x30376000 - 0x30455fff  RawCamera armv7  <293f818ba6533dceae8b900b6ed3c887> /System/Library/CoreServices/RawCamera.bundle/RawCamera
0x30456000 - 0x30494fff  IOKit armv7  <fcda71d29d6136dfbd84c1725f4998e5> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x30495000 - 0x3049bfff  MobileIcons armv7  <ed1b46f917903c9b9baaa2be4392dafe> /System/Library/PrivateFrameworks/MobileIcons.framework/MobileIcons
0x304c2000 - 0x304d9fff  WebBookmarks armv7  <696bb0630b19388da0d72e685bcf6e28> /System/Library/PrivateFrameworks/WebBookmarks.framework/WebBookmarks
0x3050f000 - 0x3050ffff  libunwind.dylib armv7  <e0a73a57795f3e1698a52ebe6fc07005> /usr/lib/system/libunwind.dylib
0x30532000 - 0x30538fff  liblaunch.dylib armv7  <aa2bcba6fc7a36a191958fef2e995475> /usr/lib/system/liblaunch.dylib
0x3055d000 - 0x3055efff  libsystem_sandbox.dylib armv7  <6a8f2f33c7543808a0f4599101c3b61a> /usr/lib/system/libsystem_sandbox.dylib
0x30711000 - 0x30715fff  libAccessibility.dylib armv7  <9a17d07b5a3b38cfafdf16f78c99b572> /usr/lib/libAccessibility.dylib
0x30716000 - 0x30756fff  libGLImage.dylib armv7  <40448706190031f6b0d9636cc11ee81d> /System/Library/Frameworks/OpenGLES.framework/libGLImage.dylib
0x307c6000 - 0x30b35fff  TextInput armv7  <8d7f24642c7634cc8e3a6e65f1dcd98e> /System/Library/PrivateFrameworks/TextInput.framework/TextInput
0x30d3c000 - 0x30d5ffff  Bom armv7  <c3435ecd2e5839f89de51edad0e1bb00> /System/Library/PrivateFrameworks/Bom.framework/Bom
0x30d68000 - 0x30d7efff  libmis.dylib armv7  <258bc92be5823b239b4412dd42cb4807> /usr/lib/libmis.dylib
0x30db3000 - 0x30db4fff  libdyld.dylib armv7  <977b0ad6f2f433108b4a0324a57cd2ab> /usr/lib/system/libdyld.dylib
0x30db5000 - 0x30dcbfff  EAP8021X armv7  <952fcfdec0633aff923768fca1a26fcb> /System/Library/PrivateFrameworks/EAP8021X.framework/EAP8021X
0x30dce000 - 0x30dd1fff  libmacho.dylib armv7  <e52b77623bd031bc807e77029566c777> /usr/lib/system/libmacho.dylib
0x30ded000 - 0x30deefff  CoreSurface armv7  <97f871f09f503c98a6371c2b657430d8> /System/Library/PrivateFrameworks/CoreSurface.framework/CoreSurface
0x30df8000 - 0x30e1bfff  MobileSync armv7  <e42604c550283f4aa517ae8f108b340f> /System/Library/PrivateFrameworks/MobileSync.framework/MobileSync
0x30e1c000 - 0x312befff  UIKit armv7  <cd513a2f22f53d698c3e10f6fe48a63e> /System/Library/Frameworks/UIKit.framework/UIKit
0x312f1000 - 0x31307fff  libsystem_kernel.dylib armv7  <311f379a9fde305d80c1b22b7dd2e52a> /usr/lib/system/libsystem_kernel.dylib
0x31308000 - 0x3132cfff  PrintKit armv7  <08509c7bc915358b953de6f5cbef5c56> /System/Library/PrivateFrameworks/PrintKit.framework/PrintKit
0x313b2000 - 0x313edfff  libCGFreetype.A.dylib armv7  <55941c96cf1f3b048e72a148c4496c16> /System/Library/Frameworks/CoreGraphics.framework/Resources/libCGFreetype.A.dylib
0x313ee000 - 0x3141efff  ContentIndex armv7  <7a64670bb2ff3ee39ddee1dc1c72f92d> /System/Library/PrivateFrameworks/ContentIndex.framework/ContentIndex
0x3141f000 - 0x31477fff  CoreAudio armv7  <be335e8eb6f93594b028a6ddd503a183> /System/Library/Frameworks/CoreAudio.framework/CoreAudio
0x31478000 - 0x3147cfff  Marco armv7  <8dea3e558fe534ff868fc92e215ce53b> /System/Library/PrivateFrameworks/Marco.framework/Marco
0x31494000 - 0x314ddfff  AddressBook armv7  <b17a2962e9043e0385c3c2c652155f2b> /System/Library/Frameworks/AddressBook.framework/AddressBook
0x314e1000 - 0x314f9fff  Notes armv7  <724966ed5cd4395cb70f9c996b123f53> /System/Library/PrivateFrameworks/Notes.framework/Notes
0x314fc000 - 0x31506fff  libbz2.1.0.dylib armv7  <40e4045fb79e382b8833707746cf28b1> /usr/lib/libbz2.1.0.dylib
0x31507000 - 0x3152cfff  OpenCL armv7  <f4b08361179a3f6bb033415b0d7c6251> /System/Library/PrivateFrameworks/OpenCL.framework/OpenCL
0x31532000 - 0x31537fff  ApplePushService armv7  <f424c0340de637c08bbeb4f3bd8c6eaf> /System/Library/PrivateFrameworks/ApplePushService.framework/ApplePushService
0x31538000 - 0x31539fff  libdnsinfo.dylib armv7  <9aede8d6579d3430ac39ae5f95cce498> /usr/lib/system/libdnsinfo.dylib
0x3153a000 - 0x315aafff  CoreImage armv7  <86ac6f5a267637b6b7f8a831dfc7c64b> /System/Library/Frameworks/CoreImage.framework/CoreImage
0x315ab000 - 0x315f4fff  libc++.1.dylib armv7  <5b690e5dd5a43a7fb166ade9fe58a7a4> /usr/lib/libc++.1.dylib
0x315f5000 - 0x315f9fff  IOMobileFramebuffer armv7  <42dbc26828e934acabb4f3b0a35d8250> /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/IOMobileFramebuffer
0x316e1000 - 0x316edfff  libCRFSuite.dylib armv7  <bdb2b4d1a78c39c1ba60d791207aed2a> /usr/lib/libCRFSuite.dylib
0x316ee000 - 0x3176dfff  libsqlite3.dylib armv7  <bf01f5ed47b033d8bde30d735ff44416> /usr/lib/libsqlite3.dylib
0x3187b000 - 0x3187ffff  CertUI armv7  <f503892ef60e36108d28d8f9d6144d2a> /System/Library/PrivateFrameworks/CertUI.framework/CertUI
0x31880000 - 0x318bffff  QuickLook armv7  <802b1092542a3017a0380632502610d4> /System/Library/Frameworks/QuickLook.framework/QuickLook
0x3193d000 - 0x31943fff  MobileKeyBag armv7  <e1f06241ef0e3f0aae00f15df572077e> /System/Library/PrivateFrameworks/MobileKeyBag.framework/MobileKeyBag
0x31944000 - 0x31995fff  CoreText armv7  <5bfac4ee88d03d5b87a1f105abb7756c> /System/Library/Frameworks/CoreText.framework/CoreText
0x31996000 - 0x3199afff  AggregateDictionary armv7  <3a3a33f3a05538988c6e2bb363dc46a8> /System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary
0x319e9000 - 0x319f8fff  MobileDeviceLink armv7  <70ac33720f513f0f97ea2279260678ca> /System/Library/PrivateFrameworks/MobileDeviceLink.framework/MobileDeviceLink
0x319f9000 - 0x31a08fff  OpenGLES armv7  <e80acc691001301e96101bb89d940033> /System/Library/Frameworks/OpenGLES.framework/OpenGLES
0x31a32000 - 0x31a38fff  liblockdown.dylib armv7  <9e45ce468a6f31e5b8263f2c224aa800> /usr/lib/liblockdown.dylib
0x3227a000 - 0x3227ffff  CrashReporterSupport armv7  <dc11c5c2cbe73a6288a6094ebf5de673> /System/Library/PrivateFrameworks/CrashReporterSupport.framework/CrashReporterSupport
0x3244d000 - 0x3244dfff  libkeymgr.dylib armv7  <ebd2dddf55d83cf48a18913968775960> /usr/lib/system/libkeymgr.dylib
0x327e8000 - 0x327e9fff  DataMigration armv7  <d77f0e8f39ee37f5a2ac713a3fd9e693> /System/Library/PrivateFrameworks/DataMigration.framework/DataMigration
0x32874000 - 0x32883fff  SpringBoardServices armv7  <a2363f8ed49932dba415d2d4cd32fb74> /System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices
0x3293f000 - 0x32976fff  Security armv7  <eea56f71fde83c2981f9281dc7823725> /System/Library/Frameworks/Security.framework/Security
0x3297b000 - 0x3298efff  DataDetectorsCore armv7  <3f4596cbe1b13fdcb427d87de21df3f6> /System/Library/PrivateFrameworks/DataDetectorsCore.framework/DataDetectorsCore
0x3299a000 - 0x3299dfff  CoreTime armv7  <a398de5ba1e43a11b7008e9bb5a7f6fe> /System/Library/PrivateFrameworks/CoreTime.framework/CoreTime
0x329a1000 - 0x33160fff  WebCore armv7  <2690c38c9c5f3c09975d619dd1dfbed7> /System/Library/PrivateFrameworks/WebCore.framework/WebCore
0x33163000 - 0x331adfff  ManagedConfiguration armv7  <f1fbb825def23043830a095b953a9c94> /System/Library/PrivateFrameworks/ManagedConfiguration.framework/ManagedConfiguration
0x331ae000 - 0x331c3fff  libresolv.9.dylib armv7  <66f7557fa4b43979b186e00271839fdb> /usr/lib/libresolv.9.dylib
0x33279000 - 0x33298fff  libSystem.B.dylib armv7  <0c55744b6f7335eebba4ca2c3d10b43c> /usr/lib/libSystem.B.dylib
0x33299000 - 0x3329cfff  libcompiler_rt.dylib armv7  <b2c05d8601c13be884097192dca4e187> /usr/lib/system/libcompiler_rt.dylib
0x3329d000 - 0x332a0fff  CaptiveNetwork armv7  <f5cc4b97ce9432da9426f12621453325> /System/Library/PrivateFrameworks/CaptiveNetwork.framework/CaptiveNetwork
0x332b4000 - 0x33311fff  StoreServices armv7  <6ce256d3cf433e4aa1af8d696bf1f75d> /System/Library/PrivateFrameworks/StoreServices.framework/StoreServices
0x335ac000 - 0x33684fff  vImage armv7  <caf3648be2933384b6aa1ae7408ab4f0> /System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/vImage
0x336f6000 - 0x33733fff  FTServices armv7  <3f23418319a03a589dd5cac7df20e238> /System/Library/PrivateFrameworks/FTServices.framework/FTServices
0x33819000 - 0x3384dfff  MIME armv7  <d30292ea8f7e360fa5f5d5b1b62b602d> /System/Library/PrivateFrameworks/MIME.framework/MIME
0x3385c000 - 0x33866fff  GraphicsServices armv7  <cb64e146a8ee3fda9e80ffae1ccc9c5a> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x3386e000 - 0x338a6fff  VideoToolbox armv7  <9f25f38d1cd13a1daff99cfde8884410> /System/Library/PrivateFrameworks/VideoToolbox.framework/VideoToolbox
0x338a7000 - 0x33900fff  IMAVCore armv7  <ce90304da959333d81a64171a6ac3ae8> /System/Library/PrivateFrameworks/IMAVCore.framework/IMAVCore
0x33901000 - 0x33909fff  MobileWiFi armv7  <b76c3e9fb78234c392058250d4620e72> /System/Library/PrivateFrameworks/MobileWiFi.framework/MobileWiFi
0x33928000 - 0x33964fff  iCalendar armv7  <f2836083051132d3aa40ad82d7f73aea> /System/Library/PrivateFrameworks/iCalendar.framework/iCalendar
0x339b2000 - 0x33a3efff  libsystem_c.dylib armv7  <f859ce1ad1773f0ba98d7c6e135b7697> /usr/lib/system/libsystem_c.dylib
0x33a4c000 - 0x33a4efff  MobileInstallation armv7  <215d93dbb0f63cbf828f9126eb7b5349> /System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation
0x33a59000 - 0x33a65fff  CoreVideo armv7  <364fa32d513f3c11b50970120545f1a8> /System/Library/Frameworks/CoreVideo.framework/CoreVideo
0x33a66000 - 0x33ac9fff  IMCore armv7  <046b6b615a743057b59d4aaba8a91d61> /System/Library/PrivateFrameworks/IMCore.framework/IMCore
0x33aca000 - 0x33acbfff  libsystem_blocks.dylib armv7  <9fdc27af7350323bbc7d98e14e027907> /usr/lib/system/libsystem_blocks.dylib
0x33ae7000 - 0x33ae8fff  libremovefile.dylib armv7  <402f8956975d3b6fb86ab9b31a43242c> /usr/lib/system/libremovefile.dylib
0x33ae9000 - 0x33b93fff  libBLAS.dylib armv7  <bf822cc1a3243ae7b104cf73ca22d352> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBLAS.dylib
0x33f57000 - 0x33f5bfff  libcache.dylib armv7  <d6a7436ed8dc33d795c9b42baf864882> /usr/lib/system/libcache.dylib
0x33f5c000 - 0x34009fff  libxml2.2.dylib armv7  <58d47f064e0232119f4b838ad659f9c1> /usr/lib/libxml2.2.dylib
0x3400a000 - 0x342cbfff  libLAPACK.dylib armv7  <0e94e9a7e7a334649afaccae0f1215a2> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLAPACK.dylib
0x34319000 - 0x344d6fff  ImageIO armv7  <02e3578171fa3b6a969b244275fd2bab> /System/Library/Frameworks/ImageIO.framework/ImageIO
0x344d7000 - 0x34500fff  AppleAccount armv7  <2ba44023410231fcb3f72f762ea3ce6e> /System/Library/PrivateFrameworks/AppleAccount.framework/AppleAccount
0x346a6000 - 0x346c6fff  libxslt.1.dylib armv7  <39348471007e39dab80af68b08390456> /usr/lib/libxslt.1.dylib
0x346d8000 - 0x346eefff  VoiceServices armv7  <c5b98e94eff33bf49006ff157c819987> /System/Library/PrivateFrameworks/VoiceServices.framework/VoiceServices
0x34835000 - 0x34839fff  IOSurface armv7  <443ac3aab9283da480dd9dcda3c5c88e> /System/Library/PrivateFrameworks/IOSurface.framework/IOSurface
0x3484b000 - 0x3484bfff  Accelerate armv7  <55b24cf91a8b3532bde6733c96f14c08> /System/Library/Frameworks/Accelerate.framework/Accelerate
0x3484c000 - 0x3485dfff  libxpc.dylib armv7  <ccf25b1e49ce3b2fa58d8c8546755505> /usr/lib/system/libxpc.dylib
0x3487e000 - 0x349c7fff  libicucore.A.dylib armv7  <b70646b63f1f3b33896dd8cb91b8dab1> /usr/lib/libicucore.A.dylib
0x34b9c000 - 0x34ce1fff  CoreGraphics armv7  <903545b89a7f311d95100ac7d1d44709> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
0x34d39000 - 0x34d3dfff  libGFXShared.dylib armv7  <998fccc16cf735dbb62324202995e193> /System/Library/Frameworks/OpenGLES.framework/libGFXShared.dylib
0x34d88000 - 0x34d8ffff  MailServices armv7  <ab2388ce733e38b7a261273a401bbbf1> /System/Library/PrivateFrameworks/MailServices.framework/MailServices
0x34db7000 - 0x34e01fff  libvDSP.dylib armv7  <441b42aca07b3da39feab25f8349918f> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvDSP.dylib
0x34e02000 - 0x34e46fff  MobileCoreServices armv7  <757226927a873d5492be721908077b48> /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
0x34e47000 - 0x34f0dfff  libobjc.A.dylib armv7  <90014d1bc583366d85622e43097df416> /usr/lib/libobjc.A.dylib
0x34f17000 - 0x34f4cfff  SystemConfiguration armv7  <4464a4e3bb3f32f7abaa35ebf31fda49> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
0x3503e000 - 0x35040fff  libCoreFSCache.dylib armv7  <808518e0fbf539af8489f028ca5198c7> /System/Library/Frameworks/OpenGLES.framework/libCoreFSCache.dylib
0x35042000 - 0x35047fff  libcopyfile.dylib armv7  <52e874396c393ed29099789ce702cfe2> /usr/lib/system/libcopyfile.dylib
0x3504a000 - 0x3504ffff  libGPUSupportMercury.dylib armv7  <3c1cc3175c403ace8fcbd3826bd43807> /System/Library/PrivateFrameworks/GPUSupport.framework/libGPUSupportMercury.dylib
0x3509f000 - 0x350b2fff  AssistantServices armv7  <4a0843742f363a8885b8db13b44ae256> /System/Library/PrivateFrameworks/AssistantServices.framework/AssistantServices
0x350de000 - 0x3530bfff  MediaToolbox armv7  <c3098478486032c6aff336fa711c4fc6> /System/Library/PrivateFrameworks/MediaToolbox.framework/MediaToolbox
0x3530c000 - 0x353dbfff  libGLProgrammability.dylib armv7  <49607ffe4ee9389494285a213e392924> /System/Library/Frameworks/OpenGLES.framework/libGLProgrammability.dylib
0x353e7000 - 0x3550cfff  JavaScriptCore armv7  <2ffc6c87b94434288366bd53765ee267> /System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore
0x35549000 - 0x35637fff  libiconv.2.dylib armv7  <2cfefe2ad1d335dd9549562910e7a2e2> /usr/lib/libiconv.2.dylib
0x3563b000 - 0x35643fff  ProtocolBuffer armv7  <0e846afacf823d2b8c029cc3010a8253> /System/Library/PrivateFrameworks/ProtocolBuffer.framework/ProtocolBuffer
0x35644000 - 0x35714fff  WebKit armv7  <3c5dd2ec46fe3e189c25bba78ad88fa1> /System/Library/PrivateFrameworks/WebKit.framework/WebKit
0x35715000 - 0x35874fff  libmecabra.dylib armv7  <06a0a1ee488030169bdfab11fc8d2c5c> /usr/lib/libmecabra.dylib
0x358a5000 - 0x3591efff  ProofReader armv7  <6db611d8df6530d480f97a40bc519f70> /System/Library/PrivateFrameworks/ProofReader.framework/ProofReader
0x35920000 - 0x35926fff  libnotify.dylib armv7  <9406297de3e43742887890662a87ab53> /usr/lib/system/libnotify.dylib
0x35930000 - 0x35932fff  libCoreVMClient.dylib armv7  <d4d4aa3090c83e87bcb15ed00b93fd5c> /System/Library/Frameworks/OpenGLES.framework/libCoreVMClient.dylib
0x35ccb000 - 0x35d00fff  DataAccess armv7  <89fd0c22338b37538cf61803a0bca9e2> /System/Library/PrivateFrameworks/DataAccess.framework/DataAccess
0x35db9000 - 0x35dd6fff  libsystem_info.dylib armv7  <50863bcbf478323e96a8e5b1a83ea6f9> /usr/lib/system/libsystem_info.dylib
0x35ee5000 - 0x35f21fff  AppSupport armv7  <311eac85b2a433a884dacba77217b49e> /System/Library/PrivateFrameworks/AppSupport.framework/AppSupport
0x35f22000 - 0x36466fff  FaceCoreLight armv7  <f326d88709683520b251dc53cb847c11> /System/Library/PrivateFrameworks/FaceCoreLight.framework/FaceCoreLight
0x36467000 - 0x364b8fff  libstdc++.6.dylib armv7  <c352af5a742e3c7a8d4d7e5f6f454793> /usr/lib/libstdc++.6.dylib
0x364c5000 - 0x364d0fff  AccountSettings armv7  <373e59421d983c93931cfbad87b1ae35> /System/Library/PrivateFrameworks/AccountSettings.framework/AccountSettings
0x364d1000 - 0x36577fff  AddressBookUI armv7  <da424fecc66e3628ab03378ae80b38fc> /System/Library/Frameworks/AddressBookUI.framework/AddressBookUI
0x36582000 - 0x36594fff  DataDetectorsUI armv7  <50ea319aaeb7307e92719980dd4b2953> /System/Library/PrivateFrameworks/DataDetectorsUI.framework/DataDetectorsUI
0x36596000 - 0x365defff  CoreMedia armv7  <e274e1b894753b2eb05cf7b22a36d0c1> /System/Library/Frameworks/CoreMedia.framework/CoreMedia
0x3660a000 - 0x367eefff  AudioToolbox armv7  <c91e27850452330ea804db6408840fd2> /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
0x367f2000 - 0x367f5fff  NetworkStatistics armv7  <7848d8ebad99367cb4f7f4e3fe88e5d6> /System/Library/PrivateFrameworks/NetworkStatistics.framework/NetworkStatistics
0x367f6000 - 0x36844fff  CoreLocation armv7  <44550ebedf23334d85441d9743b74e03> /System/Library/Frameworks/CoreLocation.framework/CoreLocation
0x36879000 - 0x3687efff  libsystem_dnssd.dylib armv7  <27bb5462450732e380f5a2c170546e93> /usr/lib/system/libsystem_dnssd.dylib
0x3687f000 - 0x36886fff  libc++abi.dylib armv7  <bab4dcbfc5943d3fbb637342d35e8045> /usr/lib/libc++abi.dylib
0x36887000 - 0x36a2dfff  CoreData armv7  <b0215b6d4d143859a2b313ecade095ec> /System/Library/Frameworks/CoreData.framework/CoreData
0x36bcb000 - 0x36bd5fff  libvMisc.dylib armv7  <e8248c797b9b363594bb652ddf7ce16d> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvMisc.dylib
0x36be1000 - 0x36c0dfff  libtidy.A.dylib armv7  <3aacc5b650e037c086a8ff6657d154bf> /usr/lib/libtidy.A.dylib
0x36c0e000 - 0x36c0efff  vecLib armv7  <a2cfe25e77aa36bfb4a30b2d0d2dd465> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vecLib
0x36c1d000 - 0x36c2efff  DataAccessExpress armv7  <e6144ba265da3bb7b9a263aa1a29b054> /System/Library/PrivateFrameworks/DataAccessExpress.framework/DataAccessExpress
0x36c52000 - 0x36d21fff  IMGSGX535GLDriver armv7  <fe4f330b9a433322844a0d87410b68f7> /System/Library/Extensions/IMGSGX535GLDriver.bundle/IMGSGX535GLDriver
0x36d7b000 - 0x36dc0fff  GeoServices armv7  <a26be2e76e8730ab91a16502aba376be> /System/Library/PrivateFrameworks/GeoServices.framework/GeoServices
0x36dd4000 - 0x36eabfff  CFNetwork armv7  <765a472c824830eea91b8f02d12867e4> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x36edb000 - 0x36edbfff  liblangid.dylib armv7  <644ff4bcfbf337b5b5859e3f0fc0a9a8> /usr/lib/liblangid.dylib
0x36edc000 - 0x36edcfff  libgcc_s.1.dylib armv7  <eb82984fa36c329387aa518aa5205f3d> /usr/lib/libgcc_s.1.dylib
0x36edd000 - 0x36f76fff  EventKit armv7  <d67aa1508ee7306b8e2a45c76ffddff0> /System/Library/Frameworks/EventKit.framework/EventKit
0x3701e000 - 0x3702afff  libz.1.dylib armv7  <36ce86a3dc8c344596c8c325615f374b> /usr/lib/libz.1.dylib
0x37092000 - 0x371a9fff  CoreFoundation armv7  <6d450fe923d7387f8b01845e0edd713d> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x371c8000 - 0x371cffff  AssetsLibraryServices armv7  <38132ecfd74b325fb1a4142bab663c19> /System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices
0x3726a000 - 0x3735bfff  QuartzCore armv7  <35d64a9da5523ae08c9e41511fd3061b> /System/Library/Frameworks/QuartzCore.framework/QuartzCore
0x3735c000 - 0x3741efff  Celestial armv7  <19617260ee073e23b95e456d93930aea> /System/Library/PrivateFrameworks/Celestial.framework/Celestial
0x3741f000 - 0x37438fff  libRIP.A.dylib armv7  <1828cddc5dd93c61afbefb59587d7f8a> /System/Library/Frameworks/CoreGraphics.framework/Resources/libRIP.A.dylib
0x37443000 - 0x374f1fff  Message armv7  <573d0118246d3d9d8aed17e7ee2faec7> /System/Library/PrivateFrameworks/Message.framework/Message
0x37511000 - 0x37597fff  CoreMotion armv7  <6a9355d5a8e238b5b8f193605d509e15> /System/Library/Frameworks/CoreMotion.framework/CoreMotion
0x375b6000 - 0x3762afff  MediaControlSender armv7  <87315c54b2293ab589950341ff91b45d> /System/Library/PrivateFrameworks/MediaControlSender.framework/MediaControlSender
0x3762b000 - 0x3768ffff  MessageUI armv7  <da7af4f9494b35558bf7892dfdb36ee3> /System/Library/Frameworks/MessageUI.framework/MessageUI
0x37690000 - 0x376a4fff  PersistentConnection armv7  <54091a638f8731cd85ccf00fa06972c3> /System/Library/PrivateFrameworks/PersistentConnection.framework/PersistentConnection
0x376c0000 - 0x376c3fff  libsystem_network.dylib armv7  <356cb66612e836968ef24e6e5c3364cc> /usr/lib/system/libsystem_network.dylib
0x376c6000 - 0x37709fff  libcommonCrypto.dylib armv7  <95b49daf4cf038b6bea8010bba3a1e26> /usr/lib/system/libcommonCrypto.dylib
0x3770a000 - 0x37719fff  GenerationalStorage armv7  <d84c3fd0e7bd36e78c256f2f4c5a4e91> /System/Library/PrivateFrameworks/GenerationalStorage.framework/GenerationalStorage
0x3771b000 - 0x3771bfff  libCVMSPluginSupport.dylib armv7  <a80aaa9989483ce3a496a061fd1e9e0a> /System/Library/Frameworks/OpenGLES.framework/libCVMSPluginSupport.dylib
0x3771c000 - 0x37758fff  IMFoundation armv7  <253125b9103c3d13b66923ac6893c25b> /System/Library/PrivateFrameworks/IMCore.framework/Frameworks/IMFoundation.framework/IMFoundation
0x37769000 - 0x3776cfff  ActorKit armv7  <434c756a6b053f4ba3c954cfccddbf59> /System/Library/PrivateFrameworks/ActorKit.framework/ActorKit
0x3776d000 - 0x37833fff  GLEngine armv7  <6617f2b4ee283469a5595129889ff049> /System/Library/Frameworks/OpenGLES.framework/GLEngine.bundle/GLEngine
0x37834000 - 0x37841fff  libbsm.0.dylib armv7  <750a0de73a733019a77144b805d4d2f8> /usr/lib/libbsm.0.dylib
0x37921000 - 0x37a9ffff  Foundation armv7  <c40ddb073142315bb4ebb214343d0b7f> /System/Library/Frameworks/Foundation.framework/Foundation

Thanks,
Alex.

A: Probably a memory error. I suppose that the system thread is trying to call a delegate method but the delegate does not exist anymore.


text:
Q: Android first row not selected using setSelection(0) method after multiple try's, i'm using "mListView.setSelection(0);" to select the first row in my ListView when the list appears. But dunno why its not working. So how can I let the first row always clicked? Because in my application i have a listview on left side and a webview on right side. So i need that when my app launchs, the first row always selected so the webview loads the details of the first element per default. The data of the listView are loaded using a cursor Adapter that communicates with an SQLite Database.
This is a part of my code :
code

A: Try setting up an OnGlobalLayoutListener to your ViewTreeObserver, which sets the selection as soon as the layout is set. (Remember to remove the listener as soon as it's called the first time to avoid repeated calls.)
Check the android sources whether setSelection(int) handles unpopulated lists right.

A: You can try using smoothScrollToPosition(int position) it should work for you.
mListView.smoothScrollToPosition(0);


text:
Q: Debian Jessie FSTAB Automount network problem Ok I made a reinstallation of my Debian 8 Jessie last night and my home Directory wasn't erased (don't know if any confs might interfere on this).
So I have a Network CIFS share I want to Automount. Everything is configured on the server side (I was able to do this connection two days ago and nothing changed on the server side)
Ok So I don't remember what configuration was the one I made in my /etc/fstab before when it was working, but I'm trying all guides on the net and I can't seem to find a solution to mount this at startup.
Here is my FSTAB conf:
//192.168.1.105/Media      /media/xxxxxx/Media     cifs     user,auto,username=xxxxxxx,password=xxxxxxx     0     0

I've changed every sensitive info with an "X" here for obvious reasons but the path and login data match the servers!
I've tried creating a credential file as well but I remember last time it worked it was with these configurations. I want to be able to unmount at anytime that's why I'm putting user on the line here.
My outputs are different depending the configuration. Right now, with this conf, I get this output:
mount error(22): Invalid argument Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

Oh my network CIFS share has this particular share with NTFS, don't know if counts.
Don't remember if last time I added a Mask or an ID or Filetype or any other configuration that made it work.

A: Ok I did some tests and aparently two things made it work.

*

*I've changed the IP to the name of the machine (media.local in my case)

*Added File_mode and Dir_mode to it

Here what became of my /etc/fstab config line:
//media.local/Media     /media/xxxxxxxxxxxxx/Media     cifs     defaults,user,file_mode=0777,dir_mode=0777,auto,username=xxxxxxxx,password=xxxxxxx     0     0

I don't know why it worked with the name of the machine instead of the IP or why the File_Mode and File_Dir made a difference... But there you go... That was the solution!


text:
Q: How to ignore other instances of a word when looping it via pandas.groupby.agg? I have a code (see below) that I used to match word occurrences per Location. My problem is that it reads all instances of the word.
FOR EXAMPLE: This is what I was hoping it to do, but the code below counted all occurrences of 'help' including 'helping' and 'helped'
      tidytext2                  |  Location    |    occurrences
she used to help me              |     Aus      |        1
help is on the way               |     UK       |        1
Helping is a kind gift           |     UK       |        0
She helped me when I needed it   |     Japan    |        0
Why dont u help me?              |     SA       |        1
Help me! Im hungry help          |     Rwanda   |        2

words = [i[0] for i in pos_freq.most_common()]

for i in words:
    positivedf[i] = positivedf.tidytext2.str.count(i)

funs = {i: 'sum' for i in words}
groupedpos = positivedf.groupby('Location').agg(funs)

I got positive_freq.most_common() using the following codes. It returns
import nltk
from nltk.tokenize import TweetTokenizer
from nltk.corpus import stopwords
import string
def process_text(text):
    tokens = []
    for line in text:
        toks = tokenizer.tokenize(line)
        toks = [t.lower() for t in toks if t.lower() not in stopwords_list]
        tokens.extend(toks)

    return tokens

tokenizer=TweetTokenizer()
punct = list(string.punctuation)
stopwords_list = stopwords.words('english') + punct
pos_lines = list(positivedf.tidytext2)
pos_tokens = process_text(pos_lines)
pos_freq = nltk.FreqDist(pos_tokens)
pos_freq.most_common()
[('help', 7)]

A: You need to use regex for this:
for i in words:
    positivedf[i] = positivedf.tidytext2.str.count(r'(?<!\S)'+i+'(?!\S)')

If you want to be case insensitive:
for i in words:
        positivedf[i] = positivedf.tidytext2.str.count(r'(?i)(?<!\S)'+i+'(?!\S)')


text:
Q: Numerical integration error using Scipy.integrate I am trying to carry out the following integration. The code starts giving error when the value of k exceeds 4 and the value of Tc exceeds 300. The error message is shown at the bottom of the code. I carried out some trials and found that the multipliers 2 and 0.5 in the statements below respectively are creating some error. Was looking for a fix for this issue.
B = (2 * (Ro ** 2 - ((Ro - a) ** 2))) ** 0.5
return [0, ((a - Ro) + ((Ro ** 2 - 0.5 * (z ** 2))) ** 0.5)]

import numpy as np
import scipy
from scipy import integrate
from scipy.integrate import nquad

Ro = 0.01
rat = 1
Ess = 207.8e9
k = 10
Tc = 900
Tm = 300

Ri = 0
a = rat * Ro

B = (2 * (Ro ** 2 - ((Ro - a) ** 2))) ** 0.5

def Cc55(y, z):
    R = (y ** 2 + z ** 2) ** 0.5
    Kc = 1.7 * (1 + 1.276 * (10 ** (-4)) * Tc + 6.648 * (10 ** (-8)) * (Tc ** 2))
    Km = 15.379 * (
        1
        - 1.264 * (10 ** (-3)) * Tm
        + 2.092 * (10 ** (-6)) * (Tm ** 2)
        - 7.223 * (10 ** (-10)) * (Tm ** 3)
    )
    a = (Kc - Km) / Km
    C = (
        1
        - (a / (k + 1))
        + (a ** 2 / (2 * k + 1))
        - (a ** 3 / (3 * k + 1))
        + (a ** 4 / (4 * k + 1))
        - (a ** 5 / (5 * k + 1))
    )
    d1 = (R - Ri) / (Ro - Ri)
    D = (
        d1
        - ((a * (d1 ** (k + 1))) / (k + 1))
        + (((a ** 2) * (d1 ** (2 * k + 1))) / ((2 * k) + 1))
        - (((a ** 3) * (d1 ** (3 * k + 1))) / ((3 * k) + 1))
        + (((a ** 4) * (d1 ** (4 * k + 1))) / ((4 * k) + 1))
        - (((a ** 5) * (d1 ** (5 * k + 1))) / ((5 * k) + 1))
    )
    b = D / C
    T = Tm + (Tc - Tm) * (b)
    EmT = (201.04 * (10) ** 9) * (
        1 + (3.079 * (10 ** (-4)) * T) - (6.534 * (10 ** (-7)) * (T ** 2))
    )

    EcT = (244.27 * (10) ** 9) * (
        1
        - (1.371 * (10 ** (-3)) * T)
        + (1.214 * (10 ** (-6)) * (T ** 2))
        - (3.681 * (10 ** (-10)) * (T ** 3))
    )
    VcT = (0.2882) * (1 + (1.133 * (10 ** (-4)) * T))

    VmT = (0.3262) * (
        1 - (2.002 * (10 ** (-4)) * T) + (3.797 * (10 ** (-7)) * (T ** 2))
    )
    Efg = (EcT - EmT) * ((d1) ** k) + EmT  # ((1.68e11-2.078e11)*((d1)**k) + 2.078e11)

    Vfg = (VcT - VmT) * ((d1) ** k) + VmT

    H = (4 * (Ro ** 2) - 2 * (z ** 2)) ** (0.5)

    L = (np.pi * y) / (2 * H)
    T = (y) / H
    M = (np.tan(L)) / L
    N1 = (1 - np.sin(L)) ** 4
    P = np.cos(L)
    F2 = ((M ** (0.5)) * (0.923 + 0.199 * (N1))) / P
    Q = Ro ** 2 - z ** 2
    S = (Ess) / (((Ro) ** 5) * Efg)

    return (16 * ((2) ** 0.5) * y * Q * (F2 ** 2)) * S

def bounds_z():
    return [0, B]

def bounds_y(z):
    return [0, ((a - Ro) + ((Ro ** 2 - 0.5 * (z ** 2))) ** 0.5)]

x4 = nquad(Cc55, [bounds_y, bounds_z])
print(x4[0])

C:\Users\arnab\Anaconda3\lib\site-packages\scipy\integrate\quadpack.py:385: IntegrationWarning: The maximum number of subdivisions (50) has been achieved.
  If increasing the limit yields no improvement it is advised to analyze
  the integrand in order to determine the difficulties.  If the position of a
  local difficulty can be determined (singularity, discontinuity) one will
  probably gain from splitting up the interval and calling the integrator
  on the subranges.  Perhaps a special-purpose integrator should be used.
  warnings.warn(msg, IntegrationWarning)
C:\Users\arnab\Anaconda3\lib\site-packages\scipy\integrate\quadpack.py:385: IntegrationWarning: The integral is probably divergent, or slowly convergent.
  warnings.warn(msg, IntegrationWarning)
C:\Users\arnab\Anaconda3\lib\site-packages\scipy\integrate\quadpack.py:385: IntegrationWarning: The algorithm does not converge.  Roundoff error is detected
  in the extrapolation table.  It is assumed that the requested tolerance
  cannot be achieved, and that the returned result (if full_output = 1) is
  the best which can be obtained.
  warnings.warn(msg, IntegrationWarning)


text:
Q: How to select a date range based on another value I have a table with identifiers, dates and a validity bit.
ID | Date       |  SalesID | InValid
   |            |          |
1  | 2013-08-01 |    2     |  False
2  | 2013-08-01 |    3     |  False
3  | 2013-08-01 |    4     |  False
4  | 2013-08-01 |    5     |  False
5  | 2013-08-02 |    2     |  False
6  | 2013-08-02 |    3     |  False
7  | 2013-08-03 |    2     |  True
8  | 2013-08-03 |    3     |  False
9  | 2013-08-03 |    4     |  False

the ID is a unique number
there will be only one date entry per SalesID
My question is how can I pick out the ID number for any SalesID that has had an Invalid = true in the past 30 days.
so for SalesID = 2 , I want plus any other dates that fall within the 30 previous days
ID | Date       |  SalesID | InValid
   |            |          |
1  | 2013-08-01 |    2     |  False
5  | 2013-08-02 |    2     |  False
7  | 2013-08-03 |    2     |  True

I hope this makes sense. any help would be welcome
Thanks guys, really quick assistance, I still have much to learn. I am in your debt

A: I think this is what you need:
SELECT DISTINCT a.*
FROM table a
JOIN table b ON
  b.SalesID=a.SalesID AND
  b.InValid           AND
  a.Date >= b.Date-30 AND
  a.Date <= b.Date

Beware... the date math may depend a bit on the SQL engine you are using, and on the actual data type of the date column.


text:
Q: Is there way to get a callback after StreamBuilder completely load? I'm trying get a callback after my context build, i already tried with "WidgetsBinding.instance!.addPostFrameCallback", but not works because i have a StreamBuilder and the first load of snapshot data it is null.
I expected exists a callback of StreamBuilder after data completely load and build loaded, here is my code:
StreamBuilder(
  stream: this.paymentInfoFormPresenter.key,
  builder: (context, snapshot) {
    final _formKey = snapshot.data;

    if (_formKey == null) {
      return Container();
    }

    return Text('example');
  }
);

And i don't find anything about on internet... i hope someone can help me.

A: To resolve this issue, i needed change the "Text('example')" to an external widget, and added "WidgetsBinding.instance!.addPostFrameCallback" inside of this external widget


text:
Q: set jquery datepicker date by using jquery i am setting the datepicker date and trying to show the datepicker by the following way
    $('.shw-dt').datepicker({
        dateFormat : "mm/dd/yyyy",
        setDate :"09/19/2014"
    });

But datepicker is always showing todays date. Looks like the value is not set which i am trying to set. Any ideas

A: setDate() is a function so you need to use
$('.shw-dt').datepicker({
    dateFormat: "mm/dd/yy"
}).datepicker('setDate', "09/19/2014");

Demo: Fiddle

A: Set your datePicker date using setdate function.
$('#dateselector').datepicker("setDate", new Date(2014,1,01) );

You should look into documentation of DatePicker first.


text:
Q: opencv - TypeError: Cannot read property 'length' of undefined I recently installed opencv and executed npm install.
After doing that, I was given some sample code to see if it works, but it does not work, and I don't know why. Maybe I installed it incorrectly, I am a newbie to this. Here is the code:
cv.readImage("./examples/files/mona.png", function(err, im){
  im.detectObject(cv.FACE_CASCADE, {}, function(err, faces){
    for (var i=0;i<faces.length; i++){
      var x = faces[i]
      im.ellipse(x.x + x.width/2, x.y + x.height/2, x.width/2, x.height/2);
    }
    im.save('./out.jpg');
  });
})

A: You should install it by "npm install opencv --save" But since there is no dependency issue so you installed it right. Try doing console.log(faces) because it is giving null as result in faces that's why length is undefined.
Also make sure the image at that path you are giving "./examples/files/mona.png" do exist.


text:
Q: Installing extensions of a program that is installed twice I have Python installed twice in my computer. The python.exe file is located once under C:\Python34 and again under C:\Anaconda3.
The first was installed through the standard Python installation, while the second through the Anaconda package which has the same standard Python plus some extra extensions. Both Python versions are 3.4.4.
Now, I was trying to install a Python library/extension (e.g. facebook library). This can be done by typing this in the command line:
pip install facebook

The pip keyword is a Python module that simplifies the installation of external libraries. In my case this installs the facebook library only for the standard Python, not for the Anaconda Python.
What I would like instead is to install the library for the Anaconda Python. I can tell because the facebook library is being created under C:\Python34\Lib\site-packages, but not under C:\Anaconda3\Lib\site-packages.
So, why is the library choosing the first Python, and ignoring the second? And, how can I control this behavior?
EDIT: Maybe it's worth mentioning that both C:\Python34 and C:\Anaconda3 are included in the Path environment variables. C:\Python34 comes first, and then C:\Anaconda3, but I also tried to put C:\Anaconda3 first, and then C:\Python34 and tried the installation again. However, the library was again installed in the standard Python.
Also, pip is installed in both Pythons.

A:
So, why is the library choosing the first Python, and ignoring the second?

Most likely because C:\Python34 precedes C:\Anaconda3 in your PATH.

And, how can I control this behavior?

Invoke Anaconda's pip, which should be located in C:\Anaconda3\Scripts.


text:
Q: $A_k\subset\mathbb{R}$ such that $\lim\sup A_k=\mathbb{R}$ but $\lambda(A_k)=1$ (Lebesgue measure) for all $k$. Construct a sequence of measurable sets $A_k\subset\mathbb{R}$ such that $\lim\sup A_k=\mathbb{R}$ but $\lambda(A_k)=1$ (Lebesgue measure) for all $k$.
My thoughts: Since $\lim\sup A_k=\cap_{n=1}^{\infty}\cup_{k\ge n}A_k$, we want for any sufficiently large $n$ (i.e., for all $n>N$ for some natural number $N$), the union of $A_{n},A_{n+1},...$ to cover $\mathbb{R}$, and the measure of each $A_k$ is 1. So I thought maybe we can make the sequence periodic, and in each period, the union of the $A_k$ covers $\mathbb{R}$. Thank you.

A: Pick an enumeration of $\mathbb Q$ and let $A_k=[q_k-\frac12,q_k+\frac12]$.
Then for any $x\in \mathbb R$ there exist infinitely many rationals with $|q-x|<\frac12$, hence for each $n\in\mathbb N$ there exists $m>n$ with $|q_m-x|<\frac12$. That amounts to $x\in\bigcap_n\bigcup_{m>n} A_m$, as was to be shown.

A: Let
$A_1=[0,1]$, $A_2=[-1,0]$, $A_3=[1,2]$,
$A_4=A_1$, $A_5=A_2$, $A_6=A_3$, $A_7=[-2,-1]$, $A_8=[2,3]$,
$A_9=A_4$, $A_{10}=A_5$, $\ldots$, $A_{14}=[-3,-2]$, $A_{15}=[3,4]$
and so on. That is in each step add two new sets by repeating all of the previous sets...


text:
Q: Chrome Extension: after update to 59 version iframe lose event handlers Our business relies on an application which is a Chrome extension. Since Chrome updated to version 59 we started seeing our event listeners for iframe listeners disappear randomly. This in turn breaks a lot of the logic in the tool.
We've tried everything: the developer documentation is opaque on this issue and we weren't able to find a solution from discussions in the developer community.
Here is example of code:
$(frame).load(function () {
    var frameContext = $(this);
    frameContext.contents().find('body').append(options.html);

    setTimeout(function () {
        var doc = frameContext.contents()[0];
        if (!doc) {
            console.log("iframe document is not ready");
            // just ensure, that document is already exist
            return false;
        }

        var closeButton = doc.getElementById("closeButton");

        closeButton.addEventListener("click", function () {
            console.log("Callback function just dissapears.");

            ...
        }, true);
    }, 600);
});

*

*It worked before Chrome released 59 version.

*Console doesn't show any errors.

*I've tried jquery listeners on(), click(). It doesn't help.

*BUT! Everything works well if you turn on the Chrome DevTool!
Thanks!