Posts

Showing posts from August, 2011

Excel doesn't update value unless I hit Enter -

Image
i have annoying problem in 1 of worksheets in workbook. using excel 2007. cell's value not updated unless hit enter. either if formula in cell includes if condition, or vlookup function or average function. calculations set automatic, application.calculation = xlautomatic, , calculations specific worksheet enabled, : ws.enablecalculation = true. furthermore, screenupdating set true. after hit enter or drag down right corner, cells updated, , keep being updated if make change. however, after saving file , reopening again frozen again. haven't figured out when stop being updated again. formatting set general or number. especially in if conditions, when check calculations through evaluate feature, result correct not passed on screen. any suggestion? thing driving me crazy. it sounds workbook got set manual calculation. can change automatic going formulas > calculation > calculation options > automatic. manual calculation can useful reduce computati...

C (Preprocessor): How to concatenate/append substitution string -

i define exceptions on command line: -dexception_1=\"first\" -dexception_2=\"second\" -dexception_3=\"third\" which check against string: except = 0; #ifdef exception_1 if (! strcmp(exception_1, mystring)) { except = 1; } #endif #ifdef exception_2 if (! strcmp(exception_2, mystring)) { except = 1; } #endif #ifdef exception_3 if (! strcmp(exception_3, mystring)) { except = 1; } #endif if (except == 1) { // } else { // else } needless say, while works, quite ugly, inflexible , causes redundancy in code. is there way append string preprocessor macro variable? i (the problem of course #append not exist): #ifdef exception_1 #append exceptions if (! strcmp(exception_1, mystring)) { except = 1; } #ifdef exception_2 #append exceptions if (! strcmp(exception_2, mystring)) { except = 1; } #ifdef exception_3 #append exceptions if (! strcmp(exception_3, mystring)) { except = 1; } then use exceptions in code , work possible permutations of...

mule datamapper pojo to csv without any data -

i have pojo class below public class product { private string productname; private string quantity; public string getproductname() { return productname; } public void setproductname(string productname) { this.productname = "laptop"; } public string getquantity() { return quantity; } public void setquantity(string quantity) { this.quantity = "25"; } } using datamapper converrt pojo csv <file:outbound-endpoint path="c:\temp" outputpattern="#[function:datestamp]_product.csv" responsetimeout="10000" doc:name="file"/> it create file without data laptop,25 datamapper ignore null values default so, if you're not calling setters, getters return null, if want have "default" values can standard java way, either set on constructor or directly in field declaration i.e private string quantity = 25 also java in general,...

Create a list of lists using Python -

