Formatting troubles

I've tried not to bother you with this but I am getting no where so I'm afraid I have to ask for help.
I'm having two issues with Maatwebsite/Laravel-Excel / PHPExcel that I can not find an answer to and I'm hoping that somebody out there can help.

I'm importing a csv and one of the columns has numbers in it with leading zeros that keep getting trimmed off. How can I prevent that? Preferable I would like all values to be treated as strings and not have the values manipulated at all.

Excel::load($filePath)->toArray();

I'm also exporting a csv that must have an empty last column in each row. The problem is that, that column is dropped on export. If I add a space as the value then it remains but unfortunately I need the value to be empty.

fyi: I was able to resolve the second issue. I discovered that if I set the $nullValue argument in the fromArray method to anything but null, an empty string or any of the other known values in any column then it works. For example I set the $nullValue argument to "emptyHack" which is ridiculous but it worked.
I'm still stuck with the trimmed leading zeros issue though...

Fixed in 1.3.0. Until release you'll have to use 1.3.0@dev

Forgive me but I don't believe that the issue of leading zeros getting trimmed is resolved even in 1.3.0@dev.
For example if I am importing a CSV file and if I have a value '01234' and add the below test to ZerosHandlingReaderTest it fails. '01234' is not a far fetched use case. It is a US zipcode of which there are many that start with a zero but are also numeric. The bottom line is that '01234' is a string.
fyi: If I import the '01234' in excel from a cell formatted as text then the test passes.
I don't fell like this is Laravel-Excel's fault but rather PHPExcel trying to intelligently format the values. Even still it would be amazing to be able to use Laravel-Excel to load a file and tell it to tell PHPExcel to leave all cells as a string.
public function testNumericString()
{
    $got = $this->loadedFile->toArray();

    $this->assertSame('01234', $got[0][0]);
}

I see now, PHPExcel autoconverts it to a double. The tests I had added where cases where the rest was a string.
At the moment I don't have a solution inside this package, but I'm currently working on improving the complete import flow, so an improvement on this might be in the pipeline :)

sounds good. thanks for creating this amazing package!

For reference, the defaultValueBinder in the develop branch branch of PHPExcel tries to detect numeric values with a leading zero (when not immediately followed by a decimal point) and treat the value as a string without casting it to a numeric

I literally just discovered this. Is there a way to override or create a custom ValueBinder and have Laravel-Excel use that? For my particular use case I would just like:
public static function dataTypeForValue($pValue = null) {
   return PHPExcel_Cell_DataType::TYPE_STRING;
}
``

The whole point of value binders is that you can create your own to suit specific needs: the advanced value binder serves as an example, replicating MS Excel's GUI behaviour; but I've created custom binders in the past for loading data from non-standard CSV files (e.g. handling phone numbers)... the relevant section of the PHPExcel documentation explains how to configure the system to enable a custom binder, so it should be possible.

Nice, going to have a look at those soon! :)

So I though that I would take another stab at this and long story short I've been able extend Laravel-Excel to allow custom value binders and resolve my specific use case! I believe that my solution will greatly benefit other users as I have seen many others asking how to format their imported values to their own needs. Would you like a PR and if so to which brach? Also I feel like this new feature will need some documentation which I am willing to write but I don't see anywhere that I can submit that.

Nice to hear. Would be great if you could show the example of how it works so I can agree on the syntax. You can make the PR to the 1.3. I will push the code to 2.0 myself. Thanks.
And docs would be great. The docs are in the branch. So you can add a new md file in the import docs folder in the same PR.

OK, Ive create the PR. The documentation explains better but basically all you have to do is something like
class MyValueBinder extends PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder
{
  public function bindValue(PHPExcel_Cell $cell, $value = null)
  {
    if (is_numeric($value))
    {
      $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
      return true;
    }

    // else return default behavior
    return parent::bindValue($cell, $value);
  }
}

$myValueBinder = new MyValueBinder;
Excel::setValueBinder($myValueBinder)->load('file.xls', function($reader) {
        // reader methods
});

I am using this same syntax but it simply ignores numeric columns.
What I want is force all cells to be string type when reading.
I tried to implement this solution but it isn't working it simply skips all numeric columns

It's been awhile but I believe that all you need to do is this to force all cells to be string type.
class MyValueBinder extends PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder
{
  public function bindValue(PHPExcel_Cell $cell, $value = null)
  {
      $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING);
  }
}

$myValueBinder = new MyValueBinder;
Excel::setValueBinder($myValueBinder)->load('file.xls', function($reader) {
    // reader methods
});

ps: http://www.maatwebsite.nl/laravel-excel/docs/import#formatting

I am using exactly this syntax. value binder class is ok. But its still reading data types.
btw I am using this syntax to load excel sheet
Excel::filter('chunk')->load($filepath)->setValueBinder($myValueBinder)->chunk(2000, function($reader) use(&$questions) {
// do stuff
}

You have to set the value binder before you load the file.

What @patrickbrouwers said.

Thank you very much @patrickbrouwers for your support and follow up. I tried to do the same as you said to set value binder before loading the file but I somehow couldn't get it working.
Here is what I did.
$myValueBinder = new MyValueBinder;
$exlObj = Excel::filter('chunk')->setValueBinder($myValueBinder);

$exlObj->load($filepath)->chunk(2000, function($reader) use(&questions) {
});

But its raising and Exception here is the screenshot

I tried couple more variants with chunk filter and value binder but didn't have any luck.
Its just the chunk filter which I am not sure how to use with this value binder.
I am using version 1.3.7 for Laravel 4.2 btw.
Any help on this chunk filter with value binder will be much appreciated.

I honestly don't even know if this feature is available for Laravel 4.2

Hi, does this also work on xls?.. I was able to make it work with xlsx.. I'm still analysing the php excel structure but it's taking time so I'll ask here. Thanks.
I tried to display the value with the created class for value binder but again it only pass through that for xlsx.

Hi everybody
i need your help please, i would like to ask a question with Maatwebsite Excel that i want to read excel file in laravel 5.1, i try to use
$results = $reader->getSheetByName('Sheet1')->toArray(null,true,true,true);
my $results can response all of cells in my excel file but it response 1000 rows and A-Z column
it not my purpose, i need only value from column A to K only not at all,
do you any solution about this problem please give me some advice
Thank You

I am having the same issue where a zipcode column with leading zero values get trimmed.  This is happening even with using the binder from the documentation.  It seems the binder has no effect:
CSV File:
ID,Address 1,City,State,Zip
77145862,8 Circle Drive,Greenwich,CT,06830

ExcelCustomFormatBinder:
<?php

namespace App\Zal\Utils;

use PHPExcel_Cell;
use PHPExcel_Cell_DataType;
use PHPExcel_Cell_IValueBinder;
use PHPExcel_Cell_DefaultValueBinder;

class ExcelCustomFormatBinder extends PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder
{
    public function bindValue(PHPExcel_Cell $cell, $value = null)
    {
        // if (is_numeric($value))
        // {
        //     $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING); //PHPExcel_Cell_DataType::TYPE_NUMERIC

        //     return true;
        // }

        $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING);
        return true;

        // else return default behavior
        return parent::bindValue($cell, $value);
    }
}

Controller:
$path = 'temp/uploaded_file.csv';
$reader = \App::make('excel.reader');
$binder = new ExcelCustomFormatBinder;
$reader->setValueBinder($binder);
dd($reader->load($path)->first()->toArray());

returns:
[
    "id" => 77145862.0
    "address_1" => "8 Circle Drive"
    "city" => "Greenwich"
    "state" => "Ct"
    "zip" => 6830.0
]

Any idea on how to get the binder to actually change the type of cell values?  Am I doing something wrong?
Thanks for the package, btw!

Just wondering why you are doing $reader = \App::make('excel.reader'); instead of using Maatwebsite\Excel\Excel or the Excel facade?
$binder = new ExcelCustomFormatBinder;
$excel = Excel::setValueBinder($binder);
dd($excel->load($path)->first()->toArray());

I'm having a similar issue, although I'm trying to create() a CSV rather than load() one.
Is it something I'm doing wrong or do custom binders not work with the create() method?
P.S. this code all works fine without the binder stuff.
controller
use App\Classes\CustomValueBinder;

...

$binder = new `CustomValueBinder;`
Excel::setValueBinder($binder)->create('file-name', function ($excel) use ($headers, $placeholders, $data) {
    $excel->sheet('name', function ($sheet) use ($headers, $placeholders, $data) {
        // data
        $sheet->row(1, $headers);
        $sheet->row(2, $placeholders);
        $sheet->fromArray($data, null, 'A3', true, false);
    });
})->export('csv');

class
<?php

namespace App\Classes;

use PHPExcel_Cell;
use PHPExcel_Cell_DataType;
use PHPExcel_Cell_DefaultValueBinder;
use PHPExcel_Cell_IValueBinder;

class CustomValueBinder extends PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder
{
    public function bindValue(PHPExcel_Cell $cell, $value = null)
    {
        if (is_numeric($value)) {
            $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING);

            return true;
        }
        // else return default behavior
        return parent::bindValue($cell, $value);
    }
}

error
FatalThrowableError in LaravelExcelReader.php line 1081:
Fatal error: Call to a member function getProperties() on null

I'm having a similar issue, although I'm trying to create() a CSV rather than load() one.
Is it something I'm doing wrong or do custom binders not work with the create() method?
P.S. this code all works fine without the binder stuff.
controller
use App\Classes\CustomValueBinder;

...

$binder = new `CustomValueBinder;`
Excel::setValueBinder($binder)->create('file-name', function ($excel) use ($headers, $placeholders, $data) {
    $excel->sheet('name', function ($sheet) use ($headers, $placeholders, $data) {
        // data
        $sheet->row(1, $headers);
        $sheet->row(2, $placeholders);
        $sheet->fromArray($data, null, 'A3', true, false);
    });
})->export('csv');

class
<?php

namespace App\Classes;

use PHPExcel_Cell;
use PHPExcel_Cell_DataType;
use PHPExcel_Cell_DefaultValueBinder;
use PHPExcel_Cell_IValueBinder;

class CustomValueBinder extends PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder
{
    public function bindValue(PHPExcel_Cell $cell, $value = null)
    {
        if (is_numeric($value)) {
            $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING);

            return true;
        }
        // else return default behavior
        return parent::bindValue($cell, $value);
    }
}

error
FatalThrowableError in LaravelExcelReader.php line 1081:
Fatal error: Call to a member function getProperties() on null

I am using Exel::batch and same problem with  "Call to a member function getProperties() on null"

Same here with:
$xls = $excel->setValueBinder(new \PHPExcel_Cell_AdvancedValueBinder())
            ->create($this->getFilename(), function (LaravelExcelWriter $excel) use ($data) {
           ...
           ...
});

