text:
Q: set origin coordinates for react-konva stage I am using react-konva for drawing purposes. I have configured the stage and I am drawing certain shapes in that stage container. The problem I am facing is that the origin coordinates(0,0) are at the top left of the stage container. I want the center of the stage to be the origin(0,0). Here is the present code:
<Stage
  height={800}
  width={1200}
  style={{ backgroundColor: '#fff', border: 'solid'}}>
  {
    this.state.circlePoints.length !== 0 &&
    <LineComponent
      startX={1200/2}
      startY={800/2}
      endX={this.state.circlePoints[0].pointX*1.3}
      endY={this.state.circlePoints[0].pointY*1.3}
      startColor={firstCircle[0].outerColor}
      endColor={pmData[0].outerColor}
    />
  }
  <CircleComponent
    x={1200/2}
    y={800/2}
    outerRadius={firstCircle[0].weight*1200}
    outerColor={firstCircle[0].outerColor}
    innerRadius={firstCircle[0].weight*1200*0.3}
    innerColor={firstCircle[0].innerColor}
    shadowColor={firstCircle[0].innerColor}
    getCirclePoints={this.getCirclePoints}
  />
  {
    this.state.circlePoints.length !== 0 &&
    <CircleComponent
      x={this.state.circlePoints[0].pointX*1.3}
      y={this.state.circlePoints[0].pointY*1.3}
      outerRadius={pmData[0].weight*1200}
      outerColor={pmData[0].outerColor}
      innerRadius={pmData[0].weight*1200*0.3}
      innerColor={pmData[0].innerColor}
      shadowColor={pmData[0].innerColor}
    />
  }
</Stage>

A: Use the layer offset command to re-position the layer on the stage. In the example below you can see that I add the x and y axis then offset the layer 200px in to the page. Finally I draw a circle on the layer at (0,0) to confirm that the layer co-ordinates remain based on this location so that you do not have to do any translation on your drawing co-ordinates.

var stage = new Konva.Stage({
      container: 'container',
      width: 600,
      height: 400
    });

var layer = new Konva.Layer();
stage.add(layer)

var axisX = new Konva.Line({
      points: [-200, 0, 200, 0],
      stroke: 'red',
      strokeWidth: 2,
      lineCap: 'round',
      lineJoin: 'round'
    });

var axisY = new Konva.Line({
      points: [0, 200, 0, -200],
      stroke: 'red',
      strokeWidth: 2,
      lineCap: 'round',
      lineJoin: 'round'
    });

layer.add(axisX)
layer.add(axisY)

// offset the layer on the stage
layer.offsetX(-200)
layer.offsetY(-200)

// draw a circle at 0,0

    var circle = new Konva.Circle({
      x: 0,
      y: 0,
      radius: 70,
      stroke: 'black',
      strokeWidth: 4
    });

    // add the shape to the layer
    layer.add(circle);

layer.draw();
stage.draw();
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title></title>

A: For those the above method doesn't work, do the following:

*

*Offset Y by the stage (canvas) height

*ScaleY by the negative value of your current scale. (If no scaling use -1)

eg. in react-konva
<Stage width={500} height={500} scaleY={-1} offsetY={500}>


text:
Q: If an answer receives a bounty, the bounty reason should be available alongside that answer If a bounty is offered on a question, the user offering the bounty is asked to select a reason for offering the bounty.
This reason should be displayed or at least available alongside the answer that is ultimately awarded the bounty, if any such answer exists, just like it is displayed alongside the question while the bounty is active. It could be displayed alongside the answer text, or hidden in the tooltip of the bounty rep gain symbol, but there should be some way to get this information.
The reason for this would be that otherwise, unless someone copies the bounty reason into an answer (or in some cases, comment) there is no way to tell what the bounty rep gain was actually for.
Perhaps a good example is my question on SuperUser Why do some RJ45 plugs have the lock release clip under a rubber cover?; the question is currently at a net +77, the accepted answer is a net +109, there's another net +114 answer, but the answer that was awarded a bounty is a net +1. (Personally I don't think that answer should have been awarded the bounty, especially with the bounty reason given, but since it wasn't me offering the bounty I figure that's not for me to decide.) Even when the answer that was awarded the bounty is a good answer, something like that can seem very weird. Making the bounty reason available next to the answer that was awarded the bounty would make it clear what the bounty giver (whether the OP or a third party) was looking for.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Openshift: Cannot upgrade to Wordpress 3.9 My Wordpress installation offers mean update to 3.9.
I click on Update now and the update process is started and finishes successfully.
However, then I am still presented with the same update screen. It seems that the update is not applied for some reasons. Any ideas?

A: After you run the upgrade from within the wordpress admin, restart your application, either using rhc app restart  command, or click the restart button in the web console, then it will tell you that a database upgrade is required.  Click the button and everything should be upgraded to wordpress 3.9.


text:
Q: Color row in JTree I'd like to color elements in a JTree. However, simply adding a background color only to the label looks kind of strange. Particularly if more than one node is selected, the resulting shape looks ragged and distracting.
Is there a way to make the background extend the whole width of the tree element, so that the whole row gets colored? Either starting at the left border or starting at the beginning of the label, but definitely extending till the right border of the component?
Here is a small self-contained demo, based on this question.
import java.awt.*;
import javax.swing.*;
import javax.swing.tree.*;
public class SO26724913 {
    public static void main(String[] args) {
        DefaultMutableTreeNode a = new DefaultMutableTreeNode("a");
        DefaultMutableTreeNode b = new DefaultMutableTreeNode("b");
        DefaultMutableTreeNode c = new DefaultMutableTreeNode("c");
        a.add(b);
        a.add(c);
        final JTree tree = new JTree(a);
        tree.setCellRenderer(new DefaultTreeCellRenderer() {
                @Override
                public Component getTreeCellRendererComponent
                    (JTree tree, Object value, boolean selected,
                     boolean expanded, boolean leaf, int row, boolean focus)
                {
                    JComponent c = (JComponent)
                        super.getTreeCellRendererComponent
                        (tree, value, selected, expanded, leaf, row, focus);
                    DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
                    String data = (String)node.getUserObject();
                    if ("b".equals(data)) {
                        c.setBackground(Color.RED);
                        c.setOpaque(true);
                    }
                    else {
                        c.setBackground(null);
                        c.setOpaque(false);
                    }
                    return c;
                }
            });
        JFrame frm = new JFrame();
        frm.getContentPane().add(tree);
        frm.setSize(200, 200);
        frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frm.setVisible(true);
    }
}

 This is what the code currently generates.
 I'd prefer either this
 or this.

A: You might be able to override the paintComponent(Graphics) method of JTree to paint selection rectangles directly:

import java.awt.*;
import java.awt.event.*;
import java.util.Arrays;
import javax.swing.*;
import javax.swing.tree.*;

public class ColorTreeTest {
  private static final Color SELC = Color.RED;
  public JComponent makeUI() {
    FocusListener fl = new FocusListener() {
      @Override public void focusGained(FocusEvent e) {
        e.getComponent().repaint();
      }
      @Override public void focusLost(FocusEvent e) {
        e.getComponent().repaint();
      }
    };
    DefaultTreeCellRenderer r = new DefaultTreeCellRenderer() {
      @Override public Component getTreeCellRendererComponent(
          JTree tree, Object value, boolean selected, boolean expanded,
          boolean leaf, int row, boolean hasFocus) {
        JLabel l = (JLabel) super.getTreeCellRendererComponent(
            tree, value, selected, expanded, leaf, row, false);
        l.setBackground(selected ? Color.RED
                                 : tree.getBackground());
        l.setOpaque(true);
        return l;
      }
    };
    JPanel p = new JPanel(new GridLayout(1, 2));
    for (JTree t : Arrays.asList(new ColorTree1(), new ColorTree2())) {
      t.addFocusListener(fl);
      t.setCellRenderer(r);
      t.setOpaque(false);
      p.add(new JScrollPane(t));
    }
    return p;
  }
  static class ColorTree1 extends JTree {
    @Override public void paintComponent(Graphics g) {
      g.setColor(getBackground());
      g.fillRect(0, 0, getWidth(), getHeight());
      if (getSelectionCount() > 0) {
        g.setColor(SELC);
        for (int i : getSelectionRows()) {
          Rectangle r = getRowBounds(i);
          g.fillRect(r.x, r.y, getWidth() - r.x, r.height);
        }
      }
      super.paintComponent(g);
      if (getLeadSelectionPath() != null) {
        Rectangle r = getRowBounds(getRowForPath(getLeadSelectionPath()));
        g.setColor(hasFocus() ? SELC.darker() : SELC);
        g.drawRect(r.x, r.y, getWidth() - r.x - 1, r.height - 1);
      }
    }
  }
  static class ColorTree2 extends JTree {
    private static final Color SELC = Color.RED;
    @Override public void paintComponent(Graphics g) {
      g.setColor(getBackground());
      g.fillRect(0, 0, getWidth(), getHeight());
      if (getSelectionCount() > 0) {
        g.setColor(SELC);
        //@see http://ateraimemo.com/Swing/TreeRowSelection.html
        for (int i : getSelectionRows()) {
          Rectangle r = getRowBounds(i);
          g.fillRect(0, r.y, getWidth(), r.height);
        }
      }
      super.paintComponent(g);
      if (getLeadSelectionPath() != null) {
        Rectangle r = getRowBounds(getRowForPath(getLeadSelectionPath()));
        g.setColor(hasFocus() ? SELC.darker() : SELC);
        g.drawRect(0, r.y, getWidth() - 1, r.height - 1);
      }
    }
  }
  public static void main(String... args) {
    EventQueue.invokeLater(new Runnable() {
      @Override public void run() {
        createAndShowGUI();
      }
    });
  }
  public static void createAndShowGUI() {
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    f.getContentPane().add(new ColorTreeTest().makeUI());
    f.setSize(320, 240);
    f.setLocationRelativeTo(null);
    f.setVisible(true);
  }
}


text:
Q: Matlab "evaluate selection" slows down code I'm using Matlab R2017b and I'm running a very simple snippet:
tic
t(1) = toc;
t(2) = toc;
t(3) = toc;
t(4) = toc;
t(5) = toc;
t(6) = toc;
t(7) = toc;

t = t - [0 t(1:end-1)];

If I run it with Run option in Editor menu of Matlab IDE the resulting t has values around 10e-5 seconds (Figure below).

If I run the very same script with Evaluate Selection (select the code, right click and then Evaluate Selection) the values are around 10e-3 seconds (Figure below).

Anyone knows the reason of this heavy slow down?
I tried with 3 different laptops (Linux and Windows OS) but nothing changed.


text:
Q: Set default primary key type across entire rails app? I will use uuid as the primary key type on some tables in a new rails app.
I see the occasional limitation like (at least out of the box) ActiveStorage can only handle attachments on either models that have bigint or uuid primary keys (not a mix of both).
For this reason, I think it's a cleaner approach to use uuid for every primary key.
Is there a global setting for new rails apps that can be set such that any models generated will automatically use uuid?

A: Yes, set
config.generators do |g|
  g.orm :active_record, primary_key_type: :uuid
end

in config/application.rb.
If you have problems, enable pgcypto extension in postgres:
class EnableUuidExtension < ActiveRecord::Migration[6.1]
  def change
    enable_extension 'pgcrypto'
  end
end

Note: this must be the first migration to run!


