Posts

Showing posts from March, 2013

c++ - Problem with template specialization and template template parameters -

c++ - Problem with template specialization and template template parameters - i have class helper : template <typename t, template <typename> e> class helper { ... }; i have class template, exposure , inherit helper while passing template template parameter e . need specialize exposure . want write following: template <> class exposure<int> : public helper<int, exposure> { exposure() : helper<int, exposure>() { ... }; ... }; unfortunately won't compile. gcc complains: exposure.h:170: error: type/value mismatch @ argument 2 in template parameter list `‘template > class exposurehelper’ exposure.h:170: error: expected constant of type ‘’, got ‘exposure’ am doing wrong? there workaround i'm trying do? if want pass template rather class template <typename t, template<typename> class e> class helper { }; template <typename t> class exposure; template <...

c# - How do I set up a site in IIS7 on Windows 2008 Server Web SP2 via a console application? -

c# - How do I set up a site in IIS7 on Windows 2008 Server Web SP2 via a console application? - i have programme i've used on windows server 2003 sets site in iis6 i've used without problems in past. i'm trying same thing windows 2008 server web sp2 , i'm getting error. i'm guessing has user business relationship security. if correct, there way can around this? thanks. system.runtime.interopservices.comexception (0x80070005): access denied. @ system.directoryservices.directoryentry.bind(boolean throwiffail) edit: i've found microsoft provide assembly, microsoft.web.administration , create task easier iis7. i'm getting error when run application. error reported says: "the specified https binding invalid". i'm not specifying https binding though i'm not sure why i'm getting error message. here's code. using microsoft.web.administration; .... using (servermanager iismanager = new servermanager()) { ...

unmarshalling - java unmarshall different types -

unmarshalling - java unmarshall different types - i'm using unmarshall method in java, want utilize different types in method. how can prepare this. utilize url or local xml-file. file: public list<order> readorders() throws jaxbexception { jaxbcontext jc = jaxbcontext.newinstance(orderconfig.class); orderconfig orderconfig = (orderconfig) jc.createunmarshaller().unmarshal( orderconfigreader.class.getresource("//filename")); homecoming orderconfig.getitems(); } url: public list<order> readorders() throws jaxbexception { jaxbcontext jc = jaxbcontext.newinstance(orderconfig.class); orderconfig orderconfig = (orderconfig) jc.createunmarshaller().unmarshal( orderconfigreader.class.getresource(new url("http://link.here")); homecoming orderconfig.getitems(); } java unmarshalling

stdout - Python Fabric - How to create files and folders on remote hosts and direct output there -

stdout - Python Fabric - How to create files and folders on remote hosts and direct output there - i kind of asked question before ("direct output python fabric function file on remote host") 1 reply given didn't work. i'm trying utilize fabric script take various outputs before reboot, , compare them outputs of same commands, after reboot. want test differences between 2 files , print output of differences, if any. easy bash, boss making me utilize python fabric , i'm having much harder time. have far fabfile allows me connect various hosts , run commands date or uptime. fab file sits on 'jump' host used connect various other hosts. run fabfile jump host, connects other hosts, , output of commands runs displays on jumphost me see. what left forcefulness output of commands directed folder within specific directory on jump server. each command needs go own folder within directory (i'm going end them .pre , .post differentiate, uptime.pre , up...

c++ - Confusion regarding protected member functions and derived class access -

