Update Kubernetes link since is broken

Hello,
Kubernetes link on this codelab is broken. Updated with the kubernetes.io one
Cheers,
Laura

I signed it!

@askcarter @ianlewis , is this repo accepting contributions? I was going through it with the Qwiklab materials for Cloud Study Jams  and found the broken link against K8s


JSONValidationError for the graphqltransformer preventing build from completing

Describe the bug
I am receiving File project: data should NOT have additional properties: 'graphqltransformer' and File project: data should NOT have additional properties: 'graphqltransformer' errors when attempting to complete the build at the end of Module 3 of the Build a Full-Stack React Application tutorial.
To Reproduce
Steps to reproduce the behavior:

Follow the Build a Full-Stack React Application tutorial through the Deploy the changes to the live environment step in Module 3.
The application will correctly provision and clone the repository; however, the build will fail at the Backend stage.
In the AWS Amplify Console, click on the failed build icon.
View the error in the Backend section of the build.

Expected behavior
The build should complete and successfully deploy the updated application to AWS Amplify.
Screenshots
Here is a screenshot of the error received during the build:

Desktop (please complete the following information):

OS: macOS Big Sur 11.0.1
Browser: Chrome
Version: 87.0.4280.88 (Official Build) (x86_64)

Smartphone (please complete the following information):

Smartphone not used

Additional context
The Build a Full-Stack React Application tutorial was followed step-by-step up to the Deploy the changes to the live environment step in Module 3, where the build error was encountered. The rest of the tutorial was completed and the application is fully functioning locally; however, the build fails and the application cannot be deployed to AWS Amplify.

I am facing the same problem with a project which did build till yesterday. Any ideas what might be the source of this problem?

I have just found the solution to this issue in Amplify-CLI repo.You have to set an package override for the Amplify CLI.

change Amplify console version: go to Amplify console -> app settings -> build settings.  scroll down to  "Build Image Settings" section and click Edit
Change Amplify CLI to latest or specific version. :)

Still fails to build for me, even with version set to latest:
2020-12-20T10:15:18.113Z [INFO]: # Ensuring NPM package '@aws-amplify/cli' is version: 'latest'
2020-12-20T10:15:22.523Z [INFO]: # Patching NPM package '@aws-amplify/cli' from 4.29.4 to 4.40.0...
aching...
2020-12-20T10:16:12.878Z [INFO]: # Environment caching completed
Terminating logging...

Still fails to build for me, even with version set to latest:
2020-12-20T10:15:18.113Z [INFO]: # Ensuring NPM package '@aws-amplify/cli' is version: 'latest'
2020-12-20T10:15:22.523Z [INFO]: # Patching NPM package '@aws-amplify/cli' from 4.29.4 to 4.40.0...
aching...
2020-12-20T10:16:12.878Z [INFO]: # Environment caching completed
Terminating logging...

you may try to match your version with the one in Amplify.  See if it works.

I had the same issue, switched Amplify CLI version from latest to my current version and still received build error. I then had a new notification about service role. I added a service role by following: https://docs.aws.amazon.com/amplify/latest/userguide/how-to-service-role-amplify-console.html and Voila! it works now!
p.s. I switched the Amplify CLI version back to latest instead of my most recent version and still getting successful builds.

I had the same issue, switched Amplify CLI version from latest to my current version and still received build error. I then had a new notification about service role. I added a service role by following: https://docs.aws.amazon.com/amplify/latest/userguide/how-to-service-role-amplify-console.html and Voila! it works now!
p.s. I switched the Amplify CLI version back to latest instead of my most recent version and still getting successful builds.

Yeah this is the solution. I have both problems. With this https://docs.aws.amazon.com/amplify/latest/userguide/how-to-service-role-amplify-console.html  I fixed my role situation, and changing to the latest version I could build. Thank you very much


Vite plugin using deprecated API

Macaron's Vite plugin seems to be using a deprected version of their API,
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

Thanks for reporting, will fix this


coalesce to improve writing speed.

Use coalesce in pyspark to improve writing speed (#156).
Default value 4. Can be configured in eva.yml.
Issue:
Skip test_select_and_sample in https://github.com/georgia-tech-db/eva/blob/master/test/integration_tests/test_select_executor.py.
Sample needs ORDER BY support.

@gaurav274 Do you know the resource limitation for circleci? It seems it is hanging with coalesce = 4.

I am unaware of the resource allocation. We have a free plan. We can check what is supported in that plan. Do you know what is the resource requirements with coalesce = 4?

Close and open again to test circle ci.


feat: Use locally installed Ionic (from node_modules/.bin)

In my company we have  a couple of Mac Minis that are used for building iOS apps in CI.
It's common for projects to have different Ionic and/or Cordova versions, so using the globally installed Ionic is no good in this case.

Thanks, this is a great feature.
Is node_modules/.bin valid on all platforms?
I think we had similar requests in the past to be able to use npx ionic or something like that, your PR should be a good template to implement that as well.

Thanks, this is a great feature.
Is node_modules/.bin valid on all platforms?
I think we had similar requests in the past to be able to use npx ionic or something like that, your PR should be a good template to implement that as well.

I know node_modules/.bin is valid on Linux & Mac OS. I'll have to test it on Windows, but it's gonna take a few days.

I replaced node_modules/.bin with File.join("node_modules", ".bin", "") (so it uses the correct path separators), but I couldn't get Fastlane to work on Windows (some problem while installing gem unf_ext).
I'm using Chocolatey to install Ruby and installed all these packages below, but nothing seems to work.
7zip.commandline <IP_ADDRESS>70209
7zip.portable 19.0
chocolatey 0.10.15
chocolatey-core.extension 1.3.3
DotNet4.5.2 <IP_ADDRESS>40902
microsoft-visual-cpp-build-tools 14.0.25420.1
mingw 8.1.0
msys2 20180531.0.0
nodejs.install 10.16.2
ruby <IP_ADDRESS>
ruby2.devkit <IP_ADDRESS>3022403

@robingenz I couldn't test in on Windows, but if you're saying it works, it's up to @janpio to merge or not.


Parse error: syntax error, unexpected '}' in /container/service/phpldapadmin/assets/config.php on line 68

running in docker-compose, relevant section is:
 phpldapadmin:
    image: osixia/phpldapadmin:0.6.8
    container_name: phpldapadmin_container
    depends_on:
	- ldap
    ports:
      - "8092:80"
    environment:
      - PHPLDAPADMIN_LDAP_HOSTS=ldap
      - PHPLDAPADMIN_HTTPS=false

docker-compose up output (filtered for specific container):
phpldapadmin_container | *** CONTAINER_LOG_LEVEL = 3 (info)
phpldapadmin_container | *** Search service in CONTAINER_SERVICE_DIR = /container/service :
phpldapadmin_container | *** link /container/service/:apache2/startup.sh to /container/run/startup/:apache2
phpldapadmin_container | *** link /container/service/:apache2/process.sh to /container/run/process/:apache2/run
phpldapadmin_container | *** link /container/service/:cfssl/startup.sh to /container/run/startup/:cfssl
phpldapadmin_container | *** link /container/service/:cron/startup.sh to /container/run/startup/:cron
phpldapadmin_container | *** link /container/service/:cron/process.sh to /container/run/process/:cron/run
phpldapadmin_container | *** link /container/service/:logrotate/startup.sh to /container/run/startup/:logrotate
phpldapadmin_container | *** link /container/service/:php5-fpm/startup.sh to /container/run/startup/:php5-fpm
phpldapadmin_container | *** link /container/service/:php5-fpm/process.sh to /container/run/process/:php5-fpm/run
phpldapadmin_container | *** link /container/service/:syslog-ng-core/startup.sh to /container/run/startup/:syslog-ng-core
phpldapadmin_container | *** link /container/service/:syslog-ng-core/process.sh to /container/run/process/:syslog-ng-core/run
phpldapadmin_container | *** link /container/service/ldap-client/startup.sh to /container/run/startup/ldap-client
phpldapadmin_container | *** link /container/service/phpldapadmin/startup.sh to /container/run/startup/phpldapadmin
phpldapadmin_container | *** Set environment for startup files
phpldapadmin_container | *** Environment files will be proccessed in this order :
phpldapadmin_container | Caution: previously defined variables will not be overriden.
phpldapadmin_container | /container/environment/99-default/default.yaml
phpldapadmin_container |
phpldapadmin_container | To see how this files are processed and environment variables values,
phpldapadmin_container | run this container with '--loglevel debug'
phpldapadmin_container | *** Running /container/run/startup/:apache2...
phpldapadmin_container | *** Running /container/run/startup/:cfssl...
phpldapadmin_container | *** Running /container/run/startup/:cron...
phpldapadmin_container | *** Running /container/run/startup/:logrotate...
phpldapadmin_container | *** Running /container/run/startup/:php5-fpm...
phpldapadmin_container | *** Running /container/run/startup/:syslog-ng-core...
phpldapadmin_container | *** Running /container/run/startup/ldap-client...
phpldapadmin_container | No certificate file and certificate key provided, generate:
phpldapadmin_container | /container/service/ldap-client/assets/certs/ldap-client.crt and /container/service/ldap-client/assets/certs/ldap-client.key
phpldapadmin_container | 2016/06/07 10:35:23 [INFO] generate received request
phpldapadmin_container | 2016/06/07 10:35:23 [INFO] received CSR
phpldapadmin_container | 2016/06/07 10:35:23 [INFO] generating key: ecdsa-384
phpldapadmin_container | 2016/06/07 10:35:23 [INFO] encoded CSR
phpldapadmin_container | 2016/06/07 10:35:23 [INFO] signed certificate with serial number<PHONE_NUMBER>75630577092912973942148232864250094169
phpldapadmin_container | Link /container/service/:cfssl/assets/default-ca/default-ca.pem to /container/service/ldap-client/assets/certs/ldap-ca.crt
phpldapadmin_container | *** Running /container/run/startup/phpldapadmin...
phpldapadmin_container | Set apache2 http config...
phpldapadmin_container | *** Set environment for container process
phpldapadmin_container | *** Environment files will be proccessed in this order :
phpldapadmin_container | Caution: previously defined variables will not be overriden.
phpldapadmin_container | /container/environment/99-default/default.yaml
phpldapadmin_container |
phpldapadmin_container | To see how this files are processed and environment variables values,
phpldapadmin_container | run this container with '--loglevel debug'
phpldapadmin_container | *** Running runit daemon...
phpldapadmin_container | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using <IP_ADDRESS>. Set the 'ServerName' directive globally to suppress this message
phpldapadmin_container | Jun  7 10:35:24 d14a473aa845 syslog-ng[1475]: syslog-ng starting up; version='3.5.6'

however, once started and navigating to http://localhost:8092/, I see:
Parse error: syntax error, unexpected '}' in /container/service/phpldapadmin/assets/config.php on line 68

I  checked the contents of the specific file:
docker exec phpldapadmin_container tail /container/service/phpldapadmin/assets/config.php

/*********************************************
 * Define your LDAP servers in this section  *
 *********************************************/

$servers = new Datastore();

/*
 * Autogenerated servers variables will come here
 */
{{ PHPLDAPADMIN_SERVERS }}

The problematic line referred to is the last one.
How can I fix it?

I have the same problem.
To go further, when I ran "docker exec ...", the environment variable "PHPLDAPADMIN_SERVERS" is well set.
It's maybe a problem with the startup.sh call?

@lcotonea thanks for the version hint!
Seems to be a regression. downgrading to 0.6.7 locally, until fix arrives.

hi guys,
i tried with this docker-compose.yml :
version: '2'
services:
  ldap:
    image: osixia/openldap
    container_name: openldap_container
  phpldapadmin:
    image: osixia/phpldapadmin:0.6.9
    container_name: phpldapadmin_container
    depends_on:
    - ldap
    ports:
      - "8092:80"
    environment:
      - PHPLDAPADMIN_LDAP_HOSTS=ldap
      - PHPLDAPADMIN_HTTPS=false

everything seems ok. Could you provide your docker-compose.yml files ?
Thanks.

Here my extract (docker-compose V1):
`
openldap:
image: dinkel/openldap
environment:
- SLAPD_ORGANIZATION=XXX
- SLAPD_DOMAIN=dc=xxx,dc=yyy,dc=com
- SLAPD_RECONFIGURE=true
volumes:
- $PWD/openldap/data/var/lib/ldap:/var/lib/ldap
- $PWD/openldap/data/etc/ldap:/etc/ldap
phpLDAPadmin:
image: osixia/phpldapadmin:0.6.7
environment:
- PHPLDAPADMIN_LDAP_HOSTS=ldap
- PHPLDAPADMIN_HTTPS=false
links:
- openldap:ldap
ports:
- "<IP_ADDRESS>:8081:80"
`

this works for me:
openldap:
  image: dinkel/openldap
  environment:
    - SLAPD_ORGANIZATION=XXX
    - SLAPD_DOMAIN=dc=xxx,dc=yyy,dc=com
    - SLAPD_RECONFIGURE=true
    - SLAPD_PASSWORD=test
  volumes:
    - $PWD/openldap/data/var/lib/ldap:/var/lib/ldap
    - $PWD/openldap/data/etc/ldap:/etc/ldap

phpLDAPadmin:
  image: osixia/phpldapadmin:0.6.7
  environment:
    - PHPLDAPADMIN_LDAP_HOSTS=ldap
    - PHPLDAPADMIN_HTTPS=false
  links:
    - openldap:ldap
  ports:
    - "<IP_ADDRESS>:8081:80"

i added SLAPD_PASSWORD=test to get it working otherwise a got Cannot link to a non running container
The following phpLDAPadmin configuration is created :
<?php
/** NOTE **
 ** Make sure that <?php is the FIRST line of this file!
 ** IE: There should NOT be any blank lines or spaces BEFORE <?php
 **/

 /*********************************************
  * Useful important configuration overrides  *
  *********************************************/

 /* If you are asked to put PLA in debug mode, this is how you do it: */
 $config->custom->debug['level'] = 0;
 $config->custom->debug['syslog'] = true;
 #  $config->custom->debug['file'] = '/tmp/pla_debug.log';

/**
 * The phpLDAPadmin config file
 * See: http://phpldapadmin.sourceforge.net/wiki/index.php/Config.php
 */

/* The temporary storage directory where we will put jpegPhoto data
   This directory must be readable and writable by your web server. */
 $config->custom->jpeg['tmpdir'] = '/var/www/tmp';

 /* phpLDAPadmin can encrypt the content of sensitive cookies if you set this
   to a big random string. */

/*
 * Autogenerated value will be automatically added by phpldapadmin/startup.sh
 */
 $config->custom->session['blowfish'] = 'YHjZd/=qvO!UY_ssP#ObXjuaP{.k]Vuy]z^aiFDt$?Ppw?L%%X[jh$f[*_:J/>Ew';

/*********************************************
 * Appearance                                *
 *********************************************/
/* Hide the warnings for invalid objectClasses/attributes in templates. */
$config->custom->appearance['hide_template_warning'] = true;

/*********************************************
 * User-friendly attribute translation       *
 *********************************************/

/* Use this array to map attribute names to user friendly names. For example, if
   you don't want to see "facsimileTelephoneNumber" but rather "Fax". */
// $config->custom->appearance['friendly_attrs'] = array();
$config->custom->appearance['friendly_attrs'] = array(
	'facsimileTelephoneNumber' => 'Fax',
	'gid'                      => 'Group',
	'mail'                     => 'Email',
	'telephoneNumber'          => 'Telephone',
	'uid'                      => 'User Name',
	'userPassword'             => 'Password'
);

/*********************************************
 * Define your LDAP servers in this section  *
 *********************************************/

$servers = new Datastore();

/*
 * Autogenerated servers variables will come here
 */
$servers->newServer('ldap_pla');
$servers->setValue('server','name','ldap');
$servers->setValue('server','host','ldap');

in /var/www/phpldapadmin/config/config.php

The version of osixia/phpldapadmin is 0.6.7 in your test (my fault, because of a wrong copy&paste).
Can you test with the latest version please ?

Just tried with 0.6.8 and 0.6.9 with the same result eveything seems ok.
can you tried running this and show the outputs  ?
openldap:
  image: dinkel/openldap
  environment:
    - SLAPD_ORGANIZATION=XXX
    - SLAPD_DOMAIN=dc=xxx,dc=yyy,dc=com
    - SLAPD_RECONFIGURE=true
    - SLAPD_PASSWORD=test
  volumes:
    - $PWD/openldap/data/var/lib/ldap:/var/lib/ldap
    - $PWD/openldap/data/etc/ldap:/etc/ldap

phpLDAPadmin:
  image: osixia/phpldapadmin:0.6.9
  environment:
    - PHPLDAPADMIN_LDAP_HOSTS=ldap
    - PHPLDAPADMIN_HTTPS=false
  command: -l debug
  links:
    - openldap:ldap
  ports:
    - "<IP_ADDRESS>:8081:80"

(command: -l debug was added)

if there is nothing special with -l debug run with -l trace please :)

