Object-Oriented Programming

Confused about parentheses and brackets? Here’s help

Parentheses and brackets set off portions of text from the whole for various purposes.<p>Parentheses, appearing almost exclusively in pairs, are usually …

JavaScript

Python QuerySelectField and request.form returning dict key, not dict value

I am not a programmer yet (working on it - this is my first big project), so sorry for the messy-ugly code.I have some issues using QuerySelectField …

Python Programming

How to select all mesh regions in ParaView OpenFOAM case using python scripting?

Loading an OpenFOAM case in ParaView using python is straight forward with:<p>However, by default only the internalMesh mesh region is selected in the …

Python Programming

Scala-spark: how to randomly choose an item in a column of arrays with different sizes

Given a dataframe with a column of arrays of integers with different sizes:I would like to generate a new column with a random chosen item in each …

Python Programming

Abstract data type vs Data Type vs Data Structure, with respect to object-oriented programming

It is my understanding that a data structure is essentially a blueprint which contains all the information necessary to create a final product …

Programming

(Django) Cannot update/add into manytomany field

So I currently in a project where I want the team leaders to update their groups and add/remove members but it doesn't work and idk why I tried doing …

Python Programming

issue with connecting mysql with ruby on rails

When I try to connect database at the moment I got this an error:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that …

Ruby on Rails

Having Django slug before admin URL

I’m having trouble correctly parsing a slug before the admin urls.I currently have a slug at the very beginning of all my urls. The slug regex works …

Python Programming

Scala defaulting typed list to be of type String

Scala 2.12 here. I have the following classes:Now I'm trying to write a "provider" method that returns a List[AbstractCollectors]:This code gives me …

Python Programming

Giving public permission to azure container

I am using rest API to create a container in Azure storage. I want to give public permission or container permission to it to upload blob into the …

DevOps

NullBooleanField doesn't show None state after saving in the django admin

I'm trying to represent a simple NullBooleanField in the django.BOOL_CHOICES = [(True, 'Yes'), (False, 'No'), (None, "Unknown")]handicap_accessible = …

Python Programming

How to implement a custom Django login?

I'm trying to develop a custom login in Django instead of using Django inbuilt login system. I don't know whether it's possible or not. Is this …

Python Programming

Django/Python convert string to Model filter with '=' in result

I'm working on writing test_templates so that I can very quickly write my tests, as I realized I was duplicating the same code with different …

Python Programming

Is there anyway to take an opencv display window and save it to a GUI window?

Just a general question. Instead of having a popup window appear when I use imshow, is it possible to have this window open up in a GUI application …

Python Programming

putting files into MongoDB using Gridfs in python

In ubuntu 17.04 I'm using these commands to put a file into mongodb using gridfs in python3 environment:<p>but after run the script I get this error:<p>why …

MongoDB

Django: my css static path does not exist

My link looks like this:This is fine because it gets the path I want which is href="/static/css/background.css". I use {% load static}. I have …

Web Development

Parse and process CSV in Django

Apologies in advance since I'm new to Django (and I've also had to freshen up my Python skills). I'm trying to make a simple example of uploading a …

Python Programming

Password is not encrypted in django

When I create a new user, his password remains unencrypted in the database.Here is my models.py file:serializers.py:views.py:managers.py:in …

Python Programming

Why cannot I determine in code that an object is of a DataTime type?

Python Programming

Why Doesn't This Python/Django Unit Test with Mock Objects Work?

I'm having trouble understanding how to write a Python 3 unit test that uses mock objects to mock an instance method for a Django model. Here are my …

Python Programming

Custom social sing up form

I have a custom Form already working for normal sign in (with email), now i have the problem with the social one.Following the official …

Python Programming

Test Regex with new line string \n via PHPUnit

I created a php library that parse content via regex. One of this regex is '#\n-{3,}#' to parse --- only with an break, a new line, before.<p>I have …

PHP

Iterating rows and collecting values for output. Numpy and Python 3.6

I am trying to collect each ID and the data for that ID for thousands of inputs. I have a degree in Econ with a minor in GIS, so I never nurtured my …

Python Programming

String getting incorrectly parsed to datetime format in Scala

I have a method as follows:Here, I am trying to identify the <i>date format</i> of an input string. The way I go about it is to iterate over all dateFormats …

Programming

How to override last() in django model manager

So I have some repeated logic in my django app that I would like to refactor move into the model layer, specifically in the last() method:I basically …

Python Programming

beanstalk django http5xx error

hey I'm trying to deploy my first django app on aws beanstalkbut I'm getting an :I'm following this tutorial: …

Python Programming

dragging points in matplotlib interactive plot

I have created an interactive plot using matplotlib and following this answer. The plot uses sliders in order to allow the user to control the …

Python Programming

Code Your Way to the Top of the Career Ladder with 10 Courses (105+ Hours) of Training on Python, PHP, Ruby & More

<b>Python Tutorial: Learn by Coding</b><p>Go From Beginner to Master of Python with 7.5 Hours of Hands-On Training<p>Cement your coding skills by learning Python: …

Python Programming

[TA Deals] Save big on the Python 3 Bootcamp Bundle

Interested in picking up Python as a new programming language, or even your first language? We’ve got a full bootcamp bundle that will help you get …

Android News

Django Templateform issue with multiple databases

I am trying to using multiple databases in my Django project.As you can see I am trying to use the custom database rather than default. In the other …

Databases