c++ - Confusion regarding protected member functions and derived class access - i having give-and-take coworker why next not compile in visual studio 2008: class base of operations { protected: virtual void f(){} }; class : public base of operations { public: void fa(base* pb) { pb->f(); // error c2248: 'base::f' : cannot access protected fellow member declared in class 'base' } }; he thinks reasonable think it's unusual restriction given, if wanted base , of derived classes closed system, still need create of base 's members public can talk each other through shared interface derived publicly. is there utilize case i'm not thinking of allowing access these protected members break nature of protected members? if compiler allows such thing, can break encapsulation. think this: base b; foo; foo.fa(b); // can access/modify protected elements of `b` in case, there no relation between derived object f...

c++ - Save/Persist FIX::SessionSettings to file -

c++ - Save/Persist FIX::SessionSettings to file - in quickfix/j possible save (an updated) sessionsettings file using tostream: public static void writesettings(sessionsettings settings, file settingsfile) throws ioexception { fileoutputstream settingsout = new fileoutputstream(settingsfile); seek { settings.tostream(settingsout); } { settingsout.close(); } } however fix::sessionsettings (c++) not have function defined in class reference. is there easy way accomplish using c++ library, or should port method myself? c++ c++11 quickfix

How can I define the LAMBDA function in LISP? -

How can I define the LAMBDA function in LISP? - i can't utilize @ lambda function, because error: argument apply/funcall not function: (lambda (e) (count_atoms m e)). and code is: > (defun count_atoms (m l) > (cond ((atom l) (cond ((equal m l) 1) > (t 0))) > (t (apply '+ > (mapcar '(lambda (e) (count_atoms m e)) > l))))) for (count_atoms 3 '( (3 3) 3 (4 4) 5)) it should print 3. what wrong here? use (mapcar #'(lambda (e) (count_atoms m e)) ... , "sharp" sign. same apply , utilize #'+ . writing #'(lambda .... ) same writing (function (lambda .... )) . there's macro lambda lets away writing (lambda ... ) there. see also: clhs: apply clhs: function designator lambda lisp common-lisp

php - Loop the index plug-in jeckpack post view -

php - Loop the index plug-in jeckpack post view - i'm trying index of loop in order list viewing. i'm using jetpack post views this ex: viewed post first , on. i utilize custom post namo movies , queensize loop not bringing custom post. could help me ? <div id="content"> <?php if( function_exists( 'stats_get_csv' ) ) : $top_posts = stats_get_csv( 'postviews', array( 'days' => 21, 'limit' => -1 ) ); $top_ids = array(); foreach ( $top_posts $top_post ) { $top_ids[] = $top_post['post_id']; } // check transient, hat tip greg rickaby if ( false === ( $tops = get_transient( 'popular_posts' ) ) ) : $top_args = new wp_query( array( 'posts_per_page' => '5', 'post__in' => $top_ids, 'posts_per_page' => 14, 'post_type' => array('movies') ) ); $tops = new ...

sql - Syntax error at FOR LOOP -

sql - Syntax error at FOR LOOP - i have function. it's not finish , doesn't meaningful yet, in process of writing i've been getting error: error: syntax error @ or near "loop" line 26: end loop; could @ code , see why?? loop syntax looks fine me. create function assigngrades(prob numeric[], school_name text, school_id bigint) returns void $$ declare num_grades integer array[6]; found_school school_probs%rowtype; num_students simulated_records%rowtype; num_students_int bigint; random_record simulated_records%rowtype; begin select found_school * school_probs school_code = school_id;--select prob dist select num_students * simulated_records school = school_name; select count(*) num_students_int simulated_records school = school_name; num_grades[1] = num_students_int*found_school.probs[1]; num_grades[2] = num_students_int*found_school.probs[1]; num_grades[3] = num_students_int*found_school.probs[1]; nu...

sql server - Replacing max(columnname) with a different query -

sql server - Replacing max(columnname) with a different query - i working number of tables, developer used 'max(columnname)' on own recent entry in column. can cause performance bottlenecks i'm trying replace max(columnname) alternative queries. i thought of: select [column name], max(1) [table] order [column name] and select top 1 [column name] [table] order [column name] desc do think 1 of above work well? if not, have suggestions how build improve query? sql-server max

adding an integer to a char array in c -

adding an integer to a char array in c - it may silly question still not getting it. have char array char arr[100] having data char arry[100] ---- data; int test; memcpy(&test,array+4,sizeof(int)) what memcpy skp it re-create element array[4] variable test . on 32-bit machine sizeof(int) = 4 . memcpy re-create 4 bytes address &test can hold 4 bytes. c

ios - Why passing data between View Controllers works with segue -

ios - Why passing data between View Controllers works with segue - why next code passing info between view controllers work ? : -(void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender{ if([segue.identifier isequaltostring:@"showdetailsegue"]) { viewcontrollerb *controller = (viewcontrollerb *)segue.destinationviewcontroller; controller.issomethingenabled = yes; } } everything see creates instance of viewcontrollerb class . don't understand how instance (controller) can actual viewcontroller passing data? concept missing? the code posted not instantiating new viewcontrollerb instance. time prepareforsegue:sender: called, view controller has been instantiated storyboard , assigned passed-in segue's destinationviewcontroller property. code is, in fact, getting reference view controller has been created , used in segue. see section segues automatically instantiate destination view controller in view ...

ios - Objective-C calling upon a IBAction without having to change the sender to nil -

ios - Objective-C calling upon a IBAction without having to change the sender to nil - i have programme phone call upon ibaction in ibaction. however, way got work used [self buttonpress:nil]; called upon ibaction button though function problem ibaction called upon sender's instance turned nil if in ibaction called upon used sender wouldn't anything. there way phone call ibaction without changing instance of sender? a potential workaround "could" have @ibaction methods serve wrapper around different methods. way when want phone call @ibaction calling method wraps. @ibaction function1 { // calls method: submethod1() } @ibaction function2 { // calls method: submethod2() } @ibaction function3 { // calls method: submethod1() submethod2() } ios objective-c ibaction

version control - Recommended way to organize JSF big application on daily builds -

version control - Recommended way to organize JSF big application on daily builds - we working in big team, building web application in jsf, each developer develops new task. example: user management, security, scheme parameters etc. we need create daily task build war svn. we know how utilize daily builder, svn etc. our question how save per module? recommended way build packages web application jsf it's build on mvc module , pages part of bean? should utilize many wars/packages? i need save per module, since days there errors in 1 module shouldn't uploaded rest of modules. (i know how compile , find decide if upload or not). you utilize "work branch(es)" (or "module branches") in development of module occur. trunk contain everything, developers working on given "module branch" merge trunk work every day publish trunk 1 time work done (done includes tests passing). like (picture version command multiple agile teams): ...

Does git send entire lines in commits? -

Does git send entire lines in commits? - i have binary file i'm forcing git view text file. when create change, entire line shown in diff. if have line 100mb, , alter 1 byte, git smart plenty send 1 byte difference? or send entire 100mb line? merges , diff of binary files pain git. suggest using binary-to-text-encoding scheme. if have time spare worth looking into. git

android - Running simultaneous animations on LinearLayout weight with ValueAnimator -

android - Running simultaneous animations on LinearLayout weight with ValueAnimator - i've tried many different approaches , none of them have worked. i'm open suggestion. i making custom "button". it's not of type button behave multi-state button. each button has 3 differently colored glyphs represent different states (blue, white, , orange). whichever glyph in primary state much larger others, so: at moment, each "button" linearlayout 3 imageviews , each imageview populated pathshape drawable weights 0.2 + 0.6 + 0.2 = 1.0. part works fine. 0.6 primary state weight. i have simple button on screen trigger animation. animation cut down current primary 0.6 weight 0.2 weight, , new primary 0.2 0.6. 1 shrinks, other grows. problem: animations not run simultaneously, though i've explicitly told them run simultaneously. first 1 shrinks 0.6 0.2, there slight pause, , sec 1 grows 0.2 0.6. button button = (button)this.findviewbyid(r.id....

CSS: Scrolling Background -

CSS: Scrolling Background - i have been using this site template page having difficulty changing background image. have recreated background on jsfiddle. current background works because top has single color , sides create image continuous. here relevant css code: 0% { -moz-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0); -o-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } 100% { -moz-transform: translate3d(-2250px, 0, 0); -webkit-transform: translate3d(-2250px, 0, 0); -o-transform: translate3d(-2250px, 0, 0); -ms-transform: translate3d(-2250px, 0, 0); transform: translate3d(-2250px, 0, 0); } is there way create background scrolls right , 1 time reaches end, scrolls left? hard create image "continuous" when scrolls. this same functionality 1 of first scripts ever, leveraging right css property. class="snippet-code-css ...

multithreading - Will mulit-threading automatically fill in the time gap while waiting for some internet content to arrive? -

multithreading - Will mulit-threading automatically fill in the time gap while waiting for some internet content to arrive? - i using curl or socket in php write net bot. noticed when request sent, websites have noticeable delay time. if utilize multithreading issue requests different urls @ "same time", 1 thread fill in gap of time , resources when thread waiting content server arrive? multithreading bots

Compiling C99 in cl compiler -

Compiling C99 in cl compiler - i using microsoft cl compiler (the 1 comes visual studio 2013) , looking command utilize when compiling tell compiler back upwards c99.. can help me this? no, there no switch in same mode. visual studio 2013 not back upwards c99. situation become improve in vs 2015 because features needed c++11 compatibility. there no official c99 support. there list of supported c99 library features in vs 2013: http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx c99 cl

devise - SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol error in rails 4 -

devise - SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol error in rails 4 - i implementing devise mailers application have done next steps: in model: class user < activerecord::base # include default devise modules. others available are: # :lockable, :timeoutable , :omniauthable devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable, :trackable, :validatable end and added migrations of confirmation_token, confirmed_at, confirmation_sent_at in devise.rb, added: config.mailer_sender = 'example@gmail.com' in development.rb: config.assets.raise_runtime_errors = true config.action_mailer.default_url_options = { :host => 'localhost:3000' } config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :enable_starttls_auto => true, :address => 'smtp.gmail.com', :port => 587, :tls => ...

Python subprocess is running a different version of Python -

Python subprocess is running a different version of Python - i'm trying create python script execute other python scripts, , works on scripts, fail when encounters print('anything', end='') . because subprocess running 2.7, rather 3.4. cannot life of me figure out how have subprocess run 3.4. python 3.4.3 (v3.4.3:9b73f1c3e601, feb 24 2015, 22:43:06) [msc v.1600 32 bit (in tel)] on win32 type "help", "copyright", "credits" or "license" more information. >>> import sys >>> import subprocess >>> sys.version '3.4.3 (v3.4.3:9b73f1c3e601, feb 24 2015, 22:43:06) [msc v.1600 32 bit (intel)]' >>> results = subprocess.check_output('testprint.py', shell=true) >>> results b'2.7 (r27:82525, jul 4 2010, 07:43:08) [msc v.1500 64 bit (amd64)]\r\n' testprint.py this: import sys print(sys.version) edit: , of course of study realize solution after posting q...

chunking - How chunk file upload works -

chunking - How chunk file upload works - i working on file upload , wandering how chunk file upload works. while understand client sends info in little chunks server instead of finish file @ once. have few questions on this:- for browser split , send whole file chunks, read finish file memory? if yes, 1 time again there me chances of memory leak , browser crash big files(say > 10gb) how cloud application google drive droopbox handles such big files upload? if multiple files selected upload , have size grater 5-10 gb, browser maintain files memory send chunk chunk? file-upload chunking

Issue regarding building an image Carousel with jQuery -

Issue regarding building an image Carousel with jQuery - i have developed carousel jquery 1 images showing 1 after 1 made error in html flashing when line execute. $('.headercarouselwrapper :first-child').fadeout().next('img').fadein() here total jquery , html code. please see , guide me how create smooth transition. <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script type="text/javascript"> var bba = { init: function () { this.slideshow(); homecoming this; }, slideshow: function () { $('.headercarouselwrapper img:gt(0)').hide(); setinterval(function () { $('.headercarouselwrapper :first-child').fa...

apache - Making RewriteRule portable/relative to the directory of the .htaccess file -

apache - Making RewriteRule portable/relative to the directory of the .htaccess file - i have next rewriterule makes going domain.com/somepage/?page=3 301 redirected domain.com/somepage/3/ : rewritecond %{the_request} \?page=([0-9]+) [nc] rewriterule ^ /somepage/%1/? [r=301,l] this in .htaccess file in somepage directory. now, works fine... it's bit of hassle. have dozen pages paginated, in own directory. able re-create .htaccess file each directory , not have worry editing each one. example, want domain.com/someotherpage/?page=3 redirect domain.com/someotherpage/3/ , i'd have edit respective .htaccess file , alter somepage part someotherpage . it causes problems when re-create entire site different server. normally, site placed in root directory. however, when i'm running locally, place entire site in folder called dev . have go through of rewriterules , alter /somepage/%1/ /dev/somepage/%1 . this, can imagine, incredibly tedious. so, there wa...

K2: How may I open a file in a new window unless I already have such a window open? -

K2: How may I open a file in a new window unless I already have such a window open? - i have k2 smartform displays list of file names. when user clicks file name, programme opens file (all of them pdfs) in new tab in browser (ie). far. if click on sec file list, opens in 3rd tab. not user wants. they want sec file selection open in same window first file. this process can see: click on file in list. open in tab. click on sec file in list. if there tab open file list, open file there. otherwise, open new tab file. i suppose automatically closing first tab when click on sec file accomplish same thing. how can done? when deal opening links, first of all, can limited. indeed, browsers (ie, chrome, etc...) can configured users open links in new tabs, windows, etc... , form developer cannot alter that. i have made jsfiddle reproduce situation , propose solution can test. don´t guaranty work utilize mac describe improve solution below. you can find here: ht...

c++ - How flush property works in SimpleFileChannel -

c++ - How flush property works in SimpleFileChannel - as per documentation: the flush property specifies whether each log message flushed log file (which may wound application performance, ensures in log in case of scheme crash), valid values are: true: every essages flushed log file (default). false: messages not flushed log file. i confused false value not immediately confusing, because not immediately mean never sometime. can please confirm if meant never or sometime (if latter, can please clarify when?) when flush property false, flushing left default underlying platform behavior. for details on exact behavior os when flush false, refer documentation createfile , flushfilebuffers (never called explicitly poco when flush property false) on windows , std::ostream (never flushed explicitly poco when flush property false) on other operating systems. c++ poco poco-libraries

charts - Gnuplot does not plot negative values -

charts - Gnuplot does not plot negative values - data file bipdeutschland.csv: 1991 79.09 0 1992 80.61 1.9 1993 79.84 –1.0 1994 81.8 2.5 1995 83.19 1.7 1996 83.84 0.8 1997 85.37 1.8 1998 87.05 2 1999 88.78 2 2000 91.43 3 2001 92.98 1.7 2002 92.99 0 2003 92.32 –0.7 2004 93.41 1.2 2005 94.07 0.7 2006 97.56 3.7 2007 100.75 3.3 2008 101.81 1.1 2009 96.07 –5.6 2010 100.00 4.1 2011 103.59 3.6 2012 103.98 0.4 2013 104.09 0.1 2014 105.76 1.6 plt file: set xdata time set timefmt "%y" set format x "%y" set format y "%6.0f" set xrange ["1990":"2015"] set yrange [0:120] set style fill solid 1.0 set boxwidth 0.85 relative set xlabel "jahr" set ylabel "reales bruttoinlandsprodukt (2010=100%)" set y2range [-5:5] set y2label "veränderung des bruttoinlandsprodukts zum vorjahr (in %)" set y2tics 2...

javascript - Ability to abort asynchronous call -

javascript - Ability to abort asynchronous call - i'm using babeljs es7 style async/await methods. have main script phone call async method on array of objects homecoming promises. utilize promise.all() wait of return, however, these tasks take long time , if exceed threshold abort of them, , task handle in appropriate way. is there anyway accomplish such thing? way can think of spawning process work of calling these methods , waiting them resolve, , if time limit reach, can kill process , whatever handling needs. update: clarification these methods main script waiting on... might doing long series of operations (calling external systems, streaming files somewhere, etc) , not performing 1 single action canceled independently. update #2: untested semi-psuedo code class foo1 { async dosomething() { // phone call external scheme // re-create files // set files somewhere else (s3) } } class foo2 { async dosomething() { ...

php - Find out which months have data logged in MYSQL database? -

php - Find out which months have data logged in MYSQL database? - in database have date of each client order stored in format 02 mar 2015 i have info march , apr , want query homecoming 2 months. 1 time have info may homecoming 3 months etc. the sql syntax trying utilize is: select distinct month(date_format(date,'%d %b %y')) orders however returns 0 rows. presume issue date format. edit: sample info table: id | date | time | order_id | item | quantity 1 | 02 mar 2015 | 14:22 | 1029 | clasico | 9 1 | 05 apr 2015 | 13:58 | 1029 | hindu | 10 try select distinct month(`order_date`) `orders` where order_date date field in orders php mysql

How to implement a debouncing function in vbscript -

How to implement a debouncing function in vbscript - i trying effort create sms script water municipality. want informed when water reservoir hints below 20%, must send sms , when it's above 20% sends sms confirm low alarm cleared. doing easy task, there needs debouncing period, illustration if value changes must wait 10 seconds, after 10 seconds sends sms. same goes when value changes , during 10 sec waiting period changes 1 time again needs reset timer , start counting 10 again. the next code shows continuous "do loop", since want code run forever. the problem is, when value changes not wait 10 seconds , sends sms. if has knowledge create debouncing function, please help appreciated. please note: 3rd party application called adroid (not confused android ;) ). scada software monitor , command water schemes. happens has vbscript text editor in it. sub main() dim output_1 dim output_2 dim commsstatus dim var_1 dim var_2 dim x dim status dim ...

oracle - ODP.NET 11.2.04 and 12.1.0.2 Side by side -

oracle - ODP.NET 11.2.04 and 12.1.0.2 Side by side - our product uses odp.net 11g(11.2.0.4 specific). want upgrade oracle 12c still want back upwards previous version also(version odp.net 11g). have couple of assemblies uses oracle.dataaccess.dll. while referencing these projects in visual studio, setting "specific version" set false. on developer machine, when oracle client 12c installed, latest oracle.dataaccess.dll files picked up. because of publisher policy gets installed oracle 12c client. verified path of oracle.dataaccess,dll in visual studio respective projects , shows path of odp.net 12c client. works seamlessly without changes code. now have problem getting work on our build machine. build machine has build 11g version , 12c versions of our product simultaneously. we have oracle client 11.2.0.4 installed on build machine. had installed oracle client 12c on build machine. when checked references in visual studio, oracle.dataaccess.dll path updated p...

android - eclipse (windows) cannot recognize HTC Evo -

android - eclipse (windows) cannot recognize HTC Evo - i have been developing on htc hero while now, , got testing phone: evo. however, when plug in, nil can scheme recognize evo worthy of testing on. i got usb drivers. went device manager tell scheme drivers are, , associate them evo. though give exact folder, windows keeps telling me no compatible drivers found. hero works fine these drivers, , there not updates available them. able access sd card when set phone in right mode. debugging mode turned on. halp? http://chris.losari.org/2010/05/adb-driver-for-htc-evo-4g.html found after refining search terms based off of chris stratton's comments android htc

regex - Replicating Codeigniter's humanize() and underscore() function in Javascript -

regex - Replicating Codeigniter's humanize() and underscore() function in Javascript - i'm trying replicate ci's humanize() , underscore() function in javascript. from ci documentation, underscore() takes multiple words separated spaces , underscores them while humanize() takes multiple words separated underscores , adds spaces between them. ci implementation looks like: function underscore($str) { homecoming preg_replace('/[\s]+/', '_', strtolower(trim($str))); } function humanize($str) { homecoming ucwords(preg_replace('/[_]+/', ' ', strtolower(trim($str)))); } my code doesn't have replicate behavior exactly, underscore() function i'd able deal multiple whitespace characters, while humanize() function can bit looser , assume 1 underscore there separate each word. so far have is: function underscore(string) { string = $.trim(string).tolowercase(); var oldstring; while(oldstring !== stri...

java - Stop music after resume using FLAG_ACTIVITY_NEW_TASK -

java - Stop music after resume using FLAG_ACTIVITY_NEW_TASK - i'm working in app android. i'm streamming online radios. i'm facing issue related app. displayed notification message, when user click on it, should reopen lastly activity. bring in front end lastly activity set flag_activity_new_task option. works ok. problem music, because when activity brought front end stopped. i've set setretaininstance(true) in oncreate method. i tried not using flag , works good, i'm creating many activities in process: 1 per each time notification clicked. i checked i'm not setting pause/stop of mediaplayer. edit this solved. see answer. i removed flag in notification intent, result in undesirable behavior when nail button. so, need override onbackpressed , calling myself activity. java android

Can't install networkx for python 3.4 -

Can't install networkx for python 3.4 - after 3 days of trying install networkx python 3.4, on verge of giving , i've decided seek help of people had experience perhaps. i managed install networkx easy_install or pip_install (i don't remember anymore of how many times i've tried install all), when seek compile first, basic piece of code (found in tutorial): import networkx nx; test = nx.graph(); test.add_node("test"); nx.draw(test, node_size=900, node_color="blue"); i error: importerror: no module named 'numpy' when seek install numpy easy_install numpy starts download , installation process shows error: microsoft visual c++ 10 required is referred mv c++ 1- redistributable? i've downloaded , tried install shouts out error have newer version of don't need it... so questions be: 1.can networkx module installed python 3.4 @ all? 2.if so, need else besides networkx zip/installer , python 3.4 work? (i've literally ...

jquery - Finish CSS Animation After Leaving Hover -

jquery - Finish CSS Animation After Leaving Hover - i have bar flips vertically bluish grayness when hovered. when leaving hover, goes blue. great. problem animation long on hover state. not finish animation if hover , "unhover" quick. goal want flip bluish grayness , bluish if hovered split second. don't want animation stop when unhover. attempts i've read can't done pure css. i've tried adding next jquery code adds , removes animation class question: css3 animation on :hover; forcefulness entire animation: $(".bar").bind("transitionend webkittransitionend otransitionend", function(){ $(this).removeclass("vflipper") }) $(".bar").hover(function(){ $(this).addclass("vflipper"); }) and changing css .vflipper .bar.vflipper , can't seem working code. ul , li's seem cause me issues. understand how works divs, not lists. fiddle http://jsfiddle.net/zuhloobie/t9x723tq/1/ any help...

c# - Calling custom methods in API controller -

c# - Calling custom methods in API controller - i added method in web api controller: public string getpeopleinfamily(string familyid) i followed examples question: custom method names in asp.net web api i updated routeconfig.cs file based off of read above: public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.maproute( name: "default", url: "{controller}/{action}/{id}", defaults: new { id = urlparameter.optional } ); routes.maphttproute("defaultapiwithid", "api/{controller}/{id}", new { id = routeparameter.optional }, new { id = @"\d+" }); routes.maphttproute("defaultapiwithaction", "api/{controller}/{action}"); routes.maphttproute("defaultapiwithactionandid", "api/{controller}/{action}/{id}", new { id ...

visual studio - Add QuickInfo to custom objects in VS2013 -

visual studio - Add QuickInfo to custom objects in VS2013 - i have been working in visual studio while , have come love intellisense. 1 thing has come mind every , 1 time again if possible add together in comments properties of custom objects can subs & functions. for illustration object defined in application i'm working on: <serializable> <xml.serialization.xmlroot("relobj")> public class relobj <xml.serialization.xmlelement> public property tablea string = "" <xml.serialization.xmlelement> public property tableb string = "" <xml.serialization.xmlelement> public property key1 string = "" <xml.serialization.xmlelement> public property key2 string = "" <xml.serialization.xmlelement> public property key3 string = "" end class so i'm currious if there's way equivalent of typing ''' before sub/function , able define text appear in intellisen...

ireport - How can I know What Error is happening to my jasper report -

ireport - How can I know What Error is happening to my jasper report - i've been using jaspersoft ireport generating reports java program. noticed when create study using ireport, , error happens, there no clue, can find out going on ? there window study problem window, window blank. cannot find out error , study not compiling. jasper-reports ireport

ArrayList in methods -

ArrayList in methods - there 2 classes involved, 1 called courseoffering(co), traininginstitution(ti). ti has main method , menu, while co contains of methods. one of method in ti enrol invoke enrol method in co class, taking in 2 arraylist. public static void enrol(arraylist <courseoffering> offerings, arraylist <student> students) { system.out.println(courseoffering.enrol(offerings,students)); } in co class, public static string enrol(arraylist <courseoffering> offerings, arraylist <student> students) { scanner kb = new scanner(system.in); system.out.println("enter pupil number: "); int input = kb.nextint(); (student s : students){ system.out.println(s); //checking arraylist values if(s.getstudentnumber() == input){ ... ... ... codes goes on. for there 5 students id increment of 1, starting 1. did println in loop of pupil array list , pupil of id 1 returned. wron...

Plot or Display chart selectively using data from the column(s) selected using ComboBox in Excel with VBA -

Plot or Display chart selectively using data from the column(s) selected using ComboBox in Excel with VBA - how create combobox list column headers take , utilize selectively plot info 1 many selected column(s) scatter plot chart overlays? i have written couple tutorials on topic: simple interactive charts in excel , interactive charts checkboxes , formulas. excel vba excel-vba combobox

java - Exclude a portion of a string with regex -

java - Exclude a portion of a string with regex - i have string below: identification of product - azec how can create regex exclude identification of product - , homecoming string comes next, in case, azec string str = "identification of product - azec"; system.out.println(str.split(" - ")[1]); // azec java regex

ios - Application Loader not load Build -

ios - Application Loader not load Build - to more precise. load build not showed in itunes connect, behavior see after lastly update xcode 6.3. ci step pass (upload build) successfully. now resolve trouble. upload build manually xcode archiver. ios xcode continuous-integration application-loader

jquery - How to create a custom remove row button in jqGrid? -

jquery - How to create a custom remove row button in jqGrid? - i have button says remove selected button. on selecting particular row or multiple rows want delete jqgrid. how can accomplish this? can utilize delgridrow method? any help appreciated. you can utilize delrowdata method remove info grid, although need send request server if want delete info back-end. jquery jqgrid row

PHP reading a page on my site -

PHP reading a page on my site - i'm trying open read page on own website search engine i'm trying working. i've tried several ways of doing it: file_get_contents $temp = file_get_contents("http://www.mysite.com/example01/"); echo $temp; returns: warning: file_get_contents(http://www.mysite.com/example01/) [function.file-get-contents]: failed open stream: connection effort failed because connected party did not respond after period of time, or established connection failed because connected host has failed respond. in c:\inetpub\wwwroot\mysite\example01\temp.php on line 66 curl function curl($url){ $ch = curl_init($url); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_header, true); // display headers curl_setopt($ch, curlopt_verbose, true); // display communication server curl_setopt($ch, curlopt_returntransfer, true); print "<pre>\n"; print_r(curl_getinfo...

flex - Is there a way to populate the Tree component with the display list -

flex - Is there a way to populate the Tree component with the display list - is there way display display list in tree component. parse display list xml not able create reference display object. you can utilize list fill tree if objects in list have parent property, specify object parent. otherwise can't know how position them in tree. flex actionscript-3 flex4

c++ - char pointer to string, then into array of strings. *** Error in `./a.out': malloc(): memory corruption: 0x0900c3b0 *** -

c++ - char pointer to string, then into array of strings. *** Error in `./a.out': malloc(): memory corruption: 0x0900c3b0 *** - i error: * error in `./a.out': malloc(): memory corruption: 0x0900c3b0 * i trying convert char pointer string, , set string array of strings later use. don't understand why not working. assuming string set array gets deleted, , might reason. error happens when new string(firstbyte) here code: char *entries[16] = {nullptr}; string *strentries[16] = {nullptr}; char * firstbyte = 0; stringstream s; size_t len; string sfb; firstbyte = new char[sizeof(char)]; count = (firstrootdirsec*512) + 32; lseek(fd, count, seek_set); //takes 32 bytes after root directory, or first entry //so either find way read in 1 byte @ time, or //take first character of firstbyte. firstbyte[0]. that's good. for(int = 0; i<16; i++){ //check first byte //if first byte 41 or 40, long directory, , can jump ahead 32 bytes,...

objective c - Drop a pin to location on the line between 2 points in MapView iOS -

objective c - Drop a pin to location on the line between 2 points in MapView iOS - i have problem: have a store location , 1 pin annotation radius = 2km. when user move pin annotation exceed radius 2km store location. want jump pin on line store location , old pin annotation in order circle radius cover store location. how can that? please give me advice. much. keeping store location covered means constraining pin within 2km circle around around store. if store @ (0,0) , point @ (dx,dy), find distance: r=sqrt(dx * dx + dy * dy). now if r>2km, find factor scale distance by: s = 2km/r. now move point (s * dx, s * dy), on 2km circle around store, store on 2km circle around pin. ios objective-c annotations location mapkit

bluetooth - How to check if there is a connection to a android wear from an app? Android -

bluetooth - How to check if there is a connection to a android wear from an app? Android - in application want display message user if user connected smartwatch or not. trying check if there connection device smartwatch, , coudn't find reply in internet. how can check it? easiest way send message , check answer? in advance nodeapi.getconnectednodes() provides list of connected android wear nodes if list empty (or while connecting required googleapiclient wearable.api returns api_unavailable (such in cases android wear app not installed or api level not back upwards android wear per this blog post) no wear device attached. android bluetooth sony-smartwatch

python - how to convert pandas data frame into numpy data frame -

python - how to convert pandas data frame into numpy data frame - i have 1 simple info set class label , stored "mydata.csv", ga_id pn_id pc_id mbp_id gr_id ap_id class 0.033 6.652 6.681 0.194 0.874 3.177 0 0.034 9.039 6.224 0.194 1.137 3.177 0 0.035 10.936 10.304 1.015 0.911 4.9 1 0.022 10.11 9.603 1.374 0.848 4.566 1 i utilize given code convert info numpy array can utilize info set predictions , machine learning modeling due header error has been raised "valueerror: not convert string float: " when removed header file method work me : import numpy np #from sklearn import metrics #from sklearn.linear_model import logisticregression sklearn.svm import svc raw_data = open("/home/me/desktop/scklearn/data.csv") dataset = np.loadtxt(raw_data, delimiter=",") x = dataset[:,0:5] y = dataset[:,6] i tried skip header error occurs: dataset = np.loadtxt(raw_data...

java - Apache Camel - Execute a task immediately before polling consumer -

java - Apache Camel - Execute a task immediately before polling consumer - i'm trying create route polls folder files match given regex. route intended batch pickup files folder. since, move of files folder isn't atomic need phone call db sproc before route polls command flow reasons. in jdsl route builder, instead of this: configure(){ from("fileuri").processor(_dbupdater).to(endpoint); } i need this: configure(){ processor(_dbupdater).from("fileuri").to(endpoint) } i know doesn't work i'm trying possible? can execute task before polling consumer? yes can adding direct endpoint from endpoint @ start of flow. route :- from("direct:a").processor(_dbupdater).to("fileuri").to(endpoint) you can read more camel direct endpoint @ http://camel.apache.org/direct.html official camel site. java apache-camel

Maven not using local repository for install-file command -

Maven not using local repository for install-file command - i new maven, have weird problem maven installs jar file in directory run mvn install:install-file command, instead of installing in local repository. what reason unusual behavior, please help! maven

Chain of Responsibility with multithreading and exception handling in java -

Chain of Responsibility with multithreading and exception handling in java - i have rest service phone call chain of responsibility, improve performance have added multi threading unable handle exception please find code sample: starting rest service method @post @path("/dispatch") public response dispatchevent(){ thread steps = new thread(new handlerexecutor()); steps.start(); } handlerexecutor.java: public class handlerexecutor implements runnable { @override public void run() { handler first = handlerlocator.gethandler(); if (first != null) { first.process(); } } } handlerlocator.java: public class handlerlocator { public static map<string, list<handler>> allhandlers = null; public static handler gethandler() { handler first = null; list<handler>> h = new hashmap<string, list<handler>>(); ...

html - RegEx match open tags except XHTML self-contained tags -

html - RegEx match open tags except XHTML self-contained tags - i need match of these opening tags: <p> <a href="foo"> but not these: <br /> <hr class="foo" /> i came , wanted create sure i've got right. capturing a-z . <([a-z]+) *[^/]*?> i believe says: find less-than, then find (and capture) a-z 1 or more times, then find 0 or more spaces, then find character 0 or more times, greedy, except / , then find greater-than do have right? , more importantly, think? you can't parse [x]html regex. because html can't parsed regex. regex not tool can used correctly parse html. have answered in html-and-regex questions here many times before, utilize of regex not allow consume html. regular expressions tool insufficiently sophisticated understand constructs employed html. html not regular language , hence cannot parsed regular expressions. regex queries not equipped break downwards html meaningful...

PHP: "Notice: Undefined variable" and "Notice: Undefined index" -

PHP: "Notice: Undefined variable" and "Notice: Undefined index" - i running php script, , maintain getting errors like: undefined variable: user_location in c:\wamp\www\mypath\index.php on line 12 line 12 looks this: $greeting = "hello, ".$user_name." ".$user_location; what these errors mean? why appear of sudden? used utilize script years , i've never had problem. what need prepare them? is there quick fix? this general reference question people link duplicate, instead of having explain issue on , on again. sense necessary because real-world answers on issue specific. related meta discussion: what can done repetitive questions? do “reference questions” create sense? from vast wisdom of php manual: relying on default value of uninitialized variable problematic in case of including 1 file uses same variable name. major security risk register_globals turned on. e_no...

python - Call sed via subprocess -

python - Call sed via subprocess - i need phone call sed via python. tried reply of this question, doesn't work. my code (yes file doesn't have extension, works when using putty): filename = '/home/user1/file' subprocess.call(["sed","-i",r"$'s/[][]//g;s/,/\\\n/g'",filename]) can see going wrong? script executes, skips subprocess call. ok tried using python re module code: filename = '/home/user/file' filenametemp = '/home/user/temp' file = open(filename, "r") temp = open(filenametemp,"w+") text = file.read() text = re.sub(r'\[|\]',r'',text) text = re.sub(r',',r'\n', text) print text temp.write(text) header_row=['h1','h2','h3'] info = pd.read_csv(filenametemp, sep= ';',skipinitialspace=1, names=header_row) the file "temp" in right layout, pandas creates empty dataframe when opening file. if com...

python - How to use connection pooling with psycopg2 (postgresql) with Flask -

python - How to use connection pooling with psycopg2 (postgresql) with Flask - how should utilize psycopg2 flask? suspect wouldn't open new connection every request how can open 1 , create globally available application? from flask import flask app = flask(__name__) app.config.from_object('config') # can access configuration variables via app.config["var_name"]. import psycopg2 import myapp.views python flask psycopg2

Android Studio - Sliding Tabs appear below action bar instead of on action bar -

Android Studio - Sliding Tabs appear below action bar instead of on action bar - i've created set of sliding tabs view pager set activity_main.xml. in project tabs show below action bar if divided. i'd have them part of action bar. what should edit in code accomplish this? project screenshot mainactivity.java package com.davidreadiii.android.slidingtabexample; import android.os.bundle; import android.support.v4.view.viewpager; import android.support.v7.app.actionbaractivity; import android.view.menu; import android.view.menuitem; import com.davidreadiii.android.slidingtabexample.tabs.mfragmentpageradapter; import com.davidreadiii.android.slidingtabexample.tabs.slidingtablayout; public class mainactivity extends actionbaractivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // viewpager , set it's pageradapter can display items viewpager view...