text:
Q: How to use sonarcloud with travis? Description
We are already using sonarqube locally and we want to use it for our open source projects.
This is an example OpenSource project we are trying to setup:

*

*https://www.npmjs.com/package/@yeutech-lab/accept-dot-path

*https://github.com/yeutech-lab/accept-dot-path
Using dev branch we have followed the documentation and the build is failing:

*

*https://travis-ci.org/yeutech-lab/accept-dot-path/jobs/396729046
Reproduction

*

*Failing job on travis
This is my sonar-project.properties:
sonar.testExecutionReportPaths=reports/test-report.xml
sonar.projectKey=com.github.yeutech-lab.accept-dot-path
sonar.projectName=com.github.yeutech-lab.accept-dot-path
sonar.sources=src
sonar.exclusions=/src/**/tests/*.test.js
sonar.test.exclusions=/src/**/tests/*.test.js
sonar.dynamicAnalysis=reuseReports
sonar.javascript.jstest.reportsPath=coverage
sonar.javascript.lcov.reportPaths=coverage/lcov.info

This is my stage failing .travis.yml:
- stage: test
  if: branch IN (dev, master)
  node_js:
    - lts/*
    - 10
    - 8
  addons:
    sonarcloud:
      organization: "yeutech-lab"
  script:
    - npm run test
    - sonar-scanner -X -Dsonar.branch=${TRAVIS_BRANCH} -Dsonar.projectVersion=${SONAR_VERSION}

I have the following error:
26.52s$ sonar-scanner -X -Dsonar.branch=${TRAVIS_BRANCH} -Dsonar.projectVersion=${SONAR_VERSION}
06:30:58.836 INFO: Scanner configuration file: /home/travis/.sonarscanner/sonar-scanner-3.0.3.778/conf/sonar-scanner.properties
06:30:58.845 INFO: Project root configuration file: /home/travis/build/yeutech-lab/accept-dot-path/sonar-project.properties
06:30:58.931 INFO: SonarQube Scanner 3.0.3.778
06:30:58.931 INFO: Java 1.8.0_151 Oracle Corporation (64-bit)
06:30:58.931 INFO: Linux 4.4.0-101-generic amd64
06:30:59.317 DEBUG: keyStore is :
06:30:59.317 DEBUG: keyStore type is : jks
06:30:59.318 DEBUG: keyStore provider is :
06:30:59.319 DEBUG: init keystore
06:30:59.321 DEBUG: init keymanager of type SunX509
06:30:59.534 DEBUG: Create : /home/travis/.sonar/cache
06:30:59.537 INFO: User cache: /home/travis/.sonar/cache
06:30:59.539 DEBUG: Create : /home/travis/.sonar/cache/_tmp
06:30:59.539 DEBUG: Extract sonar-scanner-api-batch in temp...
06:30:59.565 DEBUG: Get bootstrap index...
06:30:59.565 DEBUG: Download: https://sonarcloud.io/batch/index
06:31:00.321 DEBUG: Get bootstrap completed
06:31:00.323 DEBUG: Download https://sonarcloud.io/batch/file?name=sonar-scanner-engine-shaded-developer-7.3.0.13459-all.jar to /home/travis/.sonar/cache/_tmp/fileCache1590224166395973229.tmp
06:31:05.257 DEBUG: Create isolated classloader...
06:31:05.277 DEBUG: Start temp cleaning...
06:31:05.304 DEBUG: Temp cleaning done
06:31:05.304 DEBUG: Execution getVersion
06:31:05.310 DEBUG: Execution start
06:31:05.598 INFO: Publish mode
06:31:05.771 INFO: Load global settings
06:31:06.441 DEBUG: GET 200 https://sonarcloud.io/api/settings/values.protobuf | time=659ms
06:31:06.467 INFO: Load global settings (done) | time=697ms
06:31:06.485 INFO: Server id: AWHW8ct9-T_TB3XqouNu
06:31:06.502 DEBUG: Create : /home/travis/.sonar/_tmp
06:31:06.503 INFO: User cache: /home/travis/.sonar/cache
06:31:06.686 INFO: Load/download plugins
06:31:06.686 INFO: Load plugins index
06:31:06.806 DEBUG: GET 200 https://sonarcloud.io/api/plugins/installed | time=120ms
06:31:06.850 INFO: Load plugins index (done) | time=164ms
06:31:06.853 DEBUG: Download plugin 'authbitbucket' to '/home/travis/.sonar/_tmp/fileCache8382949818402309739.tmp'
06:31:06.972 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=authbitbucket&acceptCompressions=pack200 | time=118ms
06:31:07.480 DEBUG: Unpacking plugin authbitbucket
06:31:07.564 DEBUG: Download plugin 'scmgit' to '/home/travis/.sonar/_tmp/fileCache3430018907165592069.tmp'
06:31:07.688 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=scmgit&acceptCompressions=pack200 | time=123ms
06:31:07.936 DEBUG: Unpacking plugin scmgit
06:31:08.353 DEBUG: Download plugin 'github' to '/home/travis/.sonar/_tmp/fileCache5247411604780626227.tmp'
06:31:08.471 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=github&acceptCompressions=pack200 | time=116ms
06:31:08.885 DEBUG: Unpacking plugin github
06:31:09.011 DEBUG: Download plugin 'authgithub' to '/home/travis/.sonar/_tmp/fileCache1172914636956968383.tmp'
06:31:09.128 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=authgithub&acceptCompressions=pack200 | time=116ms
06:31:09.143 DEBUG: Unpacking plugin authgithub
06:31:09.164 DEBUG: Download plugin 'license' to '/home/travis/.sonar/_tmp/fileCache2891083593711587642.tmp'
06:31:09.280 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=license&acceptCompressions=pack200 | time=115ms
06:31:09.282 DEBUG: Unpacking plugin license
06:31:09.288 DEBUG: Download plugin 'scmmercurial' to '/home/travis/.sonar/_tmp/fileCache480957901258776338.tmp'
06:31:09.405 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=scmmercurial&acceptCompressions=pack200 | time=117ms
06:31:09.407 DEBUG: Unpacking plugin scmmercurial
06:31:09.411 DEBUG: Download plugin 'authmicrosoft' to '/home/travis/.sonar/_tmp/fileCache7929759057179488686.tmp'
06:31:09.528 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=authmicrosoft&acceptCompressions=pack200 | time=115ms
06:31:10.238 DEBUG: Unpacking plugin authmicrosoft
06:31:10.479 DEBUG: Download plugin 'abap' to '/home/travis/.sonar/_tmp/fileCache6155881230164947210.tmp'
06:31:10.596 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=abap&acceptCompressions=pack200 | time=115ms
06:31:10.714 DEBUG: Unpacking plugin abap
06:31:10.918 DEBUG: Download plugin 'csharp' to '/home/travis/.sonar/_tmp/fileCache6706825159734964118.tmp'
06:31:11.034 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=csharp&acceptCompressions=pack200 | time=115ms
06:31:11.279 DEBUG: Unpacking plugin csharp
06:31:11.422 DEBUG: Download plugin 'cpp' to '/home/travis/.sonar/_tmp/fileCache5652771019902212699.tmp'
06:31:11.539 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=cpp&acceptCompressions=pack200 | time=116ms
06:31:12.227 DEBUG: Unpacking plugin cpp
06:31:12.863 DEBUG: Download plugin 'flex' to '/home/travis/.sonar/_tmp/fileCache8167974862316719743.tmp'
06:31:12.982 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=flex&acceptCompressions=pack200 | time=115ms
06:31:13.237 DEBUG: Unpacking plugin flex
06:31:13.426 DEBUG: Download plugin 'go' to '/home/travis/.sonar/_tmp/fileCache4775478942526974201.tmp'
06:31:13.542 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=go&acceptCompressions=pack200 | time=116ms
06:31:14.679 DEBUG: Unpacking plugin go
06:31:15.380 DEBUG: Download plugin 'javascript' to '/home/travis/.sonar/_tmp/fileCache6735152755692319121.tmp'
06:31:15.497 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=javascript&acceptCompressions=pack200 | time=116ms
06:31:15.839 DEBUG: Unpacking plugin javascript
06:31:16.231 DEBUG: Download plugin 'java' to '/home/travis/.sonar/_tmp/fileCache4775164839730523442.tmp'
06:31:16.348 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=java&acceptCompressions=pack200 | time=117ms
06:31:16.921 DEBUG: Unpacking plugin java
06:31:17.871 DEBUG: Download plugin 'php' to '/home/travis/.sonar/_tmp/fileCache4310559658352997108.tmp'
06:31:17.989 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=php&acceptCompressions=pack200 | time=117ms
06:31:18.335 DEBUG: Unpacking plugin php
06:31:18.630 DEBUG: Download plugin 'plsql' to '/home/travis/.sonar/_tmp/fileCache4483462510508490361.tmp'
06:31:18.746 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=plsql&acceptCompressions=pack200 | time=116ms
06:31:18.873 DEBUG: Unpacking plugin plsql
06:31:19.120 DEBUG: Download plugin 'python' to '/home/travis/.sonar/_tmp/fileCache7976201852420985200.tmp'
06:31:19.236 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=python&acceptCompressions=pack200 | time=116ms
06:31:19.361 DEBUG: Unpacking plugin python
06:31:19.548 DEBUG: Download plugin 'security' to '/home/travis/.sonar/_tmp/fileCache4952173467535429371.tmp'
06:31:19.664 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=security&acceptCompressions=pack200 | time=116ms
06:31:19.782 DEBUG: Unpacking plugin security
06:31:19.930 DEBUG: Download plugin 'swift' to '/home/travis/.sonar/_tmp/fileCache7219239880236505170.tmp'
06:31:20.046 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=swift&acceptCompressions=pack200 | time=115ms
06:31:20.175 DEBUG: Unpacking plugin swift
06:31:20.422 DEBUG: Download plugin 'typescript' to '/home/travis/.sonar/_tmp/fileCache8846622888447642464.tmp'
06:31:20.539 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=typescript&acceptCompressions=pack200 | time=116ms
06:31:21.109 DEBUG: Unpacking plugin typescript
06:31:21.247 DEBUG: Download plugin 'tsql' to '/home/travis/.sonar/_tmp/fileCache6294671329122059465.tmp'
06:31:21.363 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=tsql&acceptCompressions=pack200 | time=116ms
06:31:21.480 DEBUG: Unpacking plugin tsql
06:31:21.723 DEBUG: Download plugin 'vbnet' to '/home/travis/.sonar/_tmp/fileCache2366356249389465444.tmp'
06:31:21.841 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=vbnet&acceptCompressions=pack200 | time=118ms
06:31:22.076 DEBUG: Unpacking plugin vbnet
06:31:22.169 DEBUG: Download plugin 'web' to '/home/travis/.sonar/_tmp/fileCache1192878208453770217.tmp'
06:31:22.286 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=web&acceptCompressions=pack200 | time=117ms
06:31:22.401 DEBUG: Unpacking plugin web
06:31:22.611 DEBUG: Download plugin 'xml' to '/home/travis/.sonar/_tmp/fileCache6491864581862163918.tmp'
06:31:22.728 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=xml&acceptCompressions=pack200 | time=116ms
06:31:22.955 DEBUG: Unpacking plugin xml
06:31:23.186 INFO: Load/download plugins (done) | time=16500ms
06:31:23.250 DEBUG: API compatibility mode is enabled on plugin Mercurial [scmmercurial] (built with API lower than 5.2)
06:31:23.491 DEBUG: Plugins:
06:31:23.492 DEBUG:   * Bitbucket Authentication for SonarQube 1.1.0.344 (authbitbucket)
06:31:23.493 DEBUG:   * SonarPLSQL 3.2.0.1753 (plsql)
06:31:23.493 DEBUG:   * SonarC# 7.2.0.5463 (csharp)
06:31:23.494 DEBUG:   * SonarSecurity 7.2.0.944 (security)
06:31:23.495 DEBUG:   * SonarJava 5.4.0.14284 (java)
06:31:23.495 DEBUG:   * SonarWeb 2.6.0.1053 (web)
06:31:23.496 DEBUG:   * SonarFlex 2.4.0.1222 (flex)
06:31:23.496 DEBUG:   * SonarXML 1.5.1.1452 (xml)
06:31:23.497 DEBUG:   * SonarTS 1.7.0.2828 (typescript)
06:31:23.498 DEBUG:   * SonarVB 5.1.0.442 (vbnet)
06:31:23.498 DEBUG:   * SonarSwift 3.3.0.2492 (swift)
06:31:23.499 DEBUG:   * GitHub 1.4.2.1027 (github)
06:31:23.500 DEBUG:   * SonarCFamily 5.1.0.10083 (cpp)
06:31:23.501 DEBUG:   * SonarPython 1.10.0.2131 (python)
06:31:23.501 DEBUG:   * GitHub Authentication for SonarQube 1.4.0.660 (authgithub)
06:31:23.501 DEBUG:   * Mercurial 1.1.1 (scmmercurial)
06:31:23.501 DEBUG:   * SonarGo 1.1.0.1612 (go)
06:31:23.501 DEBUG:   * Microsoft Authentication for SonarCloud 1.0.0.157 (authmicrosoft)
06:31:23.501 DEBUG:   * SonarTSQL 1.2.0.2539 (tsql)
06:31:23.501 DEBUG:   * SonarJS 4.1.0.6085 (javascript)
06:31:23.501 DEBUG:   * License for SonarLint 7.3.0.13459 (license)
06:31:23.504 DEBUG:   * Git 1.5.0.1160 (scmgit)
06:31:23.504 DEBUG:   * SonarPHP 2.13.0.3107 (php)
06:31:23.505 DEBUG:   * SonarABAP 3.6.0.1269 (abap)
06:31:23.543 INFO: Loaded core extensions: branch-scanner
06:31:23.544 DEBUG: Execution getVersion
06:31:23.545 INFO: SonarQube server 7.3.0
06:31:23.546 INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
06:31:23.548 DEBUG: Work directory: /home/travis/build/yeutech-lab/accept-dot-path/.scannerwork
06:31:23.549 DEBUG: Execution getVersion
06:31:23.550 DEBUG: Execution execute
06:31:23.860 INFO: Installed core extension: branch-scanner
06:31:24.122 INFO: Installed core extension: branch-scanner
06:31:24.129 INFO: Process project properties
06:31:24.143 DEBUG: Process project properties (done) | time=14ms
06:31:24.158 INFO: Load project branches
06:31:24.278 DEBUG: GET 404 https://sonarcloud.io/api/project_branches/list?project=com.github.yeutech-lab.accept-dot-path%3Adev | time=116ms
06:31:24.282 DEBUG: Could not process project branches - continuing without it
06:31:24.285 INFO: Load project branches (done) | time=127ms
06:31:24.289 INFO: Load project pull requests
06:31:24.406 DEBUG: GET 404 https://sonarcloud.io/api/project_pull_requests/list?project=com.github.yeutech-lab.accept-dot-path%3Adev | time=115ms
06:31:24.407 DEBUG: Could not process project pull requests - continuing without it
06:31:24.410 INFO: Load project pull requests (done) | time=122ms
06:31:24.410 INFO: Load branch configuration
06:31:24.411 DEBUG: Not on a Bitbucket pipeline.
06:31:24.419 INFO: ------------------------------------------------------------------------
06:31:24.419 INFO: EXECUTION FAILURE
06:31:24.419 INFO: ------------------------------------------------------------------------
06:31:24.419 INFO: Total time: 25.644s
06:31:24.518 INFO: Final Memory: 54M/188M
06:31:24.518 INFO: ------------------------------------------------------------------------
06:31:24.518 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectLock
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
    at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:281)
    at org.sonar.scanner.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:123)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:134)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
    at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
    at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:81)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
    at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:132)
    at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy0.execute(Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
    at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
    at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
    at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.DefaultInputModuleHierarchy
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
    at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
    at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
    at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
    at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
    at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
    at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
    at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
    at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
    at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
    ... 24 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectBuildersExecutor
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
    at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
    at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
    at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
    at org.picocontainer.injectors.SingleMemberInjector.getMemberArguments(SingleMemberInjector.java:61)
    at org.picocontainer.injectors.MethodInjector.getMemberArguments(MethodInjector.java:100)
    at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:112)
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
    at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
    at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
    at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
    at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
    at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
    ... 38 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.plugins.github.PullRequestProjectBuilder
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:621)
    at org.picocontainer.parameters.CollectionComponentParameter.getArrayInstance(CollectionComponentParameter.java:334)
    at org.picocontainer.parameters.CollectionComponentParameter.access$100(CollectionComponentParameter.java:49)
    at org.picocontainer.parameters.CollectionComponentParameter$1.resolveInstance(CollectionComponentParameter.java:139)
    at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:141)
    at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
    at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
    at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
    at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
    at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
    at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
    at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
    ... 53 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.plugins.github.GitHubPluginConfiguration
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
    at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
    at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
    at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
    at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
    at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
    at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
    at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
    at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
    at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
    ... 69 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.MutableProjectSettings
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
    at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
    at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
    at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
    at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
    at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
    at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
    at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
    at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
    at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
    ... 83 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.repository.ProjectRepositories
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
    at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
    at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
    at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
    at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
    at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
    at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
    at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
    at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
    at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
    ... 97 more
Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
    at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
    at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
    at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
    at org.picocontainer.injectors.SingleMemberInjector.getMemberArguments(SingleMemberInjector.java:61)
    at org.picocontainer.injectors.MethodInjector.getMemberArguments(MethodInjector.java:100)
    at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:112)
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
    at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
    at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
    at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
    at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
    at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
    at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
    ... 111 more
Caused by: Project was never analyzed. A regular analysis is required before a branch analysis
06:31:24.545 DEBUG: Execution getVersion
06:31:24.545 DEBUG: Execution stop
The command "sonar-scanner -X -Dsonar.branch=${TRAVIS_BRANCH} -Dsonar.projectVersion=${SONAR_VERSION}" exited with 1.
store build cache

I have no clue what this error message is about, the same configuration work for our local sonarqube.
Can I have information on how to resolve this error?

A: You are trying to directly analyze a branch whereas your project has not been created yet. This is why you get the following message:

Project was never analyzed. A regular analysis is required before a
  branch analysis

Fixing the situation is simple:

*

*Go to your organization "Administration > Projects Management" page

*Click on "Create Project" and set the project name and key (com.github.yeutech-lab.accept-dot-path in your case)

This should fix your issue.


text:
Q: How to pass data both ways between different android applications? What's the easiest way to pass string variables from one application to another and also return values back? I have access to the source code of both apps, but it has to be two different applications.
I tried with startActivityForResult, but this only seems to work between activies of the same application. When calling an activity from a different package, startActivityForResult returns immediately with RESULT_CANCELED. There seems to be the possibility to solve this with a Service, but isn't that a bit oversized for just some string vars?
Is there an easy and clean way to do this?
Here the code i tried to use for startActivityForResult:
//App A:
            Intent intent = new Intent();
            intent.setAction("com.example.testapp.MESSAGE");
            Bundle b = new Bundle();
            b.putString("loginToken", "263bhqw3jhf6as4yf8j0agtz8h2hj2z9j3hg3g3ggh34uzh2h2ui78h3i9wdnj89x");
            intent.putExtra("MyData", b);

            startActivityForResult(intent, TEST_REQUEST);

    @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    Log.d("pairing", "onActivityResult called");
    // Check which request we're responding to
    if (requestCode == TEST_REQUEST) {
        // Make sure the request was successful
        Log.d("pairing", "got result, resultCode: " + resultCode);
        if (resultCode == RESULT_OK) {
            // The Intent's data Uri identifies which contact was selected.
            if (data.hasExtra("returnMessage")) {
                Toast.makeText(this, data.getExtras().getString("returnMessage"), Toast.LENGTH_LONG).show();
            }

        }
    }
}

            // App B:
        Intent result = new Intent();
        Bundle b = new Bundle();
        b.putString("returnValue", "this is the returned value");
        result.putExtra("MyData", b);
        setResult(Activity.RESULT_OK, result);
        Log.d("pairing", "RESULT_OK set");
        finish();

//App B Manifest
        <activity
        android:name="com.example.testapp"
        android:launchMode="singleTop"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustPan" >
        <intent-filter>
            <action android:name="com.example.testapp.MESSAGE" />

            <category android:name="android.intent.category.DEFAULT" />

            <data android:mimeType="text/plain" />
        </intent-filter></activity>

Anybody seeing the mistake? App B always returns immediately with RESULT_CANCELED
EDIT:
Right now I'm getting a android.content.activitynotfoundexception no activity found to handle intent { act=com.example.testapp.MESSAGE (has extras) } error. What am I doing wrong?

A: AIDL is one means of communication between two different applications using Interfaces
http://developer.android.com/guide/components/aidl.html
You can find a working sample in the below tutorial
http://manishkpr.webheavens.com/android-aidl-example/

A: you can use ContentProvider.This is a better way than others.

A: SharedPreferences might help you in this regard.

A: I have two apps that i pass data to/from.
App1...
Intent i = new Intent("com.xxx.yyy.MESSAGE");
Bundle b = new Bundle();
b.putString("AAA", getAAA());
i.putExtra("MyData", b);
startActivityForResult(i, "myProcess");

nothing fancy there...
App2...in onResume()...
 Intent i = getIntent();
 if (i != null && i.getAction().equals("com.xxx.yyy.MESSAGE") {
    ...get the data from the bundle
 }

note that the AndroidManifest.xml (for App2) has the following entries for one of the activities
 <intent-filter>
    <action android:name="com.xxx.yyy.MESSAGE"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <data android:mimeType="text/plain"/>
 </intent-filter>

A: You can exchange messengers between two services that belong to those apps (even if the apps are from two different packages) and communicate using those messengers.

A: public class MyParcelable implements Parcelable {
    // You can include parcel data types
    private int mData;
    private String mName;

    // We can also include child Parcelable objects. Assume MySubParcel is such a Parcelable:
    private MySubParcelable mInfo;

    // This is where you write the values you want to save to the `Parcel`.
    // The `Parcel` class has methods defined to help you save all of your values.
    // Note that there are only methods defined for simple values, lists, and other Parcelable objects.
    // You may need to make several classes Parcelable to send the data you want.
    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeInt(mData);
        out.writeString(mName);
        out.writeParcelable(mInfo, flags)
    }

    // Using the `in` variable, we can retrieve the values that
    // we originally wrote into the `Parcel`.  This constructor is usually
    // private so that only the `CREATOR` field can access.
    private MyParcelable(Parcel in) {
        mData = in.readInt();
        mName = in.readString();
        mInfo = in.readParcelable(MySubParcelable.class.getClassLoader());
    }

    public MyParcelable() {
        // Normal actions performed by class, since this is still a normal object!
    }

    // In the vast majority of cases you can simply return 0 for this.
    // There are cases where you need to use the constant `CONTENTS_FILE_DESCRIPTOR`
    // But this is out of scope of this tutorial
    @Override
    public int describeContents() {
        return 0;
    }

    // After implementing the `Parcelable` interface, we need to create the
    // `Parcelable.Creator<MyParcelable> CREATOR` constant for our class;
    // Notice how it has our class specified as its type.
    public static final Parcelable.Creator<MyParcelable> CREATOR
            = new Parcelable.Creator<MyParcelable>() {

        // This simply calls our new constructor (typically private) and
        // passes along the unmarshalled `Parcel`, and then returns the new object!
        @Override
        public MyParcelable createFromParcel(Parcel in) {
            return new MyParcelable(in);
        }

        // We just need to copy this and change the type to match our class.
        @Override
        public MyParcelable[] newArray(int size) {
            return new MyParcelable[size];
        }
    };
}

READ HERE

redpajama_set_name: RedPajamaStackExchange


text:
Q: Como pegar índice da coluna selecionada da JTable Eu tenho uma coluna booleana na minha JTable que é editavel, o que eu quero fazer agora é salvar no banco de dados ao clicar no checkbox da tabela, estou tentando fazer isso no evento de click do mouse entao ao clicar no checkbox verificar se a coluna é a coluna que eu quero que seja editada e se for, salvar no banco de dados, porém não sei como pegar o indice da coluna para fazer essa comparação.
Imagem da JTable

Código do evento do click do mouse
private void jtPontoMouseClicked(java.awt.event.MouseEvent evt) {
    int colunaSelecionada = jtaApontamentos.getSelectedColumn();
    System.out.println("Coluna selecionada: " + colunaSelecionada); // retorna -1 deveria trazer o indice da coluna selecionada
    if (colunaSelecionada == apTableModel.COLUNA_VERIFICADO) {
        System.out.println("Salvar no banco de dados...");
    }
}

A: O jeito mas fácil para se fazer isso seria colocando um botão para executar essa ação, quando for acionado ele deve percorrer o JTable e verificar as linhas que estiver com o campo booleano igual a true e inserir no banco.
Sempre quando preciso trabalhar com um JTable realizo a inserção dessa forma.


text:
Q: Apache doesn't log remoteIP when RemoteIPHeader X-Forwarded-For is present I'm using Apache/2.4.27
Within the VirtualHost I'm forwarding the remote client IP header from the Loadbalancer with:
RemoteIPHeader X-Forwarded-For

Which is needed by the application served by that Virtualhost.
This is the log format within the main httpd.conf context.
LogFormat "%h (%{X-Forwarded-For}i) %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

When I have the RemoteIPHeader X-Forwarded-For listed within the virtualhost, Apache stops writting the remote-client IP into logs.
When I remove it from the VirtualHost, the remote-client IP starts appearing again within the logs.
Any ideas why the RemoteIPHeader X-Forwarded-For doesn't play with (%{X-Forwarded-For}i) from the LogFormat ?
Thanks !

A: Proxy Layer (Nginx)
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header        X-Real-IP       $remote_addr;

Backend Layer (Apache)
# Log format config
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" common
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog "logs/access_log" common env=forwarded

# Header config
RemoteIPHeader X-Real-IP
RemoteIPHeader X-Client-IP
RemoteIPInternalProxy 192.168.10.10 192.168.10.11

Description:
proxy_set_header - directive sets headers that nginx sends to backend; so in this example We sends two variables (to headers): X-Forwarded-For and X-Real-IP
X-Forwarded-For - on the proxy side it must be set that this header should be passed to backends and accessible from their layer
X-Real-IP - it does not affect the required variables on the web page but we leave it enabled so that the Apache server places the client's address in the logs (you also need to set the log format itself):
### X-Real-IP enabled
172.217.20.206 - - [03/Jun/2017:11:12:11 +0200] "GET /tls-check.php?9832 HTTP/1.0" 200 1409
### X-Real-IP disabled
172.16.21.11 - - [03/Jun/2017:15:12:49 +0200] "GET /tls-check.php?13266 HTTP/1.0" 200 1448

Curl
:~$ curl -H Cache-Control: no-cache -ks https://example.com/tls-check.php?${RANDOM} | grep "HTTP_X_FORWARDED_FOR\|HTTP_X_REAL_IP\|SERVER_ADDR\|REMOTE_ADDR"
[HTTP_X_FORWARDED_FOR] => 172.217.20.206
[HTTP_X_REAL_IP] => 172.217.20.206
[SERVER_ADDR] => 192.168.10.100
[REMOTE_ADDR] => 192.168.10.10

tls_check.php
<?php

echo '<pre>';
print_r($_SERVER);
echo '</pre>';
exit;

?>

A: Restore %a to that format if you're going to use mod_remoteip.
In bugzilla, mod_remoteip fills in %a while it
removes from %{X-Forwarded-For}i.  So in a simple case with one
trusted proxy, %a will hold the value used to see in
X-Forwarded-For because of mod_remoteip

A: It works for me. Replaced %h to %a
LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined

A: Try enclosing it between \" \" the same as it is done wirh Referer and User-Agent headers
LogFormat "%h \"%{X-Forwarded-For}i\" %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

A: I'm adding this as an answer to get formatting, instead of a comment on @DaWe4444 's correct answer.  Though it is correct, I didn't understand it at first.
To elucidate, my final config wound up as:
RemoteIPHeader Client-ip
RemoteIPHeader X-Forwarded-For
RemoteIPInternalProxy my.proxy.ip.address

which works for a an Apache Traffic Server upstream on Apache 2.4.25 on Debian.
I needed to change the combined log format line in apache2.conf as so:
-LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
+LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined

Some recipes out there call for switching the log format based on X-Forwarded-For headers, but mod_remoteip unsets that header, so those don't work with mod_remoteip.  Since %h incurs a DNS lookup cost (%a is just client IP) I was surprised to find it as a default.  Back in the day disabling DNS on queries was one of the first things every apache admin would do; log file analyzers will handle that part.


text:
Q: How to fix xCode 4 linking error with CoreData (4.2 -> 4.3) Simple issue I assume. Part of a project I've been working on in the iOS version 4.2/xCode 3 but now when I try to use those classes in my 4.3 project in xCode 4, I get a linking error.
It is ignoring the CoreData framework:
ld: warning: ignoring file /Users/Dom/Documents/Programming/objective-c/LunchMeet/CoreData.framework/CoreData, missing required architecture i386 in file
And then the rest of the linking errors are because core data is not there. How do I transfer a class from 4.2 to 4.3?
Thanks!

A: Okay I found a way around it anyway. I just copied the CoreData.framework reference from the 4.2 project to the 4.3 project and that fixed it. I still don't understand what the issue is though.


text:
Q: Rails: rendering a partial for a nested resource # routes.rb
resources :topics do
  resources :bookmarks, except: [:index]
end

The view files for my Bookmark model live in app/views/topics/bookmarks:

I render a bookmarks partial from within views/topics/_topic.html.erb:
...
<% if topic.bookmarks.count > 0 %>
  <% topic.bookmarks.each do |bookmark| %>
    <%= render partial: 'topics/bookmarks/bookmark', locals: { topic: topic, bookmark: bookmark } %>
  <% end %>
<% end %>
...

My problems is that I'm receiving a Template Missing error when trying to render the Bookmark partial. Is the path I'm passing to render partial: incorrect? I've also tried render partial: 'bookmarks/bookmark.
Missing template bookmarks/edit, application/edit with {:locale=>[:en], :formats=>[:html], :variants=>[],
:handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}.
Searched in: * "/Users/..../dev/.../.../code/.../app/views" *
"/Users/.../.rvm/gems/ruby-2.2.1/gems/devise-3.5.1/app/views"

Here is the full stack trace: https://goo.gl/wd3oqQ

A: I think that your controller should follow the same structure that you want to use in your views folder, so your bookmarks controller should be defined like this:
class Topics::BookmarksController < ApplicationController

And it should be placed in the /controllers/topics/ folder.
You can see something related to that in Rails guide

A: I'm not sure if this is the best practice, but I tried do this, change from this:
<% topic.bookmarks.each do |bookmark| %>
<%= render partial: 'topics/bookmarks/bookmark', locals: { topic: topic, bookmark: bookmark } %>
<% end %>

to this:
<%= render partial: 'topics/bookmarks/bookmark', :collection=> @topic.bookmarks.all %>


text:
Q: Boost.python failed with libboost_python.so.1.41.0: cannot open shared object file I have already installed Boost.Python. There were no erros during instalation, but I have a problem. When I try to build my project ererything is OK, but when I run my wrapped project there is an error:
import wrraped_project
ImportError: libboost_python.so.1.41.0: cannot open shared object file: No such file or directory

I tried to copy the project to libboost_python.so.1.41.0 also the lib to the project etc. But every time I have the sme error.

A: Check if the boost library files are in LD_LIBRARY_PATH.
If that doesn't help, check if the filename is correct, and create a symlink if different.

A: Can you give us the relevant content of your /usr/lib directory? I'm assuming you're on Linux, right? And did you install Boost.Python with a package manager?


text:
Q: configuring jars dependencies in pom I have a project developed in java using eclipse. This project is using a set of jars. We are trying to execute now this project using maven.
I have configured the pom file for every jar dependecy smth like:
<dependency>
                        <groupId>org.eclipse.uml2</groupId>
                        <artifactId>uml</artifactId>
                        <version>3.2.1</version>
                </dependency>

I am trying to use same version of libraries we have in the project.
I am facing two problems:
1. If i just specify the library just like this it gives me error that it can not download from the default repository that maven is using.
2. if i specify the repository in my pom smth like:
<repositories>
     <repository>
       <id>Indigo Release</id>
       <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/releases/indigo</url>
     </repository>
     <repository>
       <id>Juno Release</id>
       <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/releases/juno</url>
     </repository>
     <repository>
       <id>Snapshots</id>
       <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/snapshots</url>
     </repository>
   </repositories>

   <pluginRepositories>
     <pluginRepository>
       <id>Indigo Release</id>
       <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/releases/indigo</url>
     </pluginRepository>
     <pluginRepository>
       <id>Juno Release</id>
       <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/releases/juno</url>
     </pluginRepository>
     <pluginRepository>
       <id>Snapshots</id>
       <url>https://raw.github.com/eclipse/acceleo/master/maven/repository/snapshots</url>
     </pluginRepository>
   </pluginRepositories>

than the version which is in this repositories is not  the one i want to download.
I tried to download libraries manually in my local repository but its a lot of work. Isn't there any simple way to do this ?
Thank you in advance

A: Your configuration could not work cause the raw accesses to github will give you error 401 but to get forward check the wiki of Eclipse.


text:
Q: Compile protobuf to use primitive classes instead of well-known types Lets say I have test.proto file:
syntax = "proto3";

option java_package = "testing";
option java_outer_classname = "Test_v1";

import "google/protobuf/wrappers.proto";

message TestMessage {
    .google.protobuf.Int32Value integerField = 1;
}

If I compile (using protoc v3.5.0) it to c# code I will get nullable type properties:
public int? IntegerField {
   get { return integerField_; }
   set { integerField_ = value; }
 }

But if I compile it to Java code, fields will be of well-known type:
public Builder setIntegerField(com.google.protobuf.Int32Value value) {
  if (integerFieldBuilder_ == null) {
    if (value == null) {
      throw new NullPointerException();
    }
    integerField_ = value;
    onChanged();
  } else {
    integerFieldBuilder_.setMessage(value);
 }

I am moving project from proto2 to proto3 so I would like to avoid using well-known types, because it will require a lot of work to change related code. With c# projects I will not require to modify anything but in Java I will need to do as in the following example:
TestMessage.Builder builder = TestMessage.newBuilder();
builder.setIntegerField(5); //<-- instead of this with proto2
builder.setIntegerField(Int32Value.newBuilder().setValue(5)); //<-- I will need to do something like this with proto3

Is there a way to compile proto file to Java so setters would accept primitive classes/wrappers (String, Integer, etc.) as parameters?

A: The issue here is what to do when the value is missing. This isn't an issue with int32 (in the .proto), as (in proto3, at least) an int32 will always be there (defaulting to 0).  However, an .google.protobuf.Int32Value is a message, and as such it can be missing, or represent a value (which might be 0). In C# this concept can be neatly represented via int? (which can be null), but Java has no concept similar to Nullable<T>. The Int32Value encapsulates this, allowing a null reference.
So short version: no, and (^^^) that's why.
I assume you're actually replacing something that used to be:
message TestMessage {
    optional int32 integerField = 1;
}

???


text:
Q: Bootstrap (input text to modal) I have this one code, i need add intro modal (input text for verify):
        echo'

            KÓD

          <input type="text" class="form-control" placeholder="Vlož zde zvací kód hráče, který tě pozval" aria-label="Vlož zde zvací kód hráče, který tě pozval" aria-describedby="basic-addon1">

        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#overeni-kodu">
          Uložit
        </button>

Kontrola zadání

                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  ×
                </button>

                Pozval Tě hráč se zvacím kódem: XXXXXX

                Je to správně?

                <button type="button" class="btn btn-secondary" data-dismiss="modal">Opravit</button>
                <button type="button" class="btn btn-success">Opravdu uložit</button>

        ';

And i need from input-group mb-3 (text) place to modal (where is in code XXXXXX)
How i can add it?  Is it even possible?

A: What I understood is that you want to replace XXXXXX with the given code. If so you need to add 3 things.

*

*add id="code" and id="codeResult" attributes for both input and span respectively.

*add onclick="CodeDisplay()" in the button.

*add the following JavaScript function at the end of HTML code.

Snippt

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet"/>

         KÓD

       <input id="code" type="text" class="form-control" placeholder="Vlož zde zvací kód hráče, který tě pozval" aria-label="Vlož zde zvací kód hráče, který tě pozval" aria-describedby="basic-addon1">

     <button onclick="CodeDisplay()" type="button" class="btn btn-primary" data-toggle="modal" data-target="#overeni-kodu">
       Uložit
     </button>

Kontrola zadání

             <button type="button" class="close" data-dismiss="modal" aria-label="Close">
               ×
             </button>

             Pozval Tě hráč se zvacím kódem: XXXXXX

             Je to správně?

             <button type="button" class="btn btn-secondary" data-dismiss="modal">Opravit</button>
             <button type="button" class="btn btn-success">Opravdu uložit</button>


text:
Q: React Native Tools VSCode extension for debugging not connecting to React Native application I was following the steps from here.
I don't know what i did wrong, it displaying error in VScode terminal - debug console
like this

An error occurred while launching the application. Could not start the packager. (error code 303)

how to solve this and how to connect the debugger in VScode to react native application


text:
Q: Quick, small, casual git rebase for only one or a few hunks: any facility? I'm in the process of editing my source files to produce a new commit atop my dev branch. My changes are saved on disk but not yet staged.
Then I notice a small mistake introduced by a former commit, say HEAD~10. Once fixed, the result is only one (or a few) additional git diff hunk(s) on my disk.
I don't want these hunks to be recorded within the new commit, because they belong to HEAD~10. So I need to rebase. Here is my workflow then, but I'm not satisfied with it:
$ git stash # save my current work + the small fix
$ git rebase --interactive HEAD~11
# set first commit appearing in todo list to `edit` action

$ git stash pop # re-introduce my changes here (**may conflict**)
$ git add --patch fixed_files # or similar, to only stage relevant fix hunk(s)
$ git commit --amend # fix old commit
$ git stash # save my current work again
$ git rebase --continue # get back to my current commit (will likely *not* conflict)
$ git stash pop # back here with HEAD~10 fixed

What I'm not happy with is that the process is complicated, and that the first git stash pop line may introduce meaningless conflicts, even though I'm confident that no conflicts will occur during execution of the git rebase --continue line.
Is there a better way? Suppose I only have a few staged hunks in HEAD, can I easily introduce them earlier in my branch with some magical:
git amend-old-commit-then-rebase HEAD~10

yet keep my unstaged changes? (of course I'd be warned in case the inherent rebase does conflict)

A: Interactive rebase already has a built in way to deal with this.  Let's demonstrate it.  We start by checking out the tip commit of some existing branch name:
git switch main

then creating our feature or topic branch:
git switch -c topic

We begin working and make a commit that has a small error in it:
... edit ...
git add frotz.c
git commit

Let's say that this is commit a123456 (we'll find the hash ID via git log later, or we'll use HEAD~10 as you did in your example; I just want something concrete to put here).
We make more commits:
... edit and commit repeatedly ...

then discover the mistake.  We hold off on fixing the mistake just yet, making the commit we need to make:
git commit

and then we fix the mistake, git add, and use git commit --fixup:
... edit frotz.c to fix the mistake ...
git add frotz.c
git commit --fixup a123456   # or git commit --fixup HEAD~10

The --fixup option directs git commit to use a specially-formatted commit message.
Now that we have the fixup commit, we run:
git rebase -i --autosquash main

(since topic was based on main; use whatever you need here).  The form with all the pick commands pops up, but when we look closely at it, we see that one of the lines doesn't say pick, it says fixup:
pick a123456   commit subject line
fixup b789abc  fixup! commit subject line
pick 9876543   another commit subject
... and so on ...

Writing out this set of commands (or not bothering since we don't need to change them around) and exiting the editor fires up the actual rebase, which ... absorbs the fixup commit into the bad commit, so that it's now all just one commit.
The fixup command basically tells Git: squash this commit into the previous commit, while dropping this commit's log message entirely.  Using squash instead of fixup tells Git: squash this commit into the previous one, but stop and give me a chance to write a new log message, showing me the two existing log messages.  These are effectively the same except for the chance to edit the commit message.
Since you didn't mention wanting to fix the commit message, we used --fixup here.  To automatically get a "squash" command, use git commit --squash.  In both cases git commit arranges for the future git rebase --autosquash to see a message that tells rebase rearrange the order of the pick commands, and change the second one to squash or fixup as appropriate.
As always, you can also re-order and/or modify the instructions manually.  (I usually do this rather than using git commit --fixup anyway, as I often want to do a lot of commit message rewording, and think about which commits to combine and what order to put them in.)


text:
Q: Llamada duplicada a 'open' usando mongoose Buenas, iniciandome en node.js y mongodb me encuentro de primeras con un problema que no se si es tal.
Teniendo el archivos server.js tan simple como
'use strict';
var http = require('http');
var express = require('express');
var bodyParser = require('body-parser');
var dbapi = require("./db/db.js");

var port = process.env.PORT || 1337;

http.createServer(function (req, res) {
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.end('Hello World\n');

    dbapi.connection();
}).listen(port);

y db.js con
'use strict'
var mongoose = require('mongoose');

module.exports.connection = function () {
    mongoose.connect("mongodb://localhost/protocoloDb", { useMongoClient: true });

    var db = mongoose.connection;

    db.on('error', console.error.bind(console, 'connection error:'));

    db.once('open', function () {
        console.log("Now connected!");
    });
}

El resultado en consola es un doble 'Conexión establecida'. ¿No se supone que 'once' debería ejecutarse sólo una vez?
Gracias

A: Vale, perdón, no vi este artículo antes de publicar la pregunta:
https://stackoverflow.com/questions/35515200/why-mongoose-opens-two-connections
Moongose usa por debajo el controlador nativo de MongoDB y este, a su vez, usa el pooling de conexiones para la gestión asíncrona. Dicho valor es modificable al crear la conexión usando la opción {server: {poolSize: 2}} en el método createconnection.
Ese valor lo tenía especificado en mi caso a 2, por lo que sacaba en el log de mongo que había dos conexiones abiertas.


text:
Q: reverse array method not working Why doesn't this work, but when I move the for loop from the main method to the reverse method it does?
public class ReverseArray
{

    public static void main(String[] args)
    {
        int[] list = {1, 2, 3, 4, 5};
        reverse(list);

        for (int i = 0; i < list.length; i++)
        {
            System.out.print(list[i] + " ");
        }
    }

    public static void reverse(int[] list)
    {
        int[] temp = new int[list.length];

        for (int i = 0; i < list.length; i++)
        {
            temp[i] = list[(list.length - 1) - i];
        }

        list = temp;
    }

}

A: Because you can't update the callers array reference from your method (and you don't need to). Instead iterate half-way through the list and swap each element with the position like,
public static void reverse(int[] list) {
    for (int i = 0; i < list.length / 2; i++) {
        int t = list[(list.length - 1) - i];
        list[(list.length - 1) - i] = list[i];
        list[i] = t;
    }
}

Also, you could print your array with Arrays.toString(int[]) like
public static void main(String[] args) {
    int[] list = { 1, 2, 3, 4, 5 };
    reverse(list);
    System.out.println(Arrays.toString(list));
}

Output is
[5, 4, 3, 2, 1]

A: The variable list in the reverse method only exists for the lifetime of the method. You need to either return the new reverse list and assign it to a variable (example below), or modify the original list itself (Elliott Frisch's answer).
public class ReverseArray {
    public static void main(String[] args) {
        int[] list = {1, 2, 3, 4, 5};
        list = reverse(list);

        for (int i = 0; i < list.length; i++) {
            System.out.print(list[i] + " ");
        }
    }

    public static int[] reverse(int[] list) {
        int[] temp = new int[list.length];
        for (int i = 0; i < list.length; i++) {
            temp[i] = list[(list.length - 1) - i];
        }
        return temp;
    }
}

A: You should return a value from your method i.e.
public static int[] reverse(int[] list)  {
    ...
    return temp;
}

and in main...
list = reverse(list);

instead of
reverse(list);

A: Because you are making changes to list which are internal to the method reverse.Instead you should have return the updated list as h shown in example or update the original list itself
public static void main (String[] args) throws java.lang.Exception
    {

    int[] list = {1, 2, 3, 4, 5};
    list=reverse(list);

    for (int i = 0; i < list.length; i++)
    {
        System.out.print(list[i] + " ");
    }
    }

public static int[] reverse(int[] list)
{
    int[] temp = new int[list.length];

    for (int i = 0; i < list.length; i++)
    {
        temp[i] = list[(list.length - 1) - i];
        //list[i]=temp[i];

    }

    list = temp;
    return list;
}


text:
Q: Power of 3 of a Binary Number in $GF(2^6)$? First of all, i want to build it in hardware so i need this in "digital operations" like "and" or "xor".
So I tried myself in a $GF(2^4)$. With the minimal polynom $z^4+z+1$:
$$a(z) = a_0 + a_1 \cdot z + a_2 \cdot z^2 + a_3 \cdot z^3$$
$$[a(z)]^3 = a_0 + a_1 \cdot z^3 + a_2 \cdot z^6 + a_3\cdot z^9 $$
$$= a_0 + a_1 \cdot z^3 + a_2 \cdot (z^3 + z^2) + a_3 c\dot (z^3+z)$$
$$= a_0 + a_1 \cdot z + a_2 \cdot z^2 + (a_1+a_2+a_3) \cdot z^3$$
Now i have to replace $(a_0, a_1, a_2, a_3)$ by $(a_0, a_3, a_2, a_1 + a_2 + a_3)$ The + operator is just a xor. This is functional.
If i do it on $GF(2^6)$ with minimal polynom $z^6+z+1$:
$$a(z) = a_0 + a_1 \cdot z + a_2 \cdot z^2 + a_3 \cdot z^3 + a_4 \cdot z^4 + a_5 c\dot z^5$$
$$[a(z)]^3 = a_0 + a_1 \cdot z^3 + a_2 \cdot z^6 + a_3 \cdot z^9 + a_4 \cdot z^12 + a_5 \cdot z^15$$
$$[a(z)]^3 = a_0 + a_1 \cdot z^3 + a_2 \cdot (z+1) + a_3 \cdot (z^4+z^3) + a_4 \cdot (z^2+1) + a_5 \cdot (z^5+z^3)$$
$$[a(z)]^3 = (a_0 + a_2 + a_4) + a_2 \cdot z + a_4 \cdot z^2 + (a_1 + a_3 + a_5) \cdot z^3 + a_3 \cdot z^4 + a_5 \cdot z^5$$
Now i should replace $(a_0, a_1, a_2, a_3, a_4, a_5)$ with $(a_0+a_2+a_4, a_2, a_4, a_1 + a_3 + a_5, a_3 ,a_5)$
For example if i want to take the power of 3 from $a^11= 100011$, it should give $a^33 = 010010$.

*

*For new $a_5: a_5 = 1$

*For new $a_4: a_3 = 0$

*For new $a_3: a_1 + a_3 + a_5 =  1 + 0 + 0 = 1$

*For new $a_2: a_4 = 0$

*For new $a_1: a_2 = 0$

*For new $a_0: a_0+a_2+a_4 = 1 + 0 + 0 = 1$
makes = 101001 which is $a^23$
Why it works on $GF(2^4)$ and not on $GF(2^6)$? What is my mistake?


text:
Q: Not able to get Regular Expression in javascript I would like to set up validation regex on one of my text fields.
A sample input looks like:
1364-lqap-10926

The validation formula is 4 digits, dash, 4 letters, dash, 5 digits (total length validation = 15).
I have tried with \d{4})-([a-z]*[a-z])-\d{5}, but unwanted values get matched, too.
Could you please suggest how to fix the regex?

A: RegEx:
/[0-9]{4}-[a-z]{4}-[0-9]{5}/

[0-9]{4}: Matches four numbers
\-: Matches -
[a-z]{4}: Matches four alphabets from range a to z

A: The regex you are asking is pretty trivial and you should learn regexes by analyzing this one.
The regex following your behaviour is:
'/\d{4}-[a-zA-Z]{4}-\d{5}/'

Explanations:

4 Numeric

\d{4}

means that you want exactly 4 occurences of "\d" which is a number

4 Alpha

As num is not included in alpha, then you'll search for any occurence of letters that are exactly 4:
[a-zA-Z]{4}

5 Numeric

Same as 4 numbers but with a 5 instead of a 4 in the brackets (\d{5})

A: You need to check for anchors (^ and $ forcing the check at the beginning and end of the string) as well, not just the patterns.
^\d{4}-[a-z]{4}-\d{5}$

Use with i option to ignore letter case.
See demo
Sample code:

var re = /^\d{4}-[a-z]{4}-\d{5}$/i;
var str = '1234-abcd-12345';

if (re.test(str)) {
   alert("found");
}


text:
Q: How to generate a 16 digit unique number for each call by a service deployed on multiple servers without database? I have a Java service that generates a 16 digit unique number using current time in the format yymmddhhmmssmsms. And it handles multiple calls on the same mili-second using Atomic Long.
But now the problem is that I need this service on multiple cloud machines. How can I handle calls at the same microsecond on different servers and generate a unique number for each of this calls.
And I dont want to use database for this.
EDIT:
I understand UUID can be a solution. But UUID generates a random no. everytime, not unique, though the chances of collision are very low.

A: A think, you can try to use UUID.randomUUID() object

A: The UUID v4 is the right choice for distributed systems.

The UUID v4 implementation uses random numbers as the source. The Java
implementation is SecureRandom – which uses an unpredictable value as
the seed to generate random numbers to reduce the chance of
collisions.
Source: https://www.baeldung.com/java-uuid
Secure Random: This class provides a cryptographically strong random number generator (RNG). Source: https://docs.oracle.com/javase/8/docs/api/java/security/SecureRandom.html

Example how to use the UUID:
UUID uuid = UUID.randomUUID();

A: Using a random number alone (such as a random UUID) should only be done if—

*

*you have a way to check the number for uniqueness across all calls, or

*you can tolerate the risk of generating the same number for different calls.

If you find it appropriate, try assigning each server a unique number (e.g., by requesting a unique number from a central database). Then each server can generate a unique ID for each call it makes by appending a random number to that unique number; this may work well because the server can now more easily check the IDs it then generates for uniqueness, as no further contact with a central database or other servers is required.
See also my section on generating unique random identifiers.


text:
Q: Volume normalization I'm having a a problem with my audio setup. I've used to connect my external speakers (stereo setup consisting of two speakers) to a USB DAC which was connected to the onboard soundcard (Realtek) of my computer.
When I played video files where the sound was encoded for 5.1 speakers, the voices were too low and other effects were way too loud. The Realtek card had a feature called "loudness equalization" which took care of this problem.
Now I'm using a Creative X-Fi Xtreme Music instead of the onboard Realtek, which doesn't have this feature in the drivers.
The question is now, how do I normalize the sound with the X-Fi? I want to use Media Player Home Cinema as a player, but the normalize feature there seems to have no effect. Is there something I can do normalize sound on the hardware end?
Thanks for your time and help
Chris

A: The problem is not about normalization, but most likely of missing downmixing functionallity in your audio stack. In theory, at the point where the 5.1 signal is converted to a stereo signal, some downmixing has to happen, otherwise it is likely that you are missing the important Center channel, where most of the speech is.
To fix this, you can try to put the soundcard into stereo mode (drivers and operating system usually have an option for that). This will tell the audio stack—possibly including the media player—that the sound will be played using stereo speakers. This might trigger downmixing which properly mixes in the rear, center and subwoofer channels in the front left+right channels.
It is also likely that your media player has an option to enable "headphone surround" effects, which should essentially do the same (VLC has an option for that, for example).

A: Maybe you could solve the issue using a traditional (Hard- or Software) Equalizer. Speech usually has different spectrum than other sounds have - so you'd want to play with volume levels for different frequencies. However, human voice can go from 80Hz to 12kHz, making it a cumbersome task trying to find the one ideal setting.
I got an old-fashioned analog equalizer at home, if I find the time I'll look into it once again.
Of course, you can just do this in software, too. I bet your X-Fi has at least an equalizer built into it's software.


text:
Q: Keep text field and button inside box I've got a simple problem that I swear I've done a hundred times but I guess I need another pair of eyes.
I have a table, enter email text field and an add-email button all in a box. When I add more emails to the table it pushes out the text field and button outside of the box. The text field and button need to be side by side.

                Heading

    <form id="emailform" name="emailform" method="POST">

                                foo@bar.com

                            <button class="deletebutton cc_icon_button" name="delete_email"
                                    value="Delete" title="Delete this email"
                            </button>
                            <input type="hidden" name="email_address" value="" />

...

           </form>

            <form id="addemailform" name="addemailform" method="POST">

                        <input type="text" size="24" maxlength="64" name="add_email" placeholder="Enter email" id="add_email" />

                        <button class="addbutton cc_button_enable pull-right" name="submitemail">Add Email</button>

            </form>

CSS:
.cc_button_enable {
    margin-bottom: 5px;
    float: left;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 4px;
    border-top-right-radius: 4px;
    border-top-left-radius: 4px;
    border: 1px solid #999;
    cursor: pointer;
    display: inline-block;
    line-height: normal;
    margin-right: 0.1em;
    overflow: visible;
    padding: 0;
    position: relative;
    text-align: center;
    vertical-align: middle;
    padding: 0.4em 1em;
    font-family: Lucida Grande,Lucida Sans Unicode,Arial,Verdana,sans-serif;
    font-size: 1.1em;
}
.dropshadow-heading {
    background-color: #cccccc;
    color: #28292A;
    font-size: 22px;
    padding: 10px 15px;
    text-transform: uppercase;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    font-family: 'Open Sans', sans-serif;
}

.dropshadow-body {
    padding: 1px 15px 15px 15px;
    font-family: 'Open Sans', sans-serif;
}

.dropshadow {
    font-family: 'Open Sans', sans-serif;
    -moz-border-radius: 5px;
    border-radius: 5px;
    -moz-box-shadow: 5px 5px 5px #ccc;
    -webkit-box-shadow: 5px 5px 5px #ccc;
    box-shadow: 5px 5px 5px #ccc;
    min-height: 200px;
    margin-left:15px;
    margin-bottom:15px;
    background-color:#ffffff;
    border: 1px solid #CCCCCC;
}

.cc_table {
    border-collapse: collapse;
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
    table-layout: auto;
    text-align: left;
    white-space: nowrap;
    /* display:inline-block; */
    width: 100%;
}

