Posts

Showing posts from May, 2013

android - how to insert a percentage to download this Json -

i've use code download json file , convert project. since there 40k items download need add % of download of file. code is: final retrofit retrofit = new retrofit.builder() .addconverterfactory(gsonconverterfactory.create()) .addcalladapterfactory(rxjavacalladapterfactory.create()) .baseurl(airportservice.service_endpoint).build(); airportservice service = retrofit.create(airportservice.class); service.getairport() .subscribeon(schedulers.newthread()) .observeon(androidschedulers.mainthread()) .subscribe(new subscriber<list<airport>>() { @override public void oncompleted() { } @override public void onerror(throwable e) { e.printstacktrace(); } @override public void onnext(list<air

python - selenium testing with django gives 'NoneType' object has no attribute 'path' -

i cannot see making error happen because not give me more information. tests pass, print message console. post files below. tests.py: class mainapptests(liveservertestcase): """testing interactions on main page""" def setup(self): """opening browser""" selenium_logger = logging.getlogger('selenium.webdriver.remote.remote_connection') # display possible problems selenium_logger.setlevel(logging.error) self.browser = webdriver.firefox() self.user = make_user() def teardown(self): """closing browser""" self.browser.quit() def test_homepage(self): """testing work""" self.browser.get(self.live_server_url) self.assertin("site", self.browser.title) views.py: def home(request): """view displaying home page"""

css - bootstrap modal body background: none -

how remove background color of bootstrap modal body. tried use .modal-body{ background: none !important; } it not working. here jsfiddle check fiddle .modal{ background-color: transparent; }

html - AMP as default page -

i have wordpress-webblog beyondpixels.at custom theme , styling. i've been fooling around amp quite bit, , found out, suits quite features need on our blog. here demo-page : the problem: research, seems me amp-pages have set secondary url existing non-amp-url. there has <link rel="canonical"> refer default-document. my question is: can set entire blog amp-page default? don't need reduced mobile version existing page, rather change existing page becomes amp-valid. there problem that? amp-pages rank in mobile search, , lose desktop traffic when switching amp? there practical examples of pages switched responsive amp (other www.ampproject.org)

permissions - Reshift grants verification HAS_TABLE_PRIVILEGE fails -

i'm fighting redshit grants groups, schemas, default privileges. when try check correct using has_table_privilege select tablename, has_table_privilege('analyst', tablename, 'select') select, has_table_privilege('analyst', tablename, 'insert') insert, has_table_privilege('analyst', tablename, 'update') update, has_table_privilege('analyst', tablename, 'delete') delete, has_table_privilege('analyst', tablename, 'references') references pg_tables schemaname='datalab' order tablename i : an error occurred when executing sql command: select tablename, has_table_privilege('analyst', tablename, 'select') select, has_table_privilege('analyst', tablena... [amazon](500310) invalid operation: relation "dss__transaction" not exist; execution time: 0.2s 1 statement failed. what hell happening here ? i tried , query failed on f

android - Progress Dialog not show on screen -

i edited code according dear mayank'answer not show message sended input in displaymsg() method before method begines..i should methodtest() started nfc , in method onnewintent(intent intent) @override protected void onnewintent(intent intent) { methodtest(); .............. } public void methodtest() { displaymsg("method 1 running"); method1(); displaymsg("method 2 running"); method2(); displaymsg("method 3 running"); method3(); } private int displaymsg(string msg) { totalmsg += msg; displaymsgclass dc = new displaymsgclass(); dc.doinbackground(totalmsg); } private class displaymsgclass extends asynctask<string, integer, string> { @override protected void onpreexecute() { textview.settext("hello !!!"); progressbar = (progressbar) findviewbyid(r.id.progressbar1); progressbar.setvisibility(view.visible); super.onpreexecute(); } @ov

How to add custom Stylesheet before Corev15.css in SharePoint Custom HTML Master Page? -

