Afeez Aziz

1

votes
0

answer
302

views

Connecting to a remote DB via SSH for Flask [duplicate]

This question already has an answer here: MySQL connection over SSH tunnel - how to specify other MySQL server? 4 answers PostgreSQL via SSH Tunnel 1 answer I am using Flask,Flask-SQLAlchemy, and Postgres. I have set up the Postgres instance to allow local connection only i.e. can be accessed via...
Afeez Aziz
1

votes
1

answer
606

views

Keyboard shortcut Sublime Text 2?

Does the keyboard shortcut for moving from editor to console back and forth in Sublime Text 2 exist? If so what is it?
Afeez Aziz
6

votes
2

answer
192

views

Reduce Django serialization time

I am doing queries for roughly 100,000 rows with approximately 40 column each. The columns are of combination of float, integer, datetime, and char. The query time is about two seconds, and serialization is taking forty seconds or more, whereas response building is about two seconds too. I am wonder...
Afeez Aziz
22

votes
2

answer
44.9k

views

render_template with multiple variables

I am using Flask(as framework) and MongoDB(as database server). Right now, all i can do is just pass one argument that i got from the database: @app.route('/im/', methods=['GET', 'POST']) def im_research(user=None): error = None if request.method == 'POST': if request.form['user']: user = mongo.db.U...
Afeez Aziz
1

votes
1

answer
321

views

Attach GPU to App Engine Flexible Environment

I am using App Engine to build an API with workers to do Keras-related tasks in the background. Due to the nature of Keras, it is more efficient to use a GPU instead of CPU to do some of deep learning work. I understand that I can use GPU and attach it to Compute Engine but as I would rather to go t...
Afeez Aziz
8

votes
3

answer
470

views

How to speed up a SQLAlchemy Query?

I have a table of over 10 million rows. There are roughly 50+ columns. The table stores sensors data/parameters. Let's say that I need to query data for the whole day or 86,400 seconds. It would need take roughly 20 or more seconds to complete this query. I have added individual indices on a few col...
Afeez Aziz
6

votes
2

answer
1.8k

views

How to import mapbox-gl-draw into Angular 2/4?

I am importing the module in my Angular 2/4 app like this: import { MapboxDraw } from '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw'; and using it in one of the components like this: var draw = new MapboxDraw({ displayControlsDefault: false, controls: { polygon: true, trash: true } }); map.addControl(...
Afeez Aziz