## rt.representation theory – Under what conditions representations of reductive Lie group in Banach space and in its Garding space have the same length?

Let $$G$$ be a real reductive Lie group (e.g. $$G=GL(n,mathbb{R})$$). Let $$rho$$ be a continuous representation of $$G$$ in a Banach space $$V$$. Let $$V^inftysubset V$$ be the subspace of smooth vectors equipped with the Garding topology. Let $$rho^infty$$ be the natural representation of $$G$$ in $$V^infty$$.

Under what precise technical conditions the representations $$rho$$ and $$rho^infty$$ have the same length?

A reference would be very helpful.

Posted on Categories Articles

## finite automata – FA for when length of w is 4 or w contains the substring 01

I have been trying to create an FA for the language.

{w ∈ {0, 1}∗ | |w|= 4 ∨ w contains the substring 01}

I created one that accepts words that contain the substring 01, but I have a hard time finding a solution for the length part.

This is my attempt so far: Any help is greatly appreciated.

Posted on Categories Articles

## passwords – Is combining salt from two places secure enough and what length

I need to implement some hashing scheme for an open-source project. This is what I currently have and I’d like to hear whether this is secure enough –

The password is hashed using PBKDF2-SHA256 (which I prefer over bcrypt simply because OpenSSL supports it natively) with 2048 iterations.

The salt is actually a concatenation of two strings – the first one is unique and stored in the DB along with the password in plaintext. The second one is shared and stored in plaintext in the program’s configuration file. My logic is that this will prevent brute forcing passwords if an attacker gains access to the DB but not to the server’s filesystem.

Is this secure? Also how long should each part of the two salt strings be? 16+16 bytes? 32+32 bytes?

Thank you.

Posted on Categories Articles

## ac.commutative algebra – Rings with terminating division chains of a given length

Let $$R$$ be an integral domain. Given $$a,bin R$$, then a division chain for $$(a,b)$$ is a sequence where we take $$r_{-1}=a$$, $$r_0=b$$, and for each $$n>0$$ we take $$r_n=r_{n-1}s_n+r_{n-2}$$ for some $$s_nin R$$. We say that the division chain terminates if $$r_n=0$$, and it terminates at length $$n$$ when $$r_ineq 0$$ for $$i.

These concepts, of course, have a lot to do with Euclidean domains, etc…

I ran across the following very interesting fact, proved by Cooke and Weinberger in 1975. Let $$K$$ be a number field, and let $$R=mathscr{O}_{K,S}$$, the ring of $$S$$-integers, where $$S$$ contains all the infinite places of $$K$$. Assume (some appropriate version of) GRH. If the unit group of $$R$$ is infinite, and $$aR+bR=R$$, then there is a terminating division chain for the pair $$(a,b)$$ of length $$5$$. Under some additional restrictions, like $$S$$ has a non-infinite place, or $$K$$ has a real embedding, the number $$5$$ can be lowered to $$4$$ or $$3$$. Moreover, they give examples showing that these numbers are best possible in some cases.

I’m interested if the following appears anywhere in the literature: For each $$n>5$$, there exists an integral domain $$R$$ such that for any $$a,bin R$$ with $$aR+bR=R$$, there is a terminating division chain for the pair $$(a,b)$$ of length $$n$$; and there is some pair of comaximal elements in $$R$$ that doesn’t have a smaller terminating length. The example will have to be somewhat complicated, since it won’t be a ring of integers over a number field.

Posted on Categories Articles

## sensor size – Focal length for a specific distance?

I have the following information:

``````s: Image sensors dimensions: 6.00mm, 4.80mm, 3.60mm (diagonal, horizontal, and vertical)
f: focal length range: 5.1mm - 51mm
f=(s*WD/FOV), where `WD` is the working distance and the `FOV` is the object size.
``````

I would like to compute the optimal f for a given `WD=10m` and `FOV=1mx1m`.

Which sensor dimension should I choose (diagonal, horizontal, or vertical)? Since the results differ quite heavily depending on that.

Thanks

Posted on Categories Articles

## php – divide the editor text which have html attributes on every 500 th character length for creating text slider

I have to create the text slider , but that text have html attributes also,so supposed i have 1000 char length of text including html attribute and if i am dividing the text on every 500 character the html div tag will also get divide and my text will look like an simple text ,is there any solution ,hope you guyz get understand what im trying to do

``````                \$msg  = \$message;

\$xyz =  strip_tags(\$msg);

\$lentgh = strlen(\$xyz);

\$noOfDiv = round(\$lentgh/500);