text:
Q: Angular 13 - material table new row, delete row update table I am using Angular 13 material-table. I am able to successfully send a request to an api server.
I'm sending a successful post request using modal-dialog and registering. But I can't see it on the current table after registering, I see it in the table after refreshing the page.
Likewise, when I delete a record, it is not deleted from the table, I can see it in the table after the page is refreshed.
How can I fix this?
Here is the "material request lists" where my main table is located, in this area my table is available
material-demands-list
export class MaterialDemandsListComponent implements OnInit {
displayedColumns: string[] = [
    'id',
    'description',
    'createdUserId',
    'createdUserName',
    'status',
    'companyId',
    'companyName',
    'actions',
];

materials: MaterialDemandsModel[] = [];
dataSource = new MatTableDataSource<MaterialDemandsModel>(this.materials);
@ViewChild(MatPaginator, { static: false }) paginator!: MatPaginator;
@ViewChild(MatSort, { static: true }) sort!: MatSort;
@ViewChild(MatTable, { static: true }) table: MatTable<any> | any;

page: number = 1;
pageSize: number = 10;
totalCount: number = 0;
pageSizeOptions: number[] = [5, 10, 20, 50, 100];

workflows: WorkflowListModel[] = [];

constructor(
    private messageService: MessageService,
    public demandsService: MaterialDemandService,
    public workflowService: WorkflowListService,
    public dialog: MatDialog
) {}

ngOnInit(): void {
    this.getData(this.page, this.pageSize);
    this.dataSource.paginator = this.paginator;

    this.workflowService.getWorkflowDefinitions().subscribe((data) => {
    this.workflows = data.items;
    });
}

getData(page: Number, pageSize: Number) {
    this.demandsService
    .getMaterialDemands(Number(page), Number(pageSize))
    .subscribe((data) => {
        this.dataSource.data = data.data;
        this.totalCount = Number(data.data[0].totalCount);
        this.demandsService.loading = false;
    });
}

deleteDialog(obj: any): void {
    Confirm.show(
    `Delete row : ${obj.id}`,
    `${obj.description}  selected row deleting ?`,
    'Delete',
    'Cancel',
    () => {
        this.demandsService.deleteMaterialDemand(obj.id).subscribe({
        next: (v) => {},
        error: (e) => {
            console.log(e);
        },
        complete: () => {},
        });
    },
    () => {
        alert('Cancel');
    }
    );
}

onChangePage(pageEvent: PageEvent) {
    this.pageSize = pageEvent.pageSize;
    this.page = +pageEvent.pageIndex + 1;
    this.getData(this.page, this.pageSize);

    this.demandsService.loading = true;
}

openDialog(action: any, obj: any) {
    obj.action = action;
    const dialogRef = this.dialog.open(MaterialDemandDialogComponent, {
    data: obj,
    autoFocus: false,
    });
    dialogRef.disableClose = true;

    // send message to subscribers via observable subject
    this.messageService.sendMessage(this.workflows);

    dialogRef.afterClosed().subscribe((result) => {
    console.log(result);
    if (result.event == 'Add') {
        this.addRowData(result.data);
    } else if (result.event == 'Update') {
        this.updateRowData(result.data);
    }
    });
}
addRowData(row_obj: any) {
    console.log(row_obj);

    this.materials.push({
    id: 'row_obj.id',
    description: 'row_obj.description',
    ldapId: 'row_obj.ldapId',
    sAMAAccountName: 'row_obj.sAMAAccountName',
    objectGuid: 'row_obj.objectGuid',
    email: 'row_obj.email',
    preferredUserName: 'row_obj.preferredUserName',
    manager: 'row_obj.manager',
    companyName: 'row_obj.companyName',
    status: 'row_obj.status',
    companyId: "row_obj.companyId",
    workflowId: 'row_obj.workflowId',
    workflowDefinitionId: 'row_obj.workflowDefinitionId',
    workflowName: 'row_obj.workflowName',
    workflowVersion: "row_obj.workflowVersion",
    totalCount: "row_obj.totalCount",
    });
    this.table.renderRows();
}
updateRowData(row_obj: any) {
    this.materials = this.materials.filter((value, key) => {
    if (value.id == row_obj.id) {
        value.description = row_obj.description;
    }
    return true;
    });
}
}

In this modal form screen, I am creating a new record or updating an existing record.
material-demand-add-update-dialog
export class MaterialDemandDialogComponent implements OnInit, OnDestroy {
action: string | any;
local_data: any;

workflows: WorkflowListModel[] = []; //Workflow list

workflowsCtrl = new FormControl(); //autoComplete states
filteredStates: Observable<string[]> | any;
subscription: Subscription | any;

errorMessage = '';

@Input() material = {
    description: '',
    ldapId: '',
    sAMAAccountName: '',
    objectGuid: '',
    email: '',
    preferredUserName: '',
    manager: '',
    companyName: '',
    status: 'Boşta',

    workflowId: '',
    workflowDefinitionId: '',
    workflowName: '',
    workflowVersion: '',
    companyId: '1',
};
ownerForm: FormGroup | any;

constructor(
    private fb: FormBuilder,
    private messageService: MessageService,
    private materialDemandService: MaterialDemandService,
    public dialogRef: MatDialogRef<MaterialDemandDialogComponent>,
    @Optional() @Inject(MAT_DIALOG_DATA) public data: MaterialDemandsModel
) {
    this.local_data = { ...data };
    this.action = this.local_data.action;

    // subscribe to material-demands-list component -> workflow list messages
    this.subscription = this.messageService
    .getMessage()
    .subscribe((message) => {
        this.workflows = message.message;
        if (message) {
        //this.workflows.push(message.message);
        } else {
        this.workflows = [];
        }
    });
}

ngOnInit(): void {
    this.filteredStates = this.workflowsCtrl.valueChanges.pipe(
    startWith(''),
    map((state) =>
        state ? this._filterStates(state) : this.workflows.slice()
    )
    );

    //Validators
    this.ownerForm = this.fb.group({
    description: [
        this.local_data.description,
        [Validators.maxLength(250), Validators.required],
    ],
    workflowName: [
        this.local_data.workflowName,
        [Validators.maxLength(150), Validators.required],
    ],
    });
}

setWorkflowInfo(value: any) {
    this.material.workflowName = value.name;
    this.material.workflowDefinitionId = value.definitionId;
    this.material.workflowId = value.id;
    this.material.workflowVersion = value.version;
}

postMaterialDemand(): void {
    this.materialDemandService
    .postMaterialWithObservable(this.material)
    .subscribe({
        next: (v) => {
        console.log(v);
        },
        error: (e) => {
        this.errorMessage = e;
        console.log(e);
        },
        complete: () => {
        console.log('success');
        },
    });
}

doAction() {
    if (this.action === 'Add') {
    this.postMaterialDemand();
    }
    this.dialogRef.close({ event: this.action, data: this.local_data });
}
closeDialog() {
    this.dialogRef.close({ event: 'Cancel' });
}
ngOnDestroy(): void {
    this.subscription.unsubscribe();
}
}

My service file is as follows.
I make sites like "Get, Post, Delete" here and it returns successfully.
service
export class MaterialDemandService {
private gatewayUrl: string = `${environment.gatewayUrl}`;
public loading: boolean = true;

constructor(private httpClient: HttpClient) {}

httpHeaders = new HttpHeaders({
    'Content-Type': 'application/json',
});

//GATEWAY -> POST
postMaterialWithObservable(data: any): Observable<MaterialDemandsModel> {
    let api = `${this.gatewayUrl}/api/services/purchasing/MaterialDemands`;

    return this.httpClient
    .post<any>(api, JSON.stringify(data), {
        headers: this.httpHeaders,
    })
    .pipe(
        tap((x) => {
        this.loading = false;
        }),
        retry(2),
        map(this.extractData),
        catchError(this.handleError)
    );
}

//GATEWAY -> GET -> get material demands 1/10
getMaterialDemands(page: number, pageSize: number) {
    return this.httpClient
    .get<{ data: MaterialDemandsModel[] }>(
        `${this.gatewayUrl}/api/services/purchasing/MaterialDemands/${page}/${pageSize}`
    )
    .pipe(
        retry(2),
        tap((x) => {
        this.loading = false;
        }),
        catchError(this.handleError)
    );
}

deleteMaterialDemand(materialId: Number) {
    return this.httpClient
    .delete<any>(
        `${this.gatewayUrl}/api/services/purchasing/MaterialDemands/${materialId}`,
        { headers: this.httpHeaders }
    )
    .pipe(retry(2), catchError(this.handleError));
}

private extractData(res: any) {
    return res;
}
private handleError(error: any) {
    let errorMessage = '';
    if (error.errorMessage instanceof ErrorEvent) {
    errorMessage = error.error.errorMessage;
    } else {
    errorMessage = `\nCode: ${error.status}}\nResponse: ${error.message}`;
    }
    window.alert(errorMessage);
    return throwError(() => {
    return errorMessage;
    });
}
}

I've been working on it for a few days but I couldn't figure it out.

A: I belive you have to provide a new refference for dataSource
In case of adding a new row you have to do something like this
this.dataSource = [...this.dataSource, newRow];

In case of deleting
this.dataSource = this.dataSource.filter(...)


text:
Q: Evaluation of double integral – Polar Coordinates? I am trying to calculate the double integral $$\int_0^{\infty}\int_0^{\infty}e^{-2x^2-3y^2}\, dx\, dy$$ If both coefficients of $x^2$ and $y^2$ were equal then we could use polar coordinates.
Can we do that also in this case?
Then we would have $$\int\int e^{-r^2-r^2\cos^2\theta}\, r\, dr\, d\theta$$ But how can we continue from here? Or do we do something else here?

A: $$I=\int_0^\infty\int_0^\infty e^{-(2x^2+3y^2)}\,dx\,dy$$
now let $X=\sqrt{2}x\Rightarrow dx=\frac{dX}{\sqrt{2}}$ and $Y=\sqrt{3}y\Rightarrow dy=\frac{dY}{\sqrt{3}}$ so we get:
$$I=\frac{1}{\sqrt{6}}\int_0^\infty\int_0^\infty e^{-(X^2+Y^2)}\,dX\,dY$$
now use your polar coordinates

A: If you already know the result from the Gaussian integral, $\int_0^\infty e^{-ax^2} dx = \sqrt{\frac{\pi}{a}}$ (for $Re(a) > 0$) then you can simply break up the integral like this:
$$\int_0^\infty \int_0^\infty e^{-2x^2 - 3y^2} dx dy = \int_0^\infty e^{-2x^2} \left[ \int_0^\infty e^{-3y^2} dy \right] dx = \int^{\infty}_0 \sqrt{\frac\pi{3}}e^{-2x^2} dx = \frac\pi{\sqrt{6}}$$
which will match Henry's answer.


text:
Q: IPhone: Uploading a new version of an app - is there an approval process? When I upload a new version of my app to appstore does it go through the same approval process as the first time I uploaded the app?

A: It's not the same process, but you have to re-submit the app with a different version number. Usually the approve process is faster the fewer the changes you have made : i.e. for bugfixes will be faster than adding new functionality.

A: I believe it's a less involved process, but it still gets looked at.

A: Yes, you will have to go through the process. I am not sure whether it will be the identical process. Anyway, there have been reports that the same app had been denied after some minor updates.


text:
Q: what is the correct way to pass Bearer token in header section of my HTTP.Post in flutter My Post API need a customer_id in body but also need a bearer token. I am passing it using following code
var myId="1005",
var token="my Token here"
    var response = await http.post(Uri.parse("http://haulers.tech/jashn/mobile/home/shoutouttype"),
      body: ({
         "customer_id":myId.toString,
         }),
      headers: ({
         "Authorisation": token.toString, //here I want to pass Bearer Token
         })
      );

This code return status code 401.

A: Bearer tokens are usually sent preceded with Bearer  : the following key value pair:-
"Authorization": "Bearer {TOKEN}"

Should work.

A: Pay attention to the word Bearer its must be Capitalized other ways it wont work, not sure whats the reason, but for flutter http calls make sure to capitalize that word like this
var response = await httpClient.post(
url,
headers:{
    "Accept": "application/json",
    "Content-type": "application/json",
    "Authorization": "Bearer $token"
},
body :{some body});


text:
Q: Aggregation not working with monger for mongodb version 3.6 Mongo aggregation framework has some changes in version 3.6  Earlier aggregation queries with monger are not working even when we pass :cursor {} as an option. Is there any workaround or do we have to wait for the next monger release?. The error we get is specified below

MongoCommandException Command failed with error 9: 'The 'cursor' option is required, except for aggregate with the explain argument' on server localhost:27017. The full response is { "ok" : 0.0, "errmsg" : "The 'cursor' option is required, except for aggregate with the explain argument", "code" : 9, "codeName" : "FailedToParse" }  com.mongodb.connection.ProtocolHelper.getCommandFailureException (ProtocolHelper.java:115)

