Posts

Showing posts from May, 2010

exchange server - How to get Appointment recurrence in XML format using EWS? -

i working on mail application. want appointment details exchange server account using ews. use scheduler control details of recurrence in xml format. want details of appointment in either xml or in string format. for example, gmail occurance detail test: weekdays, never end meeting recurrence object details: "rrule:freq=weekly;byday=mo,tu,we,th,fr" i use following method appointment. foreach (appointment appointment in service.finditems(wellknownfoldername.calendar, new itemview(int.maxvalue))) { appointment.load(); } can please suggest me appropriate way?

Mysql 5.5 aggregate time intervals -

i have seen plenty of posts how specify time interval. tried use them strange results. table: select value,time mysensor9 order time desc; +-------+---------------------+ | value | time | +-------+---------------------+ | 79 | 2016-01-27 22:19:46 | | 45 | 2016-01-27 22:19:45 | | 5 | 2016-01-27 22:19:44 | | 72 | 2016-01-27 22:19:43 | | 20 | 2016-01-27 22:19:42 | | 92 | 2016-01-27 22:19:41 | ..... i have filled table values every second of month. then try aggregate data of table every 5min/ hour/day/month. when try aggregate average value per day make query: select avg(value),time mysensor9 time > "2015-12-09" group unix_timestamp(time) div (3600*24) order time asc; the results ok: +------------+---------------------+ | avg(value) | time | +------------+---------------------+ | 48.7179 | 2015-12-09 02:13:46 | | 49.4044 | 2015-12-10 02:13:46 | | 49.5001 | 2015-12-11 02:13:46 | | 49.4805 | 2015-12-1

python - recover the questions related to responses retrieve to ManyToMany -

Image
first model contains questions , answers pages manage issues. my models.py class question(models.model): label = models.charfield(max_length=30) def __str__(self): return self.label class page(models.model): title = models.charfield(max_length=30) def __str__(self): return self.title class reply(models.model): page = models.manytomanyfield(page) question = models.foreignkey(question) user = models.foreignkey(personne) answer = models.charfield(max_length=30) creationdate = models.datetimefield(default=datetime.now()) def __str__(self): return str(self.answer) so managed retrieve answers each page 1 page equal to: 1 visit another: visit 2 etc ... (i go share screenshot) i managed retrieve answers each pages fail see questions corresponding each response page! this views.py def reply(request): replies = reply.objects.all() questions = question.objects.all() logged_user = get_logg

quartz.net - SchedulerException with Simple Job -

i'm trying started quartz.net 2.0. simple appearing test application failing schedulerexception trigger's related job's name cannot null the code adapted version 2.0 migration guide ischedulerfactory schedfact = new stdschedulerfactory(); ischeduler classsched = schedfact.getscheduler(); classsched.start(); ijobdetail job = jobbuilder.create<classificationjob>() .withidentity("myjob", "my group") .withdescription("my description") .build(); timezoneinfo tzutc = timezoneinfo.utc; datetime starttime; starttime = datetime.utcnow; itrigger trigger = triggerbuilder.create() .withidentity("mytrigger", "my group") .withdescription("my description") .startat(starttime) .withsimpleschedule(x => x.withintervalinseconds(10).repeatforever()) .build(); classsched.schedulejob(trigger); // exception on line why failing?

How to handle Intents in Android app when you have Login Activity -

i looking advice when comes handling flows between activities. let's have 2 activities - loginactivity , mainactivity: <activity android:name=".loginactivity" android:configchanges="keyboardhidden|orientation" android:label="@string/app_name" android:launchmode="singletop" android:screenorientation="portrait"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <activity android:name=".mainactivity" android:configchanges="keyboardhidden|orientation" android:label="@string/app_name" android:launchmode="singletop" android:screenorientation="portrait" /> now, when application starts, start loginactivity, , if login successful show mainactivity. now, problems start when want handle types of intents. let

Pareto Frontier generation for multi-objective prob. using openMDAO 1.x? -

i new openmdao framework , using 1.5.0 version. i'm interested in generating pareto front zitzler–deb–thiele's functions using same. i found solution legacy version here uses 'pareto_filter' unable locate same in new version. so, how set multi-objective problem generate pareto front in 1.x version? thanks all. you should able nsga2 pyopt-sparse directly in openmdao. install pyopt-sparse package , openmdao has driver built in let use it. pick nsga2 optimizer. the issue that, if @ source , driver labeled single-objective. should change line true, can specify multiple objectives. we haven't tested nsga2 via pyopt-sparse. might take little bit of hacking around work. if you'd prefer regular pyopt package, should able start our current pyopt-sparse wrapper , make small changes work.

