Yes, you could insist that a precondition to the routine be that there board is not full, but that is exactly the kind of thinking that lets bugs pop up out of well tested code far into the programs life.
Seecond, I see what you are doing with if (randRange(0, 100) > (int) (1 / counter * 100)) , but why not just use if (randRange(0,c) == 0)? Or does randRange not actually guarantee correct behavior on randRange(0,0)?
@BernardoMeurer They aren't pointers.
The reason some high-level language can have NUL or unset values on integer variables is that the variable is actually implemented as something akin to a c struct and has some meta data coming along with it.
@YashasSamaga that would be cool - I'm working on two projects right now that possibly could lead to one, but I doubt I have the ability to bring them to fruition
And just for background knowledge, using a simple modulus operation as you have done with randRange won't give you exactly the desired probabilities. That's not an issue in this case where you don't need exactitude, but you wouldn't want to do it in a Monte Carlo.
@BernardoMeurer This method is used in cases where you don't know in advance how many items you have, but want to select one with uniform probability. The usual case is something like "Randomly and fairly pick one item from a linked list."
You can of course, walk the list counting and throw, then walk again to find the one you wanted.
@dmckee If I have two allocated pointers to unsigned integers of same size, how do I check if they are exactly the same? Is memcmp the function for that?
And I do a bunch of operation on buf based on rowcol. I want to detect if the resulting buf is the same as rowcol, i.e. buf[0]=rowcol[0] && buf[1] = rowcol[1] && ...
"Gotta check that it is safe to defrerence the pointer before you actual do so." What do you mean by that?
@heather You don't sound like an idiot, but in your AMA you said you understood a good bit of calculus. Dan and Bernardo will probably kill me, but you don't.
@BernardoMeurer In this case you probably can. But you should be in the habit of checking pointers before using them in c. And in c++ if you are using raw pointers.
@BernardoMeurer That works if you want to compare a single integer at the end of each pointer. (Which is what I thought you'd asked, but I should have known better.)
But what you want to do is to compare a buffer full of integers, and you have to do that one at a time.
He stopped posting here quite suddenly. I remember CuriousOne to be very critical of the MWI, so I'm going to poke in his eye here by saying that the Universe is in a superposition of all possibilities consistent with the record about his postings, so anything that could have happened to explain ...
Theorem: The set of truths are not closed under concatanation
Proof: Let $\mathscr{C}$ be the collection of true statements. Pick $S,T \in \mathscr{C}$. Define concatanation $\dots : \mathscr{C} \times \mathscr {C} \to \mathscr{K}$ where $\mathscr{K}$ is an ordered collection.
Suppose $S=\{\textrm{I was drunk}\}$, $T=\{\textrm{yesterday}\}$. Then $S \cdot T = \{\textrm{I was drunk yesterday}\}$. However for $\mathscr{C}|_{\textrm{my life}}$ there is no $R \in \mathscr{C}$ such that $R=S\cdot T$. Therefore $S \cdot T \not \in \mathscr{C}$ Q.E.D.
Well technically yes, thus that will be a proposition that is false or had undefined truth value. Meanwhile we also had a well defined proposition called "Buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo" that can be true or false depending on what really happened.
I am just trying to formulate the observation that one can stitch together many truth statement and in general get a logical story yet it is completely false. From you guys reactions above, it seems I still get the maths concepts wrong...?
@SirCumference general, cause they are no specific users that I remember has relevant background to help enrich the analysis by pointing out directions on where to go next
Perhaps, for some of these wall of text, the best way to think about them is that they are questions, but I am not sure what the question is except from many years of observation you guys seemed to somehow can give relevant answers
> We assume that there exists a sequence $(\lambda_n)\subset D(J)$ with $|\lambda_n|\to\infty$ and that the family of operators $\{\lambda J_{\lambda_n}\}$ is equicontinuous. Then we have $$\mathrm{cl}\, R(J)=\{x\in X:\lim \lambda_n J_{\lambda_n}x=x\}$$ and hence $$N(J)\cap\mathrm{cl}\, R(J)=\{0\}.$$
C# (pronounced as see sharp) is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines. It was developed by Microsoft within its .NET initiative and later approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270:2006). C# is one of the programming languages designed for the Common Language Infrastructure.
C# is a general-purpose, object-oriented programming language. Its development team is led by Anders Hejlsberg. The most recent version is C# 7.0 which...
In mathematics, the musical isomorphism (or canonical isomorphism) is an isomorphism between the tangent bundle TM and the cotangent bundle T*M of a Riemannian manifold given by its metric. There are similar isomorphisms on symplectic manifolds. The term musical refers to the use of the symbols ♠and ♯.
It is also known as raising and lowering indices.
== Discussion ==
Let (M, g) be a Riemannian manifold. Suppose {∂i} is a local frame for the tangent bundle TM with dual coframe {dxi}. Then, locally, we may express the Riemannian metric (which is a 2-covariant tensor field which is symmetric and...
Uh, that sounds very different from what I and DHMO went through cause we can show that in the standard topology of reals, [0,1] is closed and bounded, but noncompact?
2. I think I need to revise this a little bit cause the only thing I remember is that the open sets in that topology are of the form $\Pi^{-1}(U) \cup \Pi^{-1}(V)$ where $\Pi^{-1}$ are projections onto the first and respectively second coordinates of the tuple formed by the cartesian product of the underlying sets
3. I think I had not reached that section in munkres yet, thus I am kinda unfamilar with the theorem
@Secret Yes, and now comes the nice part. It's easy to see in this norm that $X=\times^n\Bbb R$ as a topological space, where $\Bbb R$ carries the usual topology
Now this means that $B=\{x\in X:||x||_\infty\le 1\}$ is just $[0,1]^n$, and hence compact in $X$ by Tychonov's theorem.
@Secret We now have to show that $B$ is compact with respect to $||\cdot ||$ as well
This is...not so easy
First note that $||x||=||\sum x_ie_i||\le \sum |x_i|||e_i||\le C||x||_\infty$ where $C=\sum ||e_i||$
This implies that the $\infty$-topology is stronger than the first norm topology. Using this you can show that $B$ is compact with respect to $||\cdot ||$
Let $A=\{x\in X:||x||_\infty <1\}$. This is easily seen to be open with respect to either topology
$0\in A$ so we can fit an open ball $U=\{x:||x||<r\}$ inside of $A$ for some $r>0$
Now $||x||<r$ and $||x||_\infty\le 1$ implies $||x||_\infty<1$, that is, $U$ does not touch the boundary of $A$
Claim: $||x||<r$ implies $||x||_\infty<1$. To see this, let $||x||<r$ and put $x=\sum x_i e_i, \alpha=||x||_\infty$. So $||x/\alpha||_\infty=1$ and $x/a\in B$. Now if $\alpha\ge 1$, then $||x/\alpha||<r/\alpha\le r$, hence $||x/\alpha||_\infty <1$, which contradicts $||x/\alpha||_\infty=1$.
Thus $||x||_\infty =\alpha<1$, so we have the claim.
The claim then gives $||x||_\infty <r^{-1}||x||$ in $U$, so by scaling for all $x\in X$.
To sum it all up: for each $x\in X$, $r||x||_\infty <||x||\le C||x||_\infty$, which completes the proof.
@Secret I think this proof has an issue. I never used compactness, which is necessary. I'm thinking the construction of $U$ needs to be done more carefully and requires compactness. I'll write a better proof tomorrow
Some clarification on what I mean in the previous wall of text:
Consider the following sequence of events: Truth
A: The book on the top of the bookcase fell B: The dominos were knocked down C: The ferris wheel is set into motion D: A steel bead slid down the track E: A splashing sound is made as it fell into a basin F: A detector register the sound
What is being told:
D: A steel bead slid down the track E: A splashing sound is made as it fell into a basin F: A detector register the sound C: The ferris wheel is set into motion B: The dominos were knocked down A: The book on the top of the bookcase fell
Without actually seeing the chain reaction setup in person, there is no way to deduce which version is true because it is internally consistent logically speaking
So the gist is that. You can have a video, and via clever cutting and rearrangment and the way each scene is arranged, create another video that depict the events differently, but still be perceived as unbroken and continuous