Posts

Showing posts from February, 2011

pandas - exporting a list of lists to csv in python -

i want export list of lists csv file. however, csv file not showing of data. initially have 30 rows of 'i' data , 1 row of 'r' data. i run algorithm obtain peak areas when r plotted against i{i}. gives me 30 sets of data each 3 columns follows: > 0 1 2 > 0 3053.6 105000.0 -5217775.735 > 1 3015.9 81892.0 -4013311.400 > 2 2962.8 98694.0 -2050799.050 > 3 2936.2 67884.0 -1140645.600 > 4 2906.3 2530000.0 -22099575.600 > 5 2871.5 102000.0 -653778.650 > 6 2777.9 8482.4 -68580.440 > 7 2719.3 11768.0 -91285.610 > 8 2625.0 5902.5 -40623.500 > 9 2599.3 5304.7 -69163.680 > 10 2573.5 18009.0 -170745.690 > 11 1538.0 12694.0 -965128.025 > 12 1467.7 9279.2 -144139.995 > 13 1451.4 21626.0 -280386.495 > 14 1329.8 7739.9 -63603.430 > 15 1173

msmq - Set up NServiceBus queues in EndpointConfig.cs -

similar different nservicebus not creating queues automatically (msmq) when running in debug mode in visual studio get: >...nservicebus.transports.msmq.msmqqueuecreator not create queue error@ i'm using nservicebus 5.2.7 , host 6.0.0 and wanted know how configure in endpointconfig.cs because not able find .configure.with()... (its using... helper issue) meanwhile got answer tech guys... here comes own answer. visual studio if run administrator (with windows administrator rights) automatically. for real installation in case you'll using installer. http://docs.particular.net/nservicebus/hosting/nservicebus-host/#installation

angularjs - Using React's Material-UI Library with Angular 2.0 -

i interested begin learning angular 2.0 , typescript. came across beautiful material design library material-ui , noticed has typescript definition @ definitelytyped (a definition repo). how 1 use library , definition file alongside angular 2.0's syntax? cannot seem find guide or blog post these 2 anywhere. thanks! how 1 use library , definition file alongside angular 2.0's syntax? cannot seem find guide or blog post these 2 anywhere. angular 2.0 isn't ready yet. if want use angular 1.0 can use library : https://github.com/davidchang/ngreact wrap react components , consume them angular . check usage : https://github.com/davidchang/ngreact#usage

html - css transition-delay on pointer-events not working -

i want links recover ability of being clicked after there container has been hovered. in following example apply delay on visibility of links when parent div hovered. but can't apply same philosophy pointer-events attribute. http://jsfiddle.net/coolcatdev/trlf02e2/4/ html: <div class="a"> <a href="#">some link</a><br> <a href="#">some link</a><br> <a href="#">some link</a><br> <a href="#">some link</a><br> <a href="#">some link</a> </div> <div class="b"> <a href="https://google.com">some link</a><br> <a href="https://google.com">some link</a><br> <a href="https://google.com">some link</a><br> <a href="https://google.com">some link</a><br> <a href

mapreduce - I am using Hortonworks sandbox for Hadoop ...How do I debug Java code in eclipse? -

i'm using hortonworks sandbox hadoop, using eclipse on windows java code. , hortonworks sandbox installed in oracle virtual box. created executable jar java code , run in hortons. how debug java code in eclipse? one of way debugging hadoop in eclipse running hadoop in local mode because map reduce task run in own jvm. also explore mrunit , jumbune's debugger . https://github.com/impetus-opensource/jumbune the below blogposts may you. http://let-them-c.blogspot.com/2011/07/running-hadoop-locally-on-eclipse.html http://let-them-c.blogspot.com/2011/07/configurations-of-running-hadoop.html how debug hadoop mapreduce jobs eclipse?

VS 2013 cannot login to AccuRev with 2014.3 plugin -

everything worked fine vs 2010 , accubridge plugin. after installing vs 2013 , "accurev-plugin-for-visualstudiope-2014" plugin , configuring it, when logging accurev, doesn't log me in. of options in accurev menu stay greyed out now. there bug it. had issue, not login , not allow edit uri website or location of accurev.exe. i not think there work being done on now. create .bat run on successful build, keep workstation. i switched git locally , run bat @ end of day push streams. just 2 sense.

jquery - Should I bother to develop for JavaScript disabled? -

should bother develop javascript disabled? i feel time better spent developing majority. the answer analyze usage pattern if users , check how many use ancient browsers don't support javascript. once have data, take business decision on should done. below link general usage of browser version across globe. browser usage stats

