Getting mysql error even though I am using postgres and haven't specified mysql anywhere

This issue has had me tearing my hair out for the past two hours. It works perfectly on my development machine but when trying to run on AWS I continually get this exception:
[deploy@donotcall-medium1<PHONE_NUMBER>4023]$ bundle exec rake db:migrate
rake aborted!
Specified 'mysql' for database adapter, but the gem is not loaded. Add `gem 'mysql'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/connection_specification.rb:177:in `rescue in spec'
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/connection_specification.rb:174:in `spec'
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/activerecord-4.2.1/lib/active_record/connection_handling.rb:50:in `establish_connection'
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/sinatra-activerecord-2.0.6/lib/sinatra/activerecord.rb:41:in `database='
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1216:in `set'
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/sinatra-activerecord-2.0.6/lib/sinatra/activerecord.rb:35:in `database_file='
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1216:in `set'
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/sinatra-activerecord-2.0.6/lib/sinatra/activerecord.rb:19:in `registered'
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1399:in `block in register'
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1397:in `each'
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1397:in `register'
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1977:in `register'
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:2038:in `register'
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/sinatra-activerecord-2.0.6/lib/sinatra/activerecord.rb:55:in `<module:Sinatra>'
/home/deploy/.bundler/fosubo_donotcall/ruby/2.1.0/gems/sinatra-activerecord-2.0.6/lib/sinatra/activerecord.rb:10:in `<top (required)>'
/srv/www/fosubo_donotcall/releases/20150402214023/app.rb:4:in `require'
/srv/www/fosubo_donotcall/releases/20150402214023/app.rb:4:in `<top (required)>'
/srv/www/fosubo_donotcall/releases/20150402214023/Rakefile:3:in `require'
/srv/www/fosubo_donotcall/releases/20150402214023/Rakefile:3:in `<top (required)>'
(See full trace by running task with --trace)

I don't understand why this is happening. I am not using mysql. I don't want to use mysql. I want to use postgres. I haven't specified mysql anywhere in the project.
➜  fosubo-donotcall git:(master) ack mysql
➜  fosubo-donotcall git:(master)

Here is my Rakefile:
require File.expand_path('../app.rb', __FILE__)
require 'sinatra/activerecord/rake'

My Gemfile
source "https://rubygems.org"
ruby "2.1.5"
gem 'sinatra'
gem 'pg'
gem 'haml'
gem 'thin'
gem 'json'
gem "sinatra-activerecord"
gem "rake"

And my app.rb (first five lines only)
require 'haml'
require 'json'
require 'sinatra'
require 'sinatra/activerecord' # EXCEPTION HAPPENS HERE
require "./config/boot"

Why is this happening and what can I do to fix it?

I FIXED IT.
Turns out there was some badly configured opsworks scripts that created a config/database.yml referring to a mysql adapter even though the RDS instance was running postgres.
Not a bug in sinatra-activerecord.
-S

@samphilipd I'm still getting this error and I can't trace it down? I appreciate that it might not be a bug in sinatra-activerecord. Could you shed any more light?


EXSWHTEC-146 - Implement tests for hipSignalExternalSemaphoresAsync for the Vulkan API

Test signaling a binary semaphore
Test signaling a timeline semaphore(Nvidia only)
Test signaling two semaphores
Negative parameter tests.

This change needs to be submitted through hip-tests project.


Streamline support for Feature objects in coord mapping utils

Following up on #128

[x] change Feature object geometry in-place in mapping util
[x] conform unit test to rest of test case
[ ] improve docstrings

flake8 is failing

Hi @auvipy, I am the new project lead of this repo. I wanted to include related docstring updates with this PR before merging it; I have a checklist in the PR description denoting that was work yet to be done. Going forward, please do not merge others' PRs in this repo without at least one of the original authors or a project lead saying it is ready to merge. Thank you!


Llamaindex rag

Hi Holt,
As per feedback, created a new merge request. Please advise if this works.
This is for a blog post publishing which is in final phases of approvals. Thank you

@kenleejr Please resolve the remaining lint errors, and I will give it a full review.

Hi @holtskinner I've done my best to fix as much linting errors as possible although I'm at a point where fixing some conflicts with others (applying black conflicts with flake8 changes).


Implement sample codes assuming real app situations

made a repository below for sample app.
https://github.com/chooyan-eng/crop_your_image_gallery


Crash once invoking camerapicturebackground

Hi,
I've been trying your plugin, nothing fancy just adding the plugin to newly created Cordova project and wanna try the function. Unfortunately, it always crash and force close. Any idea why this happen?

hi, I use this library in a project without problems. You can do debugging with your chrome browser to know what is happening.

Hi crmolinaz,
I've tried, the inspect device on debugging log trace nothing, it just crash when i try to engage "window.plugins.CameraPictureBackground.takePicture(success, error, options);"
Here is my CLI :
cordova plugin add https://github.com/an-rahulpandey/cordova-plugin-camerapicturebackground.git
Source code:

document.addEventListener("deviceready", function() {});
		function snap()
		{
			var options = {
				name: "Image", //image suffix
				dirName: "CameraPictureBackground", //foldername
				orientation: "landscape", //or portrait
				type: "back" //or front
			};

			window.plugins.CameraPictureBackground.takePicture(success, error, options);
		}

		function success(imgurl)
		{
			console.log("Imgurl = " + imgurl);
		}

		function error(e)
		{
			console.error("Imgurl = " + e);
		}

I just call the snap function and it crash. It would be good if could share some thought,

What device are you using? Can you check the log and print out the Java error code using this -
http://developer.android.com/tools/help/monitor.html

