Recent Questions - Stack Overflow |
- I am New to Python and I am getting a Syntax error in a code I thought was correct
- AJAX request sending null to controller
- Variable not defined even though I did define it [closed]
- fix javascript navigation probleme
- Vue Cli Electron: env file missing in release
- Count unique rows GROUP(ed) BY different columns than used in DISTINCT ON
- Count how many times a category appears with other categories
- List of Lists of Lists to dataframes R
- jQuery counter starts only in viewport
- Error to retrieve data in PHP received object array from android retrofit2
- LOGGING in .NET 5 multiple constructors with dependency injection
- How to replace string occurrences in python file?
- how to calculate number of values appeared in a string of list of lists
- Share with anyone on the web interactive python jupyter notebook with dependent files and functions in another file (.py): Colab or something else?
- Could not cast value of type '__NSDictionaryI'
- PyInstaller + tkdnd/tkinterdnd2 "Unable to load tkdnd library" when launching frozen exe. Works when launched from script
- (JavaScript/CEP) Is it possible to get the origin of my page on InDesign?
- Implementing a "temporarily suspendable" concurrent loop in C++
- pass the two zone_id values dynamicaly into the resource "aws_route53_record" "cert_validation"
- install pytorch c++ api CUDA11.4 for ubuntu
- Update existing rows with values of new row if given field is identical
- Application logs in, but redirects back to login
- How to read XML data and write to Excel sheet in Python for Selenium Automation
- Python not finding own directory, "ModuleNotFoundError: No module named ..." (Spyder IDE)
- spring core aws messaging Notification template not binding the message properly
- Why Electron spawns a process per each window?
- SignalR in ReactJS page works just with reload
- Paginate result using select 2 ajax remote data
- Can't see indexedDB database in mozilla developer tools
- Javascript remove all occurrence of duplicate element, leaving the only one that is unique
I am New to Python and I am getting a Syntax error in a code I thought was correct Posted: 27 Sep 2021 08:17 AM PDT Please what is wrong with this code? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AJAX request sending null to controller Posted: 27 Sep 2021 08:16 AM PDT I have the following Ajax request But I can not access this information from the controller. The strange thing is that if I insert a breakpoint with xdebug, it says the variable $newData has a value (which is the value I expected it to be). However if I try and access this variable within my code I get an error message (Severity: Notice Message: Trying to access array offset on value of type null). I have read posts of people with similar issues and tried the suggested fixes but none seem to work for me. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variable not defined even though I did define it [closed] Posted: 27 Sep 2021 08:16 AM PDT I'm making a paint program and there's an option to change the color of the paint. Here's my example -> VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fix javascript navigation probleme Posted: 27 Sep 2021 08:16 AM PDT please can you help me with this pages navigation script. on mobile when I click on the next page number 2 or 3.. it stays on the first page. on desktop it works very well and I navigate from one page to another without any problem, but on the phone the navigation does not work. the page numbers are displayed but when I click on a next page number it stays on the first page. can you, please, find a slolution to this. I suck at javascript, I hope someone shows me where the problem is, and offers me a solution. thank you from the bottom of my heart. here is the code : function showpageCount(json){var thisUrl=home_page_url;var htmlMap=new Array();var thisNum=1;var postNum=1;var itemCount=0;var fFlag=0;var eFlag=0;var html='';var upPageHtml='';var downPageHtml='';for(var i=0,post;post=json.feed.entry[i];i++){var timestamp1=post.published.$t.substring(0,19)+post.published.$t.substring(23,29);timestamp=encodeURIComponent(timestamp1);var title=post.title.$t;if(title!=''){if(itemCount==0||(itemCount%pageCount==(pageCount-1))){if(thisUrl.indexOf(timestamp)!=-1){thisNum=postNum}if(title!='')postNum++;htmlMap[htmlMap.length]='/search?updated-max='+timestamp+'&max-results='+pageCount}}itemCount++}for(var p=0;p<htmlMap.length;p++){if(p>=(thisNum-displayPageNum-1)&&p<(thisNum+displayPageNum)){if(fFlag==0&&p==thisNum-2){if(thisNum==2){upPageHtml=''+upPageWord+''}else{upPageHtml=''+upPageWord+''}fFlag++}if(p==(thisNum-1)){html+=''+thisNum+''}else{if(p==0){html+='1'}else{html+=''+(p+1)+''}}if(eFlag==0&&p==thisNum){downPageHtml=' '+downPageWord+'';eFlag++}}}if(thisNum>1){html=''+upPageHtml+' '+html+' '}html=' Pages '+(postNum-1)+''+html;if(thisNum<(postNum-1)){html+=downPageHtml}if(postNum==1)postNum++;html+='';var pageArea=document.getElementsByName("pageArea");var blogPager=document.getElementById("blog-pager");if(postNum<=2){html=''}for(var p=0;p<pageArea.length;p++){pageArea[p].innerHTML=html}if(pageArea&&pageArea.length>0){html=''}if(blogPager){blogPager.innerHTML=html}}function showpageCount2(json){var thisUrl=home_page_url;var htmlMap=new Array();var isLablePage=thisUrl.indexOf("/search/label/")!=-1;var thisLable=isLablePage?thisUrl.substr(thisUrl.indexOf("/search/label/")+14,thisUrl.length):"";thisLable=thisLable.indexOf("?")!=-1?thisLable.substr(0,thisLable.indexOf("?")):thisLable;var thisNum=1;var postNum=1;var itemCount=0;var fFlag=0;var eFlag=0;var html='';var upPageHtml='';var downPageHtml='';var labelHtml='';var thisUrl=home_page_url;for(var i=0,post;post=json.feed.entry[i];i++){var timestamp1=post.published.$t.substring(0,19)+post.published.$t.substring(23,29);timestamp=encodeURIComponent(timestamp1);var title=post.title.$t;if(title!=''){if(itemCount==0||(itemCount%pageCount==(pageCount-1))){if(thisUrl.indexOf(timestamp)!=-1){thisNum=postNum}if(title!='')postNum++;htmlMap[htmlMap.length]='/search/label/'+thisLable+'?updated-max='+timestamp+'&max-results='+pageCount}}itemCount++}for(var p=0;p<htmlMap.length;p++){if(p>=(thisNum-displayPageNum-1)&&p<(thisNum+displayPageNum)){if(fFlag==0&&p==thisNum-2){if(thisNum==2){upPageHtml=labelHtml+upPageWord+''}else{upPageHtml=''+upPageWord+''}fFlag++}if(p==(thisNum-1)){html+=''+thisNum+''}else{if(p==0){html=labelHtml+'1'}else{html+=''+(p+1)+''}}if(eFlag==0&&p==thisNum){downPageHtml=' '+downPageWord+'';eFlag++}}}if(thisNum>1){if(!isLablePage){html=''+upPageHtml+' '+html+' '}else{html=''+upPageHtml+' '+html+' '}}html=' Pages ('+(postNum-1)+')'+html;if(thisNum<(postNum-1)){html+=downPageHtml}if(postNum==1)postNum++;html+='';var pageArea=document.getElementsByName("pageArea");var blogPager=document.getElementById("blog-pager");if(postNum<=2){html=''}for(var p=0;p<pageArea.length;p++){pageArea[p].innerHTML=html}if(pageArea&&pageArea.length>0){html=''}if(blogPager){blogPager.innerHTML=html}}var home_page_url=location.href;var thisUrl=home_page_url;if(thisUrl.indexOf("/search/label/")!=-1){if(thisUrl.indexOf("?updated-max")!=-1){var lblname1=thisUrl.substring(thisUrl.indexOf("/search/label/")+14,thisUrl.indexOf("?updated-max"))}else{var lblname1=thisUrl.substring(thisUrl.indexOf("/search/label/")+14,thisUrl.indexOf("?&max"))}}var home_page="/";if(thisUrl.indexOf("?q=")==-1){if(thisUrl.indexOf("/search/label/")==-1){document.write('</script>')}else{document.write('</script>')}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Vue Cli Electron: env file missing in release Posted: 27 Sep 2021 08:16 AM PDT I'm building an app with Electron, using Vue-Cli-Electron. Locally I've got access to the .env.local file, but when I publish, the file .env.production, is not packaged and the variables in it are missing. Reading around there is no much (nothing) I have to do about this file, it should simply be there and picked automatically... or I'm missing something. I'm using the following command to publish: and the release works well but the env variables are not there. Any idea? Thanks! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Count unique rows GROUP(ed) BY different columns than used in DISTINCT ON Posted: 27 Sep 2021 08:16 AM PDT I'm sure this has been asked over and over, but I can't quite find a simple example that I can fully grok. I'm trying to deduplicate (do a Let's say I have a table with the following information:
I would like to first get unique records with different
I know how to do those two things separately ( The closest thing I've been able to get are groups, but they show one record by each That query ^^ shows: | date | region | count | | |:------:|:-----:|:------------:|:-----:| | 2021-09-01 | Murica | 1 | I think this is the first 001 | 2021-09-01 | Murica | 1 | I think this is the second 001 | 2021-09-01 | Yurop | 2 | I think this is the first Yurop: 002 | 2021-09-01 | Yurop | 2| I think this is the second Yurop: 003 | 2021-09-02 | Yurop | 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Count how many times a category appears with other categories Posted: 27 Sep 2021 08:16 AM PDT I have a pandas dataframe with
I want to create two tables: one in absolute values and another with the percentages of how many times a category appears in the same ID with other categories Category A and C appear together 3 times (75%) Category A and B the same. And so on.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
List of Lists of Lists to dataframes R Posted: 27 Sep 2021 08:16 AM PDT I need to convert a triple nested list to data frames. The outer list is a list of lists of lists. using returned_obj[1] and then an answer to a list of lists to df question has not worked for me. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jQuery counter starts only in viewport Posted: 27 Sep 2021 08:16 AM PDT I have a counter stats, which works fine, but how can I write a condition that it should start only if the parent is in viewport? Maybe my syntax is wrong or I don't understand how to connect what I got. Any advice is appreciated. This is what I got for now: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Error to retrieve data in PHP received object array from android retrofit2 Posted: 27 Sep 2021 08:16 AM PDT
in android studio debug shows data as follows
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
LOGGING in .NET 5 multiple constructors with dependency injection Posted: 27 Sep 2021 08:16 AM PDT Background I am new to C# dotnet and I need to enable logging into my project. Therefore, I followed some online materials including Microsoft documentation. My implementation is slightly different than the example in the document as I have another constructor with dependency injection. Then I found Stackoverflow article that explains how to handle dependency injection with multiple constructors. After that, I implemented the code as below. in Program.cs Then I created a sample controller and implemented the logger as below. It does work only when the are commented in the Program.cs Then I implemented a logger in a class that has a constructor already with dependency injection. Results are breakpoint of the
If further information is needed, I can provide them. Question 1: Why Homecontroller logger is not working when clear providers and add console in program.cs ? Question 2: How to avoid exception and print the log in the ExampleHelper class ? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
How to replace string occurrences in python file? Posted: 27 Sep 2021 08:16 AM PDT I have a CSV file which contains lines of sql entries. Each sql entry, contains message which are SOH delimited and are tag=value pairs. Issue:
Output: I've also tried regex = re.compile ("[=]") and then loop into line reader and modify, but just returns all [=] in the print. Desired output: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
how to calculate number of values appeared in a string of list of lists Posted: 27 Sep 2021 08:17 AM PDT how to calculate number of values appeared in a string of list of lists required output a is in my input, the required output is b how to do it using python | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Posted: 27 Sep 2021 08:17 AM PDT What are the free solutions for sharing an interactive python Jupyter notebook with user-defined module and dependent input files? I have python Jupyter notebook that serves as a code interface for non-technical users. The code itself is in another file One approach I consider implementing is to use Google Colab, Google Drive, GitHub, and
How to improve or simplify this approach? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Could not cast value of type '__NSDictionaryI' Posted: 27 Sep 2021 08:16 AM PDT I m using this code to call my rest web service. But if I try to decode the result of web service call I received error. This is the error that I can print: I generated OrderStore.swift class from https://app.quicktype.io/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Posted: 27 Sep 2021 08:16 AM PDT In my script I am using When I launch the script - everything works. But when I freeze the project to a single EXE with PyInstaller, and run it, I get this error: I tried this solutions already:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(JavaScript/CEP) Is it possible to get the origin of my page on InDesign? Posted: 27 Sep 2021 08:17 AM PDT I'm working on an InDesign plugin and I would like to know if it is possible to get the origin of my page? I was thinking about something like this : Thank you in advance for your help ! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Implementing a "temporarily suspendable" concurrent loop in C++ Posted: 27 Sep 2021 08:16 AM PDT I'm writing a program whose main thread spawns a worker thread that performs some work, sleeps for a set amount of time in an infinite loop, i.e. the worker thread executes: Now, I would additionally like to be able to temporarily completely disable this worker thread from the main thread, i.e. I would like to write the following functions:
What I've come up with is the following: I suppose this works (at least I can't spot any issues), however, I would also like to guarantee that when either of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pass the two zone_id values dynamicaly into the resource "aws_route53_record" "cert_validation" Posted: 27 Sep 2021 08:16 AM PDT I need to get the two zone_id values into the resource "aws_route53_record" "cert_validation"? I need to create those resources dynamicaly from the snippet provided in the yaml file at the bottom of my post. Currently I'm stucked. How can I convert the variable type? I get this error Any help is highly appreciated. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
install pytorch c++ api CUDA11.4 for ubuntu Posted: 27 Sep 2021 08:16 AM PDT I'm trying to use the PyTorch c++ API on an ubuntu 18.04. I've installed CUDA 11.4 and cuDNN 8.2.4.15. The source I'm compiling is available here. compiling CUDA with nvcc works and the cuDNN installation test succeeds. But I am unable to find a good documentation for installing and compiling projects with PyTorch c++ api on Ubuntu. Do you know any god ones? system configurations: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Update existing rows with values of new row if given field is identical Posted: 27 Sep 2021 08:16 AM PDT Sorry everybody, my MySql-knowledge is a bit shaky ... I have a table with (among others) the following columns/values: I do some checks when new rows are inserted: validate email addresses, find doublets with different dist(ributor)ID etc. One of the tasks is "update existing rows with data of the freshly imported row when column "email" is identical" (yes, there can be multiple rows with identical email addresses). At the time this task is performed, the importID of the currently inserted rows is always -1. I tried aliasing with all kinds of variations of or joining with numerous variations of I'm pretty sure one of you can help me find my mistake in thinking/coding ... thank you! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Application logs in, but redirects back to login Posted: 27 Sep 2021 08:17 AM PDT I have a piece of code that do not work, and I cannot understand why. As the subject says, it logs in to Twitter, but redirects back to the sign in button. setupTimeline(); is never executed. I am using twitter4j library, it is at the latest version, 4.0.7. Any ideas anyone? Regards. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
How to read XML data and write to Excel sheet in Python for Selenium Automation Posted: 27 Sep 2021 08:16 AM PDT I have a scenario where I need to get the data from XML file and write the same to Excel sheet and use the same sheet for data processing. I am able to read the data from XML, but not able to insert the same data (records) to an excel file I am using OpenPyExcel for this, please suggest any alternative and help me here. I am not seeing any error though, but nothing is being written to excel sheet | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Python not finding own directory, "ModuleNotFoundError: No module named ..." (Spyder IDE) Posted: 27 Sep 2021 08:17 AM PDT I'm currently trying to run an old github project and am running into an error with Python 3 in Spyder. I have
in my code and am getting a "ModuleNotFoundError: No module named 'nmap_visualizer'" However, the folder that contains db.py is called 'nmap_visualizer. This is my working directory and the file I'm trying to run this code in 'nmap.py' is in the same folder alongside db.py. In PYTHONPATH manager I've selected the nmap_visualizer folder for my path. In 'Preferences' under 'Run' I have 'Default working directory is:' 'The directory of the file being executed'. When I try I do have an init.py file which runs and imports db perfectly fine with | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
spring core aws messaging Notification template not binding the message properly Posted: 27 Sep 2021 08:16 AM PDT I am using spring-boot-2.2.1 along with AWS SNS & SQS. I was publishing a message from SNS to SQS. I am able to receive the message using String but @NotificationMessage is returning null instead of the message body. The same code was working fine when I was using spring-boot-1.5.19 pom.xml Main file SQS listener class In the above listener class, I am able to receive the message but the employee is getting as null. I am sending a message from AWS SNS directly. As I mentioned it was working fine before it stopped working after migrating the spring version to 2.2.1 release. Any help would be really appreciated. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Why Electron spawns a process per each window? Posted: 27 Sep 2021 08:16 AM PDT I'm working on electron app with multiple windows. Let say I have the main one and a few child windows. If I create 20 child windows with google.com open from the main process it spawns around 23 Electron processes(one per each window + GPU process + something else) and consumes around 800 MB in total of memory on my Windows 10 machine. Which is obviously a lot. Task Manager with 23 Electron processes I know this is the way Chromium works - each tab is a separate process so if one is broken the whole browser and other tabs are alive. I have no doubt about that but I've noticed one interesting thing. If I use native And index.html Task Manager with 4 Electron processes Is there any way to have only single process for all child windows if I create them from the main process(first snippet)? It would be great if someone could explain why it works that way. P.S. I'm using electron fiddler with Electron 6.0.2 runtime to run these snippets | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SignalR in ReactJS page works just with reload Posted: 27 Sep 2021 08:17 AM PDT I use signalr in React.Js and have a problem that when I go to the pages by clicking the menu link and redirect with Route, it is not working. The back-end singleton class constructor is not called, but when I refresh a page or type the route manually in the address bar, it is works and connects to the back-end. Why does this happen and can anyone guide me on how should I fix that? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Paginate result using select 2 ajax remote data Posted: 27 Sep 2021 08:17 AM PDT Trying to paginate ajax data using Select2 (v 4.0.6.rc1) so that the user can find more results if not present in the first limit ,using the following but not retrieving data.I 'll appreciate if someone helps me out,there is not much of examples about pagination. i was trying to paginate data using the help of this question Select2 v4 how to paginate results using AJAX its not seems to be working,getting the array but not correct format. JS: PHP | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Can't see indexedDB database in mozilla developer tools Posted: 27 Sep 2021 08:17 AM PDT I can't see the DB I created in indexedDB in Mozilla developer tools. The DB is properly created and with data stored in it because it's possible to retrive them, but doesn't appear in the tools section for indexedDB. Does anybody know why is that and/or how to solve it? Is Mozilla v.40 Thanks in advance. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Javascript remove all occurrence of duplicate element, leaving the only one that is unique Posted: 27 Sep 2021 08:16 AM PDT I want to remove elements that occurr more than once and get the unique element. The array always has 3 elements. Lets say i have an array [2,3,2], then I need to get 3 which is only unique in the array(removing both 2s, because they occur more than once). I have tried with following code, but surely it doesnot work as expected. Thanks! |
You are subscribed to email updates from Recent Questions - Stack Overflow. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment