programmerah.com Open in urlscan Pro
2606:4700:3035::ac43:d6f5  Public Scan

Submitted URL: http://www.programmerah.com/
Effective URL: https://programmerah.com/
Submission: On February 02 via manual from IN — Scanned from DE

Form analysis 1 forms found in the DOM

GET https://programmerah.com/

<form role="search" method="get" id="searchform" class="searchform" action="https://programmerah.com/">
  <div>
    <label class="screen-reader-text" for="s">Search for:</label>
    <input type="text" value="" name="s" id="s">
    <input type="submit" id="searchsubmit" value="Search">
  </div>
</form>

Text Content

WE VALUE YOUR PRIVACY

We and our partners store and/or access information on a device, such as cookies
and process personal data, such as unique identifiers and standard information
sent by a device for personalised ads and content, ad and content measurement,
and audience insights, as well as to develop and improve products.
With your permission we and our partners may use precise geolocation data and
identification through device scanning. You may click to consent to our and our
partners’ processing as described above. Alternatively you may access more
detailed information and change your preferences before consenting or to refuse
consenting.
Please note that some processing of your personal data may not require your
consent, but you have a right to object to such processing. Your preferences
will apply to this website only. You can change your preferences at any time by
returning to this site or visit our privacy policy.
MORE OPTIONSAGREE


PROGRAMMERAH


PROGRAMMER GUIDE, TIPS AND TUTORIAL

Menu Skip to content
 * Home
 * Python
 * PHP
 * JAVA
 * MySQL
 * Linux
 * JavaScript
 * Privacy Policy


[SOLVED] GBASE 8A V95 REPLACE NODE ERROR: SINGLE VC MODE DOES NOT SUPPORT
‘–FREENODE’

The v95 version of gbase 8A supports fast replacement of failed nodes through
free nodes (omitting the need to find the installation package and check the
installation and configuration process). However, free node is only for the
scene with VC enabled. For single VC, that is, the mode compatible with V8
version, free node is not supported, so it does not support this node
replacement method. The solution is to use a new node.

Error message
version: 9.5.3.22

install prefix: /opt/gbase/10.0.2.103
execute replace node os user: gbase
replaced nodes: ['10.0.2.104']
freenode: ['10.0.2.106']
Error: replace.py(line 1147) -- single vc mode does not support '--freenode'
[gbase@gbase_rh7_003 gcinstall]$

Reason
the cluster is in single VC mode, compatible with V8, and does not support
freenode. Look at the bottom of the gcadmin output. There is really no freenode
information.

[gbase@gbase_rh7_003 gcinstall]$ gcadmin
CLUSTER STATE:         ACTIVE
VIRTUAL CLUSTER MODE:  NORMAL

====================================
| GBASE GCWARE CLUSTER INFORMATION |
====================================
| NodeName |  IpAddress   | gcware |
------------------------------------
| gcware1  |  10.0.2.103  |  OPEN  |
------------------------------------
====================================================
|      GBASE COORDINATOR CLUSTER INFORMATION       |
====================================================
|   NodeName   | IpAddress  | gcluster | DataState |
----------------------------------------------------
| coordinator1 | 10.0.2.103 |   OPEN   |     0     |
----------------------------------------------------
=========================================================================================================
|                                    GBASE DATA CLUSTER INFORMATION                                     |
=========================================================================================================
| NodeName |                IpAddress                 | DistributionId | gnode | syncserver | DataState |
---------------------------------------------------------------------------------------------------------
|  node1   |                10.0.2.103                |       1        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------
|  node2   |                10.0.2.104                |       1        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------
|  node3   |                10.0.2.105                |       1        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------
|  node4   |                10.0.2.106                |                | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------

[gbase@gbase_rh7_003 gcinstall]$ 

Solution
adopt the scheme of new machines and replace nodes on the original IP.

This entry was posted in Error and tagged data warehouse, database, Gbase, GBase
8a on 2022-01-31 by Robins.


[SOLVED] INTELLIJ IDEA COMPILE GROOVY ERROR: GROOVYRUNTIMEEXCEPTION: THIS SCRIPT
OR CLASS COULD NOT BE RUN.

1. Error record

function

class Student1 {
}

Groovy code will report an error;

 

Error message:

groovy.lang.GroovyRuntimeException: This script or class could not be run.
It should either:
- have a main method,
- be a JUnit test or extend GroovyTestCase,
- implement the Runnable interface,
- or be compatible with a registered script runner. Known runners:
  * <none>



 

2. Problem analysis

Only groovy code that meets the following requirements can run:

With main function


