Posts

Showing posts from April, 2011

android - ItemTouchHelper startSwipe not working -

i tried use startswipe within adapter, seems not working. strangely, when tried swipe finger manually, worked. startswipe not work when clicked on of button inside holder. need on this~ this called startswipe (in oncreateviewholder method). final viewholder holder = new viewholder(rootview); holder.rightitemlayout.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { mitemtouchhelper.startswipe(holder); } }); this how setup itemtouchhelper: mitemtouchhelper = new itemtouchhelper(new itemtouchhelper.simplecallback(0, itemtouchhelper.left) { @override public boolean onmove(recyclerview recyclerview, recyclerview.viewholder viewholder, recyclerview.viewholder target) { return true; } @override public void onswiped(recyclerview.viewholder viewholder, int direction) { } }); how itemtouchhelper attached recyclerview: recyclerview.layoutmanager mlayoutmanager = new linearlayoutmanager(ge...

java - How to automatically run a playlist of YouTube? -

i'm new in java programming , second question. did enable playlist through dialog box in can enter playlist id youtube. what happened i happy everytime enter id not cool , want playlist start automatically. @override public void onclick(view view) { switch (view.getid()) { case r.id.fab: fab.hide(); displayplaylistdialog(); break; } } public void displayplaylistdialog() { layoutinflater inflater = getlayoutinflater(); view alertlayout = inflater.inflate(r.layout.playlist_dialog_layout, null); final edittext etplaylistid = (edittext) alertlayout.findviewbyid(r.id.et_playlist_id); alertdialog.builder alert = new alertdialog.builder(this); alert.setview(alertlayout); alert.setcancelable(true); alert.setnegativebutton("cancel", null); alert.setpositivebutton("fetch", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface...

javascript - Can't start selenium-webdriver on Karma suite -

can't start selenium-webdriver throught karma test suite. have try phantomjs, firefox, chrome... , nothing. i'm working on node@v0.12.17. this karma.conf.js: module.exports = function (config) { config.set({ basepath: '', frameworks: ['browserify', 'jasmine'], files: [ 'scrollmanagerspec.js' ], exclude: [ ], preprocessors: { 'scrollmanagerspec.js': ['browserify'] }, browserify: { debug: true }, reporters: ['spec'], port: 9876, colors: true, loglevel: config.log_info, autowatch: true, browsers: [ 'chrome'], singlerun: true, concurrency: infinity }) } and spec: var webdriver = require('selenium-webdriver'); when karma start following error: 05 11 2016 17:10:14.355:info [framework.browserify]: bundle built 05 11 2016 17:10:14.377:info [karma]: karma v1.3.0 server started @ http://...

java - How to select particular values out of a string and turn them into an integer -

i'm using scanner obtain string containing x , y coordinate in form of x,y saved string xy1, how numbers of x , y can make int x1 equal x , int y1 equal y ignoring "," if you're sure there's comma inside string, , 2 parts integers : string xy1 = "123,4567"; string[] integers = xy1.split(","); int x1 = integer.valueof(integers[0]); int y1 = integer.valueof(integers[1]); system.out.println(x1 + " " + y1); it outputs 123 4567

How To Move Camera in Tao Opengl Framework in C# (WFA)? -

i'm trying make class control camera in opengl in c# using tao framework class including -moving camera , down , right , left -rotate camera -apply of transformation main camera every thing work when apply transformation main camera nothing work this class using system; using system.collections.generic; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using tao.opengl; using tao.sdl; using visualization; using mathnet.numerics.linearalgebra; using mathnet.numerics.linearalgebra.double; using mathnet.spatial.euclidean; namespace visualiation_assignment_2 { class cameracontroller { public vector3d cameraposition; public vector3d cameraup; public vector3d cameraright; public vector3d cameradirection; public vector3d camerlook; public double prespectivangle; public double znear, zfar; public double aspectratio; public cameracontroller() { gl.glenable(gl.gl_depth_test); ...

SQL DB2 how to apply date variable to inner queries? -

i have date variable have applied outer query, receiving error message: v_date not valid in context used - when trying use on inner queries. can me replace 2 3/31/2016 dates in inner query time variable v_date? need move line or double join? with ttt (select '3/31/2016' v_date sysibm.sysdummy1) select fpr.id fpr.id_pricg_mthdy, fpr.market_date, fpr.price_amount first_price, pr.price_amount second_price, pr2.price_amount third_price, thr.price_diff test_1, thr.price_diff2 test_2 price_table_1 fpr left join price_table0 pr on fpr.id = pr.id , pr.market_date = '3/31/2016' , pr.role_type = 'd' left join price_table0 pr2 on fpr.id = pr2.id , pr2.market_date = '3/31/2016' , pr2.role_type = 'p' left join threshold_test_table thr on fpr.id_pricg_mthdy = thr.id_pricg_mthdy join ttt on fpr.market_date = v_date fpr.dt_exptn = '1/1/9999' , fpr.market_date = fpr.sell_date , fpr.type = 'f' , fpr.id_pricg_m...

java - JAX-B enum generation with equal elements -

i running problem generation of enum jax-b. have language code in schema equal elements separating via case. example have entry de , 1 de results in combination other language codes in emun schema like: /** * afar * */ @xmlenumvalue("aa") value_1("aa"), /** * afar * */ @xmlenumvalue("aa") value_2("aa"), what bit problematic when trying access value via value_x naming. there way prevent that. expecting enum values aa , de , on know of must unique. in such case difference case. if problem naming value_1 , can fix customizing enum member names for, say, lowercase entries: <jaxb:bindings schemalocation=".../myxsd" node="/xs:schema"> <jaxb:bindings node="xs:simpletype[@name='mylangtype']"> <jaxb:typesafeenumclass> <jaxb:typesafeenummember name="lower_aa" value="aa"/> <!-- ... --> </jax...

c# - Entity Framework: Unable to create a constant value of type **. Only primitive types or enumeration types are supported in this context -

i have query: public override ienumerable<order> executequery(movierentalcontext database) { return order in database.orders (customer == null || customer.id == order.customerid) select order; } where customer field in class. there order class public class order: entity { [required] public copy copy { get; set; } public customer customer { get; set; } public datetime orderdate { get; set; } public datetime estimatedreturndate { get; set; } public salesman salesman { get; set; } public datetime? actualreturndate { get; set; } public decimal price { get; set; } [foreignkey("customer")] public long customerid { get; set; } } entity contains id. want orders of customer, during execution query exception thrown: unable create constant value of type >'movierental.dataaccess.models.customer'. primitive types or enumeration >types supported in context...

Investigate about wordpress theme -

i know wordpress theme being used following website: http://www.taxreclaimservice.co.uk/ thanks, i think custom made theme, because current theme not child theme.

c# - MultiTenancy with DbContext and TenantId - Interceptors, Filters, EF Code-First -

my organization needs have shared database, shared schema multitenant database. querying based on tenantid. have few tenants (less 10) , share same database schema no support tenant-specific changes or functionality. tenant metadata stored in memory, not in db (static members). this means entities need tenantid, , dbcontext needs know filter on default. the tenantid identified header value or originating domain, unless there's more advisable approach. i've seen various samples leveraging interceptors haven't seen clearcut example on tenantid implementation. the problems need solve: how modify current schema support (simple think, add tenantid) how detect tenant (simple - base on originating request's domain or header value - pulling basecontroller) how propagate service methods (a little trickier... use di hydrate via constructors... want avoid peppering of method signatures tenantid ) how modify dbcontext filter on tenantid once have (no idea) ...

