Dramatiq: Fast, Reliable, and Simple Distributed Task Queue for Python 3 (Interview)
https://www.podcastinit.com/dramatiq-with-bogdan-popa-episode-141/
/r/Python
https://redd.it/7mgbi5
https://www.podcastinit.com/dramatiq-with-bogdan-popa-episode-141/
/r/Python
https://redd.it/7mgbi5
Podcast.__init__('Python')
Dramatiq: Distributed Task Queue For Python 3 with Bogdan Popa - Episode 141
A majority of projects will eventually need some way of managing periodic or long-running tasks outside of the context of the main application. This is where a distributed task queue becomes useful. For many in the Python community the standard option is…
[D] Superhuman AI for heads-up no-limit poker: Libratus beats top professionals
https://youtu.be/2dX0lwaQRX0
/r/MachineLearning
https://redd.it/7mg73w
https://youtu.be/2dX0lwaQRX0
/r/MachineLearning
https://redd.it/7mg73w
YouTube
Superhuman AI for heads-up no-limit poker: Libratus beats top professionals
This talk gives a high-level explanation of Libratus, the first AI to defeat top humans in no-limit poker. A paper on the AI was published in Science in 2017.
No-limit Texas hold’em is the most popular form of poker. Despite AI successes in perfect-information…
No-limit Texas hold’em is the most popular form of poker. Despite AI successes in perfect-information…
Matplot lib - how to replicate Exzel ability to display (x,y) when you mouse over a data point?
Is this even a possibility? Thanks.
/r/Python
https://redd.it/7mjv0j
Is this even a possibility? Thanks.
/r/Python
https://redd.it/7mjv0j
reddit
Matplot lib - how to replicate Exzel ability to display... • r/Python
Is this even a possibility? Thanks.
Can fields have attributes?
A quick introduction for my question:
Creating a financial app. Main model is Company, with a child called Balancesheet. In the balancesheet I have fields like "cash", "goodwill" and other accounting stuff.
Items in the balancesheet can be classified into financial and operating assets. Cash is a financial asset. I want a way to give cash that attribute. And other fields might have the attribute of an operating asset.
Do I really have to create a child model for every item on the balancesheet just to give them this attribute?
/r/django
https://redd.it/7mkk35
A quick introduction for my question:
Creating a financial app. Main model is Company, with a child called Balancesheet. In the balancesheet I have fields like "cash", "goodwill" and other accounting stuff.
Items in the balancesheet can be classified into financial and operating assets. Cash is a financial asset. I want a way to give cash that attribute. And other fields might have the attribute of an operating asset.
Do I really have to create a child model for every item on the balancesheet just to give them this attribute?
/r/django
https://redd.it/7mkk35
reddit
Can fields have attributes? • r/django
A quick introduction for my question: Creating a financial app. Main model is Company, with a child called Balancesheet. In the balancesheet I...
Creating a .exe file from a .py file keeps failing
I'm about to lose my mind here. I've become quite proficient in Python over the past few months but for the life me I cannot create a .exe file from my Python files. I have tried watching dozens of YouTube tutorials, looked at 100s of examples, websites and forums and absolutely nothing works. I tried using setup.py examples from the internet, pyinstaller, cx_Freeze, pyBuilder, py2exe and pynsist.
Pynsist is the only one that never gave me errors but it did not create a .exe file for my application. All the other applications either give me blank folders, IndexError: tuple out of range errors, or no commands supplied errors. I tried the command: python setup.py build and the exe it created just produces a ModuleNotFoundError message.
What could I be doing wrong or where can I go to get this done properly. Because right now I'm beginning to think this impossible to do. Is there a tool that can be used to do this that ACTUALLY works and actually explains how to do this? What can I do?
I am running Python 3.6, and the ".exe" files these modules create only seem to work on my computer, not on anyone elses', even if they have Python on them. At best it opens Code Writer on other computers I have tested my .exes on.
/r/Python
https://redd.it/7mliro
I'm about to lose my mind here. I've become quite proficient in Python over the past few months but for the life me I cannot create a .exe file from my Python files. I have tried watching dozens of YouTube tutorials, looked at 100s of examples, websites and forums and absolutely nothing works. I tried using setup.py examples from the internet, pyinstaller, cx_Freeze, pyBuilder, py2exe and pynsist.
Pynsist is the only one that never gave me errors but it did not create a .exe file for my application. All the other applications either give me blank folders, IndexError: tuple out of range errors, or no commands supplied errors. I tried the command: python setup.py build and the exe it created just produces a ModuleNotFoundError message.
What could I be doing wrong or where can I go to get this done properly. Because right now I'm beginning to think this impossible to do. Is there a tool that can be used to do this that ACTUALLY works and actually explains how to do this? What can I do?
I am running Python 3.6, and the ".exe" files these modules create only seem to work on my computer, not on anyone elses', even if they have Python on them. At best it opens Code Writer on other computers I have tested my .exes on.
/r/Python
https://redd.it/7mliro
reddit
Creating a .exe file from a .py file keeps failing • r/Python
I'm about to lose my mind here. I've become quite proficient in Python over the past few months but for the life me I cannot create a .exe file...
ELI5: What are the benefits of Redis, and how do you use it with RDBMS?
Let's say I have a PostGIS database with a lot related models. Would I have to basically aggregate that data into NoSQL type models to store them in redis? At what point do you move the data from models to Redis?
Note that I am a redis nooblet, so my understanding may be wrong... Just trying to figure out if it even makes sense for me to learn and implement redis. Thanks.
Ninja edit: Also, I guess geographical searches should still be handled by Django's GIS rather than me rewriting it all in Redis, if I go ahead and use that. How do you guys manage it?
/r/django
https://redd.it/7mm71s
Let's say I have a PostGIS database with a lot related models. Would I have to basically aggregate that data into NoSQL type models to store them in redis? At what point do you move the data from models to Redis?
Note that I am a redis nooblet, so my understanding may be wrong... Just trying to figure out if it even makes sense for me to learn and implement redis. Thanks.
Ninja edit: Also, I guess geographical searches should still be handled by Django's GIS rather than me rewriting it all in Redis, if I go ahead and use that. How do you guys manage it?
/r/django
https://redd.it/7mm71s
reddit
ELI5: What are the benefits of Redis, and how do you... • r/django
Let's say I have a PostGIS database with a lot related models. Would I have to basically aggregate that data into NoSQL type models to store them...
Parsing “Ask HN: Who is hiring?” with Python and Hacker News API
https://www.alexkras.com/parse-ask-hn-who-is-hiring-python-and-hacker-news-api/
/r/Python
https://redd.it/7mlqil
https://www.alexkras.com/parse-ask-hn-who-is-hiring-python-and-hacker-news-api/
/r/Python
https://redd.it/7mlqil
alexkras.com
Parsing “Ask HN: Who is hiring?” with Python and Hacker News API
Have you heard of Hacker News? It’s a great mini social network dedicated to all things tech. Once a month they post a thread called “Ask HN: Who is hiring?”, where anyone can list their job openings.
Jupyter Notebook in the cloud with browser-based Linux UI
http://engineering.paiza.io/entry/paizacloud_jupyter_notebook
/r/IPython
https://redd.it/7mn9pw
http://engineering.paiza.io/entry/paizacloud_jupyter_notebook
/r/IPython
https://redd.it/7mn9pw
Paiza Engineering Blog
Jupyter Notebook online in 3 seconds with PaizaCloud Cloud IDE - Paiza Engineering Blog
(English article is here) Hello I'm Tsuneo(@yoshiokatsuneo). Python is one of the most popular programming languages for data processing, Web service, Web scrap…
3D isotropic wavelets, texture features, and contour interpolation available via pip / conda with ITK 4.13.0 release
https://blog.kitware.com/itk-4-13-0-has-been-released/
/r/IPython
https://redd.it/7mn7f6
https://blog.kitware.com/itk-4-13-0-has-been-released/
/r/IPython
https://redd.it/7mn7f6
The Kitware Blog
ITK 4.13.0 has been released
On behalf of the Insight Segmentation and Registration Toolkit (ITK) Community, we are happy to announce the release of ITK 4.13.0! Download ITK Here are a few selected highlights for this release:…
[AF] Convert Oracle query to SQLAlchemy ORM
I have been trying to convert Oracle query to SQLAlchemy specifically ORM Here is the SQL I want to convert:
SELECT p.id,
p.name,
p.address,
to_char(t.s_time, 'mm/dd/yyyy hh:mi:ss AM') date_s,
t.date_h,
FROM p_table p,
(SELECT t_id,
dept,
ROW_NUMBER() OVER(PARTITION BY t_id ORDER BY dept) AS row_id
FROM t_table
WHERE t_id = :t_id
AND actual_time IS NULL) t
WHERE p.id = :id_var
AND row_id = 1
ORDER BY date_c DESC
Here is my attempt on converting this:
row_id = func.row_number().over(partition_by=TModel.t_id, order_by=TModel.dept)
sub_query = db.session.query(TModel.t_id, TModel.dept)\
.add_column(row_id)\
.from_self().filter(row_id == 1)\
.filter(TModel.t_id == t_id)\
.filter(TModel.actual_time == None)\
.label("sub_query")
q = db.session.query(PModel.id, PModel.name,
PModel.address, TModel.s_time, TModel.temp, sub_query)\
.filter(PModel.t_id == t_id)\
.order_by(PModel.date_complete.desc())\
.all()
print q
It seems I didn't correctly convert it into sqlalchemy it returns more than it is expecting for example running the SQL (5 rows) vs SQL(20+ rows) . Any help is greatly appreciated. Thank you!
/r/flask
https://redd.it/7mmjwi
I have been trying to convert Oracle query to SQLAlchemy specifically ORM Here is the SQL I want to convert:
SELECT p.id,
p.name,
p.address,
to_char(t.s_time, 'mm/dd/yyyy hh:mi:ss AM') date_s,
t.date_h,
FROM p_table p,
(SELECT t_id,
dept,
ROW_NUMBER() OVER(PARTITION BY t_id ORDER BY dept) AS row_id
FROM t_table
WHERE t_id = :t_id
AND actual_time IS NULL) t
WHERE p.id = :id_var
AND row_id = 1
ORDER BY date_c DESC
Here is my attempt on converting this:
row_id = func.row_number().over(partition_by=TModel.t_id, order_by=TModel.dept)
sub_query = db.session.query(TModel.t_id, TModel.dept)\
.add_column(row_id)\
.from_self().filter(row_id == 1)\
.filter(TModel.t_id == t_id)\
.filter(TModel.actual_time == None)\
.label("sub_query")
q = db.session.query(PModel.id, PModel.name,
PModel.address, TModel.s_time, TModel.temp, sub_query)\
.filter(PModel.t_id == t_id)\
.order_by(PModel.date_complete.desc())\
.all()
print q
It seems I didn't correctly convert it into sqlalchemy it returns more than it is expecting for example running the SQL (5 rows) vs SQL(20+ rows) . Any help is greatly appreciated. Thank you!
/r/flask
https://redd.it/7mmjwi
reddit
[AF] Convert Oracle query to SQLAlchemy ORM • r/flask
I have been trying to convert Oracle query to SQLAlchemy specifically ORM Here is the SQL I want to convert: SELECT p.id, p.name, ...
Compiling Jinja2 templates?
Hello there,
I have a flask app and i use pyinstaller to make a stndalone version. My problem is that i have to serve the static files and the templates on a separate folder or else the app cannot find them. Is there a way o compile the html jinja templates as well ?
/r/flask
https://redd.it/7mgahs
Hello there,
I have a flask app and i use pyinstaller to make a stndalone version. My problem is that i have to serve the static files and the templates on a separate folder or else the app cannot find them. Is there a way o compile the html jinja templates as well ?
/r/flask
https://redd.it/7mgahs
reddit
Compiling Jinja2 templates? • r/flask
Hello there, I have a flask app and i use pyinstaller to make a stndalone version. My problem is that i have to serve the static files and the...
[P]style2paintsII: The Most Accurate, Most Natural, Most Harmonious Anime Sketch Colorization and the Best Anime Style Transfer
/r/MachineLearning
https://redd.it/7mlwf4
/r/MachineLearning
https://redd.it/7mlwf4
numba and llvmlite are available in .whl format for Windows, Linux and Mac OS.
Just wanted to say that it's really nice that we can now easily install numba in a virtualenv, without having to use conda.
Kudos to the guys at Anaconda Inc!
/r/Python
https://redd.it/7mo9n9
Just wanted to say that it's really nice that we can now easily install numba in a virtualenv, without having to use conda.
Kudos to the guys at Anaconda Inc!
/r/Python
https://redd.it/7mo9n9
reddit
numba and llvmlite are available in .whl format for... • r/Python
Just wanted to say that it's really nice that we can now easily install numba in a virtualenv, without having to use conda. Kudos to the guys at...
[D] What type of Asimov-style rules would robot hosts have in HBO's Westworld?
>In the HBO series Westworld, a Host is an artificially created being, an android or artificially created animal. All of the animals (except for flies) in Westworld are hosts.
>The hosts are built to act out both storylines and narratives in the park by interacting with each other and with guests. They are designed to be incapable of permanently hurting any living non-host.
>At least some hosts are given a narrative to follow, and it may be that all hosts have a narrative to follow.
>Narratives are the stories that guests can participate in within the park. These stories are part of the entertainment of the guests. (Hosts follow their own story lines that loop, or repeat. The host's story lines can be part of guest narratives. There have been instances when hosts have broken away from their loops.)
>http://westworld.wikia.com/wiki/Host
>http://westworld.wikia.com/wiki/Narratives
/r/MachineLearning
https://redd.it/7mrbkv
>In the HBO series Westworld, a Host is an artificially created being, an android or artificially created animal. All of the animals (except for flies) in Westworld are hosts.
>The hosts are built to act out both storylines and narratives in the park by interacting with each other and with guests. They are designed to be incapable of permanently hurting any living non-host.
>At least some hosts are given a narrative to follow, and it may be that all hosts have a narrative to follow.
>Narratives are the stories that guests can participate in within the park. These stories are part of the entertainment of the guests. (Hosts follow their own story lines that loop, or repeat. The host's story lines can be part of guest narratives. There have been instances when hosts have broken away from their loops.)
>http://westworld.wikia.com/wiki/Host
>http://westworld.wikia.com/wiki/Narratives
/r/MachineLearning
https://redd.it/7mrbkv
Westworld Wiki
Host | Westworld Wiki | FANDOM powered by Wikia
In the HBO series Westworld, a Host is an artificially created being — an android or artificially created animal — or a human "developed mind" (an existing sentience) replicated within an...
[R] [1712.09913] Visualizing the Loss Landscape of Neural Nets
https://arxiv.org/abs/1712.09913
/r/MachineLearning
https://redd.it/7mr7j5
https://arxiv.org/abs/1712.09913
/r/MachineLearning
https://redd.it/7mr7j5
reddit
[R] [1712.09913] Visualizing the Loss... • r/MachineLearning
2 points and 0 comments so far on reddit
Sqlalchemy for Mysql vs postgres
Hi Im learning to program(first year CompSci student) and Im trying to teach myself how to make a website backed by a database. So far it is proving to be a harder nut to crack than I had anticipated, and definitely a learning experience.
I did a pretty cool tutorial where I scraped some facebook data with their api and stored it in a Mysql database, That was pretty cool. Now next step for my plan will be connecting to that database and getting the info out of it to use. for that end I found sqlalchemy and flask. Seems pretty great and I found a pretty great tutorial :
https://auth0.com/blog/sqlalchemy-orm-tutorial-for-python-developers/
But they use a postgres database! As far as I understand the whole purpose of sqlalchemy is so that the language will be the same for connecting to any database. Am I correct? If not Im thinking this whole thing might be a bit too ambitious for my current skill level! Oh well! Im open to any and all suggestions :)
TLDR: can i use sqlalchemy with a mysql database just like a postgres database?
/r/flask
https://redd.it/7mcwre
Hi Im learning to program(first year CompSci student) and Im trying to teach myself how to make a website backed by a database. So far it is proving to be a harder nut to crack than I had anticipated, and definitely a learning experience.
I did a pretty cool tutorial where I scraped some facebook data with their api and stored it in a Mysql database, That was pretty cool. Now next step for my plan will be connecting to that database and getting the info out of it to use. for that end I found sqlalchemy and flask. Seems pretty great and I found a pretty great tutorial :
https://auth0.com/blog/sqlalchemy-orm-tutorial-for-python-developers/
But they use a postgres database! As far as I understand the whole purpose of sqlalchemy is so that the language will be the same for connecting to any database. Am I correct? If not Im thinking this whole thing might be a bit too ambitious for my current skill level! Oh well! Im open to any and all suggestions :)
TLDR: can i use sqlalchemy with a mysql database just like a postgres database?
/r/flask
https://redd.it/7mcwre
Auth0 - Blog
SQLAlchemy ORM Tutorial for Python Developers
Let's learn how to use SQLAlchemy ORM to persist and query data on Python applications.
Algorithmic Problem Solving with Python [pdf]
http://www.eecs.wsu.edu/~schneidj/PyBook/swan.pdf
/r/Python
https://redd.it/7ms7xc
http://www.eecs.wsu.edu/~schneidj/PyBook/swan.pdf
/r/Python
https://redd.it/7ms7xc
[HELP] Setting up a frontend workflow in a Django project.
Hi everyone! I have some experience with Flask and is now trying to pickup Django, and am slightly getting overwhelmed by the directory structure. And then there's a handful of techniques which deviates from the stock `startproject` layout, which only adds to the confusion. I mean, that's the reason I'm picking up the framework: to get a standardized structure/layout, unlike Flask in which the burden is in the developer's hands. Okay, enough of the newbie rant :D
The premise is that I would like to incorporate Node/NPM to my workflow. The primary reason is to allow usage of `ES6+` and `SASS` on my static files. Anyway, I currently have the following setup:
<project_root>
├── <django_project_root>
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ ├── views.py
│ └── wsgi.py
├── lib // Compiled stuff.
│ └── app.js
├── LICENSE
├── manage.py
├── package.json
├── README.md
├── requirements.txt
├── src // Uncompiled 'source'
│ └── app.js
├── templates
│ └── index.djt
├── static // What gets referenced in my templates.
│ └── app.js
└── webpack.config.js
Now, I would like to write my `JS/SCSS` inside my `src` directory, and then:
1. Babel do its thing and output an `ES5` friendly version of whatever is in `src` into the `lib` folder.
2. Webpack grabs what's in `lib` and spits out a browser friendly version into a `static` folder.
3. Templates inside the `tempaltes` directory loads the contents of the `static` folder.
4. Note that I keep both `lib` and `static` out of version control. Which is correct, since I only need the `src` file, right?
Anyway, I can successfully do the workflow above with `ES6` js files inside `src`. But I'm clueless on what to do to do the same with `SCSS` files.
Relevant files:
// package.json
{
// ....
"scripts": {
"build": "babel src -d lib && webpack"
},
// ...
}
---
// webpack.config.js
module.exports = {
entry: './lib/app.js',
output: {
filename: './static/js/app.js',
}
};
How should I continue? Please do tell me if I need to provide more information. Thanks!
/r/django
https://redd.it/7mtbc5
Hi everyone! I have some experience with Flask and is now trying to pickup Django, and am slightly getting overwhelmed by the directory structure. And then there's a handful of techniques which deviates from the stock `startproject` layout, which only adds to the confusion. I mean, that's the reason I'm picking up the framework: to get a standardized structure/layout, unlike Flask in which the burden is in the developer's hands. Okay, enough of the newbie rant :D
The premise is that I would like to incorporate Node/NPM to my workflow. The primary reason is to allow usage of `ES6+` and `SASS` on my static files. Anyway, I currently have the following setup:
<project_root>
├── <django_project_root>
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ ├── views.py
│ └── wsgi.py
├── lib // Compiled stuff.
│ └── app.js
├── LICENSE
├── manage.py
├── package.json
├── README.md
├── requirements.txt
├── src // Uncompiled 'source'
│ └── app.js
├── templates
│ └── index.djt
├── static // What gets referenced in my templates.
│ └── app.js
└── webpack.config.js
Now, I would like to write my `JS/SCSS` inside my `src` directory, and then:
1. Babel do its thing and output an `ES5` friendly version of whatever is in `src` into the `lib` folder.
2. Webpack grabs what's in `lib` and spits out a browser friendly version into a `static` folder.
3. Templates inside the `tempaltes` directory loads the contents of the `static` folder.
4. Note that I keep both `lib` and `static` out of version control. Which is correct, since I only need the `src` file, right?
Anyway, I can successfully do the workflow above with `ES6` js files inside `src`. But I'm clueless on what to do to do the same with `SCSS` files.
Relevant files:
// package.json
{
// ....
"scripts": {
"build": "babel src -d lib && webpack"
},
// ...
}
---
// webpack.config.js
module.exports = {
entry: './lib/app.js',
output: {
filename: './static/js/app.js',
}
};
How should I continue? Please do tell me if I need to provide more information. Thanks!
/r/django
https://redd.it/7mtbc5
reddit
[HELP] Setting up a frontend workflow in a Django project. • r/django
Hi everyone! I have some experience with Flask and is now trying to pickup Django, and am slightly getting overwhelmed by the directory structure....