-
-
Sample blog post to learn markdown tips
There's lots to learn!
By Bill SmithThis is a demo post to show you how to write blog posts with markdown. I strongly encourage you to take 5 minutes to learn how to write in markdown - it’ll teach you how to transform regular text into bold/italics/tables/etc.I also encourage you to look at the code that... [Read More] -
A dedicated NS-3 Module for IEEE 802.22 standard
By Sayef Azad Sakintable.fancy_table { font-family: arial, sans-serif; border-collapse: collapse; width: 100%; } [Read More] -
Setup Virtual Router (Windows)
By Sayef Azad SakinSet the network details: netsh wlan set <network_name> mode=allow ssid=<ssid> key=<password> netsh wlan start <network_name> Example: netsh wlan set hostednetwork mode=allow ssid=ss key=ssssss netsh wlan start hostednetwork To stop the Wireless Hosted Network: netsh wlan stop <network_name> To see the Wireless Hosted Network details, including the MAC addresses of connected... [Read More] -
Quantum Computing Resources
By Sayef Azad SakinWired link: http://www.wired.com/wiredenterprise/2013/06/d-wave-quantum-computer-usc/ blog post: http://googleresearch.blogspot.com/2013/05/launching-quantum-artificial.html John Preskill: Quantum Computing and the Entanglement Frontier https://www.youtube.com/watch?v=8-IqQnGYB2M Googles explanation about quantum computing https://www.youtube.com/watch?v=CMdHDHEuOUE official google+ page: https://plus.google.com/+QuantumAILab/posts Microscopic and macroscopic systems It is useful, at this stage, to make a distinction between the different sizes of the systems that we are going... [Read More] -
Restore boot manager after installing windows 7 over linux
By Sayef Azad SakinBoot from the ubuntu Live CD. Open the terminal from applications -> Accessories -> Terminal. Then find the partition of your Ubuntu OS from the list generated with the command, sudo fdisk -l If your ubuntu(linux) partion is sda6, sudo mkdir /media/sda6 sudo mount /dev/sda6 /media/sda6 After that you have... [Read More] -
Some secret code of Mobile
By Sayef Azad Sakin*#92702689# -> Warranty settings. *#7760# -> Production serial no. *#bta0# -> MAC address of bluetooth. *#9999# -> Firmware version. *#2640# -> Security code. *#7328748263373738# -> Default security code. *#43# -> Call waiting status. *#2820# -> Bluetooth info. *#7370# -> Format mobile memory. *#delset# -> reset GPRS & E-mail Setting. [Read More] -
Lowest Common Ancestor
By Sayef Azad Sakin//<O(N logN, O(logN)> #define mx 10010 #define logmx ceil(log(mx)) #define pii pair < int, int > //#define i64 __int64 #define inf 2147483647 [Read More] -
RMQ with Segment Tree
By Sayef Azad Sakin#define mx 1000010 #define tmx 2000020 [Read More] -
Binary Indexed Tree
By Sayef Azad Sakin#define i64 long long i64 BIT[mx]; int n; //1-D BIT i64 read(int idx){ i64 sum = 0; while (idx > 0){ sum += BIT[idx]; idx -= (idx & -idx); } return sum; } [Read More] -
Bipartite Matching (Hopcroft-Karp)
By Sayef Azad Sakin//Complexity: O(e√v) //n: number of nodes in left side n=[1,n] //m: number of nodes in right side m=[n+1,n+m] //G: NIL U G1[G[1,n]] U G2[G[n+1,n+m]] [Read More] -
Character Device Driver (for linux)
By Sayef Azad SakinLittle talk..... This was my 3rd assignment in System programming lab(3rd year undergrad course). The main task of this assignment is to design a character driver which should exist in linux kernel. I make a kernel module which module implements a driver that exposes two character devices to user-space. Lets... [Read More] -
ls (my own implementation)
By Sayef Azad SakinLittle talk about 'ls' (since I have very small knowledge about it): ls - list directory contents. The 'ls' program lists information about files (of any type, including directories). Options and file arguments can be intermixed arbitrarily, as usual. Know details about 'ls' in linux man page: http://unixhelp.ed.ac.uk/CGI/man-cgi?ls Little talk about coding: Probably... [Read More] -
MAKEFILE (at a glance)
By Sayef Azad SakinSample code project1: data.o main.o io.o cc data.o main.o io.o -o project1 data.o: data.c data.h cc -c data.c main.o: data.h io.h main.c cc -c main.c io.o: io.h io.c cc -c io.c #this is a... [Read More] -
Windows 7 Command Prompt Commands
By Sayef Azad SakinAppend: It can be used by programs to open files in another directory as if they were located in the current directory. Arp: It is used to display or change entries in the ARP cache.. Assoc: The assoc command is used to display or change the file type associated with... [Read More] -
Linux tutorials
By Sayef Azad SakinLinux Mint How To Restore Grub After Windows 7 Repair Install -
vi/vim cheat sheet
By Sayef Azad Sakin -
C++ String references with example
By Sayef Azad SakinC++ String Examples [Read More] -
Strongly Connected Component (Tarjan)
By Sayef Azad Sakinvector< int > M[MX]; int color[MX],f[MX],low[MX],ftm,st[MX],top,scc; bool instack[MX]; void dfs(int u){ int i,v,sz; f[u] = ftm; low[u] = ftm; ftm++; st[top] = u;top++;instack[u] = true; sz = M[u].size(); color[u] = 1; for(i=0;i<sz;i++){ v = M[u][i]; if(!color[v]){ dfs(v); low[u] = _min(low[u],low[v]); } else if(instack[v])low[u] = _min(low[u],f[v]); } if(f[u] == low[u]){ scc++;... [Read More] -
Maximum Flow (basic)
By Sayef Azad Sakinvector < int > M[mx]; int pre[mx], cap[mx][mx]; bool color[mx]; int bfs(int s, int t){ int ok,u,v,sz,i,path_cap; memset(pre,-1,sizeof(pre)); memset(color,0,sizeof(color)); queue < int > q; color[s] = 1; q.push(s); ok = 1; while(!q.empty() && ok){ u = q.front(); q.pop(); sz = M[u].size(); for(i=0;i<sz;i++){ v = M[u][i]; if(!color[v] && cap[u][v] > 0){... [Read More] -
Minimum Spanning Tree (Kruskal)
By Sayef Azad Sakinstruct node { int u,v,w; bool operator < ( const node &b) const{ return w<b.w; } }e[mx]; int pr[mx]; [Read More] -
Max flow with min cut
By Sayef Azad Sakinvector < int > M[mx]; i64 cap[mx][mx], CAP[mx][mx]; int pre[mx]; bool color[mx]; i64 bfs(int s, int t){ int ok,u,v,sz,i; i64 path_cap; memset(pre,-1,sizeof(pre)); memset(color,0,sizeof(color)); queue < int > q; color[s] = 1; q.push(s); ok = 1; while(!q.empty() && ok){ u = q.front(); q.pop(); sz = M[u].size(); for(i=0;i<sz;i++){ v = M[u][i]; if(!color[v]... [Read More] -
Convex Hull (Grahm Scan)
By Sayef Azad Sakinpoint fp; bool cmp(const point &a,const point &b){ i64 d = isLeft(fp,a,b); if(d<0)return false; if(feq(d,(i64)0) && (dist(fp,a) > dist(fp,b)) )return false; return true; } void ConvexHull(point p[], point c[], int &np, int &nc){ int i,j,pos = 0,k; i64 dd; bool flg=0; for(i=1;i<np;i++){ if( (p[i].x < p[pos].x) || ( feq(p[i].x,p[pos].x) &&... [Read More] -
Miscellaneous Geometry
By Sayef Azad Sakin#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <vector> #include <map> #include <algorithm> using namespace std; [Read More] -
Bipartite Matching (Basic)
By Sayef Azad Sakin#define mx 210 vector < int > g[mx]; int lf[mx],rt[mx],n; bool vis[mx]; [Read More] -
Bellman Ford
By Sayef Azad Sakinvector < pii > M[mx]; int d[mx]; bool bellman_ford(int s,int n){ int i,u,j,sz,v,w; bool done = false; for(i=0;i<n;i++)d[i] = inf; d[s] = 0; for(i=0;i<n && !done;i++){ done = true; for(u=0;u<n;u++){ sz = M[u].size(); for(j=0;j<sz;j++){ v = M[u][j].first; w = M[u][j].second; if(d[v] > (d[u] + w)){ d[v] = d[u] + w;... [Read More] -
Bridge Network
By Sayef Azad Sakin#define mx 110 #define _min(i,j) ((i)>(j)?(j):(i)) [Read More] -
Articulation Point
By Sayef Azad Sakin#define mx 110 #define _min(i,j) ((i)>(j)?(j):(i)) [Read More] -
Single Source Shortest Path (Dijkstra)
By Sayef Azad Sakinstruct comp { bool operator() (const pii &a, const pii &b) { return a.second > b.second; } }; int color[mx], d[mx], nodes; vector < pii > path[MX]; int dijkstra(int source, int dest){ int u,v,sz,y,z; priority_queue< pii, vector< pii >,comp > q; for(v = 1; v<=nodes; v++){ color[v] = 0; d[v]... [Read More] -
Bigmod (a^b%m)
By Sayef Azad Sakini64 bigmod(i64 a,i64 b,i64 d) { i64 r=1; while(b) { if(b&1) r=(r*a)%d; b>>=1; a=(a*a)%d; } return r; } -
Number of Divisor
By Sayef Azad Sakini64 noOfDivisor(i64 n){ int j,f; i64 cnt,ans=1; f = 0; for(j=0;prime[j]<=n && j<prlen;j++){ cnt = 0; if(n%prime[j]==0){ while(n%prime[j]==0){ cnt++; n /= prime[j]; } f=1; ans *= (cnt+1); } } //if(!f || n!=1)cnt++; if(n^1)ans <<= 1; return ans; } -
Template
By Sayef Azad Sakin//Bismillahir Rahmanir Rahim //#pragma warning(disable:4786) //#pragma comment(linker,"/STACK:514850816") #include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cctype> #include <cstring> #include <climits> #include <string> #include <sstream> #include <queue> #include <stack> #include <vector> #include <set> #include <map> #include <list> #include <algorithm> using namespace std; [Read More] -
Prime Factorization
By Sayef Azad Sakinvoid PrimeFact( int n, int *factors, int *factCount, int &len){ int i,count, sqrtN; sqrtN = (int) sqrt( (double) n ) + 1; for(i = 0; prime[i] < sqrtN ; i++)if(!(n%prime[i])){ factors[len] = prime[i]; count = 0; while(!(n%prime[i]))n/=prime[i], count++; factCount[len++] = count; sqrtN = (int) sqrt( (double) n ) + 1;... [Read More] -
Generating Prime (Sieve)
By Sayef Azad Sakin#define mx 100000 #define chkp(n) (prm[n>>6]&(1<<((n>>1)&31))) #define genp(n) (prm[n>>6]|=(1<<((n>>1)&31))) #define PrimeLimit 10000000 int prm[PrimeLimit / 64], prime[mx], prlen; void GeneratePrime(){ int i,j,sqrtN; prlen = 0; prime[prlen++]=2; sqrtN = ( int ) sqrt ( ( double ) PrimeLimit ) + 1; for(i=3;i<sqrtN;i+=2)if(!chkp(i)){ prime[prlen++] = i; for(j=(i*i);j<PrimeLimit;j+=(i<<1))genp(j); } for(;i<PrimeLimit;i+=2)if(!chkp(i))prime[prlen++]=i; } [Read More] -
Bignumber Subtraction
By Sayef Azad Sakinvoid Subtraction(char *f, char *s, char *ans){ int lenf,lens,a,carry,ind,b; lenf = strlen(f)-1; lens = strlen(s)-1; carry = ind = 0; while(lens >=0 || lenf >=0){ b = ((lens >=0)?(s[lens--]-'0'):0) + carry; if(f[lenf] >=(b+'0')){a = f[lenf--]-'0';carry = 0;} else{a = f[lenf--]-'0' + 10;carry = 1;} ans[ind++] = (a - b) +... [Read More] -
Bignumber Multiplication
By Sayef Azad Sakinvoid Multiplication(char *f, char *s, char *sum){ int lenf,lens,i,j,k,carry,a; memset(sum,0,sizeof(sum)); lenf = strlen(f);lens = strlen(s); reverse(f,f+lenf);reverse(s,s+lens); for(i=0;i < lens;i++){ carry = 0;k = i; for(j=0;j < lenf;j++){ a = ( (f[j]-'0') * (s[i]-'0') ) + carry; if(i) a += (sum[k]-'0'); sum[k++] = (a%10) + '0'; carry = a/10; } if(carry)sum[k++]... [Read More] -
Bignumber Addition
By Sayef Azad Sakinvoid Addition(char *f, char *s, char *ans){ int lenf,lens,a,carry,ind; lenf = strlen(f)-1; lens = strlen(s)-1; carry = ind = 0; while(lens > =0 || lenf > =0){ a = ((lens > =0) ? (s[lens--]-'0') : 0) + ((lenf > =0) ? (f[lenf--]-'0') : 0) + carry; ans[ind++] = (a%10) +... [Read More]