Blog

Japanese characters in LaTeX documents

Japanese, like many other Asian languages, is written using a variety of symbols which are not found in the standard ASCII table. Fortunately, you can include these symbols in LaTeX documents using the CJK package. In ubuntu this can be installed via the sudo apt-get install latex-cjk-japanese command. I’m not sure about Windows, Mac or …

Start reading Japanese characters in LaTeX documents

Running multiple programs in a Docker container from the command line

With Docker, you can specify the command to run inside the container on the command line. But what if you want to run multiple commands? You can’t escape the && syntax, or wrap the command in quotes, as Docker won’t recognise it. The trick here is to use sh -c ” For example, to run …

Start reading Running multiple programs in a Docker container from the command line

Simulate Bankers Algorithm for Deadlock Avoidance Using C

void main(){int n,r,i,j,k,p,u=0,s=0,m;int block[10],run[10],active[10],newreq[10];int max[10][10],resalloc[10][10],resreq[10][10];int totalloc[10],totext[10],simalloc[10];//clrscr();printf(“Enter the no of processes:”);scanf(“%d”,&n);printf(“Enter the no ofresource classes:”);scanf(“%d”,&r);printf(“Enter the total existed resource in each class:”);for(k=1; k<=r; k++)scanf(“%d”,&totext[k]);printf(“Enter the allocated resources:”);for(i=1; i<=n; i++)for(k=1; k<=r; k++)scanf(“%d”,&resalloc);printf(“Enter the process making the new request:”);scanf(“%d”,&p);printf(“Enter the requested resource:”);for(k=1; k<=r; k++)scanf(“%d”,&newreq[k]);printf(“Enter the process which are n blocked or running:”);for(i=1; i<=n; i++){if(i!=p){printf(“process %d:\n”,i+1);scanf(“%d%d”,&block[i],&run[i]);}}block[p]=0;run[p]=0;for(k=1; k<=r; k++){ }OUTPUT:Enter …

Start reading Simulate Bankers Algorithm for Deadlock Avoidance Using C