Error thrown:
exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to a member function getProperties() on null' in [DELETED]\vendor\maatwebsite\excel\src\Maatwebsite\Excel\Readers\LaravelExcelReader.php:1294

same here
$binder = new ExcelCustomFormatBinder;
Excel::setValueBinder($binder)->selectSheetsByIndex(0)->load($file, function($reader){
    //
});

throw
Call to a member function getProperties() on null
"line": 1294,
"file": "/home/vagrant/code/fulstore/vendor/maatwebsite/excel/src/Maatwebsite/Excel/Readers/LaravelExcelReader.php",
"class": "Symfony\\Component\\Debug\\Exception\\FatalThrowableError",

vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Cell.php
public function setValueExplicit($pValue, $pDataType)
{
// set the value according to data type
    switch ($pDataType) {
        case DataType::TYPE_NULL:
            $this->value = $pValue;

            break;
        case DataType::TYPE_STRING2:
            $pDataType = DataType::TYPE_STRING;
            // no break
        case DataType::TYPE_STRING:
            // Synonym for string
        case DataType::TYPE_INLINE:
            // Rich text
            $this->value = $pValue;

            break;
        case DataType::TYPE_NUMERIC:
            $this->value =  $pValue;

            break;
        case DataType::TYPE_FORMULA:
            $this->value =  $pValue;

            break;
        case DataType::TYPE_BOOL:
            $this->value =  $pValue;

            break;
        case DataType::TYPE_ERROR:
            $this->value =$pValue;

            break;
        default:
            throw new Exception('Invalid datatype: ' . $pDataType);

            break;
    }

    // set the datatype
    $this->dataType = 's';
    return $this->updateInCollection();
}

could you please help me resolve my issue?
https://github.com/Maatwebsite/Laravel-Excel/issues/2997 @devinfd @MaatwebsiteSupport

could you please help me resolve my issue?
https://github.com/Maatwebsite/Laravel-Excel/issues/2997 @devinfd @MaatwebsiteSupport


add RFC: Backup and Restore

Preview

I propose to prioritize snapshot backup and time travel query.
After that we can consider PITR.


[Icon request] People with age X are allowed / Adult content / 18+ allowed

Icon name
adult
Use cases
All websites for specific age (adult) audience should have notification about age restrictions: news with bloody events, erotica, casino.

Design ideas
Age in some circle:

12+
16+
18+
21+

Checklist

[X] I have searched if someone has submitted a similar issue before and there weren't any. (Please make sure to also search closed issues, as this issue might already have been resolved.)
[X] I have searched existing icons to make sure it does not already exist and I didn't find any.
[X] I am not requesting a brand logo and the art is not protected by copyright.
[X] I am not requesting an icon that includes religious, political imagery or hate symbols.
[X] I have provided appropriate use cases for the icon(s) requested.

Something like this is feasible, although we do keep in mind that the legal definition of "adult" varies by country and culture and context (e.g. in the USA the legal age is 18 in most context, but the LMDA is 21).

Open lucide studio
Open lucide studio

Can we have several icons about age? 18+ and 21+?

Can we have number "1" more readable?

<svg
  xmlns="http://www.w3.org/2000/svg"
  width="24"
  height="24"
  viewBox="0 0 24 24"
  fill="none"
  stroke="currentColor"
  stroke-width="2"
  stroke-linecap="round"
  stroke-linejoin="round"
>
  <path d="M 6.5 10 L 9 8" />
  <path d="M 9 8 L 9 16" />
  <path d="M14 2.2a10 10 0 1 0 7.8 7.8" />
  <path d="M18 4h4" />
  <path d="M20 6V2" />
  <circle cx="15" cy="10" r="2" />
  <circle cx="15" cy="14" r="2" />
</svg>


Outdated package manager convention

When I was installing hostess on Arch Linux I've got an error.
The error (and solution) are linked in this ticket: https://github.com/golang/lint/issues/415.
I had to use find . -type f -exec sed -i 's/github.com\/golang/golang.org\/x/g' {} \; to fix this issue, but it would make more sense to update this in repository.

Thanks for the report. I've updated the makefile to reflect the correct import path. Cheers!


The schema for tol in PCA's schema does not reflect the doc.

In the hyperparameter schema for Scikit-learn's PCA, the one with "Option tol can be set for svd_solver arpack" does not correctly reflect the actual description in the official document.

Thank you for opening this. We will correct it soon.


9FUS Y20GA brick. Orange led permanently on.

Hi, my camera has the orange led permanently on with 1 single flashing every 20-30 sec approximately. Unfortunately I didn't make a backup and with the original firmware I can't recover the camera.
I have read that I need a mtdblock3.bin file but I don't know where to find it.
Could someone help me? thanks!

Thanks, I will try it this afternoon and I will comment if it is solved.


Create a new pull request by comparing changes

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

10 of 11 (90.91%)  changed or added relevant lines in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.09%) to 95.764%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

js/src/util/index.js
10
11
90.91%

Totals

Change from base Build<PHONE_NUMBER>:
0.09%

Covered Lines:
1992

Relevant Lines:
2041

💛  - Coveralls


Help me

I am new in github,I want to now how I can get the old version Box2dlights jar files,In libgdx can only download the newest Version,I can't make the  .jar  file,please answer me!

Please ask in the community for help https://libgdx.com/community/


Script returns nothing

Do you have to have E5 license in order for this script to work?  We have E1 and the script does not create an output file.  Nothing happens when finished.

To confirm, there is nothing in the output directory? (Defaults to $CurrentUser\Desktop\ExportDir)
The license question is only for mailitemsaccessed.csv

To confirm, there is nothing in the output directory? (Defaults to $CurrentUser\Desktop\ExportDir)
The license question is only for mailitemsaccessed.csv

Okay, got it.  thank you!

Okay, got it.  thank you!

No problem! Happy hunting!

No problem! Happy hunting!


Unable to install securetea using PyPI

About the bug
Unable to install securetea using 'pip install securetea' for new users.
Steps

Run 'pip install securetea' in the terminal.
it will show

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4j0Q9Q/securetea/
IOError: [Errno 2] No such file or directory: 'bin/init.d/securetea.sample'

Screenshots

Desktop

Operating System: Ubuntu
OS version: 18.04.3 LTS

Detailed log
Complete output from command python setup.py egg_info:
    [!] /usr/local/bin
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-7tGccb/securetea/setup.py", line 219, in <module>
        file_rename()
      File "/tmp/pip-build-7tGccb/securetea/setup.py", line 80, in file_rename
        with open(file) as f:
    IOError: [Errno 2] No such file or directory: 'bin/init.d/securetea.sample'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-7tGccb/securetea/

Could you try: sudo python3 -m pip install securetea

@jishnurippon Also, our initial PyPI release had some bugs which have been fixed now, it will be updated very soon in our next release. To install using the latest repo, please follow the following steps in order:
git clone https://github.com/OWASP/SecureTea-Project.git
cd SecureTea-Project
sudo python3 -m pip install -r requirements.txt
sudo python3 setup.py install

@abhisharma404 Can we roll the fixes for the pip version? May be many will be trying to install with pip.

@rejahrehim Yes, the fixes have been made. We can plan a release very soon. Also, I had a closer look at the error and tried to reproduce it in a VM, turns out this error is specifically due to 2 reasons:

Not using root, i.e. 'sudo'
Also, we need to enforce a Python 3.

The following command will work flawless:
sudo python3 -m pip install securetea
Also, #229 This error is also related to Python 2. I think we can have a discussion in the IRC related to the support of Python 2 & 3.

This error still exists.
When I try on python 2.7 it will show.

@jishnurippon What about Python 3?

@abhisharma404 python3 is working properly

@jishnurippon Thanks for bringing this in attention. I'll try to work around it.. PyPi support over Python 2 needs a lot of work.


Renderer: Add support for boolean attributes with no value

Fixes #141

This change is

Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion.

src/renderer/polymer-renderer.ts, line 21 at r1 (raw file):

 * instead of the default platformBrowser and platformBrowserDynamic.
 */
export class PolymerRenderer implements Renderer {

Had the problem again, that if I installed the package with "@vaadin/angular2-polymer": "file:../angular-polymer", that the whole "renderer" folder was missing in the target project. Maybe a import is missing? But should definitely be fixed before releasing.

Comments from Reviewable

So, I just droped in the new renderer and got this (left is before and right is after):

So functionality is working perfectly but CSS is not the same. I noticed that the following doesn't work:
css:
paper-item-body {
    width: 80%;
    margin-left: 5%;
    color: var(--komed-color-white);
    font-size: 14px;
    font-weight: 900;
    @apply(--mixin-default);
    min-height: 0;

    --paper-item-body-secondary: {
        font-size: 13px;
        color: var(--komed-color-gray);
    }
}

html:
<iron-selector #roomselector id="patient-list">
    <paper-item class="patient-list-item" id="patient-list-item" raised toggles role="menuitem">
        <iron-icon icon="social:person"></iron-icon>
        <paper-item-body id="item-body" two-line [ngClass]="{'selected': selected }">

something

else

        </paper-item-body>
        <paper-ripple></paper-ripple>
    </paper-item>
</iron-selector>

Here the paper-item-body will not have any of the css attributes


Draft-js 0.10.0 Migration

Just a heads up that the Entity API has been deprecated in the latest draft-js release.
https://facebook.github.io/draft-js/docs/v0-10-api-migration.html
Entity.get will need to be changed.
This will also effect then ast-importer project as it uses Entity.get and Entity.create

@corbanbrook Ta! I had noticed that go by, is on my list of things to get to :)

@corbanbrook I’ve pushed up a couple of branches for the exporter and the importer that handle this API change. Mind giving them a run?
https://github.com/icelab/draft-js-ast-exporter/pull/8
https://github.com/icelab/draft-js-ast-importer/pull/6

Great. I will have time on Monday to try it out.

@corbanbrook Did you get a chance to test this out btw?

Yeah, had a chance to look at it this morning. Everything looks good on both importer and exporter, no more deprecation warnings, all tests are passing and can edit my old content just fine.

Hi! Is there anything I can do to help get this PR merged? I'd love to eliminate the deprecation warnings this is causing.

draft-js v0.10.0 has been out for 3 months now and I have been running this branch in production for about 2 months. I think it is safe to tag and merge into master.

Sorry for the delay, folks! I’ve merged this and released as v2.0.0 (thanks for the reminder).


Plane collisionshape not colliding with raycast

Godot version:

3.1.beta9.official

OS/device including version:

Linux 4.20.13-arch1-1-ARCH

Issue description:

