## php – how can make looping array to be one array with simple code

i want make my looping data in one array without index. i had solve it with code above but i think it so crowd and not simple

this my code

``````\$data = array();
while(\$dt = \$this->db->fetchAssoc(\$res_weight)){
\$data() = array_values(\$dt);
}
\$datas = json_encode(\$data);
\$datas = str_replace("(","",\$datas);
\$datas = str_replace(")","",\$datas);
\$datas = '('.\$datas.')';
\$datas = json_decode(\$datas);
``````

how can i make this code more simply then this code

## reactjs – React Native NativeBase Looping Tabs issue

Am using Expo React Native and Native Base library,

While am trying to loop through an array to output Tabs (each user have his own number of tabs)

``````       <Tabs>

{sectionsTabs.map(section => <Tab
style={{backgroundColor: '#0e0e0e'}}
>
<Text>{section_id}</Text>
</Tab>)}
</Tabs>
``````

SectionsTabs is an array

Below is the error message am getting

## python – I tried to make a noob version of Jarvis and I have an issue looping it

python – I tried to make a noob version of Jarvis and I have an issue looping it – Code Review Stack Exchange

## copy paste – Looping through dropdown list with Google script?

What I need to do is loop through a list in A1 of a sheet, copy the results, say from B2 to c13, and paste that information into a Google Doc. I found something that I’m working from, but it’s not correct, and I’m unsure of where to go from here.

``````function loop(){
for(var i = 0; i < optionsArray.length; i++){
optionsArray.getRange('A1').setValue(wsWithData(i)(0));
Utilities.sleep(1000);
}
if(wsWithData.getRange('').getValue() == "Yes"){
output.push((data(i)(0)));
}
wsWithData.getRange(2,12,output.length, 1).setValues(output);
}
``````

## unity – Looping world for a top down space shooter?

I am trying to understand how to make a seamless looping world for my top down space shooter.
First thing I tried was using multiple cameras, and teleporting the player when he reaches the edge, but it is not working well, and I don’t like that I have to use 4 cameras.
I wanted to test making the objects in the world teleport around the player, but I will have problems with the fact that each object is a different size, and teleporting them around will for sure create problems with moving objects. (Big obstacles could be teleported away and not collide with, for example, bullets until the bullet gets teleported too but inside the big obstacle)
Are there other ways to accomplish this?

## vue.js – How to create infinite looping by 3 slides at once in BootstrapVue’s Carousel?

The code looks as following:

``````<template lang="pug">
b-carousel.d-none.d-sm-block(
id='categoryRoulette'
controls
no-animation
:interval='0'
@sliding-start="onSlideStart"
@sliding-end="onSlideEnd"
)
b-carousel-slide(
v-for="category in chunkedCatalog"
)
template(v-slot:img)
b-card-group(deck)
b-card(
v-for="(item, index) in category" :key="index"
:img-src="https://codereview.stackexchange.com/item.image ? item.image :"../assets/images/blank.png'"
img-alt='Image'
img-top
tag='article'
)
b-card-text.d-flex.justify-content-center.align-items-center
h5
a(href="#") {{ item.title }}
</template>

<script lang="ts">
import Vue from 'vue'
import testData from '../data/testData.json'
import { RouletteData } from '../types/roulette'

export default Vue.extend({
data: (): RouletteData => ({
slide: 0,
sliding: false,
catalog: (),
}),
computed: {
chunkedCatalog() {
const chunkedArray = ()

for (let i = 0; i < this.catalog.length; i += 3) {
chunkedArray.push(this.catalog.slice(i, i + 3))
}

return chunkedArray
},
},
mounted(): void {
this.catalog = testData.catalog
},
methods: {
onSlideStart(slide: any) {
this.sliding = true
console.log('slide =', slide)
},
onSlideEnd(slide: any) {
this.sliding = false
console.log('slide =', slide)
},
},
})
</script>

<style lang="sass">
#categoryRoulette
margin-bottom: 40px
margin-top: 40px
.carousel-control-prev-icon
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232E86C1' class='bi bi-chevron-left' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E") !important
height: 100px !important
margin-left: -300px
width: 100px !important
.carousel-control-next-icon
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232E86C1' class='bi bi-chevron-right' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E") !important
height: 100px !important
margin-right: -300px
width: 100px !important
</style>
``````

The need is to create carousel that will display 3 slides at once and click on next/previous should display next/previous 3 slides. Pay attention – I don’t need to display slide by slide (1 by 1), but 3 slides (3 by 3).

I’ve tried to use an array and make chunks, but it works until the end of array only. For example, if I have 5 slides, it displays first 3 (it’s ok) and than 2 only (it’s not ok). Click on next displays first 3 slides again and so on.

How should it work? It should display first 3 slides of 5 and on next click it should display 3 slides as well – last 2 slides of 5 and first slide again. On next click it should display slides with indexes 2, 3 and 4 and so on.

## hard drive – Clonezilla looping through multiple clones

As I attempt to clone a disk to another disk Clonezilla goes through it once, then twice, then three times. It performs the exact same action over and over. Eventually, it finishes but this is not expected behavior. This is a recently updated version of Clonezilla and the previous did not take multiple hours like this does.

## animation – Export infinite looping GIFs by default

``````frames=Table(Plot(Sin(x(1+a x)),{x,0,6}),{a,0,2,0.2});
Export("test.gif",frames)
``````

The above code runs in version 9.0 to get a infinite looping GIF animation, but in recent versions it only loops once.
I know I can specify the option `"AnimationRepetitions" -> Infinity`. Can this option be the default when exporting GIF?
I have tried `SetOptions(Export, "AnimationRepetitions" -> Infinity)`, it doesn’t work.

## python – Cannot assign to function call when looping through and converting excel files

With this code:

``````
xls = pd.ExcelFile('test.xlsx')
sn = xls.sheet_names
for i,snlist in list(zip(range(1,13),sn)):

``````

I get this error:

skiprows=range(6))
^ SyntaxError: cannot assign to function call

df+str(i) also return error

i want to make result as:

## game loop – Are you supposed to be looping through all PhysicsObjects at every step in a physics engine?

I am currently making a small 2D game and I am trying to implement some basic 2D physics. I currently have a list of around 100 PhysicsObjects which I loop through every frame in order to update and apply forces to that object based on user input. The basic code is as follows:

``````accumulator = 0
dt = 0.01

while running:
for each object in PhysicsObjects:
update object

accumulator += time between last frame and current frame

while accumulator >= dt:
for each object in PhysicsObjects:
resolve forces to get new position of object based on dt
accumulator -= dt

for each object in PhysicsObjects:
render the object

``````

I was going to resolve the forces and calculate the new position in the update method of each object, but I was told the dt was necessary in order to make the movement and physics independent of frame rate, which is why it is in a separate loop. I also can’t update the objects in the physics engine loop as the update method needs to occur every frame.

This already seems incredibly inefficient, and I haven’t even started to test for collisions or anything else more in the physics engine. Is there a better way to structure this where I don’t need to loop through every object again in order to calculate their new position?