Posts

Showing posts from January, 2014

navbar - Font Awesome use inside the Yii2 SideNavbar -

Image
i have followed guidelines given github yii2 fontawesome , installed via composer. problem code given specific icon sidenavbar not working me. i have used fa::icon('home') inside sidenav menu code out put "> this. not home icon. code used in sidenav menu. <?= sidenav::widget([ 'type' => sidenav::type_default, 'heading' => 'system functions', 'items' => [ [ 'url' => '../dashboard/manager', 'label' => yii::t('app','dashboard'), 'icon' => 'home', 'active' => ($currentpage == 'manager') ], [ 'url' => '#', 'label' => 'purchase', 'icon' => fa::icon('home'), 'items' => [ [ 'url' => '../dashboard/suppliers', ...

mysql on amazon linux - MySQL Daemon failed to start -

i tried restarting ec2 instance , sudo service httpd restart . but still message: [ec2-user@ip-* ~]$ sudo service mysqld start mysql daemon failed start. starting mysqld: [failed] also message: [ec2-user@ip-* ~]$ mysqld 160127 7:01:48 [note] mysqld (mysqld 5.5.46) starting process 2745 ... 160127 7:01:48 [warning] can't create test file /var/lib/mysql/ip-*.lower-test 160127 7:01:48 [warning] can't create test file /var/lib/mysql/ip-*.lower-test 160127 7:01:48 [note] plugin 'federated' disabled. mysqld: can't find file: './mysql/plugin.frm' (errno: 13) 160127 7:01:48 [error] can't open mysql.plugin table. please run mysql_upgrade create it. 160127 7:01:48 innodb: innodb memory heap disabled 160127 7:01:48 innodb: mutexes , rw_locks use gcc atomic builtins 160127 7:01:48 innodb: compressed tables use zlib 1.2.8 160127 7:01:48 innodb: using linux native aio 160127 7:01:48 innodb: initializing b...

php - Login app using MySQL database with Android Studio -

as title says, i'm trying make first android app simple login feature fetching username , password mysql database i'm getting following error in logcat , app crashes when click on login button 01-27 12:35:11.787 2509-2525/? e/androidruntime: fatal exception: asynctask #2 process: com.example.klm.sql, pid: 2509 java.lang.runtimeexception: error occurred while executing doinbackground() @ android.os.asynctask$3.done(asynctask.java:309) @ java.util.concurrent.futuretask.finishcompletion(futuretask.java:354) @ java.util.concurrent.futuretask.setexception(futuretask.java:223) @ java.util.concurrent.futuretask.run(futuretask.java:242) @ android.os.asynctask$serialexecutor$1.run(asynctask.java:234) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1113) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:588) @ java.lang.thread.run(thread.java:818) caused by: java.lang.classcastexception: com.android.okhttp.internal.huc.httpur...

android - How can i send push notification on any item update event in parse.com -

