text:
Interactive Visualization generated after 3 hours but cell assignment continues to run (4 cores and maxloop NOT zero)

Hi Jun,
Thanks for all your feedback in previous posts. So full disclaimer: I did NOT set maxloops to 0 (intentional) and I only used 4 cores (mistake), so I know this increases runtime. I have about 40,000 cells. The prerun results were unexpected, and not all populations I would have previously observed through Leiden-based clustering appeared in the final tree, this is why I was interested in PGM refinement.
The question is - is it normal for the interactive tree to appear before all cells are assigned? The interactive tree file appeared after about 3 hours but cell assignment is still running now >48 hours.

@paraish
YOu can check the runninglog.txt
It records the increase of the likelihood. The default cutoff is very strigent (1%).
After the first 1 loop, you will see the interactive tree.
But it will keep improving the graph until the convergence condition is met.
Here is an example running log.
The program starts at : 2020-07-05 07:18:23.853302
    The program runs with the following arguments

    $scdiff2
    -i example_out/example.E.h5ad
    -o example_out
    -t Human_TF_targets.txt
    --etfListFile None
    --log2fc 0.6
    --ncores 10
    --root None
    --llhCut 0.02
    --maxloop 5

reading cells ...
clustering cells ...
building graph(tree) ...
likelihood: -1334.8432584323705
->loop: 0
likelihood: -1272.6148271035117 -> likelihood increase this loop: 0.04661853062953572
updating the javascript powered visualization file (example.E.h5ad.html) under the InteractiveViz folder
->loop: 1
likelihood: -1196.0434282645167 -> likelihood increase this loop: 0.0573635880881774
updating the javascript powered visualization file (example.E.h5ad.html) under the InteractiveViz folder
->loop: 2
likelihood: -1196.0434282645167 -> likelihood increase this loop: 0.0
The stopping criteria is met, quit the loop

 Updating the PGM refined clustering (UMAP), trajectory (PAGA), and DE genes plots
writing the results to a example_out/example.E.h5ad file ...
job completed!
The program ends at : 2020-07-05 07:27:40.897923

You can increase the --llhCut to 0.05 or even 0.1, which will converge much faster.
Can you copy the running log here, I will take a look of your case?  48 hours seems too long even for 4 cores.

@paraish
what is your last likelihood increase in your runninglog.txt file?

Thanks Jun,
The log actually hasn't been updated since yesterday. (Also, I guess it's only been 45 hours...) Here it is:
runninglog.txt

@paraish
For your comment
"The prerun results were unexpected, and not all populations I would have previously observed through Leiden-based clustering appeared in the final tree"
If this is the case, the PGM refinement will not solve your issue. As the PGM refinement will not "generate" new clusters, it only adjusts the cell assignment to "existing" clusters inferred from the pre-run.   Some clusters may disappear if all its cells got re-assigned to other clusters. But, it won't generate new clusters.   The pre-run also utilized the leiden-based clustering, which should be similar to your results. If you believe your clustering is good,  you can directly run scdiff2 on your clustering result (just prepare your clustering in h5ad format) and skipped the rerun.    If you used scanpy to get your clusuters, it would be easy, you can directly export your results to h5ad format. If not, I will write a script to help users prepare their clusters into the h5ad format.
For your running,
It seems that it was stuck on the loop 1.
I tested on an example dataset with a similar size, it completed in a few hours on my desktop (with --ncores 10 through).
45 hours are way too long.    Do you have enough memory (>16gb at least)?  I have 32Gb for the testing example.
I would suggest the following:
(1) update scdiff2 and make sure that you are using the latest version (i made some changes in the past week).
(2) rerun the program with --ncores 10 or even 12 (if you have 32G ram)
If you are running it on a cluster, you can try to use more cores, which will significantly reduce the running time.

Thanks Jun. I have 64gb of RAM and 8 physical cores but I think with hyperthreading up to 16. I have reinstalled scdiff2. I will rerun the program and see.
Is it possible for users to adjust the Leiden resolution that scdiff2 uses?
Thanks,
Paraish

@paraish
Sure,  good idea, Hold on, I add that parameter.
I will push soon.

@paraish
I just added a parameter --cluRes and pushed it to the github.
This parameter specifies the resolution for the leiden clustering function.
By default, it was set as 1. You can increase # of clusters by specifying a larger value. (or decrease with a smaller value).   Now, you can update your prerun results with a higher resolution.
After that,  PGM refinement is still recommended.  Yes, please use as many cores as possible. In your cases, you can use --ncores 16 for sure.   Hopefully, you can get the results in hours.
Let me know if you have any further comments/Questions.

Thanks Jun - really appreciate it. Will keep you posted.

authors: paraish phoenixding


text:
GCM - sending custom icon via gcm

when we add a parameter icon->"http://www.somesite.com/someimage.jpg" the notification shows the default app icon.
Apps like facebook manage to show custom icons based on the activity.
any ideas ?

And no news about it as of February 2015? I still can't get my correct white icon to show up even when editing the setSmallIcon section and adding my white icon on all possible drawable dirs.

source: gharchive/issue

authors: andreszs astutesoftware

repo: phonegap-build/PushPlugin

license: mit

license_type: permissive

license_source: bigquery


text:
The use of phonegap WebView JS injection in the Android 4.3 system version, return the results of delays, that is to use JS loadurl method to load caused by thread occlusion, how to solve?

This is my code
public void onPageFinished(WebView view, String arg1) {
// TODO Auto-generated method stub
			setTitle(cordovaWebView.getTitle());
			if (!TextUtils.isEmpty(jsStr)) {
				final StringBuilder js = new StringBuilder();
				js.append(
						"var newscript = document.createElement(\"script\");")
						.append(jsStr)
						.append("document.body.appendChild(newscript);");
				if (android.os.Build.VERSION.SDK_INT < 19) {

					cordovaWebView.loadUrl("javascript:" + js.toString());
				} else {
					cordovaWebView.evaluateJavascript(
							"javascript:" + js.toString(), null);
				}

			}
		}

Android 4.4 using evaluateJavascript does not appear to delay.

Hello @gaobin881201,
I'm sorry to hear that you've run into an issue with Android 4.3. However, this appears to be something specific to Cordova Android and not the PhoneGap Developer App (this issue tracker).
Can you please file an issue in the Apache Cordova Issue Tracker with the Android component.
Good luck!
Michael

repo: phonegap/phonegap-app-developer

license_source: github-api


text:
Uncorrect token returned by FCM on iOS

On iOS we decided to use FCM for push notification service. What happens is that on registration to FCM, Google return an APNs token instead of FCM one.
So when i try to send a notification to iOS with APNs token through FCM, request returns obviously an error.
The weird thing is that if i try to unregister and then register again, FCM returns a correct token. Notifications sent using the second token are always received correctly on iOS device.
How can i fix this?
N.B. I assume that token received on first place by FCM is an APNs token, but i may be wrong. I posted token samples below to be clear.
Expected Behaviour
Receive a correct FCM token on every push.on('registration', function(data) { ... }) call
Actual Behaviour
Sometimes function push.on('registration', function(data) { ... }) returns an incorrect token for FCM.
Tokens received look like:
Token for pushes: 0236c4204712b8ffd7c56b6ab7540c0732o1bd962406d8884656b5fc541a99d2

Token for pushes: dwBMQ3x5rz4:APA91lOcfhj-Tymfq7o0Tq0lcUsOIuHuZj52oh0bct5IR5oIPumEMgG74p0P0sL43lNE9s0TzTImj0rEsHUcwxoJUmpXUSYBFI6m42O-_uzs1VLym6F2S2hlPs9eshPML6ho70BWOpG0

The first token is the one returned on first registration request. The second one is what i receive if i call
push.unregister(function() {
		    		...
		    	});

and then call registration function again.
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
     iOS 7.1.2

Plugin version
     1.10.5

Sample Code that illustrates the problem
Here is my code:
push = PushNotification.init({ //init push service
                android: {
                    senderID: "XXXXXXXXXXX"
                },

                ios: {
                    senderID: "XXXXXXXXXXX",
                    alert: true,
                    badge: true,
                    sound: true,
                    fcmSandbox: false
                },

                windows: {}
            });

...

 push.on('registration', function(data) {
	                var registrid = data.registrationId;
	                console.log('Token for pushes: '+ registrid);
	                ...
	            });
...

 this.unregisterPushService = function () {
                    ...
		    	push.unregister(function() {
		    		...
		    	});
    }

@FFabiano if you are using FCM please use the 2.0.0-rc5 version of the plugin and follow the instructions on how to include the GoogleServices-Info.pList in your project.
https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/INSTALLATION.md#installation-requirements

I tried your solution @macdonst, but i got the following error:
ReferenceError: PushNotification is not defined
I'm currently build with build.phonegap.com. I went deeper and i found out that latest versions supported by Phonegap Builder are:
 PhoneGap version: cli-6-5-0
 iOS Phonegap version: 4.3.1
 Android Phonegap version: 6.1.2
as pointed out also in official docs: https://build.phonegap.com/current-support
2.0.0-rc5 plugin version is not supported with this configuration at all.
I can't build using local workspace, where i would have more control on cli version for internal deployment reasons.
Is it the only way to fix this? Configuring my app with FCM is fine and works well except for this problem, both on Android and iOS.

@FFabiano I've asked the PGB team about current support levels. Those seem old but the problem you are describing does seem to indicate that the project can't install the Push Plugin because it does not meet the required versions.
Looking over your original post again I see you are using iOS7 and the 2.x stream of this plugin drops support for iOS versions before 9 so you probably shouldn't upgrade to 2.x anyway.
I can't reproduce this problem and there is a good chance the issue is with the older version of iOS you are using. Is it possible for you to upgrade to a newer version of iOS?
If you can't you may just have to work around it. If you get a registration ID with a : in it you can assume it is a FCM token. If it is missing you can assume it is a APNS token then call unregister/init again to generate the FCM token.

Hello. I used v1  of this plugin and my ios app got correct registrationId from FCM but device not receive push notifications. So I install v2 of plugin and try to get corrected regId but I receive APN regId, not FCM. What can be wrong?
Steps:
ionic cordova plugin add phonegap-plugin-push
in plugins/phonegap-plugin-push/plugin.xml add
<platform name="ios">
  <resource-file src="GoogleService-Info.plist" />
</platform>

in package.json added:
"phonegap-plugin-push": {
                "SENDER_ID": "XXX"
            }

in config.xml added:
<plugin name="phonegap-plugin-push" spec="2.0.0">
        <variable name="SENDER_ID" value="XXX" />
    </plugin>

and in app.component.ts added:
onst options: PushOptions = {
      ios: {
        senderID: 'XXX',
        alert: 'true',
        badge: false,
        sound: 'true'
      }
    };
    const pushObject: PushObject = this.push.init(options);

    pushObject.on('registration').subscribe((data: any) => {
      console.log('device token -> ' + data.registrationId);
    }, err => {
      console.log('error in device registration:', err);
    });

On v1 after this steps I received correct FCM regId but don't receive pushes on device. With v2 I received incorrect regId!

I got corrected registrationId after manually add GoogleService-Info.plist to Resources folder in Xcode project tree. But I don receive notification again. In FCM console message has status 'Accepted'.

@macdonst I can't reproduce this problem and there is a good chance the issue is with the older version of iOS you are using. Is it possible for you to upgrade to a newer version of iOS?

I checked on iPad Mini with 10.3.x iOS version, and everything worked fine. You were right, probably it's my iPhone's iOS old version.
Thank you very much for the support.

