on-internet

Processing very large list of dataframes by chunks in R

Let's say I have a list of 1000 dataframes: 1000_dataframe_list And because of memory problems with spread(), I need to process this list by chunks. To process the whole list, I'm using: " out_df <- do.call(rbind.data.frame, 1000_dataframe_list) data_wide <- spread(out_df, Sample, expression) My idea is to process the list in chunks, then merge all chunks. As you can see, data_wide is a basically a matrix with the first column being rownames, but I don't think this matters very much. How can I process the 1000_dataframe_list in a way that I can divide it by any number of parts I need (10, 100,

Join the discussion →

How do I access a custom tag in a company's 10q filing?

My issue concerns how to access non us-gapp tagged company data in, for example, a 10-q for the ticker MSFT. See this 10q filing: https://www.sec.gov/ix?doc=/Archives/edgar/data/789019/000095017023054855/msft-20230930.htm Normally, I can just use the following code based on the us-gaap key to get the value: dep_amort_data = companyFacts.json()['facts']['us-gaap'].get('DepreciationDepletionAndAmortization', {}) However, some stocks, like MSFT, use custom tags for certain values: When substituting in 'msft' for 'us-gaap'(and the other language) in the previously stated code, no value is found, s

Join the discussion →

Validação antes de enviar um formulário

imagine o seguinte cenário: em um formulario só será habilitado o botao enviar se a soma solicitada no input estiver correta. Problemas que estou tendo: Ao recarregar a pagina 'caso tenha digitado o valor errado em um teste anterior' não limpa a mensagem informando que o valor esta errado. Quando coloco o valor correto habilita o botão enviar, porem seria mais correto já executar o envio do formulário. <?php $valor = '25'; $disbled='disabled'; $info=''; if(isset($_POST['formvalor'])){ $resposta=$_POST['resposta']; if($resposta != $valor){ $info='O valor esta errado!'; }else{ $disbled=''; } } ?

Join the discussion →

Leitura de arquivo com formato fixo com linhas de diferentes padrões

Estou usando o pandas para a leitura de um arquivo txt com formato fixo, entretanto, o arquivo tem um tamanho de coluna para as linhas que começam com a letra A e outro tamanho para as linhas que começam com a letra B. Em VBA foi fácil implementar, pois como ele lia linha por linha, eu coloquei um if para testar o primeiro digito e ler a linha de um jeito ou de outro, entretanto em Python não sei como fazer. import pandas as pd largurasColunasTipoA = [26, 25,25,25,4,30,14,30,14,257] largurasColunasTipoB = [14, 4, 15, 10, 17, 17, 17, 17, 10, 4, 4, 6, 298] caminhoTotal = caminho + arquivo baseLi

Join the discussion →

This exception was thrown because the response has a status code of 404 and RequestOptions.validateStatus was configured to throw for this status code

In flutter I tried to POST data using the DIO package, I posted some data: final response = await dio.post( "127.0.0.1/toko_grosir_api/create.php", data: { 'name': '${event.product.nameProduct}', 'price': '${event.product.priceProduct}', 'desc': '${event.product.descProduct}', 'stock': '${event.product.stockProduct}', 'date': '${event.product.dateProduct}', 'category': '${event.product.categoryProduct}' }, options: Options( contentType: Headers.formUrlEncodedContentType, ), ); and I am trying to receive data using PHP as Rest API with the following code: $nameProd = isset($_POST['name']) ? $_P

Join the discussion →

unable using C++23 with CMake+clangd+MSVC+VSCode

I'm using CMake generator and MSVC compiler with VSCode editor while programming C++, but something troubled me when I try to switch language support extension to clangd. It works correctly set CXX_STANDARD to C++20, but when I tried upgrading to C++23, CMake generates "-std:c++latest" instead of "-std:c++23" to compile_commands.json. In my source files, both macro __cplusplus and _MSVC_LANG equals to 201402L, not 2023xxL. (But I can normally compile C++23 features) Do CMake and clangd support c++23? I found that there was -std:c++23 support for Clang in its official documentation, But it eith

