I need to upload .zip file to media. Here I tried https://wordpress.stackexchange.com/questions/57603/is-it-possible-to-allow-zip-files-to-be-uploaded-in-wordpress add_filter('upload_mimes', 'custom_upload_mimes'); function custom_upload_mimes ( $existing_mimes=array() ) { // add your extension to the mimes array as below $existing_mimes['zip'] = 'application/zip'; $existing_mimes['gz'] = 'application/x-gzip'; return $existing_mimes; } But it is not working in Wordpress 5+ or gutenburg editor
I'm trying to start a telegram bot on an aws unix server. Following the example in the api of pyTelegramBotApi I am setting up webhook with aiohttp. I have no problems generating the ssl certificate and the private key but I have problems in receiving connections. On aws in the security groups section I opened the ports http 80 and https 443, both with anyware 0.0.0.0/0 but when I start the program it always returns the error in the image, both with port 80 and 443, how to solve? Error Traceback (most recent call last): File "/usr/lib/python3.6/asyncio/base_events.py", line 1062, in create_ser
Consider the following example taken from Wikipedia, slightly adapted, where the steps of the program correspond to individual processor instructions: x = 0; f = 0; Thread #1: while (f == 0); print x; Thread #2: x = 42; f = 1; I'm aware that the print statement might print different values (42 or 0) when the threads are running on two different physical cores/processors due to the out-of-order execution. However I don't understand why this is not a problem on a single core machine, with those two threads running on the same core (through preemption). According to Wikipedia: When a program runs
I am using PowerBI to analyze Cost data from Azure. I am making a direct connection and pulling in data by: opening PowerBI | Get Data | Online Services | Microsoft Azure Consumption Insights (Beta) This works, however, I am only able to see two months of data and ideally I'd like to see 6. After a lot of searching the general consensus from other users seems to be using the advanced editor to tweak the query by adding "optionalParameters" and specifying the number of months... I came across a few other sites where users were experiencing the same issue but the suggestions didn't work. I am ho
I've been trying to use CSS variables recently in a very simple code. It actually did not work. I double checked the information I found about how to use variables but I can't find my mistake. Maybe I am doing something wrong? :root { --my-color: red; } body { background-color: var(--my-color); } <!DOCTYPE html> <html> <head> <title>My title</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="./style/mainPage.css"> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bo
i am making a Android video gallery app like YouTube using React-Native for that i am using 'react-native-video' , package While using it i had a problem with video auto-play option all videos are playing at a time in the background without viewing the videos and another problem is all videos controls={true} are showing when scrolling the video and they are not moving along with videos.I am doing all this inside FlatList My code : import React, { Component, PropTypes } from "react"; import { AppRegistry, Image, Platform, StyleSheet, Text, View, TextInput, Button, TouchableHighlight, Alert, Tou
I would like to make an structured array data like dtype_test = [ ('a', np.int16), ('b', np.int16), ] data = np.array( [(1, 2), (3, 4), (5, 6)], dtype=dtype_test) However, I only have individual fields array; (1,3,5) and (2,4,6). In other words, I have data data['a'] and data['b'] already made. How can I directly make data from these individual arrays?
I have a directory that contains several .py files/modules. In that directory, I put __init__.py within with an intent to make it a package. What I would like to have is, when I import the directory, I would access all the methods from individual modules without specifying each module name inside __init__.py. This means, when I would add a new module, __init__.py would pick it up and I am free off manual update of that module name inside of __init__.py. Here is an example to show what I want: /my_package/ module1.py module2.py .......... .......... moduleN.py Now, within module1.py, I have def
In a world I am helping build there is a certain group of people with the ability to produce electricity from their bodies (and control it, I believe), an additional power I gave them was the ability to sense magnetic north. My assumption was basically "if compasses can sense magnetic north, there is probably a way for a creature to do it.). I do not know the nature of magnetic fields, but since I want these people to be seafarers, my desire is to place magnetic north and magnetic south off-kilter like it is on earth. My hope is to make it where, if they can sense the direction of magnetic nor
I'm trying to make an image with a random color for each pixel then open a window to see the image. import PIL, random import matplotlib.pyplot as plt import os.path import PIL.ImageDraw from PIL import Image, ImageDraw, ImageFilter im = Image.new("RGB", (300,300)) for r in range(0,300): for c in range(0,300): re = random.randint(0, 255) gr = random.randint(0, 255) bl = random.randint(0, 255) im[r][c]=[re,gr,bl] im.show() 14 bl = random.randint(0, 255) ---> 15 im[r][c]=[re,gr,bl] 16 im.show() TypeError: 'Image' object does not support indexing
I have a test that makes an API call, and a required part of the body that I'm passing in is a timestamp. The whole test is working except for this last piece (if I manually set the date/time before each test execution the test succeeds). I have been trying to set a variable like this: const todaysDate = Cypress.moment().format('YYYY-MM-DDTHH:MM:SS-07:00'); but I cannot figure out how to use this in the API call. The API parameter is formatted as such: "offDateTime": "YYYY-MM-DDTHH:MM:SS-07:00" Can anyone help me out?
I have a Codeigniter 3.1.7 project locally and the same on my server for environnement testing. In local I can launch commands via: php index.php manage save_existing_documents and it works! But on testing, codeigniter work fine, except with the command line^^ He shows me: The configuration file does not exist Yet the config.php file is in application/config/testing/config.php^^ The folder testing is a symlinks and it works for the rest of the project Thank for your help!
When we are working on Slick, we can define the database design with all primary and foreign keys: val id = column[Int]("department_id", O.PrimaryKey, O.AutoInc) def employee = foreignKey("employee_id_fk", id, employeeTableQuery)(_.id) Now I'm working on a Quill project with a MySql database. Normally we use only the simple case class: case class Student(id: Int, name: String, address: Option[String]) How can the database design be defined in Quill?
So, I've been reading the C++ standard and came to [defns.undefined] (3.27 in this C++17 draft that I'm reading. Note that while I'm citing C++17 here, I've found similar wording in other standards)--that is the definition of Undefined Behavior. I noticed this wording (emphasis mine): Note: Undefined behavior may be expected when this International Standard omits any explicit definition of behavior or when a program uses an erroneous construct or erroneous data Now, thinking about this, this sort of makes sense. It's sort of saying that if the Standard doesn't give a behavior for it, it has un
I wrote out a simple calculator that uses multiple methods. This is what I wrote out, but is there a better/more efficient way to write this code? Suggestions would be helpful. I want to use multiple methods and have everything visible in the main method. I know it looks silly and can be done in a much more simple way, but I'm trying to explain this to people who are new to C# and are beginning to learn about methods. { Console.WriteLine("Please input two numbers"); int num1 = Convert.ToInt32(Console.ReadLine()); int num2 = Convert.ToInt32(Console.ReadLine()); int answer1 = Sum(num1, num2); in
Is there a way to calculate the maximum value representable by unsigned int without using limits.h (so no UINT_MAX) or without using unsigned int z = 0; z = z - 1;
I'd like to use web form to generate an email using mailto:, with the subject and body specified by the user in the form. Is this supported? The subject and body can be specified in a regular hyperlink, like this: mailto:[email protected]?subject=d e&body=f g I'm testing this with Firefox and Outlook and it works fine: Outlook pre-fills the subject and body with d e and f g, as desired. Of course, those spaces should really be URL-encoded: mailto:[email protected]?subject=d%20e&body=f%20g This works, too: spaces appear in Outlook. (How universal is this? Can I assume it will work for 95% of my users who have their ma
I am trying to style a navbar and I want a menu to transition open. I am trying to do this by passing a prop to the styled component and then setting the value of transform based on the prop, however I cannot see to figure out the syntax to use a prop in the styled prop. Here's the code: <MenuContainer display={showMobileMenu ? '' : 'none'}> <UL> <LI><A showMobileMenu={showMobileMenu} href="#">Sign in with Github</A></LI> <LI><A showMobileMenu={showMobileMenu} href="#">New Snippet</A></LI> </UL> </MenuContainer> . . . const MenuContainer = styled.nav` position: absolute; text-align: right; top
I have very data with MANY dimensions (thousands) and have successfully performed a principal components analysis on it. The output looks as shown above. My problem is that (as shown on axis X), one principal component accounts for all of the variance. I worry that it is masking all of the other principal components. Therefore, I want to figure out which dimension the principal component corresponds to, and then eliminate it from my data. Is there a way to work out which dimension it corresponds to? If any code is necessary to aid understanding, it is this: print(fdata.shape) # scale data scal
I have an active directory application that is used as a service principle in DevOps pipelines. I need to assign Directory Reader role to this application. I am a Global Administrator, as shown in the picture below. When I try to assign a Directory reader role to the service user, the role assignment button is disabled as shown below. Is Global admin permission is not sufficient for this purpose or am I missing something here?
How to format a cell in angular using xlsx or the cellStyles. here's the code. list.component.ts const ws = XLSX.utils.json_to_sheet(reportData); ws['!cols'] = []; Object.keys(reportData[0]).forEach((cell: any) => { const colWidth = cell === 'Date' ? 120 : cell === 'Time' ? 100 : cell === 'Location' ? 200 : cell === 'Temperature' ? 80 : cell === 'Humidity' ? 80 : 100; ws['!cols'].push({ wpx: colWidth }); }); XLSX.utils.book_append_sheet(wb, ws, this.roomTitle); XLSX.writeFile( wb, `${fileName}.xlsx`, { cellStyles: true }, ); what I'm trying to do here is to format it into BOLD TEXT the header
Given an existing slf4j logger, I would like to wrap it into an kotlin-logging logger. The classes / methods to do that already exists in the library but are internal, so I can't call them: mu.internal.KLoggerFactory.wrapJLogger() Is there another way to do it, which is accessible to users of the library?
I wanted to execute raw SQL in a Quill project using MySQL. I referred to the documentation to learn how to do it. The following works: def getProjectsFromSql: Future[List[(Index, String)]] ={ val rawQuery = quote( infix"""SELECT * FROM Project""".as[Query[Project_True]] ) val result = ctx.run(rawQuery) result } But the following results in an error: def getProjectsFromSql: Future[List[(Index, String)]] ={ val rawQuery = quote( infix"""SELECT project_id, name FROM Project""".as[Query[(Int, String)]] ) val result = ctx.run(rawQuery) result } Error: com.github.mauricio.async.db.mysql.exceptions.
We are having issues connecting our SQL database to an application server. We contacted the application company, and they stated the service "MSSQLSERVER" isn't running, the agent isnt running either but they did not state that needed to be running. We are getting Event Error 7024 saying that data is invalid. The name of the instance is "SQL2012SVR/TWOSOURCE" and we are able to start that service.
Problem is on slow 3g connection it continuously shows spinner even when video is loaded and it is playing. Code: <video src="d3cvwyf9ksu0h5.cloudfront.net/answer-1530971608.mp4" preload="auto" autoplay controls controlslist="nodownload" style="width: 100%; height: 100%;"></video>
I am newbee here as well as in template programming. I have a dictionary (means, it could be either std::map or std::vector<std::pair<type1, type2>> or std::set<std::pair<, >> ...) I wanted to write an algorithm, which act like standard library algorithms using the iterators of the passed container. Following is the idea. #include <iostream> #include <algorithm> #include <type_traits> #include <vector> #include <array> #include <map> #include <set> #include <iterator> // two different types enum EnumA { one, two, three, four, five, six}; enum EnumB { one, three, four, six}; // TypeA TypeB usin
I have a system.img.ext4.lz4 file that is compatible with my Samsung S10 5G(Qualcomm) device. I have extracted system.img.ext4 file from the system.img.ext4.lz4 using unlz4 system.img.ext4.lz4 command. I want to play with its content. So I have decided it in two steps: Flash system.img.ext4 without modification: Using tar -cvf AP.tar system.img.ext4 command, I have created a AP.tar file. Flashed AP.tar file using Odin3 v3.13. It flashed successfully. Flash system.img.ext4 with modification: a) Modifying With simg2img system.img.ext4 system.img, you will get a raw image file named system.img Wi