Hi Rahul,
LogCat as follow :
11-24 18:15:48.507 21759-21759/? D/dalvikvm: Late-enabling CheckJNI
11-24 18:15:48.507 21759-21759/? D/dalvikvm: Try to disable coredump for pid 21759
11-24 18:15:48.507 21759-21759/? D/dalvikvm: Process 21759 nice name: com.example.bgcam
11-24 18:15:48.507 21759-21759/? D/dalvikvm: Extra Options: not specified
11-24 18:15:48.617 21759-21759/com.example.bgcam V/WebViewChromium: Binding Chromium to the background looper Looper (main, tid 1) {21d02318}
11-24 18:15:48.617 21759-21759/com.example.bgcam I/chromium: [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
11-24 18:15:48.617 21759-21759/com.example.bgcam I/BrowserProcessMain: Initializing chromium process, renderers=0
11-24 18:15:48.627 21759-21780/com.example.bgcam W/chromium: [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
11-24 18:15:48.637 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 63
11-24 18:15:48.637 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 64
11-24 18:15:48.637 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 65
11-24 18:15:48.637 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 65
11-24 18:15:48.637 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 65
11-24 18:15:48.647 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 67
11-24 18:15:48.667 21759-21759/com.example.bgcam D/PasswordDatabase: constructor password.db
11-24 18:15:48.687 21759-21759/com.example.bgcam D/AwPasswordHandler: getInstance, mInstance = com.android.org.chromium.android_webview.AwPasswordHandler@21d14d30
11-24 18:15:48.687 21759-21759/com.example.bgcam W/chromium: [WARNING:password_handler.cc(27)] create-->contents = 0x62dc1a50, delegate = 0x62dd5ca0
11-24 18:15:48.687 21759-21759/com.example.bgcam W/chromium: [WARNING:password_handler.cc(35)] attaching to web_contents
11-24 18:15:48.707 21759-21759/com.example.bgcam I/dalvikvm: Could not find method android.webkit.CookieManager.setAcceptThirdPartyCookies, referenced from method org.apache.cordova.engine.SystemCookieManager.
11-24 18:15:48.707 21759-21759/com.example.bgcam W/dalvikvm: VFY: unable to resolve virtual method 180: Landroid/webkit/CookieManager;.setAcceptThirdPartyCookies (Landroid/webkit/WebView;Z)V
11-24 18:15:48.707 21759-21759/com.example.bgcam D/dalvikvm: VFY: replacing opcode 0x6e at 0x0016
11-24 18:15:48.707 21759-21759/com.example.bgcam I/dalvikvm: Could not find method android.webkit.CookieManager.flush, referenced from method org.apache.cordova.engine.SystemCookieManager.flush
11-24 18:15:48.707 21759-21759/com.example.bgcam W/dalvikvm: VFY: unable to resolve virtual method 175: Landroid/webkit/CookieManager;.flush ()V
11-24 18:15:48.707 21759-21759/com.example.bgcam D/dalvikvm: VFY: replacing opcode 0x6e at 0x0008
11-24 18:15:48.707 21759-21759/com.example.bgcam W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/webkit/ClientCertRequest;)
11-24 18:15:48.717 21759-21759/com.example.bgcam W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/webkit/ClientCertRequest;)
11-24 18:15:48.717 21759-21759/com.example.bgcam I/dalvikvm: Could not find method android.webkit.WebViewClient.onReceivedClientCertRequest, referenced from method org.apache.cordova.engine.SystemWebViewClient.onReceivedClientCertRequest
11-24 18:15:48.717 21759-21759/com.example.bgcam W/dalvikvm: VFY: unable to resolve virtual method 233: Landroid/webkit/WebViewClient;.onReceivedClientCertRequest (Landroid/webkit/WebView;Landroid/webkit/ClientCertRequest;)V
11-24 18:15:48.717 21759-21759/com.example.bgcam D/dalvikvm: VFY: replacing opcode 0x6f at 0x001a
11-24 18:15:48.717 21759-21759/com.example.bgcam W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/webkit/PermissionRequest;)
11-24 18:15:48.717 21759-21759/com.example.bgcam I/dalvikvm: Could not find method android.webkit.PermissionRequest.getResources, referenced from method org.apache.cordova.engine.SystemWebChromeClient.onPermissionRequest
11-24 18:15:48.717 21759-21759/com.example.bgcam W/dalvikvm: VFY: unable to resolve virtual method 191: Landroid/webkit/PermissionRequest;.getResources ()[Ljava/lang/String;
11-24 18:15:48.717 21759-21759/com.example.bgcam D/dalvikvm: VFY: replacing opcode 0x6e at 0x000d
11-24 18:15:48.717 21759-21759/com.example.bgcam I/dalvikvm: Could not find method android.webkit.WebChromeClient$FileChooserParams.createIntent, referenced from method org.apache.cordova.engine.SystemWebChromeClient.onShowFileChooser
11-24 18:15:48.717 21759-21759/com.example.bgcam W/dalvikvm: VFY: unable to resolve virtual method 196: Landroid/webkit/WebChromeClient$FileChooserParams;.createIntent ()Landroid/content/Intent;
11-24 18:15:48.717 21759-21759/com.example.bgcam D/dalvikvm: VFY: replacing opcode 0x6e at 0x0000
11-24 18:15:48.717 21759-21759/com.example.bgcam D/SystemWebViewEngine: CordovaWebView is running on device made by: asus
11-24 18:15:48.717 21759-21759/com.example.bgcam D/AwPasswordHandler: setSavePassword false
11-24 18:15:48.807 21759-21759/com.example.bgcam D/OpenGLRenderer: Enabling debug mode 0
11-24 18:15:48.827 21759-21759/com.example.bgcam W/AwContents: nativeOnDraw failed; clearing to background color.
11-24 18:15:49.017 21759-21759/com.example.bgcam D/JsMessageQueue: Set native->JS mode to OnlineEventsBridgeMode
11-24 18:15:49.067 21759-21759/com.example.bgcam W/chromium: [WARNING:password_handler.cc(202)] OnPasswordFormsRendered called
11-24 18:15:49.067 21759-21759/com.example.bgcam D/AwPasswordHandler: getSavePassword false
11-24 18:15:49.067 21759-21759/com.example.bgcam W/chromium: [WARNING:aw_password_handler_delegate_impl.cc(203)] IsSavePasswordEnabled ret is
11-24 18:15:49.067 21759-21759/com.example.bgcam W/chromium: [WARNING:password_handler.cc(204)] OnPasswordFormsRendered IsEnabledSavePassword is false
11-24 18:15:49.087 21759-21759/com.example.bgcam I/chromium: [INFO:CONSOLE(23)] "No Content-Security-Policy meta tag found. Please add one when using the cordova-plugin-whitelist plugin.", source: file:///android_asset/www/plugins/cordova-plugin-whitelist/whitelist.js (23)
11-24 18:15:49.137 21759-21759/com.example.bgcam I/chromium: [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
11-24 18:15:49.157 21759-21759/com.example.bgcam I/chromium: [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
11-24 18:15:49.157 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 90
11-24 18:15:49.167 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 111
11-24 18:15:49.167 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 112
11-24 18:15:49.167 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 113
11-24 18:15:49.167 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 114
11-24 18:15:49.167 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 115
11-24 18:15:49.167 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 116
11-24 18:15:49.167 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 117
11-24 18:15:49.177 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 118
11-24 18:15:49.177 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 119
11-24 18:15:49.177 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 120
11-24 18:15:49.177 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 121
11-24 18:15:49.177 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 122
11-24 18:15:49.177 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 123
11-24 18:15:49.177 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 124
11-24 18:15:49.177 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 125
11-24 18:15:49.177 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 126
11-24 18:15:49.187 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 127
11-24 18:15:49.187 21759-21759/com.example.bgcam E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 128
11-24 18:15:49.197 21759-21759/com.example.bgcam D/CameraPictureBackground: Image Name = Image
11-24 18:15:49.197 21759-21759/com.example.bgcam D/CameraPictureBackground: Camera Type =0
11-24 18:15:49.197 21759-21759/com.example.bgcam D/CameraPictureBackground: Dir Name = CameraPictureBackground
11-24 18:15:49.197 21759-21759/com.example.bgcam D/CameraPictureBackground: Rotation = 0
11-24 18:15:49.237 21759-21759/com.example.bgcam D/Camera: [CTA] Camera open urrentpackagename = com.example.bgcam
11-24 18:15:49.237 21759-21759/com.example.bgcam D/Camera: [CTA] Camera open application != null
11-24 18:15:49.237 21759-21759/com.example.bgcam D/Camera: [CTA] check CTA permisson mAllowUsing = false
11-24 18:15:49.237 21759-21759/com.example.bgcam D/Camera: [CTA] Camera open urrentpackagename = com.example.bgcam
11-24 18:15:49.237 21759-21759/com.example.bgcam D/Camera: [CTA] Camera open application != null
11-24 18:15:49.237 21759-21759/com.example.bgcam D/Camera: [CTA] after check permission mAllowUsing = com.example.bgcam
11-24 18:15:51.227 21759-21759/com.example.bgcam D/AndroidRuntime: Shutting down VM
11-24 18:15:51.227 21759-21759/com.example.bgcam W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x430f3140)
11-24 18:15:51.227 21759-21759/com.example.bgcam E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.bgcam, PID: 21759
java.lang.RuntimeException: java.lang.RuntimeException: setParameters failed
at me.rahul.plugins.camerapicturebackground.CameraSurfacePreview$1.surfaceCreated(CameraSurfacePreview.java:146)
at android.view.SurfaceView.updateWindow(SurfaceView.java:572)
at android.view.SurfaceView.access$000(SurfaceView.java:86)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:175)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:847)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1891)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1020)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5762)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:771)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:757)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: setParameters failed
at android.hardware.Camera.native_setParameters(Native Method)
at android.hardware.Camera.setParameters(Camera.java:1707)
at me.rahul.plugins.camerapicturebackground.CameraSurfacePreview$1.surfaceCreated(CameraSurfacePreview.java:96)
at android.view.SurfaceView.updateWindow(SurfaceView.java:572)
at android.view.SurfaceView.access$000(SurfaceView.java:86)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:175)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:847)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1891)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1020)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5762)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:771)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:757)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)

You are using the latest version of the plugin, the line 91-93 in CameraSurfacePreview.java file is like this -
if (params.getSceneMode() != null){
params.setSceneMode(Parameters.SCENE_MODE_STEADYPHOTO);
}

I'm using this CLI => cordova plugin add https://github.com/an-rahulpandey/cordova-plugin-camerapicturebackground.git
I believe, I should get the latest plugins. Correct me if I'm wrong

Ok, try commenting out the line number 94 from the plugin file CameraSurfacePreview.java -

So the line 91-94 should like this -

if (params.getSceneMode() != null) {
params.setSceneMode(Parameters.SCENE_MODE_STEADYPHOTO);
}
params.setFocusMode(Parameters.FOCUS_MODE_FIXED);

Hi Rahul,
I was wondering if you could take a look at this as well. I'm new to programming, but I have a similar effect (with and without line 94 commented out).
logcat as follows (please let me know if you require more information):
Shutting down VM
FATAL EXCEPTION: main
Process: com.ionicframework.journey194130, PID: 13854
java.lang.RuntimeException: java.lang.RuntimeException: setParameters failed
at me.rahul.plugins.camerapicturebackground.CameraSurfacePreview$1.surfaceCreated(CameraSurfacePreview.java:146)
at android.view.SurfaceView.updateWindow(SurfaceView.java:607)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:184)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:921)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2166)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1191)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6641)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
at android.view.Choreographer.doCallbacks(Choreographer.java:590)
at android.view.Choreographer.doFrame(Choreographer.java:560)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.RuntimeException: setParameters failed
at android.hardware.Camera.native_setParameters(Native Method)
at android.hardware.Camera.setParameters(Camera.java:1941)
at me.rahul.plugins.camerapicturebackground.CameraSurfacePreview$1.surfaceCreated(CameraSurfacePreview.java:96)
... 18 more
Could you please help?
I have it working on a Galaxy S4, but it failed on the Note 3.
Also, will this plugin work on most devices if I made a production app? And how do I understand the errors seen in the logcat? (Sorry, I am new to programming, but your help is greatly appreciated).
Thank you so much!
<EMAIL_ADDRESS>

I have updated the plugin, try the version 0.0.2. And let me know if you are still facing the issue.

Hi Rahul,
Unfortunately it is still crashing with the same logcat being produced.
The only exception being the line for the following has changed from 146 to 149 (as expected).
me.rahul.plugins.camerapicturebackground.CameraSurfacePreview$1.surfaceCreated(CameraSurfacePreview.java:146)
Any suggestions?
Is it possible it has to do with the preview pane as per below?
http://stackoverflow.com/questions/3890381/camera-setparameters-failed-in-android
Thanks again.

how are you calling the plugins and what are the parameters? And when the app crashes, does it crashes immediately or when you try to rotate the app?

The parameters are identical to the demo, and this same code works on the Galaxy S4, and not the Note 3. I'd just like to try it on a different device.
Also, as a quick note, the $ionicPlatform.ready is fired after the deviceready is fired with Cordova, so it's a suitable replacement.
  $scope.options = {
    name: "Image",
    dirName:"CameraPictureBackground",
    orientation: "portrait",
    type: 'back'
  };

  $ionicPlatform.ready(function() {
    $scope.camera = function () {

      window.plugins.CameraPictureBackground.takePicture(function (a) {
      }, function (e) {
        console.log(e);
      }, $scope.options);
    };
  });