Ok, I think I've identified the problem.... When I sent you the sample docker compose file, I've replaced my SLAPD_ORGANIZATION variable by XXX. But in my file, there is some spaces into the variable value.
Try with that and the problem will occur:
openldap:
  image: dinkel/openldap
  environment:
    - SLAPD_ORGANIZATION=My Organisation Com
    - SLAPD_DOMAIN=dc=my,dc=organisation,dc=com
    - SLAPD_RECONFIGURE=true
    - SLAPD_PASSWORD=test
  volumes:
    - $PWD/openldap/data/var/lib/ldap:/var/lib/ldap
    - $PWD/openldap/data/etc/ldap:/etc/ldap

phpLDAPadmin:
  image: osixia/phpldapadmin:0.6.9
  environment:
    - PHPLDAPADMIN_LDAP_HOSTS=ldap
    - PHPLDAPADMIN_HTTPS=false
  command: -l debug
  links:
    - openldap:ldap
  ports:
    - "<IP_ADDRESS>:8081:80"

@osixia Any updates here? Don't want to rush, rather just curious.
On Jun 14, 2016 12:30, "Loïc Cotonéa"<EMAIL_ADDRESS>wrote:

Ok, I think I've identified the problem.... When I sent you the sample
docker compose file, I've replaced my SLAPD_ORGANIZATION variable by XXX.
But in my file, there is some spaces into the variable value.
Try with that and the problem will occur:
openldap:
image: dinkel/openldap
environment:
- SLAPD_ORGANIZATION=My Organisation Com
- SLAPD_DOMAIN=dc=my,dc=organisation,dc=com
- SLAPD_RECONFIGURE=true
- SLAPD_PASSWORD=test
volumes:
- $PWD/openldap/data/var/lib/ldap:/var/lib/ldap
- $PWD/openldap/data/etc/ldap:/etc/ldap
phpLDAPadmin:
image: osixia/phpldapadmin:0.6.9
environment:
- PHPLDAPADMIN_LDAP_HOSTS=ldap
- PHPLDAPADMIN_HTTPS=false
command: -l debug
links:
- openldap:ldap
ports:
- "<IP_ADDRESS>:8081:80"
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/osixia/docker-phpLDAPadmin/issues/23#issuecomment-225842350,
or mute the thread
https://github.com/notifications/unsubscribe/AAegbFq2tru-33T1hvAXpHqK6WJxW6HXks5qLoLTgaJpZM4Ivyc6
.

I'm fairly certain that the problem seems to be the blowfish value that's autogenerated. Sometimes, a character is in the string that isn't properly escaped and PHP has a parsing error. This is why the problem is intermittent.
Unfortunately, since it's intermittent, I'm having an issue reproducing it to be absolutely certain. 😆

@cfairweather yes me too :smile:

For me it looked to be caused by the {{ PHPLDAPADMIN_SERVERS }} line in config.php not being replaced (line 68)
It seemed to happen when the ldap-admin container would start before the ldap container - causing it to appear intermittent.
Using docker-compose depends_on fixed it for me
ldap-admin:
    image: osixia/phpldapadmin
    depends_on:
      - ldap
    environment:
      - PHPLDAPADMIN_LDAP_HOSTS=ldap
...

Agreed, I actual saw this issue happen today where the "templating" wasn't applied to the configuration file.

Cristoffer

On Jul 6, 2016, at 16:25, Taylor Ludwig<EMAIL_ADDRESS>wrote:
For me it looked to be caused by the {{ PHPLDAPADMIN_SERVERS }} line in config.php not being replaced (line 68)
It seemed to happen when the ldap-admin container would start before the ldap container - causing it to appear intermittent.
Using docker-compose depends_on fixed it for me
ldap-admin:
image: osixia/phpldapadmin
depends_on:
- ldap
environment:
- PHPLDAPADMIN_LDAP_HOSTS=ldap
...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Still getting the same error here, with 0.6.11 and depends_on set:
compose.yml:
ldap:
    container_name: ldap
    image: 'osixia/openldap:1.1.6'
    environment:
      LDAP_ORGANISATION: 'xx'
      LDAP_DOMAIN: 'xx.com'
      LDAP_ADMIN_PASSWORD: 'admin'
    volumes:
      - /usr/local/ldapdata:/var/lib/ldap
      - /usr/local/ldapcfg:/etc/ldap/slapd.d

  ldap_admin:
    container_name: ldap_admin
    image: 'osixia/phpldapadmin:0.6.11'
    links:
      - ldap
    depends_on:
      - ldap
    environment:
      PHPLDAPADMIN_HTTPS: 'false'
      PHPLDAPADMIN_LDAP_HOSTS: 'ldap'
    ports:
      - '6080:80'
    command: '-l debug'

last bit of log:
ldap_admin        | *** Set environment for container process
ldap_admin        | *** Environment files will be proccessed in this order :
ldap_admin        | Caution: previously defined variables will not be overriden.
ldap_admin        | /container/environment/99-default/default.yaml
ldap_admin        |
ldap_admin        | *** --- process file : /container/environment/99-default/default.yaml ---
ldap_admin        | *** ignore : PHPLDAPADMIN_HTTPS = True (keep PHPLDAPADMIN_HTTPS = false )
ldap_admin        | *** Run commands before process...
ldap_admin        | *** ------------ Environment dump ------------
ldap_admin        | *** PHPLDAPADMIN_HTTPS = false
ldap_admin        | *** LC_CTYPE = C.UTF-8
ldap_admin        | *** PHPLDAPADMIN_SSL_HELPER_PREFIX = phpldapadmin
ldap_admin        | *** PHPLDAPADMIN_VERSION = 1.2.3
ldap_admin        | *** INITRD = no
ldap_admin        | *** HOME = /root
ldap_admin        | *** PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ldap_admin        | *** PHPLDAPADMIN_HTTPS_KEY_FILENAME = phpldapadmin.key
ldap_admin        | *** LANG = C.UTF-8
ldap_admin        | *** affinity:container = =64ecd3c116d91d415007c1a5f5662d221dedb783e3a12d6548a9322d886d8e71
ldap_admin        | *** PHPLDAPADMIN_SERVER_ADMIN =<EMAIL_ADDRESS>ldap_admin        | *** CONTAINER_SERVICE_DIR = /container/service
ldap_admin        | *** PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME = ca.crt
ldap_admin        | *** LANGUAGE = C.UTF-8
ldap_admin        | *** PHPLDAPADMIN_HTTPS_CRT_FILENAME = phpldapadmin.crt
ldap_admin        | *** PHPLDAPADMIN_TRUST_PROXY_SSL = False
ldap_admin        | *** PHPLDAPADMIN_LDAP_HOSTS = ldap
ldap_admin        | *** PHPLDAPADMIN_SHA1 = 669fca66c75e24137e106fdd02e3832f81146e23
ldap_admin        | *** CONTAINER_LOG_LEVEL = 4
ldap_admin        | *** HOSTNAME = 12bcc2afbc95
ldap_admin        | *** CONTAINER_STATE_DIR = /container/run/state
ldap_admin        | *** PHPLDAPADMIN_SERVER_PATH = /phpldapadmin
ldap_admin        | *** ------------------------------------------
ldap_admin        | *** Running runit daemon...
ldap_admin        | *** runit daemon started as PID 1431
ldap_admin        | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using <IP_ADDRESS>. Set the 'ServerName' directive globally to suppress this message