php - how to integrate payumoney payment gateway with codeigniter -

i have developed project booking appointments doctors in html,javascript,php web services(codeigniter framework) both website , mobile app.now iam in need of integration payumoney payment gateway.so please me of step step instructions in code.iam new payment integration. don't take otherwise there no sufficient document payumoney integration in codeigniter in internet in stackoverflow... have solve it... please process step step if have 'user' controller(say user.php) add function payum() or that. adding code bellow function payum() { $userid = $this->ion_auth->get_user_id(); if(is_numeric($userid)) { $this->data['title'] = 'payu money cash deposit'; $this->data['records']= $this->base_model->run_query("select * users id=".$userid ); $this->data['content'] = 'user/payum'; $this->_render_page('user/payum', $this->data); } else { $this-

c# - Getting or attaching an entity -

i have following method: public bool removebookcategories(idictionary<books, ilist<c_category>> books) { _context.configuration.autodetectchangesenabled = true; foreach (var book in books.keys) { foreach (var category in books[book]) { if (!_context.changetracker.entries<books>().any(e => e.entity.bookid == book.bookid)) _context.books.attach(book); if (!_context.changetracker.entries<c_category>().any(e => e.entity.id == category.id)) _context.c_category.attach(category); book.c_category.remove(category); } } if (_context.savechanges() > 0) return true; return false; } it works expected.. sometimes. other times error message: {"attaching entity of type 'dataaccess.plusbog.c_category' failed because entity of same type has same primary

oop - Main differences to be aware of when migrating vb6 to vb.net -

i in process of migrating 5k line long vb6 program vb.net i've been doing fair amount of research differences need aware of between 2 languages, , thought i'd opinion on it. the vb6 code hooks outlook , mail processing, written in 15 class module files ( .cls ), 1 module, , 1 designer. so main code differences should aware of before dive transferring vb.net . i'll doing in visual studio 2013 , have visual basic 6 view original code.

Format body of email sent by Excel VBA -

i've seen few questions topic none specific/similar scenario. the body of email received via input in userform. want format calibri size 11. i've tried few methods , although code doesn't error out, when email populated, still times new roman 12. the first body line calls text box , i've attempted add formatting. second line necessary maintaining line breaks. sorry basic question, i'm still learning! .to = username .cc = txtcc .bcc = txtbcc .importance = importance .subject = txtsubject.value .htmlbody = "<p style='font-family:calibri;font-size:14.5'>txtbody.value</font></p>" .htmlbody = replace(userform1.txtbody.text, vbcrlf, "<br>") actually, i'm not sure if can here tipps: why write html body , override text userform.textbox? instead try like: .to = username .cc = txtcc .bcc = txtbcc .importance = importance .subject = txtsubj

jquery - Why does the site add code to my index at run-time -

i have problem website. problem site adds code index file when running it. this code in index file: for(i = 0; < game.length; i++){ $('.games').append('<div class="slide304"><div class="center"><div id="gameticker'+ +'"></div></div></div'); } but @ runtime code becomes this: for(i = 0; < game.length; i++){ $('.games').append('<div class="slide304"><div class="center"><div id="gameticker'+ +'"></div></div></div');> + h + ":" + m; as can see adds > + h + ":" + m; @ end of jquery. problem because site can't run due syntax error "unexpected token >" does know why adds code @ end of code , how prevent it? you missing closing > of last div in .append() : $('.games').append('

does pthread_mutex_recursive attribute will affect openssl -

i need clarification in below problem. problem: writing wrapper use openssl in locking (mutex) , adding certificate information openssl store using x509_store_add_cert() function , doing more steps followed this. here problem is, update openssl store, have locked whole operation before calling x509_store_add_cert() , in function once again same lock used update openssl store. so, have used pthread_mutex_recursive attribute mutex , code works fine. but, since initializing array of global mutex list pthread_mutex_recursive , affect other openssl clients in system? kindly reply , me in regard. in advance.

operating system - Why Does the BIOS INT 0x19 Load Bootloader at "0x7C00"? -

as know bios interrupt (int) 0x19 searches boot signature (0xaa55). loads , executes our bootloader @ 0x7c00 if found. my question : why 0x7c00? reason ? how evaluate through methods? this dead i'm going answer. at start of bootloader when set origin of segment 0x7c00 registers jump address well. ideally if check out online resources tell how use int 0x19 command guide on how jump address. to fix ideally, reset stack 0 @ start of every jump new address.

android - Detecting toasts in Marshmallow -

i'm writing ui tests espresso , i'm trying assert toast messages. problem i'm having code works on lollipop fails on marshmallow , can't understand why. my code opening dialog, filling email , clicking button. should bring toast , (i confirmed visual inspection on device) test fails detect toast. for purpose created custom matcher class toasts: import android.os.ibinder; import android.support.test.espresso.root; import android.view.windowmanager; import org.hamcrest.description; import org.hamcrest.matcher; import org.hamcrest.typesafematcher; import static com.google.android.exoplayer.util.assertions.checkargument; import static com.google.android.exoplayer.util.assertions.checknotnull; import static org.hamcrest.corematchers.equalto; public class toastmatcher{ public static matcher<root> withtoasttext(string toasttext) { // use preconditions fail fast when test creating invalid matcher. checkargument(!(toasttext.equals(null)));

scala - Why doesn't keys() and values() work on (String,String) one-pair RDD, while sortByKey() works -

i create rdd using readme.md file in spark directory. type of newrdd (string,string) val lines = sc.textfile("readme.md") val newrdd = lines.map(x => (x.split(" ")(0),x)) so, when try run newrdd.values() or newrdd.keys() , error: error: org.apache.spark.rdd.rdd[string] not take parameters newrdd.values() or .keys() resp. what can understand error maybe string data type cannot key (and think wrong). if that's case, why newrdd.sortbykey() work ? note: trying values() , keys() transformations because they're listed valid transformations one-pair rdds edit: using apache spark version 1.5.2 in scala it doesn't work values (or keys ) receives no parameters , because of has called without parentheses: val rdd = sc.parallelize(seq(("foo", "bar"))) rdd.keys.first // string = foo rdd.values.first // string = bar

Exporting R output into Latex - Stargazer for non suported objects -

Image
i'm estimating models in r using frontier package , need export results latex. output quite similar lm regression [see below] frontier objects not supported stargazer export them latex code. there way work around this? idea? *i looking texreg , apsrtable , far unsuccessfully. example of frontier regression output: i don't know getting stargazer output unsupported models, can use a tidy method broom package basic output format compatible xtable , knitr::kable , or pixiedust library(broom) library(frontier) # example included in frontier 4.1 (cross-section data) data( front41data ) # cobb-douglas production frontier cobbdouglas <- sfa( log( output ) ~ log( capital ) + log( labour ), data = front41data ) tidy(cobbdouglas, conf.int = true) broom:::tidy.lm(cobbdouglas) term estimate std.error statistic p.value 1 (intercept) 0.5616193 0.20261685 2.771829 5.574228e-03 2 log(capital) 0.2811022 0.04764337 5.90013

java - Finde positive and negative numbers from Array? -

i have 1 assignment , need . int[] array={12,23,-22,043,545,-4,-55,43,12,0,-99,-87} , must make 2 array. first positive , second negative , duplicate nubers . can not use arraylist. int[] array={12,23,-22,0,43,545,-4,-55,43,12,0,-999,-87}; for(int i=0;i<array.length;i++){ if(array[i]>0){ system.out.println("positive:"+array[i]); } else if (array[i]<0){ system.out.println("negative:"+array[i]); } (int j = + 1; j < array.length; j++) { if (array[j] ==array[i]) { system.out.println("dup:"+array[j]); } } } } res is:run: postive:12 dupli:12 postive:23 negative:-22 dupli:0 postive:43 dupli:43 postive:545 negative:-4 negative:-55 postive:43 postive:12 negative:-999 negative:-87 build successful (total time: 0 seconds) don know how postive: 12,23,0,43,545, etc. try

jasmine - Sublime Text: Different Snippet for JavaScript ES5 vs ES6? -

i have these snippets use regularly when writing tests in jasmine , example of 1 is; <snippet> <content><![cdata[ beforeeach(function() { }); ]]></content> <tabtrigger>be</tabtrigger> <scope>source.js</scope> </snippet> what i'm wondering (possibly using <scope> value?) if output different based on current language between javascript, javascriptnext — es6 syntax, , jsx? far do, these share source.js scope? the output want is; javascript beforeeach(function() { }); javascriptnext — es6 syntax, , jsx beforeeach(() => { }); thanks time. the scope depends on syntax using file. es6 syntax highlighters uses source.js compatibility reasons. babel-sublime/javascript (babel).sublime-syntax javascriptnext.tmlanguage/javascriptnext.yaml-tmlanguage syntax (e.g. markdown) may specify portion of text source.js , handled es6 syntax. you have forked jsnext syntax , use scope, source.js.es6

sql - can we write better query than this? to reduce performance issues -

select (select omh_recv_bic sc_omh_m sc_omh_trans_sno=103) 'sender\receiver', (select omh_msg_trm_dt sc_omh_m sc_omh_trans_sno=103) 'send\receivedate', (select omh_msg_type sc_omh_m sc_omh_trans_sno=103) 'message type', (select omd_sfld_val sc_omd_t omd_fld_tag=20 , omd_sfld_ord=1 , omd_trans_sno=103) 'senders reference', (select omd_sfld_val sc_omd_t omd_fld_tag=50 , omd_sfld_ord=3 , omd_trans_sno=103) 'ordering customer', (select omd_sfld_val sc_omd_t omd_fld_tag=59 , omd_sfld_ord=3 , omd_trans_sno=103) 'beneficiary customer', (select omd_sfld_val sc_omd_t omd_fld_tag=32 , omd_sfld_ord=2and omd_trans_sno=103) 'currency code', (select omd_sfld_val sc_omd_t omd_fld_tag=32 , omd_sfld_ord=1and omd_trans_sno=103) 'date', (select omd_sfld_val sc_omd_t omd_fld_tag=32 , omd_sfld_ord=3and omd_trans_sno=103) 'value' select * ( select max(case when omd_fld_tag=20 , omd_sfld_ord=1 omd_sfld_val

objective c - Round only 2 corners of a UIView in custom UITableViewCell - iOS -

i have uiview in custom uitableviewcell , want round bottom left , right corners of view. i'm doing following, it's not working: - (void)awakefromnib { // initialization code cashapelayer * masklayer = [cashapelayer layer]; masklayer.path = [uibezierpath bezierpathwithroundedrect: _viewfortags.bounds byroundingcorners: uirectcornerbottomleft | uirectcornerbottomright cornerradii: (cgsize){7.0, 7.0}].cgpath; _viewfortags.layer.mask = masklayer; } i achieve in usual view controllers in viewwilllayoutsubviews method , works perfectly, there's no such method when subclass uitableviewcell . any idea how can round 2 corners of view in subclassed uitableviewcell ? actually there method state in uitableviewcell . layoutsubviews -(void)layoutsubviews { cashapelayer * masklayer = [cashapelayer layer]; masklayer.path = [uibezierpath bezierpathwithroundedrect: _im.bounds byroundingcorners: uirectcornerbottomleft | uirectcornerbottomrigh

Importing CSV into MySQL through JAVA -

so i'm trying import csv file mysql database through java program. program imports that's in file, it's suppose to, first row, send end of table, , program see it's there, if search nr, says doesn't exists. , if go directly database table , edit nr(if nr 137, , edit , write 137 again) program recognize nr, , if search it, find, , database table organizes , sends entry suppose be. don't see logic in this. me out, i'd appreciated. load data infile 'c:\\users\\carla.desktop-9364k9k\\desktop\\alunos_1.csv' table utentes character set utf8 fields terminated ',' (nrprocesso, nome, @nome_resumido, ano, turma, @subsidio, @nome_ee, @nif, @email, @obs) set subsidio = if(@subsidio='','nenhum',@subsidio), nome_resumido = if(@nome_resumido='',null,@nome_resumido), nome_ee = if(@nome_ee='',null,@nome_ee), nif = if(@nif = '', null,@nif), email = if(@email='',null,@email), obs = if(@obs='',null,

javascript - Safari 9 paints only the first frame of a video on canvas (bug) -

i'm trying paint the current frame of <video> on canvas safari 9.0.3 on 10.11 paints first frame … sometimes! appears work after video cached because hard refresh causes not work again. .drawimage(video, 0, 0, width, height) how i'm painting it. this simple snippet works correctly in browsers, including safari 9 yosemite, not in safari 9 el capitan var video = document.queryselector('video'); var canvas = document.queryselector('canvas'); canvas.addeventlistener('click', function () { canvas .getcontext('2d') .drawimage(video, 0, 0, canvas.width, canvas.height); }); <p>play video , click on canvas paint</p> <canvas width='240' height='135' style="border: solid;"></canvas> <video width='240' height='135' controls loop src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video> is there workaround? other way

node.js - Data not populating in mongoose -

here schema var employee = { empcode : { type : string , unique: true , required : true }, firstname : { type : string , required : true }, lastname : { type : string }, email : { type : string }, doj :{ type : date , default: date.now }, dob :{ type : date }, phoneno : { type : string }, authentication : { username : { type : string }, password : { type : string } }, dsg : [{ designationid: [{type : mongoose.schema.objectid , ref:'designation'}], efffrom :{ type : date , default: date.now }, effto : { type : date } }], grd : { grade : [{type : mongoose.schema.objectid, ref:'grade'}], efffrom :{ type : date , default: date.now }, effto : { type : date } },

oauth - OpenAM - Use OAuth2 Access Token to get User Details? -

is possible user details (attributes belonging resource owner) forgerock's openam using oauth 2 access token? i have trusted spa ui able access token openam using resource owner password credentials grant type. however, access token gives me no information resource owner. token_info endpoint gives me no information. openam seems have endpoints listing user attributes , expects jwt means of authentication request. how can user attributes access token? there userinfo endpoint return user attributes. in openam 13.0, data returned endpoint scriptable. in prior versions mapped scopes. the sample client application helpful understand how works: https://github.com/forgerock/openid

Play iTunes song in my iPhone application -

i developing music based iphone application. listed songs in ipod library in application. when tried play songs ipod library using avplayer, songs playing , songs not playing. when checked, seems not playing songs paid songs itunes. there problem paid songs playing. please me. you need use mediaplayer framework not avplayer

ios - Views not responding when forcing wrong orientation -

i having issue controls not responding on part of view/window. in case bottom part. what doing presenting new window has portrait oriented root view controller. seems work fine if application supports portrait orientation. when application landscape-only bottom part of window not responsive. (before start commenting should lock view controller orientation , allow application orientations let me tell framework , not have access application orientations. , yes, requirement show in portrait) so naturally tried quick trick overriding window hit test result surprisingly correct. call supper return correct view, in example below return button pressed target method not trigger. there must else breaking pipeline. example controller (you can copy , call static method showoverlay ): class overlayviewcontroller: uiviewcontroller { class mywindow: uiwindow { override func hittest(point: cgpoint, withevent event: uievent?) -> uiview? { let toreturn: uiview?

requirejs + angularjs + resolve, controller loaded but not executed -

i'm trying load dynamically controller in way: .state('main', { url:'/app', data: {requirelogin:true }, views:{ '': angularamd.route({ templateurl:function (){ var token=$cookies.get('token'); return '/gettemplate/'+token+'/main'; }, controller:'' }), 'main.content@main': angularamd.route({ templateurl:function (){ var token=$cookies.get('token'); return '/gettemplate/'+token+'/main.content'; }, // controller:'main.content', resolve: { load: ['$q', '$rootscope', '$cookies',function ($q, $rootscope, $cookies) { var controller_name='main.content.js'; return loadcontrollerwithtoken($q,$rootscope,$cookies,controller_name);}]} }), the controller loaded (i'm checkin network panel on chrome) not "executed", console.log inside isn't called. here controller: define(['

vb.net equivalent of vb6 function attributes -

i have follow class in vb6 : public function newenum() attribute newenum.vb_usermemid = -4 attribute newenum.vb_memberflags = "40" newenum = mcolfields.[_newenum] end function what equivalent attributes in vb.net? know have put attributes in <> and found this post, didn't solve problem. getenumerator() exact equivalent. gets exposed newenum in <comvisible(true)> code. implement system.collections.ienumerable interface, non-generic one.

Extent of Google spreadsheet cells -

in google sheets cells go -> z , start doubling eg aa -> zz (presumably - i've been far ca). allows 676 cells horizontally. question is- really use more this? i found copy & paste option... :-/ turns out there's 2,000,000 cell limit on whole worksheet. roughly, means might see cells 3 letters sometimes, part upper limit zz (it depends on depth of spreadsheet guess (so may not far zz sometimes) ).

Upload File with Meta-Data (`multipart/form-data`) to ColdFusion 11 REST Service -

how access meta-data (form data) sent file upload (using enctype="multipart/form-data" ) in coldfusion 11 rest service? mocking simple service: component restpath = "test" rest = true { remove void function upload( required numeric id restargsource = "path", required document restargsource = "form", required string title restargsource = "form" ) httpmethod = "post" restpath = "{id}/" produces = "application/json" { if ( fileexists( document ) ) restsetresponse({ "status" = 201, "content" = { "id" = id, "title" = title, "size" = getfileinfo( document ).size } }); else restsetresponse({ "status" = 400, "content" = "nothing uploaded" }); } } and simple html f

bash - Processing multi line logs with AWK to gather SQL statements -

i have following entries in log file: 2016-01-25 21:12:41 utc:172.31.21.125(56665):user@production:[21439]:error: bind message supplies 1 parameters, prepared statement "" requires 0 2016-01-25 21:12:41 utc:172.31.21.125(56665):user@production:[21439]:statement: select count(*) total ( select 1 count leads_search_criteria_entities inner join entities e on entity_id = e.viq_id left join companies_user cu on cu.entity_id = e.viq_id criterium_id = 644 , (( ( cu.udef_type null -- if not set user, check calculated value , is_university >= 50 ) or ( cu.udef_type not null -- if set user, use , cu.udef_type = 'university' ) )) group e.viq_id order e.viq_id ) x 2016-01-25 21:14:11 utc::@:[2782]:log: checkpoint s

java - Search specific objects in ArrayList by attribute -

good day, imagine have following code: (these not attributes) class owner { private string name; } class car { private owner owner; private string brandname; public boolean isclean() { // not included in contructor return false; } class fuelcar extends car { private string fueltype; public boolean isclean() { if (fueltype.equals("diesel")){ return false; } else { return true; } } class electriccar extends car { private int batterylevel; public boolean isclean() { return true; } } the objects added arraylist: arraylist<car> cars = new arraylist<>(); examples: cars.add(new auto("audi", new owner("peter"))); cars.add(new auto("fiat", new owner("rob"))); cars.add(new auto(mercedes, null)); cars.add(new electriccar(10, "opel ", new owner("unknown"))); cars.add(new electriccar(100,"goog

jsf - In CommandButton immediate="true" but validation not skipped? -

i have added immediate="true" in button <h:commandbutton id="browse" action="#{creationbean.getaterminationroot()}" value="browse" immediate="true"> <rich:componentcontrol event="click" target="atermpanel" operation="show" /></h:commandbutton> now in same page have included page below <ui:insert name="name"> <ui:include src="../pages/abc.xhtml" /> </ui:insert> this page have validation in inputtextbox <h:inputtext id="ammondemandid" required="true" value="#{var.amount}" requiredmessage="msg1" validatormessage="msg2"> <f:validaterequired /> <f:validatelongrange minimum="0" maximum="9999999"> </f:validatelongrange> <rich:validator event="blur" /> </h:inputtext> note:- included page ha

three.js - Get translation from matrix4() -

it may dummy question of three.js developers but, how can translation extracted transformation matrix? actually extracting manually pointing matrix array positions (12, 13, 14). thanks in advance. if want extract translation component matrix, use pattern: var vec = new three.vector3(); vec.setfrommatrixposition( matrix4 ); use matrix4.decompose() if need translation, quaternion , scale components. three.js r.73

SurveyMonkey api Coldfusion issue -

i'm having trouble getting header param "authorization" work correctly using cfhttp , cfhttpparam. the connection working fine... getting out through our proxy that's not issue. the api documentation states "authorization" in header should formatted "authorization:bearer xxxyyyzz". when try add "bearer" space after following error: {"status":3,"errmsg":"expected object or value"} when not add prefix "bearer" @ following error: {"status":1,"errmsg":"invalid \"authorization\" data in request header"} i've tried "bearer xxxyyyzz" , "bearer%20xxxyyyzz" , "bearer xxxyyyzz" same results. any ideas? thanks! code: <cfhttp timeout="2000" url="https://api.surveymonkey.net/v2/surveys/get_survey_list/?api_key=xxxx" proxyserver="proxy.xxxx.com" proxyport="8080&

jelastic - Is it possible to have both Magnolia Public and Author under 1 instance? If so, how? -

Image
is possible have both magnolia public , author under 1 instance in jelastic? if so, how? according request, i'm glad inform you can deploy magnolia public , magnolia author under 1 instance. first step, should deploy primary magnolia application, can find out it's can done in-one-click of appropriate magnolia cms widget @ our marketplace in portal/cms section. you can manage applications , files there using jelastic dashboard , ftp , webdav or ssh access. in case there necessary establish ssh access tomcat instance , perform following: cd /opt/tomcat/webapps/ && cp root.war root2.war after copying finished restart tomcat instance. having reached goal, obtain 2 separate magnolia cms applications. installed files located @ webapps directory after mentioned above actions have 2 contexts according official magnolia documentation, necessary provide changes in corresponding configuration files also, should mentioned copied magnolia application

Using Hierarchy Viewer for Android App Widget -

is possible use hierarchy viewer app widget ? if yes, how? , there tutorial that? have tried using hierarchy viewer ui elemements? followed these instructions yesterday , worked fine me. to run hierarchy viewer, can follow these steps: connect device or launch emulator. preserve security, hierarchy viewer can connect devices running developer version of android system. if have not done already, install application want work with. run application, , ensure ui visible. from terminal (command prompt), launch hierarchyviewer /tools/ directory. the first window see displays list of devices , emulators. expand list of activity objects device or emulator, click arrow on left. displays list of activity objects ui visible on device or emulator. objects listed android component name. list includes both application activity , system activity objects. screenshot of window appears in figure 1. select name of activity list. can @ view hierarchy using view hier

python - Scrapy shell doesn't work -

i new scrapy, want try scrapy shell debug , learn, it's strange shell command doesn't work @ all. it seems website crawled, nothing has been printed more. program pending, seems dead, must use ctrl-c end it. can figure out what's wrong? i'm using anaconda + scrapy 1.0.3 $ ping 135.251.157.2 pinging 135.251.157.2 32 bytes of data: reply 135.251.157.2: bytes=32 time=13ms ttl=56 reply 135.251.157.2: bytes=32 time=14ms ttl=56 reply 135.251.157.2: bytes=32 time=14ms ttl=56 reply 135.251.157.2: bytes=32 time=14ms ttl=56 ping statistics 135.251.157.2: packets: sent = 4, received = 4, lost = 0 (0% loss), approximate round trip times in milli-seconds: minimum = 13ms, maximum = 14ms, average = 13ms $ scrapy shell "http://135.251.157.2/" 2016-01-28 21:35:18 [scrapy] info: scrapy 1.0.3 started (bot: demo) 2016-01-28 21:35:18 [scrapy] info: optional features available: ssl, http11, boto 2016-01-28 21:35:18 [scrapy] info: overridden settings: {'

winforms - c# create a popup without using Form -

i have seen other apps this, can't figure out how done. have form , clicking button shows form, appears 2 on task bar. i want "popup" not task bar thing (as has user repercussions). can make popup part of first form. realise can add panel form , bring front, want popup outside app's form. how do this? your form has property called showintaskbar if set false in popup form, taskbar shows 1 window. msdn article

javascript - add class (current) on menu item if It has particular url -

i've have wordpress multisite. need add class ( current ) on menu item if tt has url: www.mysite.com/clients i tried code doesn't work: jquery(document).ready(function($){ var url = $(location).attr('protocol')+"//"+$(location).attr('host')+"/clients/"; $('li a[href="'+url+'"]').addclass('current_page_item'); }); since try modify html, should include html in post. this wild guess i'm guessing solution: $('a[href="'+url+'"]').addclass('current_page_item');

javascript - edit array elements and capitalize the letters -

i have array var myarr = [ "color - black", "color - blue", "color - red" ] i want replace " - " ":" , capitalize first letter var myarr = [ "color: black", "color: blue", "color: red" ] i try don't know how capitalize first letter for(var i=0; < myarr.length; i++) { myarr[i] = myarr[i].replace(/ - /g, ":"); } try this: var myarr = [ "color - black", "color - blue", "color - red" ] for(var i=0; < myarr.length; i++) { myarr[i] = myarr[i][0].touppercase() + myarr[i].replace(/ -/g, ":").substring(1); } console.log(myarr);

c# - EF7 - How to get values from DbSet before change -

i try value of entity stored in dbset before changed code , before saved. however, when try linq single statement changed value. i'm using ef7. here's code: dbset<entity> dbset = context.dbset; entity ent = dbset.single(x => x.id == id); ent.firstname = "new name"; entity entitybeforechange = dbset.single(x => x.id == id); //here want entity old values, if that's important need read without modifying instance context.savechanges(); hope clear enough , can help you can detach entity context. keep in mind you'll have pull context before update other, attached entity. dbset<entity> dbset = context.dbset; entity ent = dbset.single(x => x.id == id); entity entitybeforechange = dbset.single(x => x.id == id); context.entry(entitybeforechange).state = entitystate.detached; // severs connection context ent.firstname = "new name"; context.savechanges();

why can not run go function in go? -

this question has answer here: why fmt.println inside goroutine not print line? 5 answers this below code: func main() { values := []int{1, 2, 3, 4} _, v := range values { go func(x int) { fmt.println(x) }(v) } } if code have not go keyword, print 1, 2, 3, 4 . but can not print code now, why? go version: 1.5.2 darwin/amd64 short: place wait @ end , print. better option: communicate termination via channels. long: go program lives long main goroutine lives. when go somefunc() , it's not started immediately, somefunc() gets scheduled . in case schedule goroutines , quit – , there's no reason scheduler run other goroutines.

c++ - Defining operators using lambda functions -

consider example: struct { int val; a(int val) : val(val){}; operator+(const a& a1) { return (+[](const a& a1, const a& a2) -> { return a(a1.val + a2.val); })(*this, a1); }; }; int main(int argc, char* argv[]) { a(14); b(12); auto c = + b; return 0; } i have 2 questions: will compiler optimize-out use of lambda in case (which wrapper operator+ or there overhead? is there simpler syntax writing operators using lambda functions? some parts of code seem pointless. go through them , strip them out one-by-one. a operator+(const a& a1) { return (+[](const a& a1, const a& a2) -> { return a(a1.val + a2.val); })(*this, a1); }; first, +[] decays needlessly function pointer. can nothing useful here, except possibly confuse optimizer. can rid of () s: a operator+(const a& a1) { return [](const a& a1, const a& a2) -> { return a(a1.v

Binary to ASCII in Python -

i'm trying decode binary located in .txt file, i'm stuck. don't see possibilities can go around. def code(): testestest ascii = {'01000001':'a', ...} binary = {'a':'01000001', ...} print (ascii, binary) def encode(): pass def decode(code,n): f = open(code, mode='rb') # open file filename <code> while true: chunk = f.read(n) # read n characters @ time open file if chunk == '': # 1 way check end of file in python break if chunk != '\n': # process it???? pass how can take binary in .txt file , output ascii? from example, input looks string of binary formatted number. if so, don't need dictionnary that: def byte_to_char(input): return chr(int(input, base=2)) using data gave in comments, have split binary string bytes. input ='01010100011010000110100101110011001000000110100101110011001000000

c# - Play Videos in ASP.NET MVC using Custom Action Filter -

i want video using custom action filter below code find working not able pass strvideofilepath variable.this videocustomdataresult.cs code public override void executeresult(controllercontext context) { var strvideofilepath = hostingenvironment.mappath("~/videofiles/test2.mp4"); context.httpcontext.response.addheader("content-disposition", "attachment; filename=test2.mp4"); var objfile = new fileinfo(strvideofilepath); var stream = objfile.openread(); var objbytes = new byte[stream.length]; stream.read(objbytes, 0, (int)objfile.length); context.httpcontext.response.binarywrite(objbytes); } here calling as public actionresult index() { return new videodataresult(fileurl); } can tell me how pass video source variable razor view.

Modify column before inserting XML value to MySQL table -

i'm trying import xml file mysql table. in xml file there timestamp in <currenttime> in following format: 2016-01-26t09:52:19.3420655+01:00 this timstamp should go corresponding datetime currenttime column in table. did following load xml infile 'xxx.xml' table test.events rows identified '<event>' set currenttime = str_to_date(currenttime, '%y-%m-%dt%h:%i:%s.%f'); but quits error error code: 1292. incorrect datetime value: '2016-01-25t16:22:24.1840792+01:00' column 'currenttime' @ row 1 so seems doesn't convert string @ all. why? i think error thrown when string value file loaded directly column. error thrown before set clause. here's abbreviated example of how use user-defined variables pass value of field down set , bypassing assignment column. note columns _row , account_number populated directly first 2 fields in file. later fields in file assigned user-defined variables (iden

Find concatenate words in Elasticsearch -

say have indexed data song:{ title:"laser game" } but user searching lasergame how go mapping/indexing/querying this? this kind of tricky problem. 1) guess effective way might use compound token filter , word list made of words think user might concatenate. "settings": { "analysis": { "analyzer": { "concatenate_split": { "type": "custom", "tokenizer": "standard", "filter": [ "lowercase", "myfilter" ] } }, "filter": { "myfilter": { "type": "dictionary_decompounder", "word_list": [ "laser", "game", "lean", "on", "die", "hard"

javascript - How to stop event propagation when eventListener attached to same elements in IE 8? -

how can stop executing other event handlers with pure javascript in case if attached same element in ie8? i can stop event propagation event.stopimmediatepropagation method, it's not supported ie8 . // document.getelementbyid('my-elem').attachevent('click', firsthandler); document.getelementbyid('my-elem').addeventlistener('click', firsthandler); // document.getelementbyid('my-elem').attachevent('click', secondhandler); document.getelementbyid('my-elem').addeventlistener('click', secondhandler); function firsthandler(ev){ ev.stoppropagation(); alert('1'); } function secondhandler(ev){ ev.stoppropagation(); alert('2'); } <div id="my-elem"> how stop propagation ? </div> a simplified (and error prone) polyfill/shim. capture original attachevent/detachevent methods, , create new ones check flag. also prevent events attach