Question on the Front-End (Bootstrap Admin Template?)
Writing a business-logic app, with just a few models that have relationships. Django works great for the backend, love the model relationships/inheritance, and so far we've had moderate success with using basic Django (or crispy) forms, and DRF to host the ListView API and DataTables.
Was thinking of implementing something along the lines of a BootStrap Admin Template, so that our internal "Site" would start to look more like a Web Application. We'll need a dashboard, some metrics, charts/graphs, but also what's really important is the form interaction, being able to edit a parent record while seeing it's related children records, having an edit view and a read-only view, etc.
Is a Bootstrap template the way to go? Am I way overcomplicating this? Do I need to learn AngularJS or React?
I've got most of the functionality worked out, Workflow, Required Fields, Editable Fields, Audit Trail, Time Stamps, etc... just really struggling with a front-end that doesn't look like it's from the 90s.
/r/django
https://redd.it/5jlenx
Writing a business-logic app, with just a few models that have relationships. Django works great for the backend, love the model relationships/inheritance, and so far we've had moderate success with using basic Django (or crispy) forms, and DRF to host the ListView API and DataTables.
Was thinking of implementing something along the lines of a BootStrap Admin Template, so that our internal "Site" would start to look more like a Web Application. We'll need a dashboard, some metrics, charts/graphs, but also what's really important is the form interaction, being able to edit a parent record while seeing it's related children records, having an edit view and a read-only view, etc.
Is a Bootstrap template the way to go? Am I way overcomplicating this? Do I need to learn AngularJS or React?
I've got most of the functionality worked out, Workflow, Required Fields, Editable Fields, Audit Trail, Time Stamps, etc... just really struggling with a front-end that doesn't look like it's from the 90s.
/r/django
https://redd.it/5jlenx
reddit
Question on the Front-End (Bootstrap Admin Template?) • /r/django
Writing a business-logic app, with just a few models that have relationships. Django works great for the backend, love the model...
Strategy for creating/running tests that do not use a database
I have a flask app that uses a database. I am running my tests but many of the fixtures create data in the database and use that for the tests. Is there a good strategy for avoiding having the tests rely on data in the database?
Maybe having fixtures that create objects in the session, using them for the test and then deleting them from the session?
Any ideas?
/r/flask
https://redd.it/5jmrxu
I have a flask app that uses a database. I am running my tests but many of the fixtures create data in the database and use that for the tests. Is there a good strategy for avoiding having the tests rely on data in the database?
Maybe having fixtures that create objects in the session, using them for the test and then deleting them from the session?
Any ideas?
/r/flask
https://redd.it/5jmrxu
reddit
Strategy for creating/running tests that do not use a... • /r/flask
I have a flask app that uses a database. I am running my tests but many of the fixtures create data in the database and use that for the tests. Is...
Difference between running flask in debug mode vs regular mode
I was just curious what are the main differences running in debug_mode vs regular mode minus the updating of the code without having to rerun and the debuging mode nicely showing errors etcc..
Thanks
/r/flask
https://redd.it/5jlgl1
I was just curious what are the main differences running in debug_mode vs regular mode minus the updating of the code without having to rerun and the debuging mode nicely showing errors etcc..
Thanks
/r/flask
https://redd.it/5jlgl1
reddit
Difference between running flask in debug mode vs... • /r/flask
I was just curious what are the main differences running in debug_mode vs regular mode minus the updating of the code without having to rerun and...
tmuxp — tmuxinator clone i wrote in python
https://tmuxp.git-pull.com/
/r/Python
https://redd.it/5jlofy
https://tmuxp.git-pull.com/
/r/Python
https://redd.it/5jlofy
tmuxp
Session manager for tmux, which allows users to save and load tmux sessions through simple configuration files. Powered by libtmux. Python Package Docs Build status Code Coverage License New to tmu...
Has anyone got a job without a degree CompSci degree ?
Basic question. Im learning python right now and its starting to make sense. Just wondering if you can land a job if you have a good portfolio of programs you have written ?
/r/Python
https://redd.it/5jn9gg
Basic question. Im learning python right now and its starting to make sense. Just wondering if you can land a job if you have a good portfolio of programs you have written ?
/r/Python
https://redd.it/5jn9gg
reddit
Has anyone got a job without a degree CompSci degree ? • /r/Python
Basic question. Im learning python right now and its starting to make sense. Just wondering if you can land a job if you have a good portfolio of...
Estimate distribution of d prime in signal detection
I want to use maximum likelihood to derive the estimate d prime for extreme result of signal detection.
* The noise centers at 0 and signal centers at d prime. Both noise and signal have the same variance, and we assume it as 1 for now.
* Criterion is always half of d prime.
The goal is to find the probability of 'no error' data: zero counts for Miss and FA.
As I simulate use d prime from 0 to 40 in step size of 0.5, I found a probability shape like [graph](https://github.com/adowaconan/simulation/blob/master/lab%202.ipynb) in **Q3A**.
How do I derive the maximum likelihood estimate of d prime based on a given data set?
Say give a data set that is 'no error':
hit = 100, miss = 0, false alarm = 0, correct rejection = 100.
For this data set, the # of signal and # of noise are the same as 100.
I used Bernoulli method to calculate the maximum likelihood for d prime and get infinity by hand, but I don't know how to do it in python and not sure if it is correct.
Any suggestions?
/r/pystats
https://redd.it/4bai6p
I want to use maximum likelihood to derive the estimate d prime for extreme result of signal detection.
* The noise centers at 0 and signal centers at d prime. Both noise and signal have the same variance, and we assume it as 1 for now.
* Criterion is always half of d prime.
The goal is to find the probability of 'no error' data: zero counts for Miss and FA.
As I simulate use d prime from 0 to 40 in step size of 0.5, I found a probability shape like [graph](https://github.com/adowaconan/simulation/blob/master/lab%202.ipynb) in **Q3A**.
How do I derive the maximum likelihood estimate of d prime based on a given data set?
Say give a data set that is 'no error':
hit = 100, miss = 0, false alarm = 0, correct rejection = 100.
For this data set, the # of signal and # of noise are the same as 100.
I used Bernoulli method to calculate the maximum likelihood for d prime and get infinity by hand, but I don't know how to do it in python and not sure if it is correct.
Any suggestions?
/r/pystats
https://redd.it/4bai6p
GitHub
adowaconan/simulation
Contribute to simulation development by creating an account on GitHub.
Security release: Jupyter Notebook 4.3.1
http://blog.jupyter.org/2016/12/21/jupyter-notebook-4-3-1/
/r/IPython
https://redd.it/5jmnwy
http://blog.jupyter.org/2016/12/21/jupyter-notebook-4-3-1/
/r/IPython
https://redd.it/5jmnwy
Project Jupyter
Security release: Jupyter Notebook 4.3.1
We have just released Jupyter Notebook 4.3.0 and 4.3.1 with some important security fixes. You can check out the changelog for more details on the many fixes and improvements. I'm going to focus on the security changes in this post. 4.3.0: Token authentication…
serving static files help error
So I have a flask app that takes a csv then display the graph of the csv my problem is that the graph it displays does not update when I change the csv to something else even though I have route defined and it is called
@app.route("/static/<figName>",methods=['post','get'])
def renderFigure(figName):
fileLocation = os.getcwd()+"\\static\\"
print("rendering image",figName)
return send_from_directory(fileLocation, figName)
heres the html
<img src="{{ url_for('static', filename=figName) }}"} alt="..." class="img-thumbnail">
It always displays the same graph the first one I dont know why even though in the actual directory the file is updated any help is greatly appreciated.
Sorry the error is that it my other route does not call this one so my question is how to call it
@app.route("/fileAnalysis",methods=['post','get'])
def fileAnalysis():
if request.method=="POST":
option = request.form['graphSelection']
f =request.files['fileUpload']
currentDir = os.getcwd()
if not f:
print("not file entered")
elif option!="Average likes for top commentators":
file_contents = f.stream.read().decode("latin-1")
print("before writing to the file")
newFile= open("statsFile.csv","w+",encoding='latin-1')
newFile.write(file_contents)
newFile.close()
print("wrote to file ")
print(type(file_contents))
if option=="Comments by hour of the day":
print("in top comments of hour of the day")
groupByHour.saveHourGraph("statsFile.csv")
return render_template("graph.html",figName=("commentsByHour.png"),title="Comments per hour of the day")
elif option=="Top Commentators":
topComments.makeTopCommentsGraph("statsFile.csv")
return render_template("graph.html",figName=("topCommentators.png"),title="top 100 commentators and the number of comments over a period of time")
elif option=="General Statistics":
dfComments = pd.read_csv("statsFile.csv", parse_dates=['comment_published'],encoding="latin-1")
print("hello world statistics")
return render_template("generalStats.html",dFrame=dfComments.describe(percentiles=[0.25,0.5,0.75,0.85,0.9,0.95,0.97,0.98,0.99]).to_html(classes="table table-striped"),title="General statistics on the file including mean ,standard deviation and percentiles of count of comment")
elif option=="Average likes for top commentators":
print("in average likes for top commentators need 2 files")
postsFile = request.files['fileUploadLikes']
if not f or not postsFile:
print("need to enter both files")
else:
file_contents = f.stream.read().decode("latin-1")
filePostsContents= postsFile.stream.read().decode("latin-1")
print("before writing to the file")
newFile= open("statsFile.csv","w+",encoding='latin-1')
newFile.write(file_contents)
newFile.close()
newFile= open("postsFile.csv","w+",encoding='utf-8')
newFile.write(filePostsContents)
newFile.close()
print("wrote to both files")
averageComments.getAverageLikes("statsFile.csv","postsFile.csv")
return render_template("graph.html",figName=("averageComments.png"),title="Average Comments for top 500 users")
print(option)
print("posted file ")
return render_template("fileAnalysis.html")
/r/flask
https://redd.it/5j8dwy
So I have a flask app that takes a csv then display the graph of the csv my problem is that the graph it displays does not update when I change the csv to something else even though I have route defined and it is called
@app.route("/static/<figName>",methods=['post','get'])
def renderFigure(figName):
fileLocation = os.getcwd()+"\\static\\"
print("rendering image",figName)
return send_from_directory(fileLocation, figName)
heres the html
<img src="{{ url_for('static', filename=figName) }}"} alt="..." class="img-thumbnail">
It always displays the same graph the first one I dont know why even though in the actual directory the file is updated any help is greatly appreciated.
Sorry the error is that it my other route does not call this one so my question is how to call it
@app.route("/fileAnalysis",methods=['post','get'])
def fileAnalysis():
if request.method=="POST":
option = request.form['graphSelection']
f =request.files['fileUpload']
currentDir = os.getcwd()
if not f:
print("not file entered")
elif option!="Average likes for top commentators":
file_contents = f.stream.read().decode("latin-1")
print("before writing to the file")
newFile= open("statsFile.csv","w+",encoding='latin-1')
newFile.write(file_contents)
newFile.close()
print("wrote to file ")
print(type(file_contents))
if option=="Comments by hour of the day":
print("in top comments of hour of the day")
groupByHour.saveHourGraph("statsFile.csv")
return render_template("graph.html",figName=("commentsByHour.png"),title="Comments per hour of the day")
elif option=="Top Commentators":
topComments.makeTopCommentsGraph("statsFile.csv")
return render_template("graph.html",figName=("topCommentators.png"),title="top 100 commentators and the number of comments over a period of time")
elif option=="General Statistics":
dfComments = pd.read_csv("statsFile.csv", parse_dates=['comment_published'],encoding="latin-1")
print("hello world statistics")
return render_template("generalStats.html",dFrame=dfComments.describe(percentiles=[0.25,0.5,0.75,0.85,0.9,0.95,0.97,0.98,0.99]).to_html(classes="table table-striped"),title="General statistics on the file including mean ,standard deviation and percentiles of count of comment")
elif option=="Average likes for top commentators":
print("in average likes for top commentators need 2 files")
postsFile = request.files['fileUploadLikes']
if not f or not postsFile:
print("need to enter both files")
else:
file_contents = f.stream.read().decode("latin-1")
filePostsContents= postsFile.stream.read().decode("latin-1")
print("before writing to the file")
newFile= open("statsFile.csv","w+",encoding='latin-1')
newFile.write(file_contents)
newFile.close()
newFile= open("postsFile.csv","w+",encoding='utf-8')
newFile.write(filePostsContents)
newFile.close()
print("wrote to both files")
averageComments.getAverageLikes("statsFile.csv","postsFile.csv")
return render_template("graph.html",figName=("averageComments.png"),title="Average Comments for top 500 users")
print(option)
print("posted file ")
return render_template("fileAnalysis.html")
/r/flask
https://redd.it/5j8dwy
reddit
serving static files help error • /r/flask
So I have a flask app that takes a csv then display the graph of the csv my problem is that the graph it displays does not update when I change...
What’s will be new in matplotlib — Matplotlib 2.0.0rc2 documentation
http://matplotlib.org/2.0.0rc2/users/whats_new.html
/r/IPython
https://redd.it/5jnw2y
http://matplotlib.org/2.0.0rc2/users/whats_new.html
/r/IPython
https://redd.it/5jnw2y
Missing data visualizations in Python?
Is there a tool for plotting missing data entries for a dataset in Python? I am thinking about something like [this](https://www.researchgate.net/profile/Bo_Tranberg/publication/277776292/figure/fig2/Figure-3-Matrix-plot-of-missing-data-cases-sorted-by-number-of-persons-with-the-name.png).
R seems to have [something](http://www.inside-r.org/packages/cran/mi/docs/missing.pattern.plot) like this, but I haven't tracked down a Python equivalent.
/r/pystats
https://redd.it/4azhee
Is there a tool for plotting missing data entries for a dataset in Python? I am thinking about something like [this](https://www.researchgate.net/profile/Bo_Tranberg/publication/277776292/figure/fig2/Figure-3-Matrix-plot-of-missing-data-cases-sorted-by-number-of-persons-with-the-name.png).
R seems to have [something](http://www.inside-r.org/packages/cran/mi/docs/missing.pattern.plot) like this, but I haven't tracked down a Python equivalent.
/r/pystats
https://redd.it/4azhee
Analyzing Golden State Warriors' passing network using GraphFrames in Spark
http://opiateforthemass.es/articles/analyzing-golden-state-warriors-passing-network-using-graphframes-in-spark/
/r/pystats
https://redd.it/4al1ps
http://opiateforthemass.es/articles/analyzing-golden-state-warriors-passing-network-using-graphframes-in-spark/
/r/pystats
https://redd.it/4al1ps
Opiate for the masses
Analyzing Golden State Warriors' passing network using GraphFrames in Spark
and interactive chart with networkD3
How to deal with migrations between branches
I just worked on a branch that made model changes, they switched to a different branch that didn't reflect those changes and now have issues with the database. What is the best way to tell the database to run with the current branch configuration/models in this case?
/r/django
https://redd.it/5jol7q
I just worked on a branch that made model changes, they switched to a different branch that didn't reflect those changes and now have issues with the database. What is the best way to tell the database to run with the current branch configuration/models in this case?
/r/django
https://redd.it/5jol7q
reddit
How to deal with migrations between branches • /r/django
I just worked on a branch that made model changes, they switched to a different branch that didn't reflect those changes and now have issues with...
Question about jupyter notebook size
Do let me know if this isn't the right place to ask this (or can suggest a better place) -- just recently got into using jupyter notebook, but it's rather large (wide?) on my screen. Is there a way to make it smaller in that dimension (short of just zooming out the whole page)?
/r/IPython
https://redd.it/4sf3yn
Do let me know if this isn't the right place to ask this (or can suggest a better place) -- just recently got into using jupyter notebook, but it's rather large (wide?) on my screen. Is there a way to make it smaller in that dimension (short of just zooming out the whole page)?
/r/IPython
https://redd.it/4sf3yn
reddit
Question about jupyter notebook size • /r/IPython
Do let me know if this isn't the right place to ask this (or can suggest a better place) -- just recently got into using jupyter notebook, but...
Storing sensitive settings in database vs environment variables
So, my lead developer just asked me to save sensitive settings such as keys into the database, his argument is that, because we have a lot of sensitive settings, the docker run command become too long. By just pointing the right database that has the settings we need, we good to go.
How his argument? is it reasonable? The settings app will be dump into JSON, and we pass that JSON file between developers securely for developing locally.
/r/django
https://redd.it/5jp26m
So, my lead developer just asked me to save sensitive settings such as keys into the database, his argument is that, because we have a lot of sensitive settings, the docker run command become too long. By just pointing the right database that has the settings we need, we good to go.
How his argument? is it reasonable? The settings app will be dump into JSON, and we pass that JSON file between developers securely for developing locally.
/r/django
https://redd.it/5jp26m
reddit
Storing sensitive settings in database vs environment... • /r/django
So, my lead developer just asked me to save sensitive settings such as keys into the database, his argument is that, because we have a lot of...
What are the standard things people do to ready a project for production?
Hi everyone,
I've rolled my first django project up to production on Heroku (http://newsletter.greenbartrading.com)! It is just a signup page for my mailchimp email list. As far as readying it for production though pretty much all I did was turn debug off and set up the static files settings. I feel like, security-wise, I should be doing a lot more. Is there a guide somewhere I can use to learn what settings I should be protecting, adjusting, and the like for production vs testing environments?
FWIW, I used this starter template https://github.com/heroku/heroku-django-template to make sure it worked with Heroku and just worked from there. It's a simple page, just one template, some jQuery for the modals, a single view, and a few other basics.
Any help would be very much appreciated since I want to a) protect this and b) eventually roll the rest of my website as well as some other apps I've written in python over to django!
Thanks :)
/r/django
https://redd.it/5jntxo
Hi everyone,
I've rolled my first django project up to production on Heroku (http://newsletter.greenbartrading.com)! It is just a signup page for my mailchimp email list. As far as readying it for production though pretty much all I did was turn debug off and set up the static files settings. I feel like, security-wise, I should be doing a lot more. Is there a guide somewhere I can use to learn what settings I should be protecting, adjusting, and the like for production vs testing environments?
FWIW, I used this starter template https://github.com/heroku/heroku-django-template to make sure it worked with Heroku and just worked from there. It's a simple page, just one template, some jQuery for the modals, a single view, and a few other basics.
Any help would be very much appreciated since I want to a) protect this and b) eventually roll the rest of my website as well as some other apps I've written in python over to django!
Thanks :)
/r/django
https://redd.it/5jntxo
Deep Dreams with Caffe - Dreamy Visuals
https://github.com/google/deepdream/blob/master/dream.ipynb
/r/JupyterNotebooks
https://redd.it/49laam
https://github.com/google/deepdream/blob/master/dream.ipynb
/r/JupyterNotebooks
https://redd.it/49laam
GitHub
deepdream/dream.ipynb at master · google/deepdream
Contribute to google/deepdream development by creating an account on GitHub.
Delta Plots Using Python
https://programminginpsychology.wordpress.com/2016/02/28/delta-plots-on-response-time-data-using-python/
/r/pystats
https://redd.it/497ljo
https://programminginpsychology.wordpress.com/2016/02/28/delta-plots-on-response-time-data-using-python/
/r/pystats
https://redd.it/497ljo
Programming in Psychology
Delta Plots on Response time data using Python
In this post we are going to learn how to do delta plots for response (reaction) time data. Response time data are often used in experimental psychology. It is the dependent variable in many experi…