i have list year , day starting december till february 2003 2005. want divide list list of lists hold year day december february: a = ['2003337', '2003345', '2003353', '2003361', '2004001', '2004009', '2004017', '2004025', '2004033', '2004041', '2004049', '2004057', '2004337', '2004345', '2004353', '2004361', '2005001', '2005009', '2005017', '2005025', '2005033', '2005041', '2005049', '2005057'] output should like: b = [['2003337', '2003345', '2003353', '2003361', '2004001', '2004009', '2004017', '2004025', '2004033', '2004041', '2004049', '2004057'] ['2004337', '2004345', '2004353', '2004361', '2005001', '2005009', '2005017', '200502...

makefile - Directory change error with mingw32-make -

i'm building poco library 1.6.0 under mingw32, environment: windows 7 ultimate 32-bit, shell: msys. executed ./configure . $ ./configure configured mingw contents of config.make: poco_config = mingw poco_base = /c/dev/poco poco_build = /c/dev/poco poco_prefix = /usr/local poco_flags = omit = export poco_config export poco_base export poco_build export poco_prefix export poco_flags after launching mingw32-make i'm getting: $ mingw32-make --debug -w gnu make 3.82 built i386-pc-mingw32 copyright (c) 2010 free software foundation, inc. license gplv3+: gnu gpl version 3 or later <http://gnu.org/licenses/gpl.html> free software: free change , redistribute it. there no warranty, extent permitted law. reading makefiles... updating goal targets.... file `poco' not exist. file `libexecs' not exist. file `foundation-libexec' not exist. must remake target `foundation-libexec'. invoking recipe makefile:69 update target `foundation-libexec...

regex - Java Pattern.compile ignoring escaped double quotes (\") -

i having hard time figuring out pattern ignore escaped quotes. want this: "10\" 2 topping pizza, pasta, or sandwich $5 each. valid until 2pm. carryout only.","blah blah" to match as: 1> "10\" 2 topping pizza, pasta, or sandwich $5 each. valid until 2pm. carryout only." 2> "blah blah" i have been trying this: pattern pattern = pattern.compile("\"[^\"]*\""); matcher matcher = pattern.matcher(filteredcoupons); and 1> "10\" 2> "," the regex looking is "[^"\\]*(?:\\.[^"\\]*)*" see demo in java, string pattern = "\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"";

how can i change my spritekit on collision in spritekit swift -

how can change spritekit on collision in spritekit swift. else if collidedbird.birdtype == 6 { if uidevice.currentdevice().userinterfaceidiom == .pad { _bird.physicsbody?.applyimpulse(cgvectormake(0, birdimplusereturn(70.0))) } else { _bird.physicsbody?.applyimpulse(cgvectormake(0, birdimplusereturn(70.0))) } let fire = nstimer.scheduledtimerwithtimeinterval(0.05, target: self, selector: selector("createdragonfire"), userinfo: nil, repeats: false) playeffectsound("bs_std_jump_sfx.mp3") _platform.removefromparent() } if want change image of sprite, should use skphysicscontactdelegate method. in general means have implement skphysicscontactdelegate , make new struct: for example: struct physiccategories { static let nonec : uint32 = 0x1 << 0 static let bird : uint32 = 0x1 << 1 stat...

c# - Update all objects in a list from objects in another list -

i have following 2 objects: public class blogpost { public int blogpostid { get; set; } public author author { get; set; } } public class author { public int authorid { get; set; } public string firstname { get; set; } public string lastname { get; set; } } i have 2 separate lists of 50 blog post objects , 50 author objects. how combine 2 such author object assigned blog post's author property? i've tried using zip method, don't think that's quite want. question similar, want value object list. context: using seed method in entityframework populate database. edit: should have mentioned that, because seed data, don't care author gets matched blogpost. hence why trying use zip method. if blogpost , author objects linked via index can use for -loop: for(int = 0; < blogposts.count; i++) blogposts[i].author = authors[i]; you use linq approaches zip have create new objects ol...

stack overflow - Increase MaxJavaStackTraceDepth for Android DDMS -

i've encountered stackoverflowerror hard debug, , due limited depth of stack trace, unable find root of problem. is somehow possible increase stacktracedepth -xx:maxjavastacktracedepth=1000000 android? i'm not sure if it's interesting here current stacktrace: java.lang.runtimeexception: error occured while executing doinbackground() @ android.support.v4.content.modernasynctask$3.done(modernasynctask.java:137) @ java.util.concurrent.futuretask.finishcompletion(futuretask.java:355) @ java.util.concurrent.futuretask.setexception(futuretask.java:222) @ java.util.concurrent.futuretask.run(futuretask.java:242) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1112) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:587) @ java.lang.thread.run(thread.java:841) caused by: java.lang.stackoverflowerror @ org.nfunk.jep.astfunnode.jjtaccept(unknown source) ...

Jira to know how many poeple have visited an issue -

i want know how many people have visited particular isssue in order know popularity( can't trust on number of watchers of issue) .is there way (jiradb or anything) can know how many people(just count) have visited particular issue. the question can modified : top 10 visited issues in week or so. seb's earlier answer provides possible solution jira cloud. not aware of off-the-shelf product behind-the-firewall installations of jira, , not believe views tracked anywhere in jira database. for behind-the-firewall instances, write script parse jira access logs (stored in $jira_home/logs/access_log*) count issue accesses way. the jira access logs stored in format similar apache access log format , need parse out accesses individual issues looking urls of format " http://myjira/browse/abc-123 ".

Jquery Form Validation works only once -

i using jquery form validation : $('#form').validate({ errorelement: 'span', //default input error message container errorclass: 'help-block help-block-error', // default input error message class focusinvalid: false, // not focus last invalid input ignore: "", // validate fields including form hidden input rules: { "cash": { equalto: "#password" }, "custfirstname": { required: true }, "custlastname": { required: true }, "custemailaddress": { required: true, email: true, }, "custmobileno": { required: true, minlength:9, maxlength:10, number: true }, "adultfirstna...

I can not play music with Dropbox link.(Android applications.) -

i want try play direct link dropbox app not make success. uri myuri = uri .parse("https://dl-web.dropbox.com/get/lieutraitieuthuy2006tap5.mp3?_subject_uid=442310434&w=aab7e-mlx5qbbdqbf0exnmtv5nkx-hrjbwtjv5vv9dryrw"); try { mediaplayer = new mediaplayer(); mediaplayer.setdatasource(this, myuri); mediaplayer.setaudiostreamtype(audiomanager.stream_music); mediaplayer.prepare(); } catch (ioexception e) { e.printstacktrace(); } but link successful. http://searchgurbani.com/audio/sggs/1.mp3 i found link in topic. enter link description here i wanted use dropbox store music later. can explain why dropbox link not work in application.

java - JML can't catch a violated precondition -

in class test i've array of 5 int named a, , method addone(int index) add 1 selected cell. wrote in jml simple precondition control index passed method. try violate precondition calling method negative index , jml can't catch error. what's wrong? this test class: public class test { public int[] a; public test(){ = new int[]{1,1,1,1,1}; } //@ requires index>=0 && index<5; public void addone(int index){ a[index]+=1; } } and main: public static void main(string[] args) { test t = new test(); t.addone(-2); } that throw exception: java.lang.arrayindexoutofboundsexception: -2. with jml message.

mysql - SQL query to populate relational combo php -

query: network i having 2 combobox ( country , network), need populate network combo on basis of item selected in country combo. table1: network platform network location_id platform 1 operator 1 56 platform 1 operator 2 59 table2 : location location_id city country 56 hong kong hong kong 109 tafuna american samoa 59 delhi india help me write sql query same please. in advance. bind country dropdown location_id , country of location table value , text respectively. can use following query binding location - select location_id, country location and binding network combo box, use following query : select network, platform network location_id = @location_id @location_id selected value in country dropdown list. note : populate network combo in change event of country combo box.

webcam - How to integrate web camera in jsp(web Application) project -

i have integrate web camera in gate pass system(visitor management system). new , confused how use web camera. when visitor comes gate security person take information him , fill information. need take photo , print gate pass. confused how communicate web camera because web camera in client side not in server computer. this post - how access webcam javascript - includes useful info on how access webcams in js. also, can try online demo of webcam capture using 3rd party sdk , see how meets needs.

swift2 - What’s the difference between Array<T>, ContiguousArray<T>, and ArraySlice<T> in Swift? -

in swift 2, major difference between 3 array variants: array contiguousarray arrayslice can explain real world example? from docs : contiguousarray: efficiency equivalent of array, unless t class or @objc protocol type, in case using contiguousarray may more efficient. note, however, contiguousarray not bridge objective-c. see array, contiguousarray shares properties, more detail. basically, whenever store classes or @objc protocol types in array, might want consider using contiguousarray instead of array . arrayslice arrayslice uses contiguous storage , not bridge objective-c. warning: long-term storage of arrayslice instances discouraged because arrayslice presents view onto storage of larger array after original array's lifetime ends, storing slice may prolong lifetime of elements no longer accessible, can manifest apparent memory , object leakage. prevent effect, use arrayslice transient computation. arrayslices us...

c# - Regular expression to parse AT command response -

i trying return message @ command response. this input: at+cusd=1,"*124#",15 ok +cusd: 2,"00302220100 main balance 10k, valid until 23/10/2015. more balance details, please send bal 1" my expected result is: 00302220100 main balance 10k, valid until 23/10/2015. more balance details, please send bal 1 here code: private string parsemessages_chkcredit(string input) { string messages = ""; regex r = new regex("\\at+cusd: (\\d+),\"(.*?)\"", regexoptions.singleline); match m = r.match(input); while (m.success) { messages = m.groups[2].value.tostring(); break; } return messages; } the regular expression not match. please kindly me. lot. (?<=at\+[\s\s]*?cusd:[^"]*")[^"]* you can make use variable lookbehind . see demo. string strregex = @"(?<=at\+[\s\s]*?cusd:[^""]*...

ajax - CSS Animation, State change finish animation -

we implementing wishlist functionality on site developing, , when user clicks on icon add current item wishlist, fires ajax request. now while ajax request doing it's business, add loading class icon, scales bigger , smaller slightly. issue, once ajax request has finished loading, remove class, animation abruptly stops rather scaling down it's initial size. how can make animation finish, rather stopping? below css: /** * keyframes */ @keyframes breathe { 50% { transform: scale(1.2); } 100% { transform: scale(1); } } /** * icon */ .wishlist-icn { transition: .3s ease; } .wishlist-icn--isadded { fill: #4b3814; } .wishlist-icn--isloading { animation: breathe 2s ease-in-out 0s infinite normal both; } tl;dr: try applying animation-fill-mode: forwards the normal behavior after css animation done resets styles initial state. way see process here when remove --isloading class animatio...

ibm mq - Item has already been added. Key in dictionary: 'Hostname' Key being added: 'Hostname' in c# -

i trying push message ibm mq while adding properties hostname, channel , port getting below error when continue debug without stopping item has been added. key in dictionary: 'hostname' key being added: 'hostname' in c#. i have tried validate below, if (!mqenvironment.properties.containskey(strhost) && !mqenvironment.properties.containskey(intport) && !mqenvironment.properties.containskey(strchannel)) { mqenvironment.properties.add("hostname", strhost); mqenvironment.properties.add("port", intport); mqenvironment.properties.add("channel", strchannel); mqenvironment.properties.add(mqc.transport_property,mqc.transport_mqseries); } above code contains in mq putmessage method pushing message. it looks it's not strhost that's there, it's "hostname" . you'd need change ch...

What can be done with a Haskell monad that cannot be done with a Lisp macro, and vice-versa? -

my current understanding macros can implement imaginable concept, including monads, because "have compiler @ hands". true? example, have came across link please, give me facts , examples, no passionate answers. thank you. that's kind of odd comparison. it's bit asking "what can petrol car diesel generator cannot?" er, well, aren't same class of thing... lisp macros [which know nothing about] allow compile-time meta-programming. can use achieve sorts of useful things, eliminating bit of boilerplate code virtually defining entire new programming language. haskell monads useful way structure kinds of computations. make easy things otherwise bit tedious. (e.g., checking result of each , every function make sure succeeded before running next function.) of run-time thing, though; has nothing compile-time code generation.

Compile Scala code to .class file, in Java -

in project need replace java compilation task scala compilation task. first step need take find equivalent this: http://docs.oracle.com/javase/7/docs/api/javax/tools/javacompiler.html is there in scala? brief google search gave no interesting results. what need library allow me take file in form of list of lines or file on hd , compile it. i don't need evaluate must able compiled .class file it. you can invoke scalac processbuilder . otherwise, you'll need translate scala code question linked @mastov, it's pretty trivial: import scala.collection.javaconversions; import scala.tools.nsc.*; global g = new global(new settings()); global.run run = new g.run(); // assumes have java list of file names run.compile(javaconversions.asscalabuffer(filenames).tolist);

java - Get an Exception from CDI transactional observer methods -

we can declare observer method transactional defining transactionphase attribute like: public void ondocumentupdate(@observes(during=after_success) @updated document doc) { ... } is possible exception causes transaction broken within transactional cdi observers? example, i'd write business logic scenario based on exception thrown: void ondocumentupdate(@observes(during=after_failure) @updated document doc) { exception e = getfailurecause(); if (check_wether_e_is_instance_of_constraintviolationexception) { // } } any ideas how achieve it? in advance! consider using cdi interceptors handle exceptions.

bash - Why doesn't script call the cleanup and kill the script after 5s, and I also want to get where it stoppped -

the script designed kill after 5s. doesn't kill script after 5s, , not call cleanup. important thing want value of i when stopped. #!/bin/sh trap "cleanup" term #call cleanup when recive term mainpid=$$ #script's pid cleanup() { echo "cleaup called" echo "i=$i when stopped " exit 1 } (sleep 5 && echo "timeout";kill -term $mainpid) & #after 5s should kill script run_test() { i=1 sleep 100 i=$$(i+1) } run_test 2>&1 > x.log because parent processes waiting sleep 100 ends "processing". if want process ends before sleep ends, should kill him too. something like (sleep 5 && echo "timeout";kill -term `ps -ef | grep $mainpid | grep sleep | grep -v grep| awk '{print $2}'` $mainpid) &

apache - permanent redirect 301 for using regex for wordpress -

i moved corephp based site wordpress site , changed domain name also. urls save in database. seo , other purpose want permanent redirect old urls new urls. url sample old php site : /article/edleman-japan-names-rowbury-president url sample new site like: http://newdomain.com/edleman-japan-names-rowbury-president how can permanent redirect 301 thourgh .htaccess using regular expression because have 10000 urls saved in db. here sample .htaccess file : redirect 301 /myfolder/article/edleman-japan-names-rowbury-president any appriciated. thanks! thanks starkeen, used redirectmatch in .htacces accomplish this. redirectmatch 301 ^/article/edleman-japan-names-rowbury-president/([a-za-z0-9_-]*) http://target.url.com/$1 above work me

php - mysql query if else not work correctly -

in query want add condition if((select showman preferences `userid`='92') == true ) users.gender !='female' here full query select * `users` users.id != '92' , users.id not in (select matched_user_id `user_matchs` user_id = '92' ) , users.id not in (select user_id `user_matchs` matched_user_id = '92' , status = 'friend' ) , if((select showman preferences `userid`='92') == true ) users.gender !='female' my logic isifuser 92 showman value true add condition users.gender !='female' if showman value false add condition users.gender !='male' does changing last part work : and ((not (select showman preferences `userid`='92')) or (users.gender !='femal...

vba - Get the last date before selected date from ACCESS in Excel -

i have access database date column in table, dates sorted there can missing dates. problem latest date before input date. example managed solve problem in excel sheet {=max(if(a1:a10<=c1,a1:a10,0))} formula, have database large amount of data , need call db formula. i tried write code, doesn't work. don't why ? me problem ? thanks. public function getdatedb(tbl string, colmn string, dt string) variant dim db database dim rs recordset dim dbfile dbfile = application.thisworkbook.path & "\mydatabase.accdb" set db = dbengine.opendatabase(dbfile) set rs = db.openrecordset("select max(" & colmn & ") maxdate " & tbl & " maxdate <= #" & format(dt, "m\/d\/yyyy") & "# ", dbopendynaset) if rs.recordcount > 0 rs.movefirst getdatedb = rs!maxdate end if end function as far consider, need replace ... maxdate <= ... ... maxdate < ... . (just delete equals-s...

jquery - CSS: hide overflow content into bootstrap btn-group -

Image
for example have table: /* styles go here */ table.my { width: 600px; } table.my > tr { height: 40px; overflow: hidden; } .tag { background: #b8b8b8; padding: 4px; color: blue; } .tag-area{ display: inline; } .name { width: 400px; height: 100%; display: inline-block; } <table class="table table-striped table-hover my"> <tbody> <tr> <td>1</td> <td> <span class="name">ammy holdings</span> <div class="tag-area"> <span class="tag">ios</span> <span class="tag">pm</span> <span class="tag">android</span> </div> </td> ...

php - How do I send SQL logs to Symfony WebProfiler? -

i've started working on symfony project uses own db utility execute queries. i wondering if webprofiler has event can fire when query run, sql log in profiler? i think must implement datacollector .

jquery - fullPage.js anchor scroll chrome bug -

i'm working on site: http://hopscotch.laurent.devops.montenasoft.com when click on hamburger menu (top right) -> hopscotch congress or our values (only these 2 configured) should scroll second section , works on firefox not on chrome. there lot of js written in rush. of in http://hopscotch.laurent.devops.montenasoft.com/sites/all/themes/hopscotch/js/main.js i can copy part think relevant not sure causes bug. if can point peace of code he/she thinks can cause bug lot... part of js not written me try answer questions. ps it works on chrome when open new tab first 2 links. update the task create link page scrolls down section , changes slide specific slide. slide part working not scroll down part. you not using anchors links in menu specified in fullpage.js docs or examples . calling url: see difference: new url www.site.com/en?img=0#second anchor link www.site.com/#second fullpage.js works anchor links . the reason might work in ...

Readin .xlsx file into R -

im trying read excel file r. it's following file in cwd: > list.files() [1] "keuren_op_afspraak.xlsx" i installed xlconnect , doing following: library(xlconnect) demoexcelfile <- system.file("keuren_op_afspraak.xlsx", package = "xlconnect") wb <- loadworkbook(demoexcelfile) but gives me error: error: filenotfoundexception (java): file '' not found - may specify automatically create file if not existing. but dont understand coming from. thoughts? i prefer using readxl package. written in c faster. seems handle large files better. command be: library(readxl) wb <- read_excel("keuren_op_afspraak.xlsx")

Need to insert some html in a mail($email php generate email -

i insert html in email php file generate after form. here part of email: mail($email, "www.icecream-icecream.com", "thank message, within 24 hours receive dedicated email. bye", "from: info@...." ); where can read "thank message..." basic customize html. why? because want insert thai characters without html not send. thanks if know how it, anyway if don't know. new here. <?php $to = "somebody@example.com, somebodyelse@example.com"; $subject = "html email"; $message = "<html><head><title>html email</title></head><body><p></p></body></html>"; // set content-type when sending html email $headers = "mime-version: 1.0" . "\r\n"; $headers .= "content-type:text/html;charset=utf-8" . "\r\n"; // more headers $headers .= 'from: <webmaster@example.com>' . ...

python - Remove element from list without side-effect -

how remove specific index list without side-effect? is, using: l = [1,2,3,4] del l[2] is not alternative, still want keep l intact. there neater way doing deep copy , remove value there? slice list: l = [1,2,3,4] l[:2] + l[3:] [1, 2, 4]

google cloud messaging - GCM registration id in Service Worker in Push Notification for chrome -

i able send push notification , in service worker making service call want send gcm registration id service call. how registration id or subscription id in service worker here code self.addeventlistener('push', function(event) { console.log('received push message local', event); var title = 'my title file. testing on'; var body = 'new push message.'; var icon = 'refresh_blueicon.png'; var tag = 'my-push-tag'; event.waituntil( // here need wind gcm registration id / subscription id external service call fetch('http://localhost/pushmsg/push_notification/msg.php').then(function(response){ if (response.status !== 200) { console.log('looks there problem. status code: ' + response.status); throw new error(); } // examine text in response return response.json().then(function(data) { self.registration.shownotification(data.title, { body: d...

security - Spring Windows Authentication Sample fails to bind to LDAP -

we trying make spring windows authentication module working on sles 11 sp3 system. the user authentication seems work fine: 2015-07-08 08:32:02.596 debug 16861 --- [io-18080-exec-3] o.s.s.authentication.providermanager : authentication attempt using org.springframework.security.kerberos.authentication.kerberosserviceauthenticationprovider 2015-07-08 08:32:02.596 debug 16861 --- [io-18080-exec-3] .a.kerberosserviceauthenticationprovider : try validate kerberos token 2015-07-08 08:32:02.966 debug 16861 --- [io-18080-exec-3] .a.kerberosserviceauthenticationprovider : succesfully validated dummy@example.com 2015-07-08 08:32:02.967 debug 16861 --- [io-18080-exec-3] o.s.s.l.s.filterbasedldapusersearch : searching user 'dummy@example.com', user search [ searchfilter: '(| (userprincipalname={0}) (samaccountname={0}))', searchbase: 'ou=users,ou=custom,dc=example.com,dc=com', scope: subtree, searchtimelimit: 0, dereflinkflag: false ] debug true storeke...

java - Android fetch data from mySql -

Image
i have data mysql database on server. have following code.but app crashes when run it. permission denied (missing internet permission?) in logcat though specified internet permission in android manifest. idea might wrong here? java file import android.app.activity; import android.os.bundle; import android.os.strictmode; import android.util.log; import android.widget.arrayadapter; import android.widget.listview; import android.widget.textview; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.methods.httpget; import org.apache.http.impl.client.defaulthttpclient; import org.apache.http.util.entityutils; import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; import java.io.ioexception; import java.util.arraylist; import java.util.list; public class mainactivity extends activity { textview text; @override public void oncreate(bund...

android - Adding fab Button at the junction of two ViewPager widgets -

Image
i have implemented navigation drawer. in framelayout of navigation drawer have added fragment contains 2 viewpagers taking half screen each. want add fab button @ junction of these 2 viewpagers shown here. in case both viewpagers occupy half screen different shown in image. can me in getting fab @ junction. the code fragment containing 2 viewpagers below: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.view.viewpager xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/shirt_section" android:layout_weight="1" android:layout_width="match_parent" android:layout_height=...

c# - How do I copy the whole content of a pdf? -

helllo, i want transfer pdf c# program using .net 3.5. know, there libs that, not allowed use such. came idea copy content of pdf file manually , transform datatable. because want work automatically using code: process adope = new process(); adope.startinfo.filename = fd.filename.tostring(); adope.startinfo.arguments = fd.filename.tostring(); adope.start(); intptr adobe_handler = intptr.zero; while (elapsed_time.elapsedmilliseconds <= 5000) { adobe_handler = findwindow("acrobatsdiwindow", fd.safefilename + " - adobe reader"); if (adobe_handler != intptr.zero) { break; } system.threading.thread.sleep(200); } if (adobe_handler == intptr.zero) { messagebox.show("adobe not running"); return; } elapsed_time.stop(); clipboard.clear(); setforegroundwindow(adobe_handler); elapsed_time.start(); while (pdf_info.equals("")&&elapsed_time.elapsedmilliseconds<=10000) { clipboard...

objective c - Global key handler for SpriteKit Game -

Image
i have of key press code in various skscene classes. want happen every time key pressed. key needs re-triggered perform action again. i'm using boolean array keep track of this. may not optimal, it's thought of @ time. looking create class manage of this, key event methods keyup , keydown created in skscene classes. there global way handle keys presses don't have recreate code in every scene in game? you can subclass skview , perform key press handling in centralized location. approach has several benefits: 1. since key press logic in single class, changes logic made class instead of in of scenes , 2) removes device-specific input logic multiple scenes. if decide port app ios, example, can change interface keyboard/mouse touches in single file. the following implementation of key press handler in custom subclass of skview . uses protocol/delegate design pattern send key press messages various scenes. delegation convenient way object (in case class) communica...

c++ - bunch of errors and warnings while compiling in gcc linux -

this question has answer here: how compile without warnings being treated errors? 5 answers do { … } while (0) — for? [duplicate] 5 answers this piece of code used compiled no errors few months ago. lost vm image setup new linux vm latest gcc , libraries. these errors , warnings. in file included /opt/espressif/esp8266_sdk/include/ets_sys.h:12:0, include/espmissingincludes.h:4, driver/i2c.c:20: driver/i2c.c: in function 'i2c_init': /opt/espressif/esp8266_sdk/include/eagle_soc.h:247:94: error: suggest parentheses around arithmetic in operand of '|' [-werror=parentheses] #define pin_func_select(pin_name, func) {write_peri_reg(pin_name,read_peri_reg(pin_name) & (~(periphs_io_mux_func<<periphs_io_mux_func_s)) |( (((fun...

ruby - Find element which has no style -

in table, there rows this: <tr id="filtersjob_intrinsictable_row6" class="evenrow" style="display: none;">some stuff here<tr> <tr id="filtersjob_intrinsictable_row7" class="evenrow">some stuff here<tr> how use watir rows displayed, i.e rows not have style="display: none; ? you have number of ways of collecting elements without style attribute: using :css locator: browser.trs(css: 'tr:not([style])') using :xpath locator: browser.trs(xpath: '//tr[not(@style)]') you check attribute value: browser.trs.select { |tr| tr.attribute_value('style').nil? } note should cautious using style attribute indicator of row being displayed. add other unrelated style property , of tests fail. instead, suggest rows present: browser.trs.select(&:present?) i think makes purpose of code more obvious , readable.

forms - Switfmailer PHP script not working after switching hosting company -

i'm using swiftmailer website's contact form send form data via email when it's submitted. switched different hosting company , seemingly should same, no longer works. i'm not getting error messages. status 200 ok when clicking "submit." deleted , re-created email account, didn't help. changed smtp authentication information new hosting comopany's server, still no email sent. ideas? oh, , switched bluehost a2 hosting. in advance. andrew 1). check spam folder 2). ensure sendmail installed 3). if reaching spam, allow server ip in dns spf record

jsp - online users list using servletContextListener -

i new web programming here don't have idea listing online users in servlet using servlet context listener stuck implement this. has have answer please let me know example. in advance. i give general path, because detailed answer code long. you should : keep hash of logged in users (sessionid : user) in servlet context attribute - sure initialize empty hash in servletcontextlistener (contextinitialized event) add entries in module processes login remove entries httpsessionlistener (sessiondestroyed event) just glue in application , should ...

linux - cronjob : No space left on device -

i have attached new volume ec2 instance. volume attached successfully.below output of command. df -h filesystem size used avail use% mounted on /dev/xvda1 32g 8.1g 22g 27% / none 4.0k 0 4.0k 0% /sys/fs/cgroup udev 2.0g 12k 2.0g 1% /dev tmpfs 396m 340k 395m 1% /run none 5.0m 0 5.0m 0% /run/lock none 2.0g 0 2.0g 0% /run/shm none 100m 0 100m 0% /run/user overflow 1.0m 1.0m 0 100% /tmp when tried add new cronjob shows error there no space left. sudo crontab -e /tmp/crontab.jvoowt/crontab: no space left on device your /tmp directory full, first remove files temp directory issuing command below rm -rf /tmp/* run crontab again sudo crontab -e

security - Amazon S3: How to restrict bucket access to anything other than my Android mobile App -

i have amazon s3 bucket containing mp3 music files, files "public_read" accessible, bucket policy allowing everyhting read. the music should accessible streaming website along mobile app. for streaming within website, use cloudfront rtmp, can restrict bucket access bucket accessible through rtmp distribution, , can restrict buckt access http reffrer (my website), way, music not reachable mobile app (http straming), tried spoofing "referer" header in mobile app, did not work. i know how grant access files website , mobile app , deny else. (for website think rtmp or referer solution job) if above not possible, there solution rtmp streaming android/ios ?

android - How to solve error while implementing Sign in with Google Plus and Facebook in an activity? -

here, i'm integrating sign in facebook , g+ in project working fine if integrate each in individual activities if integrate both of them in same activity start getting error in code of g+. more i'm going paste code , error. loginactivity i'm integrating both of them is public class loginactivity extends activity implements onclicklistener, connectioncallbacks, onconnectionfailedlistener { // facebook app id private static string app_id = "xxxxxxxxxxxxxxx"; // replace app // id linearlayout ll; // strings of facebook string fb_muserid = "", fb_musertoken = "", fb_musername = "", fb_museremail = "", fb_verified_value = "", fb_task_message; boolean fb_verified, google_verified; // instance of facebook class private facebook facebook = new facebook(app_id); @suppresswarnings("unused") private asyncfacebookrunner masyncrunner; string filena...