Thursday, May 2, 2013

Stuck on DFU or Recovery Mode or Connect to Itunes Logo Loop on iPhone




In the recent months, we've seen reports here and there of iPhones getting stuck in a restart loop. The black screen with the Apple logo shows up, holds for a while, and then disappears again; repeat ad infinitum. While it's not clear yet exactly what's triggering the issue (the complainants suspect that it may be a recent application update to blame), there is a tried and true way to get your iPhone, iPod touch, iPad or older iPod back to square one: either use recovery mode or do a DFU restore


DFU (Device Firmware Update) mode is a means to getting your iPhone to interface with iTunes without iTunes automatically loading the latest version of iOS onto it (it skips the iBoot bootloader, for jailbreak aficionados). Differing from recovery mode -- where iTunes restores your iPhone to its original factory settings but with the latest iOS and firmware -- DFU mode allows you to change and choose the firmware you want to install onto your iPhone. For instance, you would use DFU mode if you want to install a previous version of iOS, jailbreak your iPhone or unlock your SIM. If (for whatever reason) standard recovery isn't working for you to get your device back to working condition, DFU may help you out.

Wednesday, May 1, 2013

Monte Carlo PI

 
c    calculating pi by throwing stones
c
 PROGRAM stones
 IMPLICIT none
c
c    declarations
 REAL*8 area, x, y, DRAND48
 INTEGER i, max, pi, seed
c
c    set parameters (number of stones, seed for generator)
 max = 1000
 seed = 11168
c
c    open file, set initial value, seed generator
 OPEN(6, FILE='pif.dat')
 pi=0
 call seed48(seed)
c
c    execute
 DO 10 i=1, max
    x = DRAND48()*2-1
    y = DRAND48()*2-1 
    IF ((x*x + y*y) .LT. 1) THEN
       pi = pi+1
    ENDIF
    area = 4.0 * pi/REAL(i)
    WRITE(6,*) i, area
 10  CONTINUE
  STOP
  END

PI on MPI

still trying...
 program main
      include "mpif.h"
      double precision  PI25DT
      parameter        (PI25DT = 3.141592653589793238462643d0)
      double precision  mypi, pi, h, sum, x, f, a
      integer n, myid, numprocs, i, ierr
c                                 function to integrate
      f(a) = 4.d0 / (1.d0 + a*a)

      call MPI_INIT(ierr)
      call MPI_COMM_RANK(MPI_COMM_WORLD, myid, ierr)
      call MPI_COMM_SIZE(MPI_COMM_WORLD, numprocs, ierr)


 10   if ( myid .eq. 0 ) then
         print *, 'Enter the number of intervals: (0 quits) '
         read(*,*) n
      endif
c                                 broadcast n
      call MPI_BCAST(n,1,MPI_INTEGER,0,MPI_COMM_WORLD,ierr)
c                                 check for quit signal
      if ( n .le. 0 ) goto 30
c                                 calculate the interval size
      h = 1.0d0/n
      sum  = 0.0d0
      do 20 i = myid+1, n, numprocs
         x = h * (dble(i) - 0.5d0)
         sum = sum + f(x)
 20   continue
      mypi = h * sum
c                                 collect all the partial sums
      call MPI_REDUCE(mypi,pi,1,MPI_DOUBLE_PRECISION,MPI_SUM,0, 
     &                  MPI_COMM_WORLD,ierr)
c                                 node 0 prints the answer.
      if (myid .eq. 0) then
         print *, 'pi is ', pi, ' Error is', abs(pi - PI25DT)
      endif
      goto 10
 30   call MPI_FINALIZE(ierr)
      stop
      end

Wednesday, April 24, 2013

Mencari Pi



Nilai Pi

Mencoba tanpa webworker. Pi dapat dihitung dengan kode berikut

var Pi=0, n=1, c=100000;
for (var i=0;i<=c;i++) {
  Pi=Pi+(4/n)-(4/(n+2));
  n=n+4;
}

perintah dalam tag <script> adalah sebagai berikut

Hello Canvas World

canvas's not supported
Back to first again
Tulisan di atas ditulis dalam canvas seperti kode di bawah. Di sini perintahnya adalah

context.fillText('Hello Canvas World',canvas.width/2-150,canvas.height/2+15);

context adalah '2d' dari canvas, dalam hal ini context kotak yang menyimpan perintah-perintah '2d' canvas seperti contoh diatas, yaitu menulis text.