.cc_table th
{
    background: none repeat scroll 0 0 rgb(230, 230, 230);
    border-bottom: 1px solid #2B3D61;
    border-top: 2px solid white;
    color: rgb(165, 165, 165);
    font-size: 14px;
    font-weight: normal;
    padding: 8px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.cc_table td {
    background: none repeat scroll 0 0 #ffffff;
    border-bottom: 1px solid #2B3D61;
    border-top: 1px solid transparent;
    color: #333333;
    padding: 8px;
}

.cc_table tr:hover td {
    background: none repeat scroll 0 0 #a8cb17;
    color: #333399;
}

/* Used for spacing between form fields and buttons */
.cc_separator {
    float: left;
    margin-left: 10px;
}
/* generic spacing for divs on top */
.cc_margintop {
    margin-top: 25px;
}

#addemailform label.error {
        color: red;
        display: block;
}

/* generic float left */
.cc_floatleft {
    float: left;
}

/* blocks used for main content */
.cc_halfblock {
    width:45%;
    float: left;
    margin-left: 20px;
    min-height: 1px;
}

Fiddle to play with: http://jsfiddle.net/rkkw6uvg/1/

A: You have some floating elements inside .cc_margintop, so they'll break their parents bouds and cause a mess.
You need to clear those floats, so here are some possible solutions depending on your requirements:

*

*add a overflow:hidden rule on .cc_margintop

*use a good old clearfix method on .cc_margintop like so:

Check out the solution and the clearfix bellow:
.cc_margintop:after{
    content: '';
    display: table;
    clear: both;
}

.cc_button_enable {
 margin-bottom: 5px;
 float: left;
 border-bottom-right-radius: 4px;
 border-bottom-left-radius: 4px;
 border-top-right-radius: 4px;
 border-top-left-radius: 4px;
 border: 1px solid #999;
 cursor: pointer;
    display: inline-block;
    line-height: normal;
    margin-right: 0.1em;
    overflow: visible;
    padding: 0;
    position: relative;
    text-align: center;
    vertical-align: middle;
    padding: 0.4em 1em;
    font-family: Lucida Grande,Lucida Sans Unicode,Arial,Verdana,sans-serif;
    font-size: 1.1em;
}
.dropshadow-heading {
    background-color: #cccccc;
    color: #28292A;
    font-size: 22px;
    padding: 10px 15px;
    text-transform: uppercase;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
 font-family: 'Open Sans', sans-serif;
}

.dropshadow-body {
    padding: 1px 15px 15px 15px;
 font-family: 'Open Sans', sans-serif;
}

.dropshadow {
 font-family: 'Open Sans', sans-serif;
 -moz-border-radius: 5px;
 border-radius: 5px;
 -moz-box-shadow: 5px 5px 5px #ccc;
 -webkit-box-shadow: 5px 5px 5px #ccc;
 box-shadow: 5px 5px 5px #ccc;
 min-height: 200px;
 margin-left:15px;
 margin-bottom:15px;
 background-color:#ffffff;
 border: 1px solid #CCCCCC;
}

