Posts

Showing posts from March, 2012

swift - How do I get a UITextField input as an Integer -

i uitextfield input integer? tried int(uitextfield input) , throws error. tried making variable same value, did not work. if define -> @iboutlet weak var textfield: uitextfield! can use (textfield.text! nsstring).intvalue or int(textfield.text!) . must use exclamation mark. but define -> let textfield = uitextfield() textfield.text = "007" you don't need use exclamation mark edit: (textfield.text! nsstring).intvalue int32 format, can normal int format -> int((textfield.text! nsstring).intvalue)

mysql - Parse error: syntax error, unexpected '$query' (T_VARIABLE) in /home/****/public_html/get_data_id.php on line 4 -

this question has answer here: php parse/syntax errors; , how solve them? 12 answers im having problem did research , common problem lack of semi colon sure there's nothing wrong in code please check out. <?php require 'connection.php';   $query = "select id `account_info`";   $res = mysqli_query($connect,$query);   $result = array();   while($row = mysqli_fetch_array($res)){ array_push($result, array('id'=>$row[0] )); }   echo json_encode(array("result"=>$result));   mysqli_close($connect);   ?> connection.php <?php define('hostname','mysql.hostinger.ph'); define('user','********_mftis'); define('password','********'); define('databasename','u366906409_mftis'); $connect = mysqli_connect(hostname,user,password,databasename); ?>

java - How do I instantiate an unirest HttpResponse<JsonNode> for my mock? -

let's have class called api , has method: public class api{ public httpresponse<jsonnode> request() { try { return unirest.get("http://localhost:8080").header("accept", "application/json").asjson(); } catch (unirestexception e) { throw new runtimeexception(e); } } } and have class: public class dao(){ private api api; public dao(api api){ this.api = api; } public integer test(){ integer result = api.request().getinteger("result"); return result + 100; } } in test want test business logic based on response api.request method returns. something like: import static org.mockito.mockito.mock; import static org.mockito.mockito.stub; import org.json.jsonobject; import com.mashape.unirest.http.httpresponse; public class apitest { private api api = mock(api.class); public void test() { httpresponse<jsonnode>

Reusing a previoulsy used docker container -

if in docker container, can stopped using ctrl+p+q or using exit command after exiting container, how save state can use same container changes still there. if use docker commit save container, hangs. there method use container same state @ exited it? you place source control operations last run listed in dockerfile. but in order make unique command, ensuring gets run each time, wrap docker build in script generates uniquely-numbered mini-script clone operation. this step insert invocation of script dockerfile generated on-the-fly prior build time, such operation must run every time – clone – run statement indeed unique, i.e. run /bin/sh /foo-1234567abc.sh where foo-1234567abc uniquely generated each build (and subsequent executions create foo-26190def.sh ) , contains clone operation, i.e. cd /some/dir && /usr/bin/git clone http://some.git.server/your-repo.git which may infrequently — or never — change. this guarantees docker run clone during each

javascript - how do you set cookies in angular? -