Does it crash immediately?
My app starts fine. Upon pressing the "Capture" button, we receive the message "Unfortunately myApp has stopped working.
Does it crash when you try and rotate the app?
It crashes regardless of phone orientation, and "orientation" parameter being sent to CameraPictureBackground.
I appreciate your help. If you email me, I'd be happy to send you a small thanks through PayPal or something. I'm not familiar with Java, and would rather not learn how to fix this haha. But it would be nice to have this work on more devices.
Thanks Rahul,
<EMAIL_ADDRESS>

First let solve the issue, I have added the code in dev branch to create a preview size based on what device support, but I have nothing to test on, right now. So can you clone the repo from the dev branch and install the plugin from the folder in your project?

Hi rahul, Im getting the same error after testing the app on a Huawei y625... It is working correctly on my LG nexus 5 but I need it working on huawei devices :S.....  So, please let me know if you get the fix about this. I assume that the answer is related to the preview size from surface configuration considering the follow:
79
down vote
accepted
It is failing because not all devices support arbitrary preview sizes
and there is a fix for this. I will try to use your dev branch too in order to check if this could be fixed. Thanks and I will be waiting for good news to still be using this great plugin.
Regards,
Sergio

I have added the preview size code from that stack overflow answer in the dev branch, let me know if that is also not working.

Hi Rahul,
Finally got a chance to checking. I changed the following two from "parameters" to "params" so it would compile. I believe this was the correct choice to make:
parameters.getSupportedPreviewSizes(); and parameters.setPreviewSize(previewSize.width, previewSize.height);
// line 89			List<Camera.Size> previewSizes = params.getSupportedPreviewSizes();
    				Log.d("CordovaLog","preview sizes = "+previewSizes);
    				Camera.Size previewSize =  previewSizes.get(0);
//line 91		 	params.setPreviewSize(previewSize.width, previewSize.height);

Unfortunately, it didn't work again, with the same, outcome. the log was very similar to previous. I've appended it below:
FATAL EXCEPTION: main
Process: com.ionicframework.journey194130, PID: 5372
java.lang.RuntimeException: java.lang.RuntimeException: setParameters failed
at me.rahul.plugins.camerapicturebackground.CameraSurfacePreview$1.surfaceCreated(CameraSurfacePreview.java:151)
at android.view.SurfaceView.updateWindow(SurfaceView.java:607)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:184)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:921)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2166)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1191)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6641)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
at android.view.Choreographer.doCallbacks(Choreographer.java:590)
at android.view.Choreographer.doFrame(Choreographer.java:560)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.RuntimeException: setParameters failed
at android.hardware.Camera.native_setParameters(Native Method)
at android.hardware.Camera.setParameters(Camera.java:1941)
at me.rahul.plugins.camerapicturebackground.CameraSurfacePreview$1.surfaceCreated(CameraSurfacePreview.java:101)
... 18 more
My roommate asked for his phone back (he's with the Note 3), but I'm going to see if I can find anything else in the meantime..
Cheers and thanks a lot for the help.

Rahul,
I tried a number of things, all of them came out with the same error and crash :/
I attempted removing
getSupportedPreviewSizes();
in favor of
.getPreviewSize();
as per the comment in http://stackoverflow.com/questions/3890381/camera-setparameters-failed-in-android
I also attempted mimicking the code such that your "SurfaceChanged" Function looks like:
   Camera.Parameters parameters = camera.getParameters();
    List<Camera.Size> previewSizes = parameters.getSupportedPreviewSizes();
    // You need to choose the most appropriate previewSize for your app
    Camera.Size previewSize = // .... select one of previewSizes here
    parameters.setPreviewSize(previewSize.width, previewSize.height);
    camera.setParameters(parameters);
    camera.startPreview();

rather than being empty, as per the Stack overflow forum. Mind you, I don't understand the algorithm used. I was just shooting in the dark.
I believe it to be something in the surfaceCreated() function seeing the following:
 java.lang.RuntimeException: java.lang.RuntimeException: setParameters failed
03-02 01:24:23.152: E/AndroidRuntime(17214): 	at me.rahul.plugins.camerapicturebackground.CameraSurfacePreview$1.surfaceCreated(CameraSurfacePreview.java:158)

Sorry I am not of much help. Please let me know if there's something I can do to help!
Jason

I will update the code with the new api later on- http://developer.android.com/reference/android/hardware/camera2/package-summary.html

Hi rahul,
I tried your dev branch and is not working.
Just in case I get this logs that you put from my device Huawei :
Log.d("CordovaLog","preview sizes = "+previewSizes)   -->COnsole result below:
preview sizes = [android.hardware.Camera$Size@27eefd0, android.hardware.Camera$Size@1df3490, android.hardware.Camera$Size@18f5600, android.hardware.Camera$Size@1676730, android.hardware.Camera$Size@13f7860, android.hardware.Camera$Size@ef9a20, android.hardware.Camera$Size@bfaea0, android.hardware.Camera$Size@afb580, android.hardware.Camera$Size@9fbc30, android.hardware.Camera$Size@77cd10, android.hardware.Camera$Size@57dac0]
and the we got the same error :
java.lang.RuntimeException: java.lang.RuntimeException: setParameters failed
MAybe something else to change in the cameraSurfacePreview.java.
If you know how to fix this pls let me know, I will do the same !
Thanks

Ok Finally, FIXED! I improve a little bit your cameraSurfacePreview.
Testing in more devices!   More about this soon.

Ok there was few problems for specific devices such as Huawei.
I improve the following :

How we are retrieving the supportedPreviewSize to get the better size depending of the device.
Some devices needs to use a handler to wait some miliseconds in order to avoid getting dark images. Thats why I put that custom delay. (After that my picture was Great, not dark as in the afternoon)
I notice that the critical issue that we reported in this issue was caused by the following section:
/*  Commented because it was causing critical error in some devices (i.e. Huawei)
if (params.getSceneMode() != null) {
params.setSceneMode(Parameters.SCENE_MODE_STEADYPHOTO);
}
*/

And the last improve was in the moment when we prepare the preview, I changed to code to use the
"surfaceChanged" instead of surfaceCreated because sometimes we need to depend of the width and height of the surface. (Supporting more devices with this too).
So, well know is working so the class that I changed is CameraSurfacePreview:
package me.rahul.plugins.camerapicturebackground;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.hardware.Camera.Size;
import android.hardware.Camera.Parameters;
import android.hardware.Camera.PictureCallback;
import android.os.Environment;
import android.os.IBinder;
import android.os.Handler;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.WindowManager;
public class CameraSurfacePreview extends Service {
private static Camera camera = null;
private static String imageName;
private static int camType;
private static String dirName;
private static int rotation;
@Override
public void onCreate() {
	super.onCreate();
}

public int onStartCommand (Intent intent, int flags, int startId){

	imageName = intent.getStringExtra("filename");
	debugMessage("Image Name = "+imageName);
	camType = intent.getIntExtra("camType", 0);
	debugMessage("Camera Type ="+camType);
	dirName = intent.getStringExtra("dirName");
	debugMessage("Dir Name = "+dirName);
	rotation = intent.getIntExtra("orientation", 0);
	debugMessage("Rotation = "+rotation);
	takePhoto(this);
    return START_NOT_STICKY;

}

@SuppressWarnings("deprecation")
private static void takePhoto(final Context context) {

	final SurfaceView preview = new SurfaceView(context);
	SurfaceHolder holder = preview.getHolder();
	// deprecated setting, but required on Android versions prior to 3.0
	holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

	holder.addCallback(surfaceCallback);

	WindowManager wm = (WindowManager) context
			.getSystemService(Context.WINDOW_SERVICE);
	WindowManager.LayoutParams params = new WindowManager.LayoutParams(1,
			1, // Must be at least 1x1
			WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY, 0,
			// Don't know if this is a safe default
			PixelFormat.UNKNOWN);

	// Don't set the preview visibility to GONE or INVISIBLE
	wm.addView(preview, params);
}

static SurfaceHolder.Callback surfaceCallback = new SurfaceHolder.Callback() {

	public void surfaceCreated(SurfaceHolder holder) {

	}

	public void surfaceChanged(SurfaceHolder holder, int format, int width,int height) {
		final CameraPictureBackground cpb = new CameraPictureBackground();
		try {
			camera = Camera.open(camType);
			try {
				camera.setPreviewDisplay(holder);
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
			Log.d("CordovaLog","SMS optimalSize from param - STARTING!");
			//camera.setDisplayOrientation(rotation);
			Camera.Parameters params = camera.getParameters();
			params.set("orientation", "portrait");
            //params.set("rotation",rotation);
				List<Size> previewSizes = params.getSupportedPreviewSizes();
				Log.d("CordovaLog","preview sizes = "+previewSizes);
			 Size optimalSize= getBestPreviewSize(previewSizes,width, height);
            		 if(optimalSize!=null){
            	        params.setPreviewSize(optimalSize.width, optimalSize.height);
            	        Log.d("CordovaLog", "resumed  first sizes "  + width + "height:" + height);
            	        Log.d("CordovaLog", "resumed  preview sizes "  + optimalSize.width + "height:" + optimalSize.height);

            		 }
			Log.d("CordovaLog", "SMS optimalSize DONE! ");

			params.setJpegQuality(100);
		    /*  Commented because it was causing critical error in some devices (i.e. Huawei)
			if (params.getSceneMode() != null) {
			    params.setSceneMode(Parameters.SCENE_MODE_STEADYPHOTO);
			}
            */
			List<String> focusModes = params.getSupportedFocusModes();
			if (focusModes.contains(Parameters.FOCUS_MODE_FIXED))
				params.setFocusMode(Parameters.FOCUS_MODE_FIXED);

			params.setRotation(rotation);
			camera.setParameters(params);
			 Log.d("CordovaLog", "starting preview ");
			camera.startPreview();
			new Handler().postDelayed(new Runnable() {
              @Override
              public void run() {
                  camera.takePicture(null, null, new PictureCallback() {

                  					@Override
                  					public void onPictureTaken(byte[] data, Camera camera) {

                  						FileOutputStream outStream = null;
                  						File sdDir = Environment
                  								.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
                  						File pictureFileDir = new File(sdDir,dirName);

                  						debugMessage("pictureFileDir = "+pictureFileDir);

                  						if (!pictureFileDir.exists())
                  							pictureFileDir.mkdir();

                  						SimpleDateFormat dateFormat = new SimpleDateFormat("yyyymmddhhmmss");
                  						String date = dateFormat.format(new Date());

                  						String filepath = pictureFileDir.getPath()
                  								+ File.separator +imageName+"-"+date+".jpg";

                  						File pictureFile = new File(filepath);

                  						try {
                  							outStream = new FileOutputStream(pictureFile);
                  							outStream.write(data);
                  							debugMessage("Picture Saved Successfully");
                  							outStream.close();
                  							cpb.sendJavascript(filepath);
                  						} catch (FileNotFoundException e) {
                  							debugMessage(e.getMessage());
                  						} catch (IOException e) {
                  							debugMessage(e.getMessage());
                  						}
                  						if (camera != null) {
                  							camera.stopPreview();
                  							camera.release();
                  							camera = null;
                  						}
                  					}
                  				});
              }
            }, 1000);    //Waiting some time to avoid getting dark pictures in some devices.

		} catch (Exception e) {
			if (camera != null) {
				camera.stopPreview();
				camera.release();
				camera = null;
			}
            Log.d("CordovaLog", "Cannot start preview", e);
			throw new RuntimeException(e);

		}
	}

	public void surfaceDestroyed(SurfaceHolder holder) {
		if (camera != null) {
			camera.stopPreview();
			camera.release();
			camera = null;
		}
	}
};

private static Camera.Size getBestPreviewSize(List<Size> sizes, int width, int height)
 {
          Log.d("CordovaLog", "Entra getBEST "+width+ " "+ height);
         Camera.Size result=null;

         for (Camera.Size size : sizes) {
             if (size.width<=width && size.height<=height) {
                 if (result==null) {
                     result=size;
                     Log.d("CordovaLog", "result is first size "+result);
                 } else {
                     int resultArea=result.width*result.height;
                     int newArea=size.width*size.height;

                     if (newArea>resultArea) {
                         result=size;
                     }
                     Log.d("CordovaLog", "result is second size "+result);
                 }
             }
             else{
                Log.d("CordovaLog", "Else size "+sizes.get(0));
             	//result = sizes.get(0);
             }
         }
         if(result==null){
         	result = sizes.get(0);
         	Log.d("CordovaLog", "WARNING previewSize is Null");
         }

     return result;

 }

private static void debugMessage(String message) {
	Log.d("CameraPictureBackground", message);
}

@Override
public IBinder onBind(Intent intent) {
	return null;
}

@Override
public void onDestroy(){
	if (camera != null) {
		camera.stopPreview();
		camera.release();
		camera = null;
	}
}

}
I hope that this could help. If you decide to push something of this changes to master, please let us know in order to use the CLI again to install the official version of the plugin.
If you think that this could help to improve your plugin , I will be glad to see my name in your  credits section :) . Thanks for this great plugin and we will be in touch.
Have a good day!
Sergio Mejia Silva
<EMAIL_ADDRESS>

@sergio-mejia-tierconnect-com
I haven't had the chance to try your changes as of yet!
Have you had good luck with testing? Also, are you aware of any limitations that this code might have? Should it work with most Android models?
Thanks,
Jason

HI njho,
YES!  With this fix I don't have the issue related to this topic. My 3 devices are working great after that!  Well, I used some past experience from one of my android apps called "shake4help" (https://play.google.com/store/apps/details?id=com.mejidroid.shakeforhelp) , where I use a custom background method to take a picture in background and send this via email (This app is native, not hibrid) but the logic is the same. So, Yes i'm still using the same core of the plugin but I improved few sections to get more devices working. However I paste here in order to have Rahul analyzing this approach and see if this could be used in production (merged in master) with a new version of plugin.
Anyway, I assume that Rahul will validate this, as he is the boss here :)