java - Selenium : Login With Unique Alphanumberic -

may know, how read verifycode image , insert verifycode text field on login page? kindly advise. thank you. if got right, looking solution bypass capcha. there several libraries , frameworks written it. take at deathbycapcha pretty simple tool, , work simple images. hope you

if statement - PHP function not reaching the innermost nested if block -

so i've done bit of testing conditions, , reason can't function reach innermost set of if/else. i'm hoping can show me did? function verifystridersidentity($post_name, $modpass) { //is post name strider? //this part works if (strtolower($post_name) == 'strider') { //is mod pass set? //this part works if (!empty($modpass)) { //modpass has kind of value $staff_name = md5_decrypt($modpass, ku_randomseed);//is strider though? //this seems block having trouble getting into? //i can not value of either of these next 2 return statements. if ($staff_name == $post_name) { return 'this works, it\'s me!'; //this strider } else { return 'this '.$staff_name.' attempting strider. has been logged.'; } } else { return 'anonymous test'; }

How can I separate logs based on source IP or hostname behind NAT using syslog-ng? -

i create centralized logging using syslog-ng. have cover multiple offices 1-2 public ips , multiple other servers/devices running "in cloud". just cloud servers working ok, when want collect logs different devices in office loosing hostname / source ip info of devices. got external public ip. the syslog-ng version 3.5.3 running on ubuntu 14.04 machine (in cloud public ip address). my non default config file following /etc/syslog-ng/conf.d/logserver.conf : source s_network_udp { syslog(ip(<syslog_server_public_ip>) transport("udp") keep-hostname(yes)); }; source s_network_tcp { tcp(ip(<syslog_server_public_ip>) port(514) keep-hostname(yes)); }; destination d_netlog { file("/var/log/remote/${host}.log"); }; log { source(s_network_udp); destination(d_netlog);}; log { source(s_network_tcp); destination(d_netlog);}; every public server have own $hostname.log file, office devices got 1 big public_ip_of_office.log file. the syslog

Count and Aggregate Date in R -

below data have: item date apple 09/06/2015 orange 19/06/2015 pear 01/09/2015 kiwi 20/10/2015 i count items month , year in date column in r. below output achieve: date frequency 05/2015 0 06/2015 2 07/2015 0 08/2015 0 09/2015 1 10/2015 1 thank you. just make sure have date in proper format, can use cut , table , plus formatting if want trim days, ## convert date dat$date <- as.date(dat$date, format="%d/%m/%y") ## tabulate tab <- table(cut(dat$date, 'month')) ## format data.frame(date=format(as.date(names(tab)), '%m/%y'), frequency=as.vector(tab)) # date frequency # 1 06/2015 2 # 2 07/2015 0 # 3 08/2015 0 # 4 09/2015 1 # 5 10/2015 1

Capybara-webkit takes lots of memory. How could I release it? -

i making web scraping app using rails 4. chose capybara-webkit browser engine. looks scraping app running , can parse data need. the problem memory. process called "webkit-server" taking lots of memories while app performing scraping process , assuming capybra-webkit using process somehow. since, tends occupy 1gb after scraping few hundreds pages, want limit/clear memory occupation.is there way that? it looks selenium free memory issue (keeps occupying not more 300mb around), runs slower webkit. you need run reset! on driver instance. the driver written automated test suites in mind, , doesn't perform kinds of cleanup until reset! called. it's invoked between each test. if process holding onto unusual amount of memory after calling reset! , you've found bug in driver.

vb.net - VB - Running an if statement if only a certain number of checkboxes are checked? -

i creating pizza ordering system beginning vb class. able code 1 topping pizza when try , add more 1 topping item 2 toppings 2 other pizzas have single toppings. there way run if statement if number of checkboxes selected in group box? private sub additems() 'declare topping variables dim topping1 string = "pepperoni" dim topping2 string = "bacon" dim topping3 string = "ham" 'declare size variables dim strpersonal string = "persoanl" dim strsmall string = "small" dim strmedium string = "medium" dim strlarge string = "large" dim strexlarge string = "extra large" 'personal single item if radpersonal.checked = true , chkpepperoni.checked = true checkedlistbox1.items.add(strpersonal & " " & topping1) end if if radpersonal.checked = true , chkbacon.checked = true checkedlistbox1.items.add(strpersonal &

How to get Liferay current url that is being displayed in browser? -