Image
i have created custom html master page , it's working fine, need add custom stylesheet before loading corev15.css i have added code below <link href="/style library/branding/css/abcleagueopertaioncustom.css" type="text/css" rel="stylesheet" /> <link href="/_layouts/15/1033/styles/themable/corev15.css" rel="stylesheet" type="text/css" /> but it's render below. is possible way that, please advise me. you should follow below points you should add custom stylesheet link before corev15.css stylesheet in custom master page link should have ms-design-css-conversion="no" - tag avoid sharepoint reorder stylesheet example tag below <link href="your custom stylesheet path" rel="stylesheet" type="text/css" ms-design-css-conversion="no" />

html - data to be inserted in database through php page -

<?php @$code = $_post['code']; @$name = $_post['name']; @$city = $_post['city']; $connect = mysql_connect("localhost", "root", "", "parth") or die("connection failed"); $sql_query = "insert customer_master(customer_code,customer_name,customer_city) values(" . $code . ",'" . $name . "','" . $city . "');"; $result = mysql_query($sql, $connect); if ($result) { echo "database connected"; } else { echo "data not inserted"; } mysql_close($connect); ?> the above mentioned code code of inserting data in database data in not been inserted in been displayed ,no errors been displayed please can me solve problem. you have made mistake on here ".$code.", missed single quote , using mysql depreciated use mysqli below : <?php @$code=$_post['code']; @$name=$_post['name'];

Return JSON response to ajax from struts action -

