Selasa, 22 September 2009

Eagle Eye

1.       Tulisan Singkat Mengenai film ini!
Eagle Eye
Film ini dimulai dengan para kesibukan petinggi-petinggi keamanan US membuka film dengan sebuah kisah tragis pengeboman terhadap target operasi seorang teroris pada saat sedang melakukan pemakaman. Terdapat Sebuah kesalahan pengambilan keputusan dengan memprediksi keberhasilan operasinya
Cerita ini dmulai pada saat Jerry Shaw baru kembali ke rumah setelah mendengar berita kematian saudara kembarnya, Ethan. Selain fisik, Ethan sangat berbeda dengan Jerry, hal itu terlihat dari sederet piala yang memenuhi kamar Ethan. Pada saat Jerry mengecek rekeningnya ternyata telah berisi uang dalam jumlah yang banyak, dan Jerry pun bingung ketika uangnya keluar banyak begitu saja dan pada saat pulang ke apartementnya Jerry dikagetkan dikamarnya dengan tumpukan kotak-kotak dus yang isinya merupakan barang berbahaya. Belum hilang dari keterkejutannya dia mendapatkan telephone dari nomor tak dikenal dengan suara wanita misterius. Kemudian wanita itu menyuruh Jerry untuk segera keluar dari kamarnya, karena akan ada agen FBI yang akan menggerebek kamarnya itu dengan rasa yang bingung Jerry pun tidak memperdulikan perintah dari wanita tersebut dan sehingga akhirnya Jerry pun berhasil ditangkap oleh agen FBI. Pada saat seorang Agen FBI yang mencecar beragam pertanyaan, Agen tersebut tidak mempercayai sedikitpun penjelasan dari Jerry. Lalu Jerry mendapat kesempatan untuk menelephone, akan tetapai pada saat dia menelephone dia justry kembali tersambung dengan suara wanita misterius tadi, kali ini Jerry menurutinya dan kabur dari para agen FBI tadi.
Pada saat yang sama, Rachel Holloman seorang single parent yang baru melepaskan kepergian putranya Sam untuk mengikuti suatu pertunjukan musik ke Washington juga mendapatkan telpon dari wanita misterius yang sama. Rachel pun dipaksa untuk mengikuti semua perintah yang diberikan dengan sebuah ancaman keselamatan Sam.
Dengan mengikuti semua perintah-perintah dari telephone wanita tersebut, akhirnya Jerry dan Rachel dipertemukan. Mereka dipertemukan pada saat Rachel menaiki sebuah mobil hitam yang dengan sesuai perintah dari telephone tadi untuk diam menunggu seorang lelaki yang akan menemuinya dimobil hitam tersebut, ketika ketemu awalnya keduanya saling menyalahkan namun akhirnya Jerry dan Rachel menyadari bahwa mereka sama-sama dijebak entah oleh siapa dengan taruhan nyawanya anak rachel. Lalu adegan saling kejar-kejaran dengan FBI pun terjadi, mobil yang melaju kencang dengan meninggalkan kecelakaan, ledakan dan mereka menerobos setiap perempatan jalan dengan lampu hijau yang terus menyala disetiap perempatan yang mereka lewatin.
Mereka selalu mencoba melepaskan diri dari semua perintah yang membahayakan itu tapi selalu gagal, karena si pemberi perintah sepertinya telah menguasai teknologi tingkat tinggi yang bisa mengendalikan semua jenis peralatan elektronik yang ada, mulai dari handphone, kamera pengintai, kendaraan, traffic light, atau mesin apa saja yang terhubung computer dengan jalur internet. Dan mereka juga tidak punya pilihan lain selain mengikuti perintah-perintah itu tanpa tahu sebabnya.
Lalu Jerry dan Rachel melalui tv disebuah pertokoan mendapatkan penjelasan bagaimana mereka bisa selalu dalam pengawasan, yang membuat mereka sadar siapa dalang dibalik semuanya yang ternyata sebuah komputer canggih yang telah melakukan perintah-perintah tersebut. Tapi tidak berapa lama setelah mereka melewati pemeriksaan di Bandara, adegan pengejaran seorang agen FBI hingga Jerry & Rachel berhasil naik pesawat kargo itu terjadi.
Ketika di tempat lain Agen Zoe bersama dengan salah satu staf dephan berhasil memecahkan pesan Ethan dari kode morse yang disampaikan melalui lampu HP. Dalam sebuah ruang khusus anti sadap mereka melaporkan akar permasalah sebenarnya. Lalu dijalanan ada Jerry dan Tom yang dikejar pesawat pengebom untuk mengejar Rachel yang membawa bom ke tempat pertemuan petinggi Amerika, dilantai 36 ada Zoe dan Bowman yang berusaha keras menghancurkan sistem komputer hasil sebuah project dengan nama "eagle eye", project tersebut adalah untuk membunuh seorang presiden US dikarenakan untuk melindungi sebuah negara dari ancaman. Sedangkan digedung pertemuan Rachel menanti dengan cemas kehadiran anaknya.
Jadi inti dari cerita ini adalah sebuah komputer canggih yang bisa mengambil keputusan sendiri atau memilik sebuah AI yang sangat canggih yang untuk berusaha membuka kembali project rahasia dan untuk menjalankannya. Dan untuk menjalankannya dibutuhkan seorang Jerry, karena raut muka Jerry sama dengan saudara kembarnya Ethan. Jadi Jerry digunakan untuk sebagai kunci membuka project rahasia tersebut, dan project itu harus dilaksanakan.
2.       Pengertian Fire Sale?
Fire Sale merupakan suatu operasi penghancuran sebuah negara dengan mengacaukan sistem komputer yang melayani Sistem Transportasi, Sistem Telekomunikasi, Sistem keuangan dan Sistem Pelayanan Publik.
3 Tahapan Fire Sale adalah disrupting telecommunication and transportation, stealing and destroying financial records, disabling all public utilities.
3.       Pengertian Cyber Terrosim?
Pengertian tentang  cyber terrorism sebenarnya terdiri dari dua aspek yaitu cyber space dan terrorism, sementara para pelakunya disebut dengan cyber terrorists. Para hackers dan crackers  juga dapat disebut dengan cyber terrorist, karena seringkali kegiatan yang mereka lakukan di dunia maya (Internet) dapat menteror serta menimbulkan kerugian yang besar terhadap korban yang menjadi targetnya, mirip seperti layaknya aksi terorisme.
4.       Keuntungan dan Kerugian Keberadaan Teknologi?
Keuntungan Keberadaan Teknologi
·         Membantu pekerjaan manusia menjadi lebih mudah,
·         Memudahkan manusia dalam memenuhi kebutuhannya,
·         Dapat membuat maniusia menjdai pintar,
·         Membuat manusia menjadi tahu dunia luar,
Kerugian Keberadaan Teknologi
·         Membuat manusia menjadi malas,
·         Bisa digunakan untuk kejahatan ditangan orang-orang yang jahat,
·         Bisa menimbulakan kekacauan,

