JavaScript
- 7 ответов
- 0 вопросов
3
Вклад в тег
const { spawn } = require('node:child_process');
const iconv = require('iconv-lite');
const command = spawn('ping', ['google.com'], {
stdio: ['ignore', 'pipe', 'ignore'],
encoding: 'win1251' // замените кодировку на нужную
});
command.stdout.on('data', output => {
console.log(iconv.decode(output, 'win1251')); // замените кодировку на нужную
});
foreach (string betString in bets)
{
Program currentBet = Program.FromString(betString);
// Вызов нужного метода с использованием объекта currentBet
string betNumberString = currentBet.numberString;
// ...
}
void Flip()
{
if ((onGround) && !JumpControl)
{
Vector2 normal = GetSurfaceNormal();
rb.velocity = Vector2.Reflect(rb.velocity, normal);
}
Vector3 scale = transform.localScale;
scale.x *= -1;
transform.localScale = scale;
Right = !Right;
}
Vector2 GetSurfaceNormal()
{
RaycastHit2D hit = Physics2D.Raycast(transform.position, -Vector2.up);
return hit.normal;
}
export const createLoggerMiddleware = (someType: string): Middleware => {
return () => next => action => {
if (action.type === someType) {
alert('blabla');
}
return next(action);
};
};
export const setupStore = () => configureStore({
reducer: rootReducer,
middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(createLoggerMiddleware('someType')),
});