android - Nested Scrollview does not work -

Image
hi have material design gridview contains 29 items. in nested scroll view shows 10 of them when toolbar , not scroll, follows: another issue when click on items nothing happens, unless click somewhere on empty spot. xml : <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/android_coordinator_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:id="@+id/appbar_layout" android:layout_height="@dimen/app_bar_height" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <android.support.design.widget.coll...

php - What is :array for in - private static function name():array -

i know have been answered before don't know terminology use when searching... phpstorm set method me , added :array end of declaration line, example, private static function name():array never seen :array before - what's about? return? cheers! this php 7 return type declaration. can learn more return type declaration on stackoverflow's documentation

TensorFlow - Tensor Reshape -

i'm using tensorflow , have following matrix: u2 = tf.constant([[1,3],[0,1],[1,0]],dtype=tf.float32) [[ 1. 3.] [ 0. 1.] [ 1. 0.]] what's easiest way reshape matrix results in tensor: tf.constant([[[1,1],[0,0],[1,1]],[[3,3],[1,1],[0,0]]],dtype=tf.float32) [[[ 1. 1.] [ 0. 0.] [ 1. 1.]] [[ 3. 3.] [ 1. 1.] [ 0. 0.]]] this 1 quick way create first submatrix using tensorflow api: u2 = tf.constant([[1,3],[0,1],[1,0]],dtype=tf.float32) first_col = tf.unpack(u2, axis=1)[0] repeated_cols = tf.tile(first_col, [2]) repeated_cols = tf.reshape(repeated_cols, [3,2]) which create [[ 1. 1.] [ 0. 0.] [ 1. 1.]]