@macdonst If you can't you may just have to work around it. If you get a registration ID with a : in it you can assume it is a FCM token. If it is missing you can assume it is a APNS token then call unregister/init again to generate the FCM token.

It could be a valid workaround for who can't set min version for his project above iOS 7.x.x or must test on it. Personally i will upgrade everything i have to in order to get things right.

@FFabiano okay, I'm going to close this issue then. iOS 7 from the latest info I have is only on 1% of all iOS devices out there and I no longer have a test device capable of running iOS7.

Here is my IONIC info
cli packages: (/Users/kaldinsolutions2/.webclipse/nodejs/8.5.0/lib/node_modules)
@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:
cordova (Cordova CLI) : 7.1.0

local packages:
@ionic/app-scripts : 3.0.0
Cordova Platforms  : android 6.3.0 ios 4.5.2
Ionic Framework    : ionic-angular 3.7.1

System:
ios-deploy : 1.9.2
Node       : v8.5.0
npm        : 5.4.2
OS         : macOS High Sierra
Xcode      : Xcode 9.2 Build version 9C40b

Environment Variables:
ANDROID_HOME : not set

Misc:
backend : pro

Here is code to get FCM token
const options: PushOptions = {
android: {
senderID: '1047615971893'
},
ios: {
alert: 'true',
badge: 'true',
sound: 'true'
},
windows: {}
};
const pushObject: PushObject = this.push.init(options);
pushObject.on('registration').subscribe((data: any) => {
console.log('device token -> ' + data.registrationId);
this.user.token = data.registrationId;
});
it generates like this:
fPUhdRK78aI:APA91bFn3lozqE6MKz3WLWzvaFngquYGEmh_hawoachcFlld-
juxljkacmfm1Qg_VoAIJ4meZK7Nps1of22leZ-vXo3csXUAIA1X26WsBPnjV4Af-DGQMFVh-kN56TCw_
but I want it like this:
ceo4f4bed3b29d94c1386761ed65a1fa68c4a5fd82e7495164ebf445
TIA!!

That's a FCM token, if you want/need an APNs token then don't use FCM.

how to get that APN token it doesn't available directly like FCM token

jcesarmobile Can you please tell how can i get it ?

@jcesarmobile Can you please tell how can i get that APN token using my code

You can't, if you use FCM, you will get the FCM token, that's it.

authors: FFabiano Kals5 jcesarmobile macdonst mifkys

repo: phonegap/phonegap-plugin-push

license: MIT


text:
[Dude] Wake up app on Notification

(Translated by Google)
[For Android only]
When the APP is in background, and a notification is received ...
Can it be achieved, that the APP wake up and be visible to the user?
Without showing the notification in the bar.
Thanks

In the meantime...
I leave a plugin that, at least, helped me
https://github.com/YimasoftLiuGuanJun/cordova-bring-to-front

@marcoas no, it is not possible with this plugin only. Also, it's not recommended behaviour by Apple or Google so I would suggest you don't do it.

authors: macdonst marcoas


text:
Ionic implemenation

Can this plugin be used in Ionic?

