2018-10-22         Martha

LexikJWTAuthenticationBundle - Unable to find the controller for path "/api/login_check". The route is wrongly configured

I use configuration like documentation. This is my security file:security:encoders: FOS\UserBundle\Model\UserInterface: sha512role_hierarchy: ROLE_ADMIN: [ROLE_USER]providers: fos_userbundle: id: fos_user.user_provider.usernamefirewalls: login: pattern: ^/api/login stateless: true anonymous: true json_login: check_path: /api/login_check success_handler: lexik_jwt_authentication.handler.authentication_success failure_handler: lexik_jwt_authentication.handler.authe...

 symfony                     2 answers                     92 view
 2018-10-22         Martha

List Serializer multiple object creation

My models are:class User(models.Model): id = models.AutoField(primary_key=True) email = models.EmailField()class Lawyer(models.Model): user = models.OnetoOneField(User)class Session(models.Model): name = models.CharField() lawyer = models.ForeignKey(Lawyer)I am trying to create multiple objects with a list serializer for Session.From the app side they don't have the id of lawyer, but have the email of each lawyer. How can I write a list serializer where I can take the following json input and use email to fetch lawyer to store multiple session objects?The...

 django                     2 answers                     27 view
 2018-10-22         Martha

How do I represent concurrent actions in jBPM, any of which can end a process?

An example: a permit must be examined by two lawyers and one engineer. If any of those three reject it, the process enters a "rejected" end state. If all three grant the permit, it enters a "granted" end state. All three examiners may examine simultaneously, or in any order. Once one engineer has granted it, it shouldn't be available to be examined by an engineer; once two lawyers have examined it, it shouldn't be available to lawyers; once one engineer and two lawyers have examined it should go to the granted end state.My initial thinking is that either I have a overly com...

 concurrency                     1 answers                     71 view
 2018-10-22         Martha

How do I select items from a drop down box in selenium using python

I'm attempting to iterate through a dropdown list for webscraping and I've noticed that my code isn't working outdropdown = browser.find_element_by_XPATH('//*[@id="department-dropdown"]')select = Select(dropdown)select.select_by_value("Accounting")ERROR MESSAGE I RECIEVETraceback (most recent call last): File "C:\Users\David\eclipse-workspace\Web_Scrap\setup.py", line 31, in <module> dropdown = browser.find_element_by_XPATH('//*[@id="mainContent"]/div[1]/div/div[3]/div/div/span')AttributeError: 'WebDriver' object has no attribute 'find_element_by_XPATH'For now I w...

 python-3.x                     1 answers                     79 view
 2018-10-22         Martha

How to show notification in component which is not mounted yet in react js

I have two component (Chat.js Phone.js) and a container (Full.js)I am using following versions: react 16.1.1, react-router-dom:4.2.2. Following are my files:Full.js class Full extends React.Component { render () { return(<Switch> <Route path="/phone" name="Phone" component={Phone} /> <Route path="/chat" name="Chat" component={Chat} /> </Switch>) } }Chat.js class Chat extends React.Component { render () { return(<div> <div>Some chat code...</div> </div>); } }Phone.js class Phone extends React.Compo...

 javascript                     2 answers                     46 view
 2018-10-22         Martha

Spring ActiveDirectoryLdapAuthenticationProvider issue - Getting Supplied password was invalid

Please take a look on configuration as shown below: ldap.urls=ldap://***.***.local:8389 ldap.base.dn=dc=test,dc=com ldap.user.dn.pattern=(&(objectClass=user)(userPrincipalName={0})(memberof=CN=Group Name,OU=***,OU=****,DC=test,DC=com))WebSecurityConfig.java @Configuration public class WebSecurityConfig extends WebSecurityConfigurerAdapter { private final static Logger log = LogManager.getLogger(WebSecurityConfig.class); @Value("${ldap.url}") private String ldapUrl; @Value("${ldap.base.dn}") private String ldapDomain; @V...

 spring-boot                     1 answers                     50 view
 2018-10-22         Martha

How to place a button below Imageview

The layout I used and the result is given. I want the profile Image to overlay the 3+ button. How can I rearrange the layout ? <RelativeLayout android:id="@+id/profile_layout" android:layout_width="wrap_content" android:layout_height="wrap_content"> <de.hdodenhof.circleimageview.CircleImageView android:id="@+id/author_profile_image" android:layout_width="40dp" android:layout_height="40dp" android:layout_centerVertical="true" android:layout_marginLeft="16dp" android:src="@drawable/ic_account_circle"&g...

 android                     3 answers                     77 view
 2018-10-22         Martha

How to use IN clause with multiple columns on same data in postgresql?

I have a query like this:SELECT c1 from t WHERE c2 IN list1 AND c3 IN list1;I want to combine this query to get something like this:SELECT c1 from t WHERE c2 AND c3 IN list1; You can use arrays and the operator <@ (is contained by), e.g.:with my_table(name1, name2) as (values ('Emily', 'Bob'), ('Ben', 'Jack'), ('Emily', 'James'))select *from my_tablewhere array[name1, name2] <@ array['Emily', 'Jack', 'James', 'Chloe']; name1 | name2 -------+------- Emily | James(1 row)See also: How to use same list twice in WHERE clause? [XXX]Suppose one table Person which have ...

 sql                     2 answers                     41 view
 2018-10-22         Martha

