Posts

Showing posts from March, 2014

ace editor - Meteor ShareJS document update/snapshot wipes out other values -

i'm using meteor sharejs package concurrent editing. trying write additional values items in docs collection. things titles, etc. seems work until document edited in ace editor point new snapshot created. @ point of fields cleared. i'm maintainer of meteor-sharejs package. the recommended way use package keep metadata in meteor collection, , not in sharejs docs collection. because separate software stacks not talk each other. it's possible using docs collection documents same name sharejs collection; overwriting each other. if you'd see sharejs not head in direction of being compatible derby, i'd encourage chip in @ https://github.com/share/sharejs/issues/277 .

Memory transfer between host and device in OpenCL? -

consider following code creates buffer memory object array of double's of size size: coef_mem = clcreatebuffer(context, cl_mem_read_write | cl_mem_copy_host_ptr, (sizeof(double) * size), arr, &err); consider passed arg kernel. there 2 possibilities depending on device on kernel running: the device same host device the device other host device here questions both possibilities: at step memory transferred device host? how measure time required transferring memory host device? how measure time required transferring memory device's global memory private memory? is memory still transferred if device same host device? will time required transfer host device greater time required transferring device's global memory private memory? at step memory transferred device host? the guarantee have data on device time kernel begins execution. opencl specification deliberately doesn't mandate when these data transfers should happen, in order allo

css - Chrome not rendering correct DIV width and Inspector changes layout -

i'm working div containers supposed make site 900 pixels wide, on development page chrome (v34, on mac) not rendering page expected, it's stretching site 1020 pixels wide. chrome screenshot when turn on code inspector, layout corrected without input me. how can fix problem if inspector changes output of page? does else encounter inspector problem on page? firefox (v28) , safari rendering page should look; page content contained within 900 pixel width.

.htaccess - How to 301 Redirect url include particular value -

i want redirect htaccess file url include my_value.aspx main page for exmple if there url url: mydomain.com/blablabla/blabla/my_value.aspx or mydomain.com/myvalue.aspx?id=3343234&type=blabla or different way include my_value.aspx redirect 301 http://mydomain.com how can that? you can try: rewriteengine on rewriterule ^(.*)/(.*)/my_value.aspx http://mydomain.com? [l,r=302,nc] rewriterule ^myvalue.aspx http://mydomain.com? [l,r=302,nc] the above should redirect: mydomain.com/blablabla/blabla/my_value.aspx mydomain.com/blablabla/blabla/my_value.aspx mydomain.com/myvalue.aspx?id=3343234&type=blabla mydomain.com/myvalue.aspx?id=3343234&type=blabla to http://mydomain.com the nc flags tells ignore case, mean can use my_value.apsx or my_value.apsx or my_value.apsx , still redirect. change r=302 r=301 when sure redirect works.

windows - Template Error: The template file must be given (or the template could not be opened) -

please need help, ive asked web hoster no help. on laptop. template error: template file must given (or template not opened). dont know how fit it. cant on dashbroad too. dont understand how on laptop works on else. hope can kind regards john

asp.net - UpdatePanel and Timer not working -

i have code: <form id="form1" runat="server"> <div> <asp:scriptmanager id="scriptmanager1" runat="server"> </asp:scriptmanager> <asp:timer id="timer1" runat="server" interval="1000" ontick="tickevent"></asp:timer> <asp:updateprogress id="updateprogress1" runat="server"> <progresstemplate> <img src="http://jimpunk.net/loading/wp-content/uploads/loading18.gif" /> </progresstemplate> </asp:updateprogress> <asp:updatepanel id="updatepanel1" runat="server"> <triggers> <asp:asyncpostbacktrigger controlid="timer1" eventname="tick" /> </triggers> <contenttemplate> <asp:label id="label1" runat="server" text="label&quo

java - Some elements are just magically not removed from ArrayList -

ok here's block of code wrote : public arraylist<location> possiblemoves() { arraylist<location> a1 = new arraylist<location>(); // array contain possible locations board testb = new board(); // test board test if locations valid or not // locations have x & y coordinates a1.add(new location(getcurrentlocation().getx() - 1, getcurrentlocation().gety() + 1)); a1.add(new location(getcurrentlocation().getx() + 1, getcurrentlocation().gety() - 1)); a1.add(new location(getcurrentlocation().getx() - 1, getcurrentlocation().gety() - 1)); a1.add(new location(getcurrentlocation().getx() + 1, getcurrentlocation().gety() + 1)); (int = 0; < a1.size(); i++) { try { tower testtower = testb.getgrid()[a1.get(i).getx()][a1.get(i).gety()]; }catch(arrayindexoutofboundsexception e) { a1.remove(a1.get(i));