@MitkoC Yes, yes it can. It is now the officially supported plugin in ngCordova (https://github.com/driftyco/ng-cordova/).

authors: MitkoC macdonst


text:
Icon Request: X (fka Twitter!)

Describe the requested icon
X, fka Twitter!
Additional context
Twitter's logo is obsolete now and needs to be updated to X.

Closing as duplicate of #309

authors: akiarostami rektdeckard

repo: phosphor-icons/homepage


text:
page_store: ensure buffers are accessable from any version

This PR closes #240.

@w41ter CI takes a long time and seems the buffer_set_concurrent_update test is the problem, is that expected?
test page_store::version::tests::buffer_set_concurrent_update has been running for over 60 seconds

In my local env:
patrick@thinkbook:~/workspace/montplex/photondb$ cargo test -- buffer_set_concurrent_update
    Finished test [unoptimized + debuginfo] target(s) in 0.06s
     Running unittests src/lib.rs (target/debug/deps/photondb-f374be4ee1c0622e)

running 1 test
test page_store::version::tests::buffer_set_concurrent_update ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 62 filtered out; finished in 0.35s

It seems that is not normal in a CI environment.

Maybe investigate the test later if it is reproducible in the CI.

source: gharchive/pull-request

repo: photondb/photondb


text:
tilemapLayer rendering problem with camera positioning

I have only had this error occur on Apple Devices running iOS8. On Mac w/ Google Chrome I ran into no issues.
Scenario:
Created a tilemaplayer which would be bigger than the camera size.
I allowed the camera to move so that using drag all parts of the tilemap could be seen.
This worked fine on desktop.
However when moving to mobile, parts (not all) of the section which was not in view from the beginning were not being rendered. The parts were not consistent either.
After fiddling around I realized setting layer.renderSettings.enableScrollDelta = false, solved the issue for me. This is because the whole tilemap would be rendered from the beginning rather than when it just came in view. However this will obviously be a performance hit later on.
I recommend taking a look at this.
EDIT: Both Safari and Chrome were tested on the xCode Simulator, along with a physical iPad.

Sounds like an issue, but without a test case to debug there's nothing more we can do, sorry.

authors: KyleBsingh photonstorm

repo: photonstorm/phaser


text:
Bitmap masks are broken

Version

Phaser Version: 3.50.0-beta.3
Browser: Vivaldi 3.2.1967.47 (based on Chromium 84)

Description
Bitmap masks do not render the masked object at all.
This broke somewhere between 96072e5 and 5b08be9. A lot of the commits between those either don't build at all or produce a broken build, so I haven't been able to pinpoint the exact offender. SpectorJS shows that both the main framebuffer and the mask framebuffer are prepared correctly, but nothing is rendered to the game canvas. The broken Bitmap Mask Pipeline updates its uniforms every frame, while the working one does not, so I suspect 5c39254 may be related.
Example Test Code
The existing bitmap mask examples are affected, including BitmapMask Example and BitmapMask Alpha.

Found it. The WebGLPipeline constructor always creates a blank vertex buffer. The BitmapMaskPipeline passes in a pre-filled buffer, which is never sent to the GPU. This changed in 468c03d.
Side note: With the new constructor code, isn't the fallback buffer for this.vertexData always created, even when a buffer is actually specified? That seems a little wasteful.


text:
MatterJS types problem in TypeScript

Version

Phaser Version: 3.60 beta 19

Description
Tried to remove and add a MatterJS body but it fails.
Example Test Code
const sprite = this.matter.add.image(
	500, 500, "box", undefined, { isStatic: true }
);
this.matter.world.remove( sprite.body );
this.matter.world.add( sprite.body );

It returns an error:
Argument of type 'BodyType | Body | StaticBody | null' is not assignable to parameter of type 'object | object[]'.
  Type 'null' is not assignable to type 'object | object[]'.ts(2345)

As a workaround we can use such form which works fine but not the best solution:
this.matter.world.remove( sprite.body as any );
this.matter.world.add( sprite.body as any );

MatterJS needs to pass the exactly .body of the object, not the sprite object itself. So this:
this.matter.world.remove( sprite );
this.matter.world.add( sprite );

compiles but doesn't work in runtime. It adds the sprite object only but not the physics body.
Additional Information
n/a

Cast the body (doesn't have to be as any, you can explicitly cast it), because it's perfectly valid for sprite.body to be null, so we cannot remove that from the type defs for that property.

authors: ProgrammingLife photonstorm


text:
Round linePositionX, to prevent placement of text on subpixel level which may cause blurriness

When a multiline text object has align as 'center', text on lines other than the first one might be positioned at subpixel level, causing it to look blurry in low resolution rendering.

This isn't always desirable behaviour, so I have placed it under a boolean flag.

authors: photonstorm slashman


text:
Replace the big number with Infinity

This PR

Fixes a bug

Describe the changes below:
I think it makes more sense to use the Infinity definition than to use a large number instead.

This won't work, I'm afraid:
let counter = Infinity;
counter = counter - 100;
console.log(counter); // outputs 'Infinity'

You can't use it as a seed for a decrementing value, as we do in all those cases.
We could use Number.MAX_SAFE_INTEGER instead, but there's no real point, it just takes up more bytes for no benefit in this case.

authors: photonstorm temajm


text:
Only allow processing a single messages at a time

Fixes #1

Thanks for your pull request! We love contributions.
However, this repository is what we call a "subtree split": a read-only copy of one directory of the main enqueue-dev repository. It is used by Composer to allow developers to depend on specific Enqueue package.
If you want to contribute, you should instead open a pull request on the main repository:
https://github.com/php-enqueue/enqueue-dev
Read the contribution guide
https://github.com/php-enqueue/enqueue-dev/blob/master/docs/contribution.md
Thank you for your contribution!

fixed in https://github.com/php-enqueue/enqueue-dev/pull/998

authors: makasim mlively

repo: php-enqueue/gearman


text:
🛑 phpMyFAQ Password Hash Generator Tool is down

In 5ac1ec6, phpMyFAQ Password Hash Generator Tool (https://password.phpmyfaq.de) was down:

HTTP code: 0
Response time: 0 ms

Resolved: phpMyFAQ Password Hash Generator Tool is back up in 1c650fc.


text:
🛑 phpMyFAQ API is down

In 2bf9434, phpMyFAQ API (https://api.phpmyfaq.de/versions) was down:

HTTP code: 0
Response time: 0 ms

Resolved: phpMyFAQ API is back up in 0d11e73.


text:
🛑 phpMyFAQ Demo is down

In b2fc349, phpMyFAQ Demo (https://demo.phpmyfaq.de) was down:

HTTP code: 0
Response time: 0 ms

Resolved: phpMyFAQ Demo is back up in f4a5f9c.


text:
🛑 phpMyFAQ Demo is down

In c2a3d34, phpMyFAQ Demo (https://demo.phpmyfaq.de) was down:

HTTP code: 0
Response time: 0 ms

Resolved: phpMyFAQ Demo is back up in fb84000.


text:
🛑 phpMyFAQ API is down

In 3e541d5, phpMyFAQ API (https://api.phpmyfaq.de/versions) was down:

HTTP code: 0
Response time: 0 ms

Resolved: phpMyFAQ API is back up in ef0288b.


text:
🛑 phpMyFAQ Demo is down

In df662ee, phpMyFAQ Demo (https://demo.phpmyfaq.de) was down:

HTTP code: 0
Response time: 0 ms

Resolved: phpMyFAQ Demo is back up in 7424280.


text:
🛑 phpMyFAQ API is down

In 7815c03, phpMyFAQ API (https://api.phpmyfaq.de/versions) was down:

HTTP code: 0
Response time: 0 ms

Resolved: phpMyFAQ API is back up in b788f7d after 5 minutes.


text:
🛑 phpMyFAQ API is down

In 20d4a28, phpMyFAQ API (https://api.phpmyfaq.de/versions) was down:

HTTP code: 0
Response time: 0 ms

Resolved: phpMyFAQ API is back up in 273eb42 after 5 minutes.


text:
Can I somehow use this in the monaco editor?

I am trying to implement the phpactor lsp in the monaco editor, yet I cannot get it to work. When using phpactor on 127.0.0.1:8000 and then using monaco-languageclient to connect to is, all I'm getting is Warning: Undefined array key 1 in phar:///Users/marc/.local/bin/phpactor/vendor/phpactor/language-server/lib/Core/Server/Parser/LspMessageReader.php on line 114.
Do I need to setup a proxy that connects between the monaco-languageclient and phpactor (since I want phpactor to run in STDIO anyway)?
Thanks

You can use stdio (there's an option for it)

I know I can use phpactor in stdio, but I don't get how to use it with https://github.com/TypeFox/monaco-languageclient then. I only see examples here where I have to pass an address and port.

ok, it's a "web" editor so I (guess) that makes sense. it seems the headers in the RPC request are malformed as the offending line is:
    private function parseHeaders(string $rawHeaders): array
    {
        $lines = explode("\r\n", $rawHeaders);
        $headers = [];

        foreach ($lines as $line) {
            [ $name, $value ] = array_map(function ($value) {
                return trim($value);
            }, explode(':', $line));
            $headers[$name] = $value;
        }

        return $headers;
    }

Do you have any raw LSP logs from the "client"?

authors: dantleech justlunix

repo: phpactor/vscode-phpactor


text:
Unable to install PHP 5.6.10 on C9 IDE

Hello,
I'm trying to install PHP 5.6.10 to update the C9 IDE from PHP 5.5.9:
I use the following commands:
# http://phpbrew.github.io/phpbrew/
# https://community.c9.io/t/phpbrew-on-php-workspaces/621
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
chmod +x phpbrew
sudo mv phpbrew /usr/local/bin/phpbrew
phpbrew -v
phpbrew init
vim ~/.bashrc
# Paste this: [[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc
phpbrew lookup-prefix homebrew
phpbrew update
phpbrew -d install --test 5.6.10 +default

It looks like the build.log halts when it is asking to send the report of the tests. Here is the extract of the summary:
=====================================================================
TIME END 2015-12-23 13:43:30

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :   57
Exts tested     :   21
---------------------------------------------------------------------

Number of tests : 13469              8628
Tests skipped   : 4841 ( 35.9%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    3 (  0.0%) (  0.0%)
Expected fail   :   28 (  0.2%) (  0.3%)
Tests passed    : 8597 ( 63.8%) ( 99.6%)
---------------------------------------------------------------------
Time taken      :  297 seconds
=====================================================================

=====================================================================
EXPECTED FAILED TEST SUMMARY
---------------------------------------------------------------------
Test open_basedir configuration [tests/security/open_basedir_linkinfo.phpt]  XFAIL REASON: BUG: open_basedir cannot delete symlink to prohibited file. See also
bugs 48111 and 52176.
Inconsistencies when accessing protected members [Zend/tests/access_modifiers_008.phpt]  XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Inconsistencies when accessing protected members - 2 [Zend/tests/access_modifiers_009.phpt]  XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770.phpt]  XFAIL REASON: See Bug #48770
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770_2.phpt]  XFAIL REASON: See Bug #48770
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770_3.phpt]  XFAIL REASON: See Bug #48770
Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects) [Zend/tests/bug64896.phpt]  XFAIL REASON: We can not fix this bug without a significant (performace slow down) change to gc
Initial value of static var in method depends on the include time of the class definition [Zend/tests/method_static_var.phpt]  XFAIL REASON: Maybe not a bug
DateTime::add() -- fall type2 type3 [ext/date/tests/DateTime_add-fall-type2-type3.phpt]  XFAIL REASON: Various bugs exist
DateTime::add() -- fall type3 type2 [ext/date/tests/DateTime_add-fall-type3-type2.phpt]  XFAIL REASON: Various bugs exist
DateTime::add() -- fall type3 type3 [ext/date/tests/DateTime_add-fall-type3-type3.phpt]  XFAIL REASON: Various bugs exist
DateTime::add() -- spring type2 type3 [ext/date/tests/DateTime_add-spring-type2-type3.phpt]  XFAIL REASON: Various bugs exist
DateTime::add() -- spring type3 type2 [ext/date/tests/DateTime_add-spring-type3-type2.phpt]  XFAIL REASON: Various bugs exist
DateTime::add() -- spring type3 type3 [ext/date/tests/DateTime_add-spring-type3-type3.phpt]  XFAIL REASON: Various bugs exist
DateTime::diff() -- fall type2 type3 [ext/date/tests/DateTime_diff-fall-type2-type3.phpt]  XFAIL REASON: Various bugs exist
DateTime::diff() -- fall type3 type2 [ext/date/tests/DateTime_diff-fall-type3-type2.phpt]  XFAIL REASON: Various bugs exist
DateTime::diff() -- fall type3 type3 [ext/date/tests/DateTime_diff-fall-type3-type3.phpt]  XFAIL REASON: Various bugs exist
DateTime::diff() -- spring type2 type3 [ext/date/tests/DateTime_diff-spring-type2-type3.phpt]  XFAIL REASON: Various bugs exist
DateTime::diff() -- spring type3 type2 [ext/date/tests/DateTime_diff-spring-type3-type2.phpt]  XFAIL REASON: Various bugs exist
DateTime::diff() -- spring type3 type3 [ext/date/tests/DateTime_diff-spring-type3-type3.phpt]  XFAIL REASON: Various bugs exist
DateTime::sub() -- fall type2 type3 [ext/date/tests/DateTime_sub-fall-type2-type3.phpt]  XFAIL REASON: Various bugs exist
DateTime::sub() -- fall type3 type2 [ext/date/tests/DateTime_sub-fall-type3-type2.phpt]  XFAIL REASON: Various bugs exist
DateTime::sub() -- fall type3 type3 [ext/date/tests/DateTime_sub-fall-type3-type3.phpt]  XFAIL REASON: Various bugs exist
DateTime::sub() -- spring type2 type3 [ext/date/tests/DateTime_sub-spring-type2-type3.phpt]  XFAIL REASON: Various bugs exist
DateTime::sub() -- spring type3 type2 [ext/date/tests/DateTime_sub-spring-type3-type2.phpt]  XFAIL REASON: Various bugs exist
DateTime::sub() -- spring type3 type3 [ext/date/tests/DateTime_sub-spring-type3-type3.phpt]  XFAIL REASON: Various bugs exist
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd2) [ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt]  XFAIL REASON: Still not quite right
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fs) [ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt]  XFAIL REASON: Still not quite right
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #55509 (segfault on x86_64 using more than 2G memory) [Zend/tests/bug55509.phpt]
Bug #66481: Calls to session_name() segfault when session.name is null. [ext/session/tests/bug66481.phpt]
file upload greater than 2G [sapi/cli/tests/upload_2G.phpt]
=====================================================================

You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it.	You can then email it to qa-reports@lists.php.net later.
Do you want to send this report now? [Yns]:

My questions:

is there anything not complete at that stage?
impossible to run phpbrew clean 5.6.10 or phpbrew use 5.6.10. Is that normal?
is there a work around?

When you run install 5.6.10 the give build name is php-5.6.10 by default, hence you need to run phpbrew use php-5.6.10 or phpbrew clean php-5.6.10.
If you want to install 5.6.10 as the custom build name, use the command like:
phpbrew --debug install 5.6.10 as 5.6-dev +default

Looks like make test is expecting user's input, you can use export NO_INTERACTION=1 to skip the test report submission.

@c9s Thanks. I will try that out.

The new phpbrew will putenv NO_INTERACTION=1 when running the test task

@c9s I've tried what you suggested and it is failing at configuration...

mcrypt is installed on the webserver though...

What am I missing? Is the mcrypt.h missing from the php-5.6.10 package?

Hi @WebDevJL,
Yes, you are missing libmcrypt header files, check if libmcrypt-dev, libmcrypt4 are installed on your system.
the header file should be located in /usr/include/mcrypt.h on Ubuntu system (the path depends on distributions)
further, you can pass extra configure option to configure the build script:
phpbrew install .....  -- --with-mcrypt=/usr

repo: phpbrew/phpbrew


text:
Add support for limiting deletion to defined branch prefixes

Adding support for branch prefixes allows this action to be run on a limited subset of branches that maybe created/deleted by automation or otherwise. This allows for other branches outside the prefix to not risk being removed by this action if we decide that is what we wish.

Thank you, I'll give this a spin and come back to you shortly.

I haven't forgotten about this.

I'm going to be refactoring the way input params are handled to avoid the very long function calls. Bringing this PR into it. Will come back and report once it's done

authors: jburnham luispabon


text:
create an adapter for twig

This will allow developer to use Twig instead of pure PHP templates. I will also provide an example for other adapters.

Just add Twig to the container configuration.

repo: phpolar/phpolar


text:
Events

Atualização de eventos

Atualização eventos

Atualização eventos

repo: phpwomenbr/site


text:
Search is not an exported method

Hi @phrb. So I've come stuck at the next hurdle. In the README it states

Now we are ready to use the search method, which could be called with just a Configuration and a function that accepts a Configuration as input.

The problem is that search doesn't seem to be an exported method so I end up with the following error:
ERROR: LoadError: MethodError: `search` has no method matching search(::Function, ::StochasticSearch.Configuration{StochasticSearch.NumberParameter{AbstractFloat}})
 in include at boot.jl:261
 in include_from_node1 at loading.jl:304
while loading C:\Users\jonathan\Documents\UniOfOxford\HelpingOthers\DavidBrown\FRAP_filter\filter_FRAP.jl, in expression starting on line 350

What method should I use if I want to run simulated annealing?
I assume something in the README or the code needs to be changed.
Thanks again in advance for helping me out

Hi @JonnyCBB, I'm really sorry for this. I'll have to rewrite the README because there are multiple undocumented changes. One of the changes is that search was renamed optimize. But this will not make the README example work.
Please, use the following as a substitute for the example in the README:
I'll use the rosenbrock example. The code for this example is available here.
@everywhere begin
    using StochasticSearch
    function rosenbrock(x::Configuration, parameters::Dict{Symbol, Any})
        return (1.0 - x["i0"].value)^2 + 100.0 * (x["i1"].value - x["i0"].value^2)^2
    end
end

This part just defines the cost function in every Julia process. Then, we define the configuration, the same way as before:
configuration = Configuration([FloatParameter(-2.0, 2.0, 0.0,"i0"),
                               FloatParameter(-2.0, 2.0, 0.0,"i1")],
                               "rosenbrock_config")

Now, instead of using a Dict, we build a tuning run configuration using the Run type. This type encapsulates all tuning run parameters. You can see its code here.
We use the methods array to define all search methods that will be used, and the number of instances of each one. This example uses one instance of every implemented method. Note that report_after and duration are in seconds, by default:
tuning_run = Run(cost               = rosenbrock,
                 starting_point     = configuration,
                 methods            = [[:simulated_annealing 1];
                                       [:iterative_first_improvement 1];
                                       [:randomized_first_improvement 1];
                                       [:iterative_greedy_construction 1];
                                       [:iterative_probabilistic_improvement 1];],
                 stopping_criterion = elapsed_time_criterion,
                 report_after       = 4,
                 duration           = 30,
                 measurement_method = sequential_measure_mean!)

Finally, we create a search task using the optimize method, and consume the task for the results:
search_task = @task optimize(tuning_run)
result = consume(search_task)
print(result)
while result.is_final == false
    result = consume(search_task)
    print(result)
end

I hope this works for you. Thanks for not giving up, and I'm really sorry for this terrible user experience. I'll update the wiki and the README. Please, keep posting if you find more hurdles, or need help of any kind.

No problem whatsoever. I trust you know what you're doing and this was the best simulated annealing package I could find in terms of flexibility and documentation so I'll continue to persevere with this package. Plus you've been really quick and responsive at getting back to me.
I'm busy for the next few hours but I'll try what you suggested later on and get back to you about it.

Thanks @JonnyCBB. I've updated the README example as well. If you can, please tell me what features you intend to use so I can document them first.

Hi @phrb thank you very much for your comprehensive explanation of the problem and solution. I've managed to get it working. I appreciate the amount of work you put into this to make it work for me.
I'll close the issue because you have solved the original problem but I do have 2 more questions:

for the method field of the Run type, I'm not certain what it means to specify the method e.g. simulated annealing and then the integer that comes after it. Also does applying several methods to a run mean that the methods are applied consecutively during the search?

The output gives a Starting Configuration. This isn't necessarily the initial configuration that is specified by the user. What does the Starting Configuration represent?

Sorry for all of the questions.

Hi @JonnyCBB, that was no problem at all, I've been working on this project for some time and I really appreciate that someone took the time to use it. Please feel free to ask more questions, I'll be glad to answer them and help you to use the package.
1a The methods array has the format:
methods::Array{Any, 2} = [[:method1_name::Symbol instances::Integer];
                          [:method2_name::Symbol instances::Integer]; ...;]

This means that methods is a matrix with two "columns" and n "rows", where n is the number of methods specified. Every method Symbol specifies a search technique and is a Function name, such as :simulated_annealing. The integer that follows is the number of concurrent instances of that technique running on the same problem. Different instances of a technique may search different parts of the search space and use different starting configurations, but use the same search algorithm.
1b) Applying several methods creates separate Julia Tasks, that will then use remotecalls to distribute the calculations of cost measurements between different Julia workers or processes. This allows the measurements to be made in parallel if there is more than one Julia worker active.
2) When starting a tuning run, StochasticSearch perturbs the user-provided starting configuration generating a group of candidate starting points. The starting configuration listed in the output is the lowest-cost point between all those measured candidates, including the user provided point.

@phrb Once again, thank you so much for your thorough explanation. That all makes sense. I didn't know these types of distributed techniques could have such a simple API. This is so much better than I thought it already was. I was only going to run simulated annealing search technique but I may as well try others. You're an absolute legend.
As an aside, I stumbled across this package through quite a lot of Googling. In fact I didn't know these techniques as "Stochastic Search" algorithms. I was just looking for a package that had a nice API for simulated annealing. I think this package should be part of an organisation like JuliaOpt (assuming that it fits nicely in that umbrella). Have you got any plans to incorporate that there? It would've saved me so much time searching and I think more people would see it and use it. It's a brilliant package!

Wow thanks @JonnyCBB ! I took the ideia of using ensembles of search techniques from OpenTuner, an autotuning framework written in python.
I research program autotuning, and I wrote the package to make it easy to study parallel and concurrent measurement of cost functions. I thought of those cost functions as measurements of program execution time or energy consumed by an execution, for example, and the autotuner would use stochastic search to find good program optimizations according to these objectives. That's why the set of parameters is called a "configuration", as in a program configuration, and the optimization process is called a "tuning run". Of course the cost functions and sets of parameters can be anything, so the package ends up also working as a general-purpose tool.
I would really like to be part of some bigger Julia project or organisation, but I believe the package needs to mature a bit more before that!
Thanks for your feedback, I hope the package is useful and I'm looking forward for more questions.

Hey @JonnyCBB,
What did you end up doing with the package? Did you find any other hurdles?

Thanks for everything @phrb. It works really well and I haven't come across anymore hurdles. I really appreciate you taking the time to make the changes for me.
I was using it because I've been doing some modelling for a friend of mine. Basically we have a system of reaction diffusion equations for some FRAP data (Fluorescence Recovery After Photobleaching) and there are quite a few parameters - 9 in total I think.
He's trying to write a paper to describe the dynamics that he thinks are going on and asked if I could see what the models say. So far so good but the real test comes over the next few days to see if the parameter values he expects are going to come out. So it's finished yet and I'm still using your package

@JonnyCBB No problems, it was actually fun, I got motivated to write a proper documentation page, that I'll be updating. I'm really glad it is working for you, If you have any questions or need any help, feel free to ask!
Did you use more than one Julia worker? I would like to see how the package's parallelism performs in your application. I can help you set it up if want to.
I'll release a new version, with a new search technique (Iterated Local Search) that could also be useful. The lastest version is already in GitHub.

@phrb Sorry for the late reply. I'm currently writing my thesis on top of the modelling and I just completely forgot to get back to you.
I've been using 2 workers (setting instances::Integer=2 if that's what you mean) but I haven't played around with this.
Exploring this would actually be pretty useful because the reaction diffusion equation takes a fairly long time to run - 10,000 iterations takes about half a day or something like that. If you have some tips, I would very much welcome them.
I don't know the Iterated Local Search algorithm so that would be new to me.

@JonnyCBB No problem at all, good luck on your thesis!
Actually I meant actual Julia processes, or workers. Try setting instances=2 at the tuning run configuration, and add a call to addprocs(n) at the top of your script. You can make n=2 for two Julia processes, and bigger ns to test the performance. You'll have to adjust both the number of instances and Julia processes to improve your performance.
I'm available to help in any hurdles you may find!

authors: JonnyCBB phrb


text:
Subject name should be read when data is loaded

Stuff that needs to be addressed after the code developed for OHBM23.
In physioqc.interfaces.interfaces.generate_figures()
The figure as saved with a random default 'sub-01', but it should be read from the filename when the data are loaded

Also relevant here: https://github.com/physiopy/physioqc/issues/8#issuecomment-2180974906

authors: celprov m-miedema

repo: physiopy/physioqc


text:
Update CI and add HYPRE

Using commit from master to avoid issues until https://github.com/hypre-space/hypre/pull/423 is included in a released

Codecov Report

Merging #38 (b961ebd) into master (4323fdd) will decrease coverage by 0.08%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master      #38      +/-   ##
==========================================
- Coverage   93.02%   92.93%   -0.09%
==========================================
  Files          43       43
  Lines        4129     3002    -1127
==========================================
- Hits         3841     2790    -1051
+ Misses        288      212      -76

Impacted Files
Coverage Δ

src/Picasso_ParticleList.hpp
60.00% <0.00%> (-16.93%)
:arrow_down:

src/Picasso_ParticleCommunication.hpp
12.00% <0.00%> (-13.00%)
:arrow_down:

unit_test/tstLevelSetRedistance.hpp
87.09% <0.00%> (-12.91%)
:arrow_down:

src/Picasso_UniformMesh.hpp
69.38% <0.00%> (-10.62%)
:arrow_down:

unit_test/tstParticleInit.hpp
93.93% <0.00%> (-6.07%)
:arrow_down:

src/Picasso_InputParser.cpp
89.47% <0.00%> (-2.84%)
:arrow_down:

src/Picasso_AdaptiveMesh.hpp
83.60% <0.00%> (-2.11%)
:arrow_down:

src/Picasso_UniformCartesianMeshMapping.hpp
96.55% <0.00%> (-1.13%)
:arrow_down:

unit_test/tstGridOperator2d.hpp
97.29% <0.00%> (-0.89%)
:arrow_down:

unit_test/tstGridOperator3d.hpp
98.18% <0.00%> (-0.69%)
:arrow_down:

... and 32 more

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 4323fdd...b961ebd. Read the comment docs.

authors: codecov-commenter streeve

repo: picassodev/picasso


text:
🛑 YSF REF is down

In db3b6d2, YSF REF (https://ysf.freedmr.it) was down:

HTTP code: 500
Response time: 729 ms

Resolved: YSF REF is back up in 56ff784 after 10 minutes.

repo: picchiosat/HBLink-Uptime


text:
[macOS] Copy Shortcut does not work if TextField outside of WebView has focus

Is there an existing issue for this?

[X] I have searched the existing issues

Current Behavior
When a user has focus on a Flutter TextField and tries to copy text from a WebView, nothing gets copied.
I attempted to fix this issue by adding the following code:
onWindowFocus: (
    FocusScope.of(context).unfocus();
},

This solution worked for the first copy, but it didn’t consistently resolve the problem afterward.
Expected Behavior
Copy should work without any extra code outside of InAppWebView
Steps with code example to reproduce

Steps with code example to reproduce
I could reproduce the issue on with example from: https://github.com/pichillilorenzo/flutter_inappwebview/blob/master/flutter_inappwebview/example/lib/in_app_webiew_example.screen.dart

Start The Example project (I used MacOS)
Click in Url TextField
Try to copy something from the WebView. Don't click anything else to not remove the focus from the textfield manually
Try paste copied text

Stacktrace/Logs

Stacktrace/Logs
<Replace this line by pasting your stacktrace or logs here>

Flutter version
3.24.3
Operating System, Device-specific and/or Tool
macOS
Plugin version
6.1.5
Additional information
No response
Self grab

[ ] I'm ready to work on this issue!

It seems there is an issue with the native Flutter PlatformView itself on macOS!
The same problem occurs also with the webview_flutter plugin, so you should open a new issue to the official Flutter repository.
In the meantime, I was able somehow to create a workaround for it on the native side, but this is something that should be fixed natively on Flutter itself.
This workaround should be available in the next 6.2.0 version

Released new version 6.2.0-beta.1.

authors: marcosgcd pichillilorenzo


text:
"reload" not work when no internet.

I want to handle "no internet" case.
I plan to pop up a dialog when "onLoadError".
There have a "retry" button on dialog for user reload after network available.
But I found "InAppWebViewController.reload" no function when load page fail before. (It work when load page success before).
Now, I have a workaround that call "InAppWebViewController.loadUrl" .
It's work, but not good solution. (loadUrl only can load the first url that I have).
P.S. I am working on iOS
doda

same problem here

same problem here

This is how it works on iOS (check https://stackoverflow.com/questions/45706866/wkwebview-reload-cant-refresh-current-page/45708014).
You should get the current URL with getUrl method and check the current URL is null or not.
If it is null, you need to use loadUrl because there is no URL to be reloaded, otherwise you can call reload method.

authors: PawelSzymanski89 dodatw pichillilorenzo


text:
Batch registration updates

Require a parent email for users in the 13-17 age category
Provide generated account credentials as an updated version of the uploaded CSV rather than in an HTML table

@hiliang-cmu 👍should be handled w/ 47889381

repo: picoCTF/picoCTF


text:
Twig 3

Hi,
I'm not sure how do go about this, but I've upgraded Pico 3 alpha to use Twig 3 would you be interested in the patch?

See #535. You can check whether you incorporated any other changes, feel free to open a pull request then. Thank you! :+1:

authors: PhrozenByte StuTheBearded

repo: picocms/Pico


text:
Two requests: AddLines method, and allowing timestamps to be pushed in

I wrote an NLog Target that pushes all my Logger.Info(...) messages to Hangfire.Console, and it seems to work ok, but I'm concerned about lock statement in AddLine() and logs potentially thrashing the database.  Would it be possible add an overload to persist multiple ConsoleLines at the same time?  That way I could buffer them and commit a set number of lines at one time.
To accomplish this, and keep support for the timing, we would have to add a Timestamp to the ConsoleLine class and use that instead of DateTime.UtcNow.
If I were to take run at creating a PR, Is this something you would consider pulling into the mainline?

@mmurrell mind sharing your NLog target?

authors: cskiwi mmurrell


text:
Videos not playing on iOS9 GM

Hey,
Videos don't seem to play on iOS9 GM, the player.view remains hidden. Any ideas?
Cheers!

Using the Swift 2.0 branch - and it seems to be local files being the issue, using the file path:
/private/var/mobile/Containers/Data/Application/8B93DD67-7346-4CEC-9A24-EDEB1F59C1BD/tmp/video_D67A462C-E7FC-4EAD-9E5F-1DF1C37EA8E8.mp4

Same problem... I'm trying to figure it out right now

The problem is in Player.swift the url is never being set as local and only remote.
Here is one way to play local files...
Set the path for the player (mov or mp4)
self.player.path = NSBundle.mainBundle().pathForResource("video", ofType: "mov")!
Then in Player.swift check if the remoteURL scheme is an empty string. Remote url's will have "http" or "https" and local urls will have " "
example code below...
if remoteUrl != nil && remoteUrl?.scheme != nil && remoteUrl!.scheme != "" {
let asset = AVURLAsset(URL: remoteUrl!, options: .None)
self.setupAsset(asset)
        } else {
            let localURL: NSURL? = NSURL(fileURLWithPath: newValue)
            let asset = AVURLAsset(URL: localURL!, options: .None)
            self.setupAsset(asset)

        }

There is probably a better way, but that is a quick solution

I'm having this problem with local videos as well, but it does not seem to be a problem with the current version of Player.swift's filepath section because without adding && remoteUrl!.scheme != "", the else statement is still being reached when I provide a local file.  I added a print statement to the else in order to find out what url it is getting, and while the file path printed out is correct, nothing happens.  I'm also having issues with some remote videos, particularly anything that is NOT https.

i believe this was fixed by the latest contribution.
https://github.com/piemonte/Player/releases/tag/0.0.8

authors: austinllach erautenberg piemonte rjgdesign

repo: piemonte/Player


text:
Distance martix calculation may be wrong

This issue emerges from comments on the #56 pull request.
The pull request moves the code that build the distance matrix into a PBlib.distance_matrix function. I commented about this function:

At this point of the function, we are building a similarity matrix, we only convert it to a distance matrix in the next lines. Therefore, should not the diagonal be the maximum value, so the diagonal will correspond to a distance of 0 once the matrix normalized and converted? In most cases, it should not matter as the minimum value in the diagonal is most likely greater than all values out of the diagonal. Yet, it is not impossible to have cases were it is not true. For instance, ZZdddddZZ as a similarity score of 1105 whith itself, while the similarity score between ZZeeeeeZZ and ZZeefeeZZ is 2265.

@pierrepo replied and highlighted an other issue n the same function:

agree with you @jbarnoud.
However, I believe I made an error in the normalization formula.
It should be
distance_mat = 1 - (distance_mat - mini)/(maxi - mini)
instead of
distance_mat = 1 - (distance_mat + abs(mini))/(maxi - mini)

The same normalization in used in the code that convert a similarity-score-expressed substitution matrix to a single digit distance-expressed substitution matrix in PBlib.matrix_to_single_digit.
So, this issue exposes 3 problems:

[ ] the diagonal is set to an inappropriate value
[ ] the normalization is wrong in PBlib.distance_matrix
[ ] the normalization is wrong in PBlib.matrix_to_single_digit

Ultimately, the way we build the distance matrix may not be appropriate as it scramble the information given by the diagonal of the substitution matrix. I would be interested by how such distance matrix are built in the literature.
Anyway, this issue should be fixed separately from the pull request #56 as it may change the output completely. The current way of building the matrix should be kept as PBlib.matrix_distance_legacy if it was used in already published papers.
cc @pierrepo @alexdb27

See http://emboss.sourceforge.net/apps/release/6.6/emboss/apps/distmat.html

Ultimately, the way we build the substitution matrix may not be appropriate as it scramble the information given by the diagonal of the substitution matrix. I would be interested by how such distance matrix are built in the literature.

The substitution matrix (SM) is computed in a very classical way as done originally by Dayhoff (1978) or more recently for the Blosum, PAM, Gonnet, etc. SM for amino acids. The computation cannot be more simple and was presented in our first paper in Proteins 2006, 2008 or more recently the new SM in Biochimie 2011.
The fact that ZZdddddZZ aligned with itself as not the same values that ZZeeeeeZZ and ZZeefeeZZ is totally logical as the letter d (PB d) is seen quite often and e and f less.
You have the same results with the alignement of the amino acid string WWWWWWWW with itself and AAAAAA with itslef, the first one will be also largely higher. It is totally logical.

Nonetheless, the point is very intersting cc @pierrepo @alexdb27.

On 02/05/15 11:17, Alexandre G. de Brevern wrote:

Ultimately, the way we build the substitution matrix may not be
appropriate as it scramble the information given by the diagonal
of the substitution matrix. I would be interested by how such
distance matrix are built in the literature.

The substitution matrix (SM) is computed in a very classical way as
done originally by Dayhoff (1978) or more recently for the Blosum,
PAM, Gonnet, etc. SM for amino acids. The computation cannot be more
simple and was presented in our first paper in Proteins 2006, 2008 or
more recently the new SM in Biochimie 2011.
The fact that ZZdddddZZ aligned with itself as not the same values
that ZZeeeeeZZ and ZZeefeeZZ is totally logical as the letter d (PB d)
is seen quite often and e and f less.
You have the same results with the alignement of the amino acid string
WWWWWWWW with itself and AAAAAA with itslef, the first one will be
also largely higher. It is totally logical.
—
Reply to this email directly or view it on GitHub
https://github.com/pierrepo/PBxplore/issues/62#issuecomment-98337967.

Sorry. I meant that the distance matrix is not computed in a
appropriate way.

Sorry, @jbarnoud , i've read it a little bit fast.
In fact if i remember well, most of the time, diagonal is not computed at all, it is set directly at ... zero ...

@jbarnoud the clustering part of PBxplore has never been used in any paper so far. No need to keep a legacy (wrong?) function.
@alexdb27 could you give us a clear answer on the two points below?

Normalization function must be
distance_mat = 1 - (distance_mat - mini)/(maxi - mini)
instead of
distance_mat = 1 - (distance_mat + abs(mini))/(maxi - mini)

Which value to we put in the diagonal ? max() ? min() ? 0 ?

I would like to mention that for the hierarchical clustering in R, the value of the diagonal doesn't matter (either min or 0) and in scipy/scikit-learn, it has to be set at 0.

I re-open this thread because I'm trying to optimize the computation of the distance matrix.
So far so good, my method is between 6-8 times faster to the previous one (thanks to pdist method). I compute only the condensed matrix (i.e upper triangle of the matrix) and with squareform method, I get the whole matrix.
Unfortunately, I have trouble with the normalization. Currently, the diagonal was set to its minimum value and then the minimum value of the whole matrix was searched.
With my calculation my diagonal is set to 0,  so I search the min value in my condensed matrix but this min value could be the diagonal value...  I cannot have the same matrix distance as before.
Since the diagonal value is pointless, I think normalize by this minimum value is not correct. The minimum value should be search in the upper triangle.
What do you think?

So far, the matrix is normalized using the minimum distance that must be
on the diagonal. This, of course, assume that the distances are computed
for the diagonal. Doing so, the values on the diagonal should be close
to 0 on the diagonal, after normalization. Some cells from the diagonal
(at least 1) should be 0 after the normalization, the other ones are set
to 0 afterward.
You cannot use a value from outside the diagonal as minimum for the
normalization. By doing so, you will have nul distances for sequences
that are different from each other.
How long would it take to compute the non normalized distances on the
diagonal? If you have them, you can get the minimum to use for the
normalization. Since, all the values from the diagonal will be set to 0
anyway, you do not have to change your use of pdist, you just have to
get the non-normalized values for the diagonal on the side of what you
currently do.
On 07/07/15 11:18, Hub wrote:

I re-open this thread because I'm trying to optimize the computation
of the distance matrix.
So far so good, my method is between 6-8 times faster to the previous
one (thanks to pdist method
http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.distance.pdist.html).
I compute only the condensed matrix (i.e upper triangle of the matrix)
and with squareform method
http://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.spatial.distance.squareform.html,
I get the whole matrix.
Unfortunately, I have trouble with the normalization. Currently, the
diagonal was set to its minimum value and then the minimum value of
the whole matrix was searched.
With my calculation my diagonal is set to 0, so I search the min value
in my condensed matrix but this min value could be the diagonal
value... I cannot have the same matrix distance as before.
Since the diagonal value is pointless, I think normalize by this
minimum value is not correct. The minimum value should be search in
the upper triangle.
What do you think?
—
Reply to this email directly or view it on GitHub
https://github.com/pierrepo/PBxplore/issues/62#issuecomment-119134428.

Funny, I send a mail to @alexdb27 about this point yesterday ;-)
So far, similarity scores between sequences are computed for the full matrix (diagonal included).
Values on the diagonal are then set to the minimum value found in the matrix (that is necessary on the diagonal).
Finally, the distance is computed, but bare in mind we need the min and max value of the score matrix to compute the distance :
distance = 1 - (score - mini)/(maxi - mini)
Since the score of the diagonal is mini, the distance on the diagonal becomes 0. I guess this is what you want?
However, I do not know if pdist() is able to handle all these steps, especially the one where the diagonal of the score matrix is set to its minimum value?

Okay, I see your points. Indeed, the normalization should be done through the minimum value of the diagonal, it makes sense.
I'll see how i can compute the diagonal.

Guys, I am puzzled about something.
From the substitution matrix, we have:
score(d/d) =  221
score(j/j) =  768
score(k/k) =  568
score(j/k) =  196
score(j/d) = -173
score(d/k) = -585
Say we have three sequences: ZZdddZZ, ZZjjjZZZ and ZZZjjkZZZ.
Scores between sequences are:
score(ZZdddZZ/ZZdddZZ) = 663
score(ZZjjjZZ/ZZjjjZZ) = 2304
score(ZZjjkZZ/ZZjjkZZ) = 2104
score(ZZjjjZZ/ZZjjkZZ) = 1721
score(ZZjjjZZ/ZZdddZZ) = -519
score(ZZjjkZZ/ZZdddZZ) = -931
The corresponding matrix is:
           ZZdddZZ  ZZjjjZZ  ZZjjkZZ
ZZdddZZ      663     -519     -931
ZZjjjZZ              2304     1721
ZZjjkZZ                       2104

If we set the diagonal to the minimum value of the diagonal we get:
           ZZdddZZ  ZZjjjZZ  ZZjjkZZ
ZZdddZZ      663     -519     -931
ZZjjjZZ              663      1721
ZZjjkZZ                        663

We then will have an issue while computing the distance.
We should instead set the diagonal to the maximum value of the diagonal :
           ZZdddZZ  ZZjjjZZ  ZZjjkZZ
ZZdddZZ     2304     -519     -931
ZZjjjZZ              2304     1721
ZZjjkZZ                       2304

Don't you think?

Yes, it seems we need to set to the maximum, hence  distance = 1 - (score -mini)/(maxi - mini) would equal 0.
Plus in the code, the formula is still:  distance = 1 - (score + abs(min))/(maxi - min)
But, what happens if the maximum is not on the diagonal? The distance on the diagonal will not be set to 0...

I guess the maximum of the score matrix is necessary in the diagonal. @alexdb27 could you comment on this?
I am aware the formula to compute the distance is wrong in the code. I would like to correct this today.

On 07/07/15 13:01, Hub wrote:

Yes, it seems we need to set to the maximum, hence |distance = 1 -
(score -mini)/(maxi - mini)| would equal 0.
Plus in the code, the formula is still: |distance = 1 - (score +
abs(min))/(maxi - min)|
But, what happens if the maximum is not on the diagonal? The distance
on the diagonal will not be set to 0...
—
Reply to this email directly or view it on GitHub
https://github.com/pierrepo/PBxplore/issues/62#issuecomment-119168979.

Before the normalization, we compute a similarity matrix. I cannot see a
case where the maximum value is not on the diagonal. Do you ?

@jbarnoud +1

I don't see either but could it worth a test case/check in the code?

I'll add a very simple test.
Maybe @alexdb27 can confirme to us that the maximum is always on the diagonal?

A distance matrix is a matrix with distance. So, the diagonal must be at zero.
I propose a little game:
663	  -519	  -931
-----    2304	1721
----- -------	2104
second step:
663	-519	-931
-519	2304	1721
-931	1721	2104
third step:
1594	412	0
412	3235	2652
0	2652	3035
fourth step:
0	1182	      1594
2823	0	583
3035	383	   0
fifth and last:
0	4005	4629
----	0	966
----	----	0
Sincerely

PS: you write too fast @pierrepo @jbarnoud @HubLot

@alexdb27 I did not really understand the little game ;-(
I agree the diagonal of a distance matrix must be 0 but we are not sure how to compute the distance of other parts of the matrix.

On 07/07/15 13:28, Hub wrote:

I don't see either but could it worth a test case/check in the code?
—
Reply to this email directly or view it on GitHub
https://github.com/pierrepo/PBxplore/issues/62#issuecomment-119176900.

@HubLot I have a test version were I check with assertions that the
diagonal is 0 (because I do not set it explicitly), that there is no
negative values, and that that the maximum value is 1.
@alexdb27 @pierrpo Careful not to confuse the similarity matrix we get
from the substitution matrix (where the maximum value should be on the
diagonal) with the distance matrix that we get after normalization
(where the diagonal must be 0).

Thhe little game is the principle to normalize it in a simple way:
1- the data :
663 -519 -931
----- 2304 1721
----- ------- 2104
second step, simply do the matrix
663 -519 -931
-519 2304 1721
-931 1721 2104
third step, in regards to the diagonal, you "positive" the matrix (it is a question , must it be the matrix or the column. I've some personal question to myself)
1594 412 0
412 3235 2652
0 2652 3035
fourth step, diagonal is at zero by row (or column), with a simple difference with the original value of the diagonal:
0 1182 1594
2823 0 583
3035 383 0
fifth and last : back to the half-matrix by adding (j,i) to (i,j)
0 4005 4629
---- 0 966
---- ---- 0

@pierrepo I hope it explain you how i see the question
@jbarnoud @HubLot it is too funny !!

@alexdb27 Sorry I did not understand steps 4 and 5...

what !!
https://www.youtube.com/watch?v=iCrargw1rrM

4th, we take the first line:
1594 412 0 => (a) minus the max give 0	-1182 -1594
(b) then abs => 0	1182	1594
5th step, you have a non-symetric matrix so you add the symetrical cell to the one upper.
we have 0	1182	1594
2823	0	583
3035	383	0
so we want a half matrix
(0,0) (0,1) (0,2)
-----   (1,1) (1,2)
----- ------  (2,2)
(0,1) is the sum of (0,1) and (1,0) 1182+2823=4005
(0,2) is the sum of (0,2) and (2,0) 1594+3035=4629
(1,2) is the sum of (1,2) and (2,1) 583+383 = 966
It is my point of view others can be done.
line 1 is 0	1182	1594

authors: HubLot alexdb27 jbarnoud pierrepo

repo: pierrepo/PBxplore


text:
Build Error

Running cargo run --release gives the following error (I omitted three warnings) on Fedora 40:
Compiling hncli v0.1.0 (/home/<uname>/repos/hncli)

[...]

error[E0716]: temporary value dropped while borrowed
   --> src/ui/components/widgets/text_input.rs:268:14
    |
267 |         let rendered_value = if self.password_mode {
    |             -------------- borrow later stored here
268 |             &self.masked_value()
    |              ^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
269 |         } else {
    |         - temporary value is freed at the end of this statement
    |
    = note: consider using a `let` binding to create a longer lived value

For more information about this error, try `rustc --explain E0716`.
warning: `hncli` (bin "hncli") generated 3 warnings
error: could not compile `hncli` (bin "hncli") due to previous error; 3 warnings emitted

@kataklasm Could not reproduce (what is your rustc version?) but fixed the concerned code, which is no longer needed due to a cut feature.
See the PR: https://github.com/pierreyoda/hncli/pull/6

Thanks, that fixed it!

authors: kataklasm pierreyoda

repo: pierreyoda/hncli


text:
Check the update archive isssue

Here is the error I'm getting:
UPDATE FOUND: 1.0.2 (current version: 1.0)

DESCRIPTION: Minor bug fixes

» Update, downloading ...........

ERROR DURING UPDATE (!!check the update archive!!) --TRY to restore OLD status ........... Exception => The "D:\XAMPP\htdocs\test2\application/backup_20181210" directory does not exist.
[ FAILED ]
Backup folder is located in: D:\XAMPP\htdocs\test2\application/backup_20181210.
Remember to restore System UP-Status through shell command: php artisan up.

My config file:
'tmp_path' => '/../tmp',
'update_baseurl' => 'https://rainn.xyz/x71927a/21dates',
// Doing this in the route itself
'middleware' => ['web', 'auth'],
// Because I already have a permissions system that has middleware
'allow_users_id' => false

Routes file(commented out middleware for testing purposes):
Route::get('updater/check', 'pcinaglia\laraupdater\LaraUpdaterController@check')->name('updater-check')/*->middleware('permission:manage-updater')*/;
Route::get('updater/currentVersion', 'pcinaglia\laraupdater\LaraUpdaterController@getCurrentVersion')->name('updater-currentversion')/*->middleware('manage-updater')*/;
Route::group(['middleware' => config('laraupdater.middleware') ], function(){
    Route::get('updater/update', 'pcinaglia\laraupdater\LaraUpdaterController@update')->name('updater-update');
})/*->middleware('permission:manage-updater')*/;

Thank in advance for your help. I'll keep trying but I'd love to hear your suggestions.
Let me know if you need more information.

Did you ever figure this out? I just did through some trial and error (and some debugging of the code). In your config, make sure that the directory exists. In my case, I set it to base_path().'/tmp' and made sure that I had a tmp folder in the root of my project.
Apparently, this package does not make or even attempt to make the tmp directory where your update archive will live during the process.
Hope this helps anyone else stuck on this.

authors: Rainnerz dcortez

repo: pietrocinaglia/laraupdater


text:
Update README.md

add plugin
Changes
add snowpack-plugin-inliner
Testing

cool idea! Looking forward to checking it out, thanks for adding!

authors: FredKSchott fansenze

repo: pikapkg/snowpack


text:
🛑 Newsletter URL is down

In 383edee, Newsletter URL (https://news.pik.farm/sign-up) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Newsletter URL is back up in 9a6a909 after 23 minutes.

repo: pikfarm/PikfarmStatus


text:
🛑 Newsletter URL is down

In 835434c, Newsletter URL (https://news.pik.farm/sign-up) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Newsletter URL is back up in ae68622 after 30 minutes.


text:
🛑 www.pikfarm.com is down

In 1ea4ab0, www.pikfarm.com (https://www.pikfarm.com) was down:

HTTP code: 0
Response time: 0 ms

Resolved: www.pikfarm.com is back up in 046d12b after 19 minutes.


text:
🛑 www.pik.farm is down

In 013270a, www.pik.farm (https://pik.farm) was down:

HTTP code: 0
Response time: 0 ms

Resolved: www.pik.farm is back up in 19cb173 after 1 hour, 25 minutes.


text:
🛑 Stripe Test Endpoint URL is down

In 4e39113, Stripe Test Endpoint URL ($STRIPETESTAPI) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Stripe Test Endpoint URL is back up in 167edc8 after 1 hour, 24 minutes.


text:
The method asRenderedText is flagged

with a comment on wrong/strange usage of super. This should be fixed.

Fixed by PR #7

repo: pillar-markup/BeautifulComments


text:
ST7789: Experimental 8-bit framebuffer

A 340x240 16-bit framebuffer uses a whopping 150k of RAM. This is relatively okay in C++ but causes issues in MicroPython where the gc_heap is only 192k.
At the expense of available colours and the added cost of a per-row palette lookup, this experimental hack of ST7789 maintains an implicit palette of created colours and performs a lookup to uint16_t before transferring each row to the SPI  or Parallel LCDs.
PicoGraphics starts up with a fully allocated RGB332 palette, which the user can flush with "flush_palette" to create an empty 256 entry, uint16_t palette they can populate as required.
Calling set_pen(r, g, b) or create_pen(r, g, b) will by default truncate to RGB332 for backwards compatibility. If allocating palette colours on the fly- such as in the balls demo or a GUI that uses very few colous- you can supply the argument "truncate=False" to preserve the RGB565 colour and add it to the palette verbatim.
TODO

[ ] Handle a failure to allocate a palette colour (return -1 if we've run out of palette space?)
[ ] Provide MicroPython bindings for palette put/get methods

@alphanumeric007 this may be relevant to your interests!

Yes, that may be a big advantage for me. I pretty well stick to the basic colors. Red, Yellow, Green, and Blue. And on occasion Orange and Violet. I have a PICO Breakout Garden Base, and a couple of the 1.5" st7789 LCD Breakouts I can use for testing if that helps?

No great need to test in depth, but it should get you back about 75K of RAM in your dual display setup. Or let you have separate framebuffers if you really want!
Your limited use of colour should make it pretty much a drop-in replacement and you wont notice much. To use your specified colours you can trash the default palette:
st7789.flush_palette()

And specify not to truncate new colours to RGB332 on creation:
st7789.create_pen(255, 0, 255, truncate=False)

Or create all your colours up-front, which returns an 0-255 palette index:
GREEN = st7789.create_pen(0, 255, 0, truncate=False)
st7789.set_pen(GREEN)

I might actually force this behavior at the expense of upsetting a few people who've used  set_pen(r, g, b) since it will make those function calls a little faster.
I hate breaking compatibility with user code, but we've got some bad design choices to fix!

Nice idea! It makes the above board far more useful in MicroPython.

You can also add a way to detach and free the FB temporarily. Since the display contains its own RAM, if we TEMPORARILY need lots of RAM (eg. to load an image to prepare a printout to a thermal printer, calculate a QR code) it would be of great help to do the following:
a) Free the framebuffer + garbage collect (gain 75K of RAM)
b) The previous display image remains on the LCD, backed-up by the controller RAM
c) Do the calculations that need RAM - cannot display anything at that point
d) Free memory, garbage collect, re-create Framebuffer and continue.
e) We just have to repaint the full frame

Thanks a lot!

Done as described above. Don't uh... try to draw while the framebuffer is unset :laughing: the library will not check.

Thanks Phil =), very much appreciated. I will tinker with this over the weekend. Just poured myself a grog of Captain Morgan's Dark Rum. It's the Pirate thing to do on a Friday evening. ;)

I've updated the Pico Display Python examples to demonstrate some of the changes.
To use custom colours:
display.set_palette_mode(st7789.PALETTE_USER)
BLACK = display.create_pen(0, 0, 0)
CUSTOM = BLACK + 1
display.set_palette(CUSTOM, 255, 0, 255) # Set the CUSTOM entry to RED
display.set_pen(CUSTOM)

To easy init a display:
display = st7789.ST7789(st7789.DISPLAY_PICO_DISPLAY, rotate=0)

I am trying to support all rotations, but getting the settings right is tricky :laughing:  much testomg and tweaking to do.

One wrinkle for me is I have display1 and display2.
frame_buffer = bytearray(240 * 320 * 2)
display1 = st7789.ST7789(width=240, height=320, buffer=frame_buffer, slot=0)
display2 = st7789.ST7789(width=240, height=320, buffer=frame_buffer, slot=1)
So I'll have to do something like the following.
BLACK1 = display1.create_pen(0, 0, 0)
BLACK2= display2.create_pen(0, 0, 0)
BLACK = display.create_pen(0, 0, 0)
display1.set_pen(BLACK)
gets me a display not defined error. Which was why I went with
display1.set_pen(0, 0, 0)

@alphanumeric007 in the default RGB332 any colour you create on one display will be the same on the other, so you can create them once and use them on both. Internally it just crushes that colour to its RGB332 representation, then looks up and returns its index into the palette.

Latest build, slot param - and most others - have gone.
All SPI or Parallel pins must be supplied as a "pimoroni_bus". This has a helper factory to create pins for slots, see below:
BUF = bytearray(320 * 240)

BUS_BG_FRONT = pimoroni_bus.SPISlot(0)
BUS_BG_BACK = pimoroni_bus.SPISlot(1)

display = st7789.ST7789(st7789.DISPLAY_PICO_DISPLAY_2, rotate=90, buf=BUF, bus=BUS_BG_FRONT)
display = st7789.ST7789(st7789.DISPLAY_PICO_DISPLAY_2, rotate=90, buf=BUF, bus=BUS_BG_BACK)

rotate is intended to work properly on all displays, but probably doesn't yet. This replaces flipping the WIDTH/HEIGHT (which you no longer supply) and also the rotate180 nonsense.
To get the WIDTH/HEIGHT of a display - for portable code - use:
WIDTH, HEIGHT = display.get_bounds()

I've finally arrived at something I'm more or less happy with for the Python API. Hopefully it wont change much from here. Albeit there are certainly some considerable DMA performance gains to be had for the palette-based display refresh.
My sinuses are screaming at me to stick a steam train up each nostril. Will clean this up for release this coming week.

Ok, so how do I create the color once, and use it on both displays, code wise? Looks up at very dark light bulb hovering over head.

@alphanumeric007 for USER palettes I think you'd need a wrapper function to create the same colour on each display.
def create_pen(r, g, b):
    display1.create_pen(r, g, b)
    return display2.create_pen(r, g, b)

There's no reason why the palettes shouldn't stay completely in sync.
For RGB323 palette mode display1.create_pen(r, g, b) will always return the same index as display2.create_pen(r, g, b) even when called out of order. The colours are fixed and you're just getting an index into the fix palette.
It stuck me last night that you can just draw into one display since they share the same back buffer, but calling display2.update() would still use the palette from display2.

I just now figured it out. Well one way to do it anyway. This is with the stock framebuffer, not the new 8 bit one.
I changed all my instances of display1, to just display.
white = display.create_pen(255, 255, 255)
display.set_pen(white) <<worked
display2.set_pen(white) << also worked. =)

Ah with the stock framebuffer create_pen() always returns a packed 16-bit colour value, so it's always the same on any display.
Internally it just does:
uint16_t p = ((r & 0b11111000) << 8) |
             ((g & 0b11111100) << 3) |
             ((b & 0b11111000) >> 3);

return __builtin_bswap16(p);

Whereas the new 8-bit stuff - by default (in RGB332 mode) - does:
return (r & 0b11100000) | ((g & 0b11100000) >> 3) | ((b & 0b11000000) >> 6)

Either way a created pen is transferable, the only differences is how many bits of colour information are thrown away.

I wasn't using create_pen at all in my current code. I was doing the (255, 255, 255) thing.
I figured I'd get that working with dual displays first, with the current uf2 file.
Then try your new 8bit buffer uf2. If I then have issues it should be easier to figure out what's "now" not working. ;)

Just flashed the new uf2 to that Pico.
This works > display = st7789.ST7789(st7789.DISPLAY_PICO_DISPLAY_2, rotate=90)
But this doesn't > display = st7789.ST7789(st7789.DISPLAY_PICO_DISPLAY_2, rotate=90, buf=BUF, bus=BUS_BG_FRONT)
TypeError: extra keyword arguments given
I added / edited to this
import st7789
import pimoroni_bus
BUF = bytearray(320 * 240)
BUS_BG_FRONT = pimoroni_bus.SPISlot(0)
BUS_BG_BACK = pimoroni_bus.SPISlot(1)
display = st7789.ST7789(st7789.DISPLAY_PICO_DISPLAY_2, rotate=90, buf=BUF, bus=BUS_BG_FRONT)
display2 = st7789.ST7789(st7789.DISPLAY_PICO_DISPLAY_2, rotate=90, buf=BUF, bus=BUS_BG_BACK)

Ah, OK, that fixed it. Working now with that latest 8bit test uf2 file. Next step is to do the 8-bit edits etc.
I'm using your latest test file, but with a normal buffer size.
BUF = bytearray(240 * 320)
BUS_BG_FRONT = pimoroni_bus.SPISlot(0)
BUS_BG_BACK = pimoroni_bus.SPISlot(1)
display = st7789.ST7789(st7789.DISPLAY_PICO_DISPLAY_2, rotate=270, buffer=BUF, bus=BUS_BG_FRONT)
display2 = st7789.ST7789(st7789.DISPLAY_PICO_DISPLAY_2, rotate=270, buffer=BUF, bus=BUS_BG_BACK)

I hate to be a pest, but I'm a bit lost with all the different bits of code posted above?
Not sure what bits to use?

A first port of cal would be to replace any instance of:
display.set_pen(r, g, b)

With a:
COLOR = display.create_pen(r, g, b)
display.set_pen(COLOR)

Then give all your colours sensible names and move their creation up to the top of the file after display init.
You can also just opt for the easy way and do:
display.set_pen(display.create_pen(r, g, b))

That's all already done Phil.  Once I got the one color (white) working I modified all my other code for custom colors.
white = display.create_pen(255, 255, 255)
black = display.create_pen(0, 0, 0)
red = display.create_pen(255, 0, 0)
green = display.create_pen(0, 255, 0)
blue = display.create_pen(0, 0, 255)
yellow = display.create_pen(255, 255, 0)
orange = display.create_pen(255, 140, 0)
grey = display.create_pen(120, 120, 120)
violet = display.create_pen(255, 0, 255)

Oh nice!
How's it coming together? Is there anything you're stuck on?
I think I mostly need to fix rotation on the circular display before I can merge this and release another official pre-release.
I've gone deep down a rabbit hole of breaking things and scrutinizing our codebase though :laughing:

It's coming along good. Right now I'm using the full buffer, not the 8 bit.  So I'm thinking I need use "RGB332" Mode or "USER" Mode?
You have made a bunch of updates since this started so I'm not sure what may have changed or how to set it to 8 bit.

nBytes = gc.mem_free() is saying I have 98208 bytes free. That's up ~70 kb from what I had before. So I guess I'm already there?

nBytes = gc.mem_free() is saying I have 98208 bytes free. That's up ~70 kb from what I had before. So I guess I'm already there?

Yup! You're there.
Sorry for the radio silence- sinus infection totally floored me for a few days.

I know what its like to be MIA. I have back issues and sciatica. The sciatica is a literal pain in the but that makes sitting in a chair for any length of time painful. When my back is at its worst I'm horizontal in bed for days on end. Just my XBOX for internet stuff. The onboard keyboard is frustrating to use so I don't post much from the XBOX.
Anyway, yeah, I figured out I was good to go. Just have to find my getup and go, lol.

Well instead of finishing the things on my TODO list we realised a unified graphics library that works for our UC8159 e-ink displays would be nice... so I now have a working 4-bit version of this with an 8-colour palette.
Uses about 38K RAM for a 320x240 display at the cost of only supporting 8 colours in any given update.

@alphanumeric007 I have unleashed horrible changes for you to catch up with :laughing:
Main Changes
Functions removed:

set_palette_mode - obsolete, pen mode is now picked in constructor
set_palette - now renamed update_pen which will replace a palette entry in P modes (bug: also does this in RGB332, do not rely on this)
reserve_palette - obsolete, just use create_pen() to return a palette index, and update_pen to update that colour

The BIG change here is that st7789 is gone. You must now:
import picographics
display = picographics.PicoGraphics(display=picographics.DISPLAY_PICO_DISPLAY_2)

Setting your buffer type (RAM usage vs available colours)
PicoGraphic has a new pen_type argument which accepts one of:

PEN_P4 - 4 bits per pixel mode, 8 colours, default palette loosely matches our 7-colour e-ink
PEN_P8 - 8 bits per pixel mode, 256 colours, empty palette
PEN_RGB332 - 8 bits per pixel mode, 256 colours, FIXED RGB332 palette. We might try to PIO accelerate this.
PEN_RGB565 - 16 bits per pixel mode, 65K colours (true colour)

P4 mode will use 320*240/2 bytes of RAM for Pico Display 2. That's about 38K. Handy if you want very few colours but tiny RAM usage.
P8 mode will use 320*240 bytes of RAM. That's 75K. Etc. etc.
The ST7735-based 160x80 LCD is now supported in PicoGraphics as DISPLAY_LCD_160X80.
Known issues

set_framebuffer is currently broken
PEN_RGB332 mode will currently let you replace palette colours, it probably shouldn't since if we PIO accelerate the conversion from RGB332 -> RGB565 the palette will be immutable.
Functions like update_pen do not return an error when they are unsupported, they just don't work

Solarized palette in 8-colour mode:
import picographics

lcd = picographics.PicoGraphics(display=picographics.DISPLAY_LCD_160X80, pen_type=picographics.PEN_P4)

# Some friendly names for our eight colour palette
BASE = 0
YELLOW = 1
RED = 2
MAGENTA = 3
VIOLET = 4
BLUE = 5
CYAN = 6
GREEN = 7

lcd.set_font("font8")

# Prime the palette with solarized dark!
lcd.set_palette([
    (0x00, 0x2b, 0x36),
    (0xb5, 0x89, 0x00),
    (0xdc, 0x32, 0x2f),
    (0xd3, 0x36, 0x82),
    (0x6c, 0x71, 0xc4),
    (0x26, 0x8b, 0xd2),
    (0x2a, 0xa1, 0x98),
    (0x85, 0x99, 0x00)
])

lcd.set_pen(BASE)
lcd.clear()

for pen in (1, 2, 3, 4, 5, 6, 7):
    lcd.set_pen(pen)
    lcd.text("Hello World - {}".format(pen), 0, pen * 11 - 11, 160)

lcd.update()

Added a get_buffer_size method so you can take the guesswork out of allocating a correctly-sized buffer:
from picographics import PicoGraphics, get_buffer_size, DISPLAY_PICO_DISPLAY_2, PEN_RGB565

buffer = bytearray(get_buffer_size(DISPLAY_PICO_DISPLAY_2, PEN_RGB565))
lcd = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, rotate=180, pen_type=PEN_RGB565, buffer=buffer)

Wow, your a busy man there Phil. I'll catch up at some point. Been busy with mundane chores like yardwork etc. =(

I can relate to what your up to. I usually start out with a "big" block or "working" code. Then at some point i want to add and or refine it. Then I have one of those "why did I do it that way moments?" Then do a change it, break it, fix it. Waash rinse and repeat. =)

Just about time to grab my Pico Breakout Garden and have a look see.
I have a Display Pack V1 sitting here doing nothing at the moment too.

Confused as to how to setup dual displays?
Using the following I don't get any errors, but both displays are black / blank? I don't think the backlights are on?
from pimoroni_bus import SPIBus
from pimoroni_bus import ParallelBus
from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY_2, PEN_RGB332
spibus = SPIBus(cs=22, dc=16, sck=18, mosi=19)
spibus2 = SPIBus(cs=17, dc=16, sck=18, mosi=19)

display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, bus=spibus, pen_type=PEN_RGB332)
display2 = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, bus=spibus2, pen_type=PEN_RGB332)