i have angularjs function translate text. entire controller looks this: ntsvapp.controller('ntctrl', function($translate){ var ctrl = this; ctrl.language = 'en'; ctrl.languages = ['en', 'de']; ctrl.updatelanguage = function(){ $translate.use(ctrl.language); }; }); if put $cookies updatelanguage function able set cookies, angular doesn't recognize $translate.use method. if place $cookies inside controller function, doesn't recognize $cookies .put method. if put both cookies , translate in either controller or updatelanguage nothing works. how make writing cookies works withing updatelanguage function? this should work dependency injection, ntsvapp.controller('ntctrl', ['$translate', '$cookies', function($translate, $cookies){ var ctrl = this; ctrl.language = 'en'; ctrl.languages = ['en', 'de']; ctrl.updatelanguage = function(){

html - CSS for first-child is not getting applied -

i need increase height of 1st panel in ng-repeat code <div class="panel panel-default panel-height" ng-repeat="candidateinfo in acandidatedetails"> <div class="panel-heading"> <div class="row"> <div class="col-xs-1"> <a style="cursor:pointer"> {{candidateinfo.name}} </a> </div> </div> <div stop-watch time="xyz" name="candidateinfo.name" time-of-interview="candidateinfo.doi" ></div> </div> here have applied css class .panel-height below .panel-height:first-child { height: 500px; } here css not getting applied , cannot figure out im going wrong . appreciated. add class 'panel-heading' when div satisfies $first , add height class name 'firstchild'. <div class="panel panel-default panel-height" ng-repeat=&

for loop - Extract Part of a text file in BAT -

i capturing m3u file on daily basis wish parse part of file few channels need. for example have renamed m3u test.txt file has following fictional structure: #extinf:0,abc #live link 1 #extinf:0,xyz #live link 2 #extinf:0,uvw #live link 3 i capture line staring "#extinf:0,xyz" , line beneath end output.txt follows: #extinf:0,xyz #live link 2 i know 1 needs use loop bit of noob on area. i this, supposing .m3u file not contain trailing white-spaces in lines preceded #extinf , sample data does: @echo off setlocal enableextensions disabledelayedexpansion rem // define constants here: set "file=%~1" set "header=#extm3u" set "prefix=#extinf" set "match=%~2" set "flag=" /f usebackq^ delims^=^ eol^= %%l in ("%file%") ( if defined flag ( echo(%%l set "flag=" ) /f "delims=:" %%p in ("%%l") ( if "%%p"=="%he

javascript - How to animate cloned element? -

what want looped horizontaly text slider. attempt - when end of text displayed, clone element move right end , play animation cloned element again - can't achieve because reason cloned element don't want animate. this chrome app here jsfiddle . css #elm { width: 100px; height:20px; overflow: auto; overflow-y: hidden; position:absolute; top:10px; left:10px; } #elm::-webkit-scrollbar { width: 0 !important; height: 0 !important; } #elm .inner-elm { position:absolute; white-space: nowrap; } html <div id="elm"> <div class="inner-elm"> 11111111 2222222 333333 4444444</div> </div> js var elm_right = $('#elm').offset().left + $('#elm').outerwidth(); var settings = { duration: 5000, easing: 'linear', step: function() { var this_right = $(this).offset().left + $(this).outerwidth(); // make clone if(!$(this).hasclass('cloned') && ((t

delphi - Connection Closed Gracefully on win server 2012 -

in our company have win app developed xe7 , datasnap. server works fine on win server 2003 when try run on server win server 2012 "connection closed gracefully" error. search stackoverflow , googled it, cannot find solution. can me? thanks

Custom JavaScript function not being called -

i have written custom function image slider not called following code. carousel: { init: function() { // main function run } previous: function() { // function run when want go }, next: function() { // function run when want go forward } } and calling onclick=javascript:previous() following error on console : previous() not defined if carousel top level of object. you need call function previous referring property of object: onclick=carousel.previous()

c - Is it valid to initiate the size part of a VLA in the same sequencepoint as the VLA is declared? -

in post: https://stackoverflow.com/questions/38326930/cannot-read-full-100000-integer-values-from-a-file-in-c the op contains code there lot wrong with, 1 line made me curios, since wasn't able up, disallowing it. this specific line: int n = 100000, arr[n]; is order of declaration , initialization beeing ensured? so here assume might happen n wasn't initialized when arr gets declared, obvisiously not good. but wasn't able find statement regarding in iso/iec 9899 draft @ hand neither stating undefined nor defining it. so assume not defined behavior? or it? and either way, rule beeing applyed result?5 edit: is valid c99, too? in short: code correct. premise wrong. 2 declarations not "in same sequence point". (as sidenote: there cannot in point, between 2 points, points dimensionless). the details: 6.8.2 of standard shows grammar of compound statement basis of every function body: compound-statement: { block-item-listopt

python - Flask-Restless & Marshmallow: 'dict' object has no attribute '_sa_instance_state' -

i'm working on basic crud json rest api using flask-restless, flask-sqlalchemy , marshmallow. i'm experiencing problem using combination of libraries, when enable deserialization using marshmallow. i've extensively googled error, find similar issues when using database relations, i'm not. i've been removing code possible application while still getting same error. following code blocks 1:1 what's running locally. models.py: from flask_sqlalchemy import sqlalchemy db = sqlalchemy() class case(db.model): __tablename__ = 'case' id = db.column(db.integer, primary_key=true) amount = db.column(db.integer, nullable=false) serializers.py: from marshmallow import schema class caseschema(schema): pass # simplicity - nothing works case_schema = caseschema() def case_serializer(instance): return case_schema.dump(instance).data def case_deserializer(data): return case_schema.load(data).data main.py: from flask im

controls - Programming zoom conrol button -

Image
how program zoom control zoom in , zoom out? want zoom text (not picture). possible zooming text? in internet people zooming picture.. not same text.

amp html - Why is mandatory text (CDATA) inside tag 'head > style[amp-boilerplate]' still missing or incorrect? -

though spent several hours in fixing last amp validation error need further assistance in solving following error: the mandatory text (cdata) inside tag 'head > style[amp-boilerplate]' missing or incorrect. as seen on https://con-creat.de/detail-amp/schreiben-kann-jeder.html#development=1 i not understand why error thrown. snippet seen on https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md included , seems formatted. i hope can me. try this: https://cdn.ampproject.org/c/dl.dropboxusercontent.com/u/3094317/index.html has correction per @andrew , several other small changes. also, recommend use <link href='_symbol_.png' rel='shortcut icon'> rather _symbol_ in root directory. google cdn use it. can see, lost when displayed in cdn.

webpack-dev-server vs nodemon -

are there (dis)advantages in using webpack-dev-server on nodemon. have real experience it? used nodemone , know can used in production too. whereas webpack-dev-server suitable dev only. nodemon deamon process whic looks file changes , restarts node application in case of change. if error occurs not able restart in such cases. failure occurs eaddruse address in use. //nodemon fails restart. it basic , cannot bundle modules , files used in project. webpack advanced tool. helps bundle dependencies , library files 1 single file , checks syntax , other errors. creates file on fly. when using react, indispensible tool since allows hot module replacement. same angular 2. if require examples on how use webpack, can provide many examples.

c# - white space in xslt -

Image
i'm trying generate report contains white spaces make content looks good. problem reason number of spaces being fixed or reduced in cases. for example i've got content should this: formatted text but looks this not formatted text and xslt block this: <fo:block white-space-collapse="false" usage-context-of-suppress-at-line-break="ignore"> <xsl:variable name="report_text"> <value> <xsl:value-of select="report_text" /> </value> </xsl:variable> <xsl:value-of select="dataconvertobject:converttoplaintext($report_text)" /> </fo:block> any ideas? suggestions? i found solution, the problem each alphabet font i've chosen in different size i've changed font this: <fo:table-cell column

javascript - Jquery .click() gives me "stack size exceeded" -

what in code gives me error? jquery-2.1.3.min.js:3 uncaught rangeerror: maximum call stack size exceeded html <form id="addphotoform"> <img class="pull-right" src="" width="100px" height="140px"/> <input type="file" id="addphotoinput" name="addphotoinput" style="display: none;"/> </form> js //on click photo $('#addphotoform').on('click', function(){ //check if usrname exist var usrname = $('#usrname').val(); if(usrname){ $('#addphotoinput').trigger('click'); } else{ alert("!"); } }) how can solve error? i'm trying open file dialog when clicking on form. update tried: $('#addphotoinput').click(); to avoid click event handler bound using jquery fired, , still keep event propagation (useful if delegate click event bound too), call

javascript - How to handle spaces in div id in jquery -

i getting id of div external source , in spaces coming in id , how value of id. here div example: <div id="123456abc" class="classname" onclick="javascript:addvalue(aa.value,'33',bb.value,'1000')"></div> <div id="78904 bbc" class="classname1" onclick="javascript:addvalue(aa.value,'55',bb.value,'2000')"></div> i need class name id. here doing: function addvalue(aa, bb) { var classofdiv = $('#123456abc').attr('class'); var classofdivs = $('#8904 bbc').attr('class'); alert(classofdiv); alert(classofdivs); } the first alert working fine second not fetching value. how can handle this? values dynamic. use $("div[id='78904 bbc']") access element has spaces in id, try: var classofdiv = $("div[id='123456abc']").attr('class'); var classofdivs = $("di

android - Click listener on a recylerview itself -

i trying set onclick listener on recyclerview (not items) it's not firing! i have rv inside cardview, if matters! searched internet; nothing helped! xml code: <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content"> <textview android:id="@+id/text_view_entry_status" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textcolor="@color/accent" android:background="@color/green_700" android:paddingtop="2dp" android:paddingbottom="2dp" android:paddingstart="8dp" android:textstyle="bold" android:paddingend="8dp" android:layout_alignparentend="true" tools:text="entry status label text" /> <view android:id="@+id/view_click_interceptor&quo

spark-submit yarn-cluster on azure-hdinsight cannot provide additional jars (like JNR) to my app -

i'm having problems using hdinsight spark cluster application needs 2 jars, the first 1 jnr (com.github.jnr:jnr-constants:0.9.0 exactly) and other 1 jna (net.java.dev.jna:jna:4.1.0) required jruby use. the problem have whenever run app have error : [error] exception java.lang.nosuchmethoderror : jnr.constants.platform.openflags.defined()z and have same problem jna if remove code calls jnr my.process.check.run.checkrun$.main(checkrun.scala:219): [error] exception java.lang.nosuchmethoderror : com.sun.jna.platform.is64bit()z ( is64bit()z functions not available on jna v3.5.1) checked on workers have this: myclusteruser@wn0-test:/$ find . -name '*jna*.jar' 2>/dev/null ./usr/lib/hdinsight-scpnet/scp/jvm/jna-3.5.1.jar ./usr/hdp/2.4.2.0-258/storm/extlib/jna-3.5.1.jar myclusteruser@wn0-test:/$ find . -name '*jnr*.jar' 2>/dev/null myclusteruser@wn0-test:/$ on head have this: myclusteruser@hn0-test:/$ find . -name '*jna*.jar' 2>/dev

javascript - Why is my .change() function inside jquery plugin is not working? -

i trying make simple age calculator. adds age on side of input. calculates age inside input datepicker. .split not clean change date format. i guessing problem problem of scope. what d like, plugin update age on change of input. here is: (function ($) { $.fn.ageit = function () { var = this; var positonthat = $(that).position(); var sizethat = $(that).width(); //add div ages var option = { "position": " relative", "top": "0", "left": "300" }; var templateage = "<div class='whatage" + $(this).attr('id') + "' style='display:inline-block;'>blablabla</div>"; $(that).after(templateage); var leftposition = (parseint(sizethat) + parseint(positonthat.left) + parseint(option.left)); var topositi

magento2 - Warning: DOMXPath::query(): Invalid expression in /opt/lampp/htdocs/magento/vendor/magento/framework/Config/Dom.php on line 273 -

i using magento latest release 2.x. everything works fine, except when saving product image magento 2.x throws error warning: domxpath::query(): invalid expression in /opt/lampp/htdocs/magento/vendor/magento/framework/config/dom.php on line 273 i have started learning magento. appreciated. though old question, there no answer in 5 months. got similar issue , found cause case. this issue might generated due wrong xml configuration. if add more code related issue, isolate exact reason behind issue. at end, wrote di.xml wrongly, didn't write root tag in di.xml. reason, error generate. if gets issue, should check configuration files.

python - Create a column based on condition pertaining to 2 other columns -

i have 2 columns in pandas dataframe (let's call 'col1' , col2'). both contain true/false values. i need create third column these 2 ('col3'), have true value record if 1 or other of 2 columns has true value in record. currently, i'm doing with: col3 = [] index, row in df.iterrows(): if df.ix[index, 'col1'] == true or df.ix[index, 'col2'] == true: col3.append(true) else: col3.append(false) df['col3'] = col3 it works fast enough size of dataset, there way in one-liner/vectorized way? perhaps using 2 nested np.where() statements? you can use np.logical_or this: in [236]: df = pd.dataframe({'col1':[true,false,false], 'col2':[false,true,false]}) df out[236]: col1 col2 0 true false 1 false true 2 false false in [239]: df['col3'] = np.logical_or(df['col1'], df['col2']) df out[239]: col1 col2 col3 0 true false true 1 fals

docusignapi - Docusign REST API to Delete User - getting 400 but xml structure validates. I'm passing the parameter -

trying call docusign rest api delete/close user. passing xml documentation in docusign accepts xml or json. getting 400 status code. can login using rest api fine. have had several eyes @ docusign documentation on delete in relation i'm passing in xml, nothing has popped out why getting 400. typically, mean xml ... request not correct format. having issue delete/close user? advice?

opengl - Normals move with model -

Image
i wrote shader diffuse lighting. normals rotate rotation of 3d model, , looks when rotate model, light rotate to. vertex shader position = gl_modelviewmatrix * gl_vertex; gl_position = gl_modelviewprojectionmatrix * gl_vertex; normal = vec4(gl_normal, 1.0); <--- gl_texcoord[0] = gl_multitexcoord0; fragment shader lightvector = normalize(vec4(lightposition + cameraposition, 1.0) - position); resultnormal = normalize(normal.xyz); <--- how fix it? you don't seem transforming normals gl_normalmatrix . also, line suspicious: normal = vec4(gl_normal, 1.0); normals directions, not positions, .w component should 0.

python - Tying values to keys in a dictionary and then printing -

this smaller portion of main code have been writing. depending on user selection can add player informationa , print information dictionary player roster. want store information , print in format havent been able figure out how this. name **** phone number **** jersey number **** im new dictionaries have spent hours reading , searching on past couple of days dictionaries , have tried several different ways failed. have gotten closest way have setup still doesnt work right. feel storing information incorrectly dictionary starters, appreciated. player_roster = {} def display_roster(self): #print roster if len(player_roster) != 0: x in player_roster.keys(): print('name:', x, 'phone number:', player_roster[x]) else: #print no 1 on roster len(player_roster) == [] print('no names have been entered:&#

How to download a file from webpage using Htmlunit having javascript in anchor tag -

i trying click on link download file : http://www.histdata.com/download-free-forex-historical-data/?/metatrader/1-minute-bar-quotes/eurusd/2013 the html code line trying download is: <a id="a_file" title="download zip data file" href="javascript:return true;" target="nulldisplay">histdata_com_mt_eurusd_m1_2013.zip</a> and java code is: webclient webclient = new webclient(browserversion.firefox_38); webclient.getoptions().setjavascriptenabled(true); webclient.setajaxcontroller(new nicelyresynchronizingajaxcontroller()); htmlpage htmlpage=webclient.getpage("http://www.histdata.com/download-free-forex-historical-data/?/metatrader/1-minute-bar-quotes/eurusd/2016/7"); list<htmlanchor> anchors=htmlpage.getanchors(); htmlanchor anchor = null; (int = 0; < anchors.size(); ++i) { anchor = anchors.get(i); string sanchor = anchor.astext(); if (sanchor.equals("histdata_com_mt_eurusd_m1_2016

python packaging - Is there a standard way to recommend other packages in setup.py? -

in setup.py 1 can use install_requires key list mandatory dependencies of package. is there way recommend installation of other packages here, if not required package work? i'm thinking similar debian's apt makes distinction between these 2 cases.

jsf 2 - How to provide a file download from a JSF backing bean? -

is there way of providing file download jsf backing bean action method? have tried lot of things. main problem cannot figure how outputstream of response in order write file content to. know how servlet , cannot invoked jsf form , requires new request. how can outputstream of response current facescontext ? introduction you can through externalcontext . in jsf 1.x, can raw httpservletresponse object externalcontext#getresponse() . in jsf 2.x, can use bunch of new delegate methods externalcontext#getresponseoutputstream() without need grab httpservletresponse under jsf hoods. on response, should set content-type header client knows application associate provided file. and, should set content-length header client can calculate download progress, otherwise unknown. and, should set content-disposition header attachment if want save as dialog, otherwise client attempt display inline. write file content response output stream. most important part call facescont

c++ - Calling overrided virtual function instead of overloaded -

say have part of code: #include<iostream> using namespace std; class { public: virtual int f(const a& other) const { return 1; } }; class b : public { public: int f(const a& other) const { return 2; } virtual int f(const b& other) const { return 3; } }; void go(const a& a, const a& a1, const b& b) { cout << a1.f(a) << endl; //prints 2 cout << a1.f(a1) << endl; //prints 2 cout << a1.f(b) << endl; //prints 2 } int main() { go(a(), b(), b()); system("pause"); return 0; } i can understand why first 2 print 2. cannot understand why last print 2. why doesn't prefers overloaded function in b ? i looked @ this , this couldn't manage understand these. int b::f(const b& other) const doesn't override int a::f(const a& other) const because parameter type not same. won't called via calling f() on reference of base class a . if member

oracle - SQL selection query that discards rows that share some value with another row -

suppose have next sql table, these sample values: id date user publish ---------------------------------- 1 05/20/16 peter 1 2 05/20/16 peter 2 <= discarded 3 05/20/16 john 2 4 05/28/16 john 1 5 05/28/16 john 2 <= discarded 6 07/01/16 peter 2 7 07/01/16 john 2 what want query select rows in case there 2 rows same date , user, retrieve 1 'publish' value '1', in example rows 1, 3, 4, 6 , 7. i resolve problem programmatically wonder if exists way solve proper sql query. any appreciated. this discard first row (ordered publish ) each group of date , user : select id, "date", user, publish ( select t.*, row_number() on ( partition "date", user order publish ) rn table_name t ) rn = 1;

sql - Selecting unique values from self-referencing table -

suppose have following data in table named my_tabel : ╔═══════════╦═════════════╦════════════╗ ║ id ║ person_name ║ partner_id ║ ╠═══════════╬═════════════╬════════════╬ ║ 101 ║ john ║ 3 ║ ║ 100 ║ miller ║ 0 ║ ║ 3 ║ ruby ║ 101 ║ ║ 180 ║ jack ║ 0 ║ ║ 199 ║ george ║ 65 ║ ║ 23 ║ joseph ║ 0 ║ ║ 34 ║ fredrick ║ 117 ║ ║ 117 ║ jinan ║ 34 ║ ║ 122 ║ verena ║ 0 ║ ║ 65 ║ mary ║ 199 ║ ╚═══════════╩═════════════╩════════════╝ where 0 values in partner_id column indicates he/she single. we need display partnered persons without repeating or duplication, desired result should like: ╔═════════════╦══════════════╗ ║ person_name ║ partner_name ║ ╠═════════════╬══════════════╬ ║ john ║ ruby ║ ║ george ║ mary ║ ║ fredrick ║ jinan ║ ╚═════════

authentication - Error while installing pam-python-1.0.5 -

when run make command receive following error rm -f html/index.html && ln -s pam_python.html html/index.html make[1]: leaving directory `/home/vagrant/pam-python-1.0.5/doc' make --directory src make[1]: entering directory `/home/vagrant/pam-python-1.0.5/src' gcc -o0 -wall -wextra -wundef -wshadow -wpointer-arith -wbad-function-cast -wsign-compare -waggregate-return -wstrict-prototypes -wmissing-prototypes -wmissing-declarations -werror -g -o ctest ctest.c -lpam cflags="-wall -wextra -wundef -wshadow -wpointer-arith -wbad-function-cast -wsign-compare -waggregate-return -wstrict-prototypes -wmissing-prototypes -wmissing-declarations -werror" ./setup.py build running build running build_ext building 'pam_python' extension creating build creating build/temp.linux-x86_64-2.6 gcc -pthread -fno-strict-aliasing -o2 -g -pipe -wall -wp,-d_fortify_source=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -d_gnu_source -fpic -fwr

javascript - Wagtail / Hallo.js - Adding plugins but modified content is not saved -

i'm running on wagtail 1.3.1, django 1.7.11. i have activated hallohtml , hallojustify plugins , appear in toolbar (without icons buttons here). the buttons can used , modifications seen in textarea (i mean can center field example , see it). when publish page, modifications made either hallojustify or hallohtml not saved whereas can still use bold/italic buttons , save content. looks html cleaned up... i should miss but... @hooks.register('insert_editor_js') def editor_js(): js_files = [ ] js_includes = format_html_join('\n', '', ((settings.static_url, filename) filename in js_files) ) return js_includes + format_html( """ <script> registerhalloplugin('hallojustify'); registerhalloplugin('hallohtml'); </script> """ ) by design, wagtail allows subset of html tags , attributes, , strips out not on whitelist. done several re

json - how to send complex type from client side to server side -

Image
i have page needs send complex data client side webmethod in asp.net mvc. data : {"tbl":[{"row":{"items":[{"name":"madrak1","val":"fdsfds"},{"name":"mahaletahsil1","val":"fdsfds"},{"name":"reshte1","val":""},{"name":"start1","val":""},{"name":"end1","val":""}]}}]} i need have class named table put variables inside it. webmethod : public actionresult savedetailedinfo(list<rrow> tbl) { return json(new { status = "success", message = "success" }); } your c# classes should like: public class item { [jsonproperty("name")] public string name { get; set; } [jsonproperty("val")] public string val { get; set; } } public class row { [jsonproperty("items&

jsf - Filter does not take a value from readonly field during filtering -

i use jsf 2.2, primefaces 6.0 , cdi. i've got datatable has implemented lazy loading (the datatable downloads data database). each column has got filter field. one of column has have readonly filter field (i save value filter in variable before displaying datatable ). so, wrote, filter field should readonly (non-editable) , filter should take value field filtering. how can achieve feature? i tried add inputtext component , set readonly attribute: <p:datatable id="datatableofdatastore" var="obj" widgetvar="datatableofdatastorevar" value="#{formvisualizationcontroller.datatablelazy}" lazy="true" filteredvalue="#{formvisualizationcontroller.filtereddatatable}" filterdelay="2000" <!-- other attributes --> > <!-- other columns --> <p:column headertext="sour

opencv - Cascade training for road crack detection -

i've been working on cascade using lbp feature, me detect road crack on pavement pictures taken drone. did lot of test , different list of pictures, have lot of false positives. im asking myself if method kind of detection , there better method use, other simple threshold? training lbp or haar cascade classifiers detecting cracks on road in experience not best solution there no common denominator compared detecting faces etc. have proper set of data training? how many positives using? don't think there enough features selected , that's why getting many false positives, because cannot distinguish these during training. start out different thresholds of road mentioned , see if can distinguish cracks. once visible enough in contrast road able go there.

asp.net - Automatic edit a config file with password after deployment from github to azure -

i have asp.net web application on azure, continous integration github. works good, , have managed move of passwords , connectionstrings off source , application settings. there 1 file cannot manage solve how provide connectionstring without having in source. file filesystemproviders.config looks like: <provider alias="media" type="our.umbraco.filesystemproviders.azure.azureblobfilesystem, our.umbraco.filesystemproviders.azure"> <parameters> <add key="connectionstring" value="**secret1**"/> is there anyway make script running after each deployment replaces **secret1** connectionstring automatically? or other way around? i found solution this, posting in case wondering same. kudu service has post deployment action hooks . after creating new directory in "d:\home\site\deployments\tools\" named "postdeploymentactions", put 2 files directory, , script copies connectionstrings right place.

nest - Date Range Query Elasticsearch -

below query when executed in elasticsearch version 1.x was considering documents created after 6/15/2016 documents have time beyond 12 date 6/15/2016.it considering documents till 6/15/2016 23:59:59.999 . but new version of es 2.x range query has stopped considering documents have time beyond 12 date 6/15/2016. considering documents till 6/14/2016 23:59:59.999. what changed here? { "from": 0, "size": 10, "sort": [ { "pronumber.sort": { "order": "desc" } } ], "query": { "bool": { "must": [ { "match": { "bolnumber": { "query": "7861254", "analyzer": "gtz_search_analyzer", "operator": "and" } } }, { "range": { "createddate": {

python - Django Rest Framework Bulk Update -

i have been dealing problem while , cannot seem fix it, there 3 steps doing this 1: first uploading images via ajax post 2: inserting campaign 3: want update images table foreign key of ads this means when serializer.save() being called success, make bulk update in images table ads.id here code: def create(self, request, *args, **kwargs): #data = json.dumps(request.data) user = self.request.user if user.groups.filter(name='advertisers').exists(): serializer = campaignserializer(data=request.data) adsid = adsimages.objects.filter(id__in=self.request.data["adsimages"][0]["image"]) if serializer.is_valid(): serializer.save(advertiser=self.request.user) ad_id = serializer.data['ads'][0]['id'] ad in adsid: adsimagesserializer(adsimages,data=ad_id, partial=true) return response(serializer.data, status=status.http_201_created,)

php - Http Basic Authentication using Laravel Curl Library -

i using https://github.com/ixudra/curl curl library laravel know how run below command through curl library; curl_setopt($process, curlopt_userpwd, $username . ":" . $password); i need curl url using http basic authentication , cant seem complete using library. your post quite old, looking same thing. have use method withoption : $response = curl::to('https://your-url.com') ->withoption('userpwd', 'user:password') ->post(); if want use other curl option, have remove prefix "curlopt_".

node.js - MONGODB MULTI PARAMETER SEARCH QUERY -

i have following schema: var listingschema = new schema({ creatorid : [{ type: schema.types.objectid, ref: 'user' }],//listing creator i.e. specific user roommatepreference: { //preferred things in roommate age: {//age preferences if early20s: { type: boolean, default: true }, late20s: { type: boolean, default: true }, thirtys: { type: boolean, default: true }, fortysandold: { type: boolean, default: true } }, gender: {type:string,default:"male"} }, roominfo: {//your own location of place rent address: {type:string,default:"default"}, city: {type:string,default:"default"}, state: {type:string,default:"default"}, zipcode: {type:number,default:0}, }, location: {//room location type: [number], // [<longitude>, <latitude>] index: '2d' // create geospatial index }, pricing: {//room pricing information monthlyrent:

Scala case class private constructor isn't private -

today encountered strange problem case class constructors. wanted make constructor private , seems isn't problem. i've tried in 1 of projects , works. in project can invoke private constructor , compiles. thought ide, made standalone class , compile scalac. , compiles. here code: package com.test object main { def main(args: array[string]) { val bar = bar("12345") // bar.dostuff() println(bar) } } case class bar private(foo: string){ private def dostuff():unit = println("stuff") } the funny thing if uncomment bar.dostuff() won't compile. assume private works in case, somehow doesn't work constructor. doing wrong? scalac 2.11.8 the notation val bar = bar("12345") shorthand val bar = bar.apply("12345") , in other words, calls apply method of (automatically generated) companion object of case class. the companion object has access private constructor, that's why works. (why want make co