Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 days ago.
Improve this question
How can I programmatically draw picture in text format which I want to use in comments for junior tests.
I am giving as an input some picture. Particularly I would like to give some dependency graph picture and get result like on example below:
// Gr1
// +--------------+
// | +- D2 |
// | | |
// | D1 <-+ |
// | | |
// | +- D3 |
// +--------------+
or
//
// Gr1 Gr2
// +-------------------+ +------------+
// | D1 <- D2 | <- | D3 <- D4 |
// +-------------------+ +------------+
//
Any ideas?
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
Scenario Outline: Given.. When.. Then..
#test 1
Examples:
| Model | Version | Fuel |
| Honda | Brio | Petrol |
#test 2
Examples:
| Model | Version | Fuel |
| Maruti | LXI | Diesel |
Scenario Outline: Given.. When.. Then..
#test 1
Examples:
| a | b | c |
| a1 | b1 | c1 |
#test 2
Examples:
| a | b | c |
| a2 | b2 | c2 |
Problem Statement :
-> I have multiple scenarios outline so i want when my scenario 1 will run with first row data set than it will further move to scenario 2 and pick the first row data set and continue to proceed with scenario 3, 4 with first row data set only. Once this flow completed, than again Scenario Outline 1 will run now this time it should pick second set of data which is present in its second row and further proceed to scenario 2 and pick this time second row data set and continue to proceed with scenario 3 and 4 with its second set of data only.
Note:-
#test1 //Error here -"mismatch input '#test1' expecting examples"
Examples: //Error here if i remove tags -"missing EOF at examples"
This might be a bug in the cucumber-eclipse gherkin parser. I recommend you submit a bug report.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
I was reading about Java 9 new features, modules and changes. So far so good.
Will Java 9 introduce a standard for code folding?
Something similar to #region in VisualStudio or NetBeans' code folding comments.
[-] // <editor-fold desc="Some description here">
| public void method() {
| doSomething();
| }
_ // </editor-fold>
If not, why?
No, Java 9 will not introduce code folding. The full list of Java 9 features does not mention code folding.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Suppose I have a list [1,2,3,4,4] and a target 5. I need to find all the pairs from the list which sum to 5, i.e., (1,4),(1,4),(2,3). Can someone suggest me an algorithm how to solve it in less than O(n^2).
I cam across this question while preparing for interview but I am not able to solve it in less than O(n^2).
Any Help is appreciated
Well, let me show the idea, and you'll implement it, OK?
First stage. Create a dictionary (Map) where key = number, value = number's occurrencies. E.g. for [1, 2, 3, 4, 4] we should have
{1, 1}, // we have exactly one 1
{2, 1}, // - / - 2
{3, 1}, // - / - 3
{4, 2} // we have two 4's
you can create such a dictionary in linear time O(N).
Second stage. Scan the array, for each item look at the dictionary for the key = 5 - item and repeat
(item, 5 - item) pair value times. E.g. for [1,2,3,4,4] we'll have
item | key | value | output
-----------------------------------
1 | 4 | 2 | (1, 4), (1, 4)
2 | 3 | 1 | (2, 3)
3 | 2 | 1 | (3, 2)
4 | 1 | 1 | (4, 1)
4 | 1 | 1 | (4, 1)
As you can see the second stage is also O(N)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
What is join in HQL and where shall it be used?
Have gone through tutorial.Majorly three of them used as follows:
Inner Join
Left Outer Join
Right Outer Join
Read few tutorials yet unable to understand.
Join in HQL is same like the SQL joins. In SQL join is used to join two tables to return matching data. In HQL join is between Parent entity and the child entity (Usually on a ForeignKey of a parent primary key).
Person table
person_id | name | dob
Address table
address_id | address_line1 | state | zip | person_id
A SQL Join looks like
Select * from person p join address a on p.person_id = a.person_id and p.person_id = 10
This will return data like following if a person has more than one address
person_id | name | dob | address_id | address_line1 | state | zip
----------------------------------------------------------------------
10 Jack 10/25 22 223 elk blvd AZ 54444
10 Jack 10/25 244 223 NY blvd TX 54344
A HQL join looks like
from Person p join p.address
and it returns Person entity with a list of addresses in it.
Person{
List address = [ Address{ (this is Object) }, Address{(This is object)}]
}
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I tried compiling and running the following code
public static void main(String... args) {
int x = 1 | 2 | 3 | 4;
//int x = 1 | 1 | 1 ;
//int x = 1 | 2 ;
//int x = 2 | 1 ;
System.out.println(x);
}
I tried in dot net and its not working how come its working in java ?? How is this code being evaluated to produce an answer ??
1 | 2 = 00000001 | 00000010 = 00000011 = 3
3 | 3 = 00000011 | 00000011 = 00000011 = 3
3 | 4 = 00000011 | 00000100 = 00000111 = 7
That is called bitwise operator in Java. It operates on the bits of the operands.The bitwise | operator performs a bitwise inclusive OR operation.
If you observer the lower order bits :
1 - 0001
2 - 0010
3 - 0011
4 - 0100
Biwise OR of each of them will produce 0111 which is 7.You can refer to the JLS 15.22.1 for more.
This is example of bitwise inclusive OR or operator. And the result will be 7.
1 - 0001
2 - 0010
3 - 0011
4 - 0100
---------
7 - 0111
I do not know how did you used it in "dot net", but it should work. This reading prove it