display.set_backlight(1.0)
display2.set_backlight(1.0)

spibus = SPIBus(cs=22, dc=16, sck=18, mosi=19, bl=21 )
spibus2 = SPIBus(cs=17, dc=16, sck=18, mosi=19, bl=20)
Got the backlights working. =)
Just have to figure out how to rotate the image?

My BME280 is now not working correctly? I get a reading, but it then just stays static and won't update. My BME680 is working just fine. I can pinch it with my fingers and watch the temp and humidity readings change. Nothing happens with the BME280.
My code and the micro python demo do the same thing. Stock address and 0x77. Even unplugged the BME680 while testing. It was working with an earlier official build. Not sure when it stopped working?

@alphanumeric007 I "fixed" it in this commit  - https://github.com/pimoroni/pimoroni-pico/commit/496c1a3b45a7bffab3d249e387d4c3e1653e2e4f - and this branch has since been rebased upon it.
The problem you describe is exactly what I was seeing when I fixed it. I am flummoxed!

I must have grabbed the wrong (work in progress) uf2 file. I'll go get the latest test build and see how it works.

BME280 working now Phil. My bad, grabbed the wrong uf2 file. .
If I use PEN_P8 I only get one display. Just a FYI, that may be a limitation of that mode. RGB332 works just fine though. =)