.cc_table {
    border-collapse: collapse;
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
    table-layout: auto;
    text-align: left;
    white-space: nowrap;
    /* display:inline-block; */
    width: 100%;
}

.cc_table th
{
    background: none repeat scroll 0 0 rgb(230, 230, 230);
    border-bottom: 1px solid #2B3D61;
    border-top: 2px solid white;
    color: rgb(165, 165, 165);
    font-size: 14px;
    font-weight: normal;
    padding: 8px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.cc_table td {
    background: none repeat scroll 0 0 #ffffff;
    border-bottom: 1px solid #2B3D61;
    border-top: 1px solid transparent;
    color: #333333;
    padding: 8px;
}

.cc_table tr:hover td {
    background: none repeat scroll 0 0 #a8cb17;
    color: #333399;
}

/* Used for spacing between form fields and buttons */
.cc_separator {
 float: left;
 margin-left: 10px;
}
/* generic spacing for divs on top */
.cc_margintop {
 margin-top: 25px;
    overflow: hidden;/*clear those pesky floats*/
}

#addemailform label.error {
        color: red;
        display: block;
}

/* generic float left */
.cc_floatleft {
 float: left;
}

/* blocks used for main content */
.cc_halfblock {
 width:45%;
 float: left;
    margin-left: 20px;
    min-height: 1px;
}

    Heading

 <form id="emailform" name="emailform" method="POST">

        foo@bar.com

       <button class="deletebutton cc_icon_button" name="delete_email"
         value="Delete" title="Delete this email"
       </button>
       <input type="hidden" name="email_address" value="" />

        foo1@bar.com

       <button class="deletebutton cc_icon_button" name="delete_email"
         value="Delete" title="Delete this email"
       </button>
       <input type="hidden" name="email_address" value="" />

        foo2@bar.com

       <button class="deletebutton cc_icon_button" name="delete_email"
         value="Delete" title="Delete this email"
       </button>
       <input type="hidden" name="email_address" value="" />

        foo3@bar.com

       <button class="deletebutton cc_icon_button" name="delete_email"
         value="Delete" title="Delete this email"
       </button>
       <input type="hidden" name="email_address" value="" />

        foo4@bar.com

       <button class="deletebutton cc_icon_button" name="delete_email"
         value="Delete" title="Delete this email"
       </button>
       <input type="hidden" name="email_address" value="" />

           </form>

   <form id="addemailform" name="addemailform" method="POST">

      <input type="text" size="24" maxlength="64" name="add_email" placeholder="Enter email" id="add_email" />

      <button class="addbutton cc_button_enable pull-right" name="submitemail">Add Email</button>

   </form>

