Jump to content

Adonis4000

Member
  • Posts

    87
  • Joined

  • Last visited

Everything posted by Adonis4000

  1. Half the time when I try to shutdown/restart my pc running windows 11 I get a "This app is preventing shutdown" message. The app it shows that is preventing shutdown has no name, only an icon, that I can't identify. It doesn't always appear, and I can force shutdown, but it's rather annoying and suspicious since I can't identify it. I can't screen capture on the shutdown screen, so I remade the Icon in ms paint. Hopefully someone can help me find out what and why I get that app. Note that it doesn't appear in the manager.
  2. Hello, I want to make an application that has integrated microsoft office word, excel, outlook etc. How would I go about doing that? I found there is the Office Common Javascript API so i was thinking of making the application using the React library in JS, but I'm not sure if that provides what I want for my application. To be clear, I want my users to be able to access their emails from outlook from within my app, and also be able to create word (excel, powerpoint etc.) documents from within my app. Is the javascript api what I am looking for? I there something better for my needs? Am I restricted to the use of javascript to make my application? It is worth noting I plan to make the application useable on multiple platforms, so at the moment I am considering making it as a web application so the back end can be the same for any platform (windows, android, ios, mac (maybe linux as well)). Any advice would be greatly appreciated.
  3. You are correct. Thanks for the tip. The error has been: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at "my-link". (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200. I tried changing my code to allow cross orign requests, but I still can't get it to work. $(document).ready(function () { $.ajax({ url: 'my-link', type: 'GET', // dataType: "html", beforeSend: function(xhr) { xhr.setRequestHeader('Access-Control-Allow-Credentials', 'true'); xhr.setRequestHeader('Access-Control-Allow-Headers', 'Content-Type'); xhr.setRequestHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS'); xhr.setRequestHeader('Access-Control-Allow-Origin', '*'); }, success: function(data) { $(document).html(data); } }) .done(function() { alert( "success" ); }) .fail(function() { alert( "error" ); }) .always(function() { alert( "complete" ); });; }); Now I also get this error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at "my-link". (Reason: CORS request did not succeed). Status code: (null). To my understanding, this is sort of a security feature and I would need to set Access-Control-Allow-Origin to allow my website on the target websites server, but I don't see why. I'm just trying to get the html code that everyone has access to when they load the website.
  4. My end goal is to get the html code of a website and modify it in some way to suit my needs. I can't however for the life of me, get the html. Here is my code so far. Note, that I am using JQuery. index.html <!DOCTYPE html> <html lang="en"> <head> <title>Document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <script src="EditHtml.js" type="text/javascript"></script> </head> <body> <p>Placeholder Text</p> </body> </html> EditHtml.js $(document).ready(function () { $.ajax({ url: 'my-link', type: 'GET', success: function(data) { $(document).html(data); } }) .done(function() { alert( "success" ); }) .fail(function() { alert( "error" ); }) .always(function() { alert( "complete" ); });; }); The alert is always "error" and then "complete". I tried multiple urls and nothing worked.
  5. You are right, hdmi 1.4 does have a much higher bandwidth, so that should be it. Thanks
  6. My laptop doesn't have a display port. What it does have is an HDMI 1.4 port and a USB 3.2 Gen 1 (5 Gbps) port. My display in 1080p 144Hz. So my options are: HDMI or Usb to display port directly or Usb to a usb hub and then to display through a displayport cable Note I need a usb hub anyway to get ethernet. I am curious as to if a usb c to displayport cable has any difference to a normal one and whether adding a usb hub in the equation is going to affect the performance.
  7. You could probably add functionality for testing laptops battery life claims, as well as performance when in "best battery life" mode unplugged vs "best performance" mode when plugged in to a power source.
  8. Tried that and it still doesn't work I just didn't bother because it's my username lol What did work for whatever reason is finding the frame by ID instead of by XPATH. No idea why, but it works now, so thanks anyway
  9. I'm using selenium 4 and python 3.10 I'm trying to write a script to access a website, however that website has one of those annoying pop-ups for cookies that I want to reject. My first instinct was to launch Chrome with all cookies disabled, which did get rid of the pop-up but for some reason when using any link other than https://www.domain.com, such as https://www.domain.com/map/search=a&b/etc, it prompts an error 404. So my next move was to just get the element for "Reject All", but turns out I can't because it is part of an iframe. So I tried switching to that iframe first, but I always get an error. Here is my code: import time from os import closerange from selenium import webdriver from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait as wait options = webdriver.ChromeOptions() options.add_experimental_option('excludeSwitches', ['enable-logging']) # The way I had disabled all cookies # options.add_experimental_option('prefs', {'profile.default_content_setting_values.cookies': 2}) driver = webdriver.Chrome(options=options, service=Service(ChromeDriverManager().install())) driver.get('https://www.domain.com/searchTerms/etc') wait(driver, 5).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH, '/html/body/div[2]/iframe'))) # manageCookies = driver.find_element(By.XPATH, '/html/body/app-root/app-theme/div/div/app-notice/app-theme/div/div/app-home/div/div[2]/app-footer/div/div[2]/app-action-buttons/div/button[1]') # manageCookies.click() k=input("press close to exit") The code to interact with the button has been commented out and I still get the error. Here is the error: [WDM] - ====== WebDriver manager ====== [WDM] - Current google-chrome version is 102.0.5005 [WDM] - Get LATEST chromedriver version for 102.0.5005 google-chrome [WDM] - Driver [C:\Users\adoni\.wdm\drivers\chromedriver\win32\102.0.5005.61\chromedriver.exe] found in cache Traceback (most recent call last): File "c:\Users\adoni\Desktop\GitHub\Web\auto4.py", line 21, in <module> wait(driver, 5).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH, '/html/body/div[2]/iframe'))) File "C:\Users\adoni\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\support\wait.py", line 87, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: Stacktrace: Backtrace: Ordinal0 [0x00DAD953+2414931] Ordinal0 [0x00D3F5E1+1963489] Ordinal0 [0x00C2C6B8+837304] Ordinal0 [0x00C59500+1021184] Ordinal0 [0x00C5979B+1021851] Ordinal0 [0x00C86502+1205506] Ordinal0 [0x00C744E4+1131748] Ordinal0 [0x00C84812+1198098] Ordinal0 [0x00C742B6+1131190] Ordinal0 [0x00C4E860+976992] Ordinal0 [0x00C4F756+980822] GetHandleVerifier [0x0101CC62+2510274] GetHandleVerifier [0x0100F760+2455744] GetHandleVerifier [0x00E3EABA+551962] GetHandleVerifier [0x00E3D916+547446] Ordinal0 [0x00D45F3B+1990459] Ordinal0 [0x00D4A898+2009240] Ordinal0 [0x00D4A985+2009477] Ordinal0 [0x00D53AD1+2046673] BaseThreadInitThunk [0x7681FA29+25] RtlGetAppContainerNamedObjectPath [0x777A7A7E+286] RtlGetAppContainerNamedObjectPath [0x777A7A4E+238]
  10. After some time, I remember installing msys for the gcc/g++ compiler, and it had python 3.9.11 in it for whatever reason. I just moved the system environment variables path for the older python version below the one for the 3.10.4 and it's pretty much fixed. In cmd if I do python --version it now shows the newest version and vscode can find the libraries installed.
  11. I installed python 3.10.4 but the system python is still 3.9.11. This means when I do pip install numpy for example, it is installed in the 3.10.4 version but not the 3.9.11 This may be because my laptop is a hybrid with both an ssd and a hard drive, or because I have also installed Anaconda 3.8.5 In vscode, under Python: Select Interpreter I have: Python 3.10.0 64-bit C:\abc\AppData\etc\Python310\python.exe Recommended Python 3.8.5 ('base') D:\abc\anaconda3\python.exe Conda Python 3.10.0 64-bit C:\abc\AppData\etc\Python310\python.exe Global Python 3.9.11 64-bit (system) C:\msys64\mingw64\bin\python.exe The main issue I'm tried to resolve is that vscode doesn't find the pip installed libraries. I could change it's settings so that the Python: Default Interpreter Path is set to the 3.10.4 one, but that is just avoiding the underlying problem of why does the 3.9.11 version even still exist. Can anyone make sense of this? Thanks
  12. This was it. After creating a new project vs code worked fine. Dev C++ happened to use an older version of the compiler and thus worked fine, which only added to my confusion. In my header files I always start with: #ifndef TIME #define TIME class time { ... }; #endif which I thought was supposed to cover cases such as this but apparently not? I'm not entirely sure what that does now.
  13. I have a simple 3 file C++ project that I want to be able to compile and build in VS Code. A main file(main.cpp), a header file(time.h) and its .cpp equivalent(time.cpp) Problem is, VS Code doesn't recognize that these files are related. All functions of the class "time" are marked as errors and it fails to compile. I have tested the 3 files in Dev C++ and they work, so the problem is with VS Code. I have installed MSYS2 and GCC compiler and added the msbuild file path the user environment variables path. In VS Code I did create a tasks.json, launch.json and c_cpp_properties.json file and tried messing with them to make it work but it still doesn't work. When I run the build task is says "Build finished with error(s)." and the main file on it's own doesn't compile due to the errors. What am I missing?
  14. Yeah, I'm just asking what is the standard way of doing things in the industry. What would be a standard contract/agreement? Also I happen to do have 12 hours to spare so I might actually watch that if it's good.
  15. I have a friend that needs a website and I want to take the responsibility of creating it. This raises a few questions about a developers relationship with a client. What if I was to treat my friend as a client? How do you go about creating a website? I saw that website like WordPress offer a way to create websites but I don't really like it. I'd prefer to learn HTML and CSS. How do you guys go about this? How do you host websites for a client? Also, this situation raises a few questions about my client relationship. Once I create the final website, do I get a single paycheck for the work done and every time they want something changed pay me a fee? Or do they pay me a standard monthly fee for the website? Who "owns" the website? Who pays for the hosting service? Do I take the responsibility of hosting the website and act as an intermediate for its payment, or do I give them access to the hosting service to pay it directly? What would be your fees as an independent developer? (Lets say for a simple 6 page website). Of course, in my case he is friend so I'm still not going to charge him a lot, or a monthly fee, but I would still want to know how to treat future clients.
  16. Why won't it be adequate? It did take some time to set up, but as long as I have the compiler and C++ extension is it any different?
  17. I have been using vscode for some time now and I want to keep using it. In Dev-C++ which my university uses, they create a c++ project which automatically creates and .dev file as a driver. How to do I create that in vscode? What even is that file?
  18. I am genuinely curious as to what keyboard do you guys actually use. Do you have a generic membrane keyboard or a mechanical one? If mechanical, what size and switches? What was its cost? Did you build it yourself and was it worth it? What do you use it for?
  19. I was thinking that since I am able to change the extension at the end of a .pdf to .txt and then back to .pdf without any loss of data, in theory I should be able to copy the text from the pdf file to another text file and then change that file to .pdf. The reason for doing this would be to easily copy files using python, which there probably is a better way of going about (I have to yet to do proper research on it), but I am genuinely curious as to why it doesn't work. When copying manually, I can see the copy is always a bit different that the original. When copying with python, I get the error: 'charmap' codec can't decode byte 0x9c in position 470: character maps to <undefined> Any help to understand why this doesn't work is appreciated.
  20. Alcohol is poor conductor of electricity. Not sure if this applies to beer since it's not pure alcohol, but it is probably better than if it was water.
  21. You have a 250GB M.2 NVME SSD for $53 and an additional 1TB SSD for $115. That's a total 1TB and 250GB for $168. I thing it would make more sense and give you a lot fewer headaches if you just bough a larger M.2 NVME SSD and omitted the other one. The Samsung 970 Evo Plus is: 1TB for $127 2TB for $220 Personally I thing you should go for the 2TB version since games and raw video footage for editing takes up a lot of space.
  22. Yes, I was following this https://docs.github.com/en/get-started/quickstart/fork-a-repo quickstart guide. I tried making local changes to the files and then git push origin new-branch1 which prompts the error: failed to push some refs to 'https://github.com/Tony-4k/Spoon-Knife.git' I assume that by editing my local files it makes changes to the main instead of the branch I want to push to. How can I edit a branch? I also tried git push origin :new-branch1 which deleted the "new-branch1" that I had created.
  23. It prompted me to login for verification but something went wrong and I just closed the tab. The process though did not end, that's why Git Bash got "stuck". I'm not sure what remote means to be honest, or how to add the remote name to push. In the end to push changes from local to my GitHub account I used: git commit -am "changed abc" git push Thank you very much for confirming this.
  24. I am currently learning how to use GitHub. So far I have seen how to create branches and issue pull requests etc. and I am now looking at how to fork repos. My question is, what is the intended way to use GitHub? Say I want to contribute to a project. Do I fork it to my account, clone it on my pc, work on it and when I'm done commit and push the changes to my account repo and create a pull request to the original repo? I am also having trouble pushing changes from my pc to my GitHub account using Git Bash. I was able to do it with the Desktop app, but I still want to know how to do it with Git Bash. In an attempt to push the changes with Git Bash I wrote "git push", and Git Bash got stuck like in the pic attached. For future reference, how do I unstuck Git Bash?
×