Is there any situation when text should be center aligned (horizontally) in an input?

I recently tried to use some animations in my design and I checked some nice examples as inspiration, like this: “Inspiration for Text Input Effects”. Some of them had the text centered.

enter image description here

enter image description here

I know it is just an example to illustrate the animation, but I was wondering if it is any case when it is a good idea to center the text in a field and not to let the user write from left to right (on mobile, if the value is limited to a small number of characters or anything else). What do you think?

LibGDX Calculating Correct Impulse Vector using touch point and center of body

I am trying to calculate correct impulse vector with respect to touch point and center of body.

Impulse should be applied to center of body.

I guess the problem is simple calculate 3rd point on same line given 2 points.

enter image description here (distance between C and B should be equal to B and A)

So with the new calculated point we can find impulse vector and apply(?)

What i actually want to do is: First we touch on our object,then while still touching to the screen we move our finger on screen so that we can aim(meanwhile 3rd point is calculated) and when we release our finger impulse should be applied.

This is what i wrote so far but body moves to wrong direction:

class MyGdxGame() : ApplicationAdapter() {      val PPM = 32f     val SCALE = 2f     val TIMESTEP = 60f     private  var positionX = 0f     private  var positionY = 0f     private var impulseVectorX =0f     private var impulseVectorY = 0f     private lateinit var world : World     private lateinit var player:Player     private lateinit var playerTexture: Texture     private lateinit var b2dr: Box2DDebugRenderer      lateinit var batch: SpriteBatch     lateinit var camera:OrthographicCamera      var playerIsTouched:Boolean = false       override fun create() {         var w =         var h =         camera = OrthographicCamera()         camera.setToOrtho(false, w/SCALE, h/SCALE);          world = World(Vector2(0f,0f),false)"camerax", (w/2f).toString());"cameray", (h/2f).toString());          batch = SpriteBatch()         b2dr = Box2DDebugRenderer()         playerTexture= Texture("player.png")          player = Player(world,150f,175f,32f)           Gdx.input.inputProcessor = object : InputAdapter() {              override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {               //converting touch coordinates to our actual coordinates.                 var touchPointScreen:Vector3 = Vector3(screenX.toFloat(),screenY.toFloat(),0f)                 camera.unproject(touchPointScreen)                 var touchPointBox2D:Vector2  = Vector2(touchPointScreen.x / PPM,touchPointScreen.y / PPM)                   if (player.body.fixtureList.first().testPoint(touchPointBox2D) && playerIsTouched == false){           "touched once", "player touched");                      playerIsTouched = true                     impulseVectorX = 0f;                     impulseVectorY = 0f;                     return true                 }              return false             }              override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {                  if(playerIsTouched){                     var impulseVector:Vector2 = Vector2(impulseVectorX,impulseVectorY)           "impulsevector",impulseVector.toString())                     player.body.applyLinearImpulse(impulseVector,player.body.worldCenter, true)                     playerIsTouched = false                   }                       return super.touchUp(screenX, screenY, pointer, button)             }              override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean {                 var touchPointScreen:Vector3 = Vector3(screenX.toFloat(),screenY.toFloat(),0f)                 camera.unproject(touchPointScreen)                   var playerCenterX = player.body.position.x                 var playerCenterY = player.body.position.y                 var touchPointX = touchPointScreen.x / PPM                 var touchPointY = touchPointScreen.y / PPM                 var distanceBetweenTouchAndPlayer = sqrt((playerCenterY-touchPointY).pow(2) + (playerCenterX-touchPointX).pow(2))                   if(playerIsTouched && distanceBetweenTouchAndPlayer <= 4.5){                   //"touch is dragging", "draggign touch");                      var touchPointToPlayerCenterVector: Vector2 = Vector2(playerCenterX-touchPointX,playerCenterY-touchPointY)                     var newPointHolder:Vector2=Vector2(playerCenterX+touchPointToPlayerCenterVector.x,playerCenterY+touchPointToPlayerCenterVector.y)                         impulseVectorX = newPointHolder.x                     impulseVectorY = newPointHolder.y            "screen touch point",touchPointX.toString()+" "+touchPointY.toString())           "center of mass",playerCenterX.toString() +" "+ playerCenterY.toString())           "new point",impulseVectorX.toString() +", "+impulseVectorY.toString())                       return true                  }                  return super.touchDragged(screenX, screenY, pointer)             }          }     }      override fun render() {         world.step(TIMESTEP, 6, 2);         camera.update()         batch.projectionMatrix.set(camera.combined), 0f, 0f, 1f)         batch.begin()         batch.draw(playerTexture,player.body.position.x*PPM - (64f/2),player.body.position.y*PPM-(64f/2),64f,64f);          batch.end()         b2dr.render(world,camera.combined.scl(PPM))      }      override fun dispose() {          world.dispose()         b2dr.dispose()         batch.dispose()      }     } 

Please check fun touchDragged() i guess something going wrong there ?

(When) does SharePoint Online in Office 365 use the Microsoft Upload Center?

When opening Office Documents from Office 365 it seems that the Microsoft Upload Center is not being used: I can open Word-documents from a document library and save them back without a problem, even when I clicked ‘Pause Uploads’. Also: files do not show up under ‘Recently upload files’.

I’m using Office 2016.

SharePointOnlineCredentials GetAuthenticationCookie ‘center’ is an unexpected token

I am using below piece of code to access SharePoint Online lists web services and receiving the exception at GetAuthenticationCookie method.

Please note that this code is working for some SharePoint tenancies and not working for some. I have already tried with both 16 version and 15 version client and client run time dlls and there is no difference in output.

Is there any setting that need to be checked/changed in SharePoint Online site/tenancy?


var securePassword = new SecureString();

foreach (char c in password) { securePassword.AppendChar(c); }

var credentials = new SharePointOnlineCredentials(userName, securePassword);

var authCookie = credentials.GetAuthenticationCookie(webUri);


System.Xml.XmlException: ‘center’ is an unexpected token. The expected token is ‘”‘ or ”’. Line 7, position 12. at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) at System.Xml.XmlTextReaderImpl.ParseAttributes() at System.Xml.XmlTextReaderImpl.ParseElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r) at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o) at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.DoGet(String url) at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.RequestFederationProviderInfo(String domainname) at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetFederationProviderInfo(String domainname) at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.InitFederationProviderInfoForUser(String username) at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String username, String password, String serviceTarget, String servicePolicy) at Microsoft.SharePoint.Client.Idcrl.SharePointOnlineAuthenticationProvider.GetAuthenticationCookie(Uri url, String username, SecureString password, Boolean alwaysThrowOnFailure, EventHandler`1 executingWebRequest) at Microsoft.SharePoint.Client.SharePointOnlineCredentials.GetAuthenticationCookie(Uri url, Boolean refresh, Boolean alwaysThrowOnFailure)

libgdx, png asset – Different size of animation frame assets – possible to center?

I have code that changes texture in each frame depending on state of player – walking, idle. Problem is that idle texture (from separate png) has slightly different size and due to that it appears not in line with rest of animations seemingly being in slightly different position when returning to idle. Is it possible to position them based on the center of texture instead of left bottom?

batch.draw(determineTexture(), position.x, position.y,             currentFrame.getRegionWidth()/2f, currentFrame.getRegionHeight()/2f,             currentFrame.getRegionWidth(), currentFrame.getRegionHeight(),1f,1f, rotation,false);  TextureRegion determineTexture(){         if(playerState == State.idle)             currentFrame = idleAnimation.getKeyFrame(stateTime, true);         else if (playerState == State.walkingUP || playerState == State.walkingDOWN || playerState == State.walkingRIGHT || playerState == State.walkingLEFT )             currentFrame = walkAnimation.getKeyFrame(stateTime, true);         return currentFrame; } 

One png has height of 57 – idle, while 6 columns and one row of walking frames has height of 87 pixels

Where is the epipole if one camera center is not in view of the other?

In the book multiple view geometry, the epipole is defined as follows:

The epipole is the point of intersection of the line joining the camera centres (the baseline) with the image plane. Equivalently, the epipole is the image in one view of the camera centre of the other view. It is also the vanishing point of the baseline (translation) direction.

The image of one camera center could easily not be in view of another camera center without the cameras being parallel. So, in this case, the line connecting the camera centers would not intersect at least one of the image planes. So, where is the epipole in this case?