java - SharedPreferences doesn't update preferences immediately. Requires app restart -

i trying update app layout based on user preference. after preference made, app requires restart preference come effect. want happen without restart. here activity class. public class mainactivity extends activity implements onclicklistener { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.mainactivity); sharedpreferences getprefs = preferencemanager .getdefaultsharedpreferences(getbasecontext()); theme = getprefs.getstring("themelist", "0"); switch(theme){ case "0": setcontentview(r.layout.mainactivity); break; case "1": setcontentview(r.layout.mainactivity_black); break; } initialize(); setclicklisteners(); } in way read preferences @ start-up because calling methods in oncreate. if want when change happens have register listner in activity , unregist

trading - Backtesting multiple stocks using Python -

i using pyalgotrade, popular python library testing trading strategy. want write loop can test couples of stocks 1 after another. suppose want put following 6 stocks strategy, , tun each stock 1 time , several results. how can write loop? stocks = [aapl, ebay, nflx, bby, goog, wbai] from pyalgotrade import strategy pyalgotrade.barfeed import yahoofeed pyalgotrade.technical import ma pyalgotrade.tools import yahoofinance class mystrategy(strategy.backtestingstrategy): def __init__(self, feed, instrument, smaperiod): strategy.backtestingstrategy.__init__(self, feed, 1000) self.__position = none self.__instrument = instrument # we'll use adjusted close values instead of regular close values. self.setuseadjustedvalues(true) self.__sma = ma.sma(feed[instrument].getadjclosedataseries(), smaperiod) def onenterok(self, position): execinfo = position.getentryorder().getexecutioninfo() self.info("buy @

What happens to memory of variable after loops? (C++) -

i'm trying understand how c++ works. when u declare new variable (int x) within loop, example within for-loop. memory allocated variable x within loop, happens memory after exiting for-loop? understanding friend java automatically de-allocate memory, c++? thanks. it deallocated if declared on stack (i.e. via int x = ... ) , when variable leaves scope. won't deallocated if declared on heap (i.e. via int *x = new int(...) ). in case have explicitely use delete operator.

mysql - (SQL) How can I put the count() into a column that already exists? -

in next code show alias count() "coin" want put column named "matches" in results, hope can me please. the new column "matches' exists in table "candidates" , want fill count() values sql code: select table1.* , count(*) coin ( (select c.* jobweb.candidates c, jobweb.additional_knowledge ak (ak.candidate_id = c.candidate_id) , (ak.knowledge '%ccna%' or ak.knowledge_description '%ccna%' or ak.knowledge '%java%' or ak.knowledge_description '%java%')) union (select c.* jobweb.candidates c , jobweb.work_experience ( we.candidate_id = c.candidate_id ) , ( we.position_name '%sdh%' or we.functions_desciption '%sdh%' or we.position_name '%sharepoint%' or we.functions_desciption '%sharepoint%' or we.position_name '%proyecto%' or we.functions_desciption '%proyecto%' or we.position_name '%ingeniero%' or we.functions_desciption '%ingeniero%' )) uni

objective c - How to change the value of an item when other item changes in NSTableView? -

i have populated nstableview using binding nsarraycontroller https://www.dropbox.com/s/igx8ttdfvi2tt09/ss.png now when user changes 480 (in column width) 240 want change height value 270 185 accordingly. what correct way this? can help? thanks anand just override setters each height , width , change other's value. in other words, if both height , width properties of same object, have setheight call setwidth , etc. the easiest way if have third property reflects relationship wish height , width have, such aspectratio . alternately overriding setters, if want calculation based on previous value of height or width, register kvo changes in both keypaths options:(nskeyvalueobservingoptionnew | nskeyvalueobservingoptionold) , in observevalueforkeypath you'd change dictionary both old , new values, calculate how user scaled value , scale other value accordingly (while careful avoid triggering kvo when doing so). see registering kvo observing in kvo

How does the multi-user feature work in terms of paths on Android? -

background starting version 4.2 , android supports multi-user (link here , here ). each user has apps , private data visible user. the question how encapsulation of data per user work in terms of paths , accessing files? i mean, paths per each user for: the private, internal storage. the emulated external storage (built in external storage) the "real" external storage (sd cards) ? i guess users can see data stored on sd cards belong other users, emulated external storage? , can write other users' files or read them? does each user own special path automatically? or should developer handle this? if developer needs handle it, should used id of user? the documentation says: no matter of these apis use save data given user, data not accessible while running different user. but that's assuming use apis own path. apps somehow bypass going other paths? what can app query each installation of on same device? can size of apps of other

