Skip to main content

Posts

Showing posts from 2016

Zeros in Factorial Inside out !

Here is the C Program to generate a series which leads us to understand the number of zeros in a Factorial: -------------------------------------------------------------------------------------------------------------------------- #include <stdio.h> #include<stdlib.h> int ZerorsInFactorial(int number); int main(int argc, char **argv) { //printf("hello world\n");     //This is to see the howmany zeros will be there in a factorial , let that be P.     //The values P take as we move towards infinity     int i=0;FILE *fptr;     fptr=fopen("program.txt","w");     if(fptr==NULL){       printf("Error!");       exit(1);     }     while(i<1000)         {             fprintf(fptr,"%d zeros in %d factorial\n",ZerosInFactorial(i),i);     printf("%d zeros in %d factorial\n",ZerosInFactorial(i),i);i++;     } fclose(fptr);    // printf("Hello World"); return 0; } int ZerosInFactorial(int n

Python Crash Course : Part 2

For learning core of any programming language it is necessary to learn three fundamental types of language constructs : 1.        Sequential Statements 2.        Control Statements 3.        Iterative Statements It is just that simple , only three things to learn .Cool !! Sequential Statements in Python ·          Variables (memory) are integral part of any algorithm implementation. ·          There is no need of declaring data type of the variable used, Python implies the data type based on context. Which is similar in Scripting language like JavaScript[here we use 'var' keyword]. Example : x=1 , x=’string’ , x=0.000 . Based on type of data at RHS the datatype of variable is implied. ·          INPUT and OUTPUT constructs in Python  : INPUT :                                 Example : y=input(“Please , Provide the value of Y”)  input() function provides the basic system input which can be responded by user keyboard.  As said earlier the data typ

Arduino Code To Wire any Serial Device

#include <SoftwareSerial.h> SoftwareSerial mySerial(10, 11); // RX, TX ]] change this to pin to which arduino is connected void setup() {   // Open serial communications and wait for port to open:   Serial.begin(9600);   while (!Serial) {     ; // wait for serial port to connect. Needed for native USB port only   }   // set the data rate for the SoftwareSerial port   mySerial.begin(9600); } void loop() { // run over and over   if (mySerial.available()) {     Serial.write(mySerial.read());   }   if (Serial.available()) {     mySerial.write(Serial.read());   } }

Introduction To Windows Services

Understanding windows service fundamentals Overview : Why develop windows services ? 1. Run even when no user is logged in 2. Start automatically on machine boot 3. Run as different users(inc. built in) 4. Start,stop,pause, resume services 5. Failure Policy (eg . auto start ) 6. Manage from remote machines (eg stop) Typical usecase of windows services : 1. File conversion (e.g. video / audio ) 2. System intergration(file-ingenstion) 3. System integration (data transfer between systems) 4. Run web server (e.g owin self hosting) 5. Message queue processing (eg. MSMq) 6. Host remote Akka .Net Actor System 7. Host other services eg. Mail , Ftp etc. SERVICE STARTUP MODES 1. Manual 2. Automatic 3. Automatic(Delayed Start ) 4. Disabled 5. Triggers SERVICE LOG ON ACCOUNTS 1. Local system built in account 2. Local Service Account 3. Network Service Account 4. Local User custom Account 5. Domain User custom Account SERVICE RECOVERY OP

Python Crash Course : Part 1

HISTORY :  Written by Guido Van Rossum in 1980s, i.e Guido started writing Python in 1989 December. Van Rossum is Python's principal author, and his continuing central role in deciding the direction of Python is reflected in the title given to him by the Python community,  benevolent dictator for life  (BDFL). INSTALLING PYTHON :  The python interpreted which can be downloaded from website www.python.org (https://www.python.org/download/releases) CHECKING SUCCESSFUL INSTALL : Open command prompt. Type " assoc .py " , without quotes. That should return ".py=Python.File Cool ! Up and Running to write the scripts !