I'd like to send a raycast from the camera and detect where it hits on a plane.
I had this working in 3.0.6, but it broke in 3.1-beta9.
Steps to reproduce:

Create the following hierarchy:

Spatial

MeshInstance (Plane)

Area

CollisionShape (Plane)

Camera

Point the camera at the plane
Add this script to the camera

extends Camera

var mouse_pos = Vector2()

func _input(event):
	if event is InputEventMouseMotion:
		mouse_pos = event.position

func _physics_process(delta):
	var from = project_ray_origin(mouse_pos)
	var to = from + project_ray_normal(mouse_pos) * 1000
	var space_state = get_world().direct_space_state
	var result = space_state.intersect_ray(from, to)
	print('raycasting: ', result)

Run, move the mouse around, check for raycasts

For 3.0.6, I'll see raycast results print. For 3.1, I get nothing.
Minimal reproduction project:

example.zip

I get raycast hits if I replace the Area with a StaticBody. Did the behavior of Area change somehow in 3.1?

I've tried toggling input_ray_pickable on the Area to no avail.
It also isn't clear what is true/false for input_ray_pickable. The comment says it defaults to true, yet the default state seems to be unchecked, which I would assume means false.

Confirmed on b8112074 with both Bullet and GodotPhysics engine.

I don't think that remove the shape will fix the problem, these shapes are really useful to create world margins and remove it is not a nice move (is like remove a feature that the engine already has).
This kind of shape as a specific use and a solution to this problem could be name this shape in a more specific way in order to self document it, something like: InfinitePlane, WorldMarginPlane can fix the problem.

I'm trying to just a collision plane that I'm using to separate layers on my map. It would be used for raycast collision. What is a suitable alternative to using a plane?
I'll just use a convex shape and populate it like a square but it seems odd.


Enable import/export block code as PNGs

This commit adds a feature to download individual blocks as PNG
files. In the PNG file there will be a code chunk that stores the
Blockly XML representation for the block. Dragging and dropping one of
these images into the blocks editor will import that block. This can
be useful for writing tutorials because the images of the blocks will
also contain the code, so one can drag the block image into the
workspace from another page. In order for the cross-site drag to work,
the server serving the document must allow CORS from the App Inventor
server.
Change-Id: I524bbfbef739554884caa31a8b677ce1bcc893d1

So this is a fun little pull request that recreates something I had prototyped for PUNYA but lost to the sands of time. The basic idea is that you can right click on a block and export it to PNG (similar to workspace export). In this PNG though there will be an additional optional chunk that includes the Blockly XML code. One can then drag these special PNGs from either the file system or a CORS-enabled server to import the blocks into the block workspace. The hope is that we could use this feature for improving tutorials, documentation, and other materials published on the web.

I should also note that I have only tested this in Chrome so far.

Is the name of the png file also autogenerated?

@PeterMathijssen I implemented your suggestion. If there are multiple blocks the file will be called blocks.png, same as when you export the whole workspace (rather than the autogenerated names).

Great. I was thinking what would be best. Now every png will have the English name and not for instance the translated name. Could you when you use this for instance... .appendField(Blockly.Msg.LANG_LISTS_ADD_ITEMS_TITLE_ADD)
use this as the filename? Like i said i don't know what would be best.

I'll take a look, but I don't think it will be as trivial as it seems.

Maybe start with the blocks in English and see if users from other countries would have a need for them to be in their language?

Found two bugs:

Top level blocks don't appear to get the Download as PNG menu item
Sometimes the background doesn't get reset correctly after drop completion.


General: Replaced deprecated reference in client

Checklist
General

[X] I chose a title conforming to the naming conventions for pull requests.

Client

[X] I followed the coding and design guidelines.

Motivation and Context

The client shows since some time one deprecated reference.
Description

According to the stack overflow post, this is the way to replace it: https://stackoverflow.com/questions/70946038/replace-deprecated-angular-componentfactoryresolver-componentfactory
Review Progress

Code Review

[ ] Review 1
[ ] Review 2

Is more complicated than I thought because the view ref is not defined in this extension. Will need to take a look at it when I have more time.


Is there a way to make the logo bigger

Is there a way that I can edit the _includes or _layouts to make it so that I could change the base size that images and more specifically the logo at the top left of the masthead and where it is displayed. if so where would that be and how would I go about this. Thank you for your time

You'll have to do this through custom CSS.
I'd suggest inspecting the logo with your browser's web developer tools, which will give you the class (e.g. site-logo) names you'll need to adjust the width and height on.

I'm running into the problem of the masterhead having the size it works off of causing the width changes of the logo to go through but not the height changed

update I'm figured out how to change the size of the masthead but am still trying to figure out how I can change it so the logo can increase in height without changing the size of the masthead.

The problem has been solved by editing the /_sass/minimal-mistakes/_masthead.scss
I changed line 18 so the padding was 0 as I wanted the logo to take up the whole box
then I changed the logo size to 3 rem so that the masthead would stay the same size as it was
before this ticket gets closed is there as _sass that relates to feature_rows, thank you


Sample Grafana dashboard

Hey folks
I wonder if you have any sample dashboard for activerecord metrics?
Adding other yabeda gems that have corresponding dashboards was a very positive experience 👍

Hey!
Unfortunately, not yet :upside_down_face:
Thanks for show interest, will try to extract and prepare some meaningful example one day.

@Mehonoshin did you ever come across some good examples?

I'd also love a sample dashboard!


Beta Update to latest Iced Master

Currently I have updated everything to the current except for Menu. @latidoremi could you please work on updating this to the latest master branch for me? as it might require some major changes to make it work due to how hector changed Tree.

Sorry I didn't notice the email, is the widget still working? I'll take a look at it tomorrow

currently atm it is not. You can view all the new changes in the other widgets but the menu widget was so massive i didnt know where to start since the layout stuff will need to be redone somehow.

I have a lot of menu fixes in libcosmic. It is based on a different iced version but should be possible to backport

Man...the new changes really break a hell lot of stuff, I need to rethink a bit about the layout and how to properly sync the state tree and the menu tree, the fixes in libcosmic looks good, I'll port it here if I can't come up with something better

Majority of what I did was just to sync the tree, there were bugs with alignment before.

Status on this?

Teladorer is currently working on completing the last parts that we can of iced_aw before we can release.

Busy making changes to make master to depend only on iced 0.12.0, instead of iced_widget as iced 0.12.0 does expose canvas as a feature.
It is a hell lot of files to update. Before tackling the menu feature, and look at another alignment issue somewhere.

Well first commit has been merged with main branch, which changed the dependency from iced_widget to iced 0.12.0. Most features on main branch should be working with iced 0.12.0. A few examples has issues, and 2 examples are related to a bug found today in iced 0.12.0.
The menu feature is not ready to work with iced 0.12.0, and may require a rewrite. This is my next task to tackle.

I've already rewritten the menu widget, got most of the features working, still need a few more days to complete, btw what's the alignment issue? I did notice that some widgets aren't properly clipped when being scrolled to the top, I'm working on it

mostly a issue with Grid. Where if you set the alignment to Center or Right it will overflow Glyphon. Hector said its due to infinite positioning or size or something.


Added support for custom resource logging

Resources can call WithResourceLogger to add an annotation that allows them to publish logs to a live stream. These will flow through the resource server to any consumer (including the dashboard).
Share circular buffer between otlp log storage and aspire.hosting.
Added tests

Fixes #2498
https://github.com/dotnet/aspire/assets/95136/3702c2a3-80cf-49e0-84d3-d7754fbb7f94
Microsoft Reviewers: Open in CodeFlow

Two thoughts on this:

Given we are constraining height of the logging pile (10000 entries). Should we also define a maximum width to the message so we know that on a per resource basis memory consumption cannot exceed X?
Should we also be looking to output these entries to the AppHost console log?

Tentatively approving pending the fix on the test failure and responses to those questions above. They can be follow up PRs if needs be.

@mitchdenny

Given we are constraining height of the logging pile (10000 entries). Should we also define a maximum width to the message so we know that on a per resource basis memory consumption cannot exceed X?

I don't think so, at least not by default. We'll need something more durable eventually though. I'm not a fan of opening a temp file bug it might be required for longer log streams.

Should we also be looking to output these entries to the AppHost console log?

Nope, see https://github.com/dotnet/aspire/issues/2396


can't delete text or move cursor on macOS

Thanks for the bug report! I don't have easy access to a macOS machine to test this out.
I wonder what this could be. We listen for arrow keys, backspace, and delete to manipulate the textbox.

I believe DeviceEvent::Key isn't implemented on Macs - no events of that type are ever emitted by winit in my tests. changing DeviceEvent::Key to WindowEvent::KeyboardInput in YakuiWinit::handle_event makes text boxes handle as expected

Cool, thank you for looking into this.
I just pushed a commit to use WindowEvent::KeyboardInput instead of DeviceEvent::Key.


Refactor panic/return code system

Currently we are distinguishing panic and return codes. Additionally there are some different types of panic codes including internal panic, testing panic, and avm panic, as well as the generic (Teal) panic. The avm panics were using conflicting integer codes to some of the Teal panics. This PR simplifies the system so that all return/panic codes are consolidated into one list, all specified in one file. There is also no longer any intermediate calculation of the return/panic codes after each transaction. The return code should be set to 4 initially and only be changed at the end either by a panic which is triggered, interrupting execution, setting it to the appropriate code, or be changed to 0 at the end if all transactions have been successfully executed without a panic.

@nwatson22 See the failing algod integration tests: I think they also need updating to use the new return code system.


Connection issues

The standard url http://www.kinox.sg does not work for me - using https://kinox.tv worked (note the https!)

kinox.sg added a cloudflare ddos protection (JS based) which killed the crawler.
.to and .tv don't work in all countries so I've added Google DNS to fix this.
(see c0ea641c89a050b594ce915d5f77e6ddc288f1c1 and d4a794584f3f1ec915a0656a4809a0c38333f41d)

Okay, seems to work.


