Posts

Showing posts from August, 2015

paho - can mqtt msg delivery order be guaranteed in simplified case? -

if there single broker, single publisher, single topic , clean session, in simplified case, can msg delivery order on subscriber side guaranteed same send order on publisher side? affected qos? section 4.6 mqtt 3.1.1 spec covers message ordering: 4.6 message ordering a client must follow these rules when implementing protocol flows defined elsewhere in chapter: when re-sends publish packets, must re-send them in order in original publish packets sent (this applies qos 1 , qos 2 messages) [mqtt-4.6.0-1] it must send puback packets in order in corresponding publish packets received (qos 1 messages) [mqtt-4.6.0-2] it must send pubrec packets in order in corresponding publish packets received (qos 2 messages) [mqtt-4.6.0-3] must send pubrel packets in order in corresponding pubrec packets received (qos 2 messages) [mqtt-4.6.0-4] a server must default treat each topic "ordered topic". may provide administrative or o

dynamics crm - Display a pop-up window with status message of a succeeded workflow -

i've form runs real-time workflow. when workflow succeeds, need display status message of workflow in pop-up window or alert message box. any ideas on how can achieve this? you can show messages user within synchronous workflow if cancel workflow : when set status canceled, prevent operation. error message containing text stop action status message displayed user heading business process error. there no way of showing informational message succeeded workflow. as workaround, have workflow write informational message field on entity. write javascript checks if message-field contains data, show form notification (or alert if insist) user, , subsequently clear message-field.

jquery - Overriding bootstrap data-toggle="dropdown" width -

boostrap data-toggle="dropdown" have natively width of 991px . need fix maximum 767px . my code is: <a href="/samohyl/peugeot" class="dropdown-toggle" data-toggle="dropdown">peugeot</a> try below option. <style type="text/css"> .cls .dropdown-toggle{ width:yourwidth px; } </style> <div class="cls"> <a href="/samohyl/peugeot" class="dropdown-toggle" data-toggle="dropdown">peugeot</a> </div> this way, point "cls" class sections , not others refer below link setting width of dropdown list in bootstrap 3.0

PHP shared memory on windows server -

i want store small array (aprox 1mb ) massive access load. i don't want use database. i don't need secure data. i change array one-time per minute, have thousands of access each minute read data. actually i'm using php shared memory segment shmop works fine. causes php exeption results apache restart . do exist way same memory operations in windows other php module? do exist better way handle data fast access? i don't care security or reliability of stored data. how work shared memory variable ( $shm ): visitor calls $shm. if ($shm exists, , not older 1 minute): return $shm; else: create new $shm, return $shm; visitor2 calls $shm. if ($shm exists, , not older 1 minute): return $shm; else: create new $shm, return $shm; etc ... apache 2.4.23 (win64) php 5.5.3

sqlite - Registering a new FTS tokenizer in SQLite3 w/ Python -

i'm building application requires custom tokenizer in fts database. have found tokenizer want ( this one ), can't find directions registering , using custom tokenizers sqlite in python. anyone have idea on how proceed?

java - Atlassian bamboo .Net plugins dependencies installation -

i wish modify existing atlassian bamboo .net plugin: https://bitbucket.org/atlassian/bamboo-dotnet-plugin mstest parser include stacktrace information. i've downloaded repository locally, , have tried install of project dependencies using maven command: mvn clean install -u . unfortunately not jars downloaded, i've searched online , found using atlassian sdk build project , let handle maven stuff because has configured in settings.xml file. problem still build failure after using it. here's cmd output: [info] --------------------------------------------------------------------- --- [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 04:43 min [info] finished at: 2016-07-12t14:22:23+02:00 [info] final memory: 11m/29m [info] ------------------------------------------------------------------------ [error] failed execute goal on project atlassian-bamboo-plugin-dotnet: not resolve dependencies projec

javascript - How correctly append data to HTML from jQuery and Ajax? -