@sergio-mejia-tierconnect-com Thanks for the code, will you be able to send a pull request. I will be happy to merge the code directly into the main branch, I do not have much devices to test on.

@sergio-mejia-tierconnect-com I'm having the "Redmi note 4". I tried with and without your code in the plugin it still causing the crash when I invoke the camerapicturebackground.
Anything am i missing ?

I'm facying the same problem here, any tips?
This package works on Android 6+?

I guess it will be permission issues to access camera, its been a long time since I checked the plugin. Can you check the error in Android Monitor tool?

Hi Rahul and thanks for the amazing work, it work really nice and do the job (is the really first time that i install a plugin and it work from beginning). I'm trying to collect more that one image at a time (like 2 images with an interval of an half of sec) but the app crash. Do you think that is possible to do that, even have you tried or i'm making mistakes? Is very a great work

Ok there was few problems for specific devices such as Huawei.
I improve the following :

How we are retrieving the supportedPreviewSize to get the better size depending of the device.
Some devices needs to use a handler to wait some miliseconds in order to avoid getting dark images. Thats why I put that custom delay. (After that my picture was Great, not dark as in the afternoon)
I notice that the critical issue that we reported in this issue was caused by the following section:
/*  Commented because it was causing critical error in some devices (i.e. Huawei)
if (params.getSceneMode() != null) {
params.setSceneMode(Parameters.SCENE_MODE_STEADYPHOTO);
}
*/