i using parse application i have 1 fragment on user have write article , save on parse not approve when admin approve user filed want send push notification automatically user particular article approved message how can implement things..? parse.cloud.aftersave("data", function(request) {var dirtykeys = request.object.dirtykeys();for (var = 0; < dirtykeys.length; ++i) { var dirtykey = dirtykeys[i]; if (dirtykey === "name") { //get value data object var username = request.object.get("name"); //set push query var pushquery = new parse.query(parse.installation); pushquery.equalto("name",username); //send push message parse.push.send({ where: pushquery, data: { alert: "name updated", sound: "default" ...

why does console.log output all records and not response.end - Node.js -

im newbie node.js , i'm trying output data html. code works when use console.log not when use response.end. when use response.end see on record while when use console.log see records see full code below: var http = require('http'); var formoutput; var woocommerceapi = require('woocommerce-api'); // initialize woocommerceapi class var woocommerce = new woocommerceapi({ //url: 'http://example.com', // store url (required) }); function handlerequest(response) { // example woocommerce.get('products', function (err, data, res) { //console.log(res); //var fs = require('fs'); //var jsoncontent = json.parse(json.stringify(res, null, 4)) var jsoncontent = json.parse(res) (var = 0; < jsoncontent["products"].length; i++) { var name = jsoncontent["products"][i]; // works , can output records //console.log(name['title']); ...

android - i want TimerTask pause and resume -

i working in game have need use time update in every second.i using timertask.i want pause time when clicked on button , want resume again when clicked on resume button other activity.how please me. t=new timer(); { t.scheduleatfixedrate(new timertask() { public void run() { runonuithread(new runnable() { @override public void run() { textview tv = (textview) findviewbyid(r.id.time); tv.settext(string.format("%02d:%02d",minute,seconds)); time += 1; seconds += 1; if(seconds==60) { seconds=0; } minute=time/60; } }); } }, 0, 1000); } try this want copy , paste public class mainactivity extends activity { edittext t; button b; button b2; timer timer; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); b=(button)findviewbyid(r.id.button1); b2=(button)findviewbyid(r.id.button2); t=...

playframework 1.x - How to understand the method of `ApplicationClassloaderState#hashCode`? -

when read source of play framework 1.2.5, found class: package play.classloading; import java.util.concurrent.atomic.atomiclong; /** * each unique instance of class represent state of applicationclassloader. * when classes reloaded, them applicationclassloader new state. * <p/> * makes easy other parts of play cache stuff based on * current state of applicationclassloader.. * <p/> * can store reference current state, later, before reading cache, * check if state of applicationclassloader has changed.. */ public class applicationclassloaderstate { private static atomiclong nextstatevalue = new atomiclong(); private final long currentstatevalue = nextstatevalue.getandincrement(); @override public boolean equals(object o) { if (this == o) return true; if (o == null || getclass() != o.getclass()) return false; applicationclassloaderstate = (applicationclassloaderstate) o; if (currentstatevalue != that.currents...

javascript - How to select/remove the text blocks to first div? and if the text blocks overflow it will go to the 2nd div -

Image
i want select text blocks underline , if current text blocks going exceed underline go 2nd underline. 2 underline 2 div have different i.d text blocks in array. how using javascript or jquery? select , remove of text blocks. , if text blocks going overflow first div can go second div.

war - How Exclude some files from Eclipse Java EE Web Application project Deployment Assembly -

Image
as described question title, i've eclipse java ee web application project. webcontent folder i've files , subfolder in witch there .ds_store osx system files cause problem because included when export war file. i know there way exclude file or folder src folder, not webcontent! any ideas? regards why not remove (delete or move folder) if shouldnt in webcontent folder? otherwise use deployment assembly settings. open project properties, , remove top webcontent , add want packaged. also can exclude files/folder setting resource filter. add filter... shown below:

java - Serialize proxy object created by cglib -

as title, use jersey return object json, object created cglib proxy: @get @produces(mediatype.application_json) @path("test") public response test() { enhancer enhancer = new enhancer(); enhancer.setsuperclass(a.class); enhancer.setcallback(new invocationhandler() { public object invoke(object proxy, method method, object[] args) throws throwable { return "my name"; } }); return response.ok(enhancer.create()).build(); } @data @xmlaccessortype(xmlaccesstype.property) public static class { private string name; } it cannot work because enhancer.create() return proxy object of class a, not real object of class a. org.codehaus.jackson.map.jsonmappingexception: no serializer found class myrest$1 , no properties discovered create beanserializer (to avoid exception, disable serializationconfig.feature.fail_on_empty_beans) ) (through reference chain: myrest$a$$enhancerbycglib$$fdcf8406["callbacks...

c# - Renaming project -> "Could not resolve this reference. Could not locate the assembly" -

Image
everytime build solution following warning: warning not resolve reference. not locate assembly "wordapi". check make sure assembly exists on disk. if reference required code, may compilation errors. offertehost however seems work fine, it's warning, it's bugging me. how did start? i renamed 1 of projects in solution. used right click -> rename option. used search , replace rename namespace files in project. changed assemblyinfo.cs file. in project properties on application tab changed assembly name , default namespace . i'm using costura.fody if matter. how did try fix it? i changed hintpath in project file of executing assembly: <hintpath>..\wordapi\bin\debug\wordapi.dll</hintpath> removed reference executing assembly , readded it. deleted debug/release folders across solution , rebuilt solution i can't find solution, it's tempting start blank solution , copy in there... the properties of r...

javascript - angularjs url together with django framework -

i have small issue angular's ng-click() , redirecting new page. here problem: in html have small d3 app attribute: .attr("ng-click", "go(" + "'" + "{% url 'home' %}" + "'" + ")") in js document have: $scope.go = function(link) { $location.path(link); }; my base url sth like: 127.0.0.1:8000/username/test/ now when click on d3 element following: 127.0.0.1:8000/username/test/#home/ however wish have: 127.0.0.1:8000/home/ have got tips fix that? tried $location.hash(...) , no luck... you can use $window service: .attr("ng-click", "$window.location.href = '{% url 'home' %}'") $location when need stay inside same single page.

machine learning - How to create dataset similar to cifar-10 -

i want create dataset has same format cifar-10 data set use tensorflow. should have images , labels. basically, i'd able take cifar-10 code different images , labels, , run code. haven't found information on how online, , new machine learning. i have run cifar10 code on few of own data sets. believe should able give answer. before though, need understand format in cifar10 data set in. if refer to: https://www.cs.toronto.edu/~kriz/cifar.html , , specifically, binary version section, see this: in other words, first byte label of first image, number in range 0-9. next 3072 bytes values of pixels of image. first 1024 bytes red channel values, next 1024 green, , final 1024 blue. values stored in row-major order, first 32 bytes red channel values of first row of image. intuitively, need store data in format. can next sort of baseline experiment first, images same size , same number of classes cifar10 , put them in format. means images should have size...

delphi - Combining OnValidate and OnBeforePost? -

Image
as example, have form dbnavigator , few dbedits. i want achive following: when user enters wrong in dbedit , wants switch control, warning should displayed, can continue working. when user wants post dataset, post rejected, , warning displayed again. the problem is, onvalidate tfieldnotifyevent , therefore cannot tell application if edit valid, there no way check if valid before post. i have tried following: idea 1: let onbeforepost validate , throw exception pro: invalid data not posted the user can continue working , revert changes using dbnavigator if cannot complete form. contra: no warning displayed when user leaves dbedit (low priority) validations have in 1 single point. better object orientated if validate done directly in tfield. idea 2: throw exception in onvalidate pro: it impossible post invalid data. contra: the user might stay in endless loop if unable enter valid (e.g. because doesn't know enter), , cannot press "revert...

invoke non static method in c# -

i want invoke class "***" solution works me want invoke solution gives me error : type t = type.gettype(svclass); methodinfo method = t.getmethod("execute", bindingflags.instance| bindingflags.public); ret = (string)method.invoke(null, new object[] { context.request}); public string execute(httprequest req) so tried methodinfo method = t.getmethod("execute", bindingflags.instance | bindingflags.public); but gives me error "non-static method requires target" *** working solution static method type t = type.gettype(svclass); methodinfo method = t.getmethod("execute", bindingflags.static| bindingflags.public); ret = (string)method.invoke(null, new object[] { context.request}); to invoke public class xxxxx { public static string execute(httprequest req){} } the secret change binding flags methodinfo matches signature of method wish call. eg: public static string execute(httprequest req...

javascript - Buttons that changes state to refresh Jquery -

i have sample: http://jsfiddle.net/jfgve/1017/ code html: <i class="fa fa-circle-o circle crad" id="radio"></i> <i class="fa fa-circle-o circle crad" id="radio"></i> <i class="fa fa-circle-o circle crad" id="radio"></i> <i class="fa fa-circle-o circle crad" id="radio"></i> <i class="fa fa-circle-o circle crad" id="radio"></i> code js: var firstbuttonobject = localstorage.getitem('class'); if(firstbuttonobject){ $('.crad').addclass(firstbuttonobject); } $('.crad').click(taskfunction); function taskfunction(){ if ( $( ).hasclass( "fa-circle" ) ) { $( ).removeclass('fa-circle').addclass('fa-circle-o'); localstorage.setitem('class', 'fa-circle-o'); ...

HTML5 canvas line - how can I let them appear smoother? -

Image
i want make lines have sharp edges, e.g. if use line write word. in photoshop can use brushes less sharp or can take high resolution , zoom out. there nice trick html5 canvas lines, too? canvas.addeventlistener('mousemove', function(e) { this.style.cursor = 'pointer'; if(this.down) { with(ctx) { beginpath(); moveto(this.x, this.y); lineto(e.pagex , e.pagey ); strokestyle = red; ctx.linewidth=1; stroke(); } this.x = e.pagex ; this.y = e.pagey ; } }, 0); as you’ve discovered, when let user draw polyline mousemove end list of points draws jagged line. what need is: reduce number of points keep resulting path true user’s intended shape. so want go "before" "after": the ramer-douglas-peucker polygon simplification algorithm you can using ramer-d...

How to compare two images in JavaCV and draw rectangles the part which is different in these two images -

Image
i want compare 2 images using javacv, , draw rectagle in part these images not same example below. i tried code below, needs 1 image input, , draw rectangle on objects in image. iplimage img=cvloadimage("image_path_and_name.jpg"); cvsize cvsize = cvsize(img.width(), img.height()); iplimage gry=cvcreateimage(cvsize, img.depth(), 1); cvcvtcolor(img, gry, cv_bgr2gray); cvthreshold(gry, gry, 200, 255, cv_thresh_binary); cvadaptivethreshold(gry, gry, 255, cv_adaptive_thresh_mean_c, cv_thresh_binary_inv, 11, 5); cvmemstorage storage = cvmemstorage.create(); cvseq contours = new cvcontour(null); int noofcontors = cvfindcontours(gry, storage, contours, loader.sizeof(cvcontour.class), cv_retr_ccomp, cv_chain_approx_none, new cvpoint(0,0)); cvseq ptr = new cvseq(); int count =1; cvpoint p1 = new cvpoint(0,0),p2 = new cvpoint(0,0); (ptr = contours; ptr != null; ptr = ptr.h_next...

sqlite - CDRstats installation error -

i'm trying install cdrstats pusher on debian 8.2 machine asterisk 11.13 installed. how ever it's getting me message while #make build: installation url: http://docs.cdr-stats.org/en/latest/installation/install-cdr-pusher.html error: root@cdrstats:/opt/app/cdr-pusher# make build found packages fetch_orm.go (fetch) , insert_gorm.go (main) in archive found packages fetch_orm.go (fetch) , insert_gorm.go (main) in archive cp -i cdr-pusher.yaml /etc/cdr-pusher.yaml cp: overwrite ‘/etc/cdr-pusher.yaml’? y # _/opt/app/cdr-pusher ./cdr_generator.go:55: undefined: orm.dr_sqlite makefile:29: recipe target 'build' failed make: *** [build] error 2 check // version 1.6 orm.drmysql orm.drsqlite orm.drpostgres // < 1.6 orm.dr_mysql orm.dr_sqlite orm.dr_postgres changes in file cdr_generator.go line 55 orm.registerdriver ("sqlite3" orm.dr_sqlite) by other= orm.registerdriver ("sqlite3" orm.drsqlite) and make build , work

c++ - Is there a better option than reinterpret_cast<char*> when reading from std::istream? -

i have following piece of code: std::istream is; // ... stream initialization ... while(is) { uint32_t next4bytes = 0; is.read(reinterpret_cast<char*>(&next4bytes), 4); if(next4bytes == 218893066) { is.seekg(-4, std::ios_base::cur); break; } else is.seekg(-3, std::ios_base::cur); } is there other better way reinterpret_cast<char*> read 4 bytes std::istream uint32_t ? (obviously other c-style cast) i don't think there is, , don't think need one. you're taking 4 bytes , re-interpreting them; reinterpret_cast precisely describes intent.

delphi: how to to store TCustomFrames and records in one list -

i using tobjectlist<tcustomframe> store tcustomframes . want store more information regarding tcustomframe in same list. record nice. which delphi class prefer store tcustomframes , records in same list? the tcustomframes , records added @ runtime. create single record hold information: type tframeinfo = record frame: tcustomframe; foo: string; bar: integer; end; hold in tlist<tframeinfo> . i note using tobjectlist<t> rather tlist<t> . reason doing if setting ownsobjects true . seems unlikely since doubt list in charge of lifetime of gui objects. note future, if find using tobjectlist<t> ownsobjects set false may switch tlist<t> . now, in case need list control lifetime you'd best using class rather record tframeinfo . type tframeinfo = class private fframe: tcustomframe; ffoo: string; fbar: integer; public constructor create(aframe: tcustomframe; afoo: string; abar: ...

c# - How to bind MapIcon on Bing Map in Windows Phone 8.1 -

i use bing map on windows phone 8.1 app. precisally, in xaml file, wrote <maps:mapcontrol x:name="map" loaded="map_loaded"> <maps:mapitemscontrol itemssource="{binding locations}"> <maps:mapitemscontrol.itemtemplate> <datatemplate> <image source="images/arte_icon_label.png" height="25" maps:mapcontrol.location="{binding geopoint}" maps:mapcontrol.normalizedanchorpoint=".5,.5"/> </datatemplate> </maps:mapitemscontrol.itemtemplate> </maps:mapitemscontrol> </maps:mapcontrol> i want add many images, don't know code procedure add theme. can me please? do want add multiple mapicon c# code? code snippet following post . private async task searchnearbyincidents(geopoint location) { ilist<geopoint> geopoints...

symfony - Symfony2 My custom form field type isn't populated with data from entity -

i created simple custom field class inputwithdescriptiontype extends abstracttype { public function configureoptions(optionsresolver $resolver) { $resolver->setdefaults(array( 'description' => '', )); } public function buildform(formbuilderinterface $builder, array $options) { $builder ->setattribute('description', $options['description']) ; } public function buildview(formview $view, forminterface $form, array $options) { $view->vars['description'] = $options['description']; } public function getparent() { return 'text'; } public function getname() { return 'input_with_description'; } } and added form $builder ->add('name') ->add('about', 'input_with_description', array( 'description' => "description", 'label' => "label", )) wh...

c - how to implement Modbus RTU Master in Digi Module Connect me 9210 -

i trying implement modbus rtu master in digi module connect me 9210 device. purpose using libmodbus library. what device name have give in netos connect local computer.? now using ctx = modbus_new_rtu("com3", 19200, 'n', 8, 1); modbus_set_slave(ctx, server_id); /* tcp */ // ctx = modbus_new_tcp("10.0.0.66", 502); modbus_set_debug(ctx, true); if (modbus_connect(ctx) == -1) { fprintf(stderr, "connection failed: %s\n", modbus_strerror(errno)); modbus_free(ctx); return -1; } but keep saying connection failed. have tried "/dev/usb0" , "/dev/ttys0". have modbus slave in local computer test module client. i have fixed errors . there api issue in digi module while opening default port "/com/0". also had change libmodbus library little bit work digi because using flags not supported device.

Specifying build parameters to FAKE -

Image
i asking update date answer answered question: can pass parameter f# fake build script? here build.fsx let revisionnumber = getbuildparamordefault "rev" "123" target "log" (fun _ -> trace ("revision number: " + revisionnumber) ) runtargetordefault "log" output running fake.exe .\build.fsx : perfect! output running fake.exe .\build.fsx rev=456 (as suggested answer: https://stackoverflow.com/a/26597179/2382536 ): starts with but @ bottom gives correct result: what format need pass parameters in rid of warning message? passing parameters done using --envvar parameter. until can add parameters in way did after build target not anymore. believe changed in order not confuse build parameters (optional) build target name. so, try this: fake build.fsx push --envvar rev 456

How can I change WebUI interface port 8080 for RethinkDB on Linux? -

i'm running rethinkdb on amazon linux ami. have services running on 8080 need change port webui interface. how that? i happen find documentation here https://www.rethinkdb.com/docs/cli-options/ $ rethinkdb --bind --http-port 9090

photo - Strange pattern on PS3 Eye cameras -

Image
i bought 2 ps3 eye cameras stereo vision, getting strange pattern in images: covering lens shows this: and identical (but bit darker) other camera: does know might causing this? appears issue sensor still present when lens covered, present on both cameras. i have disassembled both cameras, have not removed lens, damaged electronics (eg: static)? also: if want use stereo vision, affect disparity map (considering same on both images)?

XMPP push notifications causing problems (delay + duplications) in messages -

xmpp push notifications causing problems (delay + duplications) in messages. i have created chat application using xmpp + ejabberd. without push notifications: both single , group chat messages working perfectly. with push notifications: sometimes works perfectly.notifications triggered , messages received out delay or duplications. sometimes no notifications triggered (while app in background) messages received perfectly. sometimes notifications triggered messages received delay , duplications. everything on sever side configured correctly.they advised fix issues making sure each session connects 1 persistent resource, making connection stable using whitespace keep alive , when connection lost rebinding same resource. i have stream management,xmppstream.enablebackgroundingonsocket , app provides voice on ip services background mode enabled. when user logs out or app terminated teardown stream , send unavailable presence. below code xmpp stream push notificati...

spring - Start two springboot apps in eclipse -

is possible start 2 spring boot applications in eclipse, in same workspace in same time? how can set 2 different ports 2 spring boot applications? yes . possible run 2 spring boot apps same time in same workspace in eclipse . possible because each spring boot app comes embedded tomcat server , have make sure each of them uses different port number respectively. in each spring boot application, add application.properties file in src/main/resources folder. override default 8080 port, have use server.port property in application.properties file. make sure set different port in each of application. example, set server.port=8888 in 1 application , server.port=9999 in application, app1 run on 8888 port , app2 run on 9999 port. to scan free port (using os natives prevent clashes) use server.port=0 .

Gwt-platform with UiBinder and UiEditors Framework (GWT Editors) -

i struggle editor framework of gwt. because documentation lame- no hurt feelings- saying. now have problem cannot execute button event on editor. error: uncaught com.google.gwt.event.shared.umbrellaexception: exception caught: (typeerror) : cannot read property 'onloginbuttonclick_3_g$' of undefined i not sure doing wrong. didn't found example of that. hope help. here code: editor public class logineditor extends viewwithuihandlers<logineditoruihandlers> implements editor<loginmodel> { private verticalpanel widget = new verticalpanel(); materialtextbox email = new materialtextbox(); materialtextbox password = new materialtextbox(); materialbutton btnlogin = new materialbutton(); public logineditor() { initwidget(widget); email.setplaceholder("e-mail"); password.setplaceholder("password"); btnlogin.settext("login"); btnlogin.addclickhandler(new clickhand...

php - How to get all languages data in codeigniter -

i trying fetch language files data , store them in array. able default language data. i need language data sync them in files. far have tried following code, public function syncjslanguagefile($language) { //i need german (de) , other data data $this->lang->load('translate','de'); //but can default language data. think above line not working. $languagemessage = $this->lang->language; echo "<pre>"; print_r($languagemessage); die; } i don't want change default language, need language data in array specific purpose. should not change site default language. please me out here. i have tried, $data = $this->lang->load('translate','de', true); but not working. :( please these steps //load helper language $this->load->helper('language'); //mytest language file in english folder //application\language\english\mytest_lang.php $this->lang->load(...

sql - Why like operator doesn't work - Sqlite -

i have query return search base operation '%srch' srch=search.gettext().tostring(); ... db.rawquery("select * mytable name 'srch%' or name '%srch' ",null); but doesn't work. can explain why doesn't work, , how can fix ? thanks lot you can fix query changing below: db.rawquery("select * mytable name ?", new string[] { "%" + srch + "%" });

java - How can I modify a variable throughout the chain of calling of class through it's objects? -

i have 3 classes. class clientconnect(){ url url = new url("http:xxx.xx.xx"); api api = new api(url); api.checks.count(); } class api{ ... url url; checks checks = new checks(url); public api(url url){ url = new url(url+"/api"); } } class checks{ ... public checks(url url){ url = new url(url+"/checks"); } public void count(){ url = new url(url+"/count"); system.out.println(url); } } i want output of calling of api.checks.count() http:xxx.xx.xx.xx/api/checks/count , getting null. how can carry forward modified url next chain of class. yeah, can in other ways too, want chain these using objects of classes only. the issue lies in api class, want modified url sent there while creating object of checks class inside. modify api constructor, , pass url url constructor after initialize url (and pointed out @jonk in comments, should this.url ). ...

animated gif - FLAnimatedImage multiple gif playback delay when using loop count - objective c -

i have uipageviewcontroller displays 5 gifs, 1 in each page. flanimatedimage works great, there 1 drawback, there nothing set animation loop , used https://github.com/flipboard/flanimatedimage/pull/60 achieve that. but problem occurred after gif completes , stops in 1 controller , move controller , return previous controller, gif start after delay. i'm not sure how fix that. delays in class flanimatedimages related animation delays , not playback delays. here extract class flanimatedimage.m in method initwithanimatedgifdata : // try use unclamped delay time; fall normal delay time. nsnumber *delaytime = [framepropertiesgif objectforkey:(id)kcgimagepropertygifunclampeddelaytime]; if (!delaytime) { delaytime = [framepropertiesgif objectforkey:(id)kcgimagepropertygifdelaytime]; } // if don't delay time properties, fall `kdelaytimeintervaldefault` or carry on preceding f...

html - align-items with justify content not working properly -

this question has answer here: properly sizing , aligning flex item(s) on last row 1 answer i want make 2 li in last row, next each other, , not in middle. using flex, can responsive in smaller screens. http://codepen.io/anon/pen/vexzqk ul { display: flex; margin: 0 auto; padding: 0; width: 800px; list-style: none; flex-wrap: wrap; background-color: red; justify-content: space-between; } li { display: flex-item; padding: 15px 0; transition: transform .5s ease-in-out; transform: scale(1); margin: 10px auto; background-color: blue; width: 150px; } you can try one:\ ul { display: flex; margin: 0 auto; padding: 0; width: 800px; list-style: none; flex-wrap: wrap; background-color: red; justify-content: space-between; display:inline-block; } li { display: flex-item; padding: 15px 0; transition: transfo...

ibm - xpages - Get rid of the fraction part of a currency -

i'm trying rid of fraction part of field stored in notes document number field. in xpages displays default double want convert currency. when use standard currency converter can't rid of fraction part. i tried convert double display integer only , programmatically converted double intvalue. works fine long don't use currency converter seem add fractions no matter what. guess because default fractionpart 2. i guess 1 important clue i'm talking swedish currency. in sweden display currency in pattern: # ### ### kr . punctuation space , currency symbol after number. i tried use custom converter - pattern above example don't punctuation correct. - i'm trying achieve this: example: 112 000 kr code example return this: 112 000,00 kr of course can string conversion-concatenation operation achieve best if there's way hold of default fraction part currencycode , manipulate that..? , me seems bug because "display integer only" seems disre...

java - '" "' is not recognized as an internal or external command -

when trying run android.bat file (sdk manager), i'm getting following error: '" "' not recognized internal or external command looks have space somwhere , isn't it? thing have no idea where. sdk path : c:\android\android-sdk\tools in environement variables i'm forwarind java_home , value : c:\progra~1\java\jre7\bin it looks problem comes somewhere else.

python - Can not fetch the history data of memory when using zabbix api -

i trying history data of vm.memory.size[used], vm.memory.size[cached], vm.memory.size[buffers], vm.memory.size[total] using history.get method, returned nothing. can itemid item.get call. code listed below. import sys import time import logging pyzabbix import zabbixapi stream = logging.streamhandler(sys.stdout) stream.setlevel(logging.debug) log = logging.getlogger('pyzabbix') log.addhandler(stream) log.setlevel(logging.debug) zapi = zabbixapi(zabbix_server) zapi.login(user, passwd) # itemid items = zapi.item.get(output='extend', hostids=['10470', '10471', '10472', '10473'], search={'key_': 'vm.memory.size[used]'}) history = zapi.history.get(output='extend', itemids=['83140', '83141', '83142', '83143'], history=0, time_from=time.time() - 3600, time_till=time.time(), sortfield='clock', sortorder='desc') history empty list [] , how can history d...

python - Why doesn't Eclipse find parse from pattern.de package but pattern.de.Twitter however? -

Image
i don't know wront. installed pattern pip install pattern not located under /use/local/lib/python2.7/dist-packages . included in libraries under prefences > interpreters > python interpreter for reason can find from pattern.web import twitter but not find from pattern.de import parse what missing here? i tried remove , re-add interpreter in eclipse settings, closed , re-opened project , restarted eclipse. nothing working. and additionally: using pattern.de terminal runs flawless. well, changed package not documentation. from pattern.text.de import parse

c++ - How to implement a lambert shader using Arnold API? (for beginners) -

how implement lambert shader using arnold api? (for beginners) this example implement constant shader. don't know how implement lambert shader using arnold api (integrate light , samples). #include <ai.h> #include <cstring> ai_shader_node_export_methods(lambertmethods); enum lambertparameters {p_albedo}; node_parameters { aiparameterrgb("albedo", 1.0f, 1.0f, 1.0f); } node_loader { if (i > 0) return false; node->methods = lambertmethods; node->output_type = ai_type_rgb; node->name = "lambert"; node->node_type = ai_node_shader; strcpy(node->version, ai_version); return true; } node_initialize {} node_update {} shader_evaluate { atcolor albedo = aishaderevalparamrgb(p_albedo); sg->out.rgb = albedo; } node_finish {} loop on lights in scene. shader_evaluate { atcolor albedo = aishaderevalparamrgb(p_albedo); atcolor diffuse = ai_rgb_black; ailightsprepare(sg...

c# - Dictionary and Items protected members of a KeyedCollection in Unity3d 5.3.1? -

i've been using unity 5 year , worked fine until last week when had idea update our ide 5.3.1 version. now compiler shows 2 errors: the name `dictionary' not exist in current context. name `items' not exist in current context. both localized in simple keyedcollection public class commandprocessqueuecollection : keyedcollection<int, commandprocessqueue> { public bool trygetqueue(int id, out commandprocessqueue queue) { if (dictionary != null) { return dictionary.trygetvalue(id, out queue); } foreach (var in items) { var k = getkeyforitem(i); if (comparer.equals(id, k)) { queue = i; return true; } } queue = default(commandprocessqueue); return false; } protected override int getkeyforitem(commandprocessqueue queue) { return queue.id; } } after several attempts things became more tricky exact s...

bash - Delete files older than 365 days -

files named name_2016-01-19_00-00-00... tried script find /path/to/files* -mtime +5 -exec rm {} \; unfortunately files moved linux windows , forth file dates no longer accurate. the following print files either have no date in name, or date older whatever put in "dummy_2015_01_27" name. once have list of names deleting them trivial. it assumes there never underscore in name part of filename (i.e. date field 2 when split on _ ). if that's not true you'll have think of else. (echo "dummy_2015_01_27"; find /path/to/files -type f) \ | sort --field-separator='_' --key 2 \ | sed '/^dummy_/,$d' this works gnu sed (i have v4.2.2), favourite on linux, won't work other sed implementations. likewise, i've tested gnu sort (v8.24).

sql server - SQL LIKE with int -

is there equivalent like use varchar can used int ? i want filter 3 parameters , 2 of them varchar can use like , in case empty string still can retrieve records. how can achieve similar thing int i want retrieve if fkproducttypeid doesn't exist: query: select * product code '%'+ @code +'%' , name '%'+ @name +'%' , fkproducttypeid = @ptype i want able retrieve results when supply id doesn't exist. front-end, if pass ' ' in @code ,' ' in @name , 0 in @ptype want retrieve records you use this: select * product code '%'+ @code +'%' , name '%'+ @name +'%' , (@ptype null or fkproducttypeid = @ptype) if it's in stored-procedure should use if ... else : create procedure dbo.sp_name(@ptype int, @code varchar(1000), @name varchar(1000)) begin if @ptype null begin select * product code '%'+ @code +'%' , name '%'+ @nam...

java - When i write file I got space in the end How I can change it? -

i tried read content , write file. code run on server when server on linux don't have problem. when run on windows string in end got space how can fix ? public static void readfile(inputstream inputstream, outputstream outputstream, boolean closein, boolean closeout) throws ioexception { byte[] buffer = new byte[4096]; int read = 0; try { while ((read = inputstream.read(buffer)) != -1) outputstream.write(buffer, 0, read); } { //close input , output } }

java - Sort List of Objects by values from array; -

i have list<brand> categories; 1000+ items. for each item list have id , use categories.getid(); and have array int[] sortedidarr = {4,53,102,403,110,5,6,8,12}; i sort categories list , make order id how in sortedidarr . how can implement ? private void sortbrandsbyid(list<brand> categories) { collections.sort(categories, new comparator<brand>() { public int compare(brand o1, brand o2) { } }); } can use collections.sort ? typically use collections.sort , or equivalent idioms in java 8 if applicable, or sorted collection such treeset . however in case want follow pre-defined order, dictated sortedidarr array. one way achieve use linked collection (e.g. linkedhashset ). then iterate sortedidarr array, , search list<brand> object given id. if found, add brand object given id linkedhashset , retain insertion order. note if id not found, set not "match" array. self-enclosed example...

Delphi 2010 - Text on TRichEdit to HTML -

i'm trying convert rich text on trichedit component html tags.i have function that, doesn't work because text in component sent on plaintext. option plaintext on component set false. example: *text in richedit: house blue. when invoke function sent without bold format in text: rtftohtml( richedit.lines.text ). how can on component or in other side read text rtf? i have read other questions , didn't solve problem. help. there few 3rd party commercial components quite such wptools or trichview . both attempt optimize generated html using css styles applicable. both support delphi 2010, latest version of compiler (delphi seattle of answer).

Scraping Word with Excel VBA -

i have word document full of newspaper articles. each newspaper article preceded article title , string "length:", followed number of words in article (i.e. "length: 1500 words"). need excel macro comb word document , extract length value each article - placing these values in excel column. through googling, found this: extract data word document excel spreadsheet this almost need, returns first article length value found search. how modify code find every article length value, return these values excel column , terminate? the code link not particularly robust. i've extracted assignment cell in excel ( exr(1, 1) = wdr ' place @ excel cursor ) , built more robust word code around it. the code uses word range object instead of selection . more efficient, more predictable , screen won't jump around. find uses wildcard search specific text, plus digits between "length " , " words". since successful find includes found...