c ++ – Check if it is possible to arrive at a point presented by a number

The problem is to check if we can reach a wall that is represented with a number, by horizontal and vertical displacements or not. if we can, print one of the correct answers and if we can not, print -1.

we have three entries. the first is the distance to the wall (n). the second is the length of our foot (x) and the third is the width of our foot (y).

1≤n, x, y≤100,000

I've written a code for this and it's almost ok, I think. I want an optimized and faster solution for that.

for(int i=0;i

sharepoint server – transfers data from one point of view to another in Infopath

Battery Exchange Network

The Stack Exchange network includes 175 question-and-answer communities, including Stack Overflow, the largest and most reliable online community on which developers can learn, share knowledge and build their careers.

Visit Stack Exchange

Floating Point – Why Multiply Floating Number by a Multiple of 10 Seems to Preserve Better Accuracy?

It is famous that for floating numbers:

.1 + .2 != .3



It seems that multiplying the floats by 10 makes it possible to preserve more precision. To further illustrate the case, we can do it in python:


sum((3000000000.001 * 1000)*300) / 1000

By multiplying each element of the list by 1000 and dividing the sum of the list by 1000, I can get the answer "correct".
I wonder:
1) why this is the case.
2) Will it still work, and
3) How large will this method turn around if it does?

Optical – How can I find the distance needed to resolve a point on a page from a mobile camera?

No, you can not know from the technical specifications you are thinking about. The resolution power of a camera system depends on how the lens is built and the properties of the recording medium, as well as other factors such as lighting and the atmosphere.

You may be able to get some details about the recording media – the sensor – from the camera specifications, but not enough to be really useful in practice. And for lenses, the resolving power is characterized by tests, not calculated in theory.

Algebraic Geometry – Degree Limits on Point Coordinates of a Zero-dimensional Variety

Let $ S = {f_1, points, f_s in mathbb {Q} (x_1, points, x_n) } $ have a zero dimension nullset $ V subset mathbb {C} ^ n $and suppose that everyone $ f_i $ at most total degree $ d $.

Is there a shared root $ ( alpha_1, dots, alpha_n) in V $ such as some $ alpha_i $ has a degree at most $ dn $ as an algebraic integer (i.e. $ ( mathbb {Q} ( alpha_i): mathbb {Q}) leq $ dn)?

This is vaguely in the sense of this question but concerns the "minimal" coordinate rather than the degree of extension required to contain all the coordinates. I know that there is a limit of $ d ^ n $ (from the link, or via the inequality of Bezout followed by Shamma Lemma) but I wonder if we can say more after trying some examples and found nothing worse than $ dn $.

dns – Point the domain to another (shared) hosting subdomain

I have domain at GoDaddy. mydomain.com

and then I have a shared hosting account at hostgator with a subdomain there.

I want to point




I've tried domain hiding that works, but it displays subdomain.otherhosting.com in an IFRAME (which I do not want).

The shared hosting gave me an IP address, for example. 192,192,192,192.
I created a

A recording
@ –

and CNAME record

CNAME – www – subdomain.otherhosting.com

on the mydomain.com DNS management page but to no avail. Is it even possible on shared hosts (with shared IP) or without domain masking?

libgdx – How to rotate TextureRegion to face a point?

I'm trying to rotate a texture area so that it faces a point.

enter the description of the image here

This is a video showing my current implementation, please look for better understanding (as you do not see rotation but I can calculate the starting position of the indicator successfully, on the video you see my point of contact, the point where it must rotate to be symmetrical (I know how to calculate this point) of my point of contact)

I know how to calculate the point he should face, but I could not run it successfully.

This is how my current drawing method looks like what you see. The rotation is not implemented because I could not calculate the angle successfully.

batch.draw(powerIndicatorTextureRegion,powerIndicatorDownPointCalculator(player.body.position.cpy(),touchPointBox2D).x*PPM - powerIndicatorTexture.width/2,powerIndicatorDownPointCalculator(player.body.position,touchPointBox2D).y*PPM,48f,distanceBetweenFingerAndPlayer*PPM);

box2d – LibGDX How to calculate the correct impulse vector with respect to the point of contact and the center of the body

I'm trying to calculate the correct impulse vector with regard to the point of contact and the center of the body.

The pulse should be applied to the center of the body.

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

enter the description of the image here
(the distance between C and B must be equal to B and A)

So with the new calculated point, we can find a pulse vector and apply (?)

What I really want to do is:
We first touch our object, then, while touching the screen, we move our finger on the screen to be able to aim (the point is calculated) and the pulse of the finger must be applied.

That's what I wrote so far, but the body is going in the 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 = Gdx.graphics.width
        var h = Gdx.graphics.height
        camera = OrthographicCamera()
        camera.setToOrtho(false, w/SCALE, h/SCALE);

        world = World(Vector2(0f,0f),false)

        Gdx.app.log("camerax", (w/2f).toString());
        Gdx.app.log("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)
                var touchPointBox2D:Vector2  = Vector2(touchPointScreen.x / PPM,touchPointScreen.y / PPM)

                if (player.body.fixtureList.first().testPoint(touchPointBox2D) && playerIsTouched == false){
                    Gdx.app.log("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 {

                    var impulseVector:Vector2 = Vector2(impulseVectorX,impulseVectorY)
                    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)

                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){
                  //  Gdx.app.log("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

                    Gdx.app.log("screen touch point",touchPointX.toString()+" "+touchPointY.toString())
                    Gdx.app.log("center of mass",playerCenterX.toString() +" "+ playerCenterY.toString())
                    Gdx.app.log("new point",impulseVectorX.toString() +", "+impulseVectorY.toString())

                    return true


                return super.touchDragged(screenX, screenY, pointer)


    override fun render() {
        world.step(TIMESTEP, 6, 2);

        Gdx.gl.glClearColor(1f, 0f, 0f, 1f)
        batch.draw(playerTexture,player.body.position.x*PPM - (64f/2),player.body.position.y*PPM-(64f/2),64f,64f);



    override fun dispose() {




Check it please fun touchDragged() I guess something is wrong there?

Powershell – View workflows waiting for the entire point

We have SharePoint 2013 environment, we have some problems with the workflow manager services. because of this, no workflow starts automatically during creation / update.

Even if I manually run the workflow on any item, it will stay in place. not started yet State.

I'm in communication with Microsoft Technical Support and they suggested updating the version of the workflow manager.

Before doing that, I wanted to see how much workflow was waiting on all sites.

Can I see that?

sharepoint enterprise – Retrieves the previous version of the file with JSOM in the 2013 share point

Battery Exchange Network

The Stack Exchange network includes 175 question-and-answer communities, including Stack Overflow, the largest and most reliable online community on which developers can learn, share knowledge and build their careers.

Visit Stack Exchange