Skyrocket your website Ranking – Bullet proof power SEO strategy pack HV2 extreme impact and Result for $40

Skyrocket your website Ranking – Bullet proof power SEO strategy pack HV2 extreme impact and Result

Skyrocket your website Ranking – New bullet proof power SEO strategy pack HV2 extreme impact and Result..

write content and do article post and build high authority contextual backlinks.. Manually Done SEO Backlinks – white hat SEO services.

Its 100% White hat High pr backlinks service – Improve your Google Ranking.


python – Pygame bullet firerate not working sometimes

i have made this bullet class but i have a problem with the firerate. Sometimes i’m not able to shoot even when the little delay (700ms) between the two shots has ended. I guess it’s due to the pygame.time.set_timer(). Anyways i’m looking for a quick solution because i wanna move on to work on another part of this game.


class Singlebullet(object):

    def __init__(self):
        self.img = pygame.image.load(r'C:UsersSalemDocumentsMyGame1bullet.png')
        self.state = 'ready'
        self.speed = 0
        self.firerate = 700
    def shoot(self):
        if current_bullet_type == 'single':
            if self.state == 'ready':
                self.x = myplane.x + 71 
                self.y = myplane.y 
            if self.state == 'fire':
                self.speed = -13
            for event in events:
                if event.type == pygame.KEYDOWN or event.type == pygame.KEYUP:
                    if event.key == pygame.K_SPACE:
                        self.state = 'fire'
                        pygame.time.set_timer(pygame.USEREVENT+1, self.firerate)
                if event.type == pygame.USEREVENT+1:
                    self.state = 'ready'
            MyScrollingScreen.blit(self.img, (self.x, self.y))
            self.y += self.speed
s1 = Singlebullet()
while running:

Wysiwyg text editors: Pressing “Del” next to an empty bullet point removes said bullet point?

Each WYSIWYG text editor I can recall ever using (MS Word, Pages, Notes on Mac & iOS, web pages, etc.) exhibit the following behaviour. Suppose I’m editing the following text:

• Item one
• Item two
• |
Item three

Where | represents the current position of my caret.

If I press “Del” at this point, the following happens:

• Item one
• Item two
Item three

Isn’t the above completely counter to what one would intuitively expect to happen?

(So, what I would always do instead is the following: type a, press Del, press Backspace, which is really annoying).

Why, oh why does this action remove the bullet point in each and every text editor I have ever used?! This has infuriated me for literally decades of my life, and still does 😭!

Step size in a physics engien (Bullet)

I am trying to implement a physics engine (Bullet) into my game engine but I immediately found that I do not know how big should I make the simulation step. I think of 2 options:

  1. Use a fixed step size of 1/60. This way I have consistent simulation. Bullet allows making multiple steps when this time is exceeded. I think this is good for consistent simulation but I think it has a big flaw and that is that position of objects will not update when my framerate is higher than 60FPS. Right now I have around 1000 FPS but it will drop significantly to around 150 I expect because I use simple materials and not many objects plus the simulation time is not included yet. Is it possible to interpolate between steps so that 2 frames are always different but check for collisions only when 1/60 of a second passed?

  2. Update physics every frame but when frame time is longer than 1/60 then use substeps. This way I should be able to get more precision but it would lower framerate because the step is performed more than 60 times per second. I definitely get the new position of the object in every frame.

What do you think is a better approach and why? Is there a standardized way to go about it?

I know that when slow-motion footage of CSGO is taken in every frame the position of the object change but the tick rate is just 64. Which would not update the position in every one of the 240 frames monitors can handle and duplicate frames would be created. I know that animation can be sampled at any point in time but not the position of the objects. How is that achieved?

java – LIBGDX: Shoot a bullet using mouse position

I want to shoot a bullet towards my mouse position but I think that my math is probably wrong since the position the bullets travel to isn’t the right one.
Here’s my code

Vector2 bulletDirection = new Vector2(screenX - player.getX(), - (player.getY() - screenY)).nor();
bullet.setPosiion(player.getX(), player.getY());
bullet.translate(bulletDirection.x * flightSpeed, bulletDirection.y * flightSpeed);

Can you tell me what I’m doing wrong? The “bullet” object is my current bullet sprite

bullet physics – How to move a player on a sphere surface using Ammo.js and Three,js

