Posts

Showing posts from March, 2015

javascript - Find array count of fields using lodash or underscorejs -

i have requirement count of each account type in array. have tried normal way of looping array , increment counter each account_type. please me same in lodash or underscore js . your appreciated. thank you. input_array = [ { account_id: '4304bf0381140b8fcccbdddea3571a53facebook', account_type: 'facebook' }, { account_id: '4304bf0381140b8fcccbdddea332434facebook', account_type: 'facebook' }, { account_id: '5824fb40c4a97e21ef9715ea69c1cfb9twitter', account_type: 'twitter' }, { account_id: '5824fb40c4a97e21ef9715ea432423twitter', account_type: 'twitter' }, { account_id: '2c13790be20a06a35da629c71e548afexing', account_type: 'xing' }, { account_id: 'd1376b07b144130c4f041e223dfb1197weibo', account_type: 'weibo' }, { account_id: 'd

prolog - Swapping a specific number in list 1 with a specific number in list 2 -

i have been brushing on prolog recently. kind of enjoy coming random problems try , solve , working them out. 1 quite tough though, , i'm not 1 give on problem have set out solve. the problem: want make predicate have 2 predetermined lists, 2 numbers swap, , output lists after swapping done. further explanation: made little harder on myself wanting find specific unique number list 1, , swapping specific unique number list 2 if have 2 lists... [7,2,7,8,5], , [1,2,3,8,7,9,8], , give predicate 2 numbers(lets 8 , 7), number 8 , number 7 swapped between lists if , if number 8 in first list , number 7 in second list. (it disregard 8 in second list , 7 in first list). sample query expected answer: ?- bothswap([7,2,7,8,5],[1,2,3,8,7,9,8],8,7,x,y). x = [7,2,7,7,5], y = [1,2,3,8,8,9,8]. i kind of got stuck @ point: bothswap([],l2,n1,n2,[],l2). bothswap(l1,[],n1,n2,l1,[]). bothswap([h1|t1],[h2|t2],n1,n2,x,y) :- h1 == n1, h2 == n2, bothswap(t1,t2,n1,n2,d1,d2), append(d1,[h2]

Adding CSS using function in PHP -

i try add css file html file using statistic function this: public static function addcss($file){ $csspath = $_server['document_root']. directory_separator. 'new'. directory_separator. 'css/'.$file; return file_exists($csspath) ? " <link rel=\"stylesheet\" href=\"$csspath\" type=\"text/css\" media=\"screen\" charset=\"utf-8\" /> " : "css file not found"; } but doesn't work expected. want produce csspath "http:localhost/new/css/admin.css when i'm called using general::addcss('admin.css'); got address make me fail include: c:/xampp/htdocs\new\css/admin.css. how can fix addressing? you using xampp, document root path "server". thats why path wrong. need exclusively specify path want, until move server. also, if using shared hosting plan, document root not work of time. set constant

javascript - Can't cllick submit button -

i'm newb trying learn create form page. can tell me why submit button isn't working? thought having javascript function fix this. thanks <script type="text/javascript"> function submitform() { document.forms["contactform"].submit(); } </head> <body> <div id="contact-form"> <form method="post" id="contactform" action="bespoke-form-handler.php"> <div> <label for="name">name:</label> <input type="text" id="name" name="user_name" /> </div> <div> <label for="mail">e-mail:</label> <input type="email" id="mail" name="user_e

php - HTTPS returns plain text including headers -

during setting our production environment encounter wierd error, when trying curl through our server, returns plain text representation of response including http headers request on ssl. date: fri, 19 jun 2015 02:15:00 gmt content-type: text/html content-length: 70619 last-modified: thu, 18 jun 2015 05:30:30 gmt connection: keep-alive etag: "55825776-113db" accept-ranges: bytes <!doctype html> <html lang="en-us"> <head> , on... any ideas on how fix this? set curlopt_header false in curl_setopt so: curl_setopt($ch, curlopt_header, false); curlopt_header - true include header in output. ( ref )

java - SBT- Copy File to Output Classes -

i have persistence.xml file in 1 of packages (the file mixed sources) i want copied to: target -> scala-2.11 -> classes -> persistence.xml how can sbt? would consider adding file under src/main/resources ? resource copied target/scala-*/classes/ .

php - Creating a centric REST API for a mobile and website application -

my next project requires me develop both mobile , website application. avoid duplicating code, i'm thinking creating api both of these applications use. my questions regarding are: is approach sensible? are there frameworks me this? how handle authentication? does have affect on scalability? the answers questions - yes possible , in fact makes perfect sense me. yep. using django web , djano-rest-framework rest api. both in same project , share same model , querysets . web url normal , api url starts /api for web use normal session based authentication, rest api use token authentication so far no. both web , api works me. deployed in 3 production environment. links - django django-rest-framework

java - JdbcTemplate select for update -

i have spring application reads data database , sends system 'x'. using task executors spin threads, there 5 threads reading database rows @ same time. each thread need make sure unique records selected. achieve using jdbctemplate , "select update" i have written code in logs able see 2 threads picking same rows. not able figure out root cause of issue. has suggestion try { list<map<string, object>> rows = getjdbctemplate().queryforlist( select_for_update, new object[] {a,b,c,d}); (map<string,object> row : rows) { header = new header(); a.setmailid(((bigdecimal)row.get("mailid")).intvalue()); a.setversion(((bigdecimal)row.get("version")).intvalue()); // other parameters getjdbctemplate().update(update_msg_state_version_n_orig_msg_stat, x, a.getversion()+1

java - Create a hyperlink to a project file in console output -

Image
is there way me write out link console output when clicked on directs project file in intellij? for example, happens when run-time exception occurs. see stack trace , can click on link in console directs me problem was. here can click on databaseconfiguration.java , redirected file in intellij. what want output link readme.txt file written console when main starts up. when clicked on opens readme.txt in intellij. i using log4j , directing output console, may affect solution. here conversion pattern: log4j.appender.file.layout.conversionpattern=%d{hh:mm:ss,sss} %-5p [%c] %m%n idea create link in console text matches following pattern: (${filename}.${fileextention}:${linenum}) or regex: \([\w \.\-]+\.[\w]*:[\d]+\) for example: (errornotes.txt:10) note need include parenthesis. actual class, use following in log4j pattern: (%f:%l) example: reference class, or file, have output actual file name, extension, , line number, inside parenthesis, since l

How to vertically align html radio buttons with CSS-only in this code? -

i found cool css-only slideshow thumbnails application here . have been trying play around code align thumbnails vertically on right instead of horizontally @ bottom without success... the big picture needs 640px(x)640px: /*time css*/ * {margin: 0; padding: 0;} body {background: #ccc;} .slider{ width: 640px; /*same width of large image*/ position: relative; /*instead of height use padding*/ padding-top: 640px; /*that helps bring labels down*/ margin: 100px auto; /*lets add shadow*/ box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.75); } /*last thing remaining add transitions*/ .slider>img{ position: absolute; left: 0; top: 0; transition: 0.5s; } .slider input[name='slide_switch'] { display: none; } .slider label { /*lets add spacing thumbnails*/ margin: 18px 0 0 18px; border: 3px solid #999; float: left; cursor: pointer; transition: 0.5s; /*default style = low opacity*/ opacity: 0.6;

jquery - Selenium Click Outside Element (button) -

i'm running problem need click on expanded functions of element triggered js. picture illustrate ui: http://imgur.com/luyyoy8 so when hover on blue button, display 3 other shapes @ bottom. shapes'html code won't show until mouse hovering on it. approach use actions chain hover on blue button element click off element (in way can click on 3 shapes below). so far have: actions action = new actions(driver); action.movetoelement(elementposition).build().perform(); action.movetoelement(elementposition, offsetx, offxety).click(); but cannot click offset element, proper way it? thank you are able retrieve html code 3 buttons once have made them visible? if so, should able find , click them using webdriver.findelement() , webelement.click() respectively. for example: // find blue button webelement bluebutton = driver.findelement(by.id("blue")); // hover on blue button actions action = new actions(driver); action.movetoelement(bluebut

cordova - Ionic Deploy on Android device -

Image
ionic version: 1.5.5 cordova version: 5.0.0 ionic deploy: 0.1.6 i have followed instructions shown here afterwards, ran: ionic build android && ionic run android later on, did small edit on index.html file , ran ionic upload following log, found file download tagged ionic_deploy_download , , extract complete, error pops out 06-18 16:47:47.771: d/systemwebviewclient(7128): cordovawebviewclient.onreceivederror: error code=-1 description=net::err_file_not_found url=file:///data/data/com.org.app/app_eddaae501776ab76c86f69073/index.html 06-18 16:47:47.921: i/chromium(7128): [info:console(0)] "not allowed load local resource: file:///android_asset/webkit/android-weberror.png", source: data:text/html,chromewebdata (0) edit added log error i had same problem. during update on android, internal error generated trying create directory exists. in git has fork corrects problem. ( https://github.com/eweap/ionic-plugins-d

visual studio - Using TFS for automated testing -

first of all, apologize if dumb question , has million answers. i've not found explains quite i'm looking in depth. so then: company utilizes tfs our testing management. sort of. use github independently source management, use jira independently frm qa management, bug reporting , tracking. "use" tfs tracking pass or fail test cases. in no way connected of our automation, still require user presence check automated tests , pass test case on tfs. @ point, should using spreadsheet. what dearly need sort of learning resource focuses entirely on test management , test automation aspects of tfs. i've been searching around find tends focus on tfs bug reporting , source management system, rather automated test system. , it's 100% possible (in fact, 100% likely) we're utilizing system wrong. person set tfs left abruptly , we've been flailing ever since. in particular we've had problems with: hooking test case automated test (our test co

Waterline one-to-many with arbitrary foreign keys -

is possible have 1 sided one-to-many relationship between 2 models? what i'm trying achieve plugin architecture, core app server has base set of models, specific implementation different clients can include custom data plugins. so have notion of core entity (super-simplified): { identity: 'entity', attributes: { id: 'integer', type: 'string' } } ok, i'm going add passport plugin store login credentials. { identity: 'passport', attributes: { id: 'integer', protocol: 'string', username: 'string', password: 'string', entity: { model: 'entity' } } } so far good. want add user plugin, user extends entity , user can have number of passports. tried first: { identity: 'user', attributes: { id: 'integer', name: 'string', email: 'string', entity: { model: 'entity' }, pa

angularjs - Angular promises: trigger catch(...) from within a then(...) statement? -

is possible trigger catch(...) portion of promise chain within then(...) portion? for example, make $http request , chain behavior. $http resolves successfully, upon processing of data, clear data more suited error case, want activate error handler instead. the issue -- i've got promise chain being used within 2 locations; 1 within service itself, , other in controller activated service. controller 1 handles catch(...) portion of promise chain, opens modal displays error message. so far, i've been able chain promise such that, whenever then(...) or catch(...) triggered within service, can return result, , triggered within controller -- expected. but how have then(...) trigger within service, return result such catch(...) triggered instead within controller? i tried using $q.reject(...) create , return new promise, return value within then(...) function, didn't seem work. example: var url = 'http://google.com'; $http.get(url).then(handlefir

javascript - Google maps, passing "map" to a different event -

i have 2 different events, please correct me if doing wrong, //initializing map google.maps.event.adddomlistener(window, 'load', initialize); //initializing markers google.maps.event.addlistener(map, 'idle', showmarkers); the first event initialize map (set up), second event querying database new markers when current map bounds change (not functional yet) since have defined "map" inside initialize function, how can access outside function , pass second event? can see have declared before functions global variable still undefined event argument, have been stuck on days var map; function initialize(){ //defining map options var maplatlng = new google.maps.latlng(37.09024, -100.712891); var mapoptions = { zoom: 4, center: maplatlng } //defining map map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); } function showmarkers

css - Custom Navigation Bar Color by URL ID -

i've created traditional navigation bar. works great, customize navbar color district url. for example: ###blue http://0.0.0.0:3000/districts/1 ###red http://0.0.0.0:3000/districts/2 ###orange http://0.0.0.0:3000/districts/3 etc. i've hacked out solution, isn't efficient when add more districts. somehow loop through each district , associated css_color. district params :name, :css_color, :photo css .navbar1 { background-color: #4b8dc8; } .navbar2 { background-color: #406da6; } .navbar3 { background-color: #640000; } .navbar4 { background-color: #1450a3; } .navbar5 { background-color: #cbaa7f; } _navigation.html.erb ###how can more efficiently <% if params[:controller] == 'static_pages' || params[:controller] == 'searches' %> <nav class="navbar navbar-default navbar-fixed-top"> <% elsif params[:controller] == 'sessions' %> <nav class="navbar navbar-default navbar-fixed-to

r - How to format columns in xtable output -

Image
i have data.frame df , i'm using xtable create html table: product n° clients capital (usd) part. capital (%) 1 536 2616925 33.62 2 b 151 1613035 20.72 3 c 112 1007983 12.95 the problem when generating html: df.tab <- xtable(df, align = "cccrc",latex.environments="center", format.args = list(digits = 2, format = c("s","d","d","d","f"), big.mark = ","), floating = false) print(df.tab,type = "html", include.rownames=false, file = "df.tab.html") i expect columns (part. capital) have 2 decimal places (even if elements may integers) , comma separator "," , other columns treated integers result not way: product n° clients capital (usd) part. capital (%) 1 536 2616925.00 33.62 2 b

swift - How to put quotes around a string that has quotes? -

making game in spritekit , have array of famous historical quotations. i'm having trouble adding quotes because syntax requires me use quotes. example, want ""apple"", ""orange"", won't let me use double quotations. try this: let fruit = "\"apple\""

multithreading - Trouble getting variable read out of a thread in python -

so i'm trying write program looks keyboard presses , in main program based upon user inputs. i'm trying run keyboard listening in thread , compare whats in variable in main loop, don't ever seem getting threaded keyboard input. in below code, print maybe updating line never happens, else block main while loop. need main loop aware of keys pressed user? import threading import time kbdinput = '' playingid = '' def kbdlistener(): global kbdinput kbdinput = rawinput() print "maybe updating...the kbdinput variable is: ",kbdinput listener = threading.thread(target=kbdlistener) while true: print "kbdinput: ",kbdinput print "playingid: ",playingid if playingid != kbdinput: print "recieved new keyboard input. setting playing id keyboard input value" playingid = kbdinput else: print "no input keyboard detected. sleeping 2 seconds" time.sleep(2)

How to Edit User CakePHP 3 -

so i've been trying edit user functionality working in app, , i'm little confused how go doing cakephp 3. i've got edit action in userscontroller.php: public function edit() { $this->layout = 'dashboard'; $user = $this->users->get($this->auth->user('id')); if ($this->request->is(['post', 'put'])) { $this->users->patchentity($user, $this->request->data); if ($this->users->save($user)) { $this->flash->success(__('your account has been edited')); return $this->redirect(['controller' => 'users', 'action' => 'edit']); } $this->flash->error(__('your account not edited. please fix errors below.')); } $this->set(compact('user')); } and in edit.ctp file: <?php $this->form->templates($form_templates['defaultbootstrap']); echo $this->form-

SQL Server : Multiple Where Clauses -

suppose have t-sql command multiple where conditions this: select * tablename column1 not '%exclude%' , column2 > 10 would query exclude row column1 not met or still go on test next condition column2 ? i asking because want see if more efficient swap conditions around first test if column2 > 10 before run more time-consuming condition. edit: if matters, column1 of type bigint , column2 of type ntext sql devise query plan based on available indexes , statistics. sql doesn't have "short-circuit" expression evaluation per se because procedural language query plan perform short-circuit evaluation. swapping expressions should not affect performance.

encryption - iOS "Data Protection" depends on user passcode set or not? -

when developing ios apps 1 can chose add capability "data protection", offers more "protection". what, after lot of searching , reading, still unclear me: files declared secured "complete protection" encrypted if user doesn't set passcode? every thing found somehow involves passcode of user. need have things encrypted though user has no passcode set. thx in advance! from ios documentation ( protecting data using on-disk encryption ): data protection available on ios devices , subject following requirements: the file system on user’s device must support data protection. devices support behavior. the user must have active passcode lock set device. i'd 2nd bullet point answers question.

php - Sorting a collection in doctrine2 -

i've written following query (that may or may not efficient, i'm still newbie): $collection = $this->dm->getconnection()->selectcollection('db_name', 'collection_name'); $query = array('array_name' => new \mongoid(id)); $cursor = $collection->find($query)->limit(9)->sort('r', 'desc'); i'm trying sort r value looks in document: "r": 0.58325652219355106354 but isn't sorting r-value. doing wrong? pretty sure sort takes array argument. try ->sort(['r' => 'desc]); i looked up... http://apigen.juzna.cz/doc/doctrine/mongodb/source-class-doctrine.mongodb.cursor.html#564-585

asp.net - Generating a Webpage When It doesn't Exist -

how can generate webpage based on users request? example, if wants visit "www.mywebsite.com/example" , there no such url, website generate him/her webpage based on word "example". how can it? (i'm developing website asp.net) one way process such page use asp.net attribute routing. [route("{pagename}")] public actionresults myactionname(string pagename) { // in action method process need // figure out need generate base push user. //------ // either make generic view , fill content or // generate view code on fly. // can send view user db. return view(); } for webforms check: https://msdn.microsoft.com/en-us/library/cc668177(v=vs.140).aspx

android - How to embed a wearable apk into a mobile apk using ant rather than gradle -

our company has huge complex ant build system building enormous suite of dozens , dozens of android projects built single .apk. i incorporate wearable app don't know wearable .apk embedded within mobile .apk. in android studio / gradle embedded automatically handled adding wear apk dependency of mobile apk within mobile's build.gradle. does know how wear apk embedded within mobile apk when gradle not being used? the packaging wearable apps training has of steps packaging manually : include permissions declared in manifest file of wearable app in manifest file of mobile app. example, if specify vibrate permission wearable app, must add permission mobile app. ensure both wearable , mobile apks have same package name , version number. copy signed wearable app handheld project's res/raw directory. we'll refer apk wearable_app.apk . create res/xml/wearable_app_desc.xml file contains version , path information of wearable app. example:

puppet - Could not retrieve information from environment from production source on files -

i've setup puppet module install , keep bacula backup system running on number of systems. i'm using puppet 3.7.5 selinix on both puppet server , clients. part of formula i've come transfer ssl cert/key pair each host uses module. bacula can work on tls.  i have defined in bacula config manifest: file { "/etc/pki/tls/private/${::hostname}.mydomain.com.key":       notify  => service["bacula-fd"], owner => "bacula", group => "bacula", mode => 0400, require => package["bacula-client","bacula-common"], source => "puppet:///modules/bacula/${::hostname}/${::hostname}.mydomain.com.key", } file { "/etc/pki/tls/certs/${::hostname}.mydomain.com.crt": notify  => service["bacula-fd"], owner => "bacula", group => "bacula", mode => 0400, require => p

inheritance - C++ Updating a variable in object of derived class via pointer -

i building linked list, nodes linked head. head derived node, head requires pointer last node. see comment @ top of code. /* base <= node <= node <= node * | ^ * | ptr last node | * ------------------------- */ class node { private: node* prev; public: explicit node(node* parent) : prev(parent) { node* foo_ptr = this; while (foo_ptr->prev != 0) { foo_ptr = foo_ptr->prev; } // foo_ptr points base, how can change base::last? } }; class base : public node { private: node* last; public: base() : node(0), last(this) {} }; how can change change variable base::last when adding new node, example: node* n = new base; new node(n); // can node constructor update n->last? i thinking use virtual function update variable, according post: calling virtual functions inside constructors , no no not want it. there way of achieving ty

ios - FB Login Callback crashing for Testflight Users -

i using facebook's sdk logging app. have no issues using myself, when testflight users login, app crashes when app returns facebook app. i've been told app crashes when clicking open inside testflight app leads me believe has code below. it's hard know sure because testflight crash logs inconsistent , haven't received yet... func application(application: uiapplication, openurl url: nsurl, sourceapplication: string?, annotation: anyobject) -> bool { return fbsdkapplicationdelegate.sharedinstance().application(application, openurl: url, sourceapplication: sourceapplication, annotation: annotation) } here's crash log (truncated last couple of lines due character limit): {"app_name":"dozmia","app_cohort":"2|date=1435078800000&sf=143441&tid=40a1449018deaf3d138ed8487cd1651d98b96a10f31bde5db4e9f0f5027bf585","app_version":"1.0","slice_uuid":"57799f65-08a7-353c-8e87-fee4f3c36e

html - padding between col-md2 elements -

Image
my goal show 6 columns in 1 row. here's part of how them done (shown first 3). i have code: <div class="col-md-2"> <input mytr="first_name" mytrid="" name="first_name[]" id="first_name" class="form-control" placeholder="first name" type="text"> </div> <div class="col-md-2"> <input mytr="middle_name" mytrid="" name="middle_name[]" id="middle_name" class="form-control" placeholder="middle name" type="text"> </div> <div class="col-md-2"> <input mytr="last_name" mytrid="" name="last_name[]" id="last_name" class="form-control" placeholder="last name" type="text"> </div> it produces following controls padding between them: i'd editors have 1px of padding , them close 1

php - Is this a properly formatted POST request? -

is below code formatted post request? seems entire contents being passed via uri , not via post. have primitive understanding of php , url requests in general server-side code has been included below well. i noticed issue while attempting upload base64 encoded images (as demonstrated below) server. upon submitting request, server return error stating uri exceeds maximum length, leads me believe isn't proper approach submitting post request. entire process works if image 10x10px, isn't going trick , main priority here understanding correct approach. what proper approach submitting post request, similar below example? how can post data received server , json need slashed stripped if submitted via post? swift if let imagedata = uiimagepngrepresentation(self.image!) { let encodedimage = imagedata.base64encodedstringwithoptions(nsdatabase64encodingoptions(rawvalue: 0)) let dict = ["barcode":self.barcode, "imagedata":encodedimage]

SQL Server Storing DateTime as Integer -

i adding tables data warehouse , want store datetime information int field (the time part not important me) note i'm not storing 20150123, store pure integer using cast(field int) that stores 2015-06-18 12:57:47.833 42172 i can add day +1 , add week adding 7 field. adding month not straight forward. whenever need date representation of data, can cast datetime. just want know pros , cons see on this? converting between int , datetime works fine. it's defined conversion does, there nothing mysterious going on might change or stop working. let's @ aspects: comparable: yes; can still compare numbers tell date earlier. sortable: yes; can sort on int , it's sorted date. readable: no; have convert datetime make sense of it. self-explanatory: no; have know number represents it. portable: yes; can same conversion in system supports date arithmetics. you can example same conversion int datetime in c#: datetime d = new datetime(1900, 1, 1

java - Xtext grammar for a nested indented language -

i'm trying write xtext grammar language follows: on producer1 producerconsumer1 producerconsumer1_1 producerconsumer1_2 producerconsumer1_2_1 producerconsumer2 producerconsumer2_1 on producer2 producerconsumer1 with following grammar, can see in eclipse editor white-space blocks acknowledged not nested how intended: model: model+=on+ ; on: 'on' producer=validid begin (producerconsumers+=then)* end ; then: 'then' producerconsumer=validid begin (children+=then)* end ; terminal begin: 'synthetic:begin'; // increase indentation terminal end: 'synthetic:end'; // decrease indentation i'm new xtext , appreciate pointers on i'm going wrong. do mean then: 'then' producerconsumer=id (begin (children+=then)+ end)?

regex - Python - re.split: extra empty strings that the beginning and end list -

i'm trying take string of ints and/or floats , create list of floats. string going have these brackets in them need ignored. i'm using re.split, if string begins , ends bracket, empty strings. why that? code: import re x = "[1 2 3 4][2 3 4 5]" y = "1 2 3 4][2 3 4 5" p = re.compile(r'[^\d\.]+') print p.split(x) print p.split(y) output: ['', '1', '2', '3', '4', '2', '3', '4', '5', ''] ['1', '2', '3', '4', '2', '3', '4', '5'] as more pythonic way can use list comprehension , str.isdigit() method check of character digit : >>> [i in y if i.isdigit()] ['1', '2', '3', '4', '2', '3', '4', '5'] and code first of need split based on space or brackets done [\[\] ] , rid of empty strings leading , trailing brackets can f

Android Studio, RecyclerView crashes my app on start up -

i battling android recyclerviewer. followed tutorials , read posts here on stackoverflow, still not coming right. mainactivity public class mainactivity extends actionbaractivity { recyclerview myrecyclerview; myadapter adapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); myrecyclerview = (recyclerview)findviewbyid(r.id.myrecycleview); adapter = new myadapter(mainactivity.this, getdata()); final linearlayoutmanager layoutmanager = new linearlayoutmanager(mainactivity.this); layoutmanager.setorientation(linearlayoutmanager.vertical); myrecyclerview.setlayoutmanager(layoutmanager); myrecyclerview.setadapter(adapter); myrecyclerview.setitemanimator(new defaultitemanimator()); // } //the dataset public static list<mydatamodel> getdata() { list<mydatamodel> mydata = new arraylist<>(); string[] posttext = {"ibm",

lambda - Using a lamba in vb.net to get DataTables difference -

using vb.net , lambda, trying retrieve records in first datatable (table01) not in second datatable (table02). cannot work: dim newlist = table01.asenumerable().where(function(x) not table02.asenumerable().any(function(x1) x1.field("customernumber") = x.field("customernumber") andalso x1.field("customerid") = x.field("customerid") andalso x1.field("detailid") = x.field("detailid"))) the error : "overload resolution failed because no accessible 'where' can called these arguments" not sure missing not clause. thanks.

javascript - NodeJS - get MAC address when offline -

similar this question in c# , possible in nodejs mac address(es) of computer when disconnected network? i have been using macaddress module, works great when user connected network -- if user disconnects, macaddress not return addresses on systems. i noticed differences between os.networkinterfaces() when user offline/online, differences in behavior across windows/mac , node v10/v12. i'm not sure problem lies here. i tested getmac module , works fine offline (and online). you can try this: require('getmac').getmac(function(err,macaddress){ if (err) throw err console.log(macaddress) // 77:31:c2:c5:03:10 }) if don't want use module can ask each mac address interface (node >= 0.11): require('os').networkinterfaces() and parse depending of needs. the result should this: { lo0: [ { address: '::1', netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', family: 'ipv6', mac: '

python - What does the +0+0 in geometry() mean in tkinter? -

i understand beginning creates window size, see people put +x+x after initial 400x300 or whatever size. i've looked on answer can't seem find one. width x height + x position + y position , positions relative top left corner of screen in pixels edit: here 's brief summary of function tcl.tk, written more concisely hope achieve.

scala - Running a sub-project main class -

i have built.sbt references child project's main class own main class: lazy val akka = (project in file(".")) .aggregate(api) .dependson(api) .enableplugins(javaapppackaging) lazy val api = project in file("api") scalaversion := "2.11.6" // referencing api code mainclass in (compile, run) := some("maslow.akka.cluster.node.clusternode") artifactname := { (sv: scalaversion, module: moduleid, artifact: artifact) => s"""${artifact.name}.${artifact.extension}""" } name in universal := name.value packagename in universal := name.value however, each time run sbt run following error: > run [info] updating {file:/users/mark/dev/maslow-akka/}api... [info] resolving jline#jline;2.12.1 ... [info] done updating. [info] updating {file:/users/mark/dev/maslow-akka/}akka... [info] resolving jline#jline;2.12.1 ... [info] done updating. [info] running maslow.akka.cluster.node.clusternode [error] (ru