2018-10-22         Merry

You cannot add messages without installing django.contrib.messages.middleware.MessageMiddleware

I am new to Django. I am trying to run an app and I need to add a new user to admin. The server is running. When I enter the info fir the new user and hit "save" I get the error below. I am using django-trunk.MessageFailure at /admin/auth/user/add/You cannot add messages without installingdjango.contrib.messages.middleware.MessageMiddlewareRequest Method: POSTRequest URL: http://localhost:8000/admin/auth/user/add/Django Version: 1.6.dev20130403090717Exception Type: MessageFailureException Value: You cannot add messages without installing django.contrib.messages.middle...

 django                     6 answers                     78 view
 2018-10-22         Merry

Can Amazon Lex be used with other platforms (eg. Google Home)?

I'm trying to figure out which open source framework to use to start building a conversational AI for our business. We are a financial technology company so security/ privacy is just as important as ability to build features quickly.Amazon Lex seems to be a good choice, is it possible to use it with Google Home or other voice assistants?Also, any additional advice on which platform to use/ architecture would be very much appreciated.Thank you! Yes Amazon Lex can work with other services. From the Lex website:"With Amazon Lex, you can build, test, and deploy your chatbots...

 aws-lambda                     1 answers                     47 view
 2018-10-22         Merry

changing given text to list of lists

I have the following text in a given file: 1234,A,7.99,10.3,12.8,101,0.11843,0.27276,0.30101 87635,B,19.69,21.25,130,1203,0.1096,0.1599,0.1974First, I want to get rid of the 1234 and 87635 in the front, and I also want to change A into the integer "1" and B into the integer "0".This is my code: def convert(file): data = open(file, 'r') list1 = [] for line in data: line_data = line.strip().split(',') if line_data[0] == "B": line_data[0] = 0 else: line_data[0] = 1 for i in range(len(line)): datalist.app...

 python                     1 answers                     22 view
 2018-10-22         Merry

Can not minify the css code with webpack