I am moving a rigidbody (the character) on the surface of a sphere, like what is described here.

I am facing the following issue that I am having hard time to solve:
After moving the character, it starts spinning really slightly around it’s Y axis.

As a side note, I am using Ammo.js which is a javascript/webassembly port of Bullet 2.82, but this has no impact on the problem.

To “stick” the player (a dynamic rigidbody with a cylinder shape) to the sphere (a static rigid body with a sphere shape), here is the code, called on each game loop iteration:

function applyAttraction() {
    let sphereOrigin = this.body.getWorldTransform().getOrigin();
    let characterOrigin = this._characterEntity.body.getWorldTransform().getOrigin();

    // compute and apply sphere gravity to character body
    let sphereAttractionForce = new ammo.btVector3(
      characterOrigin.x() - sphereOrigin.x(),
      characterOrigin.y() - sphereOrigin.y(),
      characterOrigin.z() - sphereOrigin.z()
    this._characterEntity.body.applyForce(sphereAttractionForce, ammo.btVector3(0, 0, 0));

    // align character up with sphere origin
    const gravityDirection = bt2ThreeVec3(sphereAttractionForce).normalize().multiplyScalar(-1);

    // extract up axis of character transform basis
    let characterUp = new THREE.Vector3();
      new THREE.Vector3(),
      new THREE.Vector3()

    // apply rotation to align up with gravity vector
    let verticalAlignmentRotation = new Quaternion()
      .setFromUnitVectors(characterUp, gravityDirection)


And to move the character on the sphere (I removed the code dealing with the mouse controlled orientation since it is irrelevant to track down the problem). This code is also called on every game loop iteration:

let scalingFactor = 0.02;
    let moveX = inputController.getMoveX();
    let moveZ = inputController.getMoveZ();

    if (moveX === 0 && moveZ === 0) return;

    let movement = new THREE.Vector3(moveX, 0, moveZ).normalize();
    let wantedWorldPos = this.graphic.localToWorld(movement);
      .setOrigin(new ammo.btVector3(wantedWorldPos.x, wantedWorldPos.y, wantedWorldPos.z));

In plain (approximative) English, what I am doing:

  1. Get the direction from the player position to the center of the sphere
  2. Apply a force using that vector: this._characterEntity.body.applyForce(sphereAttractionForce, ammo.btVector3(0, 0, 0));
  3. Align the player Up with the gravity direction, to do so I:
    1. normalize and “flip” gravity vector direction
    2. extract character up vector and compute the quaternion which give the rotation to align this up vector with the gravity vector
    3. compute the new player orientation by applying quaternion from 3.b to it’s current orientation
  4. Apply movement (from keyboard inputs), in details:
    1. get a vector resulting from the requested movement alongside x and z axis
    2. convert this vector from player local basis to world basis: this.graphic.localToWorld(movement);
    3. set the new transform origin with this new vector

The project may be seen here (with the spinning issue I am describing). You may need to move a bit on the sphere (with WASD keys).

china – What is the closest city I can go from a bullet train departing from Beijing?

The trains you want are either “G trains” or “C trains”.
They are both rated at up to 350 kph but G designations are for longer distances and C for shorter routes.
Some information on types and speeds here

“Shorter” is relative. You can get 2 hours G train journeys.
The above page notes

  • G – High-Speed Electric Multiple Units (EMU) Train
    This is the fastest running for long distance in China, the top speed of which could reach 350km/h. Currently, the G-train could finish the 1,068-kilometers Wuhan-Guangzhou High-Speed Railway in 3 hours, the 301-kilometers Shanghai-Nanjing High-Speed Railway in 73 minutes and the 458-kilometers Zhengzhou-Xian High-Speed Railway in 2 hours.

BUT – the definitive guide to how to travel to anywhere from anywhere by train is “The man in seat 61” – be sure to find out where the name comes from :-).

This Seat-61 page tells you just about all there is to know about Chinese train travel.

For a short (75 miles) sharp (30 minutes!) trip (150 mph average) look about half way down that long page for Beijing – Tianjin by train where it says:

  • High-speed 350 km/h C-category trains (sometimes known as Hexie trains) link Beijing South Station & Tianjin every 10-20 minutes, taking just 30 minutes for the 120 km (75 miles) journey. Simply use to find specific train times. The fare is around RMB 58 (£6 or $9) for a 2nd class seat, RMB 69 (£7 or $10) in a first class seat. It’s easy enough to buy tickets at the station on the day of travel.

There will be other routes, but that seems to suit your requirement well.


For the fastest of all journeys you could take a G train to Shanghai and THEN take the “Maglev” train to the Pudong International airport. Under a 15 minute journey as I recall but daytime speeds of up to 430 kph (they say). The onboard speed gauge and actual train speed seem to not always quite match so actual speed may vary but you will find it very very very fast and noticeably faster than anything else. Cars on the adjacent motorway crawl along at 100 kph as you leap upon them from behind (figuratively anyway) and hurtle past in seconds. Marvellous !
I once got to travel the route 3 times in one day due to travel circumstances. Yee ha :-).

