Posts

Showing posts from March, 2015

php - Language locale does not change with App::setLocale but updates on Session::put() in laravel 5.2 -

am working on multi-lingual support laravel app, materials have seen online passing locale app facade , calling setlocale method translates website, have tried no luck. in routes file, have this route::group(['middleware' => ['web']], function () { route::get('change-locale', ['uses' => 'homecontroller@changelocale', 'as' => 'locale.change']); }); homecontroller@changelocale have... namespace gudaapp\http\controllers; use illuminate\http\request; use gudaapp\http\requests; use gudaapp\http\controllers\controller; class homecontroller extends controller { public function changelocale(request $request) { if(empty($request->locale)) { redirect()->back()->withmessage('unknown locale, please, if problem persists, contact admin.'); } session()->put('locale', $request->locale); return redirect()->back()->withmessage('your locale has been changed <b>'.$...

android - Gradle use RES dir from outside location -

how can set in gradle file use whole res dir specific location? using android studio 1.5.1 , gradle 0.4.0 experimental. is there official documentation gradle experimental plugins? have found this: http://tools.android.com/tech-docs/new-build-system/gradle-experimental#toc-multiple-ndk-projects is there documentation more complete , contains more info? you should use somenthing that: android.sources { main { manifest.source { srcdir 'folder' include 'androidmanifest.xml' } resources.source.srcdir 'folder/res' java.source.srcdir 'folder/src' } }

search - Solr: One word query does not match three word indexed value -

one of documents has title attribute value poésie pour pouvoir . when query q=title:poesie , no results found. q=title:poesie pour finds document, though. title of type text . excerpt schema.xml: <fieldtype name="text" class="solr.textfield" positionincrementgap="100"> <analyzer type="index"> <tokenizer class="solr.whitespacetokenizerfactory"/> <filter class="solr.asciifoldingfilterfactory" /> <filter class="solr.stopfilterfactory" ignorecase="true" words="stopwords.txt"/> <filter class="solr.worddelimiterfilterfactory" generatewordparts="1" generatenumberparts="1" catenatewords="1" catenatenumbers="1" catenateall="0" splitoncasechange="1"/> <filter class="solr.lowercasefilterfactory"/> <filter cl...

php - How to apply multy word search in mysql -

i need points on how make php script not 1 word or multiple ( john doe ). script find 1st word "john" pointed table. here script: $query = $_get['query']; $min_length = 1; if (strlen($query) >= $min_length) { $query = htmlspecialchars($query); $query = mysql_real_escape_string($query); $raw_results = mysql_query( "select * filmi (`title` '%".$query."%') or (`description` '%".$query."%') or (`nomer` '%".$query."%')" ) or die(mysql_error()); if (mysql_num_rows($raw_results) > 0) { while ($results = mysql_fetch_array($raw_results)) { echo " print results "; } } else { echo "no results"; } } else { echo "minimum length " . $min_length; } use code, have added new line. this added wild cards % in place of space modify existing qu...

ios - How to change TabBar items Navigation Title -

i'm facing problem ! have been struggling days ! problem i'm not able change title of navigation in tabbar items. first i'm pushing uitabbarviewcontroller app delegate if user signed in. let currentuser = pfuser.currentuser() if currentuser != nil { let mainstoryboardipad : uistoryboard = uistoryboard(name: "main", bundle: nil) let homeview : uiviewcontroller = mainstoryboardipad.instantiateviewcontrollerwithidentifier("4") let navigationcontroller = application.windows[0].rootviewcontroller as! uinavigationcontroller navigationcontroller.pushviewcontroller(homeview, animated: false) } else { } then in first item viewcontroller i'm using change titleview image example. let logo = uiimage(named: "logo.png") let imageview = uiimageview(image:logo) self.navigationcontroller!.topviewcontroller!.navigationitem.titleview = imageview and in second item viewco...

html - Table column fixed width -

i'm having problems setting fixed width table columns. have @ jsfiddle example: http://jsfiddle.net/stylock/jj6dk/ the middle column should 300px wide, , left column should 80px wide, reason 3 columns same width. knows how fix that? remove css style of table , should work: table-layout: fixed; demo: http://jsfiddle.net/jj6dk/6/ when set table-layout: fixed table take these algorithms: the horizontal layout depends on table's width , width of columns, not contents of cells allows browser lay out table faster automatic table layout the browser can begin display table once first row has been received

scatter plot - Add pair lines in R -

Image
i have data measured pair-wise ( e.g. 1c, 1m, 2c , 2m), have plotted separately (as c , m). however, add line between each pair ( e.g. line point 1 in c column point 1 in m 'column'). a small section of entire dataset: pairnumber type m 1 m 0.117133 2 m 0.054298837 3 m 0.039734 4 m 0.069247069 5 m 0.043053957 1 c 0.051086898 2 c 0.075519 3 c 0.065834198 4 c 0.084632915 5 c 0.054254946 i have generated below picture using following tiny r snippet: boxplot(test$m ~ test$type) stripchart(test$m ~ test$type, vertical = true, method="jitter", add = true, col = 'blue') current plot: i know command or function need achieve (a rough sketch of desired result, of lines, presented below). desired plot: alternatively , doing ggplot fine me, have following alternative ggplot code produce plot similar first 1 above: ggplot(,aes(x=test$type, y=test$m)) + geom_boxplot(outlier.shape=na) + geom_jitter(po...

javascript - ExtJS 6 access messageProperty in store sync's callback -

i want display message server in ui after synchronizing extjs grid. here's excerpt of how goes: this.store.sync({ callback: function (records, operation, success) { // messageproperty accessing code }, success: function (batch, options) { // messageproperty accessing code }, failure: function (batch, options) { } }); here's piece of store definition: proxy: { headers: { 'accept': 'application/json' }, limitparam: undefined, pageparam: undefined, startparam: undefined, paramsasjson: false, type: 'ajax', // ... reader: { type: 'json', rootproperty: 'data', messageproperty: 'message' }, // ... }, here's data comes server (omitted data inside array: { "data":[ ], "message":"success!" } the application doesn't seem have issues reading da...

asp.net mvc - EntityFramework Code first migrations not running after deploying to Azure -

Image
i'm developing web application in asp.net using code first migrations. works fine locally after deploying azure, code first migrations not executed. have been following this tutorial step step few times have not been able spot wrong on setup. here relevant code: db context: public class applicationdbcontext : identitydbcontext<applicationuser> { public applicationdbcontext() : base("defaultconnection", throwifv1schema: false) {} public dbset<bc_instance> biocloudinstances { get; set; } static applicationdbcontext() {} public static applicationdbcontext create() { return new applicationdbcontext(); } protected override void onmodelcreating(dbmodelbuilder modelbuilder) { base.onmodelcreating(modelbuilder); var conv = new attributetotableannotationconvention<softdeleteattribute, string>( "softdeletecolumnname", (type, attributes) => attributes.single().co...

node.js - Inserting objects in MongoDB to field that can reference two different objects -

in project have messages model looks this: var messageschema = new schema({ fromid: { type: entityid, required: true }, toid: { type: entityid, required: true }, important: { type: boolean, required: false }, lessonid: { type: schema.types.objectid, ref: models.lesson, required: false }, memberid: { type: schema.types.objectid, ref: models.lesson, required: false }, message: { type: string, required: true }}); as long message can sent , received either user , school i've created complex type 'entityid' looks this: var entityid = { id: { type: schema.types.objectid, required: true }, entityname: { type: string, required: true, enum: entitytypelist.array }}; and i'm putting 'type' in fields fromid , toid in messageschema (as shown above). now, when try insert entities one: samplemessage1: { _id:"560e9504cac9a42f0e415bca", memberid: "5631f6883ad9...

Word Counter In python -

i have tried create word counter in python, code fails run. word = input("enter word or sentence") input("your word/ sentence has"+ len(word) + " letters") could please me fix problem? the current result typeerror: can't convert "int" object str implicity you try below code: word = input("enter word or sentence") input("your word/ sentence has"+ str(len(word)) + " letters") here, i'm using str(len(word)) instead of len(word) . because len(word) returns number , it's int object. and you're doing str_object + int_object , , python doesn't understand want do. let's see: >>> len('foobar') 6 >>> type(len('foobar')) <class 'int'> >>> len('foobar') + 'foobar' traceback (most recent call last): file "<input>", line 1, in <module> typeerror: unsupported operand type(s) +: ...

javascript - How to select Just 1 Row from a Table using Jquery -

Image
i have created table display multiple records..i want add update functionality using ajax.. i have written following code, when click on row make rows editable..i want edit specific row in clicked. kindly guide me how achieve this. <button type="button" class="updateuser btn btn-primary btn-xs" data-userid="<?php echo $id; ?>"> <span class="glyphicon glyphicon-pencil"></span> </button> $(document).on("click", ".updateuser", function(){ $('tr td:nth-child(2)').each(function () { var html = $(this).html(); var input = $('<input type="text" />'); input.val(html); $(this).html(input); }); }); edit - html code <table class="table table-hover"> <thead> <tr> <th>...

android - I am unable to make text selectable in edittext. When user tap the text for long it gets selected, I don't want text to get selected or highlighted -

android:cursorvisible="false" android:focusableintouchmode="false" android:focusable="false" android:selectallonfocus="false" android:longclickable="false" android:textisselectable="false" i have applied these constraints on edittext, working fine, problem when user tap long text gets selected. as darko has answered on similar question: "you can return true in onlongclick listener onlongclick method? means have consumed event , wont passed further along." the onlongclick listener should added in java activity.

mysql count last_column_data not working -

i have table name: serial id name date ---- -------- ----------- 1 george 2013-07-24 2 john 2013-07-24 3 thomas 2013-07-25 4 james 2013-07-31 5 andrew 2013-07-20 6 martin 2013-07-24 7 william 2013-07-21 8 zachary 2013-07-25 9 millard 2013-07-31 10 chester 2013-07-24 now need count of last value of column date dynamically, here last value of column date 2013-07-24, count 4. if data insert id#11 date value 2013-07-31,then count 3. have made function this: function countdate(){ $sql = "select count( `id` ) countdate serial `date` = 'last(date)'"; $result = mysql_query($sql); $cd= mysql_fetch_array($result); return $cd['countdate']; } but not working. if put dir...

c - Why local array value isn't destroyed in function? -

void func(){ int i; char str[100]; strcat(str, "aa"); printf("%s\n", str); } int main(){ func(); func(); func(); return 0; } this code prints: ?@aa ?@aaaa ?@aaaaaa i don't understand why trash value(?@) created, , why "aa" continuously appended. theoretically local values should destroyed upon function termination. code doesn't. to use strcat() need have valid string, uninitialized array of char not valid string. to make valid " empty " string, need this char str[100] = {0}; this creates empty string because contains null terminator. be careful when using strcat() . if intend 2 concatenate valid c strings it's ok, if more 2 it's not right function because way wroks. also, if want code work, declare array in main() instead , pass function, this void func(char *str) { strcat(str, "aa"); printf("%s\n", str); } int main() { ch...

python - Factory Boy subfactory over 'self' -

does know how create factory in factoryboy based on models.py class halte(models.model): koppel_halte1 = models.foreignkey('self', related_name='koppel_haltea', verbose_name="koppel halte", help_text="geef hier een gekoppelde halte aan", null=true, blank=true) koppel_halte2 = models.foreignkey('self', related_name='koppel_halteb', verbose_name="koppel halte", help_text="geef hier een gekoppelde halte aan", null=true, blank=true) notice 'self'? (and yes type of relation necesarry.) i have tried several things in factoryboy (subfactory, relatedfactory, selfatribute, postgeneration) can't work. one of attempts in fact...

excel - COUNTIF with multiple criteria and list -

Image
i need count number of cells in 'criteria 1' satisfied, 'criteria 2' satisfied , 'criteria 3' falls within set of values contained in column e. i using following formula: =sum(countifs(a2:a11,"true",b2:b11,"true",c2:c11,{"2","4","6","9","10"})) but in real table, list of data within 'criteria 3' longer , more complicated , prefer reference cells in column e rather specific data, i.e. like: =sum(countifs(a2:a11,"true",b2:b11,"true",c2:c11,{"e2:e6"})) please note data contained in example different data in real table. real table considerably longer , more complex table. any suggestions? decided put comment answer can show picture works: you close. range array no need {""} wrapper just use: =sum(countifs(a2:a11,"true",b2:b11,"true",c2:c11,e2:e6)) this array formula , must confirmed ctrl-shift-...

meta regression and bubble plot with metafor package in R -

i working on meta-regression on association of year , medication prevalence 'metafor' package. the model used 'rma.glmm' mixed-effect model logit transformed 'metafor' package. my r script below: dat<-escalc(xi=a, ni=sample, measure="plo") print(dat) model_a<-rma.glmm(xi=a, ni=sample, measure="plo", mods=~year) print(model_a) i did significant results performed bubble plot model. found there no way perform bubble plot straight away 'ram.glmm' formula. did alternatively: wi<-1/dat$vi plot(year, transf.ilogit(dat$yi), cex=wi) apparently got 'crazy' results, questions are: 1> how weight points in bubble plot study sample size? points in bubble plot should proportionate study weight. here, used 'wi<-dat$vi'. vi stands sampling variance, got 'escalc()'. doesn't seem right. 2> model correct investigate association between year , medication prevalence? tried 'rma' mode...

Deferred implementation for jQuery Ajax global handlers -

according jquery documentation, global ajax event handlers must implemented using callback functions on document. otherwise, local $.ajax() implement events using promises . is there way of handling global ajax events using promises method, .done() , .fail() , .always() , .then() ? i'm looking way declaring event handlers global ajax events not depend on $(document) , example: // current way of doing this: // $(document).ajaxsuccess(_handleajaxsuccess); // // ideas of like: // $.ajaxsuccess(_handleajaxsuccess); // $.ajax.done(_handleajaxsuccess); // $.ajaxsetup({ done: _handleajaxsuccess }); no, cannot handle global ajax events using promises method .done() , .fail() , .always() , .then() . those promise methods, therefore promise needs exist before before become available. by definition, jquery's global ajax event handlers not attached particular promise @ point defined. instead, stored jquery , invoked internally whenever ajax events occur. as ...

c++ - Initializer for static member on template not always called in statically linked library -

i have template class intended enum string conversion. it's based on this solution automatically initializing static variables. full class follows: template <typename labeltype> class enumhelper { public: static const char* tostring(labeltype label) { return enumbimap_.left.at(label); } static labeltype toenum(const char* name) { return enumbimap_.right.at(name); } static bool isinitialized() { return initialized_; } private: typedef boost::bimap<labeltype, const char*> enumbimap; enumhelper() = delete; enumhelper(const enumhelper&) = delete; static void init(int numlabels, const char* names[]) { (int = 0; < numlabels; i++) { enumbimap_.insert(enumbimap::value_type((labeltype)i, names[i])); } initialized_ = true; } class initializer { public: initializer(); }; static enumbimap enumbimap_; static bool initia...

ios - How do I replace a changing array with another value? -

i have date array contains current day plus 10 days, , importing array database. have animal name array. based on imported want place animal name in filtered array in filtered array. example: date array: `[9, 10, 11, 12, 13, 14, 15, 16, 17, 18]` imported date array db: [9, 12, 14, 18] imported animal name array db: [dog, cat, tiger, sheep] this want filtered animal name like filtered animal name array: [dog, "", "", cat, "", tiger, "", "", "", sheep] i know code provided wrong, feel approaching incorretly. how should this? for(var j = 0; j < self.arrayofweek.count; j++){ for(var t = 0; t < self.datesfromdb.count; t++){ if(self.date[t] == self.datearray[j]){ self.namefiltered[t] = self.tutorname[j] print("filtered name \(self.namefiltered)") } ...

c# - Application_PreRequestHandlerExecute redirect during 404 page not found -

i trying log referrers several domains own 301 permanent redirect our secure site. have 2 web sites via iis. http://www.cool_domain.com/ redirect https://www.real_domain.com/ example. during process, want log, , redirect during prerequesthandlerexecute method. if page not found (404), application_prerequesthandlerexecute not fire. if exist, fires fine. void application_prerequesthandlerexecute(object sender, eventargs e) { if (context.handler irequiressessionstate || context.handler ireadonlysessionstate) { logpage(request); httpcontext.current.response.redirectpermanent("https://www.real_domain.com/", true); } } how can fire during 404's well? stupid mistake, , should have known... in case else runs this, , has brainfart well, global.asax not execute 404 error unless it's .net page (aspx, etc.).

c# - How To Place Multiple Gantt Chart Bars On Same Row? -

Image
i have gantt chart displays dates of work requests. i've been asked modify gantt chart display days work performed. example, wr #1 begins 2/8/2016 , ends 2/25/2016. however, work performed mon-thur. current gantt chart shows bar 2/8/2016 2/25/2016. break bar displays 2/8-2/11, 2/15-2/18, , 2/22-2/25. display single work request on 1 line. possible use seriescharttype.rangebar this, or have use different chart type? tried create series using multiple datapoint objects same xvalue , when added series chart each datapoint displayed on separate row. doing incorrectly? here code using chart setup: using system.windows.forms.datavisualization.charting; ... series series1 = new series(); series1.chartarea = "default"; series1.charttype = seriescharttype.rangebar; series1.yvaluesperpoint = 2; series1.yvaluetype = chartvaluetype.date; first attempt: // wr #1 datapoint dp0 = new datapoint(0, new double[] { startdate0, stopdate0 }); datapoint dp1 = new datapoint(0, ne...

assembly - How do I get a register to store an offset value in at&t syntax? -

i using write video memory (%es = 0xb800): movw $0x074b,%es:(0x0) however, if want offset in %ax? i tried %es:%ax , or %es:(%ax) , nothing worked, , kept getting errors. what doing wrong? in 16 bit mode limited in usable address forms. can't address using %ax . valid forms are: optionally 1 of bx or bp , plus optionally 1 of si or di , plus optionally constant displacement as such, movw $0x074b, %es:(%di) work, example. see table 2-1. 16-bit addressing forms modr/m byte in official intel® 64 , ia-32 architectures software developer's manual volume 2: instruction set reference, a-z ps: next time show errors got.

sql - How to calculate Sum of 2 Count(*) in Mysql -

i have 2 tables count rows of them. select count(*) docgrados_directores docgrados_directoresleido = '0' , docgrados_directoresusu = '11' result 1 select count(*) docgrados_lectores docgrados_lectoresleido = '0' , docgrados_lectoresusu = '11' result 1 i need total count (result 2). how can sum result single statement? correct syntax?? use select add scalar values returned queries: select (select count(*) docgrados_directores docgrados_directoresleido = '0' , docgrados_directoresusu = '11' ) + (select count(*) docgrados_lectores docgrados_lectoresleido = '0' , docgrados_lectoresusu = '11') the above statement should return 2 result if result of both subqueries 1 .

annotations - What is reverse of @deprecated in java -

this question has answer here: annotating unstable classes/methods javadoc 1 answer so, people use @deprecated annotation apis have been deprecated. is there annotation notifies users if method evolving , not stable? afaik, doesn't exist yet, have create own. jep277 define @deprecated(experimental) , it's proposition.

php - Count the number of times a value appears in a multi-dimensional array -

i have simple multi-dimensional array looks below. trying count how many times each value exists in array (i.e. arthritis => 3). have tried different count php functions returns number , not key => value pair. have looked on similar questions, nothing fits simplicity of array. array(3) { [0]=> array(1) { [0]=> string(0) "arthritis" } [1]=> array(4) { [0]=> string(7) "thyroid" [1]=> string(10) " arthritis" [2]=> string(11) " autoimmune" [3]=> string(7) " cancer" } [2]=> array(6) { [0]=> string(7) "anxiety" [1]=> string(10) " arthritis" [2]=> string(11) " autoimmune" [3]=> string(15) " bone , joint" [4]=> string(7) " cancer" [...

javascript - Adding a new associative element to a JSON object -

i have problem add elements json array. the structure want that: [{"method":"edit","type":"1", "template":"3", "meta":{"title":"tools", "descirption":"tools"}}] the problem add these parameters dynamically. so lets have start: [{"method":"edit","type":"1", "template":"3"}] how can add whole "meta" array , please not push(), because have structure when print it. when use $json = json_decode($json, true); i want have: array( method' => edit, 'type' => 1, 'template' => 3, 'meta' => array('title' => '') ); thanks in advice ! so i'm going assume have json start with. let's decode php (as noted correctly) $json = json_decode($json, true); so should have $json['method'] , etc. let's d...

r - Subsetting vectors with extract -

imagine have vector, , want remove specific element. following library(magrittr) foo <- letters[1:10] foo %>% { bar <- . bar %>% extract(bar %>% equals("a") %>% not) } [1] "b" "c" "d" "e" "f" "g" "h" "i" "j" but if i'd more succinct, this: foo %>% extract(. %>% equals("a") %>% not) doesn't work: error in extract(., . %>% equals("a") %>% not) : invalid subscript type 'closure' isn't there more idiomatically magrittr 'y way this? one option pipe foo subsetting function [ , limiting elements not equal using != : foo %>% "["(. != "a") # [1] "b" "c" "d" "e" "f" "g" "h" "i" "j" the magrittr package...

sql - item is equal to any element in array -

i have table values selected, being checked existence in other query later in procedure. right way of doing this? here how doing now: table smt: s_id | num 1 | 2 1 | 3 2 | 2 table smtable: id | b_id 1 | 2 2 | 3 arr_sid should have: {1,2} declare arr_sid int[]; select s_id arr_sid smt group s_id having sum(num) <> 0; select id val smtable b_id = pid , id = any(arr_sid); i getting error: error: malformed array literal: "1" sql state: 22p02 detail: array value must start "{" or dimension information. just have select statement clause , in clause use in keyword , second select statement: select id val smtable b_id = pid , id in ( select s_id smt group s_id having sum(num) <> 0) there no need arr_sid variable, , further arrays not standard sql, whereas query portable.

capl - Getting a list of all active messages in a CAN Bus -

i'm learning use capl on canoe , need create gateway filters messages between 2 can buses. for first part need create way toggle transmission bus 1 bus 2 , vice versa (already done). then have able select specific message of buses send on other bus. of must don graphically panel , i'm using checkboxes toggle of part 1 , dropdown lists message filter. do know of way list of active (rx/tx) messages in bus last, say, 10 seconds? (i know must use timer call update function) you can subscribe messages bus defining on message event handler. called each message (subject filter condition have specified). can create gateway retransmitting messages using output . for example, graphical panel can set variable my_id id of message want relay bus 1 bus 2. write: on message can1.* { message can2.* msg; if((this.dir == rx) && (this.id == my_id)) { msg = this; output(msg); } } the additional condition this.dir == rx necessary if want ...

html - Selenium: Test if text is fully visible -

is there way check selenium if text visible? let's have text lorum ipsum dolor sit amet and due bad css reads lorem ips on page, rest under wrongly placed div. there way assert full text visible? here's simple example using jsfiddle created , java/selenium. the html <p id="1">lorum ipsum dolor sit amet</p> <p id="2">lorum ipsum <div style="display:none">dolor sit amet</div></p> the code string expectedstring = "lorum ipsum dolor sit amet"; webdriver driver = new firefoxdriver(); driver.get("https://jsfiddle.net/jeffc/t7scm8tg/1/"); driver.switchto().frame("result"); string actual1 = driver.findelement(by.id("1")).gettext().trim(); string actual2 = driver.findelement(by.id("2")).gettext().trim(); system.out.println("actual1: " + actual1); system.out.println("actual2: " + actual2); system.out.println("pas...

vba - List folders in directory, with update function -

im trying list of folders in directory. , have button enables update, on list, without re-creating every time. listing new folder not in excel sheet. this code have working. able search sheet if folder there, if skip it, if not add it. once update completed filter name in column c sub folder_names_including_subfolder() application.screenupdating = false dim fldpath dim fso object, j long, folder1 object if activesheet.name = "test" fldpath = "z:\\" elseif activesheet.name = "test1" fldpath = "y:\\" end if cells(3, 1).value = fldpath cells(4, 1).value = "path" cells(4, 2).value = "dir" cells(4, 3).value = "name" cells(4, 4).value = "folder size" cells(4, 5).value = "date created" cells(4, 6).value = "date last modified" cells(4, 7).value = "codec" set fso = createobject("scripting.filesystemobject") set folder1 = fso.getfolder(fldpath) get_sub_folder fo...

spring - How to checkin interceptor whether a controller triggered a redirect -

in spring mvc project added interceptor class, check, whether redirect has been triggered. here controller-class: @controller public class redirecttestercontroller { @requestmapping (value="/page1") public string showpage1(){ return "page1"; } @requestmapping (value="/submit1") public string submitpage1(){ return "redirect:/page2"; } @requestmapping (value="/page2") public string showpage2(){ return "page2"; } } so if call e.g. localhost:8080/mycontext/submit1 the method "submitpage1" executed. now - server tells client, call localhost:8080/mycontext/page2 which working. so - want step process, after method "submitpage1"has been executed. in mind there should order/command in httpresponse, ask. to check that, made breakpoint in interceptor class in method: "posthandle" - bit since then, have no idea...

java - Output on buffer write using serial monitor of arduino -

i trying send data serial monitor of arduino , make led on , of can't yet problem in code kindly check here arduino code int led = 12; // led connected digital pin 13 int pts = 2; // powertail switch 2 connected digital pin 2 int recv = 0; // byte received on serial port void setup() { // initialize onboard led (led), powertail (pts) , serial port pinmode(led, output); pinmode(pts, output); digitalwrite(led,low); serial.begin(9600); } void loop() { // if serial port available, read incoming bytes if (serial.available() > 0) { recv = serial.read(); // if 'y' (decimal 121) received, turn led/powertail on // other 121 received, turn led/powertail off if (recv == 121){ digitalwrite(led, high); digitalwrite(pts,low); } else { digitalwrite(led, low); digitalwrite(pts,high); } // confirm values received in serial monitor window serial.print("--arduino received: "); serial.println(recv); } } here java code import java.awt.borderl...

java - no suitable HttpMessageConverter found for response type [class com.avada.rest.UsersController$Users] -

i getting following exception , not sure why... exception in thread "main" org.springframework.web.client.restclientexception: not extract response: no suitable httpmessageconverter found response type [class com.avada.rest.userscontroller$users] , content type [application/json;charset=utf-8] @ org.springframework.web.client.httpmessageconverterextractor.extractdata(httpmessageconverterextractor.java:109) @ org.springframework.web.client.resttemplate.doexecute(resttemplate.java:576) @ org.springframework.web.client.resttemplate.execute(resttemplate.java:529) @ org.springframework.web.client.resttemplate.getforobject(resttemplate.java:236) @ com.avada.rest.userstest.main(userstest.java:18) this restcontroller: @restcontroller @requestmapping("/users") public class userscontroller { @requestmapping(method = requestmethod.get) public users getusers() { users users = new users(); users.setusers(con...

python - Seaborn FacetGrid barplots and hue -

Image
i have dataframe following structure: interval segment variable value 4 02:00:00 night weekdays 154.866667 5 02:30:00 night weekdays 100.666667 6 03:00:00 night weekdays 75.400000 7 03:30:00 night weekdays 56.533333 8 04:00:00 night weekdays 55.000000 9 04:30:00 night weekends 53.733333 10 05:00:00 night weekends 81.200000 11 05:30:00 night weekends 125.933333 14 07:00:00 morning weekdays 447.200000 15 07:30:00 morning weekends 545.200000 16 08:00:00 morning weekends 668.733333 17 08:30:00 morning weekends 751.333333 18 09:00:00 morning weekdays 793.800000 19 09:30:00 morning weekdays 781.125000 23 11:30:00 noon weekdays 776.375000 24 12:00:00 noon weekdays 741.812500 25 12:30:00 noon weekends 723.000000 26 13:00:00 noon weekends 734.562500 27 13:30:00 noon weekends 763.882353 28 14:00:00 aftern...

Looking for Java EE Version installed with Eclipse -

i relatively new java development. have couple of questions: 1. how know version of eclipse java ee installation? 2. how upgrade newer version java ee 7. regards, janet t. your eclipse config file should indicate java version eclipse running on. specified '-vm' tag, indicates directory eclipse using java.exe file. to upgrade newer version, can download oracle website , point '-vm' directory installed downloaded version. can have multiple java versions installed on machine. 1 specified in java_home system properties 1 used build jars if building command line.

ssl - BizTalk WCF-BasicHttp Adapter does not allow Empty string for Service Certificate Props -

i'm trying find answer why wcf-basichttp, wcf-wshttp based receive locations or send ports not allow null or empty string service certificate prop (if choose transport type security certificate)? is bug or there way it. as per ms doc default value empty string. how configure wcf-wshttp send port i have once ssl cert have use client. that's because when select transport type security certificate telling use certificates both authenticate , server connecting too. you should able obtain certificate need service certificate browsing web service , using browser copy certificate file , installing other people store in local machine location , putting thumbprint servicecertificate setting. if not work, owners of service send public cert. in fact use service client certificate authentication, have send public certificate owner of web service. if service not have ssl/tsl certificate cannot use security transport transport layer not secure.

php - what is $this->load->view() in CodeIgniter -

$this use current class , view method load . property? is example correct? class super{ public $property; public function superf1() { echo "hello"; } public function col() { $this->superf1(); } $this->property->super1(); } yes, load property. think of this: class loader { public function view() { //code... } } class myclass { private $load; public __constructor() { $this->load = new loader(); } public somemethod() { $this->load->view(); } } this syntax called chaining.

javascript - $watch a variable for change angularjs -

i'm new complex angular directives. have variable in rootscope called $root.page . have set watch so: $scope.$watch( "$root.page", function handlechange( newvalue, oldvalue ) { //show select page on page change console.log(oldvalue, newvalue); if (!oldvalue || oldvalue !== newvalue) { $scope.showselectonly = true; } } ); the way code structured, $scope.showselectonly true. want $scope.showselectonly true when there change $root.page , want false in other cases (i.e. when there no change $root.page variable). i don't think need watch case. might want using angular value instead. have access angular value in entire angular module app. that, can update showselectonly when page changed. angular.module('myapp', []) .value('page', true) .value('showselectonly', true); you can inject page controller in module, , update both values needed. angular.module('myapp') .controller('...

curl - Is it possible to execute stdout with cscript? -

i'm trying execute code remote repository directly on command line single command. i'm using codepile ( https://www.codepile.net ) allows raw file access code snippets. vbscript files, right can following: curl -s http://raw.codepile.net/pile/al9bowz9.vbs > localscript.vbs cscript localscript.vbs del localscript.vbs as way of running remote code once , not leaving on pc. hoping do: curl -s http://raw.codepile.net/pile/al9bowz9.vbs | cscript but doesn't work. error "failed writing body". can pipe curl stdout "| print" , see contents of remote file printed in console. is there way in windows? i've seen examples showing syntax: cscript <(curl -s http://raw.codepile.net/pile/al9bowz9.vbs) but doesn't seem work (the system cannot find file specified) also, pipe syntax i'd use work other languages (like python instance): curl -s http://raw.codepile.net/pile/nj4qboy8.py | python does print "hello world" consol...

PHP/Wordpress: how to amend foreach() to output my array in a specific way -

major edit: reframing question might easier solve... i trying generate json microdata using php code in wordpress. i'm using foreach() method cycle through list of posts on page, put thumbnail, title , link data array, , i'll later encode array json microdata. however, array i've assembled using foreach() doesn't output data how want. i've spent hours trying section of data output correctly, no avail. -- what want achieve (using print_r() view , test php code) - e.g. instead of index numbers [0] . [1] etc., want each array output [associatedmedia] instead below: array ( [associatedmedia] => array ( [image] => http://www.website.com/thumbnail.jpg [name] => post title [url] => http://www.website.com/the-post ) [associatedmedia] => array ( [image] => http://www.website.com/second-thumbnail.jpg [name] => second post title [url] =...

entity framework - Allow exception when inserting record with or check and short circuit first? -

for httppost operation object being inserted has alternate key, considered best option handling database conflict when inserting? should check if entity exists first , return error code there conflict if (reportingcontext.reports.any(r => r.reportid == report.reportid)) { return new httpstatuscoderesult(statuscodes.status409conflict); } should allow operation go through, allowing successful addition database if there no conflict, or exception thrown if there conflict? what worse? 2 calls database, 1 check if entity exists , second insert new entity... or overhead of creating new entity in memory , assigning properties, have exception out because there conflict? burden on database vs needless burden on server?

append element of list using python -

this question has answer here: how avoid having class data shared among instances? 7 answers i want append element single object in list, object appends elements of list. class a: list_of_b=[] class b: name = "" list_a = [a() in range(3)] list_b = [b() j in range(7)] list_b[0] = "1" list_b[1] = "2" list_b[2] = "3" list_a[2].list_of_b.append(list_b[1]) my problem element list_b[1] appends element in list_a not element lista_a[2]. list_of_b class variable, change instance variable class a: def __init__(self): self.list_of_b = []

php - Remove file extensions using .htaccess (Apache2) -

i have tried bunch of different ways , getting frustrated options -indexes options +multiviews rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename}\.php -f rewriterule ^(.*)$ $1.php ^ doesn't work @ all options -indexes options +multiviews <ifmodule mod_rewrite.c> rewriteengine on rewritebase / # unless directory, remove trailing slash rewritecond %{request_filename} !-d rewriterule ^([^/]+)/$ http://squeakcode.com/$1 [r=301,l] # redirect external .php requests extensionless url rewritecond %{request_method} !post rewritecond %{the_request} ^(.+)\.php([#?][^\ ]*)?\ http/ rewriterule ^(.+)\.php$ http://squeakcode.com/$1 [r=301,l] # resolve .php file extensionless php urls rewriterule ^([^/.]+)$ $1.php [l] </ifmodule> ^works goes page doesn't exist. as mentioned second code snippet works sort of. problem removes .php doesn't pull .php file goes not found page. am missing in apache config?