tweet_data (5) Pos1459@Blackberry & @Facebook U R really about to make me throw this @Blackberry in the trash an get an @Apple iPhone! @Facebook upload issues! Neg2228Pissed with whoever designs...

1 answer below »
Create a java program


tweet_data (5) Pos1459@Blackberry & @Facebook U R really about to make me throw this @Blackberry in the trash an get an @Apple iPhone! @Facebook upload issues! Neg2228Pissed with whoever designs keyboards with @apple for not having a home and end key. working on the CLI i use those keys often Pos1400My iPhone 4S battery lasted longer than a day. That hasn't happened since my edge iPhone. Nice job @apple. Neg18189% now on my second full charge of the day. Pissed @Apple Neg1652Correction: @ Best Buy kudos to Chris @ Alamo Ranch S.A. TX-fixed issues couldn't resolve after 1/2 day w/ @ATT & @Apple. Hero of my day! Neg2354Damn you @apple for breaking wififofum! It continued to work in ios 4. Was one of my most used apps. Damn Apple's overbearing policies! Pos1283RT @MN2NOVA: Love ios5 Easter eggs. Pull down from middle top to bottom and see what pulls down. Awesome little feature! #ios5 @apple Pos1137Lmfao look at the argument I had with Siri !!@ijustine @apple http://t.co/D4VjL7SI Neg1546good article about why @apple fucked it all up with lion and their future. http://t.co/zNDP9Vr6 #fb Pos1270Been off twitter for a few days as I smashed my iPhone but @apple were very nice and gave me a new one :) Pos1095We're one of a few Featured Education Apps on the @Apple **Website** today sweet! http://t.co/0yWvbe1Z Neg1952RT @CBM: Lies @apple. the battery on this new iPhone4S is definitely not any better. Neg2427@apple thanks apple for ios 5 and losing all my contacts! Neg1612removing all @apple shit. Pos1039Lmao I think @apple is onto something magical! I am DYING!!! haha. Siri suggested where to find whores and where to hide a body lolol Neg2457Also @EricGreenspan don't forget @Apple stop closing the app store after each bloody purchase... Pos1145Save me from #HP's unwanted OS! Help me buy an #iPhone! I have seen the light! #lol http://t.co/8gUP9Acz #backchannel @apple Pos1015I just realized that the reason I got into twitter was ios5 thanks @apple Neg2141@apple why don't you guys test your upgrades before you put them out. 15 1/2 hrs u guys wasted of my time yesterday. Thanks. Neg1644Total chaos at @apple store regent street. Like an Ethiopian feeding station. Can't believe this is same co. that makes all that cool shit. Neg1661@APPLE Wow @MOTOROLA Just crushed your dreams.... Neg1559@paulens It surprises me that @Apple throws up an error alert about authorizing and there's no Authorize this computer button. Neg2386@hbogo @apple - why don't you play nice and let me use HDMI from iPad? Pretty lame. Pos1063Thank you @apple for Find My Mac - just located and wiped my stolen Air. #smallvictory #thievingbastards Pos1008Hilarious @youtube video - guy does a duet with @apple 's Siri. Pretty much sums up the love affair! http://t.co/8ExbnQjY Pos1012@RIM you made it too easy for me to switch to @Apple iPhone. See ya! Neg1758Only thing bad about the new @canon camera is that it has two compact flash cards... not one of SD. SD goes in my @apple computer. Damn you! Pos1394Impressive service @apple genius bar metro centre. Power cable replaced free n booked in for screen replacement for free :- D Pos1252Sorry @BlackBerry I'm moving to @Apple. Neg2366By far the worst experience upgrading out of any version of iOS @apple #iOS5 Neg2304If @apple doesn't fix iOS5 this week I'm buying a droid #emptythreats Pos1241Yessss! I'm lovin the iPhone update especially the slide down bar at top of screen =) good job @Apple. Pos1463#iOS5 update submitted to @apple! Thanks for all the support! Neg2165Having major battery drain issue since updating iPhone 4 to iOS 5. Anyone else? @AppStore @iPhone @apple Neg2090@Apple - why do I have to have apps I am updating in their original 'folder' location? That was painful. Pos1188@apple loving the new IOS5 upgrade for the iPhone! Neg1965Ok Hindi keyboard in #iOS5 is something to cheer about. But @apple what about support for 20+ missing Indian languages!? #FAIL Pos1021The 16 strangest things Siri has said so far. I am SOOO glad that @Apple gave Siri a sense of humor! http://t.co/TWAeUDBp via @HappyPlace Neg2300RT @MikeFerri: If @apple doesn't fix iOS5 this week I'm buying a droid #emptythreats Neg2318The new iOS5 completely failed at upgrading the phone. Now I'm stuck in this restore loop. Thanks @apple for wasting my day. Can i undo? Neg1846@apple u guys are gay Neg2126but seriously @apple finance me a damn phone you greedy bastards! OR Santa...get your jolly ass in gear and get us a 4S - white plz Pos1386I <3 @apple="" http://t.co/ondxwper="" pos="" 1361="" thank="" you="" @apple="" for="" your="" innovations.="" exhibit="" a:="" guy="" playing="" with="" facetime="" instead="" of="" watching="" game="" at="" sports="" bar.="" http://t.co/ou7k39ge="" neg="" 2334="" ok="" @itunesmusic="" idk="" wth="" is="" up="" but="" after="" syncing="" my="" phone="" my="" album="" art="" is="" out="" of="" order!="" wtf="" @apple!="" neg="" 1834="" i="" update="" to="" ios="" 5="" and="" lose="" everything="" on="" my="" phone="" and="" it="" wont="" let="" me="" sign="" into="" my="" itunes="" account...="" thanks="" @apple="" neg="" 2142="" what="" is="" going="" on="" with="" all="" my="" @apple="" products?!="" first="" my="" #ipad="" freezes="" (still="" is="" frozen)="" and="" then="" my="" #iphone="" won't="" turn="" on!!!="" #techietroubles="" neg="" 1815="" i="" know="" a="" few="" others="" having="" same="" issue="" rt="" @joelplane:="" 9%="" now="" on="" my="" second="" full="" charge="" of="" the="" day.="" pissed="" @apple="" neg="" 2453="" well="" @apple="" seems="" 2b="" screwing="" #iphone="" 4s="" resellars.="" they="" still="" dont="" have="" 4s.="" yet="" were="" promised.="" similar="" 2="" ma="" bell's="" monopolistic="" prctices?="" neg="" 1937="" @carlton858:="" i="" really="" hate="" dealing="" with="" the="" brain="" dead="" people="" at="" the="" @apple="" store.="" for="" such="" good="" products="" customer="" service="" sucks.="" in="" nz?="" neg="" 2494="" #siri="" went="" down="" for="" a="" little="" while="" last="" night.="" come="" on="" @apple!="" get="" your="" shit="" together="" on="" this="" launch!="" pos="" 1036="" rt="" @jamaicanidler:="" lmao="" i="" think="" @apple="" is="" onto="" something="" magical!="" i="" am="" dying!!!="" haha.="" siri="" suggested="" where="" to="" find="" whores="" and="" where="" to="" h="" ...="" neg="" 2080="" @apple="" would="" do="" better="" to="" inform="" customers="" properly="" about="" migrating="" to="" #icloud="" -="" many="" complaints="" lead="" to="" #image="" damage="" http://t.co/ql7zmppo="" neg="" 1905="" @apple="" i="" committed="" to="" your="" cloud="" storage="" idisk="" and="" now="" it's="" raining="" :-(="" so="" soon="" no="" more="" idisk.="" any="" plans="" for="" a="" new="" service="" for="" storage?="" pos="" 1185="" #icloud="" set="" up="" was="" flawless="" and="" works="" like="" a="" champ!="" to="" the="" cloud="" @apple="" pos="" 1324="" i="" love="" this.="" so="" much.="" thank="" you="" @apple.="" http://t.co/ui8loezx="" neg="" 1894="" what="" was="" @apple="" thinking="" making="" #siri="" totally="" dependent="" on="" a="" network="" connection?="" siri="" +="" @att="utter" frustration.="" neg="" 1721="" @apple="" $319="" to="" repair="" my="" ipad="" 2="" apple="" you've="" lost="" me="" and="" my="" $700="" a="" year="" android="" here="" i="" come!="" pos="" 1130="" @bkad5161="" than="" apologize="" to="" @apple="" ;)="" pos="" 1370="" thank="" you="" steve="" @apple="" store="" 5th="" av.="" http://t.co/nsaisrip="" neg="" 2407="" @amandbrar="" @apple="" siri="" has="" worked="" for="" me="" less="" than="" 10%="" of="" the="" time.="" if="" service="" doesn't="" improve="" by="" monday="" i'm="" returning="" my="" iphone="" 4s.="" pos="" 1318="" @stevejobs="" being="" honored="" tonite="" @apple...a="" truly="" great="" loss="" to="" the="" world.he="" will="" so="" be="" missed="" neg="" 2244="" so="" glad="" that="" i="" paid="" $69="" for="" this="" @apple="" care="" protection="" plan.="" been="" on="" hold="" for="" over="" 20="" minutes="" now.="" great="" customer="" service.="" #not="" neg="" 1984="" @philipgrey:="" dear="" @apple="" why="" you="" gotta="" go="" change="" the="">

