array – count number of previous elements greater than its element at present index

suppose i have a vector containing n elements. I want to find out the number of previous elements greater than its element at present index i . I mean i want to find A(i)>A(j) && i

constraints : 1<=t <=1000 , 1<=n <=10^5 , 1<=A(i)<=10^5

My code:

  #include<bits/stdc++.h>
 using namespace std;
 int main()
 {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;

while(t--)
{
    int n,a,i,j;
    cin >> n;

    vector<int>v1;

    for(i=0;i<n;i++)
    {
        cin >> a;
        v1.push_back(a);
    }
   int cnt=0,sum=0;

    for(i=0;i<n;i++)
    {
        if( i!=0)
        {
            for(j=0;j<i;j++)
            {
                if(v1(i)<v1(j))
                {
                        cnt++;
                }
            }
        }
      //  cout << cnt << " ";
        sum=sum+cnt;
        cnt=0;

    }

    cout << sum << 'n';
}
}

This code is running fine for all the test cases except only one. It is showing the Time limit exceeded for one of the test cases.Can anyone help me?

Package not present in Kafka github and source from Apache website?

I tried downloading the source code of Kafka from Github as well as from Apache’s website. I found that both the sources were missing the “org.apache.kafka.common.message.” package. Can anybody kindly let me know why this might be the case.

Kindly note that I had downloaded the source of “AK RELEASE 2.5.0” from Apache’s website. Similarly I used “trunk” branch from the current github repository for kafka.

mysql – Query record when N values of a column are present

I have a table similar to the one shown in snip. I want to Query all the Facility_name and Product_Id for which all ‘Week’ exist i.e. 1,2,3

enter image description here

Desired output would be only ‘A’ Faility_Name and respective Product_Id, as for them we have all 3 Weeks available.

java – List with object and index filtering out the object depends upon the index present at list

I have a following list which indicates the indexes.

 List<Integer> integerList = Arrays.asList(1, 3, 5, 6); // index

I have the following collection of objects.

Collection<Test> testCollection = new ArrayList<>();

Test test01 = new Test(0, "A"); // 0
Test test02 = new Test(1, "B"); // 1
Test test03 = new Test(2, "C"); // 2
Test test04 = new Test(3, "D"); // 3
Test test05 = new Test(4, "E"); // 4
Test test06 = new Test(5, "F"); // 5

testCollection.add(test01);
testCollection.add(test02);
testCollection.add(test03);
testCollection.add(test04);
testCollection.add(test05);
testCollection.add(test06);

The integerList has indexes which are present on testCollection. I want to filter out the testCollection which will have object consisting the index 1, 3, 5. Index 6 is not present on object collection.

I wrote the code as below example. Is there any better as like Java 8 way?

List<Test> testList = new ArrayList<>(testCollection);
List<Test> newTestList = new ArrayList<>();

for (Integer integer : integerList) {

  for (int j = 0; j < testList.size(); j++) {

    if (integer == j) {
      newTestList.add(testList.get(j));
    }
  }
}
System.out.println(newTestList);

It will have the following output as result:

(Test{id=1, name='B'}, Test{id=3, name='D'}, Test{id=5, name='F'})

The class Test has following information.

class Test {
  private int id;
  private String name;
}

Present a hierarchal view (tree) containing sequential and parallel tasks

How would you present a hierarchal view (tree) containing sequential and parallel tasks?

  1. The tree can contain two levels of groups when each group can
    contain one or more tasks
  2. A specific group can contain either sequential tasks or parallel tasks
  3. The group could be collapsed and I still think we need a
    sequential/parallel indication in that case

swift – SwiftUI: How can i present a Popup using Navigation Link

I have this code embed in a Navigation View and i want RankingUserDetail presented as a Pop-up, i’ve tried changing the size of the View, using View.popOver style and looking for the presenting methods, can’t figure out. Thanks for the atttention

 List(UsersList.users){ value in
                NavigationLink(destination:
                RankingUserDetail(user: value)){
                    RankingViewRow(user: value,rowNumber: self.UsersList.users.firstIndex(where: {$0.id == value.id})!,needAppearance: 0).frame(width: 343, height: 116)
                }
            }

gui design – How to best present end date to the user? Inclusive, exclusive, 23:59, something else?

In our app you can select a start date and the app calculates the end date (we’re talking about subscriptions here). This is from midnight to midnight, so the actual points in time are, for example:

2020-05-18 00:00:00 to 2020-05-25 00:00:00

So the period starts on the midnight of the 18th, runs all day long, then a few more days, then stops on the midnight between the 24th and the 25th. 24th is included in the interval; 25th is not. But the timestamp itself is the midnight of the 25th.

So how to best communicate this to the user? Some options:

  • 25th May, 2020 – matches the timestamp, but can be misleading. People might thing that the 25th is included.
  • 24th May, 2020 – still can be misleading. Someone might think that the 24th is NOT included. But this is my personal favorite.
  • 24th May, 2020 (inclusive) – wordy? Is this clear enough?
  • 24th May, 2020, 23:59:59 – Dunno, looks kinda ugly to me, but it is kinda accurate….

Or maybe something else entirely?

How to best present end date to to the user? Inclusive, exclusive, 23:59, something else?

In our app you can select a start date and the app calculates the end date (we’re talking about subscriptions here). This is from midnight to midnight, so the actual points in time are, for example:

2020-05-18 00:00:00 to 2020-05-25 00:00:00

So the period starts on the midnight of the 18th, runs all day long, then a few more days, then stops on the midnight between the 24th and the 25th. 24th is included in the interval; 25th is not. But the timestamp itself is the midnight of the 25th.

So how to best communicate this to the user? Some options:

  • 25th May, 2020 – matches the timestamp, but can be misleading. People might thing that the 25th is included.
  • 24th May, 2020 – still can be misleading. Someone might think that the 24th is NOT included. But this is my personal favorite.
  • 24th May, 2020 (inclusive) – wordy? Is this clear enough?
  • 24th May, 2020, 23:59:59 – Dunno, looks kinda fugly to me, but it is kinda accurate….

Or maybe something else entirely?

oracle – What is the correct way to present the disks to ASM?

Hello I would like to know which is the correct way … or the most recommended way to present the disks to ASM, for example: I have 3 disks mapped to a server (rhel7) orasys, orafra, oradata, with dm-multipath I configure the multipath and I put aliases (orasys, orafra and oradata respectively). The doubt I have from there, I have read in the guides, that the disks are formatted, leaving for examples: orasys1, orafra1, oradata1 and these are the ones that are presented to ASM as /dev/mapper/* and with the respective permissions … but when I do it that way it gives an error finishing the installation of the grid because it cannot create the diskgroup, however if I do not format them, that is, I present them directly as orasys, orafra and oradata I have no problem.
The database is oracle 19c and I don’t use asmlib but udev rules.
Thanks.

"Mike Tyson" back in shape: "I want to present four-turn exhibitions"

[IMG]

  • "Mike Tyson" back in shape: "I want to present four-turn exhibitions"

    Mike Tyson's return to coaching sparked a social media storm after a video confirmed the self-proclaimed “ the nastiest man on the planet '' & # 39; & # 39; 39; … READ MORE https://www.stars2day.com/mike-tyson-back-in-shape -j-want-to-box-quatre-round-expositions /