Posts

Showing posts from March, 2012

python - What’s the best way to remove these files yet retrieve them should an issue arise? -

what’s best way remove these files yet retrieve them should issue arise? i'm trying homebrew squared away , below warnings appeared in terminal. python.framework i'm not concerned with, since know put there. other files, not know how got there. not familiar. if in shoes, how go getting these warning disappear? warning: python installed @ /library/frameworks/python.framework homebrew supports building against system-provided python or brewed python. in particular, pythons installed /library can interfere other software installs. warning: unbrewed dylibs found in /usr/local/lib. if didn't put them there on purpose cause problems when building homebrew formulae, , may need deleted. unexpected dylibs: /usr/local/lib/libtcl8.6.dylib /usr/local/lib/libtk8.6.dylib warning: unbrewed header files found in /usr/local/include. if didn't put them there on purpose cause problems when building homebrew formulae, , may need deleted. unexpected header files: /usr/local/inclu...

query string - How can I get specified querystring key-value on custom log files with powershell? -

i've tried parse own custom log files rows , except spesific rows header value involved querystring values , included spesific key-value i spesified example log file rows below : 2016-01-04 14:07:06 192.168.1.0 - example.com mainpage a=2&b=20&c=12-10&d=apple 2016-01-04 14:07:07 192.168.1.0 - example.com search x=2&y=20&c=56-32-12&d=orange 2016-01-04 14:07:08 192.168.1.0 - example.com prodview r=1&b=20&c=24&d=orange 2016-01-04 14:09:38 192.168.1.0 - example.com prodview a=2&b=20&c=1-23e&d=orange what want own powershell result 2016-01-04 14:07:08 192.168.1.0 - example.com prodview r=1&b=20&c=24&d=orange output must show querystring parameters contains c , points numeric value(it mustn't contains '-' character) my own query below : import-csv -encoding utf8 .\logs\x.log -header a,b,c,d,e,f,g,h -delimiter ' ' | {$_.h -match "c"} | select-string h but i've blocked when a...

hibernate - Grails Temporary Domain -

is there best way solving using grails- creating "temporary" table based on multiple tables when user login (session created). it should possible access "temporary" table controllers when http session ends, temporary table should dropped / truncated gorm features should available truncate data , insert new when actions happen during http session. (the data dynamic) i guess can solved somehow domain class. haven't succeeded finding example. the base of data construction "temporary" table complex (performance) generate , used often. , important data can access owner (the user). although there grails plugin can create domain classes dynamically , there blog burt explains how can create dynamic domain classes. these have own limitations , not suggested used in production environment. one thing can create domain class stores session object. unique per session , can insert/update entries using session object. each finder call hav...

visual studio - How do I access the scroll bar on a box in selenium using C#? -

i'm starting out selenium using c# in visual studio , far good. on site i'm building tests for, there's dialog box text , scroll bar on right side. have scroll bottom button become enabled me click to. best example of cases end user agreements have read text (scroll bottom) accept become enabled. the code front-end i'm wondering if have call javascript methods somehow this? i reading javascriptexecutor have no idea how set in visual studio / c#. if has examples, appreciate it!

Separate hex blocks in PHP -

anyone knows way "separate" blocks of hex code? [49cd0d18] -> 1238175000 [00010000] -> 1 [0069] -> 105 [543ace68] -> timestamp 000000000000000000000000000000000000000 complete: 49cd0d1800010000543ace68000000000000000000000000000000000000000 oh, of course... values, can different... know, not same. so, need know how "count" blocks, , then, "cut". i'll grateful help! regex easy solution problem theses: you can see regex on link: https://regex101.com/r/qp1bc7/1 note: don't forget put delimiter (the slashes in example) around regex when use in code : /^(\w{8})(\w{8})(\w{4})(\w{8})(\w{39})$/ the caret , dollar sign delimit respectively beginning , ending of string. the parenthesis capturing groups. \w match letter (a-z in lower , upper case), digits (0-9) , underscore (_). {8} means must match 8 characters and can see example of code here: http://sandbox.onlinephpfunctions.com/code/c3a0ec3a45c53eb2c1b8e...

visual studio 2015 - How to disable "npm install" in VS2015 -

