instruction
stringlengths
0
30k
|reactjs|node.js|docker|next.js|
To display the legend outside of the plot in matplotlib, you can use the bbox_to_anchor papameter along with the loc parameter of the legend function, here's how you can modify your code to achieve that: ``` df3.iloc[0:30].plot.area(alpha=0.4) plt.legend(loc='upper left', bbox_to_anchor=(1, 1)) plt.show() ```
You mean like this? var variableOfTypeByteArray []byte
I am trying to make a card animation where a card on the top of the deck would translate upwards when hovered. Unfortunately, it seems like my card flickers if I move my mouse horizontally over the bottom part of the card. I have made some tests and it seems to be related to the translate, as increasing the translate on hover will result in having a greater area accross the flickering happens. Sorry if I explained this bad, hopefully looking at the code will show what my issue is( simply mouse over the translated area after the translate has taken place and move your mouse vertically. You can also increase the translate to see the results). I would be looking for any suggestions regarding this and/ or any advice regarding my code. Thank you for your time and effort! ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Karte</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="container"> <div id="game"> <div id="deck"></div> <div id="hand"></div> </div> </div> <script src="script.js"></script> </body> </html> ``` ``` #deck { display: flex; justify-content: space-around; position: relative; } .card { height: 100px; width: 100px; background-color: red; position: absolute; border: 1px solid black; } #deck .card:last-child { transition: transform 0.3s ease; } #deck .card:last-child:hover { transform: translateY(-20px); } ``` ``` // grab elements let game = document.getElementById('game'); let deckEl = document.getElementById('deck'); let hand = document.getElementById('hand'); // global variables let arr = [{card: 1, text:"Attack"},{card: 2, text:"Attack"},{card: 3, text:"Attack"},{card: 4, text:"Shield"},{card: 5, text:"Shield"},{card: 6, text:"Shield"},{card: 7, text:"Parry"},{card: 8, text:"Parry"},{card: 9, text:"Parry"}]; let cardsInHand = []; // shuffling the deck with selected deck as argument function shuffleDeck(array) { let i = array.length; while(i--) { const i2 = Math.floor(Math.random()*i); [array[i], array[i2]] = [array[i2], array[i]]; } } // drawing cards with card number as argument function drawCards(cardAmount) { for(cardAmount; cardAmount > 0; cardAmount--) { cardsInHand.push(arr[arr.length-1]); arr.pop(); } } // generate deck element function generateDeck() { let cardOutline = 200; arr.forEach(card=> { let cardEl = document.createElement('div'); cardEl.classList.add('card'); cardOutline-=3; cardEl.style.top = cardOutline + "px"; console.log(cardEl.style.top); deckEl.appendChild(cardEl); }) } generateDeck(); shuffleDeck(arr); drawCards(3); ``` I tried increasing modifying the translate and position properties, as well as the top and transitions, however it doesn't make much of a difference. Here is the fiddle - https://jsfiddle.net/2hsg5bL4/
This is my code in my +page.server.js: export const actions = { default: async ({ request }) => { const data = await request.formData(); const ln = data.get('lastname'); ..... } }; export function load( ) { if (!db) throw error(404); return { todos : db.getTodos() } } My question: how do I use the actions object output variable for filtering what I get from db.getTodos() in the load function? I can implement the filter on the front-end in +page.svelte by using a bind:value on the variable, but I would rather filter on the server side.
Using `react-testing-library`: > To enable testing of workflows involving the clipboard, `userEvent.setup()` replaces `window.navigator.clipboard` with a stub. First, install `@testing-library/user-event` Secondly, import user event like so: `import userEvent from '@testing-library/user-event';` Then, for example: ``` test('copies all codes to clipboard when clicked', async () => { const user = userEvent.setup() render(<Success />); const copyButton = screen.getByTestId('test-copy-button'); await user.click(copyButton); // Read from the stub clipboard const clipboardText = await navigator.clipboard.readText(); expect(clipboardText).toBe('bla bla bla'); }) ```
There is quite a bit of confusing non-valida JavaScript in your code, here are relevant parts corrected: ```js // I don't know what you wanted to do with createReducer here but it seems you wanted to declare an initial state? const initialState = { form: [], status: null, }; export const formSlice = createSlice({ name: "form", initialState, reducers: {}, extraReducers: builder => { // instead of builder.getform(pending builder.addCase(getform.pending, (state) => { state.status = "pending"; }); // you can either do a semicolon here, or nothing, but not a comma // this is not an object definition, but a function body. }, }); ```
I created a custom HTML element that creates a new element from the following template: <template id="track"> <div class="record">Nothing yet</div> </template> Here the JS code that defines the custom element: class Track extends HTMLElement { constructor() { super(); this.template = document.getElementById("track"); this.clone = this.template.content.cloneNode(true); } connectedCallback() { this.append( this.clone ); } set record(html) { // Case 1: Works only for element 1 (before appending to the DOM) this.clone.querySelector('.record').innerHTML = html; // Case 2: Works only for element 2 (after appending to the DOM) //this.querySelector('.record').innerHTML = html; } } customElements.define('my-track', Track); Note the record property that changes the HTML content of the `<div>`. I would like to be able to update the element content whatever it has been attached or not the DOM. I can't write a code that works in both cases (before and after appending the custom element to the DOM). The following code only works in case 1: const el1 = document.createElement('my-track'); el1.record = "Bla<b>bla</b> #1"; document.body.append(el1); The following code only works in case 2 const el2 = document.createElement('my-track'); document.body.append(el2); el2.record = "Bla<b>bla</b> #2"; Of course, in the method `set record()`, I could check if the element has already been attached to the DOM and switch to case 1 or case 2 accordingly. But I feel this is not the right way to build custom elements. What is the best option to update element content in the method `set record()` whether or not the element has been attached to the DOM ? I create a JSFiddle here: https://jsfiddle.net/Alphonsio/gL8a239o/13/
I met same issue try ssl port https://192.168.1.227:54321 then allow exception or firefox setting -> certificate manager servers -> servers add exception site
I have two tables that look like this: Table `Person`: ``` id name --------- 1 Jason 2 Dave 3 Amy ... ``` Table `Points`: ``` id points ---------- 1 8 2 9 3 5 ... ``` I try to join the "name" column from the first table to the second one based on their ids. The expected outcome should look something like this: ``` id name points ----------------- 1 Jason 8 2 Dave 9 3 Amy 5 ... ``` My select query is: ``` SELECT id, CASE WHEN Person.id = Points.id THEN Person.name END AS name, Points.points FROM Person, Points; ``` The result I get is: ``` id name points ----------------- 1 Jason 8 2 NULL 9 3 NULL 5 ... ``` How can I modify it to get the desired output? Thanks in advance for your time and help
Instead of using Typescripts classes with methods in it, you must use Javascript objects. This means: Instead of using this: const track1 = new Track("7empest", "TOOL", "Fear Inoculum", new Date(2024, 3, 2), 60 * 3); You must use: const track1 = { title: "7empest", artist: "TOOL", album: "Fear Inoculum", releaseDate: new Date(2024, 3, 2), durationInSeconds: 60 * 3 }; Removing methods from your class (in this case Track) and leave only data fields will also work (meaning my first code snippet will also work).
{"OriginalQuestionIds":[65621789],"Voters":[{"Id":1491895,"DisplayName":"Barmar","BindingReason":{"GoldTagBadge":"python"}}]}
You are doing it very bad. `php artisan serve` is a [server for local development, not for production][1]. I will asume that you have nginx installed, and that you already configured .env file, databases and all other things for production. If not, please follow [this tutorial][2] First of all, you need to copy (or link) your project directory to /var/www - `# cp /path/toyour/project-directory /var/www/yourproject -r`. This command will copy your project. Also you can use `mv` for move or `ln -s` for link. - `# vim /etc/nginx/sites-available/yourproject` ```server { listen 80; listen [::]:80; server_name server_domain_or_IP; root /var/www/yourproject/public; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; index index.html index.htm index.php; charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } error_page 404 /index.php; location ~ \.php$ { # Please change your PHP version based on your setup. fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.(?!well-known).* { deny all; } } # Dont forget save it.``` - `# ln -s /etc/nginx/sites-available/yourproject /etc/nginx/sites-enabled/yourproject` With `# nginx -t` you can test your configuration. If is ok, you can reload service with `# nginx -s reload` Notes - Set your own PHP version - Set your own domain name - `#` in the commands, indicates that you need do it as root. After this configuration, you need set up the permissions: - `# chown -R www-data:www-data /var/www/yourproject/storage` - `# chown -R www-data:www-data /var/www/yourproject/bootstrap/cache` I tested the configuration and i having a error: I can see the error with `tail -f /var/log/nginx/error.log` [crit] 46660#46660: *3 connect() to unix:/var/run/php/php8.1-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: ::1, server: example.localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "example.localhost" The solution was: `# apt install php8.1-fpm -y && service nginx restart`. Tested on Ubuntu 22.04 with PHP 8.1. [1]: https://stackoverflow.com/questions/34978857/laravel-how-to-start-server-in-production [2]: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-laravel-with-nginx-on-ubuntu-20-04
{"OriginalQuestionIds":[156767],"Voters":[{"Id":3001761,"DisplayName":"jonrsharpe"},{"Id":1048572,"DisplayName":"Bergi","BindingReason":{"GoldTagBadge":"javascript"}}]}
|postgresql|pgadmin-4|pgbouncer|
I am trying to setup an android emulator for pentesting and, I am using the system-image `system-images;android-34;google_apis_playstore;x86_64`. Anytime I try to run Bybit on the emulator, it simply crashes. Here are the logs from logcat ```bash 03-30 17:25:39.576 732 766 V WindowManagerShell: Transition requested: android.os.BinderProxy@259b457 TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=24 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.bybit.app cmp=com.bybit.app/com.bybit.pro.MainActivity } baseActivity=ComponentInfo{com.bybit.app/com.bybit.pro.MainActivity} topActivity=ComponentInfo{com.bybit.app/com.bybit.pro.MainActivity} origActivity=null realActivity=ComponentInfo{com.bybit.app/com.bybit.pro.MainActivity} numActivities=1 lastActiveTime=1007203 supportsMultiWindow=true resizeMode=2 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@76e7b44} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=null topActivityInfo=ActivityInfo{e31642d com.bybit.pro.MainActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=false isVisible=false isVisibleRequested=false isSleeping=false topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= false topActivityLetterboxed= false isFromDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 locusId=null displayAreaFeatureId=1 cameraCompatControlState=hidden}, remoteTransition = null, displayChange = null } 03-30 17:25:39.577 524 2485 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.bybit.app cmp=com.bybit.app/com.bybit.pro.MainActivity} with LAUNCH_SINGLE_TOP from uid 1000 (BAL_ALLOW_ALLOWLISTED_UID) result code=0 03-30 17:25:39.613 524 2485 D CoreBackPreview: Window{aa89c0c u0 Splash Screen com.bybit.app}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@4af4c5b, mPriority=0, mIsAnimationCallback=false} 03-30 17:25:39.676 11642 11642 I com.bybit.app: Using CollectorTypeCC GC. 03-30 17:25:39.680 11642 11642 W com.bybit.app: Unexpected CPU variant for x86: x86_64. 03-30 17:25:39.680 11642 11642 W com.bybit.app: Known variants: atom, sandybridge, silvermont, goldmont, goldmont-plus, tremont, kabylake, default 03-30 17:25:39.736 524 548 V WindowManager: Sent Transition #41 createdAt=03-30 17:25:39.565 via request=TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=24 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.bybit.app cmp=com.bybit.app/com.bybit.pro.MainActivity } baseActivity=ComponentInfo{com.bybit.app/com.bybit.pro.MainActivity} topActivity=ComponentInfo{com.bybit.app/com.bybit.pro.MainActivity} origActivity=null realActivity=ComponentInfo{com.bybit.app/com.bybit.pro.MainActivity} numActivities=1 lastActiveTime=1007203 supportsMultiWindow=true resizeMode=2 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{RemoteToken{10c5337 Task{21b7c99 #24 type=standard A=10190:com.bybit.app}}} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=null topActivityInfo=ActivityInfo{72460a4 com.bybit.pro.MainActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=false isVisible=false isVisibleRequested=false isSleeping=false topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= false topActivityLetterboxed= false isFromDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 locusId=null displayAreaFeatureId=1 cameraCompatControlState=hidden}, remoteTransition = null, displayChange = null } 03-30 17:25:39.736 524 548 V WindowManager: info={id=41 t=OPEN f=0x0 trk=0 r=[0@Point(0, 0)] c=[{WCT{RemoteToken{10c5337 Task{21b7c99 #24 type=standard A=10190:com.bybit.app}}} m=OPEN f=NONE leash=Surface(name=Task=24)/@0xb4725d1 sb=Rect(0, 0 - 320, 640) eb=Rect(0, 0 - 320, 640) d=0},{WCT{RemoteToken{d59c3cd TaskFragment{506e1a4 mode=fullscreen}}} m=TO_BACK f=IN_TASK_WITH_EMBEDDED_ACTIVITY|FILLS_TASK p=WCT{RemoteToken{788222d Task{4f7d95a #22 type=standard A=1000:com.android.settings}}} leash=Surface(name=TaskFragment{506e1a4 mode=fullscreen})/@0x2bae2f7 sb=Rect(0, 0 - 320, 640) eb=Rect(0, 0 - 320, 640) d=0},{WCT{RemoteToken{788222d Task{4f7d95a #22 type=standard A=1000:com.android.settings}}} m=TO_BACK f=NONE leash=Surface(name=Task=22)/@0x176c257 sb=Rect(0, 0 - 320, 640) eb=Rect(0, 0 - 320, 640) d=0}]} 03-30 17:25:39.753 524 564 I ActivityManager: Start proc 11642:com.bybit.app/u0a190 for next-top-activity {com.bybit.app/com.bybit.pro.MainActivity} 03-30 17:25:39.950 11642 11642 E com.bybit.app: Not starting debugger since process cannot load the jdwp agent. 03-30 17:25:40.006 11642 11642 D nativeloader: Configuring clns-6 for other apk /system/framework/org.apache.http.legacy.jar. target_sdk_version=33, uses_libraries=ALL, library_path=/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/lib/arm64:/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/base.apk!/lib/arm64-v8a:/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.arm64_v8a.apk!/lib/arm64-v8a:/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.en.apk!/lib/arm64-v8a:/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.mdpi.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.bybit.app 03-30 17:25:40.030 11642 11642 W ziparchive: Unable to open '/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.arm64_v8a.dm': No such file or directory 03-30 17:25:40.030 11642 11642 W ziparchive: Unable to open '/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.arm64_v8a.dm': No such file or directory 03-30 17:25:40.031 11642 11642 W com.bybit.app: Entry not found 03-30 17:25:40.031 11642 11642 W ziparchive: Unable to open '/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.en.dm': No such file or directory 03-30 17:25:40.031 11642 11642 W ziparchive: Unable to open '/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.en.dm': No such file or directory 03-30 17:25:40.031 11642 11642 W com.bybit.app: Entry not found 03-30 17:25:40.032 11642 11642 W ziparchive: Unable to open '/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.mdpi.dm': No such file or directory 03-30 17:25:40.032 11642 11642 W ziparchive: Unable to open '/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.mdpi.dm': No such file or directory 03-30 17:25:40.032 11642 11642 W com.bybit.app: Entry not found 03-30 17:25:40.033 11642 11642 D nativeloader: Configuring clns-7 for other apk /data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/base.apk:/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.arm64_v8a.apk:/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.en.apk:/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.mdpi.apk. target_sdk_version=33, uses_libraries=, library_path=/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/lib/arm64:/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/base.apk!/lib/arm64-v8a:/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.arm64_v8a.apk!/lib/arm64-v8a:/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.en.apk!/lib/arm64-v8a:/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.mdpi.apk!/lib/arm64-v8a, permitted_path=/data:/mnt 03-30 17:25:40.057 11642 11642 E LoadedApk: java.lang.ClassNotFoundException: Didn't find class "androidx.core.app.CoreComponentFactory" on path: DexPathList[[zip file "/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/base.apk", zip file "/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.arm64_v8a.apk", zip file "/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.en.apk", zip file "/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.mdpi.apk"],nativeLibraryDirectories=[/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/lib/arm64, /data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/base.apk!/lib/arm64-v8a, /data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.arm64_v8a.apk!/lib/arm64-v8a, /data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.en.apk!/lib/arm64-v8a, /data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.mdpi.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]] 03-30 17:25:40.057 11642 11642 E LoadedApk: Suppressed: java.io.IOException: Failed to open dex files from /data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.arm64_v8a.apk because: Entry not found 03-30 17:25:40.057 11642 11642 E LoadedApk: Suppressed: java.io.IOException: Failed to open dex files from /data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.en.apk because: Entry not found 03-30 17:25:40.058 11642 11642 E LoadedApk: Suppressed: java.io.IOException: Failed to open dex files from /data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/split_config.mdpi.apk because: Entry not found 03-30 17:25:40.081 11642 11642 V GraphicsEnvironment: ANGLE GameManagerService for com.bybit.app: false 03-30 17:25:40.082 11642 11642 V GraphicsEnvironment: com.bybit.app is not listed in per-application setting 03-30 17:25:40.100 11642 11642 E AndroidRuntime: Process: com.bybit.app, PID: 11642 03-30 17:25:40.100 11642 11642 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/~~oUb8_Qsrt3VQNZpsyjkzMw==/com.bybit.app-4iQh-nGpzVBSYi2bjB9BJA==/lib/arm64/libDexHelper-x86.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183) 03-30 17:25:40.113 524 1455 W ActivityTaskManager: Force finishing activity com.bybit.app/com.bybit.pro.MainActivity 03-30 17:25:40.151 524 1455 I ActivityManager: Process com.bybit.app (pid 11642) has died: fg TOP 03-30 17:25:40.227 524 548 V WindowManager: info={id=42 t=CLOSE f=0x10 trk=0 r=[0@Point(0, 0)] c=[{WCT{RemoteToken{d59c3cd TaskFragment{506e1a4 mode=fullscreen}}} m=TO_FRONT f=IN_TASK_WITH_EMBEDDED_ACTIVITY|FILLS_TASK p=WCT{RemoteToken{788222d Task{4f7d95a #22 type=standard A=1000:com.android.settings}}} leash=Surface(name=TaskFragment{506e1a4 mode=fullscreen})/@0x2bae2f7 sb=Rect(0, 0 - 320, 640) eb=Rect(0, 0 - 320, 640) d=0},{WCT{RemoteToken{788222d Task{4f7d95a #22 type=standard A=1000:com.android.settings}}} m=TO_FRONT f=MOVE_TO_TOP leash=Surface(name=Task=22)/@0x176c257 sb=Rect(0, 0 - 320, 640) eb=Rect(0, 0 - 320, 640) d=0},{WCT{RemoteToken{10c5337 Task{21b7c99 #24 type=standard A=10190:com.bybit.app}}} m=CLOSE f=NONE leash=Surface(name=Task=24)/@0xb4725d1 sb=Rect(0, 0 - 320, 640) eb=Rect(0, 0 - 320, 640) d=0}]} 03-30 17:25:40.274 524 596 W InputManager-JNI: Input channel object 'aa89c0c Splash Screen com.bybit.app (client)' was disposed without first being removed with the input manager! 03-30 17:25:40.617 524 551 W ActivityTaskManager: Activity top resumed state loss timeout for ActivityRecord{54141e0 u0 com.bybit.app/com.bybit.pro.MainActivity t24 f} isExiting} ``` Also I run this app just fine on my device. Please what is wrong and How can I prevent the crashing? I tried changing emulator with different system image, I got the same result. I tried the system images ` system-images;android-33;google_apis_playstore;x86_64` and ` system-images;android-32;google_apis_playstore;x86_64`
How to prevent app from crashing on android emulator
|java|android|operating-system|emulation|android-virtual-device|
null
This is what I did it with Bootstrap 4. The span allows the tool tip to be clear, instead of using a button. <span data-toggle="tooltip" data-placement="top" title="The text of the tooltip goes here"> --- SVG element goes here --- </span> I had to activate all the tooltips in the page by addig this jquery code: $(function () { $('[data-toggle="tooltip"]').tooltip() })
{"Voters":[{"Id":22192445,"DisplayName":"taller"},{"Id":8422953,"DisplayName":"braX"},{"Id":8162520,"DisplayName":"Mayukh Bhattacharya"}]}
I'm using MediaRecorder to record audio files , i have set up the necessary code to do , the code works fine until i press stop recording right after an exception is thrown crashing the application don't know exactly what is the issue ! i'd be happy to get some help from you guys and thank you ``` override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) setContentView(binding.root) binding.sendIcon.setOnClickListener { startRecording() } binding.recordingIcon.setOnClickListener { stopRecording() } } private fun startRecording() { if (mediaRecorder == null){ mediaRecorder = MediaRecorder() mediaRecorder!!.setAudioSource(MediaRecorder.AudioSource.MIC) mediaRecorder!!.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP) mediaRecorder!!.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB) mediaRecorder!!.setAudioSamplingRate(16000) mediaRecorder!!.setOutputFile(getOutputFilePath()) try { mediaRecorder!!.prepare() mediaRecorder!!.start() } catch (e: Exception) { Log.d("TAG","Recording Exception " + e.localizedMessage) } } } private fun stopRecording() { if (mediaRecorder != null){ mediaRecorder?.stop() mediaRecorder?.release() } } private fun getOutputFilePath(): String { val recordingID = "Recording_" + System.currentTimeMillis() val directory = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q){ applicationContext.getExternalFilesDir(Environment.DIRECTORY_MUSIC) } else { Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC) } return directory?.absolutePath + "/AudioRecording/" + recordingID + ".3gp" } ```
MediaRecorder.stop() thorwing illegalException
I inherited an ESP-32 firmware project based on AmazonFreeRTOS. I know how to build it but I'm not extremely familiar with this kind of programming. The other developer never created a signing key intended for production, but there is a "developkey.pem" file in with the source code. Unfortunately the company has already distributed units of the project built with this key. I need to validate that we can perform OTA updates. Whenever I try to send such an update, the device receives it but won't install it. The error says "Signature verification failed". In my source code there are two build scripts, one that is supposed to build a signed version and one unsigned. Initially I was building the signed version and sending that. Later I tried building the unsigned version and signing it with the AWS signer using a code signing certificate (one that is unrelated to the rest of the project). Both things failed. I know that the failure occurs in a function called "CRYPTO_SignatureVerificationFinal" but I don't know why. I'm probably missing some fundamental concept here. Does a new build need to be code signed with the same certificate as the old build, or does it just require a valid code signature? Is the failure message even due to the code signing or is it objecting to something else? Does a build even need to be signed in order to be delivered this way? It's possible that the 'developkey.pem' file I have is not the same one that was used to make the build that ended up on the units. However, I have been able to take one of my updated builds and load it onto the device through the serial port, which I think means that the signature is good, otherwise the secure bootloader wouldn't accept it (I might be wrong about how this works though). Thanks for your help.
Amazon IoT OTA update Signature verification failed
|aws-iot|freertos|
I want to create a new Laravel project using Composer. I have installed Composer and successfully ran the command `composer global require laravel/installer`. However, when I tried to run `laravel new <project-name>`, I encountered an error: > A connection timeout was encountered. If you intend to run Composer > without connecting to the internet, run the command again prefixed > with COMPOSER_DISABLE_NETWORK=1 to make Composer run in offline mode. I verified that my internet connection was functioning properly. I deleted the files created by the command and tried again, but the same error occurred. I noticed that the process "Downloading laravel/pint (v1.15.0)" does not complete and results in the same error. I then ran the commands `composer clear-cache` and `composer install` in the project directory (which contains the created files), but these actions did not resolve the issue.
Laravel installation via Composer results in connection timeout error
Go to your app-routing.module.ts and ensure your routes matches the login component. you can use this as a guide ... ... imports const routes: Routes = [ { path: '', pathMatch: 'full', component: YourWelcomeComponent // Whatever component you want to load when the application starts }, { path: 'login', component: LoginComponent } ];
you should update AppServiceProvider.php use Illuminate\Support\Facades\Schema; public function boot(): void { Schema::defaultStringLength(191); }
{"Voters":[{"Id":5921826,"DisplayName":"IVNSTN"},{"Id":17562044,"DisplayName":"Sunderam Dubey"},{"Id":162698,"DisplayName":"Rob"}]}
Here's an example of how to use shadows in TextView: android:shadowColor="#636363" android:shadowDx="2" android:shadowDy="2" android:shadowRadius="10" android:background="@drawable/temp" - The shadowColor property allows you to change the color of the shadow. - The shadowDx property allows you to change the vertical placement of the shadow. - The shadowDy property allows you to change the horizental placement of the shadow. - The shadowRadius property allows you to increase the amount of area where the shadow is shown. And as for the background, we first need to create a shape that has the appearance we want and we can apply that shape appearance onto the TextView. To do so, we first make a new xml file (Drawable Resource File) in the drawable folder which is found under the "res" folder. You can find more information about android xml shapes online but here's a simple example of a rectangular shape that has a linear gradient background: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <gradient android:type="linear" android:angle="0" android:startColor="#f6ee19" android:endColor="#115ede" /> <corners android:radius="6dp"/> </shape> You can apply this shape by adding the android:background="@drawable/custom_shape" attribute to your TextView. (You need to rename custom_shape to the name you chose for the xml file)
|javascript|hashmap|
|flutter|video-player|preloading|flutter-devtools|
Spigot does not include NMS with its maven packages. The legal way to do what you are after is to download [BuildTools][1] and run it via: java -jar BuildTools.jar --rev 1.14.4 Then, you can include your dependency as follows: <dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot-server</artifactId> <version>1.14.4-R0.1</version> </dependency> Note that you have to change ``spigot-api`` to ``spigot-server`` which is the artifact that also includes NMS. [1]: https://hub.spigotmc.org/jenkins/job/BuildTools/
**Requirement**: Based on the code provided below, implement the merge sort algorithm to rearrange an array with N elements. While running the algorithm, print array A after each merge of two subarrays. Input - The first line is a positive integer N (0 \< N \< 20) - The next line contains N integers Who are the elements of the array Output - The next lines print out the configuration of array A. # Example: Input 10 800 728 703 671 628 625 518 508 392 331 Output \[ 728 800 \] 703 671 628 625 518 508 392 331 \[ 703 728 800 \] 671 628 625 518 508 392 331 703 728 800 \[ 628 671 \] 625 518 508 392 331 \[ 628 671 703 728 800 \] 625 518 508 392 331 628 671 703 728 800 \[ 518 625 \] 508 392 331 628 671 703 728 800 \[ 508 518 625 \] 392 331 628 671 703 728 800 508 518 625 \[ 331 392 \] 628 671 703 728 800 \[ 331 392 508 518 625 \] \[ 331 392 508 518 625 628 671 703 728 800 \] I'm having trouble finding a way to print out the remaining elements of the array after each merge. this is my code, hope any one can help me: ``` #include <iostream> using namespace std; void printArray(int arr[], int start, int end) { cout << "[ "; for (int i = start; i <= end; ++i) { cout << arr[i]; if (i < end) { cout << " "; } } cout << " ] "; } void merge(int arr[], int left, int mid, int right) { int n1 = mid - left + 1; int n2 = right - mid; int* L = new int[n1]; int* R = new int[n2]; for (int i = 0; i < n1; ++i) L[i] = arr[left + i]; for (int j = 0; j < n2; ++j) R[j] = arr[mid + 1 + j]; int i = 0, j = 0, k = left; while (i < n1 && j < n2) { if (L[i] <= R[j]) { arr[k] = L[i]; ++i; } else { arr[k] = R[j]; ++j; } ++k; } while (i < n1) { arr[k] = L[i]; ++i; ++k; } while (j < n2) { arr[k] = R[j]; ++j; ++k; } // In ra mảng sau mỗi lần trộn hai mảng con printArray(arr, left, right); cout << endl; delete[] L; delete[] R; } void mergeSort(int arr[], int left, int right) { if (left < right) { int mid = left + (right - left) / 2; mergeSort(arr, left, mid); mergeSort(arr, mid + 1, right); merge(arr, left, mid, right); } } int main() { int N; cin >> N; int* arr = new int[N]; for (int i = 0; i < N; ++i) cin >> arr[i]; mergeSort(arr, 0, N - 1); delete[] arr; return 0; } ```
I am probably missing something simple but... I have a website created with WordPress that has a WooCommerce shop on it. I want to put an image behind the "Shop" text in the banner on the page. Can't seem to find a way to do it. Any help would be greatly appreciated. [Link to website page in question](https://malcolmwray.com/shop/) Not editable with Elementor!
***Android : react-native-maps show only absolute one block area in detail.*** Only one rectangular area is shown in detail. I try code.but Does not get better What's wrong with this? When I zoom in on the map, I can't see anything, does this mean it crashes? ios is working fine. <meta-data android:name="com.google.android.geo.API_KEY" android:value="*********************"/> <uses-library android:name="org.apache.http.legacy" android:required="false"/>
Android : react-native-maps show only absolute one block area in detail
Good morning, I am having an issue with my SKLabel not showing on my Tutorial SKScene. My code is below, I can't seem to find where I went wrong. When trying to add the SKLabel manually, it works fine. When adding it via code, nothing happens. Where am I going wrong? GameviewController: import UIKit import SpriteKit import GameplayKit class GameViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Configure the view let skView = self.view as! SKView skView.showsFPS = true skView.showsNodeCount = true // Create and present the scene let scene = Start(size: skView.bounds.size) scene.scaleMode = .aspectFill skView.presentScene(scene) // Print the size of the scene print("Scene size: \(scene.size)") } override var supportedInterfaceOrientations: UIInterfaceOrientationMask { if UIDevice.current.userInterfaceIdiom == .phone { return .allButUpsideDown } else { return .all } } override var prefersStatusBarHidden: Bool { return true } } start scene import SpriteKit import GameplayKit class Start: SKScene { private var label : SKLabelNode? private var PlayButton : SKSpriteNode? override func didMove(to view: SKView) { // Create a label node let labelNode = SKLabelNode(text: "Block Maze") // Set position of the label just below the top with a fixed margin let topMargin: CGFloat = 100 // Adjust this value for the desired margin labelNode.position = CGPoint(x: self.size.width / 2, y: self.size.height - topMargin) // Add the label node to the scene self.addChild(labelNode) // Print the position of the label print("Label position: \(labelNode.position)") // Create a play button box let buttonSize = CGSize(width: 150, height: 60) let playButtonBox = SKShapeNode(rectOf: buttonSize, cornerRadius: 10) playButtonBox.fillColor = SKColor.clear playButtonBox.position = CGPoint(x: self.size.width / 2, y: self.size.height / 2) // Create a label node for the play button text let playLabel = SKLabelNode(text: "Play") playLabel.fontColor = .white playLabel.fontSize = 24 playLabel.position = CGPoint(x: 0, y: -10) // Adjust this value to position the text inside the box playButtonBox.name = "playButton" // Set the name property // Add the label node as a child of the button box playButtonBox.addChild(playLabel) // Add the play button box to the scene self.addChild(playButtonBox) } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { for touch in touches { let location = touch.location(in: self) // Check if the touch is on the play button if let node = self.atPoint(location) as? SKShapeNode, node.name == "playButton" { // Perform the action when the play button is tapped print("Play button tapped!") // Add your code here to perform the desired action //Go to Tutorial // Create and present the scene // Create and present the scene if let tutorialScene = SKScene(fileNamed: "Tutorial") { tutorialScene.scaleMode = .fill // Present the TutorialScene self.view?.presentScene(tutorialScene) } } } } } Tutorial Scene import SpriteKit import GameplayKit class Tutorial: SKScene { override func didMove(to view: SKView) { print("Tutorial scene did move to view.") // Confirm that the scene's didMove(to:) method is called // Create a label node let labelNode = SKLabelNode(text: "Block Maze") labelNode.fontColor = SKColor.black // Set label text color labelNode.fontSize = 24 // Set label font size // Set position of the label just below the top with a fixed margin let topMargin: CGFloat = 100 // Adjust this value for the desired margin labelNode.position = CGPoint(x: self.size.width / 2, y: self.size.height - topMargin) // Add the label node to the scene self.addChild(labelNode) // Print the position of the label print("Label position: \(labelNode.position)") } }
Label not showing on Tutorial SKScene
|swift|sprite-kit|uikit|sklabelnode|
null
I'm developing a Python script using the requests library for HTTP requests. I need guidance on handling potential exceptions gracefully and ensuring that I receive a response from the server. Currently, I'm encountering issues with exceptions or no response in terminal. [Here's the current code snippet I'm using][1] I've implemented a code snippet that sends a GET request to a specific URL with headers and payload. I've tried using a try-except block to catch any exceptions, but I'm still facing problems with handling exceptions and empty terminal [1]: https://i.stack.imgur.com/4zsWV.png
You can't do it if `billing_address_collection` or `shipping_address_collection` are enabled, as your Checkout Session will add fields for the customer to add their address, and you can't prefill them. If you already know your Customer's address, then [create a Customer][1] with their `address` and `shipping` information first, then create your Checkout Session with `customer => $customer->id`. Your Session will still show the Billing country field, as that's required for the payment method (card), but it won't prompt the customer to enter their address. [1]: https://docs.stripe.com/api/customers/create
Here's a breakdown of the key differences between Python lists and Java arrays, including explanations and examples: 1. Fixed Size vs. Dynamic Size Java arrays: Have a fixed size that must be declared when you create the array. You cannot add or remove elements beyond this size. Java int[] numbers = new int[5]; // Array can only hold 5 integers Python lists: Can dynamically grow or shrink. You can add or remove elements as needed. Python numbers = [1, 2, 3] # List initialized numbers.append(4) # Adding an element 2. Homogeneous vs. Heterogeneous Types Java arrays: Must store elements of the same data type. Java String[] names = {"Alice", "Bob"}; int[] ages = {25, 30}; Python lists: Can store elements of different data types. Python my_list = [10, "hello", 3.14, True] 3. Mutability Java arrays: The contents of the array can be changed after the array is created. You can alter the value of individual elements. Java int[] numbers = {1, 2, 3}; number[0] = 5; // Now numbers is {5, 2, 3} Python lists: Lists are fully mutable. You can change elements, add elements, remove elements, and rearrange them. Python my_list = [1, 2, 3] my_list[1] = "new value" # Now my_list is [1, "new value", 3] my_list.remove(3) # Now my_list is [1, "new value"] 4. Efficiency and Performance Java arrays: Generally more memory-efficient for storing homogeneous data, especially primitive data types. They offer fast access to elements by index. Python lists: More flexible, but have some overhead due to their dynamic nature and ability to store different types. This flexibility comes at a slight cost in terms of memory and, in some cases, speed. 5. Functionality Python lists: Have a rich set of built-in methods that make common operations very convenient: append() to add an element remove() to remove an element sort() to sort in place reverse() to reverse in place And many more... Java arrays: Require the use of external utility classes like Arrays for advanced operations like sorting, searching, etc. Java Arrays.sort(my_array); Python's array Module Python has an array module that provides array-like structures similar to Java arrays for storing homogenous data types. However, even these array objects are somewhat more flexible than Java's arrays, allowing some resizing. **Summary** In essence, Python lists offer more versatility for general-purpose programming, while Java arrays are more suited for scenarios where you know the size of your data in advance and need better performance for specific operations on homogeneous data.
Im new with Jasper and I'm struggling with simple grouping. My dto which is passed: @Getter public class OrderPrintPreviewInputData { private final List<OrderedTestInputData> tests; .... } OrderedTestInputData.class: @Getter public class OrderedTestInputData { private final Long id; @Setter private String testType; @Setter private String materialType; } now my jrxml: <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="pzt-order-print-preview" language="groovy" pageWidth="595" pageHeight="842" columnWidth="556" leftMargin="20" rightMargin="19" topMargin="20" bottomMargin="20" uuid="406fbc92-1eae-45c7-93f1-f65ed1808b63"> <property name="ireport.zoom" value="1.610510000000001"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="626"/> ... <subDataset name="orderedTests" uuid="448c9b60-118e-407a-b2c6-61db0f377e4e"> <field name="tests.testType" class="java.lang.String"/> <field name="tests.materialType" class="java.lang.String"/> </subDataset> <parameter name="SUBREPORT_JASPER_FILE" class="java.lang.Object"/> <field name="tests" class="java.util.List"/> ... <detail> <frame> <reportElement positionType="Float" x="0" y="525" width="556" height="26" uuid="393eb4ce-1fa9-4e44-a560-a94ab2e2a04f"> <property name="com.jaspersoft.studio.element.name" value="ExaminationFrame"/> <property name="com.jaspersoft.studio.unit.y" value="px"/> </reportElement> <subreport> <reportElement positionType="Float" x="-3" y="16" width="556" height="10" uuid="8666b227-be06-4552-8a0d-12015455ea4a"> <property name="com.jaspersoft.studio.unit.y" value="px"/> </reportElement> <dataSourceExpression> <![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{tests})]]> </dataSourceExpression> <subreportExpression> <![CDATA[$P{SUBREPORT_JASPER_FILE}]]> </subreportExpression> </subreport> </frame> </detail> The data is displayed that way: row 1 - testType_1 | materialType_1 row 2 - testType_1 | materialType_2 row 3 - testType_2 | materialType_3 row 4 - testType_3 | materialType_4 row 5 - testType_3 | materialType_5 but now I need to display the results grouped by testType like below: row 1 - testType_1 | materialType_1 + '\n' + materialType_2 row 2 - testType_2 | materialType_3 row 3 - testType_3 | materialType_4 + '\n' + materialType_5 I tried with such code but without any results: <variable name="MaterialTypesAggregated" class="java.lang.String" resetType="Group" resetGroup="TestTypeGroup" calculation="System"> <variableExpression><![CDATA[(($V{MaterialTypesAggregated} != null ? $V{MaterialTypesAggregated} + ", " : "") + $F{tests.materialType})]]></variableExpression> <initialValueExpression><![CDATA[""]]></initialValueExpression> </variable> <group name="TestTypeGroup"> <groupExpression><![CDATA[$F{tests.testType}]]></groupExpression> <groupHeader> <band height="20"> <textField> <reportElement x="0" y="0" width="200" height="20" uuid="c4efc3da-c43d-4100-ad8d-0a0d358bf386"/> <textFieldExpression><![CDATA[$F{tests.testType}]]></textFieldExpression> </textField> </band> </groupHeader> <groupFooter> <band height="20"> <textField> <reportElement x="0" y="0" width="400" height="20" uuid="b121bb43-86a9-4b7d-8e03-c81ccd938466"/> <textFieldExpression><![CDATA["Material Types: " + $V{MaterialTypesAggregated}]]></textFieldExpression> </textField> </band> </groupFooter> </group> with this code above I'm getting the errors: Caused by: net.sf.jasperreports.engine.design.JRValidationException: Report design not valid : 1. Field not found : tests.materialType 2. Field not found : tests.testType 3. Field not found : tests.testType 4. Field not found : tests.testType 5. Field not found : tests.materialType
Grouping by column in Jasper
|java|jasper-reports|grouping|report|
When I execute this code: import pandas as pd # Example DataFrame creation df = pd.DataFrame({'A': [1, 2, 3]}, index=[0, 1, 2]) # Assuming idx is a valid index in df, for example: idx = 1 # Store the list as a single value in the DataFrame df.loc[idx, 'SHAP'] = [1, 2] print(df) I get the error: `ValueError: Must have equal len keys and value when setting with an iterable` how do I fix this? I am using pandas version `2.1.4`
Fix error when assigning a list of values to dataframe row
|python|pandas|
Try using Scala 2 syntax fastparse.parse("1234", implicit p => parseAll(MyParser.int(p))) https://scastie.scala-lang.org/DmytroMitin/MrFZ0EhiSPeFDHd1IyBhrA (I'll try to find SO question with Scala 3 syntax.) One of possible Scala 3 syntaxes is fastparse.parse("1234", p => {given P[_] = p; parseAll(MyParser.int(p))}) https://scastie.scala-lang.org/DmytroMitin/MrFZ0EhiSPeFDHd1IyBhrA/11 but I guess there was one more.
You can pass an `index` to the `DataFrame` constructor with the given name that you want. ``` import pandas as pd df = pd.DataFrame({"a":[1,2],"b":[3,4]}, index=pd.Index([], name='myIndex')) df ``` ``` a b myIndex 0 1 3 1 2 4 ```
The VCALENDAR object, as supplied, is not strictly valid: the EXDATE property must have one or more date-time or date values (see [3.8.5.1. Exception Date-Times](http://icalendar.org/iCalendar-RFC-5545/3-8-5-1-exception-date-times.html)). Despite that, *vobject* parses the data successfully, ending up with an empty list of exceptions in the VEVENT object. To get the list of occurrences, try: >>> s = "BEGIN:VCALENDAR ... END:VCALENDAR" >>> ical = vobject.readOne(s) >>> rrule_set = ical.vevent.getrruleset() >>> print(list(rrule_set)) [datetime.datetime(2011, 3, 25, 8, 0), datetime.datetime(2011, 3, 26, 8, 0), datetime.datetime(2011, 3, 27, 8, 0), datetime.datetime(2011, 3, 28, 8, 0), datetime.datetime(2011, 3, 29, 8, 0), datetime.datetime(2011, 3, 30, 8, 0)] >>> If we add a valid EXDATE property value, like EXDATE:20110327T080000 re-parse the string, and examine the RRULE set again, we get: >>> list(ical.vevent.getrruleset()) [datetime.datetime(2011, 3, 25, 8, 0), datetime.datetime(2011, 3, 26, 8, 0), datetime.datetime(2011, 3, 28, 8, 0), datetime.datetime(2011, 3, 29, 8, 0), datetime.datetime(2011, 3, 30, 8, 0)] >>> which is correctly missing the 27th March, as requested.
Can't understand kotlin logic. For sush code inline fun inlined( block: () -> Unit) { block() println("hi!") } fun foo() { inlined { println("5") return@inlined // OK: the lambda is inlined println("5") } println("6") } fun main() { foo() } Expected such output "56" but got "5hi!6". How could this happen? And on my understanfing it contradicts following description from documentation [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/IER8n.png Can someone explain it? UPDATE: Thanks for your answers. I still wandering why execustion of inlined() proceed after calling return@inlined? Anyway lambda is not aware about "inlined()" paremeter "block" but behaves like return@block was called.
|java|android|kotlin|mediarecorder|
# **Replace `@` with `&#64;`** For example instead of this: ``` email@domain.com ``` You write this: ``` email&#64;domain.com ```
When I try to call the Telegram.WebApp.initDataUnsafe method in inline mode, the Telegram web app API returns an empty object - python & tg webapp
This is details Log Context from tomcat log folder 30-Mar-2024 10:26:42.230 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [authenticationTokenFilterBean] javax.naming.NameNotFoundException: Name [userService] is not bound in this Context. Unable to find [userService].**** at org.apache.naming.NamingContext.lookup(NamingContext.java:839) at org.apache.naming.NamingContext.lookup(NamingContext.java:172) at org.apache.catalina.core.DefaultInstanceManager.lookupFieldResource(DefaultInstanceManager.java:526) at org.apache.catalina.core.DefaultInstanceManager.processAnnotations(DefaultInstanceManager.java:438) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:164) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:156) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:100) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4311) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4940) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:683) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:661) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1014) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1866) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:816) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1584) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:312) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:114) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:345) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:893) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:794) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) On console: 30-Mar-2024 10:26:42.230 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file 30-Mar-2024 10:26:42.246 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal Context [/NightLife-0.0.1-SNAPSHOT] startup failed due to previous errors 2024-03-30 10:26:42.261 INFO 8596 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2024-03-30 10:26:42.292 INFO 8596 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' 2024-03-30 10:26:42.292 INFO 8596 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2024-03-30 10:26:42.324 INFO 8596 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. 30-Mar-2024 10:26:42.339 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [NightLife-0.0.1-SNAPSHOT] appears to have started a thread named [mysql-cj-abandoned-connection-cleanup] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
Getting error while deploying war in tomcat 9
|java|spring|spring-boot|spring-mvc|tomcat9|
{"OriginalQuestionIds":[58475427],"Voters":[{"Id":943435,"DisplayName":"Yogi"},{"Id":1048572,"DisplayName":"Bergi","BindingReason":{"GoldTagBadge":"javascript"}}]}
There is a part of mathematics called the theory of multiple zeta values (MZVs) introduced around 1992. In this theory, we study the properties of parametric nested infinite series (see, e.g., [here](https://www.usna.edu/Users/math/meh/mult.html) for the definition of one particular variant) whose numeric evaluation is, therefore, of high computational complexity. Several days ago, I started using Python to calculate the basic partial sums of specific MZVs. The following code allows me to calculate the 20th partial sum of the so-called multiple zeta-star value zeta*(10,2,1,1,1) or any other similar instance by changing the inputs `S`, `n`. ``` S = (10,2,1,1,1) n = 20 l = len(S) def F(d,N): if (d == 0): return 1 else: return sum(F(d-1,k)/(k**(S[-d])) for k in range(1,N+1)) print(F(l,n)) ``` Of course, the partial sums of the d-dimensional MZVs essentially depend on their arguments forming a d-tuple (s_1,...,s_d) and on the upper summation bound `n`. **My question** is whether we can define a function typed in a user-friendly way `F([s_1,...,s_d],n)` with the first argument being a list with integer entries and the second argument being the summation bound n. Thus, instead of typing the two inputs separately, `S` and `n`, I am looking for a way to directly type `F([10,2,1,1,1],20)` or `F([2,1],100)`, etc., with the given delimiters of the two arguments.
Defining function in Python whose one argument is list
|python|definition|
null
Iam trying to deploy a contract on erc20, the code can be compiled without any problem and i deployed it on testnet as well without any problem but when i try and switch to mainnet iam getting this error. Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Returned error: gas required exceeds allowance (15854) Any help ? Thanks in advance. Iam trying to deploy a contract on erc20, the code can be compiled without any problem and i deployed it on testnet as well without any problem but when i try and switch to mainnet iam getting Gas estimation failed | Returned error: gas required exceeds allowance (16966)
Gas estimation failed | Returned error: gas required exceeds allowance (16966)
I am trying to approve my angular website for google Adsense . For this i used ads.txt file which i have placed under src folder inside our angular app like src/ads.txt .But still google Adsense website showing after few days that ads.txt is not found . What will be the the exact the reason can you please help me out with this problem that it is again and again showing the ads.txt status as not found .[google ads.txt not found](https://i.stack.imgur.com/0fGlQ.png) I just tried what could be reason for the ads.txt status not found .When i tried to access the file in the second go what i get the status is 304 not modified . If anybody could help me out what is the exact reason that Why google adsense is not approving the website and why ads.txt status is becoming not found .[status 304 not found](https://i.stack.imgur.com/8RjJx.png)
Google adsense ads.txt status becomes not found Why?
|angular|ads|adsense|http-status-code-304|app-ads.txt|
null
I have an android application containing both java and kotlin codes. I want to scan its possible vulnerabilites using coverity sast tool version 2023.12.0. I follow the following steps: 1-) ./cov-configure --java 2-) ./cov-configure --kotlin 3-) ./cov-build --dir <path of idir file> --fs-capture-search <path of target source file> --no-command 4-) ./cov-analyze --dir <path of idir file> --aggressiveness-level high --android-security 5-) cov emit command (I did not write it here because it just commit the result to localhost) My scan results did not satisfy me, because it just scanned android manifest and some xml files. It found some vulnerabilities here, but when I look at the log file, i realized that it did not capture any java or kotlin code. So, what is my mistake ? why did it not scan java or kotlin files ? If you use this tool, can you explain me how you make android scans ? Thanks... Note: This question is important issue for me. If I did something wrong in my question, please firstly state it in comments, dont just downvote
making android analyze with coverity sast tool
|java|android|kotlin|coverity|sast|
null
It's not required to kill the app, when waiting until the user pressed the back button. @RequiresApi(api = Build.VERSION_CODES.R) public void gotoExternalStorageSettings() { Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION); intent.setData(Uri.fromParts("package", requireContext().getPackageName(), null)); this.startActivityAndWait.launch(intent); } ActivityResultLauncher<Intent> startActivityAndWait = registerForActivityResult( new ActivityResultContracts.StartActivityForResult(), (ActivityResult result) -> { if (Environment.isExternalStorageManager()) { // continue in here ... } });
The `DefaultJmsHeaderMapper` is used in the `JmsSendingMessageHandler` by default. It maps all the headers into `jmsMessage.setObjectProperty(propertyName, value);` if the values are in the supported types: private static final List<Class<?>> SUPPORTED_PROPERTY_TYPES = Arrays.asList(new Class<?>[] { Boolean.class, Byte.class, Double.class, Float.class Or you lose that your header somewhere in between... **UPDATE** Sorry, but you are confusing us. Your `_AMQ_SCHED_DELIVERY` is indeed present as a property in that final JMS message. When you talk about `setDeliveryDelay()`, it is fully different story. What you can do is something like extension for the `DynamicJmsTemplate`. Override its `getDeliveryDelay()` and take the required value from a `ThreadLocal` you populate before sending message to that `<int-jms:outbound-channel-adapter>`. This is something we definitely can add into the `DynamicJmsTemplate` and `DynamicJmsTemplateProperties` to be addressed by the mentioned `JmsSendingMessageHandler`. But at the moment the workaround only implementing your own `ThreadLocal` variable for this `deliveryDelay` option.
{"OriginalQuestionIds":[9357032],"Voters":[{"Id":14991864,"DisplayName":"Abdul Aziz Barkat","BindingReason":{"GoldTagBadge":"django"}}]}
It would be helpful to include some comments in code to explain what each section does. But from what I see you are adding the Headers from your original to a new workbook (and then reading/printing these header). <br> Then there is a loop looking for a cell with value "PP/ Charger 2"<br> There is no mention of this in your post and it's not in the table provided. Also the loop is wrong.<br> ``` for j in range(1, max_row_og +1): for i in range(1, max_col_og +1): c = cpsd_s1.cell(row=j, column=1) if (c.value == "PP/ Charger 2"): k = cpsd_s1.cell(row=j, column=i) sheet_dcfc1.cell(row=j, column=i).value = k.value ``` You are setting j to count the rows in the origin worksheet and i to count the columns then `c = cpsd_s1.cell(row=j, column=1)` . So this means it always looks in the same column (A), 'column=1'. Presumably this should be 'column=i' <br> If this is changed, then you're now looking in every cell from A1 to K11. Is this value, "PP/ Charger 2" expected to be randomly in any column including those you have shown? If it is expected to be in a specific column then you should iterate just that column and not the whole used range. Please provide details on what/where/when of this value, as its existence seems important to the next section. Without it the new worksheet will just contain the headers.<br> If the previous section does find that "PP/ Charger 2" value it copies that value to the **same** cell in the new Sheet. The code then runs a delete which aims to remove empty rows given presumably "PP/ Charger 2" could be on any row. While this delete achieves that it also removes the Headers previously written. if it is only necessary write that value once down the page for each occurrence in the original Sheet then maybe use Openpyxl 'append' so each will be written to the next unused row. Either way the value can be added to the new sheet row by row without the need to then delete empty rows. The exact implementation would depend on where this text is expected to be found. Then the code loops a list of all cells in all rows looking specifically in row 9 for a value of 0, `row[9].value == 0):` <br> Presumably this is looking for the 0 value in the energy column. However you state *Energy is in column 11* or Column 'K' whereas row[9] is Column 'J'. But again why select the whole range and not just loop through Column K only?<br> Then the code looking for a value of 0, but this is the new Sheet `range_x = enumerate(sheet_dcfc1.iter_rows())` , 'sheet_dcfc1' and all you have written to it is the Headers and the value "PP/ Charger 2" when it occurs. There are no cells with a value of 0 ... I seems may be when you find the value "PP/ Charger 2" it's the whole row you want to copy across not just that cell. You need to better explain what your code is supposed to do, what the expected result should be.
Spigot does not include NMS with its maven packages. The legal way to do what you are after is to download [BuildTools][1] and run it via: java -jar BuildTools.jar --rev 1.14.4 This command will not only build Spigot but also install the resulting artifacts to your local maven repository. Then, you can include your dependency as follows: <dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot-server</artifactId> <version>1.14.4-R0.1</version> </dependency> Note that you have to change ``spigot-api`` to ``spigot-server`` which is the artifact that also includes NMS. [1]: https://hub.spigotmc.org/jenkins/job/BuildTools/
I was implementing the disjoited-sets-forest structure using the cormens algorithms book. I found that after the implementation of Union-by-rank we make sure that the three heigth stays log n if we have n nodes. But since if two trees have different rank they just get merged (with Union and all that comes with it), if I merge a tree, for example of 3/4 elements, with a single node n times, doesn't it stay of heigth 2? For example ``` 3 3 / \ Union 4 -> / | \ and so on n times 2 5 2 5 4 ```
Disjointed-sets-forest Why is the heigth of a tree with n elements log n?
|data-structures|disjoint-sets|
null
Suppose you are limited to 7 bits for a floating-point representation: 1 sign bit, 3 exponent bits, and 3 fraction bits. First I convert `3/32` to the binary `0.00011`, then to the standard scientific notation of `1.1 * 2^(-4)`. At this point I realize my exponent field will be `-1`, which is not valid. I try to represent `3/32` as `0.11 * 2^(-3)` instead, which leads to the more intuitive representation of `1 000 110`. However, obviously this is a denormalized value, and if I try to convert the representation back to decimal I get `-3/16`. My question is: is it even possible to represent this value precisely within the constraints of the problem? It looks like the smallest representable value for this scheme is `-15`, so `-3/32` falls within this interval. I'm aware that bits are dropped and precision is lost during conversions; is this the case here?
I have a php script that scrapes a database on a daily basis and pushes a json feed to a downstream process. We have some logic in the middle that we are trying to create a list called types. ``` $sql = "SELECT id AS slug, name, CONCAT('[', IF (closed = 0, 'O', 'C'), IF (mandatory = 1, ', M', ''), IF (weekend = 1, ', W', ''), ']' ) AS types FROM meetings as meetings"; ``` The issue are having is the downstream process expect the list types, to have each value in quotes: ``` "types": [ "O", "M", "W"], ``` However, when we escape the quotes they end up in the json feed: `IF (closed = 0, '/"O/"', '/"C/"')` The question is whether this is the correct approach and is the output how json_encode is intended to operate? We return the query row by row into a php array (while ($row = mysqli_fetch_assoc($result)) $return[] = $row;) and then dump to json. ``` //function to output json function output($array) { $return = json_encode($array); if (json_last_error()) error(json_last_error_msg()); die($return); } ``` I have played around with some of the json_encode constants: JSON_UNESCAPED_SLASHES and such as well as omitting the escape slash. My expectation is that it shouldn't be this difficult or I am missing something incredibly simple. Expected output: ``` "types": [ "O", "M", "W"], ```
PHP script to json_encode returns escaped forward slash
|php|json|
null
I created a block with Link and put text and an svg image inside. How do I move it correctly to the lower right corner of the button? (photo) By the way, how do I change the background color of svg? It's NEXT.JS framework. [photo of the result](https://i.stack.imgur.com/JiJ4T.png) TSX: ``` <section className={styles.categories}> <div className={`container ${styles.categories__container}`}> <Link href='/catalog'> <button className={`btn-reset ${styles.categories__container__button}`} > <span className={styles.categories__container__button__text}> ВСЕ <br /> ТОВАРЫ </span> <div> <Image className={styles.categories__container__button__image} src='/img/categories-all.svg' alt='Banner Image' width={150} height={150} /> </div> </button> </Link> </div> </section> ``` SCSS: ``` .categories { position: relative; overflow: hidden; z-index: 1; height: 495px; &__container { position: relative; // align-items: center; &__button { width: 270px; height: 216px; margin: 10px; background-color: #FFF4E7; border-color: #B79158; border-radius: 20px; padding: 10px 15px; display: inline-block; justify-content: space-between; overflow: hidden; // align-items: center; &__text { display: flex; font-size: 18px; font-weight: 500; text-align: left; } &__image { display: flex; position: relative; width: 100%; } } } } ``` I tried using png, but for some reason figma distorts my image very much when exporting.
I have a google form embedded into my home site. How to I get users to redirected to a thank you page after having submitted? I have tried using the code below but it cannot load after i submit the form. ``` <iframe id="gform" src="google form link" width="640" height="422" frameborder="0" marginheight="0" marginwidth="0">Loading…</iframe> <script type="text/javascript"> var load = 0; document.getElementById('gform').onload = function(){ /*Execute on every reload on iFrame*/ load++; if(load > 1){ /*Second reload is a submit*/ document.location = "thank you page link"; } } </script>```
How to redirect to thank you page after submitting a Google form embedded into a Google Site?
|html|redirect|google-forms|form-submit|google-sites|
null
This is an interesting and misleading error. I have multiple .NET Framework 4.8 projects and none of the proposed solutions worked for me. I am yet to find a solution to this issue.
{"Voters":[{"Id":874188,"DisplayName":"tripleee"},{"Id":1940850,"DisplayName":"karel"},{"Id":349130,"DisplayName":"Dr. Snoopy"}],"SiteSpecificCloseReasonIds":[18]}
I want to send message to syslog in plsql. I think it's possible via utl_tcp and ACL but have no idea how to do that. For example, in unix, the command should be: ``` logger -p local1.info "hello word" ``` Who know how to do same with plsql code? thank in advance
{"Voters":[{"Id":12421110,"DisplayName":"Jean-Joseph"}],"DeleteType":1}