Does Oracle guarentee that ORA_HASH is used to determine which hash partition a row is inserted, and will this be honored in the future?

I use hash partitioning for a few of my very large tables, and occasionally I have a use case where it would be convenient to have a mechanism that would return the partition name that a row would be inserted into, given a partition value.

This blog here shows that we can use ORA_HASH function for this purpose. Incidentally, it appears this page is the only page on the entire internet that explains this.

I’ve used it successfully and it works in all cases that I have tried. It seems ORA_HASH is definitely what Oracle itself uses to pick the hash partition that it inserts data into, and that at least on the current version of Oracle it is safe to use for this use case.

However there is no guarantee in the documentation that Oracle even uses it, or will continue to use it in the future. This makes me think that using ORA_HASH in this way is not safe or future proof. What if a DB is upgraded and ORA_HASH no longer behaves this way?

For reference, you can use the following SQL to return the hash partition for a given value:

SELECT partition_name FROM all_tab_partitions WHERE table_name = 'FOO'     AND partition_position = ORA_HASH('bar', n - 1) + 1 

Where 'bar' is the value you wish to analyze, and n is the number of partitions in your table. There are some edge cases when the number of partitions is not a power of 2, which is covered in the blog article linked above.

How do you determine a dragon’s gender?

How do you determine the gender of a dragon, without resorting to asking them? A number of published D&D adventures have dragons in them (natch), clearly identified as male or female. However there is no information on how people know the gender of a dragon. I’m asking about the Forgotten Realms, as the original silver sourcebooks define dragons differently from the D&D 1E Monster Manual. Given the detail dedicated to dragons there should be a gender determination description somewhere.

Given a row sum vector and a column sum vector, determine if they can form a boolean matrix

For example, for a boolean matrix of size $ 3×4$ , the row sum vector $ R = (3, 3, 0, 0)$ and the column sum vector $ C = (2, 2, 2)$ form a match because I can construct the boolean matrix:

$ $ \begin{matrix} & \begin{bmatrix} 1 & 1 & 0 & 0\ 1 & 1 & 0 & 0\ 1 & 1 & 0 & 0 \end{bmatrix} & \begin{pmatrix} 2\2\2 \end{pmatrix} = C \ R = &\begin{pmatrix} 2 & 2 & 0 & 0 \end{pmatrix} \end{matrix} $ $

However, the column vector $ C’ = (4, 1, 1)$ doesn’t form a match with $ R$ .

So given two vectors whose values are sorted in descending order $ R_{1, w}$ and $ C_{h, 1}$ , and whose accumulated sum is the same, $ T = \sum_jR[1, j] = \sum_iC[i, 1]$ , how can I polynomically check if $ R$ and $ C$ form a matching because I can form a matrix $ M_{h,w}$ having $ R$ and $ C$ as row and column sum vectors?

More specifically, in case it can help to make the check algorithm faster, in my specific case, R and C has the following properties:

  • $ h \leq w$
  • The number of positive values of $ R$ and $ C$ is $ > w$ . For example, $ R$ , in the example, has two positive values and $ C$ has three positive values, and it happens that $ 2 + 3 > w = 4$ .

Determine if there is a subset of the given set with sum divisible by a given integer

I’ve been given a question to solve:

Given a set of non-negative distinct integers, and a value $ m$ , determine if there is a subset of the given set with sum divisible by $ m$ .

For this question the answer is here

I don’t understand the part after if DP[j]==True
what is actually the intuition behind this code. Please explain in detail.

How to express a type that represents an associative array whose keys determine the type of the value?

I’m fairly new to type systems and theory, so I would appreciate some guidance in a problem that sparked my interest.

I would like to understand what type system features are required so a compiler can enforce that a given key will return a value of the same type as the one the key was associated with in the first place.

A practical version of my problem is to declare a Map in TypeScript that allows a developer experience like in the pseudocode below:

const cache =  new  Map<K,  V>()  cache.set('Foo',  Error('R'))  cache.set('Bar',  1)  cache.get('Foo')  // Return value typed as Error.    cache.get('Bar')  // Return value typed as number.  cache.get('Qux')  // Compilation error. 

What would the type of K and V be?

How do I fix ‘Could not determine java version from ‘14.0.2’.’ when trying to make Minecraft mods?

I try to build my mod like this.

I get the error:

FAILURE: Build failed with an exception.

  • What went wrong: Could not determine java version from ‘14.0.2’.

What causes this? How do I fix this? I never used Gradle or Java before so please be specific. Is this caused because Gradle doesn’t support Java 14.0.2? If so, how do I tell Gradle to use a Java version it does support? I’m a noob. I have no experience with Gradle at all, I don’t even know what it is or what it’s for, all I know is I’m trying to make a basic Minecraft mod. However I do know Java.

Is there a way to determine whether a list of integers can be a prefix function?

Say you had




Could you use, for example, the KMP algorithm to deduce the validity of the above lists as prefix functions? I know there is a way to find whether a substring exists in a string using KMP, but is there a way to do it the other way around, starting at the apparent prefix function and ascertaining that it is indeed a possible prefix function, without knowing the string/substring itself at the start?

How to determine if given “complex” time complexity is $O(n^2)$?

If a given time complexity, such as these:

  1. $ (n + \log n) * \sqrt{n+\log n}$
  2. $ n * (200 + \log^2 n)$
  3. $ (7+n^3)\log(n^5)$

