instruction
stringlengths
0
30k
Get array as output in specific function
|google-sheets|google-apps-script|google-sheets-formula|
null
Recently I also faced same problm in MacOS File Listing Error > navigaten opertaion not permitted R studio so waht u have to do - open R studio - you may find RStudio next to apple icon Click over there - Then click on Service setting - Then Click on Accessibility and then - Click on Restore default Now when u open R studio again it will ask to all permission for folder etc - click allow
This is the simplest example I can think of. import vlc import time instance = vlc.Instance('--no-xlib --quiet --sub-source=marq') player = instance.media_player_new() media = instance.media_new("/home/rolf/BBB.ogv") player.set_media(media) player.video_set_marquee_int(0, 1) #Enable player.video_set_marquee_int(6, 48) # size in pixels player.video_set_marquee_int(4, 8) # position | bottom player.video_set_marquee_int(7, 0) # timeout #player.video_set_marquee_string(1, 'First marquee String') # using a fixed parameter player.video_set_marquee_string(vlc.VideoMarqueeOption.Text, 'First marquee String') # using the vlc function player.play() for iter in range(45): if iter == 15: player.video_set_marquee_string(1, "Marquee Changes") # new text if iter == 30: player.video_set_marquee_string(1, "Final Marquee Change") # new text time.sleep(0.5) > I get NameError: name 'VideoMarqueeOption' is not defined That is because `VideoMarqueeOption` is a function in vlc.py that converts a named option to a number. You will have a similar problem with `Position`. So either use the vlc function i.e. `vlc.VideoMarqueeOption` or a fixed parameter e.g. 1 At this point I dash your hopes and refer you to either the vlc documentation or vlc.py for a full list of the options and their number equivalents. :)
I am writing a game with python on a MAC PC and I am getting the following error: `libc++abi: terminating due to uncaught exception of type NSException` The [SnakeGame](https://github.com/GaiAshk/SnakeGame/tree/main) is written so the player can be able to run using [pygame](https://www.pygame.org/docs/) or [turtle](https://docs.python.org/3/library/turtle.html). The game is working just fine when running it with pygame, but when switching to turtle I get this error: ``` *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SDLApplication macOSVersion]: unrecognized selector sent to instance 0x15be965f0' *** First throw call stack: ( 0 CoreFoundation 0x000000018b930570 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000018b421eb4 objc_exception_throw + 60 2 CoreFoundation 0x000000018b9e212c -[NSObject(NSObject) __retain_OA] + 0 3 CoreFoundation 0x000000018b89a7d4 ___forwarding___ + 1572 4 CoreFoundation 0x000000018b89a0f0 _CF_forwarding_prep_0 + 96 5 libtk8.6.dylib 0x000000010f0d9788 GetRGBA + 48 6 libtk8.6.dylib 0x000000010f0d9258 SetCGColorComponents + 144 7 libtk8.6.dylib 0x000000010f0d95e8 TkpGetColor + 344 8 libtk8.6.dylib 0x000000010f03b508 Tk_GetColor + 220 9 libtk8.6.dylib 0x000000010f02eb90 Tk_Get3DBorder + 204 10 libtk8.6.dylib 0x000000010f02e9a0 Tk_Alloc3DBorderFromObj + 144 11 libtk8.6.dylib 0x000000010f03c8b4 DoObjConfig + 832 12 libtk8.6.dylib 0x000000010f03c470 Tk_InitOptions + 348 13 libtk8.6.dylib 0x000000010f03c36c Tk_InitOptions + 88 14 libtk8.6.dylib 0x000000010f063e30 CreateFrame + 1432 15 libtk8.6.dylib 0x000000010f064128 TkListCreateFrame + 156 16 libtk8.6.dylib 0x000000010f05d0bc Initialize + 1848 17 _tkinter.cpython-311-darwin.so 0x000000010eeaa34c Tcl_AppInit + 80 18 _tkinter.cpython-311-darwin.so 0x000000010eea48a4 Tkapp_New + 592 19 _tkinter.cpython-311-darwin.so 0x000000010eea428c _tkinter_create + 608 20 libpython3.11.dylib 0x0000000100f0edcc cfunction_vectorcall_FASTCALL + 260 21 libpython3.11.dylib 0x0000000100ec4844 PyObject_Vectorcall + 80 22 libpython3.11.dylib 0x0000000100fa49e4 _PyEval_EvalFrameDefault + 33788 23 libpython3.11.dylib 0x0000000100f9c548 _PyEval_Vector + 200 24 libpython3.11.dylib 0x0000000100ec41c0 _PyObject_FastCallDictTstate + 272 25 libpython3.11.dylib 0x0000000100ec4f10 _PyObject_Call_Prepend + 160 26 libpython3.11.dylib 0x0000000100f3175c slot_tp_init + 188 27 libpython3.11.dylib 0x0000000100f27258 type_call + 424 28 libpython3.11.dylib 0x0000000100ec43a8 _PyObject_MakeTpCall + 344 29 libpython3.11.dylib 0x0000000100fa49e4 _PyEval_EvalFrameDefault + 33788 30 libpython3.11.dylib 0x0000000100f9c548 _PyEval_Vector + 200 31 libpython3.11.dylib 0x0000000100ec41c0 _PyObject_FastCallDictTstate + 272 32 libpython3.11.dylib 0x0000000100ec4f10 _PyObject_Call_Prepend + 160 33 libpython3.11.dylib 0x0000000100f3175c slot_tp_init + 188 34 libpython3.11.dylib 0x0000000100f27258 type_call + 424 35 libpython3.11.dylib 0x0000000100ec43a8 _PyObject_MakeTpCall + 344 36 libpython3.11.dylib 0x0000000100fa49e4 _PyEval_EvalFrameDefault + 33788 37 libpython3.11.dylib 0x0000000100f9c548 _PyEval_Vector + 200 38 libpython3.11.dylib 0x0000000100f97c1c builtin___build_class__ + 1148 39 libpython3.11.dylib 0x0000000100f0ee8c cfunction_vectorcall_FASTCALL_KEYWORDS + 160 40 libpython3.11.dylib 0x0000000100ec4844 PyObject_Vectorcall + 80 41 libpython3.11.dylib 0x0000000100fa49e4 _PyEval_EvalFrameDefault + 33788 42 libpython3.11.dylib 0x0000000100f9c418 PyEval_EvalCode + 272 43 libpython3.11.dylib 0x0000000100f98f50 builtin_exec + 916 44 libpython3.11.dylib 0x0000000100f0ee8c cfunction_vectorcall_FASTCALL_KEYWORDS + 160 45 libpython3.11.dylib 0x0000000100fa6504 _PyEval_EvalFrameDefault + 40732 46 libpython3.11.dylib 0x0000000100f9c548 _PyEval_Vector + 200 47 libpython3.11.dylib 0x0000000100ec5e90 object_vacall + 248 48 libpython3.11.dylib 0x0000000100ec5d00 PyObject_CallMethodObjArgs + 92 49 libpython3.11.dylib 0x0000000100fd4a14 PyImport_ImportModuleLevelObject + 1308 50 libpython3.11.dylib 0x0000000100fa1e14 _PyEval_EvalFrameDefault + 22572 51 libpython3.11.dylib 0x0000000100f9c418 PyEval_EvalCode + 272 52 libpython3.11.dylib 0x0000000100f98f50 builtin_exec + 916 53 libpython3.11.dylib 0x0000000100f0ee8c cfunction_vectorcall_FASTCALL_KEYWORDS + 160 54 libpython3.11.dylib 0x0000000100fa6504 _PyEval_EvalFrameDefault + 40732 55 libpython3.11.dylib 0x0000000100f9c548 _PyEval_Vector + 200 56 libpython3.11.dylib 0x0000000100ec5e90 object_vacall + 248 57 libpython3.11.dylib 0x0000000100ec5d00 PyObject_CallMethodObjArgs + 92 58 libpython3.11.dylib 0x0000000100fd4a14 PyImport_ImportModuleLevelObject + 1308 59 libpython3.11.dylib 0x0000000100fa1e14 _PyEval_EvalFrameDefault + 22572 60 libpython3.11.dylib 0x0000000100f9c418 PyEval_EvalCode + 272 61 libpython3.11.dylib 0x0000000100fef2c8 run_mod + 152 62 libpython3.11.dylib 0x0000000100fed7bc _PyRun_SimpleFileObject + 852 63 libpython3.11.dylib 0x0000000100fed244 _PyRun_AnyFileObject + 160 64 libpython3.11.dylib 0x000000010100cd0c Py_RunMain + 1848 65 libpython3.11.dylib 0x000000010100d0bc pymain_main + 324 66 libpython3.11.dylib 0x000000010100d15c Py_BytesMain + 40 67 dyld 0x000000018b45d0e0 start + 2360 ) libc++abi: terminating due to uncaught exception of type NSException Abort trap: 6 ``` I looked online a lot and saw similar errors for developers using swift.
I have tried so many solutions and all of them has some problems **Here is the best way to install GMP and eclipse** Follow this link http://www.multigesture.net/articles/how-to-install-mingw-msys-and-eclipse-on-windows/ You need to make sure of the following that hasn't been mentioned there: When installing MinGW choose a path that contains no space like "c:\MinGW" Once installed, From **start** open **MinGW installation manger** - choose all the basics -then under MinGW, choose all GMP libraries to be installed - Apply changes After that you will install JDK, then Add "C:\Program Files\Java\jdk1.8.0_121\bin" to PATH system variable After installing Eclipse go to: - GCC C++ compiler --> Miscellaneous add -lgmp -lgmpxx to the END of the line - MinGW C++ linker --> Libraries Add to the "Libraries (-l)" both gmp and gmpxx IN THAT ORDER
I'm trying to utilize PortAudio in a Unreal Engine 5 project. Just started learning to use this API. I encountered a weird problem when looking at the available devices. All device names are in chineese(?). I can't figure out why that is. How do I fix this? [![get device info results][1]][1] Don't know if this is useful info, but: I'm on Windows 11. My display language is English. My keyboard language is German. And those are the only language packs I have installed. [1]: https://i.stack.imgur.com/Ui9kT.png
PortAudio Device Names Language
|c++|unreal-engine5|portaudio|
Your question is probably opinion-based, as no one will be able to give you a definitive answer or a guarantee that the code you are using is going to be stable, even when requiring `@ExperimentalApi`. <br> I can only share my thoughts and experience. ----------------- At the current point, basically everything in Jetpack Compose [`material3`][1] libraries needs to be marked as [`@ExperimentalApi`][2]. However, while these APIs might change in the future, in my experience they are stable in a sense of having no bugs when you go with a stable release. <br> Check out which dependency version is considered as the latest stable in the respective dependency page. [![release table][3]][3] Also, it seems like the Jetpack Compose team is rather quickly using this annotation as sort of a safety precaution. Even components like [`BottomAppBar`][4] which API has been stable for a long time are still requiring an `@ExperimentalApi` annotation. So I would say, you can use it in production, but be aware that when you update the dependencies once in a while, it can be that you will have to rewrite some code. <br> I recently updated a project that I wrote two years ago, and it took two hours to refactor all the changed APIs. For me, this is acceptable. I'd suggest if you have doubt on using a specific experimental Composable, check out the [Google Issue Tracker][5] and search for that Composable. This will give you a quick hint whether there are many or severe bugs occuring with that Composable. [1]: https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary [2]: https://developer.android.com/jetpack/compose/designsystems/material3#experimental-apis [3]: https://i.stack.imgur.com/hznNf.png [4]: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/AppBar.kt;drc=0cc02be72c56759955caf8f29d2e6ee6312d7931;l=395 [5]: https://issuetracker.google.com/issues
Module not Found error in streamlit about tensorflow
|tensorflow|streamlit|modulenotfounderror|
null
{"Voters":[{"Id":209103,"DisplayName":"Frank van Puffelen"},{"Id":807126,"DisplayName":"Doug Stevenson"},{"Id":5246885,"DisplayName":"Alex Mamo"}]}
I got a new Laravel project but it showing the following error and it is not letting me run it using php artisan serve I tried using composer self-update too but it is not working.... [1st image](https://i.stack.imgur.com/Tb9fK.png) [2nd image](https://i.stack.imgur.com/aKx3z.png) Please tell me how can I resolve it. I have tried changing the Php version in the .env file as well but it is not working either. Chat or Gemini have not been much of help either....
I'm having issues in setting up my laravel project
|php|laravel|frameworks|
null
{"Voters":[{"Id":2836621,"DisplayName":"Mark Setchell"},{"Id":1968182,"DisplayName":"Ulrich Eckhardt"},{"Id":2530121,"DisplayName":"L Tyrone"}]}
I am a Android application developer, I have implemented a chat feature in my app. I want to integrate the stickers/gifs available in the soft keyboard into my app's chat interface, similar to how WhatsApp and IMO handle it. Even if a user uses any soft keyboard like Gboard or Google AI Keyboard, apps like WhatsApp still allow users to add stickers from those keyboards to their chats. I want to implement similar functionality in my app. I need code to load stickers/gifs from the soft keyboard into an Imageview using android studio java language. Could you provide me with the code for this, or explain how to implement it? I have attached screenshots for reference. Attachment 1 - [![Showing soft keyboard stickers/gifs](https://i.stack.imgur.com/DhgJS.jpg)](https://i.stack.imgur.com/DhgJS.jpg) Attachment 2 - [![Clicking on a sticker then displaying it in the chat (Sticker shown in ImageView)](https://i.stack.imgur.com/gJPd0.jpg)](https://i.stack.imgur.com/gJPd0.jpg) I want code for this development or explain how to implement it?
How to laod softkeyboard sticker/gifs into imageview using android studio. like whatsapp,imo,etc
|java|android|android-softkeyboard|
null
```Authentication error: BrowserAuthError: user_cancelled: User cancelled the flow. at Br.s [as constructor] (msal-browser.min.js:2:4145) at new Br (msal-browser.min.js:2:67586) at Br.createUserCancelledError (msal-browser.min.js:2:66371) at msal-browser.min.js:2:86314 (anonymous) @ HomePage.jsx:70 HomePage.jsx:72 User cancelled the authentication flow.```
I have WPF window application, i am trying to pop up window and with that window doing some configuration. So the pop up window is showing properly in english language PC. but when i open the pop up in japanese language pc it is not showing properly. so i want to know the reason behind this. is WPF pop up has different default width limitation with different language PCs? OR something else? [Below is EN PC result](https://i.stack.imgur.com/dm3Sq.png) [Below is JA PC result](https://i.stack.imgur.com/sAiwv.png) basically I want to know the route cause. Thank You.. I Set pop up max with to some number it worked fine in both language PCs.
libc++abi: terminating due to uncaught exception of type NSException - python on MAC
|python|macos|pygame|python-turtle|
null
I think you missed adding the scaffold @override Widget build(BuildContext context) { return Scaffold( body: build_v3(context), ); }
I am new to Docker and trying to set up two containers for my spring boot app and mysql database. I can run the mysql container but the app container fails because it cannot connect to mysql due to Unknown host. This is my docker compose file ``` version: '3.9' services: app: image: my-custom-image container_name: spring-app build: context: . dockerfile: Dockerfile ports: - '8080:8080' networks: - 'local-network' depends_on: - mysqldb mysqldb: image: mysql:8.0.28-oracle container_name: mysqldb restart: always environment: MYSQL_DATABASE: 'mysql-db' MYSQL_USER: 'user' MYSQL_PASSWORD: 'password' MYSQL_ROOT_PASSWORD: 'password' networks: - 'local-network' ports: - '3306:3306' volumes: - case-mysql-data:/var/lib/case-mysqldb - ./mysql-db-dump.sql:/docker-entrypoint-initdb.d/mysql-db-dump.sql:ro volumes: case-mysql-data: networks: local-network: driver: bridge ``` Dockerfile for spring app ``` FROM maven:3.8.8-eclipse-temurin-17 AS Builder WORKDIR /app COPY pom.xml . COPY src ./src RUN mvn clean package FROM eclipse-temurin:17-jre WORKDIR /app COPY --from=Builder /app/target/*.jar /app/application.jar CMD ["java", "-jar", "application.jar"] ``` application.properties ``` spring.jpa.hibernate.ddl-auto=update spring.datasource.url=jdbc:mysql://mysqldb:3306/mysql-db spring.datasource.username=user spring.datasource.password=password spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver ``` When I build these with docker-compose up --build, mysql container works fine but spring container cannot connect to it giving the error: Caused by: java.net.UnknownHostException: mysqldb: Name or service not known. I know that there are similar questions but none of them solved my problem. I checked the networks and containers are running in the same network. I can also connect to mysql container through localhost when the spring app is running locally but it fails when I try to run it in the container and change the host name to my mysql service. I looked at several examples and tried changing the host name but nothing worked. Is there anything wrong with my setup? Any help is appreciated
How can I connect to my mysql container from spring boot (java.net.UnknownHostException)
|mysql|spring-boot|docker|
null
From an arm64 mac machine - Im trying to package an Electron-forge app that will work both on an arm64 and x64 architectures. I tried to use the @electron/universal npm package but couldt nake it run. Their docs arent great. From some reference i found i added this to my package.json "forge": { "packager": { "config": { "targetArch": "universal" } } } runing "npm run package" outputs only an arm64 version. any suggestions?
I am trying to make a measurement using the CAEN DT5742 16-channel digitizer using the library [CAENPy](https://github.com/SengerM/CAENpy/blob/main/CAENpy/CAENDigitizer.py) which is basically just a wrapper around the actual [CAENDigitizer](https://www.caen.it/products/caendigitizer-library/). My program scans an area with a laser using stepper motors and reads out the data coming from an analog readout board via the digitizer. It's been working more or less well, but I noticed that my program randomly becomes unresponsive and 2 processes (my program is multiprocessed) draw 100% CPU (single core). The code I use for acquiring data with the digitizer: ```python def read_and_save_events(self, max_num_events: int = 1): """Reads a specified number of events from the digitizer. Arguments --------- max_num_events: int, default 1 Number of events to read. Returns ------- nevts: int Number of events read. """ nevts: int = 0 data = [] retries = 0 while retries < MAX_RETRIES: retries += 1 try: with self.device: self.log.info("Reading %d events...", max_num_events) while nevts < max_num_events: time.sleep(0.05) waveforms = self.get_waveforms() current_nevts = len(waveforms) nevts += current_nevts data += waveforms self.log.info( "Read %d out of %d events...", nevts, max_num_events ) break except RuntimeError: self.log.error("Encountered error during read. Retrying...") self.hard_reset(self._device_id) self.close() self.device = CAEN_DT5742_Digitizer(self._device_id) self.init() time.sleep(RETRY_TIMEOUT) else: self.log.error("Too many retries, aborting read...") if self._save_path is None: self.log.warning("No save path specified, waveforms not saved!") return 0 # Disentangle data and save to file df = pd.DataFrame(data) timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S") data_file = os.path.join(self._save_path, f"waveforms_{timestamp}.h5") self.curr_savefile = data_file with pd.HDFStore(data_file, "w") as store: for channel in df.columns: channel_df = [] for eventid, event in enumerate(df[channel]): event_df = pd.DataFrame(event) for column in event_df.columns: col = pd.Series( event_df[column].values, name=f"{eventid}_{column.split()[0]}", ) channel_df.append(col) channel_df = pd.concat(channel_df, axis=1) store.put(channel, channel_df) ``` I profiled the program using `py-spy` and got the attached call stack for one of the heavy duty processes. So, apparently the problem is with the `_GetNumEvents` method from the library. My question: Can I even solve this bug? If not, how would I monitor my program to get out of this error state?
Python script becomes unresponsive at 100% CPU usage (single core)
WPF pop up is behaving differently in English language PC and Japanese language PC
|wpf|popup|
null
|angular|typescript|mixins|
can anyone help me how to differentiate between background color and text color of pdf document if background color and text color are same. Actually I need to set some static color to invisible text using pdfbox so that text which are invisible we can see. TextObjectInfo contains all text object information using PDFStreamEngine . ``` public class SimplePdfRegeneretor { private PDDocument _document; private PDResources _pageResource; private PDFTextObjectInfoExtraction _PDFTextObjectInfoExtraction; private List<List<TextObjectInfo>> _documentTextObjectInfo; private void RecreatePDF() throws IOException{ int _pageNo = 0; for (PDPage page : _document.getPages()) { List<TextObjectInfo> _pageTextObjectInfo = this._documentTextObjectInfo.get(_pageNo); try (PDPageContentStream contentStream = new PDPageContentStream(_document, page, AppendMode.APPEND, false)){ Integer _textObjInfoInx = 0 ; //contentStream.setNonStrokingColor(0,0,0,0); for(TextObjectInfo _textObjInfo : _pageTextObjectInfo){ Float _xmin = _textObjInfo.get_xyminmax().get(0); Float _ymin = _textObjInfo.get_xyminmax().get(1); putTextOnDocument(contentStream,_textObjInfo,_textObjInfo.TextFontObject,_xmin,_ymin,_textObjInfoInx); _textObjInfoInx++; } } _pageNo++; } _pageNo = 0; for (PDPage _page : _document.getPages()) { List<Object> newTokens = addTjStringtoContenStream(_page,_pageNo); PDStream newContents = new PDStream(_document); writeTokensToStream(newContents, newTokens); _page.setContents(newContents); System.out.println("Page TextObject Writting Completed.."+_pageNo); _pageNo++; } } private void putTextOnDocument(PDPageContentStream contentStream, TextObjectInfo _textObjInfo, PDFont font, Float horizontalPixel, Float verticalPixel, int TextObjectIndex) throws IOException { String _textobjstr = "TextObjectIndex-" + TextObjectIndex; Matrix _tm = _textObjInfo.textMatrixs.get(_textObjInfo.textMatrixs.size()-1); int fontSize = _textObjInfo.TextFontSize.intValue(); PDGraphicsState _GraphicsState = _textObjInfo.getGraphicsState(); PDTextState _TextState = _GraphicsState.getTextState(); contentStream.beginText(); contentStream.setNonStrokingColor(_GraphicsState.getNonStrokingColor()); contentStream.setStrokingColor(_GraphicsState.getStrokingColor()); contentStream.setRenderingMode(_TextState.getRenderingMode()); contentStream.setFont(font, fontSize); contentStream.setTextMatrix(_tm); contentStream.beginMarkedContent(COSName.getPDFName(_textobjstr)); contentStream.endMarkedContent(); contentStream.endText(); } private List<Object> addTjStringtoContenStream(PDContentStream contentStream, int _pgInx) throws IOException{ PDFStreamParser parser = new PDFStreamParser(contentStream); Object token = parser.parseNextToken(); List<Object> newTokens = new ArrayList<>(); List<TextObjectInfo> _pageTextObjInfo = this._documentTextObjectInfo.get(_pgInx); System.out.println("Len of _pageTextObjInfo: "+_pageTextObjInfo.size()); //newTokens.add(Operator.getOperator("q")); while (token != null) { if (token instanceof Operator) { Operator op = (Operator) token; String opName = op.getName(); if (OperatorName.BEGIN_MARKED_CONTENT.equals(opName)) { // remove the argument to this operator //System.out.println(newTokens.get(newTokens.size() - 1)); Integer _tjObjInx = Integer.parseInt(((COSName)newTokens.get(newTokens.size() - 1)).getName().replace("TextObjectIndex-", "")); TextObjectInfo _TextObjectInfo = _pageTextObjInfo.get(_tjObjInx); COSString _tjStr = _TextObjectInfo.TjString; newTokens.remove(newTokens.size() - 1); newTokens.add(_tjStr); newTokens.add(Operator.getOperator("Tj")); token = parser.parseNextToken(); continue; } else if (OperatorName.END_MARKED_CONTENT.equals(opName)) { token = parser.parseNextToken(); continue; } } newTokens.add(token); token = parser.parseNextToken(); } //newTokens.add(Operator.getOperator("Q")); return newTokens; } private static void writeTokensToStream(PDStream newContents, List<Object> newTokens) throws IOException { try (OutputStream out = newContents.createOutputStream(COSName.FLATE_DECODE)) { ContentStreamWriter writer = new ContentStreamWriter(out); writer.writeTokens(newTokens); } } } ``` this is background image [![enter image description here][1]][1] this is text having black color without background image [![enter image description here][2]][2] this image is combination of above both image from source document [![enter image description here][3]][3] and this image is from output document look like this [![enter image description here][4]][4] [1]: https://i.stack.imgur.com/uEFC1.png [2]: https://i.stack.imgur.com/HEySE.png [3]: https://i.stack.imgur.com/X9KBn.png [4]: https://i.stack.imgur.com/yrkuf.png
* `glPushMatrix()` just pushes the current matrix value onto the stack existing somewhere. * This is used to saving the current matrix value. * **This function does not cause any changes to the current matrix**. * `glPopMatrix()` pops the matrix value from top of the stack, and current matrix value is overwritten with this popped value. * This is used to loading the matrix value previously pushed. This is the all. They are useful to make local transformation. In your code, they surround: 1. local transformation for {Earth and Moon} only 2. local transformation for Moon only.
|ios|flutter|
null
I have a circle that follows my cursor. I was wondering if I can add an effect so when the circle hovers over the text it inverts only the text so you are able to see the text even when the white circle is on top of it. I have tried to make the text black when I hover over it using CSS but it wont work because the words are too big so the text out of the circle blend in with the background. <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> document.addEventListener('DOMContentLoaded', () => { const interBubble = document.getElementById('circle'); let curX = 0; let curY = 0; let tgX = 0; let tgY = 0; function move() { curX += (tgX - curX) / 10; curY += (tgY - curY) / 10; interBubble.style.transform = `translate(${Math.round(curX)}px, ${Math.round(curY)}px)`; requestAnimationFrame(() => { move(); }); } window.addEventListener('mousemove', (e) => { tgX = e.clientX; tgY = e.clientY; if (e.target.tagName === 'P' || e.target.tagName === 'A' || e.target.tagName === 'BUTTON' || e.target.parentNode.tagName === 'BUTTON') { interBubble.classList.add('big'); } else { interBubble.classList.remove('big'); } }); move(); }); <!-- language: lang-css --> Body { background-color: black; overflow: hidden; } div { position: relative; width: 100%; height: 100vh; display: flex; justify-content: center; align-items: center; z-index: 2; } p { color: white; font-size: 30px; } p:hover { color: black; } :root { --trans-bounce: cubic-bezier(.4,2.2,.6,1.0); --trans-time: .4s; } .mouseFollowCircle { width: 30px; height: 30px; border-radius: 999px; position: absolute; z-index: 1; top: -15px; left: -15px; box-shadow: 0 0 10px white; background-color: white; pointer-events: none; backdrop-filter: blur(2px); transition: width var(--trans-time) var(--trans-bounce), height var(--trans-time) var(--trans-bounce), border var(--trans-time) var(--trans-bounce), top var(--trans-time) var(--trans-bounce), left var(--trans-time) var(--trans-bounce), background-color var(--trans-time) var(--trans-bounce); } .mouseFollowCircle.big { width: 70px; height: 70px; border-radius: 999px; position: absolute; z-index: 1; top: -35px; left: -35px; box-shadow: 0 0 10px white; background-color: white; pointer-events: none; backdrop-filter: blur(2px); transition: width var(--trans-time) var(--trans-bounce), height var(--trans-time) var(--trans-bounce), border var(--trans-time) var(--trans-bounce), top var(--trans-time) var(--trans-bounce), left var(--trans-time) var(--trans-bounce), background-color var(--trans-time) var(--trans-bounce); } <!-- language: lang-html --> <div><p>Hello World</p></div> <section class="mouseFollowCircle" id="circle"></section> <!-- end snippet -->
|python|performance|serial-port|physics|cpu-usage|
null
Suggestions to consider for your my.cnf [mysqld] section. Zaki, General Log is NORMALLY not ON. Until actually needed and will be used, general_log=OFF When needed from MySQL Command Prompt, SET GLOBAL general_log=ON then when you have sufficient logging completed, usually less than one minute - unless you have a VERY LONG executing process, SET GLOBAL general_log=OFF to avoid filling you storage with information you will NEVER look at. Trust me a full storage device is NO FUN to deal with. Do you have a REAL good reason for setting innodb_page_size anything other than the default of 16384? Consider editing your my.cnf to get back to the default from 64K This has helped the few instances where they have attempted anything other than 16384 and been troubled with incidents out of nowhere. Additional suggestions will be provided after posting the additional information requested in a comment above.
**Is there a way to know if the camera is on?** There be no straight way for an Android app to detect if another app is using the camera. Android's security model prohibit one app from accessing the resources or monitoring the behavior of another app without explicit permission and appropriate APIs. While Android does provide APIs for accessing certain system information, such as the list of running processes or the usage statistics of other apps, these APIs have limitations and privacy considerations. They may not provide fine-grained information about whether a specific app be actively using the camera at any given moment. Furthermore, even if you could detect that another app be using the camera, accessing or interfering with its operation would likely be a violation of the Android platform's security principles and may lead to ur app being flagged as potentially harmful or intrusive. If have concerns about privacy or resource usage related to the camera, it be best to address them within your own app's functionality and not attempt to monitor or interfere with other apps' behavior. Additionally, if believe an app be misbehaving or violating user privacy, can report it to the appropriate platform or store for investigation. **Is there a way to disable the camera?** Disabling the camera programmatically on Android be not a straightforward task, especially considering Android's security model, which prioritizes user privacy and app sandboxing. System-level permissions be typically required to manipulate hardware features such as the camera, and such permissions be not available to third-party apps for security reasons. However, if you have control over the device's firmware or system settings (for example, if ye be developing a custom ROM or managing devices in an enterprise environment), may be able to disable the camera through device policies or modifications to the system software. Here be some potential approaches to consider: Device Administration: Device Administration APIs to enforce policies on Android devices, including disabling certain features such as the camera. However, this requires the app to be designated as a device administrator, and users must grant permission for these privileges. Custom ROMs: If developing custom firmware for Android devices (e.g., custom ROMs), you may be able to modify the system settings or firmware to disable the camera functionality. This approach requires advanced knowledge of Android system development and may not be feasible for all devices. Enterprise Device Management: In enterprise environments, mobile device management (MDM) solutions can be used to enforce policies on managed devices, including disabling certain hardware features like the camera. MDM solutions typically provide APIs or management consoles to configure device policies remotely. Rooting: Rooting an Android device provides superuser access, allowing for deeper system modifications. With root access, it may be possible to disable the camera through system-level changes. However, rooting voids device warranties and can compromise device security. It be important to note that disabling critical features like the camera can have significant implications for device functionality and user experience. Additionally, any modifications made to the system software should be done carefully to avoid unintended consequences or security vulnerabilities. As a general principle, apps developed for the Google Play Store should not attempt to disable or manipulate system features without user consent, as this violates Google's policies and may result in app removal or account suspension. Refrence link - https://stackoverflow.com/questions/15862621/how-to-check-if-camera-is-opened-by-any-application
Electron forge macOS app for x64 and arm64
|electron|electron-packager|electron-forge|
We are using firebase_messaging for notifications in our flutter app and to customise notification we are using awesome_notifications. The notification ontap flow is working fine in background or foreground state. The problem is in killed state, the callbacks are not working. used `@pragma('vm:entry-point')` also to awesome_notifications background state listeners. Also used `getInitialNotificationAction()` method in hope to get event there but its still not working. Weird part is that the same setup is working on another flutter project. Another observation is that when the firebase's background handler is called in killed state which also has `@pragma('vm:entry-point')`, our main method gets called and due to which `getInitialNotificationAction()` method is also gets called when app is killed. The callback to work fine in killed state.
Awesome notification on tap not working on killed state
|flutter|awesome-notifications|
null
I am using `differential_evolution` from `scipy` with `workers` to parallel the calculations. And I switch to `pytorch` from `numpy` to speed up the code. ``` from torch.multiprocessing import set_start_method,Pool if __name__ == '__main__': #device = get_device() device = torch.device('cpu') # testing with cpu num_workers=int(sys.argv[1]) set_start_method("spawn",force=True) pool=Pool(num_workers) results = differential_evolution(likelihood, seed=np.random.seed(0),workers=pool.map, callback=print_de, bounds=bounds, maxiter=1500, disp=True,recombination=0.1,mutation=(0.9,1), constraints=NonlinearConstraint(positive_definite, lb=0, ub=np.inf), popsize=25, polish=False ) ``` In my own laptop (m1 macbook) this works fine either using `torch.multiprocessing` or `multiprocessing` (simply set `workers=int(sys.argv[1])`). When I test this in HPC with 256 cores in 1 node, it slows down a lot. Using `torch.multiprocessing` is faster than `multiprocessing`, but still one iteration is much slower than when I don't do parallel. When I use `top`, I can see the correct number of `python` instances are running, but the cpu usage is more than 100%, some even with 1000% per `python`, can this be the problem? When I use `numpy` the cpu usage is almost 100%. How can I solve the problem?
|php|wordpress|
null
|python|macos|python-turtle|
It's often needed to patch and compile a HTML (in my case a SVG) returned from a backend. I used only the simplest version as ``` import {compile} from 'vue'; const component = compile(text); ``` But now I patch the source with DOM and inject other components inside it. For that I need to use `app.component()` to register all the injected components. That's bad obviously for several known reasons. Could we inject locally imported components? Like: ``` import Tooltip from 'Tooltip.vue'; import {compile} from 'vue'; const component = compile(text, {components:[Tooltip]}); ``` Definitely `compile` has an extensive set of options: https://github.com/vuejs/core/blob/fef2acb2049fce3407dff17fe8af1836b97dfd73/packages/compiler-core/src/options.ts But I can't find anything about injecting components. There are several ideas but need prolonged tries and errors like: 1. Compile as SFC and inject dependencies somehow 1. Provide components in `ctx` somehow on a render 1. Somehow do it with `defineComponent` But I can't figure a proper direction to follow, any help would be appreciated.
```python class Items(Base): tag_id = Column(Integer, ForeignKey(Tag.id, ondelete='CASCADE'), index=True) ... tag = relationship('Tag', back_populates='items') query = Select(Items) cursor = await db_session.execute(query) items = cursor.scalars().all() print(items[0].tag.id) # 123 ``` Why does it work without `joinedload`? When does the additional query for the second table occur?
SQLAlchemy[async] query without joinedload
|python|sqlalchemy|fastapi|
When using openpyxl one can call [coordinate_from_string][1] method to check if it properly returns column and row. def validate_cell(value=None, default=None): if not value: return default # validate provided string try: from openpyxl.utils.cell import coordinate_from_string column, row = coordinate_from_string(str(value).upper()) except: return default # validate values if not column or not row: return default return '%s%i' % (column, row) [1]: https://openpyxl.readthedocs.io/en/stable/api/openpyxl.utils.cell.html#openpyxl.utils.cell.coordinate_from_string
I had to use one of these, not 2 or more of them, make sure there is no duplication in your program.cs regarding these : - AddIdentity - AddIdentityCore - AddDefaultIdentity
What capabilities does a WordPress User need to create and use patterns?
I'm using Anaconda3-2024.02-1-Windows-x86_64 (yes, Windows 64) on windows 11, with python 3.11.7. I was trying to build an offline translator and i forgot what led to what... Eventually i was trying to install EasyNMT and it faild because of fasttext package. Then, I decided to install fasttext separately but failed and can't seem to know what the problem is. I am using pip on Anaconda Prompt to install almost all my packages. And I suffer from a weak internet connection. The code is below: (base) C:\Users\pc>pip install wheel Collecting fasttext Using cached fasttext-0.9.2.tar.gz (68 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [28 lines of output] C:\Users\pc\anaconda3\python.exe: No module named pip Traceback (most recent call last): File "<string>", line 38, in __init__ ModuleNotFoundError: No module named 'pybind11' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\pc\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() File "C:\Users\pc\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\pc\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\pc\AppData\Local\Temp\pip-build-env-31ahp4pz\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\pc\AppData\Local\Temp\pip-build-env-31ahp4pz\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires self.run_setup() File "C:\Users\pc\AppData\Local\Temp\pip-build-env-31ahp4pz\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\pc\AppData\Local\Temp\pip-build-env-31ahp4pz\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup exec(code, locals()) File "<string>", line 72, in <module> File "<string>", line 41, in __init__ RuntimeError: pybind11 install failed. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. I have just updated my MS Build Tools for Visual Studio because of another project. I tried to install pybind11 on it's own. and it was already downloaded I guess. pip install pybind11 Requirement already satisfied: pybind11 in c:\users\pc\anaconda3\lib\site-packages (2.11.1) So!!!! I don't know what to do...... HELP ME PLEASE!!
How to compile a Vue template with other components?
|vue.js|vuejs3|
I'm deleting your post because this seems like a programming-specific question, rather than a conversation starter. With more detail added, this may be better as a Question rather than a Discussions post. Please see [this page](https://stackoverflow.com/help/how-to-ask) for help on asking a question on Stack Overflow. If you are interested in starting a more general conversation about how to approach an issue or concept related to the topic of this collective, feel free to make another Discussion post. You can check the discussions guidelines at https://stackoverflow.com/help/discussions-guidelines
null
I have integrated Google sing in using **angularx-social-login** in angular 16 app, able to get the userInfo using this.authService.authState.subscribe((user) => { this.user = user; this.loggedIn = (user != null); }); but I need accessToken to pass to resource server and login pop up is prompting again if i try to retrieve access token using getAccessToken(): void { this.authService.getAccessToken(GoogleLoginProvider.PROVIDER_ID).then(accessToken => this.accessToken = accessToken); } Is there a way i can retrieve accessToken without 2 prompts for UserInfo and access token
angularx-social-login - GetAccessToken prompting sign in pop up again
|angular|angular-social-login|
null
null
null
null
What I am trying to achieve? ---------------------------- Use System.Text.Json in my VSTO Addin, which has worked recently but stopped to work when I upgraded RestSharp What is the problem? -------------------- 2 Exceptions while running the VSTO Plugin in Debug Mode in Outlook: First: FileNotFoundException: Die Datei oder Assembly "System.Text.Json, Version=8.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden. Second: FileNotFoundException: Die Datei oder Assembly "System.Text.Json, Version=7.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden. So in short: Neither version of System.Text.Json can be found. 8.0.0.2 and 7.0.0.2 My setup: -------- Visual Studio 2022 with latest updates. Project setting: [![enter image description here][1]][1] [![enter image description here][2]][2] And yes I realized that 7.0.2 != 7.0.0.2 This is how Nu Packages admin for the Project looks like when I hit: [![enter image description here][3]][3] [![enter image description here][4]][4] and yes I already tried to upgrade to 8.0.2 but this delivered the same result by: [![enter image description here][5]][5] still the same problem What I also already tried: --------------------- I changed my target framework and found the hint that changing the target framework may influence the installed packages (this is the link provided my VisualStudio 2022: https://learn.microsoft.com/en-us/nuget/consume-packages/reinstalling-and-updating-packages) . Thus I remove RestSharp and System.Text.Json. Then searched for RestSharp, found out that it in the current stable version 110.2.0 depends on at least .Net Framework 4.7.1. Thus I switched to .Net Tartgetframework 4.7.1 in my project setting like this: [![enter image description here][6]][6] Then added RestSharp. Which my itself installed System.Text.Json 7.0.2 [![enter image description here][7]][7] The exception still stays the same: Exception 1: FileLoadException: Die Datei oder Assembly "System.Text.Json, Version=8.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040) Exception 2: FileLoadException: Die Datei oder Assembly "System.Text.Json, Version=7.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040) At least it is a minor improvement as the error message changed from: File not found to The manifest definition of the assembly found does not match the assembly reference. (Exception from HRESULT: 0x80131040) What I still don't get is that RestSharp depends in 7.0.2 but the Exception tries to find 7.0.0.2. Please note **7.0.0.2 != 7.0.2** is it? So i investigated my Project csproj file: and found for RestSharp: <Reference Include="RestSharp, Version=110.2.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL"> <HintPath>..\packages\RestSharp.110.2.0\lib\net471\RestSharp.dll</HintPath> </Reference> and for System.Text.Json: <Reference Include="System.Text.Json, Version=7.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <HintPath>..\packages\System.Text.Json.7.0.2\lib\net462\System.Text.Json.dll</HintPath> </Reference> --> Question: Is that correct? I investigated whether there is the dll available: [![enter image description here][8]][8] The answer is yes? On stack overflow: https://stackoverflow.com/questions/75071943/could-not-load-file-or-assembly-system-text-json-version-4-0-1-0 --> Question What do I need to check this? https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Json/#dependencies-body-tab --> I use 4.8.1 [1]: https://i.stack.imgur.com/fyvfV.png [2]: https://i.stack.imgur.com/T7D31.png [3]: https://i.stack.imgur.com/uqvgX.png [4]: https://i.stack.imgur.com/fBU2V.png [5]: https://i.stack.imgur.com/LaqjC.png [6]: https://i.stack.imgur.com/aijDf.png [7]: https://i.stack.imgur.com/zoSVT.png [8]: https://i.stack.imgur.com/sQ3eq.png
File Not Found Exception for System.Text.Json (VSTO Addin). Upgrade of RestSharp?
`scanf` **returns** EOF ``` int main(){ char c; int result; while(1){ result = scanf("%c", &c); if(result == EOF) break; else{ c = toupper(c); printf("%c", c); } } return 0; } ``` You will not EOF until you type special keyboard key combination. - Linux: CTRL-D - Windows: CTRL-Z
New to go. This is currently my code: ``` client := http.Client{ Timeout: 10 * time.Millisecond, } resp, err := client.Get("http://google.com/") if err != nil { if os.IsTimeout(err) { fmt.Println("There was a timeout") } panic(err) } ``` This works, but os.IsTimeout writes: ``` // This function predates errors.Is, and the notion of whether an // error indicates a timeout can be ambiguous. For example, the Unix // error EWOULDBLOCK sometimes indicates a timeout and sometimes does not. // New code should use errors.Is with a value appropriate to the call // returning the error, such as os.ErrDeadlineExceeded. ``` ``` if errors.Is(err, os.ErrDeadlineExceeded) { fmt.Println("There was a timeout 2") } ``` Which doesn't work. I tried debugging, but there wasn't an easy way for me to see how to check for the specific error type. Coming from.NET I could directly see the exception type, and check for that, how do I go about this in the future?
fasttext Installation in anaconda
|python|pybind11|fasttext|
null
aspectRatioMode=Qt.KeepAspectRatio does not work as expected, or I am getting something wrong I am tring to open an image and resize it to fit my window, but I need to keep aspect ratio, what I've specified in aspectRatioMode=Qt.KeepAspectRatio, but in fact I get my image resized as it fills whole image_label.size() ``` def open_image(self, image_path): pixmap = QPixmap(image_path) if not pixmap.isNull(): scaled_pixmap = pixmap.scaled(self.image_label.size(), aspectRatioMode=Qt.KeepAspectRatio) self.image_label.setPixmap(scaled_pixmap) else: self.image_label.setText("Failed to load image") ```
QPixmap scaled aspect ratio is not keep
|python|python-3.x|qt|pyqt|
null
Note the difference: - `[1]` selects the second element of a series, equivalent to `.iloc[1]`. Since the series is a series of lists of substrings created with `.str.split()`, it results in a single **list** of substrings. - `.str[1]` selects the second string of a list of substrings, row-wise. It results in a **series** of substrings. ---- import pandas as pd strings = ['lorem^ipsum^dolor', 'sit^amet^consectetur', 'adipiscing^elit^sed', 'do^eiusmod^tempor'] df = pd.DataFrame({'strings': strings}) print('Dataframe:') print(df) # First syntax a_row_of_split = df['strings'].str.split('^')[1] print('\n' 'With [1]:') print(a_row_of_split) # What you did: # 1. Each string in df has been split, resulting in a series # 2. The second element (row) of the series has been selected # This was equivalent to # a_row_of_split = df['strings'].str.split('^').iloc[1] # Second syntax a_series = df['strings'].str.split('^').str[1] print('\n' 'With .str[1]') print(a_series) # What you did: # 1. Each string in df has been split, resulting in a series # 2. With str accessor, each second string was extracted row-wise ---- Dataframe: strings 0 lorem^ipsum^dolor 1 sit^amet^consectetur 2 adipiscing^elit^sed 3 do^eiusmod^tempor With [1]: ['sit', 'amet', 'consectetur'] With .str[1] 0 ipsum 1 amet 2 elit 3 eiusmod Name: strings, dtype: object
You cannot mock `String` with Mockito. It has nothing to do with it being `final`, as Mockito has been able to mock final classes since 2.0, and natively since 5.0. If you attempt it with the latest version, you get this `MockitoException`: > Cannot mock/spy class java.lang.String > Mockito cannot mock/spy because : > \- Cannot mock wrapper types, String.class or Class.class This is [by design][1]. > This is working as intended. You can't mock strings. Use a real string instead. [1]: https://github.com/mockito/mockito/issues/1734
I have a very simple Asp .Net API project where I am trying to add some trace logging. I need some help with Application Insights configuration for that logging. Right now its capturing ALL traces while in *appsettings.json* I have set the **Default** level to **Information**. I have this code in my *Program.cs* `services.AddApplicationInsightsTelemetry();` Followed by: `Trace.Listeners.Add(new Microsoft.ApplicationInsights.TraceListener.ApplicationInsightsTraceListener());` And the following in my *appsettings.json*: `"Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", }, "ApplicationInsights": { "LogLevel": { "Default": "Warning", "Microsoft": "Warning" } }` I am expecting that only traces with level *Information* or above should get logged to Application Insights however I am also seeing every thing getting logged to Application Insights. What do I need to do change the trace logging level globally?
How to check for http timout error in Go?
|go|http|error-handling|
null
|mysql|database|intersection|
**While k8s itself does not provide a specific API for file IO operations. Applications can communicate with PV in a standardized and scalable way due to its strong infrastructure for managing storage resources through PVs and PVCs.** So Persistent Volumes are the suggested method in this case, thus you are on the correct path for applications operating on K8s that require persistent storage for file IO. **As per official kubernetes doc on** [**Persistent volumes**][1] and **PVCs** : Pods consume node resources and PVCs consume PV resources. Pods can request specific levels of resources. Claims can request specific size and access modes. Pods use PVCs to define their storage requirements, which are then bound to PVs that are available. Kubernetes resources stand for persistent storage resources that the cluster has access to AWS EBS, GCP persistent disk, local storage, NFS and cloud storage providers are some of the technologies that can support PVs external storage. Choose the appropriate PV storage class based on your application performance capacity and cost requirements. As per **David Maze** suggestion, also try to avoid manually establishing StatefulSets or PersistentVolumeClaims and instead use an **external storage**. Perhaps a nice fit would be an object-storage system such as **MinIO** (or) a comparable cloud system like AWS S3). Keeping data in local files can cause issues if you wish to have several copies of a pod in the future. [1]: https://kubernetes.io/docs/concepts/storage/persistent-volumes/
The problem is that you have `print` statements *during* the reversal process. That reversal will temporarily create cycles, and if in that state you call `print`, which calls `__repr__`, you'll get into an infinite loop. The solution is to not call `print` with a *node* as argument while you reverse your list (as you already discovered), at least not when the list temporarily has a cycle. That temporary cycle is created when you do `head.next.next = head`, and is broken again when you do `head.next = None`. It might be a good idea to perform a tuple assignment, so that there is no more moment (in your Python code) where the list has this cycle: head.next.next, head.next = head, None