Use gpt-3.5-turbo-16k to write a cli-snake-game , but got 2 same file .

Model: gpt-3.5-turbo-16k.
Question: After execution, two identical files were generated.
Note: Below is the command-line output, from which you can see that the contents of Game.py and Snake.py are the same. It is not clear whether this is an issue with the gpt model or a problem within the code itself (such as some caching, etc.).
(metagpt_env_2) (base) wkm•~/code/metagpt(main⚡)» python startup.py "Write a cli snake game"                                                                    [20:27:33]
2023-08-08 20:36:52.676 | INFO     | metagpt.config:__init__:44 - Config loading done.
2023-08-08 20:36:54.406 | INFO     | metagpt.software_company:invest:39 - Investment: $3.0.
2023-08-08 20:36:54.406 | INFO     | metagpt.roles.role:_act:167 - Alice(Product Manager): ready to WritePRD
## Original Requirements:
The boss wants a command-line interface (CLI) snake game.

## Product Goals:
- Create a fun and engaging snake game that can be played in the command-line interface.
- Provide a challenging gameplay experience with increasing difficulty levels.
- Implement intuitive controls and smooth gameplay mechanics.

## User Stories:
- As a player, I want to be able to control the snake using arrow keys to navigate through the game.
- As a player, I want to see my current score and high score displayed on the screen.
- As a player, I want the game to become progressively more difficult as I score higher.
- As a player, I want to be able to pause and resume the game at any time.
- As a player, I want to be able to restart the game after losing.

## Competitive Analysis:
- Python Snake Game: A simple snake game implemented in Python with basic gameplay mechanics.
- CLI Snake: A command-line interface snake game with customizable difficulty levels.
- Snake CLI: A snake game with a minimalistic design and smooth controls.
- Terminal Snake: A snake game with retro graphics and challenging gameplay.
- Snake Game: A classic snake game with intuitive controls and multiple game modes.
- Snake CLI Pro: An advanced command-line interface snake game with power-ups and special abilities.
- Snake Master: A highly addictive snake game with stunning graphics and immersive gameplay.