5.       Mutating Algorithmic Security Code?
Non Mutating Algorithms
There are a number of useful non-mutating algorithms, so here's a little program to demonstrate a few:
#include
#include
#include
#include
#include
#include

int main() {

    std::srand( std::time(0) );

    std::vector v;
    std::vector::iterator vi;
    for ( unsigned i = 0; i < 10; ++i ) {
        v.push_back( std::rand()%10 );
    }

    std::cout << "The smallest element is "
              << *std::min_element( v.begin(), v.end() )
              << std::endl;

    std::cout << "The largest element is "
              << *std::max_element( v.begin(), v.end() )
              << std::endl;

    vi = std::find( v.begin(), v.end(), 5 );
    if ( vi != v.end() ) {
        std::cout << "There is a 5 in position "
                  << ( vi - v.begin() )
                  << std::endl;
    } else {
        std::cout << "There is no 5"
                  << std::endl;
    }
   
    std::cout << "The average of the elements is "
              << std::accumulate( v.begin(), v.end(), 0.0 ) / v.size()
              << std::endl;

    std::cout << "There are "
              << std::count( v.begin(), v.end(), 0 )
              << " zeros"
              << std::endl;
   
}

One important thing to remember is that these algorithms use operators, so if you've overloaded some operators, you can use them to do rather surprising things:
#include
#include
#include
#include

int main() {

    std::vector v;
    v.push_back( "how " );
    v.push_back( "are " );
    v.push_back( "you?" );

    std::cout << std::accumulate( v.begin(), v.end(), std::string("Hello, ") )
              << std::endl;
             
}

 Mutating Algorithms
