i called reclaimReleasedResources() method,but the memory is not release.help me !

i add  a line code in SceneView.destory() as follows:
/**
   * Required to exit Sceneform.
   *
   * <p>Typically called from onDestroy().
   */
  public void destroy() {
    if (renderer != null) {
      //add this method to release memory.
      reclaimReleasedResources();
      renderer.dispose();
      renderer = null;
    }
  }

but i see memory in android studio:Profiler window not release.
Any suggestions for me?
thank for your time.

I noticed as well an increase on my memory footprint on multiple start and stops. Currently I call mArFragment.getArSceneView().getSession().close(); in my onDestroy function, because I noticed that it takes a while that the Session get's destroyed.
Do you have a graph to show?
I also used the new performance debug monitor to get some vitals during a session, what I noticed here is a constant increase of my java memory until it drops and increases again. The native memory is pretty stable.

Hi,

I noticed as well an increase on my memory footprint on multiple start and stops. Currently I call mArFragment.getArSceneView().getSession().close(); in my onDestroy function, because I noticed that it takes a while that the Session get's destroyed, if I let the system do it.

You are right, the session.close() isn't called yet inside the ArFragment.onDestroy() even is if the session.pause() is handled.
I'll double check if there is no issue when starting again a session
@RGregat did you encounter any issue with this on your tests ?
And it's true that the native and java memory is increasing while using the sdk and not moving the phone. I don't know yet if it comes from ARCore collecting data or something else like the plane renderer.

Hi,

I noticed as well an increase on my memory footprint on multiple start and stops. Currently I call mArFragment.getArSceneView().getSession().close(); in my onDestroy function, because I noticed that it takes a while that the Session get's destroyed, if I let the system do it.

You are right, the session.close() isn't called yet inside the ArFragment.onDestroy() even is if the session.pause() is handled.
I'll double check if there is no issue when starting again a session
@RGregat did you encounter any issue with this on your tests ?
And it's true that the native and java memory is increasing while using the sdk and not moving the phone. I don't know yet if it comes from ARCore collecting data or something else like the plane renderer.

Do you mean that the problem is not sceneform problem but ARCore?

@ThomasGorisse My current problem is to release the memory immediately when I close the AR page, so that the next time I display the AR model again, the memory will not overflow. Do you have any good ideas?

I noticed as well an increase on my memory footprint on multiple start and stops. Currently I call mArFragment.getArSceneView().getSession().close(); in my onDestroy function, because I noticed that it takes a while that the Session get's destroyed, if I let the system do it.
Do you have a graph to show?
I also used the new performance debug monitor to get some vitals during a session, what I noticed here is a constant increase of my java memory until it drops and increases again. The native memory is pretty stable.

i called the getArSceneView().getSession().close(); in my ondestroy() function ,but the memory is not release .

Hi,

I noticed as well an increase on my memory footprint on multiple start and stops. Currently I call mArFragment.getArSceneView().getSession().close(); in my onDestroy function, because I noticed that it takes a while that the Session get's destroyed, if I let the system do it.

You are right, the session.close() isn't called yet inside the ArFragment.onDestroy() even is if the session.pause() is handled.
I'll double check if there is no issue when starting again a session
@RGregat did you encounter any issue with this on your tests ?
And it's true that the native and java memory is increasing while using the sdk and not moving the phone. I don't know yet if it comes from ARCore collecting data or something else like the plane renderer.

Do you mean that the problem is not sceneform problem but ARCore?

No, I don't know where does the problem come from

This is the way how I close currently the session
@Override
protected void onPause() {
     super.onPause();
     if (isFinishing()) {
         LoggerHelper.showLog(Log.DEBUG, "ArActivity", "finish");
         onStop();
         mController.onDestroy();
     }
 }

And in my Controller I have the following Code
void onDestroy() {
   Optional.ofNullable(mArFragment.getArSceneView().getSession())
      .ifPresent(Session::onClose());
}

The reason to use the onPause Function is, that the onDestroy function is called with a delay. It can take a few seconds after the Activity is already closed. At least that is what I noticed for my App and UseCase.
So far I had no trouble by doing it that way, I only noticed a warning when the original process is trying to close the session, but it doesn't break anything on my side. So far I noticed less Crashes on multiple starts.
To monitor the performance including the memory I'm using the new Performance-Overlay https://developers.google.com/ar/develop/c/debugging-tools/performance-overlay
What I noticed here is a relative constant native memory, but the java memory is looking strange to me. It's starting very low, then it climbs constantly and then after a while it is falling back to a very low value. And that process repeats through the whole session. Maybe it is normal and part of the DepthApi?
For the Memory Profiler you showed. On my end I have the same issue, that on every start the footprint is a little bit higher than before. Only to hard close the app an reopen it, is solving this problem. But I didn't investigated this enough for now.

I noticed as well an increase on my memory footprint on multiple start and stops. Currently I call mArFragment.getArSceneView().getSession().close(); in my onDestroy function, because I noticed that it takes a while that the Session get's destroyed, if I let the system do it.
Do you have a graph to show?
I also used the new performance debug monitor to get some vitals during a session, what I noticed here is a constant increase of my java memory until it drops and increases again. The native memory is pretty stable.

i called the getArSceneView().getSession().close(); in my ondestroy() function ,but the memory is not release .

You can also ask the question on the ARCore repo.

@ThomasGorisse My current problem is to release the memory immediately when I close the AR page, so that the next time I display the AR model again, the memory will not overflow. Do you have any good ideas?

Put your code here for help

@ThomasGorisse My current problem is to release the memory immediately when I close the AR page, so that the next time I display the AR model again, the memory will not overflow. Do you have any good ideas?