## Competitive Quadrant Chart:
```mermaid
quadrantChart
    title Reach and engagement of snake games
    x-axis Low Reach --> High Reach
    y-axis Low Engagement --> High Engagement
    quadrant-1 Python Snake Game: [0.3, 0.6]
    quadrant-2 CLI Snake: [0.45, 0.23]
    quadrant-3 Snake CLI: [0.57, 0.69]
    quadrant-4 Terminal Snake: [0.78, 0.34]
    quadrant-1 Snake Game: [0.4, 0.34]
    quadrant-2 Snake CLI Pro: [0.35, 0.78]
    quadrant-3 Snake Master: [0.6, 0.7]
    "Our Target Product": [0.5, 0.6]

Requirement Analysis:
The product should be a command-line interface (CLI) snake game with intuitive controls, increasing difficulty levels, and the ability to pause, resume, and restart the game.
Requirement Pool:
[
    ("Implement arrow key controls for the snake movement", "P0"),
    ("Display current score and high score on the screen", "P1"),
    ("Increase the speed of the snake as the score increases", "P1"),
    ("Implement pause and resume functionality", "P2"),
    ("Allow the player to restart the game after losing", "P2")
]

UI Design draft:
The game will have the following elements and functions:

Snake: A series of characters representing the snake's body, moving on the screen.
Food: A character representing the food that the snake needs to eat to grow.
Score: Displayed on the screen, showing the current score and high score.
Controls: Arrow keys to navigate the snake.
Pause/Resume: Pressing a specific key to pause or resume the game.
Restart: Pressing a specific key to restart the game after losing.

The style of the game will be minimalistic, with clear and easy-to-read characters. The layout will be centered on the screen, with the snake and food displayed in a grid-like format.
Anything UNCLEAR:
There are no unclear points.
2023-08-08 20:37:19.073 | INFO     | metagpt.roles.role:_act:167 - Bob(Architect): ready to WriteDesign
Implementation approach:
For the implementation of the CLI snake game, we will use the following open-source tools:

curses library: This library provides a terminal-independent way to create text-based user interfaces. It allows us to control the terminal screen, handle keyboard input, and create interactive CLI applications.

random module: This module will be used to generate random positions for the food in the game.

time module: This module will be used to control the speed of the game and introduce delays between each frame.

sys module: This module will be used to handle system-level operations, such as exiting the game.

Python package name:
"cli_snake_game"

File list:
[
    "main.py",
]

Data structures and interface definitions:
classDiagram
    class Game {
        -int score
        -int high_score
        -int speed
        -bool game_over
        -bool paused
        -Snake snake
        -Food food
        +start_game(): None
        +update(): None
        +handle_input(): None
        +draw(): None
        +game_over_screen(): None
        +pause(): None
        +resume(): None
        +restart(): None
    }

    class Snake {
        -List[Tuple[int, int]] body
        -Tuple[int, int] head
        -Tuple[int, int] direction
        +move(): None
        +change_direction(): None
        +grow(): None
        +check_collision(): bool
    }

    class Food {
        -Tuple[int, int] position
        +generate_position(): None
    }

    class Screen {
        -int width
        -int height
        -curses.window window
        +init(): None
        +draw_border(): None
        +draw_snake(): None
        +draw_food(): None
        +draw_score(): None
        +refresh(): None
        +close(): None
    }

    class InputHandler {
        -curses.window window
        +get_input(): int
    }

    Game "1" -- "1" Snake: has
    Game "1" -- "1" Food: has
    Game "1" -- "1" Screen: has
    Game "1" -- "1" InputHandler: has

Program call flow:
sequenceDiagram
    participant M as Main
    participant G as Game
    participant S as Snake
    participant F as Food
    participant SC as Screen
    participant IH as InputHandler

    M->>G: G.start_game()
    G->>SC: SC.init()
    G->>F: F.generate_position()
    G->>SC: SC.draw_border()
    G->>SC: SC.draw_snake()
    G->>SC: SC.draw_food()
    G->>SC: SC.draw_score()
    G->>SC: SC.refresh()
    loop
        G->>IH: IH.get_input()
        G->>G: G.handle_input()
        G->>S: S.move()
        G->>S: S.change_direction()
        G->>S: S.grow()
        G->>S: S.check_collision()
        G->>F: F.generate_position()
        G->>SC: SC.draw_snake()
        G->>SC: SC.draw_food()
        G->>SC: SC.draw_score()
        G->>SC: SC.refresh()
        G->>G: G.update()
    end
    G->>G: G.game_over_screen()
    G->>G: G.pause()
    G->>G: G.resume()
    G->>G: G.restart()
    G->>SC: SC.close()

Anything UNCLEAR:
The requirements and implementation approach are clear.
2023-08-08 20:37:47.605 | INFO     | metagpt.utils.mermaid:mermaid_to_file:38 - Generating /Users/wkm/code/metagpt/workspace/cli_snake_game/resources/competitive_analysis.pdf..
file:///Users/wkm/.nvm/versions/node/v13.14.0/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:260
const svg = container.getElementsByTagName?.('svg')?.[0]
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
2023-08-08 20:37:47.865 | INFO     | metagpt.utils.mermaid:mermaid_to_file:38 - Generating /Users/wkm/code/metagpt/workspace/cli_snake_game/resources/competitive_analysis.svg..
file:///Users/wkm/.nvm/versions/node/v13.14.0/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:260
const svg = container.getElementsByTagName?.('svg')?.[0]
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
2023-08-08 20:37:47.938 | INFO     | metagpt.utils.mermaid:mermaid_to_file:38 - Generating /Users/wkm/code/metagpt/workspace/cli_snake_game/resources/competitive_analysis.png..
file:///Users/wkm/.nvm/versions/node/v13.14.0/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:260
const svg = container.getElementsByTagName?.('svg')?.[0]
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
2023-08-08 20:37:48.011 | INFO     | metagpt.actions.design_api:_save_prd:110 - Saving PRD to /Users/wkm/code/metagpt/workspace/cli_snake_game/docs/prd.md
2023-08-08 20:37:48.015 | INFO     | metagpt.utils.mermaid:mermaid_to_file:38 - Generating /Users/wkm/code/metagpt/workspace/cli_snake_game/resources/data_api_design.pdf..
file:///Users/wkm/.nvm/versions/node/v13.14.0/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:260
const svg = container.getElementsByTagName?.('svg')?.[0]
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
2023-08-08 20:37:48.124 | INFO     | metagpt.utils.mermaid:mermaid_to_file:38 - Generating /Users/wkm/code/metagpt/workspace/cli_snake_game/resources/data_api_design.svg..
file:///Users/wkm/.nvm/versions/node/v13.14.0/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:260
const svg = container.getElementsByTagName?.('svg')?.[0]
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
2023-08-08 20:37:48.217 | INFO     | metagpt.utils.mermaid:mermaid_to_file:38 - Generating /Users/wkm/code/metagpt/workspace/cli_snake_game/resources/data_api_design.png..
file:///Users/wkm/.nvm/versions/node/v13.14.0/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:260
const svg = container.getElementsByTagName?.('svg')?.[0]
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
2023-08-08 20:37:48.293 | INFO     | metagpt.utils.mermaid:mermaid_to_file:38 - Generating /Users/wkm/code/metagpt/workspace/cli_snake_game/resources/seq_flow.pdf..
file:///Users/wkm/.nvm/versions/node/v13.14.0/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:260
const svg = container.getElementsByTagName?.('svg')?.[0]
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
2023-08-08 20:37:48.363 | INFO     | metagpt.utils.mermaid:mermaid_to_file:38 - Generating /Users/wkm/code/metagpt/workspace/cli_snake_game/resources/seq_flow.svg..
file:///Users/wkm/.nvm/versions/node/v13.14.0/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:260
const svg = container.getElementsByTagName?.('svg')?.[0]
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
2023-08-08 20:37:48.443 | INFO     | metagpt.utils.mermaid:mermaid_to_file:38 - Generating /Users/wkm/code/metagpt/workspace/cli_snake_game/resources/seq_flow.png..
file:///Users/wkm/.nvm/versions/node/v13.14.0/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:260
const svg = container.getElementsByTagName?.('svg')?.[0]
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
2023-08-08 20:37:48.528 | INFO     | metagpt.actions.design_api:_save_system_design:119 - Saving System Designs to /Users/wkm/code/metagpt/workspace/cli_snake_game/docs/system_design.md
2023-08-08 20:37:48.531 | INFO     | metagpt.roles.role:_act:167 - Eve(Project Manager): ready to WriteTasks
Required Python third-party packages:
"""
curses
"""

Required Other language third-party packages:
"""
No other language third-party packages required.
"""

Full API spec:
"""
openapi: 3.0.0
info:
  title: Snake Game API
  description: API for controlling the Snake Game
  version: 1.0.0
servers:
  - url: http://localhost:8000
paths:
  /game/start:
    post:
      summary: Start a new game
      responses:
        '200':
          description: Game started successfully
  /game/move:
    post:
      summary: Move the snake in a specific direction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                direction:
                  type: string
                  enum:
                    - up
                    - down
                    - left
                    - right
              required:
                - direction
      responses:
        '200':
          description: Snake moved successfully
  /game/pause:
    post:
      summary: Pause the game
      responses:
        '200':
          description: Game paused successfully
  /game/resume:
    post:
      summary: Resume the game
      responses:
        '200':
          description: Game resumed successfully
  /game/restart:
    post:
      summary: Restart the game
      responses:
        '200':
          description: Game restarted successfully
"""

Logic Analysis:
[
    ("main.py", "Main"),
    ("game.py", "Game"),
    ("snake.py", "Snake"),
    ("food.py", "Food"),
    ("screen.py", "Screen"),
    ("input_handler.py", "InputHandler")
]

Task list:
[
    "main.py",
    "game.py",
    "snake.py",
    "food.py",
    "screen.py",
    "input_handler.py"
]

Shared Knowledge:
"""
The 'game.py' file contains the main logic for the Snake Game.
"""

Anything UNCLEAR:
No unclear requirements or implementation approach mentioned.
2023-08-08 20:38:03.166 | INFO     | metagpt.actions.write_code:run:77 - Writing main.py..
Code: main.py
import curses
import time
import sys
from game import Game
from screen import Screen
from input_handler import InputHandler

def main(stdscr):
    screen = Screen(stdscr)
    input_handler = InputHandler(stdscr)
    game = Game(screen, input_handler)

    game.start_game()

    while True:
        game.handle_input()
        game.update()
        game.draw()
        time.sleep(0.1)

        if game.game_over:
            game.game_over_screen()
            game.pause()
            game.restart()

if __name__ == "__main__":
    curses.wrapper(main)

2023-08-08 20:38:08.168 | INFO     | metagpt.actions.write_code:run:77 - Writing game.py..
Code: game.py
import curses
import time
import sys
from screen import Screen
from input_handler import InputHandler
from snake import Snake
from food import Food

class Game:
    def __init__(self, screen: Screen, input_handler: InputHandler):
        self.screen = screen
        self.input_handler = input_handler
        self.snake = Snake()
        self.food = Food()
        self.score = 0
        self.high_score = 0
        self.speed = 1
        self.game_over = False
        self.paused = False

    def start_game(self):
        self.screen.init()
        self.food.generate_position()
        self.screen.draw_border()
        self.screen.draw_snake(self.snake.body)
        self.screen.draw_food(self.food.position)
        self.screen.draw_score(self.score, self.high_score)
        self.screen.refresh()

    def handle_input(self):
        key = self.input_handler.get_input()

        if key == curses.KEY_UP:
            self.snake.change_direction("up")
        elif key == curses.KEY_DOWN:
            self.snake.change_direction("down")
        elif key == curses.KEY_LEFT:
            self.snake.change_direction("left")
        elif key == curses.KEY_RIGHT:
            self.snake.change_direction("right")
        elif key == ord("p"):
            self.pause()
        elif key == ord("r"):
            self.restart()

    def update(self):
        if not self.paused:
            self.snake.move()

            if self.snake.check_collision():
                self.game_over = True
                return

            if self.snake.head == self.food.position:
                self.snake.grow()
                self.score += 1
                self.speed += 0.1
                self.food.generate_position()

            self.screen.draw_snake(self.snake.body)
            self.screen.draw_food(self.food.position)
            self.screen.draw_score(self.score, self.high_score)
            self.screen.refresh()

    def draw(self):
        if self.game_over:
            self.game_over_screen()
        elif self.paused:
            self.screen.draw_pause()
            self.screen.refresh()

    def game_over_screen(self):
        self.screen.draw_game_over()
        self.screen.refresh()

    def pause(self):
        self.paused = True

    def resume(self):
        self.paused = False

    def restart(self):
        self.score = 0
        self.speed = 1
        self.snake.reset()
        self.food.generate_position()
        self.game_over = False
        self.paused = False
        self.screen.clear()
        self.screen.draw_border()
        self.screen.draw_snake(self.snake.body)
        self.screen.draw_food(self.food.position)
        self.screen.draw_score(self.score, self.high_score)
        self.screen.refresh()

def main(stdscr):
    screen = Screen(stdscr)
    input_handler = InputHandler(stdscr)
    game = Game(screen, input_handler)

    game.start_game()

    while True:
        game.handle_input()
        game.update()
        game.draw()
        time.sleep(0.1)

        if game.game_over:
            game.game_over_screen()
            game.pause()
            game.restart()

if __name__ == "__main__":
    curses.wrapper(main)

2023-08-08 20:38:28.540 | INFO     | metagpt.actions.write_code:run:77 - Writing snake.py..
Code: snake.py
import curses
import time
import sys
from screen import Screen
from input_handler import InputHandler
from snake import Snake
from food import Food

class Game:
    def __init__(self, screen: Screen, input_handler: InputHandler):
        self.screen = screen
        self.input_handler = input_handler
        self.snake = Snake()
        self.food = Food()
        self.score = 0
        self.high_score = 0
        self.speed = 1
        self.game_over = False
        self.paused = False

    def start_game(self):
        self.screen.init()
        self.food.generate_position()
        self.screen.draw_border()
        self.screen.draw_snake(self.snake.body)
        self.screen.draw_food(self.food.position)
        self.screen.draw_score(self.score, self.high_score)
        self.screen.refresh()

    def handle_input(self):
        key = self.input_handler.get_input()

        if key == curses.KEY_UP:
            self.snake.change_direction("up")
        elif key == curses.KEY_DOWN:
            self.snake.change_direction("down")
        elif key == curses.KEY_LEFT:
            self.snake.change_direction("left")
        elif key == curses.KEY_RIGHT:
            self.snake.change_direction("right")
        elif key == ord("p"):
            self.pause()
        elif key == ord("r"):
            self.restart()

    def update(self):
        if not self.paused:
            self.snake.move()

            if self.snake.check_collision():
                self.game_over = True
                return

            if self.snake.head == self.food.position:
                self.snake.grow()
                self.score += 1
                self.speed += 0.1
                self.food.generate_position()

            self.screen.draw_snake(self.snake.body)
            self.screen.draw_food(self.food.position)
            self.screen.draw_score(self.score, self.high_score)
            self.screen.refresh()

    def draw(self):
        if self.game_over:
            self.game_over_screen()
        elif self.paused:
            self.screen.draw_pause()
            self.screen.refresh()

    def game_over_screen(self):
        self.screen.draw_game_over()
        self.screen.refresh()

    def pause(self):
        self.paused = True

    def resume(self):
        self.paused = False

    def restart(self):
        self.score = 0
        self.speed = 1
        self.snake.reset()
        self.food.generate_position()
        self.game_over = False
        self.paused = False
        self.screen.clear()
        self.screen.draw_border()
        self.screen.draw_snake(self.snake.body)
        self.screen.draw_food(self.food.position)
        self.screen.draw_score(self.score, self.high_score)
        self.screen.refresh()

def main(stdscr):
    screen = Screen(stdscr)
    input_handler = InputHandler(stdscr)
    game = Game(screen, input_handler)

    game.start_game()

    while True:
        game.handle_input()
        game.update()
        game.draw()
        time.sleep(0.1)

        if game.game_over:
            game.game_over_screen()
            game.pause()
            game.restart()

if __name__ == "__main__":
    curses.wrapper(main)

2023-08-08 20:38:50.483 | INFO     | metagpt.actions.write_code:run:77 - Writing food.py..
Code: food.py
class Food:
    def __init__(self):
        self.position = (0, 0)

    def generate_position(self):
        # Generate random position for the food
        # Set self.position to the generated position
        pass

2023-08-08 20:38:53.777 | INFO     | metagpt.actions.write_code:run:77 - Writing screen.py..
Code: screen.py
import curses

class Screen:
    def __init__(self, stdscr):
        self.stdscr = stdscr
        self.width = 0
        self.height = 0
        self.window = None

    def init(self):
        self.stdscr.clear()
        self.height, self.width = self.stdscr.getmaxyx()
        self.window = curses.newwin(self.height, self.width, 0, 0)
        self.window.timeout(100)

    def draw_border(self):
        self.window.border()

    def draw_snake(self, body):
        for x, y in body:
            self.window.addch(y, x, curses.ACS_BLOCK)

    def draw_food(self, position):
        x, y = position
        self.window.addch(y, x, curses.ACS_DIAMOND)

    def draw_score(self, score, high_score):
        score_text = f"Score: {score} High Score: {high_score}"
        self.window.addstr(0, self.width - len(score_text) - 1, score_text)

    def draw_pause(self):
        pause_text = "PAUSED"
        self.window.addstr(self.height // 2, (self.width - len(pause_text)) // 2, pause_text)

    def refresh(self):
        self.window.refresh()

    def clear(self):
        self.window.clear()

    def close(self):
        curses.endwin()

Explanation:

The Screen class is responsible for managing the terminal screen and drawing the game elements.
The __init__ method initializes the screen attributes and sets the default values.
The init method clears the screen, gets the screen dimensions, and creates a new window using the curses library.
The draw_border method draws a border around the game area.
The draw_snake method takes a list of coordinates representing the snake's body and draws each segment on the screen.
The draw_food method takes the position of the food and draws it on the screen.
The draw_score method takes the current score and high score and displays them on the screen.
The draw_pause method displays a "PAUSED" message in the center of the screen.
The refresh method updates the screen with the latest changes.
The clear method clears the screen.
The close method ends the curses library and restores the terminal to its original state.
2023-08-08 20:39:09.163 | INFO     | metagpt.actions.write_code:run:77 - Writing input_handler.py..

Code: input_handler.py
import curses

class InputHandler:
    def __init__(self, stdscr):
        self.stdscr = stdscr

    def get_input(self):
        key = self.stdscr.getch()
        return key

The code above implements the InputHandler class, which is responsible for handling user input in the snake game. It uses the curses library to read keyboard input from the terminal.
The InputHandler class has a constructor that takes the stdscr parameter, which is the standard screen object provided by the curses library.
The get_input method reads a single character of input from the user and returns it. It uses the getch method of the stdscr object to read the input.
The code is PEP8 compliant, modular, easy to read and maintain.
2023-08-08 20:39:15.569 | INFO     | metagpt.roles.engineer:_act_sp:148 - Done /Users/wkm/code/metagpt/workspace/cli_snake_game/cli_snake_game generating.
(metagpt_env_2) (base) wkm•~/code/metagpt(main⚡)»                                                                                [20:41:34]

We cannot guarantee that the generated code is completely correct. In most cases, it needs to be modified and debugged.
There is some work in roadmap to reduce the possibility of errors.

This problem actually comes from the poor Instruction Following of gpt-3.5-turbo. gpt-4 basically does not have this problem


[TW#24059] Error handling for Ethernet / PHY initialization

Environment

Development Kit:      none
Core (if using chip or module): ESP32-WROOM-32
IDF version: 8d3d3fd (v3.0 branch)
Development Env:		Make
Operating System:		Windows
Power Supply:         USB + external 5V

Problem Description
Our ESP32-based product can connect to the internet via either WiFi or Ethernet. We recently had the problem that the LAN8720 chip broke for a customer and this prevented the ESP32 from starting up at all. We use the following code to initialize the ethernet module:
esp_err_t ret;

eth_config_t config = DEFAULT_ETHERNET_PHY_CONFIG;
config.phy_addr = PHY1;
config.gpio_config = eth_gpio_config_rmii;
config.tcpip_input = tcpip_adapter_eth_input;
config.clock_mode = ETH_CLOCK_GPIO0_IN;
config.phy_power_enable = phy_device_power_enable_via_gpio;

ret = esp_eth_init(&config);

This works great when the LAN8720 is connected, but if it isn't, it causes the ESP32 to get stuck in an infinite loop trying to reset the PHY until the task watchdog kills it and restarts the microcontroller. The output in the console:
I (3385) emac: emac start !!!

I (3389) emac: emac resetting ....
I (3393) emac: emac resetting ....
I (3397) emac: emac resetting ....
I (3401) emac: emac resetting ....
I (3405) emac: emac resetting ....
I (3409) emac: emac resetting ....
I (3415) emac: emac resetting ....
I (3419) emac: emac resetting ....
[...]
I (8017) emac: emac resetting ....
I (8021) emac: emac resetting ....
I (8025) emaTask watchdog got triggered. The following tasks did not reset the watchdog in time:
 - IDLE (CPU 0)
Tasks currently running:
CPU 0: emacT
Aborting.
abort() was called at PC 0x400d1145 on core 0

So, this chunk of code within the internal "emacT" task is the culprit:
void emac_reset(void)
{
    REG_SET_BIT(EMAC_DMABUSMODE_REG, EMAC_SW_RST);

    while (REG_GET_BIT(EMAC_DMABUSMODE_REG, EMAC_SW_RST) == 1) {
        //nothing to do ,if stop here,maybe emac have not clk input.
        ESP_LOGI(TAG, "emac resetting ....");
    }

    ESP_LOGI(TAG, "emac reset done");
}

Expected Behavior
If the PHY is not connected or broken, the ethernet initialization function should return an error return code or a system event shall be thrown, allowing programmatic detection of this error.
Actual Behavior
The emacT task gets stuck in an infinite loop. After the timeout expires, the task watchdog restarts the chip (if it's enabled). I do realize that emac_reset() is called in a background task, so returning a value from esp_eth_init() is difficult - but throwing a system event would be feasible and sufficient in my mind. Just don't go into an infinite loop!
Steps to repropduce

Disconnect a connected PHY from the ESP32 module (if connected)
Flash the ethernet example program onto the chip
See the message emac resetting .... appear on-screen forever

Code to reproduce this issue
See above / see ethernet example
Debug Logs
See above

@Oromis
You can try to change the system frequency to 240M.

@xiongyumail thank you for the suggestion, but the CPU frequency is already set to 240M. Furthermore, I don't see how changing the frequency can influence this behavior. If the PHY is not connected, then we will always end up in this infinite loop, not matter the frequency.

I investigated a bit and copied the ESP-IDF ethernet component into my project. After a bit of trial-and-error, I found a solution that's working nicely and could be integrated into the main ESP-IDF project so that others could benefit from it.
You can find the code changes in my post in the ESP-IDF forums: https://www.esp32.com/viewtopic.php?f=13&t=6286&p=27329#p27329


isBetween returns true and false when passed undefined

Describe the bug
The isBetween() function is returning different answers to the same question, when called with an undefined value.
To Reproduce
const moment = require('moment');

let i;
for (i = 0; i < 10; i++) {
   console.log(moment().isBetween('2019-01-01T00:00:00.000Z', undefined));
}

Expected behavior
The code should always print "true"
Current behavior
Returned values are randomly true or false, e.g.:
true
true
false
true
false
false
false
false
true
false
Enviroment
moment: 2.24.0
node.js: 10.15
Additional context
momentjs is used as stated in the docs:
https://momentjs.com/docs/#/query/is-between/

I feel this behavior is correct. As per the document the undefined is equivalent to moment(), so when the loop is running and both the moment() is producing same time then it will be true else it will be false.
As per the document ** The match is exclusive**
Here is code to justify the answer.
`const moment = require("moment");
let i;
for (i = 0; i < 10; i++) {
let x = moment();
console.log(x.isBetween("2019-01-01T00:00:00.000Z", x));
}`
output
false false false false false false false false false false
and when there is a time gap then it will always print true
const moment = require("moment"); let i; for (i = 0; i < 10; i++) {   let x = moment();   let y = moment().add(1, "s");   console.log(x.isBetween("2019-01-01T00:00:00.000Z", y)); }
output
true true true true true true true true true true
Conclusion is -> in the loop when two moments are getting time next to each other then it is true or when each one is getting same time it is resulting false. Its the loop which is causing this.
I think this is not a bug

In case anyone is still wondering how to fix this, there's another workaround which is to use the fourth parameter of  isBetween that indicates interval inclusion/exclusion.
Here is a jsFiddle demonstrating both behaviors side by side: https://jsfiddle.net/t4s6w5mc/3/
Thanks @kaushikkishore for the insight on this issue!

Please re-open if you still have issues.


Unable to get SyncDate

Please check Services, Known Bug / Issues and Troubleshooting over here first: https://github.com/dahlb/ha_kia_hyundai/blob/master/README.md
Region and Brand of car
US, KIA Soul EV
Describe the bug
Loading the custom component in HA fails causing the component to not load. Looks like KIA may have changed the output of the returned json data and it no longer includes syncDate, possibly others. Just a guess.. will try to load the data in the api project. Error started today.
Debug logs if an error occurred
2023-02-15 16:32:58.717 ERROR (MainThread) [custom_components.ha_kia_hyundai.vehicle] Unexpected error fetching Vehicle 0***** data: 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py", line 239, in _async_refresh
self.data = await self._async_update_data()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py", line 195, in _async_update_data
return await self.update_method()
File "/home/homeassistant/.homeassistant/custom_components/ha_kia_hyundai/vehicle.py", line 116, in async_update_data
await self.api_cloud.update(vehicle=self)
File "/home/homeassistant/.homeassistant/custom_components/ha_kia_hyundai/api_cloud_us_kia.py", line 32, in request_with_active_session_wrapper
return await func(args, kwargs)
File "/home/homeassistant/.homeassistant/custom_components/ha_kia_hyundai/api_cloud_us_kia.py", line 120, in update
last_updated_str=vehicle_status["syncDate"]["utc"],
TypeError: 'NoneType' object is not subscriptable
2023-02-15 16:32:58.722 DEBUG (MainThread) [custom_components.ha_kia_hyundai.vehicle] Finished fetching Vehicle 0** data in 0.326 seconds (success: False)
To Reproduce
Steps to reproduce the behavior:

Restart HA
See error

Expected behavior
custom component to load without issue
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Running HA 2023.2.2 and ha_kia_hyundai v1.7.3

looks like they have changed the api parameters and have blocked access to debug on android devices to see the new parameters so this will likely take a while to find a fix.

It's blocked on the iOS app too.. :(

looks like it might be possible to grab the api calls from the website...
https://owners.kia.com/apps/services/owners/getvehicleinfo.html/vehicle/1/maintenance/1/vehicleFeature/1/airTempRange/1/seatHeatCoolOption/1/enrollment/1/dtc/1/vehicleStatus/1/weather/1/location/1
looks like it returns similar data to what is gathered from the api

android's slightly older version 6.0.1 isn't blocked, using it I was able to identify the status data is being blocked unless enrollment is requested too, not sure if this is a bug on kia's side or a way to ensure active subscriptions, either way about to release a fix :)

fixed in 1.7.4. Thanks for writing this up, this ticket helped resolve this very quickly

Awesome! Thank you for the quick fix!

Works as expected. Thank you again!


added binomial heap code implemented in C

No description provided.

No description provided.

Could you please assign your file like:-
BinomialHeapImplementation/C/binomialheap.c
make your PR again


It.IsAnyObject only accepts objects/interfaces that has a constructor and prototype not object literals

Because It.IsAnyObject expects Ctor, only types and interfaces that including a constructor and prototype are valid.
But many objects are being instantiated using object literals (JSON deserialization) which does not fit this scheme.
I would suggest to add an overload for It.IsAnyObject that simply expects T
      interface z {
        new ();
        prototype: any;
      }
      var c  = function() {}
      var o : z = new c();
      var p : z = {}; //<-- not valid
Kind regards

I guess that it is answered partially by https://github.com/florinn/typemoq/issues/3 but would a explicit typecast of and empty object to T allow the mock to be contructed?

For your code example, TypeScript 1.8.29 gives me the following error at the last line:
Error TS2322
Type '{}' is not assignable to type 'z'.
  Property 'prototype' is missing in type '{}'.

What TypeScript version are you using?

Dear florinn
The code that i posted was not meant to compile, but simply to illustrate that object literals could not be used as input parameter to It.IsAnyObject because it was restricted by the Ctor<T> interface.
After giving it some additional thought i realize that there are not other way to check what type an object is - runtime - than to check the prototype. And hence the Ctor<T> restriction
You can close the issue. Sorry for the inconvenience.

It's OK, @moanrose
Let me know if you have any other suggestions to improve typemoq.


fix: Small responsivity issue on Why Koda? page

Thank you for your contribution to the Koda - Generative Art Marketplace.
👇 __ Let's make a quick check before the contribution.
PR Type

[x] Bugfix

Needs Design check

@exezbcz please review

Context

[x] Closes #10113

Did your issue had any of the "$" label on it?

[x] My DOT address: Payout

Screenshot 📸

[x] My fix has changed something on UI; a screenshot is best to understand changes for others.

thank you!


incorrect dfsdiag testdfsintegrity command

[Enter feedback here]
The command dfsdiag testdfsintegrity is incorrect. it is missing a double slash (\) before the domain name
dfsdiag /testdfsintegrity /DFSRoot:\contoso.com\MyNamespace /recurse /full

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: 802850c4-0365-5fc3-bda1-cf8c9c1afbd2
Version Independent ID: ead601fc-9e80-53e3-b697-2edc4289639d
Content: dfsdiag testdfsintegrity
Content Source: WindowsServerDocs/administration/windows-commands/dfsdiag-testdfsintegrity.md
Product: windows-server
Technology: windows-commands
GitHub Login: @JasonGerend
Microsoft Alias: jgerend

We hugely appreciate your contribution, feedback, and support to our technical documentation.
We’ve phased out GitHub Issues on this repository as the feedback mechanism for content and have replaced it with a new feedback system. For more information see, Content User Feedback. As part of this rollout, we are migrating your issue where our team will use your comments to improve the documentation experience. Unfortunately, this does mean you won't be able to access this issue after the migration is complete.
All issues will be migrated by Thursday 29th August 2024.
Once again, thank you for your valuable feedback, we hope you’ll continue to contribute using our new feedback system.


Adjust limits in BYOC

If I'm using Defang BYOC to deploy to my own cloud accounts, I shouldn't have the same limits as Defang Hosted.
Ideally, there should be UX around setting account-wide limits, or project-based limits get applied at deploy-time. Something like:
defang config set --scope=account --key=deploy.resources.reservations.cpus --value=4.0

defang config set --scope=project --project=application-x --key=deploy.resources.reservations.memory --value=4096

Done in 82e47e0f6d8f60d4764d53751dbfe6fc8e63c920


BUG: Setting master_subnet_id and compute_subnet_id to the same value -> compute nodes fail to come online

Configuration:
[global]
sanity_check = true

[vpc ***]
master_subnet_id        = subnet-1234
compute_subnet_id     = subnet-1234

Result:
Beginning cluster creation for cluster: mycluster
Creating stack named: parallelcluster-mycluster
Status: parallelcluster-torque - ROLLBACK_IN_PROGRESS
Cluster creation failed.  Failed events:
  - AWS::AutoScaling::AutoScalingGroup ComputeFleet Received 0 SUCCESS signal(s) out of 2.  Unable to satisfy 100% MinSuccessfulInstancesPercent requirement

Note: cluster creation fails because initial_queue_size = 2. If initial_queue_size = 0 it will succeed, but when jobs get added to the queue, compute nodes will come online but fail to register with the master instance.
I thought there was nothing wrong with being explicit and expected that master_subnet_id= compute_subnet_id  = <id> behave the same as master_subnet_id = <id>. The documentation here only shows examples where the subnets are different: https://docs.aws.amazon.com/parallelcluster/latest/ug/networking.html

Hi @RickoLacharity,
thank you for the feedback. This has been fixed both in the code and in the docs and will be avail in the next release


Fixed-length buffers

A program consisting of >= 256 zeros crashes. I haven't checked yet, but I suspect that many other tokens of length >= 256 will also crash.
Simple reproduction:
python -c 'print("0"*1000)' >crash.txt
huo crash.txt

Considering you're using longs internally anyways, it may be simplest to just throw an error if you get too many characters in a single token.

Yep, other tokens are affected. A thousand 'a's, or a string consisting of 1000 characters, will both crash it, for instance.

Also issue #9 comes into play here.

If I wrote up a patch to replace your fixed-length buffers with heap-allocated ones, would you accept it?

Yes, in general I am pretty open about pull requests. If you do something to improve the code I'll definitely accept the pull request.


strange issue with throws block

Here https://github.com/stalexxx/ad-scrapper/blob/3f38e75d806ad9b3ea99b019280728fe78cd29d0/avito/src/test/kotlin/com/stalex/avito/RetryTest.kt I firstly made test "test always bad with mockk", but it failed stangly, although it should do the same as "test always bad"(that works):
in debugger it goes until line 35, but then fails with exception on line 33

Let me check what is wrong

Can you paste an exception message with stacktrace

well, i got that
java.lang.IllegalStateException
at com.stalex.avito.RetryTest$3.invoke(RetryTest.kt:33)
at com.stalex.avito.RetryTest$3.invoke(RetryTest.kt:10)
at io.kotlintest.Spec$runTest$callable$1$1.invoke(Spec.kt:124)
at io.kotlintest.Spec$runTest$callable$1$1.invoke(Spec.kt:15)
at io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke(Spec.kt:116)
at io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke(Spec.kt:15)
at io.kotlintest.Spec.interceptTestCase(Spec.kt:78)
at io.kotlintest.Spec$runTest$initialInterceptor$1.invoke(Spec.kt:116)
at io.kotlintest.Spec$runTest$initialInterceptor$1.invoke(Spec.kt:15)
at io.kotlintest.Spec$runTest$callable$1.call(Spec.kt:124)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
but you can run it yourself

Very weird error. Not able to understand how that's possible

Ok, now understand

It's about how Kotlin and MockK interact regarding Boxed numbers

As a workaround you can use Parser<String, Int?>. It should pass. Meanwhile I get closer on what can be done with non-nullable integer
        "test always bad with mockk" {
            val parser = mockk<Parser<String, Int?>>()
            every { parser.parse(any()) } throws IllegalStateException()

            val result = RetryableParser(parser, default = { -1 }).parse("")

            result shouldBe -1
        }.config(enabled = true)

well, Int is some random type, doesn't matter

Are you sure it doesn't matter?
Because what I understood Kotlin is returning Int object from Parse and then any first possible time converts it to int via intValue() , but because you pass it from mock to other type of Parser it keep the object Int and only when it assigned to val calls intValue() which results in exception(because it is mocked). That way intValue() get out of try {} catch(...) {} and throws Excecption

Version 1.7.10 released, please check if it fixes your case and close the ticket.


Added example of how to run Hugging Face models through Ollama using TC

Added example of how to use OllamaContainer to run Hugging Face models
Co-authored-by: @kiview

Thanks @ilopezluna !


Added a --fee param to the cleos system regproducer command

Change Description

Consensus Changes

API Changes

Documentation Additions

I propose to add an interface to change the fee of the producer in the future. this is ok, because there is a break_fee field in the table of grants, and the edge of the proxying graph is deleted as soon as the grantor is no longer satisfied with the commission.

Will be implemented in the future


adds experience slider multipler

I think you need to do this
                // Never reduce to zero
                experiencePoints = (int)Math.Round(experiencePoints * Main.Settings.ReceivedExperiencePercentage / 100.0f, MidpointRounding.AwayFromZero);

and also take into account experience can be granted by FunctorGrantExperience.
I was going to do
    [HarmonyPatch(typeof(FunctorGrantExperience), "Execute")]
    internal static class FunctorGrantExperience_Execute_Patcher
    {
        internal static bool InFunctor { get; private set; }

        public static void Prefix()
        {
            InFunctor = true;
        }

        public static void Postfix()
        {
            InFunctor = false;
        }
    }

    [HarmonyPatch(typeof(RulesetCharacterHero), "GrantExperience")]
    internal static class RulesetCharacterHero_GrantExperience_Patcher
    {
        /// <summary>
        /// Modify experience received from battle by desired %.
        /// Don't modify if experience granted by FunctorGrantExperience.
        /// Don't reduce to zero.
        /// </summary>
        /// <param name="experiencePoints"></param>
        public static void Prefix(ref int experiencePoints)
        {
            if (!FunctorGrantExperience_Execute_Patcher.InFunctor
                && Main.Settings.ReceivedExperiencePercentage != 100
                && Main.Settings.ReceivedExperiencePercentage != 0)
            {
                // Never reduce to zero
                experiencePoints = (int)Math.Round(experiencePoints * Main.Settings.ReceivedExperiencePercentage / 100.0f, MidpointRounding.AwayFromZero);
            }
        }
    }

I don't believe we need to patch the Functor at all. I leveraged your experience formula as well as the if != 100.

FunctorGrantExperience doesn't do it directly but always calling RulesetCharacterHero.GrantExperience. Reason why no patch required there:
List<RulesetCharacterHero> rulesetCharacterHeroList = ServiceRepository.GetService<IGameService>().EnumerateHeroes();
FunctorDefinitions.GrantExperienceMode intParameter = (FunctorDefinitions.GrantExperienceMode) functorParameters.IntParameter;
using (List<RulesetCharacterHero>.Enumerator enumerator = rulesetCharacterHeroList.GetEnumerator())
{
  while (enumerator.MoveNext())
  {
    RulesetCharacterHero current = enumerator.Current;
    if (intParameter == FunctorDefinitions.GrantExperienceMode.Flat)
    {
      current.GrantExperience(functorParameters.IntParameter2);
    }
    else
    {
      int experienceToReachLevel = current.ComputeNeededExperienceToReachLevel(functorParameters.IntParameter2);
      if (experienceToReachLevel > 0)
        current.GrantExperience(experienceToReachLevel);
    }
  }
  yield break;

Yes but this branch forces you to the next level, which it won't if scaled.
{
  int experienceToReachLevel = current.ComputeNeededExperienceToReachLevel(functorParameters.IntParameter2);
  if (experienceToReachLevel > 0)
    current.GrantExperience(experienceToReachLevel);
}

So we could disable scaling when xp granted from functor and/or look at the "intParameter == FunctorDefinitions.GrantExperienceMode.Flat" so we still scale that bit.


Cannot skip in multiplayer due to skip slots not being created after load complete.

Never mind that's not the cause of this issue. Something more is at play.


fix 156: No result for static route overlap check with non-affected versions

The issue ( #156 ) was actually visible even in the pytest output pasted in the original PR #129.
The last line is of when the provided versions are not affected by CSCwb91766, which is what this check is for.
[Check  1/1] L3out /32 Static Route and BD Subnet Overlap...                                                      FAIL - OUTAGE WARNING!!
  L3out                 /32 Static Route  BD                BD Subnet
  -----                 ----------------  --                ---------
  uni/tn-AA/out-static  <IP_ADDRESS>       uni/tn-AA/BD-bd1  <IP_ADDRESS>/24

  Recommended Action: Change /32 static route design or target a fixed version
  Reference Document: https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#l3out-32-overlap-with-bd-subnet

[Check  1/1] L3out /32 Static Route and BD Subnet Overlap...                                                      FAIL - OUTAGE WARNING!!
  L3out                 /32 Static Route  BD                BD Subnet
  -----                 ----------------  --                ---------
  uni/tn-AA/out-static  <IP_ADDRESS>       uni/tn-AA/BD-bd1  <IP_ADDRESS>/24

  Recommended Action: Change /32 static route design or target a fixed version
  Reference Document: https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#l3out-32-overlap-with-bd-subnet

[Check  1/1] L3out /32 Static Route and BD Subnet Overlap...                                                                         PASS
[Check  1/1] L3out /32 Static Route and BD Subnet Overlap...                                                                         PASS
[Check  1/1] L3out /32 Static Route and BD Subnet Overlap...      <--- result missing

After the fix:
[Check  1/1] L3out /32 Static Route and BD Subnet Overlap...                                                      FAIL - OUTAGE WARNING!!
  L3out                 /32 Static Route  BD                BD Subnet
  -----                 ----------------  --                ---------
  uni/tn-AA/out-static  <IP_ADDRESS>       uni/tn-AA/BD-bd1  <IP_ADDRESS>/24

  Recommended Action: Change /32 static route design or target a fixed version
  Reference Document: https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#l3out-32-overlap-with-bd-subnet

[Check  1/1] L3out /32 Static Route and BD Subnet Overlap...                                                      FAIL - OUTAGE WARNING!!
  L3out                 /32 Static Route  BD                BD Subnet
  -----                 ----------------  --                ---------
  uni/tn-AA/out-static  <IP_ADDRESS>       uni/tn-AA/BD-bd1  <IP_ADDRESS>/24

  Recommended Action: Change /32 static route design or target a fixed version
  Reference Document: https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#l3out-32-overlap-with-bd-subnet

[Check  1/1] L3out /32 Static Route and BD Subnet Overlap...                                                                         PASS
[Check  1/1] L3out /32 Static Route and BD Subnet Overlap...                                                                         PASS
[Check  1/1] L3out /32 Static Route and BD Subnet Overlap...                                                                         PASS

Also, cleaned up the unnecessary white spaces.

Internal integration tests have also passed.


Debian Release Mapping needs update

https://github.com/coreos/clair/blob/fec86b621187501444a681908eeaa385ae68c18f/database/namespace_mapping.go#L26
Debian just moved stretch to stable, so we need to update this list.

Also, there is now a new warning so a mapping for "buster" is also needed:
clair: fetcher note: Debian buster is not mapped to any version number (eg. Jessie->8). Please update me.

This was fixed in #416. I'm working on cutting a v2.0.1 release with these changes!


Problems !

I have two Problems

same I  dont know whats going on

The first pic isn't a problem in itself, you should access the dashboard and once you clone the website it shouldn't appear anymore.
The second image, though, never happened to me and can't seem to replicate it.
Does it still happen if you browse using <IP_ADDRESS>?

http://<IP_ADDRESS>:5000/neptune
After going on the above link social fish on termux Gives this :
[05/May/2019 10:28:19] "GET /creds HTTP/1.1" 200 -
What does this mean


fix: let toAdditive handle more auxiliary declarations

This PR will correctly deal with names starting with env.mainModule ++ _auxLemma(generated bysimp`)
Also add a test for this case (reported on Zulip)
Also correctly deal with equation lemmas, which are have mkPrivateName env pre as prefix, instead of pre. It fixes both of the following issues:

Previously this would sometimes not translate the equation lemmas, since the naming heuristic didn't change their name
If it would translate a lemma, it would not apply it, since it wasn't additive to the translations dictionary.

depends on: #689

Could you please fix `` in the commit message?

bors merge


ARTEMIS-1058 Jars in web tmp dir locked on Windows

This is the second commit. It improves the windows service
configuration file so that the service can be shutdown
gracefully (clean shutdown) and allow for a chance to
clean up the web tmp dir.

@clebertsuconic  The commit ae00423 was valid. However on Windows when running artemis as a service,  stopping the service simply kills the process, So the shutdown hook won't get called and the clean up code never get executed. This commit just fixes this.
According to this doc: https://github.com/kohsuke/winsw/blob/master/doc/xmlConfigFile.md
The  is used for starting a service, not .

@gaohoward Please check #2537


optionalWords=querystring not doable

We don't have a way to do optionnalWords=querystring for each query.
Probably an option in searchbox should do it

You can pass any Algolia option to the instantsearch() instanciation call using the searchParameters option. Would that work?

I thought I added that to the doc but I think we haven't deployed the latest version on the community website yet.

No that won't work because this need to be set for each query with the query.
So if I search for "Iphone 6 case" optionnalWords will be "Iphone 6 case"
if I search "Iphone 5 charger" optionnalWords will be "Iphone 5 charger"

