Sunday, June 30, 2013

Mac Linux USB Loader Starred 50 Times on GitHub!

Mac Linux USB Loader was recently starred for the 50th time. Thanks everyone for your continued support - it lets me know that this tool is needed and keeps me going on development.

Also, thanks to everyone who posted articles on Mac Linux USB Loader, added it to Softpedia, and wrote about it on Wikipedia. You guys are the best!

Tuesday, June 11, 2013

Xcode 5


Apple just yesterday revealed the interface to the next iteration of Xcode 5, Apple's premier development IDE. It can, unfortunately, sometimes break compatibility with older Xcode versions. But a lot of things are hopefully much easier now. I look forward to trying it and I hope you all try it out.

Monday, June 10, 2013

A Demonstration of the UNIX fork() Call

UNIX's fork() call is a fantastic way to have one executable divide itself into two processes, each of which can perform different code from a single codebase. It is also useful for apps that should be started from a command line but shouldn't be vulnerable to being killed with Control-C or the death of the shell. This is how daemons work in UNIX/Linux/OS X. I believe (though I may be mistaken) that this is the basis of Google Chrome's multi-process browsing feature.

 //  
 // fork.c  
 //  
 // Created by SevenBits on 4/14/13.  
 //  
 // This demonstrates how to fork a process. Basically, what happens is, one  
 // process will fork itself, creating a cloned process. The return value of  
 // the fork() call can be used to direct one process to perform one task,  
 // and the clone to perform another! Inter-process communication is also  
 // possible.  
 #include <stdio.h>  
 #include <unistd.h>  
 #include <stdlib.h>  
 int main() {  
   printf("We're going to fork ourselves. This will spawn multiple processes,");  
   printf(" which will each count from 1 to 100 in a different process.\n");  
   pid_t pid = fork();  
   int i;  
   switch (pid) {  
     case -1:  
       printf("ERROR! Something went wrong!\n");  
       return 1;  
       break;  
     case 0:  
              for (i = 0; i < 100; i++) { // This runs in one process.  
                printf ("A: %d\n", i);  
         sleep(1);  
              }  
       break;  
     default: // This runs in another process (the parent).  
              for (i = 0; i < 100; i++) {  
                printf ("B: %d\n", i);  
         sleep(2);  
              }  
       break;  
   }  
   return 0;  
 }  

I officially place this code in the public domain. Do whatever.