There are many more Mutating Algorithms than Non-Mutating ones, since they actually do things to the elements. std::copy is technically a Mutating Algorithm since it writes to the output iterator, but it's not a very interesting one.
My favourite example of a Mutating Algorithm is std::sort. Its two parameters are the iterator range on which it works, but unlike the other std::algorithms we've seen so far, it requires Random Access Iterators. The actual algorithm used isn't specified, but it's usually some form of quicksort. ( Roguewave's implementation uses introsort, a form of quicksort that switches to heapsort for inputs that are troublesome for a pure quicksort. ) In any case, you can safely treat it as an O( nlgn ) average-case sort.
One very cool thing about std::sort is that it is actually often faster than C's qsort. Thanks to overloaded operators, std::sort just uses <, which means that there is no function pointer needed. It's very hard for a compiler to inline a call to a comparison function through a function pointer, but for < between integers or an overloaded operator< it's usually not all that hard.
Perhaps the most useful mutating operation is std::remove. The catch with it, however, is that std::remove doesn't actually remove anything. This is rather surprising at first, but think about it: Do iterators have any function that tells you what container they're in? Do they have any function that lets you delete them? Nope. All std::remove does is reorder the elements, returning an iterator to the first one "removed". This lead to the Erase-Remove Idiom:
std::vector v;
put_a_bunch_of_stuff_in( v );
v.erase( std::remove( v.begin(), v.end(), 42 ), v.end() );

If there are no 42s to remove, then the remove returns v.end() and the erase does nothing. If there are 42s, then they get moved to the end of the range and the erase removes them.
Since you can't rearrange elements in Associative Containers, they have special erase member functions that remove all entries with a specified key. Also, Associative Containers have better-than-linear lookup time for elements, so these are much faster than could be done with iterators.
Roguewave's Algorithms documentation is nice enough to give examples and descriptions of the various algorithms, so instead of describing them, I'll just highlight a few:
·         std::nth_element : try updating the Non-Mutating demo above to find medians, using this function
·         std::fill and std::fill_n : similar to a generic std::memset. Great for clearing or initialising things.
·         std::next_permutation and std::prev_permutation
·         std::swap and std::iter_swap : two of the very few std::algorithms that don't work on iterator ranges. Note that most std::lib classes ( such as the Containers ) specialise these function so they will never fail.
 Writing Your Own
It's fairly straight forward to write your own algorithms. The only thing you need to be careful of is what type or iterators you require. Let's start by making an iterator-based version of show_elements, which is more useful anyways since it means you can display subranges and not only entire containers. To keep things simple, it'll always show the elements to std::cout with a space after each element:
template
void show_range(InputIterator begin, InputIterator end) {
    for ( ; begin < end; ++begin) std::cout << *begin << ' ';
}

Fairly obvious, but something should jump out at you. Take a moment to look at the code and maybe try it with a few different containers.
Found the problem?
I called the templated iterator type InputIterator, and that's all this function should require from the iterators, but the template parameter name makes no difference. Perhaps I was thinking of the ubiquitous for ( int i = 0; i < n; ++i ) loop, since I accidentally used < to compare the iterators. Only Random Access Iterators are Less-Than-Comparable, so there's a rather severe unnecessary restriction. A better version would use !=:
template
void show_range(InputIterator begin, InputIterator end) {
    for ( ; begin != end; ++begin) std::cout << *begin << ' ';
}

Which can be used with just Input Iterators. Try, for example, opening a text file in a std::ifstream called input_file and running show_range( std::istream_iterator(input_file), std::istream_iterator() );.
That looks pretty good so far, but there's still that explicit loop. Algorithms are a great way to get rid of loops and make your code cleaner. Of course, algorithms will usually have an explicit loop inside them, but in this case all we're doing is a wrapper, so we can use std::copy and std::ostream_iterator to get rid of the explicit loop:
template
void show_range(InputIterator begin, InputIterator end) {
    std::copy( begin, end,
               std::ostream_iterator< typename InputIterator::value_type >( std::cout, " " ) );
}

This version will work for most container iterators and all special iterators. There's one hidden problem, however: Pointers are iterators, but wont work with this function. Obviously, if InputIterator is, for example, an int*, you can't use :: on it. To get around this problem, there's std::iterator_traits which is partially specialised for pointers and pointers-to-const. Using it, we get a fully working version:
template
void show_range(InputIterator begin, InputIterator end) {
    std::copy( begin, end,
               std::ostream_iterator< typename std::iterator_traits
                                                  ::value_type >( std::cout, " " ) );
}

Now would be a good time to try writing a few of your own. If you're short on ideas, try writing a few of the simple sorts as algorithms using other algorithms. Selection sort can be done particularly elegantly; I've put my implementation of it and some others up to compare against after you've come up with one yourself.
 In Closing
Algorithms are a great tool. They make code more readable, eliminate opportunities for little errors when typing up loops, and can even speed up code ( since the implementation will often optimize them ). They work on iterator ranges so they aren't limited to specific situations, greatly reducing the amount of code you need to write.