i calling struts action using ajax. javascript code below $.ajax({ url: '${pagecontext.request.contextpath}/gettransactiondata.do', type: 'post', success: function(data) { alert(data); }, error: function(xmlhttprequest, textstatus, errorthrown){ alert('error ' + textstatus); alert(errorthrown); alert(xmlhttprequest.responsetext); } }); i have written action class in want create list of data , access data in jsp page json response. action class method public actionforward execute(actionmapping mapping, actionform form, httpservletrequest request, httpservletresponse response) throws exception { list<map> datalist = new arraylist<>(); map<string, object> datamap = n

c# - itext7 not creating new pdf-page automatically -

when add multiple tables itext7 pdf , number of tables more fits in 1 page following exception gets thrown. exception: "object reference not set instance of object." source: "itext.layout" stacktrace: "at itext.layout.renderer.tablerenderer.layout(layoutcontext layoutcontext) @ itext.layout.renderer.rootrenderer.addchild(irenderer renderer) @ itext.layout.rootelement 1.add[t2](blockelement 1 element) @ itext.layout.document.add[t](blockelement`1 element) @ itextsharp7_test.controllers.pdfcontroller.replicatebug(string pdffile) in c:\users\me\documents\visual studio 2015\projects\app_test\itextsharp7_test\controllers\pdfcontroller.cs:line 443" in provided example exception gets thrown when 6th table added. the way have been able handle issue assuming exception thrown adding more data pdf fits in 1 page , add new page within try catch block, solution ugly , not in long term

c# - When we run .exe manually, it works fine, but same .exe is not working in Windows's Task Scheduler? -

i deployed .exe in windows 2008 r2 server, running fine when run manually, not running in task scheduler (ts), when run in ts, task completing out error, in 'last run result' column shows '(0xc0000142)' instead of 'the operation completed successfully', checked in event viewer no error. please on this.

Jenkins - FileName Extensions error -

i using jenkins work trying jmeter through jenkins build option run batch file, blocked below error. started user admin building in workspace d:\ [] $ cmd /c call c:\users\xxxx\appdata\local\temp\hudson4481668363865698547.bat filename or extension long fatal: command execution failed java.io.ioexception: cannot run program "cmd" (in directory "d:\"): createprocess error=206, filename or extension long @ java.lang.processbuilder.start(unknown source) @ hudson.proc$localproc.<init>(proc.java:243) @ hudson.proc$localproc.<init>(proc.java:212) @ hudson.launcher$locallauncher.launch(launcher.java:815) @ hudson.launcher$procstarter.start(launcher.java:381) @ hudson.tasks.commandinterpreter.perform(commandinterpreter.java:95) @ hudson.tasks.commandinterpreter.perform(commandinterpreter.java:64) @ hudson.tasks.buildstepmonitor$1.perform(buildstepmonitor.java:20) @ hudson.model.abstract

ios - Can't run "pod install" with ":git" -

thi podfile: platform :ios, '7.0' def mypods pod 'mtmenubar', :git => 'https://github.com/mnaito/mtmenubar.git', :branch => 'master' end target 'xxx' mypods end target 'yyy' mypods end project 'zzz' when run "pod install", got bug: analyzing dependencies pre-downloading: `mtmenubar` `https://github.com/mnaito/mtmenubar.git`, branch `master` [!] `mtmenubar` pod failed validate due 2 errors. [!] validator swift projects uses swift 3.0 default, if using different version of swift can use `.swift-version` file set version pod. example use swift 2.3, run: `echo "2.3" > .swift-version`: - error | attributes: missing required attribute `homepage`. - warn | github_sources: github repositories should end in `.git`. - error | [ios] frameworks: framework should specified name please let me know problem here? thank you!

Why >>> eval "$(docker-machine env default)" in a ansible playbook script return "No such file or directory" -

i try execute docker-compose create containers on docker-machine (driver virtualbox) ansible. so, write ansible-playbook script that. user (all/nopasswd) added suddoers group. activate machine before. shell: eval "$(docker-machine env default)" shell: docker-compose -d it didnt activate remote machine. stays on host. ok: [192.168.0.12] => { "msg": "" } so, docker-compose create container on local machine instead of remote machine. thank in advance help. olivier my bad, each task in isolated shell, write shell multiline resole problem. shell: | eval $(sudo docker-machine env default) docker-compose -d

android - String.equals() always returns false? -

i trying make sign in page android app. team leader has decided make webservice. whenever uses logs in, request sent, 3 possible responses: 0: wrong password 20: wrong username otherwise: uuid i trying validate results given webservice this: string resultstring = result.tostring(); if (resultstring.equals("20")) { toast.maketext(getbasecontext(), "het ingevulde emailadres klopt niet!", toast.length_long).show(); return; } else if (resultstring.equals("0")) { toast.maketext(getbasecontext(), "het ingevulde wachtwoord klopt niet!", toast.length_long).show(); return; } else { toast.maketext(getbasecontext(), "debug, klopt", toast.length_long).show(); return; } seems basic code me. however, code shows bottom statement, lets first 2 pass false. for debugging purposes, returning resultstring console. (removed line in sample). there can see result given in fact

phpunit - Codeception improve readiness unit test -

i'm new test, i'm using codeception , phpunit tdd. however, methods have lot of code. used best practices ? there way improve readiness of code, can more clean ? class newsformhandlertest extends \codeception\test\unit { /** * @var \unittester */ protected $tester; protected function _before() { } protected function _after() { } private function getformmock(){ return $this->getmockbuilder(forminterface::class) ->disableoriginalconstructor() ->getmock(); } private function getnewsmanagermock(){ return $this->getmockbuilder(inewsmanager::class) ->disableoriginalconstructor() ->getmock(); } // tests public function testshouldhandleasuccessfulformsubmissionforaddanews() { // prepare $request = new \symfony\component\httpfoundation\request(); $news = new news(); $form = $this->ge

swift - IOS Charts - Values on X-Axis not formatted correctly in portrait mode -

Image
i'm in process of integrating "ios charts" latest app. fine formatting of xaxis isn't running in portrait mode on ios (see screenshot). landscape mode fine. chartsdata contain 290 entries date / numeric value. formatting done not enough. (see screenshots) working xcode 8 / swift 3 / latest build cocoapods (version 3.0.0 of charts) / ios 10 here code relating xaxis, "charty" linechartview charty.xaxis.granularityenabled = true charty.xaxis.granularity = 10 charty.xaxis.labelposition = .bottom charty.autoscaleminmaxenabled = true any kindly appreciated try below code while in portrait mode. linechartview.xaxis.spacebetweenlabels = 4 linechartview.xaxis.wordwrapenabled = false spacebetweenlabels align things on xaxis. have happy coding.

Jquery Datatable null column -

hi have created jquery datatable using below code.. the column email id , activated date may nullable. when render table showing 'request unknown parameter 'email' data source row 0' var tblallkeys = $('#tblallkeys').datatable({ "bdestroy" : true, "bprocessing" : true, "bserverside" : true, "blenthchange" : false, "idisplaylength" : 10, "sajaxsource" : "loadallkeys", "olanguage" : { "ssearch" : "search activation key:" }, "aocolumns" : [ {"stitle" : "no.","mdata" : null,"atargets": [ 0 ], "fnrender" : function(obj) { var col

php - JWT And Routes Symfony3 -

i have 2 firewalls in security.yml file: security: encoders: fos\userbundle\model\userinterface: bcrypt providers: fos_userbundle: id: fos_user.user_provider.username_email firewalls: login: pattern: ^/api/v1/auth$ stateless: true anonymous: true provider: fos_userbundle form_login: check_path: /api/v1/auth success_handler: lexik_jwt_authentication.handler.authentication_success failure_handler: lexik_jwt_authentication.handler.authentication_failure require_previous_session: false api: pattern: ^/api/v1 stateless: true provider: fos_userbundle guard: authenticators: - lexik_jwt_authentication.jwt_token_authenticator and 2 routes in authcontroller : /** * @param paramfetcherinte

objective c - iOS UI testing - presented view controller appearing as "other element" -

i trying write ui tests app. have pop modally presented view controller uitableview on it. tableview contains 2 clickable cells, both of dismiss view controller. problem when pop appears, appearing "other element" in elements tree , not view controller. can find element otherelements[@"popoverviewcontroller"] unable click cells on controller doesn't know are. →other 0x7fc778039540: traits: 8589934592, {{32.0, 155.5}, {311.0, 356.0}}, label: 'popoverviewcontroller' how can access element , click buttons on view controller? thanks edit here output when popoverviewcontroller showing image 0x7fc26378c270: traits: 8589934596 image 0x7fc263784310: traits: 8589934596, {{0.0, 0.0}, {375.0, 64.0}} button 0x7fc263786ff0: traits: 8724152321, {{8.0, 26.0}, {110.0, 30.0}}, label: '*****' button 0x7fc26378d480: traits: 8724152321, {{8.0, 36.5}, {11.0, 11.0}}, label: '*****' statictext 0x7fc263794620: traits: 8589934656 sta

python - Feature selection using tensorflow -

i using python 3.5 tensorflow 0.11. i have dataset large number of features (>5000) , relatively small number of samples(<200). using wrapper skflow function dnnclassifier deep learning. it seems work work classification task, want find important features large number of features. internally, dnnclassifier seems perform feature selection(or feature extraction). there way perform feature selection tensorflow? or, there function extract weights of features? (there function dnnclassifier.weights_, seems deprecated) if tensorflow not support feature selection or weight information, reasonable conduct feature selection using other method(such univariate feature selection) , try deep learning? thank help. you can eval weights. example if variable define by weights = tf.variable(np.ones([100,10],dtype='float32'), name=weights) you can value @ tensorflow session value = weights.eval();

node.js - Add Column with random value Sequelize PostgreSQL -

i want add column not_null constraint column contain random default values following code how can this up: function (queryinterface, sequelize, done) { queryinterface.addcolumn( { tablename: 'sometable', schema: 'sometemplate' }, 'somecolumn', //column name { //column date type , constraint type: sequelize.string, allownull: false, defaultvalue: // want random value }) .then(function () { done() }) .catch(done); } postgresql example: create or replace function f_random_text( length integer ) returns text $body$ chars ( select unnest(string_to_array('a b c d e f g h j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9', ' ')) _char ), charlist ( select _char chars order random() limit $1 ) select string_agg(_char, '') charlist ; $body$ language sql; drop table if exists tmp_test; create temporary table tmp_test ( id serial, data

rspec - Circular require issue with Ruby -

i trying implement currency based application using ruby, find that: require 'dollar' require 'franc' puts 'why not work?' class money attr_reader :amount def self.dollar(number) dollar.new number end def ==(other) self.amount == other.amount end def self.franc(number) franc.new(number) end end i have franc class looks this: require 'money' class franc < money attr_reader :amount def initialize(amount) @amount = number end def times(mul) amount = @amount * mul franc.new(amount) end def ==(other) return false unless other.is_a? self.class super end end this direct translation of of code kent beck book ruby. when run bin/rspec see: /home/vamsi/do/wycash/lib/franc.rb:3:in `<top (required)>': uninitialized constant money (nameerror) /home/vamsi/do/wycash/lib/money.rb:2:in `require' /home/vamsi/do/wycash/lib/money.rb:2:in `<top

python - django.http.JsonResponse return json data in wrong format -

i want return queryset in json format, , use jsonresponse following: def all_alert_history(request): ''' all alert history data ''' all_data_json = serializers.serialize('json', latestalert.objects.all()) return jsonresponse(all_data_json,safe=false) but browser shows this: "[{\"fields\": {\"alert_name\": \"memory usage\", \"alert_value\": 83.7, \"alert_time\": \"2016-11-08t06:21:20.717z\", \"alert_level\": \"warning\", \"alert_rule\": \"warning: > 80%\"}, \"model\": \"alert_handler.latestalert\", \"pk\": \"xyz.test-java.ip-10-0-10-138.memory.percent\"}]" i replace jsonresponse httpresponse : def all_alert_history(request): ''' all alert history data ''' all_data_json = serializers.serialize('json', latestalert.objects.all()) return httpresponse(a

Excel ignoring VBA Print Settings -

for reason excel ignoring "fit 1 1" rule here. tried adjust zoom doesn't seem work. ideas utmost welcome! thank you! private sub commandbutton1_click() dim sel_manager string 'specify headers repeated @ top activesheet.pagesetup .printtitlerows = "$5:$9" .printtitlecolumns = "$b:$m" .orientation = xllandscape .zoom = 70 .fittopageswide = 1 .fittopagestall = 1 end 'manager selection through simple inputbox sel_manager = combobox1 'insert autofilter worksheet cells.select selection.autofilter 'select manager defined in inputbox activesheet.range("b14", range("m14").end(xldown)).autofilter field:=1, criteria1:=sel_manager 'select range printed , specify manager in filename activesheet.range("b14", range("m14").end(xldown)).select selection.exportasfixedformat type:=xltypepdf, filename:= _ sel_manager + ".pdf", quality:=xlqualit

javascript - JQuery plugin developement with multiple functions call -

after initial research figured out way have multiple functions in plugin mentioned in code, not getting required result. candles should displayed in mentioned color , mentioned number of time. can figure out error? view page: <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>happy diwali</title> <script type="text/javascript" src="/plugin6/scripts/jquery-3.1.0.min.js"></script> <script type="text/javascript" src="/plugin6/scripts/diwali.jquery.js"></script> <link rel="stylesheet" type="text/css" href="/plugin6/scripts/lamp.css"> <script> $(document).ready(function () { $("#show").click(function(){ //window.location.reload(); $(".candle").diwali( 'col....or',{ background : $("#colorlamp").val() }); $(".hap

javascript - Direction arrow does not show, but polyline is showing in google map -

i trying draw direction arrows poly line. code not show arrows plots every markers info windows , poly line using data set. want add arrows this. http://jsfiddle.net/nx8u8/2/ here code .done function of ajax callback. can explain me wrong done. var path1 = []; var poliline; function getdata(){ $.ajax({ url: '/filter', datatype:'json', type: 'post', data: {'mmsi':$('input[name=mmsi]').val(),'from': $("input[name='from']").val(), 'to': $("input[name='to']").val()} }).done(function(data) { initmap(); console.log(data.length); console.log(data); $.each(data, function(index, obj){ console.log( obj.latitude + " - " +obj.longitude ); //console.log("helloooo"); var pos = {lat: obj.latitude, lng: obj.longitude}; path1.push({lat: parsefloat(obj.la

asp.net web api2 - Sharepoint Provider Hosted app with Odata Web API -

we have requirement build sharepoint provider hosted app, needs call asp.net web api built odata. could't find exact solution this. perform highly approciated it should other web application provider hosted app totally independent sharepoint. if building app using asp.net, can add reference odata endpoint, ex: http://yourservice/odata/ $metadata visual studio generate proxy entities in odata service. if building app using other technology, deal service normal rest service , call using http client, browser or backend.

mysql - Query runs very slow -

i have query runs slow. goal of query list articles table , quantity table artikli. want see article sales listed in tables (artikli_2016 year, , artikli_2015 previous year) select a.artid, a.artsifra, a.artnaziv, a.artstanje, a.artstanjepalete, ( a.artstanje + a.artstanjepalete ) total, sum(g.izlaz) promet, c.jmoznaka, sum(f.izlaz) promet artikli left join artikli_2016 g on a.artid = g.artikal left join artikli_2015 f on a.artid = f.artikal left join jed_mjere c on a.artmjera = c.jmid a.artroditelj != 0 , a.artaktivan group a.artid order a.artid asc once join artikli_2015 gets slow. helpful if can give me advice or solution run query faster. due 2 lots of multiple records (i suspect) need use couple of sub queries sums. assuming jed_mjere has @ 1 record each artmjera. select a.artid, a.artsifra, a.artnazi

java - How to represent output in use case diagram -

i designing use case diagram system , doesn't know how represent output. here's system supposed do. (1) run on different server , part of product maintained entirely different team in organisation. (2) gather information , send message queue part of product maintained department. i want show explicitly in use case there 2 different systems here , application run on client system , send message message queue in different system. confused in how show message queue part of system. shall have use case showing message queue in system , connect user case in client system ? thanks use cases not architecture/technical aspects. use cases added value of system. neither of 2 cases added value architecture (the 2nd re-formulated use case gather information , that's commonplace). place them in component diagram show how deployed. however, should start on thinking actual added value actors of system under consideration.

c++11 - operator == () loops for ever -

see simple code: struct { bool operator ==(const int &t) { return *this == t; } }; void main() { p; p == 2;// code loops ever!!! } dose 1 know why code loops ever ?! operator ==() calls recursively! many thanks ask this. what *this ? it's struct a . so *this == t ? a::operator==() argument t. you calling same function.

c# - Decimal precision and scale in EF Code First -

i'm experimenting code-first approach, i'm find out property of type system.decimal gets mapped sql column of type decimal(18, 0). how set precision of database column? the answer dave van den eynde out of date. there 2 important changes, ef 4.1 onwards modelbuilder class dbmodelbuilder , there decimalpropertyconfiguration.hasprecision method has signature of: public decimalpropertyconfiguration hasprecision( byte precision, byte scale ) where precision total number of digits db store, regardless of decimal point falls , scale number of decimal places store. therefore there no need iterate through properties shown can called public class efdbcontext : dbcontext { protected override void onmodelcreating(system.data.entity.dbmodelbuilder modelbuilder) { modelbuilder.entity<class>().property(object => object.property).hasprecision(12, 10); base.onmodelcreating(modelbuilder); } }

node.js - How to run AIVA (CGKB) on Windows? -

Image
i want install aiav on windows. i've installed dependencies (node, python3, , mysql) on windows. but have error comes in following: is there suggestion install on windows without using ubuntu bash and purely in windows environement?

mysql - SQL query and output in PHP does not work - 500 Internal Server Error -

i try put working sql query in php-file cronjob. receive blank 500 internal server error notification. the sql query works fine in phpmyadmin. here code: <?php $con=mysqli_connect("host","dbuser","dbpw","dbname"); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $result = mysqli_query($con,"select oc_order_product.order_id bestellnr, oc_order_product.quantity, oc_order_product.model, oc_order_product.name, oc_order.shipping_company, oc_order.shipping_firstname, oc_order.shipping_lastname, oc_order.shipping_city oc_order_product, oc_order oc_order.order_id = oc_order_product.order_id , oc_order.order_status_id = 1 order bestellnr, model"); while($row = mysqli_fetch_array($result)) { echo $row['oc_order_product.order_id'] . "; " . $row['oc_order_product.quantity'] "; " .

MySql - Way to update portion of a string with part of another string? -

i'm looking way replace portion of string part of string same row via mysql query. for example, if have records title='blablabla - xx.yy.zzzz' , want add string, zzzz, field - extra_fields format '[{"value":"zzzz"}]' original table: title | extra_field -------------------- 19.02.1996 | [empty] 13.05.1815 | [empty] 22.03.2016 | [empty] after update need: title | extra_field ------------------- 19.02.1996 | year 1996 13.05.1815 | year 1815 22.03.2016 | year 2016 the query solution update yourtable set extra_field = concat('year ', substring(title,7)) or update yourtable set extra_field = concat('year ', substring(title,-4))

image processing - Converting and uploading of pictures to web gallery -

i'm building web page user area, registered users have possibility upload / delete pictures / gallery, other users can see it. i tried find solution allow me convert/resize images (i tried find facebook solution), unfortunately had no luck or converter didn't work well. don't want restrict users size of images. means, users not need care if pictures have 5mb each or 200kb. files width size > 1200px converted width 1200, smaller sizes kept are. in addition, need thumbs not load images in full (1200px) size. can please advise? thanks! jan

elasticsearch - Is it possible to create a document via an update? -

i have following case update documents may not exist yet: documents created specific calls ( calla ) preset _id several calla result in 1 document. set field field1 in document. independently, there call ( callb ) updates information existing document setting field2 . i ensure once document created, not overwritten subsequent calla . calla should update field1 , callb - fieldb . it have been easy achieve _update function did not manage have create document in first place. once document created _update ok. is there way go around limitation? code simpler if did not have first check if ercord exist , either create or update (as opposed have single call update or create if dcoument not exist yet)

on the fly object initialization c++ -

i'm trying used c++. want add object in dynamic array each time read line file without knowing dimension. i declared pointer array this: rlmr *myarray; where rlmr class public string id. now read file line line , after want add object myarray index = 0; while (fgets(buffer, maxsizebuffer, fp) != null) { if(buffer[0] == '#') // skip comment lines continue; else { sscanf(...); index++; } // @ point want new object in array myarray = (rlmr*) malloc(sizeof (rlmr) * index); // here try call object constructor passing id myarray[index-1] = new rlmr(cbeacid); } i don't understand error compiler: error: no match âoperator=â in â*(myarray+ ((unsigned int)(((unsigned int)index) * 28u))) = (operator new(28u), (<statement>, ((rlmr*)<anonymous>))) â what wrong. and, how done using std::vector. i'd understand

reactjs - Call an API using superagent? -

i have api consists branch of data { "data": { "id": , "title": , "description": , "old_price": "100", "new_price": "50", "size": "50", "quantity": 20, }, "errors": null, "code": 1 } i using superagent in order call api , render information, doing in wrong way. here code import react 'react'; import {render} 'react-dom'; import superagent 'superagent'; import layout './components/layout'; class app extends react.component{ constructor(){ super() this.state={ name:'' } } componentdidmount(){ console.log('componentdidmount'); const url='http://...'; superagent .get(url) .query(null) .set('accept', 'application/json')

mysql - how to extend RSuite search extension API? -

i started using rsuite cms. mostly concentrating on rsuite search api. by default rsuite search api provides limited search functionality. is there article can learn how can use rsuite search api perform more complex searches. any kind of related rsuite search api highly appriciated. i searched google lot did not find rsuite developers less no tag available rsuite. :) those don't know rsuite is..' here's link: http://www.rsicms.com/rsuite-enterprise-publishing-solution thanks in advance

android - Ionic $urlRouterProvider.otherwise() not working -

i've tried following tutorials looking @ other stackoverflow questions can't figure i'm doing wrong. i built ionic creator , i'm trying have user login google , after that's complete route dashboard. sorry brand new me. if can explain i'm doing wrong , why way, can learn. thanks! my controller.js: angular.module('app.controllers', []) .controller('loginctrl', ['$scope', '$stateparams', // following constructor function page's controller. see https://docs.angularjs.org/guide/controller // can include angular dependencies parameters function // tip: access route parameters page via $stateparams.parametername function ($scope, $stateparams, $urlrouterprovider) { $scope.googlelogin = function(){ //alert('yup'); var provider = new firebase.auth.googleauthprovider(); provider.addscope('https://www.googleapis.com/auth/plus.login'); firebase.auth().signinwithpopup(pro

c++ - Setting system time with gps timestamp_t structure in Linux -

setting system time gps timestamp_t structure in linux hi everyone, i'm trying write code succesfull gps lock (adafruit ultimate gps w/ gpsd) set system time. right now, can see 'timestamp_t': typedef double timestamp_t; /* unix time in seconds fractional part */ is part of "gps_data_t*" structure. start, however, function planned on using set system time in linux is: int settimeofday(const struct timeval *tv, const struct timezone *tz); i've found information on how convert time_t *timeval, how should handle double convert *timeval? code: gpsmm gps_rec("localhost", default_gpsd_port); if (gps_rec.stream(watch_enable|watch_json) == null) { std::cout << "no gpsd running. exiting gps thread." << std::endl; return; } //data structure struct gps_data_t* newdata; //loop until first gps lock set system time while ((newdata = gps_rec.read()) == null) { //wait valid read } //set system time - timest

cmd - How to open command prompt and insert command using c++ -

currently working on project of image processing using c++. found solution requires use of command prompt.can please tell me syntax of portion of it? since c++ skills aren't great don't know how achieve this. try use system() function: #include <stdlib.h> int main(void) { return system("dir"); }

plugins - How I can hide default wordpress sidebar in woocommerce pages? -

Image
i want hide default blog sidebar in pages of woocommerce plugin , instead add woocommerce sidebar. how in can this? thanks. it's theme dependent. please check theme option , see if can change sidebar woocommerce page. for example, theme option in avada theme:

sql - INNER JOIN in a long query? -

i landed @ new job , there´s report i´m asked show information stored in table, need enhance existing query developed left company. the query long , i´m not getting should insert inner join clause retrieve information need. this original code: select toollists.ident, toollists.descript tldescript, toollists.materialnr, toollists.order, toollists.who, toollists.ncp, toollists.rem tlrem, toollists.mdate, toollists.tdate, toollists.gdate, toollist.t, machines.name machinename, machines.trelation, toollist.d, toollist.h, toollist.pos toollistpos, toollist.rem toollistrem, toollist.how toollisthow, tools.nr, tools.z1, tools.drawing, tools.x1, tools.sort, tools.design, tools.descript, tools.rem toolrem, toolparts.pos toolpartpos, toolparts.nbr, toolparts.how, parts.unr, p