Whew regarding the BME280!

If I use PEN_P8 I only get one display. Just a FYI, that may be a limitation of that mode

That's odd. PEN_P8 and RGB332 should be the same size! I will look into it.

Well dontchaknow PEN_P8 was using a 16-bit pen size to calculate the buffer size. Fixed! Good spot, thank you!

PEN_P8 still not working for me? I may have my code messed up though?
The screen is split in two, and then the top half split it two again, with my text duplicated in the two top halves?
import time
import picographics
from pimoroni_bus import SPIBus

from picographics import PicoGraphics, get_buffer_size, DISPLAY_PICO_DISPLAY, PEN_P8
#from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY, PEN_RGB332

buf = bytearray(get_buffer_size(DISPLAY_PICO_DISPLAY, PEN_P8))

display = PicoGraphics(display=DISPLAY_PICO_DISPLAY, rotate=270 ,pen_type=PEN_P8,  buffer=buf)
#display = PicoGraphics(display=DISPLAY_PICO_DISPLAY, rotate=270, pen_type=PEN_RGB332)

display.set_backlight(1.0)

black = display.create_pen(0, 0, 0)
red = display.create_pen(255, 0, 0)
green = display.create_pen(0, 255, 0)
blue = display.create_pen(0, 0, 255)

while True:
    display.set_pen(red)    # Set pen to a red
    display.clear()         # Fill the screen with the colour
    display.set_pen(black)  # Set pen to black
    #display.text("pico display pack", 10, 10, 240, 6)   # landscape
    display.text("pico display pack", 10, 10, 135, 3)    # potrait
    display.update()        # Update the display
    time.sleep(1.0)

    display.set_pen(green)  # Set pen to a green
    display.clear()         # Fill the screen with the colour
    display.set_pen(black)  # Set pen to black
    #display.text("pico display pack", 10, 10, 240, 6)   # landscape
    display.text("pico display pack", 10, 10, 135, 3)    # potrait
    display.update()        # Update the display
    time.sleep(1.0)

    display.set_pen(blue)   # Set pen to a blue
    display.clear()         # Fill the screen with the colour
    display.set_pen(black)  # Set pen to black
    #display.text("pico display pack", 10, 10, 240, 6)   # landscape
    display.text("pico display pack", 10, 10, 135, 3)    # potrait
    display.update()        # Update the display
    time.sleep(1.0)

