Posts

Showing posts from March, 2015

sql server 2008 - How to query the max quantity of grouped records and display that date -

i have view sums quantity of items based on item , date. want query results max(quantity) along date. if max(quantity) has multiple dates, want display oldest. want 1 record. here data example: example 1 item quantity date i1 100 1/1/2010 i1 100 2/1/2010 i1 5 3/1/2010 in case want see first record oldest date. because using max, need group by. how can rewrite query. can use store procedure if needed. display in report. select item, max(quantity), loaddate vwarchivequantitybyloaddate item = 'i1' group item, loaddate order item, loaddate using sql server 2008, reporting services. just 1 way without using max. sql fiddle demo select top 1 item, quantity, date vwarchivequantitybyloaddate item = 'i1' order quantity desc, date desc

ios - XCode 6.4 device list corrupted -

Image
this question has answer here: ios simulator appear udid in xcode 6 6 answers since adding ios8.3 or 8.4 simulators, device list in xcode 6 filled udids instead of ios version. adding 8.4 sim new xcode 7 beta seems have created similar issue. in device list (window > devices) there multiple devices same ios version. after deleting each duplicate device able restore order devices dropdown. seems bug ios8.4 sim, had duplicates of ios8.4 devices

ruby - removing escape characters when parsing a string from file -

i'm trying read file string interpolates variables defined in code, , substitutes string value of variables. the text file: my name #{name} the code: file = file.open("tesst.txt", "r") arr = [] name = "cdj" file.each_line.with_index { |line, index| puts line } file.close desired output: my name cdj actual output: my name #{name} when output line.inspect: "my name \#{name}" can me format string correctly reads #{name} variable instead of string inserted escape character? file= 'tesst.txt' name = 'cdj' file.readlines(file).each |line| eval("puts \"#{line}\"") end

http status code 404 - 404 after 43 seconds TTFB -