in vs2015, opening web project/solution uses node packages (e.g. gulpfile.js) cause vs automatically run "npm install" , install packages. vs2015 comes old version of npm (1.4.19), doesn't "flat" install of package dependencies, causes paths created on 260 characters. painful when happens every time visual studio opened. i've found several workarounds (including http://jameschambers.com/2015/09/upgrading-npm-in-visual-studio-2015/ ), ideally there setting somewhere disable "auto npm install" or that, either can't find setting or doesn't exist. you can literally "hide" web tools visual studio: under tools menu select "options..." go "projects , solutions" -> "external web tools" if want make visual studio use globally installed npm - remove checkboxes items starting $(devenvdir). if want disable web tools in vs: uncheck all.

python - Distance calculation in Geopy -

i using python 2.6.6 on centos 6. have dataframe bringing in pickle file. i'd calculate distance between 2 points. have tried combine lat , long each point tuple , used geopy.great_circle . traceback includes this: /opt/rh/python27/root/usr/lib/python2.7/site-packages/geopy/point.pyc in __new__(cls, latitude, longitude, altitude) 127 ) 128 else: --> 129 return cls.from_sequence(seq) 130 131 latitude = float(latitude or 0.0) /opt/rh/python27/root/usr/lib/python2.7/site-packages/geopy/point.pyc in from_sequence(cls, seq) 351 """ 352 args = tuple(islice(seq, 4)) --> 353 return cls(*args) 354 355 @classmethod typeerror: __new__() takes @ 4 arguments (5 given) my input pandas dataframe should of same length (if matters?) import numpy np geopy.distance import vincenty import geopy import pandas pd distances_frame = pickle.load(open("distances.p", ...

mongodb - JacksonDBCollection findOne query and not working java -

i trying implement findone query on json: my json looks this: { "_id":{ "$oid":"5613b8d360b292805a5d7f2d" }, "resellerid":"1" .... } and here java code: final jacksondbcollection<mongodocument, string> resellerwidget = jacksondbcollection.wrap(mongodb.getcollection("resellerwidget"), mongodocument.class, string.class); mongodocument md = resellerwidget.findone(dbquery.and(dbquery.is("_id",widgetid), (dbquery.is("resellerid", resellerid)))); but not find record. when query widgetid though, find it. relevant part of mongodocument: @jsonignoreproperties(ignoreunknown = true) public class mongodocument { private string id; private string resellerid; private final map<string, jsonnode> extraproperties = new hashmap<>(); @objectid @jsonproperty("_id") public string getid() { return this.id; ...

javascript - Parse database job is not getting all results from http request -

i have following code set job in parse cloud code application. parse.cloud.job("requestlocations", function (request, response) {parse.cloud.httprequest({ url: 'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=29.7030428,-98.1364808&radius=900&types=restaurant&key=aizasyctg0x68q6lrcao6-a37zkxge81jdekpvo' }).then(function (httpresponse) { // success response.success("success"); var parseddata = json.parse(httpresponse.text); var location = parse.object.extend("locations"); (var = 0; < parseddata.results.length; i++) { var restaurant = new location(); var placeid = parseddata.results[i].place_id; var name = parseddata.results[i].name; var vicinity = parseddata.results[i].vicinity; var point = new parse.geopoint({ latitude: parseddata.results[i].geometry.location.lat, longitude: parseddata.results[i].geometry.location.lng ...

h2o from R on Windows gives curl error: Protocol "'http" not supported or disabled in libcurl -

i've run h2o r on linux machine , wanted install in windows too. h2o not initialise me. full output pasted below key seems line [1] "failed connect 127.0.0.1 port 54321: connection refused" curl: (1) protocol "'http" not supported or disabled in libcurl judging this , this experience might single quotes v double quotes somewhere; seems unlikely because no-one able h2o / r / windows combination working , gather people are. on other hand, this question seems suggest problem curl installation may not have ssl enabled. downloaded curl scratch this wizard recommended on h2o page, selecting 64 bit version, generic, , selected version both ssl , ssh enabled; downloaded , added folder ended in windows path. no difference. i've noticed java runtime environment old , update well. on face of it's not obvious that problem. any suggestions welcomed. > library(h2o) > h2o.init() h2o not running yet, starting now... note: in case of ...

php - How to dynamically add to PHPExcel spreadsheet -

alright, have code $key = $_session['order_nums']; $sqll = "select * `money` `order` = :key"; $qq=$con->prepare($sqll); $qq->bindvalue(":key", $key); $qq->execute(); $excel2 = phpexcel_iofactory::createreader('excel2007'); $excel2 = $excel2->load('ntest.xlsx'); // empty sheet $excel2->setactivesheetindex(0); $worksheet = $excel2->getactivesheet(); while($fdata=$qq->fetch(pdo::fetch_assoc)) { $worksheet ->setcellvalue('a7', $fdata['code']); } where it setting cell value a7 there 6 more of match. when however, puts cell a7 while($fdata=$qq->fetch(pdo::fetch_assoc)) { $worksheet ->setcellvalue('a7', $fdata['code']); } how can make above value drop down 1 cell each new entry. so nex...

javascript - Customizing and positioning a vertical slider in HTML/CSS -

i'm trying create remote control app using cordova. there should 2 vertical sliders ( <input type="range"> , customizations (height, width, color, etc.). 1 should on left, positioned @ 25% of page width; , other on right, @ 75% of page width. the sliders should centered on correct point (ex. calc(25% - 20px); slider on left if 40px wide, be). the other requirement webpage works on ios safari (really cordova, uses apple's webkit same). opera/firefox nice. it not have ie compatible (you're welcome). i don't mind using javascript/jquery, prefer css. also, reasons unexplained, sliders go off top of page, must fixed. 1 last bug have applying position: fixed; left: 0px; slider not move left, centerinviewport() function offset. here's jsfiddle: https://jsfiddle.net/coder256/6zjnk3qt/ i tried -webkit-appearance: slider-vertical . doesn't allow styling. sliders, -webkit-appearance value aside none i've tried doesn't let sty...

oracle - SQL loop inserts -

i have company table list of companies name , company id. now there value table hold information company reference company id. i need first list , size of companies , companies insert particular feature information in value table. this means need have companies having features in value table. i tried use below sql gives compilation error. loop works without insert. declare x number(2) ; begin x in (select distinct company_num company comp_in_comp='t') loop insert value (property_num, data_group, num_updates, created_date, created_by, last_updated_date, last_updated_by, value) values ('78', x ,'0', to_date('2015-12-17 00:00:00', 'yyyy-mm-dd hh24:mi:ss'), 'admin', to_date('2015-12-17 00:00:00', 'yyyy-mm-dd hh24:mi:ss'), 'admin', 'n'); end loop; end; you don't need loop - use insert-select statement: insert value (property_num, ...

Email sent with Outlook Object Model stays in Outbox until I start Outlook -

i'm trying send emails .net application using outlook object model. my application displays outlook message window user can see we're sending , edit first. when user hits send button, outlook window closes, , message gets sent. works long outlook application running. if outlook application isn't running, message gets stuck in outbox, , not send until start outlook. when start outlook, can see message sitting in outbox folder few seconds, gets sent. here simplified version of code i'm using send email: outlook.application app = new outlook.application(); var ns = app.getnamespace("mapi"); // (ref: https://msdn.microsoft.com/en-us/library/office/ff861594.aspx) // if outlook running, nothing. if isn't, has // side-effect of initializing mapi use default profile , make object // model functional var mailfolder = ns.getdefaultfolder(outlook.oldefaultfolders.olfolderinbox); var mailitem = (outlook.mailitem)ns.application.createitem(outlook.o...

javascript - How to reference files belonging to a module? -

i making module need use files, local module. the path module can vary, depending on level of nesting , depending on whether if installed globally or locally. how reference modules local files within module? i found best solution: for javascript libraries: if javascript want include, can add relative path require call: require('my-module/lib/other-script.js'); for other files open: use module.filename obtain absolute path current file. remove file name , add relative path name it: filename = module.filename.substring(0,module.filename.lastindexof("/"))+"/my/local/file.txt";

c++ - How can I return an object with converted type from a new operator+ (Template class) -

i wrote template class spheres. saves central point , radius. i'm trying write operator+ adds value every value of central point. call main function looks this: sphere<int, double> s1(1,1,1,2.5); // (x,y,z,radius) auto s2 = s1 + 1.5; while operator+ looks this: template <typename t, typename s> class sphere { ... template <typename u> friend sphere operator+(const sphere<t, s> s, u add){ // sphere<int, double> decltype(s.m_x + add) x,y,z; x = s.m_x + add; y = s.m_y + add; z = s.m_z + add; sphere<decltype(x), s> n(x,y,z,s.rad); // sphere<double, double> return n; //error occurs here } }; the error message is: could not convert 'n' 'sphere<double, double>' 'sphere<int, double>' what have change works , why way wrong? the sphere in friend function's return type refers type of enclosing class, it's sphere<in...

java - How to parse simple JSON Array in android? -

i've been wondering how parse json array in android ? i've json object this: [{"id":"1","email":"email@mail.mail","password":"password"},{"id":"2","email":"test@test.com","password":"passward"}] but cannot find how parse it, want access data have first mail, or second id. i've try around 40 differents solutions, no luck. last time tried this: private void showjson(string json){ try { jsonarray jarray = new jsonarray(json); string jsonstring = jarray["id"]; tv.append(jsonstring); } catch (jsonexception e) {e.printstacktrace();} } but expected array , not json array. still haven't found how convert array. i've tried this: for (int = 0; < jsonarray.length(); i++) { jsonobject jsonobject = jsonarray.getjsonobject(i); string name = jsonobject.getstring(...

c# - Cross AppDomain async method call -

from main appdomain, trying call async method defined in type instantiated in different appdomain. for example, following type myclass inherits marshalbyrefobject , instantiated in new appdomain : public class myclass : marshalbyrefobject { public async task<string> fooasync() { await task.delay(1000); return "foo"; } } in main appdomain create new appdomain , create instance of myclass inside appdomain, make call async method. var appdomain = appdomain.createdomain("mydomain"); var myclass = (myclass)appdomain.createinstanceandunwrap(typeof(myclass).assembly.fullname, typeof(myclass).fullname); await myclass.fooasync(); // bam ! of course, serializationexception when try make call, task type not inherit marshalbyrefobject , nor serializable. how arround ? able call/await on async methods type instantiated in appdomain ... there way ? thanks !

android - Implementing custom menu items like in feedly app -

Image
i try made this but dont know element need use? , how need element. maybe need create layout menu, or use popupwindows element. anybody can help?

c++ - RcppArmadillo: "-=" operation on list elements -

i have list of complex matrices same k*k dimensions, , need subtract k*k complex matrix x each element of list. application, x vary depending on position of elements in list, here simplicity, x fixed. code task: # include <rcpparmadillo.h> // [[rcpp::depends(rcpparmadillo)]] using namespace rcpp; using namespace arma; // [[rcpp::export]] list fn(int& length, int& k) { list out(length); cx_mat m(k, k, fill::zeros); out.fill(m); cx_mat x(k, k, fill::ones); for(int i=0; i<length; i++) { out(i) -= x; } return out; } this throw error during compiling: g++ -m64 -i"c:/progra~1/r/r-32~1.3/include" -dndebug -i"c:/progra~1/r/r-32~1.3/library/rcpp/include" -i"c:/progra~1/r/r-32~1.3/library/rcppar~1/include" -i"c:/users/shuang/docume~1/markov~1/rcode~1" -i"d:/rcompile/r-compiling/local/local323/include" -o2 -wall -mtune=core2 -c test3.cpp -o test3.o test3.cpp: in function 'rcpp::list...

html - Dynamically change table background color based on value -

Image
i have table being populted database , need apply background color each row coming dtabase. code below im not sure im doing wrong not working. help! <tbody> <tr> <c:foreach items="${summary}" var="summary" style='background-color:<c:out value="${summary.color}"></c:out>;'> <tr> <td><c:out value="${summary.eventdesc}" /></td> <td><c:out value="${summary.labelnbr}" /></td> <td><c:out value="${summary.origin}" /></td> <td><c:out value="${summary.sendername}" /></td> <td><c:out value="${summary.receivername}" /></td> <td><c:out value="${summary.receiptdate}" /></td> <td><c:out value="${summary.loaddate}" /></td> <td><c:out value="${summary.forecastisc}" /></td...

javascript - datatables getting 'undefined' from the json object -

i need id json object in button's function. if try access directly id undefined (not error/warning) if try access object can see without problem (the id , rest of data). var table = $('#example').datatable( { serverside: true, dom: 'bfrtip', ajax: '/get?op=2', columns: [ { data: 'id' }, // more columns ], buttons: [ { text: 'new', action: function ( e, dt, node, config ) { window.location.href = '/url?op=new' } }, { text: 'modify', action: function ( e, dt, node, config ) { window.location.href = '/url?op=modify&id=' + dt.row( { selected: true } ).id() ) }, enabled: false }, { text: 'delete', action: function ( e, dt, node, config ) { }, enabled: false ...

javascript - Why isn't the following function selecting all the checkboxes inside this directive? -

Image
the following directive has 2 tabels: 1 checkboxes , without checkboxes. has function selects checkboxes: .directive('tablelist', function() { return { restrict: 'ea', template: '<button ng-if="listall" type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#mymodal">' + 'launch demo modal' + '</button>' + '<table class="table table-stripped">' + '<thead>' + '<th>some code</th>' + '</tr>' + '</thead>' + '<tbody>' + '<tr ng-repeat="item in listthis">' + '<th scope="row">{{$index + 1}}</th>' + '<td><a href="#/groups/{{item.id}}">{{item.name}}</a></td>' + '<td>some code...

extjs - List not showing in card layout in 2.1.1 version. Working Perfectly in 2.0 version -

important: working in version 2.0 , not in 2.1.1 my app has 2 different tabs @ bottom (near by, search) both tab use same list given below. both nearby , search use card layout, difference in near list in first card , search list in second card i trying last 2 day , no progress in this. please me ext.define('churchlookup.view.churchlist', { extend: 'ext.list', xtype: 'churchlist', config: { title: 'zip code', cls: 'x-contacts', grouped: true, store: 'churches', itemtpl: [ '<div class="headshot" style="background-image:url(resources/images/church-type-logo/{icon}.png);"></div>', '{name}, {city}', '<span>{phone} / {email}</span>' ].join('') }}); for near when tab clicked list displayed inside tab panel. working , can see list. near card code ext.define('churchlookup.view.nearby', { ext...

How to config .htaccess permalink -

i use linux , file .html onpage: no database: want redirect this: http://example.com/?page=/mylinks.html to this: http://example.com/mylinks.html in ".htaccess" file, or alternative. thank! try this: rewriteengine on rewritecond %{query_string} page=(.*) rewriterule ^$ %1 [l]

How do I configure the version of Gradle to use with Grails 3.0? -

it seems grails 3 ships gradle 2.3 , need downgrade 2.2. there way tell grails run gradle 2.2 instead of 2.3? have looked @ gradle.properties file? mine looks this: grailsversion=3.0.11 gradlewrapperversion=2.3 grails.groovyversion=2.4.5 not sure downgrades. 2.3 has worked fine me far.

html - :hover targeting not working exactly the way I want it to -

if hover on project text appear, if mouse on text kills hover style because that's not triggers hover. p.description { position:absolute; top:50%; left:50%; margin: 40px 0 0 -125px; /*offset 50px center*/ transform: translatey(-50%); /*vertically centered*/ width:250px; height:80px; z-index:1000; color: #ffffff; opacity: 0; } .holder:hover p.description { margin-top: 0; /*makes me slide up*/ opacity:1; visibility:visible; -moz-transition: .2s ease-in; -o-transition: .2s ease-in; -webkit-transition: .2s ease-in; transition: .2s ease-in; } p.description span { font-family: 'aileronbold'; font-size: 110%; } this css trying accomplish this. not sure how re-target achieve this. works want minus when mouse on text. you can check at: http://darrenbachan.com/ change selector .holder a:hover .holder:hover a . seeing flicker issue because transition end when hover on p description element...

java - Getting Input from JTextArea -

public static void main(string[] args) throws printerexception { toolkit tk = toolkit.getdefaulttoolkit(); int xsize = ((int) tk.getscreensize().getwidth()); int ysize = ((int) tk.getscreensize().getheight()); final string password = "alphabet"; jframe screen = new jframe("insert title here"); screen.setsize(xsize, ysize); screen.setdefaultcloseoperation(jframe.exit_on_close); screen.setresizable(false); screen.setvisible(true); final jwindow window = new jwindow(screen); window.setsize(xsize, ysize); window.setname("insert title here"); final jtextarea text = new jtextarea(); text.settext("type password > "); text.setbackground(color.black); text.setforeground(color.green); window.add(text); window.setvisible(true); text.addkeylistener(new java.awt.event.keyadapter(){ public void keyreleased(java.awt.event.keyevent evt) { system.out.p...

c++ - C++11 cast const iterator pointing to container of shared_ptr objects -

i have stl container element type const std::shared_ptr<myclass> . i want supply 2 iterator types user: mycontainer::iterator typedefed std::vector<const std::shared_ptr<myclass>>::iterator (which should same type std::vector<const std::shared_ptr<const myclass>>::const_iterator mycontainer::const_iterator typedefed std::vector<const std::shared_ptr<const myclass>>::iterator (which should same type std::vector<const std::shared_ptr<const myclass>>::const_iterator in other words, want " const " refer myclass constness, not shared_ptr constness. solution found getting second iterator type getting first one, easy (e.g. using vector::begin ), , converting second type using static_cast (fixme: no need use const_cast because i'm adding constness, not removing it). would common good-design way achieve that, or there's better/more common way? typedefed std::vector<const std::share...

mysql - how to create queries in phpmyadmin using stored procedure in visual basic 6? -

i have problem here simple system uses stored procedure , database in xampp(phpmyadmin, mysql)--this required database. my questions are: *is possible create queries(append,update,select,delete) in xampp in ms access query tools? *is possible add, update, select, , delete records in xampp using stored procedure in vb6? (using parameters) databse using xampp made me confused! hope me.

javascript - Issue With Angular $scope.Watch -

i having scope.watch below, in link function of directive scope.$watch(function () { return scope.chartconfig; }, function (value) { console.log(value); }, true); its trowing below error angular.js:12221 typeerror: illegal invocation @ isarraylike (angular.js:278) @ foreach (angular.js:332) @ copy (angular.js:913) @ copy (angular.js:879) @ putvalue (angular.js:944) @ copy (angular.js:926) @ copy (angular.js:879) @ putvalue (angular.js:944) @ copy (angular.js:926) @ copy (angular.js:879)(anonymous function) @ angular.js:12221(anonymous function) @ angular.js:9055scope.$digest @ angular.js:15574scope.$apply @ angular.js:15824(anonymous function) @ angular.js:17580completeoutstandingrequest @ angular.js:5370(anonymous function) @ angular.js:5642 angular.js:12221 error: [$rootscope:infdig] 10 $digest() iterations reached. aborting! watchers fired in last 5 iterations: [] http://errors.angularjs.org/1.4.0/$rootscope/infdig?p0=10&p1=%5b%5...

plot - How can I get good Y axis intervals when plotting in Matlab? -

i'm trying plot vector (with dynamically changing size / values) have 50-150 elements, values ranging 0.3331 1.7378 (random example). is there way plot a) values on y axis presented 2 decimal places. b) y axis starts minimum value rounded down closest 0.5, c) y axis ends @ maximum value rounded closest 0.5 , d) there 10 intervals. so example of 0.3331 minimum , 1.7378 maximum, y axis start @ 0 , finish @ 2 . this attempt @ setting intervals: ymin = floor(minvalue) ymax = ceil(maxvalue) yint = ymin:(ymax-ymin)/10:ymax i'm quite newbie programming in general , doesn't work want to. have tried lot of things , can't seem right. able provide me solution this? extremely grateful. you can round up to or down to value using code minvallimit = floor(minval/roudingvalue)*roundingvalue maxvallimit = ceil(maxval/roudingvalue)*roundingvalue so e.g. 0 = floor(0.3331/0.5)*0.5 2 = ceil(1.7378/0.5)*0.5 next topic: rounding 2 decimal places roun...

asp.net - jquery validation is not working properly -

i new jquery. by googling have done following code not working. i have txtlogin textbox , btnlogin button. i trying simple thing. if textbox expty error message should displayed in lblloginerror. following code: $(document).ready(function () { $('#btnlogin').click(function () { var loginid = $("#txtlogin").val(); if ($("#txtlogin").val() == "") { $("#lblloginerror").text("please enter login id"); return false; } else { $("#lblloginerror").text(""); return true; } }); }); my problem is>> first time when textbox empty , click on button gives me error message on lable[its working fine according code]. second time when enters thing in textbox , press button removing error message.[this fine according code]. but third time when rem...

javascript - React Native Swift callback -

i send string swift-implemented module react native , string result callback native module further use. here's i've got: //helloworldmodule.m #import "rctbridgemodule.h" @interface rct_extern_module(helloworldmodule, nsobject) rct_extern_method(sayhelloworld:(nsstring *)name callback:(rctresponsesenderblock *)successcallback) @end alongside swift implementation: // helloworldmodule.swift import foundation import uikit import avfoundation @objc(helloworldmodule) class helloworldmodule: nsobject { @objc func sayhelloworld(name: string, callback successcallback: rctresponsesenderblock) { nslog("log swift: \(name)") successcallback([name]) } } and whatever goes reactnative part: // requiring swift module in react native var helloworldmodule = require('react-native').nativemodules.helloworldmodule; ... // using somewhere in render function render: function() { return ( <text> hello wor...

Any way to prevent emacs key bindings to bug in Eclipse? -

i'm wondering if i'm 1 struggling (i.e. failing) keep emacs key bindings working in eclipse. i set them. works fine. stops working fine. keys still work, others don't. find myself in kind of weird quantum state of uncertain key-binding setup superposition. key bindings standard set work, emacs set work, things can achieve neither set of bindings. i'm 1 experience this? i've seen on @ least 4 computers in past few months. i set key bindings standard set. works. use reset defaults button. try set emacs. doesn't work. pressing apply button between different steps or not... drives me crazy. on computers, bindings whatever. can save using mouse, c-d , c-k don't work delete/cut lines, emacs keys still work c-space auto-completion, etc. anyone knows can cause this? how prevent it? pressing key binding key-bindings mistake? i had similar problem ctl-k, ctl-d commands: after doing upgrade (i forget whether eclipse or android plugin) saw eclipse...

cordova - How to Set Up a Single Page Application in phonegap within a single HTML page? -

renderhomeview: function() { var html = "<div class='header'><h1>home</h1></div>" + "<div class='search-view'>" + "<input class='search-key'/>" + "<ul class='employee-list'></ul>" + "</div>" $('body').html(html); $('.search-key').on('keyup', $.proxy(this.findbyname, this)); }, go https://angularjs.org/ you can follow tutorials in started. place index.html file including other project folders in www folder. if build ios/android platforms, should copy files respective folders , can run them on device.

javascript - Refresh Iframe when the Dialog modal Closes -

im new jquery dialogs , iframes , want ask if can refresh static iframe when dialog modal closes. heres static iframe: <iframe id="frameuserinfo" src="/user/userinfo" style="border: none; width: 100%; min-height: 220px;"></iframe> </div> and jquery dialog $("#dialogaddphone").dialog({ autoopen: false, resizable: false, modal: true, width: 700, height: 700, position: ['center', 40], close: function (event, ui) { $('#dialogaddphone').attr('src', ''); } }); i tried adding $('#frameuserinfo').reload(true); not working just want give better picture, in parent window, theres static iframe contains button opens $("#dialogaddphone") click event being called @ /user/userinfo this 1 in pa...

function - Error Message: undefined reference to 'printHeader()' & undefined reference to 'calculateArea(double&)' -

i wrote program calculate area of circle , keeps giving me error message: "undefined reference 'printheader() , undefined reference 'calculatearea(double&)'" i cannot figure out means! i've looked everywhere including site of answers way above head. program: #include <iostream> using namespace std; // aquire radius value // postcondition: print out header , return radius value double printheader(); // precondition: radius has been entered // postcondition: calculate , print out area of circle void calculatearea(double& radius); int main() { double area=0.0, radius=0.0; printheader(); calculatearea(radius); return 0; } double printheader(double& radius) { cout << "program calculating area of circle" << endl; cout << "enter radius of circle: "; cin >> radius; return radius; } void calculatearea(double& radius, double area) { double pi=3.14159; ...

PHP File is getting Included, but CSS of that File is not -

i have folder name called test2. inside test2 contains "universal.php" , "universal.css". inside test2, folder called article. inside article, contains file called template.php. template.php, trying require_once universal.php. using this: <?php require_once "../universal.php"; ?> this displaying php, not css goes file. universal.php linked universal.css. whenever, make new file inside of test2, , require_once using this: <?php require_once "universal.php"; ?> it works. universal.php displayed css properties of universal.css. how make template.php gets css properties of universal.css? in universal.php try ../universal.css because calling universal.php inside template.php directory occurs template.php

javascript - Which event get triggers on image drag and drop using Tinymce . -

i have images large images want drag , drop tinymce editor. screen size allow image 600 - 800 pixels . image when droped in editor expands full screen don't want . my requirement : want resize image according dimension of 600 800 pixels when dropped in editor . there way achieve particular thing ? also , possible edit uploadimages function callback ? i not know uploadimages function callback. you have add own handlers tinymce body react on drop. should work: var editor = tinymce.get('your_editor_id'); $(ed.getbody()).bind('dragend', function(e){ /* magic here */});

iphone - How can I make videos play sound even if the phone is on silent or vibrate? -

this question has answer here: how make mpmovieplayercontroller ignore mute switch 5 answers i'm using lbyoutubeview play youtube videos, , if phone on silent or vibrate, video not play sound. there way force play sound on video anyway? i know can play audio file, described here . you need use avaudiosession api configure audio playback. call like: [[avaudiosession sharedinstance] setcategory:avaudiosessioncategoryplayback error:&error]; make call before call api's play audio. working me in app plays audio, not video, ymmv. the possible values category described here .

Dont remove filters in magento -

i apply filter in magneto. if click on filter filter hide want show filter always.any appreciated . the part of code hides other options located @ app\code\core\mage\catalog\model\layer\filter\attribute.php part. if ($filter && strlen($text)) { $this->_getresource()->applyfiltertocollection($this, $filter); $this->getlayer()->getstate()->addfilter($this->_createitem($text, $filter)); $this->_items = array(); } overwrite part in local pool.

angularjs - How to add Constant values in dropdown using angular js? -

i new angular js.i trying use angular constants in application shown in code below, able alert constant values not able bind constant values in view using ng-repeat 1.index.html <html ng-app="objapp" lang="en"> <head> <meta charset="utf-8"> <title>example</title> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0-rc.0/angular.min.js"></script> <script src="jquery.min.js"></script> <script src="app.js"></script> <script src="controller.js"></script> </head> <body ng-controller="objectivecontroller"> <form> <select> <option ng-repeat="dropdown in dropdown.regular>{{dropdown.name}}</option> </select> </form> </body> </html> app.js var app = angular.module('objapp', ['objectivecontrollers']) app.constant('dropdown'...

Sparse matrix multiplication in MATLAB with spfun -

i have dense column matrix y of size (m,1) , sparse matrix x of size (m,n) . want element-wise multiplication using y , every column of x . resultant sparse matrix still of size (m,n) . sparse matrix x , when loaded memory, 10gb. can spfun me accomplish goal in memory efficient manner? i having difficulties understanding logic behind it. thank you. have tried bsxfun ? out = bsxfun( @times, x, y ); spfun more suitable element-wise operations manipulate each non-zero element of x . not fit matrix-vector element wise operations. however, if want along line, might try: [ii jj xij] = find(x); %// extract non-zeros of x , locations out = sparse( ii, jj, xij.*y(ii), size(x,1), size(x,2) ); see doc find more information.

android - Add bullet points between textview in horizontal listview -

Image
i have horizontal listview of text. want add colored bullet points in between texts. used gallery display horizontal listview. final view should same in image. also, how divider in image between gallery , textview? activity public class mainactivity extends activity { gallery myhorizontallistview; myadapter myadapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); myhorizontallistview = (gallery)findviewbyid(r.id.horizontallistview); myadapter = new myadapter(this); myhorizontallistview.setadapter(myadapter); myhorizontallistview.setonitemclicklistener(new onitemclicklistener(){ @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { toast.maketext(mainactivity.this, parent.getitematposition(position).tostring() + " clicked", toast.length_lo...