Strangely, Seat-61 seems to not mention the Maglev – maybe it’s not considered a train if it floats in the air with no wheels :-).

Maglev journey video here – looks so smooth it’s almost boring. Great fun in practice. Wikipedia page

Note that maximum speeds vary with time of day due to noise considerations.
According to the Wikipedia page, full speed runs are only from 9-10:45 am and 3-3:45 pm.
Check current arrangements when travelling.

Maglev speed estimation:

I tried using photos and vehicles on a motorway to estimate speed.
If you estimate vehicles as travelling at maximum speed limit you can note the distances they travel per frame and/or per time and compare this to how long the train takes to cover the same distance. There is a significant amount of uncertainty due to parallax errors, different positions of view and deciding where the train is relative to the roadway in any given photo. It gave me results of “about 4 x car speed” which should be ‘about correct’. My DSLR camera will take 12 frames per second when desired, which helps maximise material to take comparison photos from.

I have used this method with reasonable (apparent) success in the past to estimate vehicle speeds on motorways either overtaking us at at high speed or approaching.
For overtakers you simply estimate the time taken for you and them to reach a then distant point starting from the moment they pass you. For oncoming traffic similar but rearranged. Works to within error of estimation of distant location, timing and your mean speed.

front end – How to create an item list with a checkbox bullet head

Thanks for contributing an answer to Mathematica Stack Exchange!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.

To learn more, see our tips on writing great answers.

Is the boarding process/time the same for any train in China, or does the bullet train have its special boarding process?

As far as steps 5, 6, 7 are described in the graphic, yes, it is the same for all trains.

Identity Check

Since 2012, all passenger trains in China have adopted the “real-name system” where all tickets must be purchased with an associated name (and ID number) and can only be used for the named passenger.

Initially this is was only checked at boarding but to reduce heavy traffic inside the train station, as well as for security measures, nowadays most stations can only be accessed with a ticket and the ID associated to it.

This is strictly enforced almost everywhere (as it also involves the commercial interests of the railway company).

What may be different for HSR (and certain other routes): Many larger stations for more popular routes allow the use of Chinese machine-readable IDs without physical ticket (much like e-Ticket for flights); automated screening (via facial recognition) may be available. But this is not universal for all HSRs at the moment.

There are also stations with dedicated area for HSRs with dedicated lanes that allow faster boarding, which can also be a pain if you are unfamiliar and you may need to exit and enter through another side of the building to transfer trains for example.

Luggage Check & Security Check

This is standard as part of entry process to the station building. I couldn’t remember when it started, but it was a thing since 2008 at latest.

After the terrorist attacks at Kunming and Ürümqi train stations in 2014, the security at stations becomes remarkably stricter and many stations underwent renovations to seal off the station building as a “sterile” area. Additionally, the pat-down/metal detector checks are introduced generally. This is also when much more oppressive policies were introduced in Xinjiang.

But this check can still be quite lax at many stations, as long as you don’t have obviously banned items (e.g. knives). But it does increase the wait queue at peak times, during which many people are just waved through at some stations.

During sensitive periods (e.g. Congress/CPPCC sessions, Olympics), certain trains, HSR or otherwise, will also be subject depending on the destination (e.g. Beijing, Xinjiang).

What may be different for HSR (and certain other routes): Train stations serving HSRs may have more stringent security practices, even though the safety rules are technically the same. But HSR-serving stations are usually large and considered an important location, and sometimes are inspected by higher up officials, so there is a greater desire to at least appear more secure.