test case, used as JUnit test or extended GroovyTestCase


Thread related and implements the runnable interface
It is compatible with the registered script running program


Groovy code in other cases cannot be run;

This entry was posted in How to Fix and tagged grade, groovy, intellectual idea
on 2022-01-31 by Robins.


[SOLVED] HCITOOL ERROR: SET SCAN PARAMETERS FAILED: OPERATION NOT PERMITTED

Set scan parameters failed: operation not allowed

The reason is that the function of hcitool tool is missing, and the lescan
function needs to be supplemented

sudo apt-get install libcap2-bin
sudo setcap 'cap_net_raw,cap_net_admin+eip' `which hcitool`
getcap !$

Execute again at this time

hcitool -i hci1 lescan

It is found that it can be scanned normally

This entry was posted in Error and tagged python on 2022-01-31 by Robins.


VIRTUAL MACHINE PING COMMAND ERROR: PING NAME OR SERVICE NOT KNOWN

Problem description

In the process of using VMware, the virtual machine environment was configured,
but due to the confusion of pending shutdown, the following errors were found
when restarting today:
Ping www.google.com, the following errors are found: Ping name or service not
known

> Since it can be used correctly before, ensure that the virtual network editor
> of the virtual machine is configured correctly. If it is the first
> configuration and has not been successfully started before, you can check the
> configuration of the network editor.

In the process of finding a solution, the following errors are found by using
the restart network command service network restart :
restarting network failed journalctl - Xe for detail control process exited with
error code

Problem-solving

systemctl stop NetworkManager
systemctl disable NetworkManager
systemctl start network.service

This entry was posted in Linux and tagged cents, linux on 2022-01-31 by Robins.


MAC MYSQL START ERROR: THE SERVER QUIT WITHOUT UPDATING PID

1. System configuration information:

System MacOS bigsur 11.6
MySQL 8.0.26

2. Start MySQL service:

sudo /usr/local/mysql/support-files/mysql. server start

The error message is as follows:

Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/jinjideleishen.local.pid).

Solution commands
mac default user is _mysql, under linux the default user of mysql is mysql
Use chown to change the owner of the specified file to the specified user or
group
-R : Process all files in the specified directory and its subdirectories

sudo chown -R _mysql:_mysql /usr/local/mysql/

Restart successful:

 sudo /usr/local/mysql/support-files/mysql.server restart
 ERROR! MySQL server PID file could not be found!
Starting MySQL
.................................................... SUCCESS!

3. Stop MySQL service

sudo /usr/local/mysql/support-files/mysql.server stop

4. Restart MySQL service

sudo /usr/local/mysql/support-files/mysql.server restart

This entry was posted in MySQL and tagged database, macOS, mysql on 2022-01-31
by Robins.