is handled out of the blue? Neg1604So apparently @apple put MB cap on your SMS with the new update. 25mb storage before it tells you your inbox is full. What is this 2001? Neg2376Never purchasing another item from @apple. Pos1309@alexlindsay My wife upgraded her iPhone 4. I think Siri alone is worth the upgrade. Looking forward to @Apple continuing to enhance Siri. Pos1047Just registered as an @apple developer... Here's hoping I can actually do it... Any help greatly appreciated! Pos1105<3 #ios5 @apple neg1543@apple airdrop #fail - immediate declined your request. every time neg1593dear @apple my new air is now a notbook since your update killed #wifi #bug #destroying #productivity pos1215so yeah... @apple #ios5 #readinglists have changed my life. #nowicanspendevenmoretimeonmyphone. pos1141incredible: 4 million iphone 4ss in 3 days. 135% better than the iphone 4 http://t.co/1fmjxtmm @apple #iphone4s neg2348asked #siri where's baby lisa? and was told sorry i'm having trouble connecting to the network right now. @apple server fail. #ios5 neg2492houston we have a problem!! my ipad has been restoring for 12+ hours after installing @apple ios5. this can't be right.... neg1657@phxguy88 @apple @bgr that's why all the ppl who stand in line for hrs to get the newest model are suckers... neg2314after a week or so with @apple's #ios5 i'm considering going back to #jailbroken 4.2 - same features as 5 plus more. not as stable though. neg2202rt @jdougyj: hey @apple do you wanna fix my fucking playlist order you piece of shit neg1678@apple on the #ipad with #ios5 why has the messages icon been included when it can't be used? neg1709@apple #ios5 gm on ipad1 is very slow wash better on beta7/8 solve this problem or give me the ipad2 neg1928dear @apple: why did all my pdfs and epub files disappear from ibooks in my iphone post ios5 upgrade? this hurts. #3gs #needsomethingtoread neg1648@fishmama: if you made a purchase just wait for the @apple survey! hate going b/c of the bad #custserv neg1567oh @apple. steve obviously had nothing to do with iphoto as it's the perfect opposite of 'insanely great'. get it fixed please. neg1909hey @apple why can't i share a reminder list from my iphone?also why can't i login to the icloud webpage to modify sharing from my phone? neg2471@apple #siri can't connect to the network -- it's less useful that voicecontrol now... :( neg2005@apple: multiple times siri is having trouble connecting to the network. siri needs servers (and some exercise!) neg1868@chascouponmom @apple i get they are busy w/ the new phone but i just wanted to buy a stylus. they made me wait forever outside & never pos1306loving the new ipod update @apple neg1754hey @apple: stop sending your automatically-depreciate-all-iphones-older-than-the-4s signal. my #iphone4 is dying rapidly processor-wise. neg1600@apple thank you for ruining my 3gs with #ios5. you've just turned my phone into an utterly useless pile of shit. neg1766why the fuck dose my phone decide its just ganna freeze every time i try to update it so fucking sick of @apple neg2392and only the first 23 images in my photo roll made it over? seriously @apple how did you fuck this up so much? pos1227#10twitterpeopleiwouldliketomeet @coollike @thegadgetshow @thelittleappkid @jon4lakers @benrubery @apple @twitter @fxhomehitfilm (-2) neg2255@robert_terpstra no worries bud ps: they're saying that the 4s is having a lot of network issues right now. (i'm @apple for mac problems) neg1829itunes is @apple's worst product. worse than the #newton or the hockey puck mouse. it's utterly painful to use. neg1881hey @apple the sms full message is complete shit. yes i'm annoyed. pos1292updated my ios and started using cloud services. pretty bad ass @apple my #iphone 3gs still the champ. neg2286i sure as hell better be able to restore my calendar events. terrible bug apple! @apple #icloud #anothericloudfail pos1465awesome service from the @apple store in pc. thanks chris! neg2061spoke to an @apple rep on phone & could hear her tv blaring in the bg. she said i can't actually help u just direct u back to the web neg2128pondering the ios update... from the sounds of @mikeferri's difficulties i may just hold off :/ @apple fix it! neg2483dear @apple one day you're going to release a version of itunes that doesn't freeze more often #ios5="" @apple="" neg="" 1543="" @apple="" airdrop="" #fail="" -="" immediate="" declined="" your="" request.="" every="" time="" neg="" 1593="" dear="" @apple="" my="" new="" air="" is="" now="" a="" notbook="" since="" your="" update="" killed="" #wifi="" #bug="" #destroying="" #productivity="" pos="" 1215="" so="" yeah...="" @apple="" #ios5="" #readinglists="" have="" changed="" my="" life.="" #nowicanspendevenmoretimeonmyphone.="" pos="" 1141="" incredible:="" 4="" million="" iphone="" 4ss="" in="" 3="" days.="" 135%="" better="" than="" the="" iphone="" 4="" http://t.co/1fmjxtmm="" @apple="" #iphone4s="" neg="" 2348="" asked="" #siri="" where's="" baby="" lisa?="" and="" was="" told="" sorry="" i'm="" having="" trouble="" connecting="" to="" the="" network="" right="" now.="" @apple="" server="" fail.="" #ios5="" neg="" 2492="" houston="" we="" have="" a="" problem!!="" my="" ipad="" has="" been="" restoring="" for="" 12+="" hours="" after="" installing="" @apple="" ios5.="" this="" can't="" be="" right....="" neg="" 1657="" @phxguy88="" @apple="" @bgr="" that's="" why="" all="" the="" ppl="" who="" stand="" in="" line="" for="" hrs="" to="" get="" the="" newest="" model="" are="" suckers...="" neg="" 2314="" after="" a="" week="" or="" so="" with="" @apple's="" #ios5="" i'm="" considering="" going="" back="" to="" #jailbroken="" 4.2="" -="" same="" features="" as="" 5="" plus="" more.="" not="" as="" stable="" though.="" neg="" 2202="" rt="" @jdougyj:="" hey="" @apple="" do="" you="" wanna="" fix="" my="" fucking="" playlist="" order="" you="" piece="" of="" shit="" neg="" 1678="" @apple="" on="" the="" #ipad="" with="" #ios5="" why="" has="" the="" messages="" icon="" been="" included="" when="" it="" can't="" be="" used?="" neg="" 1709="" @apple="" #ios5="" gm="" on="" ipad1="" is="" very="" slow="" wash="" better="" on="" beta7/8="" solve="" this="" problem="" or="" give="" me="" the="" ipad2="" neg="" 1928="" dear="" @apple:="" why="" did="" all="" my="" pdfs="" and="" epub="" files="" disappear="" from="" ibooks="" in="" my="" iphone="" post="" ios5="" upgrade?="" this="" hurts.="" #3gs="" #needsomethingtoread="" neg="" 1648="" @fishmama:="" if="" you="" made="" a="" purchase="" just="" wait="" for="" the="" @apple="" survey!="" hate="" going="" b/c="" of="" the="" bad="" #custserv="" neg="" 1567="" oh="" @apple.="" steve="" obviously="" had="" nothing="" to="" do="" with="" iphoto="" as="" it's="" the="" perfect="" opposite="" of="" 'insanely="" great'.="" get="" it="" fixed="" please.="" neg="" 1909="" hey="" @apple="" why="" can't="" i="" share="" a="" reminder="" list="" from="" my="" iphone?also="" why="" can't="" i="" login="" to="" the="" icloud="" webpage="" to="" modify="" sharing="" from="" my="" phone?="" neg="" 2471="" @apple="" #siri="" can't="" connect="" to="" the="" network="" --="" it's="" less="" useful="" that="" voicecontrol="" now...="" :(="" neg="" 2005="" @apple:="" multiple="" times="" siri="" is="" having="" trouble="" connecting="" to="" the="" network.="" siri="" needs="" servers="" (and="" some="" exercise!)="" neg="" 1868="" @chascouponmom="" @apple="" i="" get="" they="" are="" busy="" w/="" the="" new="" phone="" but="" i="" just="" wanted="" to="" buy="" a="" stylus.="" they="" made="" me="" wait="" forever="" outside="" &="" never="" pos="" 1306="" loving="" the="" new="" ipod="" update="" @apple="" neg="" 1754="" hey="" @apple:="" stop="" sending="" your="" automatically-depreciate-all-iphones-older-than-the-4s="" signal.="" my="" #iphone4="" is="" dying="" rapidly="" processor-wise.="" neg="" 1600="" @apple="" thank="" you="" for="" ruining="" my="" 3gs="" with="" #ios5.="" you've="" just="" turned="" my="" phone="" into="" an="" utterly="" useless="" pile="" of="" shit.="" neg="" 1766="" why="" the="" fuck="" dose="" my="" phone="" decide="" its="" just="" ganna="" freeze="" every="" time="" i="" try="" to="" update="" it="" so="" fucking="" sick="" of="" @apple="" neg="" 2392="" and="" only="" the="" first="" 23="" images="" in="" my="" photo="" roll="" made="" it="" over?="" seriously="" @apple="" how="" did="" you="" fuck="" this="" up="" so="" much?="" pos="" 1227="" #10twitterpeopleiwouldliketomeet="" @coollike="" @thegadgetshow="" @thelittleappkid="" @jon4lakers="" @benrubery="" @apple="" @twitter="" @fxhomehitfilm="" (-2)="" neg="" 2255="" @robert_terpstra="" no="" worries="" bud="" ps:="" they're="" saying="" that="" the="" 4s="" is="" having="" a="" lot="" of="" network="" issues="" right="" now.="" (i'm="" @apple="" for="" mac="" problems)="" neg="" 1829="" itunes="" is="" @apple's="" worst="" product.="" worse="" than="" the="" #newton="" or="" the="" hockey="" puck="" mouse.="" it's="" utterly="" painful="" to="" use.="" neg="" 1881="" hey="" @apple="" the="" sms="" full="" message="" is="" complete="" shit.="" yes="" i'm="" annoyed.="" pos="" 1292="" updated="" my="" ios="" and="" started="" using="" cloud="" services.="" pretty="" bad="" ass="" @apple="" my="" #iphone="" 3gs="" still="" the="" champ.="" neg="" 2286="" i="" sure="" as="" hell="" better="" be="" able="" to="" restore="" my="" calendar="" events.="" terrible="" bug="" apple!="" @apple="" #icloud="" #anothericloudfail="" pos="" 1465="" awesome="" service="" from="" the="" @apple="" store="" in="" pc.="" thanks="" chris!="" neg="" 2061="" spoke="" to="" an="" @apple="" rep="" on="" phone="" &="" could="" hear="" her="" tv="" blaring="" in="" the="" bg.="" she="" said="" i="" can't="" actually="" help="" u="" just="" direct="" u="" back="" to="" the="" web="" neg="" 2128="" pondering="" the="" ios="" update...="" from="" the="" sounds="" of="" @mikeferri's="" difficulties="" i="" may="" just="" hold="" off="" :/="" @apple="" fix="" it!="" neg="" 2483="" dear="" @apple="" one="" day="" you're="" going="" to="" release="" a="" version="" of="" itunes="" that="" doesn't="" freeze="" more="">
Answered Same DayFeb 08, 2021

