Posts

Showing posts from July, 2012

javascript - Magnific popup how to catch close? -

this magnific popup <script> $(document).ready(function () { setinterval(function () { $.magnificpopup.open({ items: { src: '#recently-viewed-popup' }, type: 'inline' }); }, <?php echo $time_popup; ?>); }); </script> i catch open, how catch when client close ? try this: <script> $(document).ready(function () { setinterval(function () { $.magnificpopup.open({ items: { src: '#recently-viewed-popup' }, type: 'inline' }); }, <?php echo $time_popup; ?>); }); $.magnificpopup.close({ ...

Identify the branch or trunk you are connected in IntelliJ -

i couldn't find way in intellij inform me branch or trunk repository of subversion,svn connected to. can change different branches and/tags, never know branch working with. in eclipse, identified along name of project, in intellij, such not displayed. 1 know? current version: intellij idea 2017.14 you can see url used working copy @ moment in subversion working copies tab of version control tool window. it not shown in project view or other locations. please vote following requests: https://youtrack.jetbrains.com/issue/idea-76042 , https://youtrack.jetbrains.com/issue/idea-63893

java - Custom Bean Validation UnexpectedType Exception Spring 3.2 -

i'm new application uses spring 3.2. project upgrade , upgraded java 1.6 1.7. after upgrading i'm facing issue custom bean validation on group of field. i had google , understand validation , looks good. please note works java 1.6 , made code comparison too. controller.java @requestmapping(value = constants.url, method = requestmethod.post) public modelandview process( @modelattribute("bean") bean bean, bindingresult result, sessionstatus status, @requestparam(constants.wizard_page) int currentpage, modelmap modelmap, model model, locale locale, redirectattributes redirectattributes, httpservletrequest request, httpservletresponse response) { isnotvalid(bean, result, interface.class); } public boolean isnotvalid(object target, errors errors, class<?>... groups) { set<constraintviolation<object>> result = validator.validate(target, groups); ...

android asynctask - What exactly does thread priority do in Java -

this question has answer here: java multithreading - thread priority 5 answers i working on android project written in java. have dashboard queries data cloudant database , renders data on graphs. data has processed when received. have 4 asynctasks process received data in doinbackground override method simultaneously (or supposed to). process being slow, tried line thread.currentthread().setpriority(thread.max_priority); in each asynctask. however, 4 asynktasks seem happen 1 after other, due changing priority of threads max? when thread priority changed, stop other threads , continue 1 until finishes? from: https://docs.oracle.com/javase/7/docs/api/java/lang/thread.html every thread has priority. threads higher priority executed in preference threads lower priority. each thread may or may not marked daemon. when code running in thread creat...

datagridview - WinForm DataGridViewComboBoxCell - only Formatted Value updated instead of Value -

i wonder if came across following issue: update datagridviewcomboboxcell follows (it's copying settings in 1 row other multiple rows selected): irs = 0 me.dgw.selectedrows.count - 1 ic = 0 20 me.dgw.selectedrows(irs).cells(ic + 3).value = _ me.dgw.rows(me.comboboxcopyfromline.selectedvalue).cells(ic + 3).value call checkline(me.dgw.selectedrows(irs).index) ' validation next next behaviour when in other case on me.dgw.rows(xx)... works perfectly. however, in case (selectedrows instead rows), correct result in comboboxcells visually , validation function flashes cells containing int16 values red, indicating value missing . when press save , reload form, "red" values gone. affects int16 values , columns string comboboxcell selection valid , saved. when go edit mode , leave (click cell, click other cell), validation flashes green valid value , when save it, correc...

c++ - How is atomic exchange of std:shared_ptr in libstdc++ correct -

based off of libstdc++'s implementation of atomic exchange ( https://gcc.gnu.org/ml/libstdc++/2014-10/msg00154.html ): it looks 16 mutexes statically allocated. when atomic swap needs occur, swapping code hashes 2 pointers swapped 1 (or two) of static mutexes, locks, , swaps. if shared_ptr shared between threads , being concurrently accessed, how mutexes guarantee synchronization of concurrent access , modification? i’m guessing code assumes correct alignment of internal raw pointer, that's x86 rule, not c++ guarantee. missing makes swap atomic , correct without additional locking each read of underlying raw pointer? the atomic_* functions atomic respect each other. in other words, valid way concurrently access shared_ptr being modified atomic_exchange via atomic_load , take same mutex (based on shared_ptr 's address) , block until atomic_exchange completes.

How to use boost::python::dict or tuple in main function? -

when use boost::python::tuple or boost::python::dict in main function, program crash! #define boost_python_static_lib #include <boost/python.hpp> #include <iostream> #include <boost/python/tuple.hpp> #include <boost/python/dict.hpp> //using namespace std; using namespace boost::python; int main() { //tuple x; //x = make_tuple(object(0),object(1)); dict x; x["123"] = 3; return 0; } but when use them in .dll , ok, what's wrong? it's necessary call py_initialize() initialize interpreter before use of python object: #define boost_python_static_lib #include <boost/python.hpp> #include <iostream> #include <boost/python/tuple.hpp> #include <boost/python/dict.hpp> //using namespace std; using namespace boost::python; int main() { py_initialize(); dict x; x["123"] = 3; return 0; } boost python offers lot of functionalities interface c++ python, funcionalitie...

newrelic - Stack trace in New Relic shows 99% of time in Rails::Rack::Logger#call -

i've been working on improving performance of high throughput endpoint , i've reduced sql calls few ms average response time still > 150ms. new relic highlights poor performing stack traces , in of examples see: rails::rack::logger#call taking 99% of time (over 2 seconds). causing these hangups? there no logging happening , these entries don't show on average call endpoint?

android - Program do not disturb mode -

when open second activity, turn on not disturb mode on android device. however, want not disturb turn on through second page (either opening or through button created on second page). code found on stack overflow in android manifest file <uses-permission android:name="android.permission.access_notification_policy" /> i'm not sure go here, appreciated. use method: private void setringermode(context context, int mode) { notificationmanager nm = (notificationmanager) context.getsystemservice(context.notification_service); // check dnd permissions api 24+ if (android.os.build.version.sdk_int < 24 || (android.os.build.version.sdk_int >= 24 && !nm.isnotificationpolicyaccessgranted())) { audiomanager audiomanager = (audiomanager) context.getsystemservice(context.audio_service); audiomanager.setringermode(mode);  } } where mode parameter can audiomanager.ringer_mode_silent or audiomanager.ringer_mode_normal...

unix - Shell Script : Assign the outputs to different variables -

in shell script need assign output of few values different varialbes, need please. cat file1.txt uid: user1 cn: user 1 employeenumber: 1234567 absjobaction: hired i need assign value of each attribute different variables can call them them in script. example uid should assigned new variable name current_uid , when $current_uid called should give user1 , forth other attributes. , if output not contain of attributes attribute value should considered "null". example if output not have absjobaction value of $absjobaction should "null" this did array #!/bin/bash ifs=$'\n' array=($(cat /tmp/file1.txt | egrep -i '^uid:|^cn:|^employeenumber|^absjobaction')) current_uid=`echo ${array[0]} | grep -w uid | awk -f ': ' '{print $2}'` current_cn=`echo ${array[1]} | grep -w cn | awk -f ': ' '{print $2}'` current_employeenumber=`echo ${array[2]} | grep -w employeenumber | awk -f ': ' '...

cors - Why does my JavaScript get a "No 'Access-Control-Allow-Origin' header is present on the requested resource" error when Postman does not? -

i trying authorization using javascript connecting restful api built in flask . however, when make request, following error: xmlhttprequest cannot load http://myapiurl/login . no 'access-control-allow-origin' header present on requested resource. origin 'null' therefore not allowed access. i know api or remote resource must set header, why did work when made request via chrome extension postman ? this request code: $.ajax({ type: "post", datatype: 'text', url: api, username: 'user', password: 'pass', crossdomain : true, xhrfields: { withcredentials: true } }) .done(function( data ) { console.log("done"); }) .fail( function(xhr, textstatus, errorthrown) { alert(xhr.responsetext); alert(textstatus); }); if understood right doing xmlhttprequest different domain page on. browser blocking allows request in same origin securi...

java - tomcat started but application not loading in browser -

tomcat started. getting page cant find error in browser. using catalina_base: /opt/tomcat8 using catalina_home: /opt/tomcat8 using catalina_tmpdir: /opt/tomcat8/temp using jre_home: /usr/java/jdk1.8.0_74 using classpath: /opt/tomcat8/bin/bootstrap.jar:/opt/tomcat8/bin/tomcat-juli.jar tomcat started. browser this page can’t displayed •make sure web address http://172.22.68.60:8083 correct. •look page search engine. •refresh page in few minutes. server.xml <?xml version='1.0' encoding='utf-8'?> <!-- licensed apache software foundation (asf) under 1 or more contributor license agreements. see notice file distributed work additional information regarding copyright ownership. asf licenses file under apache license, version 2.0 (the "license"); may not use file except in compliance license. may obtain copy of license @ http://www.apache.org/licenses/license-2.0 unless required applicable law or agree...

SOCKS-5 proxy server on android device without root -

is there way create socks-5 proxy server on unrooted android device? why require root? can make own android application create server on device , use server proxy on compluter, without rooting device? update: came using this library try create proxy server. downloaded files, added main .jar file project dependencies in androidstudio. there trying start server runnable in service. here service code: public class proxyservice extends service { private static boolean running = false; @override public int onstartcommand(intent intent, int flags, int startid) { serverauthenticatornone auth = new serverauthenticatornone(); proxyserver server = new proxyserver(auth); run(server); //runnable needed because if start service //this thread throws network on main thread exception return start_sticky; } private void run(proxyserver server) { if (running) return; final proxyserver ...

coldfusion - Sizing headers to include arrows -

Image
how resize columns in grid make enough space sort-direction arrows appear when sorting column? when grid loads, resizes columns fit text of columns precisely. however, not leave enough room sort direction arrows can appear, making them unable seen unless column manually resized. how can set default size of columns such includes space these? keep in mind column sizes must still relative length of header text; fixed width not sufficient. please advised new both coldfusion code base in working in. there may conflicting resizing functionality being processed i'm not aware of. based on way columns resizing, there code may doing should aware of? like this: <cfgridcolumn header="something" name="something" width="some number">. just make sure number big enough.

React Navigation TabBar Does not display -

i try add tabbar navigation , not display. stacknavigator works fine though. idea ? class app extends react.component { render(){ const mainnavigator = stacknavigator({ welcomeslides: {screen: welcomeslides}, home: { screen: firebasereactnative }, details: { screen: worditem }, daily : { screen: tabnavigator({ home : {screen: firebasereactnative}, }) }// closes daily }); return( <mainnavigator /> ); } }

html - Javascript $http dependency injection -

i'm having problems trying make http calls inside same javascript controller gives me error: 'function not defined' if move function outside of controller, can't use $http dependency.. here's problem... what should use? i'm trying call function through onclick event on div created dinamically. i've tried not work: function mycontroller($scope,$http,$resource) { function activatesmartcase(deviceid) { }; } thanks if call method ng-click directive should attached $scope $scope.activatesmartcase=function(deviceid){ }

Android - Selecting five random numbers with some probability -

i want select 5 random numbers probability. my numbers: 2-5-6-9-14 probability: 2 -> %30 5 -> %20 6 -> %35 9 -> %10 14 -> %5 i want go new activity if 3 numbers same. not: maximum 3 numbers can same. how can that? you should try (can massively improved). idea generated number between 0 , 100 (representing 100%). , return number want based on probabilities: public int random() { random r = new random(); int n = r.nextint(100); if (n < 30) // 30% return 2; if (n < (30 + 20)) // 20% (we exclude 30% above) return 5; if (n < (30 + 20 + 35)) // 35% (we exclude ones above) return 6; if (n < (30 + 20 + 35 + 10)) // 10% (30 + 20 + 35 previous probabilities) return 9; return 14; }

Spotfire - filters applied to be saved in DB -

how store user actions filter applied on table 'xyz' user in spotfire?? , action performed user must stored in database log no idea why you'd want log that. serving data users. why care how sliced , diced it? regardless, here want start: tibco spotfire server , environement action logs , system monitoring

android - Status{statusCode=PLACES_API_KEY_INVALID, resolution=null} -

Image
i have 2 different applications using same key, same dependencies. 1 works, second error: status{statuscode=places_api_key_invalid, resolution=null} any clue? thanks it won't work generated api key depends on package name , it's not same need generate other one. key restriction lets specify websites, ip addresses or apps can use key.

python - how to run manage.py on heroku with cleardb apps -

i uploaded django app heroku , provision cleardb add-on using these 3 commands heroku documantation: heroku addons:create cleardb:ignite heroku config | grep cleardb_database_url heroku config:set database_url='mysql://adffdadf2341:adf4234@us-cdbr-east.cleardb.com/heroku_db?reconnect=true' it seems o.k , app running (but without database). try run: $ heroku run python manage.py migrate and error get: traceback (most recent call last): file "manage.py", line 22, in <module> execute_from_command_line(sys.argv) file "/app/.heroku/python/lib/python3.5/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line utility.execute() file "/app/.heroku/python/lib/python3.5/site-packages/django/core/management/__init__.py", line 355, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "/app/.heroku/python/lib/python3.5/site-packages/django/core/management/base.py...

sql server 2008 - how to use distinct with where clause and inner join -

Image
i have following query want use clause show not distinct values please me when use multiple columns after currentdate doesn't shows distinct values select convert(varchar(10), ts.current_datetime, 101) currentdatets,ts.student_id,tc.class_name,tsi.section_name,tl.test_name tblstudentmarks ts inner join tblclassinfo tc on tc.idx = ts.class_id inner join tblsectioninfo tsi on tsi.idx = ts.section_id inner join tblsubjects su on su.idx = ts.subject_id inner join tbltestlist tl on tl.idx = ts.testtype ts.school_id = 2 , ts.section_id = 1 , ts.class_id = 2 , ts.testtype = 1 your question unclear, seems need add distinct select... select distinct convert(varchar(10), ts.current_datetime, 101) currentdate tblstudentmarks ts inner join tblclassinfo tc on tc.idx = ts.class_id inner join tblsectioninfo tsi on tsi.idx = ts.section_id inner join tblsubjects su on su.idx = ts.subject_id inner join tbltestlist tl on tl.idx = ts.t...

r - How can I make a list of data frames which have the same values in the first column? -

say have multiple data frames, , want make multiple lists of data frames same first column. example, dfs 1-4 have "abc" in columns of first row, dfs 5-7 have "def" in columns of first row, etc. how can write script puts (in case) dfs 1-4 in list called "abc", dfs 5-7 in list called "def"? this first question, please let me know if there else provide. researched few days no luck :( thanks! jack so guide solution, asked. first make sure have list of data frames called l ( all(sapply(l, is.data.frame)) should true ). then, each element ( df ) of list, need character (string) in first row (in column, example first one). give vector of characters , can using either sapply or purrr::map_chr . after that, here comes split want do. use split first argument vectors of indices (see ?seq_along ) , second argument vector of characters you've computed before. finally, use lapply transform list of indices in list of data frame...

CDI in a servlet produces NullPointerException -

i trying use cdi in servlet, here snippet of servlet code public class myservlet extends httpservlet{ @inject @any instance<myprocedure> procedures; public void handlerequest(servletrequest req, servletresponse res) throws exception { if (procedures == null) { system.out.println("procedure list null"); } (object o : procedures) { system.out.println("calling procedure " + o.tostring()); } } } myprocedure interface , appliation war contains couple of classes implement myprocedure. i nullpointerexception because list of procedures null...i have beans.xml file in web-inf directory. i found out problem was. interface implemented beans had included in war archive under web-inf/lib. after did started work expected.

How to get a failure file/excludeFromFailureFile argument from classpath for maven-pmd-plugin? -

the maven-pmd-plugin allows ruleset files local filesystem (with absolute path only, makes unflexible use) , classpath practically means multi-module project rulesets put separate project build maven parent or aggregator it's available siblings. how achieve failures files specified in excludefromfailurefile parameter of plugin configuration in pom? putting them next rulesets recognized doesn't work, pmd maven plugin article on multi-module projects doesn't contain information (why?) , google appears redirect rulesets on classpath issues systematically. loading classpath allows able specify resource once in form of dependency , able build @ every level of multi- , or hierarchical project structure - consider following example: aggregator: - pom.xml - parent: - pom.xml (maven-pmd-plugin here) - module1: - pom.xml - module2: - pom.xml where can validate , build aggregator (which run on ci service), parent , single modules 1 specification. using b...

GNUstep compiling Objective C: Cannot find foundation/NSObject.h File -

i have started learning how program objective c. however, struggling test programs because cannot them compile. whenever try make makefile error in shell states "test1_1.h:5:33: fatal error: foundation/nsobject.h: no such file or directory compilation terminated. have files installed on computer i'm not sure how need tell compiler find these files. here program if helps. using windows system. test1_0.m file #include "test1_1.h" #include <appkit/appkit.h> int main(int argc, const char *argv[]) { nsautoreleasepool *pool; appcontroller *delegate; pool = [[nsautoreleasepool alloc] init]; delegate = [[appcontroller alloc] init]; [nsapplication sharedapplication]; [nsapp setdelegate: delegate]; release(pool); return nsapplicationmain (argc, argv); } appcontroller.m file #include "test1_1.h" #include <appkit/appkit.h> @implementation appcontroller - (void) applicationwillfinishlaunching: (nsnotification *) not { nsmenu *menu; nsmenu ...

python - git push flynn master freezes on local instance -

i have setup flynn on local machine vagrant method. seems simple deploying app using flynn. when deploying application examples, when push code flynn using git push flynn master command line freezes when tries install environment, in given example go application or example phthon application. root@shaurya-z510:/home/xuryax/desktop/work/flynn-go/python-flynn-example# sudo git push flynn master counting objects: 23, done. delta compression using 8 threads. compressing objects: 100% (19/19), done. writing objects: 100% (23/23), 3.19 kib | 0 bytes/s, done. total 23 (delta 5), reused 0 (delta 0) -----> building pexample... -----> python app detected -----> installing python-3.6.1 not sure why happening.

google bigquery - SQL select unique elements and compare them on two periods -

Image
lets have table looks this: i want able see how many url records there during period1 , period2. where period 1 "date > '2016-01-01' , date < '2017-01-01' " and period 2 "date > '2014-01-1' , date < '2015-01-01' " here visualization of expectations : i can 1 single period using following query: select url, count(url) period1 table date < '2017-01-01' , date > '2016-01-01' group url but how add second column period2? any thoughts appreciated. sorry if explained myself incorrectly. for bigquery standard sql #standardsql select url uri, countif(date between '2016-01-01' , '2016-12-31') period1, countif(date between '2014-01-01' , '2014-12-31') period2 `logfilesv2_dataset.de_visits` group url

ios - Accessing descendant controls in custom UIView using XCTest -

the problem having have reusable views / controls contain text fields. these xib files custom ui view class, such following: import uikit @ibdesignable public class customcontrol: uicontrol { @iboutlet public weak var textfield: uitextfield? public var contentview: uiview? required public init?(coder adecoder: nscoder) { super.init(coder: adecoder) setupviewfromnib() } override public init(frame: cgrect) { super.init(frame: frame) setupviewfromnib() } override public func awakefromnib() { super.awakefromnib() setupviewfromnib() } override public func prepareforinterfacebuilder() { super.prepareforinterfacebuilder() setupviewfromnib() contentview?.prepareforinterfacebuilder() } func setupviewfromnib() { guard let view = loadviewfromnib() else { return } guard let textfield = self.textfield else { return } view.frame = bounds view.autoresizingmask = [.flexiblewidth, .flexibleheight] addsubview(view...

android - Uploading 4032x3024 / 12MP resolution camera image to server -

i found out why previous issue had photos rear camera on phone not uploading via android app occurring. camera resolution high @ 4032 x 3024 , megapixel count 12mp, noticed when lower qualities, work. seems can go high 4.7 megapixel quality. 12mp quality absolutely large? or there way reduce size before uploaded? main activity package com.example.stins.orbotcamera; import android.manifest; import android.app.progressdialog; import android.content.context; import android.content.dialoginterface; import android.content.intent; import android.content.pm.packagemanager; import android.database.cursor; import android.graphics.bitmap; import android.graphics.color; import android.graphics.drawable.bitmapdrawable; import android.net.uri; import android.os.asynctask; import android.os.build; import android.os.environment; import android.provider.mediastore; import android.provider.settings; import android.provider.syncstatecontract; import android.support.design.widget.coordinatorlayo...

Auto update of MySql row numbering -

i have made table in mysql column "id" auto_increment , primary_key. made 3 rows, namely 1,2,3. deleted no. 2 row numbering remains 1, 3. how change 1,2. mysql table the short answer is: you don't . changing multi step problem can error prone if don't right. frankly, (if ever) makes sense so. things involved in such task: delete row don't want (you've done that) subtract 1 id of every id that's >= row deleted. update auto increment counter @ 1 less current. do same thing tables in foreign key. if want delete multiple rows, logic gets more complicated quickly. either way, take considerable resources , wreak havoc foreign keys. such action goes against principles of how 1 use database. rdms not flat file excel spreadsheet. delete rows , let there gap in auto incremented id, doesn't make difference whatsoever application.

angular - Trouble implementing an Angular2 front-end service -

my goal display logged-in user’s name. i have back-end express service uses mongoose perform mongodb queries. i’m able see work postman. service queries “users” collection in database. takes userid , returns user’s firstname. i’m encountering problems implementing angular2 front-end service gets userid local storage, passes back-end, , retrieves user’s firstname . want use handlebars string interpolation insert username wherever want. loggedinuser() in code below i'm focusing. auth.service.ts import { injectable } '@angular/core'; import { http, headers, response } '@angular/http'; import 'rxjs/rx'; import { observable } 'rxjs'; import { user } './user.model'; import { errorservice } '../errors/error.service'; @injectable() export class authservice { constructor(private http: http, private errorservice: errorservice) {} loggedinuser() { const userid = localstorage.getitem('userid'); console...

user interface - Beginner Tkinter in Python: Functions with Inputs -

i have basic gui 2 text box inputs: 1 each of arguments in function, convert_databases, i'm not sure how pass arguments (i've seen examples using lambda, wasn't able implement them correctly). here attempt far, came tkinter's native tutorial: from tkinter import * tkinter import ttk def convert_databases(input_file, output_format): #function deleted simplicity root = tk() root.title("title") #formatting mainframe = ttk.frame(root, padding="3 3 12 12") mainframe.grid(column=0, row=0, sticky=(n, w, e, s)) mainframe.columnconfigure(0, weight=1) mainframe.rowconfigure(0, weight=1) #setting variables file = stringvar() conversion = stringvar() # places enter variables file_entry = ttk.entry(mainframe, width=50, textvariable=file) file_entry.grid(column=2, row=2, sticky=(w, e)) type_entry = ttk.entry(mainframe, width=50, textvariable=conversion) type_entry.grid(column=2,row=3, sticky=(w,e)) # convert button ttk.button(mainframe, text=...

javascript - Selenium Select .getOptions .selectBy.... not working -

like title says cant select functions work on page im working with. here dom ` <div id="ember3366" class="ember-view"> <div class="row m-b-1"> <!----> <div class="col-xs-12 col-md-6 col-lg-3 m-b-1"> <label>category</label> <select class="form-control"> <option value="all"> <option value="spirits">spirits</option> <option value="wine">wine</option> </select> </div> and here code have written public void selectcategory(string text) { webelement element = driver.findelement(category); select sel = new select(element); sel.selectbyvisibletext(text); } nothing gets selected.... when run console print out of .getoptions [[[[[chromedriver: chrome on xp (c33ce4eedeef26cc3921b3e439811cf5)] -> tag name: option], [[[[chromedriver: chrome on xp (c33ce4eedeef26cc3921b3e439811cf5) -> tag name: option], [[...

javascript - Jquery Multiple togglefade -

i'm using following code create pop boxes $(document).ready(function() { $('.item-link').click(function(e){ e.preventdefault(); var id = $(this).attr('id'); $('#pop-up-' + id).fadetoggle(); }); }); .pop-up{ display:none; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <a href="#" id="1" class="item-link"> link 1 </a> <a href="#" id="2" class="item-link"> link 2 </a> <a href="#" id="3" class="item-link"> link 3 </a> <a href="#" id="4" class="item-link"> link 4 </a> <div class="pop-up" id="pop-up-1"> content 1 </div> <div class="pop-up" id="pop-up-2"> content 2 </div> <div class="pop-up" id=...

unix - Does using different devices can be effective in IO reduction linux? -

i see have different devices on rhel box such sda, sda1 , sda2 , sdb etc. different directories lies on different file system or device/devices . e.g root directory on /dev/sda6 device . if create new directory on different device /dev/sda3 or /dev/sdb read , write head these devices same or different ? what trying find how many read , write heads system has , associated device in way ( each device has own read , write head , write on 2 different place 2 process reduce io ) . not looking suggestion if disk drive ssd or hdd , use faster 1 . more on devices , if can used reduce overall io when used wisely . also how found number of read/write heads on rhel box xyz@xyz-aspire-4736z:/$ df -h filesystem size used avail use% mounted on udev 1.5g 0 1.5g 0% /dev tmpfs 296m 5.3m 291m 2% /run /dev/sda6 110g 5.5g 99g 6% / i tried finding read capability of 2 different devices , results different them can seen below. can measure wr...

excel - Test or check if sheet exists -

dim wkbkdestination workbook dim destsheet worksheet each thisworksheet in wkbkorigin.worksheets 'this throws subscript out of range if there not sheet in destination 'workbook has same name current sheet in origin workbook. set destsheet = wkbkdestination.worksheets(thisworksheet.name) next basically loop through sheets in origin workbook set destsheet in destination workbook sheet same name iterated 1 in origin workbook. how can test if sheet exists? like: if wkbkdestination.worksheets(thisworksheet.name) some folk dislike approach because of "inappropriate" use of error handling, think it's considered acceptable in vba... alternative approach loop though sheets until find match. function sheetexists(shtname string, optional wb workbook) boolean dim sht worksheet if wb nothing set wb = thisworkbook on error resume next set sht = wb.sheets(shtname) on error goto 0 sheetexists = not sht nothing...