Image
i working on implementing "load more articles" functionality using python, flask , ajax. working server-side don't know how append new data html using jquery. i have following json object sent server side: and following jquery , ajax code in html template: <script type=text/javascript> $(function() { $('a#get-more').bind('click', function() { $.getjson($script_root + '/_get_the_data_from_serverside', { }, function(data) { $("#more").append(data.stories[0].storycontent); }); return false; }); }); </script> <span id=more></span> <a href="#" id=get-more></a> but doesn't work can see, data json object "storycontent" not being appended html. any ideas? the path json should data[0].storycontent. so: <script type=text/javascript> $(function() { $('a#get-more').bind('click', function() {

Neo4j WARN Config file [D:\neo4j\neo4j.conf] does not exist -

i followed steps introduced neo4j website( https://neo4j.com/docs/operations-manual/current/#tutorials 7.2) deploy neo4j cluster version. when wanted start neo4j command 'neo4j console'. showed 'warn config file [d:\neo4j\neo4j.conf] not exist.' can me this?

sqlite3 disk I/O error on cli -

sqlite version 3.6.20, running through vnc. starting sqlite3 cli session. when trying run commands ".tables", ".databases", "create table" "error: disk i/o error". don't know how more accurate description. want write in home directory have permissions. i tried suggested fixes in .sqliterc journal mode , temp storage - not help. commands "pragma synchronous = off;" cause disk io error. .output /dev/null pragma journal_mode = memory; pragma locking_mode = exclusive; pragma temp_store_directory = '/home/username/tmp'; how find out more error , solve this? it vmware related error. solution: move files /tmp. sqlite works there. described here https://dba.stackexchange.com/questions/93575/sqlite-disk-i-o-error-3850

java - Storing unsigned long value in two 16bit register -

i want store unsigned long value in 2 16bit register.for example if have long value (-2,147,483,648 2,147,483,647) i'm using formula like: v[0] = myvalue % 65536 v[1] = myvalue / 65536 to value register outval = reg0 + (reg1 * 65536) but how unsigned long value range 0 4,294,967,295? as commenter harold pointed out already, formula doesn't work correctly negative numbers. you should bitwise instead of using math avoid surprises (and speed things in case compiler didn't optimize already). splitting: v[0] = myvalue & 0xffff v[1] = myvalue >> 16 // implicitly cuts off lower 16 bits // shifting them away nirvana joining: outval = reg0 | (reg1 << 16) this applies both signed , unsigned (provided variables have same "sign type"). legend , in case language (which didn't specify) uses different operators: & bitwise and, | bitwise or, << , >> bitwise shifting left/rig

ios - How to use CNContactPickerViewController with objective c? -

hi i'm new ios development. want pick contact default contacts app. created application lets user pick contact iphone default contacts app. ios 9+ version, i'm using following snipped. - (ibaction)btnaction:(id)sender { cncontactpickerviewcontroller *contactpicker = [[cncontactpickerviewcontroller alloc] init]; contactpicker.delegate = self; contactpicker.displayedpropertykeys = (nsarray *)cncontactgivennamekey; [self presentviewcontroller:picker animated:yes completion:nil]; } -(void) contactpicker:(cncontactpickerviewcontroller *)picker didselectcontact:(cncontact *)contact{ nslog(@"contact : %@",contact); } -(void)contactpickerdidcancel:(cncontactpickerviewcontroller *)picker { nslog(@"cancelled"); } i added cncontactpickerdelegate delegate in uiviewcontroller. when execute above code, opens contacts app, when tap contact app becomes blank. thanks in advance , can please share knowledge use cncontactpickerviewcontrol

c preprocessor - How do I resolve this warning about passing a function pointer to a macro in C? -

i have macro defined as: #define _call(func_name, __func_proto, ...) { \ void *_handle; \ int result = !cerr_v_success; \ \ _handle = dlopen(_dll_name,global); \ if (_handle) { \ __func_proto = dlsym(dll_handle, func_name); \ if (__func_proto) { \ result = (*__func_proto)(__va_args__); \ } \ (void)dlclose(_handle); \ } \ return (result); \ } i calling macro different function pointers this: _call("download",_download,src,dst); _call("upload",_upload,src,dst); _call("test",_test,f

python - Find fileS and then find a string in those files -

i have written function finds of version.php files in path. trying take output of function , find line file. function finds files is: def find_file(): root, folders, files in os.walk(acctpath): file in files: if file == 'version.php': print os.path.join(root,file) find_file() there several version.php files in path , return string each of files. edit: thank suggestions, implementation of code didn't fit need. able figure out creating list , passing each item second part. may not best way it, i've been doing python few days. def cmsoutput(): filelist = [] root, folders, files in os.walk(acctpath): file in files: if file == 'version.php': filelist.append(os.path.join(root,file)) path in filelist: open(path) f: line in f: if line.startswith("$wp_version ="): version_number = line[15:20] inst_path = re.sub('wp-includes/version.php', '', path)

c# - Publish Entity-Framework Code-First Migrations with Context in another project -

i've same problem described here , i've try apply suggested solution changing connection string name fqn of db context placed in project. web project web.config file (in project myapplication.web): <connectionstrings> <add name="farmacianataliniserver.infrastructure.applicationdbcontext" connectionstring="data source=(localdb)\mssqllocaldb;attachdbfilename=|datadirectory|\aspnet-farmacianataliniserver-20151127115838.mdf;initial catalog=aspnet-farmacianataliniserver-20151127115838;integrated security=true" providername="system.data.sqlclient" /> applicationdbcontext.cs (in project myapplication): public class applicationdbcontext : identitydbcontext<applicationuser> { public dbset<registereddevice> registereddevices { get; set; } public dbset<reservation> reservations { get; set; } public applicationdbcontext() : base("farmacianataliniserver.infrastructure.applicationdbcontext", thr

XPATH to extract data from CarWale.com? -

with friend made script extract specs , features pages http://www.carwale.com/mercedesbenz-cars/e-class/e63amg-3049/ , works not perfectly. he told me use xpath //tr[contains (.,"feature name")]/td[2] , 1 of them impossible pick, using //tr[contains (.,"display")]/td[2] extract 4 features containing word display . there way pick 1 labelled display? <td>trip meter</td><td>multi-function display </td> <td>heads display (hud)</td><td>no </td> <td>display</td><td>lcd display </td> <td>display screen rear passengers</td><td>no </td> i extracted car color names using xpath //div[@class='colorname'] i want car color rgb values, or whole style code , remove unneeded code using find/replace, xpath need? <div class="colours" style="background-color: #040404; height: 30px; width: 130px; margin: 7px"></div> extract '

xpages - OpenNTF Domino API (ODA) WrapperFactory.fromLotus Usage -

i have situation need org.openntf.domino.document object lotus.domino.document object. found examples using factory.fromlotus() depreciated. the javadocs pointed me wrapperfactory.fromlotus() unsure how use this. doing this: document doc = wrapperfactory.fromlotus(lotusdoc, org.openntf.domino.document.class, null); eclipse marking line error: the method fromlotus(d, factoryschema, p) in type wrapperfactory not applicable arguments (document, class, null) how use wrapperfactory.fromlotus() ? that method wants original lotus object (as you're doing), "schema" object, , parent. for schema, can use org.openntf.domino.document.schema. for parent, you'll need pass in wrapped version of parent database object. believe can go chain getting database , session - wrap session session s = fac.fromlotus(lotussession, session.schema, null) , db database db = fac.fromlotus(lotusdatabase, database.schema, s) , doc document doc = fac.fromlotus(lo

jquery - how to apply to avoid adding all .test classes from the page in the code $( ".test" ).insertBefore( ".test1" ) -

how apply avoid adding .test classes page in code $( ".test" ).insertbefore( ".test1" ) <div id="testdiv"> <div class="test1"></div> <div class="test"></div> </div> div replicated on page you need iterate on each test element , insert before previous sibling .test : $(".test").each(function(){ $(this).insertbefore($(this).prev()); }) ;

osx - install4j installer shows message "internal error occurred, launch path not accessible" -

on mac os x, install4j installer shows following error dialog "an internal error occurred (error code: launch path not accessible)" to debug native launcher, start installer this: install4j_log=yes installer.app/contents/macos/javaapplicationstub and post last part of output before error.

ios - UIScrollView not showing uilabel text -

Image
i developing simple app. in there text displaying inside uiscrollview , pagecontrol app isn't giving error isn't showing text in scrollview. here code. in .h @property (nonatomic, strong) iboutlet uiscrollview *scrollview; @property (nonatomic, strong) iboutlet uipagecontrol *pagecontrol; in .m @interface dashboardviewcontroller () @property (nonatomic, strong) nsarray *pagetext; @property (nonatomic, strong) nsmutablearray *pageviews; - (void)loadvisiblepages; - (void)loadpage:(nsinteger)page; - (void)purgepage:(nsinteger)page; @end @implementation dashboardviewcontroller @synthesize scrollview = _scrollview; @synthesize pagecontrol = _pagecontrol; @synthesize pagetext = _pagetext; @synthesize pageviews = _pageviews; #pragma mark - - (void)loadvisiblepages { // first, determine page visible cgfloat pagewidth = self.scrollview.frame.size.width; nsinteger page = (nsinteger)floor((self.scrollview.contentoffset.x * 2.0f + pagewidth) / (pagewidth * 2.0f)

javascript - UI-Grid more than one field per column -

i need import excel sheet ui-grid using js-xls in same column retrieve data database. example, 1 of columns defined as: { field: 'employee_id', displayname: 'id', width: "*"} from sheet, column join produces json object named "person number". need "employee_id" , "person number" on same column. like: { field: 'employee_id + person number', displayname: 'id', width: "*"} how can achieve this? i found way deal this. after retrieving data excel sheet, made loop change key names of objects match ones retrieve database. this: data[i].employee_id = data[i]['person number']; delete data[i]['person number']; that way, have same structure , make sure import work column ordering in sheet. thanks s. baggy , tylerwal commenting!

returning matrix column indices matching value(s) in R -

i'm looking fast way return indices of columns of matrix match values provided in vector (ideally of length 1 or same number of rows in matrix) instance: mat <- matrix(1:100,10) values <- c(11,2,23,12,35,6,97,3,9,10) the desired function, call rowmatches() return: rowmatches(mat, values) [1] 2 1 3 na 4 1 10 na 1 1 indeed, value 11 first found @ 2nd column of first row, value 2 appears @ 1st column of 2nd row, value 23 @ 3rd column of 3rd row, value 12 not in 4th row... , on. since haven't found solution in package matrixstats, came function: rowmatches <- function(mat,values) { res <- integer(nrow(mat)) matches <- mat == values (col in ncol(mat):1) { res[matches[,col]] <- col } res[res==0] <- na res } for intended use, there millions of rows , few columns. splitting matrix rows (in list called, say, rows ) , calling map(match, as.list(values), rows) way slow. i'm not satisfied fu

Bazaarvoice Jolt Generic Spec for multiple Kinds of Input JSON -

i new jolt. have 2 different set of input json of same structure except 1 object inside differs based on decider value below. eg: input json 1 { "input": { "decider": 1, "object1": { "object1info": 1 "obj1specificobj2" : { obj2info : "data" } }, "doc": { "docid": "doc100" } } } eg: input json 2 { "input": { "decider": 2, "object2": { "object2info": 2 "obj2specificobj3" : { "obj3info1" : "data1", "obj3info2" : "data2", "other" : { "otherdata" : "data3" }

eclipse - Jetty client and PATCH method -

is possible execute patch method jetty client? using jetty 9.3.3 , patch method not defined in enum httpmethod. i checked api of jetty 9.3.10 , did not find patch method in enum httpmethod. if not supported, how can extend jetty code able use it? needed in client side (jetty client need able send patch request). thanks , best regards. yes, it's possible use patch verb jetty client. the value in httpmethod enum absent, recommendation pass patch string method() api in request . support added in commit .

java - Attaching spring api doc to eclipse -

i working on spring framework.i want attach spring api doc in eclipse.i have tried many things going properties->java build path->libraries , putting location of documentation in each jar file.but nothing works following message whenever hover cursor on method/class. "this element neither has attached source nor attached javadoc , hence no javadoc found". please suggest solution. you must not use jar. can use link online documentation. spring api. current versionhttp://docs.spring.io/spring/docs/current/javadoc-api/ in eclipse, click project -> build path -> configure build path. under libraries choose spring libraries, open , click javadoc location -> edit. add link or jar-file. validate , ok. link jar http://docs.spring.io/spring/docs/current/javadoc-api/ cheers

ubuntu - Need to install pip for python 3 -

i have installed python 2.7 , python 3.3 on server , need install pip python 3. here have tried far. sudo apt-get install python3-setuptools sudo easy_install3 pip this install pip python 3.2 ( don't have installed python 3.2), sudo apt-get install python3-pip this install pip python 3.2 my need install few packages python3.3 (lxml, ftplib, etc...) for that need pip unfortunately unable this. i can not setup python 3.3 because basic need python 2.7 (for odoo). can guide me in proper direction. after: sudo apt install python3-pip you should able install packages pip3 command. try: pip --version pip3 --version

qt5.5 - Qt decimal separator -

in many (all?) qt gui control (like qdoublespinbox), qdoublevalidator etc ',' using decimal separator. qstring method tofloat, todouble use '.'. best way resolve conflict platforms , locals? qt uses system locale display numbers in widgets, has ',' decimal separator. can use qlocale::system().todouble() locale-dependent conversion.

bash - Why can't /usr/bin/cd go to $OLDPWD -

ran interesting can't quite figure out reason for. whenever use bash's builtin cd, can use cd - , when use cd executable errors out error saying: /usr/bin/cd: line 2: cd: oldpwd not set here's transcript: $ cd /tmp $ cd $home $ echo $oldpwd /tmp $ /usr/bin/cd - /usr/bin/cd: line 2: cd: oldpwd not set $ declare -xp oldpwd declare -x oldpwd="/tmp" i not sure cd executable comes from, pointless: can change own wd, not caller's (i. e. shell's). cd builtin , can work such.

Regex in R -- extracting sub-string based on two start/stop words -

i have character (text) column: tweets <- c( "drinking bud light @budweiser @ joe's crab shack http://www.joes.com", "drinking sam adams winter ale @samadams @ growler stop http://www.growlerstop.com", "drinking coco loco @nodabrewing @ corner pub http://www.cornerpub.com" ) as can see, assume tweets have standard structure: "drinking [name of beer] @[name of brewery] @ [name of bar, notice whitespace] http://" i want use regular expressions (and substr() ?) create 3 new columns: name of beer name of brewery name of bar (note have white space, needs go "http:") one step further - how control tweets not have same structure? it's ugly: setnames(nm=c('beer','brewery','bar'),as.data.frame(do.call(rbind, regmatches(tweets,regexec('^drinking an? (.*) @(.*) @ (.*) http://.*$',tweets)) )[,-1l])); ## beer brewery bar ## 1

Odoo8-Call a python function from menuitem and rereturn a URL? -

i tried call python function menuitem , return url? function didn't return anything, no error. code : in py: def browse_ftp(self, cr, uid, ids, context=none): fi_url='http://www.google.com' print'final url',fi_url // print url return { 'type': 'ir.actions.act_url', 'url':fi_url, 'target': 'self' } in vew.xml: <record id="action_make_testing" model="ir.actions.server"> <field name="name">test browsse file</field> <field name="condition">true</field> <field name="type">ir.actions.server</field> <field name="model_id" ref="model_document_ftp_browse" /> <field name="state">code</field> <field name="code">self.browse_ftp(cr, uid, context.get('active_ids', []), context=context)</

c# - Xamarin not building iOS project -

Image
everything working fine until today. working fine yesterday , have not applied changes since then. today when try debug project in xamarin error: /library/frameworks/mono.framework/external/xbuild/xamarin/ios/xamarin.ios.common.targets: error: system.io.filenotfoundexception: /users/me/dropbox/projects/projectname/projectfile/obj/iphone/debug/build-ipad4.5-9.3.2/ibtool/main.storyboardc/byz-38-t0r-view-78.nib not exist file name: '/users/me/dropbox/projects/projectname/projectfile/obj/iphone/debug/build-ipad4.5-9.3.2/ibtool/main.storyboardc/byz-38-t0r-view-78.nib' @ system.io.file.copy (system.string sourcefilename, system.string destfilename, boolean overwrite) <0x1a24c60 + 0x00333> in <filename unknown>:0 @ xamarin.macdev.tasks.smartcopytaskbase.copyfile (system.string source, system.string target, system.string targetitemspec) <0x3fc5de8 + 0x000c7> in <filename unknown>:0 @ xamarin.macdev.tasks.smartcopytaskbase.execute () <0x3f08bf0 +

elk stack - filebeat is sending log directly to elastic search not to logstash -

i facing problem since have deleted indices . executed following command curl -xdelete 'http://localhost:9200/*' filebeat.yml filebeat: prospectors: - paths: - /var/log/syslog - input_type : log document_type: syslog registry_file: /var/lib/filebeat/registry output: logstash: hosts: ["127.0.0.1:5044"] bulk_max_size: 1024 shipper: logging: files: rotateeverybytes: 10485760 # = 10mb and logstash config files input config input { beats { port => 5044 } } and output config output { elasticsearch { hosts => ["localhost:9200"] sniffing => true manage_template => false index => "%{[@metadata][beat]}-%{+yyyy.mm.dd}" document_type => "%{[@metadata][type]}" } } problem logs not coming through logstash , these coming directly because can not see new field added in kibana , in case o

ios - UIWebView UIViewController does not load URL -

i having issue ios app. when click on url button uiwebview loads correct url in first instance when visit page within same web view frame stores page memory. when navigate button , click previous button shows page in instead of loading url. what want achieve when user clicks on button uiwebview loads url . my current code: import uikit class menuviewcontroller: uiviewcontroller { @iboutlet weak var oyebwebview: uiwebview! override func viewdidload() { super.viewdidload() oyebwebview.loadrequest(nsurlrequest(url: nsurl(string: menuurl)!)) // additional setup after loading view. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } you can use following code work. import uikit class menuviewcontroller: uiviewcontroller { @iboutlet weak var oyebwebview: uiwebview! override func viewwillappear(animated: bool) { let weburl

java - How to run Spring 3.2 project in Tomcat V6.0.45 -

i need develop spring project. requirements follows: spring - 3.0 hibernate - 3.0 mysql 5.5 tomcat 6.0 jdk 1.7 i not using web.xml instead using java configuration.when trying run project on tomcat v6.0 (by right click in eclipse on project -> run @ server) saying project can not run on server. have no idea how run project. pom.xml follows : <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>lab.testme</groupid> <artifactid>test</artifactid> <version>0.0.1-snapshot</version> <packaging>war</packaging> <name>testme3.0</name> <properties> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target>

c++ - Can I have my Makefile automatically make GCC use the most recent standard it supports? -

my c++03 project needs upgrade c++11, , can guarantee @ least experimental support available in gccs want use. however, may -std=c++0x or may actual -std=c++11 newer gcc. 1 day it'll -std=c++14 (when centos catches up…). how can form gnu makefile adds "best" flag cxxflags depending on succeed? i could "okay, earliest gcc in use still doesn't have production-ready c++11 support should stick c++03", meh. this select best option supported $(cxx) compiler: cxx_mode.42 := -std=c++98 cxx_mode.43 := $(cxx_mode.42) cxx_mode.44 := $(cxx_mode.43) cxx_mode.45 := $(cxx_mode.44) cxx_mode.46 := -std=c++0x # unnecessary, since -std=c++0x still works, hey why not: cxx_mode.47 := -std=c++11 cxx_mode.48 := $(cxx_mode.47) cxx_mode.49 := $(cxx_mode.48) cxx_mode.5 := -std=c++14 cxx_mode.6 := $(cxx_mode.5) gxx_version := $(shell $(cxx) -dumpversion | awk -f. '$$1<5{print $$1$$2} $$1>=5{print $$1}') cxx_mode := $(cxx_mode.$(gxx_version)) cx

python - Error creating pytheapp for Ethereum on OSX -

i trying install pyethapp on osx error right @ end ""python setup.py egg_info"". suggestions? c233:json-server-api justinstaines$ pip install pyethapp collecting pyethapp downloading pyethapp-1.3.0-py2.py3-none-any.whl (334kb) 100% |████████████████████████████████| 337kb 1.2mb/s collecting statistics (from pyethapp)........ collecting secp256k1 (from ethereum>=1.3.5->pyethapp) downloading secp256k1-0.12.1.tar.gz (144kb) 100% |████████████████████████████████| 153kb 2.3mb/s complete output command python setup.py egg_info: setuptools version (1.1.6) old correctly install package. please upgrade newer version (>= 3.3). ---------------------------------------- command "python setup.py egg_info" failed error code 1 in /private/var/folders/rb/ydgvprfj6yg5q180740g1lpm0000gn/t/pip-build-kdbjvf/secp256k1/ doh realised your setuptools version (1.1.6) old correctly install package. please upgrade newer vers

How to determine equality of values of JavaScript object? -

in given object values of properties same. var obj = { property1: 'some value', property2: 'some value', property3: 'some value', property4: 'some value' } the function checkequality should return true if values same , false otherwise. i can following achieve it: function checkequality () { var compare = obj.propery1; (var key in obj) { if (obj[key] !== compare) { return false; } } return true; } but solution far not best. you use array#every it. the every method executes provided callback function once each element present in array until finds 1 callback returns falsy value (a value becomes false when converted boolean). if such element found, every method returns false . otherwise, if callback returned true value elements, every return true . callback invoked indexes of array have assigned values; not invoked indexes have been deleted or have never been

How to remove all grammar from a string in Java -

hello trying edit code in order remove grammar. hope in order make can input string area. public static void main(string[] args) { // string list string foxes = "the,quick,brown,fox,jumped,over,the,lazy,dog."; system.out.println(" here string unedited" + foxes); string lowercase = foxes.tolowercase(); system.out.println(" here string (no caps): " + lowercase); please let me know code should use in order make code remove grammar. thank in advance. :) see http://www.tutorialspoint.com/java/java_string_replaceall.htm you want remove punctuation string. easiest way use regular expression find punctuation , replace matches nothing. string nopunctuation = foxes.replaceall("[\.,:;'\"!\?]", ""); simply include each symbol want replaced inside regular expression set , don't forget escape special characters!

git log - Git log all, display current commit differently -

i tend use git log --all --graph --oneline lot. if current state behind last commit, find hardly on graph display. is there way, conserving general display (oneline, graph), highlight current revision in way? you can use --pretty option of git log include references (branches, tags , head ) in list of commits: git log --all --graph --pretty='%c(green)%h%creset %c(cyan)%d%creset %s' where: %c(color) , %creset change color of output , reset default color, respectively %h expands abbreviated commit hash %d expands list of references point commit %s expands first line of commit message (i.e. " summary ") you can find complete list of placeholders in pretty formats section of git log documentation. of course, wouldn't want type every time want @ history, let's create alias it: git config --global alias.lg \ "log --all --graph --pretty='%c(green)%h%creset %c(cyan)%d%creset %s'" at point can gi

android - What is the way for having a list through rxjava? -

i bit new rxjava. trying have list on rxjava iterating on result. tried operator tolist() not work out. following working fine. however, wonder if there better way reactive perspective? db.loaddata().map(new func1<realmresults<data>, list<string>>() { @override public list<string> call(realmresults<data> datas) { list<string> companies = new arraylist<string>(5); (company company : datas.get(0).getcompanies()) { companies.add(company.getname()); } return companies; } }).subscribe(new action1<list<string>>() { @override public void call(list<string> strings) { showcompanydialog(strings); } }); so (pseudocode don't know object types have): db.loaddata() .map(new func1<realmresults<data>, list<company>>() ) { public list<company> call(realmresu

android - Why StrictMode does not catch read/write operations by SQLite? -

in app have following setup strictmode: strictmode.setthreadpolicy(new strictmode.threadpolicy.builder() .detectdiskreads() .detectdiskwrites() .detectnetwork() .penaltylog() .penaltydeath() .build()); at point i've noticed have few places sqlite operations not placed in separate thread nevertheless don't trigger strictmode violation. i've tested on real device android 5.1.1 , on genymotions 4.4.4 , 5.1.1 same result. have recollections sqlite operations used trigger strictmode violations not case. idea why? i saw in documentation following: notably, disk or network access jni calls won't trigger it. is reason? sqlite library written in c, accesses database file indeed hidden inside jni calls.

objective c - Set Text Colour of Placeholder Text of UITextfield Apple TV -

how set text colour of placeholder text of uitextfield in both normal , focused state. i using code setting placeholder text colour self.emailtextfield.attributedplaceholder = [[nsattributedstring alloc] initwithstring:@"email address" attributes:@{nsfontattributename:[uifont fontwithname:@"opensans" size:24], nsforegroundcolorattributename:[uicolor whitecolor]}]; self.passwordtextfield.attributedplaceholder = [[nsattributedstring alloc] initwithstring:@"password" attributes:@{nsfontattributename:[uifont fontwithname:@"opensans" size:24], nsforegroundcolorattributename:[uicolor whitecolor]}]; default focus go email textfield. email textfield placeholder colour black. if focus goes password text field, placeholder text colour of email textfield still black colour. you can set nsattributedstring placeholder so: self.totextfield.attributedplaceholder = [[nsattributedstring alloc] initwithstring:@"placeholdertext" a

php - How can I keep the pdf page from wrapping to a new page when large amounts of information is disaplayed -

i have specific question. going on have created pdf form using mpdf. problem i'm having when there large amount of data, form goes on different page. there way prevent pdf overflowing different page despite large amounts of data on page. thank you... you may choose reconfigure page size of pdf working on (bigger page = more text per page). however: if plan print form on standard 8.5" x 11" printer paper, not solution you. you can shrink font size using allow more text fit on page. keep in mind trade-off smaller text loose readability. depending on layout of document, may able tweak design making more space-efficient. involved solution problem, potentially best, able preserve font , page size.

python - I am having trouble with Tkinter GUI control -

i have programme various controls, live webcam feed , matplotlib figure based on webcam data. controls located in left column, , webcam , matplotlib figure located in right column. attempts use .grid() methods, canvases , frames etc don't work - python script fails execute , hangs indefinitely. how can achieved? minimum working example: import tkinter tk import cv2 pil import image, imagetk import numpy np import matplotlib matplotlib.use('tkagg') matplotlib.backends.backend_tkagg import figurecanvastkagg, navigationtoolbar2tkagg import matplotlib.pyplot plt matplotlib.figure import figure root = tk.tk() root.bind('<escape>', lambda e: root.quit()) lmain = tk.label(root) lmain.pack() class controller(tk.frame): def __init__(self, parent=root, camera_index=0): self.camera_index = 0 frame = tk.frame.__init__(self, parent,relief=tk.groove,width=100,height=100,bd=1) self.pack() self.parent = parent self