Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
It would be nice to have some sample tests.
Questionable statement about performance and memory consumption.
In postgres WITH is always optimization fence. PG always materialize it.
Here you basically told PG to make two temp tables out of payment table doing two scans (index or maybe full table ones as we don't have any idea if staff_id is indexed or not or anything about its cardinality and distribution).
Sorry, but with all things being equal this query does two scans instead of one while AGGREGATE WITH FILTER approach gets all aggregates in a single pass over the table (using index or not). Not knowing table statistics we cannot simply say what will be faster.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
expected: [{:location=>"US", :id=>1, :name=>"Awesome Rubber Bottle", :price=>50.07, :card_name=>"Toni Senger II...ber=>"1234-2121-1221-1211", :transaction_date=>#<Date: 2012-07-29 ((2456138j,0s,0n),+0s,2299161j)>}]
got: [{:location=>"US", :id=>1, :name=>"Awesome Rubber Bottle", :price=>50.07, :card_name=>"Toni Senger II...ber=>"1234-2121-1221-1211", :transaction_date=>#<Date: 2016-07-24 ((2457594j,0s,0n),+0s,2299161j)>}]
That is the problem. We get 1 failure while submitting. There is no requirement for order by and I have tried both ASC and DESC, I get a different failure each time. Many of these US/EU sales based DB problems are poorly specified. There are hidden ordering requirements every where.
This comment is hidden because it contains spoiler information about the solution
This is still confusing.
Order by US then EU just means show the US orders first. The requirement needs to state to show them ordered by ID, US first then EU.
No, even as a native speaker it is quite vague. The wikipedia article helps a little but is still not clear.
That's true, but anyone who's read LYAH should be familiar with monoids, especially 6-kyu Haskellers, the kata's difficulty level.
This comment is hidden because it contains spoiler information about the solution
A fair point, but I'm sure people are clear as to what I'm meaning.
Err..Sorry I was speaking about the haskell version.
the [a] datatype in haskell is called a list (because it /is/ a linked list).
There are arrays in Data.Array and its sub modules.
Even a stub of tests would be nice.
Mind the typos.
For clarity in dicussion. The following is the list in, the tree created, and the tree by levels result. Either buildTree needs to be fixed or the expectation that treeByLevels is the inverse of buildTree needs to change.
Loading more items...