Jeśli podczas uruchomienia testów integracyjnych wykorzystujących Arquillian Persistence Extension uruchmionych względem bazy Oracle pojawi się błąd
arquillian.persistence.dbunit.exception.DBUnitDataSetHandlingException: Unable to clean database. ... Caused by: org.dbunit.database.AmbiguousTableNameException: OL$ at org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.java:198) at org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.java:231) at org.dbunit.database.DatabaseDataSet.getTableNames(DatabaseDataSet.java:272) at org.dbunit.database.DatabaseDataSet.createIterator(DatabaseDataSet.java:258) at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:189) at org.dbunit.dataset.filter.AbstractTableFilter.iterator(AbstractTableFilter.java:91) at org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.java:89) at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:189) at org.dbunit.operation.DeleteAllOperation.execute(DeleteAllOperation.java:92) at org.jboss.arquillian.persistence.dbunit.cleanup.StrictCleanupStrategyExecutor.cleanupDatabase(StrictCleanupStrategyExecutor.java:56) ... 181 more
to rozwiązaniem jest dodanie do pliku arquillian.xml wpisu
<extension qualifier="persistence-dbunit"> <property name="schema">$nazwa-schematu$</property> </extension>
Originally posted on Jon Skeet's coding blog:
As I’ve mentioned before, I’m part of the technical group looking at updating the ECMA-334 C# standard to reflect the C# 5 Microsoft specification. I recently made a suggestion that I thought would be uncontroversial, but which caused some discussion – and prompted this „request for comment” post, effectively.
What does the standard say about precedence?
The current proposed standard includes the following text:
The order of evaluation of operators in an expression is determined by the precedence and associativity of the operators (§13.4.2).
Operands in an expression are evaluated from left to right.
When an expression contains multiple operators, the precedence of the operators controls the order in which the individual operators are evaluated. [Note: For example, the expression
x + y * zis evaluated as
x + (y * z)because the
*operator has higher precedence than the binary
+operator. end note
View original 857 słów więcej
Jednym z moich ulubionych sposobów spędzania wolnego czasu jest czytanie dobrego kodu. Jest to dość nietypowe hobby, ale… no cóż, po prostu to lubię.
W ten dość przypadkowy sposób okryłem dwie niezwykle ciekawe klasy sun.misc.Signal i sun.misc.SignalHandler służące do obsługi przerwań. To API nie jest dobrze udokumentowane, ani nie jest oficjalnie obsługiwane, co więcej zgodnie z wytycznymi programiści nie powinni z niego korzystać – ale od każdej reguły są wyjątki.
Originally posted on Josh Stone:
How short can a Git hash be abbreviated? A full SHA-1 hash is 160 bits, 40 hex characters, which is a bit long to talk about and retype when you’re not just copy-pasting. Therefore most people will use just the first few characters to refer to commits, but how safe is this?
I know of a coupleposts where Linus Torvalds laments Git’s default hash abbreviation of 7 characters. This gives you 28 unique bits, almost 270 million possibilities, which seems like it should be plenty. Even with the Linux kernel, one of the biggest repositories I know, there are fewer than 4 million objects. However, since hash functions like SHA-1 have approximately random distribution, you easily can and will run into the birthday problem at this level.
As Linus noted in that second link, Git will now make sure that the abbreviated hashes it prints are currently long enough…
View original 619 słów więcej
Originally posted on Matt Malone's Old-Fashioned Software Development Blog:
One of the main complaints you hear about the Scala language is that it’s too complicated compared to Java. The average developer will never be able to achieve a sufficient understanding of the type system, the functional programming idioms, etc. That’s the argument. To support this position, you’ll often hear it pointed out that Scala includes several notions of nothingness (Null, null, Nil, Nothing, None, and Unit) and that you have to know which one to use in each situation. I’ve read an argument like this more than once.
It’s not as bad as all that. Yes, each of those things is part of Scala, and yes, you have to use the right one in the right situation. But the situations are so wildly different it’s not hard to figure out once you know what each of these things mean.
Null and null
First, let’s tackle Null and null. Null…
View original 1 098 słów więcej
Originally posted on Random ASCII:
I recently noticed that my Windows 7 home laptop was running slower than usual. It seemed to be spending a lot of time waiting on disk I/O. When I looked at Task Manager it showed that my laptop was caching about one fifth as much disk data as normal, but the cause of this was not obvious.
Part of my job at Valve is to be a performance expert – to investigate both mundane and esoteric performance problems. So when I realized that I had a serious and systemic problem I knuckled down and brought all the tools of my trade to bear, and ultimately I found the culprit.
View original 2 391 słów więcej
Originally posted on Bartosz Milewski's Programming Cafe:
Now that you know what a functor is, and have seen a few examples, let’s see how we can build larger functors from smaller ones. In particular it’s interesting to see which type constructors (which correspond to mappings between objects in a category) can be extended to functors (which include mappings between morphisms).
Since functors are morphisms in Cat (the category of categories), a lot of intuitions about morphisms — and functions in particular — apply to functors as well. For instance, just like you can have a function of two arguments, you can have a functor of two arguments, or a bifunctor. On objects, a bifunctor maps every pair of objects, one from category C, and one from category D, to an object in category E. Notice that this is…
View original 4 261 słów więcej