linux - Redirecting output of cat to sort -

i have following problem: names of cities should accepted keyboard. list of cities should combined list of cities present in file cityfile. combined list should sorted , sorted output should stored in file newfile. have solve using pipelining. wrote following pipelines: cat >> cityfile | sort > newfile sort | cat >> cityfile > newfile how can pass data of cityfile sort command ? the cat command concatenates input. input can files or stdin . common key stdin "-". holds cat command. do: cat - cityfile | sort > newfile you can find information man cat .

mongodb 2.6 c++ driver tutorial linker error -

i trying run mongodb c++ driver tutorial, trouble g++ -std=c++11 -wall -pthread -lmongoclient -lboost_thread-mt -lboost_filesystem -lboost_program_options -lboost_system -o2 -i../../../mongo-client-install/include -c main.cpp -o obj/release/main.o this gives me error /usr/bin/ld: obj/release/main.o||undefined reference symbol _zn5boost6system15system_categoryev'| i using c++ driver 26compat , boost 1.55 on ubuntu gcc 4.8 some googling led me to why gnu ld resolve symbols differently when linking executables vs shared objects? but using --[no-]allow-shlib-undefined did not help. any ideas?

r - Specify external resource in config.yml -

i have following config.yml file: dygraphs: jshead: [js/dygraph-combined.js, js/lodash.js] cdn: jshead: - "http://cdnjs.cloudflare.com/ajax/libs/dygraph/1.0.1/dygraph-combined.js" - "http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js" it sources locally saved js/dygraph-combined.js , js/lodash.js files within working directory. how rewrite source instead http addresses provided above? edit i've found workaround without using config.yml , inserting addresses inside rcharts object property this: dy1 <- rcharts$new() ... dy1$html_assets$js = c( "http://cdnjs.cloudflare.com/ajax/libs/dygraph/1.0.1/dygraph-combined.js", "http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js") ... this result in html file indeed contains remote resources: <script src='http://cdnjs.cloudflare.com/ajax/libs/dygraph/1.0.1/dygraph-combined.js' type='text/javascript'>

python - C++ curve fiting to find the coefficients of a cubic? -

i have group of data points need fit curve , extract coefficients of polynomial , use them determine roots of polynomial. have python library, scipy optimize curve fit able extract coefficients, need have c++ version. noticed python library based on minpack downloaded minpack haven't been able figure out how use it. looked @ john burkhardt version found here , pretty compact version of minpack again haven't figured out how use it. the python library leads me believe polynomial of form ax^2 + bx + c + d/x. thought maybe port scipy minpack c++ after looking @ realized bad idea, , python skills aren't enough. have related code examples using c++ version of minpack, links read, anything? i minuit ! they offer standalone version, , it's packaged in root (a larger data analysis framework). i've ever used through root's interface.

docker - Canonical way to checksum downloads in a Dockerfile? -

i'm creating dockerfile downloads, builds, installs node.js source. i'd checksum download before building it, , stop or exit dockerfile if checksum fails: # officially supported ubuntu ubuntu:12.04 # setup run cd /tmp run apt-get update -y run apt-get install wget build-essential automake -y run wget http://nodejs.org/dist/latest/node-v0.10.26.tar.gz run wget http://nodejs.org/dist/latest/shasums256.txt # run checksum: exit on fail, continue on success ??? how ??? # install run tar -xvf node-v0.10.26.tar.gz && cd node-v0.10.26 run ./configure && make && make install # cleanup apt-get autoremove --purge wget build-essential automake -y has docker community settled on 'best practices' way of doing this? if of run commands return non-zero code, build fail. from fedora run false in dockerfile above, i'm doing quick test running false . false linux utility sets non-zero return code, handy testing. can see, when build d

java - Error while following osmbonuspack "Hello, Routing World!" tutorial -

i have created simple project using osm.the map showing current location. want create navigation current location specific point on map.i trying follow this tutorial . in polyline roadoverlay = roadmanager.buildroadoverlay(road, this); line,i getting error type mismatch: cannot convert pathoverlay polyline i using following libraries in project: 1. osmdroid-android-4.1.jar 2. osmbonuspack_3.0.jar 3. slf4j-android-1.5.8.jar here mainactivity : import java.util.arraylist; import org.osmdroid.defaultresourceproxyimpl; import org.osmdroid.resourceproxy; import org.osmdroid.api.polyline; import org.osmdroid.bonuspack.routing.osrmroadmanager; import org.osmdroid.bonuspack.routing.road; import org.osmdroid.bonuspack.routing.roadmanager; import org.osmdroid.tileprovider.tilesource.tilesourcefactory; import org.osmdroid.util.geopoint; import org.osmdroid.views.mapview; import android.app.activity; import android.graphics.drawable.drawable; import android.os.bundle; import and

