Posts

Showing posts from February, 2014

python - Labels not defined in tkinter app -

i'm trying make basic window text "t" inside using tkinter, when running code shell spits out "nameerror: name 'label' not defined". i'm running python 3.5.2. i followed tutorials problem in label = label(root, text="test") line. import tkinter root = tkinter.tk() sheight = root.winfo_screenheight() swidth = root.winfo_screenwidth() root.minsize(width=swidth, height=sheight) root.maxsize(width=swidth, height=sheight) label = label(root, text="test") label1.pack() root = mainloop() is label function different in 3.5.2? you never imported label class. try tkinter.label check import statements tutorials maybe imply from tkinter import *

Read static ePassport (ISO 14443-4, MRTD) tag id via Android NFC -

is possible read static tag id of epassport? each time try read tag id android device gives me random 1 (it's described here: https://randomoracle.wordpress.com/2012/09/07/nfc-in-us-passports-verifying-the-random-id/ ). i understand mrtd application inside card requires bac read personal information name, nationality, image etc, don't need data. i'm wondering, if it's possible stable card's id sure, it's same card i've read while ago. no not possible intention. see icao 9303, part 11 , chapter 4. attempt can't distinguished skimming, i. e. tracing, whether same passport here , @ time, without proof, card holder agreed (by presenting or card, terminal can read optical information necessary bac).

java - BitmapFactory.decodeFile() returns null value for a camera picture -

i have android app go camera activity , take photo, , execute following code: string s1 = file_uri.getpath(); bitmapfactory.options options = new bitmapfactory.options(); options.injustdecodebounds = true; bitmap = bitmapfactory.decodefile( s1, options); bytearrayoutputstream stream = new bytearrayoutputstream(); bitmap.compress(bitmap.compressformat.jpeg, 50, stream); where file_uri image path phone storage (it not null) bitmap variable null. why? your image may big , out of memory

javascript - Filter objects array -

i got array this: const xx = [ { name: "alex", income: 324300, total: 3030000 }, { name: "snake", income: 3433000, total: 34323000 } ]; i want check if income larger 300000 , if name stored or logged. this have tried, dont understand how works so.. var f = {}; (var = 0, len = xx.length; < len; i++) { f[xx[i].id] = xx[i]; if(f[income]>=500000){ console.log(xx[i]); } } you can use array.filter filtering array , array.foreach iterating on console.log or w/e want it. const xx = [ { name: "alex", income: 324300, total: 3030000 }, { name: "snake", income: 3433000, total: 34323000 }, { name: "wake", income: 4, total: 3 } ]; xx.filter(function(x) { return x.income > 30000; }).foreach(function(x){ console.log(x) });

apache - How to redirect subfolder as proxy in htaccess? -

i have isso app running on localhost:63837 , i'd proxy requests https://www.domain.com/isso these approaches: rewriterule https://www.domain.com/isso/(.*)$ http://127.0.0.1:63837/$1 [p] rewriterule /isso/(.*)$ http://127.0.0.1:63837/$1 [p] rewriterule /isso(.*)$ http://127.0.0.1:63837/$1 [p] normally i'd adjust httpd-vhost.conf in case can't on hoster (uberspace). <location "/isso"> proxypass "http://127.0.0.1:63837" proxypassreverse "http://127.0.0.1:63837" </location> also, don't use subdomain this. your second approach correct (in fact, work in .conf file). in per-directory context ( directory or .htaccess ), pattern matched against partial path: directory path rule defined stripped path before comparison - , including trailing slash!. removed prefix ends slash, meaning matching occurs against string never has leading slash. therefore: rewriterule ^isso/(.*)$ http://127.0.0.1:63837/$1 ...

android - Permission settings restricting deployment platforms -

i have tried embrace new permission framework having problems. my app has optional feature read sms messages (from bank) , if contains data (payment made) update app information. this works fine if include in manifest: <uses-permission android:name="android.permission.read_sms"/> i set permission mid app with: public boolean getpermission(string type, integer permission ) { // returns true if have permissions - false otherwise if (activitycompat.checkselfpermission(context, type) != packagemanager.permission_granted) { activitycompat.requestpermissions(activity, new string[]{type}, permission); return false; } else return true; } however, when deploy this, wont deploy tablet tablet not have sim card , no sms available - play services filters device , wont deploy it. i can round using manifest line: <uses-feature android:name="android.permission.read_sms" android:required="false"/> application d...

asp.net - C# Validating a password on SERVER SIDE -

i'm right trying validate password on server side using .net here's client side code: <asp:textbox id="pswrd" runat="server" width="120px"></asp:textbox> <span style="background-color:yellow; color:red; font-weight:bold;" title="some rules">password rules</span> <asp:requiredfieldvalidator id="vpswrd" runat="server" errormessage="a password required" controltovalidate="pswrd"> </asp:requiredfieldvalidator> <asp:customvalidator id="ipswrdval" runat="server" onservervalidate="validatepasswordserverside" controltovalidate="pswrd" errormessage="please enter *valid* password"...

mysql - Rails activeadmin database -

i have problem active admin , showing records. view has more 3k records (i join few tables prepare it) , active admin has problem response time , shows 504 error. one of problems pagination first must count records , prepare number of pages displayed (yes i've tried disable option). does have similar problem? thanks!

c - MinGW gcc vs linux gcc executable size -

i wrote small c program #include <stdio.h> int main() { int = 0; while (i < 10){ printf("%i", i); i++; } } if compile mingw gcc executable 59kb if compile linux gcc, via ubuntu on windows shell, executable 9kb. 50kb seems lot of data... why this? according mingw wiki, debugging information can included libraries linked executable. can exclude debugging information executable, gcc "-s" option or "strip" command. http://www.mingw.org/wiki/large_executables support "gnu style" or "ms style" printf format seems 1 of differences between mingw stdio , gnu c library stdio. mingw https://sourceforge.net/p/mingw/mingw-org-wsl/ci/5.0-active/tree/mingwrt/include/stdio.h mingw-w64 https://github.com/msys2/mingw-w64/blob/master/mingw-w64-headers/crt/stdio.h gnu c library https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=blob;f=libio/stdio.h;hb=head mingw #> gcc --version...

python - How to create user with secured password field -

i have /users endpoint , want secure user's password. want prevent updating password , retrieving request, need way encrypt password before stored. there way this? found myself. event hooks looking for. http://python-eve.org/features.html#event-hooks

android - Background service using alarm manager -

i have followed below example code implementing periodic background service. periodic task executes correctly if app on foreground on 1st time. if, close application background service not working. https://github.com/codepath/android_guides/wiki/starting-background-services#using-with-alarmmanager-for-periodic-tasks 1) broadcastreceiver service bootcomplete public class bootbroadcastreceiver extends broadcastreceiver { @override public void onreceive(context context, intent intent) { // launch specified service when message received intent startserviceintent = new intent(context, mytestservice.class); context.startservice(startserviceintent); } } 2) broadcastreceiver start service public class myalarmreceiver extends broadcastreceiver { public static final int request_code = 12345; // triggered alarm periodically (starts service run task) @override public void onreceive(context context, intent intent) { intent = new intent(context, mytestservice.class); ...

java - How to parse a big JSON file in android Like This -

Image
this question has answer here: how parse json in android 4 answers how parse json : the best way using gson library google refer link : gson

sql - Python Pygresql Insert Current Date -

what correct way insert current time postgresql using pygresql db-api compliant interface? understood postgresql uses 'timedate' , python (3.x) uses 'datetime'. there clean way convert between two? pygresql package displays error when trying insert 'datetime' fields. pg.programmingerror: error: schema "datetime" not exist using pygresql type 'timestamp' still uses 'datetime' shown in code below 'sqlcur' postgresql cursor, 'tblnam' table, 'collst' list of columns, , 'insrec' list of records contains 1 field has current time: ## ## load packages ## import pgdb pgdb import connect datetime import datetime import pprint ## ## setup variables ## dbahst = 'localhost' dbausr = 'user' dbapas = 'pass' dbanam = 'db' dbaprt = '5432' tblnam = 'device_table' collst = ['ci_nm', 'loc_txt', 'model_nm', 'datecreated' ] ins...

xml - Invalid RSS Feed. Undefined item element: media:backLinks -

Image
when run rss http://www.goalscout.com/static/rss2.xml through http://validator.w3.org/feed/ error message this feed not validate. line 14, column 9: undefined item element: media:backlinks (2 occurrences) [help] <media:backlinks> so i'm unable understand what's wrong xml. xml namespace media seems correctly defined, rss advisory board reccomends, had googled around few hours no 1 had same problem. thanks can point me in right direction. the rss feed contains additional elements within item element. these additional elements in namespace http://search.yahoo.com/mrss/ , validator not have schema information namespace. <media:backlinks> this should ok rss schema says validation on unknown elements should 'lax' means validate them if know are. however validator using seems little on zealous, , flagging these errors, should warnings @ most. to eye rss feed looks valid.

graphviz - How can I combine edges in an ortho graph? -

Image
i'm using splines=ortho , hoping edges collapse together. illustrate, want accomplish this: i tried this: digraph g { splines=ortho; edge [dir=none]; node [shape=diamond, label="", height=0.1, width=0.1]; start -> [weight=10]; start -> b; start -> c; start -> d; start -> e; } but ends looking this: any clue on how can make edges overlap each other?

Force maven update -

i imported working project on other computer started download dependencies. apparently in meantime internet connection crashed. get: build errors comics; org.apache.maven.lifecycle.lifecycleexecutionexception: failed execute goal on project comicstest: not resolve dependencies project comicstest:comicstest:war:0.0.1-snapshot: following artifacts not resolved: org.springframework:spring-context:jar:3.0.5.release, org.hibernate:hibernate-entitymanager:jar:3.6.0.final, org.hibernate:hibernate-core:jar:3.6.0.final, org.hibernate:hibernate-commons-annotations:jar:3.2.0.final, org.aspectj:aspectjweaver:jar:1.6.8, commons-lang:commons-lang:jar:2.5, mysql:mysql-connector-java:jar:5.1.13: failure transfer org.springframework:spring-context:jar:3.0.5.release http://repo1.maven.org/maven2 cached in local repository, resolution not reattempted until update interval of central has elapsed or updates forced. original error: not transfer artifact org.springfra...

java - What name to give to objects when adding to ArrayList -

i have container class array list defined person object. the person using program asked register person , have create object person, give name, lastname , age user inputed , after add arraylist. my question is, when creating person object, can give same name every object add? or have name them person1, person2, etc? if so, how? thanks no, don't have give them different names. doing defeat purpose of using collection. can following: person p = new person(...); // set name, age, etc. list.add(p); each time that, new person created , added list. think of name p temporary variable can discarded.

operator precedence - How does Java process the expression x = x - (x = x - 1)? -

i tested following code: int x = 90; x = x - (x = x - 1); system.out.print(x); it prints 1. as far understand, things go in following order: x - 1 computed , stored temporary variable in memory. x assigned result temporary variable item 1. then x - new value of x calculated. the result assigned x ; i don't understand why x subtract result of item 2 still has initial value after item 2. missing? from https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html all binary operators except assignment operators evaluated left right; assignment operators evaluated right left. you doing 90 - (90 - 1) => 1 it's important not confuse precedence order of evaluation. related not same. edit as @ruakh points out, jls spec put differently tutorial above. http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15 ‌​.7. the left-hand operand of binary operator appears evaluated before part of right-hand operand e...

JAVA Why do I get a type error when assigning these variables (T extends Comparable<T>) -

so, let's have these 2 classes. public class main<t extends comparable<t>> { public list<t> tolist(t t){ node n = new node(); n.value = t; //this assignment1 gives no issues. list<t> list = new list<t>(); list.add(n.value); //this assignment2 gives type error. return list; } } class node <t extends comparable<t>> { t value = null; } so, why assignment1 go through without type error, while assignment2 gives me following error: add (t) in list cannot applied (java.lang.comparable) it disappears when do: list.add((t)n.value); but understand reason first figure out if above solution correct one. edit: now, should specify code uses these classes integer objects. so, developer can assume t types same. not sure if code has underlying routine can change values during casting. node n = new node(); should be node<t> n = new node<t>(); if ever refer node without ...

c# - Send results of Database Query from ASP.net MVC to Unity Game Engine -

i need able results of database queries run on webpage sql server database regarding user information sent game in unity. i'm gameplay programmer significant experience in c#, i'm @ loss trying figure out how make happen. the bare minimum need figure out how send user/password combination web page, check database username, , store if not exist. finally, sending success or failure depending on whether user/password combination existed. in unity have @ disposal 2 classes sending http requests. 1.) https://docs.unity3d.com/scriptreference/www.html 2.) https://docs.unity3d.com/scriptreference/wwwform.html i have basic (very basic) understanding of how web technology works, finer details required make happen beyond current knowledge. my website hosted on azure running asp.net mvc. @ or pointers in right direction appreciated. i have far been able results using www, meaningless me , wouldn't know how tell if results of query working (based on responses). can of ...

ajax - Python requests module gets the same results despite incrementing page number -

the thing changes in url page number, incremented after each request. other selenium or related tools, i’m not sure approach used traverse pages. instinct there may header/query combination data directly, don't know find it. url = 'http://therunningbug.co.uk/events/find-races.aspx?eventname=&addressregion=&addresscounty=&date=&surface=#sort=date&page=' page = 1 while true: pagedata = beautifulsoup(requests.get(url + str(page)).content) articles = pagedata.find('div', {'class':"items-content"}) in articles.find_all('article'): name = a.find('span', {'itemprop':"name"}).text d, t = a.find('time').get('datetime').split('t') timedata = t[:-3] datedata = d.split('-') date = (datedata[1] + '/' + datedata[2] + '/' + datedata[0][2:]).strip() description = a.find('p', {'i...

python - Using pandas to create a summary table -

how can use pandas obtain summary table data below: id condition confirmed d0119 bad yes d0119 no d0117 bad yes d0110 bad undefined d1011 bad yes d1011 yes d1001 bad yes d1001 bad yes required output: id condition confirmed %bad d0119 bad,good yes, no 50 d0117 bad,yes 100 d0110 bad,undefined 0 d1011 bad,good yes, yes d1001 bad,bad yes, yes 100 can help? thanks you can way: in [123]: (df.assign(bad=df.condition=='bad') ...: .groupby('id') ...: .agg({'condition':pd.series.tolist, ...: 'confirmed':pd.series.tolist, ...: 'bad':'mean'}) ...: ) ...: out[123]: bad condition confirmed id d0110 1.0 [bad] [undefined] d0117 1.0 [bad] [yes] d0119 0.5 [bad, good] [yes, no] d1001 1.0 [bad, bad] [yes, yes] d1011 0.5 [bad, good] [yes, yes] vertical variant: in [113]: df out[...

string - Get only one word from line -

how can take 1 word line in file , save in string variable? example file has line "this, line, is, super" , want save first word ("this") in variable word. tried read character character until got on "," when check got error "argument of type 'int' not iterable". how can make this? line = file.readline() # reading "this, line, is, super" if "," in len(line): # checking, if contains ',' in line: if "," not in line[i]: # while character not ',' -> error word += line[i] # add string at glance, on right track there few things wrong can decipher if consider data type being stored where. instance, conditional 'if "," in len(line)' doesn't make sense, because translates 'if "," in 21'. secondly, iterate on each character in line, value not think. want index of character @ point in loop, check if ",...

Stories sandbox in wit.ai -

let's create story dedicated giving weather in given place, , story dedicated listing possible activities in given place, , allowing buy tickets them. let's user launches second story entering "what can in paris ?". bot answers list of things , asks user input 1 he'd buy ticket for. but, instead of entering number, user inputs "what current weather in paris ?". first story triggered ? a wit.ai blog post states : we strengthened initial overfitting: when user follows scenario of story, bot 100% stick story. should repost intent context key next action prediction scope stays within same story ? should end of story flush context of keys (which in our tests seems idea not stick story) ? thanks insights.

Postgresql IN operator Performance: List vs Subquery -

for list of ~700 ids query performance on 20x slower passing subquery returns 700 ids. should opposite. e.g. (first query takes under 400ms, later 9600 ms) select date_trunc('month', day) month, sum(total) table_x y_id in (select id table_y prop = 'xyz') , day between '2015-11-05' , '2016-11-04' group month is 20x faster on machine passing array directly: select date_trunc('month', day) month, sum(total) table_x y_id in (1625, 1871, ..., 1640, 1643, 13291, 1458, 13304, 1407, 1765) , day between '2015-11-05' , '2016-11-04' group month any idea problem or how optimize , obtain same performance? the difference simple filter vs hash join: explain analyze select t in (500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,...

arrays - Add new field to an existing object javascript d3js -

add third attribute object. var result = array.from( grants.reduce((organ, grant) => organ.set(grant.organisation.name, (organ.get(grant.organisation.name) || 0) + +grant.value), new map()), ([organization, sum]) => ({organization,sum}) ); i wanting add new field called id above result object. how can achieve that? something like: ([id, organization, sum]) => ({id, organization,sum}) but dont understand organ.set, organ.get @ , when try add parameter breaks. the field willing add in grant.organisation.orgid place code

How would you round up or down a Float to nearest even numbered integer in Swift 3? -

i need little rounding or down float nearest number in swift. eg: 32.86 closest 32 33.86 closest 34 if want round nearest number, divide 2, round , multiply 2: let rounded = int(round(value / 2.0)) * 2

excel - Missing Microsoft XML reference on macOS Sierra 10.12.1, Office Mac 2011 14.6.1 -

i porting excel vba module windows macintosh. if have terminology right, module uses reference called "microsoft xml, v3.0." marked "missing" on mac. other references working expected. have poked bit on each platform, looking @ other references working properly. seems 5 other references work associated files in office directory hierarchy on both platforms. the xml reference has "location: c:\windows\system32\msxml3.dll" on windows computer. on mac, excel appears looking in same directory workbook, sensible default in situations. is there hope porting project? edit: fixed terminology above , added following paragraph below. i think reverse engineer c:\windows\system32\msxml3.dll , re-implement (or subset) macos, seems big job , not hope.

reactjs - Should you dispatch or call next multiple times inside of a Redux middleware? -

i'm curious, i've seen in middlewares, such redux-promise-middleware want single action fire off multiple actions (e.g. request, success, failure). however, in middleware, we're provided dispatch able dispatch these actions. there reason calling these additional actions next(action) on dispatch(action) ? if dispatch action go through of middleware chain again. on other hand next sends along next middleware in chain or straight reducers if there aren't more middlewares.

nexus - OSSRH release not replicating to maven central -

Image
3 days ago, released version 2.0.2 of maven archetype ossrh , shows in ossrh archetype catalog , can downloaded oss releases ( https://oss.sonatype.org/content/repositories/releases/edu/uchicago/mpcs53013/hdfs-ingest-weather-archetype/2.0.2/ ) however, if in maven central, still shows version 2.0.1. shouldn't visible after 3 days. there way can force sync? thanks, mike there is: http://repo1.maven.org/maven2/edu/uchicago/mpcs53013/hdfs-ingest-weather-archetype/2.0.2/ after release central repository sonatype artefact should visible after few hours: http://central.sonatype.org/pages/ossrh-guide.html#releasing-to-central if have problem can check status of sonatype services: http://status.sonatype.com/ you can create issue maven central repository: http://central.sonatype.org/pages/help.html mvnrepository sort of indexing many maven repository in 1 place. 1 of indexing central repository. if wrong mvnrepository - please contact support of site.

sorting - recursive merge sort in python -

i trying make merge sort using 2 functions in python. got error like indexerror: list assignment index out of range whenever run code. don't know part wrong. code below. appreciate!! def merge(a): def merge_sort(a,first,last): if first<last: mid=(first+last)//2 merge_sort(a,first, mid) merge_sort(a,mid+1,last) temp=[] temp.append(99999) i=first j=mid+1 k=0 while i<=mid , j<=last: if a[i]<=a[j]: temp[k]=a[i] k=k+1 i=i+1 else: temp[k]=a[j] k=k+1 j=j+1 while i<=mid: temp[k]=a[i] k=k+1 i=i+1 while j<=last: temp[k]=a[j] k=k+1 j=j+1 a=0 b=first ...

javascript - Access variable in Backbone View from Backbone Router -

my router var approuter = backbone.router.extend({ routes: { ':*':'home', 'home' : 'home', 'home/:a' : 'home', '*whatever' : '404' }, home: function (a) { document.title = sitetitle + ' - home'; homepage = new homepage; homepage.render(a); }, 404: function(){ document.title = sitetitle + ' - 404'; fofpage = new fofpage; fofpage.render(); } }); my home view var homepage = backbone.view.extend({ initialize: function (options) { _.bindall(this, 'beforerender', 'render', 'afterrender'); var _this = this; this.render = _.wrap(this.render, function (render) { _this.beforerender(); render(); _this.afterrender(); ...

c - n Partitions with fixed number of elements -

i have given array of integers , should partition difference of sums minimal. size of partitions fixed (3), there n/3 partitions. should output partitions minimal sum. i found algorithm think similar have problems understanding , adopting it: https://www.careercup.com/question?id=10244832 so understanding algorithm builds table, can check if there exists subsequence length k sums j. finds best fitting subsequence searching through table sum thats closest optimal (=arithmetical mean). array {5, 3, 1, 2} this n = 0 1 2 3 4 5 ------------------ length=0 | 1 0 0 0 0 0 1 | 0 1 1 1 0 1 2 | 0 0 0 1 1 1 optimal sum: length=2, n=(5+3+1+2)/2=5 exists sum=5 but how adopt table n partitions? possible 2 dimensional array? , how output elements instead of sum afterwards? best guess create second array , save combinations somehow. thanks in advance!

matlab - Error: operator *: nonconformant arguments (op1 is rxc, op2 is rxc ) -

i have implemented following function estimate parzen density of matrix , parzen.m function [retval] = parzen (matrix, datapoint, variance) [r c] = size(matrix); = ones(r, c)*datapoint; sub = matrix - a; = sub.^2; dw = 2 * variance; firstpart = 1/(sqrt(2*pi*variance)); retval = firstpart * exp((-1)*(up/dw)); error >> parzen(train, test, 0.25) error: parzen: operator *: nonconformant arguments (op1 1824x8, op2 1824x8 ) error: called parzen @ line 3 column 4 >> how can rid of error? the commenet @benoit_11 solved issue. a = ones(r,c) .* datapoint.

javascript - How can I optimize this floodFill algorithm? Advice needed -

i have fiddle following code. colorwalk clone here js code: function floodfill(x, y, selectedcolor, graycolor) { if (x < 0 || x >= 600) return; if (y < 0 || y >= 400) return; let square = $('.blockattribute').filter(function(ind, el) { return $(el).css('left') == x + 'px' && $(el).css('top') == y + 'px' }); let squarecolor = square.css('background-color'); if (squarecolor === graycolor || squarecolor === selectedcolor) { square.removeclass().addclass('blockattribute gray'); floodfill(x + 20, y, selectedcolor, graycolor); floodfill(x, y + 20, selectedcolor, graycolor); floodfill(x - 20, y, selectedcolor, graycolor); floodfill(x, y - 20, selectedcolor, graycolor); } else { return; } } i've been working on learning javascript/jquery , algorithms , i've pretty have clone working except fact when deeper , deeper grid, slower , slower code is. i've b...

matrix - Matlab Repeat Value -

i matrix: a = [2 3 4 6 7 8 9 1 2]; i need change matrix into: b = [2 3 4 6 7 8 9 1 2; 2 3 4 6 7 8 9 1 2; 2 3 4 6 7 8 9 1 2] the output be: b = 2 3 4 6 7 8 9 1 2 2 3 4 6 7 8 9 1 2 2 3 4 6 7 8 9 1 2 thank much... repmat , repelem used repeating copies of array. case, can use either of these as: repmat(a,3,1) or repelem(a,3,1)

vue.js - Vuejs state seems to only update in a setTimeout -

this component object: <script> import { ipcrenderer } 'electron'; export default { data() { return { "formdata": { "username": "", "password": "", "auth_code": "", "auth_code_required": false, "submitted": false, "showformscreen": true }, "showwelcomescreen": false, "state": { "value": 0, "message": "" } } }, computed: { statemessageshow() { return (this.state.value !== 0 || this.state.value === 999); } }, mounted() { ipcrenderer.on('loginresponse', (e, a) => { this.formdata.submitted = false; switch(a.state) { // successful login case 1: this.formdata.showformscreen = false; settimeout(()=> { ...

c# - ASP.NET Assigning default user roles upon registration -

how can assign default roles e.g. standard user upon user registration? at moment, can manually assign roles editing table in sql server there way default role can assigned users? i've tried using solution posted here doesn't appear work projects using asp.net core web application (visual studio 2015). // post: /account/register [httppost] [allowanonymous] [validateantiforgerytoken] public async task<iactionresult> register(registerviewmodel model, string returnurl = null) { viewdata["returnurl"] = returnurl; if (modelstate.isvalid) { var user = new applicationuser { username = model.email, email = model.email }; var result = await _usermanager.createasync(user, model.password); if (result.succeeded) { // more information on how enable account confirmation , password reset please visit http://go.microsoft.com/fwlink/?linkid=532713 ...

bro-ids logstash filter not working -

i've set elk stack on centos 7, , forwarding logs freebsd 11 host runs bro. filters not working correctly parse bro logs. this current set up: freebsd filebeat client filebeat.yml filebeat: registry_file: /var/run/.filebeat prospectors: - paths: - /var/log/messages - /var/log/maillog - /var/log/auth.log - /var/log/cron - /var/log/debug.log - /var/log/devd.log - /var/log/ppp.log - /var/log/netatalk.log - /var/log/setuid.today - /var/log/utx.log - /var/log/rkhunter.log - /var/log/userlog - /var/log/sendmail.st - /var/log/xferlog input_type: log document_type: syslog - paths: - /var/log/bro/current/app_stats.log input_type: log document_type: bro_app_stats - paths: - /var/log/bro/current/communication.log input_type: log document_type: bro_communication - paths: - /var/log/bro/current/conn.log input_type: log document_type: bro_conn - paths: - /var/log/bro/current/dhcp.lo...