Put your code here for help
ok, my code main include an activity and a Nodes as subclass as TransformableNode ,
sorry for code a bit many, but the structure is clearly,
please help me to check whether the code leaking memory or not.
my ar page named :ARSceneActivity
`class ARSceneActivity : BaseActivity(), OnClickListener {

var arFragment: ArFragment? = null
var arSceneView: ArSceneView? = null

private val coordinator by lazy { Coordinator(this, ::onArTap, ::onNodeSelected, ::onNodeFocused) }

var modelList: ArrayList<ArModel> = arrayListOf()
var bannerList: ArrayList<ArBanner> = arrayListOf()
var videoNodeList = arrayListOf<ArVideo>()
var videoBeanList = arrayListOf<ArModel>()
var phoenixList = arrayListOf<PhoenixModel>()
var nodeMap = hashMapOf<String, Nodes>()

//缓存视频路径的map
var videoLocalPathMap = hashMapOf<String, String>()

//缓存模型路径的map
var modelLocalPathMap = hashMapOf<String, String>()

val mHandler: Handler = object : Handler() {
    override fun handleMessage(msg: Message) {

        if (msg.what == AR_INIT_COMPLETE) {
            WHQuicmoToARworld.getInstance().setMC0(arSceneView!!.arFrame!!.camera)
            arSceneView?.let {
                /** start to request server data */
                requestData()
            }
            /** when frame is null ,then go on */
        } else if (msg.what == AR_FRAME_NULL) {
            postDelayed(runnable, 500)
            /** when init not finish ,then go on */
        } else if (msg.what == AR_INITING) {
            postDelayed(runnable, 500)

        }else ….
    }
}

override fun initWidget(savedInstanceState: Bundle?) {
    arFragment = supportFragmentManager.findFragmentById(R.id.ux_fragment) as ArFragment?
    arFragment?.getArSceneView()?.planeRenderer?.isVisible = false
    arSceneView = arFragment?.arSceneView
    arSceneView!!.setZOrderMediaOverlay(true)
    …
    initAr()

mHandler.post(runnable)
…
}

override fun getContentView(): Int {
    return R.layout.activity_scene
}

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

initWidget(savedInstanceState)
initData(savedInstanceState)

  }

override fun initData(savedInstanceState: Bundle?) {
    var bundle = intent.extras

}

/**
 * get server data
 */
fun requestData() {

    if (sceneState == 1 || sceneState == 2) {
        bindScene()
    } else {
        getDefaultScene()
    }
}

/**
 * 请求展示详情信息
 * @param sceneId String
 */
fun getSceneInfo(sceneId: String) {
   	…..
            showModels(modelList)
         ……

}

/**
 * 监听ARcore初始化状态
 */
var runnable = Runnable {
    var frame = arSceneView?.arFrame
    if (frame == null) {
        mHandler.sendEmptyMessage(AR_FRAME_NULL)
    } else {
        if (frame.camera.trackingState == TrackingState.TRACKING) {
            mHandler.sendEmptyMessage(AR_INIT_COMPLETE)
        } else {
            mHandler.sendEmptyMessage(AR_INITING)
        }
    }
}

/**
 * down video file
 * @param url String
 * @param videoModel ArModel
 */
fun downVideo(url: String, videoModel: ArModel) {
 	...
            showVideo(task?.targetFilePath!!, videoModel)
   …

}

/**
 * down glb  file
 * @param url String
 * @param videoModel ArModel
 */
fun downArModel(url: String, arModel: ArModel) {
…
              showAnimals(arModel)
   …
}

/**
 * get default scene
 */
fun getDefaultScene() {
…
            showModels(responseData?.data.get(0).arModels)
   …

        }

/**
 * show all model in my arSceneview
 * @param list List<ArModel>
 */
fun showModels(list: List<ArModel>) {

//show an axies at original postion
    showAxiesAtOriginal()

       list.forEach {
        when (it.materialType) {
            ShareData.TYPE_BRAND -> {
                showBrand(it)

            }
            ShareData.TYPE_BANNER -> {
                showLoopPic(it)
                refreshProgress()
            }
            ShareData.TYPE_BALL -> {
                showARBall(it)

            }
            ShareData.TYPE_ARMODEL -> {
                armodelPath = it.androidDownloadUrl
            }
            ShareData.TYPE_VIDEO -> {
                videoBeanList.add(it)
                videoPath = it.urlArr.get(0)
            }
            ShareData.TYPE_VIDEO_GREEN -> {
                videoPath = it.androidDownloadUrl
                videoBeanList.add(it)
            }
        }

        if (!videoPath.isNullOrEmpty()) {
            downVideo(videoPath!!, it)
            videoPath = ""
        }

        if (!armodelPath.isNullOrEmpty()) {
            //Log.d("steven", "armodelPath:" + armodelPath)
            downArModel(armodelPath!!, it)
            armodelPath = ""
        }
    }
    coordinator.selectNode(null)
}

/**
 * every frame listener
 */
private fun onArUpdate() {

//        Log.d("steven", "onArUpdate is running ......")
    if (hasPickUp) {
        calculateMoveMatrix(selectedNode!!)
    }
    for (phoenix in phoenixList) {
        phoenix.doGlbAnimation()
    }
}

/**
 * show ar model
 * @param model ArModel
 */
fun showAnimals(model: ArModel) {
    val anchorNode = AnchorNode()
    var matrix = getArModelMatrix(model)
    anchorNode.worldPosition = getModelShowPosition(matrix)

//                Log.d("steven", "AR model :” + anchorNode.worldPosition)
var phoenixModel = PhoenixModel(mHandler, this, coordinator, model)
nodeMap.put(model.arModelId, phoenixModel)
    phoenixList.add(phoenixModel)
    phoenixModel?.let {
        val anchorNode = AnchorNode()
        var matrix = getArModelMatrix(model)
        anchorNode.worldPosition = getModelShowPosition(matrix)

        it.attach(anchorNode, arSceneView?.scene!!)
        it.worldScale = getModelShowScale(matrix)
        it.worldRotation = getModelShowRotation(it.worldScale, matrix)

        Log.d("steven", "AR模型的缩放:" + it.worldScale)
    }
}

/**
 * show video model
 * @param path String
 * @param videoBean ArModel
 */
fun showVideo(path: String, videoBean: ArModel) {

   …
    val anchorNode = AnchorNode()
    var destMatrxi = getArModelMatrix(videoBean!!)
    anchorNode.worldPosition = getModelShowPosition(destMatrxi)
    var videoNode = ArVideo(this, coordinator, videoBean!!, path)
    videoNodeList.add(videoNode)
    nodeMap.put(videoBean!!.arModelId, videoNode!!)
    var scale = getModelShowScale(destMatrxi)

    videoNode?.let {
        it.attach(anchorNode, arSceneView?.scene!!)

       it.worldRotation = getModelShowRotation(scale, destMatrxi)

        it.worldScale = Vector3(videoWidth.toFloat() * scale.x, videoHeight.toFloat() * scale.y, 1.0f)
    }
}

/**
 * 显示大球
 * @param model ArModel
 */
fun showARBall(model: ArModel) {
    detailDialog = BallFaceDialog(this)
    ball = model
    config!!.objCylinderAdapter = ObjCylinderAdapter(this, initBallFaceData(model))
    val msg = mHandler.obtainMessage()
    msg.what = SHOW_BALL
    mHandler.sendMessageDelayed(msg, 500)
}

/**
 * show axies model
 * @param model ArModel
 */
fun showAxiesAtOriginal() {

        val anchorNode = AnchorNode()
        var matrix = WHQuicmoToARworld.getInstance().quicmoToARworld(trans2SceneFormMatrix(matrix2Transform(Matrix())))
        anchorNode.worldPosition = getModelShowPosition(matrix)
        var axiesModel = AxisModel(this, coordinator, ArModel())
        axiesModel?.let {
            it.attach(anchorNode, arSceneView?.scene!!)
            it.worldScale = Vector3.one().scaled(0.1f)
            it.worldRotation = getModelShowRotation(it.worldScale, matrix)
        }

}

/**
 * show looper pic model
 * @param model ArModel
 */
fun showLoopPic(model: ArModel) {
    val anchorNode = AnchorNode()
    var matrix = getArModelMatrix(model)
    anchorNode.worldPosition = getModelShowPosition(matrix)

    var pic = ArBanner(this, coordinator, model)
    nodeMap.put(model.arModelId, pic)

    pic?.let {
        it.attach(anchorNode, arSceneView?.scene!!)
        it.worldScale = getModelShowScale(matrix)

        if (!model.isHorizontal) {
            it.worldRotation = getModelShowRotation(it.worldScale, matrix)

        }
    }
    bannerList.add(pic)
}

/**
 * show brand model
 * @param model ArModel
 */
fun showBrand(model: ArModel) {
    val anchorNode = AnchorNode()
    var matrix = getArModelMatrix(model)
    anchorNode.worldPosition = getModelShowPosition(matrix)
    var brand = ShopBrand(this, coordinator, model)
    nodeMap.put(model.arModelId, brand)
    brand?.let {
        it.attach(anchorNode, arSceneView?.scene!!)
        it.worldScale = getModelShowScale(matrix)

        if (!model.isHorizontal) {
            it.worldRotation = getModelShowRotation(it.worldScale, matrix)

        }
    }
}

override fun onResume() {
    super.onResume()
    try {
        arSceneView?.resume()

        ballNode?.let {
            it.startAnimation()
        }
    } catch (ex: CameraNotAvailableException) {
    }
}

override fun onPause() {
    super.onPause()
    arSceneView?.pause()
    ballNode?.let {
        it.stopAnimation()
    }
}

override fun onDestroy() {
    super.onDestroy()
    if (isPlay) {
        detail_player.getCurrentPlayer().release()
    }
    if (orientationUtils != null) orientationUtils!!.releaseListener()

    bannerList.forEach {
        it.releaseBanner()
    }

    for (videoNode in videoNodeList) {
        videoNode?.let {
            it.releaseVideo()
        }
    }

    ballNode?.let {
        it.stopAnimation()
    }
    for (armodel in phoenixList) {
        armodel?.let {
            it.stopAnimation()
        }
    }

    nodeMap.forEach {
        it.value.detach()
    }
    arSceneView?.destroy()
    //强制立马回收所有资源

//        ArSceneView.destroyAllResources()
//        ArSceneView.destroyAllResourceExceptEngine()
}
/**
 * init AR
 */
private fun initAr() {
    arSceneView?.scene?.let {
        it.addOnUpdateListener {
            onArUpdate()
        }
        it.addOnPeekTouchListener { hitTestResult, motionEvent ->
            coordinator.onTouch(hitTestResult, motionEvent)
        }
    }
}

/**
 *
 * @param node Nodes?
 */
fun onNodeFocused(node: Nodes?) {
….
….

}

fun onNodeSelected(old: Nodes? = coordinator.selectedNode, new: Nodes?) {

}

private fun onArTap(motionEvent: MotionEvent) {
…..
}

fun checkIsSupportedDeviceOrFinish(activity: BaseActivity): Boolean {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
     ….
        return false
    }
    val openGlVersionString = (activity.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager).deviceConfigurationInfo.glEsVersion
    if (java.lang.Double.parseDouble(openGlVersionString) < 3.0) {
       ….
        return false
    }

    var available = ArCoreApk.getInstance().checkAvailability(this);
    //not support AR
    if (available != ArCoreApk.Availability.SUPPORTED_INSTALLED) {
		….
             }

    return true
}

}
package com.whyhow.sucailib.ar
sealed class Nodes(activity: ARSceneActivity, name: String, coordinator: Coordinator, model: ArModel) : TransformableNode(coordinator), ViewSizer {
var model: ArModel
var activity: ARSceneActivity
var axiesModel: AxisModel? = null

var anchor: AnchorNode? = null

var animatorPosition: Vector3 = Vector3.zero()
    set(value) {
        field = value
        worldPosition = value
    }
    get() = field

companion object {
    private val IDS: MutableMap<KClass<*>, AtomicLong> = mutableMapOf()
    fun Any.newId(): Long = IDS.getOrElse(this::class, { AtomicLong().also { IDS[this::class] = it } }).incrementAndGet()
}

fun getWidthMeterMap(): Int {
    //
    var displayMetrics = Resources.getSystem().getDisplayMetrics();
    return (model.materialWidth * (displayMetrics.xdpi / 160.0f) * 250).toInt()
}

fun getHeightMeterMap(): Int {
    var displayMetrics = Resources.getSystem().getDisplayMetrics();
    return (model.materialHeight * (displayMetrics.xdpi / 160.0f) * 250).toInt()
}

override fun getSize(view: View?): Vector3 {
    return Vector3(model.materialWidth.toFloat(), model.materialHeight.toFloat(), 0.01f)
}

init {
    this.activity = activity
    this.name = name
    this.model = model
    rotationController.isEnabled = false
    scaleController.isEnabled = false
    translationController.isEnabled = false
    @Suppress("LeakingThis")
    model?.let {
        if (model.isLookCamera) rotationController.isEnabled = false
    }

    addTransformChangedListener(object : TransformChangedListener {
        override fun onTransformChanged(p0: Node?, p1: Node?) {
            var isVideo = model.materialType == ShareData.TYPE_VIDEO || model.materialType == ShareData.TYPE_VIDEO_GREEN
            if (!isVideo) {
                syncAxis()
            }
        }
    })
}

var onNodeUpdate: ((Nodes) -> Any)? = null

override fun getTransformationSystem(): Coordinator = super.getTransformationSystem() as Coordinator

override fun setRenderable(renderable: Renderable?) {
    if(renderable == null) return
    super.setRenderable(renderable?.apply {

        isShadowCaster = false
        isShadowReceiver = false
    })
}

override fun onUpdate(frameTime: FrameTime) {
    onNodeUpdate?.invoke(this)
    model?.let {
        if (model.isLookCamera) {
            facingCamera()
        }
    }
}

open fun facingCamera() {

        if (isTransforming) return /*Prevent infinite loop*/
        val camera = scene?.camera ?: return
        var direction: Vector3? = null
        var isVideo = model.materialType == ShareData.TYPE_VIDEO || model.materialType == ShareData.TYPE_VIDEO_GREEN
        var localVideoRotation = getModelVideoRotation(model, activity)

        if (isVideo && localVideoRotation % 180 != 0) {

            direction = Vector3.subtract(worldPosition, camera.worldPosition)
            direction.y = 0f
            var yawPhone = Utils.Quaternion2Eular(Quaternion.lookRotation(direction, Vector3.up())).y
            Log.d("steven", "yawPhone。。。。 " + (yawPhone))
            if(this is AxisModel){
                direction = Vector3.subtract(worldPosition, camera.worldPosition)

                direction.y = 0f
                worldRotation = Quaternion.lookRotation(direction, Vector3.up())

            }else{
                direction = Vector3.subtract(worldPosition, camera.worldPosition)

                direction.y = 0f
                worldRotation = Quaternion.lookRotation(direction, Vector3.right())
            }
        } else {
            direction = Vector3.subtract(worldPosition, camera.worldPosition)

            direction.y = 0f
            worldRotation = Quaternion.lookRotation(direction, Vector3.up())
        }

}

open fun attach(anchor: AnchorNode, scene: Scene, focus: Boolean = false) {
    this.anchor = anchor
    setParent(anchor.apply { setParent(scene) })

    if (focus) {
        transformationSystem.focusNode(this)
    }
}

open fun detach() {
    if (this == transformationSystem.selectedNode) {
        transformationSystem.selectNode(null)
    }
    (parent as? AnchorNode)?.anchor?.detach()
    setParent(null)
    renderable = null
}

fun addAxis() {
    if (model.materialType != ShareData.TYPE_BALL) {
        if (axiesModel == null) {
            axiesModel = AxisModel(activity, getTransformationSystem(), model)
        }
        axiesModel?.attach(anchor!!, activity.arSceneView!!.scene)

        if (model.materialType == ShareData.TYPE_BALL || model.materialType == ShareData.TYPE_ARMODEL) {

        } else {
            var widthScale = model.materialWidth / 6f
            var heightScale = model.materialHeight / 6f
            var localVideoRotation = getModelVideoRotation(model, activity)
            if (localVideoRotation % 180 != 0) {
                axiesModel!!.worldScale = Vector3((heightScale + 0.05).toFloat(), (widthScale + 0.05).toFloat(), 0.05f)
            } else {
                axiesModel!!.worldScale = Vector3((widthScale + 0.05).toFloat(), (heightScale + 0.05).toFloat(), 0.05f)
            }
        }
        syncAxis()
    }
}

fun syncAxis() {
    if (model.materialType != ShareData.TYPE_BALL) {
        axiesModel?.let {
            if (model.materialType == ShareData.TYPE_VIDEO || model.materialType == ShareData.TYPE_VIDEO_GREEN) {
                var localVideoRotation = getModelVideoRotation(model, activity)
                if (localVideoRotation % 180 != 0) {
                    var videoOffsetRotation = Quaternion.axisAngle(Vector3(0f, 0f, 1f), localVideoRotation.toFloat())
                    it.worldRotation = Quaternion.multiply(worldRotation, videoOffsetRotation)
                    it.worldPosition = worldPosition
                } else {
                    it.worldRotation = worldRotation
                    it.worldPosition = worldPosition
                }
            } else {
                it.worldRotation = worldRotation
                it.worldPosition = worldPosition
            }
        }
    }
}

fun removeAxis() {
    axiesModel?.detach()
    axiesModel = null
}

override fun onTap(hitTestResult: HitTestResult?, motionEvent: MotionEvent?) {
    super.onTap(hitTestResult, motionEvent)
    if (isTransforming) return // ignored when dragging over a small distance

//        Log.d("steven","ontap name:" + name)
if (name != "AxisModel") {
transformationSystem.focusNode(this)
}
}
override fun equals(other: Any?): Boolean {
    if (this === other) return true
    if (javaClass != other?.javaClass) return false

    other as Nodes

    if (model != other.model) return false

    return true
}

override fun hashCode(): Int {
    return model.hashCode()
}

}
class AxisModel(context: ARSceneActivity, coordinator: Coordinator, model: ArModel) : Nodes(context, "AxisModel", coordinator, model), Footprint.Invisible {
init {
activity = context
ModelRenderable.builder().setSource(activity, R.raw.axis)
.setIsFilamentGltf(true)
.build()
.thenAccept(
{ renderable ->
this.renderable = renderable
})
collisionShape = null
}
}
class ShopBrand(
context: ARSceneActivity,
coordinator: Coordinator,
model: ArModel
) : Nodes(context, "ShopBrand", coordinator, model), Footprint.Invisible {
init {
    this.name = "ShopBrand"
    var view = LayoutInflater.from(context).inflate(R.layout.renderable_ar_brand, null)
    var logo = view.findViewById<ImageView>(R.id.logo)

    GlideLoadUtils.getInstance().load(context, model.materialThumbnail, logo)

//        Glide.with(context).asGif().load(R.drawable.zou).into(logo);
ViewRenderable.builder()
.setView(context, view)
.setVerticalAlignment(ViewRenderable.VerticalAlignment.CENTER)
.build()
.thenAccept {
renderable = it
it.view.layoutParams.width = getWidthMeterMap()
it.view.layoutParams.height = getHeightMeterMap()
}
}
}
class ArBanner(
context: ARSceneActivity,
coordinator: Coordinator,
model: ArModel
) : Nodes(context, "ArBanner", coordinator, model), Footprint.Invisible {
var banner: Banner<ArModel, BannerImageAdapter>;
init {
    this.model = model
    var view = LayoutInflater.from(context).inflate(R.layout.renderable_ar_looppic, null)
    banner = view.findViewById(R.id.banner)
    banner.removeIndicator()
    banner.setLoopTime(4000)

    var adapter = BannerImageAdapter(model.urlArr)
    banner?.let {
        it.addBannerLifecycleObserver(activity)
        it.setUserInputEnabled(false)
        it.setAdapter(adapter, true)
        if (model.urlArr.size == 1) {
            it.isAutoLoop(false)
        }
    }

    ViewRenderable.builder()
            .setVerticalAlignment(ViewRenderable.VerticalAlignment.CENTER)
            .setView(context, view)
            .build()
            .thenAccept {
                renderable = it
                it.view.layoutParams.width = getWidthMeterMap()
                it.view.layoutParams.height = getHeightMeterMap()
            }
}

fun releaseBanner() {
    banner.stop()
}

}
@RequiresApi(Build.VERSION_CODES.O)
class ArVideo(context: ARSceneActivity, coordinator: Coordinator, model: ArModel, localPath: String) :
Nodes(context, "Video", coordinator, model), Footprint.Invisible {
var mediaPlayer: MediaPlayer?=null
val texture = ExternalTexture()
var uri: Uri
var context: ARSceneActivity
init {
this.context = context
uri = getUriForFileKotlin(context, BuildConfig.APPLICATION_ID, File(localPath))
if (localPath.isNullOrEmpty()) {
context.showToast("视频路径为空")
context.whenLoadVideoFail()
} else {
try {
mediaPlayer = MediaPlayer.create(context, uri)
if (mediaPlayer != null) {
mediaPlayer!!.isLooping = true
mediaPlayer!!.setSurface(texture.surface)
                    Material.builder()
                            .setSource(context, R.raw.sceneform_chroma_key_material)
                            .build()
                            .thenAccept { material: Material? ->
                                val cube = ShapeFactory.makePlane(1f, 1f, material)
                                cube.material?.setExternalTexture("videoTexture", texture)
                                cube.material?.setFloat4("keyColor", Color(0.1843f, 1.0f, 0.098f))
                                if (model.materialType == ShareData.TYPE_VIDEO) {
                                    cube.material.setBoolean("disableChromaKey", true);
                                } else {
                                    cube.material.setBoolean("disableChromaKey", false);
                                }

                                if (!mediaPlayer!!.isPlaying) {
                                    if(TDevice.getAndroidSDKVersion() >= android.os.Build.VERSION_CODES.O){
                                        mediaPlayer!!.seekTo(500,MediaPlayer.SEEK_CLOSEST)
                                    }else{
                                        mediaPlayer!!.seekTo(500)
                                    }

//                                        mediaPlayer!!.start()
// Wait to set the renderable until the first frame of the  video becomes available.
// This prevents the renderable from briefly appearing as a black quad before the video
// plays.
texture.surfaceTexture.setOnFrameAvailableListener {
renderable = cube
texture.surfaceTexture.setOnFrameAvailableListener(null)
}
} else {
renderable = cube
}
}
} else {
context.whenLoadVideoFail()
ToastUtils.showLongToast(activity, "视频格式不支持")
}
}catch (e: Exception){
context.whenLoadVideoFail()
e.printStackTrace()
ToastUtils.showLongToast(activity, "视频格式不支持")
}
}
}
fun releaseVideo() {
    try{
        mediaPlayer?.stop()
        mediaPlayer?.release()
    }catch (e:Exception){
        e.printStackTrace()
    }

}

fun isPlaying():Boolean{
    if(mediaPlayer !=null){
        try{
            return mediaPlayer!!.isPlaying
        }catch (e:Exception){
            return false
        }
    }else{
        return false
    }
}

fun pause() {
    mediaPlayer?.let {
        if (it.isPlaying) {
            it.pause()
        }
    }
}

fun startPlay() {
    mediaPlayer?.let {
        it.start()
    }
}

}
class ArBall(activity: ARSceneActivity, coordinator: Coordinator, model: ArModel)
: Nodes(activity, "ArBall", coordinator, model), Footprint.Invisible {
var rotationAnimation: ObjectAnimator? = null
var degreesPerSecond = 10.0f
val speedMultiplier = 1.0f
private fun getAnimationDur(): Long {
    return (1000 * 360 / (degreesPerSecond * speedMultiplier)).toLong()
}

fun startAnimation() {
    if (rotationAnimation != null) {
        return
    }
    rotationAnimation = createAnimator()
    rotationAnimation!!.target = this
    rotationAnimation!!.duration = getAnimationDur()
    rotationAnimation!!.start()
}

fun stopAnimation() {
    if (rotationAnimation == null) {
        return
    }
    rotationAnimation!!.cancel()
    rotationAnimation = null
}

private fun createAnimator(): ObjectAnimator {

    val orientation1 = Quaternion.axisAngle(Vector3(0.0f, 1.0f, 0.0f), 0f)
    val orientation2 = Quaternion.axisAngle(Vector3(0.0f, 1.0f, 0.0f), 120f)
    val orientation3 = Quaternion.axisAngle(Vector3(0.0f, 1.0f, 0.0f), 240f)
    val orientation4 = Quaternion.axisAngle(Vector3(0.0f, 1.0f, 0.0f), 360f)
    val rotationAnimation = ObjectAnimator()
    rotationAnimation.setObjectValues(orientation1, orientation2, orientation3, orientation4)

    rotationAnimation.setPropertyName("localRotation")

    rotationAnimation.setEvaluator(QuaternionEvaluator())

    rotationAnimation.repeatCount = ObjectAnimator.INFINITE
    rotationAnimation.repeatMode = ObjectAnimator.RESTART
    rotationAnimation.interpolator = LinearInterpolator()
    rotationAnimation.setAutoCancel(true)
    return rotationAnimation
}

}
class PhoenixModel(handler: Handler, activity: ARSceneActivity, coordinator: Coordinator, model: ArModel) : Nodes(activity, "PhoenixModel", coordinator, model) {
var modelAnimation: ObjectAnimator? = null
var repeatCount = 0
var handler:Handler
var animCount:Int = 0

private var animators: HashSet<AnimationInstance> = hashSetOf()

val colors = Arrays.asList(
        Color(0f, 0f, 0f, 1f),
        Color(1f, 0f, 0f, 1f),
        Color(0f, 1f, 0f, 1f),
        Color(0f, 0f, 1f, 1f),
        Color(1f, 1f, 0f, 1f),
        Color(0f, 1f, 1f, 1f),
        Color(1f, 0f, 1f, 1f),
        Color(1f, 1f, 1f, 1f))
var nextColor = 0

class AnimationInstance internal constructor(animator: Animator, index: Int, startTime: Long) {
    var animator: Animator
    var startTime: Long
    var duration: Float
    var index: Int

    init {
        this.animator = animator
        this.startTime = startTime
        duration = this.animator.getAnimationDuration(index)
        this.index = index
    }
}

init {
    this.handler = handler

    var localPath = activity.modelLocalPathMap.get(model.androidDownloadUrl)
    var pathUri  = Uri.parse(localPath)
    ModelRenderable.builder().setSource(activity, pathUri)
            .setIsFilamentGltf(true).build().thenAccept(
                    { modelRenderable ->
                        renderable = modelRenderable
                        Log.d("steven","renderabel.submeshCount:" + renderable!!.submeshCount)
                        val filamentAsset = renderableInstance!!.filamentAsset
                        animCount = filamentAsset!!.animator.animationCount
                        if (animCount > 0) {
                            for (i in 0 until animCount) {
                                animators.add(AnimationInstance(filamentAsset.animator, i, System.nanoTime()))
                            }
                        }
                        val color: Color = colors.get(nextColor)
                        nextColor++
                        for (i in 0 until renderable!!.getSubmeshCount()) {
                            val material: Material = renderable!!.getMaterial(i)
                            material.setFloat4("baseColorFactor", color)
                        }
                    })
            .exceptionally(
                    { throwable ->
                        val toast = Toast.makeText(activity, "无法加载模型文件，请确认格式是否正确", Toast.LENGTH_LONG)
                        toast.setGravity(Gravity.CENTER, 0, 0)
                        toast.show()
                        null
                    })
}

fun startAnimation(startPosition: Vector3) {
    Log.d("steven", "PhoenixModel start position ......")
    var endPosition = Vector3(model!!.moveX.toFloat(), startPosition.y, model!!.moveZ.toFloat())

//        var endPosition =  Vector3(0f,0f,0f)
//        Log.d("steven", "endposition ......" + endPosition)
if (modelAnimation != null) {
return
}
    modelAnimation = createGlbAnimator(this, startPosition, endPosition)

    modelAnimation!!.addListener(object : android.animation.Animator.AnimatorListener {

        override fun onAnimationRepeat(animation: android.animation.Animator?) {

//                Log.d("steven","onAnimationRepeat......")
repeatCount++
worldRotation = Quaternion.multiply(worldRotation, Quaternion.axisAngle(Vector3(0f, 1f, 0f), 180f))
}
        override fun onAnimationEnd(animation: android.animation.Animator?) {

//                Log.d("steven","onAnimationEnd......")
}
        override fun onAnimationCancel(animation: android.animation.Animator?) {

//                Log.d("steven","onAnimationCancel......")
}
        override fun onAnimationStart(animation: android.animation.Animator?) {

//                Log.d("steven","onAnimationStart......")
}
})
    modelAnimation!!.target = this
    modelAnimation!!.duration = model.cycle.toLong() * 1000
    modelAnimation!!.start()
}

fun stopAnimation() {
    if (modelAnimation == null) {
        return
    }
    modelAnimation!!.cancel()
    modelAnimation = null
}

fun doGlbAnimation() {
    if(animCount >0){

//            Log.d("steven","doGlbAnimation......")
val time = System.nanoTime()
for (animator in animators) {
animator.animator.applyAnimation(animator.index, ((time - animator.startTime) / TimeUnit.SECONDS.toNanos(1).toDouble()).toFloat()
% animator.duration)
animator.animator.updateBoneMatrices()
}
}
}
}
class Cube(size: Vector3, center: Vector3, color: Color, context: ARSceneActivity, coordinator: Coordinator, model: ArModel) : Nodes(context, "Sphere", coordinator, model) {
var size: Vector3
var center: Vector3
var color: Color
var context: Context
init {
    this.context = context
    this.size = size
    this.center = center
    this.color = color
    loadDebugPointModel()
}

fun loadDebugPointModel() {
    Texture.builder().setSource(context, R.drawable.ic_quicmo).build()
            .thenAccept(
                    { texture ->
                        MaterialFactory.makeOpaqueWithColor(context, color)
                                .thenAccept { material ->
                                    renderable = ShapeFactory.makeCube(size, center, material)
                                    localPosition = Vector3.zero()
                                }
                    }
            )
}

}
`