A: See the below code.

*

*Tag <input type='button' /> is self closing, don't use <button></button>

*Pay attention on the class dropshadow. I added clear: both; and display: inline-block; to solve your specific problem.

.cc_button_enable {
 margin-bottom: 5px;
 float: left;
 border-bottom-right-radius: 4px;
 border-bottom-left-radius: 4px;
 border-top-right-radius: 4px;
 border-top-left-radius: 4px;
 border: 1px solid #999;
 cursor: pointer;
    display: inline-block;
    line-height: normal;
    margin-right: 0.1em;
    overflow: visible;
    padding: 0;
    position: relative;
    text-align: center;
    vertical-align: middle;
    padding: 0.4em 1em;
    font-family: Lucida Grande,Lucida Sans Unicode,Arial,Verdana,sans-serif;
    font-size: 1.1em;
}
.dropshadow-heading {
    background-color: #cccccc;
    color: #28292A;
    font-size: 22px;
    padding: 10px 15px;
    text-transform: uppercase;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
 font-family: 'Open Sans', sans-serif;
}

.dropshadow-body {
    padding: 1px 15px 15px 15px;
 font-family: 'Open Sans', sans-serif;
}

.dropshadow {
    clear: both;
    display: inline-block;
 font-family: 'Open Sans', sans-serif;
 -moz-border-radius: 5px;
 border-radius: 5px;
 -moz-box-shadow: 5px 5px 5px #ccc;
 -webkit-box-shadow: 5px 5px 5px #ccc;
 box-shadow: 5px 5px 5px #ccc;
 /* min-height: 290px; */
 margin-left:15px;
 margin-bottom:15px;
 background-color:#ffffff;
 border: 1px solid #CCCCCC;
}