Yup that's apparently very broken. Looking into it.

Working now Phil. =)
Is there any advantage to me, to use PEN_P8 over PEN_RGB332? In my dual display setup.

Haven't figured out how to get PEN_P4 mode to work?
MicroPython v1.18 on 2022-06-14; Raspberry Pi Pico with RP2040
Type "help()" for more information.

%Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File "", line 30, in
ValueError: create_pen failed. No matching colour or space in palette!

import time
import picographics
from pimoroni_bus import SPIBus

from pimoroni import Button
button_a = Button(12)
button_b = Button(13)
button_x = Button(14)
button_y = Button(15)

from pimoroni import RGBLED
led = RGBLED(6, 7, 8)

from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY, PEN_P4
#from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY, PEN_P8
#from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY, PEN_RGB332

#buf = bytearray(get_buffer_size(DISPLAY_PICO_DISPLAY, PEN_P4))
#buf = bytearray(get_buffer_size(DISPLAY_PICO_DISPLAY, PEN_P8))

display = PicoGraphics(display=DISPLAY_PICO_DISPLAY, rotate=270 ,pen_type=PEN_P4)
#display = PicoGraphics(display=DISPLAY_PICO_DISPLAY, rotate=270 ,pen_type=PEN_P8)
#display = PicoGraphics(display=DISPLAY_PICO_DISPLAY, rotate=270, pen_type=PEN_RGB332)