Putting that as an option in the search box will work. The only problem that can happen is with several widget that have the ability to set the query.
If we have that in instantsearch core, then it needs to intercept the query and then change the parameters. What if the helper could be prevented to send the search query when the search event is triggered https://github.com/algolia/algoliasearch-helper-js/blob/master/src/algoliasearch.helper.js#L723
This would be like :

searchbox sets query and do the search
search event is triggered and interupted if the value of the query is not the optionnalWords
state is modified with the optionnalWords set to the query value
trigger the search again

First solution is way simpler :P

An option in the searchBox looks good, this is where it should belong. Now we need a name for it that actually maps a feature

This can be solved using the queryHook or searchFunction or creating a custom widget that will listen to helper change and set the optionnal words accordingly.
No need for a new API entry.


AMP plugin is installed but its not funtioning

Hi,
I have installed this plugin and configured at, http://mentalitch.com from last week. its working fine if I add /?amp after url.
but its not working if from mobile if I search for keyword and click on site link. Its opening actual site pages instead of google pages.
Can you let me know whats missing exactly?
Thanks,
Gulshan

Hey Gulshan,
I have just checked your website, you have not installed this plugin. As far as the google is concerned, it will take some time before it start showing it on the results.

For more support, please create a new support thread at the forums at https://wordpress.org/support/plugin/accelerated-mobile-pages