Answer To: tweet_data (5) Pos1459@Blackberry & @Facebook U R really about to make me throw this @Blackberry...

Valupadasu answered on Feb 09 2021
149 Votes
console output.png
Main.java
Main.java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Objects;
public class Main {

    public static void printHead(ArrayList list,int n) {
        for(int idx = 0 ; idx < n ; idx++) {
            System.out.println(list.get(idx).toString());
        }
    }

    public static void printHead(Tweet[] list,int n) {
        for(int idx = 0 ; idx < n ; idx++) {
            System.out.println(list[idx].toString());
        }
    }

    public static void prinTail(ArrayList list,int n) {
        for(int idx = list.size() ; idx > list.size() - n ; idx--) {
            System.out.println(list.get(idx-1).toString());
        }
    }

    public static void prinTail(Tweet[] list,int n) {

         list = Arrays.stream(list).filter(Objects::nonNull).toArray(Tweet[]::new);   // since we created array dynamically , end of array we have have some null values so removed those

        for(int idx = list.length ; idx > list.length - n ; idx--) {
            System.out.println(list[idx-1].toString());
        }
    }

    public static void main(String[] args) {

        String fileName = "tweets_data.csv";

        int tweetCnt = 5; // used to print first and last n tweets from tweets array and array lists

        ArrayList tweetList = TweetLoader.loadAsArrayList(fileName);

        Tweet[] tweetArr = TweetLoader.loadAsArray(fileName);

        System.out.println("First "+tweetCnt +" tweets using array");
        System.out.println("================================================");
        printHead(tweetArr,tweetCnt);

        System.out.println();
      System.out.println("First "+tweetCnt +" tweets using array list");
        System.out.println("================================================");
        printHead(tweetList,tweetCnt);

        System.out.println();
        System.out.println("Last "+tweetCnt +" tweets using array list");
        System.out.println("================================================");
        prinTail(tweetList,tweetCnt);

        System.out.println();
        System.out.println("Last "+tweetCnt +" tweets using array");
        System.out.println("================================================");
        prinTail(tweetArr,tweetCnt);



    }
}
Tweet.java
Tweet.java
public class Tweet {