And the last improve was in the moment when we prepare the preview, I changed to code to use the
"surfaceChanged" instead of surfaceCreated because sometimes we need to depend of the width and height of the surface. (Supporting more devices with this too).
So, well now is working so the class that I changed is CameraSurfacePreview:
package me.rahul.plugins.camerapicturebackground;
@code
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.hardware.Camera.Size;
import android.hardware.Camera.Parameters;
import android.hardware.Camera.PictureCallback;
import android.os.Environment;
import android.os.IBinder;
import android.os.Handler;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.WindowManager;
public class CameraSurfacePreview extends Service {
private static Camera camera = null;
private static String imageName;
private static int camType;
private static String dirName;
private static int rotation;
@Override
public void onCreate() {
    super.onCreate();
}

public int onStartCommand (Intent intent, int flags, int startId){

    imageName = intent.getStringExtra("filename");
    debugMessage("Image Name = "+imageName);
    camType = intent.getIntExtra("camType", 0);
    debugMessage("Camera Type ="+camType);
    dirName = intent.getStringExtra("dirName");
    debugMessage("Dir Name = "+dirName);
    rotation = intent.getIntExtra("orientation", 0);
    debugMessage("Rotation = "+rotation);
    takePhoto(this);
    return START_NOT_STICKY;

}

@SuppressWarnings("deprecation")
private static void takePhoto(final Context context) {

    final SurfaceView preview = new SurfaceView(context);
    SurfaceHolder holder = preview.getHolder();
    // deprecated setting, but required on Android versions prior to 3.0
    holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

    holder.addCallback(surfaceCallback);

    WindowManager wm = (WindowManager) context
            .getSystemService(Context.WINDOW_SERVICE);
    WindowManager.LayoutParams params = new WindowManager.LayoutParams(1,
            1, // Must be at least 1x1
            WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY, 0,
            // Don't know if this is a safe default
            PixelFormat.UNKNOWN);

    // Don't set the preview visibility to GONE or INVISIBLE
    wm.addView(preview, params);
}

static SurfaceHolder.Callback surfaceCallback = new SurfaceHolder.Callback() {

    public void surfaceCreated(SurfaceHolder holder) {

    }

    public void surfaceChanged(SurfaceHolder holder, int format, int width,int height) {
        final CameraPictureBackground cpb = new CameraPictureBackground();
        try {
            camera = Camera.open(camType);
            try {
                camera.setPreviewDisplay(holder);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            Log.d("CordovaLog","SMS optimalSize from param - STARTING!");
            //camera.setDisplayOrientation(rotation);
            Camera.Parameters params = camera.getParameters();
            params.set("orientation", "portrait");
            //params.set("rotation",rotation);
                List<Size> previewSizes = params.getSupportedPreviewSizes();
                Log.d("CordovaLog","preview sizes = "+previewSizes);
             Size optimalSize= getBestPreviewSize(previewSizes,width, height);
                     if(optimalSize!=null){
                        params.setPreviewSize(optimalSize.width, optimalSize.height);
                        Log.d("CordovaLog", "resumed  first sizes "  + width + "height:" + height);
                        Log.d("CordovaLog", "resumed  preview sizes "  + optimalSize.width + "height:" + optimalSize.height);

                     }
            Log.d("CordovaLog", "SMS optimalSize DONE! ");

            params.setJpegQuality(100);
            /*  Commented because it was causing critical error in some devices (i.e. Huawei)
            if (params.getSceneMode() != null) {
                params.setSceneMode(Parameters.SCENE_MODE_STEADYPHOTO);
            }
            */
            List<String> focusModes = params.getSupportedFocusModes();
            if (focusModes.contains(Parameters.FOCUS_MODE_FIXED))
                params.setFocusMode(Parameters.FOCUS_MODE_FIXED);

            params.setRotation(rotation);
            camera.setParameters(params);
             Log.d("CordovaLog", "starting preview ");
            camera.startPreview();
            new Handler().postDelayed(new Runnable() {
              @Override
              public void run() {
                  camera.takePicture(null, null, new PictureCallback() {

                                    @Override
                                    public void onPictureTaken(byte[] data, Camera camera) {

                                        FileOutputStream outStream = null;
                                        File sdDir = Environment
                                                .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
                                        File pictureFileDir = new File(sdDir,dirName);

                                        debugMessage("pictureFileDir = "+pictureFileDir);

                                        if (!pictureFileDir.exists())
                                            pictureFileDir.mkdir();

                                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyymmddhhmmss");
                                        String date = dateFormat.format(new Date());

                                        String filepath = pictureFileDir.getPath()
                                                + File.separator +imageName+"-"+date+".jpg";

                                        File pictureFile = new File(filepath);

                                        try {
                                            outStream = new FileOutputStream(pictureFile);
                                            outStream.write(data);
                                            debugMessage("Picture Saved Successfully");
                                            outStream.close();
                                            cpb.sendJavascript(filepath);
                                        } catch (FileNotFoundException e) {
                                            debugMessage(e.getMessage());
                                        } catch (IOException e) {
                                            debugMessage(e.getMessage());
                                        }
                                        if (camera != null) {
                                            camera.stopPreview();
                                            camera.release();
                                            camera = null;
                                        }
                                    }
                                });
              }
            }, 1000);    //Waiting some time to avoid getting dark pictures in some devices.

        } catch (Exception e) {
            if (camera != null) {
                camera.stopPreview();
                camera.release();
                camera = null;
            }
            Log.d("CordovaLog", "Cannot start preview", e);
            throw new RuntimeException(e);

        }
    }

    public void surfaceDestroyed(SurfaceHolder holder) {
        if (camera != null) {
            camera.stopPreview();
            camera.release();
            camera = null;
        }
    }
};

private static Camera.Size getBestPreviewSize(List<Size> sizes, int width, int height)
 {
          Log.d("CordovaLog", "Entra getBEST "+width+ " "+ height);
         Camera.Size result=null;

         for (Camera.Size size : sizes) {
             if (size.width<=width && size.height<=height) {
                 if (result==null) {
                     result=size;
                     Log.d("CordovaLog", "result is first size "+result);
                 } else {
                     int resultArea=result.width*result.height;
                     int newArea=size.width*size.height;

                     if (newArea>resultArea) {
                         result=size;
                     }
                     Log.d("CordovaLog", "result is second size "+result);
                 }
             }
             else{
                Log.d("CordovaLog", "Else size "+sizes.get(0));
                //result = sizes.get(0);
             }
         }
         if(result==null){
            result = sizes.get(0);
            Log.d("CordovaLog", "WARNING previewSize is Null");
         }

     return result;

 }

private static void debugMessage(String message) {
    Log.d("CameraPictureBackground", message);
}

@Override
public IBinder onBind(Intent intent) {
    return null;
}

@Override
public void onDestroy(){
    if (camera != null) {
        camera.stopPreview();
        camera.release();
        camera = null;
    }
}

}
I hope that this could help. If you decide to push something of this changes to master, please let us know in order to use the CLI again to install the official version of the plugin.
If you think that this could help to improve your plugin , I will be glad to see my name in your credits section :) . Thanks for this great plugin and we will be in touch.
Have a good day!
Sergio Mejia Silva
<EMAIL_ADDRESS>
thank you men

@paredesivan Does it work with Android 6 and above? If yes, then can you please send a pull request?


VARCHAR with character Ñ is not returning results

Hi there!
I have a question about cast the type in named parameters to package's VarChar type.
Why if my username contains a Ñ (spanish character) and it is send as VarChar in the named parameter is not returning results?
Here is a sample of my code:
qerr := dataSource.SearchUserDataStatement.QueryRow(sql.Named("LoginID", mssql.VarChar(userID))).Scan(...)
In SQL table the type for the field is VARCHAR.
If I send the non-cast string the query takes to long to resolve, because SQL Server cast the type for execute the query, but it's resolved. In any other case the query performance is fast with the same type cast.
And the parameter is string with the value otoño
Any comment is helpful!
Thanks!

@jpcoronar I'll try and reproduce this issue.

@chris-rossi could you reproduce the issue?
I've been trying to solve and debug that, but i can't find the solution.
I urgently need to solve it.
Thank you for your help.

Hi @jpcoronar, I've reproduced the issue and I'm trying to track down where it is failing to encode correctly.

@jpcoronar as a workaround could you try using string() instead of mssql.Varchar() the driver will treat this as a NVarchar which will respect the character encoding. I am still looking into a way of getting this working using the drivers mssql.Varchar type.

Hi, @chris-rossi.
First of all, thank you for you effort to solving the issue!
As I commented before, the string() casting reduces the performance drastically
With the mssql.VarChar type the result is following:

With string() cast type the time is higher

Is there another method to temporarily solve this?
Thank you so much!