{{ fn('wp_nonce_field', 'action', 'name') }} produces double output

Expected behavior
Should display 2 tags (nonce name and nonce referrer).
Actual behavior
Displays 4 tags (name x2, referrer x2).
Steps to reproduce behavior
{{ fn('wp_nonce_field', 'action', 'name') }}

What version of WordPress, PHP and Timber are you using?
Example: WordPress 4.7.2, PHP 5.6, Timber 1.2.1
How did you install Timber?
Upgraded to newest version via plugin updater in WordPress dashboard

Figured out the issue.
I needed to pass the fourth parameter as false, to prevent function from echoing the output:
{{ fn('wp_nonce_field', 'action', 'name', false, false) }}

thanks ! It works


[feature] mx::api NonTraditionalKey equivalent

We've discussed about this in the past, and I've found mixing mx::core with mx::api to be a pain! :)
So, I'm just adding this here in case someday you'd want to add this feature to mx::api.
Cheers

If you'd rather I finish up with my branch (I think it's ready) then I can do that instead.

Up to you. If you already have the feature up and working + tested, you can just merge that and close my PR. I won't be offended by it ;)


Rename Repo

Your repo name is incredibly confusing. You can change it in the settings tab.

How about the fact that i'm testing out a thing where this repo is a host to a few mods, and not just vayras.
Will not change (for now at least), closing.


ERD is not visible in the documents readme

Expected Behavior
When I go to https://github.com/redhat-beyond/Hotails/tree/main/resources/documents I expect to see the DFD and the ERD
Current Behavior
When I go to https://github.com/redhat-beyond/Hotails/tree/main/resources/documents I expect to see only the DFD
Acceptance Criteria
Both DFD and ERD are visible in the readme
Failure Information (for bugs)
Just go to When I go to https://github.com/redhat-beyond/Hotails/tree/main/resources/documents I expect to see the DFD and the ERD


Enable signing of nupkgs

@dotnet-bot test this please

@dotnet-bot test Ubuntu16.04 Build for CoreCLR please
I don't recognize this but don't see how it could possibly be related:
MESSAGE:
Microsoft.Build.Shared.InternalErrorException : MSB0001: Internal MSBuild Error: Request 0 was expected to be in state Executing but is not scheduled at all (it may be unscheduled or may be unknown to the system.)
+++++++++++++++++++
STACK TRACE:
at Microsoft.Build.Execution.BuildManager.EndBuild() in /_/src/Build/BackEnd/BuildManager/BuildManager.cs:line 658 at Microsoft.VisualStudio.Build.UnitTest.MuxLogger_Tests.OneSubmissionTwoLoggers() in /_/src/Utilities.UnitTests/MuxLogger_Tests.cs:line 272


Old support

[This support page is really old and suggest downgrading to really old stuff]

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: a93e3805-5fd5-c6c9-f25d-1be5c41ed77f
Version Independent ID: 9826c974-24a2-b65e-9603-14428f6bb5bc
Content: Preparing Appium Tests for Upload - Visual Studio App Center
Content Source: docs/test-cloud/frameworks/appium/index.md
Service: vs-appcenter
Sub-service: app-center-test
GitHub Login: @lucen-ms
Microsoft Alias: lucen

Currently App Center Test support only Appium 1.x versions, latest version of 1.x branch is 1.22.


removed update button from explorer

Description
The update button was replaced by the run button in Explorer, but now both are being shown. Removing the update button since the search bar was most recently developed with the run button
Issues Resolved
[List any issues this PR will resolve]
Check List

[ ] New functionality includes testing.

[ ] All tests pass, including unit test, integration test and doctest

[ ] New functionality has been documented.

[ ] New functionality has javadoc added
[ ] New functionality has user manual doc added

[ ] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Needs a snapshot update