A: by OSt advice, I could run monger aggregation sample with codes below.
(mc/aggregate db coll
    [{"$project" {:subtotal {"$multiply" ["$quantity", "$price"]}
                  :_id "$state"}}]
    :cursor {:batch-size 0})

thanks!

A: According to mongo db spec, cursor became a required field in some cases. So you should provide it through monger API. It is not a problem in monger,  it is a breakable change in mongo db API.


text:
Q: Using Crontab - some clarification I have a rake task which runs as per the following values, using certain format fields(given below values):-
Value 1:
30   0   */1   *   *
Format Fields:
1    2    3   4   5
hrs min  d/m  m   d/w
Here we have, d - day; m -month; w - week.
When I tried to better understand this, it basically meant that it would be at 00:30 hrs every day a week and every week of the month.
I'm only not clear about what does the third field d/m refer to wrt */1.
As in, I am unable to figure out the difference wrt the above value and another value say:-
Value 2:
30 0 1 * *
Do the both basically refer to the same period of execution on a timely basis?
Kindly advice me on this.
Thanks..

A: The field order is
min hour day month weekday

So
30 0 */1 * *

sets minutes to 30, hour to 0, and day to every day.  This is a daily task that runs at 00:30 (or 12:30 AM) every day of the month.  It is equivalent to
30 0 * * *

since the step value of /1 is superfluous.
In contrast,
30 0 1 * *

sets minutes to 30 and hour to 0 as before but sets day to 1.  This is a monthly task that runs at 00:30 (12:30 AM) on the 1st day of every month.


text:
Q: How can i send a html mail with an attachment through Unix Shellscripting I am totally new to unix shellscripting.I have to send a html mail with a gzip file as an attachment through unix shell scripting without using uuencode or mailx.I have got several codes for this using uuencode and mailx but i need one without these.I m stuck.Please help me out.

A: You do have to use uuencode if there will be an attachment. The trick is to write out a plain ascii file that is formatted in a particular way. There is an example in this post. As long as your script writes out a file in that format, with the attachment uuencoded between the $MAILPART sections, it will be processed by sendmail and rendered nicely in the recipient's email program.


text:
Q: symfony blank bundle class loader I can't figure out why does symfony2 load's a blank class for a Bundle like this :
AppKernel.php
<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new AppBundle\AppBundle(),
        );

Like the last line new AppBundle\AppBundle()
The src/AppBundle/AppBundle.php looks like this :
<?php

namespace AppBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AppBundle extends Bundle
{
}

I really dont understand. I read both Symfony2 books (the book and the cookbook) and I couldn't find an answer.
Thank you.


text:
Q: $a$ and $b$ are two vectors such that $a\cdot(a-b)=0$ and $3|a|=|b|$. Find the angle between $a$ and $b$. $a$ and $b$ are vectors and we are supposed to find the angle in between them, I tried the question but I haven't got a clue about it

$a$ and $b$ are two vectors such that $a\cdot(a-b)=0$ and $3|a|=|b|$. Find the angle between $a$ and $b$.

A: $$\overrightarrow{A}.(\overrightarrow{A}-\overrightarrow{B})=0$$
$$3|A|=|B|$$
Expanding the first equation,
$$\overrightarrow{A}.(\overrightarrow{A}-\overrightarrow{B})=\overrightarrow{A}.\overrightarrow{A}-\overrightarrow{A}\overrightarrow{B}=0$$
W.K.T,$$\overrightarrow{A}.\overrightarrow{B}=|\overrightarrow{A}||\overrightarrow{B}|\cos\theta$$
Where, θ is the angle between the given two vectors.
$$\overrightarrow{A}.\overrightarrow{A}=|\overrightarrow{A}||\overrightarrow{A}|\cos(0)=|\overrightarrow{A}|^2$$
As the two vectors are the same, the angle between them is 0
$$\overrightarrow{A}.\overrightarrow{B}=|\overrightarrow{A}||\overrightarrow{B}|\cos\emptyset$$
So,
$$|\overrightarrow{A}|^2-|\overrightarrow{A}||\overrightarrow{B}|\cos\emptyset=0$$
$$|\overrightarrow{A}|=|\overrightarrow{B}|\cos\emptyset$$
It is given in the question that:
$$3|A|=|B|$$
$$|\overrightarrow{A}|=3|\overrightarrow{A}|\cos\emptyset$$
$$1/3=\cos\emptyset$$
Thus,
$$\emptyset=\cos^{-1}(1/3)=70.528^\circ$$


text:
Q: Now I am Getting Fatal error: Call to a member function prepare() on a non-object on my php form Been fighting this code all day got most of the bugs hammered out but now im getting this error message

Fatal error: Call to a member function prepare() on a non-object in /home/jsnow/public_html/registration.php on line 26

Here is my code:
<?php

if(isset($_POST['username']) && isset($_POST['password']))
{
$db =connect('********','*********');
if($db!=false)
{
   register($db);
   echo "User registered";
}

}

function connect($dbuser,$dbpassword)
{
    try{
        $db = new PDO('mysql:host=localhost;dbname=jsnow_login', '*******' , '*********');
        return $db;
    }catch(PDOException $e){
        echo $e;
        return false;}
}