Error: /lib64/libm.so.6: version `GLIBC_2.29' not found

Issue Summary
Run the program in the Kylin v10 sp2 system and report an error at startup. Error message:
Error: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /data/soft/geoops-sever/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-arm64/node_sqlite3.node)
glibc version:
ldd (GNU libc) 2.28
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
Steps to Reproduce
yarn add sqlite , import it , new sqlite() , running program
Version
5.1.6
Node.js Version
16.20.1
How did you install the library?
kylin v10 sp2 , arm

node:internal/modules/cjs/loader:1210
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^
Error: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /var/www/.../node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.node)

Any solutions?


Feature Question: does pandas have a "groupsort" function?

Is there a hashtable based sort function in pandas to sort integer interchangeable dtype (dense) in O(n) time?
Not sure if the feature is the one mentioned in the link below. It's called groupsort.
http://wesmckinney.com/blog/tag/pandas/

you'll have to supply more detail
order n sort is a only in a very restricted way
not a general function

Sure. I am sorting timeseries/dataframe based on a column of datatime64. Frequency is daily. Range of the date is known.

and? what is the problem/issue

The problem/issue is: do I have a "groupsort" function in pandas to do the sorting in O(n) time, in this situation?

no, wes's post is applicable to group calculations where k << n. Here you are simply doing a sort.
though not clear on what you are actually trying to do.
see this: https://en.wikipedia.org/wiki/Radix_sort
fyi, the sorting is only sometimes necessary and usually not the limiting factor in most situation.
often times you can use partial sorts, eg. see here

In [1]: N = 10000000

In [3]: s = Series(np.random.randint(0,N,size=N))

# quicksort
In [4]: %timeit s.order()
1 loops, best of 3: 2.64 s per loop

In [6]: %timeit s.order(kind='mergesort')
1 loops, best of 3: 2.44 s per loop

In [7]: s = Series(np.random.randint(0,4*N,size=4*N))

In [8]: %timeit s.order()
1 loops, best of 3: 14.9 s per loop

so 1.5x growth rate. I don't think this is a big deal. Of course if you think that you could implement a faster sort, then pull-requests are welcome. (counting sort/radix) actually would work, but you have to factorize first
# for the 40M
In [11]: %timeit pd.factorize(s)
1 loops, best of 3: 4.2 s per loop

So in theory you might have a small gain by doing this, but a lot of complexity.

This is helpful. Thanks


jquery not loading if I use DataTable.use(DataTablesLib)

Hi Thanks heaps for doing this component.
If I follow the blog post for using datatables in vue3 I am getting a blank screen and an error
Uncaught TypeError: Cannot set properties of undefined (setting '$')
at DataTable (jquery.dataTables.mjs:61:9)
at Comp.use (datatables.net-vue.esm.js:26527:3)
at eval (index.js??clonedRuleSet-40.use[0]!./node_modules/vue-cli-plugin-quasar/lib/loader.js.transform-quasar-imports.js!./node_modules/vue-cli-plugin-quasar/lib/loader.vue.auto-import-quasar.js??ruleSet[0].use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[1]!./src/components/logging.vue?vue&type=script&lang=js:14:61)
at ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/vue-cli-plugin-quasar/lib/loader.js.transform-quasar-imports.js!./node_modules/vue-cli-plugin-quasar/lib/loader.vue.auto-import-quasar.js??ruleSet[0].use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[1]!./src/components/logging.vue?vue&type=script&lang=js (app.js:63:1)
at webpack_require (app.js:1344:33)
at fn (app.js:1635:21)
If I remove DataTable.use the tables load fine but I cannot use any plugins.
I have gone through the messageboard do I need to refer to $ directly in the jquery library as I thought the component included jquery.
Library
"datatables.net": "^1.13.1",
"datatables.net-buttons": "^2.3.3",
"datatables.net-dt": "^1.13.1",
"datatables.net-select": "^1.5.0",
"datatables.net-vue3": "^1.0.0",
"vue": "^3.2.44",

Re-read the article and it reports you are using datatables.net-vued ^2.0.0 I have upgraded to that and removed datatables.net and it is now working correctly
sorry


Could this package support map rotation？？

What kind of rotation you are talking about?

hopefully he does not mean ENU vs NED .. :D


Error in name

Hello :D
Jikan reports Black Lagoon: Roberta's Blood Trail this
with this title : "Black Lagoon: Roberta& #039;s Blood Trail"
Should we decode all HTML-code or is it an error in the back-end?
Thanks a lot :D

I don't really know, I am using the api.jikan.moe
So it should be :
JikanREST: "2.2",
JikanPHP: "1.16.2"

Hi, that's an issue with the current parser. Will be fixed in the next REST update (~end of this month) for all responses.
You'll have to HTML decode the responses for now

ok thx


DOC-2723: adding doc for terraform cli options and skip refresh

Harness Developer Pull Request
Thanks for helping us make the Developer Hub better. The PR will be looked at
by the maintainers.
Epic Link: https://harness.atlassian.net/browse/CDS-50829
What Type of PR is This?

[ ] Issue
[ ] Feature
[ ] Maintenance/Chore

If tied to an Issue, list the Issue(s) here:

Issue(s)

House Keeping
Some items to keep track of. Screen shots of changes are optional but would help the maintainers review quicker.

[ ] Tested Locally
[ ] Optional Screen Shoot.

Please check the Execution Link of the Pipeline for the Website Draft URL. This is located in the Preview Step and also is available in #hdh_alerts. E.g Website Draft URL: https://unique-id--harness-developer.netlify.app

reviewed and revised.


Vscode extension

Description of the problem / feature request:
with the popularity of Vscode growing day by day , i think Vscode is the best place for such features.

There is some cool VSCode gist extension like this https://marketplace.visualstudio.com/items?itemName=kenhowardpdx.vscode-gist


folder tester_top_system

why aren't these files in the submodules/TESTER/hardware/.. respective directories

The files in the tester_top_system are no longer used.
The folder was not yet deleted because it contains sources that may be useful for reference of connecting the ethernet peripheral in the future.


mild fix comment dead link

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/go
Target /usr/local/bin/go
is a symlink belonging to go. You can unlink it:
  brew unlink go

To force the link and overwrite all conflicting files:
  brew link --overwrite go

To list all files that would be deleted:
  brew link --overwrite --dry-run go

==> Pouring<EMAIL_ADDRESS>Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'

To force the link and overwrite all conflicting files:
  brew link --overwrite<EMAIL_ADDRESS>
To list all files that would be deleted:
  brew link --overwrite --dry-run<EMAIL_ADDRESS>


An interesting case for REF in PHP

I'm interested in PHP opcode, when I use VLD to analyze a case, I found some interesting.
Below is the code for this case, these are two PHP files: main.php and include.php

Absolutely, after main.php execution, we get a different value for $var1 and $var2.
But, when I check the opcode, I found that the opcodes for function sendref and function sendnoref are the same.

And for main.php, it seems that the opcode for the function call is the same too.

So, I want to know why we get a different value for $var1 and $var2 when the opcodes are the same.

Please don't use screenshots for text when possible, it's not cool for a lot of people (blind users, terminal users, …)

There is no bug here.
The "referenceness" is not checked/done through the opcode, but instead this is part of the function signature. An op array contains for each argument "arg_info_flags" which contains which type the argument is supposed to be, and also whether it is a reference or a variadic.

https://github.com/php/php-src/blob/PHP-8.2/Zend/zend_compile.c#L6881
https://github.com/php/php-src/blob/PHP-8.2/Zend/zend_compile.c#L6956

VLD does not show this information to go with each function (oparray) yet.

Please don't use screenshots for text when possible, it's not cool for a lot of people (blind users, terminal users, …)

Thanks for the reminder!

There is no bug here.
The "referenceness" is not checked/done through the opcode, but instead this is part of the function signature. An op array contains for each argument "arg_info_flags" which contains which type the argument is supposed to be, and also whether it is a reference or a variadic.

https://github.com/php/php-src/blob/PHP-8.2/Zend/zend_compile.c#L6881
https://github.com/php/php-src/blob/PHP-8.2/Zend/zend_compile.c#L6956

VLD does not show this information to go with each function (oparray) yet.

Thanks!


Correspondence Issue

I found that the first picture generated was not the image prompt. I feel that it is a problem to add the mse loss of referring image for further image-to-3D generation.

this work adopt canonical camera to generate 3D similiar to the image-prompt, we tried to make the image at the front view, results are worse and more blurry.


PMD ruleset for Google Cloud

I know it's not strictly style but I suggest including a PMD ruleset for gcloud based projects.
i.e. https://raw.githubusercontent.com/GoogleCloudPlatform/google-cloud-java/master/pmd.xml

Those old rule definitions also need to be updated for the latest releases of PMD. Using gcloud PMD rulesets causes tons of rule name change warnings in latest releases of PMD, and things will get worse as PMD 7.0 is released and deprecated rules are removed.


Feature Request: Add Support for Custom HTTP Headers in Ollama Requests

Hello there,
I discovered Ollama a few months ago and forgot about it.
Yesterday I came across it again and promptly set up an instance at home on a dedicated machine and made it publicly accessible behind a reverse proxy that authenticates using basic auth, because I wanted to be able to access it from anywhere - even though it runs on old hardware and takes ages to answer. But it works and I would like to experiment with it.
As I'm a Rustacean I was going to write a library for Rust myself. But it seems like you guys were faster :-)
Unfortunately, as I see it, it is currently not possible to set any request headers. That makes it impossible for me to use this crate with my setup, as I do quite some work on the road and can't set up a VPN due to technicalities.
So I thought for myself that I can't be the only one with a setup like this and came up with three possible solutions which I would like to propose from (my) most to least favorite.

ID
Proposal
Pros
Cons

1
Accept a reqwest::header::HeaderMap and use RequestBuilder.headers() on each occurence of Ollama.reqwest_client. Maybe re-export the required structs and constants from the reqwest crate?
Allows users to define headers as they pleaseFuture proof
Has to be applied to each Ollama.reqwest_client occurenceRequires additional implementation work

2
Accept a Option<Credential> in the Ollama struct and use the RequestBuilder.basic_auth() on each occurence
Quick and dirty
Quick and dirtyHas to be applied to each Ollama.request_client occurenceNot future proof

3
Pass in the host Parameter using the old school https://[username]:[password]... scheme (presumably no change in code required)
Should work without any code changes
InsecureNot future proof

Another approach would be to separate the crate completely from the engine that runs the requests (currently the reqwest crate). But that would certainly break all existing projects. And up to this point I couldn't figure out how this could be achieved.
I would be happy to contribute the changes on which we agree, should we agree.
The first and second approach have already been successfully tested in my local fork (not yet published).
Please let me know what you think and if this could be beneficial for this crate.
PS: Maybe this could be implemented behind a feature flag.

Hey, sorry for the delay. The first approach actually sounds very good. I can implement it if needed but if you already have an implementation of it then the contribution would be welcome!


Fix/stepper error state

This PR is linked to 👉 https://github.com/okp4/ui/issues/520
It keeps the error state when the user clicks the previous button of a step in error.
The current step :

The user clicks the next button and the step is invalid :

User clicks the previous button, step remains in error state :

Codecov Report

Merging #530 (40bbcb8) into main (c433974) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #530   +/-   ##
=======================================
  Coverage   96.34%   96.34%
=======================================
  Files          70       70
  Lines         847      847
  Branches      124      124
=======================================
  Hits          816      816
  Misses         29       29
  Partials        2        2

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ccamel
Is this one OK for you?

:tada: This PR is included in version 1.18.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


option to install package to home directory or a custom directory

Verification

[X] This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

Provide a detailed description of the proposed feature
you can do
brew install hexchat --homedir and it'll download the files after checking for dependencies, install to a custom directory in the home dir or in general (--homedir-dir ? --custom-dir=/Volumes/5tb/.brew ?) and somehow set paths using zsh
then it can compress and decompress the files to save time
What is the motivation for the feature?
independant packages, binaries, libraries per user, at the cost of disk space
How will the feature be relevant to at least 90% of Homebrew users?
it will allow them to easily organize multiple packages through mutiple directories, even the home heirachy
What alternatives to the feature have been considered?
a custom python/shell script that replicates suggested features

We can't install formulae to arbitrary directories, many of them break. You can install Homebrew itself to your home directory but it's not supported (because you'll have to build from source).
Some casks can be installed to the home directory with brew install --appdir.


Update URLs. [skip ci]

Signed-off-by: Yana Hontyk<EMAIL_ADDRESS>What type of PR is this?
/kind documentation
[skip ci]
What does does this PR do / why we need it:
Updates broken URLs in the README
PR acceptance criteria:

[ ] Unit test

[ ] Integration test

[x] Documentation

How to test changes / Special notes to the reviewer:

Links are working for me
/lgtm

/approve

docs, no need for tests
/override ci/prow/v4.2-integration-e2e
/override ci/prow/v4.3-integration-e2e
/override ci/prow/v4.4-integration-e2e
/override ci/prow/v4.5-integration-e2e


How to enable caching?

In your documentation is stated that optional caching is possible. How can I enable it and how is the data be cached?

Caching is on by default. You may explicitly enable/disable via the cache kwarg in the Pilmoji constructor, i.e. Pilmoji(cache=True)


thirdweb v4.0.1 useWalletConnect Hooks does not work

This seems to be a problem with walletconnect

thanks for reporgibnt this @Kkirito1 - we're looking into this

@Kkirito1 thanks for reporting this. Could you share more context on when you're getting this error? Is it when disconnecting/connecting? Even when you get this error in the console, does the wallet still works as expected?
If it does, then this may be on the walletconnect side and they are working on muting these errors:
According to this issue: https://github.com/WalletConnect/walletconnect-monorepo/issues/2983 :
FYI, we're patching most of the No matching key. errors and if you encounter any errors/behavior that blocks the client from operating normally feel free to open a new issue 💯


Incorrect Shading on Flamedramon model

Import / export flamedramon model, check what the material settings are

Caused due to the issue with setting loop normals rearing its head once more. Should now, finally, be fixed.


FEATURE REQUEST: js code styling

Hello, no bug reporting/ pr  this time.
I am studying the foundation 6.2 javascript code in order to solve a few issues I encountered.
I find the code a little hard to read compared to other projects and also compared to mainstream php code (i am mostly a php developer) (see psr)
I also found examples different styles inside the same file:
if (a === b) {
  //...
}
if(a === b){
  //...
}

i personally regard readability to be an important step/feature in code quality and i am a big fan of spaces (in the end we all use minified files) and skipping them may convey particular meaning like function definitions and function calls ().
Wouldn't it be better to follow (or even create) some guidelines like the well-known @douglascrockford's ones for instance?
http://javascript.crockford.com/code.html
Sorry if there is already a javascript code styling for foundation but i was not able to find it. If that is the case could someone direct me to right place?
kind regards
maks feltrin

It may be easier to incorporate a gulp plugin into the checkin process. Here's a list of options available. Would adding this tool be enough to cleanup the JS source files so it's formatted the same throughout the project?

Hello @markadrake ,
I was referring mainly to a "zurb foundation" js source code guideline - before any gulp processing - so that the js code of foundation-sites (apps|emails|motion) could be more consistent. I personally like Crockford's, but i believe it's more important to have a code style than which one to use.
kind regards,
maks

@pine3ree I totally agree that all the JS code (CSS too for that matter) should follow a convention of choice set by the team at Zurb - and Corckford's is pretty close to what I follow. I definitely support you on this.
I know that Gulp is typically used for tasks relating to the front-end, but we could make it a part of the build + checkin process. We could utilize a plugin like the one above to define the standards for all the JS files to follow. So before you check in, run the build. The build will reformat all the JS files.
This would allow people to write the code, initially, however they like. But before submitting a PR it will be formatted to the standard of the project. We do things like this inside of Visual Studio all the time (not with Gulp though).
Sorry if I'm not making much sense. :)

Hi everyone,
Guidelines can be found here: https://github.com/zurb/foundation-code-standards
Feel free to make specific recommendations in that repo.
Big thanks!


Normalize select all on NodeSelection

The following selection is invalid, it should point to the corresponding child nodes

Fixes #4658

Heads up, if a DecoratorNode (guessing any empty node w/r to text) is first in the document, when you Select All you won't get the first node selected. (ie starting with a RangeSelection)
This fix makes it so that if you come from a NodeSelection that Select All does work, including when the first node is a Decorator/empty.

Heads up, if a DecoratorNode (guessing any empty node w/r to text) is first in the document, when you Select All you won't get the first node selected. (ie starting with a RangeSelection)
This fix makes it so that if you come from a NodeSelection that Select All does work, including when the first node is a Decorator/empty.

https://github.com/facebook/lexical/pull/4671


"ghc-options:" -main-is module for multiple executables

I have a package.yaml with the following execitables section:
executables:
  bitcoin-clearing-server:
    main: ClearingServer/Main.hs
    source-dirs: src
  bitcoin-signer:
    main: BitcoinSigner/Main.hs
    source-dirs: src
  note-signer:
    main: NoteSigner/Main.hs
    source-dirs: src

If I try to build this as-is, I get an error because -main-is module has not been specified to GHC:
rune@macbook:~/IdeaProjects/bitcoin-clearing-server$ stack build
Preprocessing executable 'bitcoin-clearing-server' for
bitcoin-clearing-server-<IP_ADDRESS>...
[29 of 29] Compiling ClearingServer.Main ( src/ClearingServer/Main.hs, .stack-work/dist/x86_64-osx/Cabal-<IP_ADDRESS>/build/bitcoin-clearing-server/bitcoin-clearing-server-tmp/ClearingServer/Main.o ) [flags changed]

<no location info>: error:
    output was redirected with -o, but no output will be generated
because there is no Main module.

--  While building package bitcoin-clearing-server-<IP_ADDRESS> using:
      /Users/rune/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_<IP_ADDRESS>_ghc-8.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-<IP_ADDRESS> build exe:bitcoin-clearing-server exe:bitcoin-signer exe:bitcoin-signer-arm exe:note-signer --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

If I add the following to the top level of my package.yaml
ghc-options:
- -main-is
- ClearingServer.Main

then ClearingServer.Main is successfully built, but now BitcoinSigner doesn't work because it thinks its main module is ClearingServer.Main:
rune@macbook:~/IdeaProjects/bitcoin-clearing-server$ stack build
Preprocessing executable 'bitcoin-clearing-server' for
bitcoin-clearing-server-<IP_ADDRESS>...
[29 of 29] Compiling ClearingServer.Main ( src/ClearingServer/Main.hs, .stack-work/dist/x86_64-osx/Cabal-<IP_ADDRESS>/build/bitcoin-clearing-server/bitcoin-clearing-server-tmp/ClearingServer/Main.o ) [flags changed]
Linking .stack-work/dist/x86_64-osx/Cabal-<IP_ADDRESS>/build/bitcoin-clearing-server/bitcoin-clearing-server ...
Preprocessing executable 'bitcoin-signer' for
bitcoin-clearing-server-<IP_ADDRESS>...

<no location info>: error:
    output was redirected with -o, but no output will be generated
because there is no ClearingServer.Main module.

--  While building package bitcoin-clearing-server-<IP_ADDRESS> using:
      /Users/rune/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_<IP_ADDRESS>_ghc-8.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-<IP_ADDRESS> build exe:bitcoin-clearing-server exe:bitcoin-signer exe:bitcoin-signer-arm exe:note-signer --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

As far as I can see, for this to work, a section like this:
executables:
  bitcoin-clearing-server:
    main: ClearingServer/Main.hs
    source-dirs: src

must add -main-is ClearingServer.Main to ghc-options of the appropriate Cabal executable stanza, like so:
executable bitcoin-clearing-server
  main-is: ClearingServer/Main.hs
  ghc-options: -main-is ClearingServer.Main

If I modify the cabal file produced by hpack to include this additional information, all executables link without problems.

Why don't you add
ghc-options:
- -main-is
- ClearingServer.Main

to bitcoin-clearing-server: instead of to top level?

@runeksvendsen in general, as @liskin mentioned, you can specify `ghc-options on a per-executable basis.
But, in your particular case, you can also specify a module instead of a source fail as main and hpack will add the required -main-is for your. Specifically try:
source-dirs: src
executables:
  bitcoin-clearing-server:
    main: ClearingServer.Main
  bitcoin-signer:
    main: BitcoinSigner.Main
  note-signer:
    main: NoteSigner.Main