fix: Listen to all services in sui-test-validator

Description
sui-test-validator's faucet listen to all IPs (<IP_ADDRESS>)
fixes https://github.com/MystenLabs/sui/issues/15279
Test plan
How did you test the new or updated feature?

Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

[ ] Protocol:
[ ] Nodes (Validators and Full nodes):
[ ] Indexer:
[ ] JSON-RPC:
[ ] GraphQL:
[ ] CLI:
[ ] Rust SDK:

Thanks! This was fixed with the removal of sui-test-validator and integrating the logic in sui start. See #18607.


Constructor syntax needs to be changed..

Hi,
Have found issue with constructor syntax which we used in todomvc app, while running depcheck-es6.
https://github.com/rackt/redux/blob/master/examples/todomvc/server.js#L06
hope this will be the proper syntax.
new (require('express'))();
you can check it out here : https://github.com/lijunle/depcheck-es6/issues/91
Thanks

Closed by #979, thanks for reporting.


Document undocumented overloads that take string

When looking at the signatures of std.file, it looks like
it only takes input ranges and specifically disallows strings.
The text of most functions say it can take strings, but the
proper overload isn't displayed at all.
This gave me a moment of confusion earlier today, so I decided to
just fix it with a bunch of little dittos. Now, the string overloads
should appear right with the non-string overloads.

I'm torn on this. They're not documented because it's a hack around alias this issues, which is a legitimate reason not to bother the user with it. On the other hand, if the code is going to be calling it unbeknownst to the user, they should be a way to know about the function.

Eh, they are public functions, I think ALL public functions ought to be documented. Even if they are a filthy hack, just mention that to the reader since otherwise they will be kinda confused when it pops up "no overload matches, candidates are.... <some thing they didn't realize even existed>" in an error message some day.
And consider this: http://dlang.org/phobos/std_file.html#remove
It specifically says !isConvertibleToString in the prototype, so when I saw that, I briefly considered that it actually didn't even accept strings! I almost flamed Phobos when I realized that's absurd and there had to be more to the story, so I looked to the source and saw the overload.

Ideally, we should take Walter's advice and merge these overloads into single user-facing functions that accept all ranges (including strings), and that either forwards to *Impl overloads (i.e., the current functions) or uses static if in the function body to handle the different cases. The user really should not need to know that the current Phobos implementation handles strings and non-string ranges differently.

But if that's too much work, I agree to merge this PR to at least get things documented, and then we can clean it up later.

@quickfur  it's not a question of ranges and strings, it's a question of ranges (which include strings), and aggregate types which alias this to string like data.  The aggregate types require a specific template instantiation in order to properly use the aliased part of the type.

Yeah, fixing it is certainly ideal, I don't understand why it needs to be separate though (if only the language supported /*some feature*/ to explain the reasoning of strange things like this. Maybe I should write a DIP). Why is it auto ref too?
The way I would have written these functions if I was doing them from scratch with a Phobos interface would be to just accept the input range and copy it into a temporary buffer:
void remove(Range)(Range name) if(CanGetStringFrom!Range) {
   char[1024] nameBuffer; // wchar on Windows
   call_c_function(put_with_zero_terminator(name, nameBuffer));
}

And then the implementation of that put just foreach over it or memcpy or whatever optimization you want.
That CanGetStringFrom implementation is just basically __traits(compiles, put_with_zero_terminator())... basically isInputRange && !isInfinite && isSomeChar!ElementType!range || isConvertibleToTheFormer
I mean that's just how I'd do it, and the existing impl really isn't far from that - it forwards the convertsToString version to the range version, which then calls tempCString to do the stack buffer and zero termination... which takes a range already... http://dpldocs.info/experimental-docs/std.internal.cstring.tempCString.html
but if it were that simple, why didn't they do it that way in the first place? idk.

ummm this works:
import std.internal.cstring;

void print(const char* c) {
        import core.stdc.stdio;
        printf("%s\n", c);
}

struct Test {
        string foo = "lol";
        alias foo this;
}

void main() {
        Test t;
        print(tempCString(t));
}

So why don't we just already use that? I think the constraint is just wrong anyway, alias this already works on tempCString, which is the existing implementation.
Why does read for example have a static if inside? The one thing could just be sliced! And tempCString knows the length so it can just offer slicing... and readImpl, being internal, could just take the tempCString type directly. (it is one of those idiotic f#@ing voldemort types but that can be fixed... or even just ignored).
I still think we should just document the status quo but all this crap:
void[] read(R)(R name, size_t upTo = size_t.max)
if (isInputRange!R && isSomeChar!(ElementEncodingType!R) && !isInfinite!R &&
    !isConvertibleToString!R)
{
    static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char))
        return readImpl(name, name.tempCString!FSChar(), upTo);
    else
        return readImpl(null, name.tempCString!FSChar(), upTo);
}
/// ditto
void[] read(R)(auto ref R name, size_t upTo = size_t.max)
if (isConvertibleToString!R)
{
    return read!(StringTypeOf!R)(name, upTo);
}

should really just be
void[] read(R)(R name, size_to upTo = size_t.max) if(something simplified)
{
  auto tcs = tempCString!FSChar(name);
   return readImpl(tcs[], tcs,  upTo);
}

Where tempCString.opSlice is added to just return ptr[0 .. _length];
We don't even have to change readImpl.

opSlice is supposed to translate a .. b into something that can be passed to opIndex. At least, that's the case with multidimensional indexing of mixed index type, e.g., arr[a, b..c, d], but last time I checked, there is some inconsistency in how the compiler handles opSlice for single-dimensional indexing.

Well, regardless it all works.
I guess the problem is a case like this:
struct Test {
	int front;
	bool empty;
	void popFront();

	string foo = "lol";
	alias foo this;
}

import std.range.primitives;
static assert(isInputRange!Test);
static assert(is(ElementType!Test == char));

So it is a range of int (sort of lol but it passes the test), and is implicitly convertible to a range of char via alias this. So that Test won't pass the isSomeString test nor the is input range of chars test.
It works once we get inside, but we have to get inside. OK, I understand the problem now.
I'd really just abstract the constraint to handle this, then make tempCString handle it too, then everything forwards through them.