display.set_backlight(1.0)

black = display.create_pen(0, 0, 0)
red = display.create_pen(255, 0, 0)
green = display.create_pen(0, 255, 0)
blue = display.create_pen(0, 0, 255)

while True:
    display.set_pen(red)    # Set pen to a red
    display.clear()         # Fill the screen with the colour
    display.set_pen(black)  # Set pen to black
    #display.text("pico display pack", 10, 10, 240, 6)   # landscape
    display.text("pico display pack", 10, 10, 135, 3)    # potrait
    display.update()        # Update the display
    led.set_rgb(255, 0, 0)
    time.sleep(1.0)

    display.set_pen(green)  # Set pen to a green
    display.clear()         # Fill the screen with the colour
    display.set_pen(black)  # Set pen to black
    #display.text("pico display pack", 10, 10, 240, 6)   # landscape
    display.text("pico display pack", 10, 10, 135, 3)    # potrait
    display.update()        # Update the display
    led.set_rgb(0, 255, 0)
    time.sleep(1.0)

    display.set_pen(blue)   # Set pen to a blue
    display.clear()         # Fill the screen with the colour
    display.set_pen(black)  # Set pen to black
    #display.text("pico display pack", 10, 10, 240, 6)   # landscape
    display.text("pico display pack", 10, 10, 135, 3)    # potrait
    display.update()        # Update the display
    led.set_rgb(0, 0, 255)
    time.sleep(1.0)

