google cloud platform – how to filter log entries by timestamp in gcloud logging command line

Any one knows how to filter log entries by timestamp in gcloud logging command line? From google cloud site – https://cloud.google.com/logging/docs/reference/tools/gcloud-logging, I learned to read logs by command

gcloud logging read “resource.type=gce_instance AND logName=projects/[PROJECT_ID]/logs/syslog AND textPayload:SyncAddress” –limit 10 –format json

I want to know how to filter by timestamp. I need to read logs in a particular period.

thanks

command line – Internet Proxy Settings In Terminal

I have used terminal to install apps using the proxy of my office. Now when I am using mobile data, I cannot install or update any apps. I know it is using the old proxy in the terminal. how to change the proxy to default?? So that I can use my mobile data to install apps in the terminal.

I have changed the proxy in google chrome. so there is no problem.

geometry – Line $K$ is parallel to line $U$, and line $L$ intersects line $K$ at point $P$. Show $L nparallel U$.

Working on the book: Lang, Serge & Murrow, Gene. “Geometry – Second Edition” (p. 18)

  1. In Figure 1.11, line $K$ is parallel to line $U$, and line $L$ intersects line $K$ at point $P$. What can you conclude about lines $L$ and $U$? Why?

enter image description here

PAR 2. Given a line $L$ and a point $P$, there is one and only one line
passing through $P$, parallel to $L$.

Conclusion: $L nparallel U$

Proof (using Fitch-style natural deduction):

I will assume $L mathbb{parallel} U$ and reach a contradiction.

$
deffitch#1#2{quadbegin{array}{|l}#1\hline#2end{array}}
defAe#1{qquadmathbf{forall E} : #1 \}
defAi#1{qquadmathbf{forall I} : #1 \}
defEe#1{qquadmathbf{exists E} : #1 \}
defEi#1{qquadmathbf{exists I} : #1 \}
defR#1{qquadmathbf{R} : #1 \}
defci#1{qquadmathbf{land I} : #1 \}
defce#1{qquadmathbf{land E} : #1 \}
defoi#1{qquadmathbf{lor I} : #1 \}
defoe#1{qquadmathbf{lor E} : #1 \}
defii#1{qquadmathbf{to I} : #1 \}
defie#1{qquadmathbf{to E} : #1 \}
defbe#1{qquadmathbf{leftrightarrow E} : #1 \}
defbi#1{qquadmathbf{leftrightarrow I} : #1 \}
defqi#1{qquadmathbf{=I}\}
defqe#1{qquadmathbf{=E} : #1 \}
defne#1{qquadmathbf{neg E} : #1 \}
defni#1{qquadmathbf{neg I} : #1 \}
defIP#1{qquadmathbf{IP} : #1 \}
defx#1{qquadmathbf{X} : #1 \}
defDNE#1{qquadmathbf{DNE} : #1 \}
$

$
fitch{1.,K parallel U\
2.,K neq L\
3.,P in L land P in K\
4.,exists!l(Pin l land l parallel U) qquad text{(PAR 2)}
}{
fitch{5.,L parallel U}{
fitch{6.,P in l_0 land l parallel U}{
vdots\
}\
k.,bot
}\
m.,L nparallel U
}
$

The point of this proof is showing that is not possible that there are two lines parallel to line $U$ passing through point $P$. I have a problem on line 6 when I need to make a substitution instance of PAR 2. The variable used (where I wrote $l_0$) need to be “fresh”, i.e. not appear in any undischarged assumptions.

How can I overcome that problem and continue the proof ?

P.D.: rules of inference can be found in Appendix C of this book: http://forallx.openlogicproject.org/forallxyyc.pdf

20.04 – how to connect to wired internet with command line

I am trying to connect to a wired internet using the command line. I am using a USB type C hub, as this X360 Envy laptop has no ethernet port.
I can connect using the user interface.
Firstly, ifconfig has no “eth0” logical name, it is enx[deleted chars]211b
I can disconnect from the command line using “ipconfig enx[]211b down” , but “up” does not work. I have done automatically connect in the settings , but that also does not work, nor does it actually connect automatically on reboot or replugging in the hub with the wired connection. /etc/network/interfaces is
auto lo
iface lo inet loopback
and I tried adding in
auto enx[]211b
and auto eth0, to no avail.
I need to do this as I got the “oops something went wrong” on dist-upgrade and the desktop is unusable and I need to do commands with the internet access from the terminal. the Live USB stick will not give any option for an update , alongside or overwrite or do something else are the only options there, and there is no way I can discover to do an dist-update from the desktop using the 20.04 Live USB stick,.

geometry – Partitioning points into 2 sets of euqal size by a line

How can u find every possible division of $2n$ points into 2 sets each containing $n$ points, with the condition, that these two sets need to be divisible by a line (for a 2 dimensional space).

My initial thoughts are the following, but i got stuck:

  • Order the point by one coordinate (lets say the x-coordinate for example).
  • Divide the points into 2 sets by ‘cutting’ the sorted points in the middle
  • This could be represented by a line dividing the two sets.
  • Now my idea is to somehow turn the line either clockwise or anti-clockwise until we arrive at our starting configuration.

Does anyone know a solution to my problem ?

algorithms – Intersection of line segments induced by point sets from fixed geometry

I am reading up on algorithms and at the moment looking at the below problem from Jeff Erickson’s book Algorithms.

Problem 14 snippet from Recursion chapter out of Algorithms book by Jeff Erickson

I solved (a) by seeing a relationship to the previous problem on computing the number of array inversions. However, I am struggling with problem (b) as I cannot see how to reduce the circle point arrangement to an arrangement of points and lines that would be an input to the problem posed in (a). Assuming I have something for (b), I also cannot see how one might resolve (c).

For part (b), clearly every point $p = (x, y)$ satisfies $x^2 + y^2 = 1$ but I do not see how I might be able to use this fact to do the reduction. The runtime I am shooting for of $O(n log^2 n)$ also seems to tell me the reduction is going to cost something non-trivial to do.

Can anyone have some further hints/insights that might help with part (b) and potentially even part (c)?

programming languages – An expression in the first line of the control flow statement

Is there a term or some short wording to refer to an expression in the “first” line of the control flow statement?

func() {
  if (a == b) {
    var = 1 + 1
    return True
  } else {
    var = 5 + 5
    return False
  }
}
if ((a == b)
 && (c == d)) {
  ...
}

In the first example, the term/wording should “match” a == b, True, and False. It should not match 1 + 1 and 5 + 5.

In the second example, it should match (a == b) && (c == d).

I used to use “control flow statement expression”, but I do not think this term is accurate.

collision detection – if touching line renderer (do something)

LineRenderer is not your friend here. While you can somehow make it work (you would need to dynamically create and update the colliders by code), that is not something you want to do. (As reference https://answers.unity.com/questions/470943/collider-for-line-renderer.html)

If you want to use your laser to kill something, it is just a bunch of stretched shiny bullet packed together. All you need to do is create a small laser prefab with an image of your laser and you spawn them in quick succession. Each of those laser bullets can have their own collider and therefore your collision/ die/ kill etc call.

With a bullet prefab, you can for example easily move your ship, continue shooting and you don’t care about already shot bullets. The line renderer would just stay where it is. You will have a really hard time to update it to match your movement pattern of the ship.

  1. instantiate a prefab should have no influence on your ships movement, if it does, you do it wrong. That would be a different problem and can only be helped if you post your implementation of it.
  2. You don’t enable/ disable bullet prefabs. You instantiate them and usually have an offscreen collider that destroys them. Upgraded version is a pool manager for them but for starters offscreen destroyer will do.