inside container the last bit of config.php still has templating intact:
/*********************************************
 * Define your LDAP servers in this section  *
 *********************************************/

$servers = new Datastore();

/*
 * Autogenerated servers variables will come here
 */
{{ PHPLDAPADMIN_SERVERS }}

Any ideas?
Any way I can add a startup delay to the admin container to make sure the ldap container has time to start up properly?

I'm also having this issue. Tried it with 0.6.9, -10 and 11.
Stripped out the space in my organisation name.
PHPLDAPADMIN_SERVERS is not replaced in the config.
@thearrow did you find a solution?

@sirrapa I ended up just using this docker image instead: https://hub.docker.com/r/dinkel/phpldapadmin/


[0.8.4][Linux] Never reaches the end position and timeout

When I tried to follow Benchmarking your Agent (https://carla.readthedocs.io/en/latest/benchmark_creating/), I noticed two problems as follows. I'm using an autopilot agent by using control = measurements.player_measurements.autopilot_control

The benchmark never reaches the end position and ends with timeout. I used poses_tasks = [[[140, 134]]]

The benchmark never reaches the end position with sufficient time. I increased time_out by 10 times in CARLA_0.8.4/PythonClient/carla/driving_benchmark/driving_benchmark.pydriving_benchmark.py

The agent provided by the server does not follow the high level commands.
For that I created a client side agent for version 0.8.4 that is now on another repository.
https://github.com/carla-simulator/data-collector


add DockerContainerIdComponent

resolves #26

The only special information available by default in docker seems to be a container-id extracted from '/proc/1/cgroup'.
Informations to build the new Component were gathered from Baeldung and Stackoverflow.


more feedback from ipfs add

Currently, addFromFs and ipfs add only trigger the callback when everything is done or if an error occured. This has two problem:

there is no feedback of the progress during the operation.
all the stream of event of the daemon is buffered in memory and that can be expensive for a directory with a lot of files
there is no way to process the result during the operation. You have to wait and process everything in the end.

It would be nice if there was an unbuffered version that trigger the callback for each daemon event.

Agreed. This is also related with the progress bar support - https://github.com/ipfs/js-ipfs/issues/879
In js-ipfs-api case with go-ipfs, it is really due to the nature of how the multipart message is created and how a http request is formed. We are aware that we need to level up our http-api to support things like this, see:  https://github.com/ipfs/http-api-spec/issues/116

Released on  v14.3.7 \o/


Readd an exitcode on error

mass change to add 'on error, exit exit code 1' back to the cli

Fixes #130

Looks good


fixed ScoreKeeper Dynamo Setup hash attribute type

Fixed the ScoreKeeper README Dynamo Setup primary key attribute type from "Hash" to "String".
Fixes Issue #27

Thanks for this!


fix: Age Validation in Profile Section

Fixes Issue #410
My PR closes #410
👨💻 Changes proposed(What did you do ?)
I have implemented client-side validation to prevent users from entering negative values for age. This was achieved by using HTML attributes and JavaScript validation.
✔ Check List (Check all the applicable boxes)

[x] My code follows the code style of this project.
[x] This PR does not contain plagiarized content.
[x] The title and description of the PR is clear and explains the approach.

Note to reviewers
Could you please consider adding the "hacktoberfest" and "hacktoberfest-accepted" labels to this pr? Thanks a bunch!
📷 Screenshots
https://github.com/Dun-sin/Whisper/assets/110025628/7ce43ebb-90fa-4309-a17c-4b765a21b7ff

@Dun-sin ready for review

Please don't tag maintainers for a review, we see the PR you create.


shard_metadata not found

What is your question?
I run python -m metaseq.scripts.consolidate_fsdp_shards ${FOLDER_PATH}/checkpoint_last --new-arch-name transformer_lm_gpt --save-prefix ${FOLDER_PATH}/consolidated following #60 to merge the shards but I got this error: metadata.append(ckpt["shard_metadata"])
I tried on 125M and 1B3. How to fix the issues?
Code

What have you tried?
What's your environment?

metaseq Version (e.g., 1.0 or master): master
PyTorch Version (e.g., 1.0) 1.10.1+cu113
OS (e.g., Linux): Ubuntu 18.04 LTS
How you installed metaseq (pip, source): I followed the tutorials
Build command you used (if compiling from source):
Python version: 3.7.13
CUDA/cuDNN version: 11.3
GPU models and configuration: NVIDIA GeForce RTX 2060
Any other relevant information: N/A

have you soled this problem?


Add docker.io registry to a config.toml.tmpl

I've added registry endpoint of the docker.io that  necessary to start k3s cluster correctly.

Thanks for your PR. However, can you post the details of the run that failed? Because even without your changes, k3s starts just fine and I can deploy stuff from dockerhub :thinking:

this means I can change that and use a mirror? @reoring


Init version

Description:
This PR port the exporter from my home repo to suse namespace.
It is a initial functional version of the exporter.
Many things were left over because for an initial version is ok to be concentrated to the essential part of it.
Also due to the rationale of this exporter, and prios we have I didn't invested much time on the Filesystem layout of the project , golang packages , etc this we can do later on.
I'm Adding Angela as CC reviewer just in case she spot something not saptune conform :)

hey @MalloZup great stuff, but could you please add at least one functional test like the ones we have in the other exporters? You can take the sap_host_exporter as a the updated example. Otherwise I can't really see how the metrics are structured, without actually running the thing.

Hi @stefanotorresi  thx for review. I will let this PR currently open a bit because i'm focusing on other things, currently.
I agree on the comments , I didn't had time to implement the missing things yet
The documentation I didn't wrote till now because based on feedback, I did already changed some metrics.
Will address comments later on thx

no worries, there is no rush.

follow-up: https://github.com/SUSE/saptune_exporter/issues/4

@stefanotorresi  I adressed most of your comment with a follow-up issue for the metrics "disappering". For that particular case I think we could investigate if we can set them to 0, something I will look at.
I think for a first releases 0.1 this PR is ok now. (test + doc ) added.

thx @angelabriel


Writing Style information into Excel

I am trying to preserve the style information while I read and then write an excel File.
Seems like the style information is read when I read the file, but unfortunately when I write the file its not preserved.
Thoughts on how I can read and write the style information?
            excelFile = XLSX.readFile(file.path, {
                cellStyles: true
            });

            // some processing here!

            XLSX.writeFile(excelFile, fileName, {
                cellStyles: true
            });

@sheetjs After a conversation with @elad (https://github.com/hubba/js-xlsx/commit/5e9bca78f2b0c54242cefc8a358f3151232941ab#commitcomment-8039333) I was informed that the styling information is only read, and not written back to excel.

Hi guys, I was wondering if there is any updates on this?
Thanks.

:+1:

Even a limited functionality to save some type of formatting (e.g. bold, italic, color, font size, fill, border) would be extremely useful, even if it didn't span the universe of possible input formats that might be obtained from parsing.
Cases like "foobar" with "ob" bolded seem like edge cases compared to the alternatives of no formats at all.

+1

There are three awesome Node.js Excel libraries which collectively offer key features, but choosing one is like playing "Rock-Paper-Scissors":

js-xlsx:    Can handle numbers and number formats, but can't write cell styles, marges, or charts
msexcel-builder:  Can write cell styles, but can't write numbers or number formats
officegen:  Can write numbers and embed Excel with chart objects in PPT, but no styles, merges

As a foundation for generating Excel documents, JS-XLSX seems like a great choice, as it has a very clean design philosophy, rigorous attention to licensing and IP, detailed testing and an active development community.
Would love to add the ability to write some minimal styling -- font weight, font color, fill color, merge, and borders -- and offer that as a pull request.
However, per the issue above there has a been a substantial bit of thought put to this already, and developing this is outside my focus.
Rather than take a proverbial gift horse and then ask for a gold [italic, Helvetica, bordered] bridle on it, my thought is to sponsor dev of this feature as a Freelancer project that yields a useful public contribution to this project.
Open to any suggestions.

@gradualstudent and everyone else: sorry for the apparent lack of public activity on this area (reading and writing cell styles, text styles, etc).  A quick patch for specific features like bold and italics is pretty straightforward (https://github.com/SheetJS/js-xlsx/issues/74#issuecomment-46981775 gives a rough outline).
on a side note: there are a set of round-trip tests https://github.com/SheetJS/js-xlsx/blob/master/test.js#L696 which read a file, write it, read again and confirm that certain properties are the same.  A similar set of tests should be written for styles and themes and other features.

Aha, it seems very feasible to follow that comment in issue #74.
For a Common Spreadsheet Format, using CSS seems great (per @elad Oct 6 comment above) and inside the code translate these to Excel keywords per the Oct 7 @SheetJSDev comment above).
As a start, I put together a simple example case for testing using CSS labels for the .s attribute:
https://gist.github.com/gradualstudent/d931cdf8cc9dc48919b4

Have extended the library to allow fairly general formats, at https://github.com/protobi/js-xlsx.  This allows authoring a new document with cell styles specified in the .s class as well as preserve styles read from XLSX.parseFile(...).
Also extended your helpful Gist at https://gist.github.com/SheetJSDev/88a3ca3533adf389d13c into a Workbook convenience class at https://github.com/protobi/workbook.
Example
var XLSX = require('xlsx');
var Workbook = require('./workbook')(XLSX);

var workbook = new Workbook()
    .addRowsToSheet("Main", [
      ["This is a merged cell"],
      [
        {"v": "Blank"},
        {"v": "Red", "s": {fill: { fgColor: { rgb: "FFFF0000"}}}},
        {"v": "Green", "s": {fill: { fgColor: { rgb: "FF00FF00"}}}},
        {"v": "Blue", "s": {fill: { fgColor: { rgb: "FF0000FF"}}}}
      ],
      [
        {"v": "Default"},
        {"v": "Arial", "s": {font: {name: "Arial", sz: 24}}},
        {"v": "Times New Roman", "s": {font: {name: "Times New Roman", sz: 16}}},
        {"v": "Courier New", "s": {font: {name: "Courier New", sz: 14}}}
      ],
      [
        0.618033989,
        {"v": 0.618033989},
        {"v": 0.618033989, "t": "n"},
        {"v": 0.618033989, "t": "n", "s": { "numFmt": "0.00%"}},
        {"v": 0.618033989, "t": "n", "s": { "numFmt": "0.00%"}, fill: { fgColor: { rgb: "FFFFCC00"}}},
        [(new Date()).toLocaleString()]
      ]
    ]).mergeCells("Main", {
      "s": {"c": 0, "r": 0 },
      "e": {"c": 2, "r": 0 }
    }).finalize();
XLSX.writeFile(workbook, '/tmp/wb.xlsx');

Read and write
It's also possible to read and re-write a document:
var wb = XLSX.readFile(__dirname + '/wb.xlsx', {cellStyles: true});
XLSX.writeFile(wb, __dirname + '/wb-1.xlsx');

Some info gets lost on parsing styles.  It seems like only fill colors get expressed in the CellXf styles.  Thus information about fonts, borders and number formats gets lost when reading.  I recommend that we extend CSF such that cell styles have four attributes as below.
cell.s = {  "font": {}, "fill": {}, "numFmt": {}, border: {} }

I convert cell.s = { fill: cell.s } for backward compatibility with the current parseFile() (only if the style is an object, has patternStyle or fgColor and doesn't have font, border or numFmt attributes).
Known gaps

This doesn't (yet) implement borders, but at least now there's a framework to add it.
No support for number formats beyond the built in ones
Unit tests not written yet.

CSS vs JS
Now that i've gotten into it I can see the issues you've been discussing earlier. CSS seems like such a natural way to express cell styles.  CSS is a style language.  We'd like to abstract away from the details of OpenXML.  Most of the cell styles have natural CSS equivalents.  And Excel represents cell styles in way analogous to CSS classes to avoid redundancy.
Excel has some concepts not in CSS:

fgColor: { theme: "3", tint: -0.19"}  We could probably treat theme colors (e.g. "dk1") like named colors in HTML, and make up an attribute for tint.
Number Formats: we might make our own attribute
Fill colors: Excel fill colors have both an fgColor and a bgColor attribute.  Maybe we ignore one?

@pietersv this is great work! and the documentation is perfect! Thank you

@pietersv excellent work!  (was it straightforward?)
The "fun" part comes when trying to work with the other formats, but I do see tremendous value in experimenting with an XLSX-specific version.

Thanks!  The SheetsJS code is elegant and concise which made it a real pleasure to map out and learn from.
There are minimal changes (under 10 lines) to xlsx.js to:

call a new version of write_sty_xml(...)
fall back to old write_sty_xml(...) if not CommonJS
replace out cell.s values with an integer index into the <cellXfs> list,
accept an optional themeXml in the options object in lieu of the default xml string for the theme.

The major change is adding a new StyleBuilder class which reads the XLSX CSF object and exposes  toXML() and getStyleIndex(format)  methods.  Right now it's in a separate file.
This tiny bit makes me appreciate what it must have taken to build this great library. Who knew that...

Excel won't open a workbook if the second fill style doesn't have a patternType="gray125"?
Excel warns on opening when there's both an rgb and a tint attribute on the fgColor attribute?
Some of the 100+ built-in cell number formats are subtly different between OpenXml and Office?

Agree this branch is experimental.  Open to suggestions.  Looking forward to using this in practice and addressing feedback, with aim of readying it for a pull request.

@pietersv by "experimenting with an XLSX-specific version" I didn't intend to belittle what you have done.  I meant that the ultimate solution will have to support reading XLS and writing XLSX (which is a much larger can of worms)

@pietersv, @SheetJSDev Can we use CSS and private extensions for stuff that's not standard?
I recall someone suggesting we use Microsoft's private CSS extensions for these styles (if they're exportable to HTML/CSS using Excel's Save As). That could be one approach, another could be something like -sheetjs-tint: -0.19 etc.
See my earlier comment about possible styles - I don't think the proposed four attributes will be enough, and I'd really like to avoid inventing yet another style language if possible. :)

@pietersv I saw your recent posts and was excited to see you had begun implementing styles for the XLSX format, but quickly discovered your solution depends on at least some libraries for NodeJS (e.g., cheerio). Any chance you might update it to support browser-based execution as well?
Thanks!

@augurer Let me noodle on that.  The only dependency is cheerio which is just used as a shortcut to handcrafting the XML. It uses just four few of its methods: $('<el>') to create a node, $doc('el') to select a node, $doc.append(el) to append and $el.attr() to get/set attribute values.   I wonder if there is a way to embed cheerio. Alternative is to rewrite StyleBuilder.js to build strings directly, which is certainly possible as that's how the rest of the code works and is impressively hardcore.  I think it should be possible to write four tiny methods that do these four steps,  using shortcuts rather than full dom parsing.

@pietersv That would be amazing! I started going down the path of modifying code to make it work in the browser and am currently stuck at cheerio.load(baseXml, { xmlMode: true });. I tried using jQuery's parseXML function, which works (maybe?) but then var $fonts = this.$styles('fonts'); fails with the error "function expected".
I'll table this for now and move on to implementing another feature -- please let me know if you develop a solution as I'd love to bold and center text in cells!

@pietersv directly writing strings is preferable if you don't expect to inspect the xml structure later (you can avoid that by explicitly storing the necessary metadata, like how the shared string table is built and searched when writing)  If you plan on making changes you should store the intermediate strings in an array, manipulate the parts that need to be changed, and then join at the end.

@SheetJSDev  Concur that building the strings directly is better and consistent with rest of codebase.
@augurer   For quick this now falls back to jQuery to build the XML if require and module are not defined, and included it in the main xlsx.js file.  The class itself generates XML in the browser, and I ran make test and make dist the test suite, but I haven't tested its ability to generate XLSX in the browser. Message me directly if any issues.  Centering cell values is not implemented yet.
@elad  Will allow format object to accept either CSF or CSS objects.  Will duck type and convert to the current CSF format generated by parseFile() so the following would be almost equivalent.  When we settle on a format, can later convert parseFile to store that directly.
{
   font: { name: 'Arial', sz: 12, color: {rgb: "#FFFFAA00"}, bold: true, italic: true, underline: true},
   fill: {fgColor: { theme: 3, tint: -0.25; },
   patternType: 'solid'},
   numFmt: "0.00%;-0.00%;-;@"
}

and
{
   font-family: "Arial",
   font-size: "12px",
   font-weight: bold,
    f
   color: "#FFAA00",
   background-color: "dk1",
   -sheetjs-background-tint: "-0.25",
   -sheetjs-number-format: "0.00%;-0.00%;-;@"
}

@pietersv Thanks a lot, you rock! I'll replace my files and give it a try tomorrow or Sunday.

@SheetJSDev Figured out the make process and made code edits to select entries in the bits/ folder.   I wanted to add a new entry "91_style_builder" but added the class definition to "90_utils" instead.
This passes 15,532 tests in the browser suite  with 0 failures.  I don't know if the new styles actually get written in the browser, will need to write new tests for that.  It passes 11,998 tests tests in the server suite then fails 16 round trip tests on preserving date formats, that'll take more thought.
@augurer added alignment as a fifth attribute, with horizontal, vertical, indent and wrapText as subattributes:
   [ // alignment
        {v: "left", "s": { alignment: {horizontal: "left"}}},
        {v: "left", "s": { alignment: {horizontal: "center"}}},
        {v: "left", "s": { alignment: {horizontal: "right"}}},
        {v: "vertical", "s": { alignment: {vertical: "top"}}},
        {v: "vertical", "s": { alignment: {vertical: "center"}}},
        {v: "vertical", "s": { alignment: {vertical: "bottom"}}},
        {v: "indent", "s": { alignment: {indent: "1"}}},
        {v: "indent", "s": { alignment: {indent: "2"}}},
        {v: "indent", "s": { alignment: {indent: "3"}}},
      {
        v: "In publishing and graphic design, lorem ipsum is a filler text commonly used to demonstrate the graphic elements of a document or visual presentation. ",
        s: { alignment: { wrapText: 1, alignment: 'right', vertical: 'center', indent: 1}}
      }

The current format object closely parallels the OpenXML, as XML itself has tags for font, fill, numFmt, alignment and border and the subtags parallel as well. So I'm thinking that this is pretty good, as it can express every thing that Excel can handle.  We're not inventing the style description langage, Microsft and the OpenXML standards team did.  CSS may still be useful as syntactic sugar, as it will be functionally equivalent.
Will hold off on CSS for now and focus on creating tests and getting this addition up to the high quality  standards for this project.

Thanks to @augurer for identifying cross-platform issues with IE.  Will drop cheerio/jquery and write strings directly.

@pietersv Yeah, really weird. Here's a fiddle demonstrating the problem in IE 10 and IE 11: http://jsfiddle.net/kd2tvb4v/2/

Checked in a version that writes XML strings directly (removingdependence on jQuery / cheerio) and seems to work correctly across browsers including IE.  The issue was that jQuery serializes XML incorrectly in some browsers.  The current code is simpler.

Passes 15532 tests in the browser with 0 fails
test_misc yields 104 passing, 0 failing
npm run-script test yields  11917 passing (3m), 1740 pending, 97 failing.

The 97 fails are "CSV badness" in .xlsb and .xlsx files.  All 22,000 tests pass on a clean install, but am not sure what could have changed that would affect that.  From what I can tell, it's because XLSX.util.sheet_to_scv(sheet, opts) is appending a newline at the end, and the reference csv file doesn't have a trailing newline.  I can't see where the o.RS option gets set.  Any hints appreciated.

Checked in a version that writes XML strings directly (removing dependence on jQuery / cheerio)

Passes 15532 tests in the browser with 0 fails
test_misc yields 104 passing, 0 failing
npm run-script test yields  11917 passing (3m), 1740 pending, 97 failing.

The 97 fails are "CSV badness" in .xlsb and .xlsx files.  All 22,000 tests pass on a clean install, but am not sure what could have changed that would affect that.  From what I can tell, it's because XLSX.util.sheet_to_scv(sheet, opts) is appending a newline at the end.
 The one remaining fail is   1) should parse test files roo_Bibelbund.ods:      Error: timeout of 20000ms exceeded. Not sure what changed, but must be something.

The roo_Bibelbund.ods is a simple timeout, sometimes it takes less than 20 secs and passes, sometimes more and fails.  Maybe we extend the time limit, or move the test to the end.
The CSV tests  I think need to be updated.  These take 3 minutes to get to, so hard to test.  Can provide more detail either here or directly as appropriate.
Otherwise this seems to work in server and browser, in Chrome/OSX and IE/Windows.  Will monitor this unofficial branch to see if any cases arise.

Success.  Can get all test results to pass. The CSV test results pass if we replace line 155 in test.js
parsetest(x, X.read(X.write(wb, {type:"buffer", bookType:ext.replace(/\./,"")}), {WTF:opts.WTF}), ext.replace(/\./,"") !== "xlsb", ext);
with
parsetest(x, wb, ext.replace(/\./,"") !== "xlsb", ext);
This write-read roundtrip caused the workbook to lose the styling information, whereas the CSV tests expect the results to have formatted dates, dollar figures, etc.   Presumably there's a deeper reason for the roundtrip that I'm not seeing yet.
Let me know what it might take to get an accepted pull request.  There's a large user base and potential issues with dates, localization, etc. so am tentative to merge this too early.

Borders implemented.  Styles are passed straight through to OpenXML, allowable values in include
["thin","medium","thick","dotted", "hair", "dashed", "mediumDashed", "dashDot", "mediumDashDot", "dashDotDot","mediumDashDotDot", "slantDashDot"]

Examples are below:
{
            v: "Apple",
            s: {
              border: {
                diagonalUp: 1||true,  // for none use 0, false, null, or undefined
                diagonalDown: 1||true, // for none use 0, false, null, or undefined
                top: { style: "dashed", color: {auto: 1}},
                right: { style: "medium", color: {theme: "5"}},
                bottom: { style: "hair", color: {theme: 5, tint: "-0.3"}},
                left: { style: "thin", color: {rgb: "FFFFAA00"}},
                diagonal: {style: "dotted", color: {auto: 1}}
              }
            }
          },
          {
              v: "Pear",
              s: {
                border: {
                  diagonalUp: 1, diagonalDown: 1,
                  top: { style: "dashed", color: {auto: 1}},
                  right: { style: "dotted", color: {theme: "5"}},
                  bottom: { style: "mediumDashed", color: {theme: 5, tint: "-0.3"}},
                  left: { style: "double", color: {rgb: "FFFFAA00"}},
                  diagonal: {style: "hair", color: {auto: 1}}
                }
            }

Next steps are documenting the API and adding test cases.

@protobi FYI we have a (very incomplete) test case for understanding how row/column styles are represented.  The base name is cell_style_simple.  Unfortunately it doesn't test features like borders.

Documented cell styles in the README.md.
For testing the cell_style_simple is a great example, can definitely follow that for reading styles.  Where I'm stuck now is the right way to test writing the styles.
First thought is to generate a file, write it to /temp/style-test-n.xlsx and compare it to a reference file ./test_files/style-test-n.xlsx testing for byte-wise equality.   In the short term I'm not sure if that would even work across OSX and Windows (are the XLSX files byte wise the same?).  Longer term, there are different valid ways to write styles that would fail.  For instance, one might program StyleBuilder to get smarter about reusing existing <font> or <border> entries.
The ideal would be to write and then read an XLSX file, and verify that the styles are properly represented in the workbook CSF.  That requires extending the ability to read styles as well.
An alternate short term approach is to write the XLSX file, then read it and test that just the ./xl/styles.xml subfile has the expected string content.  But that's not quite the same as saying the file would open without warning and display styles correctly.

@protobi I see you created documentation for styles. Color specification does not describe {auto: 1} case. Also I failed to make borders for merged cells. In my tests only the first cell of the merged range has border.

@paulish -- great catches.  Added {auto:1} to README, will include in next push.
Looking I see adding borders to merged cells is more involved.  When adding a thick border to all sides of a merged area, Excel generates eight border styles:  (i.e. top, top+right, right, right+bottom, bottom, bottom+left, left, left+top). And it then applies those styles to each individual cell within the merged area.
And to my great surprise, we can actually handle borders for merged areas within the current code.  What you have do is is explicitly set border styles for each cell in the merged area.  After merging, only the content of the upper left cell will be visible, but the border styles of the others will appear.
[
        {
          v: "This is a submerged cell",
          s:{
            border: {
              left: {style: 'thick', color: {auto: 1}},
              top: {style: 'thick', color: {auto: 1}},
              bottom: {style: 'thick', color: {auto: 1}}
            }
          }
        },
        {
          v: "Pirate ship",
          s:{
            border: {
              top: {style: 'thick', color: {auto: 1}},
              bottom: {style: 'thick', color: {auto: 1}}
            }
          }
        },
        {
          v: "Sunken treasure",
          s:{
            border: {
              right: {style: 'thick', color: {auto: 1}},
              top: {style: 'thick', color: {auto: 1}},
              bottom: {style: 'thick', color: {auto: 1}}
            }
          }
        }]

@pietersv Indeed, each border cell of the merge should be added. Thank you.

@protobi, do you have any plans to add textRotation attribute to cell style?

@paulish Support for textRotation is add as a property of alignment. See below.
          {v: "Up 90", s: {alignment: {textRotation: 90}}},
          {v: "Up 45", s: {alignment: {textRotation: 45}}},
          {v: "Horizontal", s: {alignment: {textRotation: 0}}},
          {v: "Down 45", s: {alignment: {textRotation: 135}}},
          {v: "Down 90", s: {alignment: {textRotation: 180}}},
          {v: "Vertical", s: {alignment: {textRotation: 255}}}

@paulish I think a utility to iterate over merged cells to apply borders is simple but would belong outside the js-xlsx class, either in the end application or a convenience class like workbook,  as js-xlsx which is focused on parsing and writing workbooks rather than tools to author them.
For your app, can write two for loops, one that iterates over vertical indices and sets left/right cell borders, and one that iterates over horizontal indices and sets top/bottom borders.

@pietersv Thanks for your quick solution for textRotation.
About borders for merged cells, I already solved that in my application using 2 for loops :) I see no need for an utility at the moment but it would be nice to explicitly describe in the documentation that each of the merged cells can have an own border.

@pietersv Thanks for creating https://github.com/protobi/js-xlsx I am using it for styling cell color and it works great (using fill). However, I am not able to do two things if you can help with that, that would be great:

I cannot change the font color using font: {color: {rgb: "C6EFCE"}}, but the color changes using font: {color: {theme: "3"}
Is there anyway to insert comment to a cell? Issue #192

Also @pietersv when I read styled XLSX i see that the font style is missing
function read_test() {
    /* read file */
    var book1 = XLSX.readFile('test-format.xlsx', {cellStyles:true});
    console.log('A1', book1.Sheets.Sheet1.A1);  // Check cell style - Gray fill and White font
    console.log('B1', book1.Sheets.Sheet1.B1);  // Normal cell style - No style
    console.log('C1', book1.Sheets.Sheet1.C1);  // Bad cell style - Red fill and dark red font
    console.log('D1', book1.Sheets.Sheet1.D1);  // Good cell style - Green fill and dark green font
    console.log('E1', book1.Sheets.Sheet1.E1);  // Neutral cell style - yellow fill and dark yellow font
}

read_test()

// Output...
A1 { t: 's',
  v: 'Check cell',
  r: '<t>Check cell</t>',
  h: 'Check cell',
  w: 'Check cell',
  s: { patternType: 'solid', fgColor: { rgb: 'A5A5A5' } } }
B1 { t: 's',
  v: 'Normal',
  r: '<t>Normal</t>',
  h: 'Normal',
  w: 'Normal' }
C1 { t: 's',
  v: 'Bad',
  r: '<t>Bad</t>',
  h: 'Bad',
  w: 'Bad',
  s: { patternType: 'solid', fgColor: { rgb: 'FFC7CE' } } }
D1 { t: 's',
  v: 'Good',
  r: '<t>Good</t>',
  h: 'Good',
  w: 'Good',
  s: { patternType: 'solid', fgColor: { rgb: 'C6EFCE' } } }
E1 { t: 's',
  v: 'Neutral',
  r: '<t>Neutral</t>',
  h: 'Neutral',
  w: 'Neutral',
  s: { patternType: 'solid', fgColor: { rgb: 'FFEB9C' } } }

@abarik1981   I checked in a change just now fixing an issue with rgb font colors. That said, Excel OpenXML seems to use eight-character ARGB values, where A is the alpha or opacity, so try font: {color: {rgb: "FFC6EFCE"}} instead.
There are two related issues with style, reading them (#52) and writing them (#128).  Each are fairly involved, so I'm thinking to keep this fork focused exclusively on #128, and within that, just for xlsx/xlsm files.  Then may be able to address #52 if/when this branch gets merged.  Toward that end, am currently adding unit tests commensurate with the awesome test suite already here.

@SheetJSDev Your early point about round trip tests is well taken.  The best way to test writing styles is to read them back. And the ability to  read fills and number formats already exists.  So now extending that parsing to include fonts, borders, alignments.  In the process, would like to confer on a few suggested changes.
Presently, the parser

writes fills directly to the .s attribute,
translates theme/tint to absolute RGB colors, and
truncates 8-digit ARGB to 6-digit RGB colors

e.g. {v: 3.14, s: { patternType: "solid", bgColor: { rgb: "FFAA00"}, fgColor: "FFFFFF"}}.
For writing styles, I'm thinking that:

.s should be a general style with .fill as an attribute,
maintain references to theme/tint if that's how colors are specified,
and use ARGB directly.

e.g. {v: 3.14, s: {fill: { patternType: "solid", bgColor: { theme: 5, tint: -0.20}, fgColor: "FFFFFFFF"}}.
This breaks one existing test describe('should correctly handle styles', ...) which would be revised per new syntax.  I don't see how to make this backward compatible, but think this should be acceptable, as it  would permit even more styles to be parsed than today, and allows all the styles to be written back.  Is that okay?

@pietersv So the original style object was designed to hold common information like background/foreground color.  The original comment that proposed the current design, https://github.com/SheetJS/js-xlsx/issues/36#issuecomment-44472566 , was based on my understanding of how XLS and XLSX store style information.
It's probably better to ignore the current style representation (as in, "break backwards compatibility") and see what it looks like.

Just committed change that preserves styles roundtrip:  create -> write -> read -> write.
Updated example.js at https://github.com/protob/workbook accordingly.
For right now this preserves only font, fill and numFmt.  Will add borders and alignments soon.
The minimalist regex xml parser in the current code is neat, finally got the rhythm of it.

Is there an estimate for when protobi's branch will be merged with master? I'd really like to use new style implementation (I'm sure I'm not the only one :smile: ) and it'd be cool to have it merged with master as soon as possible.

I think we're getting close to a pull request.  The most recent checkin includes a round-trip test suite (call mocha test-styles.js) which covers a wide variety of styles, and it passes the existing test suite (22073 passing, 4929 pending) with a couple known exceptions.
The only reason I'm hesitant is to fear of introducing an unknown bug or missing a key use case into a widely used code base until I hear it's working in practice.  In immediate short term, perhaps try using the xlsx.js from the branch or npm install protobi/js-xlsx and let me know either here or direct message?

@pietersv
Thanks for the update. I'll start playing around with your branch and let you if I find any errors.

I just checked in additions to read/write borders and alignments as well, so it handles most styles round trip.
Notes:

Added a test test-styles.js which creates a workbook with a variety of styles, writes it , parses it, and compares it to the original, both to a file and to a buffer.
The test file can be called with mocha test-styles.js.  This is in the top-level directory for now as the test suite is a whole separate repo.
I had to blank out the original tests of styles as they're handled differently now.
I also had to modify the tests should generate correct CSV output as these depend on number formats, which are now handled differently as part of cell styles.  Basically if a workbook fails the original CSV test, this re-reads it with {cellStyles: true, cellNF: true} and tries again.
Also merged in a few changes from upstream that had occurred in the interim.

@SheetJS    I think this might be ready for a pull request, open to further suggestions.

@pietersv let me just say that this is really great work and the effort you've put into it is much appreciated!
Just one question, since I use this module in production:

I had to blank out the original tests of styles as they're handled differently now.

Does that mean that the API for reading styles changes? If so, could you please add a note in the documentation to allow for a smooth transition?

@pietersv Excellent work! That test file is beautiful :)
@elad its unclear whether we will use the proposed XLSX-inspired API, stick with the existing structure, or do something completely different.  As we discussed earlier @pietersv is exploring the XLSX space.  The fun part (working with XLS and other formats) has yet to start.

@elad  I just updated the tests 'different styles' and 'correct styles' to reflect these changes in API:

Fills are now specified as properties of s.fill rather than s
Where colors are specified in the XLSX as theme/tint (and not RGB) they are also also specified that way in in CSF  (i.e. RGB is not automatically extracted to fill.raw_rgb)

@SheetJSDev  The js-pptx library is a fabulous resource, so completely understand the need to maintain its integrity and support for other formats.  Just to get up to speed on considerations, is the issue (a) that js-pptx currently reads fill styles for XLS and so we'd need to store them under s.fill in CSF, or (b) that if this writes additional styles for XLSX it'd also need to write the additional styles for XLS and XLSB?   Is there a downside to an API that parallels the OpenXML API for XLSX files in a project titled 'js-xlsx'?

@pietersv:

Where colors are specified in the XLSX as theme/tint (and not RGB) they are also also specified that way in in CSF (i.e. RGB is not automatically extracted to fill.raw_rgb)

Ouch, that's actually something I'm relying on. If you're not going to provide the RGB value, could you at least expose a utility function to extract it? I think that logic (theme/tint to RGB) belongs in the library rather than application code and wouldn't want to copy/paste it all over the place...

@pietersv @elad while theme and tint are useful, they are concepts specific to how XLSX represents the colors.  Other formats like the XLML (2003) format only store the final display color.
Take a look at the cell_style_simple test case.  The colors are stored with tint in the xlsx version, but not in the xlml styles.

Excel throws an error ("Excel found unreadable content in 'filename.xlsx'.... Repair?") if we write both theme/tint and rgb to OpenXML, as in <fgColor theme="5" tint="-0.5" rgb="FF00FF00"/> .
But there's no reason we can't read it and store ARGB in the style object.  The main branch currently stores it as s.raw_rgb. So then how about

Store ARGB value as fill.rgb in CSF
If both fill.theme and fill.rgb are specified, ignore fill.rgb when generating to .xlsx.
That way
the theme references are preserved on read/write to xlsx, and
it falls back to the ARGB value are preserved if you write to a different format (or if you delete s.fill.rgb)

The latest commit parses theme color and saves it as raw_rgb (rather than .rgb) for

fill.bgColor,
fill.fgColor,
font.color and
border.*.color

This now passes the tests different styles and correct styles .
HOWEVER the existing tests were expecting colors without tints applied and somehow getting them.  For instance, the test file "cell_style_simple.xlsx" specifies this fill color:
       <patternFill patternType="darkHorizontal">
                <fgColor theme="9" tint="-0.249977111117893"/>
                <bgColor theme="5" tint="0.39997558519241921"/>
       </patternFill>

and the theme 9 ("accent6") is specified as follows:
<a:accent6>
  <a:srgbClr val="F79646"/>
</a:accent6>

So it should expect a base color of "F79646" but with the tinting the color should be a darker red.   But it gets "F79646" nonetheless and the test has been passing. Can't quite figure out why.
I tried applying the tints and updating the expected colors, but the function rgb_tint(hex, tint) appears to have a bug, as it returns shades of grey, not the correct color.  The greys seem about right brightness given the tint, it's just that they're grey.   Some examples are below.  So I keep expecting the untinted color and it pase
console.log([color.hex, color.tint, rgb_tint(color.hex, color.tint)]);
[ '4BACC6', 0.3999755851924192, '939393' ]
[ '9BBB59', 0.3999755851924192, 'C3C3C3' ]
[ '1F497D', -0.499984740745262, '101010' ]
[ 'F79646', -0.249977111117893, 'B9B9B9' ]
[ 'C0504D', 0.3999755851924192, 'D9D9D9' ]
[ 'EEECE1', -0.249977111117893, 'B3B3B3' ]
[ '8064A2', 0.3999755851924192, 'B3B3B3' ]
[ '1F497D', -0.749992370372631, '080808' ]
[ '9BBB59', -0.249977111117893, '747474' ]
[ 'F79646', -0.249977111117893, 'B9B9B9' ]
[ 'EEECE1', 0.3999755851924192, 'F5F5F5' ]
[ '8064A2', 0.3999755851924192, 'B3B3B3' ]
[ '4F81BD', -0.249977111117893, '3B3B3B' ]
[ '8064A2', -0.249977111117893, '606060' ]

So for now I ignore all tinting when storing colors converted from the theme.

Sorry, theme colors are saved as .rgb  (and optionally raw_rgb if opts.WTF)

@pietersv, do you mean that the value in .rgb (or .raw_rgb) for the relevant fields gives a different color than what the user sees?
What I think is very important is being able to get the RGB value that represents the final color the human sees when looking at the Excel sheet.

Concur we'd want to return the tinted colors that the user would have seen in Excel.  It appears that line 3 of bits/45_styutils.js has been interpreting hex RRGGBB colors as RRRRRR before converting.  Simple fix.
function hex2RGB(h) {
	var o = h.substr(h[0]==="#"?1:0,6);
	return [parseInt(o.substr(0,2),16),parseInt(o.substr(0,2),16),parseInt(o.substr(0,2),16)];
//should be
	return [parseInt(o.substr(0,2),16),parseInt(o.substr(2,2),16),parseInt(o.substr(4,2),16)];
}```

Updated to fix hex2RGB and apply tints.  Now s.fill.fgColor.rgb is the theme color with tinting applied and s.fill.fgColor.raw_rgb is the theme color without tinting, for backward compatibility and reference.

Thank you @pietersv :)

How often are people generating files where they couldn't template the styling/formatting in the native application first?

A quick note about the proposed extension to CSF , while the style is specified for each cell, the style objects are reused where possible.  For instance, one could define a style and reuse it in multiple cells, e.g. {v: 1.61828, s: GOLDARIAL_18} where
var GOLD_ARIAL_18 = {
    fill: { bgColor: {rgb:  "FFFFAA000"}},
    font: { family: "Arial", sz: 18, bold: true, color: { rgb: "#FF444444"}},
    numFmt: "0.00"
};

Even if the styles are different objects with the same value, the style object is de-duplicated using deepEquals in the StyleBuilder class, and reduced to a  style reference in the Excel workbook.   Thus one could generate a CSS representation for each style, and vice versa generate a style from a CSS representation.
So we can later extend the format to take a CSS string or object instead, which gets converted the same way:
{ v: 1.6818, s: {
    css: "background-color: #FFAA00, font-family: Arial, font-size: 18, color: 444, font-weight: bold",
    numFmt: "0.00"
}

or
{v: 1.61828, s: {
     css: { background-color: "#FFAA00", font-family: "Arial", font-size: 18, color: "#444"},
    numFmt: "0.00"
  }
}

Right now each unique style gets its own <xf> entry in Excel. One can go further and really tried to compress each style component, i.e. reusing every single font or border spec, but this may be overkill for now.

the style objects are reused where possible
really tried to compress each style component

Should we just store pointers to the styles array?  FYI the shared string table (cell type s in XLSX, record type BrtCellIsst in XLSB, record type LabelSst in XLS) also uses pointers, but those are converted to normal string cells for convenience.  We could also do the same for cell formats (storing the index in the format table rather than the actual format) and a few other places.
Also, food for thought: to get the actual spreadsheet object out of a Web Worker, you have to serialize and pass a string across the divide.  It's a pain, and the The worker currently uses JSON.stringify, which isn't exactly efficient and doesn't round-trip properly (try var x = {a:1}, y = {a:x, b:x}, z = JSON.parse(JSON.stringify(y)); y.a.a = z.a.a = 3; console.log(y.b.a, z.b.a);), so a pointer-based format might be useful

@SheetJSDev Sorry for the delay!   This is a great question I spent some time going both ways and here's my current thinking.   TL;DR -> I like objects per cell, but we could easily support both.
Styles as objects
Net net, specifying styles as objects in each cell seems more convenient and  semantically clearer to a user.  Here you can see exactly what the format is for each cell, without having to deference pointers, and can easily tweak styles here and there.
If a lot of cells have exactly the same format, can define a format object and share the pointer.  If a lot of cells have different formats, but share the same font and fill? Define a fill and font object and share those pointers.   This does make the JSON larger but computers are efficient.
Styles as indexes
Here we would specify each cell's style not as an object, but as an integer that refers to an index in an array of cell styles.  Presumably we'd use the object CellXf: [] in the CSF workbook.
This mirrors how Excel XLSX stores the styles internally, keeping integer indexes to styles.  Excel goes as step farther and turns keep integer indexes to fonts, fills, alignments, number formats and borders.   I don;t think we want to go that extra step.
So for the case of a lot of common styles, e.g. a big report with thousands of rows, we could allow (but not require) the user to specify styles in the CellXf property and refer to them by integer.
var cell_style = (typeof s == 'number') ? workbook.CellXf[s] : s
Currently this seems to be filled with empty styles on read.  So we'd have to populate that when reading a workbook, and store the integer reference in the cells.
Round trip
I think we're unlikely to have directed cycles in the references, though can imagine a user trying to construct one:
var workbook = { Sheets: { "Main": {
   "A1": { v: "Larry", s: {  fill:   workbook.Sheets.Main.B1.s.fill }},
   "B1": { v: "Moe", s: {  fill:   workbook.Sheets.Main.C1.s.fill }},
   "C1": { v: "Curly", s: {  fill:   workbook.Sheets.Main.A1.s.fill }}
   }
}

I've been working with @pietersv's branch for a while to write styles and it seems to be working fine. If there aren't any more known issues and it passes the TravisCI builds, I think it might be time to do a pull request.

Reading/writing styles seems pretty stable. I've gotten a few direct requests which were easily addressed without extending code. So I think it's time to submit a pull request and power through any steps required to get it up to snuff (Alternately could create a separate npm module, e.g. js-xlsx-fmt).
Tests
It passes all the tests on the server and browser.

I had to slightly rewrite the test should generate correct CSV output to re-read the Workbook with {cellStyles: true}, not sure why that should be necessary, but the tests pass after that.
I also modified the test should correctly handle styles to expect the colors after tinting.

Styles as objects
Re styles as objects vs integers, my intuition is to go with style objects within the cell, and defer integer indexing for later.  Style objects with the cell seem semantically clearer and easier for the human author. Compressing the JSON via integer indexing feels more like an optimization to which Jackson's rules would apply ("The First Rule of Program Optimization: Don't do it. The Second Rule:  don't do it yet.")
Commits - to squash or not
There are 36 commits with this branch.  It's common practice in a PR to squash these to a single commit for brevity.  But this becomes a tangle, as there were other contributors to this branch, and upstream changes merged in.  So it would be easier for me to submit the PR as is.  Might that be okay?
JS-XLSX is a deep package with a wide user base, so respect that a PR request is a commitment.   Can make time for code review, screenshare, other steps if that would be useful.

Here's a gist using the fork to generate Excel workbooks with styles in the browser:
https://gist.github.com/protobi/db3f8190de610bc971cc
This uses https://rawgithub.com to serve xlsx.js, jszip and FileSaver.js individually because the js-xlsx dist files aren't committed between versions, so the minified/catenated versions aren't in the repo.

Thanx a lot to @SheetJSDev , @elad , @pietersv  and all who were involved in this great and awesome work!!!
For those who are interested to support "right to left direction"
follow he folllowing steps :
{v: "right to left", s: {alignment: {readingOrder: 2}}

and in @pietersv  code you should add :
 if (attributes.alignment.readingOrder)  { $alignment.attr('readingOrder', attributes.alignment.readingOrder);}

(in _addXf function)
@pietersv what do you think of adding it?

@sarahl123   That's awesome.  Will add to next update this week.
Your patch also presents a cool general solution to the problem.   There
are likely other attributes that could be specified that I didn't
systematically identify and thus read from the style object and explicitly
write to the OpenXML object using code.
It should be possible to take any attribute on the s.alignment object and
mix it on as an attribute to the <aligment> element.
That should work for most cases not yet implemented, with a few exceptions
where OpenXML doesn't follow that pattern
On Tue, May 19, 2015 at 5:46 AM, sarahl123<EMAIL_ADDRESS>wrote:

Thanx a lot to @SheetJSDev https://github.com/SheetJSDev , @elad
https://github.com/elad , @pietersv https://github.com/pietersv and
all who were involved in this great and awesome work!!!
For those who are interested to support "right to left direction"
follow he folllowing steps :
{v: "right to left", s: {alignment: {readingOrder: 2}}
and in @pietersv https://github.com/pietersv code you should add :
if (attributes.alignment.readingOrder)  { $alignment.attr('readingOrder', attributes.alignment.readingOrder);}
(in _addXf function)
@pietersv https://github.com/pietersv what do you think of adding it?
—
Reply to this email directly or view it on GitHub
https://github.com/SheetJS/js-xlsx/issues/128#issuecomment-103419325.

--
Pieter Sheth-Voss PhD
protobi
e<EMAIL_ADDRESS>m:<PHONE_NUMBER>

Hi All,
using the web browser versione of protobi branch:  https://rawgit.com/protobi/js-xlsx/master/xlsx.js.  i find an issue: styles seem to works fine but ... If i format a cell with date, this format remain “in memory” for the next export, for example:
i place a button in my web page where i do excel export (so, i can click it twice without closing the browser)
My last column of the export is a date (and i format it using XLS.SSF._table[14])
I press the button for the first time, export go well.
When i press it again, and i use Chrome debug to check variable value, i’have seen that the cell format (date) is not reset, so the first cell that contains a number, assume a date format
This behavior do not happen with the master library, i’ve simply tried to switch between this and the issue is only on the develop library (the library with the styles).
Some one has solved this issue in browser version ?
Let me know.
Thanks

Thanks for the report.  Will take a look.

Is the issue that the second export doesn't remember the style, or that
it does but shouldn't?
Does setting the cell style to a new objec (e.g. {v: 3.14, s : {}} )
clear the format, as a diagnostic?
Is it easy to send/or post code I might use to replicate this easier on
this end?

Pieter
On Thu, May 21, 2015 at 11:13 AM, esoni<EMAIL_ADDRESS>wrote:

Hi All,
using the web browser versione of protobi branch:
https://rawgit.com/protobi/js-xlsx/master/xlsx.js. i find an issue:
styles seem to works fine but ... If i format a cell with date, this format
remain “in memory” for the next export, for example:
i place a button in my web page where i do excel export (so, i can click
it twice without closing the browser)
My last column of the export is a date (and i format it using
XLS.SSF._table[14])
I press the button for the first time, export go well.
When i press it again, and i use Chrome debug to check variable value,
i’have seen that the cell format (date) is not reset, so the first cell
that contains a number, assume a date format
This behavior do not happen with the master library, i’ve simply tried to
switch between this and the issue is only on the develop library (the
library with the styles).
Some one has solved this issue in browser version ?
Let me know.
Thanks
—
Reply to this email directly or view it on GitHub
https://github.com/SheetJS/js-xlsx/issues/128#issuecomment-104314590.

--
Pieter Sheth-Voss PhD
protobi
e<EMAIL_ADDRESS>m:<PHONE_NUMBER>

@sarahl123  Added readingOrder to the code and docs.  My Excel (OSX Office 2011 doesn't seem to have that feature so not tested.  Mixing in arbitrary attributes is still ahead.
@esoni  Added note to README that the .z attribute is deprecated in favor of specifying styles in the .s attribute.  So to specify date formats one can use either  s.numFmt: "m/dd/yy" or z: "m/dd/yy"  but now recommend the first moving forward on this branch.
For backward compatibility, an empty s.numFmt will not override a non-empty .z attribute, which per our direct email exchange seemed like the issue.

Can anyone help, I need a work-around for keeping original template styles after file is written. {cellStyles: true} does not appear to work in my case.

The styles branch of the js-xlsx library can be used on the server (Node) and the browser.

To use this dev branch on Node, can install with install protob/js-xlsx
To use this in the browser, you need to use the xlsx.js in the root directory (NOT under dist/)

https://gist.github.com/protobi/db3f8190de610bc971cc
The README.md directs not to regenerate  files in the dist/ subdirectory until the branch is merged in and included in a new release version.  So the minified version isn't available in the browser until this is merged in or forked into a separate project.

I'd love to see this merged in soon :+1:

I'd love to see this merged in soon, too :+1:

Me also +1.

+1

Pending guidance on submitting a pull request, have published this fork to npm and bower which allows the styles-enabled version to be more accessible:

npm install xlsx-style
bower install js-xlsx-style#beta

To make this work there are two branches, master and beta:

master is intended to merge back with SheetJS/js-xlsx and until then fetch upstream changes.  This does not run make dist and its package.json is the same as the  original repo.
beta is what is published to npm and bower.  This does run make dist so you can use the minified files, and its package.json points to a new project name (js-xlsx-style) and version number.

Any problems with this branch you can report to https://github.com/protobi/js-xlsx/issues.

+1

+1

+1

@SheetJSDev this looks very complete, any reason not to do a squashed pull request and merge it in?
(plus I think one or two people are looking forward to this ;)

I would be interested in having this merged as well.

+1 for the PR and merge into this project.

+1

+1

:+1:

@pietersv Hey can you please tell me how did you generate the excel sheet mentioned in Apr 16.
I am generating excel sheet through this xlsx.js but am not able to do formatting to my cells.So i went through this issue but not able regenerate what you told.So can you please help me.

Generating styles I believe has not yet been merged into the master branch.  For now you'll need to use one of these branches:
npm install xlsx-style
or
bower install js-xlsx-style#beta

A decent number of people are raising the same issue about styling not being implemented yet because they aren't aware that this feature is being actively developed. Adding a little note in the readme about the current status of styling could help reduce the number of duplicate issues.

+1 waiting for the merge.
And agree with @aravindkoneru

+1
Would love to see the work progress in a merge.

+1

@pietersv is there a way to insert a page break with this?

I'm sure that's possible to add, will take a look.  Urgency?

Thank you! My boss has been wanting me to add it for about a week now and I haven't been able to figure it out. Not super urgent, just trying to make her happy.

For styles-related issues, report these at https:/
There are two aspects:

Adding row breaks to the xlsx file
Specifying row breaks in the CSF workbook object

Page breaks are described by <rowBreaks> which appears just before <extLst>.
<rowBreaks count="1" manualBreakCount="1">
    <brk id="8" max="16383" man="1"/>
</rowBreaks>

var fs = require('fs');
var jszip = require('jszip');
var cheerio = require('cheerio');

var FILENAME = __dirname + '/wb.xlsx';
var OUTFILE = '/tmp/wb.xlsx';

var zip = fs.readFile(FILENAME, function (err, data) {
  if (err) throw err;
  var zip = new jszip(data);
  var sheet = zip.file('xl/worksheets/sheet1.xml').asText();

  var $sheet = cheerio.load(sheet, {xmlMode: true});
  var rowBreaks = $sheet('rowbreaks');
  if (rowBreaks.length === 0) {
    $extLst = $sheet('extLst');
    // id is the row before the break
    $extLst.before('<rowBreaks count="1" manualBreakCount="1"><brk id="8" max="16383" man="1"/></rowBreaks>')
  }
  else {
      // add new <brk> records to
      // update counts in the <rowbreakss> record
  }

  zip.file('xl/worksheets/sheet1.xml', $sheet.xml())
  var buffer = zip.generate({type: "nodebuffer"})
  fs.writeFile(OUTFILE, buffer, function (err) {
    if (err) throw err;
    console.log("open " + OUTFILE)
    console.log("Select View -> Page Layout to see breaks")
  });
});

Let's move discussions of styles-related issues to the project https://github.com/protobi/js-xlsx.

+1 for merge. Looking forward to this feature.

https://github.com/protobi/js-xlsx/issues/13

@protobi So just making sure I followed that correctly (I skimmed the conversation). You managed to to implement styles pretty well (I tried it and even the typing information is preserved - saving a stylesheet with dates using js-xlsx, saves the dates as a string containing the days since 1900). And now you're maintaining an, ever more diverging, fork, since you're not really sure how to get your changes into this repo? Right?

Well, the key thing is:

Protobi maintains and supports a fork of this project (https://github.com/protobi/js-xlsx) that reads and writes styles for XLSX files.  Our intent is to keep the branch in sync with the master as possible.
The main project is still being actively developed (see https://github.com/SheetJS/js-xlsx/issues/370).  Current work might include a wholesale rewrite of the style implementation here, not sure.

The SheetJS/js-xlsx project is a professionally developed library, both broad (XLS, XLSX, XLSXB, XLSM) and deep (read/write, internationalization).  It has tens of thousands of test cases, covering bugs in apps that came years before Excel (e.g. Lotus) and years later (e.g. Keynote, OpenOffice).  I can understand why being conservative about integrating a major feature may be reasonable from their perspective.
In our work, many of our use cases are purely authoring XLSX.  We're working on extending the lightweight msexcel-builder to write styles with an API consistent with this project, and add unit testing via js-xlsx.
From my perspective, the proximate issue is just migrating the root project to Node 4 and 5, to enable unit testing that makes new development safe.

👍  for the merge

+1 for merge. Really pumped for this

@SheetJSDev any chance to finally handle style in this project? Thanks.

@SheetJSDev any news ? really need this case here too

@SheetJSDev  +1

+1

+1

+1

No news and no feedback, so, here, we are moins to xls-populate, an incredible Project WITH styles support :)

@lizjulien, with xls-populate we can generate excel file from existing template + style???

+1 for merging.
Kneeling for mercy

i will try

What do you think about exceljs?

@thearabbit interesting

Hello, the idea is to use "https://github.com/protobi/js-xlsx" now to use the styles?

https://github.com/protobi/js-xlsx this one is updated 3 years ago .. ANy update on style in js-xlsx ?

+1

+1

+1. The support for style setting is really important

This is really a deal breaker for this amazing library.. 😭

+1

Is it possible to provide this for xlsx at least? A partial solution is better than nothing.

+1

+1

+1

+1

We offer this in the Pro compendium.  Since companies have paid for the features already, it would be unfair to them if we turned around and made it available as open source.  We have a longer comment in a gist.

What do you think about exceljs?

It doesn't support LibreOffice/LibreCalc ODS files, or older Excel .xls files.
Neither does xlsx-populate.

@SheetJSDev , I dont follow this statement, " Since companies have paid for the features already, it would be unfair to them if we turned around and made it available as open source." How come?


[Help needed] Uniform and shader destruction issue

Hello.
Sorry for disturbing. I've already spent 2 days trying to figure out what's happening, and I think I'm stuck, so just asking for help, probably you know the root of the issue. If not, feel free to close the issue.
I'm initializing bgfx, creating shader, uniform, texture, vertex and index buffera and other things.
The sequence looks like this:
create shader
create uniform (u_textureColor, the only uniform instance)
Everything works fine.
After some update cycles I need to recreate shader, texture and uniform. I've narrowed the issue to these cases (vb and ib are transient, texture creation and destruction place doesn't matter):
Works:
destroy uniform
destroy shader
create uniform
create shader
Works:
destroy shader
destroy uniform
create uniform
create shader
Crashes:
destroy shader
destroy uniform
create shader
create uniform
Crashes:
destroy uniform
destroy shader
create shader
create uniform
Two last cases crashes here in the next bgfx::frame call after objects recreation:
Stack trace (most recent call last):
#13   Object "", at 0xffffffffffffffff, in
#11   Source "/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c", line 310, in __libc_start_main [0x7f060d7eeb96]
#10   Source "modules/application/plugin/desktop_main.cpp", line 6, in main [0x120a841]
          4: int main(int argc, char* argv[])
          5: {
      >   6:     return desktop_main(argc, argv);
          7: }
#9    Source "modules/application/jet/application/_desktop/main.cpp", line 225, in desktop_main(int, char**) [0x18bed5a]
        222:             });
        223:         }
        224:
      > 225:         bgfx::frame();
        226:     }
        227:     log::info("GLFW"_tag, "Closing window ...");
#8    Source "libs/bgfx/src/bgfx.cpp", line 3812, in bgfx::frame(bool) [0x1a4c4a4]
       3809: 	uint32_t frame(bool _capture)
       3810: 	{
       3811: 		BGFX_CHECK_API_THREAD();
      >3812: 		return s_ctx->frame(_capture);
       3813: 	}
       3814:
       3815: 	const Caps* getCaps()
#7    Source "libs/bgfx/src/bgfx.cpp", line 2163, in bgfx::Context::frame(bool) [0x1a42602]
       2160: 		BGFX_PROFILER_SCOPE("bgfx/API thread frame", 0xff2040ff);
       2161: 		// wait for render thread to finish
       2162: 		renderSemWait();
      >2163: 		frameNoRenderWait();
       2164:
       2165: 		m_encoder[0].begin(m_submit, 0);
#6    Source "libs/bgfx/src/bgfx.cpp", line 2172, in bgfx::Context::frameNoRenderWait() [0x1a42588]
       2170: 	void Context::frameNoRenderWait()
       2171: 	{
      >2172: 		swap();
       2173:
       2174: 		// release render thread
       2175: 		apiSemPost();
#5    Source "libs/bgfx/src/bgfx.cpp", line 2207, in bgfx::Context::swap() [0x1a452fd]
       2204: 		if (!BX_ENABLED(BGFX_CONFIG_MULTITHREADED)
       2205: 		||  m_singleThreaded)
       2206: 		{
      >2207: 			renderFrame();
       2208: 		}
       2209:
       2210: 		m_frames++;
#4    Source "libs/bgfx/src/bgfx.cpp", line 2295, in bgfx::Context::renderFrame(int) [0x1a4548c]
       2292: 			if (m_rendererInitialized)
       2293: 			{
       2294: 				BGFX_PROFILER_SCOPE("bgfx/Render submit", 0xff2040ff);
      >2295: 				m_renderCtx->submit(m_render, m_clearQuad, m_textVideoMemBlitter);
       2296: 				m_flipped = false;
       2297: 			}
#3    Source "libs/bgfx/src/renderer_gl.cpp", line 7072, in bgfx::gl::RendererContextGL::submit(bgfx::Frame*, bgfx::ClearQuad&, bgfx::TextVideoMemBlitter&) [0x1a7492a]
       7069: 					if (constantsChanged
       7070: 					&&  NULL != program.m_constantBuffer)
       7071: 					{
      >7072: 						commit(*program.m_constantBuffer);
       7073: 					}
       7074:
       7075: 					viewState.setPredefined<1>(this, view, program, _render, draw);
#2    Source "libs/bgfx/src/renderer_gl.cpp", line 3674, in bgfx::gl::RendererContextGL::commit(bgfx::UniformBuffer&) [0x1a9dfbd]
       3672: 				switch (type)
       3673: 				{
      >3674: 				CASE_IMPLEMENT_UNIFORM(Sampler, 1iv, I, int);
       3675: 				CASE_IMPLEMENT_UNIFORM(Vec4,    4fv, F, float);
       3676: 				CASE_IMPLEMENT_UNIFORM_T(Mat3, Matrix3fv, F, float);
       3677: 				CASE_IMPLEMENT_UNIFORM_T(Mat4, Matrix4fv, F, float);

Segmentation fault (Address not mapped to object [(nil)])

Afaiu in this place data == nullptr.
I use last bgfx from master, single-threaded, on linux using opengl renderer.
I've tried to reproduce the issue on bgfx examples, but I can't, it works fine with all cases.
As I said, uniform is "really" destructed and created since there's only one place where I reference it. I can confirm it because newly created uniform has different idx. Also I can confirm that I don't use old uniform to draw an object because if so I have different stacktrace and error.
Will be grateful for any help, thanks!

Reproduce this crash in some of existing examples, and post the code.

Okay, here's a modification of 00-helloworld example.
This code should be placed right after bgfx::setViewClear call in ExampleHelloWorld::init method. Please note that if you swap (1) and (2) it doesn't crash:
    auto vDecl = bgfx::VertexDecl{};
    vDecl.begin()
        .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)
        .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Float)
        .add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
        .end();

    auto pHandle = loadProgram("vs_crash", "fs_crash");
    auto uHandle = bgfx::createUniform("u_texColor", bgfx::UniformType::Enum::Sampler);

    bgfx::destroy(pHandle);
    bgfx::destroy(uHandle);

    pHandle = loadProgram("vs_crash", "fs_crash");  // (1)
    uHandle = bgfx::createUniform("u_texColor", bgfx::UniformType::Enum::Sampler);  // (2)

    for (int i = 0; i < 2; i++) {
        bgfx::touch(0);
        bgfx::setViewMode(0, bgfx::ViewMode::Enum::Sequential);

        bgfx::TransientVertexBuffer vb;
        bgfx::TransientIndexBuffer ib;

        bgfx::allocTransientVertexBuffer(&vb, 3, vDecl);
        bgfx::allocTransientIndexBuffer(&ib, 3);

        auto ibPtr = reinterpret_cast<uint16_t*>(ib.data);
        ibPtr[0] = 0;
        ibPtr[1] = 1;
        ibPtr[2] = 2;

        bgfx::setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A);
        bgfx::setVertexBuffer(0, &vb);
        bgfx::setIndexBuffer(&ib);
        bgfx::submit(0, pHandle);
        bgfx::frame();
    }

Also please add 2 shaders from the archive to the examples/runtime/shaders/glsl directory.
glsl.zip
Let me know if you need more info.
Thanks!


Date is converted from JS Date to DateTime wrong

When using JS to select a date in a WPF calendar object the date selected is always one out from the true value.
After further investigation (notice the Debug.WriteLine call) the date conversion is one out from the true value even if I don't set the date in the calendar widget.
namespace TestClearScriptDateConversionProblem {
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window {
        private V8ScriptEngine v8;

        public MainWindow() {
            InitializeComponent();

            v8 = new V8ScriptEngine(V8ScriptEngineFlags.EnableDateTimeConversion);
            v8.AddHostObject("calendar1", calendar1);

            calendar1.SelectedDate = DateTime.Now;
            yearInput.Text = calendar1.SelectedDate.Value.Year.ToString();
            monthInput.Text = (calendar1.SelectedDate.Value.Month - 1).ToString();
            dayInput.Text = calendar1.SelectedDate.Value.Day.ToString();
        }

        private void Button_Click(object sender, RoutedEventArgs e) {

            v8.Execute("calendar1.SelectedDate = new Date(" + yearInput.Text + ", " + monthInput.Text + ", " + dayInput.Text + ");");
            Debug.WriteLine(v8.Evaluate("new Date(" + yearInput.Text + "," + monthInput.Text + "," + dayInput.Text + ")"));
        }
    }
}

After this I decided to research further by writing a script to check if the converted dates are correct. After running this program it outputted that the first invalid conversion was on 29th March 2021 (2021/3/29) and the next valid conversion was on 1st November 2021 (2021/11/1).
namespace CheckDateValuesClearScript {
    class Program {
        static void Main(string[] args) {
            V8ScriptEngine v8 = new V8ScriptEngine(V8ScriptEngineFlags.EnableDateTimeConversion);
            DateTime a = new DateTime(2021, 1, 1);
            bool z = false;
            while (a.Year < 2022) {
                bool y = CheckDate(v8, a.Year, a.Month, a.Day);
                if (y != z)
                    Console.WriteLine("{0}/{1}/{2}", a.Year, a.Month, a.Day);
                z = y;
                Console.WriteLine(z);
                a = a.AddDays(1);
            }

            Console.WriteLine("Press escape to exit");
            while (Console.ReadKey().Key != ConsoleKey.Escape) { }
        }

        static bool CheckDate(V8ScriptEngine v8, int year, int month, int day) {
            // Use "month - 1" as JS uses a zero indexed month value
            object a = v8.Evaluate($"new Date({year},{month - 1},{day})");
            if (a is DateTime b) {
                return b.Year == year && b.Month == month && b.Day == day;
            }
            return false;
        }
    }
}

Edit: I also tested a different year "2020" and the incorrect dates are between "2020/3/30" and "2020/10/26". I also took a look and the source code and I have no idea why the bug occurs?

I believe the issue was due to the JavaScript date class not handling UTC by default.
Changing new Date({year},{month - 1},{day}) to new Date(Date.UTC({year},{month - 1},{day})) has resolved the issue.
And now the dates make sense: its the start and end of daylight saving when an hour is lost of gained.


Confusing paragraph in Labels and Selectors concept

https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#equality-based-requirement
In the documentation, we have this statement:
One usage scenario for equality-based label requirement is for Pods to specify node selection criteria. For example, the sample Pod below selects nodes with the label **"accelerator=nvidia-tesla-p100"**.
While an example just after doesn't use this, but instead ** accelerator: nvidia-tesla-p100`**
apiVersion: v1 kind: Pod metadata:   name: cuda-test spec:   containers:     - name: cuda-test       image: "registry.k8s.io/cuda-vector-add:v0.1"       resources:         limits:           nvidia.com/gpu: 1   nodeSelector:     accelerator: nvidia-tesla-p100

/retitle Confusing paragraph in Labels and Selectors concept
We could edit the existing text, eg:
 One usage scenario for equality-based label requirement is for Pods to specify
-node selection criteria. For example, the sample Pod below selects nodes with
-the label "`accelerator=nvidia-tesla-p100`".
+node selection criteria. For example, the sample Pod below selects all nodes
+labelled `accelerator: nvidia-tesla-p100`.

Although a narrow tweak is helpful, we'd welcome a wider revision of the entire page to align it with the documentation style guide.
/language en
/priority backlog
/triage accepted
/help

/assign


error in saved checkpoints

When running !python3 audioldm_train/train/latent_diffusion.py -c audioldm_train/config/2023_08_23_reproduce_audioldm/audioldm_original.yaml --reload_from_ckpt /content/drive/MyDrive/AudioLDM-training-finetuning/data/checkpoints/checkpoint-fad-133.00-global_step=25009.ckpt, the training proceeds as expected. However, the checkpoint fails to load, and the training process is interrupted by ^c at the step when the checkpoint should be saved. what should i do please

any one help

@haoheliu


supported version of cuda ?

is rbcuda compatible with cuda-10.1..105 ?
getting this error :
cd tmp/x86_64-linux-gnu/rbcuda/2.5.1
/usr/bin/make
compiling ../../../../ext/rbcuda/rbcuda.cpp
In file included from ../../../../ext/rbcuda/ruby_rbcuda.c:1967:0,
from ../../../../ext/rbcuda/rbcuda.cpp:31:
../../../../ext/rbcuda/internals/cuda_runtime_api.c: In function ‘VALUE rb_cudaLaunch(VALUE, VALUE)’:
../../../../ext/rbcuda/internals/cuda_runtime_api.c:1013:21: error: ‘cudaLaunch’ was not declared in this scope
cudaError error = cudaLaunch((void*)func);
^~~~~~~~~~
../../../../ext/rbcuda/internals/cuda_runtime_api.c:1013:21: note: suggested alternative: ‘cuLaunch’
cudaError error = cudaLaunch((void*)func);
^~~~~~~~~~
cuLaunch
Makefile:240: recipe for target 'rbcuda.o' failed
make: *** [rbcuda.o] Error 1
rake aborted!
Command failed with status (2): [/usr/bin/make...]
/var/lib/gems/2.5.0/gems/rake-compiler-0.9.9/lib/rake/extensiontask.rb:157:in block (2 levels) in define_compile_tasks' /var/lib/gems/2.5.0/gems/rake-compiler-0.9.9/lib/rake/extensiontask.rb:156:in block in define_compile_tasks'
/usr/share/rubygems-integration/all/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => compile => compile:x86_64-linux-gnu => compile:rbcuda:x86_64-linux-gnu => copy:rbcuda:x86_64-linux-gnu:2.5.1 => tmp/x86_64-linux-gnu/rbcuda/2.5.1/rbcuda.so
(See full trace by running task with --trace

Same bug.