    private int uniqueId;
    private String segmentCategory;
    private String text;

    public int getUniqueId() {
        return uniqueId;
    }
    public void setUniqueId(int uniqueId) {
        this.uniqueId = uniqueId;
    }
    public String getSegmentCategory() {
        return segmentCategory;
    }
    public void setSegmentCategory(String segmentCategory) {
        this.segmentCategory = segmentCategory;
    }
    public String getText() {
        return text;
    }
    public void setText(String text) {
        this.text = text;
    }

    public Tweet(int uniqueId, String segmentCategory, String text) {
        this.uniqueId = uniqueId;
        this.segmentCategory = segmentCategory;
        this.text = text;
    }

    public String toString() {
        return this.uniqueId +" ("+this.segmentCategory+") : "+this.text;
    }
}
TweetLoader.java
TweetLoader.java
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
public class TweetLoader {
    public static ArrayList loadAsArrayList(String fileName) {
        ArrayList tweetsData = new ArrayList<>();
        BufferedReader csvReader = null;
        try {
            csvReader = new BufferedReader(new FileReader("src/" + fileName));
            String row = null;
            Tweet tweet = null;
            while ((row = csvReader.readLine()) != null && !"".equals(row)) {
                String tempStr[] = row.split("\\,");
                tweet = new Tweet(Integer.parseInt(tempStr[1].trim()), tempStr[0].trim(), tempStr[2].trim());
                tweetsData.add(tweet);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (NumberFormatException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally{
            try {
                csvReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return tweetsData;
    }
    public static Tweet[] loadAsArray(String fileName) {
        int arraySize = 10;
        Tweet[] tweetsData = new Tweet[arraySize];
        BufferedReader csvReader = null;
        int indexPos = 0;
        try {
            csvReader = new BufferedReader(new FileReader("src/" + fileName));
            String row = null;
            Tweet tweet = null;
            while ((row = csvReader.readLine()) != null && !"".equals(row)) {
 
                if (tweetsData.length == indexPos) { 
                    tweetsData = Arrays.copyOf(tweetsData,tweetsData.length*2); // doubling the array size
                }
 
                String tempStr[] = row.split("\\,");
                tweet = new Tweet(Integer.parseInt(tempStr[1].trim()), tempStr[0].trim(), tempStr[2].trim());
                tweetsData[indexPos] = tweet;
                indexPos++;
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (NumberFormatException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally{
            try {
                csvReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return tweetsData;
    }
}
tweets_data.csv
Pos,1459,@Blackberry & @Facebook U R really about to make me throw this @Blackberry in the trash an get an @Apple iPhone! @Facebook upload issues!
Neg,2228,Pissed with whoever designs keyboards with @apple for not having a home and end key. working on the CLI i use those keys often
Pos,1400,My iPhone 4S battery lasted longer than a day. That hasn't happened since my edge iPhone. Nice job @apple.
Neg,1818,9% now on my second full charge of the day. Pissed @Apple
Neg,1652,Correction: @ Best Buy kudos to Chris @ Alamo Ranch S.A. TX-fixed issues couldn't resolve after 1/2 day w/ @ATT & @Apple. Hero of my day!
Neg,2354,Damn you @apple for breaking wififofum! It continued to work in ios 4. Was one of my most used apps. Damn Apple's overbearing policies!
Pos,1283,RT @MN2NOVA: Love ios5 Easter eggs. Pull down from middle top to bottom and see what pulls down. Awesome little feature! #ios5 @apple
Pos,1137,Lmfao look at the argument I had with Siri !!@ijustine @apple http://t.co/D4VjL7SI
Neg,1546,good article about why @apple fucked it all up with lion and their future. http://t.co/zNDP9Vr6 #fb
Pos,1270,Been off twitter for a few days as I smashed my iPhone but @apple were very nice and gave me a new one :)
Pos,1095,We're one of a few Featured Education Apps on the @Apple **Website** today sweet! http://t.co/0yWvbe1Z
Neg,1952,RT @CBM: Lies @apple. the battery on this new iPhone4S is definitely not any better.
Neg,2427,@apple thanks apple for ios 5 and losing all my contacts!
Neg,1612,removing all @apple shit.
Pos,1039,Lmao I think @apple is onto something magical! I am DYING!!! haha. Siri suggested where to find whores and where to hide a body lolol
Neg,2457,Also @EricGreenspan don't forget @Apple stop closing the app store after each bloody purchase...
Pos,1145,Save me from #HP's unwanted OS! Help me buy an #iPhone! I have seen the light! #lol http://t.co/8gUP9Acz #backchannel @apple
Pos,1015,I just realized that the reason I got into twitter was ios5 thanks @apple
Neg,2141,@apple why don't you guys test your upgrades before you put them out. 15 1/2 hrs u guys wasted of my time yesterday. Thanks.
Neg,1644,Total chaos at @apple store regent street. Like an Ethiopian feeding station. Can't believe this is same co. that makes all that cool shit.
Neg,1661,@APPLE Wow @MOTOROLA Just crushed your dreams....
Neg,1559,@paulens It surprises me that @Apple throws up an error alert about authorizing and there's no Authorize this computer button.
Neg,2386,@hbogo @apple - why don't you play nice and let me use HDMI from iPad? Pretty lame.
Pos,1063,Thank you @apple for Find My Mac - just located and wiped my stolen Air. #smallvictory #thievingbastards
Pos,1008,Hilarious @youtube video - guy does a duet with @apple 's Siri. Pretty much sums up the love affair! http://t.co/8ExbnQjY
Pos,1012,@RIM you made it too easy for me to switch to @Apple iPhone. See ya!
Neg,1758,Only thing bad about the new @canon camera is that it has two compact flash cards... not one of SD. SD goes in my @apple computer. Damn you!
Pos,1394,Impressive service @apple genius bar metro centre. Power cable replaced free n booked in for screen replacement for free :- D
Pos,1252,Sorry @BlackBerry I'm moving to @Apple.
Neg,2366,By far the worst experience upgrading out of any version of iOS @apple #iOS5
Neg,2304,If @apple doesn't fix iOS5 this week I'm buying a droid #emptythreats
Pos,1241,Yessss! I'm lovin the iPhone update especially the slide down bar at top of screen =) good job @Apple.
Pos,1463,#iOS5 update submitted to @apple! Thanks for all the support!
Neg,2165,Having major battery drain issue since updating iPhone 4 to iOS 5. Anyone else? @AppStore @iPhone @apple
Neg,2090,@Apple - why do I have to have apps I am updating in their original 'folder' location? That was painful.
Pos,1188,@apple loving the new IOS5 upgrade for the iPhone!
Neg,1965,Ok Hindi keyboard in #iOS5 is something to cheer about. But @apple what about support for 20+ missing Indian languages!? #FAIL
Pos,1021,The 16 strangest things Siri has said so far. I am SOOO glad that @Apple gave Siri a sense of humor! http://t.co/TWAeUDBp via @HappyPlace
Neg,2300,RT @MikeFerri: If @apple doesn't fix iOS5 this week I'm buying a droid #emptythreats
Neg,2318,The new iOS5 completely failed at upgrading the phone. Now I'm stuck in this restore loop. Thanks @apple for wasting my day. Can i undo?
Neg,1846,@apple u guys are gay
Neg,2126,but seriously @apple finance me a damn phone you greedy bastards! OR Santa...get your jolly ass in gear and get us a 4S - white plz
Pos,1386,I <3 @apple http://t.co/ondXWpEr
Pos,1361,Thank you @apple for your innovations. Exhibit A: Guy playing with Facetime instead of watching game at sports bar. http://t.co/oU7K39ge
Neg,2334,Ok @iTunesMusic idk wth is up but after syncing my phone my album art is out of order! WTF @Apple!
Neg,1834,i update to ios 5 and lose everything on my phone and it wont let me sign into my itunes account... thanks @Apple
Neg,2142,what is going on with all my @Apple products?! First my #iPad freezes (still is frozen) and then my #iPhone won't turn on!!! #techieTroubles
Neg,1815,I know a few others having same issue RT @Joelplane: 9% now on my second full charge of the day. Pissed @Apple
Neg,2453,Well @apple seems 2b screwing #iphone 4s resellars. They still dont have 4s. Yet were promised. Similar 2 Ma Bell's monopolistic prctices?
Neg,1937,@carlton858: I really hate dealing with the brain dead people at the @apple store. For such good products customer service sucks. in NZ?
Neg,2494,#Siri went down for a little while last night. Come on @apple! Get your shit together on this launch!
Pos,1036,RT @JamaicanIdler: Lmao I think @apple is onto something magical! I am DYING!!! haha. Siri suggested where to find whores and where to h ...
Neg,2080,@Apple would do better to inform customers properly about migrating to #iCloud - many complaints lead to #image damage http://t.co/QL7zmPpO
Neg,1905,@apple I committed to your cloud storage iDisk and now it's raining :-( so soon no more iDisk. Any plans for a new service for storage?
Pos,1185,#iCloud set up was flawless and works like a champ! To the Cloud @Apple
Pos,1324,i love this. so much. thank you @apple. http://t.co/Ui8lOEzX
Neg,1894,What was @apple thinking making #Siri totally dependent on a network connection? Siri + @ATT = utter frustration.
Neg,1721,@apple $319 to repair my iPad 2 Apple you've lost me and my $700 a year Android here I come!
Pos,1130,@bkad5161 than apologize to @apple ;)
Pos,1370,Thank you Steve @apple store 5th av. http://t.co/nSAisriP
Neg,2407,@amandbrar @apple Siri has worked for me less than 10% of the time. If service doesn't improve by Monday I'm returning my iPhone 4S.
Pos,1318,@SteveJobs being honored tonite @Apple...A truly great loss to the world.He will so be missed
Neg,2244,So glad that I paid $69 for this @apple care protection plan. Been on hold for over 20 minutes now. Great customer service. #NOT
Neg,1984,@philipgrey: dear @apple why you gotta go change the way <input type=number> is handled out of the blue?
Neg,1604,So apparently @apple put MB cap on your SMS with the new update. 25mb storage before it tells you your inbox is full. What is this 2001?
Neg,2376,Never purchasing another item from @apple.
Pos,1309,@alexlindsay My wife upgraded her iPhone 4. I think Siri alone is worth the upgrade. Looking forward to @Apple continuing to enhance Siri.
Pos,1047,Just registered as an @apple developer... Here's hoping I can actually do it... Any help greatly appreciated!
Pos,1105,<3 #ios5 @apple
Neg,1543,@apple AirDrop #fail - Immediate declined your request. every time
Neg,1593,Dear @apple My new Air is now a notbook since your update killed #wifi #bug #destroying #productivity
Pos,1215,So yeah... @apple #iOS5 #readinglists have changed my life. #nowicanspendevenmoretimeonmyphone.
Pos,1141,Incredible: 4 million iPhone 4Ss in 3 days. 135% better than the iPhone 4 http://t.co/1FMJxTMM @apple #iphone4s
Neg,2348,Asked #Siri Where's Baby Lisa? and was told sorry I'm having trouble connecting to the network right now. @apple server fail. #ios5
Neg,2492,Houston we have a problem!! My iPad has been restoring for 12+ hours after installing @apple IOS5. This can't be right....
Neg,1657,@phxguy88 @Apple @BGR That's why all the ppl who stand in line for hrs to get the newest model are suckers...
Neg,2314,After a week or so with @Apple's #iOS5 I'm considering going back to #jailbroken 4.2 - same features as 5 plus more. Not as stable though.
Neg,2202,RT @JDougyJ: hey @apple do you wanna fix my fucking playlist order you piece of shit
Neg,1678,@Apple on the #iPad with #iOS5 why has the Messages Icon been included when it can't be used?
Neg,1709,@Apple #iOS5 gm on ipad1 is very slow wash better on beta7/8 solve this problem or give me the ipad2
Neg,1928,Dear @apple: Why did all my PDFs and ePub files disappear from ibooks in my iPhone post ios5 upgrade? This hurts. #3GS #needsomethingtoread
Neg,1648,@FishMama: If you made a purchase just wait for the @apple survey! hate going b/c of the bad #custserv
Neg,1567,Oh @apple. Steve obviously had nothing to do with iPhoto as it's the perfect opposite of 'insanely great'. Get it fixed please.
Neg,1909,Hey @apple why can't I share a reminder list from my iPhone?Also why can't I login to the iCloud webpage to modify sharing from my phone?
Neg,2471,@apple #siri can't connect to the network -- it's LESS useful that VoiceControl now... :(
Neg,2005,@apple: Multiple times siri is having trouble connecting to the network. Siri needs servers (and some exercise!)
Neg,1868,@chascouponmom @apple I get they are busy w/ the new phone but I just wanted to buy a stylus. they made me wait forever outside & never
Pos,1306,Loving the new iPod update @apple
Neg,1754,Hey @Apple: stop sending your automatically-depreciate-all-iPhones-older-than-the-4s signal. My #iPhone4 is dying rapidly processor-wise.
Neg,1600,@apple thank you for ruining my 3GS with #iOS5. You've just turned my phone into an utterly useless pile of shit.
Neg,1766,why the fuck dose my phone decide its just ganna freeze every time i try to update it so fucking sick of @apple
Neg,2392,and only the first 23 images in my Photo Roll made it over? Seriously @apple how did you fuck this up so much?
Pos,1227,#10twitterpeopleiwouldliketomeet @coollike @TheGadgetShow @thelittleappkid @Jon4Lakers @BenRubery @Apple @twitter @FXhomeHitFilm (-2)
Neg,2255,@robert_terpstra no worries bud ps: they're saying that the 4s is having a lot of network issues right now. (I'm @apple for mac problems)
Neg,1829,iTunes is @apple's worst product. Worse than the #Newton or the hockey puck mouse. It's utterly painful to use.
Neg,1881,Hey @apple the SMS full message is complete shit. Yes I'm annoyed.
Pos,1292,Updated my iOS and started using cloud services. Pretty bad ass @apple my #iPhone 3GS still the champ.
Neg,2286,I sure as hell better be able to restore my calendar events. Terrible bug apple! @apple #icloud #anothericloudfail
Pos,1465,Awesome service from the @apple store in pc. Thanks chris!
Neg,2061,Spoke to an @Apple rep on phone & could hear her tv blaring in the bg. She said I can't actually help u just direct u back to the web
Neg,2128,Pondering the iOS update... From the sounds of @MikeFerri's difficulties I may just hold off :/ @Apple FIX IT!
Neg,2483,Dear @apple One day you're going to release a version of iTunes that doesn't freeze more often than it works. One day.
Pos,1210,Play on ma man. Loving the camera in the...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here