Hi, @ chris-rossi. Sorry for the insistence :(
Is any news for the issue?
Thank you for your help!

Hi @jpcoronar, sorry for the slow progress, I'm still trying to figure out the cause of the issue, I'm hoping to have some news soon.


AuthenticationError when Using Tree of Thoughts with OpenAI's API

Hello,
I'm attempting to use your Tree of Thoughts (ToT) library in conjunction with OpenAI's API, but I'm encountering an issue with authentication. When I try to instantiate either the OpenAILanguageModel or OptimizedOpenAILanguageModel class with my API key, I get the following error:
openai.error.AuthenticationError: <empty message>
This is confusing because when I use the same API key in a standalone script to call OpenAI's API directly, it works perfectly fine.
Here's the relevant part of my code (with the API key redacted):
from tree_of_thoughts import OpenAILanguageModel, TreeofThoughts

api_key = "my-api-key"  # redacted
model = OpenAILanguageModel(api_key)
tree_of_thoughts = TreeofThoughts(model, "BFS")

Do you have any idea why this might be happening, or suggestions for how I could troubleshoot this issue? Your guidance would be greatly appreciated.
Thank you in advance for your help.
Best Regards,
Dennis

issue is in the treeoflife.py file his example script is also there.

@Gumbu

issue is in the treeoflife.py file his example script is also there.

You mean treeofthoughts.py.
But it works when I run treeofthoughts.py with example in it.
Thank you very much!

Ok the problem was inside of  init.py of /tree_of_thoughts directory.
This file should contain the following code:
from .treeofthoughts import TreeofThoughts, CustomLanguageModel, OptimizedOpenAILanguageModel, OptimizedTreeofThoughts


feat: Added method Images.ready()

Description
Added method Images.ready() to await for all images that are currently loading. For example, this allows the user to write
@override
Future<void> onLoad() async {
  images.load('sprite1.png');
  images.load('sprite2.png');
  ...
  images.load('something-else.png');
  await images.ready();
}

In addition, multiple small improvements to the Images class:

Renamed private field _loadedFiles -> _assets, which reflects the fact that this map also contains images that have not been loaded yet.
Added a second constructor for _ImageAsset that does not require a future.
Improved doc-strings for several methods.
Added private method _ImageAsset.dispose() for more thorough disposal: now if there is a pending future to load the image, that image will get disposed as well when the future completes.
Better error message in Images.fromCache(): now it distinguishes between image not added to the cache, or image added but not loaded yet.
When an images finishes loading, its _future will be garbage-collected, leaving only the image behind.

Checklist

[x] The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
[x] I have read the Contributor Guide and followed the process outlined for submitting PRs.
[x] I have updated/added tests for ALL new/updated/fixed functionality.
[x] I have updated/added relevant documentation in docs and added dartdoc comments with ///.
[-] I have updated/added relevant examples in examples.

Breaking Change

[x] No, this is not a breaking change.

Related Issues

Can't you just use loadAll for this? eg
@override
Future<void> onLoad() async {
  await images.loadAll('sprite1.png', 'sprite2.png', 'something-else.png');
}

Can't you just use loadAll for this?

You can. But that requires all images to be loaded up-front from a single place, whereas it could be more convenient to split loading into multiple parts. So, images.ready() is more of a convenience method rather than solving any insurmountable obstacle.

You can. But that requires all images to be loaded up-front from a single place, whereas it could be more convenient to split loading into multiple parts. So, images.ready() is more of a convenience method rather than solving any insurmountable obstacle.

loadAll does not required them to be loaded up-front, yes you can use it to load a list of images right there and then but you can also use it to ensure they are loaded, even if they were loaded somewhere else first.
But I get that it might feel bit strange to use it like that. But I dont think this is the way to go either. ready will wait for all loads, even for images that are being loaded on different components than your own, which might be a valid use-case but that really sounds more like a niche than a feature.
Also I think the name ready isn't the right name for what it does, it indicates to me that it means the ImageAssets is ready for use but it isn't about him but instead about the images it can potentially contain. And because ready waits for all the images that it currently has, there could still be other images loading from a different component that gets added a fraction later. So then it never really was "ready" (I know that is just semantics but I am a firm believer that semantics matter haha).
It is more of a areAllImagesThatIHadThisVeryMomentLoaded? method which as I mentioned before can also be done with loadAll, with the added benefit that you can specific which images with the loadAll.

One problem with loadAll() is that it requires knowing the names of all images you need to load, which breaks encapsulation. For example, consider the following pattern:
Future<void> onLoad() async {
  add(Background());
  add(Player());
  add(Enemy());
  add(Hud());
  await images.ready();
}

Here the Background class knows the name of the image used for the background, and Player class knows the path to the player-related images, and so on. Each of those classes would only schedule loading of the corresponding resource, and then a single await at the end of the Game.onLoad would ensure that those images are all ready to be used.

Also I think the name ready isn't the right name for what it does, it indicates to me that it means the ImageAssets is ready for use but it isn't about him but instead about the images it can potentially contain.

You're right that if we think of Images class as an entity per se, then .ready() is not guaranteed to make that class "ready". However, if you think about the class as a simple "bag of images", where only the images are important and not the "bag" itself, then images.ready() makes sense: it means "make all current images ready". The fact that there may be some other images added into the same bag in the future is not relevant: you're simply taking the current set of images and readying them.


Provide a preemption example

Sample code that showcases how an action should deal with being preempted.

Done in b194c37


add string util class

follow your opinion Can we use StringUtils method for this?

I'm really sorry I wasn't clear, I meant using org.apache.commons.lang3.StringUtils instead of implementing this yourself.

I'm going to close this without merging, we can look at using org.apache.commons.lang3.StringUtils to replace some of the string parsing logic.


sed: can't read Makefile.am: No such file or directory

Output of sudo edit-chroot -all:
name: jammy
encrypted: no
Entering /mnt/stateful_partition/crouton/chroots/jammy...
crouton: version git
release: jammy
architecture: amd64
targets: xfce
host: version 15329.44.0 (Official Build) stable-channel octopus
kernel: Linux localhost 4.14.254-20279-gdb10dc132e24 #1 SMP PREEMPT Tue Mar 7 19:24:51 PST 2023 x86_64 x86_64 x86_64 GNU/Linux
freon: yes
Unmounting /mnt/stateful_partition/crouton/chroots/jammy...

I keep getting this error when trying to install a chroot:
sed: can't read Makefile.am: No such file or directory

See: Figure out a way to build audio target now that autotools is removed #4958


Like/Comments Post

Creating Posts Works well but users aren't able to like and comments on Posts and also aren't able to see Who liked The Posts, The functions is done From Erlang and Elixir Clients So Devs can directly call like_post(userID, postID) from Clients and working on LiveView, same for Comments:  add_comment(author, postID, content)
get_all_comments(postID)
get_likes(likeID)

Hi @jaeyson @ioavv is someone already working on this one? If none, I'll start working on this one.

@pau-riosa I haven't started yet.

thank you @jaeyson


refactor: rework the animation frames

I has change the bomb and using array of string instead of multiline string
I also add code that put the animation in the bottom center of the terminal window
Also I left the mushroom there instead of clearing it I think about this because of sl
In conclusion, I hope you appreciate this PR (I forgot to mention I crank up the speed a little bit)

Do you mind providing a PR to the testing branch? I'll do a test build locally and see how things go. Thanks for the PR, I appreciate any help I can get!

Okay thanks for the instruction hope I didn't disrupt anything

Okay thanks for the instruction hope I didn't disrupt anything


Quest Helper Log on Galvek covers whole screen

We actually neeed to be able to see the chat box. Perhaps don't let the plugin cover the entire screen. Makes no sense. Make it wider, not longer.

You can choose how wide it is @bdixon95 by dragging it out. I can't control that. I will make the on-screen text reduced though as many people don't know they can alt-drag the size of it though.


Check if file exists before considering it for report merges

Closes #1757, Closes #1685

Have you been able to reproduce #1757? Is there a valid case in which the report file does not exist?
I hope I find some time to investigate.


Bug fix: DoneTaskCommand undo/redo

Bugfix for not being able to redo done task.
Issue lied in the fact that this.execute() in undo() calls super.canExecute(), which negates its previous super.canUndo().
Changed it such that it does not call this.execute().

Codecov Report

Merging #133 (01a56d8) into master (7f739b6) will decrease coverage by 0.20%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master     #133      +/-   ##
============================================
- Coverage     58.41%   58.21%   -0.21%
  Complexity      599      599
============================================
  Files           121      121
  Lines          2561     2570       +9
  Branches        251      252       +1
============================================
  Hits           1496     1496
- Misses          975      984       +9
  Partials         90       90

Impacted Files
Coverage Δ

...u/address/logic/commands/task/DoneTaskCommand.java
57.14% <0.00%> (-19.79%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f739b6...01a56d8. Read the comment docs.


Do not save JSON summaries by default

If --json_summary_folder arg is not specified, the JSON summary files will be saved to the default folder "json-summary" by default.
When we run the test for the second time, we detect if the json_summary folder has any files inside, if so, the code will raise an exception to protect those existed summaries.
Some users complain it's really annoying and they don't need those summary files.
Also when running Throughput Test, if this json_summary argument is not specified differently, the run will fail due to duplicated summary folder name.

Since our CI jobs specify --json_summary_folder always, we can simply modify the script that don't save JSON summary when not setting --json_summary_folder. It won't impact the CI.


Problem with two identical values in chart

I have found that when I generate charts, if only one set of data is used, two points are selected, but the figures are the same, the chart doesn't generate. Example:
var lineChartData = {
labels : ["01-01-2014","01-02-2014"],
datasets : [
{
fillColor : "rgba(0,132,255,0.5)",
strokeColor : "rgba(0,132,255,0.9)",
pointColor : "rgba(0,132,255,0.9)",
pointStrokeColor : "#fff",
data : [121130.21,121130.21]
}
]
	}

	var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Line(lineChartData);

Whereas 3 months with a variance of quantity will produce a working line chart. I have run this code both within a project I am working on, and with just the bare essentials and it doesn't generate correctly.

Whereas, Adding another item to the chart seems to fix the line not working.

This seems to be fixed in the latest version. But if you are still seeing this problem, please add a test case and reopen.


Backend broadcast 2

for broadcasting a*b, with a  a 1d vector, and b a matrix (eq. to np.diag(a).dot(b))

Weird. I'm not seeing any changes...

forgot to commit the changes ...

Once this is in you can check #506 .


Ports the SM

About the PR
Adds the SM from pre 2021 tg.

[X] Supermatter Graphics
[X] Supermatter Atmos
[X] Basic Supermatter Interactions(Radiation,Delam,Dusting)
[ ] Every Station has a Supermatter Layout

Media

[X] I have added screenshots/videos to this PR showcasing its changes ingame

https://user-images.githubusercontent.com/33989683/231009792-cbc45146-285e-4fed-a440-77182cd2385d.mp4
Sources
general source:https://github.com/tgstation/tgstation/blob/6c01cc2c010c8dc15c5500434ae8e55261511781/code/modules/power/supermatter/supermatter.dm
stepstone PR:https://github.com/space-wizards/space-station-14/pull/7908
Changelog
:cl: - add: Beloved SM

Don't forget to put things in an AtlasStation folder for modularisation.


Ramda does not work with snowpack

After installing ramda I get the following error in snowpack:
[snowpack] Package "ramda" exists but package.json "exports" does not include entry for "./src/forEach".

Some dependency of mine is using ramda and I'm trying to locate the issue. Will elaborate here if I find out anything.

This is an issue with the consumer of ramda, not with ramda itself

I did some debugging and the issue was caused by the html-to-react package. It does however use Ramda as you have documented in the readme:
import identity from 'ramda/src/identity'

identity()

So this is indeed an issue with Ramda and it will be a problem when using Ramda with import maps. Either the documentation should be changed to use .js or the exports-field should be updated to include each sub-package.
const fs = require('fs')
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'))
fs.readdirSync('./src').forEach(f => pkg.exports[`./src/${f.replace(/\.js$/, '')]`] = f)
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2))

Sorry for closing and opening this issue so many times. My brain is a bit fried from trying to migrate from Webpack to a faster bundler.

Either the documentation should be changed ...

import identity from 'ramda/src/identity'

is IMO an unfortunate choice to document tree-shaking for Ramda. Regarding the current "exports" in package.json, that statement violates ES6 module spec and thus gives an ERR_MODULE_NOT_FOUND error.
Not being an expert in tree-shaking, I'd vote for changing it to
import {identity} from 'ramda';

which works for Rollup.
I guess
import identity from 'ramda/src/identity.js'

would work too, but is too wordy and impractical.

... or the exports-field should be updated to include each sub-package

I would not recommend that, because package.json needs to be kept human-readable.

Having a similar issue over at https://github.com/lo1tuma/eslint-plugin-mocha/issues/322 when they upgraded to 0.28.0.

So is this something we can just fix by updating the README?  Or is there more that we have to do?

Isn’t this a duplicate of #3236?


Update BLEURT hyperlink

The description of BLEURT on the hf.co website has a strange use of URL hyperlinking. This PR attempts to fix this, although I am not 100% sure Markdown syntax is allowed on the frontend or not.

Hi @lewtun. Thanks for noticing that issue.
Unfortunately, the frontend does not support Markdown (at least for /metrics); see: https://huggingface.co/metrics/bertscore
I wonder whether:

another syntax for links is supported (reStructuredText, HTML,...)
or support for Markdown should be implemented, as it is already the case for /datasets; see: https://huggingface.co/datasets/speech_commands#dataset-summary

CC: @julien-c @SBrandeis @Pierrci ...

seems like a very very low-prio improvement :)