[SOLVED] LINUX SHELL SCRIPT ERROR: SYNTAX ERROR NEAR UNEXPECTED TOKEN `DO

[problem] the error content reported by the Linux server running the shell
script is shown in the following figure.

[reason] incompatible carriage return and line feed characters under Linux and
windows

[solution] change the windows newline character “CR lf” in the file to UNIX “LF”

Use Notepad + + to set the view first -> Display symbol -> When all symbols are
displayed, you will see “CR lf”



Edit -> with Notepad + +; Document format conversion -> Convert to UNIX (LF)



Re-run to solve the problem.

This entry was posted in Linux and tagged computer network, linux, Operation and
maintenance, shell, The server on 2022-01-31 by Robins.


[SOLVED] VSCODE ERROR: BUILD CONSTRAINTS EXCLUDE ALL GO FILES IN SYSCALL\JS

When developing golang webassembly in vscode, an error is reported when
importing the package. The code is as follows:

// main.go
package main

import "syscall/js"

func main() {
	alert := js.Global().Get("alert")
	alert.Invoke("Hello World!")
}

The error information is as follows:

could not import syscall/js (cannot find package "syscall/js" in any of 
	E:\Go\src\syscall\js (from $GOROOT)
	F:\go\Gopath\src\syscall\js (from $GOPATH))
error while importing syscall/js: build constraints exclude all Go files in E:\Go\src\syscall\js

The solution is as follows:

> Open setting and enter go tools env



Open settings.JSON file, write in the file:

{
  "go.toolsEnvVars": {
    "GOOS":"js",
    "GOARCH":"wasm"
  }
}

Then reopen vscode.

This entry was posted in Error and tagged Vscode error, webassembly on
2022-01-31 by Robins.


PYTHON USE SQLALCHEMY ERROR: PYMSSQL.PROGRAMMINGERROR: (102, B“INCORRECT SYNTAX
NEAR ‘(‘.DB-LIB ERROR

As shown below, use create in Sqlalchemy_ Engine creates a database connection;

conn = create_engine('mssql+pymssql://' + dbuser + ':' + dbpassword + '@' + dbhost + '/' + database)

Then through pandas’ to_SQL method to the database,

df = pd.read_csv(filename, sep='|', header=0, quoting=3)

df.to_sql(name=filename + ty, con=conn, if_exists='replace', index=True)

Result error:

Traceback (most recent call last):
  File "src\pymssql.pyx", line 450, in pymssql.Cursor.execute
  File "src\_mssql.pyx", line 1064, in _mssql.MSSQLConnection.execute_query
  File "src\_mssql.pyx", line 1095, in _mssql.MSSQLConnection.execute_query
  File "src\_mssql.pyx", line 1228, in _mssql.MSSQLConnection.format_and_run_query
  File "src\_mssql.pyx", line 1639, in _mssql.check_cancel_and_raise
  File "src\_mssql.pyx", line 1683, in _mssql.maybe_raise_MSSQLDatabaseException
_mssql.MSSQLDatabaseException: (102, b"Incorrect syntax near '('.DB-Lib error message 20018, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\n")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

Supplementary error reporting exception information:

Traceback (most recent call last):
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\engine\base.py", line 1264, in _execute_context
    cursor, statement, parameters, context
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\engine\default.py", line 587, in do_executemany
    cursor.executemany(statement, parameters)
  File "src\pymssql.pyx", line 476, in pymssql.Cursor.executemany
  File "src\pymssql.pyx", line 465, in pymssql.Cursor.execute
pymssql.ProgrammingError: (102, b"Incorrect syntax near '('.DB-Lib error message 20018, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\n")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pandas\io\sql.py", line 948, in run_transaction
    yield tx
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pandas\io\sql.py", line 641, in insert
    self._execute_insert(conn, keys, chunk_iter)
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pandas\io\sql.py", line 616, in _execute_insert
    conn.execute(self.insert_statement(), data)
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\engine\base.py", line 1020, in execute
    return meth(self, multiparams, params)
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\sql\elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\engine\base.py", line 1139, in _execute_clauseelement
    distilled_params,
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\engine\base.py", line 1324, in _execute_context
    e, statement, parameters, cursor, context
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\engine\base.py", line 1518, in _handle_dbapi_exception
    sqlalchemy_exception, with_traceback=exc_info[2], from_=e
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\util\compat.py", line 178, in raise_
    raise exception
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\engine\base.py", line 1264, in _execute_context
    cursor, statement, parameters, context
  File "C:\Users\****\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\engine\default.py", line 587, in do_executemany
    cursor.executemany(statement, parameters)
  File "src\pymssql.pyx", line 476, in pymssql.Cursor.executemany
  File "src\pymssql.pyx", line 465, in pymssql.Cursor.execute
sqlalchemy.exc.ProgrammingError: (pymssql.ProgrammingError) (102, b"Incorrect syntax near '('.DB-Lib error message 20018, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\n")

Mainly look at this line, which literally means [syntax error near ‘(‘):

_mssql.MSSQLDatabaseException: (102, b"Incorrect syntax near '('.DB-Lib error message 20018, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\n")

Generally, we will first check whether the SQL is correct (or whether there are
‘special characters’ in the data), but strangely

When this program runs locally, it reads the same file and imports the same
database table. Everything is normal!

At this time, it is suspected that the running environment on the local and
remote servers is inconsistent, and the inspection found that it was not
surprising; The version of Sqlalchemy on the remote is rather old, only 0.23.0



So I decided to upgrade and run again. Everything was normal~

This entry was posted in Python and tagged database, python on 2022-01-31 by
Robins.


NACOS START ERROR: ERROR CREATING BEAN WITH NAME ‘GRPCCLUSTERSERVER’

Today, I installed Nacos locally and reported the error creating bean with name
‘grpcclusterserver’ at startup. When I went to search for the cause of the
error, I saw that a blogger said it would be better to try several more times. I
didn’t know the specific reason, so I shut down and restarted directly and
started again successfully
screenshot of error reporting:

screenshot of success:


This entry was posted in Error and tagged back-end, java on 2022-01-31 by
Robins.


[SOLVED] STREAM CONVERT LIST TO MAP ERROR: JAVA.LANG.ILLEGALSTATEEXCEPTION:
DUPLICATE KEY

I background

In many scenarios, the data of List needs to be transformed into the key-value pairs of Map scenarios to facilitate quick query data. For example: the need to query the corresponding person name details scenario according to the work number. There are two kinds of scenarios, the first one is to query the database once by each work number, which is obviously not reasonable because it is not good for DB pressure and connection. The second will be a collection of work number (need to consider the volume of data scenarios, Oracle supports a maximum of one thousand, mysql, although no online, but consider the performance and memory consumption need to consider the upper limit recommended 1000 below), the next is the second way to expand.

Translated with www.DeepL.com/Translator (free version)

II Development practice

List<User> userList = new ArrayList<>();

userList.add(User.builder().id(123).name("TEST123").build());

userList.add(User.builder().id(1231).name("TEST1231").build());

userList.add(User.builder().id(1232).name("TEST1232").build());

userList.add(User.builder().id(1233).name("TEST1233").build());

userList.add(User.builder().id(1234).name("TEST1234").build());

1.The stream implementation was not available before Java 1.8

Map<String, Long> idNameMap = new HashMap<String, Long>();

for(User user : userList ){

     idNameMap.put(user.getName(),  user.getId());

}

return idNameMap ;

2.Java 1.8 onwards supports stream implementation

return userList.stream().collect(Collectors.toMap(User::getName, User::getId);

III Existing problems

If you use the 2.1 way, the possible problems, if there are two data with the
same name in the data, it will report an error java.lang.IllegalStateException:
Duplicate key.

When using stream stream, it will not overwrite the data directly like the above
way, but will report an error. So it needs to be optimized as

return userList.stream().collect(Collectors.toMap(User::getName, User::getId , (entity1, entity2) -> entity1);

It can solve the problem of error reporting.

This entry was posted in JAVA and tagged development language, java, list, Pit,
study on 2022-01-31 by Robins.


[SOLVED] HIBERNATE ERROR: ROW WAS UPDATED OR DELETED BY ANOTHER TRANSACTION

Row was updated or deleted by another transaction (or unsaved-value mapping was
incorrect) Hibernate Error:

org.hibernate.StaleObjectStateException:Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)

Error reporting reason:

1. The current version is not consistent with the db database version, the data
is modified when the value of the form object in the version and the value of
the corresponding record in the database version is not consistent, which makes
the update method in the call, the version is not consistent with the reverse
error.
2. Two or more sessions have modified the same record

Encountering such an exception indicates that the object of the operation uses
an optimistic lock or the defined POJO defines the version field

Solution:

1. When submitting the form data, submit the version as well
2. First query the value of the version of the corresponding record in the
database and assign it to the entity object to be modified, and then execute the
update operation (after modifying the database data, the value of its version
will change, so at this time the update operation needs to obtain the latest
version value, assign it to the operation object, and then execute the update
operation)

This entry was posted in JAVA and tagged database, hibernate, java on 2022-01-31
by Robins.


ROS ERROR: WARNING: “DEPRECATED PIXEL FORMAT USED“

Error log

[swscaler @ 0x28dace0] deprecated pixel format used, make sure you did set range correctly

Reason for error reporting
The above error occurs when using the ROS usb_cam package to call the camera,
the error log is written clearly, that is, the video format used is deprecated.
The error format is mjpg, after changing it to yuyv, the problem is solved.

This entry was posted in Error and tagged Debug experience, ROS Error on
2022-01-31 by Robins.


POST NAVIGATION

← Older posts

Search for:


RECENT POSTS

 * [Solved] GBase 8a V95 Replace Node Error: single vc mode does not support
   ‘–freenode’
 * [Solved] IntelliJ IDEA Compile Groovy Error: GroovyRuntimeException: This
   script or class could not be run.
 * [Solved] hcitool Error: Set scan parameters failed: Operation not permitted
 * Virtual machine ping Command Error: ping name or service not known
 * MAC MYSQL Start Error: The server quit without updating PID


TAGS

 * & View
 * Android
 * Android studio
 * back-end
 * Big data
 * bug
 * c++
 * database
 * Deep learning
 * development language
 * docker
 * eclipse
 * error
 * front end
 * git
 * Hadoop
 * idea
 * intellectual idea
 * java
 * javascript
 * linux
 * maven
 * mybatis
 * mysql
 * node.js
 * Npm
 * OpenCV
 * OpenGL
 * Operation and maintenance
 * php
 * ProgrammerAH
 * python
 * pytorch
 * qt
 * report errors
 * solution
 * spring
 * spring boot
 * SQL
 * tensorflow
 * The database
 * tomcat
 * ubuntu
 * View.js
 * windows


Proudly powered by WordPress