function register($db)
{
    $result_set = $pdo->prepare("INSERT INTO `users` (`username`, `password`)
                            VALUES (:username, :password)");
 $result_set->execute(array(
':username' => $username, ':password' => $password
));

}

?>

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form action="http://vps8383.***********.com/~jsnow/registration.php" method="post">
username:<input type="text" name="username"/>
password:<input type="password" name="password"/>
email<input type="text" name="e_mail"/>
<input type="submit"/>

</form>

</body>
</html>

A: Inside register(), $pdo is not defined. Use the following instead:
$result_set = $db->prepare("INSERT INTO `users` (`username`, `password`)
                        VALUES (:username, :password)");

Concerning the $sername and $password variables not getting initialized in the function, change your function definition to:
function register($db,$username,$password)

and call it like this:
register($db,$_POST['username'],$_POST['password']);


text:
Q: Azure Logic App authenticate with WebApp using MSI Has anyone ever managed to implement MSI authentication between a LogicApp and a WebApp? (assuming this is even possible). The only examples I am managing to find are to use MSI with services like Keyvault, Storage etc.

A: If I understand it correctly, your API is hosted in Azure web app, and you want to use MSI to call the API in logic app, if so, you could follow the steps below.

*

*Navigate to your web app in the portal -> Authentication / Authorization -> enable the Azure AD auth of your web app, follow this doc.

Note: Please select Create new AD App like below, then Azure will configure the AD App automatically for you, this can avoid many configuration issues.

At last, select Log in with Azure Active Directory, it will be like below after all the configurations.

*Navigate to the logic app in the portal -> Identity -> enable the system-assigned identity.

*In the logic app designer, use the Http action like below(In my sample, to test it easily, I use azure function instead of web app, they are the same logic, just use web app in your case), replace the Audience with the URL of your web app.

Result:

A: It can be done out of box. You can call MSI authenticated Web API from Logic App by following below simple steps:

*

*Add MSI to your Logic App.

*Add RBAC for Logic App in your Web API's App Service.

*Add HTTP action with settings like below in your Logic App to call Web API (Don't add Audience and fill up other details of the API):

For more details, visit Authenticate access to Azure resources by using managed identities in Azure Logic Apps.


text: Q: How do I disprove that $|\mathcal P([0,1]) \setminus \mathcal P((0,1))| > |\mathcal P(\mathbb{N})|$ I am trying to disprove this proposition $|\mathcal P([0,1]) \setminus \mathcal P((0,1))| > |\mathcal P(\mathbb{N})|$, where $\mathcal P (X)$ is the power set of $X$, but I am not sure how. I hope someone here could help me, thanks.


text:
Q: tf.TensorArray allow reading from an unwritten index? I was trying to use TensorArrays in a nested while loop and I faced issues when combining read and write on a particular TensorArray index.
I trying investigating the error and it seems TensorFlow throws an error when I trying reading from an unwritten index and then subsequently write to that index.
"InvalidArgumentError (see above for traceback): TensorArray TensorArray_0: Could not write to TensorArray index 5 because it has already been read."
I tried looking for solutions and found this issue.
https://git.codingcafe.org/Mirrors/tensorflow/tensorflow/commit/06bd05e0018969b9c0696233ceb7fa881e50210c
To better frame this question, I simplified my code in this snippet.
def loop_body1(i, x):
    x = tf.cond(tf.equal(i, 0), lambda: x.write(i+1, 10), lambda: x.write(i+1, 1 + x.read(i-1)))
    i = tf.add(i, 1)
    return i, x

num_iterations = 5
iteration_num1 = tf.constant(0, dtype=tf.int32)

array = tf.TensorArray(dtype=tf.int32, size=1, dynamic_size=True, clear_after_read=False)         # dynamic size
loop_condition1 = lambda iteration_num1, predictions: tf.less(iteration_num1, num_iterations)

# First loop - same as previous cell
_, array = tf.while_loop(loop_condition1, loop_body1, [iteration_num1, array])

array = array.write(tf.constant(0), 100)
loop_op1 = array.stack()

sess = tf.Session()
sess.run(tf.global_variables_initializer())
outputs = sess.run(loop_op1)
print(outputs)

The line
array = array.write(tf.constant(0), 100)
throws an error because I write to index 0 after having read from index 0 in the loop body.
Any help regarding this would be highly appreciated.


text:
Q: Verify_password() : password not matching hash I apologize if this is too much of a newbie issue but I've been stuck with the password_verify function for days now. The problem would seem to be that the password entered in the login does not match the password in the database. Yet the passwords do match and I don't understand what the problem is! The passwords are stocked as VARCHAR 255 and when I use var dump on the two variables this is what I get:
string(60) "$2y$10$vfTK8JhbTjtwN3R2qED59uT1gvlD7XbczeacC7IMGn4kKi/1ETiP2" string(12) "Password123."
The problem does not solve if i switch place to $password, $row["password"] in password_verify
Does anyone know what the problem could be?
Thanks in advance
This is how I am trying to compare the password from the login with the one in the db.
<form method="post" >
    <input class="input" type= "text" name="nom" placeholder="nom" required >

     <input class="input" type= "password" name="password" placeholder="password" required>

    <input class="button" type= "submit" value="Login" name= "Submit1">
    <?php
//appel a la connexion de bdd
require_once ('conn.php');

///$_Post variables
$email = $_POST['nom'];
$password =  $_POST ['password'];

//Query
$q = $conn->prepare("SELECT * FROM users WHERE nom = :email");
$q->bindParam(':email', $email);
$q->execute(); // eseguo la query
$q->setFetchMode(PDO::FETCH_ASSOC);
$rows = $q->rowCount();

if ($rows > 0) {
    while ($row = $q->fetch()) {
        var_dump($row["password"]);
        var_dump($password);

        //Password control
        if ((password_verify( $password, $row["password"]))) {
            echo 'right';

        }
       else {
        echo 'wrong';

    }

    }
}

This is how i store them in the first place
 <?php
//connessione bd
include 'conn.php';
include 'forminsertuser.php';

//recupero

if(!empty ($_POST["Submit1"]))

{
    $password_hash= password_hash($arr['password'], PASSWORD_DEFAULT);

$arr['nom'] = htmlspecialchars($_POST ['nom']);
$arr['password']= htmlspecialchars( $_POST ['password']);
$arr['rankid']=  $_POST ['rankid'];

$sql = 'INSERT INTO users ( nom, password, rankid) VALUES( :nom, :password, :rankid)';

$statement = $conn->prepare($sql);

$statement->execute([
':nom' => $arr['nom'],
    ':password' => $password_hash,
    ':rankid' => $arr['rankid'],
]);

 header("Location: process.php");
exit;
};
?>

A: Your password_hash variable is set in the wrong place.  It is using $arr before it has been initialized.
<?php
//connessione bd
include 'conn.php';
include 'forminsertuser.php';

//recupero

if(!empty ($_POST["Submit1"]))

{

$arr['nom'] = htmlspecialchars($_POST ['nom']);
$arr['password']= htmlspecialchars( $_POST ['password']);
$arr['rankid']=  $_POST ['rankid'];

// shifted here
$password_hash= password_hash($arr['password'], PASSWORD_DEFAULT);

$sql = 'INSERT INTO users ( nom, password, rankid) VALUES( :nom, :password, :rankid)';

$statement = $conn->prepare($sql);

$statement->execute([
':nom' => $arr['nom'],
    ':password' => $password_hash,
    ':rankid' => $arr['rankid'],
]);

 header("Location: process.php");
exit;
};
?>


text:
Q: Scheme - turn each element of a list into a list (list of lists) I have list in scheme: (3 4 2) and I want to make it a list of lists, i.e: ((3) (4) (2)), How can I do it?
Thank you.

A: You can utilize the map function, e.g. (map list '(3 4 5)), which is the bread and butter of all list manipulation. It's equivalent to a list comprehension in python, or a for loop in java.
for the record:
You can also use reduce and filter for more complicate list-manipulation tasks. You do not really need anything else, besides maybe apply.

A: If you wanted to do it Little Schemer style with only basic functions you could create something like this:

(define make-list
..(lambda (lat)
....(cond
......((null? lat) (quote()))
......(else (cons (cons (car lat) (quote()))
..................(make-list (cdr lat))))))))


text:
Q: Python multiprocessing ratio of processors and iteration This is probably a stupid question. But, if I have a simple function and I want to run it say 100 times and I have 12 processors available, is it better to use 10 processors to run the multiprocessing code or 12?
Basically by using 12 cores will I be saving one iteration time? or it will run 10 iterations in 1st time and then 2 and then 10 and so on?

A: It's almost always better to use the number of processors available. However, some algorithms need processes to communicate partial results to achieve an end result (many image processing algorithms have this constraint). Those algorithms have a limit on the number of process that should be running in parallel, as beyond this limit, the cost of communication impairs performances.
However, it depends on a lot of things. Many algorithms are easily parallelizable, however, the cost of parallelism impair their acceleration. Basically, for parallelism to be worth anything, the actual work to be done must be an order of magnitude greater than the cost of parallelism.
In typical multi-threaded languages, you can easily reduce the cost of parallelism by re-using the same threads (thread pooling). However, python being python, you must use multi-processing to achieve true parallelism, which has a huge cost. However, there's a process pool if you wish to re-use processes.
You need to check how much time it takes to run your algorithm sequentially, how much time it takes to run one iteration, and how many iteration will you have. Only then will you know if parallelization is worth it. If it is worth it, then do tests for number of processes going from 1 to 100. This will allow you to find the sweet spot for your algorithm.


text:
Q: Dell Precision 7520 laptop with preinstalled Ubuntu 16.04. Software Update failed on a wifi update and broke it On March 16, 2019 I ran the software update checker and told it to install all updates. (Up-to-date as of the previous week if not later.)
One update, for wifi, failed.  I did not log its name because I assumed Ubuntu would roll back the changes.  Wrong.  On reboot WiFi wasn't working.
The laptop has an Ethernet port so it is running online.  Running the software update returns with no updates needed.
I've gone online and found many Ubuntu wifi trouble shooting guides but each one I've tried has run into problems after the first few steps.
The PCI WiFi is Intel Corporation Wireless 8265 / 8275 (rev 78).   On the Intel site they have iwlwifi-8265-ucode-22.361476.0.tgz but its for kernel 4.6 not 4.4.  (uname -r returns "Kernel: 4.4.0-143-generic")  Its latest update was March 5th which probably lead to the problem on the 16th.
Under Software & Updates >
Additional drivers

Intel Corporation:  Unknown
  This device is using an alternative driver
  (selected)
  using oem-wifi-intel-iwlwifi-lp1757035-4.4-dkms driver in DKMS format wrapped by dkms-helper, from  oem-wifi-intel-iwlwifi-lp1757035-4.4-dkms-dkms (open source)

Only other option is Do not use
I selected Do not use and the first time it took 5 minutes, the second over 20 minutes and wasn't finished so I rebooted and it was selected.  Selecting the oem driver took maybe 2 seconds but didn't fix the problem.
lshw -C network shows the wireless and ethernet adapters. Wireless is recognized properly as Intel
In lspci -vwireless is listed as intel 8265 / 8275 rev 78
In lshw – C netowrk wireless configuration line only has latency=0 (no mention of driver)
$ sudo lspci
01:00.0 Network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)

$ sudo lsmod
Module                  Size  Used by
nls_utf8               16384  0
isofs                  40960  0
uas                    24576  0
usb_storage            73728  1 uas
nvram                  16384  0
msr                    16384  0
bnep                   20480  2
binfmt_misc            20480  1
joydev                 20480  0
hid_alps               16384  0
i2c_designware_platform    16384  0
i2c_designware_core    20480  1 i2c_designware_platform
dell_wmi               16384  0
snd_hda_codec_hdmi     49152  1
dell_rbtn              16384  0
dell_led               16384  1
dell_laptop            20480  0
dcdbas                 16384  1 dell_laptop
btusb                  45056  0
btrtl                  16384  1 btusb
btbcm                  16384  1 btusb
dell_smm_hwmon         16384  0
btintel                16384  1 btusb
bluetooth             520192  9 bnep,btbcm,btrtl,btusb,btintel
snd_hda_codec_realtek    94208  1
snd_hda_codec_generic    73728  1 snd_hda_codec_realtek
intel_rapl             20480  0
x86_pkg_temp_thermal    16384  0
intel_powerclamp       16384  0
coretemp               16384  0
kvm_intel             176128  0
kvm                   552960  1 kvm_intel
irqbypass              16384  1 kvm
crct10dif_pclmul       16384  0
crc32_pclmul           16384  0
ghash_clmulni_intel    16384  0
aesni_intel           167936  0
snd_hda_intel          40960  3
snd_hda_codec         135168  4 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel
aes_x86_64             20480  1 aesni_intel
snd_hda_core           90112  5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel
snd_hwdep              16384  1 snd_hda_codec
lrw                    16384  1 aesni_intel
snd_pcm               106496  4 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_core
gf128mul               16384  1 lrw
snd_seq_midi           16384  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            32768  1 snd_seq_midi
snd_seq                69632  2 snd_seq_midi_event,snd_seq_midi
glue_helper            16384  1 aesni_intel
ablk_helper            16384  1 aesni_intel
snd_seq_device         16384  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer              32768  2 snd_pcm,snd_seq
rtsx_pci_ms            20480  0
cryptd                 20480  3 ghash_clmulni_intel,aesni_intel,ablk_helper
memstick               20480  1 rtsx_pci_ms
snd                    81920  17 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel,snd_seq_device
mei_me                 36864  0
soundcore              16384  1 snd
idma64                 20480  0
input_leds             16384  0
serio_raw              16384  0
mei                    98304  1 mei_me
virt_dma               16384  1 idma64
intel_lpss_pci         16384  0
intel_lpss             16384  1 intel_lpss_pci
shpchp                 36864  0
dell_smo8800           16384  0
int3403_thermal        16384  0
intel_hid              16384  0
processor_thermal_device    16384  0
intel_soc_dts_iosf     16384  1 processor_thermal_device
sparse_keymap          16384  2 dell_wmi,intel_hid
int3402_thermal        16384  0
int340x_thermal_zone    16384  3 int3402_thermal,processor_thermal_device,int3403_thermal
int3400_thermal        16384  0
acpi_thermal_rel       16384  1 int3400_thermal
mac_hid                16384  0
acpi_pad               24576  0
parport_pc             32768  0
ppdev                  20480  0
lp                     20480  0
parport                49152  3 lp,ppdev,parport_pc
autofs4                40960  2
btrfs                 987136  0
xor                    24576  1 btrfs
raid6_pq              102400  1 btrfs
hid_logitech_hidpp     20480  0
hid_logitech_dj        20480  0
usbhid                 53248  0
rtsx_pci_sdmmc         24576  0
i915_bpo             1343488  7
intel_ips              20480  1 i915_bpo
i2c_algo_bit           16384  1 i915_bpo
psmouse               131072  0
e1000e                241664  0
drm_kms_helper        155648  1 i915_bpo
syscopyarea            16384  1 drm_kms_helper
ptp                    20480  1 e1000e
sysfillrect            16384  1 drm_kms_helper
pps_core               20480  1 ptp
sysimgblt              16384  1 drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
ahci                   40960  3
rtsx_pci               53248  2 rtsx_pci_ms,rtsx_pci_sdmmc
drm                   364544  8 i915_bpo,drm_kms_helper
libahci                32768  1 ahci
wmi                    20480  2 dell_led,dell_wmi
i2c_hid                20480  0
hid                   122880  6 i2c_hid,hid_alps,usbhid,hid_logitech_dj,hid_logitech_hidpp
video                  40960  3 i915_bpo,dell_wmi,dell_laptop
fjes                   28672  0
I couldn't tell if the correct module was loaded or not but nothing looked like a WiFi module to me.
I do have a full user data backup and the original factory image so I can restore the image if necessary but will lose all the programs installed except Ubuntu and all the tweaks to the interface.
From what I've read Ubuntu will detect the hardware and install the appropriate software except maybe not with these Dell / Intel / Ubuntu drivers.  Except there was an updated driver coming though the software update channel.
I don't know where to go from here.  Can I get the driver through Ubuntu or do I have to restore the factory image?
I did submit a report about the error using the error reporting tool but couldn't find a local copy.   It it stored somewhere local?
Thank you for your help.
wifi info script output
########## wireless info START ##########

Report from: 21 Mar 2019 16:43 EDT -0400

Booted last: 21 Mar 2019 00:00 EDT -0400

Script from: 22 Oct 2018 03:34 UTC +0000

##### release ###########################

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.6 LTS
Release:    16.04
Codename:   xenial

##### kernel ############################

Linux 4.4.0-143-generic #169-Ubuntu SMP Thu Feb 7 07:56:38 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Parameters: ro, acpi_rev_override, alx.enable_wol=1, mem_sleep_default=deep, quiet, splash, vt.handoff=7

##### desktop ###########################

Ubuntu

##### lspci #############################

00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (5) I219-LM [8086:15e3] (rev 31)
    Subsystem: Dell Ethernet Connection (5) I219-LM [1028:07b0]
    Kernel driver in use: e1000e

01:00.0 Network controller [0280]: Intel Corporation Wireless 8265 / 8275 [8086:24fd] (rev 78)
    Subsystem: Intel Corporation Device [8086:0050]

02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader [10ec:525a] (rev 01)

##### lsusb #############################

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 004: ID 0a5c:5832 Broadcom Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

##### PCMCIA card info ##################

##### rfkill ############################

0: dell-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: dell-bluetooth: Bluetooth
    Soft blocked: yes
    Hard blocked: no

##### secure boot #######################

SecureBoot enabled

##### lsmod #############################

dell_wmi               16384  0
dell_laptop            20480  0
dcdbas                 16384  1 dell_laptop
sparse_keymap          16384  2 dell_wmi,intel_hid
wmi                    20480  2 dell_led,dell_wmi
video                  40960  3 i915_bpo,dell_wmi,dell_laptop

##### interfaces ########################

[/etc/network/interfaces]
auto lo
iface lo inet loopback

##### ifconfig ##########################

1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback  brd
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s31f6:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether  brd
    inet 192.168.1.230/24 brd 192.168.1.255 scope global dynamic enp0s31f6
       valid_lft 86246sec preferred_lft 86246sec
    inet6 2601:982:c100:bf10:3884:d08c:764e:9aee/64 scope global temporary dynamic
       valid_lft 594sec preferred_lft 594sec
    inet6 2601:982:c100:bf10:287a:d1a4:2b51:286e/64 scope global mngtmpaddr noprefixroute dynamic
       valid_lft 594sec preferred_lft 594sec
    inet6 fe80::754c:ec08:f9c2:6a82/64 scope link
       valid_lft forever preferred_lft forever

##### iwconfig ##########################

lo        no wireless extensions.

enp0s31f6  no wireless extensions.

##### route #############################

default via 192.168.1.1 dev enp0s31f6  proto static  metric 100
169.254.0.0/16 dev enp0s31f6  scope link  metric 1000
192.168.1.0/24 dev enp0s31f6  proto kernel  scope link  src 192.168.1.230  metric 100

##### resolv.conf #######################

[777 root '/etc/resolv.conf' -> '../run/resolvconf/resolv.conf']
nameserver 127.0.1.1

##### network managers ##################

Installed:

    NetworkManager

Running:

root      1168     1  0 Mar18 ?        00:00:03 /usr/sbin/NetworkManager --no-daemon

##### NetworkManager info ###############

GENERAL.DEVICE:                         enp0s31f6
GENERAL.TYPE:                           ethernet
GENERAL.NM-TYPE:                        NMDeviceEthernet
GENERAL.VENDOR:                         Intel Corporation
GENERAL.PRODUCT:                        Ethernet Connection (5) I219-LM
GENERAL.DRIVER:                         e1000e
GENERAL.DRIVER-VERSION:                 3.2.6-k
GENERAL.FIRMWARE-VERSION:               0.1-3
GENERAL.HWADDR:
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.REASON:                         0 (No reason given)
GENERAL.UDI:                            /sys/devices/pci0000:00/0000:00:1f.6/net/enp0s31f6
GENERAL.IP-IFACE:                       enp0s31f6
GENERAL.IS-SOFTWARE:                    no
GENERAL.NM-MANAGED:                     yes
GENERAL.AUTOCONNECT:                    yes
GENERAL.FIRMWARE-MISSING:               no
GENERAL.NM-PLUGIN-MISSING:              no
GENERAL.PHYS-PORT-ID:                   --
GENERAL.CONNECTION:                     Wired connection 1
GENERAL.CON-UUID:                       bad1b2a1-db56-30fc-b668-75b636a1377a
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/4
GENERAL.METERED:                        no (guessed)
CAPABILITIES.CARRIER-DETECT:            yes
CAPABILITIES.SPEED:                     1000 Mb/s
CAPABILITIES.IS-SOFTWARE:               no
WIRED-PROPERTIES.CARRIER:               on
CONNECTIONS.AVAILABLE-CONNECTION-PATHS: /org/freedesktop/NetworkManager/Settings/{1}
CONNECTIONS.AVAILABLE-CONNECTIONS[1]:   bad1b2a1-db56-30fc-b668-75b636a1377a | Wired connection 1
IP4.ADDRESS[1]:                         192.168.1.230/24
IP4.GATEWAY:                            192.168.1.1
IP4.ROUTE[1]:                           dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.DNS[1]:                             208.67.222.222
IP4.DNS[2]:                             192.168.1.1
DHCP4.OPTION[1]:                        requested_subnet_mask = 1
DHCP4.OPTION[2]:                        requested_rfc3442_classless_static_routes = 1
DHCP4.OPTION[3]:                        subnet_mask = 255.255.255.0
DHCP4.OPTION[4]:                        domain_name_servers = 208.67.222.222 192.168.1.1
DHCP4.OPTION[5]:                        ip_address = 192.168.1.230
DHCP4.OPTION[6]:                        requested_static_routes = 1
DHCP4.OPTION[7]:                        dhcp_server_identifier = 192.168.1.1
DHCP4.OPTION[8]:                        requested_time_offset = 1
DHCP4.OPTION[9]:                        broadcast_address = 192.168.1.255
DHCP4.OPTION[10]:                       requested_interface_mtu = 1
DHCP4.OPTION[11]:                       dhcp_rebinding_time = 75600
DHCP4.OPTION[12]:                       requested_domain_name_servers = 1
DHCP4.OPTION[13]:                       dhcp_message_type = 5
DHCP4.OPTION[14]:                       requested_broadcast_address = 1
DHCP4.OPTION[15]:                       routers = 192.168.1.1
DHCP4.OPTION[16]:                       wpad = a
DHCP4.OPTION[17]:                       dhcp_renewal_time = 43200
DHCP4.OPTION[18]:                       requested_domain_name = 1
DHCP4.OPTION[19]:                       requested_routers = 1
DHCP4.OPTION[20]:                       expiry = 1553287280
DHCP4.OPTION[21]:                       requested_wpad = 1
DHCP4.OPTION[22]:                       host_name = jennifer-Precision-7520
DHCP4.OPTION[23]:                       requested_netbios_scope = 1
DHCP4.OPTION[24]:                       requested_ms_classless_static_routes = 1
DHCP4.OPTION[25]:                       requested_netbios_name_servers = 1
DHCP4.OPTION[26]:                       network_number = 192.168.1.0
DHCP4.OPTION[27]:                       requested_domain_search = 1
DHCP4.OPTION[28]:                       requested_ntp_servers = 1
DHCP4.OPTION[29]:                       next_server = 192.168.1.1
DHCP4.OPTION[30]:                       requested_host_name = 1
DHCP4.OPTION[31]:                       dhcp_lease_time = 86400
IP6.ADDRESS[1]:                         2601:982:c100:bf10:3884:d08c:764e:9aee/64
IP6.ADDRESS[2]:                         2601:982:c100:bf10:287a:d1a4:2b51:286e/64
IP6.ADDRESS[3]:                         fe80::754c:ec08:f9c2:6a82/64
IP6.GATEWAY:                            fe80::fa32:e4ff:feb8:3fc
IP6.DNS[1]:                             2601:982:c100:bf10::1
DHCP6.OPTION[1]:                        requested_dhcp6_domain_search = 1
DHCP6.OPTION[2]:                        dhcp6_name_servers = 2601:982:c100:bf10::1
DHCP6.OPTION[3]:                        dhcp6_server_id = 0:3:0:1:f8:32:e4:b8:3:f8
DHCP6.OPTION[4]:                        requested_dhcp6_client_id = 1
DHCP6.OPTION[5]:                        requested_dhcp6_name_servers = 1
DHCP6.OPTION[6]:                        dhcp6_info_refresh_time = 600
DHCP6.OPTION[7]:                        dhcp6_client_id = 0:4:5b:b9:7a:c:6c:6b:eb:3f:7d:dc:ec:f1:7a:dc:84:14

##### NetworkManager.state ##############

[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true

##### NetworkManager config #############

[[/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf]]
[connection]
wifi.powersave = 3

[[/etc/NetworkManager/NetworkManager.conf]]
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
[ifupdown]
managed=false

##### NetworkManager profiles ###########

[[/etc/NetworkManager/system-connections/Babylon]] (600 root)
[connection] id=Babylon | type=wifi | permissions=
[wifi] mac-address= | mac-address-blacklist= | ssid=Babylon
[ipv4] method=auto
[ipv6] method=auto

##### Netplan config ####################

##### iw reg get ########################

Region: America/New_York (based on set time zone)

country 00: DFS-UNSET
    (2402 - 2472 @ 40), (6, 20), (N/A)
    (2457 - 2482 @ 40), (6, 20), (N/A), PASSIVE-SCAN
    (2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
    (5170 - 5250 @ 160), (6, 20), (N/A), PASSIVE-SCAN
    (5250 - 5330 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
    (5490 - 5730
 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
    (5735 - 5835 @ 80), (6, 20), (N/A), PASSIVE-SCAN
    (57240 - 63720 @ 2160), (N/A, 0), (N/A)

##### iwlist channels ###################

lo        no frequency information.

enp0s31f6  no frequency information.

##### iwlist scan #######################

lo        Interface doesn't support scanning.

enp0s31f6  Interface doesn't support scanning.

##### module infos ######################

##### module parameters #################

##### /etc/modules ######################

##### modprobe options ##################

[/etc/modprobe.d/amd64-microcode-blacklist.conf]
blacklist microcode

[/etc/modprobe.d/blacklist-ath_pci.conf]
blacklist ath_pci

[/etc/modprobe.d/blacklist.conf]
blacklist evbug
blacklist usbmouse
blacklist usbkbd
blacklist eepro100
blacklist de4x5
blacklist eth1394
blacklist snd_intel8x0m
blacklist snd_aw2
blacklist i2c_i801
blacklist prism54
blacklist bcm43xx
blacklist garmin_gps
blacklist asus_acpi
blacklist snd_pcsp
blacklist pcspkr
blacklist amd76x_edac

[/etc/modprobe.d/blacklist-rare-network.conf]
alias net-pf-3 off
alias net-pf-6 off
alias net-pf-9 off
alias net-pf-11 off
alias net-pf-12 off
alias net-pf-19 off
alias net-pf-21 off
alias net-pf-36 off

[/etc/modprobe.d/intel-microcode-blacklist.conf]
blacklist microcode

[/etc/modprobe.d/iwlwifi.conf]
remove iwlwifi \
(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
&& /sbin/modprobe -r mac80211

[/etc/modprobe.d/mlx4.conf]
softdep mlx4_core post: mlx4_en

##### rc.local ##########################

exit 0

##### pm-utils ##########################

[/etc/pm/power.d/disable_wol] (777 root)
CONFFILE=/etc/default/tlp
LIBDIRS='/usr/lib /usr/lib64'
for d in ${LIBDIRS}; do
    if [ -d "${d}/pm-utils/power.d" ]; then
        blocked="${d}/pm-utils/power.d/${0##*/}"
        break
    fi
done
if [ -n "$blocked" ] && [ -x "$blocked" ]; then
    # else nothing to disable -> don't read $CONFFILE
    if [ -e "$CONFFILE" ] && . "$CONFFILE" && [ "$TLP_ENABLE" = '1' ]; then
        # TLP is enabled -> disable $blocked
        echo "Notice: '${blocked}' disabled by TLP."
    else
        exec "$blocked" $*
    fi
fi
exit 0

[/etc/pm/power.d/laptop-mode] (777 root)
CONFFILE=/etc/default/tlp
LIBDIRS='/usr/lib /usr/lib64'
for d in ${LIBDIRS}; do
    if [ -d "${d}/pm-utils/power.d" ]; then
        blocked="${d}/pm-utils/power.d/${0##*/}"
        break
    fi
done
if [ -n "$blocked" ] && [ -x "$blocked" ]; then
    # else nothing to disable -> don't read $CONFFILE
    if [ -e "$CONFFILE" ] && . "$CONFFILE" && [ "$TLP_ENABLE" = '1' ]; then
        # TLP is enabled -> disable $blocked
        echo "Notice: '${blocked}' disabled by TLP."
    else
        exec "$blocked" $*
    fi
fi
exit 0

[/etc/pm/power.d/pci_devices] (777 root)
CONFFILE=/etc/default/tlp
LIBDIRS='/usr/lib /usr/lib64'
for d in ${LIBDIRS}; do
    if [ -d "${d}/pm-utils/power.d" ]; then
        blocked="${d}/pm-utils/power.d/${0##*/}"
        break
    fi
done
if [ -n "$blocked" ] && [ -x "$blocked" ]; then
    # else nothing to disable -> don't read $CONFFILE
    if [ -e "$CONFFILE" ] && . "$CONFFILE" && [ "$TLP_ENABLE" = '1' ]; then
        # TLP is enabled -> disable $blocked
        echo "Notice: '${blocked}' disabled by TLP."
    else
        exec "$blocked" $*
    fi
fi
exit 0

[/etc/pm/power.d/pcie_aspm] (777 root)
CONFFILE=/etc/default/tlp
LIBDIRS='/usr/lib /usr/lib64'
for d in ${LIBDIRS}; do
    if [ -d "${d}/pm-utils/power.d" ]; then
        blocked="${d}/pm-utils/power.d/${0##*/}"
        break
    fi
done
if [ -n "$blocked" ] && [ -x "$blocked" ]; then
    # else nothing to disable -> don't read $CONFFILE
    if [ -e "$CONFFILE" ] && . "$CONFFILE" && [ "$TLP_ENABLE" = '1' ]; then
        # TLP is enabled -> disable $blocked
        echo "Notice: '${blocked}' disabled by TLP."
    else
        exec "$blocked" $*
    fi
fi
exit 0

[/etc/pm/power.d/sched-powersave] (777 root)
CONFFILE=/etc/default/tlp
LIBDIRS='/usr/lib /usr/lib64'
for d in ${LIBDIRS}; do
    if [ -d "${d}/pm-utils/power.d" ]; then
        blocked="${d}/pm-utils/power.d/${0##*/}"
        break
    fi
done
if [ -n "$blocked" ] && [ -x "$blocked" ]; then
    # else nothing to disable -> don't read $CONFFILE
    if [ -e "$CONFFILE" ] && . "$CONFFILE" && [ "$TLP_ENABLE" = '1' ]; then
        # TLP is enabled -> disable $blocked
        echo "Notice: '${blocked}' disabled by TLP."
    else
        exec "$blocked" $*
    fi
fi
exit 0

[/etc/pm/power.d/usb_bluetooth] (777 root)
CONFFILE=/etc/default/tlp
LIBDIRS='/usr/lib /usr/lib64'
for d in ${LIBDIRS}; do
    if [ -d "${d}/pm-utils/power.d" ]; then
        blocked="${d}/pm-utils/power.d/${0##*/}"
        break
    fi
done
if [ -n "$blocked" ] && [ -x "$blocked" ]; then
    # else nothing to disable -> don't read $CONFFILE
    if [ -e "$CONFFILE" ] && . "$CONFFILE" && [ "$TLP_ENABLE" = '1' ]; then
        # TLP is enabled -> disable $blocked
        echo "Notice: '${blocked}' disabled by TLP."
    else
        exec "$blocked" $*
    fi
fi
exit 0

[/etc/pm/power.d/wireless] (777 root)
CONFFILE=/etc/default/tlp
LIBDIRS='/usr/lib /usr/lib64'
for d in ${LIBDIRS}; do
    if [ -d "${d}/pm-utils/power.d" ]; then
        blocked="${d}/pm-utils/power.d/${0##*/}"
        break
    fi
done
if [ -n "$blocked" ] && [ -x "$blocked" ]; then
    # else nothing to disable -> don't read $CONFFILE
    if [ -e "$CONFFILE" ] && . "$CONFFILE" && [ "$TLP_ENABLE" = '1' ]; then
        # TLP is enabled -> disable $blocked
        echo "Notice: '${blocked}' disabled by TLP."
    else
        exec "$blocked" $*
    fi
fi
exit 0

[/etc/pm/power.d/xfs_buffer] (777 root)
CONFFILE=/etc/default/tlp
LIBDIRS='/usr/lib /usr/lib64'
for d in ${LIBDIRS}; do
    if [ -d "${d}/pm-utils/power.d" ]; then
        blocked="${d}/pm-utils/power.d/${0##*/}"
        break
    fi
done
if [ -n "$blocked" ] && [ -x "$blocked" ]; then
    # else nothing to disable -> don't read $CONFFILE
    if [ -e "$CONFFILE" ] && . "$CONFFILE" && [ "$TLP_ENABLE" = '1' ]; then
        # TLP is enabled -> disable $blocked
        echo "Notice: '${blocked}' disabled by TLP."
    else
        exec "$blocked" $*
    fi
fi
exit 0

##### udev rules ########################

##### dmesg #############################

[ 6773.357055] IPv6: ADDRCONF(NETDEV_UP): enp0s31f6: link is not ready (repeated 2 times)
[ 6776.194058] e1000e: enp0s31f6 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx
[ 6776.194132] IPv6: ADDRCONF(NETDEV_CHANGE): enp0s31f6: link becomes ready

########## wireless info END ############


text:
Q: How to access a property of an element xamarin forms? How to access a property of an element of a page in xamarin forms from Android and IOS projects?
For example:
Button1.IsVisible = false;

but since the Android project.

A: you could access properties of page elements in the code behind file, but that is generally not a good or clean strategy.
A simple sample would be Page.xaml:
<Button x:Name="Button1" Content="Sample String"/>

And then in your  Page.xaml.cs
Button1.IsVisible = false;

The better way is that you might want to check out the DataBinding mechanism:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/data-binding/
As a small example you would have a BindingContext/ViewModel that implements INotifyPropertyChanged. With that you could go like this:
private bool _isVisible;
public bool IsVisible
{
    get => this._isVisible;
    set
    {
        if(this._isVisible != value){
            this.IsVisible;
    }
}

And then in your Page.xaml:
<Button IsVisibile="{Binding IsVisible} Content="Sample String"/>

You can set the BindingContext inside your Page.xaml.cs:
this.BindingContext = new ViewModel(); //If the properties are in a separate class (preferred)
this.BindingContext = this; //If the properties are in the page class

A: Thanks, I solved it with this:

MessagingCenter.Subscribe<object>(this, "btButton1Visible", (sender) =>
                {
                    Button1.IsVisible = false;
                });


text:
Q: Как вывести список дочерних страниц с кастомными полями Wordpress? Всем привет. Такой вопрос по Wordpress: есть родительская страница, на которую нужно вывести дочерние, на шаблоне страницы есть кастомные поля, сделанные с помощью плагина Magic Fields. Вывести список дочерних страниц удалось, но нужно вместе с этим вывести некоторые кастомные поля из этих дочек. Как это можно реализовать?
Вывести дочерние страницы получилось таким образом:

            <?php
            wp_list_pages( array(
                'depth'        => 1,
                'title_li'    => '',
                'child_of'    => $post->ID,
                ) );
            ?>

A: Вам надо реализовывать цикл WordPress через WP_Query, а в цикле для каждой страницы выводить нужные кастомные поля.
global $post;

$args = array(
    'post_type' => 'page',
    'post_parent' => $post->ID,
);

$query = new WP_Query( $args );

if ( $query->have_posts() ) {
    while ( $query->have_posts() ) {
        $query->the_post();
        // Здесь ваш код
        echo $post->post_title; // Например, вывод названия страницы
        // Вывод кастомных полей
    }
} else {
    echo 'Нет записей';
}

wp_reset_postdata();

A:
                    <?php $penis = get_the_ID(); ?>
                    <?php
                $sort = $_COOKIE["catalog_sort"];
                $show_count = (int)$_COOKIE["catalog_show_count"];
                $sort = str_replace('\\', "", $sort);
                $sort = json_decode($sort, true);

                if(!$show_count)
                    $show_count = 24;

                $queryArr = array(
                    'post_type'         => 'page',
                    'post_parent'       => $penis,
                    'meta_query'        => array(
                        "template"  => array(
                            "key"   => "_wp_page_template",
                            "value" => "templates/catalogue_detail.php",
                            "type"  => 'NUMERIC'
                        ),
                    ),
                    'paged'             => $currPage,
                    'posts_per_page'    => $show_count,
                    'order'             => strtoupper($sort["type"]),
                );

                if($sort)
                {
                    switch ($sort["by"]) {

                        case 'alphabet':
                            $queryArr["orderby"] = "title";
                            break;
                        case 'price':
                            $queryArr["meta_key"] = "item_price";
                            $queryArr["orderby"] = "meta_value_num";
                            break;
                    }
                }

                $query = new WP_Query( $queryArr );
                while ($query->have_posts()) : $query->the_post();?>
                <?php $aidi = get_the_ID(); ?>

            <div class="section__top section__top_page contacts__top" style="background-image: url('<?php the_field( "картинкарррррррррр" );?>')">

      <svg class="section__triangle" viewbox="0 0 1000 105" preserveaspectration="none">
        <polygon class="section__polygon" points="0,10 0,105 800,105 800,120"></polygon>
        <polygon class="section__polygon" points="1000,0 1000,105 500,105 500,85"></polygon>
      </svg>

<?php the_title()?>

                <div class="section__img-pic" style="background-image: url('<?php the_post_thumbnail_url() ?>')">

<?php the_title()?>

<?php the_content(); ?>

<?php the_field( "urokiaaa" );?>

<a class="courses__btn section__btn section__btn_darken" href="<?php the_permalink(); ?>">подробнее

                <?php
                endwhile;
                wp_reset_query();
                ?>


text:
Q: Google Event Tracking Using jquery multiple events Complete novice and surprised to get this far, using google and youtube.

How can I merge the two, in the current format it wont work on analytics for tracking the two different events.

A: You can make use of HTML5 data attributes to save your Analytics category/other data on the element itself.
In jquery you can do something like this:

$('.clickable').on('click', function() {
  var gaCategory = $(this).data('category');
  var gaLabel = $(this).data('label');

  alert('Category: ' + gaCategory + ', Label: ' + gaLabel);
});
.clickable {
  width: 50px;
  height: 50px;
  background: green;
  margin: 5px;
}


text:
Q: Recursively output a php array in nested div? I have an array with a data structure like below
$array = array(
   'someKey' => array(
       'id' => 1,
       'string' => 'some key',
       'someKey2' => array(
            'id' => 1,
            'string' => 'some key two',
            'someKeyThree' => array(
                 'id' => 1,
                 'string' => 'some key three',
            ,
       ),
   ),
   'someOtherKey' => array(

   ),
);

What I would like to do is out every array as a nested div p structure,

someKey
 // key of first array value

someKey2

SomeKeyThree

I have tried using new RecursiveIteratorIterator(new RecursiveArrayIterator($this->getData(), RecursiveIteratorIterator::CHILD_FIRST));
and using that but I am having trouble as the end tag for div never ends up right. Also once the iterator reaches the bottom of an array with no array to go into I want it to stop iterating completely.
THanks

A: You have to call a function recursively.
function printUl($arr){
$output = "
";
foreach ($arr as $key => $val){
  if (is_array($val)){
    $output .= printUl($val);
    continue;
  }
  else{
  $output .= "
".$val."
"

  }
$output .= "
";
return $output;
}
}


text:
Q: Which microcontroller for audio synthesis/processing? I want to get started designing my own hardware (digital) audio devices for signal generation and processing. The end goal is to design products which will be part of a modular synthesizer system.
I'm a bit of a beginner with hardware so I'm after some advice on an appropriate type of microcontroller to use. What features should I look for in a microcontroller to satisfy the needs.
I will need digital I/O for switches and audio in and out (presumably I will use discrete DACs/ADCs), analogue I/O for real-time control (pots/faders etc.) and sufficient computational power to do real-time DSP at reasonably high quality.
Through a bit of research and looking at the specs of existing hardware I was thinking that starting off with something general like an ARM Cortex M3 or M4. Would this microcontroller types be appropriate? I'd like if possible to program it in C.
The issue then is how I go about programming/prototyping with what I choose.
Should I get a development board? Will that include some kind of IDE? Can I get a bare chip and program it as is?
Any advice or redirection elsewhere is appreciated.

A: Look at Microchip dsPIC family of microcontrollers as the features they offer may fit your needs.
The family offers the following features:

*

*16 to 70 MIPS, DSP options

*30 MIPS DSC at 5V

*Intelligent Integrated Analog: Op Amps, 10/12/16-bit ADC, DAC

*Integrated Codec interface

*Motor Control peripherals

You can find more detailed about dsPIC30F features here:

A: The ARM Cortex M3 mbed LPC1768 board might suit your needs. It has 1 analog output, and 5 analog inputs and it runs at 100 MHz. You can find it here.


text:
Q: AttributeError: 'int' object has no attribute 'get'? Basically, I created another window when the #Topscores method is called. In this window there is a listbox and a Sort button.
When i click the Sort button, it suppose to sort the values in the listbox, however whenever i clicked on the Sort button, it shows

AttributeError: 'int' object has no attribute 'get'

on this line of code
temp_list = list(topscoreslistbox.get(0,END))

Anyone can help me with this?
By the way how the Listbox gets its values is from the #TopscoresStop method.
def main():
        root = Tk()
        root.wm_attributes("-topmost", 1)
        root.title("Solar Car Racing")
        root.geometry("1600x900")
        topscoreslistbox = 0

        sw = StopWatch(root)
        sw.place(x=120, y=80)

        sw2 = StopWatch2(root)
        sw2.place(x=840, y=80)

    def Topscores():
        toplevel() = Toplevel()
        toplevel.title("Top Scores")
        topscoreslistbox = Listbox(toplevel, selectmode=EXTENDED, height=3, width=20, font=("Helvetica", 26))
        topscoreslistbox.pack(side=RIGHT, fill=BOTH, expand=1, pady=5, padx=2)

        first = Label(toplevel, text=("1st"), font=("Algerian", 30))
        first.pack(side=TOP)

        second = Label(toplevel, text=("2nd"), font=("Algerian", 30))
        second.pack(side=TOP)

        third = Label(toplevel, text=("3rd"), font=("Algerian", 30))
        third.pack(side=TOP)

        Buttonsort = Button(toplevel, text="Sort", command=Sort)
        Buttonsort.pack()

    def TopscoresStop():
        tempo = sw._elapsedtime - sw.lapmod2
        tempo2 = sw2._elapsedtime2 - sw2.lapmod2

            if sw._running:
                sw.after_cancel(sw._timer)
                sw._elapsedtime = time.time() - sw._start
                sw._setTime(sw._elapsedtime)
                sw._running = 0

            if len(sw.laps) == 3:
                return

            sw.laps.append(sw._setLapTime(tempo))
            topscoreslistbox.insert(END, (str(sw.one.get()) , "%.2f" % sw._elapsedtime))
            topscoreslistbox.yview_moveto(1)

            if sw2._running2:
                sw2.after_cancel(sw2._timer2)
                sw2._elapsedtime2 = time.time() - sw2._start2
                sw2._setTime(sw2._elapsedtime2)
                sw2._running = 0

            if len(sw2.laps) == 3:
                return

            sw2.laps.append(sw2._setLapTime(tempo))
            topscoreslistbox.insert(END, (str(sw.two.get()) , "%.2f" % sw2._elapsedtime2))
            topscoreslistbox.yview_moveto(1)

    def Sort():
        temp_list = list(topscoreslistbox.get(0,END))
        temp_list.sort()
        topscoreslistbox.delete(0, END)
        for item in temp_list:
            topscoreslistbox.insert(END, item)


text:
Q: Transferring tables with an "insert from location" statement in Sybase IQ is very slow I am trying to transfer several tables from a Sybase IQ database on one machine, to the same database on another machine (exact same schema and table layout etc).
To do this I'm using an insert from location statement:
insert into <local table> location <other machine> select * from mytablex

This works fine, but the problem is that it is desperately slow. I have a 1 gigabit connection between both machines, but the transfer rate is nowhere near that.
With a 1 gigabyte test file, it takes only 1 or 2 minutes to transfer it via ftp (just as a file, nothing to do with IQ).
But I am only managing 100 gigabytes over 24 hours in IQ. That means that the transfer rate is more like 14 or 15 minutes for 1 gigabyte for the data going through Sybase IQ.
Is there any way I can speed this up?
I saw there is an option to change the packet size, but would that make a difference? Surely if the transfer is 7 times faster for a file the packet size can't be that much of a factor?
Thanks! :)

A: It appears from the documentation here and here that using insert into is a row by row operation, and not a bulk operation.  This could explain the performance issues that you are seeing.
You may want to look at the bulk loading LOAD TABLE operation instead.

A: If I recall correctly, IQ 15.x has known bugs where packetsize is effectively ignored for insert...location...select and the default 512 is always used.
The insert...location...select is a bulk tds operation typically, however we have found it to have limited value when working with gigabytes of data, and built a process to handle extract/Load Table that is significantly faster.
I know it's not the answer you want, but performance appears to degrade as the data size grows.  Some tables will actually never finish, if they are large enough.
Just a thought, you might want to specify the exact columns and wrap in an exec with dynamic sql.  Dynamic SQL is a no-no, but if you need the proc executable in dev/qa + prod environments, there really isn't another option.  I'm assuming this will be called in a controlled environment anyways, but here's what I mean:
declare @cmd varchar(2500), @location varchar(255)

set @location = 'SOMEDEVHOST.database_name'

set @cmd =    'insert localtablename (col1, col2, coln...) ' +
              ''''+ trim(@location)+ '''' +
              ' { select col1, col2, coln... from remotetablename}'

select @cmd

execute(@cmd)
go


text:
Q: Tastypie limit user to create more resources I have a subscription service online app. If the user has payed he may create as many resources as he want, if not he would be limited.
def obj_create(self, bundle, **kwargs):
    current_user = auth.get_user(bundle.request)
    if current_user.get_profile().has_payed:
        return super(ClientResource, self).obj_create(bundle, user=current_user)
    else:
        if Client.objects.filter(user=current_user).count() < 2:
            print "you may create"
            return super(ClientResource, self).obj_create(bundle, user=current_user)
        else:
            return ???

Is this the correct way? And what do I need to return to tell the user the custom message of "Sorry you have reached the limit, please pay up"

A: I suggest you simply return a 401 (unauthorized) http response. Its the RESTFul thing to do


text:
Q: How to keep from inserting duplicated rows into a table? I have a table MY_TABLE that contains records as follows:

NAME
ID1
ID2
FLAG

JESSICA
12
34
TRUE

NULL
12
34
TRUE

I want to insert into another table TEST the values from the last 3 columns from MY_TABLE but I don't want to duplicate the rows
I am trying to do:
INSERT ALL
WHEN ID1 IS NOT NULL AND FLAG THEN
INTO TEST VALUES (
ID1,
ID2,
FLAG
)
SELECT *
FROM MY_TABLE
LEFT JOIN TEMP ON ID1;

This is resulting in my table looking like:

ID1
ID2
FLAG

12
34
TRUE

12
34
TRUE

instead of:

ID1
ID2
FLAG

12
34
TRUE

The issue I am running into is that these duplicated values for these last 3 columns are resulting from my join and I can't select only the last 3 columns in my query because I need the first column for another table I am inserting into as well (not shown and also is the reason why I need to use INSERT ALL here). Is there a way to solve this duplicate rows issue within the INSERT itself?

A: You can project a column with a row number for each group of rows and use the row number to decide which row to use in your multi-table insert.
create or replace temp table T1 as
select
COLUMN1::string as "NAME",
COLUMN2::string as "ID1",
COLUMN3::string as "ID2",
COLUMN4::string as "FLAG"
from (values
('JESSICA','12','34','TRUE'),
('NULL','12','34','TRUE')
);

select   NAME
        ,ID1
        ,ID2
        ,FLAG
        ,row_number() over (partition by ID1, ID2, FLAG order by NAME nulls last) ROWNUMBER
from t1
;

That select will produce a result set like this:

NAME
ID1
ID2
FLAG
ROWNUMBER

JESSICA
12
34
TRUE
1

NULL
12
34
TRUE
2

In your multi-table insert, you can then key off the ROWNUMBER column:
INSERT ALL
WHEN ID1 IS NOT NULL AND FLAG AND ROWNUMBER = 1 THEN
[etc., etc.]


text:
Q: modernizr $ is not a function I have a modernizr file that looks like this:
var popup = {};

//wait until main document is loaded
window.addEventListener('load', function()
{

    Modernizr.load([
        {
            // these files are always loaded
            load : [
                'assets/js/plugins/additems.js'
            ],
            // called when all files have finished loading
            // and executing
            complete : function() {
                // show the first screen
                popup.addItems.setDialogueContainer( '#popup' );

                $( '.stat .add-more' ).bind('click', function(e) {
                    e.preventDefault();

                    // Open popup
                    popup.addItems.openDialogue( $(this) );
                });
            }
        }
    ]);

}, false);

Before this file is included, I include JQuery and a lot of other javascript files via gulp. I have another file set up almost exactly like this, but different functionality in the complete function and it works just fine.
I'm not sure why I'm getting this error:

Uncaught TypeError: $ is not a function          pet-panel.js:19

Line 19 is $( '.stat .add-more' ).bind('click', function(e) {.. any help would be appreciated.
I know this error message typically means jQuery isn't loaded, but it IS loaded.. all my other jQuery usage works fine like my navigation drop downs, my other popups, etc. So jQuery IS loading.. but maybe not before this file? However I tried $(document).ready(function() {}); too, but that throws the same error since it uses $.
I tried doing jQuery instead of $, but then none of my code works..


text:
Q: Indefinite integral of $\frac{\arctan x}{x^2+1}$ EDIT: I was studying from a site that uses really ambiguous notation so I misread $\arctan\ (x)^2$ as $\arctan\ (x^2)$. Now I can see why the integral is actually $\frac{1}{2} \arctan^2\ x + c $. Thanks to everyone who answered and corrected me!
Why is $$\int\frac{\arctan\ x}{x^2+1} dx=\frac{1}{2}\arctan(x^2)+c$$
instead of $\int u\ du$ where $u=\arctan\ x$ and $du=\frac{1}{x^2+1} dx$, thus $$\begin{align} &\int\frac{\arctan\ x}{x^2+1} dx=\int \arctan\ x\ dx \\
&x\ \arctan\ x-\int \frac{x}{x^2+1}\ dx \\
&x\ \arctan\ x -\frac{1}{2}\ln(x^2+1)+c\end{align}$$
Is there something I'm not getting? I'd like to see the steps for the correct calculation so I can better understand it. Thanks!

A: instead of $\int u\ du$ where $u=\arctan\ x$ and $du=\frac{1}{x^2+1} dx$, thus $$\int\frac{\arctan\ x}{x^2+1} dx=\int u du= \frac12u^2+C=\frac12(\arctan x)^2+C$$

A: Hint
Notice that
$$\int f'f=\frac12 f^2+c$$
so the answer for your antiderivative is $\frac12(\arctan x)^2+c$.

A: Your notation may be a bit off?
Doing the $u$-substitution gives
$$\int \frac{\arctan x}{1+x^2}dx = \int u\text{ }du = \frac{u^2}{2} + C = \frac{(\arctan x)^2}{2} + C.$$
Note that $(\arctan x)^2 \neq \arctan \left(x^2\right)$.


text:
Q: Wi-fi is not working! Help! here is the dmesg of a normally working device

 2.866051] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.866053] usb 1-2: Product: 802.11 n WLAN
[    2.866054] usb 1-2: Manufacturer: MediaTek
[    2.866055] usb 1-2: SerialNumber: 1.0
[   11.696348] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   11.696806] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   13.158884] usb 1-2: reset full-speed USB device number 3 using ohci-pci
[   17.414800] mt7601u 1-2:1.0: ASIC revision: 76010001 MAC revision: 76010500
[   19.403803] snd_intel8x0 0000:00:05.0: white list rate for 1028:0177 is 48000
[   19.461657] audit: type=1400 audit(1658331267.603:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/sbin/dhclient" pid=527 comm="apparmor_parser"
[   19.461661] audit: type=1400 audit(1658331267.603:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=527 comm="apparmor_parser"
[   19.461663] audit: type=1400 audit(1658331267.603:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=527 comm="apparmor_parser"
[   19.461665] audit: type=1400 audit(1658331267.603:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=527 comm="apparmor_parser"
[   19.631605] audit: type=1400 audit(1658331267.775:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/man" pid=541 comm="apparmor_parser"
[   19.631608] audit: type=1400 audit(1658331267.775:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="man_filter" pid=541 comm="apparmor_parser"
[   19.631610] audit: type=1400 audit(1658331267.775:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="man_groff" pid=541 comm="apparmor_parser"
[   19.632739] audit: type=1400 audit(1658331267.775:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/evince" pid=528 comm="apparmor_parser"
[   19.632742] audit: type=1400 audit(1658331267.775:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/evince//sanitized_helper" pid=528 comm="apparmor_parser"
[   19.632743] audit: type=1400 audit(1658331267.775:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/evince-previewer" pid=528 comm="apparmor_parser"
[   21.042111] mt7601u 1-2:1.0: EEPROM ver:0d fae:00
[   21.079575] mt7601u 1-2:1.0: EEPROM country region 01 (channels 1-13)
[   24.074229] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   24.075943] usbcore: registered new interface driver mt7601u
[   24.107078] mt7601u 1-2:1.0 wlx502b73c4c4ea: renamed from wlan0
[   29.750930] e1000: enp0s3 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
[   29.751240] IPv6: ADDRCONF(NETDEV_CHANGE): enp0s3: link becomes ready
[   40.321620] wlx502b73c4c4ea: authenticate with 46:d5:f2:2c:9b:17
[   41.094651] wlx502b73c4c4ea: send auth to 46:d5:f2:2c:9b:17 (try 1/3)
[   41.098972] wlx502b73c4c4ea: authenticated
[   46.096019] wlx502b73c4c4ea: aborting authentication with 46:d5:f2:2c:9b:17 by local choice (Reason: 3=DEAUTH_LEAVING)
[   51.969976] wlx502b73c4c4ea: authenticate with 46:d5:f2:2c:9b:17
[   52.558013] wlx502b73c4c4ea: send auth to 46:d5:f2:2c:9b:17 (try 1/3)
[   52.562027] wlx502b73c4c4ea: authenticated
[   57.558738] wlx502b73c4c4ea: aborting authentication with 46:d5:f2:2c:9b:17 by local choice (Reason: 3=DEAUTH_LEAVING)
[   63.115151] rfkill: input handler disabled
[   63.608021] wlx502b73c4c4ea: authenticate with 46:d5:f2:2c:9b:17
[   64.545758] wlx502b73c4c4ea: send auth to 46:d5:f2:2c:9b:17 (try 1/3)
[   64.733516] wlx502b73c4c4ea: authenticated
[   66.016199] wlx502b73c4c4ea: aborting authentication with 46:d5:f2:2c:9b:17 by local choice (Reason: 3=DEAUTH_LEAVING)
[   74.619422] wlx502b73c4c4ea: authenticate with 46:d5:f2:2c:9b:17
[   75.302437] wlx502b73c4c4ea: send auth to 46:d5:f2:2c:9b:17 (try 1/3)
[   75.306721] wlx502b73c4c4ea: authenticated

reconnecting the device and it no longer works

[   88.088803] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   88.088810] usb 1-2: Product: 802.11 n WLAN
[   88.088812] usb 1-2: Manufacturer: MediaTek
[   88.088813] usb 1-2: SerialNumber: 1.0
[   88.362370] usb 1-2: reset full-speed USB device number 4 using ohci-pci
[   88.706512] mt7601u 1-2:1.0: ASIC revision: 76010001 MAC revision: 76010500
[   88.797361] mt7601u 1-2:1.0: Firmware Version: 0.1.00 Build: 7640 Build time: 201302052146____
[   92.898223] mt7601u 1-2:1.0: Vendor request req:02 off:0a44 failed:-110
[   96.578171] mt7601u 1-2:1.0: Vendor request req:02 off:0230 failed:-110
[  100.242872] mt7601u 1-2:1.0: Vendor request req:02 off:0400 failed:-110
[  104.166451] mt7601u 1-2:1.0: Vendor request req:02 off:0800 failed:-110
[  108.408306] mt7601u 1-2:1.0: Vendor request req:07 off:0404 failed:-110
[  112.130337] mt7601u 1-2:1.0: Vendor request req:02 off:0404 failed:-110
[  116.019884] mt7601u 1-2:1.0: Vendor request req:02 off:0800 failed:-110
[  120.158702] mt7601u 1-2:1.0: Vendor request req:02 off:0238 failed:-110
[  123.710759] mt7601u 1-2:1.0: Vendor request req:07 off:0238 failed:-110
[  127.134271] mt7601u 1-2:1.0: Vendor request req:02 off:0238 failed:-110
[  130.686759] mt7601u 1-2:1.0: Vendor request req:02 off:0238 failed:-110
[  134.174269] mt7601u 1-2:1.0: Vendor request req:02 off:09a0 failed:-110
[  138.159001] mt7601u 1-2:1.0: Vendor request req:02 off:09a4 failed:-110
[  142.165273] mt7601u 1-2:1.0: Vendor request req:02 off:09c4 failed:-110
[  146.131767] mt7601u 1-2:1.0: Vendor request req:02 off:0a6c failed:-110
[  149.954101] mt7601u 1-2:1.0: Vendor request req:42 off:0230 failed:-110
[  153.470545] mt7601u 1-2:1.0: Vendor request req:07 off:0080 failed:-110
[  156.897354] mt7601u 1-2:1.0: Vendor request req:02 off:0080 failed:-110
[  160.254284] mt7601u 1-2:1.0: Vendor request req:02 off:0080 failed:-110
[  160.254413] mt7601u: probe of 1-2:1.0 failed with error -110
[  174.585841] usb 1-2: USB disconnect, device number 4


text:
Q: VBA how do i have the same code on a command button but with changed variables completely new to VBA (and coding really) and have started today so i can imagine this problem has a relatively simple fix.
I want to create a revision logger for multiple subjects and the code just for 1 subject is working great. Here is what i have got. (i cannot place pictures so here is the link.)
http://i.imgur.com/Up2Pf8r.png
here is the code for the command button (notr stands for number of times revised)
Private Sub revision_Click()

Dim check As String

If revision.Caption = "StartRevision" Then
revision.Caption = "EndRevision"
Else
revision.Caption = "StartRevision"
End If

Dim column As Integer
Dim notr As Integer

notr = Cells(*2*, 5).Value
column = notr + 6

If revision.Caption = "StartRevision" Then
Cells(*3*, column).Value = Now
Cells(*3*, column).NumberFormat = "dd/mm/yyyy hh:mm:ss"
Cells(*4*, column).Value = Abs((Cells(2, column)) - (Cells(3, column)))
Cells(*4*, column).NumberFormat = "hh:mm:ss"
Else
Cells(*2*, column).Value = Now
Cells(*2*, column).NumberFormat = "dd/mm/yyyy hh:mm:ss"
End If

If revision.Caption = "StartRevision" Then
notr = notr + 1
Cells(*2*, 5).Value = notr
End If

End Sub

now though i wish to copy and paste that command button for the other subjects. Now i can do this easily by changing the numbers i have labelled with *'s every time for each button but i was wondering if there is a way of doing this but making those * numbers variables and just have that code once and then for each subject just have to change those variables instead of having to copy and paste the whole code many times.
i understand that iam not being very clear so sorry :( but any help would be much appreciated.
thanks.

A: Instead of putting all your code on the button click event have a separate sub which takes a parameter(s) for the elements you want to change. So instead of a first line as this:
Private Sub revision_Click()

Use this:
Private Sub revision(MyVar As Long)

Then replace the parts of your code you want to change by using MyVar, this will take a bit of reworking to get the cell numbers you want from the one number. Then for each button use some code like so:
Private Sub Button1_Click()
  revision 1
End Sub

Private Sub Button2_Click()
  revision 2
End Sub


text:
Q: Does spring always ensure same creation order for independent beans? Let's say, I have 4 beans like,
@Component
public class Bean11 {

  @PostConstruct
  public void post(){
   System.out.println("I am bean # 1");
  }
}

@Component
public class Bean2 {

  @PostConstruct
  public void post(){
   System.out.println("I am bean # 2");
  }
}

@Component
public class Bean3 {

  @PostConstruct
  public void post(){
   System.out.println("I am bean # 3");
  }
}

@Component
public class Bean4 {

  @PostConstruct
  public void post(){
   System.out.println("I am bean # 4");
  }
}

none of these are dependent on each other. Will their creation always be in the same order or will spring just randomly instantiate them?


text:
Q: Luarocks upload - "Error: file not found" I'm trying to use luarocks to upload a project. However, when I run
$ luarocks upload kong-plugin-hello-0.1.0-1.rockspec --api-key=<REDACTED>

It returns Error: File not found: git:github.com/JoshTheGoldfish/kong-plugin-hello
Below is my rockspec:
package = "kong-plugin-hello"
version = "0.1.0-1"

local pluginName = package:match("^kong%-plugin%-(.+)$")  -- "myPlugin"

supported_platforms = {"linux", "macosx"}

source = {
   url = "git:github.com/JoshTheGoldfish/kong-plugin-hello",
   tag = "v0.1.0",
}

description = {
  summary = "Kong is a scalable and customizable API Management Layer built on top of Nginx.",
  homepage = "http://getkong.org",
  license = "Apache 2.0"
}

dependencies = {
}

build = {
  type = "builtin",
  modules = {
    ["kong.plugins."..pluginName..".handler"] = "kong/plugins/"..pluginName.."/handler.lua",
    ["kong.plugins."..pluginName..".schema"] = "kong/plugins/"..pluginName.."/schema.lua",
  }
}

Any my code can be found here: https://github.com/JoshTheGoldfish/kong-plugin-hello
Any clue what I might be missing here?

A: source.url needed to be: git://github.com... not git:github.com...


text:
Q: How to call a c++ function multiple times based off of a users input? This is a two fold question. I am trying to build a program were I am able to call a function based on the input of a user. Basically the program will ask the user how many sets of random numbers they would like. And based on their answer I would like to call my function based on their answer. Is that possible? Thanks ! My code is below.
#include<iostream>
#include<stdlib.h>

void randomGenerator()
{
    int i;          //loop counter
    int num;        //store random number

    int randomize();    //call it once to generate random number
    for(i=1;i<=10;i++)
    {
        num=rand()%100; //get random number
        std::cout << num << "\t";
    }

}

int main(){
    randomGenerator();
    return 0;
}

A: What's wrong with using a loop?
cout << "how many random numbers? ";
int num;
cin >> num;
for (int i = 0; i < num; ++i)
    randomGenerator();

Incidentally
int randomize();    //call it once to generate random number

is a function prototype, not a function call. So you aren't calling that function any number of times.
If you want to call the function once, do it in main before you do anything else and put the prototype at the top of your code, where it belongs.
int randomize();    // here the prototype for randomize

int main()
{
    randomize(); // and here's the call to randomize
    ...
}

A: in you int main() you have just to add to while lke this
     int main() {
     int times = 0;
     int timeNumber = 0;

     printf("how many randow numbers you want to generate? ");
     scanf("%d",&times);

      while(timeNumber < times)
       {
         timeNumber++;
         randomGenerator();
       }
       return 0;

     }


text:
Q: Returning photos from Instagram by hashtag to my ios app I have an app in which I want to have 10 UIImage objects that hold first 10 images by hashtag #clock. What is the best way to do this? And do I have to authorize into Instagram?

A: Connect to the Instagram API using NSURLConnection. The API endpoints will return you responses in JSON format. You will then need to parse those responses using something like NSJSONSerialization. Pick the image URLs from the response and create UIImage instances from them.
You won't need to authenticate for most of the API calls, but you will need to request a client ID. Looks like you could use the tags/tag-name/media/recent endpoint of the Instagram API for what you are trying to do.


text:
Q: Flickr Geo queries not returning any data I cannot get the Flickr API to return any data for lat/lon queries.
view-source:http://api.flickr.com/services/rest/?method=flickr.photos.search&media=photo&api_key=KEY_HERE&has_geo=1&extras=geo&bbox=0,0,180,90
This should return something, anything. Doesn't work if I use lat/lng either. I can get some photos returned if I lookup a place_id first and then use that in the query, except then all the photos returned are from anywhere and not the place id
Eg,
http://api.flickr.com/services/rest/?method=flickr.photos.search&media=photo&api_key=KEY_HERE&placeId=8iTLPoGcB5yNDA19yw
I deleted out my key obviously, replace with yours to test.
Any help appreciated, I am going mad over this.

A: I believe that the Flickr API won't return any results if you don't put additional search terms in your query.  If I recall from the documentation, this is treated as an unbounded search.  Here is a quote from the documentation:
Geo queries require some sort of limiting agent in order to prevent the database from crying. This is basically like the check against "parameterless searches" for queries without a geo component.

A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters — If no limiting factor is passed we return only photos added in the last 12 hours (though we may extend the limit in the future).
My app uses the same kind of geo searching so what I do is put in an additional search term of the minimum date taken, like so:
http://api.flickr.com/services/rest/?method=flickr.photos.search&media=photo&api_key=KEY_HERE&has_geo=1&extras=geo&bbox=0,0,180,90&min_taken_date=2005-01-01 00:00:00
Oh, and don't forget to sign your request and fill in the api_sig field.  My experience is that the geo based searches don't behave consistently unless you attach your api_key and sign your search.  For example, I would sometimes get search results and then later with the same search get no images when I didn't sign my query.