If you're dealing with an implicit conversion, the conversion needs to be forced. Using the type without converting it is just going to cause buggy behavior or even outright won't compile (e.g. treating an enum of base type string as a string if you're doing anything range-based on it will fail to compile, which is why using isSomeString on a range-based function is questionable). It wouldn't surprise me if what's here could be simplified, but if you're going to accept stuff based on implicit conversions, then you need to actually do the conversion.
As for the auto ref, without that, static arrays would be copied (since for better or worse, static arrays pass isConvertibleToString). They then get sliced when calling the other overload, because it's explicitly instantiated with the corresponding string type. And since we don't normally using auto ref with range-based functions, it makes sense for them to be separate overloads.
Honestly, I wish that isConvertibleToString weren't a thing and that this didn't accept static arrays, but it was probably done because it previously took string and thus - unfortunately - automatically sliced static arrays rather than refusing them without explicit slicing, and Walter didn't want to break any code with the change.
So, I think that we should either combine the two overloads and use static if - making the one overload take its argument by auto ref - or we should document the second overload. And which is better depends primarily on the side effects of having it take auto ref. For a basic input range, it wouldn't matter. Unless someone is reusing it after passing it (which would be a bug), using auto ref will have no impact, and in most cases, the range would just be consumed either way and reusing it wouldn't have even partially worked (the main exception being if it should have been a forward range and wasn't and copying it implicitly saved it). If it's a forward range, then it should have save called on it if it gets reused, but you know that almost no one is doing that, and most of the arguments will either be structs that are implicitly saved or strings which are implicitly saved. So, changing it to auto ref would then cause those ranges to be consumed when they weren't before. That being the case, making it auto ref would break code and is a bad idea.
So, given that, documenting the second overloads and indicating in the documentation that the function takes any range of characters or any type which implicitly converts to a string is probably the right approach.

Eh, I don't think static arrays should be accepted. I also don't think they should be implicitly convertible either (and that is such a major buggy zone that I can't imagine anyone disagreeing if they are familiar with the issue!), but here it is so simple, the user just adds [] when passing it and boom, it works. The auto ref thing complicates the simplified implementation I'd otherwise do (tempCString doesn't do the auto ref stuff either ad forwarding can't be done without the signature-level overload anyway. Ugh.)
But we're getting really down a rabbit hole here. Ironically, I opened this PR via a new script because I figured the github overhead of going to the website and clicking "create pr" would take longer than the code and I figured /// ditto would be uncontroversial and instantly merged...
Let's at least go ahead and document the status quo then we can figure out the other stuff later.

I would love it if static arrays were no longer implicitly sliced, but the last time I tried to talk Walter into that, he thought that improving @safe would fix the safety problems with implicit slicing and didn't think that it was a big deal. So, I don't see implicit slicing going away any time soon.
As for these functions in particular, the problem is code breakage. They used to take string (or maybe const(char)[] - I'd have to dig through the history to see which), which means that they accepted static arrays. So, removing that functionality when templatizing the functions risked breaking code. And changing it now would risk breaking code. So, I don't see that happening, much as I totally agree that these functions would ideally not accept static arrays.
As for the PR, ideally the docs would be clearer about what is accepted (since they seem to claim that it's just ranges of characters and strings, which isn't true), but documenting the overloads is at least an improvement.

Auto-merge toggled on

I'm curious if it actually would break code to disallow static arrays. Since they are statically sized, they are almost never the correct length for a filename anyway, so you'd have to slice it regardless to get usable contents.
Now, for a zero-terminated string that is different, but read (et. al., I'm just using it as an example of the ~20 functions in here that all follow the same pattern) was never defined to take a zero-terminated string. I guess ['f,'o','o',0,trash, follows, rest, of, array][].ptr would yield "foo" the same to the underlying C function, but... that's just accidentally working rather than a published interface that we need to adhere to...
meh oh well.

I'm curious if it actually would break code to disallow static arrays.

The biggest risk would probably be a constant, though even then, I'd expect an enum that's a string instead. It wouldn't surprise me at all if it didn't break code, but we don't know and there really isn't a good way to know. And at this point, the stance tends to be that we don't want to risk breaking code, so I doubt that Walter or Andrei would be in favor of such a change. Deprecating the behavior would be acceptable in that regard, but it's functionality that's been around for years, and unless we're going to go the extra mile of actually removing implicit slicing of strings, I'm not sure that it's worth it. And we run into this exact same problem every time that we templatize a function that took a string previously. And that's a lot of stray deprecations to get rid of implicit slicing without actually getting rid of it from the language. If we want to go down that road, it makes more sense to try and convince Walter to deprecate implicit slicing of static arrays, but unfortunately, I doubt that we can.


[incubator/druid] Specify these configurations about druid_indexer_logs_xxx

Is this a new chart

NOTE: We're experiencing a high volume of PRs to this repo and reviews will be delayed. Please host your own chart repository and submit your repository to the Helm Hub instead of this repo to make them discoverable to the community. Here is how to submit new chart repositories to the Helm Hub.

No
What this PR does / why we need it:
Specify these configurations about druid_indexer_logs_xxx
Which issue this PR fixes
(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

fixes #

Special notes for your reviewer:
@maver1ck @AWaterColorPen
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

[x] DCO signed
[x] Chart Version bumped
[x] Variables are documented in the README.md
[x] Title of the PR starts with chart name (e.g. [stable/mychartname])

/assign @maver1ck

/ok-to-test

Hi, @AWaterColorPen . Do you have any other comments?

@asdf2014 . It is good to merge

/lgtm


Allow TXT records when reading TinyDNS files

Symbiosis (https://symbiosis.bytemark.co.uk/stretch/docs/symbiosis.html) and its fork Sympl (https://sympl.host/) can generate TXT records in TinyDNS format. However, octodns does not consider a TXT record from TinyDNS as valid.
An example TXT record:
'gentlyhosting.uk:v=spf1 +a +mx ?all:300
The format is documented here:
https://cr.yp.to/djbdns/tinydns-data.html
It would be good to allow octodns to be able to read in (and hence sync) these TXT records from TinyDNS files

Similar to https://github.com/github/octodns/issues/342 PRs welcome


Adding ‘echo support’ in Condoor to hide the password from scp/sftp etc

SCP prompts users to enter a password in a separate line.
The password needs to be excluded in the log.

@jamesjwei , could you please add the example of the command/interaction where the echo should be disabled?


Filters for Published/Draft updates

Not all updates have a publication date, so when viewing https://opencollective.com/opencollective/updates as an admin (only them can see drafts) I see all drafts first, sorted by creation date. Or, with example, a typical list from the admin point of view looks like:
Update 0: publishedAt: null, createdAt: '2020-07-01'
Update 1: publishedAt: null, createdAt: '2020-01-01'
Update 2: publishedAt: '2020-03-01', createdAt: '2020-01-01'
Update 3: publishedAt: '2020-02-01', createdAt: '2020-05-01'
Update 4: publishedAt: '2020-01-01', createdAt: '2020-01-01'

I personally think we should address this with a different design, letting the admin select between "Published" and "Draft":

Originally posted by @Betree in https://github.com/opencollective/opencollective/issues/5690#issuecomment-1209015611

Resolved with tabs in the new dashboard


Support wider range of AWS certificate types

ACM has a lot of challenges, largely due to requirements for manual approval of certs.
This also rules out the mainstream signers.
Support for  "server-certificate" ARNs as an alternative to ACM would be highly desirable.

Is this available in 0.8?


added simple directive

The translation key can be passed as an attribute, or the content of the element. It's also possible to pass an object with interpolation key-value pairs.

Hello, thanks for this PR, it's very complete and I like that !
I'm a bit worried about the fact that it can use the content of the element because of the risks of injection.
Also I think that it's not a good idea to use "nativeElement" because you cannot use webworkers: https://angular.io/docs/ts/latest/api/core/ElementRef-class.html

Yeah, you're totally right about nativeElement, but I didn't found out how to adequately manipulate the content from a Directive or Component.
Could you explain your concerns regarding injection? Maybe, we can drop this feature because of this security problem alone not digging into the nativeElement issue, although I really like to have my translation keys as innerHTML.

Well you're using innerHTML, which means that you don't check the content of the element. In angular 1 we had $sce that did that for us.
Let's say that your element contains the name of your users, one user changes his name to some js or sql code, and then you get the content with innerHTML and you try to use that as a key in the TranslateService & TranslateParser, I have no idea what could happen but it could be a problem somehow.

There is not much documentation about the right way to manipulate the DOM, so I just took a look how the angular native directives do it. (for example ngClass  )
This seems to be the right way:
constructor(
  public translateService: TranslateService,
  public ref: ElementRef,
  public renderer:Renderer
) {
}

updateValue(key: string) {
  this.translateService.get(key, this.interpolateParams).subscribe((res: string) => {
    this.renderer.setText(this.ref.nativeElement, res);
  });
}

@hpop: but your code prevents using html in translations.

Is html output necessary? As far as I understand it, there is no html support in pipes, so ng2-translate does't support html output right now. Or am I missing something?
Bonus: If we are not allowing html in translations, we don't have to build a implementation of $sce. :)

Apart from questioning html support, everything you wrote is correct. The thing is, I'm pretty certain, html support is essential.
You would have to translate every part of longer texts with markup or links separately which is in some languages not possible at all, because of different sentence structures.

Ok. Good point.

If what we need is an Angular2 sanitizer to make this directive a reality, then I could make an Angular2 html sanitizer library based off this excellent one:
https://github.com/google/caja/blob/master/src/com/google/caja/plugin/html-sanitizer.js
?
Try it out here:
http://codepen.io/devilish/pen/aCJuH
There's also this alternative:
https://github.com/punkave/sanitize-html
If everyone is in agreement that having one would solve this and then integrating such a library here would allow this PR to be merged, I could create this lib this week.

@NathanWalker That would be great!I had a look into html-sanitizer and unfortunately it has some other dependencies to the caja tool :-/ I hope this is not a showstopper. On the other hand, sanitize-html is browserified and minified still 125K, so maybe resolving those dependencies in cajas html-sanizier would be a good start.

Maybe we could just add a note in the docs saying: "hey be careful" and go on with it ?

Be careful warning may suffice for time being. I think if a sanitizer is created, we could add a wiki here that described how to use the sanitizer with the library if desired. Maybe just take consideration in how this directive is implemented to allow easy plug/play with a 3rd party sanitizer :+1:

Yeah I think that's a better way to do that. I'll try to merge this tonight

Now that I've fixed the OnPush bug with the Pipe, do we still need this directive ?

@ocombe Awesome! Not sure we do need the directive anymore. @sclausen I like the additional flexibility it adds but may add unneeded complexity at this point since OnPush is now possible?

I would really enjoy to see my templates more like cool_translate_key	 than {{'cool_translate_key' | translate}}	, but I think its just a matter of aesthetics. There is no real 'need' for this and to gain simplicity in code, we should omit this directive.

Oh, I totally forgot about the html thing. How can we achieve the rendering of html-translations (e.g. for formatted message bodies) without having the directive?

What are the html translations you're talking about ?

I thought of html translations e.g. for messages with variables.
The following could be the translation value:

Dear {{username}},

Your order "{{order.name}}" has been shipped and will arrive est. {{order.estArrive}}

Sincerly

Your [cool-company-name] Shipping Team

This could be the view:
<message-body translate-params="{order:order, username: username}" translate>
</message-body>

If this wouldn't be possible, it would be totally cumbersome to create multiple translation values to compose such a message and furthermore, not every language has the same sentence construction, so the variables are sometimes at a different place in the sentence.
Do you have a different solution for this problem?

@NathanWalker still interested in writing a sanitization lib for angular2?

@sclausen Yes! Once the issue with OnPush was solved for me, creating the sanitization library fell to bottom of my list though.
Here we go though, just created a shell for the lib here:
https://github.com/NathanWalker/ng2-sanitize
Invited you to collab :+1:
I'd like to move forward with either of these options for the core sanitizer, lemme know what you think:
A. https://github.com/punkave/sanitize-html
or...
B. Port angular 1.x sanitizer to TypeScript and integrate: https://github.com/angular/angular.js/blob/master/src/ngSanitize/sanitize.js

The official sanitizer is real, we can use this: angular/angular/pull/8453

@ocombe angular/angular#8453 has been merged, so we just have to wait for rc2 to be released to :smile: what do you think should be done now? should I continue to work on this pull request and add the new sanitizer?

yes, I don't see why not, this was my only concern

You might want to pull the latest changes that I just pushed to make it work with RC2 :)

I also messed up the tests :-1: Im currently working on it ;)

@ocombe I desperately tried to get a test to work, but testing a directive with the depending translate service is too complicated for me. I tried my directive manually and it works, but I can't put a working test case for my directive together. Do you have any idea, how I can test this?

It would be great to have this PR finalized.
Is there anything I can do to help?

@mchambaud beside the tests, there is still an issue with correct updates when switching the language. You could dig into both issues. Since I started this, angular got further and testing is now very different, so you could basically rewrite the whole test setup.

I'd like to see if we can use the i18n directive for this, maybe make a directive that could be provided instead of the existing i18n directive so that users can switch from the current i18n angular implementation to ng2-translate easily, and maybe even use the new ng-xi18n messages extractor

I still have the problem, that

hello_world
 doesn't update after first language change, but
greetings
 works properly.
One strange thing I discovered is, that translate.get doesn't return after the first language change in the first example. Has anybody an idea, why this happens?

@sclausen I know this may be very late but still why not

 as its the format used in angular-i18n which is very famous for ng1 it would make migrations very easy. Also you might want to consider using a prefix to translate as its a HTML5 attribute and usually ends up having issues when using protractor

@sclausen sorry just saw the code, ignore my first comment. Seems you already support key as attribute value. May be you could consider adding a prefix to the translate directive. something like ng-translate may be

btw we currently use the below as a workaroud as I didnt want to write a complete directive from scratch. Works perfectly
import { Component } from '@angular/core';

@Component({
    selector: '[jhi-translate],[jhiTranslate]',
    template: '',
    inputs: ['key:jhi-translate', 'args:translate-values']
})
export class <%=jhiPrefixCapitalized%>Translate {

    private key: string;
    private args: any;
    //FIXME add support to pass translate-compile/ directives in translated content doesnt work
}

@deepu105 I don't think there is a need of prefixing the translate attribute-component with ng. When I created this, I had the compatibility to pascal precht's angular-translate in mind.

@sclausen take a look at this thread https://github.com/angular-translate/angular-translate/issues/849

@deepu105 I'm not sure, what you want to tell me with this thread. They discuss prefixing because of a very narrow corner case and don't come to a conclusion to implement this, so angular-translate still works like always and if I want to be compatible, I shouldn't implement prefixing.
Btw. the in the w3c document mentioned google translate service ignores this flag.

@sclausen what I'm trying to tell you is that the translate directive doesnt work when you use it in protractor coz protractor treats its as a html5 attribute and expects a boolean and not string as value. So I understand you want to maintain backword compatibility so what say you support both like below
@Component({
    selector: '[ng-translate],[translate]',
    ...
})

So that people who are not bothered by the issue can use translate and we (Jhipster folks, which is a huge user base btw, and others using this with protractor) can use ng-translate

@deepu105 that sounds really reasoned, I will add this. For the rest of my problems though I still have no solution.

@sclausen what do you think of the wrapper directive approach I posted above. It works without any problem for me. But im no ng2 expert so wouldn't know if it has any downfall compared to your original service ?

@deepu105 I don't think your wrapper would work for my desired featureset. The wrapper needs to have  so it's not compatible to angular-translate anymore, since it was possible in angular-translate to use it also like this key and that {{'keys.' + variable}}.

So what's left to be done here? I'll be glad to help if some resources are needed

@gitnik I still have the problem, that

hello_world
 doesn't update after first language change, but
greetings
 works properly.
One strange thing I discovered is, that translate.get doesn't return after the first language change in the first example. Do you have any idea, why this happens?

I had a similiar issue. Maybe this can help you?
https://github.com/ocombe/ng2-translate/issues/288

@SamVerschueren thanks for the remarks. I will fix this minor codestyle change requests along with fixing the faulty functionality. I'm currently a little out of spare time.

No problem, we all have busy lives!

I have a question about this, let's say that you have the following html code:

  Some text
  some inner text

then using the innerHTML as a key will receive:

  Some text
  some inner text

Two problems here: the first is that we have the empty lines at the beginning and end which can be removed if you compress your html or use aot, and then it won't work anymore, but you probably won't use that as a key anyway because that'd be insane (so you'll use the translate attribute to specify a key).
Still, someone who uses:

  Some text

might expect the key to be "Some text", and that will not be the case.
And the second problem is that angular adds attributes to inner elements, so that means that you can never use inner html elements in your keys because it won't work.
I won't even start with the innerHTML of elements that use bindings (like *ngIf), it adds comments all over the html...
This means that this directive will only work on really simple elements that only contain some text, that's still useful but I would love if it could do more. And to make sure that it works we should trim the content to remove leading/trailing spaces.
Do you think we could do something like that:

  Some text
  some inner text

And in this case replace only the text at the first level, which would mean that here we have 2 translations: Some text and some inner text ? We replace those and ignore all the inner html?

@ocombe I think your example of
Some text
some inner text

as a key is a corner case which shoudln't be handled. Your translation keys are keys in a json file and if someone want's to have something like that as a translation key, I would be curious to hear the explanation why. In your third example, I agree, I would trim al the whitespace, like in angular-translate from @PascalPrecht (translate.js#L167), too.
I wanted to make this directive compatible to angular-translate and ultimately support all its options, so something like this

TRANSLATION_ID

{{translationId}}

WITH_VALUES

WITH_VALUES

@SamVerschueren that's also the reason I used @Input('translate'), because I didn't wanted to have translate to be the variable name of the key in some cases.
A lot has happened since I opened the pull request and much work has to be done to finish this directive/component. Currently my focus in angular2 is on other things, and I think I should rewrite this whole pr, but this may take a while.

No problem, I started rewriting it, using some of your work, but transforming it in a directive instead of a component :)

@ocombe That's great! :+1:

Let's keep this opened, I'll work from your PR so that you get the credits deserved, also this will help me not to forget to merge it :D

Done !
Thanks a lot to all of you and especially @sclausen for this, sorry it took so long !

So awesome! Thanks!


added Kubernetes support

⚠⚠⚠ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma
Tick the checkbox if you understand [x]:

[x] I have read and understand the pull request rules.

Description
Kubernetes manifests and helm chart added
Type of change

Other

Checklist

[x] My code follows the style guidelines of this project
[x] I ran ESLint and other linters for modified files
[x] I have performed a self-review of my own code and tested it
[x] I have commented my code, particularly in hard-to-understand areas
(including JSDoc for methods)
[x] My changes generate no new warnings
[ ] My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)
Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.

Kubernetes manifests and helm chart with persistent storage

It is already here:
https://github.com/louislam/uptime-kuma/tree/k8s-unofficial/kubernetes
If you think the existing k8s files can be improved, please make another pr and make changes to it.
Close as duplicate of https://github.com/louislam/uptime-kuma/pull/231


Support unknown exposure_program value of 0

I have an image that produced the following error
iex(1)> d = File.read!("test.jpg")
<<255, 216, 255, 225, 95, 204, 69, 120, 105, 102, 0, 0, 73, 73, 42, 0, 8, 0, 0,
  0, 12, 0, 15, 1, 2, 0, 6, 0, 0, 0, 158, 0, 0, 0, 16, 1, 2, 0, 14, 0, 0, 0,
  164, 0, 0, 0, 18, 1, 3, 0, ...>>

iex(2)> {:ok, info} = Exexif.exif_from_jpeg_buffer(d)
** (FunctionClauseError) no function clause matching in Exexif.Decode.exposure_program/1

    The following arguments were given to Exexif.Decode.exposure_program/1:

        # 1
        0

    Attempted function clauses (showing 9 out of 9):

        defp exposure_program(1)
        defp exposure_program(2)
        defp exposure_program(3)
        defp exposure_program(4)
        defp exposure_program(5)
        defp exposure_program(6)
        defp exposure_program(7)
        defp exposure_program(8)
        defp exposure_program(9)

    (exexif) lib/exexif/decode.ex:116: Exexif.Decode.exposure_program/1
    (exexif) lib/exexif/decode.ex:28: Exexif.Decode.tag/3
    (exexif) lib/exexif.ex:111: Exexif.read_tags/5
    (exexif) lib/exexif.ex:113: Exexif.read_tags/5
    (exexif) lib/exexif.ex:67: Exexif.read_exif/1
iex(2)>

The attached commit fixes this problem. Sorry if it doesn't make sense, this is the first line of Elixir I've ever written.
I can upload the image somewhere if necessary

I am also getting this error with a standard jpg with unknown exposure... it would be nice if you could merge the fix

Sorry this took so long to merge—just slipped my mind.

I'll be putting the update on hex in a few minutes

not a problem, i found a few more that i'll put in PRs for in the near
future
On 30 November 2017 at 01:50, Dave Thoms<EMAIL_ADDRESS>wrote:

I'll be putting the update on hex in a few minutes
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/pragdave/exexif/pull/9#issuecomment-347902810, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAofOcx7ycu_-1H0icu3E0VKOjeGsa-fks5s7X0sgaJpZM4PY99w
.


[SPARK-23928][SQL] Add shuffle collection function.

What changes were proposed in this pull request?
This PR adds a new collection function: shuffle. It generates a random permutation of the given array. This implementation uses the modern version of Fisher-Yates algorithm.
How was this patch tested?
New tests are added to CollectionExpressionsSuite.scala and DataFrameFunctionsSuite.scala.

cc @pkuwm

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/1093/
Test PASSed.

Merged build finished. Test PASSed.

Test build #93231 has started for PR 21802 at commit b4cbb55.

Test build #93231 has finished for PR 21802 at commit b4cbb55.

This patch passes all tests.
This patch merges cleanly.
This patch adds the following public classes (experimental):
case class Shuffle(child: Expression, randomSeed: Option[Long] = None)

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/93231/
Test PASSed.

Test build #93261 has finished for PR 21802 at commit 9081e2f.

This patch fails due to an unknown error code, -9.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/93261/
Test FAILed.

Jenkins, retest this please.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/1117/
Test PASSed.

Test build #93268 has started for PR 21802 at commit 9081e2f.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/1126/
Test PASSed.

Test build #93279 has started for PR 21802 at commit f38b698.

Test build #93268 has finished for PR 21802 at commit 9081e2f.

This patch fails Spark unit tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/93268/
Test FAILed.

Test build #93279 has finished for PR 21802 at commit f38b698.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/93279/
Test PASSed.

cc @cloud-fan @gatorsmile

Do we really need full codegen for all of these collection functions? They seem pretty slow and specialization with full codegen won't help perf that much (and might even hurt by blowing up the code size) right?

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/1193/
Test PASSed.

Merged build finished. Test PASSed.

Test build #93373 has started for PR 21802 at commit 2ca1230.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/93373/
Test PASSed.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/1269/
Test PASSed.

Test build #93493 has started for PR 21802 at commit c56ecc5.

Test build #93493 has finished for PR 21802 at commit c56ecc5.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/93493/
Test PASSed.

@rxin Generally I agree with you, but currently the whole-stage-codegen doesn't support CodegenFallback, which means, if we don't implement codegen, this expression will stop WSC and hurt perf a lot.

LGTM

Looks good to me too

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/1398/
Test PASSed.

Thanks! merging to master.


When select a list of fields and sql with [ ]

sqldef = {
"table": "table_a",
"id_fld": "id",
"fields": ["resource_id",
"resource_name",
"subject_name",
"period_name",
"view_url",
"download_url",
"score",
"view_count_td",
"like_count_td",
"download_count_td",
"spread_count"]
}
Query.from_(table).select(conf.fields).get_sql()
return SQL is :  SELECT ['resource_id','resource_name','subject_name','period_name','view_url','download_url','score','view_count_td','like_count_td','download_count_td','spread_count'] FROM "table_a"
How to remove the [ ] ?
Thanks!

I solved it by adding a *
sql = str(Query.from_(table).select(*[Field(f) for f in conf.fields]).get_sql())
SELECT "resource_id","resource_name","subject_name","period_name","view_url","download_url","score","view_count_td","like_count_td","download_count_td","spread_count" FROM "table_a"
Thanks!


Fixed missing Unified diff headers for gitlab.mr_diff

Fixed missing Unified diff headers for gitlab.mr_diff due to a Gitlab API bug (See https://gitlab.com/gitlab-org/gitlab-ce/issues/53229).

          1 Warning

:warning:
Tests were not updated

  Generated by :no_entry_sign: Danger

A test for it would be nice but not a blocker for now 👍


Update appenders.xml

Fix "filePattern" description

Thank you for your report. Diff applied to Git master.