.cc_table {
    border-collapse: collapse;
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
    table-layout: auto;
    text-align: left;
    white-space: nowrap;
    /* display:inline-block; */
    width: 100%;
}

.cc_table th
{
    background: none repeat scroll 0 0 rgb(230, 230, 230);
    border-bottom: 1px solid #2B3D61;
    border-top: 2px solid white;
    color: rgb(165, 165, 165);
    font-size: 14px;
    font-weight: normal;
    padding: 8px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.cc_table td {
    background: none repeat scroll 0 0 #ffffff;
    border-bottom: 1px solid #2B3D61;
    border-top: 1px solid transparent;
    color: #333333;
    padding: 8px;
}

.cc_table tr:hover td {
    background: none repeat scroll 0 0 #a8cb17;
    color: #333399;
}

/* Used for spacing between form fields and buttons */
.cc_separator {
 float: left;
 margin-left: 10px;
}
/* generic spacing for divs on top */
.cc_margintop {
 margin-top: 25px;
}

#addemailform label.error {
        color: red;
        display: block;
}

/* generic float left */
.cc_floatleft {
 float: left;
}

/* blocks used for main content */
.cc_halfblock {
 width:45%;
 float: left;
    margin-left: 20px;
    min-height: 1px;
}

    Heading

 <form id="emailform" name="emailform" method="POST">

    foo@bar.com

                    <button class="deletebutton cc_icon_button" name="delete_email" value="Delete" title="Delete this email" />
     <input type="hidden" name="email_address" value="" />

     foo1@bar.com

                <button class="deletebutton cc_icon_button" name="delete_email" value="Delete" title="Delete this email" />
    <input type="hidden" name="email_address" value="" />

    foo2@bar.com

                    <button class="deletebutton cc_icon_button" name="delete_email" value="Delete" title="Delete this email" />
     <input type="hidden" name="email_address" value="" />

    foo3@bar.com

                    <button class="deletebutton cc_icon_button" name="delete_email" value="Delete" title="Delete this email" />
     <input type="hidden" name="email_address" value="" />

    foo4@bar.com

     <button class="deletebutton cc_icon_button" name="delete_email" value="Delete" title="Delete this email" />
     <input type="hidden" name="email_address" value="" />

    </form>

  <form id="addemailform" name="addemailform" method="POST">

    <input type="text" size="24" maxlength="64" name="add_email" placeholder="Enter email" id="add_email" />

