Posts

ios - Observer being added after postNotification ONLY on iPhone 4S -

i have functional code works on ios >8.0 iphones >5 , ipads, pass information , call function via observers/notifications, on iphone 4s doesn't work. through debugging, found out only while running on iphone 4s observer gets added after notification gets posted. this happening on devices , on simulator, on ios 8 , 9, respectively. code: **postnotification** override func viewdidload() { super.viewdidload() self.registercells() uiapplication.sharedapplication().statusbarstyle = .lightcontent self.collectionview.delayscontenttouches = false nsnotificationcenter.defaultcenter().addobserver(self, selector: "footerupdatecontentsize:", name: "footerupdatecontentsize", object: nil) nsnotificationcenter.defaultcenter().addobserver(self, selector: "seasonupdatecontentsize:", name: "seasonupdatecontentsize", object: nil) self.loaddetailtvshow() } func registercells() { self.collectionview.regist...

printwriter - I keep only getting these compiling answers in 3 methods. JAVA -

please ignore sloppy coding. i'm pretty new java , trying project school. can't find causing error decrossdiscipline.java:455: error: unreported exception filenotfoundexception; must caught or declared thrown printwriter outputfile = new printwriter(filename); ^ decrossdiscipline.java:533: error: unreported exception filenotfoundexception; must caught or declared thrown printwriter outputfile = new printwriter(filename); ^ decrossdiscipline.java:623: error: unreported exception filenotfoundexception; must caught or declared thrown printwriter outputfile = new printwriter(filename); ^ 3 errors this program getting errors in. please help. feel need pair of eyes spot problem me. import java.util.scanner; import java.io.*; public class decrossdiscipline { public static void main(string[] args) throws ioexception { scann...

bash - Need a script to split a large file by month that can determine year based off order of the logs -

i need split large syslog file goes october 2015 february 2016 , separated month. due background log retention, format of these logs similar to: oct 21 08:00:00 - log info nov 16 08:00:00 - log info dec 25 08:00:00 - log info jan 11 08:00:00 - log info feb 16 08:00:00 - log info this large file result of initial zgrep search across large amount of log files split day. example being, user activity on network across multiple services such windows/firewall/physical access logs. for previous request, used following: gawk 'begin{ m=split("jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec",mth,"|") } { for(i=1;i<=m;i++){ if ( mth[i]==$1){ month = } } tt="2015 "month" "$2" 00 00 00" date= strftime("%y%m",mktime(tt)) print $0 > filename"."date".txt" } ' logfile output file examples (note add "%d" day not time: test.201503.txt test.201504.txt test.201505.txt test.2015...

PHP "include" fails (redux) -

sorry "php include" chapter searching on gives 90,000 entries , feel i've read 1/2 of 'em. i'm resurrecting web page wrote 9 years ago on win 2000 pro. since i've ported ubuntu 10.0, windows 7 , published online through 2 different hosting sites. i'm on ubuntu 14.04 , cannot php "include" command work. code follows: <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> <html> <head> <title>main menu movietime.php</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> </head> <?php error_reporting(e_all);?> <body background="wood.gif"> <form method="post"> <input type="hidden" name="hiddenn" value="hide & "> <hidden name="hidden" value="well hid"> </form> <?php include dirname(__file__).'menu.php'; ?> ...

javascript - AngularJS provider not working as per styleguide -

i'm following john papa's angular1 styleguide , trying implement provider. the provider per document looks this, angular .module('blocks.router') .provider('routerhelper', routerhelperprovider); routerhelperprovider.$inject = ['$locationprovider', '$stateprovider', '$urlrouterprovider']; /* @nginject */ function routerhelperprovider($locationprovider, $stateprovider, $urlrouterprovider) { /* jshint validthis:true */ this.$get = routerhelper; $locationprovider.html5mode(true); routerhelper.$inject = ['$state']; /* @nginject */ function routerhelper($state) { var hasotherwise = false; var service = { configurestates: configurestates, getstates: getstates }; return service; /////////////// function configurestates(states, otherwisepath) { states.foreach(function(state) { $stateprovider.st...

Android Button always takes two clicks to fire onClick() -

i have relativelayout inside of scrollview contains button , textviews , edittexts. in xml layout file, defining android:onclick takes 2 clicks of button fire event. button gets focus on first click , fires onclick event on second click. have tried setting focusable , focusableintouchmode both false behavior doesn't change. here layout file: <scrollview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" tools:context=".densityactivity" > <relativelayout android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview ... <textview ... <textview ... <edittext ....

android - Recyclerview only load Image when itemview is shown -

i load images in itemviews of recyclerview if itemview shown. tried in adapter far: if (holder.itemview.isshown()) { log.e("shown", "yes " + position); } if (holder.itemview.isfocused()) { log.e("focused", "yes " + position); } if (holder.itemview.hasfocus()) { log.e("hasfocus", "yes " + position); } and tried in fragment add onscrolllistener recylcerview: recyclerviewsearchgif.addonscrolllistener(new recyclerview.onscrolllistener() { @override public void onscrolled(recyclerview recyclerview, int dx, int dy) { super.onscrolled(recyclerview, dx, dy); } @override public void onscrollstatechanged(recyclerview recyclerview, int newstate) { super.onscrollstatechanged(recyclerview, newstate); } }); but don't know how use case. su...