i have 2 portlets on page "portlet a" , "portlet b". page has url http://localhost:8080/web/guest/page?p_p_id= "portlet a"... submit form in "portlet b" , try current url portalutil like portalutil.getcurrenturl(myrequest);//p_p_id="portlet b"... themedisplay.geturlcurrent(myrequest);p_p_id="portlet b"... but in browser before submission see url p_p_id="portlet a"... is there way url being shown user? the link looking called referer , points page request comes from. tobias liefke in liferay can find using portlerrequest.gethttprequest().getheader("referer")

css - Text appear from left to right -

i want caption of image (which not necessary real caption) appear when image hovered. text should appear left right it's container should grow on x axis image hovered. have been able make text appear on hover transition effect stuck. have tried: css: .morbid { display: none; margin-left:10px; } a:hover + .morbid { position:relative; display: block; } html: <a> <img src='.../goals/sia.png'> </a> <div class="morbid"> text appear hover mouse on image. </div> actually whole div must grow, text remaining static , want text hidden unless image hovered. you cannot transition display property's change of value. full list of properties can animated available in spec . for content grow , appear need transition max-width (or width , if can set fixed width element) done in below snippet. .morbid { width: auto; max-width: 0%; white-space: nowrap; overflow: hidden; transition: max

create no-login user using chef -

i read https://docs.chef.io/resource_user.html , looks creating system account. want create user running process no login option. right now, using execute block in chef recipe. not great fan of execute block. there way can replace code? execute 'create user service' command -c "this account testing something" -s /sbin/nologin -g 'mygroup' -r my_user' end -s /sbin/nologin on command same specifying shell "/sbin/nologin" in user resource. the user resource create users, create system user if set system property true . so chef user resource command line is: user 'my_user' # user name in command action :create # default action, omitted, better precise shell '/sbin/nologin' gid 'mygroup' # -g in execute comment 'this account testing somethin' # -c in execute system true # match -r in execute manage_home false # avoid creating home directory, omit if wish anyway end the nologin

Applescript Excel 2016 open as read only -

i'm trying applescript open shared excel file, read function doesn't seem work open alias syntax, doing wrong? code similar below. set masterfile ""macintosh hd:users:myname:desktop:test file.xlsb"" text tell application "microsoft excel" activate open alias masterfile read end tell thanks, vd

visual studio 2013 - Modify existing setup for Office Add-In -

i have created couple of com-addins ms excel , ms visio using visual studio 2013. runs planned. as living project, have update code when change stuff. have create new setup files , redistribute them team members install on machine. problem is, every time have uninstall previous version before installing new version have provided. there way when run setup file, ask whether "repair" or "modify" existing installation not have uninstall previous version every time? i used "install shield" in visual studio create setup file. any appreciated. one way make every build able perform major upgrade (uninstall old + install new) on installed build. you'd add entry in upgrade table make happen - https://msdn.microsoft.com/en-us/library/aa372379(v=vs.85).aspx the upgrade table entry like: upgradecode minversion maxversion language attributes remove actionproperty <your upgradecode> null null null 1 null

jquery - IF ELSE Statement in JSP -

i made access log menu. point make can see users activity. have difficulties in displaying string message in menu table after using if else preparedstatement in jsp. before put code below, first need explain basics. have button in access log page named btnreport . , when clicking menu page, display page view in access log table, , when pressing btnreport, display page displayed. click here see screenshot and finally, code: <% string serverip = request.getremoteaddr(); string sqllog = "insert accesslog (userid,hostip,status,webflag,logtype,action) values (?,?,?,?,?,?)"; preparedstatement pst=cn.preparestatement(sqllog); pst.setstring(1,(string) session.getattribute("user")); pst.setstring(2,serverip); pst.setstring(3,"-"); pst.setint(4,1); pst.setstring(5,"

database - Is there any node.js library for offline facial recognition/identification? -

is possible me use facial recognition/identification particular person in database no internet access? or there other better way biometric identification? there may http://www.nodejs-news.com/fun-with-nodejs/face-recognition-with-nodejs/ uses kinect suppose, https://github.com/sklise/appropriatingnewtechnologies/tree/master/week2 can try http://talkweb.eu/face-recognition-with-node-js/ using face.com api mind such questions have been closed community in past face recognition node.js

git - Always take binaries from remote branch on pull and ignore conflicts -

i have problem git , binaries. don't know why, libgit2sharp get's conflict on pulling binaries remote repository, have not changed in local repository. git provide possibility, override binaries in local repository when pulling remote repository? helpful , don't have change thing libgit2sharp . the exact error message is: 1 conflict prevents checkout thank much!

c++ - Trying to print first 5 perfect numbers using Euler's theorem -

euler theorem states equation results perfect number if right side (2^n -1) prime number. 2^(n-1) * (2^n -1) my code trying generate first 5 perfect numbers being : 6,28,496.8128 etc... upon execution prints numbers of euler's equation different n values (1,2,3,4 etc..). seems there mistake prime condition. can ? so 6,28,120,496,2016 etc... result #include <iostream> #include <cmath> #include <iomanip> using namespace std; int main(void) { (int = 2; i<100; i++) { bool prime = true; (int j = 2; j*j <= i; j++) { if (pow(2,i) - 1 % j == 0) { prime = false; } } if (prime = true) { cout << pow(2, - 1)*(pow(2, i) - 1) << " "; } } return 0; } in if condition have if (prime = true) the = operator assignment operator. evaluates true on every iteration in case. should using == operator. instead should have if (prime == true) also,

git push: everything up-to-date / git status has changes committed: -

yesterday, git working normally. making changes , uploading changes origin/master. git commit -a -m 'comment' git push today, when did sequence, after making modifications git push did not recognize commits. can explain going on... , how fix it. have provided copy of git log (i know how git clone , migrate changes new clone, trying understand why git commits not working?) sequence below git status on branch master branch up-to-date 'origin/master'. changes committed: (use "git reset head <file>..." unstage) modified: requirements.txt new file: src/bin/setup_linux.sh deleted: src/echo when run git push up-to-date git push username 'http://giturl': gituid password 'http://giturl': up-to-date git log commit df3a71f7af9070a826a3742751611d3d3fa898a9 author: gituid date: mon oct 12 16:54:51 2015 -0400 fix docs commit a8c5867222147e366fc968e9b47daa5d237ecde5 author: gituid date: mon o

I can not make background image HTML5 -

i have been trying place background image behind text on html5 page, suggestions how place behind text? any appreciated! screenshot of current code here solution <body background="images/example.jpg"> place between head , body of html doc , text appear visable on background.

sql - show empty records with date that don't have data -

i have sql table, show employees attendances date,time,employee id , key( in or out), as: id atttime key attdate 123 08:00 in 2015-08-21 123 06:00 pm out 2015-08-21 123 08:00 in 2015-08-22 123 06:00 pm out 2015-08-22 123 08:00 in 2015-08-23 123 06:00 pm out 2015-08-23 123 08:00 in 2015-08-24 123 06:00 pm out 2015-08-24 123 08:00 in 2015-08-25 123 06:00 pm out 2015-08-25 123 08:00 in 2015-08-26 123 06:00 pm out 2015-08-26 123 08:00 in 2015-08-27 123 06:00 pm out 2015-08-27 now want show dates requested if don't have data.. example: if user request report 01-08-2015 30-08-2015 want output below: id atttime key attdate null null null 2015-08-01 null null null 2015-08-01 null null null 2015-08-02 null null null 2015-08-02 null nul

css - sass bem element modifier inheriting said elements properties -

i know sass provides @extend method allows me this: %knob { width: 10px; height: 10px; } .house { &__door { &__knob { color: inherit; @extend %knob; &--red { @extend %knob; // $1 color: red; } &--blue{ @extend %knob; // $1 color: blue; } } } } however prefer not define abstract class %knob @ all, possible reference/include properties defined in __knob (width , height in case) within modifiers --red , --blue ? im including sassmeister snippet here out bit: http://sassmeister.com/gist/58b5b4673a18ecadbba7 example here might not issue if element long class name has 2 or more different groups of modifiers, , wont create abstract class, end html tags looking <p class="some other classes some-house__some-door__some-knob some-house__some-door__some-knob--red">example</p> find not desirable. what achieve: referencing parent element alo

java - Read data as double array POI -

i have code reads data excel sheet using apache poi , stores array of strings. want data array of double, since have manipulate other purposes. i tried changing string double using double.parsedouble. data read excel file becomes @8bbab2f. i tried initialising output double array throws error. so how data double array using apache poi? my code follows: import org.apache.poi.hssf.usermodel.hssfcell; import org.apache.poi.hssf.usermodel.hssfrow; import org.apache.poi.hssf.usermodel.hssfsheet; import org.apache.poi.hssf.usermodel.hssfworkbook; import org.apache.poi.ss.usermodel.cell; public class xlread { public static void main(string args[]) throws exception { scanner in = new scanner(system.in); string wb_name; wb_name = in.next(); file excel = new file("/users/documents/sample_data/" + wb_name); fileinputstream fis = new fileinputstream(excel); hssfworkbook wb = new hssfworkbook(fis); hssfsheet sh = wb.getsheet("sample&qu

cordova - Ionic CLI not generating release build for Android -

when use command: cordova build --release android cli throws following error: error: cannot find module 'minimatch' @ function.module._resolvefilename (module.js:336:15) @ function.module._load (module.js:286:25) @ module.require (module.js:365:17) @ require (module.js:384:17) @ object.<anonymous> (c:\users\sologic\appdata\roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\glob\glob.js:44:17) @ module._compile (module.js:434:26) @ object.module._extensions..js (module.js:452:10) @ module.load (module.js:355:32) @ function.module._load (module.js:310:12) @ module.require (module.js:365:17) @ require (module.js:384:17) but when use ionic lab (windows installer) , using build option - generates ' android-debug.apk ' & ' android-debug-unaligned.apk ' in android\build\outputs\apk folder. note not generating android-release-unsigned.apk my questions are: 1: wrong cli ?? 2: can

swift - Capturing self weak or unowned on asynchronous network requests -

whenever doing asynchronous network requests on arrival of request self nil (e.g. viewcontroller dismissed). to prevent capturing self weak: future.onsuccess(context: queue.main.context, callback: { [weak self] result in if let strongself = self { // stuff self, guaranteed not nil // strongself.somemethod() } }) or capture self unowned: future.onsuccess(context: queue.main.context, callback: { [unowned self] result in // stuff self // self.somemethod() }) i not care request returning, because when request returning @ point in time when viewcontroller dismissed have nothing show request. not want keep self "alive" closure. my question - enough capture self unowned in case? or have time nil checking [weak self]? happens in case of unowned capturing request when arrives , self nil - closure still alive , execute , trigger runtime error on accessing nil? or closure deallocated self , r

libsodium - Creating Nacl Cryptography library project in Eclipse on Ubuntu -

i want create eclipse project of nacl cryptographic library. have installed using commands mentioned on website, don't know how should include files in eclipse project can use develop own main function. can me on this? githut repository located @ nacl github , project installation details available @ nacl install i new , hence have no idea. if need further information, please tell me. thanks in advance.

mdx - ssas total calculation incorrect when using IIF in calculated member -

Image
i cannot understand why total of calculated member displayed incorrect. how should change calculated member work correctly? calculated member: create member currentcube.[measures].averagescore iif([measures].[distance]<2001,0,[measures].[avgscore]/[measures].[date count]), visible = 1; it seems total calculated without checking value in "averagescore" month. thanks if avgscore hidden measure don't want visible , if it's physical measure not calculated measure try adding before current calc: scope([driver dim].[driver].[driver].members, [date].[month].[month].members); [measures].[avgscore] = iif([measures].[distance]<2001,null,[measures].[avgscore]); end scope; that should 0 out avgscore low distance driver months grand total work right. if won't work explain avgscore further. how many rows per driver per month there? assume more 1 otherwise tell <2001 check in sql.

ios - Auto layout in ipad -

i learning auto layout , try implement tutorial http://www.raywenderlich.com/115440/auto-layout-tutorial-in-ios-9-part-1-getting-started-2 it working fine other ipad. in ipad show on portrait but when rotated show expected. have suggestion? make sure have 3 views in view controller. it's quite placed view accident. you can try ui debugging , eveything clear: https://developer.apple.com/library/ios/recipes/xcode_help-debugger/using_view_debugger/using_view_debugger.html

There are no primary or candidate keys in the referenced table in sql server 2008 -

classcode table create table [dbo].[classcode]( [schoolcode] [nvarchar](10) not null, [classcode] [nvarchar](4) not null, [classname] [nvarchar](50) not null, [classrange] [int] not null, [classduration] numeric(38,2) not null, [userid] [nvarchar](30) null, [recorddate] [smalldatetime] null, constraint [pk_classcode] primary key clustered ( [schoolcode] asc, [classcode] asc, [classrange] )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] examdeclaration table create table [dbo].[examdeclaration]( [schoolcode] [nvarchar](10) not null, [classcode] [nvarchar](4) not null, [examcode] [nvarchar](4) not null, [registationfess] numeric(38,2) not null, [registatinstartdate] [date] not null, [registatinenddate] [date] not null, [examstartdate] [date] not null, [userid] [nvarchar](30) null, [recorddate] [smalldatetime] null constraint [pk_examdeclaration] primary key c

linux - How to Execute Command stored in variable from a file -

cmd="cd /home/pi" $cmd , eval "$cmd" this working in cli interested run command variable stored in file. in file wrote $cmd , eval "$cmd" and execute file cli shows error. solution??

Ruby on rails 4 using filterrific to filter based on checkbox -

i using filterrific gem in rails app filter result, have events filtered based on options code follows event.rb filterrific :default_filter_params => { :sorted_by => 'created_at_desc' }, :available_filters => %w[ sorted_by search_query with_category_id with_area ] # default will_paginate self.per_page = 9 scope :with_category_id, lambda { |category_ids| where(category_id: [*category_ids]) } events_controller.rb def index @filterrific = initialize_filterrific( event, params[:filterrific], :select_options => { sorted_by: event.options_for_sorted_by, with_category_id: category.options_for_select } ) or return @events = @filterrific.find.paginate(page: params[:page], per_page: 6).where(is_job: false) respond_to |format| format.html

javascript - Load a ui-router state when website first loads -

js creating 2 layout , content page is: $urlrouterprovider.otherwise("/site/movies"); $stateprovider .state('admin', { url: "/admin", templateurl: "/views/admin.html" }) .state('site', { url: "/site", templateurl: "/views/site.html" }) .state('site.movies', { url: "/site/movies", templateurl: "/views/site/movies.html", controller: 'moviescontroller' }) index.html is: <!doctype html> <html ng-app="moviesapp"> <head></head> <body ng-cloak> <!--<div class="container-fluid"> <ng-view></ng-view> </div>--> <div ui-view></div> <a ui-sref="site.movies">state 1</a> </body> </html> ​

jquery - processing a form after submit in overlay instead of new windows -

i have html form whith action url... till if press submit button progress continued in new window. want continue div overlay or this... my site: http://www.bayers-hotel.de/ if u fill out dates , click on "prüfen" u se... what want have: http://brecherspitze.com/index.php/de/ if u scroll down there on left side box "buchung" after click on suchen process woul continued in overlay... i found lot of examples how open popup content after click on submit. not how can continue booking process in new popup, cause information form ... thanks. you'll need ajax: http://api.jquery.com/jquery.ajax/ , send returning data popup. i can't give explicit example, issue complex.

php - API that provide today weather and next 5 day weather forcast -

attempted using yahoo weather like this: http://query.yahooapis.com/v1/public/yql?q=select%20item%20from%20weather.forecast%20where%20location=%22lexx0003%22&format=json&u=c however, weather next 4 days only. there other free weather api recommend? not heavy user seems charged plan not required. use openweathermap api. goes 5 days in advance. :) http://openweathermap.org/forecast5

java - Suddenly Unable to launch application using JNLP -

i facing strange problem, have been launching application using jnlp on windows machine jdk/jre 1.7. has been working fine far, jnlp not working. tried jre 1.8 well, same issue. on start see jre launch screen , closes. any suggestions appreciated.

ios - Don't Understand the concept of the pushViewController -

can explain me concept of pushing , popping stack items in uinavigationcontroller .i know meaning of push , pop used in stack opreation in data structure don't know how work in uinavigationcontroller .please explain the following functions of it. pushviewcontroller:animated: - popviewcontrolleranimated: - poptorootviewcontrolleranimated: - poptoviewcontroller:animated: interactivepopgesturerecognizer thanks. its same concept stack in data structure really, except can view whats on top (ie top viewcontroller in navigation stack) so pushing viewcontroller means going on top of stack (animates coming in right) popping viewcontroller take viewcontroller off top (which current 1 looking at) animate off right of screen, showing viewcontroller underneath top one poptorootviewcontroller popping until hit last viewcontroller in navigation stack poptoviewcontroller pops until particular viewcontroller on top hope thats clarification need

REGEX to catch whitespace or comments -

i'm trying create regex catch whitespace or comments (//). content of comment unknown (can contain character). want allow character only after comment, otherwise - whitespace. run regex on string contains new-lines. suggestions? example: whitespace // unknown comment 123@#$~ whitespace whitespace // comment whitespace if ones mentioned want capture, use : (\s*)(//(.*))*

android - How to Disable material design Fragment Navigation Drawer inside a particular Activity -

i used fragment navigation drawer , floatingactionbutton inside application. clicking on floatingactionbutton takes me new activity. have added setdisplayhomeasupenabled(true) , takes me parent activity. inside activity still ableto swipe fragment navigaion drawer , when click on drawer items app crashes. want disablethe fragment navigation drawer inside second activity. how this. here code. mainactivity.java @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mtoolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(mtoolbar); getsupportactionbar().setdisplayshowhomeenabled(true); drawerfragment = (fragmentdrawer) getsupportfragmentmanager().findfragmentbyid(r.id.fragment_navigation_drawer); drawerfragment.setup(r.id.fragment_navigation_drawer, (drawerlayout) findviewbyid(r.id.drawer_layout), mtoolbar); drawerfragment.setdrawerlistene

javascript - Why my variable "c" has changed? -

var c = new date(2015, 11, 25); var d = c; d.setfullyear(2000); console.log(c); console.log(d); //why variable "c" has changed in code? line 1: create date object , assign reference c . line 2: copy value of c (a reference date object) d line 3: modify date object. still referenced 2 variables. if want create new date object , assign d need explicitly. var c = new date(2015, 11, 25); var d = new date(c); d.setfullyear(2000); console.log(c); console.log(d);

mysql - how can I mysqlnd work with php? -

i use php 5.2 doesn't support mysqlnd. changed php 5.3.7 can't handle it...what's wrong it version info os window7 php 5.3.7v mysql 5.1.39 apache 2.2.14 if read php installation manual see that: installation on windows in official php windows distributions 5.3 onwards, mysql native driver enabled default, no additional configuration required use it. mysql database extensions use mysql native driver in case. so need install php , working already. try reinstall php scratch if manipulated it's configuration files , should have no issues.

jdbc - Multiple Teradata DDL queries plus a select using Java -

may me on that? i trying execute following query using java (teradata jdbc driver): connection string: jdbc:teradata:/xxx.xx.xx.xx/database=xxx,tmode=tera,charset=utf8 jdbc driver: com.teradata.jdbc.teradriver bt; create multiset volatile table ( select ... ) data primary index (xxx, xxx) on commit preserve rows; create multiset volatile table b ( select ... ) data primary index (xxx, xxx) on commit preserve rows; create multiset volatile table c ( select ... ) data primary index (xxx, xxx) on commit preserve rows; select x.a, x.b, x.c join a, b, c et; but getting following error message: exception in thread "main" java.sql.sqlexception: [teradata database] [terajdbc 15.10.00.05] [error 3932] [sqlstate 25000] **only et or null statement legal after ddl statement.** @ com.teradata.jdbc.jdbc_4.util.errorfactory.makedatabasesqlexception(errorfactory.java:308) @ com.teradata.jdbc.jdbc_4.statemachine.receiveinitsubstate.action(receiveinitsubstate.jav

Play youtube video using youtube api v3 in php -

i using youtube data api(v3) accessing data of youtube. search lot how can play video in php using api, couldn't find anything. i know there way play youtube videos. embed video using iframe however, youtube blocked in region live, means can't use method them. are there workarounds? for instance, playit.pk can play videos if region blocked. update how can playit.pk access youtube video url like. https://r2---sn-npo7en7d.c.doc-0-0-sj.sj.googleusercontent.com/videoplayback?upn=ys-t9e4j_3o&id=15589d4018f319ea&mime=video/mp4&mm=31&mn=sn-npo7en7d&ms=au&mt=1444897255&mv=m&ip=2400:6180:0:d0::27:f001&key=yt6&initcwndbps=13453750&ipbits=0&ratebypass=yes&sver=3&signature=a365aa3ada506748ae53f0493b34e4b4ae807dcc.9f8eb21e86e4f5682bffd44768102434da58341b&fexp=9405958,9408710,9413271,9414764,9416126,9416359,9417707,9418204,9418400,9418809,9418997,9419837,9420351,9421923,9422553&nh=igpwcjaxlnnpbjazkg

javascript - I want to remove this line from my html code -

Image
this image of html code. i want rid of line boxed in red.please me.that line not show in actual code, when page opened on browser i.e in (google chrome) , selected "view source code" shows line.i want rid of it.please me, reply me a.s.a.p..thank you. definitely adware. check out: http://www.malwarekillers.com/tag/remove-track-breaking-news/

javascript - Is it possible to only remove the "watch later" and "share" buttons from youtube iframe embed player -

how can remove watch later , share buttons youtube iframe embed player. using following embed code embedding video clips. <iframe width="854" height="480" src="https://www.youtube.com/embed/cpvgwz5an1o" frameborder="0" allowfullscreen></iframe> using showinfo=0 removes full header contains video title. is possible remove "watch later" , "share" buttons header? add line after link https://www.youtube.com/embed/c5chjtspa7m?mode=opaque&amp;rel=0&amp;autohide=1&amp;showinfo=0&amp;wmode=transparent it disable share , watch later option

meteor - Why does my select element have an empty item at the beginning? -

Image
i've got empty first item in select element: i don't know why; here's html/spacebars in meteor app: <select id="stateorprovince" name="stateorprovince"> <option selected="selected"></option> {{#each statesandprovinces}} <option title="{{hint}}">{{abbrcode}}</option> {{/each}} </select> ...and here's meteor helper returns values: template.addperson.helpers({ statesandprovinces: function() { return [{ "hint": "alabama", "abbrcode": "al" }, { "hint": "alaska", "abbrcode": "ak" }, { . . . if remove line html/spacebars: <option selected="selected"></option> ...i no longer have empty line after dropping down select, makes al default/displayed value prior dropdown; don't want - want blank default - yet not have empty va

php - Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables 11 -

my code against sql injection isn't working (error message in title). i simplified code, still not working. <?php include "conf.php"; $db = new mysqli($mysql_host, $mysql_user, $mysql_pass, $mysql_db); $ltime =10; $url= 1; $title =2; $result = $db->prepare("insert links values ('', ?, ?, ?)"); $result->bind_param('ss', $url, $title, $ltime); $result->execute(); i created db , variables integer, first value id , created auto increment flag. you have put 3 "s" in bind_param method, because there 3 variables bind $result = $db->prepare("insert links values (null, ?, ?, ?)"); $result->bind_param('sss', $url, $title, $ltime); i's better pass null null value autoincremented field instead of empty string

FxCop analysis using Jenkins SonarQube plugin? -

i'm trying fxcop analysis .net projects within jenkins build ( invoke standalone sonarqube analysis ). configuration looks this: sonarqube 5.1.2 c# 4.2 sonar-runner 2.4 jenkins: sonarqube plugin 2.2.1 and main problem when enable fxcop rules in sonarqube error: java.lang.illegalargumentexception: property "sonar.cs.fxcop.assembly" must set , project must have been built execute fxcop rules. property can automatically set analysis bootstrapper visual studio projects plugin, see: http://docs.codehaus.org/x/taa1dg.if wish skip analysis of not built projects, set property "sonar.visualstudio.skipifnotbuilt". however, if explicitly set sonar.cs.fxcop.assembly in sonar-project.properties point @ assembly (.dll) analysis one, project has multiple assemblies i'd fxcop analysis. if it's possible set list of assemblies argument (is it?) not elegant/generic solution , patterns not accepted value. i understand msbuild sonarqu

java - How to subscribe multiple device token at one time in AWS SNS -

i using aws sns sending push notification in android , ios devices. can tell me how subscribe multiple device tokens @ same time (not 1 one). i have code 1 one subscription of device token. createtopicrequest createtopicrequest = new createtopicrequest("mynewtopic"); createtopicresult createtopicresult = snsclient.createtopic(createtopicrequest); //print topicarn system.out.println(createtopicresult); //get request id createtopicrequest sns metadata system.out.println("createtopicrequest - " + snsclient.getcachedresponsemetadata(createtopicrequest)); string topicarn = createtopicresult.gettopicarn() createplatformapplicationresult platformapplicationresult string platformapplicationarn = '' long = system.currenttimemillis() println("----before-subscription-------" + now) platformtokens.each { string platformtoken -> try { platformapplicationresult = createplatformappl

weblogic12c - spring integration jms-outbound-channel-adapter not caching weblogic jms connection -

we using jms outbound channel adapter send messages coming 1 channel. accessing connection factory , queue using jndi template. both config using cache=true in config. but have noticed that, every message sends, new connection being created instead of using cache. i believe behind scene outbound channel adapter uses "jmssendingmessagehandler " internally use jms template send message. can throw light on how can cache weblogic jms connection? accessing connection factory , queue using jndi template caching in context means caching connection factory object, not connection(s). as long not using jta transactions, can wrap cf obtain jndi cachingconnectionfactory . jta, app server might need new connection each tx , need configure caching in app server (if available).

vb.net - can someone help me to include aces into my blackjack program -

i have been trying create simple blackjack game user picks cards , decides whether hit or stick , if cards go above 21 lose. not know how add in aces program choose whether ace 1 or 11. please code module module1 sub main() dim cards(4, 13) integer dim value integer dim value2 integer dim royal string dim suit string dim card1 integer dim card2 integer dim card3 integer dim card4 integer dim card5 integer dim card6 integer dim card7 integer dim answer string dim total integer randomize() value = (3 * rnd()) + 1 value2 = (11 * rnd()) + 1 'suits: 1= hearts '2= diamonds '3=spades '4=clubs cards(1, 1) = 2 cards(2, 1) = 2 cards(3, 1) = 2 cards(4, 1) = 2 cards(1, 2) = 3 cards(2, 2) = 3 cards(3, 2) = 3 cards(4, 2) = 3 cards(1, 3) = 4 cards(2, 3) = 4 cards(3, 3) = 4 cards(4, 3) = 4 cards(1, 4) = 5 cards(2, 4) = 5 cards(3, 4) =