Add Email

  </form>

A: Your Answer: http://jsfiddle.net/rkkw6uvg/2/
I took out two floats and didn't even need to clear anything.
First float I took out was in this class: .cc_button_enable
Second: In the class: .cc_separator


text:
Q: Impala return null values after 'is not equal' condition I am trying to print the top 5 sports according to the duration.
I ran the below query:
with t1
AS
(
 select cast(duration as int),race,lap,sport
 from db.table1
 where exchange_code in ("tennis", "golf", "football")
 and table1_date = 20201010
 and duration is not null
 and race is not null
 and lap is not null
 and sport is not null
)
select sum(duration_int) ,race,lap,sport
from t1
group by race,lap,sport
order by sum(duration_int) desc
limit 5;

And the results are these:
 sum(duration_int) race   lap      sport
 [null]            first  second   golf
 408439363026
 65886284          fourth third    football
 33687102          fifth  first    american-football
 22642805          tenth  fifth    english-football

As you can see I have null values after the condition IS NOT NULL.

A: As the Impala documentation explains, CAST() does not return an error if it cannot cast the value, it returns NULL:

If the expression value is of a type that cannot be converted to the target type, the result is NULL.

Hence, the condition duration is not null is not sufficient.  Instead:
cast(duration as int) is not null

I am not sure why race, lap, and sport would have NULL values.  I suspect the values may be the string '[null]'.


text:
Q: Using scaleX and translationX at the same time (VelocityJS) I have a bar that is filled from a certain percentage to another percentage (0% - 50%). I want to smoothly animate this towards a new range (25% - 55%). This means both the width and the location of the bar will need to be changed. I'm having some trouble doing both of these smoothly at the same time.
After some research I found I needed to use scaleX to smoothly animate the width and translateX to smoothly animate the location (where translateX is also affected by the scale). The problem that occurs now is that the bar will overstep it's desired percentage (55%) and then move back as shown in the snippet below.

/* Button function to restart. */
const restart = () => {
  animate();
}

const animate = () => {
  /* Reset the bar to its starting position. (from 0% - 50%) */
  Velocity(document.getElementById('movingBar'), {
    scaleX: 0.5,
    translateX: 0
  },
  {
    duration: 0,
    easing: [0, 0, 1, 1]
  });

  /* Move the bar to its final position. (from 25% - 55%). */
  /* Split into two velocity calls so that they can have a seperate duration/easing if needed. */
  Velocity(document.getElementById('movingBar'), {
    scaleX: 0.30
  },
  {
    duration: 1000,
    easing: [0, 0, 1, 1],
    queue: false
  });

  Velocity(document.getElementById('movingBar'), {
    translateX: (25 / 0.30) + '%'
  },
  {
    duration: 1000,
    easing: [0, 0, 1, 1],
    queue: false
  });
};

/* Start animation on run. */
animate();
#root {
  width: 700px;
  height: 100%;
}

#container {
  width: 100%;
  height: 90px;
  background-color: #000000;
}

.bar {
  width: 100%;
  height: 30px;
  transform: scaleX(0.5);
  transform-origin: left;
  background-color: #FF0000;
}

#description {
  display: flex;
}

.percentage {
  display: flex;
  justify-content: flex-end;
  width: 10%;
  height: 20px;
  text-align: right;
}

.odd {
  background-color: #DDDDDD;
}

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

  <button onClick="restart()">restart</button>

The example shows the starting position in the top green bar, and the desired position it should animate to in the bottom green bar. The middle red bar is the bar that should animate from the starting position to the desired position. As you can see the red bar reaches the desired result eventually but not before going over 55% for a bit. I'm using VelocityJS to animate at the moment.
Any idea what I'm doing wrong or how I would go about animating this? Is there some calculation I need to do to the duration/easing to correct whatever is going wrong?

A: The issue is related to how the interpolation of values is done. It would be a hard work to make sure to have a global linear transformation using scaleX and translateX because you cannot control the interpolation of values and the browser will do this for you. so either you do a complex calculation of the duration/easing to find a perfect result or you consider another kind of animation.
For such situation I would consider clip-path even if the support isn't optimal but it will be easier to handle since you have only one property to animate and you don't need any complex calculation as you simply have to use the percentage of the graph.
Here is a simplified example:

body {
  background:#000;
}
.box {
  height:50px;
  background:red;
  clip-path:polygon(10% 100%,10% 0,     40% 0,40% 100%); /*from [10% 40%]*/
  transition:1s all;
}

body:hover .box {
  clip-path:polygon(50% 100%,50% 0,     60% 0,60% 100%); /*to [50% 60%]*/
}

A: I started with the math while trying to find an answer and got this for translation easing which is almost perfect:
[1/3, 0.2, 2/3, 1 - (8/15)];
I calculated those by created a formula for what the translation path should look like 25x / (-0.2x + 0.5). I then divided it by 83.333333 to get the desired translation formula in a [0, 1] window. I then used the formula of (25x / (-0.2x + 0.5)) / 83.333333 to calculate the cubic-bezier points which I used above. Note that I do 1-C2y for the 4th point, not sure why but otherwise it wouldnt work.
NOTE: This worked for the original problem above but fails to work when the scale changes from anything other than 0.5 - 0.3. I'm still figuring out why.

/* Button function to restart. */
const restart = () => {
  animate();
}

const desiredX = 0.5;
let desiredYScale = 0;
let desiredYTranslation = 0;

const animate = () => {
  const barMax = 100;

  const scaleStart = 0.5;
  const scaleEnd = 0.4;
  const offsetStart = 0;
  const offsetEnd = 10;
  const translationStart = 100 / barMax * offsetStart / scaleStart;
  const translationEnd = 100 / barMax * offsetEnd / scaleEnd;
  const dataS = {};
  const dataT = {};

  const F = 0.5;
  const scaleFormula = ((-scaleStart + scaleEnd) * F + scaleStart);
  //console.log("scale formula: ", scaleFormula);
  const translationPath = (offsetEnd * F) / scaleFormula;
  const diffPath = translationPath - (offsetEnd / scaleEnd * F);
  const diffFormulaA = - (diffPath / (F * F));
  const diffFormula = (diffFormulaA/diffPath) * (F - 0.5) * (F - 0.5) + 1
  const diffA = diffFormulaA / diffPath;
  const cX = 0.5;
  const cY = 0.5 * Math.abs(diffA);
  const cAx = 2/3 * cX;
  const cAy = 2/3 * cY;
  const cBx = 2/3 * cX + 1/3 * 1;
  const cBy = 2/3 * cY + 1/3 * 1;
  const multiplicant = 0.5;

  const realCAX = cAx / cBy * multiplicant;
  const realCAY = cAy / cBy * multiplicant;
  const realCBX = 1 - (cBx / cBy * multiplicant);
  const realCBY = cBy / cBy * multiplicant;
  console.log("realCAX: ", realCAX);
  console.log("realCAY: ", realCAY);
  console.log("realCBX: ", realCBX);
  console.log("realCBY: ", realCBY);

  const linearEasing = [0, 0, 1, 1];
  //const one = 0.5 + (scaleEnd / 4);
  //const two = 0.525 - (scaleStart - scaleEnd);
  //const one = 0.40 + 0.025 / (0.5 - (scaleStart - scaleEnd));
  //console.log("One: ", one, (scaleStart - scaleEnd));
  //const one = 0.5;
  //const one = 0.535;
  //const one = 0.5;
  const one = 0.5;
  const two = 0.1;

  //const two = 0.125;
  //const translationEasing = [0.33, 10, 0.66, 16];
  //const translationEasing = [1/3, 0.2, 2/3, 1-(8/15)];
  //const translationEasing = [1/3, 1/15, 2/3, 1-0.4];
  //const translationEasing = [0.24, 0.06666, 0.85, 0.1];
  //const translationEasing = [0.33, 1.33, 0.66, 1.66];
  //const translationEasing = [0.2, 0.8, 0.4, 1];
  //const translationEasing = [0.1, 0.4, 1-0.2, 0.5];
  //const translationEasing = [realCAX, realCAY, realCBX, realCBY];
  //const translationEasing = [1/3, 0.0833333, 2/3, 0.42];
  const translationEasing = [one, two, 1-two, 1-one];
  //const translationEasing = [0, 0, 1, 1];5

  /* Reset the bar to its starting position. (from 0% - 50%) */
  Velocity(document.getElementById('movingBar'), {
    scaleX: scaleStart,
    translateX: translationStart  + '%'
  },
  {
    duration: 0,
    easing: linearEasing
  });

  /* Move the bar to its final position. (from 25% - 55%). */
  /* Split into two velocity calls so that they can have a seperate duration/easing if needed. */
  Velocity(document.getElementById('movingBar'), {
    scaleX: scaleEnd
  },
  {
    duration: 1000,
    easing: linearEasing,
    queue: false,
    progress: function(elements, complete, remaining, start, tweenValue) {
      dataS[complete] = scaleStart + ((scaleEnd - scaleStart) * complete);
    }
  });

  Velocity(document.getElementById('movingBar'), {
    translateX: translationEnd + '%',
    tween: translationEnd
  },
  {
    duration: 1000,
    easing: translationEasing,
    queue: false,
    progress: function(elements, complete, remaining, start, tweenValue) {
       dataT[complete] = translationStart + ((translationEnd - translationStart) * complete);
       console.log("TWEEN", complete, tweenValue);
    },
    complete: function() {
      //console.log("DONE!");
      //console.log("SCALE:");
      //if (desiredX in dataS) {
        //console.log('Scale[0.5]: ', dataS[desiredX], ', Translation[0.5]: ', dataT[desiredX]);
        //desiredYScale = dataS[desiredX];
        //desiredYTranslation = dataT[desiredX];
      //} else {
        //animate();
      //}
      for (const key in dataS) {
        if (dataS.hasOwnProperty(key)) {
          //console.log('', key, ': ', dataS[key]);
        }
      }

      //console.log("TRANSLATION:");
      for (const key in dataT) {
        if (dataT.hasOwnProperty(key)) {
          //console.log('', key, ': ', dataT[key]);
        }
      }
    }
  });
};