But as a disclaimer, note that GHCs -main-is has some limitations.  Specifically, it has to refer to a module in source form.  It can not be a already compiled library module.

That said, following a layout like e.g. https://github.com/hspec/sensei/blob/ad436d2095f5a36121eac43e0c1fe946e7568215/package.yaml#L34 for multiple executables is more common with GHC and may result in less hassle.

Thank you sirs.
In the back of my head, I think I had the memory of trying to add main-is to each entry in executables, which didn't work , rather than as part of ghc-options. Adding separate ghc-options totally works, and just specifyng the main class makes it a lot more compact.
By the way, I just discovered hpack a month or so ago, and I thoroughly enjoy how it simplifies things over Cabal. I'm pretty sure that my package.yaml is at least five times shorter than my .cabal, not in the least due to other-modules. Keep up the good work!


[Docs]: Docs Report Template Functionality - Test

What's this about?
Outdated or incorrect information
Description
This report is intended to test the functionality of the Documentation Report Template to ensure all elements are working as expected. -As requested
Code of Conduct

[X] I agree to follow this project's Code of Conduct.

Self-service

[X] I'd be willing to address this documentation request myself.

Awesome @botgina. Thank you!

Closing this on the next PR @botgina


iTunes Visibility Doesn't seems to work?

Thanks for the library, I have tried the following:
itunes.visibility(284882215).then(console.log);
But getting:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'split' of undefined