Is there any tool/SW to help me build a good database?

I am new to databases. I have a classifieds website with MySQL db and I am soon about to use SOLR to index them also. Then whenever a query is done, SOLR will return ID:s and I will match those ID:s to the MySQL database and fetch the ads to display.Anyways, I have trouble making the db.Users may choose from a drop-list what category to search. Lets say they choose CARS. Then a div is shown containing drop lists for "YEAR, FUEL, GEARBOX, PRICE". Then they may choose LOCATION also. Also if they wish, they may type in a querystring. All is optional though. How should I setup ...

 php                     2 answers                     61 view
 2018-10-22         Martha

How to use Eclipse's Display View for Debug?

At the link below it explains that the "display view allows you to manipulate live code in a scrapbook type fashion (see Figure 8). To manipulate a variable, simply type the name of the variable in the Display view, and you'll be greeted with a familiar content assist."http://www.ibm.com/developerworks/library/os-ecbug/However, I am having trouble getting it to work. I have the view open but all the buttons are disabled. I have tried putting code in the view, selecting code in the view, selecting code in other views, while running and while not running debug, but the onl...

 java                     5 answers                     4 view
 2018-10-22         Martha

What is the difference between Wide and Nonwide tables in SQL 2008?

I was looking at this page on MSDN:Maximum Capacity Specifications for SQL Server 2008And it says the following:Max Columns per 'nonwide' table: 1,024Max Columns per 'wide' table: 30,000However I cannot find any information on the difference between 'wide' and 'nonwide' tables in SQL 2008. If I wanted to define a 'wide' table, how would I do it? Special Table TypesAll the info you need is in this MSDN article.A wide table is just a table with sparse columns. To make a table wide you just add a column set to its definition. [XXX]I would say the difference is about 28,9...

 sql-server                     4 answers                     18 view
 2018-10-22         Martha

Retrieving text from password field [python][pyqt4]

def welcomeStage (self): self.test = QtGui.QLineEdit (self) self.test.move (50, 150) QtCore.QObject.connect (self.test, QtCore.SIGNAL ('returnPressed()'), self.passwordStage)def passwordStage (self): self.email = self.test.text() self.test.clear() self.test.setEchoMode (QtGui.QLineEdit.Password) QtCore.QObject.connect (self.test, QtCore.SIGNAL ('returnPressed()'), self.loginStage)def loginStage (self): self.pwd = self.test.text() print self.pwd if len (self.pwd) < 0: welcomeStage () returnSimply put, I am making a login...

 python                     1 answers                     46 view
 2018-10-22         Martha

Renaming SOME columns in pandas

I have a csv file which I get as a report and it's header looks like this:ln;7,26;7,27;7,28;7,29;7,3;7,31;8,01;8,02;8,03;8,04;8,05;8,06;8,07;8,08;8,09;nameThe numbers are supposed to be dates (so 7,29 is July 29, 7,3 is July 30). How can I convert these to actual date format if I'm using pandas? Since it's from a report, I'd need a way to format them daily automatically.Thanks in advance! Let's try pd.to_datetime:pd.to_datetime(df.columns[1:-1] + ',2018', format='%m,%d,%Y')DatetimeIndex(['2018-07-26', '2018-07-27', '2018-07-28', '2018-07-29', '2018-07-03', ...

 python                     1 answers                     25 view
 2018-10-22         Martha

How to for loop all documents in a collection - Azure CosmosDB - Nodejs

I have looked around at a few answers/questions regarding this issue but yet to find a solution.I have a collection with documents (simplified) as such:{ "id": 123 "stuff": "abc" "array":[ { "id2":456 "properties": [ { "id3": 789 "important": true } ] } ]} I want to check for each document in my collection, for each array object within array, for each properties, if it has important: true for example. Then return:"id": 123"id2": 456"id3": 789I have tried us...

 arrays                     2 answers                     36 view
 2018-10-22         Martha

How can I perform an UPSERT using Azure DocumentDB?

Azure DocumentDB does not support UPSERT. Is there a reasonable work around to achieve the same functionality?Is using a stored procedure which checks if the document exists to determine whether and insert or update should be performed an effective strategy?What if I need to perform thousands of these in bulk?Vote for the feature here:http://feedback.azure.com/forums/263030-documentdb/suggestions/7075256-provide-for-upsertUpdate - Here is my attempt at a bulk upsert stored procedure.function bulkImport(docs) { var collection = getContext().getCollection(); var colle...

 azure                     1 answers                     37 view
 2018-10-22         Martha

d3 cluster layout nodes at a particular depth are not aligned

I have the following JSFiddle code:http://jsfiddle.net/s4Mjx/27/I want the node2 and node3 to be vertically aligned as they are at the same depth. I also want all the leaf nodes to be aligned as well. However, this code only aligns the leaf nodes and remaining nodes are at different levels. The easiest is to use the tree layout, it aligns nodes at depth, then move the leaf nodes to the position of largest depth.var root = getData();var nodes = tree.nodes(root);var links = tree.links(nodes);var maxY = d3.max(nodes, d => d.y);var linkSources = new Set(links.map(d =>...

 d3.js                     1 answers                     3 view

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