for(\$i = 1 ; \$i <= \$noOfDiv ;\$i++){
\$startPoint = \$prevPoint;
\$endPoint = \$startPoint + 500;
\$prevPoint = \$endPoint;

\$abc = substr(\$msg,  \$startPoint, \$endPoint);

echo "<div class='mySlides '>
<div class='numbertext'>".\$i." / ".\$noOfDiv."</div>
<div class='message__text__container'>
<div class='text'> ".\$abc."</div>
</div>
</div>";

}

``````

Posted on Categories Articles

## unity – Why does my in-game frame calculation not correlate with animation length?

I need to play an animation in such a way that each frame is for sure being played and not skipped.
To do that, I use a very slow animator speed like this:

``````_animator.speed = 0.01f;
``````

The Unity editor says this about the animation: To make sure that each frame is really shown / played, I have implemented my own counter.
My counter however returns 43 frames and not 51 frames as the Inspector.
No matter how often I repeat this process, it always return 43 frames.

What am I missing?

Thank you!

``````private void LateUpdate()
{

float f = _animator.GetCurrentAnimatorClipInfo(0)(0).clip.length * (_animator.GetCurrentAnimatorStateInfo(0).normalizedTime % 1) * _animator.GetCurrentAnimatorClipInfo(0)(0).clip.frameRate;
int iCurrentFrameIDInAnimationFile = (int)f;

bool bIsNewFrame = (iCurrentFrameIDInAnimationFile != _iLastFrameIDInAnimationFile);

if (!bIsNewFrame)
{
return;
}
else if (bIsNewFrame)
{
_iFrameCount += 1;
}

_iLastFrameIDInAnimationFile = iCurrentFrameIDInAnimationFile;

if (_animator.GetCurrentAnimatorStateInfo(0).normalizedTime > 1 && !_animator.IsInTransition(0))
{
//animation has finished playing
Debug.Log("Frames: " + _iFrameCount); //this returns 43 frames. Why???
}
``````

Posted on Categories Articles

## python – Count e length em Django

Olá, pessoal. Tenho um projeto Django e uma das funcionalidades dele é gerar números estatísticos. Por exemplo: tenho um modelo de funcionários e ele tem campos booleanos, tipo, se está ativo ou não, presente ou não, etc. Daí quero mostrar no template um card contendo o total de funcionários cadastrados e quantos desses estão ativo e em determinado dia quantos estavam presentes, etc. Ou seja, a quantidade será mostrada conforme o estado do objeto, se true ou false. Confira um exemplo de modelo:
models.py

``````class Funcionario(models.Model):
nome = ...
ativo = models.BooleanField()
...
``````

views.py

``````from .models import Funcionario

class IndexView(TemplateView): # TemplateView mesmo
template_name = 'index.html'

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context('funcionarios') = Funcionario.objects.all()
return context
``````

Sei que é tranquilo mostrar o total no template usando {{ funcionarios.count }} ou {{ funcionarios|length }}. Mas ainda não entendi realmente a diferença entre os dois modos. Porém, minha pergunta é sobre como mostrar o número de funcionário ativos e inativos. Alguns alternativas que pensei foi criar várias chaves no def get_context_data:

``````def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context('funcionarios') = Funcionario.objects.all()
context('funcionarios_ativos') = Funcionario.objects.filter(ativo=True)
context('funcionarios_inativos') = Funcionario.objects.filter(ativo=False)
...

return context
``````

Ou poderia criar @propety no model Funcionario; ou poderia criar tag personalizadas. Enfim, gostaria de uma opinião sobre qual seria a forma mais adequada de se fazer isso.

Agradeço desde já.

## focal length – What’s the reason between different binocular shapes for the same magnification and objective diameter

I have noticed that binoculars with the same magnification and objective size, ie. 7×50, have different optical layouts. There seem to be a chunky design used in older binoculars (presumably with large porro prisms), (eg. the Carl Zeiss Jena Binoctem 7×50), and a longer design (eg Nikon Aculon A211) more used with modern binoculars (although I have seen some older ones also with this design).

My question is what is the reason for this, is one design better than the other, or is it just to save money on prisms? How can the shorter chunkier binoculars also have the same focal length as the longer ones, is this made up for by the longer optical path length of the bigger prisms?

Cheers

Dave

Posted on Categories Articles

## focal length – How can I calculate a camera sensors width and height?

I try to compute the focal length for different field of views of a camera.

Therefore I need the sensor size horizontally and vertically, but in the datasheet I only have the information: `1/3" 2.4 MP` Image Sensor.
The image size is `1920x1080` it that’s needed.

How do I get the size of the size of the sensor?

Thanks

Posted on Categories Articles