I am trying to generate eigenfaces using principal component analysis and have gone through the following steps to do so. Am I missing something or doing something wrong? data matrix: (N, width * height) normalized matrix: data matrix - mean vector covariance matrix: (data matrix).T @ (data matrix) *results in matrix of shape (width * height, width * height) find eigenvectors of covariance matrix using np.linalg.eig function rescale the eigenvector corresponding to the largest eigenvalue to fit within 0 and 255 reshape the eigenvector to (width, height) display the eigenvector. Code is below i
I have the following project structure: /resources /components component-a.js component-a.html component-a.scss /scss bootstrap.scss variables.scss my-app.js my-app.html my-app.scss I am using the aurelia framework, but I don't think that makes much of a difference here. I am also using webpack, with these loaders style-loader, cssLoader, postcssLoader, sassLoader. Hence, my webpack config looks like this: rules: [ ... { test: /\.scss$/i, use: [ 'style-loader', cssLoader, postcssLoader, sassLoader ] }, ... ] My bootstrap.scss file looks like this (I know that @import is deprecated, but it's th
ı have two capture interrupts from tim1ch1 and tim4ch1, when ı worked with only tim1 ch1, ı could use if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1) but what if ı want to use tim4ch1 interrupts at the same time. Can ı use below format? is it correct or not? Can you warn me about it. I will not be able to try it as software that so ı want to ask professions about these kind of topics. void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) { if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1) { if (htim->Instance == htim1.Instance) { // to do sth } else if (htim->Instance == htim4.Instance) { // to
I have an image stored in Firebase Storage. I used the link for my website's meta og:image tag, but it doesn't appear on the preview for WhatsApp or Facebook. It seems like the %2F characters are being replaced with %252F. How can I get around this issue without changing the name of the image? This image works (doesn't have %2F). This image doesn't work (has %2F).
Which language should I consider for Android development, Java or Kotlin? I understand the main point of Kotlin is that it can handle null safety, while Java can't, but I am confused about which language I should use for Android dev.
plz someone tell me which language should i consider for Android development, java or kotlin. Till now i understand main point about kotlin that it can handle null safety but java can't, but i am confused which language should i use for Android dev, i already completed my java and kotlin. plz someone help me and also suggest me sources where i can learn without wandering on internet and also share your opinion if you have to start over, what you do first? sorry for grammar mistakes i am expecting genuine answer about language which i use as a android dev java or kotlin. devs can help me in cle
I want to write a custom TextField on SwiftUI to have an input with credit card format like this "xxxx-xxxx-xxxx-xxxx", I was looking at this answers https://stackoverflow.com/a/48252437, but I'm struggling with UIViewRepresentable, when I want to past the numbers into the original text, it doesn't seems to update it with the format. The textField will show you 12345, but I need 1234 5 struct ContentView: View { @State var cardNumber: String = "12345" // <-- It won't be formatted until I type another one number var body: some View { VStack { CreditCardTextField(number: $cardNumber) .frame(heig
Regular Expression for text box validation. I need to validate textbox. conditions like below can enter numbers and letters. need to avoid these characters !@#$%^&*+= Currently i am using below regular expression. but it is not working. <input type="text" pattern="^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$" /> can u help me to find correct regular expression
I have been around the mulberry bush for a few weeks now trying to implement the writing of a file on an android phone. My development setup is on a Windows PC with Anaconda and Pycharm. I am using kivy and buildozer to create the android app. My test app is simply trying to write a file (test.txt) to the root directory of the SD card on the phone. The directory is: /storage/emulated/0 The error I am getting is: [Errno 1] Operation is not permitted: '/storage/emulated/0/test.txt' I ask for permissions in the code, but the permissions are not prompted at application startup or installation. Her
Whenever I collect data from my database, it is stored as <sqlite3.Row object at 0x0000019494A725F0> instead of being the actual data within the database. I've tried multiple methods that worked for other people but doesn't for me(such as .fetchall()). I'm currently using Flask and I think that might have something to do with the error. This is my current python code: @app.route('/signup', methods=["GET", "POST"]) def add_data(): p = request.form['password'] p2 = request.form['password_c'] if p == p2: db = get_db() e = request.form['email'] e2 = db.execute('SELECT Email FROM Users').fetchall()
I've been trying to get images from duckduckgo using: from duckduckgo_search import DDGS from fastcore.all import * ddgs = DDGS() def search_images(term, max_images=30): print(f"Searching for '{term}'") keywords = 'stop sign' return L(ddgs.images((keywords, term, max_results=max_images)).itemgot('image')) but it gives an error: Cell In[30], line 8 return L(ddgs.images((keywords, term, max_results=max_images)).itemgot('image')) ^ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='? Did some looking up and seems there's some issue with the pip version of fastbook-0.0.16.tar.
A straight forward way would be uint32_t diff = abs(num1 - num2); bool isZeroOrOne = (diff == 0 || diff == 1); or to simply check for all possible cases: int32_t diff = num1 - num2; bool isZeroOrOne = (diff == 0 || diff == 1 || diff == -1); Is there a more optimized way?
Currently, Valgrind only uses uninitialized variables error when a conditional jump or move, use of an uninitialized pointer, etc., is done. I want to detect the use of uninitialized value error also when some ALU operation is performed over that value. int add(int a, int b){ return a+b; } int main(){ int a = 10; int b ; int t = add(a,b); return 0; } I am trying to figure out where to change the Valgrind source code. I am looking in mc_translate.c but cannot find the exact change. What and where should I change?
I'm working on a Flutter project (sdk: '>=3.0.1 <4.0.0') for iOS (platform :ios, '13.0') and right after upgrading Flutter this morning I noticed that the iPhone simulator (Xcode 14.3) was using between 3-5gb of memory and my entire system was unusable as long as the simulator was running. I have a 32GB Mac and when the simulator was onscreen (when minimized the system was performant and seemed fine) and running, my entire system was experiencing massive latency, lags, and performance issues. Scrolling through source, doing any kind of debugging, or really anything at all was extremely difficu
I have just learnt about the DataKinds extension, type-level literals, and found out that type-levels natural numbers can be compared using constraints provided in the Data.Type.Ord such as (>), and manipulated using type-level operations provided in GHC.TypeNats such as (+). With these in mind, I came across the idea of implementing a safe version of !! for length-indexed vectors. The idea is simple: you pass in an ix :: Natural as the index, and a vec :: Vec len a with length len and type a, and you get the element at index ix. The compiler should detect and shout at you for any illegal ix (
I want to install the onnxruntime pip library but i have this output: pip install onnxruntime ERROR: Could not find a version that satisfies the requirement onnxruntime (from versions: none) ERROR: No matching distribution found for onnxruntime Also: pip install onnxruntime-gpu ERROR: Could not find a version that satisfies the requirement onnxruntime-gpu (from versions: none) ERROR: No matching distribution found for onnxruntime-gpu links: onnxruntime-gpu at PyPI onnxruntime at PyPI onnxruntime at Github My python version is 3.9 My OS is Windows 11 (I already have the VSC Built Tools) My pip
I need help with irf plots. I am working with R and hope You can help me here. My VECM model consist of three endogenous variables and two exogenous variables. When I transform VECM to VAR using vec2var function and try to plot impulse response functions it shows only endogenous variables, because vec2var takes cointegration test results and cointegration was tested between three I(1) variables. So is it possible to plot IRF with those exogenous variables or not really? I tried to use VARXirf, but it doesn't work for me. My data: structure(list(date = structure(c(1546214400, 1548892800, 155131
I have configured node exporter, grafana and prometheus through docker compose. I want to show Memory usage in the dashboard. I want to match the value shown with what is shown in the Ubuntu System monitor. Below are my queries: This is the transform: If I turn of the transform by clicking button, panel gets rendered like this: The value of 8.4 GB is correct one as my Ubuntu System Monitor shows the same. My concern is why it is not showing any gauge representing 8.4 GiB of memory is used (the same way it shows thick red gauge for Total Memory when I click that button). Update It started showi
I'm setting my nginx to listen to port 8080 here's my config file and it works on when I'm accessing with http e.g http://myweb.com:8080/api/. server { listen 8080; location / { proxy_pass http://localhost:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_ssl_server_name on; } } However when I try to access it with https on Insomnia it returns SSL connect error. When I try curl https://myweb.com:8080 --verbose It returns something like this: * Trying {myipadress}:8080... * Connected to myweb.com (ipaddress) port 8080 (#0) * ALPN: offers h2,http/1.1 * TLSv1.3 (OU
How would you get from this vec2 uv = fragCoord/iResolution.xy; // <0, 1> uv -= 0.5; // <-0.5,0.5> uv.x *= iResolution.x/iResolution.y; // fix aspect ratio to this? vec2 uv = (fragCoord - .5 * iResolution.xy) / iResolution.y; // Condense 3 lines down to a single line! Well, I tried breaking it down into components ((fragCoord.x-0.5) / iResolution.x) * (iResolution.x / iResolution.y) ((fragCoord.y-0.5) / iResolution.y)
While working on my wordpress theme, inside my Site Health Status I am facing an error of The REST API is one way that WordPress and other applications communicate with the server. For example, the block editor screen relies on the REST API to display and save your posts and pages. The REST API did not process the context query parameter correctly. Currently I am using Wp- version 6.2. I have tried all possible methods to the best of my knowledge. I am not able to understand what it is going wrong. Any help would be appreciated.
I am connecting to ssh machine in which I have installed Docker. From the ssh machine I will use Devcontainer. I am using Devcontainer most of the time. Some time I need to run commands from terminal in ssh. During that time i am doing 'Reopen folder in ssh' and run commands in terminal. Is there a way that I can open one terminal in SSH and one in Devcontainer at the same time?
I am trying to run a a project with docker-compose and I am getting mkdir: cannot create directory ‘/home/postgres/pgdata/data’: permission denied. This problem only occurs on windows, on macOS the setup works fine. I think it has to do with user permissions on windows for docker. The compose config: volumes: volume_name: name: data postgres: container_name: postgres image: timescale/timescaledb-ha:pg14.7-ts2.10.2-latest ports: - "5433:5432" volumes: - ./data:/home/postgres/pgdata env_file: - ./.envs/.local/.postgres Any idea what I could do to fix this? Thanks in advance, help is much appreci
I have a simple question that I haven't found or understood anywhere on the internet. I'm a novice powerapps user. I would like to click a button and clear all fields (inputText, checkbox, etc) from a gallery. Details: My data source is some excel tables; this gallery (not a collection or a form for god's sake) has some information from my data source (tab_lista). I tried the following command without success: Mybutton OnSelect ForAll(BrowseGallery1.AllItems; If(ThisRecord.Checkbox1.Value = true;Checkbox1.Value = false);; ThisRecord.InputText1.Text = "" ) Segue uma imagem.
I am using the latest apt packages on Ubuntu 18.04.6: Boost 1.65.1 valgrind-3.13.0 Here is the test file; it intentionally doesn't include any tests: // temp.cpp #define BOOST_TEST_MODULE some_name_here #include <boost/test/included/unit_test.hpp> The source is compiled then linked like this (dumped from cmake): /usr/bin/clang++-12 -O3 -DNDEBUG -Wall -Wextra -O0 -g -std=gnu++17 -o temp.o -c temp.cpp /usr/bin/clang++-12 -O3 -DNDEBUG temp.o -o temp /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so I invoke valgrind on the executable: valgrind --leak-check=full --show-leak-kinds=all --tra
When one builds a Flutter web app with flutter build web --release --web-renderer=html then the app does not load (blank screen) when one views it through Safari 16.4 on desktop. It works if one clicks on "Allow WebGL in Web Workers" in the Safari settings (Develop > Experimental Features > Allow WebGL in Web Workers). Can anyone help me with what can be done to fix this with the html web renderer, please? There is no problem on Chrome nor on an older version of Safari (for example 15.5). There is also no problem when one uses --web-renderer=canvaskit, but I can't use that because I need a fas
I have been using Tailwind CSS in VS Code. But suddenly I did notice I can't see the color preview.. I opened the laptop and started working again in the project. I disabled all the extensions and reenabled again. . I restarted the laptop. In the input.css file when I switch the language mode to CSS . I can see it. But when I switch it back to postCSS , I can't see it again . ( @tailwind base; @tailwind components; @tailwind utilities; ) throws an unknown error. I am expecting to see the color preview boxes on the left side again
I’m planning to bring my birth certificate to Japan because the ward office requires you to have original copy of it in order to get married. Would it be possible if I bring it just for that purpose? I’m only staying in Japan for a month and get back to Canada to start my gf’s immigration process so she can live here in Canada with me. Will I have trouble with the Japanese immigration? My other option is sending it through DHL or FedEx to my gf’s address.
I have a project in UIKit, with a Calendar. I implemented a slide animation every time the month is changed. This was the code: /// Desliza una vista hacia derecha o izquierda /// /// - Parameter direccion: Dirección de desplazamiento func deslizarHacia(_ direccion:DireccionDeslizamiento, tipoTransicion: CATransitionType = .push) { let slideInFromLeftTransition = CATransition() // Customize the animation's properties slideInFromLeftTransition.type = CATransitionType.push slideInFromLeftTransition.subtype = convertToOptionalCATransitionSubtype((direccion == .derecha) ? CATransitionSubtype.fromL
I am currently working on an UnrealEngine 5 project and have run into an issue. The project works perfectly fine in the editor and the only warning I see during the packaging process are: “VerifyImport: Failed to find script package for import object 'Package /Script/SQLiteExt”, “VerifyImport: Failed to find script package for import object 'Package /Script/InterchangeFactoryNodes”, and “VerifyImport: Failed to find script package for import object 'Package /Script/InterchangePipelines” After the packaging process is complete though, the game instantly crashes upon loading after opening the ex