[P] Simple Tensorflow implementation of Multimodal Unsupervised Image-to-Image Translation (MUNIT)
/r/MachineLearning
https://redd.it/8e4765
/r/MachineLearning
https://redd.it/8e4765
[D] Million Dollar Salaries for AI Researchers? Well, Quants Have Seen This Before
https://medium.com/@pycy/million-dollar-salaries-for-ai-researchers-well-we-quants-have-seen-this-movie-before-8e7af51f6c63
/r/MachineLearning
https://redd.it/8e5pmr
https://medium.com/@pycy/million-dollar-salaries-for-ai-researchers-well-we-quants-have-seen-this-movie-before-8e7af51f6c63
/r/MachineLearning
https://redd.it/8e5pmr
Medium
Million Dollar Salaries for AI Researchers? Well, we Quants Have Seen this Movie Before
TLDR: Do it if you enjoy it, don’t do it for the money
Struggling with dynamic forms
I need a form that can dynamically create more fields. I have a select, and I need a number of additional parameters depending on the value of the select.
For example, imagine a select "numberOfParameters" and if the user selects 4, I want 4 new fields. This is made even worse by the fact that these are dependent selects: the options on the second select which generates more fields depends on what has been selected on the first one.
This is proving to be pretty challenging in django, is it safe to do this without forms.py in AJAX/JQuery (which is relatively easy)? Or is there a way to do it normally? (or should I just drop the idea altogether if it isn't safe).
Example of what I mean:
An application for selecting a way to travel to school.
* Users can select a school they go to.
* Depending on which school they choose there are different options for the travel, some school have busses, some only have cars, some even have boats.
* Depending on which way they want to travel, there are more options: trains have option for 1st or second class, cars have options for brand, but also for itinerary, type of fuel, type of music you want to listen to, and boats don't have any options at all.
Thanks for reading.
/r/django
https://redd.it/8e376d
I need a form that can dynamically create more fields. I have a select, and I need a number of additional parameters depending on the value of the select.
For example, imagine a select "numberOfParameters" and if the user selects 4, I want 4 new fields. This is made even worse by the fact that these are dependent selects: the options on the second select which generates more fields depends on what has been selected on the first one.
This is proving to be pretty challenging in django, is it safe to do this without forms.py in AJAX/JQuery (which is relatively easy)? Or is there a way to do it normally? (or should I just drop the idea altogether if it isn't safe).
Example of what I mean:
An application for selecting a way to travel to school.
* Users can select a school they go to.
* Depending on which school they choose there are different options for the travel, some school have busses, some only have cars, some even have boats.
* Depending on which way they want to travel, there are more options: trains have option for 1st or second class, cars have options for brand, but also for itinerary, type of fuel, type of music you want to listen to, and boats don't have any options at all.
Thanks for reading.
/r/django
https://redd.it/8e376d
reddit
Struggling with dynamic forms • r/django
I need a form that can dynamically create more fields. I have a select, and I need a number of additional parameters depending on the value of the...
How can I convert my Jupyter notebooks to organizable and searchable documentation such as devdocs.io?
Hello guys.I have thousands of code snippets and jupyter notebooks.I want to create easily, organizable, searchable documentation(such as devdocs.io) for this Jupyter notebooks.
Are there tools for doing this hard work for me?
/r/IPython
https://redd.it/8e6w43
Hello guys.I have thousands of code snippets and jupyter notebooks.I want to create easily, organizable, searchable documentation(such as devdocs.io) for this Jupyter notebooks.
Are there tools for doing this hard work for me?
/r/IPython
https://redd.it/8e6w43
reddit
How can I convert my Jupyter notebooks to organizable... • r/IPython
Hello guys.I have thousands of code snippets and jupyter notebooks.I want to create easily, organizable, searchable documentation(such as...
flask whoosh alchemy: when or where do analyzers/tokenizers run?
Are texts tokenized > indexed > searched? OR
are full texts indexed > read/loaded > tokenized > searched?
Im trying to index my existing db, still trying to get it to work. But not quite sure how to go about it.
/r/flask
https://redd.it/8e7yph
Are texts tokenized > indexed > searched? OR
are full texts indexed > read/loaded > tokenized > searched?
Im trying to index my existing db, still trying to get it to work. But not quite sure how to go about it.
/r/flask
https://redd.it/8e7yph
reddit
flask whoosh alchemy: when or where do... • r/flask
Are texts tokenized > indexed > searched? OR are full texts indexed > read/loaded > tokenized > searched? Im trying to index my existing db,...
This media is not supported in your browser
VIEW IN TELEGRAM
Prototype for a garage door monitor/controller using MicroPython and an ESP8266
/r/Python
https://redd.it/8e3fix
/r/Python
https://redd.it/8e3fix
Build an Instagram "Pin" Effect in Python with Dlib
https://www.makeartwithpython.com/blog/instagram-pin-effect-in-python/
/r/Python
https://redd.it/8e80rw
https://www.makeartwithpython.com/blog/instagram-pin-effect-in-python/
/r/Python
https://redd.it/8e80rw
Make Art with Python
Build an Instagram “Pin” Effect in Python with Dlib
Using correlation tracking to pin images in video
Why when SageMath was before Jupyter, only Jupyter was "accepted" in the community? What are the differences between them? I'm NOT talking about CoCalc but SageMath the software
/r/IPython
https://redd.it/8e5una
/r/IPython
https://redd.it/8e5una
reddit
Why when SageMath was before Jupyter, only Jupyter was... • r/IPython
2 points and 0 comments so far on reddit
Cron script to re-save all of a model's instances
I have a pre-save receiver that updates a model with some supplemental information. I'll need to run it every day or so.
While messing around in the shell, I noticed that I have to exit out and restart the shell if I make any changes to my receiver (which I anticipate having to do).
Some googling suggested I should use importlib to reload a package, in this case profiles.models. But it's not working as I expected. Here's my script:
import importlib
import profiles.models
importlib.reload(profiles.models)
for i in profiles.models.Score.objects.all():
i.save()
I get the error:
django.core.exceptions.AppRegistryNotReady:
Apps aren't loaded yet.
Does that mean I can't run this outside of an active and running Django server? What's the right way to do this?
---
Bonus question: It seems computationally expensive to do this for every Score instance every time. If I want to select a random sample of 100 of them, would the right way to do so be this?
Score.objects.all().order_by('?')[:100]
/r/djangolearning
https://redd.it/8e5w3r
I have a pre-save receiver that updates a model with some supplemental information. I'll need to run it every day or so.
While messing around in the shell, I noticed that I have to exit out and restart the shell if I make any changes to my receiver (which I anticipate having to do).
Some googling suggested I should use importlib to reload a package, in this case profiles.models. But it's not working as I expected. Here's my script:
import importlib
import profiles.models
importlib.reload(profiles.models)
for i in profiles.models.Score.objects.all():
i.save()
I get the error:
django.core.exceptions.AppRegistryNotReady:
Apps aren't loaded yet.
Does that mean I can't run this outside of an active and running Django server? What's the right way to do this?
---
Bonus question: It seems computationally expensive to do this for every Score instance every time. If I want to select a random sample of 100 of them, would the right way to do so be this?
Score.objects.all().order_by('?')[:100]
/r/djangolearning
https://redd.it/8e5w3r
reddit
Cron script to re-save all of a model's instances • r/djangolearning
I have a pre-save receiver that updates a model with some supplemental information. I'll need to run it every day or so. While messing around in...
How to structure a custom built admin?
Hey guys, my application is getting much more complex and the inbuilt django admin isn't cutting it anymore.
So I've decided to build a custom admin for our most used flows.
How do I go about structuring this custom admin? Do I make a new app called `custom_admin` and house all the functionality in there, or do I just add a new `custom_admin.py` file to all my existing apps? (since I already have a lot of stuff in `admin.py`), or simply write the views in `views.py`?
One example I found is that `saleor` (a django project) have their custom admin dashboard as a separate app https://github.com/mirumee/saleor/tree/master/saleor/dashboard
How do you guys build a custom admin?
/r/django
https://redd.it/8e9bvd
Hey guys, my application is getting much more complex and the inbuilt django admin isn't cutting it anymore.
So I've decided to build a custom admin for our most used flows.
How do I go about structuring this custom admin? Do I make a new app called `custom_admin` and house all the functionality in there, or do I just add a new `custom_admin.py` file to all my existing apps? (since I already have a lot of stuff in `admin.py`), or simply write the views in `views.py`?
One example I found is that `saleor` (a django project) have their custom admin dashboard as a separate app https://github.com/mirumee/saleor/tree/master/saleor/dashboard
How do you guys build a custom admin?
/r/django
https://redd.it/8e9bvd
GitHub
mirumee/saleor
saleor - An e-commerce storefront for Python and Django
Submitting multiple forms at once?
New to flask, hello :)
I have a page with two forms that are passed in as parameters.
return render_template(
'survey.html',
clientDetailsForm=ClientDetailsForm(),
houseDetailsForm=HouseDetailsForm())
I like having them as seperate forms because they represent seperate concepts.
On my survey.html I have a save button which I would like to save the values of both forms.
Additionally I have a "Send Report" button which ideally would first call the save view, then the sendReport view.
How can this be achieved?
Thanks!
/r/flask
https://redd.it/8e9fj1
New to flask, hello :)
I have a page with two forms that are passed in as parameters.
return render_template(
'survey.html',
clientDetailsForm=ClientDetailsForm(),
houseDetailsForm=HouseDetailsForm())
I like having them as seperate forms because they represent seperate concepts.
On my survey.html I have a save button which I would like to save the values of both forms.
Additionally I have a "Send Report" button which ideally would first call the save view, then the sendReport view.
How can this be achieved?
Thanks!
/r/flask
https://redd.it/8e9fj1
Reddit
reddit: the front page of the internet
r/flask: Flask is a Python micro-framework for web development. Flask is easy to get started and a great way to build web sites and web applications.
Android development using Python?
Does anybody know the best way to develop for Android in Python? I've heard about a lot of packages /etc but no clear answer to "what is the best / standard / working".
/r/Python
https://redd.it/8e9wae
Does anybody know the best way to develop for Android in Python? I've heard about a lot of packages /etc but no clear answer to "what is the best / standard / working".
/r/Python
https://redd.it/8e9wae
reddit
Android development using Python? • r/Python
Does anybody know the best way to develop for Android in Python? I've heard about a lot of packages /etc but no clear answer to "what is the best...
Are there any good continuous testing tools ?
Hello !
The C# team at my company is using a proprietary tool called [NCrunch](https://www.ncrunch.net/) which amongst other things allow us to have tests continiously running the appropriate unit tests when a part of the codebase is modified.
After working some weeks on the C# codebase, I found myself missing this feature when coding in Python.
Do you know a good tool for continuous testing for a Python codebase ?
Thanks in advance for your feedbacks :)
[EDIT 1]: We already have set up continuous integration on our [Jenkins](https://jenkins.io/) server.
[EDIT 2]: I do not try to find a replacement for NCrunch, but instead I am looking for its equivalent for Python codebases :)
[EDIT 3]: Teamates told me about [Wallaby.js](https://wallabyjs.com/) which is an continuous testing tool for JavaScript. If this kind of stuff exists for JS, I am confident that it can be done for Python too !
/r/Python
https://redd.it/8ea9lx
Hello !
The C# team at my company is using a proprietary tool called [NCrunch](https://www.ncrunch.net/) which amongst other things allow us to have tests continiously running the appropriate unit tests when a part of the codebase is modified.
After working some weeks on the C# codebase, I found myself missing this feature when coding in Python.
Do you know a good tool for continuous testing for a Python codebase ?
Thanks in advance for your feedbacks :)
[EDIT 1]: We already have set up continuous integration on our [Jenkins](https://jenkins.io/) server.
[EDIT 2]: I do not try to find a replacement for NCrunch, but instead I am looking for its equivalent for Python codebases :)
[EDIT 3]: Teamates told me about [Wallaby.js](https://wallabyjs.com/) which is an continuous testing tool for JavaScript. If this kind of stuff exists for JS, I am confident that it can be done for Python too !
/r/Python
https://redd.it/8ea9lx
www.ncrunch.net
NCrunch
NCrunch is the ultimate live testing tool for Microsoft Visual Studio and JetBrains Rider. It runs your unit and integration tests so you don't have to, providing inline code coverage and performance metrics while you type.
sqlalchemy queries
I am learning about flask and sqlalchemy and I have a question about the ways to make queries. I have seen three types of querys: cls.query, db.session.query and model.query. I want to know what are, if there are, the differences between these three methods? Or do the do the exact same thing?
/r/flask
https://redd.it/8eb8go
I am learning about flask and sqlalchemy and I have a question about the ways to make queries. I have seen three types of querys: cls.query, db.session.query and model.query. I want to know what are, if there are, the differences between these three methods? Or do the do the exact same thing?
/r/flask
https://redd.it/8eb8go
reddit
sqlalchemy queries • r/flask
I am learning about flask and sqlalchemy and I have a question about the ways to make queries. I have seen three types of querys: cls.query,...
manage.py migrate: [migration_name] just needs the first few characters
EDIT: looking at the comments I think I should add some context. Say you did a migration and want to undo the database changes (so it doesn't screw up future migrations), you can run `manage.py migrate [app_label] [migration_name]` where migration_name is the filename of the previous migration you wish to revert to. What's not clear in the docs is that you can actually use just the first few characters of the filename, so long as there are no clashes.
---
I feel silly for not trying this before, but when doing `manage.py migrate app_label migration_name` you can actually just use the first few characters of a migration for `migration_name` e.g. if your migration file is 0018_auto_20170802_1822.py, you can just use `manage.py migrate app_label *0018*`.
This works because the function to get the migration uses `startswith()`: https://github.com/django/django/blob/master/django/db/migrations/loader.py#L134
Hope this helps if you're trying to undo a previous migration!
/r/django
https://redd.it/8eal1n
EDIT: looking at the comments I think I should add some context. Say you did a migration and want to undo the database changes (so it doesn't screw up future migrations), you can run `manage.py migrate [app_label] [migration_name]` where migration_name is the filename of the previous migration you wish to revert to. What's not clear in the docs is that you can actually use just the first few characters of the filename, so long as there are no clashes.
---
I feel silly for not trying this before, but when doing `manage.py migrate app_label migration_name` you can actually just use the first few characters of a migration for `migration_name` e.g. if your migration file is 0018_auto_20170802_1822.py, you can just use `manage.py migrate app_label *0018*`.
This works because the function to get the migration uses `startswith()`: https://github.com/django/django/blob/master/django/db/migrations/loader.py#L134
Hope this helps if you're trying to undo a previous migration!
/r/django
https://redd.it/8eal1n
GitHub
django/django
django - The Web framework for perfectionists with deadlines.
DjBrut: bruteforce protection for Django with Redis backend. Customizable, extendable, fast.
https://github.com/orsinium/django-bruteforce-protection
/r/django
https://redd.it/8ed2og
https://github.com/orsinium/django-bruteforce-protection
/r/django
https://redd.it/8ed2og
GitHub
orsinium/django-bruteforce-protection
Bruteforce protection for Django projects based on Redis. Simple, powerful, extendable. - orsinium/django-bruteforce-protection
PyGotham 2018 Call for Proposals
https://www.papercall.io/pygotham-2018
/r/django
https://redd.it/8ec6mc
https://www.papercall.io/pygotham-2018
/r/django
https://redd.it/8ec6mc
www.papercall.io
PaperCall.io - PyGotham 2018
PyGotham 2018 is taking place from October 5-6 at the Hotel Pennsylvania in New York City. It will feature three tracks of talks on Friday, October 5th and Saturday, October 6th.
## Background
PyGotham is a New York City based, eclectic, Py-centric conference…
## Background
PyGotham is a New York City based, eclectic, Py-centric conference…
[AF] Request.referrer gives BuildError when redirecting to the same endpoint.
Hi, so I have a website that enables voting, much like on reddit, and I've tried to make it so that whenever the user votes he is instantly redirected back to wherever he initially viewed a post. So say I upvoted a post when viewing it, I expect to be redirected back to the post, not the front page.
Here is the code I used, taken from a snippet:
def redirect_url():
return request.args.get('next') or \
request.referrer or \
url_for('index')
And here is where it is implemented:
@app.route('/vote/<post_id>', methods=['POST'])
def vote(post_id):
post = Post.query.filter_by(id=post_id).first()
if post != None:
if post.upvotes == None:
post.make_vote_int()
if "upvote" in request.form:
post.upvotes = post.upvotes + 1
post.get_score()
db.session.commit()
if "downvote" in request.form:
post.downvotes = post.downvotes + 1
post.get_score()
db.session.commit()
return redirect(url_for(redirect_url()))
Using this I receive this error:
werkzeug.routing.BuildError: Could not build url for endpoint 'http://localhost:5000/
when voting wherever.
What am I doing wrong and how can I fix it?
Here is the github link, however I haven't yet pushed this code yet.
https://github.com/ModoUnreal/dopenet
/r/flask
https://redd.it/8efkzl
Hi, so I have a website that enables voting, much like on reddit, and I've tried to make it so that whenever the user votes he is instantly redirected back to wherever he initially viewed a post. So say I upvoted a post when viewing it, I expect to be redirected back to the post, not the front page.
Here is the code I used, taken from a snippet:
def redirect_url():
return request.args.get('next') or \
request.referrer or \
url_for('index')
And here is where it is implemented:
@app.route('/vote/<post_id>', methods=['POST'])
def vote(post_id):
post = Post.query.filter_by(id=post_id).first()
if post != None:
if post.upvotes == None:
post.make_vote_int()
if "upvote" in request.form:
post.upvotes = post.upvotes + 1
post.get_score()
db.session.commit()
if "downvote" in request.form:
post.downvotes = post.downvotes + 1
post.get_score()
db.session.commit()
return redirect(url_for(redirect_url()))
Using this I receive this error:
werkzeug.routing.BuildError: Could not build url for endpoint 'http://localhost:5000/
when voting wherever.
What am I doing wrong and how can I fix it?
Here is the github link, however I haven't yet pushed this code yet.
https://github.com/ModoUnreal/dopenet
/r/flask
https://redd.it/8efkzl
GitHub
ModoUnreal/dopenet
dopenet - The ideal template to make websites in 2018!!!! (I'm kidding of course)