Webpack version: 4.16.3All compilation is successful.My code after compilation in bundle.css is not minify.I try to use minimize: true in text-webpack-plugin, but it not working.For compile I use command in command line: webpack in my working directoryWhat am I doing wrong?My wepback config:'use strict'const webpack = require("webpack");const ExtractTextPlugin = require('extract-text-webpack-plugin')module.exports = { context: __dirname, mode: 'production', entry: __dirname + "/js/init.js", output: { path: __dirname + "/dist", filename: "bundle.js" }, plugins: [...

 javascript                     3 answers                     7 view
 2018-10-22         Merry

Yarn Workspaces And Webpack Hot Module Reloading React App

I am using Yarn Workspaces to manage a mono repo. I am using webpack 4 for hot module reloading. In my mono repo I have an app, a UI component library, and another component library for authorizing users (auth package). I am using the component library in both the app and the auth package. Everything local to the app hot reloads fine, but the UI component library will not hot reload - it requires a full refresh. I've tried accepting the UI component library using module.hot.accept(...), but doesn't seem to pick it up.Guessing this question is a stretch, but any ideas? Ad...

 reactjs                     1 answers                     22 view
 2018-10-22         Merry

get datetime difference breakdown in laravel php

I'm trying to get the difference between two dates like this [ 'years' : 4, // 0 if the difference is not above a year 'months': 4, // 0 if the difference is not of above a month 'weeks': 4, // 0 if the difference is not of above a week 'days': 4, // 0 if the difference is not of above a day 'hours' : 4 // 0 if the difference is not of above a hour 'minutes': 54 // 0 if the difference is not of above a minute 'seconds': 5 // 0 if the difference is not of above a second]Is there any utility function that gives me an output something like above in laravel P...

 php                     1 answers                     58 view
 2018-10-22         Merry

Hide options in select2 multi select

I need to hide/show options from select2 multi-selectI have tried something like this but option Two is not hidden: $(document).ready(function() { $('#test').select2(); });<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" /><script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script> <select id="test" multiple style="width:250px"> <option value=...

 javascript                     3 answers                     96 view
 2018-10-22         Merry

Select n rows containing at least one of a columns possible values

Consider this Table:+----+----------+----------+| id | title | language |+----+----------+----------+| 10 | Title 1 | de || 11 | Title 2 | de || 12 | Title 3 | de || 13 | Title 4 | fr || 14 | Title 5 | fr || 15 | Title 6 | fr || 16 | Title 7 | fr || 17 | Title 8 | it || 18 | Title 9 | it || 19 | Title 10 | it || 20 | Title 11 | en || 21 | Title 12 | en || 22 | Title 13 | en |+----+----------+----------+I would like to retrieve (n) rows containing at least one of each defined language. ...

 mysql                     1 answers                     87 view
 2018-10-22         Merry

Group By and Order By for SQL query

I'm trying to generate a report that shows how many Expense Reports (ERs) and the total of those reports for each employee for FY18. The result set I have now has several duplicate UIN numbers--which is the identifying ID number for employees. There should only be one record for each UIN. I was thinking it had to do with the Group By and Order By clauses, but not sure. Can someone point out the problem area? Here's the SQL:select x.er_employee_number "UIN", x.er_user_full_name, x.er_user_location, count(X.ER_DOCUMENT_ID) "Number of ERs", sum...

 sql                     1 answers                     52 view
 2018-10-22         Merry

Invalid Column name Gull

I am using Sql Server with Netbeans. I am executing the update query using following codeClass.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); //Connection establishment Connection con=DriverManager.getConnection("jdbc:sqlserver://DESKTOP-CU5U75J\\SQLSERVER1;databaseName=SQLConnection","Fateh","Fateh"); //Statement Object Statement st=con.createStatement(); //For DML use executeUpdate method of Statement Class st.executeUpdate("INSERT INTO Emp" +" VALUES("+2+",+Gull)"); //Commit Statement con.c...

 java                     2 answers                     63 view
 2018-10-22         Merry

kafka listener for meteor

I want to consume Kafka messages in Meteor.Is there any package in meteor to do it? how should approach this? I searched and I could find npm for node.js which can listen to kafka messages but not sure how this can be used in meteor.Thank you Have a look at the meteorhacks:npm package, which will allow you to use npm packages in your meteor app. Here is a blog post explaining how to use it (though the package README should be sufficient) [XXX]kafka-node would be the package that you might want to try. It is important to note that this is a server-side only package. ...

 meteor                     2 answers                     39 view
 2018-10-22         Merry

svnant - parent dir in server is not a working copy

I want to checkout project, get the revision number, build jar with that number in menifest, on the server with a web interface. There are some other minor steps in the whole process, but that's the main goal. everything in the build script is working fine locally, but I always get stuck when it is done on the server. when I try to use svnant task on the project I checked out, it's telling me the parent dir is not a working copy, so I tried a copy first, then the whole project again into that copy, it's still telling me that the parent dir (the first edition) is not a ...

 svn                     1 answers                     27 view
 2018-10-22         Merry

Converting Post File to Pdf in Azure Function

I want to achieve is to post data which includes text and file from html page to azure function and then send that data to admin email. I have tried it out but now able to get posted file.Html Page : <script> function myFormOnSubmit() { var formData = new FormData(); formData.append("firstname",$('#firstname').val()); formData.append("lastname",$('#lastname').val()); formData.append("phonenumber",$('#phonenumber').val()); formData.append("email",$('#email'...

 c#                     1 answers                     70 view
 2018-10-22         Merry

SQLAlchemy: Filter by objects in a member list

Consider the following classes, class Person: id name jobsclass Job: name person person_id (FK)where Person.jobs refers to class Job objects. Now I'd like to perform the following query,# for a given person pJob.query.filter(Job.notin_(p.jobs))Is it possible in SQLAlchemy? Please not that I do not want to write Job.query.filter(Job.person_id != p.id). Nope !As the documentation about in_ explains, as of version 1.2 of SQLAlchemy, you can not have list of instances of object, only :list of IDempty listselectbound paramsAs of version 1.2, only what you ...

 python                     1 answers                     44 view
 2018-10-22         Merry

How connect a Switch Button with a form

I have a web application and I want to implement in it a Switch Button using this bootstrap example, so that the user can choose the language. Also, I need it to be submitted with a POST. How can I code this type of toggle button, e.g., <div class="btn-group btn-toggle"> <button class="btn btn-xs btn-default">pt</button> <button class="btn btn-xs btn-primary active">eng</button> </div>so that when the user clicks in one of them, a POST is submitted with "pt" or "eng" values?EDIT: I just need a simple POST with redirect. I'm using...

 html                     3 answers                     9 view
 2018-10-22         Merry

Calculate the area under each peak in a graph in python

I am trying to calculate the area under each peak in a graph that I plotted with a set of x and y co-ordinates, I don't have a function for (x,y), and so I haven't been able to find an appropriate method to do the same.the co-ordinates are { [10 10] [11 1] [12 7] [14 4] [16 8] [17 5]]}And y=0 for all the unmarked x values The area below two points consists of a 'square' part and a triangular part. The trick is to calculate them both separately and add them. Do this for all points, and you get a list of areas under peaks:points = [[10, 10], [11, 1], ...

 python                     3 answers                     56 view

Page 1 of 145  |  Show More Pages:  Top Prev Next Last