@albertvillanova thanks for the feedback! I removed the formatting altogether since I think this is a bit simpler tor read than non-rendered Markdown


Link to MDX in README

I wasn't familiar with MDX, and I think many others reading this might not be.
Description
Added a link to MDX to the README.
I wasn't familiar with MDX, and I think many others reading this might not be.
Review

[ ] Check the copy

I like it, it's just an additional information, not really necessary but it might help someone.

When I read MDX I didn't know what it was, so I googled it. Having this link there might save the next person a few seconds because they don't have to Google, but it's  up to you whether you want to add it or not.


Strange macro behavior

Here's the definition of the macro:
qa
^
cf[
i $headers->set(
esc
f]
cf=
,
esc
$
i )
esc
j
q

Here's the code I'm running it on:
  $res['Content-Disposition'] = 'attachment; filename="'. $filename .'"';
  $res['Content-Length'] = '' . filesize($file);
  $res['Content-Range'] = '';
  $res->setBody(file_get_contents($file));

And here's what happens when I go to run the macro:

This seems really unintuitive to me - I don't believe I did anything wrong, macro-definition-wise. Though certainly correct me if I did - I am, at best, at amateur vim user (vimmer? vimolyte?).
EDIT:
This is on OS X 10.9 (not Yosemite), using Brackets Release 1.2 build 1.2.0-15697 (release 8f82e2a97) -- the most up-to-date version of Brackets, so far as I am aware -- and the most recent version of vimderbar as well.

I'm not sure if the macro is correct for what you want to do, but all of the core vim functionality including macro recording is provided by CodeMirror, check their vim demo (http://codemirror.net/demo/vim.html) and see if the macro works properly there. If it doesn't, then it is likely a bug in CodeMirror vim.


Change WebSocket abstraction

At the moment, this lib uses the isomorphic-ws package to build an abstraction around WebSocket. This is because the browser and Node.js use different objects for this.
For some reason, we see problems around this from time to time, e.g. https://github.com/fmalcher/soundcraft-ui/issues/153
An idea is to remove the abstractions and let the users of this library decide which WebSocket object they want to use.
On the one hand, this makes it a bit more difficult to use the library, on the other hand there is less magic happening under the hood. For special environments, this will give users full control over the WebSocket object, and the library will not have to handle each and every special use-case.
WebSocket could be the default object there, e.g. like this:
// browser
new SoundcraftUi(ip)

// browser
new SoundcraftUi(ip, WebSocket)

// Node.js
const ws = require('ws');
new SoundcraftUi(ip, ws);

export class SoundcraftUi {
  constructor(targetIp: string, wsCtor?: any) {
    // ...
    // apply default
    if (!wsCtor && typeof WebSocket !== 'undefined') {
      wsCtor = WebSocket;
    }
  }
}

What about this package instead?
https://github.com/JoCat/modern-isomorphic-ws

Not sure if this would be an improvement over the original one, and I had to mention it seems less known in comparission.
But still isomophic-ws has some years without activity anyway.

Let's give it a try!I don't think this will solve the problem you had in #153, but modern-isomorphic-ws looks a bit cleaner.
I also made it possible to configure the WebSocket constructor at initialization. I will try and see whether this solves your problem.

Yay! The other package seems to have solved the problem in your project 🥳
I have no idea why because the two packages do basically the same – but it works!
However, I will keep the option to provide an individual WebSocket constructor, just in case.

Well … the downside is that it doesn't seem to work in Node.js anymore 😬


Renaming the library to wannier90io

As discussed during the 2023 Wannier meeting

I agree about renaming the package to wannier90io for clarity. Does it make sense to use the following import statement?
import wannier90io as w90io


Stream.fromIterable(things).asyncMap(convert) Missing elements in the list.

Steps to Reproduce

Info
Value

Platform Name
flutter

Platform Version
3.0.5

Xcode Version
Xcode 13.2.1

Demo project link
link to the demo project that highlights the issue

Issue Description and Steps
I am trying to use a Stream.fromIterable(things).asyncMap(convert);
Future<TouchPoints?> convert(TouchPoints? thing) async {
    await Future.delayed(const Duration(milliseconds: 2));
    // changing the delay for function does affect the
    // accuracy of painter results.
    // set this to 5 milliseconds and then there will be a smooth line, which is not required here.
    // set this to 25 milliseconds, or more, and then there will be a dotted line of x = y.

    return thing;
  }

  Stream<TouchPoints?> doStuff(List<TouchPoints?> things) {
    return Stream.fromIterable(things).asyncMap(convert);
    // This asyncMap seems to be the culprit here, My Guess!...
  }

This returned stream is used to stream points, used along with a custom painter.
Expected results:
When used with Future.delayed(const Duration(milliseconds: 25));, or greater than 25 milliseconds, the results are as expected. See picture below:

Actual results:
The issue here is that with Future.delayed(const Duration(milliseconds: 2));, stream snapshot.data doesn't returns the complete array thus we see results like:

Note*: Here, i am guessing asyncMap is missing the data, or might be some other issue.

Code sample

import 'dart:async';

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  MyApp({Key? key}) : super(key: key);

  List<TouchPoints?> records = [];

  @override
  Widget build(BuildContext context) {
    for (int i = 0; i < 25; i++) {
      records.add(TouchPoints(
          points: Offset((i + 1) * 5, (i + 1) * 5),
          paint: Paint()
            ..strokeCap = StrokeCap.round
            ..color = Colors.red
            ..strokeWidth = 5));
      records.add(null);
      // adding null points after each point to make a dotted line.
    }
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: DrawingWidget(rec: records),
    );
  }
}

class DrawingWidget extends StatefulWidget {
  const DrawingWidget({Key? key, required this.rec}) : super(key: key);

  final List<TouchPoints?> rec;

  @override
  State<DrawingWidget> createState() => _DrawingWidgetState();
}

class _DrawingWidgetState extends State<DrawingWidget> {
  _DrawingWidgetState();
  List<TouchPoints?> drawPoints = [];

  @override
  Widget build(BuildContext context) {
    print('Building drawing widget');
    drawPoints = [];

    return SafeArea(
      child: Scaffold(
          body: SizedBox.expand(
              child: ClipRRect(
                  borderRadius: const BorderRadius.all(Radius.circular(20)),
                  child: StreamBuilder<TouchPoints?>(
                      stream: doStuff(widget.rec),
                      builder: (context, snapshot) {
                        if (snapshot.connectionState ==
                            ConnectionState.active) {
                          drawPoints.add(snapshot.data);
                        }
                        return CustomPaint(
                            size: Size.infinite,
                            painter: SignaturePainter(
                              points: drawPoints,
                            ));
                      })))),
    );
  }

  Future<TouchPoints?> convert(TouchPoints? thing) async {
    await Future.delayed(const Duration(milliseconds: 25));
    // changing the delay for function does affect the
    // accuracy of painter results.
    // set this to 5 milliseconds and then there will be a smooth line, which is not required here.
    // set this to 25 milliseconds, or more, and then there will be a dotted line of x = y.

    return thing;
  }

  Stream<TouchPoints?> doStuff(List<TouchPoints?> things) {
    return Stream.fromIterable(things).asyncMap(convert);
    // This asyncMap seems to be the culprit here, My Guess!...
  }
}

class SignaturePainter extends CustomPainter {
  List<TouchPoints?> points;

  SignaturePainter({required this.points});
  @override
  void paint(Canvas canvas, Size size) {
    for (int i = 0; i < points.length - 1; i++) {
      if (shouldDrawLine(i)) {
        canvas.drawLine(
            points[i]!.points!, points[i + 1]!.points!, points[i]!.paint!);
      } else if (shouldDrawPoint(i)) {
        canvas.drawCircle(points[i]!.points!, points[i]!.paint!.strokeWidth / 2,
            points[i]!.paint!);
      }
    }
  }

  bool shouldDrawPoint(int i) =>
      points[i]?.points != null &&
      points.length > i + 1 &&
      points[i + 1]?.points == null;

  bool shouldDrawLine(int i) =>
      points[i]?.points != null &&
      points.length > i + 1 &&
      points[i + 1]?.points != null;

  @override
  bool shouldRepaint(SignaturePainter oldDelegate) {
    return true;
  }
}

class TouchPoints {
  Paint? paint;
  Offset? points;
  String? command;

  TouchPoints({this.points, this.paint, this.command});
}

Hi @Mo5hu, Thanks for filing the issue. I am quite not sure if it is really a bug. I am seeing a different output for each build, Perhaps this is dependent on the build. Labeling for further insights from the team.

code sample
import 'dart:async';

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: DrawingWidget(),
    );
  }
}

class DrawingWidget extends StatefulWidget {
  const DrawingWidget({Key? key}) : super(key: key);

  @override
  State<DrawingWidget> createState() => _DrawingWidgetState();
}

class _DrawingWidgetState extends State<DrawingWidget> {
  _DrawingWidgetState();
  List<TouchPoints?> drawPoints = [];
  List<TouchPoints?> records = [];

  @override
  Widget build(BuildContext context) {
    drawPoints = [];
    return SafeArea(
      child: Scaffold(
          body: SizedBox.expand(
              child: ClipRRect(
                  borderRadius: const BorderRadius.all(Radius.circular(20)),
                  child: StreamBuilder<TouchPoints?>(
                      stream: doStuff(),
                      builder: (context, snapshot) {
                        if (snapshot.connectionState ==
                            ConnectionState.active) {
                          drawPoints.add(snapshot.data);
                        }
                        return CustomPaint(
                            size: Size.infinite,
                            painter: SignaturePainter(
                              points: drawPoints,
                            ));
                      })))),
    );
  }