is not determinable by just looking at it whether is it in class $ O(n^2)$ or not, how do I decide? If a time complexity is given, and in it there are more types of expressions (exponential, logarithmic, polinomial, … ) how do I decide which one determines the $ O(n^2)$ or $ O(n\log n)$ or … complexity?

How do you determine what action belongs to who in a modernist GM-based game?

Lets say we have a game. The group playing the game accepts the following modernist1 conventions:

  • GMs control the in-game world, except the PCs. They have final say over what happens (and has happened!) in the game world. Players should accept and respect this as a part of agreeing to play at the table.

  • Players control their own characters. They have final say over what they do and don’t do, subject to the rules of the game. Other players should accept and respect that.

How do we tell what is ‘their own characters’ and what is ‘the in-game world’ and where one character’s stuff starts and another’s begins?

For example, let’s say the group is discussing whether or not Yilbur was stabbed by Xaratron. It seems to me that Yilbur’s player, Xaratron’s player, and the GM each have a claim to authority here. Specifically, Yilbur’s stabbedness is an aspect of Yilbur’s character and thus controlled solely by Yilbur’s player. Xaratron’s successful stabbing is an aspect of Xaratron’s character and thus controlled solely by Xaratron. The object used for stabbing and the space the stabbing moved through are external to the characters and thus the GM has sole control over that. This seems problematic to me, because there’s no reason Yilbur might not decide the stabbing wounded their left hind leg, but will heal quickly with rest, whilst Xaratron decides they have successfully slain Yilbur and go to claim a bounty, and the GM decides that no stabbing has occurred because the implement used transformed mid-swing into a fish.

Nevertheless, it seems clear to most people who make frequent use of these conventions which action belongs to who– for example, the above action would, according to most people, belong to Xaratron. It seems like there must be some system for determining what action belongs to who, since that participant then (it seems) has authority to determine what happened such that contradictory outcomes like the above don’t happen. I don’t know how to do that. How is that best done within this system?

Some test cases:

John, a PC, casts charm person, a spell with defined but ambiguous mechanical effects including changes to internal states on Sally, also a PC. John, Sally, and the GM all disagree about what happens next in terms of Sally’s internal state and resulting action. Sally’s player says her character happily stabs John to death. John’s player says she can’t because the spell makes her treat John as she would a lover and intimate confidant. Sally’s player says Sally has trained herself to always immediately stab to death anyone she views as a lover and intimate confidant. The GM says neither thing happens because charm person doesn’t do that, to which both players object. Who owns this? What happens?

Inana, a PC, is dancing her way into the court of the King of the Underworld, an NPC, with the help of Tiamat the ghost leviathan, a PC. A disagreement occurs when Inana moves to spring their trap on the King– Inana’s player believes Tiamat used their ghost powers to move themselves and Inana into the throne room, past a battalion of guards and magical wards, after which Inana has taken several actions, including a lengthy public dance, in said throne room, and that the plan is for Tiamat to now appear and rescue them from the King’s clutches just after the King is forced to award her the Amulet of Yendor but before he inevitably orders his guards to seize her and not let her leave. Tiamat’s player says that they never teleported anybody into the throne room and they don’t know how Inana got in but they aren’t there so they can’t do the rescue and besides, that wasn’t the plan in the first place, they were supposed to go get the last me from the King’s haberdashery first, instead, which is where Tiamat went by themselves. The GM says that since Tiamat does not appear Inana is captured. Inana’s player says that Inana feels betrayed by Tiamat for abandoning them in the throne room. Tiamat’s player says that’s ridiculous because they never went to the throne room in the first place. Inana’s player asks how they got in if that was the case. Inana’s player says they don’t know but it’s not their problem. Who should own this? What should happen?

El Cid Roy Diaz de Vivar (a PC) is in need of some fast cash to buy his peons (NPCs) some actual equipment so they don’t, like, immediately die in Moorish country. He’s already committed some bank fraud, but that was spent hiring some knights (also NPCs) and buying everybody food. He concocts a plan to ambush a nearby lightly-defended allied town currently occupied by enemy forces and then have the townsfolk outfit his troopers as repayment for liberation. After successfully sneaking into the town and sealing the gates with the occupiers outside distracted by a secondary force, he sets out to do this, but is then informed by the GM that his plan makes no sense because this is an enemy town that was, until El Cid drew them out of the town, ambushed them, and sealed the gates, occupied by allied forces and the King (an NPC) who’s already gonna be mad at him for that aforementioned bank fraud (and various other crimes) is probably going to mount an actual campaign against him if he hears he liberated an enemy settlement and looted his treasury. El Cid’s player is like "I wouldn’t have attacked it, then, so I must not have known" and the GM is like "Ok, fine, you didn’t know, but that means you’re really dumb because everybody has been telling you that for, like, days" and the player is like "No, they haven’t, or you sure didn’t mention it if they did". Who own this? What should happen here?

  1. I’m referring to this as ‘modernist’ because I don’t know the name and that seems appropriate (as opposed to ‘tradionalist’ conventions that hold that the GM is the final arbiter of all things, including PCs actions and internal states, but that PCs have input insomuch as the GM decides, which will be principally over their character but also extend to aspects of the world around said character to a lesser extent). I think a name or signifier of some sort is necessary because this isn’t, like, some random set of conventions that maybe no one actually uses– these conventions hold for probably in excess of 30% of all RPGs right now.