Posts

Showing posts from July, 2014

python 2.7 - Sending Game Server Info To dweet.io (srcds) -

i host garry's mod dedicated server , trying figure out how srcds.exe's (dedicated server) game data, players online, server status, etc. how information , upload dweet.io using python? can server info in srcds.exe using status in console have no idea how prints dweet.io (or python program fetches it, sending dweet.io). wiki

html5 - Waiting for the end of an animation in Haxe/OpenFL -

i'm making turn-based game using haxe + openfl + swf + actuate (i'm targeting js). 1 of important gameplay aspects using abilities. each ability has animation and, of course, takes time animation play. i want know how can handle end of swf animation? in advance there various ways. if have movie called 'myswf' movieclip setup on main timeline linkage 'holder' can attach , control enterframe loop per haxe nme example ( openfl pretty similar ). not tried html5 code nme prefer on openfl, unfortunately nme not support html. can find alternate approach in nyancat sample in nme haxelib, there similar 1 using 'swf' library in openfl sample folder, matter or switching imports over. package; import nme.display.sprite; import nme.display.stagealign; import nme.display.stagescalemode; import nme.assets; import format.swf; import format.swf.instance.movieclip; import flash.events.event; class main extends sprite{ public function new(){ super (

css - Preventing high-contrast mode in Edge from adding background to text -

Image
i'm working adjust components function , in high-contrast mode. edge seems adding black background under text ie11 not add. can't seem find way target background in css, or other way normalize behavior between 2 browsers. for example, let's have following: <div class="selectedtext"> text! </div> and let's assigned background-color: cyan; , color: black; .selectedtext div. in scenario, ie11 renders expected div , text having assigned colors. however, in edge div background , text given right colors, text gets black background drawn behind it, making unreadable black on black text. the following image illustrates problem occurring in context of menu items with same markup described above. is there way disable or target background edge adds? found answer eventually. setting -ms-high-contrast-adjust: none; on parent can disable backgrounds edge puts behind text. wiki

node.js - How to relocate global packages? -

in process of getting familiar npm, ive installed bunch of stuff globally, including angular cli - users directory on windows (c:\users...) how can either relocate directory or uninstall , reinstall different folder? you 1 one by npm uninstall angular-cli npm -g install angular-cli without -g interact current directory package.json while -g globally (your %user_profile%) wiki

c# - DialogUnits in .NET WinForms -

i'm porting old app .net, in there forms sizes set in dialog units. int w = --- dialog definition int h = --- dialog definition i tried use such approach int dx = (double)(loword(getdialogbaseunits())) / 4; int dy = (double)(hiword(getdialogbaseunits())) / 8; w *= dx; h *= dy; _form->clientsize = size::size(w, h); but .net form becomes way larger expected. then tried use rect rc = { _form->location.y, _form->location.x, _form->location.y + w, _form->location.x + h }; bool b = ::mapdialogrect((hwnd)_form->handle.toint32(), &rc); char err[1024]; getlasterrortext(getlasterror(), err, 1024); inside onload event, i'm getting error saying window not valid dialog, , rc variable remains un-changed. how correctly transform du inside winforms application? thx wiki

go - reflect.Value.Set using unaddressable value -

g.get("/", func(c echo.context) error { var users []models.user err := db.find(users).error if err != nil { fmt.println(err) } return c.json(http.statusok, users) }) this code getting , displaying users table using slice resulting following error gorm reflect.value.set using unaddressable value any appreciated you have call find pointer slice. err := db.find(&users).error relevant gorm documentation: http://jinzhu.me/gorm/crud.html#query wiki

mysql - ERROR 1582 (42000): Incorrect parameter count in the call to native function 'STR_TO_DATE' -

i looking regarding error receiving in mysql. new mysql. have following table: +--------------+--------------+------+-----+-------------------+-----------------------------+ | field | type | null | key | default | | +--------------+--------------+------+-----+-------------------+-----------------------------+ | date | date | no | | null | | | time | timestamp | no | | current_timestamp | on update current_timestamp | | messure | decimal(9,2) | no | pri | null | | | inject_units | decimal(9,2) | yes | | null | | +--------------+--------------+------+-----+-------------------+---------------- i using below query insert data table insert sugar_levels (date, time, messure, inject_units) values ('2017-08-22',str_to_date('2017-08-22 05:50:00', '

Beautiful Soup fails to recognize UTF-8 encoding on Python 3, IPython 6 console -

i trying read xml document using beautiful soup on python 3.6.2, ipython 6.1.0, windows 10, , can't encoding right. here's test xml, saved file in utf8-encoding: <?xml version="1.0" encoding="utf-8"?> <root> <info name="愛よ">ÜÜÜÜÜÜÜ</info> <items> <item thing="ÖöÖö">"23Äßßß"</item> </items> </root> first check xml using elementtree: import xml.etree.elementtree et def printxml(xml,indent=''): print(indent+str(xml.tag)+': '+(xml.text if xml.text not none else '').replace('\n','')) if len(xml.attrib) > 0: k,v in xml.attrib.items(): print(indent+'\t'+k+' - '+v) if xml.getchildren(): child in xml.getchildren(): printxml(child,indent+'\t') xml0 = et.parse("test.xml").getroot() printxml(xml0) the output correct: root: info: ÜÜÜÜÜ

Unable to load win32/api.so from ruby script -

the command run following : c:\v4\framework\scripts > ruby scm.rb the error following : c:/rubby/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require: 126: specified module not found. - c:/rubby/lib/ruby/gems/2.4.0/gems/win32-api-1.4.8-x86-mingw32/lib/win32/ruby19/win32/api.so (loaderror) c:/rubby/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require' c:/rubby/lib/ruby/gems/2.4.0/gems/win32-api-1.4.8-x86-mingw32/lib/win32/api.rb:2:in the first few lines of calling script looks following : require 'watir/win32ole' require 'windows/com' require 'windows/window/message' the second line giving load error. googled , not able find solution. wiki

vba - Outlook 2010 VBS how to add meeting to specific calendar -

this question has answer here: vbscript outlook form creating meeting in specific calendar 1 answer i'm trying set vbs create meeting in specific calendar (not default) when command button pressed. code have works creates meeting in default calendar. i've tried fooling around new vbs (mainly used vba). know vba , vbs similar im sure small has tweaked. want meetings placed in calendar named test, under calendars. sub commandbutton1_click() if commandbutton1 = false dim objol 'as outlook.application dim objappt 'as outlook.appointmentitem const olappointmentitem = 1 const olmeeting = 1 const olfree = 0 set objol = createobject("outlook.application") set objappt = objol.createitem(olappointmentitem) objappt.subject = "my test appointment" objappt.start = #8/24/17 3:50:00 pm# objappt.duration = 1 objappt.location = "followu

python - How do I incorporate Skulpt into my Meteor.js webapp? -

atmosphere.js lacks skulpt package, i'm unsure how proceed. if meteor doesn't support skulpt, there way let users type , run python code on meteor app (and if so, can provide small example of how implement it)? i'm using meteor-blaze stack. i tried using trinket.io. learned of same-origin policy ( https://en.wikipedia.org/wiki/same-origin_policy ), prevents me grabbing users type trinket or inserting own content. thanks! as skulpt in javascript, there no reason why shouldn't able use in meteor app. there npm package, should able do npm install skulpt and import skulpt 'skulpt' in code want use it. i haven't tried this, found npm package, indication you. wiki

r - How to map tibble elements to ggplot2 aesthetics? -

Image
i have following dataset map(.x = list(small = 3, medium = 10, large = 100) , .f = ~ sample(rnorm(1000), .x, replace = t)) %>% tibble(sample = ., mean = map_dbl(., mean)) # tibble: 3 x 2 sample mean <list> <dbl> 1 <dbl [3]> 0.61473548 2 <dbl [10]> 0.17278357 3 <dbl [100]> 0.04156308 i trying functionally create 1 histogram in ggplot2 each record in column sample . display plots in same grid, thought somehow use facet_wrap() not sure how map aesthetics lists. this have tried far: map(.x = list(small = 3, medium = 10, large = 100) , .f = ~ sample(rnorm(1000), .x, replace = t)) %>% tibble(sample = ., mean = map_dbl(., mean)) %>% ggplot2::ggplot(data = .) + geom_histogram(mapping = aes(sample)) + facet_wrap(~ sample) the output expect 3 histograms 3, 10 , 100 observations respectively. i wonder if possible solution involve splitting sample in 2 columns: 1 values,

spring - Control @RestController availability programatically -

is possible control @restcontroller programatically enable or disable it? don't want write code in each @requestmapping method kind of if (!enabled) { return 404exception; } i've seen this question works @ startup time. need allow me enable or disable controller multiple times. i've thought of different ways don't know doable in spring. actually control container (jetty in case) requests particular endpoint disabled somehow control requestmappinghandlermapping since seems class mapping between urls , controllers control lifecycle of @restcontroller component can create , destroy @ will, i'm not sure how trigger mapping endpoint if end result want respond 404 when decide specific endpoint should disabled write interceptor checks whether enabled condition false and, if so, sets response accordingly. for example: @component public class conditionalrejectioninterceptor extends handlerinterceptoradapter { @override public boolean

javascript - change attrib name with array -

i have form input: <input id="cant_user" type="text" name="cant_user" value="1" onblur="addinputs()"> #userdata cloned when add input value greater 1 , want change input name user_age age[n] <div id="userdata"> <div class="panel-body" id="generated[0]"> <div class="form-group"> <label class="col-md-4 control-label">age user [n]</label> <div class="col-md-6"> <input type="number" class="form-control" name="user_age[]" value="0" required> </div> </div> </div> javascript: function addinputs() { var cantusers = document.getelementbyid("cant_user").value; var countgenerated = $('[id^=generated]').length; if (countgenerated > 0) { $('[id^=generated]').not(':first&#

elasticsearch - Elastic search combining queries and nested queries together -

i've been reading elasticsearch queries time , documentation doesn't seem helpful of queries. i'm trying documents ((field1=keyword1 or field2=keyword1) , (field1=keyword2 or field2=keyword2)) , (field3=keyword3 ) , (field4!=keyword4)). the document refered https://dzone.com/articles/23-useful-elasticsearch-example-queries , when trying execute of queries in sense api extension in chrome, had syntax errors in it. eg: { "query": { "bool": { "must": { "bool" : { "should": [ { "match": { "title": "elasticsearch" }}, { "match": { "title": "solr" }} ] } }, "must": { "match": { "authors": "clinton gormely" }}, "must_not": { "match": {"authors": "radu gheorge" }}

PHP: variable is suddenly null -

i have problem data variable null. it's happening directly after if-statement when nothing written variable. knows happening here? public function render() { ob_start(); if($this->ajax) $ext = '.ajax'; else if(file_exists($this->scriptpath.$this->template.'.mst')) $ext = '.mst'; else $ext = '.phtml'; #var_dump($this->data); // <-- filled many data if($ext === '.mst'){ var_dump($this->data); // <-- null $mustache = new \mustache_engine( array( 'escape' => function($value){return $value;}, 'partials_loader' => new \mustache_loader_filesystemloader(dirname(__file__).'/../../../frontendtarget/classes/lib/de/preis/frontend/viewfragments/partials',array('extension' => 'mst')) ) );

Changing values in a multi-dimensional array via reference (in PHP)? -

the following php function finds node in multi-dimensional array matching key: <?php function & findbykey($array, $key) { foreach ($array $k => $v) { if(strcasecmp($k, $key) === 0) { return $array[$k]; } elseif(is_array($v) && ($find = findbykey($array[$k], $key))) { return $find; } } return null; } $array = [ 'key1' => [ 'key2' => [ 'key3' => [ 'key5' => 1 ], 'key4' => '2' ] ] ]; $result = findbykey($array, 'key3'); i want function return reference node if change $result original $array changes (like javascript objects). <?php array_splice($result, 0, 0, '2'); //changes $array since `$result` reference to: $array['key1']['key2']['key3'] how can this? you need 2 things: 1) specify $array parameter re

xml - How to add decimal numbers in xslt 1.0 in substrings -

i have following input xml. <?xml version = "1.0" encoding = "utf-8"?> <values> <value>sometext;+123.23;+100.23</value> <value>sometext;+004.23;+444.12</value> </values> i newbie in xsl 1.0. add 2 decimal numbers received in strings receiving nan error. how do that. following output above input xml decimal values summed instead receiving nan errors. <?xml version="1.0"?> <results> <result>+223.46</result> <result>+448.35</result> </results> i have xsl file follows, <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="xml" indent="yes"/> <xsl:template match = "/"> <results> <xsl:for-each select="values/value"> <result> <xsl:valu

Panel Var Model with R -

i trying run panel var model r. have researched question thoroughly, have found no answer. people posted article on panel var r , talked r packaged called panelvar ( https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2896087 ), not available on r cran , cannot found on internet. i researching r packaged called plm ( https://cran.r-project.org/web/packages/plm/index.html ), nice on many other panel data tasks. can package work on panel var? if yes, has used package panel var analysis? advice? thanks. wiki

files array in upload file with angular 4 -

Image
i select file in template this: <input type="file" #fileupload [(ngmodel)]="myfile" name="myfile" (change)="filechange(fileupload.files)" /> then in component use function manipulate object: filechange(event){ console.log( event); this.myfile = event[0];} compilation ok , no errors, error in browser: error error: [object object] @ viewwrappeddebugerror (core.es5.js:8410) @ callwithdebugcontext (core.es5.js:13475) @ object.debughandleevent [as handleevent] (core.es5.js:13053) @ dispatchevent (core.es5.js:8602) @ core.es5.js:9213 @ htmlinputelement.<anonymous> (platform-browser.es5.js:2651) @ zonedelegate.webpackjsonp.../../../../zone.js/dist/zone.js.zonedelegate.invoketask (zone.js:424) @ object.oninvoketask (core.es5.js:3881) @ zonedelegate.webpackjsonp.../../../../zone.js/dist/zone.js.zonedelegate.invoketask (zone.js:423) @ zone.webpackjsonp.../../../../zone.js/dist/zone.js.zone.runtask (zone.js:191) and error erro

php - How to replace first and last 3 characters of a string with asterisk without using any functions? -

i want replace first 3 characters , last 3 characters * sign without using built in functions. $string = array("johndoee","shawnmarsh","peterparker","johndoee","shawnmarsh","peterparker"); can guide me? there way this? this seems pointless, it's possible using string access , modification character . foreach ($strings &$string) { ($i=0; $i < 3; $i++) { $string[$i] = '*'; $string[-($i+1)] = '*'; } } note won't work if string contains multibyte characters, because it's accessing string byte array. also note requires php 7.1 in order use negative indexes. if don't have php 7.1 don't know of way replace last 3 characters without using functions. wiki

google project tango - ADF file as a map -

how can adf file map? scan region , create cad-like overhead map (or mesh-like surface object matter) use external program. can think of 3d-reconstruction have dynamicmesh , dumping out points of mesh, adf file gets re-used , extended , have more, complete, information. experimental 3d-reconstruction headed , there update google soon? thanks wiki

amazon s3 - paginating unlimited S3 size with filters -

in bucket, s3 has unlimited number of objects names epoch value in created. (e.g. "1503379525") lambda function should concatenate contents of files between specific time range (last 15 minutes). my solution use: pagination list of objects page_iterator.search("contents[?key > epoch-for-last-15-min ][]") i need consider memory limit of lambda , need make sure paginator works fine in bucket unlimited number of files. feasible solution? wiki

add 3 different table column in laravel -

i'm new laravel, got 3 tables, want retrieve value null. $noarea = membership::join('profiles', 'profiles.id', '=', 'member_history.profile_id') ->where('member_history.area_name', '')->get(); it shows result value in laravel views, now, got 6 instances of above code 3 different table column. how can sum of variable made, ($noarea, $noproduct, etc) thanks in advance. wiki

Add SSL cert to application.yml in rails -

i integrated encrypted shopping cart rails(4.2) app use paypal. currently, app reads ssl cert & key files constants used during encryption. works fine, i'd prefer not publish files github. app uses figaro gem manage environment variables in application.yml file. there way incorporate ssl certs application.yml environment variables instead of reading files? thanks in advance, brendan wiki

ffmpeg - playing, decoding, seeking, audio from command line -

there various way use audio, find several different audio players can following easily, command line: carry out standard audio function: play, pause, stop, seek(absolute), volume(absolute), mute. be able decode , raw data of audio input 1 can display waveform. -- correct answers provide player, command line functions and/or how 1 can interact programmatically if necessary. e.g., program: ffmpeg decode: pipe out using -i <filename> -f s16le -ac 1 - play: ffplay -nodisp send keys wmproc(keys don't work without window open , -nodisp closes window, wm keys) stop, pause, etc same. not have way absolutely seek or set volume. other programs might vlc, etc. the reason asking because provide several options program use user might have without having require shipping or downloading dlls(i.e., hard dependencies). bonus points being able control pitch , speed. wiki

Default configuration for WordPress Docker Container -

i'm working on project using wordpress api . this docker-compose.yml file: version: '3.1' services: wordpress: image: wordpress volumes: - ./volumes/wordpress/:/var/www/html ports: - 8080:80 environment: wordpress_db_password: root depends_on: - mysql mysql: image: mysql:5.7 volumes: - ./volumes/mysql/:/var/lib/mysql environment: mysql_root_password: root web: build: context: . dockerfile: dockerfile volumes: - ./src/:/src ports: - 8081:8081 depends_on: - wordpress in order use wordpress api , need configure wordpress container manually going http://localhost:8080/wp-admin , changing settings. thing is, need make settings changes automatic because everytime remove volume folder in order reset wordpress content , removes settings . any idea on how can achieve this? i guess settings configured via wp-admin section stored in dat

powershell - Delta file structure between two dates on windows -

the best way make question give example: have file structure (for example, folder different subfolders , files). example, today copy file structure location. after file structure changed (folders , files inserted or modified not deleted). week later want copy delta (of folders , files) week (between 2 dates) folder , files have been changed or added during week (folders not renamed). whole thing happens on windows system. ask how best(with robocopy, powershel etc.). want have right comandline. wiki

sql - replacing multiple units of specific character with one unit in hive -

i have dataset in values same except number of semicolons in resulting different records. for example if in column 1 records has a;b;c , record has a;;b;c, disabling use of distinct function in code. want treated duplicate record ;; needs replaced ; how can replace multiple ; single ; in strings in dataset in hive? you can use regexp_replace defined in hive udfs the first argument string needs changed. can call on table : with t (select "a\;\;\;b\;\;c\;d" col ) select regexp_replace(t.col, "\;+", "\;") col t this should give output +-------+ | col| +-------+ |a;b;c;d| +-------+ wiki

javascript - Generate JSON from Nested input checkbox values -

Image
i getting nested input checkbox tags in divs shown in image [problem] @ bottom of page, have submit button, when click on want form json of checked values parent nodes. if check key value, should parent keys along it. example: have selected servicename , officeid in transactiondetails, , array values in billdetails, should this { "fetchdetails": { "transactiondetails": { "servicename": "airtel mobile bill postpaid", "officeid": "209" }, "billdetails": [{ "lablename": "amount before due date", "lablevalue": "931.00" }, { "lablename": "due date", "lablevalue": "na" }, { "lablename": "account number", "lablevalue": "1116231291" }] } } [refer

android - Is RecyclerView a ViewGroup? -

is recyclerview viewgroup? as in below code, using onintercepttouchevent used viewgroups , implementing recyclerview , recyclerview viewgroup ? if not viewgroup on implementing onintercepttouchevent , views? i trying implement this: link here please me this. static class recyclertouchlistener implements recyclerview.onitemtouchlistener { private gesturedetector gesturedetector; private clicklistener clicklistener; public recyclertouchlistener(context context, final recyclerview recyclerview, final clicklistener clicklistener) { this.clicklistener = clicklistener; gesturedetector = new gesturedetector(context, new gesturedetector.simpleongesturelistener() { @override public boolean onsingletapup(motionevent e) { return true; } @override public void onlongpress(motionevent e) { view child = recyclerview

netlogo - NL does not see the extension built with NetBeans -

i have compiled extension netbeans , compiling worked fine, have included manifest file present in final jar: manifest-version: 1.0 archiver-version: plexus archiver class-manager: it.unibo.ai.manager extension-name: dialoguesimulatorext created-by: apache maven 3.0.5 build-jdk: 1.8.0_65 netlogo-extension-api-version: 6.0 and jar, named dialoguesimulatorext.jar, in folder dialoguesimulatorext, latter 1 in same folder nl model. so far good, when try load extension within model, prompted message "go download site netlogo extension" i don't understand problem might be, since there no hint apart generic "i don't find it" - though it's there... common reasons behavior? this defaultclassmanager: package it.unibo.ai; import asp4j.solver.object.filter; import asp4j.solver.object.objectsolver; import org.nlogo.api.*; public class manager extends defaultclassmanager { public static string rulefile_clingo = null; public static filter filt

angular - Jasmine: Adding Lodash to Testing -

i'm using lodash in application/component. jasmine complaining: failed: cannot read property 'eq' of undefined i've added, lodash karma.conf such as:{ pattern: './node_modules/lodash/lodash.min.js', included: true, watched: false } still getting issue, correct way of including lodash? just import lodash in component: import * _ 'lodash' wiki

javascript - Cannot get '&' prefix working when defining isolated scope in basic angular directive -

i'm boning on angular directives , having trouble isolated scope. i'm making basic directive/controller , trying throw alert on ng-click within directive setting scope attribute '&' prefix. i've been staring @ 45 minutes , can't see i'm doing wrong, nothing happening when clicking button (the other 2 prefixes working though). here code directive/controller: (function() { 'use strict'; angular .module('mepracticing') .directive('practicedirective', practicedirective); function practicedirective() { var directive = { restrict: 'ae', scope: { movie: '=', rating: '@', display: '&' }, template: '<div>movie: {{movie}}</div>' + "enter movie: <input type ='text' ng-model='movie'>" + &

Confused with the python results after using some function -

this question has answer here: in python, why can function modify arguments perceived caller, not others? 8 answers i have problem here. please @ code , don't know what's wrong in code. simple results confusing me. attached code below. import numpy np import matplotlib.pyplot plt def s(xc): n=len(xc) r=0.0 s=0.0 # calculation quartile m in range(0,n-1): n in range(m+1,n): if (xc[m] > xc[n]): q=xc[m] xc[m]=xc[n] xc[n]=q if (n % 4 < 2): q=(xc[n-n/4-1] + xc[n-n/4])*0.5-(xc[n/4-1]+xc[n/4])*0.5 else: q=xc[n-n/4-1]-xc[n/4] #calculation standard deviation m in range(0,n): r+=xc[m] s+=xc[m]*xc[m] r=np.sqrt(s/n-(r/n)*(r/n)) #calculation if (q<r): s=q else: s=r hasil=0.9*(s/1.34)*pow

javascript - How to pass controller into modal view -

i've been on unhealthy length of time. initially, modal.open darkened screen without dialog box coming up. used windowtemplateurl override templeteurl , showed. nothing controller passes through; neither cancel() function nor data api seem work. possible solution welcome. (function() { angular .module('loc8rapp') .controller('locationdetailctrl', locationdetailctrl); locationdetailctrl.$inject = ['$routeparams', '$uibmodal', 'loc8rdata']; function locationdetailctrl($routeparams, $uibmodal, loc8rdata) { var vm = this; vm.locationid = $routeparams.locationid; loc8rdata.locationbyid(vm.locationid) .success(function(data) { vm.data = { location: data } vm.pageheader = { title: vm.data.location.name }; }) .error(function(e) { console.log(e); }); vm.popupreviewform = function() {

ssas - Effecient way to get NonEmpty members -

consider dimension_a , dimension_b , measure_amt require first 100 non-empty members cross-join between dimension_a , dimension_b measure_amt. following query works takes lot of time since these dimensions large(from million 20 million) set subset(dimension_a.levels(1),0,100) set x subset(nonemptycrossjoin(a,dimension_b.levels(1)), 0, 100) select [measures].[measure_amt] on 0 , x on 1 my_cube and clause, with set subset(dimension_a.levels(1),0,100) set x subset(nonemptycrossjoin(a,dimension_b.levels(1)), 0, 100) select [measures].[measure_amt] on 0 , x on 1 my_cube dimension_c.member_c1 fetching first 100 members of single dimension quick, nonempty function accounts of time. since require first 100 non-empty members , not next subset, there way write better query. when say, "i require first 100 non-empty members cross-join between dimension_a , dimension_b measure_amt", assume mean want top 100 results, measure_amt not null 2 cross-jo

ios - OnScroll Load more data -

i implemented search api , working fine in ios objective c. getting result server. , again need call same service when scroll end on tableview. , need pass parameter "page=2" @ same time on same page. , need show next page data on table view end. this pagination concept. please go through link , better idea : swift tableview pagination i can show have done in project : func tableview(tableview: uitableview, willdisplaycell cell: uitableviewcell, forrowatindexpath indexpath: nsindexpath) { if indexpath.row = arraydatafortable.count && page <= totalnumberofpages { page += 1 } } in above code arraydatafortable contains data show in table. if user has scrolled last cell adding page count increase code. getting "totalnumberofpages" api , maintaining page count "page" locally starting 0. for objective c use method: - (void)tableview:(uitableview *)tableview willdisplaycell:(uitableviewcell *)cell forr

user interface - How to implement folder-picker android? -

i'm writing small corporate program sends photos company's server. each photo should fall specially allocated folder, example photo of forest should in folder nature -> forest. directory tree i'm getting server list of objects fields: name id parentid prefix where prefix ​​a numeric value, example: nature - 1000; forest - 1100 hill - 1200 animals - 2000 bear - 2100 mouse - 2200 and on. in order send photo user needs select appropriate folder. question is, how implement easy , clear folder-picker? at moment, picker made using autocompletetextview, in order enter first 3 letters of folder name - name should remembered user , if folders around 10, not difficult, if folders become more 100 - hold names in head become impossible. maybe have idea how implement user interface select folder, without forcing employees learn hundred names? wiki

Java android asyncHttpClient ENOBUFS (No buffer space available) -

when try connect server (log in server) see : enobufs (no buffer space available) java.io.ioexception: unknownhostexception exception: unable resolve host "****.***.net.pl": no address associated hostname but when restart phone everythink ok , did wrong ? wiki

swift - Connecting menu items to the first responder and multiple view controllers at the same time -

Image
i have main view controller container view in it. i’m able create ibaction in main view controller , connect menu item action in first responder successfully. when connecting different menu item container view controllers action, menu item stays grayed out. in main view controller: @ibaction func outermenutest(_ sender: any) { print("outermenutest") } in container view controller: @ibaction func containermenutest(_ sender: any) { print("containermenutest") } how connect menu items view controllers in container view controllers @ same time? need both menu items enabled. the easiest way connect menu items other app delegate use first responder in storyboard. need have created ibaction appropriate class before making connection. may need clean and/or build project force xcode index ibaction s. provided xcode behaving , actions in classes xcode sees potential first responder show in list of options when control drag menu item first r

c - Calculate the range of double -

as part of exercise "the c programming language" trying find way calculate maximum possible float , maximum possible double on computer. technique shown below works float s (to calculate max float) not double : // max float: float f = 1.0; float last_f; float step = 9.0; while(1) { last_f = f; f *= (1.0 + step); while (f == infinity) { step /= 2.0; f = last_f * (1.0 + step); } if (! (f > last_f) ) break; } printf("calculated float max : %e\n", last_f); printf("limits.h float max : %e\n", flt_max); printf("diff : %e\n", flt_max - last_f); printf("the expected value? : %s\n\n", (flt_max == last_f)? "yes":"no"); // max double: double d = 1.0; double last_d; double step_d = 9.0; while(1) { last_d = d; d *= (1.0 + step_d); while (d == infinity) { step_d /= 2.0; d = last_d * (1.0 + step_d); } if (! (d > last_d)

vba - Convert an embedded Excel Picture into an Object -

i created logo in publisher. using techsmith snagit, captured image , saved jpeg. fetched image inside of excel , placed in sized cell(s) i don't want have file has image (have seen in researching solutions) -- nevertheless, must self-contained in excel vba application. excel (2013) has tendency either erase image or creeps when app opened on other displays. (and activex controls, too) so... friend wrote code stretches or centers activex controls inside cells. works brilliantly, except want apply code picture (say picture 12) ... logo ... if convert picture object (similar commandbutton or spinbutton, think code work. my work around had been insert logo bitmap commandbutton, , apply stretching code button... have image size limitations , bitmap of low resolution, makes beautiful logo terrible. any suggestions appreciated. maybe use base64 inserting image sheet using base64 in vba? https://www.base64-image.de/ wiki

sass - Simplify matching elements in SCSS -

the html dom structure have is, sort of, repetitive. there practice refactor sass rules? html: <div name="opportunitydetailview" class="actor-wrapper"><div name="opportunitydetailview" class="detail-view expansion-bottom-normal">...</div></div> <div name="applicationdetailview" class="actor-wrapper"><div name="applicationdetailview" class="detail-view expansion-bottom-normal">...</div></div> <div name="profiledetailview" class="actor-wrapper"><div name="profiledetailview" class="detail-view expansion-bottom-normal">...</div></div> scss case 1: div[name="opportunitydetailview"] > div[name="opportunitydetailview"], div[name="applicationdetailview"] > div[name="applicationdetailview"], div[name="profiledetailview"] > div[name=&q

text to speech - Custom voice for TextToSpeech Android -

is there possibility set custom voice tts baby girl voice? i have tried getvoices() following, if (build.version.sdk_int >= 21) { set<locale> localeset = tts.getavailablelanguages(); (locale locale : localeset) { log.v(tag, locale.getdisplayname() + " - " + locale.getdisplaylanguage() + " - " + locale.getcountry()); if (locale.getdisplaylanguage().equals("tamil")) { result = tts.setlanguage(locale); if (result == texttospeech.lang_missing_data || result == texttospeech.lang_not_supported) { log.e("tts", "this language not supported"); } else { tts.setspeechrate(0.05f); //tts.setpitch(5.0f); fabspeak.setenabled(true); speakout(); } } } set<voice> voices = tts.getvoices(); (voice voice : voices) { log.v(tag, voice.getn

ios - Polyline won't show up in MapKit -

Image
i'm using xcode 8.3.2 first import mapkit. set markers map. add following code add polyline map won't show any. class viewcontroller: uiviewcontroller, mkmapviewdelegate { @iboutlet weak var mapview: mkmapview! override func viewdidload() { self.mapview.delegate = self super.viewdidload() let template = "http://tile.openstreetmap.org/{z}/{x}/{y}.png" let point1 = cllocationcoordinate2d(latitude: 6.9271, longitude: 79.8612); let point2 = cllocationcoordinate2d(latitude: 9.6615, longitude: 80.0255); let overlay = mktileoverlay(urltemplate: template) overlay.canreplacemapcontent = true let location = cllocationcoordinate2dmake(6.878069, 79.892119) mapview.add(overlay, level: .abovelabels) mapview.setregion(mkcoordinateregionmakewithdistance(location, 1100, 1100), animated: true) let pin = pinannotation(title: "nimbus", subtitle: "best"

javascript - Set bs64 string for pdf into PdfMake js-plugin -

on client side have bs64 string pdf files in memory. can set bs64 string pdfmake js-plugin ? because must put lot of files in 1 big file. this: var docdefinition = { content: [ { pdf: 'data:pdf/jpeg;base64,...encodedcontent...' } }; pdfmake.createpdf(docdefinition).download('name.pdf'); or pdfmake-js have method images? thanks answer! wiki

python - Create array based on boolean logic -

problem 1 i have numpy array data[:,0:5] out[98]: array([[ 1.00200300e+09, 1.00000000e+00, 2.00000000e+00, 3.00000000e+00, 4.00000000e+00], [ 1.00200400e+09, 1.00000000e+00, 2.00000000e+00, 4.00000000e+00, 5.00000000e+00], [ 1.00200300e+09, 3.00000000e+00, 4.00000000e+00, 1.00000000e+00, 2.00000000e+00], [ 1.00200400e+09, 4.00000000e+00, 5.00000000e+00, 1.00000000e+00, 2.00000000e+00], [ 5.70580591e+10, 5.70000000e+01, 5.80000000e+01, 5.90000000e+01, 6.00000000e+01], [ 5.70580601e+10, 5.70000000e+01, 5.80000000e+01, 6.00000000e+01, 6.10000000e+01], [ 5.70580591e+10, 5.90000000e+01, 6.00000000e+01, 5.70000000e+01, 5.80000000e+01], [ 5.70580601e+10, 6.00000000e+01, 6.10000000e+01, 5.80000000e+01, 5.70000000e+01]]) each of data[:,1:5] refers position on 2d grid, of there 64 positions in total. i&

XSD Namespace element different to XML namespace allowed? -

im trying find out whether following case allowed: lets have following xsd: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:xyz="http://www.example.com/abc" targetnamespace="http://www.example.com/abc" elementformdefault="qualified" attributeformdefault="qualified"> does following xml uses correct namespace? (please consider namespace only): <?xml version="1.0" encoding="utf-8"?> <def:whatever xmlns:def="http://www.example.com/abc"> <def:adress="street 1"> ... yes does. (stackoverflow doesn't short answers can't think of else worth saying.) wiki

javascript - Full Screen Overlay on Link Click -

a client has requested project page has similar feel this . whereby, click '+' button display project information, in full-screen overlay window. i'm familiar html / css & while have dabbled php have never touched js. , i'm pretty sure developer of above site has used here. so, questions are: how achieve outcome (or close it)? note - site being developed on wp. i'm not sure if changes anything. once done, how add project information overlay? i created small pen demonstrating how can achieve using css , little plain javascript: https://codepen.io/tauka/pen/ojeqze .overlay { position: fixed; top: 0; left: 0; width: 0; height: 100%; background-color: green; transition: width 2s ease-out; overflow-x:hidden; } important moments: .overlay must have width: 0 , position: fixed .content must have width in absolute measure, i.e. px/rem/em hope helps! wiki

ftp - Reliable Ways to Send Large Files to Clients -

we have need regularly provide large files clients on daily or weekly basis. our process this: internal process creates file , places in specific folder our client connects via sftp , downloads file this work when files small. bigger (50-100 gb in size), keep getting network interruptions , internal disk space related issues. what i'd see following: our internal process creates file. this file copied intermediary service (similar filedropper). our client download file intermediary service. i'd know if other people had similar issues , possible solutions in place. file dropper works great non-business related files won't putting client data on there. have office 365 subscription. tried see use haven't found yet solve this. any hints, suggestions or feedback appreciated! consider amazon s3 . have used several times in past , reliable both processing lot of files , processing large files wiki

How do I deploy to Azure App Service with PowerShell? -

i have looked around , thousands of commands in azure , azurerm commandlets in powershell, i'm still not sure how this. what have working far: installed azure , azurerm modules , imported them script generated "*.publishsettings" file get-azurepublishsettingsfile command imported "*.publishsettings" file can acccess website "stop-azurewebsite" , "start-azurewebsite" commandlets what need do: create new deployment , push files app-service site. notes: not have visual studio project , .csproj file configs. want take contents of folder , push website. any useful documentation bad on details , there thousands of commands in powershell go through. you check blog:deploy app service using azure powershell deployment slot . get-azurepublishsettingsfile import-azurepublishsettingsfile .\your-publish-settings-credentials.publishsettings get-azuresubscription select-azuresubscription -subscriptionname "the subscri

python - Best image hosting for django -

i building project using django, have lots of images sent users, wonder image hosting suitable django or mybe, should host them directly on server? it depends on requirement. if web application not huge, can use services amazon s3 host images application. there apis available in python/django can upload , download objects s3. disadvantage of hosting images in server end maintaining server amazon s3, easier maintain servers micro instance large instances , cost going low. wiki

asp.net mvc - How do I make my published web app that is installed on my IIS be accessed by another computer -

i published asp mvc app using iis. main page address localhost/hr/index. how can make computer able access , use web app? get computer ip address cmd command 'ipconfig'. from computer browser 'youtipaddress:80/hr/index'. make sure computer within lan. cheers..... wiki

elasticsearch - DSL Query: Sale Amount Per Second in a Five Minute Window -

i trying total amount of sale divide 300 secs sale amount per second in 5 minute window i far able construct query until here. there seems no way division on “total_value_five_mins”. my elasticsearch version 2.3 tried elasticsearch docs can’t understand single one. { "size": 0, "query": { "aggs" : { "five_minute_data" : { "date_histogram" : { "field" : "timestamp", "interval" : "5m" }, "aggs": { "total_value_five_mins": { "sum": { "field": "sales" } } } } } } you can use scripting in sum aggregation this: { "size": 0, "query": { "aggs" : { "five_minute_data" : { &quo

android - Visual Studio Xamarin Performance Issues -

i have below issues on visual studio - xamarin , tried possible solutions available on internet fix it. xamarin slow on machine, stops responding while loading designer agent page while work android , storyboard page while work ios. below machine hardware configuration. using on hp notebook. processor - intel (r) core (tm) i5 -6200u cpu @ 2.30ghz 2.40 ghz ram - 8gb 64 bit operating system - windows 10 connection established between notebook , macbook disconnects often. everytime happens have close visual studio , reopen it. takes forever connect, , should restart machine. below software versions installed. visual studio 2015 version 14.0.25420.1 xamarin vs version 4.2.1.62 xamarin profiler version 1.4.0.1 could suggest detailed hardware requirements working on vs xamarin. wiki

List of months within multiple date ranges in mysql -

i have list of date ranges , list of months within these date ranges. can query date ranges so: select id, start, end date_range and query give following output: 1, 01-01-2016, 25-03-2016 2, 26-03-2016, 30-03-2016 3, 30-12-2016, 08-01-2017 now find mysql query lists months within these date ranges. should give following output: 01-2016 02-2016 03-2016 12-2016 01-2017 there examples here on how list of month between 2 dates, such as: creating list of month names between 2 dates in mysql how list of months between 2 dates in mysql but these examples single date range, have multiple date ranges. great if can find sql query problem. here solution: #drop table if exists monthtest; create table monthtest(id int unsigned auto_increment primary key, `start` datetime, `end`datetime); insert monthtest(`start`, `end`) values ('2016-01-01', '2016-03-25'), ('2016-03-26', '2016-03-30'), ('2016-12-30', '2017-0