i have script uses simple_html_dom parse different site data. looks through table of users, grabs various sites needed, , parses data , stores them db. the problem when iterate through more 3 users 404 error. after lot of debugging (much of i'm learning go) looks ttfb hits 40 seconds 404 not found error. under page returns fine. i included following in php file extend time problem seems ignore these statements. // may take whils crawl site ... ini_set("memory_limit", "-1"); ini_set('max_execution_time', 300); //300 seconds = 5 minutes ini_set('max_input_time', -1); //300 seconds = 5 minutes set_time_limit(0); but i've never had problem before 404 page exists. i'm new simple_html_dom , crawling through different pages problem wait time long? if how can fix that? thanks so did not have execution time or setting change php script. having same issue fixed changing way simple_html_dom loads script from: $html = new sim...

php - PDO equivalent of mysql_num_rows or mssql_num_rows -

i know question has been asked before seems solutions have been specific problem presented. i have codebase hundreds of instances mssql_num_rows used. code example: $db->execute($sql); if ($db->getrowsaffected() > 0) { $total = $db->fetch(); in db class: $this->rowsaffected = mssql_num_rows($this->query_result); i can't create generic select count(*) table queries have many specific select statements. i run preg_replace remove between select , from , replace count(*) , run second query assumes queries setup way. i fetchall first count() results means upgrading instances of if statements. so best around replacement *_num_rows function if people updating code pdo. not solves specific problem, replaces functionality of *_num_rows. if that's not possible allowed possible before? if want count rows can pdo: $sql = 'select * users'; $data = $conn->query($sql); $rows = $data->fetchall(); $num_rows = count($row...

javascript - How can I erase a section of my table to display a message without touching the rest? -

i have created table made of 2 rows, first row checks if user input correct or not, , second row displaying button. have used following code inside script function inside first row of table display output response: function checkuserinput() { var userinput = document.getelementbyid("textinput").value; var stringtocheckagainst = random_images_array[num].split('.'); //this splits item @ array index array, so. if item "apple.gif", array reads ["apple", "gif"] if (userinput == stringtocheckagainst[0]) { //user has inputted correct string //window.alert("user gave correct response!"); document.write("<p>" + txt.fontsize(5) + "</p>"); document.close(); } else { //user has inputted incorrect string //window.alert("user gave incorrect response!"); document.write("<p>" + txt1.fontsize(5) + "</p>"); document.close(); } } </script> however code dele...

javascript - How to pass a parameter to Collection parse? backbone.js -

how 1 pass parameter through parse/fetch function? want pass variable variable_parameter in lower initialize-part. otherwise have write 3 identical collections. thank you help. app.js //-------------- // collections //-------------- diagnoseapp.collections.param1_items = backbone.collection.extend({ model: diagnoseapp.models.param1_item, url: 'testinterface.xml', parse: function (data) { var parsed = []; $(data).find(/*variable_parameter*/).find('parameter').each(function (index) { var v_number = $(this).attr('number'); var v_desc_d = $(this).attr('desc_d'); parsed.push({ data_type: v_data_type, number: v_number, desc_d: v_desc_d}); }); return parsed; }, fetch: function (options) { options = options || {}; options.datatype = "xml"; return backbone.colle...

python - Displaying both ViewSets and GenericAPIViews in the Django REST framework API Root documentation -

this question has answer here: how can register single view (not viewset) on router? 2 answers view: class fooviewset(viewsets.readonlymodelviewset): queryset = foo.objects.filter(state=2) serializer_class = fooserializer class barviewset(viewsets.readonlymodelviewset): queryset = bar.objects.filter(state=2) serializer_class = barserializer class bazviewlist(generics.listapiview): queryset = baz.objects.all() authentication_classes = (tokenauthentication,) permission_classes = (isauthenticated,) serializer_class = bazserializer def list(self, request): queryset = baz.objects.all() serializer = bazserializer(queryset, many=true) return response(serializer.data) urls: from django.conf.urls import include django.conf.urls.defaults import patterns, url rest_framework import routers rest_framework.authtoken import views...

Difference between () & [] in R -

i write this: tempx <- tempx (-1, c(-4, -2:-20)) which gives error message as: could not find function "tempx" whereas tempx <- tempx [-1, c(-4, -2:-20)] runs properly. please let me know diff between () & [] . () used call function. [] used subsetting vectors, arrays , matrices (and other such objects). i'd suggest if haven't already, reading an introduction r , available typing help.start() r itself. in particular, might @ sections 2.1 vectors , assignment , 5.2 array indexing. subsections of array .

networking - Mvn Connection Timeout Error because of proxy Setting in Redhat 7 while connecting via Bamboo -

This summary is not available. Please click here to view the post.

python - Install pymatbridge on Windows -

i trying use pymatbridge. using python 2.7.9 64 bits on windows , canopy 1.5.5 , when put following code in ipython notebook from pymatbridge import matlab mlab = matlab(executable='matlab') mlab.start() i receive error: zmqerror traceback (most recent call last) in () 1 pymatbridge import matlab 2 mlab = matlab(executable='matlab') ----> 3 mlab.start() c:\users\administrateur\appdata\local\enthought\canopy\user\lib\site-packages\pymatbridge\pymatbridge.pyc in start(self) 205 port = self.socket.bind_to_random_port(self.socket_addr) 206 self.socket_addr = self.socket_addr + ":%s"%port --> 207 self.socket.unbind(self.socket_addr) 208 209 # start matlab server in new process c:\users\utilisateur\appdata\local\enthought\canopy\app\appdata\canopy-1.5.5.3123.win-x86_64\lib\site-packages\zmq\backend\cython\s...

performance - web start jar validation getting slower with each Java update -

we have (eclipse rcp) application of 90mb 139 self-signed jars starts in 8s without web start , in 10s in older version of java 7. configured java not use browser proxy, i.e. deployment.proxy.type=0 . with each update of oracle's java startup performance drops. takes more , more time start up: 7u60/7u65/8u25: 13s (starts after 5s of web start processing) 7u75: 23s 8u31: 20s 8u40: 29s 8u51/8u60ea: 32s what can solve issue? from trace/logs can see probable slowdown due validating cached jars taking more time. note this question similar doesn't provide following details: diagnosis: when cached, update check runs in 0.5s (server returns "304 not modified"), full download takes few seconds on gigabit network. after update check, each jar xxx there log entry: validating cached jar xxx.jar when done, com.sun.javaws.main started after same validation seems happen again , takes same amount of time, application starts. the time spent in vali...

Java list value replacing -

if have java list 5 elements 0, 1, 2, 3, 4 had int number values. how can sum of combination of elements in place of elements combined the packages using follows: java.util.arraylist java.util.linkedlist java.util.vector java.util.stack java.util.iterator example mylist(o) = 1 mylist(1) = 2 mylist(2) = 3 mylist(3) = 4 mylist(4) = 5 i combine elements 1-3 mylist(0) = 1 mylist(1) = 9 //sum of elements 2,3,4, indexed 1-3 mylist(2) = 5 what asking instead of automatically adding new value (in case 9) end of list place. simply rebuild list , add elements within range: public static list<integer> combine(list<integer> list, int start, int end) { arraylist<integer> lst2 = new arraylist<>(); int sum = 0; (int = 0; < list.size(); i++) { //if not in combine range, add element new list if (i < start || > end) { lst2.add(list.get(i)); } else { //otherwise, ad...

Excel String Comparison Failing -

checking =d2 , aransas . when try , assign cell =d2="aransas" spits out false . when assign c5 =d2 , type aransas in c6 , , try =c5=c6 returns true . however, c5="aransas" still gives me false . what frickity frack going on? formatting of cells or way i'm typing strings? checked here: excel string comparison failing when should not , can't see how type issue, seeing it's literally comparing 2 strings. resolved: reason, seemed text (e.g. "aransas") wasn't being treated such. excel, things autoformatted numbers or dates can kept converting if 1 puts apostrophe ' in front of desired text. ended doing changing relevant cells text format, , voilà , equality comparison returns should.

Java regex for Uk postcodes with spaces -

this question has answer here: uk postcode regex (comprehensive) 26 answers i'm trying create regex matching following patterns (with , without space): m1 1aa, m60 1nw, cr2 6xh, dn55 1pt, w1a 1hq , ec1a 1bb i'm new @ , find hard create functional regex examples above. searching here , there found regex might work of patterns don't know how add condition "with or without space" each type of postcode. here regex found on post "^(a-pr-uwyz [0-9][abd-hjlnp-uw-z]{2})" how add space/no space condition? in order match m11aa or m1 1aa. you need regex: ^([a-pr-uwyz](([0-9](([0-9]|[a-hjkstuw])?)?)|([a-hk-y][0-9]([0-9]|[abehmnprvwxy])?)) ?[0-9][abd-hjlnp-uw-z]{2})$ ^ this space must set optional ? quantifier means 0 or 1 repetition . ...

tomcat - Query with q=*:* && q={keyword} && q=field:{keyword} in solr 4.9 -

i've found apache solr, , after installed apache solr tomcat successfully. , began use apache solr search. but had problem results of apache solr. when query field same as: title: love , , url same as: http://my_ip:8080/solr/music/select?q=title%3a+love&wt=json&indent=true . apache solr returned a lot of results title match word love . the problem here if query same as: love , , url same as: http://my_ip:8080/solr/music/select?q=love&wt=json&indent=true apache solr didn't return results . i want ask why q=love didn't return results ? hope can me. thank much. this schema.xml file: <schema name="example" version="1.5"> <field name="_version_" type="long" indexed="true" stored="true"/> <field name="_root_" type="string" indexed="true" stored="false"/> <field name="id" type="string" inde...

.net - Apply IDataErrorInfo validation errors to a control Errors inside a usercontrol child element -

Image
i have usercontrol contains label , textbox. validate textbox entry inside viewmodel using idataerrorinfo interface. validation kicks in, error not shown on textbox inside usercontrol on usercontrol itself. this usercontrol (the other dependency properties in base class ): <cc:labelableinputcontrol> <grid x:name="layoutroot" > <grid.columndefinitions> <columndefinition width="auto" /> <columndefinition width="*" /> </grid.columndefinitions> <label content="{binding path=labeltext, fallbackvalue=empty label}" grid.column="0" horizontalalignment="left" name="baselabel" verticalalignment="center" width="{binding path=labelwidth}"/> <textbox grid.column="1" x:name="basetextbox" text="{binding text" /> </grid> </cc:...

Vim not indenting javascript block comments properly -

if run vim's auto indent on block of code: /** * description here * * @return {?string} */ i /** * description here * * @return {?string} */ instead of (desired behavior) new behavior, previous being done correctly. i'm using vim-javascript plugin, , vimrc has sytanx on set autoindent set smartindent

php extract all objects from an array if value equals to a variable -

i have array of objects : array (size=13) 0 => array (size=7) 'id' => string '62' (length=2) 'firstname' => string 'alio' (length=24) 'lastname' => string 'djam' (length=7) 'city' => string 'paris' (length=8) 1 => array (size=7) 'id' => string '2' (length=1) 'firstname' => string 'jack' (length=7) 'lastname' => string 'jacky' (length=6) 'city' => string 'berlin' (length=8) ... i need extract objects city equals variable (berlin, paris, ...). $city = 'berlin'; $found = []; foreach($data $row){ if($row['city'] == $city){ $found[] = $row; } }

html - Is it possible to add javascript functions to an embedded webmap? -

i have creatd webmap on arcgis online. embedded map in iframe . i using html , javascript develop whith phonegap . does arcgis have js api similar googlemap? yes it's possible , documented in api you can find full docs here there repo on github phonegap/arcgis starter set up

jquery - Add an arrow when hovering an image -

i need help. i have current code: <script type="text/javascript"> $(document).ready(function(){ $('div.imagens1').mouseover(function(){ div_imagem = $(this); //div que tem imagem p = div_imagem.find('p').first(); texto_p = p.text(); $('#lista1').find('p').each(function(){ $(this).css('color','white'); $(this).css('font-size','20px'); if ( ($(this).text()).tolowercase() == (texto_p) ){ texto_lista = $(this); //texto (elemento p da lista) respetivo à imagem //podes por exemplo meter o texto p negrito assim: texto_lista.css('color','#575658'); texto_lista.css('font-size','26px'); } }); }); }); </script> that searches in image text "salas" , goes list have on side change css gets highlight...

anaconda - Theano windows installation - Configuring the Environment -

i'm trying install theano on windows anaconda , i'm stuck @ "configuring environment" step. instructions here say: the script assumes installed winpython distribution, update winpython line otherwise. line in question is call %scisoft%\winpython-64bit-2.7.9.4\scripts\env.bat what supposed change if i'm using anaconda instead of winpython? it's easy install "theano on windows anaconda" after anaconda installed: $ conda install mingw libpython $ pip install theano then maybe, needn't else, test it.

Jekyll - Get the date of the last post -

i know can post date post.date . but, how can date of last post or date related last time website generated? i want echo this: last update: {{ getdate }} you want site.time , show exact date/time when site last generated: 2015-07-22 17:11:02 +0200 to output exact date format want, can use liquid's date formatting . for example, {{ site.time | date: "%-d %b %y"}} generate 22 july 2015 .

How to line up columns when printing from 2d array in Python? -

this question has answer here: pretty print 2d python list 4 answers i want display simple 2d array in tabular format headings @ top, values line under headings. there way this? have looked @ pprint , printing using numpy cannot work. here have @ moment: myarray = [['student name','marks','level'],['johnny',68,4],['jennifer',59,3],['william',34,2]] row in myarray: print(" ") each in row: print(each,end = ' ') any suggestions? you need align based on length of longest element: myarray = [['student name','marks','level'],['johnny',68,4],['jennifer',59,3],['william',34,2]] mx = len(max((sub[0] sub in myarray),key=len)) row in myarray: print(" ".join(["{:<{mx}}".format(ele,mx=mx) ele in row])) outp...

modernizr - Passing data to variables from other Javascript files -

i'm working on project driving me crazy, i've searched through articles here on site i've not been able head how make work. i using modernizr.js file check geolocation , localstorage, localstorage piece working fine finding latitude, longitude , creating map geolocation file. issue i'm having passing latitude , longitude values main js file can pass values (along form data entered on page) constructor function. i don't know if order of statements or if passing data incorrectly, i've been battling while , have succeeded in confusing myself more. if can clarify me appreciate it. i including files project, again stuck on passing values latitude , longitude geolocation.js file. html file: <!doctype html> <html> <head> <title>javascript, ajax , json: list</title> <meta charset="utf-8"> <link rel="stylesheet" href="todol14o2.css"> <script src="http://maps.google.com/m...

osx - How do I know the way my OS X application was launched? -

ok. 2015. lot of things have changed. , ask... does know way detect how application launched on osx ? because still don't have answer... i talking these cases important me: regular launch user (via selecting app finder, launchpad, etc.) launch @ login (automatic launch myhelperapp on startup) launch user selecting item in services menu ("do in myapp") assuming app wasn't launched before. right detecting launch-at-login outdated getcurrentprocess function, obtaining current process id , looking parent process info. in case parent process info obtained (!) , bundleid not equal list of strings (myhelperapp bundleid, com.apple.loginwindow, com.apple.coreservices.uiagent) (!) - not launch-at-login case. yes, works now, c'mon people, outdated, not stable way solve problem! and important - there seems no way tell app launched via services menu! has found new on topic?

sql server - Automated export of a table/query from SQL SVR 2012 into Excel 2007 and subsequent VBA formatting macro? -

i’ve been given task of updating code isn’t working after our sql svr 200 sql svr 2012 (don't laugh) conversion. have automated task creates 500ish xls files in line-by-line manner using old sp_oacreate command. in 2000, job takes hours , rickety @ best. needless say, doesn’t work @ in 2012. that's never upgrading? i rewrote job constructing table, adding info table, & doing bulk export xls (using openrowset). new task ran in less 15 minutes , ecstatic. ops complained new files weren’t formatted… i looped , tried formatting automation. that’s fell apart. use openrowset , export “xls template file” has autorun vba code formatting when file opened first time. didn’t work. use openrowset , export “xlsm template file” has autorun vba code formatting when file opened first time. didn’t work. use bcp , export “xls template file” has autorun vba code formatting when file opened first time. didn’t work. use bcp , export “xlsm template file” has autorun vba c...

r - Calculating the analogue of Euler angles/Tait-Bryan angles for dimensions >3 -

while trying answer another question , issue of how calculate euler angles dimensions > 3 came up. rspincalc package has straightforward dcm2ea function converting 3d rotation matrix euler or tait-bryan angles, handles specific case of 3 dimensions. wikipedia page on euler angles briefly discusses issue of extending euler angles higher dimensions , cites italian paper apparently generalises method greater numbers of dimensions. unfortunately, neither italian nor maths quite taking paper , creating usable r function. my current method, used in this answer little cumbersome, least. use ryacas package create symbolic matrix composite of series of rotations arbitrary number of dimensions. can solved iteratively against known rotation matrix find angles required. works, gets increasingly slow once number of dimensions 5 or more. is there better way achieve objective, either through implementation of method in italian paper or else? there interesting paper here 19...

use uart driver from linux kernel -

there external device (sensor keyboard) connected processor thrue uart port (tx rx) , gpio interrupt line. need write driver keyboard (not standart own protocol, linux kernel 4.1). i writed module whith line discipline , requested irq on open() function (when open user space /dev/ttymxc3). it's work, line discipline structure has no released callbacks suspend , resume functions. it's need release sleep keyboard when system sleeping. i try write tty driver use uart driver, don't know how. how communicate kernel module external devices thrue uart port? thanks. you can use uart device in kernel space // call userspace { mm_segment_t fs; fs=get_fs(); set_fs(get_ds());//kernel ds handle = sys_open(uts_uart_dev_name, o_rdwr | o_noctty | o_nonblock, 0); if( handle < 0 ) { printk(kern_info "uts port open fail [%s] \n ", uts_uart_dev_name); ...

python - Using Flask's "after_request" handler to get tracebacks of errors -

the documentation after_request says "as of flask 0.7 function might not executed @ end of request in case unhandled exception occurred." there way change after_request functions called unhandled exceptions, example log traceback? use teardown_request instead. register function run @ end of each request, regardless of whether there exception or not. these functions not allowed modify request, , return values ignored. if exception occurred while processing request, gets passed each teardown_request function. from flask import flask app = flask(__name__) # unhandled teardown won't happen while in debug mode # app.debug = true # set if need full traceback, not exception # app.config['propagate_exceptions'] = true @app.route('/') def index(): print(test) @app.teardown_request def log_unhandled(e): if e not none: print(repr(e)) # app.logger.exception(e) # works propagate_exceptions app.run('localho...

apache spark - When does fetch happen from Cassandra -

i have application triggers job spark master. when check ip address executing job, displaying application ip , not spark worker ip. so, understand, call on rdd generates spark worker work. but question this. cassandrasqlcontext c = new cassandrasqlcontext(sc); queryexecution q=c.executesql(cqlcommand); //-----1 q.tordd().count(); //----2 i saw worker doing 2 nothing 1. so mean fetch cassandra , rdd creation out of in 1 done in application? if so, 2 trigger job 2 workers. in case, fetch again cassandra , process count? can clarify this?? edit going answer provided, if count call triggers workers function, use of executesql creating rdd in local? create cassandra dataset of data querying ? if that's case, querying cassandra happens twice? 2.. if spark automatically distributes computations of 10 partitions of cassandra among 4 workers, aggregate results? master doing distribution. aggregate too? if don't cache rdd , count operation, happen? spark try...

fingerprint - How to rename the final generated file in a Brunch plugin? -

i'm developing plugin brunchjs , don't understand everything. https://github.com/dlepaux/fingerprint-brunch inspirated github.com/mutewinter/digest-brunch , github.com/jgallen23/grunt-hash concept : rename output filename , write manifest key (to real filename). exemple : in config file want make /js/master.js file. the goal of plugin rename filename : master.[hash].js next write in manifest : {'/js/master.js' : '/js/master.[hash].js'} i hope me understand how what do. exports.config = paths: public: './../public' compass: './config.rb' watched: ['app'] files: javascripts: jointo: '/js/master.js': /^(bower_components[\/\\]bootstrap-sass-twbs|bower_components[\/\\]bootstrap-datepicker|app)/ #'/js/vendor/response.js': /^(bower_components[\/\\]responsejs)/ #'/js/vendor/head.min.js': /^(bower_components[\/\\]headjs)/ #'/js/vendor/jqu...

c++ - cmake find_library with version number -

i have library in different flavours libsoci-3.2.2_core_s.a libsoci-3.2.2_core_sd.a etc.. 1 static debug version or static release version , other versions (unicode, dll, etc.). now when use cmake statement finds first library instead of correct one. set(cmake_prefix_path ${soci_library_path}) find_library(soci_library names "soci-3.2.2_core_${unicode_flag}s${build_type_flag}" hints "${soci_library_path}" ) message("soci_searchname: soci-3.2.2_core_s${build_type_flag}") message("soci_found: ${soci_library} soci-3.2.2_core_s${build_type_flag}") currently have static versions of lib, put 's' hardcoded. build_type_flag 'd' debug or empty , in case 'd' cmake returns d:\src\c\github\build\datinator>make soci_searchname: soci-3.2.2_core_sd soci_found: d:/opt/soci/lib/libsoci-3.2.2_core_s.a soci-3.2.2_core_sd -- configuring done -- generating done so have do, cmake finds correct library version, a...

c++ - What is an undefined reference/unresolved external symbol error and how do I fix it? -

what undefined reference/unresolved external symbol errors? common causes , how fix/prevent them? feel free edit/add own. compiling c++ program takes place in several steps, specified 2.2 (credits keith thompson reference) : the precedence among syntax rules of translation specified following phases [see footnote] . physical source file characters mapped, in implementation-defined manner, basic source character set (introducing new-line characters end-of-line indicators) if necessary. [snip] each instance of backslash character (\) followed new-line character deleted, splicing physical source lines form logical source lines. [snip] the source file decomposed preprocessing tokens (2.5) , sequences of white-space characters (including comments). [snip] preprocessing directives executed, macro invocations expanded, , _pragma unary operator expressions executed. [snip] each source character set member in character literal or string literal, e...

angularjs - Generate gps marker's icon in CSS3 for OSM -

i'm generating openlayer map different markers. controlled angular , leaflet directive. my question : i'm wondering if it's possible generate marker's icons in pure css3 instead of using png images ? code hope replace. gps_icon: { iconurl: '/static/lib/leaflet/images/marker-gps.png', shadowurl: '/static/lib/leaflet/images/marker-gps-shadow.png', iconsize: [40, 40], shadowsize: [40, 40], iconanchor: [20, 20], shadowanchor: [18, 18], popupanchor: [10, 20] } if has try this, i'm curious know if possible , how ? thank ! afaik there no such js webmap lib supports css/font based marker icons. feel free ask such ol3 feature @ bug tracker...

gsub in R with case condition in R -

i have data : pes + pea + pwh i want use gsub or other function in r such -- if there pea in data keep pea (and pwh should kept too) , remove pes so ideally condition should involve pea , pes. final output : pea + + pwh thanks! the question easier answer if provide sample data set. assuming intention replace strings taking account capitals ignore.case = false should enough. example: x <- "pes + pea + pwh + pes" gsub("pes","new text",x, ignore.case = false) would give you: [1] "new text + pea + pwh + pes"

dataframe - R replacing columns by lookup to dictionary -

in question need able lookup value dataframe's column not based on 1 attribute, based on more attributes , range comparing against dictionary. (yes, continuation of story in r conditional replace more columns lookup ) it should easy question r-known ppl, because provide working solution basic indexing, needs upgraded, possibly ... hard me, because iam in process of learning r. from start: when want replace missing values columns testcolnames (big) table df1 according column default of (small) dictionary testdefs (row selected making testdefs$labmet_id equal column name testcolnames ), use code: testcolnames=c("80","116") #...result of regexp on colnames(df1), longer df1[,testcolnames] <- lapply(testcolnames, function(x) { tmpcol<-df1[,x]; tmpcol[is.na(tmpcol)] <- testdefs$default[match(x, testdefs$labmet_id)]; tmpcol }) to go: now - need upgrade solution. table testdefs have (example below) multiple rows of same labmet_id ...

vbscript - To get no. of buttons on Google homepage using Static descriptive programming in QTP -

i wanted count no. of objects on google homepage using static programming, mean without creating object first(the way in dynamic one). pls tell me wrong in below statement set p = browser("creationtime:=0").page("title:=google").webbutton("type:=submit","html tag:=input") msgbox p.count() pls help, screenshot of error attached here. thanks you can total number of buttons using descriptive approach. set odesc = description.create() odesc("micclass").value="webbutton" set = browser("creationtime:=0").page("title:=google").childobjects(odesc) msgbox i.count() set = nothing : set odesc = nothing

ios - Getting an error when trying to use imagePickerController Delegate function below: -

when trying use following function func imagepickercontroller(picker: uiimagepickercontroller,didfinishpickingimage image: uiimage, editinginfo: [string: anyobject]?) { let selectedimage:uiimage = (editinginfo[uiimagepickercontrolleroriginalimage]) as! uiimage displayimage.image = selectedimage self.dismissviewcontrolleranimated(true, completion: nil) } getting error: "cannot subscript value of type '[string:anyobject]? index of type 'string' on second line write let selected image this has worked fine xcode 6.3 & 6.4 new xcode 7 beta 4 not work , throws error. help! try dismissing controller before setting image imageview. replace methods as: func imagepickercontroller(picker: uiimagepickercontroller, didfinishpickingmediawithinfo info: [nsobject : anyobject]) { self.dismissviewcontrolleranimated(true, completion: nil) let selectedimage:uiimage = (editinginfo[uiimagepickercontrolleroriginalimage]) as! uiimage displayimage.ima...

How can I package up a PowerShell script so it runs when I click on shortcut? -

i have sample .ps powershell script created me. can tell me how can make shell runs in background when click on windows shortcut icon. create shortcut powershell -noexit -executionpolicy bypass -file script.ps

json - mongodb findOne() geojson data -

i trying find data using findone function of mongodb. code below doesn't find anything. collection : streets code: db.streets.findone({"id":181035}) collection data: { "features": [ { "type": "feature", "properties": { "id": 181035, "adi": "Özlü sitesi", "tipi": "Ýç yol", "anname": null, "rnname": null, "ilkod": "06", "adiuluslar": null, "kkno": null }, "geometry": { "type": "linestring", "coordinates": [ [ 32.629908, 39.851886 ], [ 32.63044, 39.851549 ] ] } } }, { "type": "feature", "properties": { "id...