fillText('tulisan', posisi_x,posisi_y) adalah perintah untuk menampilkan tulisan dengan warna sesuai fillStyle, yaitu 'green'

strokeText('tulisan', posisi_x,posisi_y) adalah perintah untuk menampilkan tulisan dengan warna 'tepi' sesuai strokeStyle yaitu 'red'


var  canvas = document.getElementById('canvasexample'),
 context = canvas.getContext('2d');

context.font = '38pt Arial';
context.fillStyle = 'green';
context.strokeStyle = 'red';

context.fillText('Hello Canvas',canvas.width/2-150,canvas.height/2+15);
context.strokeText('Hello Canvas',canvas.width/2-150,canvas.height/2+15);

Saturday, April 6, 2013

See the Avengers Face on Kebab Store

We knew that Tony Stark is cheeseburger mania. But at the end of Avenger movie, after barely escaped from time-space bridge, he decided to treat other avengers kebab, :)




My Blackberry Experience (part3)

In term of ease of use, I prefer non qwerty phone, thus, I prefer other devices than blackberries (but z10, maybe)

Why I don't like qwerty phone, because I didn't use to it. My first smartphone has candybar form factor, w960i, and I barely use it keyboard because I prefer its handwriting method using stylus.

I still like it and hope iPhone include this feature (unfortunatelly Apple don't bother to include it). I think it's possible cause google applied it in its search engine (work on i Phone too)

I start to used dvorak on my macbook pro in 2009, and since then I "abuse" my home PC, my HP tx2100us, and two server at work keyboards to became dvorak layout. It's simpler and more balance (right and left stroke). Of course blackberry, with its infamous qwerty keyboard, slow me down a bit.

Unfortunately, it applies to iPhone too. Although it allows for changing layout, it don't provide dvorak. Nevertheless, I still prefer iPhone over blackberry because its ability to change its keyboard layout. I'm currently use azerty layout on iPhone.



http://aravir-rose.blogspot.com

Web Worker on HTML 5

I'm planning to write an article or two about this web worker.

The background is our html+javascript behavior; it ran in just single thread (mean single process). With the development of technology, it's become a common that multicore processor installed on a computer or laptop, even in some models of tablets.

The problem is, because single thread nature of html+javascript, it couldn't take advantage of multicore processor. The process itself become inefective if there loop algorithm need to be done and many of that state affecting GUI (the common symptom is freeze web page, not respon to click and even popup that appears and warn us to stop the script)

Web worker solved that by implementing multi thread processes on single page. Web worker thread itself runs in background and independent of GUI so a large loop computation process won't freeze the page.

(to be continued)

http://aravir-rose.blogspot.com

My Blackberry Experience (part 2)

So, how about the Blackberry killer app, Blackberry Messenger?

I personally don't know what's so great about it and what's really different with others messenger apps.

My sister in law tell me that BBM benefit is ability to block people and prevent his/her to contact us. Because BBM connect people through PIN, blocked people won't be able to contact via phone number if didn't know our number or we change our number.

I though of that and feel that it's ridiculous. We know yahoo messenger, google talk, whatsapp and other messenger have blocking feature as well.

Another problem is PIN itself. It's tied to one device. While it comes handy as we don't need to create new account as we have new number, it ties us to just one device. If we get another blackberry device, we have to reinvite our contacts again (or just export it? IDK).

Sure whatsapp or LINE is very vulnerable, anyone had our number is able to contact us but what's so bad about it? They still able to text or call us, don't they? And it have (along yahoo, gtalk and other) great portability; we're free to change device and still use same account, even use it in desktop computer.

Maybe it's just me but I don't want to be tied with one device. (Don't you want to upgrade your blackberry device?)

Blackberry Messenger is still great app though, with million users of course, every blackberry owner use it. But in the end, I still found whatsapp or other traditional instant messenger come handy in term of portability.



http://aravir-rose.blogspot.com

Labels

Picture (491) diary (109) computer (97) Python (39) programming (30) Physicist (25) coding (24) mac (19) os x (19) linux (15) music (15) lion (14) S2 (13) internet (11) HTML5 (10) crazyness (10) delphi (10) flash (6) fortran (5) iPad (5) blackberry (3) Math (2) mountain lion (2) apple (1) iOS (1) iPhone (1) javascript (1) mathematica (1) php (1)