@steven-gao First of all remove all the arSceneView.resume(), arSceneView.destroy(),... since it's already handled by the ARFragment.
After that, make sure to call very light operations on the onArUpdate() since it's happening on every frame callback. I don't know what your calculateMoveMatrix() is doing but make sure it doesn't cost too much.
I also don't know what your
WHQuicmoToARworld.getInstance().setMC0(arSceneView!!.arFrame!!.camera)
arSceneView?.let {
    /** start to request server data */
    requestData()
}

is doing so I cannot help you on that.
Finally, from what I see in your profiler, it looks like you are using 600 Mo of graphical memory. So you should check that all your models and mediaplayers are well released.
My advise is to comment some parts of your code ans check steps by steps where does the 600Mo comes from in order to release the corresponding memory on destroy.
AND PLEASE CLICK ON THE PREVIEW TAB BEFORE SENDING A COMMENT.

OK, I think I figured out maybe one of the biggest consuming part and why one of the highest allocated class is Bitmap.
I forgot the last SFB asset still in use for the default LightProbe and most important, the one for the Skybox with a 2K resolution!
That part was waiting for Filament to have a KTXLoader I think.

Great performances/rendering increase in perspective but also a bit of work to do.

operations

Thank you for your patient guidance first of all,yestoday i add RenderableInstance.destroyAsset(); in RenderableInstance.destroyAsset()
look like this :
` /**
* @hide
*/
public void detachFromRenderer() {
Renderer rendererToDetach = attachedRenderer;
if (rendererToDetach != null) {
Log.d("steven","detachFromRenderer....");
detachFilamentAssetFromRenderer();
        destroyAsset();
        rendererToDetach.removeInstance(this);
        renderable.detatchFromRenderer();
    }
}`

