Union Operation in REST Search

We are making REST base search to sharepoint. However we have to make 2 different searches. For example, if we ask "indian employees" then sharepoint does not return a document which contains India (Stemming does not work here). And if we ask "indian OR employees" then the sort order of sharepoint is as per individual keywords. So we are firing 2 searches one with “indian employees” and then “indian OR employees”.

All good, but the time is being taken by 2 queries is high. Is there a way so that we can union these two types of queries like in CAML query How to make a CAML union query. Though CAML query does not work in REST query.

Also head of ANY(indian employees) query but I think that is equivalent to OR query only.

Restaurant Operation Manuals & SEP for $100

Highly professional and easily editable restaurant operations manual to make your concept an international franchise. (A4 pages 114)A to Z new restaurant opening manual guide (A4 pages 53)Franchise agreement as per international franchising systemFranchise disclosure which contains maximum clauses to secure franchisors Food Safety & HACCP Manual including restaurant, transportation, vendors, staff hygiene, etc. (A4 pages 96)Recipe Costing formulated excel worksheet to prepare full menu costing and decide the retail price of every productBarista Training Manual with Selected hot & cold beverages. (with images)Fully automated excel sheets with formulas to create a pre-opening restaurant budget.compiled worksheet with project source & uses, capital budget, sales projection, hourly labor, assumptions, P&L detail, summary P&L, 5 years P&L, breakeven worksheet, & break-even P&L summary.Recipe costing sheet is a compiled menu engineering with suppliers prices, yield, packaging cost, food cost, retail price, suggestive retail prices as per the standard food cost options, suggestive retail price with food cost and sub-recipes. daily opening, closing, revenue, cleaning, maintenance, suppliers receiving, cash closing, personal grooming, briefing, customer feedback tracking, sales tracking, & employee evaluation worksheets.Premium: Premium package contains both basic and standard training courses together with a highly professional restaurant manager/owner/chef training workshop of 178 slides which covers the following operational training: Key Profit ConceptRegular Guest Plus New ComersNumber of Guest VS Check AverageDe-bunking Food Cost Seven keys to Food Cost ManagementGL and Management ControlWaste ManagementVariance ManagementDaily Shift ControlsKPI’s and Measures[/*]

by: MHServices
Created: —
Category: Tutorials & Guides
Viewed: 415


DDD – operation on one aggregate that creates another aggregate

Let’s say I am designing a TODO application and therefore have an aggregate root called Task. The business requires to keep a list of TaskLogEvent that provides them with a history of how the task changed over time. As the Task may have hundreds of these events, I will model this TaskLogEvent as a separate aggregate root (I do not want to load these elements every time and I am not using any lazy loading mechanism).

Now anytime I want to do task.complete() or any other opration modifying the Task I want to create a new TaskLogEvent. I have these options:

  1. Design a domain service that will make all changes to Task and create the event. Every comunication with Task would have to get through this service.
  2. Pass TaskLogEventRepository to any method in Task so that the Task itself can create the Event and save it into the repository.
  3. Let an application service handle this. I don’t think that is a good idea.

What would be the ideal solution to this situation? Where did I make mistake in my thinking process?

Plotting trajectories that undergo modulus operation on a surface

I’m trying to plot an orbit as a surface in the extended phase space of the system

$ $ \dot{q}=p$ $ $ $ \dot{p}=-sin(q)(1+\epsilon sin(\theta))$ $ $ $ \dot{\theta}=\omega$ $

When $ \epsilon=0$ the dynamics can be portrayed on the $ p,q$ phase space (without the extension of the phase space)

    f[p_, q_, \[Theta]_] := p;     g[p_, q_, \[Theta]_] := -Sin[           q] (1 + \[Epsilon] Sin[\[Theta]]) ;     h[p_, q_, \[Theta]_] := \[Omega];     H[q_, p_] := 1/2 p^2 - Cos[q];     \[Delta] = 0; \[Epsilon] = 0.1; \[Omega] = 1; tf = 10;  Show[  {ContourPlot[H[q, p] == 1, {q, -2 \[Pi], 2 \[Pi]}, {p, -6, 6},     Contours -> 100, ContourStyle -> {Red, Thick}],   StreamPlot[{p, -Sin[q]}, {q, -2 \[Pi], 2 \[Pi]}, {p, -6, 6},     StreamPoints -> Fine, PlotRangePadding -> 0, ImageSize -> 500]}] 

enter image description here

where I’m interested in the dynamics on the red curve. d I wish the plot trajectories on the orbit (red curve) in the extended phase space such that $ \theta=mod(\theta,2\pi)$

When I attempt to plot a trajectory, I have a connecting lines between each section which was shifted with the $ mod$ function

    \[Delta] = 0; \[Epsilon] = 0.5; \[Omega] = 4; tf = 10; sol = NDSolve[{q'[t] == f[p[t], q[t], \[Theta][t]],     p'[t] == g[p[t], q[t], \[Theta][t]], \[Theta]'[t] ==      h[p[t], q[t], \[Theta][t]],    WhenEvent[Mod[\[Theta][t], 2 \[Pi]] == 0 , \[Theta][t] -> 0],    p[0] == .1, q[0] == .1, \[Theta][0] == 0}, {p, q, \[Theta]}, {t, 0,     tf}]  Plot[Evaluate[\[Theta][t] /. sol], {t, 0, tf}] ParametricPlot3D[  Evaluate[{p[t], q[t], \[Theta][t]} /. sol], {t, 0, tf},   AspectRatio -> 1/2] 

enter image description here enter image description here

at the end I would like to get a 3d plot of the surface with the trajectories that bounded to it, such as in the figure below

enter image description here

virsh cannot set bridge Operation not permitted

I am trying to enable the default libvirt network to be able to create a vm. However when i try to start the default network, this occurs:

sudo virsh -c qemu:///system net-start default error: Failed to start network default error: Unable to set bridge virbr0 forward_delay: Operation not permitted

with net-list --all you can see that it is not running: sudo virsh -c qemu:///system net-list --all

Name State Autostart Persistent

----------------------------------------------------------

default inactive yes yes

is there another way to start the network. I am not needing to see other devices on the network, just need internet access.

is the problem because it doesn’t exist? If I do ip addr show it doesn’t come up

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 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: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default link/void inet 127.0.0.1/32 scope host venet0 valid_lft forever preferred_lft forever inet 206.---.166.---/32 brd 206.---.---.96 scope global venet0:0 valid_lft forever preferred_lft forever inet6 ::2/128 scope global valid_lft forever preferred_lft forever

What is the O of this operation?

Say for a given positive integer number n, you have to find a level k so that

1 + 2 + 3 + ... + k = S is below or equals n

but S + k + 1 is above n.

For example in python:

def find_level(n):     level = 1     while n > 0:         n -= level         level += 1     return level - 1 

I wonder what is O magnitude of this function?

Correspondence between matrix multiplication and a graph operation of Lovasz

In his book “Large networks and graph limits” (available online here: http://web.cs.elte.hu/~lovasz/bookxx/hombook-almost.final.pdf), Lovasz describes a multiplication operation (he calls it concatenation) on “bi-labeled graphs”. An $ (m,n)$ bi-labeled graph is a graph in which some vertices are labeled with the left labels $ 1, \ldots, m$ , and some are labeled with the right labels $ 1, \ldots, n$ . The left and right label $ i$ are distinguished. A vertex is allowed to have more than one left and/or right labels assigned to it.

The concatenation operation of Lovasz (definition begins on page 85 of the above link), is as follows. If $ G$ is a $ (m,n)$ bi-labeled graph and $ H$ is a $ (n,k)$ bi-labeled graph, then the concatenation $ G \circ H$ is the $ (m,k)$ bi-labeled graph obtained from the disjoint union of $ G$ and $ H$ by identifying the vertex of $ G$ with right label $ i$ with the vertex of $ H$ with left label $ i$ for all $ i = 1, \ldots n$ , and then forgetting these labels, but retaining the left labels of $ G$ and the right labels of $ H$ .

If it is not clear how this corresponds to matrix multiplication, consider the following. Fix a graph $ K$ . For any $ (m,n)$ bi-labeled graph $ G$ , define the $ K$ -homomorphism matrix of $ G$ as the matrix $ M^{G \to K}$ whose rows/columns are indexed by $ m$ -tuples/$ n$ -tuples of vertices of $ K$ such that its $ (u_1, \ldots, u_m),(v_1, \ldots, v_n)$ -entry is equal to the number of homomorphisms from $ G$ to $ K$ that map the vertex with left label $ i$ to $ u_i$ and the vertex with right label $ j$ to $ v_j$ for all $ i,j$ . One can check that $ M^{G \circ H \to K} = M^{G \to K}M^{H \to K}$ .

It is unlikely, to say the least, that Lovasz was not aware of this correspondence between concatenation and matrix multiplication, but I could not find any explicit mention of this in the book or elsewhere. Admittedly I have not read the entire book in detail yet, but I have looked through it for mention of this.

Does anyone know if this correspondence is explicitly spelled out anywhere? Either in the book or an article somewhere?

Check the status of a Finder copy-paste operation from Watch

Today I had to leave my Mac copy-pasting a large number of files and I found myself wanting to know how long the operation had left (and if it had encountered any issues, duplicates etc.). This left me wondering, would there be a way to view this progress on the Apple Watch?

I’m not entirely sure if this already exists via an app on the App Store (please let me know!) or if someone has coded a sideload app. Either way, let me know because I’d love to investigate. I understand how the app would encounter issues interacting with the actual MacOS but I wondered if anyone had any insight. Perhaps if not for the Apple Watch, but for the iPhone?

Thanks in advance!

Basic calculator that takes 2 numbers and does an operation with them

The code works perfectly fine for me (compiled it in BlueJ and Eclipse) but I was wondering what other more experienced programmers thought of it. I’d specifically like to know if it could be shorter or be made more resource efficient.

    /** * This program is just a simple addition calculator that can use whole numbers or decimals. *  * @author Christopher Goodburn  * @version 6/4/2016 */ import java.util.Scanner; import java.math.*;  public class Calculator { private static final Scanner askScanner = new Scanner(System.in); public static double answer; public static double firstNumber; public static double secondNumber; //makes variables for the whole class  public static void main(String[] args) {     calculator(); }      public static void calculator() {        System.out.println("Basic calculator");     System.out.println("Pick one:");     System.out.println("1. Addition");     System.out.println("2. Subtraction");     System.out.println("3. Multiplication");     System.out.println("4. Division");     int pick = askScanner.nextInt();      if(pick == 1) {         addition();     }     else if(pick == 2) {         subtraction();     }     else if(pick == 3) {         multiplication();     }     else if(pick == 4) {         division();     }     else {         System.out.println("You need to choose 1, 2, 3, or 4");         calculator();     }     askScanner.close(); }      private static double getNumbers() {         System.out.println("First number?");         firstNumber = askScanner.nextDouble();         System.out.println("Second Number?");         secondNumber = askScanner.nextDouble();         return firstNumber;     }      public static void subtraction() {         System.out.println("Subtraction");         getNumbers();         answer = firstNumber - secondNumber;         System.out.println("This is the difference of the two numbers:  " + answer);         calculator();     }      public static void addition() {        System.out.println("Addition");        getNumbers();        answer = firstNumber + secondNumber;        System.out.println("This is the sum of the two numbers:  " + answer);        calculator();     }      public static void multiplication() {         System.out.println("Multiplication");         getNumbers();         answer = firstNumber * secondNumber;         System.out.println("This is the product of the two numbers  " + answer);         calculator();     }      public static void division() {         System.out.println("Division");         getNumbers();         answer = firstNumber / secondNumber;         System.out.println("This is the quotient of the two numbers:    " + answer);         calculator();     }  }