/* Start animation on run. */
animate();
#root {
  width: 700px;
  height: 100%;
}

#container {
  width: 100%;
  height: 90px;
  background-color: #000000;
}

.bar {
  width: 100%;
  height: 30px;
  transform: scaleX(0.5) transform (calc(20 / 0.5 * 1%));
  transform-origin: left;
  background-color: #FF0000;
}

#description {
  display: flex;
}

.percentage {
  display: flex;
  justify-content: flex-end;
  width: 10%;
  height: 20px;
  text-align: right;
}

.odd {
  background-color: #DDDDDD;
}

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

  <button onClick="restart()">restart</button>


text:
Q: ADODB RecordSet.RecordCount property always returns -1 The below code exports data correctly however my debug.print line always gives  -1. I would like to retrieve the count of rows in debug.print statement. Please suggest what is wrong.
Sub TEST()

        Dim rs As Object
        Dim iCols As Integer
        Set rs = CreateObject("ADODB.Recordset")
        On Error GoTo ERR
        Dim SQLSTR As String, MYVAL As String
        MYVAL = InputBox("Enter Query")
        SQLSTR = " " & MYVAL & ""
        CONNECT_TO_DWHS
        rs.Open SQLSTR, PERSONALDBCONT

            For iCols = 0 To rs.Fields.Count - 1
                ActiveSheet.Cells(1, iCols + 1).Value = rs.Fields(iCols).Name
            Next
         Debug.Print rs.RecordCount
        ActiveSheet.Cells(2, 1).CopyFromRecordset rs
        ActiveSheet.Cells(1, 1).Select

        CLOSE_CONNECTION_TO_SQL

            With ActiveWindow
                .SplitColumn = 0
                .SplitRow = 1
                .FreezePanes = True
            End With

        Exit Sub

   ERR:
        CLOSE_CONNECTION_TO_SQL
        MsgBox "There was an error"

  End Sub

A: Try to specify the cursor location. Specify the cursor location before opening the connection.
rs.CursorLocation = adUseClient
rs.Open SQLSTR, PERSONALDBCONT
For iCols = 0 To rs.Fields.Count - 1
  ActiveSheet.Cells(1, iCols + 1).Value = rs.Fields(iCols).Name
Next
Debug.Print rs.RecordCount

Please read this article: http://www.geeksengine.com/article/recordcount-ado-recordset-vba.html

A: When you open a RecordSet as ForwardOnly (default if you don't explicit declare the cursor type) the RecordCount property returns -1.
For more check here.


text:
Q: Rails 6/Webpack unable to compile images referenced from js.erb in production? (but working in development) While working in development, I have no problem (after running bundle exec rails webpacker:install:erb) with this code in Rails 6 using Webpack:
# app/javascript/raty.js.erb

<% helpers = ActionController::Base.helpers %>

$(document).on("turbolinks:load", () => {
  $('.star-rating').raty({
    starOn: "<%= helpers.asset_pack_path('media/images/star-on.png') %>",
    starOff: "<%= helpers.asset_pack_path('media/images/star-off.png') %>",
    readOnly: true,
    score: function () {
    return $(this).attr('data-score');
    }
  });
});

Bear in mind I'm using Webpack to load static assets as well, so no sprockets whatsoever (although I haven't removed its gems or touched any config related to the asset pipeline; just ignoring it for the time being).
That means I'm storing all my images in app/javascript/images, and then requiring as per the documentation:
# app/javascript/packs/application.js

// Uncomment to copy all static images under ../images to the output folder and reference
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
// or the `imagePath` JavaScript helper below.
//
const images = require.context('../images', true)
const imagePath = (name) => images(name, true)

In production, however, my push gets rejected from Heroku because the .pngs referenced (star-on.png and star-off.png) can't be found, since (I think) Webpack compiles them into the /public directory, so they are not present anymore in the /media/images path.
Unfortunately, the guides on Heroku don't cover Rails 6/Webpack, and all the answers I've come across were meant for Sprockets, and not Webpack.
Any advice would be very much appreciated!

A: In Webpack-land, you "import" images too. Given the following directory structure:
app/
  javascript/
    images/
      star-on.png
      star-off.png
    packs/
      application.js
    raty.js

This is what you would do in your raty.js:
import $ from 'jquery'
import 'raty-js'

import starOn from "./images/star-on.png"
import starOff from "./images/star-off.png"

$(document).on("turbolinks:load", () => {
  $('.star-rating').raty({
    readOnly: true,
    starOn: starOn,
    starOff: starOff,
    score() {
      return $(this).attr('data-score');
    }
  });
});

Note there's no need to use ERB here; the default Webpacker configuration will know how to resolve the output path to the image assuming you have the correct import path.
Also, you only need the following:
const images = require.context('../images', true)
// ...

if you want reference images via image_pack_tag in your HTML templates. You may very well want to do that, but, if just for this small example, it's unnecessary.


text:
Q: Strict column checking in Datastax java driver 4 causing problems Below is our entity class

  @Entity(defaultKeyspace = CASSANDRA_KEYSPACE)
  @CqlName(CASSANDRA_TABLE)
  public static class Scientist implements Serializable {

    @CqlName("person_name")
    public String name;

    @Computed("writetime(person_name)")
    @CqlName("name_ts")
    public Long nameTs;

    @CqlName("person_id")
    @PartitionKey
    public Integer id;

    public Scientist() {}

    public Scientist(int id, String name) {
      super();
      this.id = id;
      this.name = name;
    }

    public Integer getId() {
      return id;
    }

    public void setId(Integer id) {
      this.id = id;
    }

    public String getName() {
      return name;
    }

    public void setName(String name) {
      this.name = name;
    }

    @Override
    public String toString() {
      return id + ":" + name;
    }

    @Override
    public boolean equals(@Nullable Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      Scientist scientist = (Scientist) o;
      return id.equals(scientist.id) && Objects.equal(name, scientist.name);
    }

    @Override
    public int hashCode() {
      return Objects.hashCode(name, id);
    }
  }

  @Dao
  public interface ScientistDao {
  @GetEntity
  MappedAsyncPagingIterable<Scientist> map(AsyncResultSet resultSet);

  @Delete
  CompletionStage<Void> deleteAsync(Scientist entity);

  @Insert
  CompletionStage<Void> saveAsync(Scientist entity);
}

The problem faced is, when the computed fields (in the above case writetime(person_name) )are not selected as part of the query, the mapping fails.
In 3.x driver: mapped fields that are not present in the ResultSet were ignored. link
In 4.x driver: for each entity field, the database table or UDT must contain a column with the corresponding name. link
Please suggest a possible solution/workaround where this computed field can be part of the query on a need basis and the mapping happens successfully without throwing IllegalArgumentException.
Edit:
scientist table schema
CREATE TABLE beam_ks.scientist (person_id int PRIMARY KEY,person_name text);

Below is the query tried:
   select person_id,writetime(person_name) as name_ts from beam_ks.scientist where person_id=10

Mapping of the resultset with @GetEntity fails with below error:
Caused by: java.lang.IllegalArgumentException: person_name is not a column in this row
    at com.datastax.oss.driver.internal.core.cql.DefaultRow.firstIndexOf(DefaultRow.java:110)
    at com.datastax.oss.driver.api.core.data.GettableByName.get(GettableByName.java:144)
    at org.apache.beam.sdk.io.cassandra.CassandraIOTest_ScientistHelper__MapperGenerated.get(CassandraIOTest_ScientistHelper__MapperGenerated.java:89)

get method in CassandraIOTest_ScientistHelper__MapperGenerated:
  @Override
  public CassandraIOTest.Scientist get(GettableByName source) {
    CassandraIOTest.Scientist returnValue = new CassandraIOTest.Scientist();

    Integer propertyValue = source.get("person_id", Integer.class);
    returnValue.setId(propertyValue);

    String propertyValue1 = source.get("person_name", String.class);
    returnValue.setName(propertyValue1);
    return returnValue;
  }

Also, the documentation does not specify whether to add getter and setter methods for computed values. So, they are removed from entity class

A: When using @GetEntity methods, it is your responsibility to provide a result set object that is 100% compatible with the entity definition.
Here your Scientist entity contains two regular fields: person_id (integer) and person_name (text). Therefore your result set must contain (at least) two columns with these names and types.
But you said you provided the following query: select person_id,writetime(person_name) as name_ts from beam_ks.scientist where person_id=10.
This query does not contain the required columns. You should change your query to the one below, or something similar:
select person_id, person_name from beam_ks.scientist where person_id=10

Note that @GetEntity methods do not recognize computed values, only regular ones. It is not necessary to include writetime(person_name) as name_ts, it won't be mapped anyway.


text:
Q: JavaScript speechSynthesis is not working I'm trying to understand the speechSynthesis and this is my code:

const speechBtn = document.querySelector('#speech-btn');

const speak = () => {
  const msg = new SpeechSynthesisUtterance('Hello world');
  msg.rate = 0.7;
  msg.pitch = 1;
  window.speechSynthesis.speak(msg);
  console.log('test');
};

speechBtn.addEventListener('click', speak);
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button id="speech-btn">Read</button>
    <script src="./text-to-speech.js"></script>
  </body>
</html>

But it's not working.
What is wrong with my code?