logical - Code ignoring if statements - C++ -

i've been working on password generator college coursework, , 1 of parts involves creating 'complex' passwords, passwords nothing more strings of random characters, , user should able specify types of characters used. however, set of if statements control if function used don't activate based on values within uppertrue numbertrue , lowertrue, act if statement returns true, , function run. #include #include #include #include int upper(), lower(), number(), symbol(); //initializing functions used generate ascii code int clength = 15; int pass[30]; int uppertrue = 0, numbertrue = 1, symboltrue = 0; int main() { srand (time(null)); //seed random generator int = 0; //counter int = 0; { = rand() % 4 + 1; //randomly decides type of character shown - probablity unweighted complex module if (w...

Laravel Redirect Security -

this post in response answers provided by... laravel subdomain redirect login i decided go second answer provided, made edits it. have switch in 2 places... the first here inside of authenticated method inside of illuminate\foundation\auth\authenticatedusers /** * user has been authenticated. * * @param \illuminate\http\request $request * @param mixed $user * @return mixed */ protected function authenticated(request $request, $user) { switch ($user->getgroup()) { case 'athlete': return redirect('http://athlete.main.dev/login')->with([ 'email' => $request['email'], 'password' => $request['password'], ]); case 'coach': // implement same above, coach. } } the second inside of app\http\controllers\homecontroller /** * show application dashboard. * homecontroller main.dev * @return ...

arrays - How can I get all objects in Firebase with using AngularJs -

i want objects firebase database getting error. here how tried far; my firebase db (json); { "posts" : { "-kvwh7awrtg04zdtbtkd" : { "posttext" : "heo1" }, "-kvwhac2skrc_fy75a2i" : { "posttext" : "heo2" } } and here controller; $scope.loadpost = function() { $scope.posts=$firebasearray(firebasedata.refpost()); } and service; .factory('firebasedata', function($firebase) { var refpost = new firebase("https://myapp.firebaseio.com/posts"); refpost: function() { return refpost; } } }) result: error: firebasedata.refpost not function what wrong suggestion ? thanks always prefer documentation instead tutorials/blogs/sites... https://firebase.google.com/docs/database/web/start first need initialize firebase sdk code snippet in console. then you create reference father of 'posts' node, this. var fatherposts = firebase.database().ref().child('post...

Java: Maven and Library compiling -

i'm trying compile project has got maven dependencies , normal dependencies (the ones add .jar buildpath/lib). however, can choose 1 ;( either, compile maven, or compile artifacts, , won't make project work. i use <build> <plugins> <plugin> <artifactid>maven-assembly-plugin</artifactid> <configuration> <archive> <manifest> <mainclass>me.expdev.testproject.main</mainclass> </manifest> </archive> <descriptorrefs> <descriptorref>jar-with-dependencies</descriptorref> </descriptorrefs> </configuration> </plugin> </plugins> </build> and mvn clean compile assembly:single to compile. have 5 jars (which not available maven) need included in packag...

Python : Data Structure to hold transition probabilities HMM -

currently have designed 2d matrix :- transitionprobabilities = [[0 x in range(w)] y in range(h)] store probabilities. updating values of each , every row,col in matrix after encountering state transition. ex :- if encounter noun @ start of sentence change initial probability new probability. efficient data structure example performing such computations , create transition matrix in python ? the fastest , used library matrix computations in python numpy (as far concerned). http://www.numpy.org/

Selenium IDE command to combination shortcut keys press -

what command simulate keys combination: left_ctrl + left_alt + m this shortcut ff browser menu functionality. i tired this: command: sendkeys target: id=lst-ib value: ${key_ctrl}${key_alt}${m}

dictionary - Python - printing dictionaries without commas -

i procesing music api and writing results file, so: for val, track_id in zip(values,list(track_ids)): #below if val < threshold: data = {"artist": sp.track(track_id)['artists'][0]['name'], "track":sp.track(track_id)['name'], "feature": filter_name, "value": val} #write file io.open('db/json' + '/' + user + '_' + product + '_' + filter_name + '.json', 'a', encoding='utf-8') f: f.write(json.dumps(data, ensure_ascii=false, indent=4, sort_keys=true)) data printed follows: }{ "artist": "radiohead", "feature": "tempo", "track": "climbing walls", "value": 78.653 }{ "artist": "the verve", "feature": "tempo", "track": "the drugs don't work", "value...

What makes a story triggered in Wit.ai? -

i try understand logic behind weather bot in wit.ai quick-start .the story build trait intent (supposed "what weather ?") , entity declared weather wondered. so, think story triggered when weather asked , location given. this not case since illustration of jump / bookmarks below first step deals unset location. hence question : how wit.ai decide story trigger ? actually, there no difference between : what weather in barcelona ? , what weather ? from decision regarding next action choose wit engine standpoint. previous contexts , current context (and contained key) matters task. quick-start puts it: only trait entities have value influence prediction. non-trait entities, value ignored regards action prediction. my advice on create flushcontext action returns empty context , trigger everytime give story comes end.

PHP - Inline images not displayed in Thunderbird -

i want send mail trough php inline/embedded images (aka cid). mail succesfully sended , received correctly in gmail. however, in thunderbird (latest version windows) inline/embedded image not displayed. i followed information given in this thread still doesn't work. inline/embedded image displayed in gmail not in thunderbird. knows problem here? to: example@example.com subject: test from: noreply@test.com <noreply> mime-version: 1.0 content-type: multipart/related; boundary="52cd9ebf4fb8c9b0547e93b82b3f3f6b" --52cd9ebf4fb8c9b0547e93b82b3f3f6b content-type: text/html; charset=iso-8859-1 content-transfer-encoding: 8bit <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>test mail</title> </head> <body> <img src="cid:myimage...

javascript - Process http get request completely before click event -

i have following javascript code:- $scope.fav_bill_details=function (id1,id2,bill_id) { document.getelementbyid(id2).style.display="none"; $scope.getactivebill(); document.getelementbyid(id1).style.display="block"; $scope.getbilldetails(bill_id); $timeout(function(){ var btn=angular.element(document.getelementbyid(bill_id)); angular.element(document.getelementbyid(btn.id)).trigger('click'); }); }; as can see above there 2 function call above:- $scope.getactivebill(); , $scope.getbilldetails(bill_id); , both of these functions has http requests. data , process , store in $scope variables. want these request completed before trigger click event above. have implemented promises in both function. click finishes first , http requests completed. how can achieve above requirement?? you need use promises, this: $scope.fav_bill_details=function (id1,id2,bill_id) { document.getelementbyid(id2).style.display="none"; $sc...

python - Installing django-userena: userena.compat.SiteProfileNotAvailable when trying to create accounts app -

running django 1.9 i'm trying follow install instructions django-userena , add existing django project. when try create accounts app: python manage.py startapp accounts i error: userena.compat.siteprofilenotavailable other questions indicate need set auth_profile_module , directed in installation instructions . however, these assume have accounts app created, within i've created profile model. so seem i'm stuck in circular dependancy can't create accounts app without profile model, can't create profile model without accounts app! also, instructions, doesn't appear auth_profile_module should required yet @ step, in order create accounts app. how solve this?

javascript - Contenteditable field onchange event add date -

html: <p id="bon_date" class="inline" style="color:#0000ff;" contenteditable="true" onchange="add7day()"> enter date </p> javascript: function add7day() { var str = document.getelementbyid(#bon_date).value; var startdate = str.split("/"); var month = parseint(stardate[0], 10); var day = parseint(stardate[1], 10); var o_month = parseint(stardate[0], 10); var o_day = parseint(stardate[1], 10); if (month == 1 | month == 3 | month == 5 | month == 7 | month == 8 | month == 10 | month == 12) { if ((day + 7) > 31) { month = month + 1; day = day + 7 - 31; } else { day = day + 7; } document.getelementbyid(#bon_date).innerhtml = o_month + "/" + o_day + "~" + month + "/" + day; } else { if ((day + 7) > 30) { ...

Grails 3 Integration Spec has Strange Transactional Behavior -

i have following test (which more of functional test integration but...): @integration(applicationclass = application) @rollback class conventioncontrollerintegrationspec extends specification { restbuilder rest = new restbuilder() string url def setup() { url = "http://localhost:${serverport}/api/admin/organizations/${organization.first().id}/conventions" } def cleanup() { } void "test update convention"() { given: convention convention = convention.first() when: restresponse response = rest.put("${url}/${convention.id}") { contenttype "application/json" json { name = "new name" } } then: response.status == httpstatus.ok.value() convention.findbyname("new name").id == convention.id convention.findbyname("new name").name == "new name" } } the data being loaded via bootstrap (which admittadly might issue) problem...

How to unit test Asp.net core WebAPI (net452) project? -

Image
i have asp.net core web.api project. (only) targets net452 framework. question is: how unit test asp,net core webapi (net452) project? i tried adding classic .net unit testing project solution, reference web.api core project. reason, i'm not able declare (refer) class inside webapi project. this, conclude, cannot use classic unit testing project test asp.net core project. inside project.json: "frameworks": { "net452": {} } } this how solution looks like: inside test class: [testclass] public class activedirectoryclientprovidertests { [testmethod] public async task get_should_return_client() { //var settings = new activedirectorysettings(); ng2aa_demo.domain.avatar.getavatarbyuserhandler } } you can use xunit or nunit, both works .net core. here tutorial on how create unit test project: https://docs.microsoft.com/en-us/dotnet/articles/core/testing/unit-testing-with-dotnet-test you create .ne...

Python script search a text file for a word -

i'm writing python script. need search text file word end " s , es or ies " , word must greater 3 letters , need konw number of words , word it-self .....it's hard task cant work it, please me i agree comment need go work on basics. here ideas started. 1) "search file." open file , read line line this: with open ('myfile.txt', 'r') infile: line in infile: # each line 2) want store each line in data structure, list: # before open file... lines = [] # while handling file: lines.append(line) 3) you'll need work each word. 'split' function of lists. 4) you'll need @ individual letters of each word. 'string slicing.' all said , done, can 10 - 15 lines of code.

VB.net 2015 Prevent a second CMD instance to show up -

shell("cmd.exe", appwinstyle.minimizedfocus) thread.sleep(50) my.computer.keyboard.sendkeys("cd c:\users\administrator\desktop\captcharuc", true) my.computer.keyboard.sendkeys("{enter}", true) thread.sleep(50) my.computer.keyboard.sendkeys("tesseract.exe imagen.jpg leerca -psm 7", true) my.computer.keyboard.sendkeys("{enter}", true) thread.sleep(50) my.computer.keyboard.sendkeys("exit", true) my.computer.keyboard.sendkeys("{enter}", true) im streaming commands cmd instance, works fine when execute tesseract.exe cmd instance opens execute such program. this regular behavior of tesseract if steps manually, second cmd instance show execute tesseract commands. this part of windows app im developing , dont want second instance show up. i have tried with const strcmdtext string = "/c cd c:\users\administrator\desktop\captcharuc\&tesseract.exe imagen.jpg le...

c# - Display all strings in a List -

i trying create 2 sets , put both in list , display items in list. getting error code. error: system.collections.generic.list 1[system.collections.generic.sortedset 1[system.string]] attaching code below. appreciated. namespace prog 5 { class program { static void main(string[] args) { list<sortedset<string>> items = new list<sortedset<string>>(); sortedset<string> set = new sortedset<string>(); sortedset<string> set2 = new sortedset<string>(); set.add("a"); set.add("b"); set.add("d"); set.add("c"); set2.add("e"); set2.add("d"); set2.add("c"); foreach (string item in set) { items.add(set); } foreach (string item in set2) { items.add(set2); } displayitem(items); ...

node.js - Direct post to AWS S3 from ReactNative (iOS) with signed request -

i trying recreate heroku example of uploading user submitted images in react native, keep getting 400 errors aws. the images ios camera roll. have uri image , base64 encoded version of image. mime type image/jpeg . far, have set heroku stated, having trouble making file send proper shape. i've added code below clarification. i using react-native-image-picker select images camera roll client side code module.exports = react.createclass({ ... openphotos() { // called on button press, opens camera roll imagepicker.showimagepicker(options, (response) => { if (response.didcancel) return; if (response.error) return alert.alert('imagepicker error: ', response.error); this.getsignedrequest(response); }); }, getsignedrequest(pickerresp) { // image uri pickerresp.uri `data:image/jpg;base64,${pickerresp.data}` var file = { uri: pickerresp.uri, // works `data:image/jpg;base64,${pickerresp.data}`, name: `${this.props.email}.jpg`,...

android - SimpleCursorAdapater with Filtered Listview - Error Attempting to access a closed CursorWindow -

i have app 3 tabs. in tab1 have listview cursor adapter, in tab2 , tab3 have textviews. the problems happens when put code filter listview , next, click randomly in tabs. when come tab1 listview error. i tracking problem , @ setfilterqueryprovider. if rid off filter works well. doing wrong ? the error is: d/androidruntime: shutting down vm e/androidruntime: fatal exception: main process: net.techabout.medappointment, pid: 10716 android.database.staledataexception: attempting access closed cursorwindow.most probable cause: cursor deactivated prior calling method. @ android.database.abstractwindowedcursor.checkposition(abstractwindowedcursor.java:139) @ android.database.abstractwindowedcursor.getstring(abstractwindowedcursor.java:50) @ android.database.cursorwrapper.getstring(cursorwrapper.java:137) @ net.techabout.medappointment.agendacursoradapter.bin...

ios - [UITableViewCellContentView setText:]: unrecognized selector sent to instance -

i have created custom uitableviewcell xib , connected labels on outlets property. when use cell in uitableviewcontroller class set text on it, app crashes during runtime "[uitableviewcellcontentview settext:]: unrecognized selector sent instance" error. below code: custom table view cell .h , .m files: #import <uikit/uikit.h> @interface customtableviewcell : uitableviewcell @property (weak, nonatomic) iboutlet uilabel *branchname; @property (weak, nonatomic) iboutlet uilabel *address; @end @implementation customtableviewcell - (void)awakefromnib { [super awakefromnib]; // initialization code } - (void)setselected:(bool)selected animated:(bool)animated { [super setselected:selected animated:animated]; // configure view selected state } @end my uitableviewcontroller code: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { nsstring *branchlistcellid = @"branchlist"; c...

python - vollib issue after pip install -

i have installed vollib module follows: [root@e7440 boris]# python -m pip install vollib collecting vollib using cached vollib-0.1.5.tar.gz requirement satisfied: lets_be_rational in /usr/lib64/python2.7/site-packages (from vollib) requirement satisfied: simplejson in /usr/lib64/python2.7/site-packages (from vollib) requirement satisfied: numpy in /usr/lib64/python2.7/site-packages (from vollib) requirement satisfied: pandas in /usr/lib/python2.7/site-packages/pandas-0.19.0-py2.7-linux-x86_64.egg (from vollib) requirement satisfied: python-dateutil in /usr/lib/python2.7/site-packages (from pandas->vollib) requirement satisfied: pytz>=2011k in /usr/lib/python2.7/site-packages (from pandas->vollib) requirement satisfied: six>=1.5 in /usr/lib/python2.7/site-packages (from python-dateutil->pandas->vollib) installing collected packages: vollib running setup.py install vollib ... done installed vollib-0.1.5 although installation seems success, vollib module not ...

java - Sending Android mail with Javax mail without attachment -

i'm trying sent email javax mail resources find online attachment code throws error: public boolean send() throws exception { properties props = _setproperties(); if(!_user.equals("") && !_pass.equals("") && _to.length > 0 && !_from.equals("") && !_subject.equals("") && !_body.equals("")) { session session = session.getinstance(props, this); mimemessage msg = new mimemessage(session); msg.setfrom(new internetaddress(_from)); internetaddress[] addressto = new internetaddress[_to.length]; (int = 0; < _to.length; i++) { addressto[i] = new internetaddress(_to[i]); } msg.setrecipients(mimemessage.recipienttype.to, addressto); msg.setsubject(_subject); msg.setsentdate(new date()); // setup message body bodypart messagebo...

java - Difference Between ItemEvent.getStateChange() and checkbox.getState() when using it on ItemListener? -

so i'm new java , i'm trying make simple text editor 1st java program. i'm working on text wrapping. code looks this. public class wordwraplistener implements itemlistener { public void itemstatechanged (itemevent e) { if(wrapmenuitem.getstate() == true) { // changed line of code editortextarea.setlinewrap(true); editortextarea.setwrapstyleword(true); frame.repaint(); } else { editortextarea.setlinewrap(false); editortextarea.setwrapstyleword(false); frame.repaint(); } now code above not work. googled how make itemslistener , found answer below: public class wordwraplistener implements itemlistener { public void itemstatechanged (itemevent e) { if(e.getstatechange() == itemevent.selected) { // changed line editortextarea.setlinewrap(true); editortextarea.setwrapstyleword(true); frame.repaint(); } else { ...

navigation - CSS How to add content under fixed position navbar -

i have fixed position navigation bar. height navbar 50px i want put text under navbar, don't know how. add line in css flie: body { padding-top: 50px; } or: .some-text { padding-top: 50px; }

Electron Take Up 100% Of Screen (Not Full Screen) -

i've got electron app, below main.js file: var app = require('electron').app; var browserwindow = require('electron').browserwindow; app.on('ready', function() { mainwindow = new browserwindow({ height: 715, width: 1200, minwidth: 600, minheight: 200, center: true }); mainwindow.loadurl('file://' + __dirname + '/index.html'); }); as can see, width , height specified. want app open, take of available screen (but not in full screen, such dock , tool bar of os hidden). in simple css done using width:100%; height:100%; i want able reproduce in electron app, although cannot seem find details on how it note: fullscreen: true not looking for, makes app open dock , toolbar hidden can help? call mainwindow.maximize() maximize window after create it.

algorithm - Meeting of people -

Image
i have dataset of group of person using mobile phone track places (a list of time milliseconds level) , gps coordinates in building (a list of x,y). given 2 people , timestamp, there way detect whether have met? note mobile phone might have signal delayed when sending coordinate. a solution think of: organise time in tree format, merge neighbouring time stamp within 100ms: for intersection of time frame, check whether have met (i not have concrete idea how check here) sample data: datetime x-coordinate y-coordinate floor# user 2016-07-19t16:00:06.071z 103.79321 71.50419428 1 user1 2016-07-19t16:00:06.074z 110.33623 100.6828323 2 user1 2016-07-19t16:00:06.076z 110.066325 86.48873525 1 user2 ....

linux - Why doesn't Chrome respect the Proxy-Server option in xUbuntu 14 -

been trying chrome on xubuntu 15 use proxy configuration can tunnel traffic through 1 of proxy servers. to achieve this, i've done following: 1 - connected tunnel box via ssh: ssh -d 8123 -f -c -q -n me@proxy-server-ip 2 - verified tunnel open: ps aux | grep ssh server-user 31102 0.0 0.0 45212 796 ? ss 19:12 0:00 ssh -d 8123 -f -c -q -n me@proxy-server-ip 3 - using configuration able firefox push traffic through tunnel no problem. 4 - work chrome, opened terminal , opened chrome way: google-chrome-stable --proxy-server="socks5://127.0.0.1:8123" created new window in existing browser session. and google-chrome --proxy-server="socks5://127.0.0.1:8123" i have read instructions here: https://www.chromium.org/developers/design-documents/network-stack/socks-proxy i've tried number of other variations of this, every time open browser pulls ip , not proxy server.. :( i'm trying undertand why chrome isn't respecti...

ios - Using AudioQueueNewInput to record stereo -

i use audioqueuenewinput create stereo recording. configured follows: audioformat.mformatid = kaudioformatlinearpcm; hardwarechannels = 2; audioformat.mchannelsperframe = hardwarechannels; audioformat.mformatflags = kaudioformatflagissignedinteger | kaudioformatflagispacked | kaudioformatflagisbigendian; audioformat.mframesperpacket = 1; audioformat.mbitsperchannel = 16; audioformat.mbytesperpacket = (audioformat.mbitsperchannel / 8) * hardwarechannels; audioformat.mbytesperframe = audioformat.mbytesperpacket; osstatus result = audioqueuenewinput( &audioformat, recordingcallback, (__bridge void *)(self), // userdata null, // run loop null, // run loop mode 0, // ...

node.js - Append serial number property to array of objects in javascript -

i have array of objects in javascript. var obj_arr = [{ data_id: 281, data_name: 'cim', data_state: '0' }, { data_id: 382, data_name: 'cimx', data_state: '0' }, { data_id: 482, data_name: 'cimy', data_state: '1' }] i append serial number each of object in array. appended object this; var obj_arr_appended = [{ serial_no: 1, data_id: 281, data_name: 'cim', data_state: '0' }, { serial_no: 2, data_id: 382, data_name: 'cimx', data_state: '0' }, { serial_no: 3, data_id: 482, data_name: 'cimy', data_state: '1' }] the serial number auto-increment. using node.js v6 with array.map can run function on each element: var obj_arr_appended = obj_arr.map(function(currentvalue, index) { currentvalue.serial_no = index return currentvalue })