PEN_P4 working now on my Pico Display single test setup. =)
Next step is to try some of this on my dual Pico Display setup.

Something is broken in those latest test uf2 files?
I'm getting "Unknown USB Device (Device Descriptor Request Failed)" and Thonny won't connect?
1.18.7 is fine, but
pimoroni-picolipo_16mb-156ab5c6b4d5a12b3ae6458b53f171d59578bffb-micropython.uf2
and some of the previous versions have an issue.

For dual display you should use something like:
from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY_2, PEN_P8, get_buffer_size
from pimoroni_bus import SPIBus

spibus = SPIBus(cs=17, dc=16, sck=18, mosi=19, bl=20)
spibus2 = SPIBus(cs=22, dc=16, sck=18, mosi=19, bl=21)

buffer = bytearray(get_buffer_size(DISPLAY_PICO_DISPLAY_2, PEN_P8))

display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, rotate=270, buffer=buffer, bus=spibus, pen_type=PEN_P8)
display2 = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, rotate= 270, buffer=buffer, bus=spibus2, pen_type=PEN_P8)

Note the creating and supplying a buffer step from before, except now we have the get_buffer_size helper to give us the right size for a given display/pen type combo.
The latest builds seem fine from my end- totally sure it's not a flaky USB connection?

I had that buffer code in earlier, then took it out thinking I didn't need it. PEN_RGB332 worked just fine without it on my dual display setup, so I left it out.
All my Pico's with the official 1.18.7 connect just fine. And that Pico Lipo connects just fine with 1.18.7. If I put the latest test build on it it just errors when plugged in.
Thonny just reports the following.
Couldn't find the device automatically.
Check the connection (making sure the device is not in bootloader mode) or choose
"Configure interpreter" in the interpreter menu (bottom-right corner of the window)
to select specific port or another interpreter.
This is on my Windows 10 PC. No issues connecting on my Pi 400 running Pi OS. Same USB Cable.

Looks like I just got lucky on my Pi 400. I did that edit but only got one display, nothing on display 2 with P8. Did a reset and then couldn't connect. Thonny showed that same Couldn't find the device automatically message.
Could I have messed up my Pico Lipo with all this testing? The official 1.18.7 is fine so I'm thinking it should be OK?
Another bit of weirdness is if I try to download one of the test uf2 files on my Pi 400, they aren't clickable / downloadable? If I go here on my Pi 400, its just plain text, they don't turn blue when hovered over?
https://github.com/pimoroni/pimoroni-pico/actions/runs/2496108692

Hmm in both Pico LiPo cases we should have 1024K for binary size, so they're a country mile from exploding themselves- in Pico relative terms at least.
You might need a Pico LiPo sized flash_nuke.uf2 you can normally take a backup of your whole board beforehand (using picotool: https://github.com/raspberrypi/picotool) if you have any code that's not saved elsewhere.
Perhaps GitHub is spitting broken .uf2 files at you!

Dropped "pimoroni-picolipo_16mb-4f4b88501a92daf32b64808fa0d4055c301cfe41-micropython.uf2" onto it and so far so good. Started and stopped it a few times with no issues. Unplugged it and plugged it back and no error message. My code is running fine with PEN_RGB332 and the buffer code added back in. P8 and P4 won't work with this uf2 though?

Where does one find a 16mb flash nuke file? And does it actually need to be used?

Just added I2C OLED support into MicroPython. Needs some fleshing out, but it works with our 128x128 OLED:
from picographics import PicoGraphics, DISPLAY_I2C_OLED_128X128, PEN_1BIT
from pimoroni_i2c import PimoroniI2C

bus = PimoroniI2C(4, 5)

display = PicoGraphics(DISPLAY_I2C_OLED_128X128, pen_type=PEN_1BIT, bus=bus)

display.set_pen(1)
display.clear()
display.set_font("gothic")
display.set_pen(0)
display.text("Hello World", 0, 10, 0, 0.5)
display.update()

This means you can use this little display with all of our boards sporting a Stemma/Qwiic connector.

It looks like what ever Device Descriptor issue I'm having is at my end.
If I use the SparkFun Cerberus USB Hub Cable, no errors and Thonny connects without issue.
Use a stock straight through cable and I get the error message?
I'd say its either an issue with this PC or with Windows 10?
Tested with a brand new never used before Pi Pico with no headers.
I'm totally flummoxed by what's going on, but I have a working work around so I'll go with that for now.

Hey Phil, I have a tufty ;) question for you, but have lost that e-mail address you gave me.

Hey Phil, I have a tufty ;) question for you, but have lost that e-mail address you gave me.

I have a.... tufty answer for you... :eyes:

Merged and released as v1.19.0 - https://github.com/pimoroni/pimoroni-pico/releases/tag/v1.19.0
Open a new issue if you find any other bugs/have any other questions.
Thaannkk yooou to all involved!

authors: Doukakis Gadgetoid alphanumeric007

repo: pimoroni/pimoroni-pico