I need to shedule a facebook post using an image. It should appear in the planner tool of the Meta Business Suite. I found this example, but I can't figure out how to use an image and set a publication date. Depencency: <dependency> <groupId>com.facebook.business.sdk</groupId> <artifactId>facebook-java-business-sdk</artifactId> <version>17.0.3</version> </dependency> Code: import com.facebook.ads.sdk.*; import java.io.File; import java.util.Arrays; public class PageFeedPost { public static void main (String args[]) throws APIException { // https://github.com/facebook/facebook-java-business-sdk
I have this two pieces of code that works today: This one gets a blob file I retrieved from backend and open a 'print dialog' on current tab: var blob = new Blob([response.body], {type: 'application/pdf'}); const blobUrl = URL.createObjectURL(blob); const iframe = document.createElement('iframe'); iframe.style.display = 'none'; iframe.src = blobUrl; document.body.appendChild(iframe); iframe.contentWindow.print(); This one opens a new tab to download a file (which is returned as inline by the server): var form = document.createElement("form"); form.target = "_blank"; form.method = method; form.
I met this error in loss function. An example below: import torch device = "cuda" if torch.cuda.is_available() else "cpu" a = torch.Tensor([[-10.3353, -28.4371, 2.0768, -4.2789, -8.6644, -6.0815], [-10.3353, -28.4371, 2.0768, -4.2789, -8.6644, -6.0815], [-10.3353, -28.4371, 2.0768, -4.2789, -8.6644, -6.0815], [-10.3353, -28.4371, 2.0768, -4.2789, -8.6644, -6.0815]]).to(device) b = torch.Tensor([ -100, -1, -100, 2456]).long().to(device) loss = torch.nn.functional.cross_entropy(a,b,ignore_index=-1) print(loss) Then the error is: -------------------------------------------------------------------
I want to create a custom TabBar in a MAUI app (Android and Windows). I want the upper edges to be rounded and ading some other customizations. What I've tried: The shell's TabBar control is not customisable at all... I was experimenting with a shell custom renderer but I am not really sure how I could achive a custom look in MAUI and how to implement it. Instead of using the shell's TabBar I created a custom TabBar which derives from the ContentView class and with a TapGestureRecogniser I navigated to a new page when an image was clicked. And I used this custom control in every page at the bo
I have written a PowerShell script to do some operation. When the operation is completed, I want the script to send a mail using the Send-MailMessage cmdlet. For this I used Google's app password feature. But I'm not confident about storing the app password as plain text in the script itself. I can encrypt somehow and store it in the script or separate file, but people can still see that password. Even if I encrypt the password, the decryption login will be there in the script itself. One other way I think would be useful is passing the encrypted password as an environment variable but 1. I co
I want to use python and the PyADS library to find all the variables available of a TwinCat system/PLC. PyADS has a function called get_all_symbols which almost does what I am looking for. Here you see the variables I want to get in Python. ADS variables visible in TwinCAT When i use the get_all_symbols() function I see all the variabels from within the MAIN. Now for the problem. I can read the integers, booleans and other primitive variables in the MAIN. Result of reading the variables The problem is that I can't get the variabels within a STRUCT or FB in the MAIN using the get_all_symbols()
When using Visual Studio Code on Windows 10, I encountered an issue where the terminal's font was messed up. There's a space between each letter, rendering the terminal very difficult to read. When I uninstalled VS Code entirely, and re-installed it, the issue persisted. How can I reset the user settings for VS Code back to default settings?
I would like to use a variable to match patterns with a regular expression. The patterns I want to match are: >crypt29_1 and >crypt29_2 my $var = 'crypt29'; my $pattern = ">".$var."_"."*"; $string =~ m/$pattern/; matches >crypt29_1, >crypt29_2 as well as >crypt290_2 and >crypt2914_2. How can I make the match specific to match only >crypt29_1 and >crypt29_2.
I would like to use a variable to match patterns with a regular expression. The patterns I want to match are: >crypt29_1 and >crypt29_2 my $var = crypt29 my $pattern = ">".$var."_"."*"; $string =~ m/$pattern/; matches to >crypt29_1, >crypt29_2 as well as >crypt290_2 and >crypt2914_2. How can I make the match specific to match only >crypt29_1 and >crypt29_2.
I am trying to convert a PDF file to docx using command line using: soffice --infilter=“writer_pdf_import” --convert-to “docx:MS Word 2007 XML” *.pdf The Input PDF contains multiple pages. The Output Docx file when opened has the contents of the pages over written onto one another into a single page. Hence, the number of pages in the Docx file is only 1. Section of the document is shown in the Image below. I expect each page on PDF written to corrosponding page in Docx. Additional Info: Version: LibreOffice 7.5.4.2 36ccfdc35048b057fd9854c757a8b67ec53977b6 OS: Windows
I need to join 2 tables of 3, and to do that, I need to convert a datetime to string, but I don't know how, the query: OBS: the code is running, but it just shows null results select distinct aa.column1, aa.column2, cc.column3, from table1 aa left join table3 cc on cc.shift_original_name = aa.shift join table2 bb on aa.column1 between (cc.start_time) and (cc.end_time) the aa.column1 is the datetime, and the cc.start_time/cc.endtime are string. I tried using left join, timestamps, convert, and couldn't do it.
I'm trying to deploy to vercel using vite but I keep getting the following error: error TS2688: Cannot find type definition file for 'vite/client'. The file is in the program because: Entry point of type library 'vite/client' specified in compilerOptions Error: Command "npm run build" exited with 2 I've tried adding: "typeRoots": ["./node_modules/@types/"] And installing different vite versions: v4.4.0 and v4.1 but the problem continues. Here's my client-side package.json, any ideas: { "compilerOptions": { "paths": { "@/*": ["./src/*"] }, "target": "ESNext", "useDefineForClassFields": true, "l
I have a Python bot for forwarding messages (formatted text, photos with captions, videos, stickers) to groups where the bot is added. However, I'm experiencing issues with forwarding photos, stickers, and similar content. How can I fix this? import telebot from telebot.types import Message bot_token = '(I hide it)' ALLOWED_USER_ID = 746422763 bot = telebot.TeleBot(bot_token) def is_bot_in_group(chat_id): with open('groups.txt', 'r') as file: existing_chat_ids = [line.strip() for line in file.readlines()] return str(chat_id) in existing_chat_ids def add_group(chat_id): with open('groups.txt',
We deployed a node application on cloud run and it is working fine. Now we have got a new requirement of uploading files of size Up to 5GB and for some business reasons we won’t be able to use cloud storage. After some initial research we found that cloud run has limit of 32MB and this limit is only for HTTP1 requests but not HTTP2 requests. You can find that in below URL. https://cloud.google.com/run/quotas#cloud_run_limits So we upgraded our application to support HTTP2 and deployed it. below is the sample code. const spdy = require('spdy'); const fs = require('fs'); const adminRouter = requ
I am beginner to mainframe applications and want to perform a simple POC for understanding where I want to run a sample Cobol application on Hercules mainframe emulator with terminal 3270, application also consist of JCL, BMS, VSAM files so, also want to know how can I connect the emulator to database and store VSAM files. Please share information on this. I have installed Hercules emulator, Crypto term terminal and setup the emulator and reached to TSO main menu. I have application folder and want to run this folder on emulator. Please help me out.
I need to add another website (a subdomain of a current host permission) to the host_permissions key in the manifest.json file. Will doing so give users a notification to allow the changes or uninstall the extension when the update reaches them? I'm changing the host_permissions, but I'm not sure what will happen when I release the changes to current users.
I have two classes that use generics in Java in order to perform conversions between units of measure. In the BaseUnitConverter class I have two warnings, from the intellij IDE, that say: Raw use of parameterized class 'InstantiatorUnitConverter' Unchecked assignment: 'org.cnr.lambertools.utils.unitconverter.InstantiatorUnitConverter' to 'org.cnr.lambertools.utils.unitconverter.InstantiatorUnitConverter<T>' Unchecked call to 'InstantiatorUnitConverter(Object, T, String)' as a member of raw type 'org.cnr.lambertools.utils.unitconverter.InstantiatorUnitConverter' for methods: protected final <M,
I am trying to scrape saved comments and posts on my reddit profile. I have made a solution with selenium and python and it is providing results. But it is utterly slow. First it scrolls through the whole 1000 saved comments and posts(which takes around 41 mins) and then it starts adding the links to a text file, which is also very slow. As it have to reload the data at top again. All the posts and comments are dynamically loaded, also when new sections are loaded previous get hidden from the page. A better approach would be to save the links right after they are loaded, but I am not sure how
I'm working on an ASP.NET API project where I have multiple controllers, and I want to prepend a common prefix to all the URLs before the controller route. For example, I want all my API endpoints to have the prefix "/appapi/" followed by the controller name. I know that I can achieve this by manually adding the prefix in each controller using the [Route]attribute, like [Route("appapi/MyController")]. However, this requires updating every controller, which can be time-consuming and error-prone. Is there a more efficient and centralized way to add this common prefix to all the URLs without modi
In the R package visNetwork, if an edge connects a node to itself, is it possible to control where the edge contacts the node? library(visNetwork) nodes <- data.frame(id = 1:2) edges <- data.frame(from = c(1, 1), to = c(1, 2), arrows = c("to,from", "to")) visNetwork(nodes, edges) I tried different settings and it seems that the orientation of the same-node edge is always as displayed above. It may be able to edit the points of contact manually but it would be better to be able to set the contact points using an R script.
I am using google pubsub to publish a lot of records which is happening concurrently, but after few dozens of publishes, I get an error : concurrent map write. I have read that I am suppose to use sync.Map{} or sync.Mutex, but I haven't found an example that helped me understand how to use it in my specific situation. Here is a code snippet that causes me problems: md := metadata.Collect(ctx) records, err := s.emailRepository.SetCurrentVersionWithEnsure(ctx, md.GetTransactionId(), valid) if err != nil { return err } for _, value := range records { go s.pub.PublishAction(md, value) } return nil
This may be a dumb question but i have to ask. I hav several IP addresses for devices in our network that i need the hostnames for. I want to use nmap to get these hostnames, however, when i run a ping scan, intense scan, etc.....it never pulls up the host name. Is this not possible? I have tried ping scans Intense scans & Slow comprehensive scan Is there something im missing? I heard that this was possible through nmap, i feel like im just missing a very simple detail.
I have a fully working React project that runs server with Express and gets data from mongodb. I made deploy on my repo in github and then created an account in render.com, connected my repo with render and chose Web Service which should run the backend. In the column Build command I pointed npm run build and in Start command I chose npm run server (that runs my server) and then I tried to build my app but I keep getting this kind of error: ... Jun 20 12:35:24 AM ==> Running build command 'npm run build'... Jun 20 12:35:25 AM Jun 20 12:35:25 AM > [email protected] build /opt/render/project/src Jun 20
I'm trying to add a sidebar to my Avalonia UI application, but I'm not sure how to do it. I've looked at the documentation and some examples, but I'm still having trouble. Here's what I've tried so far: <Grid> <SplitView x:Name="SplitView"> <SplitView.Pane> <TextBlock Text="Pane content"/> </SplitView.Pane> <Grid> <views:MainView/> </Grid> </SplitView> </Grid> This code creates a simple layout with a sidebar on the left and main content on the right. However, I'm not sure how to make the sidebar collapsible or resizable. Can anyone help me with this? Thanks in advance!
I'm having trouble joining two datasets data = races_df.join(runs_df, on='race_id', how='right') X = data[data.columns[:-14]] ss = preprocessing.StandardScaler() X = pd.DataFrame(ss.fit_transform(X),columns = X.columns) y_won = data[data.columns[-14:]].applymap(lambda x: 1.0 if 0.5 < x < 1.5 else 0.0) print(X.shape) print(y_won.shape) when i run the code i get error message pandas.errors.MergeError: Not allowed to merge between different levels. (1 levels on the left, 2 on the right) Does anyone know the correct code that wont produce this error thx
I'm looking for a way to display the ages of a person in Years and Days. EX: someone born January 26, 1934 is 89 years and 149 days. How would this be calculated in Javascript? Thanks, John I can calculate it in years, months and days. just don't know how for it to be just years and days. function getAge(date_1, date_2) { //convert to UTC var date2_UTC = new Date(Date.UTC(date_2.getUTCFullYear(), date_2.getUTCMonth(), date_2.getUTCDate())); var date1_UTC = new Date(Date.UTC(date_1.getUTCFullYear(), date_1.getUTCMonth(), date_1.getUTCDate())); var yAppendix, mAppendix, dAppendix; //------------
im stuck with an automation workflow on Make.com I'm trying to create a flow that starts with Google Forms, once a form has been submitted, it will automatically add a new row in Sheets, and then send them a confirmation email. However, I want to send myself an email when the first 3 forms are created, with the details that they have entered in the form. As of right now, i have everything set up correctly except the final email. I can't figure out how to pull the 3 rows of data from Sheets. I can only pull the most recent row. Does anyone have any experience with this? Thanks! Tried using diff
I'm applying for a machine-readable visa to Bangladesh and I'm stuck on the last question of part 1, where it says "organisation". Does anyone know what this means? What does it wants me to put in the "other" boxes? It’s not letting me move to the next stage without filling it out.
I have the beginning of a GUI application written in Rust. I'm using the Py03 crate to run a python function inside my Rust app. I have my python function (test_func) inside a file "test_funcs.py" and this file is located in the same directory as my Rust binary. I also have a copy of this file in the root directory too. The problem is, whilst Py0 is able to find my .py file, it can't seem to find the function I'm trying to call. Here is the key bit of code: MyAppMessage::SecondButton => { Python::with_gil(|py| { let my_module = PyModule::new(py, "test_funcs").expect("Could not load Python modu