cocoa - WebView changeFont: and changeColor: with no selection reset changes when i type -

ok, title bit confusing. have subclass of webview. can type in it. now, if change font fontpanel, or color colorpanel while having nothing selected, , type character, new character in new font or new color. if change font popupbutton, set selectedfont in nsfontmanager, when type character, font resets font of previous character. is there way keep "temporary" font or color change? i looked @ webview class reference docs , doesn't seem can that. have first way, every time, achieve want.

javascript - iScroll not working on iPhone for jquery show/hide -

i building phonegap application iscroll used scrolling. facing problem when dynamically append controls div , show/hide div on click. div shows , hides automatically. have given code samples below. apperciate help. first tried scroll.refresh() alone, since did not work, tried destroying , recreating according forum post in google. but, not work either. html <div class="wrapper" id="wrapper"> <main class="content" id="scroller"> <ul> <li> <span id="usertype-link"> </span> <div class="b-preferences__select b-preferences__select--type" id="search-user-type-div"> </div> </li> </ul> </main> </div> js $('#search-user-type-div').hide(); $('#usertype-link').bind('clic

html - Submenu in Wordpress doesnt show IE-11 -

Image
i have problem submenu in ie-11. following menu in different browsers , versions ok in ie-11 not appear. this site has address: there i asked question on topic, result has zero. ask experienced people! menu in wp doesnt show in ie-11 check compatibility of css property correctly used in css file, of attribute supported "div.clipped" in code

How to acces the string inside XML cdata in android -

i trying make android app reads online xml file. xml file includes cdata. , need text inside cdata. how this? in advance! <id> <![cdata[ 10217 ]]> </id> public static string getcharacterdatafromelement(element e) { nodelist list = e.getchildnodes(); string data; for(int index = 0; index < list.getlength(); index++){ if(list.item(index) instanceof characterdata){ characterdata child = (characterdata) list.item(index); data = child.getdata(); if(data != null && data.trim().length() > 0) return child.getdata(); } } return ""; }

c# - IDataParameter InvalidCastException -

the microsoft enterprise library data access application block contains following method: private static idataparameter[] createparametercopy(dbcommand command) { idataparametercollection parameters = (idataparametercollection)command.parameters; idataparameter[] parameterarray = new idataparameter[parameters.count]; parameters.copyto(parameterarray, 0); return cachingmechanism.cloneparameters(parameterarray); } if command.parameters tdparametercollection (a teradata .net provider class implements idataparametercollection ), parameters.copyto(parameterarray, 0) throws invalidcastexception: "unable cast object of type system.data.idataparameter[] type teradata.client.provider.tdparameter[]". my first question: how , why happening? the exception message suggests parameters have been copied parameterarray , there attempt afterwards convert parameterarray idataparameter[] tdparameter[]. (in case, tdparameter implements idataparameter .) my se

asp.net mvc 3 - How to add same column multiple times in mvcgrid in mvc3 view -

below code mvcgrid . model contains properties name , productcode , avgwaight . want add column productcode 2 times. @ runtime argument exception thrown "column 'productcode ' exist in grid" @html.grid(model).columns(columns => { columns.add(c => c.name).titled("product name ").setwidth(200).sortable(true).filterable(true); columns.add(c => c.productcode).titled("product code").setwidth(200).sortable(true).filterable(true); columns.add(c => c.avgweight).titled(" avg. weight").setwidth(300).sortable(true).filterable(true); }).withpaging(5) how add same column multiple times, different titles. thank in advance do way, worked me. @html.grid(model).columns(columns => { columns.add(c => c.name).titled("product name").setwidth(200).sortable(true).filterable(true); columns.add(c => c.productcode).titled("product code").setwidth(200).sortable(true).filterable(tru

javascript - Texturing a sphere with Three.js does'nt work on smartphones -

i have troubles using three.js. want apply texture on sphere (an image). code works without problem... until try on smartphone. try bug firefox , remote debugger, did not find issue. here code : <!doctype html> <html> <head> <meta charset="utf-8" /> <title>test</title> <meta name="viewport" content="initial-scale=1.0" /> <script src="./three.min.js"></script> <script src="./sphere.js"></script> <style> html, body, #container { margin: 0; overflow: hidden; } </style> </head> <body> <div id="container" style="width: 300px; height: 200px;"></div> <script> init(); </script> </body> </html> and : var renderer, scene, camera

php - Override core Magento DB connection using environment variables -

i trying use environment variables loaded magento application override default database connection credentials. i've managed 'almost' working using getenv('my_custom_var'), trying use same method override database credentials, sensitive data can stored within htaccess. e.g # .htaccess file setenv db_username root setenv db_password password123 setenv db_host localhost my app.php (within app/code/local/mage/core/model/app.php - copy of 1 core pool) // function overrides core 1 protected function _initbaseconfig() { varien_profiler::start('mage::app::init::system_config'); $this->_config->loadbase(); /* read db connection config environment variables */ $connection = $this->_config->getnode('global/resources/default_setup/connection'); $connection->setnode('host', getenv('db_host')); $connection->setnode('username', getenv('db_username')); $connection->se

json - Ember #<Object> has no method 'set' -

i'm extracting json data in routes follows: app.collectionroute = ember.route.extend({ setupcontroller: function(controller, model){ $.getjson('../returnitems.json', function(data){ controller.set('returnitems', data); }) } }); which gives me object can iterate on in template with: {{#each destination in controller.returnitems}} now want remove via controller following code: this.get('controllers.collection').get('returnitems')[returnindex].set('hasitems', false); which gives following error: uncaught typeerror: object #<object> has no method 'set' but when use: this.get('controllers.collection').get('returnitems')[returnindex].hasitems = false it tells me use , set?! you shouldn't doing ajax calls in setupcontroller hook. should use model , aftermodel hooks ember waits until promise succeeds before transitioning route. now, can't call set method b

ruby on rails - Parameter not being passed to partial -

i have rails 4 application user accounts can created in 2 ways: new users (sign up) or admin users (add account). my thought process send requests new action in user controller, have logic in there see if it's new user or admin user , handle request accordingly. here's template: new_by_admin.html.erb: <%= form_for(@user) |f| %> <div class="col-md-6 col-md-offset-3"> <h1 class="centertext">add user</h1> <%= render 'add_user_fields', f: f %> <%= f.submit "create account", class: "btn btn-large btn-primary" %> </div> <% end %> in controller, works fine: user_controller.rb: def new @user = user.new if !signed_in? @user.confirmation_code = user.new_confirmation_code elsif signed_in? && current_user.admin? new_by_admin else redirect_to root_url end end def new_by_admin @user = user.new

java - Spring JdbcTemplate Prepared Statements with SQL Server 2012 -

i'm trying use prepared statements jdbc template , sql server 2012. used execute statement: jdbctemplate.query(preparedstatementcreator psc, preparedstatementsetter pss, resultsetextractor rse); from java part, ok. query executed, , need, issue database performance. when fire tracing, can see statement being prepared, executed, unprepared! i'm not sure why. than, whole point of prepared statements lost, since query execution plan being erased cache, , has prepared again next usage. please, have idea why sql server unprepareing statements, , how prevent happening? thanks in advance!

regex - Java String tokens -

i have string line string user_name = "id=123 user=aron name=aron app=application"; and have list contains: {user,cuser,suser} and have user part string. have code this list<string> username = config.getconfig().getlist(configuration.att_cef_user_name); string result = null; (string param: user_name .split("\\s", 0)){ for(string user: username ){ string userparam = user.concat("=.*"); if (param.matches(userparam )) { result = param.split("=")[1]; } } } but problem if string contains spaces in user_name , not work. ex: string user_name = "id=123 user=aron nicols name=aron app=application"; here user has value aron nicols contain spaces. how can write code can me exact user value i.e. aron nicols if want split on spaces right before tokens have = righ after such user=... maybe add look ahead condition like split("\\s(?=\\s*=)") this regex split on \\s space

netbeans - What is format of customs.json configuratin file? -

for php project uses custom html tags template part of framework define netbeans customs.json file, can contain these new tags. empty file in nbproject directory called customs.json looks 1 below. there descrition of can define , how in file? (e.g. definition tag can inside of tag ... tr must inside of table tag ... custom tags ...) customs.json { "attributes": {}, "elements": {} } afaik there no documentation, easy way add definitions use custom tag/custom attribute in html file, netbeans mark error or warning bulb icon on left of line "error". click on bulb icon , ide offer define custom element, custom attribute, custom attribute on specific element etc. these action add definitions customs.json file. once this, show in code completion common tags/attributes.

opengl texture format for floating-point gpgpu -

i wish process image using glsl. instance - each pixel, output squared value: (r,g,b)-->(r^2,g^2,b^2). want read result cpu memory using glreadpixels. this should simple. however, glsl examples find explain shaders image post-processing; thus, output value lies in [0,255]. in example, however, want output values in range [0^2,255^2]; , don't want them normalized [0,255]. the main parts of code (after trials , permutations): glteximage2d(gl_texture_2d, 0, gl_rgba16f, width, height, 0, gl_bgr, gl_float, null); glreadpixels(0, 0, width, height, gl_rgb, gl_float, data_float); i don't post entire code since think these 2 lines problem lies. edit following @arttu's suggestion, , following this post , this post my code reads follows: glteximage2d(gl_texture_rectangle_arb, 0, gl_rgba32f_arb, width, height, 0, gl_rgba, gl_float, null); glreadpixels(0, 0, width, height, gl_rgb, gl_float, data_float); still, not solve problem. if understand correctly - no mat

c# - Pagination logic : Inserting ... instead of middle pages when there are lots of pages -

i trying create pagination on latest news section of site. i've managed page navigation working each page output @ bottom of screen along next , previous buttons however, want try , reduce size of pagination field when have large number of pages overall. in mind want try , mimic following behaviour: when total number of pages less 7, output pagination as: <previous> 1 2 3 4 5 6 7 <next> however, if total number of pages not less 7, output first 2 pages, last 2 pages , 2 pages either side of current page link current page. in place of missing page, there should single ... i've managed way towards behavour using following code: @if (totalpages > 1){ <ul class="pager"> @if (page > 1){ <li><a href="?page=@(page-1)">previous</a></li> } @for (int p = 1; p < totalpages + 1; p++){ var linkclass = (p == page) ? "disabled" : "active"; if ((p >= pag

Using batch file to enumerate through registry keys -

i'm trying query install location of installed software. each new version of creates it's own key in registry following pattern: hklm\software\mysoftware\<version> example: windows registry editor version 5.00 [hkey_local_machine\software\mysoftware\0.2.0] "installdir"="c:\\program files\\mysoftware" how can query installdir of latest version installed on computer? @echo off setlocal enabledelayedexpansion regedit /e /s hklm\software\mysoftware c:\export.txt set version_candidate=000 /f "tokens=4,5,6 delims=\." %%a in ('type c:\export.txt ^|findstr /r "[0-9].[0-9].[0-9]"') ( if %%a%%b%%c gtr !version_candidate! set version_candidate=%%a%%b%%c ) set version=%version_candidate:~0,1%.%version_candidate:~1,1%.%version_candidate:~2,1% regedit /e /s hklm\software\mysoftware\version c:\export2.txt /f "tokens=2 delims==" %%a ('type c:\export2.txt ^|find /i "installdir"') (

Why does the vim gt command does not set alternate file as expected? -

launch vim without arguments, , perform experiment. files a, b, c , d used in experiment below need not exist. execute :e a execute :tabe b execute :tabe c execute :tabe d execute :ls press enter remove output of previous command execute gt execute :ls this output of step 5. :ls 1 "a" line 0 2 "b" line 0 3 #a "c" line 0 4 %a "d" line 1 press enter or type command continue this shows "c" alternate file (marked # ) , "d" current file (marked % ). far, see expected per documentation. if there existing current file, becomes alternate file when make other file current file. but output of step 8 following. :ls 1 %a "a" line 1 2 "b" line 0 3 "c" line 0 4 &q

java - login facebook android notworking -

when install app eclipse on real device works ok login face book sample app but when exporting apk , install manually mobile when hit login hit ok facebook permission again login screen i don't know why not working apk version my code : public class loginactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_login); loginface.setonclicklistener(new view.onclicklistener() { @override public void onclick(view arg0) { // call logout twitter function // start facebook login session.openactivesession(loginactivity.this, true, new session.statuscallback() { // callback when session changes state @override public void call(session session, sessionstate state, exception exception) { if (session.isopened()) { // make request /me api request.executemerequestasync(session, new reques

installer - NSIS: How to press "Next" button automatically when MUI_PAGE_INSTFILES is complete -

i'm making installer nsis , have following pages: !insertmacro mui_page_welcome !insertmacro mui_page_directory !insertmacro mui_page_instfiles !insertmacro mui_page_finish on each page must press "next" button. how press "next" button automatically when installation complete in mui_page_instfiles? have defined mui_finishpage_noautoclose in script? from manual : mui_finishpage_noautoclose not automatically jump finish page, allow user check install log.

r - Setting Directory -

i wondering if possible set web site, http or ftp, directory on r. i found similar question, , suggests using rcurl , curloption . did not find kind of command. perhaps misunderstanding comments. if can set directory, want set here: ftp://amrc.ssec.wisc.edu/pub/aws/10min/rdr/

javascript - ng-if inside ng-repeat not working as expected -

i have repeater i'm using return views accordion. i'd conditionally load views, i'm wanting add ng-if condition on repeaters elements check , see if current == true it's not working. i'm using angular 1.0.8. i have fiddle <div data-ng-view></div> showing same view edit: angular 1.0.8 not support ng-if went switch statement. <div ng-switch="group.current"> <div ng-switch-when="true"> <div data-ng-view></div> </div> </div> problem at <div ng-if="group.current == 'true'"><div data-ng-view></div></div> replaced with <div ng-if="group.current === true"><div data-ng-view></div></div> check updated @ http://jsfiddle.net/rajumjib/guwsh/15/

cocoa - NSURL: Display Relative URLs? -

has come across solution or addition nsurl make relative file url based on this: nsurl * = [nsurl urlwithstring:@"/users/me/scripts/python/test.py"]; nsurl * = [nsurl urlwithstring:@"/users/me/new-scripts/python/test.py"]; nsurl * rel = [nsurl urlfrom:from to:to]; nslog(@"%@",rel); --> ../../new-scripts/python/test.py and i'm looking able take relative path "../../new-scripts/python/test.py" , combine absolute url new url. [nsurl urlwithstring:@"../../new-scripts/python/test.py" relativetourl:[nsurl fileurlwithpath:@"/users/me/scripts/python/test.py"]]; haven't come across on google, , trying implement myself can end having lot intricacies correctness. wondering if apple or or if c/posix functions exist already? thanks! i came accross https://github.com/karelia/ksfileutilities , doesn't work file urls. wrote this. http://pastebin.com/fkyjvwpu #import <foundation/foundation.h> nsst

ruby - program using while with array values -

i trying write small program goes through array's values outputting each individual value. when reaches 15 stops , outputs "too big". why logic below wrong, makes sense me.. x = [10,11,12,13,14,15,16,17,18] def counting x[y] while y < 15 puts y else puts "too big" end puts counting i'm learning sorry if simple solution. if want 1 liner: x.each {|y| y < 15 ? puts(y) : puts("too big") || break } if insist using while, can done following: i = 0 while x[i] < 15 ? puts(x[i]) : puts("too big") || break i+=1 end

spring - SCORM: Web based SCORM player in Java -

i'am looking free scorm player can integrated java website.i need on integration part.please help.thanks in advance. we people add scorm players applications, time. i'm not aware of free integratable option. however, open-source tools, such moodle, can provide scorm 1.2 player you. if willing license software, our scorm cloud , scorm engine solutions designed provide player scorm 1.1, scorm 1.2, scorm 2004 (2nd, 3rd, & 4th editions), aicc, pens, , tin can api. our solutions compatible java environment. the scorm cloud provides free testing sandbox, debug log, can see 2 way communication between course , scorm player. if need example courses, started , benchmark with, offer free library of scorm courses (in every version , style) here . if want build own player adl's official specification documentation, found here , best place begin. recommend starting scorm 1.2, widely-used version of standard. if have specific questions, feel free ask. we&

Sonarqube 4.2 & PHP -

since updated sonar 4.2 , php plugin 2.1 there no way use results or execute external tools phpcs , phpmd. we used phpcs quite extensively before - wanted know there way our phpcs rules in sonar else php analysis run not use us. have not found way define own new rules, found few come plugin (for comparison had 580 rules before, , have 28). hope can ;) thanks, susanne we hope include ability write custom rules in java: http://jira.codehaus.org/browse/sonarphp-270 in meantime, please join user list , tell rules you'd see re-implemented.

android - Phonegap: new FileTransfer(); returns undefined -

i want download file in phonegap using filetransfer, "referenceerror: filetransfer not defined" error (line 3 on below code). using phonegap 3.3.0; file , filetransfer plugins added config.xml(and showing on build.phonegap.com). building via web interface function descargarepo2(id) { try { var filedownloadedit = new filetransfer(); alert("hecho: " + filedownloadedit); } catch (e) { alert("el error de filetransfer es: " + e); } var uri = encodeuri("http://dl.dropbox.com/u/97184921/editme.txt"); var filepath = "www/data/"; filedownloadedit.download( uri, filepath, function(entry) { console.log("download complete: " + entry.fullpath); alert("file downloaded. click 'read editable downloaded file' see text"); }, function(error) { //alert("download error source " + error.source); //alert("download error targ

Toast after seconds set by timepicker when screen off android -

i can detect when screen turns off in way: intentfilter intentfilter = new intentfilter(intent.action_screen_on); intentfilter.addaction(intent.action_screen_off); registerreceiver(new broadcastreceiver() { @override public void onreceive(context context, intent intent) { if (intent.getaction().equals(intent.action_screen_off)) { toast.maketext(mainactivity.this, "screen off", toast.length_short).show(); } else if (intent.getaction().equals(intent.action_screen_on)) { toast.maketext(mainactivity.this, "screen on", toast.length_short).show(); } } }, intentfilter); i need same thing, toast have appears after seconds can set through timepicker . every time screen turns off, if set 10 seconds, after 10 seconds toast. how can it? need service? manually can this: new handler().postdelayed(new runnable() { @override public void run() { // here code } }, 30 * 1000);

numpy - Python: Efficiently sample an n-dimensional distribution from density array -

i have n-dimensional distribution have estimated gauissian kernel density have stored n-dimensional array. need perform 2d kohonen map fitting underlying distribution. the simplest way of doing in python found far use newc module neurolab . however, module requires cloud or points , need sample n-dimensional array recover points correspond original density distribution. what efficient way perform such sampling? alternatively, there kohonen map modules work directly density arrays?

asp.net mvc - Unit Testing account MVC controller Error - real MembershipService is still being used -

i have following account controller public class accountcontroller : controller { public imembershipservice membershipservice { get; set; } protected override void initialize(requestcontext requestcontext) { if (membershipservice == null) { membershipservice = new accountmembershipservice(); } base.initialize(requestcontext); } public accountcontroller(imembershipservice membership) { membershipservice = membership; } [httppost] public actionresult login(loginmodel model, string returnurl) { if (modelstate.isvalid) { if (membershipservice.validateuser(model.emailorusername, model.password)) { ..... } } } from unit testing project want simulate login public class accountcontrollertest2 { [test] public void login_usercanlogin() { string returnurl = "/home/index"; string username = "user1";

javascript - Toggling through values of a Json object using Jquery -

i have list of tasks can have 4 possible states taken json object. "not done", "done", "doing", "later" this states stored in object loaded via json. var states = { status: ['doing','done', 'later' ] }; tasks loaded json object. var tasks = [ {id: 1, text: 'do something.', status: 'doing'}, {id: 2, text: 'undo thing.', status: 'done'}, {id: 3, text: 'redo again.', status: 'started'}, {id: 4, text: 'responsive', status:'later'} ]; the html this. <ul> <li><a href="#1">do - <span class="status">doing</span> </a></li> <li><a href="#2">undo thing - <span class="status">done</span> </a></li> <li><a href="#2">redo again. - <span class="status">started</span> </a>&

jquery - Minification of Javascript and increasing performance -

here code html: <div class="board"> <table id="mastermind_table_one"> <tr id="one"> <td></td> <td></td> <td></td> <td></td> </tr> </table> <table id="mastermind_table_two"> <tr id="two"> <td></td> <td></td> <td></td> <td></td> </tr> </table> <table id="mastermind_table_three"> <tr id="three"> <td></td> <td></td> <td></td> <td></td> </tr> </table> </div> here code javascript: $('.next_round').click(function() { var count = 3; var counter = setinterval(timer, 1000); function timer() { count = count - 1; if (count === 0) { $('#mastermind_table_two&#

c++ - Questions about the logic and scope of a destructor that frees a linked list from memory -

i have class called stopwatch i'm working on (so please ignore of incompleteness below). interface supposed abstraction of stopwatch in real life. right i'm trying write destructor, free memory linked list represents laps. class stopwatch { typedef enum {unstarted, running, paused, finished} state; typedef struct { unsigned hours; unsigned minutes; unsigned seconds; } time; typedef struct { unsigned n; // lap number time t; // lap time lap* next_ptr; } lap; public: stopwatch(); ~stopwatch(); void right_button(); // corresponds start/stop/pause void left_button(); // corresponds lap/reset private: state cur_state; lap* first_ptr; } stopwatch::stopwatch() { cur_state = unstarted; first_ptr = null; } stopwatch::~stopwatch() { // destroy laps (lap* thisptr = first_ptr; thisptr != null;) { lap* tempptr = thisptr; thisptr = thisp