Join the discussion →

MessagePack: how to serialize without types information?

I try to serialize an object which contains a lists of another objects. I would like to send serialized data to front-end part of my application using SignalR. For serialization I use MessagePack library as a nuget package. My application is written in NET 8 (backend) and frontend uses ReactJS. I have tried serialize some data this way: var serializedData = MessagePackSerializer.Typeless.Serialize(graphic); But when I send this data over SignalR and in my browser I could see names of classes inside binary data like on the image below: (https://i.sstatic.net/qnmEM.png) In this image you could s

Join the discussion →

Trying to nest a SUM(FILTER inside a SUMIFS function

New to the wonderful world of excel formulas and hoping someone has a solution to the below: I am trying to use SUM/FILTER functions inside a SUMIF function to return results filtered by the column in the filter section as well as those matching a specific date in a date column This is a formula that will be used across multiple reports so it's important to be able to filter by the column header The =SUM(FILTER part of this formula works fine and returns the total value of the column However when I try to add this to a SUMIFS Function and further filter the data so that only the total from res

Join the discussion →

How to remove automatic highlighting of messages for reply in a telegram bot

After the dialogue with the bot is completely completed in a telegram conversation, the message from the bot is automatically highlighted for an answer. How to fix this? I use Python telebot library def screenshot_request(message, bot, problem, userstate, buttons): if message.text.lower() == 'да': bot.send_message(message.chat.id, 'Отлично! Отправьте фото скриншота:') bot.set_state(message.from_user.id, userstate.with_screen, message.chat.id) elif message.text.lower() == 'нет': problem_message = '\n'.join( [f"{key}: {value}" for key, value in problem.items()]) markup = buttons() bot.send_messa

Join the discussion →

How to check if a best offer was accepted on a sold listing on ebay? (Python + Beautifulsoup)

I am trying to write a simple Flask API in python that grabs all the sold listings for a particular item on Ebay. All I want it to do it take in a search input string, and it will return all the sold listings. So for example, if I search "oakley sunglasses" it will return all the recently sold sunglasses with the title, price, date sold, and whether a best offer was accepted or not. I was able grab all the information using beautifulsoup, but unfortunately I've been stuck trying to figure out the best offer part. If a best offer was accepted, the price would have a strikethrough in it. My init

Join the discussion →

WordPress URL rewriting; How to match URL parameters

I have URL: https://www.example.com/articles?page=2. I need to rewrite it to WordPress format: https://www.example.com/index.php?category_name=articles&paged=2. I tried with rewrite rule like this: add_rewrite_rule('^(.+?)\?page=([0-9]+)$', 'index.php?category_name=$matches[1]&paged=$matches[2]', 'top'); However this does not work. I have legacy CMS that I try to migrate to WP and I need to keep old URL structure. Suggestions?

Join the discussion →

python list.append with for loop

I was wondering if it is possible to add a for loop in a append function. used code now: for Master_ii in ExcelSheet_IO.iter_rows(min_row=3): if Master_ii[0].value != '': #Collect column A to S from excel in to Imported_Variables (A=[0]-X=[18]) Imported_Variables.append([Master_ii[0].value,Master_ii[1].value,Master_ii[2].value,Master_ii[3].value,Master_ii[4].value,Master_ii[5].value,Master_ii[6].value,Master_ii[7].value,Master_ii[8].value,Master_ii[9].value,Master_ii[10].value,Master_ii[11].value,Master_ii[12].value,Master_ii[13].value,Master_ii[14].value,Master_ii[15].value,Master_ii[16].valu

Join the discussion →

Pytrends Not working in 2024 using in Python

Currently I´m working in a project involving use of pytrends for extract data from google trends. Last month it worked fine but now It gets all times I tried the same error. pytrends.exceptions.TooManyRequestsError: The request failed: Google returned a response with code 429 The code for testing this is following one: from pytrends.request import TrendReq import pandas as pd # import plotly.express as px import time import json # Create pytrends object pytrends = TrendReq(hl='de-DE', tz=360) # 'De' means consider Germany as the search area # Set your keyword and time frame keyword = ['Analyti

Join the discussion →

ModuleNotFoundError: No module named 'aiogram'

I work in VS Code and I was asked to change the telegram bot script from python-telegram-bot library to aiogram. I've installed that via 'pip install aiogram' and still getting errors like ModuleNotFoundError: No module named 'aiogram' and I don't know what to do. import logging from aiogram import Bot, Dispatcher, types from aiogram.types import ParseMode from aiogram.utils import executor import requests TELEGRAM_BOT_TOKEN = 'XXXXXXXX' COINGECKO_API_KEY = 'XXXXXXXX' logging.basicConfig(level=logging.INFO) bot = Bot(token=TELEGRAM_BOT_TOKEN) dp = Dispatcher(bot) # Function to get token price

Join the discussion →

Is transatlantic or transpacific freighter travel still possible?

Before 2020, a small number of companies would offer a small number of passenger seats on freighters, including on transatlantic and transpacific routes. Have any returned post-pandemic or are they all permanently defunct? As of 2024: freightercruises.com notes that the only large-pre-covid provider has decided to permanently cease passenger services, langsamreisen.de notes that passenger transport on cargo ships is unfortunately still limited to a few active routes (between Europe and Africa or within Polynesia), zylmann notes only routes within Europe or between Europe and Africa, grimaldi n

Join the discussion →

Error "was named in package.xml, but was not found in zipped directory" on salesforce deployment

anyone here experienced facing this following issue on salesforce deployment process: ⁠An object '....' of type '.....' was named in package.xml, but was not found in zipped directory Already looking the answer from internet but still didn't found clear solution. And I got totally almost 1000 error like that hope anyone can help me to fix this. Thanks in advance ⁠

Join the discussion →

the space on the right side of a site made with Bootsrap is not going away?

the white space on the right side of a site I made with Bootsrap did not go away no matter what I did. If there is a solution, please let me know <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Contact | Enba Camping</title> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> <link rel="stylesheet" href="style/style.css"> <link rel="preconnect" hre

Join the discussion →

How to get Python output in VS Code similar to Jupyter

I'm trying to write some Python code and would like to see the Output of that code, like I would in a Jupyter Notebook, except in VS Code. I'm not looking to replicate the IN: / OUT: cells of a Jupyter Notebook, just have all my Python Code in the code pane and its output in the Output or Terminal Window. For example if I run the following in Jupyter I see the contents of df, including the column names, the rows, info about the DF import pandas as pd df = pd.read_csv('test.csv') df If I run that same code in VS Code it defaults to the terminal window and I don't see the df output even when cli

Join the discussion →

How to get Python output in VSCode similar to Jupyter

I'm trying to write some Python code and would like to see the Output of that code, like I would in a Jupyter Notebook, except in VSCode. To be clear I'm not looking to replicate the IN: / OUT: cells of a Jupyter Notebook, just have all my Python Code in the code pane and it's output in the Output or Terminal Window. For example if I run the following in Jupyter I see the contents of df, including the column names, the rows, info about the DF import pandas as pd df = pd.read_csv('test.csv') df If I run that same code in VSCode it defaults to the terminal window and I don't see the df output ev

Join the discussion →

How to stop onclick action in JavaScript?

When the button is clicked, I want the spiners to appear for 3 seconds and then disappear. I can make it visible but I can't make it invisible again. function stoploading() { document.getElementById('loading').style.visibility = 'visible'; } <button class="btn btn-danger d-inline-flex align-items-center" type="button">ATTACK</button> <div class="col text-white m-5 px-5"> <div id="loading" class="spinner-border text-primary load_icon" role="status"> <span class="visually-hidden">Loading...</span> </div> </div> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bo

Join the discussion →

Visa on arrival in Egypt

We are travelling to Egypt on Sunday. My Wife is a Canadian/British citizen with a Canadian passport, but has the indefinite right of entry in it. Will she be able to get a visa on entry in Sharm El-Sheikh?

Join the discussion →

Getopt::Long, Optional Arguments, and Greediness

I'm trying to write a program that has an option that takes an optional argument, in such a way that it accepts options in the same fashion with the exact same behavior as perl -i or git --color. Unfortunately Getopt::Long doesn't exactly work that way and I can't get it to. Allow me to explain. Example #1: If you run perl -i .bak, it does not use .bak as a backup file extension for editing in-place, as perl -i.bak would. Example #2: If you run git diff --color always, it does not specify always for the --color option; for that you must use --color=always. I call that "non-greedy". I cannot fi

Join the discussion →

warning C5050 incompatible environments - _UTF8 defined in C++ 20 modules Qt project

I am working on a small project to get used to C++20. For the GUI I use Qt 6.5 and I split parts into hopefully meaningful modules. When building I get multiple warnings of the same kind and currently I am trying to clean up the code. But I realized I don't really understand how to fix the problem yet. The warning is warning C5050: Possible incompatible environment while importing module 'b3m.common': _UTF8 is defined in current command line and not in module command line And as I said, many of these are for every module consumed (some self-defined and some without a name, I assume these are t

Join the discussion →

401/Unauthorized while doing REST vs Coinbase Advanced Trade API/Javascript

I am querying coinbase advancedTrade using node/javascript, using their most recent v3 api. They recommend using axios, then implement an authentication scheme using jsonwebtoken. I have created an api token on coinbase, with appropriate trading permissions (a trading token), then I store it on a USB. This creates an appropriate Bearer token, as far as I can see. My definitions of secret and key names are ok, but I get a 401/Unauthorized. Here is my authentication routine and REST request, with an ensuing response. Code I am using, doing authentication before RESTful call. const axios = requir

Join the discussion →

【レシピ】生米を炒めて作る本格派中華粥【お粥研究家の粥日記2022/11/20】 | おかゆワールド.com

生米を炒めてから煮込む本格派の中華粥をお鍋いっぱいにつくりました。 寒い季節の週末はなんだか煮込み料理がつくりたくなるのです。 家のことをととのえつつ、火を見守って、ときどき混ぜて。たしかに時間はかかるんですけど、中華粥をお鍋いっぱいにつくって、小分けにして冷凍しておくと、それだけでしあわせを保存...

Join the discussion →

Publish ASP.NET Core Razor Pages

Can't find a way to just publish a single cshtml page (no code-behind cshtml.cs involved). It feels like I'm missing something. This should be a super common thing to do. So, when I choose to publish single file option from VS, it deploys both cshtml and cshtml.cs files. But for Razor Pages, it all compiles to dll. There aren't actual pages after publish. So, it's possible to achieve this instead of publishing the whole project for small html changes? Thank you. Please see the screenshot

Join the discussion →

Stable Diffusion ComfyUI Problem with IPAdapter and Clip_vision

It has to be some sort of compatibility issue with the IPadapters and the clip_vision but I don't know which one is the right model to download based on the models I have. I located these under clip_vision and the ipadaptermodels under /ipadapter so don't know why it does not work. Error: Error occurred when executing IPAdapterApply: 'NoneType' object has no attribute 'encode_image' Error occurred when executing IPAdapterApply: 'NoneType' object has no attribute 'encode_image' File "C:\Users\Valknut\Documents\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute output

Join the discussion →

Unable to run haarcascade_frontalface_default.xml in docker

I have made a simple scala application that uses OpenCV-4.8.0 that extract face from image via Haar-Cascade (haarcascade_frontalface_default.xml). The above functionality working fine on local machine. Now I'm trying to achieve same functionality through dockerization, for this I've followed, following steps. Here is the build.sbt, in which we are creating an Image via sbt-native-packager and then installed OpenCV-4.8.0 via dockerCommands. import com.typesafe.sbt.packager.docker._ ThisBuild / version := "0.1.0-SNAPSHOT" ThisBuild / scalaVersion := "2.13.4" lazy val root = (project in file(".")

Join the discussion →
Older stories