i test for serval times ,it make a bit effect

If you want to totally clear the rendering memory you should destroy the Filament Engine and the glContext on your ‘onDestroy()‘.
Since you seems to use a lot of 3D assets, the gain on your memory leaks will be quite big.
The counterpart wich I'm working on will be that you will currently have issues creating the rendering context again.
You will also have issues with some already destroyed entities exception since they are done on objects ’finalize()‘ called.

Please move to https://github.com/SceneView for a well handled lifecycle aware memory management

Filament

how to do that?

by destroyFilamentEngine?


Adding tool specific setting in yaml file

Dear Bcbio team,
I want to add this flag (--f1r2-tar-gz) to the caller mutect2 in my variant.yaml file.
Here's how i've done it.
details:

algorithm:
aligner: false
mark_duplicates: false
remove_lcr: true
mixup_check: qsignature
variantcaller:
somatic: [vardict, strelka2, mutect2]
germline: [gatk-haplotype]
min_allele_fraction: 5
indelcaller: false
effects: vep
effects_transcripts: all
ensemble:
numpass: 2
use_filtered: false
tools_off: [gemini]
tools_on: [gatk4]
analysis: variant2
genome_build: hg38
resources:
mutect2:
options: ["--f1r2-tar-gz", "f1r2.tar.gz"]

However, my vcf output file doesn't seem to have used the flag at all.
Have I done the right thing?

Essentially i want to use the new tool by GATK<IP_ADDRESS> here https://gatk.broadinstitute.org/hc/en-us/articles/360035531132

Hi @alhafidzhamdan!
Yes, that looks right. The only thing I don't see indentation in your yaml, resources should be top level:
https://github.com/bcbio/bcbio-nextgen/blob/master/config/examples/mitochondrial_variants_amplicons.yaml
Mutect2 module should pull the resources from the yaml
https://github.com/bcbio/bcbio-nextgen/blob/a3473775db06540c10b5f20ddc2043b8cc99d1f8/bcbio/variation/mutect2.py#L106
could you please add bcbio-nextgen-commands.log to confirm, that the mutect call was correct?
Sergey

Thank you. Yes the indentations are correct- just didn't paste it correctly on here. Here's an example log.

unset JAVA_HOME && export PATH=/gpfs/igmmfs01/eddie/NextGenResources/bcbio-1.1.5/anaconda/bin:"$PATH" && gatk --java-options '-Xms681m -Xmx3181m -XX:+UseSerialGC -Djava.io.tmpdir=/gpfs/igmmfs01/eddie/Glioblastoma-WGS/bcbio/work/DO10900/bcbiotx/tmpz36aajty' Mutect2 --annotation ClippingRankSumTest --annotation DepthPerSampleHC --reference /gpfs/igmmfs01/eddie/NextGenResources/bcbio-1.1.5/genomes/Hsapiens/hg38/seq/hg38.fa --annotation MappingQualityRankSumTest --annotation MappingQualityZero --annotation QualByDepth --annotation ReadPosRankSumTest --annotation RMSMappingQuality --annotation FisherStrand --annotation MappingQuality --annotation DepthPerAlleleBySample --annotation Coverage --read-validation-stringency LENIENT -I /gpfs/igmmfs01/eddie/Glioblastoma-WGS/bcbio/work/DO10900/prealign/DO10900T/DO10900T-prealign.bam --tumor-sample DO10900T -I /gpfs/igmmfs01/eddie/Glioblastoma-WGS/bcbio/work/DO10900/prealign/DO10900N/DO10900N-prealign.bam --normal-sample DO10900N -L /gpfs/igmmfs01/eddie/Glioblastoma-WGS/bcbio/work/DO10900/mutect2/chrUn_KI270334v1/DO10900-chrUn_KI270334v1_0_285-regions-nolcr.bed --interval-set-rule INTERSECTION -O /gpfs/igmmfs01/eddie/Glioblastoma-WGS/bcbio/work/DO10900/mutect2/chrUn_KI270334v1/DO10900-chrUn_KI270334v1_0_285-raw.vcf.gz && sed -i 's/callable\t0.0/callable\t10.0/' /gpfs/igmmfs01/eddie/Glioblastoma-WGS/bcbio/work/DO10900/mutect2/chrUn_KI270334v1/DO10900-chrUn_KI270334v1_0_285-raw.vcf.gz.stats && unset JAVA_HOME && export PATH=/gpfs/igmmfs01/eddie/NextGenResources/bcbio-1.1.5/anaconda/bin:"$PATH" && gatk --java-options '-Xms681m -Xmx3181m -XX:+UseSerialGC -Djava.io.tmpdir=/gpfs/igmmfs01/eddie/Glioblastoma-WGS/bcbio/work/DO10900/bcbiotx/tmpz36aajty' FilterMutectCalls --reference /gpfs/igmmfs01/eddie/NextGenResources/bcbio-1.1.5/genomes/Hsapiens/hg38/seq/hg38.fa --variant /gpfs/igmmfs01/eddie/Glioblastoma-WGS/bcbio/work/DO10900/mutect2/chrUn_KI270334v1/DO10900-chrUn_KI270334v1_0_285-raw.vcf.gz --output /gpfs/igmmfs01/eddie/Glioblastoma-WGS/bcbio/work/DO10900/bcbiotx/tmpz36aajty/DO10900-chrUn_KI270334v1_0_285-raw-filt.vcf.gz

It doesn't seem to include the flag --f1r2-tar-gz.
And the output vcf is the no difference than the original vcf.
Do you think it's because i included "f1r2.tar.gz" as a stdout filename, within the yaml file?

Also i note in this version of mutect.py, there is no flag --f1r2-tar-gz.
Whereas in the master version - https://github.com/bcbio/bcbio-nextgen/blob/master/bcbio/variation/mutect2.py
there is.
I wonder it doesn't work because of this?
Essentially mutect2 got updated with the flags --f1r2-tar-gz and LearnReadOrientationModel a month back.

@naumenko-sa any thoughts?

Hi @alhafidzhamdan !

Please update to the latest development to have the same mutect2.py as in the master:
bcbio_nextgen.py upgrade -u development

Try to add mutect2_readmodel switch to your bcbio.yaml:

tools_on:
- gatk4
- mutect2_readmodel

I think this switch turns on the parameter:
https://github.com/bcbio/bcbio-nextgen/blob/master/bcbio/variation/mutect2.py#L110
and you don't need to specify resources, as it is doing it automatically.
Please let us know, how it works. It is a new feature and needs more feedback.
Sergey

I didn't have many files to test the MuTect 2 read model with: in fact some files made it break, so that is one of the reasons it's behind a tools_on flag.

thanks @lbeltrame
@alhafidzhamdan  please reopen if you have any updates on that


Add callout colors