  Stream<TouchPoints?> doStuff() {
    for (int i = 0; i < 25; i++) {
      records.add(TouchPoints(
          points: Offset((i + 1) * 5, (i + 1) * 5),
          paint: Paint()
            ..strokeCap = StrokeCap.round
            ..color = Colors.red
            ..strokeWidth = 5));
      records.add(null);
      // adding null points after each point to make a dotted line.
    }
    return Stream.fromIterable(records).asyncMap((x) async {
      await Future.delayed(const Duration(milliseconds: 2));
      return x;
    });
    // This asyncMap seems to be the culprit here, My Guess!...
  }
}

class SignaturePainter extends CustomPainter {
  List<TouchPoints?> points;

  SignaturePainter({required this.points});
  @override
  void paint(Canvas canvas, Size size) {
    for (int i = 0; i < points.length - 1; i++) {
      if (shouldDrawLine(i)) {
        canvas.drawLine(
            points[i]!.points!, points[i + 1]!.points!, points[i]!.paint!);
      } else if (shouldDrawPoint(i)) {
        canvas.drawCircle(points[i]!.points!, points[i]!.paint!.strokeWidth / 2,
            points[i]!.paint!);
      }
    }
  }

  bool shouldDrawPoint(int i) =>
      points[i]?.points != null &&
      points.length > i + 1 &&
      points[i + 1]?.points == null;

  bool shouldDrawLine(int i) =>
      points[i]?.points != null &&
      points.length > i + 1 &&
      points[i + 1]?.points != null;

  @override
  bool shouldRepaint(SignaturePainter oldDelegate) {
    return true;
  }
}

class TouchPoints {
  Paint? paint;
  Offset? points;
  String? command;

  TouchPoints({this.points, this.paint, this.command});
}

flutter doctor -v (mac)
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-IN)
    • Flutter version 3.0.5 at /Users/mahesh/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (5 days ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-32, build-tools 33.0.0-rc4
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.67.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.44.0

[✓] Connected device (3 available)
    • sdk gphone arm64 (mobile) • emulator-5554 • android-arm64  • Android 11 (API 30) (emulator)
    • macOS (desktop)           • macos         • darwin-arm64   • macOS 12.4 21F79 darwin-arm
    • Chrome (web)              • chrome        • web-javascript • Google Chrome 103.0.5060.114

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

[✓] Flutter (Channel master, 3.1.0-0.0.pre.2009, on macOS 12.4 21F79 darwin-arm, locale en-IN)
    • Flutter version 3.1.0-0.0.pre.2009 on channel master at /Users/mahesh/Documents/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9d96c7b8be (3 days ago), 2022-08-01 00:39:06 -0400
    • Engine revision cf0db3e546
    • Dart version 2.19.0 (build 2.19.0-49.0.dev)
    • DevTools version 2.16.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-32, build-tools 33.0.0-rc4
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13C100
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.69.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.46.0

[✓] Connected device (3 available)
    • sdk gphone arm64 (mobile) • emulator-5554 • android-arm64  • Android 11 (API 30) (emulator)
    • macOS (desktop)           • macos         • darwin-arm64   • macOS 12.4 21F79 darwin-arm
    • Chrome (web)              • chrome        • web-javascript • Google Chrome 104.0.5112.79

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Hi @Mo5hu, Thanks for filing the issue. I am quite not sure if it is really a bug. I am seeing a different output for each build, Perhaps this is dependent on the build time. Labeling for further insights from the team.
code sample
flutter doctor -v (mac)

Thanks for Labeling further insights


VerbFilter - "Trying to get property of non-object"

What steps will reproduce the problem?
class ManageController extends CommonController
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

   // ****
   public function actionDelete()
   {
       // ***
   }
}

What is the expected result?
PHP Notice – yii\base\ErrorException
Trying to get property of non-object

in /var/www/crmisk/src/crmisk/vendor/yiisoft/yii2/filters/VerbFilter.php at line 90

What do you get instead?
Additional info

Q
A

Yii version
<IP_ADDRESS>

PHP version
7.1

Operating system
RH6

Can not reproduce.


Release Github Action

Adds automated release creation (including binaries) on tag push using github action and  goreleaser.
NOTE:
You would need to add your PERSONAL_GITHUB_TOKEN as a new Repository Secret (Settings > Secrets and Variables > Actions).

Thanks for this - at this point, we're working out whether we do want to pre-build binaries, as our official recommendation is to use the source distribution with go run.
We'll try and have a look at it again at some point, but unfortunately this is low on our priority list.
Also, for full disclosure, something we're considering but have not at all decided on is whether this may be a paid feature, to help make the project more sustainable if companies require a pre-built binary distribution


Ndex2 changes host if 'localhost' in host name

The constructor of ndex2.client.Ndex2 incorrectly changes the value of host parameter if localhost is in the value to http://localhost:8080/ndexbio-rest which is non-intuitive and problematic if one has a local instance of NDEx.

Fixed in chrisdev branch with commit  bafe850..16b04a6  chrisdev -> chrisdev


Testcontainers.MsSql Returns Docker Error about Conflict During Integration Tests

Testcontainers version
3.6.0
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host arch
x86
.NET version
7
Docker version
Client:
 Cloud integration: v1.0.35+desktop.10
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:02 2024
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Desktop 4.27.2 (137060)
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:14:25 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Docker info
Client:
 Version:    25.0.3
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1-desktop.4
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.5-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  debug: Get a shell into any image or container. (Docker Inc.)
    Version:  0.0.24
    Path:     C:\Program Files\Docker\cli-plugins\docker-debug.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.21
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     C:\Program Files\Docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.0.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.4.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 3
  Running: 2
  Paused: 0
  Stopped: 1
 Images: 5
 Server Version: 25.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.6.12-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 1.92GiB
 Name: docker-desktop
 ID: 390214ef-1e7b-4ca6-87f7-359cd0ff84d2
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  <IP_ADDRESS>/8
 Live Restore Enabled: false

WARNING: daemon is not using the default seccomp profile

What happened?
I develop on a laptop and desktop using the same repository, but Testcontainers.MsSql has a fail rate of about 95% on the desktop, while a 100% success rate on the laptop. The error I get on my desktop for all my tests is:
Docker.DotNet.DockerApiException : Docker API responded with status code=Conflict, response={"message":"container 181ed4bbfa292f8cbf9a6f17cf7abada437af1ea37eb9f810150c18c83ded3d1 is not running"}
However, while I watch Docker Desktop, I can see images/containers starting up and stopping in what seems like a normal fashion. I have Docker Desktop 4.27.2 on my desktop and 4.27.1 on my laptop.
I've seen other issues asking for enabling logs but I haven't discovered how to enable them yet.  My code in a derived WebApplicationFactory<T> is simply:
private readonly MsSqlContainer msSqlContainer =
	new MsSqlBuilder()
		.Build();

public virtual async Task InitializeAsync()
{
	await msSqlContainer.StartAsync();
}

Any ideas of why the Desktop mostly doesn't work?  Let me know if there is more information I can provide.  (FYI, posted similar question on Stackoverflow and got close votes, not sure why, hoping it is because they want it here).
Relevant log output
No response
Additional information
No response

Could you please share the actual container logs? The logs contain the reasons why the container suddenly exited.

It looks like your Docker VM only provides 2GB of RAM. According to the docs this might not be enough.

At least 2GB of RAM (3.25 GB prior to 2017-CU2). Make sure to assign enough memory to the Docker VM if you're running on Docker for Mac or Windows.

It looks like your Docker VM only provides 2GB of RAM. According to the docs this might not be enough.

Great eye.  This fixed it, thanks a lot.  In case I ever have problems in the future, where are these:

Could you please share the actual container logs? The logs contain the reasons why the container suddenly exited.

In case I ever have problems in the future, where are these:

Either use the Docker CLI command docker container logs or access them by selecting the container in Docker Desktop and opening Logs in the top menu bar.

Since the issue seems to be resolved, I will close it in the meantime. If you have further questions, do not hesitate to reopen it again.


Text composables: Android Basics with Compose

URL of codelab
In which task and step of the codelab can this issue be found?
Describe the problem
Steps to reproduce?

Go to...
Click on...
See error...

Versions
Android Studio version:
API version of the emulator:
Additional information
Include screenshots if they would be useful in clarifying the problem.

Hi @anubhav5678
As you did not provide any information regarding your issue, I am unable to assist you further.
If you are still having an issue, please do not hesitate to create a new issue and provided at least the requested information.
Hope you are enjoying the course!
Regards.


Disable unwired

Closes #841

Coverage remained the same at 87.231% when pulling f75ab23ec10072116d67ffd5376d5b28d4463765 on na3d:disable-unwired into aea2be37461074447596af690f43533254cee47e on linode:master.

Disabled

Search
Open Glish
Add IP buttons
Rescue Reboot


Tracker Remove Request

This game gained great popularity these days. For users' privacy, would you like to remove Cloudflare Web Analysis?
This issue is purely a piece of advice. The choice is up to you since you are the developer and ought to have such right.

@VickScarlet Could you give a clear answer? Thanks in advance.

It seems that the developer ignores this issue and refuses to remove trackers. The issue will be closed.


Check that given domain resolves to droplet IP before going on with the script

We now check if the domain resolves

Very cool! 👍


Support native interface for the return value of doc.getRootObject ()

Solved by https://github.com/yorkie-team/yorkie-js-sdk/pull/8.