How to search through a jagged array Posted: 11 Sep 2021 08:36 AM PDT This code should search an array of decimals for elements that are in a specified range, and return the number of occurrences of the elements that matches the range criteria. The problem is that I am having trouble in accessing the jagged array, my code: public static int GetDecimalsCount(decimal[] arrayToSearch, decimal[][] ranges) { if (arrayToSearch is null) { throw new ArgumentNullException(nameof(arrayToSearch)); } else if (ranges is null) { throw new ArgumentNullException(nameof(ranges)); } else { int sum = 0; for (int i = 0; i < arrayToSearch.Length; i++) { for (int j = 0; j < ranges.Length; j++) { for (int n = 0; n < ranges[j].Length; n++) { if (arrayToSearch[i] >= ranges[n][j] && arrayToSearch[i] <= ranges[n][j + 1]) { sum++; } } } } return sum; } } The ranges are from lowest to highest so it will always be arrays of two decimals  |
How does one use a PIP installed package from GitHub in Command Prompt? Posted: 11 Sep 2021 08:36 AM PDT I am trying to use the NTS Radio downloader (https://github.com/everdrone/nts) that is available on GitHub. I have PIP installed all the requirements and the downloader itself. So now it's a matter of using the program to download these free radio shows. To the best of my knowledge, the author of the program mentions one would have to type "nts" on a line in the command prompt with a valid link and press enter for the program to work. In other words, the act of writing "nts" will execute or import the program for the user to enter whatever it is one wants. However, when I enter "nts" on the command prompt, I get the message that "nts" "is not recognized as an internal or external command, operable program or batch file." So my question is, what should I enter in the command prompt so that it recalls, imports, or executes the downloader before or in addition to writing "nts" so I can make use of it? Thank you!  |
NFT metadata not showing up on opensea Posted: 11 Sep 2021 08:35 AM PDT |
Using react API to print a question on screen not working Posted: 11 Sep 2021 08:35 AM PDT I'm new to using react and I'm trying to make an application that shows the user a question from this api: https://opentdb.com/api.php?amount=1 and after the user clicks the button it should show a new question. I keep getting invalid hook call and after trying to find the answer I just can't seem to find out why. Heres my code: function FetchQuestion(){ const [triviaq, setTriviaq] = React.useState([]); React.useEffect(() => { //fetch fetch('https://opentdb.com/api.php?amount=1') .then(response => response.json()) .then(data => { setTriviaq(data.results[0].question); }) .catch(err => console.error(err)) }, []); return( <div> Question: {triviaq} <button onClick={FetchQuestion}> Next Question </button> </div> ) } ReactDOM.render(<FetchQuestion/>, document.getElementById("root")) </script>```  |
Length issue in Python3 Posted: 11 Sep 2021 08:35 AM PDT I am taking an Ethical Hacking class, and my lab for the week is trying to crack passwords created by our professor. For this specific challenge, I used a 64 bit decoder to translate his string in his code, and have found the way to solve the problem. The issue is when I run the equation found in the code, I run into an error in Python. I'll attach an image for clarification. I do know that length is typically found using len() but I don't know how to use that in this context. The part giving me issues is the [chunk2.length-1]. Any help provided would be great, thank you guys.enter image description here  |
cstring requires library <bits/c++config.h> Posted: 11 Sep 2021 08:34 AM PDT right now i'm getting an error invalid conversion from 'char*' to 'char' [-fpermissive] i found a solution, strcpy in <cstring> but, i'm getting an error that <cstring> need a library called <bits/c++config.h> which i can't find in my /usr/include directory, neither can gcc (the compiler i'm using). can anyone help? or atleast with the char* to char conversion?  |
Insert values into column when the two corresponding column values are not there Posted: 11 Sep 2021 08:34 AM PDT I am creating a table with having user profiles associated with various events. Various variables of user profile change at various intervals ranging from daily to more than a year. Hence, once the user is associated with an event, his profile cannot change for that event. While Inserting the values into the table through a Select query I need to ensure that there is no more than one record for one user ID and Event ID. How can I achieve this in the best optimal way? Thank You in advance. e.g. | event_id | user_id | age | gender | | -------- | ------- | --- | ------ | | abc | 1 | 24 | M | | xyz | 5 | 31 | F | | xyz | 5 | 31 | F | | abc | 5 | 31 | F | In the above table, the event_id = xyz and user_id = 5 has been entered twice. I need to ensure that the these type of value do not get inserted again from the query that I am retreiving the data.  |
how we can optimize sql request to db to avoid extra information and decrease the time response in nested models? Posted: 11 Sep 2021 08:34 AM PDT We have 2 nested models: user and company.To find all users we send a request to sql database and in addition of users it also takes all company's information from database. this request takes long time and includes extra information that we don't need.we think getting this extra information from table of company is the reason that the response time is long. how we can optimize this request to avoid extra information and decrease the time response?  |
Disable gather_facts for a single host only Posted: 11 Sep 2021 08:34 AM PDT I am trying to share some variables between multiple hosts in a playbook, and am using the technique described in this stack overflow question. It works, however each run ansible complains that the dummy host (K8S_MASTER_CA_HASH) does not exist, so it can't gather facts about it. Is it possible to tell ansible not to gather facts for a single host in a play run against various hosts? I tried using 'localhost' as the dummy host to hold the variables, but then ansible complains it can't ssh to localhost. (Seems like wrong approach)  |
Datatables not showing data when searching is enabled Posted: 11 Sep 2021 08:34 AM PDT I've a DataTables which get all the data available from an AJAX call which returns this:  I'm not using serverSide option 'cause I'm returning all the data in the first loading, but here the strange behavior: if I disable searching , as this: let tablePrematch = $('#table-prematch').DataTable({ processing: true, serverSide: false, searching: false, deferRender: true, autoWidth: true, colReorder: true, pageLength: 100, dom: "<'row'<'col-sm-3'l><'col-sm-6 text-center'B><'col-sm-3'f>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>", The DataTables correctly display the data. If I set searching: true , then DataTables won't display the rows. This is weird 'cause the AJAX call actually returns the same response. I just need to enable the search bar to filter specific columns, what I did wrong?  |
How get count of value repeated in list at index position 1 in python Posted: 11 Sep 2021 08:34 AM PDT How to count number of values repeated in list at first position and do sum based on that My input : [[2, 1], [2, 1], [2, 1], [1, 2]] Note : my list will contain 2 OR 1 in first index[0] In above the 2 is repeated the maximum number of times so my sum should be like get its second value of all and do sum and display 2 , 1 -> 1 + 2 , 1 -> 1 + 2 , 1 -> 1 ---------------------- 2 , 3 So output would be : 2 , 3 How to achieve above output from given Input In my code not able to implement such logic cnt=0 m[0]=0 for m in my_list: if m[0] == 2 cnt+=1 v=m[1] print(m[0],v[1])  |
I want to make a list from the outcome of a function using lists as arguments Posted: 11 Sep 2021 08:34 AM PDT I'm trying to make a list by using other lists as arguments of a function. However, i can't seem to get the right syntax. This is my code: f1 = theta0 + theta1*(X1_train[:,0]) + theta2*(X2_train[:,0]),theta3*(X3_train[:,0]) The expected outcome would be a list of the same length of X1_train, X2_train and X3_train (which is the same for those 3). I expect to get a list of the outcomes of each element on the lists X1_train, X2_train and X3_train as arguments of the funcion. For example, if my lists where X1_train=[0,1] X2_train = [1,2] X3_train =[0,2] I'd expect a list of numbers like f1=[theta0+theta2, theta0+theta1+theta2+2*theta3] The thethas are random numbers. This lists are columns of a dataframe I converted into lists so I could do the function.  |
Is there any way to limit user resources in MongoDB? Posted: 11 Sep 2021 08:36 AM PDT Can I limit user resources in MongoDB ? Example of this limitation in MySQL is to limit queries per hour or connections per hour for a user.  |
Getting NaN instead of actual values when I divide two fields to get a new field Posted: 11 Sep 2021 08:35 AM PDT df3['Loss_Ratio'] = df2['Loss_Amount'] / df2['Annual_Premium'] Annual_Premium | Loss_Amount | Loss_Ratio | 424.710275 | 80.228807 | NaN | 415.552846 | 305.996641 | NaN | 263.447212 | 158.091151 | NaN | 446.322354 | 516.527543 | NaN |  |
Laravel forge server disconnected Posted: 11 Sep 2021 08:35 AM PDT We received the following error when connecting to the server: WHEN CONNECTING AS "root" USER: with Digitalocean droplet Error Output Server Disconnected We had trouble connecting to your server. Typically, this means there is a problem with the SSH keys on the server. Or, your server may be prompting for a password when Forge attempts to SSH in as the root user. Recently reset the root password? If you have recently reset your root password via the DigitalOcean control card, this will break Forge's access to your server. You must SSH into your server and set a new password for the root user. We received the following error when connecting to the server: WHEN CONNECTING AS "root" USER: Please make sure that the following SSH key is placed in both the /home/forge/.ssh/authorized_keys file and the /root/.ssh/authorized_keys file on your server.  |
TypeScript - Map key type with value type in function sig based on a type object Posted: 11 Sep 2021 08:34 AM PDT Imagine having a type mapping like this: type MyTypeMapping = { Key1: Type1; Key2: Type2; }; and a function like this: const getVal = (key: keyof MyTypeMapping) => { return getObjectFromStorage(key) } The expected return type of the function getVal needs follow from the provided key value. So, if key === Key1 , then the expected return type must be Type1 . And for a closely related question, imagine if there is a function: const setVal = (key: keyof MyTypeMapping, val: T) => { return setObjectInStorage(key, val) } How do you make the type of argument val dependent on the type of argument key ? So if key === Key2 , the the expected type of val must be Type2 .  |
How to remove the gray bulk on top of screen Posted: 11 Sep 2021 08:34 AM PDT I have created a React Native app with React Native CLI. The App.tsx has the following content: import React from "react"; import { StyleSheet, Text, } from "react-native"; import { SafeAreaView } from "react-native-safe-area-context"; const App = () => { return ( <SafeAreaView> <Text>Hello React</Text> </SafeAreaView> ); }; const styles = StyleSheet.create({ }); export default App; The app is very straightforward, it shows only Hello React . What does disturb me is the gray bulk on the top:  and I do not know, where it comes from. My virtual device:  React Native version 0.65. Could you please tell me, where the gray bulk comes from?  |
incorrect number of subscripts on a large matrix from loop for in R Posted: 11 Sep 2021 08:33 AM PDT I have this simple codes for matrix called rates and works well. thresholds <- c(1e-8,1e-7,1e-6,1e-5,1e-4,1e-3,1e-2,1e-1,1) rates = matrix(0,2,length(thresholds)) for (i in 1:length(thresholds)) { rates[1,i] = 1 rates[2,i] = 1 However, when I apply the same idea to a bigger data (matrix), somehow there is an error. thresholds <- c(1e-8,1e-7,1e-6,1e-5,1e-4,1e-3,1e-2,1e-1,1) rates = matrix(0,2,length(thresholds)) for (i in 1:length(thresholds)) { t = thresholds[i] prob_matrix = solution_matrix(prob_matrix, t) compare_true_est_sol = compare_solutions(synthetic_solution, prob_matrix) rates[1,i] = compare_true_est_sol["TP"]/(compare_true_est_sol["TP"]+compare_true_est_sol["FN"]) rates[2,i] = compare_true_est_sol["FP"]/(compare_true_est_sol["FP"]+compare_true_est_sol["TN"]) } return(rates) I attach the photo to see the matrix example. The solution_matrix() and compare_solutions() are the function you can ignore. The error is "Error in rates[2, i] <- compare_true_est_sol["FP"]/(compare_true_est_sol["FP"] + compare_true_est_sol["TN"]) : incorrect number of subscripts on matrix". Please anyone help why the error happened and how t solve it?  |
How can i invoke a flask endpoint directly from code without using requests Posted: 11 Sep 2021 08:36 AM PDT Hey everyone I was tasked a few days ago to create an API style application that listens over a TCP socket for some commands then return some responses mainly success/failures (i know it's dumb but it's the client request) since I have some validation/database stuff I thought of flask directly but I am still stuck on how I am going to invoke the specific endpoints in code directly. here is a small snippet on how I am imagining things would be from flask import Flask import threading data = 'foo' app = Flask(__name__) @app.route("/SomeCommand") def SomeCommand(): return { 'Some' : 'Response'} def flaskThread(): app.run() def TcpListenner(): # logic that listens over tcp socket then invoks the flask app # I was thinking about calling app.something() from here pass if __name__ == "__main__": flaskApp = threading.Thread(target=flaskThread) flaskApp.start() listenner = threading.Thread(target=TcpListenner) listenner.start() any help/ideas would be much appreciated, thank you  |
How can I regroup my two for in one with only a tiny difference between the two? Posted: 11 Sep 2021 08:34 AM PDT I have the following code with the only difference being the j and the I position in my list. Is there any way to make it better by writing a function or something like that because I can't quite figure it out? Thank you ! for i in range(dimension): for j in range(dimension - 4): k = 1 while k < 5 and gameboard[i][j+k] == gameboard[i][j]: k += 1 if k == 5: winner = gameboard[i][j] for i in range(dimension): for j in range(dimension - 4): k = 1 while k < 5 and gameboard[j+k][i] == gameboard[j][i]: k += 1 if k == 5: winner = gameboard[j][i]  |
I want to built my own AbstractModel with only tracking field functions of Mail.Thread in Odoo, is there any way to do it? Posted: 11 Sep 2021 08:34 AM PDT Below is the function which I want to use... But thing is, I dont want to inherit it and overide this method.. @tools.ormcache('self.env.uid', 'self.env.su') def _get_tracked_fields(self): """ Return the set of tracked fields names for the current model. """ fields = { name for name, field in self._fields.items() if getattr(field, 'tracking', None) or getattr(field, 'track_visibility', None) } return fields and set(self.fields_get(fields))  |
How to draw animated line from origin to destination in react-native mapbox? Posted: 11 Sep 2021 08:36 AM PDT |
Can we allocate any number of byte we want in c++ ? (allocate 6 bytes for example for a type) Posted: 11 Sep 2021 08:34 AM PDT I'm trying to make a program for chess and in most cases I would need only 4, 6 or 8(here I can use char) bytes. So can I create a type that use 4 bytes, or an array with 4 bytes per cases ? It would lead to an significant gain in memory (and in efficiency ?). Thanks all.  |
How to fixed Project Permission Denied problem for update draft grade and assigned grade of student submission Posted: 11 Sep 2021 08:36 AM PDT I want to update the draft grade and assigned grade from Google Classroom using API. I can update draft grade and assigned grade using the environment of Try this API cause I created a course manually where "associated with developer": true . Localhost Code: $client = getClient(); $service = new Google_Service_Classroom($client); $courseId = '328776504166'; $courseWorkId = '393728101130'; $id = 'Cg4IoeDCvNwJEIqWmOC6Cw'; $post_body = new Google_Service_Classroom_StudentSubmission(array( 'assignedGrade' => 10, 'draftGrade' => 90 )); $params = array( 'updateMask' => 'assignedGrade,draftGrade' ); $list = $service->courses_courseWork_studentSubmissions->patch($courseId, $courseWorkId, $id, $post_body,$params); But I can't update draft grade and assigned grade using localhost. PERMISSION_DENIED problem appear when I want to update the draft grade from localhost. Problem: Fatal error: Uncaught Google\Service\Exception: { "error": { "code": 403, "message": "@ProjectPermissionDenied The Developer Console project is not pe rmitted to make this request.", "errors": [ { "message": "@ProjectPermissionDenied The Developer Console project is no t permitted to make this request.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } } How to solve this problem?  |
Kivy app: How to compile zbar module with buildozer [closed] Posted: 11 Sep 2021 08:34 AM PDT Running into errors on compile with buildozer.(autoconf missing, gettext missing. I tried using pyzbar in the requirements but it's not enough. What am I missing to compile on android? Here is my py file and spec file. My Main.py and kv file are /home/Desktop/bcamp folder ubuntu21 from kivy.app import App from kivy.uix.screenmanager import ScreenManager, Screen import cv2 import numpy as np from pyzbar.pyzbar import decode class Main(Screen): pass class BarcodeView(Screen): def qr_scanner(self,*args): cap = cv2.VideoCapture(0) cap.set(3, 640) cap.set(4, 480) Cam_ON_OFF = True while Cam_ON_OFF: success, img = cap.read() # img = cv2.imread('1.png') # code = decode(img) for barcode in decode(img): myData = barcode.data.decode('utf-8') print(myData) self.barcode.text = myData pts = np.array([barcode.polygon], np.int32) pts = pts.reshape((-1, 1, 2)) cv2.polylines(img, [pts], True, (255, 0, 255), 5) cv2.imshow('frame', img) if cv2.waitKey(1) & 0xff == 27: break class CameraPreview(Screen): pass class WindowManager(ScreenManager): pass class test(App): def build(self): return if __name__ == '__main__': test().run() [app] ''' ** (str) Title of your application title = My Application (str) Package name package.name = myapp (list) Application requirements comma separated e.g. requirements = sqlite3,kivy requirements = python3==3.8.5, kivy==2.0.0, opencv,numpy,pillow, pyzbar,zbarsymbol, autoconf,libtool (str) Custom source folders for requirements Sets custom source for any requirements with recipes requirements.source.kivy = ../../kivy (list) Garden requirements #garden_requirements = (list) List of service to declare #services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY OSX Specific author = © Copyright Info (list) Permissions android.permissions = INTERNET,CAMERA (int) Target Android API, should be as high as possible. android.api = 30 (str) Android NDK directory (if empty, it will be automatically downloaded.) #android.ndk_path = (str) Android SDK directory (if empty, it will be automatically downloaded.) #android.sdk_path = (str) ANT directory (if empty, it will be automatically downloaded.) #android.ant_path = (bool) If True, then skip trying to update the Android sdk This can be useful to avoid excess Internet downloads or save time when an update is due and you just want to test/build your package android.skip_update = False (bool) If True, then automatically accept SDK license agreements. This is intended for automation only. If set to False, the default, you will be shown the license when first running buildozer. android.accept_sdk_license = False (str) Android entry point, default is ok for Kivy-based app #android.entrypoint = org.renpy.android.PythonActivity (str) Android app theme, default is ok for Kivy-based app android.apptheme = "@android:style/Theme.NoTitleBar" (list) Pattern to whitelist for the whole project #android.whitelist = (str) Path to a custom whitelist file #android.whitelist_src = (str) Path to a custom blacklist file #android.blacklist_src = (list) List of Java .jar files to add to the libs so that pyjnius can access their classes. Don't add jars that you do not need, since extra jars can slow down the build process. Allows wildcards matching, for example: OUYA-ODK/libs/*.jar #android.add_jars = foo.jar,bar.jar,path/to/more/*.jar (list) List of Java files to add to the android project (can be java or a directory containing the files) #android.add_src = (list) Android AAR archives to add (currently works only with sdl2_gradle bootstrap) #android.add_aars = (list) Gradle dependencies to add (currently works only with sdl2_gradle bootstrap) #android.gradle_dependencies = (list) add java compile options this can for example be necessary when importing certain java libraries using the 'android.gradle_dependencies' option android.add_compile_options = "sourceCompatibility = 1.8", "targetCompatibility = 1.8" (list) Gradle repositories to add {can be necessary for some android.gradle_dependencies} please enclose in double quotes e.g. android.gradle_repositories = "maven { url 'https://kotlin.bintray.com/ktor' }" #android.add_gradle_repositories = (list) packaging options to add can be necessary to solve conflicts in gradle_dependencies please enclose in double quotes e.g. android.add_packaging_options = "exclude 'META-INF/common.kotlin_module'", "exclude 'META-INF/*.kotlin_module'" #android.add_gradle_repositories = (list) Java classes to add as activities to the manifest. #android.add_activities = com.example.ExampleActivity (str) OUYA Console category. Should be one of GAME or APP If you leave this blank, OUYA support will not be enabled #android.ouya.category = GAME (str) Filename of OUYA Console icon. It must be a 732x412 png image. #android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png (str) XML file to include as an intent filters in tag #android.manifest.intent_filters = (str) launchMode to set for the main activity #android.manifest.launch_mode = standard (list) Android additional libraries to copy into libs/armeabi #android.add_libs_armeabi = libs/android/.so #android.add_libs_armeabi_v7a = libs/android-v7/.so #android.add_libs_arm64_v8a = libs/android-v8/.so #android.add_libs_x86 = libs/android-x86/.so #android.add_libs_mips = libs/android-mips/*.so (bool) Indicate whether the screen should stay on Don't forget to add the WAKE_LOCK permission if you set this to True #android.wakelock = False (list) Android application meta-data to set (key=value format) #android.meta_data = (list) Android library project to add (will be added in the project.properties automatically.) #android.library_references = (list) Android shared libraries which will be added to AndroidManifest.xml using tag #android.uses_library = (str) Android logcat filters to use android.logcat_filters = *:S python:D (bool) Copy library instead of making a libpymodules.so #android.copy_libs = 1 (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64 android.arch = armeabi-v7a (int) overrides automatic versionCode computation (used in build.gradle) this is not the same as app version and should only be edited if you know what you're doing android.numeric_version = 1 Python for android (p4a) specific (str) python-for-android fork to use, defaults to upstream (kivy) #p4a.fork = kivy (str) python-for-android branch to use, defaults to master #p4a.branch = master (str) python-for-android git clone directory (if empty, it will be automatically cloned from github) #p4a.source_dir = (str) The directory in which python-for-android should look for your own build recipes (if any) #p4a.local_recipes = (str) Filename to the hook for p4a #p4a.hook = (str) Bootstrap to use for android builds p4a.bootstrap = sdl2 (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask) #p4a.port = iOS specific (str) Path to a custom kivy-ios folder #ios.kivy_ios_dir = ../kivy-ios Alternately, specify the URL and branch of a git checkout: ios.kivy_ios_url = https://github.com/kivy/kivy-ios ios.kivy_ios_branch = master Another platform dependency: ios-deploy Uncomment to use a custom checkout #ios.ios_deploy_dir = ../ios_deploy (str) Name of the certificate to use for signing the debug version Get a list of available identities: buildozer ios list_identities #ios.codesign.debug = "iPhone Developer: ()" (str) Name of the certificate to use for signing the release version #ios.codesign.release = %(ios.codesign.debug)s '''  |
too many initializers MQL4 Posted: 11 Sep 2021 08:34 AM PDT When I compile the code, it tells me that too many initializers. This is the code string; I don't understand where the problem is: string op_str[5] = { "BUY","SELL","BUYLIMIT","SELLLIMIT","BUYSTOP","SELLSTOP"};  |
PIC SPI Beginner Problems (XC8 MCC) Posted: 11 Sep 2021 08:34 AM PDT I've recently got I2C working in no time with some MCC generated functions which are well documented in the .h file, however SPI gives me nothing and is causing me frustraions, not helped by the fact I'm new to these serial protocols. I'm simply trying to read a register on a MCP23S17, then write to it, then read it back again to verify it's changed. I'm not even sure I'm going about this the right way but I've included my code below with comments. For some reason I seem to need to add some dummy writes to get the first read to work, but only happens on the 2nd loop though. #include "mcc_generated_files/mcc.h" uint8_t receiveData; /* Data that will be received */ uint8_t OpCodeW = 0x40; uint8_t OpCodeR = 0x41; void main(void) { SYSTEM_Initialize(); INTERRUPT_GlobalInterruptEnable(); INTERRUPT_PeripheralInterruptEnable(); Reset1_GPIO_SetLow(); __delay_ms(200); Reset1_GPIO_SetHigh(); __delay_ms(200); printf("Initalised \r\n"); while (1) { SPI1_Open(SPI1_DEFAULT); CS1_GPIO_SetLow(); // Read IODIRA Register 0x00 SPI1_ExchangeByte(OpCodeR); // Address + Read SPI1_ExchangeByte(0x00); // ??? -- When I add this in it works 2nd loop -- ??? receiveData = SPI1_ExchangeByte(0x00); // Returns 0x00 1st loop, then 0xFF after ... // ... but only when duplicate sending of byte above ??? printf("Read IODIRA: 0x%02x \r\n", receiveData); // Try writing to IODIRA Register // Not sure what SPI1_WriteByte actually does! // I thought it might be the same as ExchangeByte but without anything returned // No idea! SPI1_WriteByte(OpCodeW); // Address + Write SPI1_WriteByte(0x00); // Register Addres IODIRA (Port A) SPI1_WriteByte(0xF0); // Data to be written // Read back changed IODIRA Register again - Same routine as above SPI1_ExchangeByte(OpCodeR); // Address + Read SPI1_ExchangeByte(0x00); // Same routine as above ... // ... but always prints 0x00 receiveData = SPI1_ExchangeByte(0x00); // Register Address, IODIRA (Port A) printf("Wrote to IODIRA and read back: 0x%02x \r\n", receiveData); printf(" ----- \r\n\n"); CS1_GPIO_SetHigh(); SPI1_Close(); __delay_ms(5000); } } The actual printed output looks like this: Initalised Read IODIRA: 0x00 // Should be 0xFF Wrote to IODIRA and read back: 0x00 // Should be 0xF0 ----- Read IODIRA: 0xff // This is right now! Wrote to IODIRA and read back: 0x00 // but this hasn't changed ----- Read IODIRA: 0xff Wrote to IODIRA and read back: 0x00 Read IODIRA: 0xff Wrote to IODIRA and read back: 0x00 - My main questions are am I approaching this the right way?
- Why do I need some dummy writes to get it working on the 2nd loops? - clearly wrong
- What's the difference between SPI1_ExchangeByte and SPI1_WriteByte.
- Is there some documentation or guide to using these functions I'm missing?!?!?
Any help greatly appreciated.  |
how to create csv for my output in R programming Posted: 11 Sep 2021 08:33 AM PDT library(pdftools) library(data.table) library(tabulizer) pdf_file <- "new.pdf" out2 <- extract_tables(pdf_file, pages = 89, output = "data.frame") out2 output:  Can someone help me how to change the output(out2) into CSV/Dataframe using R programing  |
org.springframework.dao.DataIntegrityViolationException: A different object with the same identifier value was already associated with the session Posted: 11 Sep 2021 08:35 AM PDT This method begin with Transaction @Transactional(propagation = Propagation.REQUIRED) public Account generateDirectCustomerAccountEntity(AccountReq source, Map<String, String> headers, String workflowId) { Account dbAccount = dCustomerModelToEntityMapper.map(source, headers); dbAccount = saveAccount(source, dbAccount, headers, workflowId); return dbAccount; } This is a mapper class where I create DB Account entity and map address and contacts . @Override @LogExecutionTime(log=true) public Account map(AccountReq accountReq, Map<String, String> headers) { logger.info("AccountModelToEntityMapper.mapDirectCustomer*****START"); Account dbAccount = new Account(); AccountCode accountCode = dbService.getAccountCodeForDirectCustomer(accountReq); String accountId = dbService.genarateAccountId(accountCode); logger.info("genarated AccountID for Direct Customer is={}", accountId); dbAccount.setAccountId(accountId); setAccountContact(dbAccount, accountReq, headers); setAddress(dbAccount, accountReq); dbAccount.setAccountType(accountCode.getCodeId()); return dbAccount; } When I dont call below method inside map, everything works fine. But when i call it I get the error described in the title. private void setAccountContact(Account dbAccount, AccountReq accountReq, Map<String, String> headers) { try { if (null != accountReq.getContacts() && !accountReq.getContacts().isEmpty()) { logger.info("setAccountContact accountReq.getContacts().size()={}", accountReq.getContacts().size()); List<String> emailList=new ArrayList<>(); for (ContactReq contact : accountReq.getContacts()) { String email = contact.getEmail(); logger.info("setAccountContact:"+email); if(emailList.contains(email)) { logger.error("ERROR={}", "same emailId sent in multiple contacts"); throw new AccountException(AccountConstant.INVALID_FIELDS, AccountConstant.INVALID_FIELDS_CODE); } emailList.add(email); Contact dbcontact = contactRepository.findByEmail(email); if (null == dbcontact) { dbcontact = new Contact(); dbcontact.setCreatedAt(dbAccount.getCreatedAt()); dbcontact.setCreatedBy(dbAccount.getCreatedBy()); dbcontact.setEmail(contact.getEmail()); dbcontact.setFirstName((contact.getFirstName())); dbcontact.setLastName((contact.getLastName())); dbcontact.setPhone(contact.getPhoneNumber()); dbcontact.setStatus(AccountConstant.STATUS_ACTIVE); logger.info("contactRepository={} {}", contactRepository,contact.getEmail()); try { dbcontact = contactRepository.save(dbcontact); } catch (Exception e) { logger.error("ERROR in updating contact table={}", e); throw new InternalServerException(AccountConstant.INTERNAL_SERVER_ERROR, AccountConstant.INTERNAL_SERVER_ERROR_CODE); } } AccountContact dbAccountContact = new AccountContact(); dbAccountContact.setCreatedAt(dbAccount.getCreatedAt()); dbAccountContact.setCreatedBy(dbAccount.getCreatedBy()); dbAccountContact.setStatus(AccountConstant.STATUS_ACTIVE); ContactRole contactRole = getContactRole(contact.getType()); if (null == contactRole) { logger.error("ERROR={}", "contact type is invalid"); throw new AccountException(AccountConstant.INVALID_FIELDS, AccountConstant.INVALID_FIELDS_CODE); } dbAccountContact.setContactRole(contactRole); dbAccountContact.setAccount(dbAccount); dbAccountContact.setContact(dbcontact); if (null != dbcontact.getAccountContact() && !dbcontact.getAccountContact().isEmpty()) { logger.error("dbcontact.getAccountContact() is not null, dbcontact.getAccountContact().size()={}", dbcontact.getAccountContact().size()); List<AccountContact> accountContactList = dbcontact.getAccountContact(); accountContactList.add(dbAccountContact); } else { logger.error("getAccountStatusHistory is null"); List<AccountContact> accountContactList = new ArrayList<>(); accountContactList.add(dbAccountContact); dbcontact.setAccountContact(accountContactList); } if (null != contact && AccountConstant.ADMIN_CONTACT_ROLE.equalsIgnoreCase(contact.getType())) { if (null != contact.getAdminId()) { dbService.saveExternalID(String.valueOf(dbcontact.getContactId()), contact.getAdminId(), headers, AccountConstant.STATUS_ACTIVE, CosConstants.ID_TYPE); } } } } } catch (Exception e) { logger.error("ERROR in setAccountContact to dbAccount contacts={},{}", accountReq.getContacts(), e); throw e; } } @LogExecutionTime(log = true) public Account saveDirectCustomerAccount(AccountReq source, Account dbAccount, Map<String, String> headers, String workflowId) { try { String statusCode=AccountConstant.INITIAL_STATUS_CODE; dbAccount = updateAccountStatusHistory(dbAccount, statusCode); } catch (Exception e) { logger.error("ERROR in updateAccountStatusHistory={}", e); throw new InternalServerException(AccountConstant.INTERNAL_SERVER_ERROR, AccountConstant.INTERNAL_SERVER_ERROR_CODE); } return dbAccount; } @LogExecutionTime(log = true) private Account updateAccountStatusHistory(Account dbAccount, String statusCode) { logger.info("updateAccountStatusHistory *****START"); AccountStatusHistory accountStatusHistory = new AccountStatusHistory(); accountStatusHistory.setAccount(dbAccount); accountStatusHistory.setCreatedAt(dbAccount.getCreatedAt()); accountStatusHistory.setCreatedBy(dbAccount.getCreatedBy()); try { updateAccountStatus(dbAccount, statusCode, accountStatusHistory); } catch (Exception e) { logger.error("ERROR updateAccountStatus e={}", e); } if (null != dbAccount.getAccountStatusHistory()) { logger.error("getAccountStatusHistory not null"); dbAccount.getAccountStatusHistory().add(accountStatusHistory); } else { logger.error("getAccountStatusHistory is null"); List<AccountStatusHistory> accountStatusHistoryList = new ArrayList<>(); accountStatusHistoryList.add(accountStatusHistory); dbAccount.setAccountStatusHistory(accountStatusHistoryList); } Account createdAccount = saveAccount(dbAccount); logger.debug("createdAccount.getAccountId()={}", createdAccount.getAccountId()); return createdAccount; } And the final method is public Account saveAccount(Account dbAccount) { try { Account createdAccount = accountRepository.save(dbAccount); logger.debug("createdAccount.getAccountId()={}", createdAccount.getAccountId()); return createdAccount; } catch (Exception e) { logger.error("ERROR in account creation={}", e); throw new InternalServerException(AccountConstant.INTERNAL_SERVER_ERROR, AccountConstant.INTERNAL_SERVER_ERROR_CODE); } } Exception stacktrace ERROR Throwable={}","stack_trace":"org.springframework.dao.DataIntegrityViolationException: A different object with the same identifier value was already associated with the session : [com.adobe.costheta.account.model.db.mysql.Account#1000000080]; nested exception is javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [com.adobe.costheta.account.model.db.mysql.Account#1000000080]\n\tat org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:400)\n\tat org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:256)\n\tat org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:537)\n\tat org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:746)\n\tat org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:714)\n\tat org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:534)\n\tat org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:305)\n\tat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)\n\tat com.adobe.costheta.service.DbService$$EnhancerBySpringCGLIB$$8d6d52b1.generateDirectCustomerAccountEntity()\n\tat com.adobe.costheta.service.DirectCustomerAccountServiceImpl.createDirectCustomerAccount(DirectCustomerAccountServiceImpl.java:158)\n\tat com.adobe.costheta.service.DirectCustomerAccountServiceImpl$$FastClassBySpringCGLIB$$27f4a473.invoke()\n\tat org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n\tat org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)\n\tat com.adobe.costheta.service.DirectCustomerAccountServiceImpl$$EnhancerBySpringCGLIB$$13af2ff1.createDirectCustomerAccount()\n\tat com.adobe.costheta.resource.AccountResource.createAccount(AccountResource.java:93)\n\tat com.adobe.costheta.resource.AccountResource$$FastClassBySpringCGLIB$$dd5cfc46.invoke()\n\tat org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n\tat org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)\n\tat com.adobe.asr.logging.aspect.ExecutionTimeAspect.logExecutionTime(ExecutionTimeAspect.java:83)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\n\tat org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)\n\tat org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)\n\tat org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)\n\tat org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)\n\tat com.adobe.costheta.resource.AccountResource$$EnhancerBySpringCGLIB$$d988334a.createAccount()\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\n\tat org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)\n\tat org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)\n\tat org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:893)\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:798)\n\tat org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)\n\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)\n\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)\n\tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)\n\tat org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:665)\n\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:750)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:97)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:88)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat com.adobe.asr.filter.AsrRequestResponseFilter.doFilterInternal(AsrRequestResponseFilter.java:88)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat com.adobe.asr.logging.http.servlet.AsrLoggingFilter.doFilter(AsrLoggingFilter.java:69)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat com.adobe.asr.filter.AsrRequestIdFilter.doFilterInternal(AsrRequestIdFilter.java:99)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat com.adobe.costheta.filters.ApiLoggingFilter.doFilter(ApiLoggingFilter.java:52)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat com.adobe.asr.exception.AsrExceptionFilter.doFilterInternal(AsrExceptionFilter.java:82)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat com.adobe.costheta.filters.MDCFilter.doFilter(MDCFilter.java:44)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:94)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:114)\n\tat org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:104)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)\n\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)\n\tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)\n\tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)\n\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639)\n\tat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tat java.base/java.lang.Thread.run(Thread.java:834)\nCaused by: javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [com.adobe.costheta.account.model.db.mysql.Account#1000000080]\n\tat org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:123)\n\tat org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)\n\tat org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)\n\tat org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1478)\n\tat org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:512)\n\tat org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3310)\n\tat org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2506)\n\tat org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:447)\n\tat org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:178)\n\tat org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$300(JdbcResourceLocalTransactionCoordinatorImpl.java:39)\n\tat org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:271)\n\tat org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:104)\n\tat org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:533)\n\t... 126 common frames omitted\n","requestId":"f5d17eccdfa90271","Content-Type":"application/json"}  |
Jump to a word in a command in Bash Posted: 11 Sep 2021 08:36 AM PDT Consider: ssh -i "key.pem" root@server.com Is there a quick way to jump to the beginning of "root" in such a Bash command in the terminal, without iterating over every word/character?  |
No comments:
Post a Comment