Previous dark:
![image](https://user-images.githubusercontent.com/3822492/192142322-01c42be8-9b01-452e-a5f1-88bbfc535735.png | width=100)
New dark:

Previous light:

New light:

Fixes #26

This looks good. I like the way the callouts pop.
Can you please change all your color arrays to use variables inside theme-dark or theme-light? Then you can cut the amount of CSS in half as you've duplicated most selectors for both dark/light. You'll only need to specify a single selector with the corresponding variable color which will work for both dark/light.

If you'd like to see this committed please simplify the code as previously requested and update for the new Obsidian v1.x theming style (i.e. rebase your changes).

Different pull request that picked up the ideas for callouts here was merged.


mountinfo: fix build on linux/386

Due to a recent change cilium-cli started pulling in this package. We currently still build release binaries for linux/386, but these are failing with
# github.com/cilium/cilium/pkg/mountinfo
Error: ../../pkg/mountinfo/mountinfo_linux.go:56:27: invalid operation: fst.Type == mntType (mismatched types int32 and int64)

because fst.Type has a different type depending on GOARCH (e.g. int32 on linux/386). Fix this issue by converting fst.Type to int64 for comparison.
Related #16843

/test


Rework examples

On zulip @cmyr mentioned a cleanup of the examples would be welcome, I am not completely sure what was meant by this.
This is a sample for simplefying/redocumenting the examples, if this is what was needed I can do this for all the others as well.
I removed some unnecessary code, reordered it to me on-point (the widget itself is not the point of this example) and refactored some code to be more comment-friendly.

yes, I thought I already cleaned it up but it seems I (already) messed up my master branch.

Got it, thanks. The first comment makes much more sense to me now, and it also makes the names make more sense. Can I go ahead and merge? I would have just done it, but I noticed you've still got it marked as a draft...

oh yeah I thought maybe I'd do all of them at once, thats why it was still a draft

I wouldn't do them all in one PR, it's easier to review smaller PRs I think. I've gone ahead and marked this as 'ready', I hope that's okay!

ah yes, sorry I was multitasking a bit, I was going to google it but got distracted.

I feel like every time I want to unmark something as draft, I spend at least 5 minutes searching for the button...

im used to gitlab where I just remove the WIP:title prefix, or click the nice bright breen "resolve WIP" button next to the title.
Poeple always complain about gitlab cluthered UI, but I always get lost doing anything in github. anyways, I will start on the next one tomorrow probably.


Make the 'kroki-' prefix optional

We have our Markdown rendered in 2 places: Gitlab Markdown preview and custom mkdocs website.
Gitlab's implementation of diagrams in Markdown does not require the kroki- prefix. https://docs.gitlab.com/ee/administration/integration/kroki.html
Example:
    ```plantuml
    Bob -> Alice : hello
    Alice -> Bob : hi
    ```

To make the sites compatible, we would like to remove the kroki- prefix in the code block kroki-plantuml.

This PR seems to enable the functionality: https://github.com/AVATEAM-IT-SYSTEMHAUS/mkdocs-kroki-plugin/pull/4/files

Thanks for your request, somehow @oniboni  was already implementing this (also bis Thanks!).
So. PR #4  is submitted, so this issue can be closed.


Inconsistent use of capitalization

For example, createCohortDefinition() has capitalized argument names, such as Name and PrimaryCriteria, while createDrugExposure() has non-capitalized argument names such as conceptSetExpression and attributeList. createGroup() even mixes the two.
For consistency with the HADES style guide I recommend using lowercase first letters for all arguments.

Sounds good @schuemie. Thanks for the feedback. We are working on a pretty major rewrite of Capr for v2 which we (@mdlavallee92 or I will present to the Hades group for feedback once we have a good implementation. We're working on the v2 branch here. The code is a bit of a mess right now though.


strings: improve doc of Split* functions for the empty string case

In go 1.8 the behaviour of strings.Split{,N,After,AfterN} functions is not explicitly documented for the special case of splitting the empty string "". The functions return a slice with a single element which is the empty string.
The problem is that the Go behaviour is not the same as in other programming languages with functions with a similar name where for the same input the result is a zero-length array.
In Go (playground):
	fmt.Printf("%q\n", strings.SplitAfter("a", ":"))
	fmt.Printf("%q\n", strings.SplitAfter("", ":"))
	// Output:
	// ["a"]
	// [""]

In Perl 5 the result is a zero-length list:
perl -mData::Dumper=Dumper -E 'say Dumper([ split /:/, $_ ]) for "a", ""'
$VAR1 = [
          'a'
        ];

$VAR1 = [];

This leads to wrong expectations from users of the functions (especially when porting code from other languages) and may lead to security issues such as incorrect input validation or deny of service.
The documentation should be improved by documenting specially this corner case.

I've proposed a change which makes this behavior consistent here.

I've created a CL addressing this issue by changing the behavior of the Split func to always return a []string{""} if s is empty.

The functions have behaved as they do since before the Go 1 release.  I think we would need a strong reason to change that behavior, and I don't see that strong reason here.  I think we should change the documentation instead.

I think you should not think the go's behavior as same as perl. In javascript, "".split(",").length == 1. python also return 1 with len("".split(",")).

What would be a good message to document it? Something like
// If s is empty, SplitAfterN returns a slice with a single empty string.
// If both s and sep are empty, SplitAfterN returns an empty slice.

seems too verbose to explain such an obscure feature.

@ammario That's because it is obscure that it must be documented.


[SE-0155] Reject empty associated value lists

SE-0155 makes an empty associated value list in an enum element declaration illegal.

@swift-ci please smoke test

@swift-ci please smoke test and merge

Merge job crashed, doing it live.
⛵


Question on t_hash:MergeHSet

hi,
Within MergeHSet(), there is the predicate value.GetObjectLen() == -1,

what's objectlen stands for here ?
at HSet(),  meta_size.SetInt64(1) which is assigned to object len, what's '1' here ?

Thanks.

objectlen is the hash size stored in meta value
meta_size.SetInt64(1) is an incr value for meta value since the 'hset' is a new field which would increase hash size.

Cool.  Then what's meta.SetObjectLen(-1); used for, in both MergeHSet() and HMSet()  ?
And, seems HMSet() doesn't follow redis-protocol ? ardb uses the overwritten behavior.

-1 mean no precise length value.
for some write commands, it's much faster if u do not care about the size value and u can use -1 instead.
there is an option redis-compatible-mode in ardb.conf, default value is no.

then could you take a look at code. seems no matter option redis-compatible-mode is set or not, length will set to -1.
In this case, HDel() will not remove its meta key.
Assume that's also your expected behavior ?

for hmset, the return value is just "OK", there is no need to calculate the length which could save one READ operation.


Adding keybinds for moving the cursor without selecting

Hello,
I really like this plugin. That being said, I would still like to be able to move my cursor using keybinds when I am not pressing shift. I would like to use CMD + Left to go to the beggining of the line, CMD+  Right to go to the end, and Option+Right/Left to jump between words. How can I modify the plugin to use these? Would it be possible to integrate these into the plugin?
Thanks

Check out this forum post for help: https://stackoverflow.com/questions/12382499/looking-for-altleftarrowkey-solution-in-zsh. This project seems to be unmaintained, so you may have to do this on your own.

Hello,
I really like this plugin. That being said, I would still like to be able to move my cursor using keybinds when I am not pressing shift. I would like to use CMD + Left to go to the beggining of the line, CMD+ Right to go to the end, and Option+Right/Left to jump between words. How can I modify the plugin to use these? Would it be possible to integrate these into the plugin?
Thanks

This project seems to be unmaintained, so you may have to do this on your own.

It’s not unmaintained, but either the question is unrelated to this plugin, or maybe I misunderstood.

This project seems to be unmaintained, so you may have to do this on your own.

It’s not unmaintained, but either the question is unrelated to this plugin, or maybe I misunderstood.

Gotcha: saw last commit from two years ago so I assumed, my bad.


Update API according to the latest implementation in Parser-JS

Reason/Context
@jonaslagoni and @smoya have been working on a new iteration of the current Parser-API by directly implementing a POC on the current Parser-JS.
It can be found here: https://github.com/asyncapi/parser-js/pull/453
This means, that implementation has a more up-to-date API than the current in this repository, a validated API that can be implemented without any issue.
Description
To update https://github.com/asyncapi/parser-api/blob/master/docs/v1.md according to https://github.com/asyncapi/parser-js/pull/453.
cc @jonaslagoni @Souvikns @magicmatatjahu

We will keep this issue open until the first release happens.


Update for compatibility with SSH.NET > 2020.0.2

This Async library isn't compatible with later versions of SSH.NET (eg latest 2024.1.0), assumably due to missing/renamed methods.
eg
System.MissingMethodException: Method not found: 'System.Collections.Generic.IEnumerable1 Renci.SshNet.SftpClient.EndListDirectory(System.IAsyncResult)'. at Renci.SshNet.Async.SshNetExtensions.ListDirectoryAsync(SftpClient client, String path, Action1 listCallback, TaskFactory`1 factory, TaskCreationOptions creationOptions, TaskScheduler scheduler)

Thanks, but I'm a bit confused.
I'm not seeing any of the Async methods in the SftpClient class in the latest SSH.Net Nuget from Renci https://www.nuget.org/packages/SSH.NET (2024.0.1)
BUT I do see them in the source code on https://github.com/sshnet/SSH.NET
I'm using .NET 8

Hmm... not sure if I can provide too much guidance on that. I'm also using dotnet 8 and SSH.NET 2024.1.0.
You need
using Renci.SshNet.Sftp;
using Renci.SshNet;


added the maintained ueberzug(++) repo

As the current ueberzug repo is not maintained anymore I added the new link for the maintained repo

Thanks for the PR! Did you test this new version of ueberzug on you machine? Does it work without issues?


Try libcurl 8.4.0 on MacOS

Checklist

[x] Used a personal fork of the feedstock to propose changes
[x] Bumped the build number (if the version is unchanged)
[x] Reset the build number to 0 (if the version changed)
[x] Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
[x] Ensured the license file is being packaged.

After more digging it seems there is in fact a native Kerberos framework on MacOS that this is supposed to dig in. So let's give it a try!


Extra tags being added

PLEASE NOTE: make sure the bug exists in the latest patch level of the project. For instance, if you are running a 2.x version of Apostrophe, you should use the latest in that major version to confirm the bug.
To Reproduce
const input = '
Lorem ipsum
dolorem
 <foo>sic</foo> amet
';
const sanitizedString = sanitizeHtml(input, { allowedTags: ['p'] });

sanitizedString =
Lorem ipsum
dolorem sic amet

;
Expected behavior
Sanitized string should remove all non-p tags
Should return
Lorem ipsum dolorem sic amet

Describe the bug
A
 gets inserted before "dolorem" and a
 gets inserted after "amet"
Details
Version of Node.js:
18
Server Operating System:
MacOSX
Additional context:

Add any other context about the problem here. If the problem is specific to a browser, OS or mobile device, specify which.

Screenshots
If applicable, add screenshots to help explain your problem.

Confirmed - it seems that nested pre tags are replaced with p tags. Top level pre tags are eliminated correctly if disallowed.

Apparently this is not a bug, it's behavior coming from htmlparser2 which
is the HTML parser upstream of us. And that module is behaving reasonably
given the rules of HTML:
"Paragraphs are block-level elements, and notably will automatically close
if another block-level element is parsed before the closing  tag. See
"Tag omission" below."
See:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p
So what happened is this:

htmlparser2 saw "pre" inside "p". htmlparser2 said "that's not a thing
(see above), but I'll do the most reasonable thing I can: I'll close this p
element, output the pre element, and then open a new p element."

sanitize-html stripped the "pre" element, per your configuration.

Probably we can't change this at the sanitize-html level, and shouldn't
because htmlparser2 isn't doing anything wrong really.
On Fri, Jun 28, 2024 at 1:13 PM Robert Means @.***>
wrote:

Confirmed - it seems that nested pre tags are replaced with p tags. Top
level pre tags are eliminated correctly if disallowed.
—
Reply to this email directly, view it on GitHub
https://github.com/apostrophecms/sanitize-html/issues/667#issuecomment-2197350014,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAH27PUACWY2R4YF3MIKH3ZJWKS3AVCNFSM6AAAAABKCHL5EOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJXGM2TAMBRGQ
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his


PLAT-4215 Adding option to configure the --platform tag during docker build

An alternative to https://github.com/govuk-one-login/devplatform-upload-action-ecr/pull/7
This change adds in the option to set the platform option in the docker build step. This version of the change is intended to be a minor change. If the action variable is not set then the docker build step will behave as previously. That is it will determine the target architecture of the docker image by which runner the build step is running on. If the action variable is set then it will add in the option and the target arch is now configurable.

Tested https://github.com/govuk-one-login/devplatform-demo-sam-app/actions/runs/8722438124/job/23928304421 and working


helm: remove duplicate metrics for Envoy pod

Currently, having Prometheus enabled envoy.prometheus.enabled=true results in duplicated metrics for the Envoy daemonset Pods if scraping via a dedicated ServiceMonitor isn't enabled. The reason is that prometheus are added to the Pod (in the DaemonSet) and to the Service.
Therefore, this commit removes the Envoy K8s Service completely, as this is only used for prometheus scraping.
Fixes: #32747

/test

@mhofstetter I've added the needs-backport labels for 1.15 and 1.16

v1.15 does not have this file, removed the backport label for it.

v1.15 does not have this file, removed the backport label for it.

@joamaki what about https://github.com/cilium/cilium/blob/v1.15/install/kubernetes/cilium/templates/cilium-envoy/service.yaml? :thinking:


python310Packages.jupyter_console: 6.5.0 -> 6.5.1

Automatic update generated by nixpkgs-update tools. This update was made based on information from passthru.updateScript.
meta.description for python310Packages.jupyter_console is: Jupyter terminal console
meta.homepage for python310Packages.jupyter_console is: https://jupyter.org/
Updates performed

Ran passthru.UpdateScript

To inspect upstream changes
Impact

Checks done (click to expand)

built on NixOS
The tests defined in passthru.tests, if any, passed
found 6.5.1 with grep in /nix/store/vij7ihnb8x4qvvbz1w8743hd1jm98nbz-python3.10-jupyter_console-6.5.1
found 6.5.1 in filename of file in /nix/store/vij7ihnb8x4qvvbz1w8743hd1jm98nbz-python3.10-jupyter_console-6.5.1

Rebuild report (if merged into master) (click to expand)

24 total rebuild path(s)

24 package rebuild(s)

First fifty rebuilds by attrpath
ihaskell
python310Packages.ansible-kernel
python310Packages.arviz
python310Packages.augmax
python310Packages.bambi
python310Packages.dalle-mini
python310Packages.einops
python310Packages.elegy
python310Packages.ilua
python310Packages.jupyter
python310Packages.jupyter_console
python310Packages.phik
python310Packages.pymc
python310Packages.treex
python310Packages.vega
python310Packages.xarray-einstats
python311Packages.ansible-kernel
python311Packages.augmax
python311Packages.einops
python311Packages.ilua
python311Packages.jupyter
python311Packages.jupyter_console
python311Packages.vega
quarto

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/vij7ihnb8x4qvvbz1w8743hd1jm98nbz-python3.10-jupyter_console-6.5.1 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A python310Packages.jupyter_console https://github.com/r-ryantm/nixpkgs/archive/43985b4fc45610ee236aac654c4d79a66ab8f2a2.tar.gz

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/vij7ihnb8x4qvvbz1w8743hd1jm98nbz-python3.10-jupyter_console-6.5.1
ls -la /nix/store/vij7ihnb8x4qvvbz1w8743hd1jm98nbz-python3.10-jupyter_console-6.5.1/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

4 packages failed to build:

python310Packages.dalle-mini
python310Packages.elegy
python310Packages.treex
python311Packages.ansible-kernel

20 packages built:

ihaskell
python310Packages.ansible-kernel
python310Packages.arviz
python310Packages.augmax
python310Packages.bambi
python310Packages.einops
python310Packages.ilua
python310Packages.jupyter
python310Packages.jupyter_console
python310Packages.phik
python310Packages.pymc
python310Packages.vega
python310Packages.xarray-einstats
python311Packages.augmax
python311Packages.einops
python311Packages.ilua
python311Packages.jupyter
python311Packages.jupyter_console
python311Packages.vega
quarto

Maintainer pings

python310Packages.dalle-mini
python310Packages.elegy
python310Packages.treex
python311Packages.ansible-kernel
are already broken in master


seed varchar cols with apostrophe's fail

This csv fails to materialize because of line 63 where last_name=O'Gready with the following error:

Expected but did not find a closing quotation mark after the character string '.

Here's the query.


NIX_SSL_CERT_FILE with mercurial (hg) on MacOS

opening a new issue for https://github.com/NixOS/nix/issues/921#issuecomment-320059299 from @xpe, and moved away from https://github.com/NixOS/nix/issues/1501
Original content:
I think I might be facing a related problem. I'm using a recently updated macOS Nix installation with Nix-installed version of Mercurial (hg) and I'm getting this error:
hg clone https://bitbucket.org/eigen/eigen/
abort: could not find web.cacerts: /etc/ssl/certs/ca-certificates.crt
echo $NIX_SSL_CERT_FILE
/Users/xpe/.nix-profile/etc/ssl/certs/ca-bundle.crt
I'm using macOS 10.12.6 with nix-env (Nix) 1.11.13.
What should I try to diagnose, debug, and fix or workaround?

@xpe Looking into it, it seems that mercurial has a cacert = /etc/ssl/certs/ca-certificates.crt in https://github.com/NixOS/nixpkgs/blob/11e13306f7084c0b60a62dc5dd6a3cff92d41e79/pkgs/applications/version-management/mercurial/default.nix#L50. That path does not exist on MacOS, so it explains the failure.
Could you  try to add cacerts =  in your .hgrc ? Or cacerts = $NIX_SSL_CERT_FILE ? Or directly cacerts =  /Users/xpe/.nix-profile/etc/ssl/certs/ca-bundle.crt and report what works ?

Do you see the same issues with curl/git from nixpkgs or is it just mercurial?

@xpe, your input is most welcome here. I cannot test on darwin myself.

Hi, @layus and @LnL7.
I just experienced this exact same problem myself.  I can confirm that it was fixed by adding the following to ~/.hgrc:

[web]
cacerts = $NIX_SSL_CERT_FILE

Moreover, I have not had any such problem with git, so it seems to be just mercurial.
Hope this helps!

@jamtrott Thanks!
Does it also work with no value, like this ?
[web]
cacerts =

@layus, no problem.  Yes, it does indeed seem to also work with no value.


Added 7digital and Zazzle

Besides the leading plus signs added (by accident, I assume), this looks good. Thank you!


Instruction missing

Where does the very last code segment go?
app.UseMvc(routes =>
{
    routes.MapRoute(
        name: "default",
        template: "{controller=Home}/{action=Index}/{id?}");
});

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

ID: 20264150-9ac7-2b21-3314-64ffa114410f
Version Independent ID: 3477519b-1bc2-73be-33e3-63067383d426
Content: Add a controller to an ASP.NET Core MVC app
Content Source: aspnetcore/tutorials/first-mvc-app/adding-controller.md
Product: aspnet-core
Technology: aspnetcore-tutorials
GitHub Login: @Rick-Anderson
Microsoft Alias: riande

This is just a copy of the code that deals with the URL, it is highlighting how the information you pass it is processed also know as the "URL Routing Logic", more info regarding this on this very page if you scroll up a bit. You can find the code mentioned in the Startup.cs of the solution, at the bottom.


Adding hash index in noir for private call stack item

In C++, for the private kernel's call stack item, we hash the object using a GeneratorIndex aka hash index
We do that check here in the private kernel circuit.
On the client side, we hash the call stack item in private_call_stack_item.nr but we don't use a hash index!
Because of this nested calls to the private kernel is failing (now that we have error handling). I have commented out the validate_this_private_call_stack() check in the private kernel circuit for now because of this.

Same applies to public call stack item in Noir being added in https://github.com/AztecProtocol/aztec-packages/pull/546.

I'm working on this now that we have support for hash_index

@dbanks12 @suyash67 maybe something your team could pick up? :)

@dbanks12 @suyash67 maybe something your team could pick up? :)

@suyash67 can you pick this up this week?


Feature/content length bug

Some characters that represent three bytes
UTF-8

We don't maintain v1.1 and latest version removed HttpClient.
So close this PR. Sorry...


PT-162048442 optimize store access

Pivotal: PT-162048442
I'm not super confident of the POI stuff, and in particular some of the changes made to the tests, so I would appreciate careful review of this.

@UlfNorell unless you changed the gas computation and thereby consensus you don't have to bump anything?!

Fixed a failing test case... Wrong initial value of the store...

Hans says I don't have to bump protocol... isn't it already bumped several times? I guess the protocol-relevant thing that has changed is serialisation format for PoIs?


Allow API Proxy to Consume/Return any URL

It would be great if we could make a request to a proxy endpoint (as it is currently) but pass a full request in the querystring.  This would leave our options fairly open-ended.  In node, I'm currently doing this by getting
req._parsedUrl.query;

@drewcovi got any idea how to do this in Nginx? Also, what are you doing this for and how is the request serialized in the query string?

Presently no additional work. Just passing the entire url and request querystring AS the querystring for the endpoint.

Not sure what the request is here if there's no additional work. What's the issue exactly?

Oh I meant that how I'm currently doing it with node, I'm not doing any serialization.

Be careful baking an open redirect into this project.

@drewcovi any movement on this as a PR?

I'm closing this as I have no idea what it is I'm supposed to implement :) If someone wants to create a PR, that's cool by me, but this is not a feature I've seen the need for.


flutter tool cache_test.dart: Check current DevTools version test failure on hhh buildbot

from https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8830778834841354241/+/u/flutter_test_tool_tests/stdout
 01:13 +2041 ~3: test/general.shard/cache_test.dart: Check current DevTools version
 Exception: Could not find directory at bin/cache/dart-sdk/bin/resources/devtools
 #0      Cache.devToolsVersion (package:flutter_tools/src/cache.dart:369:9)
 #1      main.<anonymous closure> (file:///b/s/w/ir/cache/builder/flutter/packages/flutter_tools/test/general.shard/cache_test.dart:898:57)
 #2      main.<anonymous closure> (file:///b/s/w/ir/cache/builder/flutter/packages/flutter_tools/test/general.shard/cache_test.dart:897:54)
 #3      testUsingContext.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/flutter/packages/flutter_tools/test/src/context.dart:143:42)
 #4      testUsingContext.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/flutter/packages/flutter_tools/test/src/context.dart:137:23)
 #5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
 #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:7)
 #7      _rootRun (dart:async/zone.dart:1426:13)
 #8      _CustomZone.run (dart:async/zone.dart:1328:19)
 #9      _runZoned (dart:async/zone.dart:1861:10)
 #10     runZoned (dart:async/zone.dart:1783:10)
 #11     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
 #12     testUsingContext.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/flutter/packages/flutter_tools/test/src/context.dart:132:30)
 #13     _rootRun (dart:async/zone.dart:1426:13)
 #14     _CustomZone.run (dart:async/zone.dart:1328:19)
 #15     _runZoned (dart:async/zone.dart:1861:10)
 #16     runZonedGuarded (dart:async/zone.dart:1849:12)
 #17     testUsingContext.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/flutter/packages/flutter_tools/test/src/context.dart:130:18)
 #18     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
 #19     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:7)
 #20     _rootRun (dart:async/zone.dart:1426:13)
 #21     _CustomZone.run (dart:async/zone.dart:1328:19)
 #22     _runZoned (dart:async/zone.dart:1861:10)
 #23     runZoned (dart:async/zone.dart:1783:10)
 #24     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
 #25     testUsingContext.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/flutter/packages/flutter_tools/test/src/context.dart:105:22)
 #26     runInContext.runnerWrapper (package:flutter_tools/src/context_runner.dart:82:18)
 <asynchronous suspension>
 #27     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
 <asynchronous suspension>
 #28     testUsingContext.<anonymous closure> (file:///b/s/w/ir/cache/builder/flutter/packages/flutter_tools/test/src/context.dart:104:5)
 <asynchronous suspension>
 #29     Declarer.test.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:215:9)
 <asynchronous suspension>
 #30     Declarer.test.<anonymous closure> (package:test_api/src/backend/declarer.dart:213:7)
 <asynchronous suspension>
 #31     Invoker._waitForOutstandingCallbacks.<anonymous closure> (package:test_api/src/backend/invoker.dart:257:7)
 <asynchronous suspension>
 01:13 +2041 ~3 -1: test/general.shard/cache_test.dart: Check current DevTools version [E]
   Exception: Could not find directory at bin/cache/dart-sdk/bin/resources/devtools
   package:flutter_tools/src/cache.dart 369:9           Cache.devToolsVersion
   test/general.shard/cache_test.dart 898:57            main.<fn>
   test/general.shard/cache_test.dart 897:54            main.<fn>
   test/src/context.dart 143:42                         testUsingContext.<fn>.<fn>.<fn>.<fn>.<fn>
   test/src/context.dart 137:23                         testUsingContext.<fn>.<fn>.<fn>.<fn>.<fn>
   package:flutter_tools/src/base/context.dart 150:29   AppContext.run.<fn>
   package:flutter_tools/src/base/context.dart 150:7    AppContext.run.<fn>
   dart:async                                           runZoned
   package:flutter_tools/src/base/context.dart 149:12   AppContext.run
   test/src/context.dart 132:30                         testUsingContext.<fn>.<fn>.<fn>.<fn>
   dart:async                                           runZonedGuarded
   test/src/context.dart 130:18                         testUsingContext.<fn>.<fn>.<fn>
   package:flutter_tools/src/base/context.dart 150:29   AppContext.run.<fn>
   package:flutter_tools/src/base/context.dart 150:7    AppContext.run.<fn>
   dart:async                                           runZoned
   package:flutter_tools/src/base/context.dart 149:12   AppContext.run
   test/src/context.dart 105:22                         testUsingContext.<fn>.<fn>
   package:flutter_tools/src/context_runner.dart 82:18  runInContext.runnerWrapper
   ===== asynchronous gap ===========================
   package:flutter_tools/src/base/context.dart 150:19   AppContext.run.<fn>
   ===== asynchronous gap ===========================
   test/src/context.dart 104:5                          testUsingContext.<fn>

Dup of https://github.com/flutter/flutter/issues/93553


Transparent Background color for ActionButton.Item

On Android, I have sent buttonColor="transparent" but It always shows a pentagon like background.
Is there any way I can make the icon completely transparent
Note: Transparent background works perfect on IOS but not on Android

i know this issue is open for a long time, but you tried to put shadowStyle={{elevation: 0}}?


18098: KUDU-3197 [tserver] optimal Schema's memory used, using std::s…

create the pr, just for code-review

Thanks for your contribution!
Please submit code review on gerrit, see: https://kudu.apache.org/docs/contributing.html#_contributing_patches_using_gerrit
For draft, you can open a pull request on your own repo.


omniscidb should scan CUDA_PATH and /lib folders when looking for libdevice file

https://github.com/omnisci/omniscidb-internal/blob/ebd3a5f4bec2d5925fc844e01a932f2cdd2eec90/CudaMgr/CudaMgr.cpp#L404-L430

I think it is rather here:
https://github.com/omnisci/omniscidb-internal/blob/ebd3a5f4bec2d5925fc844e01a932f2cdd2eec90/QueryEngine/NativeCodegen.cpp#L1367-L1380
where the scanning for libdevice should be implemented.

This might be a simple PR. One needs to do the following:

Update read_libdevice_module to also check for libdevice in /path/to/cuda/lib/
Update check_module_requires_libdevice to correctly check if libdevice is required or not (ref)
Raise an exception if libdevice.10.bc is not available

Raising an exception might be a problem for other omnisci products (see image below). An alternative is to force the execution to the CPU when libdevice is unavaiable.


unresolved import xxx even though set "python.autoComplete.extraPaths"

LSP reports "unresolved import utils", even though I set "python.autoComplete.extraPath"

setting.json
{
    "files.watcherExclude": {
        "**/sysu_dataset/**": true,
    },
    "python.pythonPath": "/home/zjli/anaconda3/envs/person_search/bin/python",
    "python.autoComplete.extraPaths": [
        "./person_search_2/utils",
    ],
    "python.linting.pylintEnabled": true,
    "python.linting.enabled": false
}

Language Server version: Latest
OS and version: win10
Python version (& distribution if applicable, e.g. Anaconda): Anaconda

Expected behaviour
No warning
Actual behaviour
LSP reports "unresolved import utils"
Logs
[Info  - 7:33:31 PM] Analysis restarted.
[Info  - 7:41:30 PM] Reloading modules...
[Info  - 7:41:30 PM] GetCurrentSearchPaths /home/zjli/anaconda3/envs/person_search/bin/python
[Info  - 7:41:30 PM] Analysis caching mode: None.
[Info  - 7:41:31 PM] Interpreter search paths:
[Info  - 7:41:31 PM]     /home/zjli/anaconda3/envs/person_search/lib/python3.6
[Info  - 7:41:31 PM]     /home/zjli/anaconda3/envs/person_search/lib/python3.6/lib-dynload
[Info  - 7:41:31 PM]     /home/zjli/anaconda3/envs/person_search/lib/python3.6/site-packages
[Info  - 7:41:31 PM] User search paths:
[Info  - 7:41:31 PM]     /home/zjli/Desktop/213project/person_search_2/utils
[Info  - 7:41:31 PM] done.
[Info  - 7:41:31 PM] Analysis restarted

It is strange that the warning has gone when I set
"python.autoComplete.extraPaths": [
        "./person_search_2",
    ],

Can I set python.autoComplete.extraPaths to ./person_search_2/utils instead of ./person_search_2? I am lookinng forward your response, thank you very much.

@jakebailey Thanks for your response. I have read the TROUBLESHOOTING.md
I am so sorry that my description is not clear.

I want to import the module named utils under the folder named utils.
According to https://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#unresolved-import-warnings, I think it's enough to set python.autoComplete.extraPaths to ./person_search_2/utils.
But unfortunately, it does not work, I have to set python.autoComplete.extraPaths to ./person_search_2, that is the parent folder of the parent folder.
Is it by design? I am looking forward to your response, thank you.

Looking at your code, you write import utils.utilsimport utils.utils, which means that the parent directory of the first utils, i.e. person_search_2, is what you need to be adding to extraPaths. You don't want to use person_search_2/utils because you're not doing a plain import utils.

Thank you very much. Now I know where I was wrong.
I am sorry to waste your time on the fool question.
Greate repo, greate maintainer!


0.5.1 - Incorrect session IP

After upgrade of Firezone to 0.5.1, I have noticed the session IP in the web interface is returned incorrectly. I am accessing the web UI using IPv6 (from a public IPv6 address). The web UI shows this:

My true address starts with 2404.

@gbe0 Yeah, found this little gem last night. This is a display format error. Will have it fixed in a bit.
Thanks for the report!

cc @conectado


Add popover attributes

This PR adds popover attributes as detailed here: https://developer.mozilla.org/en-US/docs/Web/API/Popover_API/Using

Hi @knpwrs, thanks for this.
This is the second attribute in a short time that allows zero or one argument(s) (popover is the same as popover="auto"). I'm wondering whether we should start adding a third form of attribute in the html package, with varargs values, similar to how gomponents.Attr itself works. And then panic if there's more than one value. Thoughts?

@knpwrs I think in-place is fine. But it needs to go into a new test which:

Tests that it works like a boolean attribute
Tests that it works as a key-value attribute
Tests that it panics with more than one value given

Might as well start a new table-driven test, I think more attributes like these will show up.
Are you up for that? Otherwise let me know. 😊

How does that look?

Looks great! Should we add the popovertargetaction now we're at it? :D

Done!


Could not load file or assembly System.Memory Version=<IP_ADDRESS>

Description
File load exception when using Confluent.Kafka 1.5.3 with SystemText.Json 5.0.1
Could not load file or assembly 'System.Memory, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
How to reproduce
Add Confluent.Kafka and System.Text.Json from Nuget.  Try to consume events from Kafka queue.  Error is thrown when ConsumerBuilder.Build is called to create IClient instance.  .NET Framework 4.7.1 project.
Checklist
Please provide the following information:

[ ] A complete (i.e. we can run it), minimal program demonstrating the problem. No need to supply a project file.
[x] Confluent.Kafka nuget version.
[ ] Apache Kafka version.
[ ] Client configuration.
[ ] Operating system.
[ ] Provide logs (with "debug" : "..." as necessary in configuration).
[ ] Provide broker log excerpts.
[x] Critical issue.

Do we have an update or work around for this issue? This is quite critical for us as well. We'd rather not have to downgrade our System.Memory assembly as that seems to be the only fix.

This still happens with version 1.6.3 and I had to roll back to version 1.5.2.
I have to use net472 because of a third party library from some vendor.

v1.7.0 works with net472 for me

I was able to work around it (with the latest Kafka installed) by adding this to my app.config:
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
	  <dependentAssembly>
		<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
		<bindingRedirect oldVersion="<IP_ADDRESS>-<IP_ADDRESS>" newVersion="<IP_ADDRESS>"/>
	  </dependentAssembly>
    </assemblyBinding>

I think, this issue (and probably also https://github.com/confluentinc/confluent-kafka-dotnet/issues/1184) is caused by https://github.com/confluentinc/confluent-kafka-dotnet/commit/14e0d0e57d1e0933b135ff572d54a2e7e6e8c23d, <SignAssembly>true</SignAssembly> build option.
Maybe, adding <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> will help, as suggested workaround by @gseddon will be automatic. Also, see I really, really need to strong-name, what kinds of issues will I run into?


vulcan:users runs callbacks with incorrect calling convention

In packages/vulcan-users/lib/server/on_create_user.js, onCreateUserCallback tries to run the same callbacks that createMutator would. Unfortunately, it runs a subtly different set and ordering of callbacks, and omits most of the arguments they would normally be passed.
The right way to do this would be to call createMutator (finding some way to provide a context), sharing code and ensuring matching calling conventions.

Oh good point. I think I just forgot to change that when I recently cleaned up how mutator callbacks work.
I agree it'd be better to call createMutator, once we refactor Accounts maybe it'll be easier to use the same mutators for users as well.


Typo fixes

Apply fixes for a few typos in the comments.

This is amazing, thank you for tracking those down and fixing them!


Support multiple frame const animations

The const types only require specifying a single frame value. The animation's final frame index determines the actual length.

[x] add a frame count field to AnimData
[x] return an error if a track has more frames than the specified frame count
[x] zero length animations?

Zero length animations cause visual issues in game, so it might not be worth making this an error condition.


how to change the hover color for the table row

i want to change the hover color for the table row, is there any way to do it?

Please submit support requests and questions to StackOverflow using the tag material-ui. StackOverflow is better suited for this kind of support. The issue tracker is for bug reports and feature discussions. See also our CONTRIBUTING guidelines.


Upgrade Docker to 1.10.3

https://github.com/docker/docker/releases/tag/v1.10.3
Upgrade it on the host too, not just in the Docker image!

Done in 2016_03_26_1


BLE Scanner example is not scanning continuously (IDFGH-8656)

Answers checklist.

[X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
[X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
[X] I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report
IDF-Version : 4.4.2
SoC : ESP32-C3
I've two esp32-c3 dev kit. In one of them I flashed gatt_server example and gatt_client example in the second. gatt server is advertising with 40ms interval and gat client is scanning with 60ms scan window and 60ms scan interval. Also scan duration 0 for infinite scanning. With this configuration gattc should find gatts 16 times in a second ideally. But it is taking more than 30 seconds to detect after the first scan result event. Need help in solving this.
Config

Logs

@mohamed-jasim
Please turn off BLE Scan Duplicate Options and try is again.
make menuconfig -> component config -> Bluetooth -> Controller options -> BLE Scan Duplicate Options

@xiewenxiang BLE duplicate scanning was disabled by default in SDK config

But was enabled in scan params of example code. After disabling in code, the scan result was coming in expected interval.

Yes, there is also a scan duplicate option in scan parameters.

Correct me if I'm wrong. In my understanding scan duplicate is applicable for a particular scan window. And this is to restrict multiple appearances of a device which is having shorter advertising interval in a bigger scan window. So this duplicate mac id filter enabled shouldn't delay the scan result event. In my case my advertiser is advertising in 1000ms and the scanner is detecting the advertiser in 30 seconds and more

I'm able to see multiple events for MAC IDs in same scan window even after enabling Duplicate filtering for mac id. Attaching the scan params, config and output logs

If enable duplicate scan filtering, it's not mean the same device will be reported only once per scan window. It just means that the same device will be reported only once durning a certain time interval.

Thanks for reporting, will close due to short of feedback, feel free to reopen with more updates. Thanks.


Search sometimes hangs

When this happens, debugging halts after relay.queryRaw(req)

Will be fixed either by improving Purplebase (with Dart NDK) and/or the revamped relay (on Khatru)

This is happening for me too, except search always hangs so I am unable to use the app

@yojimble sorry about that. I really am not sure what's causing it. Hope to fix soon

fingers crossed, I love the app


Update README.md

LGTM

Thanks a lot for your contribution. While we still recommand that  you would read the contributing guidance https://github.com/alibaba/pouch/blob/master/CONTRIBUTING.md.
And feel free to tell us, if you need any help.


Added hypothesis test to two unit testing

Description
This change introduces the use of Hypothesis-based testing in two files and is being applied to selective functions as requested by the author and members of the issue https://github.com/pybamm-team/PyBaMM/issues/4703#issuecomment-2564062105
Fixes # (issue)
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

[x] New feature (non-breaking change which adds functionality)
[x] Optimization (back-end change that speeds up the code)
[X] Bug fix (non-breaking change which fixes an issue)

Key checklist:

[x] No style issues: $ pre-commit run (or $ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
[x] All tests pass: $ python -m pytest (or $ nox -s tests)
[x] The documentation builds: $ python -m pytest --doctest-plus src (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ nox -s quick.
Further checks:

[ ] Code is commented, particularly in hard-to-understand areas
[ ] Tests added that prove fix is effective or that feature works

@RohitP2005 Add hypothesis as a dependency in pyproject.toml for checks to pass.
https://github.com/pybamm-team/PyBaMM/blob/421784e6b0a5f0e857be155b693fec1d9e7ba72d/pyproject.toml#L100

Also, fix the PR heading. It's not proper.

I've added reviews for test_averages.py. I'll add reviews for test_unary_operators.py once the failing tests are fixed.

I've updated the heading as requested, and committed all your suggested changes except for one.
Regarding the implementation of Hypothesis, I limited its use to specific tests to avoid adding overhead by applying it to too many cases. Do you think the way I implemented Hypothesis is optimized, or are there areas where I can improve further?


Remove macro methods from the language

According to the docs:

Macro defs allow you to define a method for a class hierarchy and have that method be evaluated at the end of the type-inference phase, as a macro, for that type and subtypes.

This is how Reference#inspect(io) is implemented (simplified a bit to show the essence):
class Reference
  macro def inspect(io : IO) : Nil
    io << "#<{{@type.name.id}}:0x"
    object_id.to_s(16, io)
    {% for ivar, i in @type.instance_vars %}
      {% if i > 0 %}
        io << ","
      {% end %}
      io << " @{{ivar.id}}="
      @{{ivar.id}}.inspect io
    {% end %}
    io << ">"
    nil
  end
end

Why does it need to be a macro def? Because:

We want this method to be "copied" in every subclass, where @type.instance_vars can be different.
At least before 0.16.0, the final type of an instance var was only known at the end of the type inference phase.

But 2 no longer applies, because now the type of instance variables is known even before the "main" type inference begins.
For point 1, we could simply have the method be marked as a "macro" method, at parse time, if a @type is found inside macro code. That is, if a method uses @type inside a macro it's probably because the method will want type information for the most specific type in the hierarchy.
I just checked all macro def instances in Crystal's standard library and they all use @type.
We can greatly simplify the language with this change. For example, the above could be re-written like this:
class Reference
  def inspect(io : IO)
    io << "#<{{@type.name.id}}:0x"
    object_id.to_s(16, io)
    {% for ivar, i in @type.instance_vars %}
      {% if i > 0 %}
        io << ","
      {% end %}
      io << " @{{ivar.id}}="
      @{{ivar.id}}.inspect io
    {% end %}
    io << ">"
    nil
  end
end

Benefits:

No new concept (macro def) has to be learned. The above is just a method, it works, and the compiler is smart and knows that the method needs to be instantiated differently for each subclass.
No need to specify a return type, because now the compiler will be able to infer this (all needed types are now known)

I'm planning to move forward with this change, but I'd like to know if any of you is using macro defs in your projects, and if so, are they all using @type inside a macro? I checked mocks.cr, spec2.cr and artanis, which heavily use macros, and didn't find macro defs.
Hmm... I also checked frost and here I see some macro defs that don't mention @type ( /cc @ysbaddaden ). But I think in this case we can let the methods be defined in the included macro hook. As an alternative, we could introduce a @[MacroMethod] annotation to let the compiler know that the method needs to be resolved differently for each subtype (I don't like the macro def syntax).

I like being capable to say that a method is dependent to the class, and not inherited. It's not used often, but can be powerful sometimes.
I prefer this to be explicit thought, and not implicit by detecting that the method includes a macro that references @type. I think it's more readable.
I don't care about the syntax; having a decorator would be better, indeed. It says "please treat this method as special" and it differentiates from macros. I'm just not sure MacroMethod is very explicit, but I'm at a loss to imagine something :-/

I vote for explicit way, having different mechanisms based on code in body feels a bit surprising, and these constructs aren't that common.
Perhaps attribute mirroring included macro hook? @[ProcessWhenIncluded] or such, (but better / more specifically worded).

Thank you for the feedback!
One more thing: did you know that the body of a macro def is a macro? I mean, it's parsed as a macro. I'd like to change that, it makes things unnecessary complex, we can always use {% begin %} ... {% end }% inside the method definition. For example this compiles right now:
class Foo
  # This is a valid macro, it will of course fail to parse once we invoke it,
  # but it's better if we give a syntax error before that moment
  macro def foo : Int32
    a +
  end
end

So, this can be changed without a problem. Once we do that, the name macro def stops having sense, because it's just a regular def that is "instantiated" for every subtype. We could drop this feature and use macro inherited, except that this won't work because you might have types that already inherit, say, Reference, but you add the inherited hook later.
Another thing is that a macro def is analyzed at the end of the type inference phase... I don't think this is needed anymore, because when methods are analyzed all the type hierarchy and types of instance vars are already defined, so doing it at the end or at the beginning should have the same effect.
Maybe we should find an attribute name. Another possibility is to stick with the idea of having the compiler recognize this if it finds @type inside macro code inside a method. If this functionality is desired, but we don't need to use @type, we can always do:
class Foo
  def magic
    {% @type %} # just so the compiler treats this method in a different way, has no effect otherwise
    # code...
  end
end

But, yeah, this last bit feels more hacky. My thought was that this behaviour is usually (always) needed when you access @type. At least on macros in the std behave this way, and 99% of the others in other shards.
In conclusion, for now I'll change two things:

A macro def's body will be parsed like a regular method instead of a macro
The macro def's return type won't be mandatory

After that we can continue discussing the other bits :-)

I would prefer the mentioned explicit annotation, and, that if a def contains a reference to @type in macro-code, it errors until the annotation is added. This makes sure the code will work as intended. And it makes sure it's obvious to the reader.

So, points 1 are 2 are done now. This is a breaking change because I found some macro defs that used the feature that their body was parsed as a macro (I found a couple of them in minitest, @ysbaddaden). The fix is really simple, though: just put the method's body between {% begin %} ... {% end %}.
With this change we can now turn any object into a hash... this was impossible before because we needed a precise return type:
class Reference
  macro def to_h # previously we needed a return type here...
    {% if @type.instance_vars.empty? %}
      {} of Symbol => Nil
    {% else %}
      {
        {% for ivar in @type.instance_vars %}
          {{ivar.id}}: @{{ivar.id}},
        {% end %}
      }
    {% end %}
  end
end

class Foo
  def initialize
    @x = 1
    @y = "hello"
  end
end

hash = Foo.new.to_h
p hash # => {:x => 1, :y => "hello"}
p typeof(hash) # => Hash(Symbol, Int32 | String)

Not sure what's that useful for, though. But once we introduce named tuples, we'll be able to convert any object to them, and there it makes more sense (you can basically treat an object as a "hash" of properties, but a very fast and efficient hash). This can be useful to automatically dump a type to json without defining an explicit mapping.
Another nice thing is that now macro defs work with yield, which previously didn't, so now we can generically yield a type's instance vars, types and values.
All of this, of course, wouldn't have been possible without "explicit" type annotations in  instance vars... so now we can start compensating that small annoyance :-)

Wouldn't that help for marshaling Crystal objects, too?

I prefer this to be explicit thought, and not implicit by detecting that the method includes a macro that references @type. I think it's more readable.

I think the example in #2647 shows that doing it implicitly feels more natural and intuitive. Therefore I vote for removing explicit macro defs from the language.

I made it so that {{@type}} inside a method turns it into a macro def for the compiler.
The syntax macro def is still available if you want to make this explicit, though if we don't find cases of "macro def"s where {{@type}} isn't used I'd say we remove that syntax. For example, some previous changed made macro defs resolve types relative to the place where they are defined (#2616). So if one needs to resolve a type relative to the more specific type one would have to do {{@type}}::SubType, so there the compiler too will mark the method as "macro def". With that, I'm not sure other cases where {{@type}} isn't used exist.

@ysbaddaden Yes, I believe that now that macro defs no longer require a return type they can be very poweful. For example one can turn an object into a named tuple and then access it almost as an (immutable) hash: https://play.crystal-lang.org/#/r/znn :-)
(don't know if that's useful, though, but it's definitely possible)