Posts

Showing posts from June, 2011

outlook - Using Java Mail -

i send email using java application. when press button, there should automatically sent email , somehow didn't find solution yet. found lot of example codes in internet, doesn't matter if use gmail / gmx or outlook, receive message : "could not connect smtp host: mail.gmx.net, port: 587; nested exception is: java.net.connectexception: connection timed out: connect" based on domain, host mail.gmx.net or smtp.office365.com etc.. think there's somehow connection problem, wasn't able fix it. have ideas / codes worked ? thank in advance. tobias use code send email .this works fine me package sendmail; import java.util.properties; import javax.mail.message; import javax.mail.messagingexception; import javax.mail.session; import javax.mail.transport; import javax.mail.internet.addressexception; import javax.mail.internet.internetaddress; import javax.mail.internet.mimemessage; /** * @author akash073 * */ public class crunchifyjava

c# - Detect a corrupt image file -

hi clever guys, im faceing bit of challenge here. im supposed create several different pdf's containing multiple (not similar) images. unfortunately of images corrupt/defect. causes creation of partikular pdf fail/dump. is there way can test image prior creation of pdf? please gentle me. im not expert. i found out system.drawings.image can test formats. better nothing guess (it reduce subset significantly). but when using itextsharp.text.image creation of pdf's. dont know how use the system.drawings.image because when try image newimage = image.fromfile("sampimag.jpg"); (image) refers itextsharp.text.image class. system.drawings.image abstract, i've tried create subclass. public class imagetest : system.drawing.image { } now error message: "error 1 type 'system.drawing.image' has no constructors defined" trying investigate constructors can use gives me attempt. public class imagetest : system.drawing.ima

ios - Why my UIWebview cannot 'full' screen? -

i have uiwebview built on xib following settings: [self.webview setscalespagetofit:yes]; self.webview.opaque = no; however, there white spaces on bottom, while if try on mac's chrome , ios simulator's safari, doesn't have white space. setting lack in uiwebview ? try code - (void)initwebview { self.webview.scalespagetofit=no; [self.webview setopaque:no]; self.webview.autoresizingmask = uiviewautoresizingflexibleheight | uiviewautoresizingflexiblewidth | uiviewautoresizingflexibletopmargin | uiviewautoresizingflexiblebottommargin | uiviewautoresizingflexibleleftmargin | uiviewautoresizingflexiblerightmargin ; [(uiscrollview*)[self.webview.subviews objectatindex:0] setshowshorizontalscrollindicator:no]; [(uiscrollview*)[self.webview.subviews objectatindex:0] setshowsverticalscrollindicator:no]; [self.webview.scrollview flashscrollindicators]; self.webview.frame=self.view.bounds; self.webview.opaque = no; self.webview.back

java - Why does a final collection still get updated? -

i've code store 2 collections , add event listener (no lambda here - need stick java 7 ;) ). // rri returnrequestinterface final collection<bigdecimal> selecteditems = rri.getselected(); final collection<bigdecimal> unselecteditems = rri.getunselected(); rri.addinformationchangeeventlistener(new componentinformationchangelistener() { @override public void informationchange(requestchangeevent event) { returnrequestinterface source = (returnrequestinterface) event.getsource(); boolean debug1 = source.getselected().containsall(selecteditems); boolean debug2 = source.getunselected().containsall(unselecteditems); } }); i've debugged , collection correctly setup. contained no objects, since code initialized. debugging listener (the event fired because item selection made) left me confused. booleans debug1 , debug2 both true because collection selecteditems , unselecteditems

inheritance - Derived Class C++ -

this question has answer here: what weird colon-member (“ : ”) syntax in constructor? 12 answers i know can stupid don't know how name question. i'm non native english. learn c++ book , there program shows name , pay rate of employee (base class) , manager (derived class) added bool variable salaried . here source code: //base class class employee { private: string name; double pay; public: employee() { name = ""; pay = 0; } employee(string empname, double payrate) { name = empname; pay = payrate; } string getname() const { return name; } void setname(string empname) { name = empname; } double getpay() const { return pay; } void setpay(double payrate) { pay = payrate; } string tostring() { stringstream stm;

android - How to avoid selecting last item from autocompletetextview -

