How to import or include data structures (e.g. a dict) into a Python file from a separate file

I know I can include Python code from a common file using import MyModuleName - but how do I go about importing just a dict? The problem I'm trying to solve is I have a dict that needs to be in a...

Populating One Select Box Based on the Selection in Another Select Box - JQuery?

I am trying to populate one select box based on the selection made in the first select box. I've looked online, and found a lot of helpful information on hard-coded options, but I need my options...

Blackberry PIM why is contact creation so slow?

The following code, which i took from the blackberry forum, takes almost 26 minutes to create 2000 random contacts using the BB PIM API on an 8500 series set. Does anyone have any idea why it...

MySQL using IN/FIND_IN_SET to read multiple rows in sub query

I have two tables, locations and location groups CREATE TABLE locations ( location_id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, name VARCHAR(63) UNIQUE NOT NULL ); INSERT INTO locations...

How to use a cursor on a SQLite database

I was following a tutorial to make a database cursor, but I have hit an issue; when I write the code below I get no option to add a query after the database's name: public String...

Convert Stripe API response to JSON using stripe-php library

I'm accessing customer data from the Stripe API, which I'd like to convert to JSON. Usually I'd convert an object to an array and use json_encode() but I don't seem able to in this case, even when...

Filtering store data in ember

I am trying to filter some hard coded data in an Ember route which is being provided by mirage and having trouble. Either Ember moans at my syntax (when trying to use filter on the store) or it...

How to Implement Autocomplete Textbox in MVC

I am facing a problem in autocompleting the textbox vith hardcoded data, my json "Search" method does not fire i have been search a lot of code implement it into my project but did not get any...

google maps auto open infoWindow

I'm having a problem getting info windows on my google map to auto open I have followed a tutorial here... https://www.taniarascia.com/google-maps-apis-for-multiple-locations/ Everything is...

R: install.packages error

I'm just trying to simply install a package, and the whole thing is FUBAR. Worked fine earlier this week. Haven't touched firewall settings or anything, and have tried to install both "readxl" and...

How to count unique records by two columns in pandas?

I have dataframe in pandas: In [10]: df Out[10]: col_a col_b col_c col_d 0 France Paris 3 4 1 UK Londo 4 5 2 US Chicago 5 6 3 UK ...

How to add a label and textbox based on combo box selection on a userform in excel

I am currently working on a userform to create an order for users at a company to send to my dept. At the moment i have come to a standstill as i am struggling to work out the following. I have a...

Django get value from JSON data

I am trying to play with an open fda API. So far everything works well. Issue is coming for nested JSON data. Here is my Json data: { "seriousnessother": "1", "reportduplicate": { ...

Incorrect results returned from a partial UK postcode

I am having an odd issue with Google Maps which their documentation doesn't seem to cover. We have a page in our application that returns a list of engineer locations ordered by distance when an...

Getting error deserialising JSON to List<T>

I want to deserialize this json to a List of Product objects but i get this error: Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"})...

How can I make part of my test reusable so that it can be used or called again in other future tests using Cypress Javascript

Background Hi, I am new to cypress and I have the following code which allows a specified user type (out of 4 total) to login. As this is one of the main tests, instead of having to copy and paste...

TypeError: append() missing 1 required positional argument: 'other'

I have several dataframes (of the same shape) that I want to append creating one larger data-frame. Tee individual data-frames all have the type: C-Mastersheet.xlsx <class...

Web Scraping in R (using rvest) - looping over multiple years

I am new to web scanning in R. I am using rvest I can get the match record for an individual year by manually going to each year as follows; ## The...

How can I accept cookies on a particular site?

When writing a basic search test for a job website in Selenium Java, I ma having problems when trying to accept the cookie warning displayed on the site. The site has 2 cookie notifications, a...

How to replace values by labels in data.frames from spss files?

I have to read a sav file I use the package haven library(haven) dataset<- read_sav("datafile.sav") In the console I can see the labels : dput(head(voyages$portdep)) structure(c(50422,...

Group and sum data by common prefix from column value with different length prefixes and inconsistent delimiters in a Pandas dataframe

I am new to using Python and Pandas, but have been trying to automate some of the data cleaning/merging for reports of mine. So far I've had success in building up the combined file of all...

is it possible to have a SelectInput that does not have a dropdown arrow?

new to using Rshiny. My question mainly considers the look of the drop down bars. There's 2 dataframes, one has car data and the other shows distances. And the drop down bars depend on what has...

how to actually use ical in spring

I've been try to use ical in spring now i have implement two files, one for create an event another one for sent email after the event created. here is my code: public class cal { public static...

Subfigures or Subcaptions with knitr that span more than one page?

Very similar to this post. However I have more plots than that fit on one page causing the remaining plots to be cut off after pressing Knit. Does any one know how to solve this by plotting the...

Why am I getting the "'...' is not empty" error mostly when using pipe and basic functions?

I am very new to R but seem to be getting this error more and more frequently, especially when using the pipe operator: "Error: ... is not empty. We detected these problematic...

How do you make a choropleth map with Mapbox GL JS, and an object?

I'm struggling to find the right information in order to create a choropleth map using mapbox. Their examples are very vague. I currently have a geojson showing the polygons for all the UK...

Vuelidate check array has items on blur

I am using nuxt-vue-select to allow users to select multiple objects form an array locations and then I want to use Vuelidate to try and validate that at least one item in the array has been...

How to add 'Circle' size legend to Folium map (in python) and how to annotate text so it's visible in all cases?

Below find my piece of code. I have a map of Europe and some cities I want to mark and their population size. I want to mark those cities with 'Circle' and the size should correspond to the scaled...

Column Name Shift using read_csv in Dask

I'm attempting to use Intake to catalog a csv dataset. It uses the Dask implementation of read_csv which in turn uses the pandas implementation. The issue I'm seeing is that the csv files I'm...

Relevant tags