This is most likely failing because the rss feeds for the itunes scraper list method changed (I'm reviewing this issue in app-store-scraper at the moment, it may take a while before a solution gets here).

fixed now


Create a port of mod_security as Apache TrafficServer plugin

MODSEC-250: The Apache Traffic Server is a proxy and cache. It's highly performant - even with its out-of-the-box config.
It offers a clean API which is used to extend the server with plugins.
When used as a reverse proxy, it would be the ideal enter point to protect back-ends with mod_security.

With the advent of libModSecurity, I think the requirements are changed.
An initial implementation is ongoing here: https://github.com/shukitchan/ats-luajit-modsecurity
HAProxy + ModSecurity also seems like a viable solution: https://github.com/git001/haproxy-waf


Question: Webhook address for Staticman at Heroku

What is the proper webhook address when I deploy Staticman at Heroku?
For the public instance the webhook was https://api.staticman.net/v1/webhook
For my instance I'm guessing https://spinningnumbers-staticmandev2.herokuapp.com/v1/webhook/, but I'm getting a 404 not found error.
While moving to Heroku I deleted the public staticman collaborator and only have my robot as a collaborator.
2020-04-18T22:56:56.155851+00:00 heroku[router]: at=info method=POST path="/v1/webhook/" host=spinningnumbers-staticmandev2.herokuapp.com request_id=a8552a56-4182-415d-ba95-5cae432a7f07 fwd="<IP_ADDRESS>" dyno=web.1 connect=0ms service=6ms status=404 bytes=505 protocol=https

Solved... I removed the trailing / from the webhook URL.  Changed v1/webhook/ to v1/webhook and the not-found problem cleared up. This mailhook provides two services: It deletes unneeded branches and it launches a notification email to people who have subscribed. This second feature isn't (yet) mentioned in the Staticman documentation for webhooks. Thanks to @travisdowns for spotting the flaw.

@willymcallister - glad it worked! Can I ask what documentation you followed? I might go ahead and set up the webhook itself.
I forgot that the webhook also sends mail (I don't have mailgun set up since it seems you need your own domain for that to work).

@travisdowns - I was clued in to the need for the webhook by this post from @gabeluci. The easy instructions are at the mother ship. The intro doesn't mention notifications getting triggered, but they do. The url for the webhook changes from https://api.staticman.net/v1/webhook to https://yourAppName.herokuapp.com/v1/webhook, with no / at the end!
I'm working on my own exhaustive deployment instructions. I will link them here when they are ready.

Detailed instructions for how to deploy an instance of Staticman at Heroku... https://spinningnumbers.org/a/staticman-heroku.html
This could benefit from peer review. I'm happy to entertain comments, answers to questions, or pull requests with improvements.

@willymcallister thank you for your contributions on this repo. I've not had the time lately to work on this project and your help answering questions has been greatly appreciated!


Mnist example OSError: [Errno 2] No such file or directory

Im not sure what files are missing? It seems like Chainer cannot compile Cuda kernel?
root@igor-GS60-2QD:~/chainer# ./examples/mnist/train_mnist.py -g 0
load MNIST dataset
Downloading train-images-idx3-ubyte.gz...
Done
Downloading train-labels-idx1-ubyte.gz...
Done
Downloading t10k-images-idx3-ubyte.gz...
Done
Downloading t10k-labels-idx1-ubyte.gz...
Done
Converting training data...
Done
Converting test data...
Done
Save output...
Done
Convert completed
epoch 1
Traceback (most recent call last):
  File "./examples/mnist/train_mnist.py", line 88, in <module>
    optimizer.update(model, x, t)
  File "/root/anaconda2/lib/python2.7/site-packages/chainer-<IP_ADDRESS>-py2.7-linux-x86_64.egg/chainer/optimizer.py", line 376, in update
    self.target.zerograds()
  File "/root/anaconda2/lib/python2.7/site-packages/chainer-<IP_ADDRESS>-py2.7-linux-x86_64.egg/chainer/link.py", line 530, in zerograds
    super(Chain, self).zerograds()
  File "/root/anaconda2/lib/python2.7/site-packages/chainer-<IP_ADDRESS>-py2.7-linux-x86_64.egg/chainer/link.py", line 318, in zerograds
    param.zerograd()
  File "/root/anaconda2/lib/python2.7/site-packages/chainer-<IP_ADDRESS>-py2.7-linux-x86_64.egg/chainer/variable.py", line 151, in zerograd
    self._grad.fill(0)
  File "cupy/core/core.pyx", line 364, in cupy.core.core.ndarray.fill (cupy/core/core.cpp:7870)
    cpdef fill(self, value):
  File "cupy/core/core.pyx", line 373, in cupy.core.core.ndarray.fill (cupy/core/core.cpp:7815)
    elementwise_copy(value, self, dtype=self.dtype)
  File "cupy/core/elementwise.pxi", line 756, in cupy.core.core.ufunc.__call__ (cupy/core/core.cpp:42043)
    kern = _get_ufunc_kernel(
  File "cupy/util.pyx", line 36, in cupy.util.memoize.decorator.ret (cupy/util.cpp:1194)
    result = f(*args, **kwargs)
  File "cupy/core/elementwise.pxi", line 566, in cupy.core.core._get_ufunc_kernel (cupy/core/core.cpp:38632)
    return _get_simple_elementwise_kernel(
  File "cupy/core/elementwise.pxi", line 32, in cupy.core.core._get_simple_elementwise_kernel (cupy/core/core.cpp:29309)
    module = compile_with_cache(module_code, options)
  File "cupy/core/carray.pxi", line 87, in cupy.core.core.compile_with_cache (cupy/core/core.cpp:28987)
    return cuda.compile_with_cache(source, options, arch, cachd_dir)
  File "/root/anaconda2/lib/python2.7/site-packages/chainer-<IP_ADDRESS>-py2.7-linux-x86_64.egg/cupy/cuda/compiler.py", line 102, in compile_with_cache
    base = _empty_file_preprocess_cache[env] = preprocess('', options)
  File "/root/anaconda2/lib/python2.7/site-packages/chainer-<IP_ADDRESS>-py2.7-linux-x86_64.egg/cupy/cuda/compiler.py", line 65, in preprocess
    pp_src = subprocess.check_output(cmd, cwd=root_dir)
  File "/root/anaconda2/lib/python2.7/subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/root/anaconda2/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/root/anaconda2/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Is nvcc command is in your PATH environment variable? Please check it with which nvcc.

Thank you, adding export of PATH with /usr/local/cuda-7.5/bin to .bashrc file helped!


script/devnet: help text provides invalid command

$ sudo ./scripts/devnet create k8s
Most examples use CoreOS Alpha 1185.3.0. You may wish to download it with './scripts/get-coreos alpha 1185.3.0'.
...
$ ./scripts/get-coreos alpha 1185.3.0
Channel or Version not found

Stable works.

Fixed in 1394ee4fd89c3445d0c8384a6751b9141c6b6597


Is the argv the adress the code starts at?

Is the argv the adress the code starts at?

@vamsi-una the PsLoadedModuleList address, however this PoC may not work on your specific hardware.


Add key

EntropyCentre-Win64-Shipping
0x72463A7B70FA819E286295CF74C280AC7C928D0BCB349CF811CAF1AE27780A41

Wrong repo

Yeah, I was about to say, this isn't the correct repo for you. lol


Add --pointer-check to goto-instrument --drop-unused-functions call

As pointed out by @tautschnig here (https://github.com/diffblue/cbmc/issues/6983#issuecomment-1172020654), we should add --pointer-check while droping unused functions to ensure that CBMC fails the verification if it cannot find a suitable pointer for a function call.

@tautschnig Just double checking, this is no longer needed, right?
That said, do you still recommend enabling all checks before invoking goto-instrument --drop-unused-functions?

My apologies for the delay: yes, this should no longer be necessary. Also, I don't immediately see a reason as to why you'd need to enable checks before --drop-unused-functions.

No worries! Thank you.


cassandra: add help article on tombstones

Add a new help article on Cassandra tombstones, so that we have somewhere to direct users who receive a user alert about encountering too many tombstones during queries. Currently, this article is pretty short; it could definitely go into more detail, but the overarching advice of "change your queries or change your data model" is there, which is the most important bit for someone coming there from a user alert.
Also flesh out the Cassandra section a bit - at the moment there is only a reference document, so add a section for concepts as well.
This PR also includes a small commit for ignoring the .venv folder in the .gitignore and when looking for docs to build.

Tagged as helpwanted since I think we'll need some help with the review on this

Other things that can help with deleting data without creating the resurrected data problem is to use TTL at table level or at update record level. TTL is a lot more efficient when it comes to purging deleted data because all nodes have the knowledge of the tombstones since the data was inserted.
One other thing is to choose the compaction strategy correctly: TimeWindowCompactionStrategy with data TTL will drop entire sstable files when they expire, using a background cassandra thread, without compaction intervention.
But again, maybe these things can just be mentioned because getting deeper into the data modeling details takes too long.
Couple of things at the end:
This line:

Change your data model so that you don’t have to delete so much data.
change to:
Review your data model and compaction strategy and implement table TTL or TimeWindowCompactionStrategy if possible

this line:

If you are planning to delete all the data in a table, you can drop the whole table to avoid creating tombstones.
change to:
If you are planning to delete all the data in a table, you can truncate the table to avoid creating tombstones.

Your last sentence: "the tombstones will be removed automatically." should be changed into "the tombstoned data will be removed from disk"

@fmanimali Thank you for reviewing! I've added some mentions to TTL and TWCS with links to the docs + done the suggested sentence changes. Please have another look when you when you have time.

Thanks everyone! I really appreciate the Cassandra knowledge in the original article and in the excellent and knowledgeable reviews. You all rock!!!!


Spin off the generator as its own project

Description
Hello, I just want to say I really appreciate this project. I've been using it for schema first API design and I look forward to the tanstack query support. I have also been using this (modified) project to generate types for Fastify handlers (example below). This has enabled me to safely handle request parameters and response types. This in conjunction with a Fastify plugin for schema validation has lead to a great developer experience. In short, I can generate clients and server types from API spec.
I was wondering if it was possible to spin off the generator as its own project so that other projects that wanted to generate code from OpenAPI spec could do. I know there has been trouble accommodating all json schema types conversion to TS and it would be nice to have that dealt with in a united project. Thanks!
// generated code
import {type RouteHander} from "fastify";

type Handlers = {
  createUser: RouteHandler<{
    Body: NewUser;
    Reply: {
      201: User;
      400: Error;
      401: Error;
      409: Error;
      500: unknown;
    };
  }>;
  getUser: RouteHander<{
    Reply: {
      200: User;
      400: Error;
      401: Error;
      500: unknown;
    };
  }>;
};

// implement handlers
const handlers: Handlers = {
  createUser: async function (request, reply) {}
  getUser: async function (request, reply) {}
}

fastify.register(glue, {
  specification: "api.yaml",
  serviceHandlers: handlers,
  prefix: "v1",
});

Hey @jcx0, would your initial use case be to replace your modified project to handle Fastify codegen? Do you have a link to your modified project?

Yes I would hope the generator could be used as a dependency for the Fastify codegen for others to use. My project is an older openapi-ts build, most of the changes were to the types codegen https://github.com/jcx0/fastify-ts/commit/7647f46e91792f7f9f4d342a3c2bc6a485b253d7. It reuses the generated types and uses operation id instead of path/http method to map to the request/reply parameters.

The good news is that's on the roadmap. The bad news is, not anytime soon. If this issue gains more interest, it could get prioritised

Understandable! This would require a good deal of refactoring and I see there is a lot of work being done. Thank you for your replies

@jcx0 Are you able to roughly list what changes you've made in your repository? Think it would be easier to get this working well for you first rather than try to create a generic solution for potential users (who may or may not come)

Most of my changes were to the types generator. The changes were:

Use operation id instead of paths to map types
Reshape the operation parameters to match Fastify generic types
openapi-ts: path: { method: { req: { body: {}, query: {}, header: {}, path: {} } res: { 200: {} } } }
fastify: operationId: { Body: {}, Querystring: {}, Params: {}, Headers: {}, Reply: { 200: {}} }
Wrap the operations parameters with the Fastify RouteHandler type

The reason why I used this project's generator because the output is 99% close enough to what I need for types for Fastify. In fact with the current output I could use some TS utility type magic to get what I want. The only thing I would like is an operation id to path map such as below. The biggest feature wanted from the generic solution would be the JSON Schema to TS type conversion given an OpenAPI spec which the types generator deals with nicely.
I also see no need for a generic solution if there isn't much interest from other users. Perhaps I could do a better job of showing this off--I am new to the open source community. I do believe this helps the DX for schema first design and would help adoption.
export type $OpenApiTs = {
  "/user": {
    post: { req: CreateUserData, res: { 200: User } }
    get: { res: { 200: User } }
  }
};

export type Operations = {
  createUser: $OpenApiTs["/user"][post];
  getUser: $OpenApiTs["/user"][get];
}

Examples definitely help. How does Fastify handle responses with multiple content types?

Fastify natively only handles text/plain and application/json to remain lightweight. Additionally support is through plugins and custom parsers.
https://fastify.dev/docs/latest/Reference/ContentTypeParser/

Another Fastify user https://github.com/hey-api/openapi-ts/issues/876#issuecomment-2274326589

I can dedicate time to help now if it's wanted, but I can understand if other features are a priority right now (I can see there is active development of an experimental parser and this would delay that and other features).
As for implementation: we could create a generator directory in package/openapi-ts and do an incremental migration starting with openApi, moving on to the compiler, and then exposing the smaller, commonly used helper functions in generate. Once extracting all the common code, we could then move it into its own package openapi-generator(?).
Instead of picking out fields from UserConfig/ClientConfig to define Config we could do a copy/paste of the required subset of fields and pass the values from UserConfig/ClientConfig to Config when we call the functions in generator.
Again, more than happy to help/experiment and wouldn't be mad if it ends up being shelved.


bug: panicked at /risingwave/src/meta/src/barrier/schedule.rs:244:18:

Describe the bug
Failure in recovery test: https://buildkite.com/risingwavelabs/main-cron/builds/2104#018e5c98-0655-4b21-b3d1-343a8b3bf96c/99
Error message/log
thread '<unnamed>' panicked at /risingwave/src/meta/src/barrier/schedule.rs:244:18:
called `Result::unwrap()` on an `Err` value: RecvError(())
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
             at ./src/meta/src/barrier/schedule.rs:244:9
             at ./src/meta/src/barrier/schedule.rs:327:59
             at ./src/meta/service/src/stream_service.rs:72:69
             at ./src/prost/src/sim/meta.rs:2980:30
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
context: node=6 "meta-3", task=731805 (spawned at /risingwave/.cargo/registry/src/index.crates.io-6f17d22bba15001f/madsim-tonic-0.4.1+0.10.0/src/transport/server.rs:275:13)
note: run with `MADSIM_TEST_SEED=10` environment variable to reproduce this error

To Reproduce
No response
Expected behavior
No response
How did you deploy RisingWave?
No response
The version of RisingWave
No response
Additional context
No response

Suspect it might be related to https://github.com/risingwavelabs/risingwave/pull/13108
cc. @yezizp2012 Can you please take a look?


SendPaginatedMessage evaluates the IEnumerable multiple times

This can be bad for performance depending on what the actual type is. It could be a LINQ query and in that case the query will run every time something like First(), Count(), or ToArray() is used.
Should just eagerly ToList() at the start of the method and use that instead.

Should be fixed in next commit. Please reopen if i'm wrong


Various variant features and fixes

You can click on a Filter without selecting its Query first
Fixes bug where the drag and drop component would create new components instances instead of simply hydrating children
Refactor of Query to use the redux store instead of a local state
Moved a few pieces to helper functions and files to sanitize and manage history
Using sagas where possible instead of triggering from components

@gablabelle Please put back functionality:

@gablabelle Please put back functionality:

@gablabelle

@gablabelle

refer to branch fix/remaining-branches


Compatibility issue with Graph and BellmanFordShortestPath

Problem
The Bellman-Ford algorithm doesn't seem to be compatible with the graph implementation. It fails when the graph is undirected.
Since the Bellman-Ford algorithm iterates through all the edges, it has no notion of which vertex is adjacent. It treats the edges as directed and doesn't take into account the edge v->u when the graph is undirected.
Vertex<Integer> u = edge.getVertex1();
Vertex<Integer> v = edge.getVertex2();
//relax the edge
//if we get better distance to v via u then use this distance
//and set u as parent of v.
if (distance.get(u) + edge.getWeight() < distance.get(v)) {
   distance.put(v, distance.get(u) + edge.getWeight());
   parent.put(v, u);
}

I encountered this problem when Dijkstra and Bellman-Ford returned different results for the following graph:
Graph<Integer> graph = new Graph<>(false);
graph.addEdge(1, 2, 7);
graph.addEdge(1, 3, 9);
graph.addEdge(1, 6, 14);
graph.addEdge(2, 3, 10);
graph.addEdge(2, 4, 15);
graph.addEdge(3, 6, 2);
graph.addEdge(3, 4, 11);
graph.addEdge(4, 5, 6);
graph.addEdge(5, 6, 9);

Solution
Within the addEdge method of Graph.java, the current implementation is:
Edge<T> edge = new Edge<T>(vertex1,vertex2,isDirected,weight);
allEdges.add(edge);
vertex1.addAdjacentVertex(edge, vertex2);
if(!isDirected){
    vertex2.addAdjacentVertex(edge, vertex1);
}

A potential fix could be:
Edge<T> edge = new Edge<T>(vertex1,vertex2,isDirected,weight);
allEdges.add(edge);
vertex1.addAdjacentVertex(edge, vertex2);
if(!isDirected){
    edge = new Edge<T>(vertex2,vertex1,isDirected,weight);
    allEdges.add(edge);
    vertex2.addAdjacentVertex(edge, vertex1);
}

Bellman ford algorithm is for directed graph.


Design interrogation on using effects as "side" ones (when relevant)

I'm writing this to know if I get it right or not.
On examples found online, the pattern usually goes like this (example here on add/delete actions on the state and on a remote database) :
effects.ts :
@Effect()
add$ = this.action$
  .ofType(ADD)
  .switchMap((action: Action) => {
     return this.http.put(...)
       .map( response => response.json() )
       .map( response => Observable.of({ type: ADD_SUCCESS, payload: action.payload }))
       .catch( response => Observable.of({ type: ADD_FAIL, payload: response.status }))

reducer.ts
...
switch (action.type){
  case 'ADD_SUCCESS':
     ...
     return new_state;
  case 'ADD_FAIL':
     return state;
}

It works, but the speed of execution as felt by the user depends on how fast the network is. So I came up with a pattern that bets on the high probability that no error will be returned from the API:
reducer.ts
...
switch (action.type){
  case 'ADD':
     ... // make the adequate addition
     return new_state;
  case 'ADD_FAIL':
     ... // delete the addition previously made
     return new_state;
}

effects.ts :
@Effect()
add$ = this.action$
  .ofType(ADD)
  .switchMap((action: Action) => {
     return this.http.put(...)
       .map( response => response.json() )
       .catch( response => Observable.of({ type: ADD_FAIL, payload: action.payload }))

In this pattern, the action of saving to database really is a "side effect". In the unlikely but possible case where the API return an error, then a second action is taken to undo the first action.
But I haven't found yet this design in the examples given online: Since I'm an amateur dev, I wonder if I missed something that makes it wrong/dangerous/inefficient in the end.

This pattern has a more formal name called "optimistic updates". It is a great pattern as long as you can guarantee a high degree of success for your network requests.

Thanks @MikeRyan52 for your quick and kind reply. As an amateur dev, I'm proud of having reinvented the wheel! ;-) More seriously, I can now go on with my project without wondering.


[logging] add rotating file handler

[ ] See https://docs.python.org/3.6/library/logging.handlers.html#logging.handlers.RotatingFileHandler and https://docs.python.org/3.6/howto/logging-cookbook.html#using-file-rotation

see https://docs.python.org/3.6/howto/logging.html#useful-handlers for other possible file handlers
Aggregating logs generated from different processes

[ ] See Logging to a single file from multiple processes and A more elaborate multiprocessing example

Couldn't we use supervisord?

Couldn't we use supervisord?

We are just kicking off this project, and we can look into alternatives later.  The first cut is meant to be as simple as possible, and limiting ourselves to the standard library can help us to keep things simple for now.

I would recommend using the logging.handlers  RotatingFileHandler for now when we instantiate the logger. Keep it to a fixed 200MB size with 5 backups.
That should be enough.
I am still rooting for the UDP socket idea though. I feel it keeps things simple and becomes less of a perf bottleneck for us. And we can do richer log processing outside the DB.

UDP is a lossy, unordered socket.
It would be better at this point to prioritize event replayability IE of the HTTP interface
We don't really need an opinionated solution to log output right now, we just need the outputs to work...

@libscott:

UDP is a lossy, unordered socket

Hence the localhost and the UDP.

It would be better at this point to prioritize event replayability IE of the HTTP interface

Are you sure that increasing log verbosity in the system will not hurt performance? Json marshalling and unmarshalling, handling network events for logging affecting  core functionality. Logging is a fine line between capturing all interesting events without hurting performance.
I have faced scenarios where increasing debug levels have actually made the problem worse, or directed at different pain-points than the real issue.

We don't really need an opinionated solution to log output right now, we just need the outputs to work...

I honestly think I have a much stronger proposal that can last long term without affecting DB functionality.
Please let me know if you need clarifications and I will be happy to elaborate and listen to inputs.

Ok, true, it's a separate concern; replayable logs can be obtained using an intermediary such as nginx.


Update Iroha SDK version and add tests to CI

Iroha SDK version updated to ensure its compatibility with the latest Iroha binaries.
A sample testing scenario added to the CI to facilitate benchmarks.
Checklist

[x]  A link to the issue/user story that the pull request relates to
[ ]  How to recreate the problem without the fix
[ ]  Design of the fix
[ ]  How to prove that the fix works
[ ]  Automated tests that prove the fix keeps on working
[ ]  Documentation - any JSDoc, website, or Stackoverflow answers?

Issue/User story

https://github.com/hyperledger/caliper/issues/725
Steps to Reproduce

N/A
Existing issues

[ ] Stack Overflow issues
[ ] GitHub Issues
[ ] Rocket Chat history

Design of the fix

Validation of the fix

Automated Tests

What documentation has been provided for this pull request

@ekovalev - thank you for this PR 👍
Are you able to squash the commits?

Notice this is on master not the iroha branch that you asked for

@ekovalev - apologies for the delay in looking at this one. For some reason the lint/license checker is failing on the build at the moment within the iroha package


Add housekeeping operations to keyed state stores

Since keyed state stores might grow indefinitely as new keys get used, we should allow users to evict those keys that haven't been used in a while - if their state is indistinguishable from a fresh rate-limiting state, evict it.
TODO:

[x] add tests
[x] maybe upgrade DashMap so we get shrink_to_fit - blocked by https://github.com/xacrimon/dashmap/issues/6

bors r+


summer-ospp: support import data as column storage only by load data …

summer-ospp:
support import data as column storage only by load data
support export data as orc format by select into outfile
to issue #155

LGTM


Some minor fixes to Italian

Fixed an error on "preAlphaText" and adjusted "Controller_info".

Thank you! Merging now.


Issue: Could not reach any registry endpoint.

Expected behavior
Be able to install dashDB image.
Actual behavior
Could not reach registry endpoint.
Information about the Issue
First occurrence
Steps to reproduce the behavior

Launch Kitematics > My Repos > dashDB Local Create.
Communication to docker hub fails with "could not reach registry endpoint" error.

Docker Hub is hosted on AWS s3, which is currently down:
https://status.aws.amazon.com/
Sorry for the inconvenience.


Is this the new IdentityManager?

I ask this because we're also planning to create an open-source project based on IdentityServer3 v2 with administrator support but also with user self-service support. The idea is to have a standalone OpenID Connect solution like pingidentity.com, auth0.com or Azure Active Directory B2C.
So I wonder what the roadmap/features are for this project or if it is just a revamped IdentityManager?

No. This is just the admin piece for the IdentityServer scopes and clients if you plan to use a database for that data. It's unrelated to managing the users and unrelated to IdentityManager.

...and instead of building something new - it would be more appropriate to rather contribute to the base.

Contributing sounds perfect. Is there any project in particular that you know of or do you mean contributing this to IdentityManager itself?

Well, I think he means these projects (both this repo for the IdentityServer Admin UI, and IdentityManager). And just so we're clear, these two projects are deliberately separate, but of course can be used together.

I would still have to add a third project to add user self-service as users should be able to manage their applications, credentials and link/unlink their external identities.
We then might need a 4th project to combine all of these because we want a self-contained solution that can be deployed without having to change any line of code. It should start out of the box with a predefined admin user and everything should be configurable through the web-interface.

Every project on its own is OWIN middleware which enables composability - maybe that is a good research topic to start with.

Combining IdentityServer3 with WebAPI and static file/embedded file hosting is not that straightforward with OWIN, it is not plug and play.

This is our current startup f.e.
// The order is very important, if we call UseIdentityServer first, then models posted to
// the manager Web API are not converted anymore.
app.Map("/api", apiApp => apiApp.UseIdentityServerWebApi());

// We need to map UseIdentityServer to a sub-path, otherwise the the FileServer middleware
// can't host index.html on the root url.
app.Map("/id", IdentityServer3.Configure);

// Must come after WebApi and IdentityServer3
FileServer.Configure(app);

// Needed to make UseFileServer/UseStaticFiles work until vNext arrives.
// See http://katanaproject.codeplex.com/wikipage?title=Static%20Files%20on%20IIS
app.UseStageMarker(PipelineStage.MapHandler);

Second comment about mapping IdentityServer is no longer needed I guess, since now when EnableWelcomePage = false, the route is no longer registered. Anyway the other comments show how fragile the OWIN pipeline is :)

Oh btw, I initially didn't want to discuss about whether or not we will start with the project. But now we got to it, I don't feel a lot of support for it either or did I misinterpret this?
I remember people asking for such a solution and now when we see those OpenID Connect cloud services rising, it might mean the end for the IdentityServer project, because getting IdentityServer working in a production environment still needs a lot of knowledge, effort and resources.

This is the new admin project - @iBoonz currently works on it on its own - so your help would be very much appreciated.
We won't merge the Admin UI and IdentityManager - because all the projects we did so far, no-one ever used both functionalities in a single tool (separation of concerns).
So please get in touch with @iBoonz so he can tell you how to help out.


Flowtypes are broken

The flowtypes were quite badly broken during the massive refactor.
These will need to be fixed and then enforced in the pre-push hook.

[ ] Flow types fixed
[ ] Typechecking added to prepush hook

This will probably require #6 to be completed

Well fix em

Closed: won't fix


Is there a way to mock m.top.getScene() call?

I currently have a component that is dependent on m.top.getScene(). Is there a way to mock this function so I wouldn't have to change the current code base?
Currently, it isn't available in a Node scope.
SomeNode.brs(17,19-20): 'getScene' is not a function and cannot be called.Runtime error encountered in BRS implementation:  Error: Something terrible happened and we didn't throw a `BlockEnd` instance.

The getScene() function is declared in the ifSGNodeChildren interface, which is implemented by roSGNode:

getScene() as roSGNode
Description
Returns the node's root Scene. This returns a valid Scene even if the node is not parented.
Return Value
The node's root Scene.

We don't currently have any scene support, unfortunately. But I think that it should be possible to mock it with #495.


balloon: introduce BALLOON_INFLATE_IGNORE_LOWMEM macro

Introduce BALLOON_INFLATE_IGNORE_LOWMEM macro to avoid the check for low
memory before further inflating the balloon towards the target set by
the hypervisor.
This enables the hypervisor to reclaim guest cold pages. The inflating
balloon causes pressure, which Windows resolves by paging-out cold memory
to the Pagefile.
Co-authored-by: Carl Waldspurger <carl.waldspurger@@nutanix.com>
Co-authored-by: Florian Smidth<EMAIL_ADDRESS>Co-authored-by: Sergey Bykov<EMAIL_ADDRESS>Co-authored-by: Jonathan Davies<EMAIL_ADDRESS>

@kostyanf14 It looks that "Hardware-enforced Stack Protection Compatibility Test" is still running.

FYI, I ran HCK/HLK test suites for the balloon driver compiled with BALLOON_INFLATE_IGNORE_LOWMEM set for the following OSs and didn't see any failures:

Windows Server 2012R2
Windows Server 2016
Windows Server 2019
Windows Server 2022

FYI, I ran HCK/HLK test suites for the balloon driver compiled with BALLOON_INFLATE_IGNORE_LOWMEM set for the following OSs and didn't see any failures:

Windows Server 2012R2
Windows Server 2016
Windows Server 2019
Windows Server 2022

Thanks!

Fixed a typo in the commit message. Apologies, the forced push has cleared the test results. This was the link:
https://www.dropbox.com/sh/qhd3l8f945hbixe/AABMFlxlaPlfuu7S55bnhq6Ba?dl=0&lst=
Hardware-enforced Stack Protection Compatibility Test timed-out:
1932 4004 2022:6:30 0:31:22:249 Error: 0x8201adb1, Error 0x8201adb1   CExecutionTask::Cleanup()::(null)::CAUSE:INFORMATION: Task "Run Test" Failed Because the Task With TaskTimeout Flag Was running after the Timeout period 1800000 MilliSeconds    File=sdktools\dtm\wttbuild\coresys\client\executiontask\executiontask.cpp Line=1754
Maybe a spurious failure?

Fixed a typo in the commit message. Apologies, the forced push has cleared the test results. This was the link: https://www.dropbox.com/sh/qhd3l8f945hbixe/AABMFlxlaPlfuu7S55bnhq6Ba?dl=0&lst=
Hardware-enforced Stack Protection Compatibility Test timed-out: 1932 4004 2022:6:30 0:31:22:249 Error: 0x8201adb1, Error 0x8201adb1 CExecutionTask::Cleanup()::(null)::CAUSE:INFORMATION: Task "Run Test" Failed Because the Task With TaskTimeout Flag Was running after the Timeout period 1800000 MilliSeconds File=sdktools\dtm\wttbuild\coresys\client\executiontask\executiontask.cpp Line=1754
Maybe a spurious failure?

"Hardware-enforced Stack Protection Compatibility Test" is a manual test, requires manual intervention and ideally should not be run

Great! Thanks @YanVugenfirer!


Support type guards in script setup

Hello,
Variable test in the last line is typed as object but inside template, it is still object|null which causes possible null error.
<template>
  <div>{{ test.message }}</div>
</template>

<script setup lang="ts">
let test: { message: string }|null = { message: 'hello' };

if (test === null) {
  throw new Error('error');
}

let obj: object = test;
</script>

function setup() {
  let test: { message: string } | null = { message: 'hello' }

  if (test === null) {
    throw new Error('error')
  }

  // simulate render function
  return () => {
    return test.message // Object is possibly 'null'.
  }
}

Expected? so I am supposed to check the nullability of a variable twice in the same component?
Is this expencted?

You can

using obj.message inside template
using test?.message inside template (no null check inside ts)
add v-if="test" to div (no null check inside ts)

Well, they check nullability twice.
I am closing the issue as this is expencted.

Actually this behavior was designed by TS as a control flow analysis trade-off

So how do you guys write your components? it is really dirty to check nullability twice.

Guess you missed the previous comment?

I already knew them, but they are dirty. anyways, ty.

Throw error was not the best way for UI rendering, there should be placeholders when no data, so the dirty way was needed.
When test was a prop, why not using v-if on component instance?

It is not like really throw error. it will be handled later.
for example in nuxt 3 you do like this:
throw createError({ statusCode: 404 });


Use utimensat on FreeBSD

Every supported version of FreeBSD includes utimensat(2).  Filetimes should use that instead of utimes, to get nanosecond precision.

Sounds good to me!