i creating simple application having autocompletetextview contains names. want load imageview @ end of last item of autocompletetextview should non clickable/selectable. i able populate list along displaying imageview after last list item however, cant make non clickable/selectable. means, everytime selects empty field autocompletetextview & sets blank/empty. here, getview() method code: @override public view getview(int position, view convertview, viewgroup parent) { view view; layoutinflater inflater = (layoutinflater) mcontext.getsystemservice(context.layout_inflater_service); if (position != (resultlist.size() - 1)) view = inflater.inflate(r.layout.autocomplete_list_item, null); else view = inflater.inflate(r.layout.autocomplete_google_logo, null); if (position != (resultlist.size() - 1)) { textview autocompletetextview = (textview) view.findviewbyid(r.id.autocompletetext);

javascript - GoogleMaps doesn't appear when Angular ui-router($stateProvider) is used -

i have 3 states in simple ionic project. want add map home page after logged in. when tried add map in map.html file template file, appears when map.html opened via browser. however, when try reach state(map.html) using $stateprovider map not appear. my map.html file : <!doctype html> <html ng-app="starter"> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <title></title> <link href="lib/ionic/css/ionic.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <script async defer src="https://maps.googleapis.com/maps/api/js?key=apikey&callback=initmap"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <!-- ionic/a

xml - How to display an icon in Odoo ListView? -

i want show warning icon in odoo tree view if score <= avg <field name="score"/> <field name="avg"/> your python code (add field score_lt_avg model has score , avg fields): @api.multi @api.depends('score', 'avg') def _compute_score_lt_avg(self): record in self: record.score_lt_avg = (record.score <= record.avg) score_lt_avg = fields.boolean( compute='_compute_acore_lt_avg', string='score equal to/lower average', ) your xml code (you must add score , avg , score_lt_avg form view, not tree view, otherwise computed field not work): <field name="score"/> <field name="avg"/> <field name="score_lt_avg" invisible="1"/> <span class="fa fa-exclamation-triangle" attrs="{'invisible': [('score_lt_avg', '=', false)]}"/>

c# - LINQ to entites does not recognize Convert.ToDatetime method -

edit other answers link previous question's wont work me because either using 2 tables or know startdate looking for. i have following linq query trying data table last 14 days. linq not recognize convert.todatetime method. query_date column type string , can't change it. how data need? var logs = (from bwl in db.useractivities convert.todatetime(bwl.query_date) >= datetime.now.adddays(-14) select new { id = bwl.id, useremail = bwl.useremail }).tolist(); convert.todatetime works if query_date has proper format. if not, check string expression convertable format. i tested below code , works fine when assume query_date form of datetime.tostring() . var logs = (from bwl in db.useractivities datetime.now - convert.todatetime(bwl.qu

plot - R ggplot2 stacked barplot normalized by the value of a column -

Image
i have following dataframe t : name type total 1 20 1 20 3 20 2 20 3 20 b 1 25 b 2 25 c 5 35 c 5 35 c 6 35 c 1 35 the total identical entries same name . want plot stacked barplot type on x axis , count of name normalized total on y axis . plotted non normalized plot following : ggplot(t, aes(type,fill= name))+geom_bar() + geom_bar(position="fill") how can plot normalized barplot ? i.e type = 1 y axis value 2/20 a , 1/25 b , 1/35 c ... my try did not work: ggplot(t, aes(type, ..count../t$total[1],fill= name))+geom_bar() + geom_bar(position="fill") read in data d <- read.table(header = true, text = 'name type total 1 20 1 20 3 20 2 20 3 20 b 1 25 b 2 25 c 5 35 c 5 35 c 6 35 c 1 35') it's bad idea call t , since name of transpose function. calculate fractions library(dplyr)

Perl XML::Twig Copying without children -

is possible use somthing like my $nodecopy = $node->copy(); without copying children? can't find on page on cpan it. maybe i'm missing something? nevermind, found way. going leave here if ever else looks similar. have use cut_children . did this: my $nodecopy = $node->copy(); #copy node $nodecopy->paste('before', $node); #paste node $node->cut_children(); #remove children original node

java - How to trace which HashMap throws ConcurrentModificationException -

in application have several hashmaps. 1 of them throw concurrentmodificationexception every , then. problem not know how trace map throws it, , when concurrentmodification happens. stack trace not show line numbers happens. begin of stack trace looks liks this: java.util.concurrentmodificationexception @ java.util.hashmap$hashiterator.nextentry(hashmap.java:806) @ java.util.hashmap$valueiterator.next(hashmap.java:838) @ com.parse.parsetraverser.traverseinternal(parsetraverser.java:87) @ com.parse.parsetraverser.traverse(parsetraverser.java:137) @ com.parse.parseobject.collectfetchedobjects(parseobject.java:817) @ com.parse.parseobject.access$700(parseobject.java:49) @ com.parse.parseobject$13.then(parseobject.java:1487) @ com.parse.parseobject$13.then(parseobject.java:1484) @ bolts.task$15.run(task.java:917) @ bolts.boltsexecutors$immediateexecutor.execute(boltsexecutors.java:105) @ bolts.task.completeaftertask(task.java:908) @ bolts.task.continuewithtask(task.java:715)

android - Cannot Retrieve Location's longitude an latitude -

when try run code, error: java.lang.nullpointerexception: attempt invoke virtual method 'android.content.res.resources android.content.context.getresources()' on null object reference i can manually configure coordinates in emulator, still, got same error. here codes getting location coordinates. locationtracker.java public class locationtracker extends mainactivity implements locationlistener { mainactivity activity; context context; location location; locationmanager lm; double lat,longi; boolean isgpsenabled = false; boolean isnetworkenabled = false; boolean cangetnetworklocation = false; public locationtracker (context context) { this.context=context; getgpslocation(); } public location getgpslocation() { lm = (locationmanager) context.getsystemservice(context.location_service); isgpsenabled = lm.isproviderenabled(locationmanager.gps_provider); if (isgpsenabled)

android - Start Fragment before hand -

i have parent fragment p contains 10 buttons each on clicking replace container in p child fragments c1 c10. should able navigate c1 c2 on clicking next in action bar. able achieve since each of child fragment having heavy initialization (loading svg, surfaceview etc..) transition not smooth. possible start next fragment i.e. c2 when in c1 , put in paused state can resumed directly when next in c1 clicked. this someway similar offscreenlimit in viewpager when have seen view pager source code doesn't replace existing fragment scroll view new fragment x. replacing existing framework viewpager shown here 1 possible solution requires lot of changes existing code base , last thing wish do you can start fragments when create activity, call it. do know how inicialize fragment ? if not: fragment c1 = fragmentc1.newinstance(); fragment c2 = fragmentc2.newinstance(); fragment c3 = fragmentc3.newinstance(); ... then when click in button send information wich 1 want o

python - Finding Multiple Sequences in a File by Position after SpecifIcally Repeating Characters -

i trying write code, can sequences of different samples in file after line breaks position, output blank reason, can me? import readline count = 0 brk = 0 open("file.txt") f: while (count < 35): l = f.readline()[brk + 2] sp = raw_input ("starting position:") sp = int(sp) rl = sp + 6 print(l[sp:rl]) print(l[-30:0]) count = count + 1 brk = brk + 2 print ("done") in line l = f.readline()[brk + 2] program puts 1 character variable l . so, when trying print substring of l (in lines print(l[sp:rl]) , print(l[-30:0]) ), program prints empty lines. expected result. to find add print l right after assigning of l . it seems trying read 2-nd, 4-th, 6-th, etc lines of file. can this: brk = 0 open("file.txt") f: f.readline() f.readline() #skip both first lines while (count < 35): l = f.readline() f.readline() #skip next line

php - Malware attack on my server -

all index.php, header.php, footer.php files on server have code segment. possible malware. remove junk data files @ once. i'm using php on debian system. <?php //###=cache start=### error_reporting(0); $strings = "as";$strings .= "sert"; @$strings(str_rot13('riny(onfr64_qrpbqr("njltxtymp2i0xpeclalcxfo7vtiwnt8twtyvqwftsfoyouayvuftmkwlo3wspzijo3w0nj5axqncbjccozysp2i0xpwxnkajots5k2ilpz9lplvfvpvjvvx7pzyzvptunkammkdbwtyvqvxcvufxnjlbvjigpue5xpesd09cf0ysjlwwotyyoaesl2uyl2fvkfxcvtecmftxk0acg0gweifvl2kcmj50k2abmjaevy0cbjccmvujpziak21uqtabxppukszuqfpfvtmcotism2i0k2aioaeyoaemxpesh0ifixifjlwgd1wwhsesexyzeh5oghhvkfxcxfnxlln9vpw1vwftmjkmmfnxlln9vpw3vwfxwtdtcfnxk1ashymshyfvh0ifixifk05oghhvkf4xk1ashymshyfvhxieihigis9ihxxvkgfxwuhtcfnxk1ashymshyfvfsehhs9ih0ifk0sueh5hvy07pvecppn9vpesh0ifixifjlwfeh1cirisdherhvwqbjbxqkwfvq0tvzu0qun6yl9gmjquykwuqtyhml5lqf9amkdhptujc2yjcfvhqkwfmj5wo2eyxpecppxhvvmxcfvhqkwfmj5wo2eyxpexxf4vwah9vv51pzkyozaimthbwuhcyvvzlm0vyvewyvvzng0kwz

go - Config file masks -

we deploy services docker containers using marathon. containers include base config file, marathon pulls environment config file (which has subset of base keys) @ deployment time when app starts has; environment.toml config.toml when reading config need conflate values in both files single set, masking/shadowing values present in both files in environment file. i didn't find functionality in viper docs. unless have missed seems options are; write package uses viper read both files , perform conflation. extend viper before start writing code, there mechanism doing this?

reactjs - Get an inputs component props onBlur -

is possible props of input onblur event? with event.target.value value of input. is possible props of component similar way? sure can, here fiddle : var hello = react.createclass({ onblur: function(e) { console.log(this.props) }, render: function() { return <div> <input onblur={this.onblur} /> </div>; } }); or if receive function parent property, should bind components context. fiddle example : var hello = react.createclass({ render: function() { return <div> <input onblur={this.props.onblur.bind(this)} /> </div>; } }); function onblur(e) { console.log(this.props); console.log(e); } reactdom.render( <hello onblur={onblur} name="world" />, document.getelementbyid('container') );

windows - How to get path to provided visual studio "lib.exe" executable in CMake? -

how path provided visual studio "lib" executable (that can found in c:\program files (x86)\microsoft visual studio 11.0\vc\bin\ ) cmake? the full path lib.exe not directly available. derive cmake_linker : get_filename_component(_vs_bin_path "${cmake_linker}" directory) or via script cmake in windows-gnu.cmake .

python - How to resolve the ValueError proj_w in Tensorflow? -

i have created rest webservice execute machine translation modifications in translate.py. if run decode function in translate.py alone, on multiple runs right output. when try run decode function through webservice have created, first time, translation result. on second iteration, error mentioned in title. this error message : valueerror : variable proj_w exists, disallowed. did mean set reuse=true in varscope? rest webservice part : input = request.json['inputtext'] print "'%s'" % input print 'please wait' #import pdb; pdb.set_trace() #out = demo1.decode(input); decode python script: def decode(sentence) tf.session() sess: # create model , load parameters. model = create_model(sess, true) model.batch_size = 1 # decode 1 sentence @ time. # load vocabularies. en_vocab_path = os.path.join(flags.data_dir, "vocab%d.en" % flags.en_vocab_size) fr_vocab_path = os.path.join(flags.data_dir,

android - PercentRelativeLayout not working -

i'm trying use percentrelativelayout obtain ratio widget. if updated dependecies, doesn't seem android studio recognize library. here gradle android { compilesdkversion 23 buildtoolsversion "23.0.3" defaultconfig { applicationid "com.cobaltsign.androidwidget" minsdkversion 21 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } }} dependencies { compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.4.0' compile 'joda-time:joda-time:2.9.3' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.google.android.gms:play-services-appindexing:9.0.2' compile 'com.makeramen:roundedimageview:2.2.1'} idea ? you have

android - Dynamic, multiple string config for an app -

i need changing config in app. have right strings.xml file, holds different values i.e. city_name. have different build configuration, there lot of different looking apps can build using same codebase, each 1 of them has own values directory, unique strings.xml. what want achieve is, each app want have multiple city_name attributes "app a", strings.xml in values directory, want have city_name_xyz, city_name_abc. "app b", strings in values directory, contain city_name_123, city_name_mno etc. so, within code obtain "_xyz" or "_mno" suffix, thing dont know how access resources dynamic name. not know start looking answers, can me. best, radek you can use flavors - have different strings.xml files in different flavors

android - Opening the app's page in Google Play -

this question had been asked @ least couple times, , answer same, along lines of startactivity(new intent(intent.action_view, uri.parse("market://details?id=" + getpackagename()))); the problem is, doesn't work me. opens main google play page, not app's page. app indeed on google play, had been 4 years. interestingly, code did work couple years ago when first written doesn't.

javascript - Vuejs template inheritance -

how can use template inheritance (like jade has, extends file.jade , blocks same name overwritten)? i know can composition, components footer , header appear on every single page except 1 or 2 (e.g.login page) must write them on every single component. in app have 2 level navigation , seems painful repeat them on every 1 of child components :( i know can use jade , inherit jade file within components, seems wrong because have jade , vue files, there other way this? // component.vue <template lang="jade"> extends ./standardlayout block content router-view </template> // standardlayout.vue <template lang="jade"> div navbar div.container div.spacer div.row block content <template> what i've settled for, layouts folder filled jade layouts , use them extend components. used vue-cli webpack template . in most general case if have repeat same html on , over, 1 option use <partia

java - spring mvc configuration in spring tool suite -

i new spring mvc . using ubunto linux , sts 3.7 when create spring web mvc project helloworld following maven error in pom.xml.i have searched many time couldnt solution . " failure transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 https://repo.maven.apache.org/maven2 cached in local repository, resolution not reattempted until update interval of central has elapsed or updates forced. original error: not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to central ( https://repo.maven.apache.org/maven2 ): operation cancelled. pom.xml /springfirst line 1 maven configuration problem" can try this: right click on project --> run --> maven clean and then right click on project --> run --> maven install

Spring boot- RabbitMQ consumer keep on printing "Retrieving delivery for Consumer" -

hi using spring boot 1.3.5 along starter rabbitmq. in project having rabbitmq consumer consumes messages particular queue.but while running application keeps on printing below message in console.while browsing in google read setting heartbeat resolve issue no luck me, 14:08:14.892 [simpleasynctaskexecutor-1] debug o.s.a.r.l.blockingqueueconsumer - retrieving delivery consumer: tags=[{amq.ctag-rdkzctoxlmwqf4ffuihs0a=notificationqueue}], channel=cached rabbit channel: amqchannel(amqp://guest@127.0.0.1:5672/,3), conn: proxy@47914ea3 shared rabbit connection: simpleconnection@1096fe75 [delegate=amqp://guest@127.0.0.1:5672/], acknowledgemode=auto local queue size=0 14:08:14.913 [simpleasynctaskexecutor-3] debug o.s.a.r.l.blockingqueueconsumer - retrieving delivery consumer: tags=[{amq.ctag-jxyjmkfw6heu77xvdyh3tw=notificationqueue}], channel=cached rabbit channel: amqchannel(amqp://guest@127.0.0.1:5672/,2), conn: proxy@47914ea3 shared rabbit connection: simpleconnection@1096fe75 [deleg

osx - Unable to automatically remount webdav shared drive on iOS -

i trying automatically mount shared drive pointing webdav on yosemite mac. correctly able connect, access webdav, , copy files repository. able set shared drive login item. the problem comes when reboot, delivers error. when read console, says: "webdavfs_agent: webdav fs authentication credentials being sent insecurely to: http://address ", "webdavfs_agent: network_mount: network_stat returned error 2". still able connect clicking "connect server" selecting saved connection, not have reinput credentials or change address in way. replacing http https not allow me connect @ all. deleting , recreating credentials in keychain had no effect, , i've tried deleting , recreating login item every way can think of (pointing root repository, further directory chain, further down, etc). any ideas going wrong? alfresco's webdav hosted remotely on aws, if helps. i able fix problem creating applescript mount webdav setting script login item. he

java - Protobuf: UninitializedMessageException is thrown but isInitialized() returns true -

i'm experimenting bit protobuf in android , i'm bit stuck. i'm trying create message com.google.protobuf.uninitializedmessageexception: message missing required fields . however, isinitialized() returns true , i'm using optional & repeated fields. i'm sure i'm missing something. ideas? here proto file: package mobile_app; message msg { enum command { login = 0; logout = 1; } message param { optional int32 param_id = 1; repeated string items = 2; } enum errorcode { login_ok = 0; login_failed = 1; unknown_param_id = 2; } optional command command = 1; optional int32 param_id = 2; optional errorcode error_code = 3; optional string username = 4; optional string password = 5; repeated param params = 6; } and code: // ... messages.msg.builder loginmessage = messages.msg.newbuilder(); loginmessage.setcommand(messages.msg.command.login) .setusername(username) .setpassword(password); boolean

swift - Xcode Not Opening Project After Git Merge -

Image
i merged 2 branches , resolved close 100 conflicts. now, xcode doesn't allow me open of projects project navigator. way edit conflicted files in first place click on conflicts issue navigator. i'm not sure if it's important, vast majority of conflicts occcured in .pbxproj file , accepted both versions in cases. additionally, pods project disappeared. when running pod install , got following error: any appreciated, thanks! sometimes, accepting both sides of merge create duplicate sections in xcode project. or worse, invalid sections. xcode projects in old ascii plist format. can see file vaguely json or yaml file, basic tree structure. possible basic structure can corrupted if accept both sides of merge without paying attention contents of merge. make sure parentheses () , braces {} balanced correctly after merge. another problem objects represented in new property list might not make sense xcode. i'm not sure of requirements of file structu

model - Django ImageField error : cannot open image file -

i put imagefield model , can upload image file. when try open file through admin page. cannot open file there error says "500 internal server error". in file name there non-ascii letters inside. how can fix problem? class customer(user): profile_image = models.imagefield(upload_to='customers/photos', null=true, blank=true) hospital = models.foreignkey('hospital', null=true, blank=true) treatments = models.manytomanyfield('treatment', blank=true) verified = models.booleanfield(default=false) def get_full_name(self): return self.email def get_short_name(self): return self.email image file name = "데이비드_베컴2.jpg" actually model has more 1 field.. +) admin.py class customeradmin(useradmin): form = customerchangeform add_form = customercreationform # fields used in displaying user model. # these override definitions on base useradmin # reference specific fields on

django - Cannot use overextends in Wagtail admin -

i try replace default logo , title in wagtail app. according http://docs.wagtail.io/en/v1.0b1/howto/custom_branding.html i've created templates/wagtailadmin/ , have installed django-overextends , added overextends project’s installed_apps object( base.py ). as result error invalid block tag on line 1: 'overextends'. did forget register or load tag? how can correctly load overextends module make work? appreciated. in advance. see overextends readme in django 1.9+, must add overextends builtins key of templates setting templates = [ { 'backend': 'django.template.backends.django.djangotemplates', 'app_dirs': true, 'options': { 'builtins': ['overextends.templatetags.overextends_tags'], } }, ] for extensions feature template tags, need load them in each template, e.g. {% load overextends_tags %} , overextends different, , in earlier versions of django se

stripe payments - Set up a marketplace tips / donations system -

i have site lot of suppliers , end users. end users able give tips suppliers while taking commission in between. what's easiest way set up? plan code custom stripe integration node.js backend. there might easier way? maybe has written lot of what's needed already. thanks. stripe connect stripe's api lets process payments on behalf of third-parties, , optionally take cut out of transaction. there's lot of things consider depending on exact use case recommend take time browse documentation. this article resource.

Error defining dataype in Isabelle -

i'm working on theory uses topology , helpful have type of open sets. tried following: context topology begin typedef openset = "{u. u ∈ t}" end where topology locale , context command correctly gives output locale topology = fixes t :: "'a set set" assumes "topology t" however, following error: extra type variables in representing set: "'a" error(s) above occurred in typedef "openset" what mean? here t set of sets , want have type consisting of sets belonging t, there way can done? first of all, not data type – ‘normal’ type definition. the problem cannot have type definitions depend on locale parameters. logical foundations of isabelle not permit such thing @ moment. cf. question: what kind of type definitions legal in local contexts?

javascript - finding a value in an object -

i have object: { id: 16, defs: { name: "depot (float)", field: "depot" } } and array (which can have more 1 object in purposes of has one): [ { percentage monthly potential: 1, area manager: "ashar", business unit: "retail", cust no: 68345, depot name: "leicester", group number: "", depot: 14, target: 46100 } ] what need take field value object , use find key matches in second object , retrieve value of it, in case should getting 14. any appreciated. thanks time. if using es6, can try this: const field = lookupobject.defs.field; const matches = array.map(arrayitem => { return { field, value: arrayitem[field] } }); the matches array contain data interested in.

apache - Exo Platform Remove Address Port 8080 -

we've started use exo platform community 4.3 in our company. the issue far access platform link is: http://ipaddress:8080 we've used dns configurations able have: http://intranet.company.com:8080 the issue that, not able remove mandatory :8080 (port) address link. thanks port 8080 setup in home_exo/conf/server.xml file, , can not remove it, if want change port need update file new port.

datetime - How to extract year and week number using base R? -

i have following data frame: id created_at year_weak 1 2016-01-01t12:11:03.383z 2016-01 2 2016-01-04t12:11:03.383z 2016-01 3 2016-01-06t12:11:03.383z 2016-01 4 2016-01-11t12:11:03.383z 2016-02 5 2016-01-12t12:11:03.383z 2016-02 currently have following code using lubridate package: paste(year(as.date(df$created_at)),week(as.date(df$created_at)),sep = "-") i want same thing using base r , how can in base r? this following works base r commands: year <- format(as.date(df$created_at)+2, "%y") week <- format(as.date(df$created_at)+2, "%u") paste(year,week,sep = "-") note: have add 2 days, because 1st january 2016 friday , give week of 0. in format() week starts sunday. regards, j_f

javascript - window.open not working as new tab is undefined -

newtab = window.open('about:blank','_newtab' ); newtab.location.replace = ('http://www.yahoo.com/') i need open new tab different domain. following error occured instance_controller.js:184 uncaught typeerror: cannot read property 'location' of undefined why happening? please give solution. try this: newtab = window.open('about:blank', '_newtab'); newtab.location = ('http://www.yahoo.com/');

python - Selecting children from TreeView using pywinauto -

the issue have related the getitem() method pywinauto . able run window.treeview.getitem('\\desktop').click() command on windows 7 , 10 both 32 bit throws exeption , not run when calling python command line of windows 10 64 bit. this full code use: import pywinauto pwa_app = pywinauto.application.application() w_handle = pywinauto.findwindows.find_windows(title=u'browse folder', class_name='#32770')[0] window = pwa_app.window_(handle=w_handle) window.treeview.getitem('\\desktop').click() these errors receive: traceback (most recent call last): file "<stdin>", line 1, in <module> file "c:\python27\lib\site-packages\pywinauto\controls\common_controls.py", line 1374, in getitem texts = [r.text() r in roots] file "c:\python27\lib\site-packages\pywinauto\controls\common_controls.py", line 872, in text return self._readitem() file "c:\python27\lib\site-packages\pywinauto\contro

Getting empty TestNG group lists in Gradle -

i have big testng suite invoked via 'test' task in gradle. suite runs fine, i'm having difficulty asking gradle test suite information. specifically, lists of include , exclude groups. my group configuration in testng.xml looks this: <groups> <run> <exclude name="notready" /> </run> </groups> my goal provide means user specify include/exclude groups @ runtime using command line properties, , add them appropriate lists in testng config. catch is, still need respect existing include/exclude config in testng.xml file. here's brief build.gradle example of i'm trying in task block (minus command line parsing keep code simple): test { usetestng() { suites("src/test/resources/testng.xml") set<string> excludegroups = getexcludegroups() // returns empty set excludegroups.add("someothergroup") setexcludegroups(excludegroups) } } i expect exclud

c# - Centering Across Selection Using EPPlus -

if select adjacent cells in excel , click 'format cells', within alignment tab can set text alignment 'center across selection'. is there way apply programatically using epplus? searched on official documentation , couldn't find anything. if there no way apply through epplus, best alternative? the use case need traverse through cells in 1 particular row in excel , turn duplicate entries 1 entry centered across cells. logic had in mind delete content in bar first cell , center across selection of cells. epplus supports using centercontinuous this: ws.cells[1, 1].style.horizontalalignment = excelhorizontalalignment.centercontinuous;

ruby on rails - Uploading image with paperclip to S3 Bucket gives error: undefined method 'match' -

i'm trying setup application uses paperclip imageuploader upload files s3 bucket. config looks this: config.paperclip_defaults = { :storage => :s3, :s3_permissions => 'public-read', :s3_credentials => { :bucket => env['aws_bucket_id'], :access_key_id => env['aws_access_key_id'], :secret_access_key => env['aws_secret_access_key'], :region => env['aws_region'] } } creating post image working fine, giving me error: nomethoderror (undefined method `match' nil:nilclass): app/controllers/posts_controller.rb:33:in `create' my post model: has_attached_file :image, styles: { :medium => "640x" } validates_attachment_content_type :image, :content_type => /\aimage\/.*\z/ my post controller: def create @post = current_user.posts.build(post_params) if @post.save(post_params) flash[:success] = "your post has been created!" redirect_to posts_path else flash.now[:a

jquery - bxslider only working on vertical scroll, not horizontal -

i'm trying implement bxslider on website sidebar reason working when set mode "vertical" when set mode "horizontal," should default, or put nothing @ mode, slider transitions not work. i'm trying accomplish slider showing 1 slide @ time , auto transitioning next slide vertical scroll working still have manually hit pager next slide. i'm kind've stumped on problem. <ul class="bxslider"> <li> <div> <img class="img-responsive" src="/wp-content/themes/axon-responsive/images/slide1.png" /> <br> <quote>“axon radiology reliable , timely great response on questions or issues.”</quote> <hr> <p>brandon selle</p> <span>northeast missouri imaging associates</span> </div> </li> <li> <div> <img class="img-res

How to Install 'Approval - SharePoint 2010' workflow template in SharePoint 2013 Server -

i new in sharepoint development , configuration. need create list when entry created, email selected person approves entry. right now, have created list , setting-up workflow configuration, problem 'approval-sharepoint 2010' workflow template missing. how can work around this? or can download template , install in server sharepoint 2013? you haven't mentioned version of sharepoint running. presume because don't have option available running sharepoint 2013 foundation. sharepoint 2013 foundation doesn't use support workflow manager , uses same workflow engine sharepoint 2010 foundation uses- doesn't include approval workflow. the approval-sharepoint 2010 workflow template comes sharepoint standard or sharepoint enterprise. see here feature comparisons between versions: https://blog.blksthl.com/2013/01/14/sharepoint-2013-feature-comparison-chart-all-editions/ unfortunately, having tried various things myself, options upgrade @ least share

objective c - Getting issue while integrating CCAvenue in ios app -

Image
i not getting rsa value while using ccavenue. any appreciated. make format of rsa as rsakey = [nsstring stringwithformat:@"-----begin public key-----\n%@\n-----end public key-----\n",rsakey]; rsa key : -----begin public key----- miibijanbgkqhkig9w0baqefaaocaq8amiibcgkcaqeal6i3oqd5m23q+c/2pmznn5nbnfbf+yzg rg1yrhlmkbgkgba5xsrgbseqbzi3wq4sqz5kp01vkdc56a7itm9qy4uqwcxp0gtgtajxzkmwje9i axccp+a8qnnbnfpibj9pmjc9ykudvsn0liure7b1t1twnh02sqriygbzureo7yqp9e0ilrok7bjm 47ozhedhc5aj6iqqmq3+cuooboct8xyxtxukg21m3ecdjlgaarzdg13rjmpofi2uvso3dfgnplbp nhom5qfq2q8cv8lzqlnn6o5urb4jr7wwvaox+e+dgy6lc+i3hanngox5e4nj5lro7i8upbfxkeid tvhcoqidaqab -----end public key-----

asp.net - Send an email once an hour even though page refreshes every minute -

using vb.net , vs 2015 create asp.net site. i have web page refreshes automatically every minute , shows status of several items. want able send email page every 60 minutes if error found. prefer use code within site have access sql server 2012 create db if needed. i thought best way if there error on page call subroutine send email. stands happen every minute annoying. thought best way session variable cannot work out how send email once every 60 mins , stop when error no longer present , reset time 0. the code below shows have far. wrapped case statement checking error. 'checks see if email needs sent select case session("sendemail") case nothing, 60, 120, 180 'send email case else 'do nothing end select session("sendemail") = session("sendemail") + 1 this should work after page has refreshed 60 times session variable match case statement need send emails until has resolved error , dont want hardcod

java - Unable to switch focus to newtab/window in Internet Explorer using Selenium Webdriver -

the problem here is, i'm unable focus new tab/window both, instead focus remains in first one. please help. driver=new internetexplorerdriver(); driver.findelement(by.cssselector("body")).sendkeys(keys.control +"t"); //driver.findelement(by.cssselector("body")).sendkeys(keys.control +"n"); (string winhandle : driver.getwindowhandles()) { driver.switchto().window(winhandle); } driver.get("https://google.com/"); the ie driver doesn't support enumeration of tabs within window. additionally, webdriver in general doesn't support automating "manually" opened tabs, opened control+t . specific drivers may support functionality, it's not globally supported part of api contract. the vast majority of times users attempting "manually open new tab, switch it, , automate it," use case isn't entirely thought through. since decline state why want perform action, opposed starting new driver i

javascript - return value from datepickerCallback function -

i new angular js, , application using datepickercallback function date selected. how can return value of function ? want date selected , pass in http request data corresponding date. self.datepickercallbackfrom = function(val) { if (typeof(val) === 'undefined') { console.log('date not selected'); } else { console.log('selected date : ', val); self.datefrom = val; } }; html: <ionic-datepicker date="exctrl.datefrom" disablepreviousdates="false" disablefuturedates="true" callback="exctrl.datepickercallbackfrom" title="exctrl.titlefrom"> it looks have pass callback option not html attribute. https://github.com/rajeshwarpatlolla/ionic-datepicker#readme var options = { callback: function (val) { //mandatory if(typeof(val) === 'undefined') { console.log('

PHP if-else condition in JSON to change the event color in fullcalendar -

<?php header("access-control-allow-origin: *"); header('content-type:application/json'); mysql_connect('localhost','root','') or die(mysql_error()); mysql_select_db('pmothesis'); $select = mysql_query("select * venue_reservations join venue on venue.venue_code = venue_reservations.venue_code join office on office.office_id = venue_reservations.office_id status != 'finished'"); $rows = array(); while ($row = mysql_fetch_array($select)) { $rows[] = array('id'=>$row['venue_reservation_id'], 'title'=>$row['venue_name'], 'start'=>$row['date_time_start'], 'end'=>$row['date_time_end'], 'description'=>"purpose: ".$row['purpose']. ' <br> venue reservation id: ' .$row['venue_reservation_id'

c# - NHibernate QueryOver get time from datetime property -

i'm saving both date , time datetime in sql server database, , have datetime property in mappings. in query need access date individually , time well. date have no problem when trying time datetime following error: additional information: not resolve property: timeofday of: iws.datacontracts.servicesplanning saving time in other property not want though tried , can't working either. query queryover : session.queryover<servicesplanning>() .joinalias(x => x.teammember, () => stm) .where(() => stm.id == _memberid) .where(x => (x.allday && (x.startdate == _startdate && x.enddate == _enddate)) || (!x.allday && x.startdate.date == _startdate && x.enddate.date == _enddate && (x.startdate.timeofday > _endtime.value || x.enddate.timeofday < _starttime.value))) .rowcount() > 0; query linq: return session .query<servicesplanning>() .where(

excel - VBA Loop Worksheet Filter Using Multiple Variables -

i trying provide easy search tab of employees in order them filter through large data table specific entries , copy row master list , past search tab. the code below works , copies data entries match, unfortunately "country" criteria works , rest nothing. what trying tweak code have written criteria work , if criteria blank in corresponding search ignores criteria allowing value in cell copy , pasted. thinking adding if else statements of criteria job i'm not sure how add if else statement in vba strings , tell ignore criteria if blank. sub search_and_extract_multicriteria() dim datasheet worksheet 'where data copied dim reportsheet worksheet 'where data pasted dim country string dim subtype string dim productname string dim productformula string dim source string dim rating string dim finalrow integer dim integer 'row counter set datasheet = sheet1 set reportsheet = sheet3 country = reportsheet.range("a3").value subty

ios - How does the Swift string more than operator work -

this question has answer here: what mean string , character comparisons in swift not locale-sensitive? 3 answers i don't have experience swift , come php / python / javascript background, please bare me. i reading documentation on swift programming language, when came across the following code snippet : let names = ["chris", "alex", "ewa", "barry", "daniella"] func backwards(s1: string, _ s2: string) -> bool { return s1 > s2 } names.sort(backwards) // ["ewa", "daniella", "chris", "barry", "alex"] what don't seem able find, how > operator works in context, thought count amount of characters , return boolean based on that, logic following snippet should return false: "cd" > "abc" // true could please explain going o

ios - how to get the incoming call number by using callkit -

how incoming call phone number programmatically using call kit framework. tried cxcallobserver class no use. any suggestions helpful... when using callkit's call blocking & identification feature (new in ios 10), phone numbers blocked or identified loaded app's call directory extension prior incoming call , phone numbers stored system. then, when incoming call arrives, stored data consulted system , incoming call may either blocked or identified in incoming call ui label provided. for privacy , performance reasons, call directory app extensions not launched when incoming calls arrive , app extension cannot retrieve phone number incoming call.

javascript - Calling to to another page with AJAX while showing loading image -

i have php gets parameters post , @ end of process redirects user page. because whole process can take 6 seconds, wanted add loading gif. i've created page shows image , calls first page using ajax. no matter i've tried, not able make whole process work. @ end xmlhttprequest cannot load error - no 'access-control-allow-origin' header present on requested resource. origin ' http://localhost:8888 ' therefore not allowed access. this code of page calls php process file: <?php function generatedata(){ global $dpost; foreach ($_post $key => $value){ $dpost .= ',' . $key . ':"' . $value . '"'; } $dpost .= ',resulttype:"pre"'; $dpost = '{' . substr($dpost, 1) . '}'; } ?> <html> <head> <link rel="stylesheet" type="text/css" href="default.css"> <script src="http://code.jquery.com/jquery-1.1