• Tuesday, September 30, 2014

    6. Java - Variables

    Syed Masoom Rizvi
    Java Variable
    A variable is a named memory location where we can store different types of values.
    The value of a variable may be changed during the execution of the program.
    Variables are of different types for storing different values.

    Types of Value            Keword                  Example
    Integer Valuesintint m=5;
    Character Typecharchar a='v'
    String ValuesStringString myStr="test"
    Double Valuesdoubledouble myDbl=2.564
    Boolean(true or false)BooleanmyBool=true;

    Following program clear the concept of the variable:

    Thursday, September 25, 2014

    Java, Android - Set time out while connecting using Socket with IP Address

    Syed Masoom Rizvi

    How to set time while connecting  using socket with provided IP Address

    Import these files:

    import java.net.InetSocketAddress;
    import java.net.Socket;
    import java.net.ServerSocket;


    public void connect(String IPAddress,int port,int timeOut) throws Exception
    SocketAddress sa=InetSocketAddress(IPAddress,port);
    Socket s=new Socket();

    GET ALL LOCAL IP ADDRESS in Java, Android

    Syed Masoom Rizvi

    How to get all connected local ip address.

    String myIP=Inet4Address.getLocalHost().getHostAddress();

    for(int i=1;i<=255;i++)
    int pos=myIP.lastIndexOf(".");
    String temp=myIP.substring(0,pos) + "." + i;
    System.out.println("IP Address: " +temp);

    Tuesday, September 16, 2014

    Java - Converting Character to String

    Syed Masoom Rizvi

    How to convert a character to string.

    In Java, character is a data type which use char keyword to make a variable char type, but this character cant by directly type casted to String. Because String is a class.

    To convert character to string, we use Character.toString(char) method.


    char myChar='c';
    String myString="";

    Example 2:

    Monday, September 15, 2014

    Java - Converting String to Integer or Integer to String.

    Syed Masoom Rizvi

    How to convert String to integer or integer to String in Java

    In Java, String is a predefined class in Java which can hold String Value(array of Characters.).
    If any string contain number such as "53", "21" , "110" and you want to use of Integer. It is not directly possible.

    You can convert it by using Integer.parseInt(myStringNumber).

    Example 1:

    Winsock For Microsoft Visual Basic 2008,2010 (.NET) as same as in Visual Basic 6.0

    Syed Masoom Rizvi
    In Viusal Basic 6.0, there is control named "Winsock" which is used to easily create connection with server or opens connection for client.

    But in Viusal Basic NET(2008,2010,2012) this features excluded.
    There is a Winsock as same as in VB6 for latest Visual Basic which behave as same as WinSock.

    Download WinSock For Latest Version

    Java Exception Handling

    Syed Masoom Rizvi
    Exceptions are special types of error which occurred at run time and leads to abnormal termination of the program.
    These exceptions are handled by the programmer.

    Some types of exception are:
    1. Math Error( such as division by zero)

    2. Memory Error(such as memory full, index out of bound)

    3. File system error(such as read/write error, file not found error)

    4. Network Error( such as host not found, port already in use)

    To handle this types of error java provides Exception class. These error handles as follow:

       //my code that may generate errors.
    catch(Exception e)
       // code to be executed if error occurs.

    SQL Database - Select a random row from table in MySQL, PostgreSQL, Oracle, Microsoft SQLServer

    Syed Masoom Rizvi
    For MySQL:

    SELECT * FROM table_name ORDER BY RAND() LIMIT 1

    You can also use below code to make query faster:

    SELECT * FROM table_name WHERE RAND() > 0.9 ORDER BY RAND()

    For PostgreSQL:

    Java - The Four Object Oriented Programming(OOP) Principles

    Syed Masoom Rizvi
    For implementing object oriented model, Java provide three  mechanism :

    1. Encapsulation
    2. Inheritance
    3. Polymorphism
    4. Abstraction
    1. Encapsulation: It is a mechanism of hiding data. It hide the visiblity of fields and field can be changed by using public methods so that the code can be protect from unauthorized access by outer world.

    Sunday, September 14, 2014

    Java - Local Class and Anonymous Class

    Syed Masoom Rizvi

    Local Class and Anonymous Class

    Local Class: If we declare an inner class within a method such class is known as local class.
    Use it if you need to create more than one instance of a class and access its constructor, or introduce a new, named type.

    Android - WebView with custom and local data

    Syed Masoom Rizvi

    How to display custom text, html and local store images on Andoid Webview

    public void viewData()
    WebView w=(WebView)findViewById(R.id.webView1);


    myData= "<html><body><img src='file:///android-res/raw/myfile.jpg' />This is test webpage</body></html>";



    Wednesday, September 10, 2014

    Java - Overloading Method

    Syed Masoom Rizvi
    A class have two or more method with same name but different parameter. This is called overloading method in Java.

    class OverloadingTest
    public void add(String s1, String s2)
    String s3=s1 + s2;
    System.out.println("Addition of two string is: " + s3);

    public void add(int i1, int i2)

    Java - Thread Runnable

    Syed Masoom Rizvi

    Java Thread and Runnable

    Runnable (java.lang.Runnable): Runnable is basically a interface which is used to create a task(runnable code) which can run in Thread. Before reading Runnable you must learn Thread first.

    Runnable define a method run() which must override

    Tuesday, September 9, 2014

    Java - Thread

    Syed Masoom Rizvi

    Thread in Java

    What is Thread?

    Thread is a class, an independent path of execution within a program. A thread execute the provided code(Task) in new process, so the thread run concurrently with your program. 
    Usually thread is use for connectivity(i.e. Networking, Internet, Bluetooth), timer, i/o operation.

    Thursday, September 4, 2014

    1. Install and Setup Java Environment on Windows, Linux

    Syed Masoom Rizvi
    Basic step for installing and setting up environment.

    1. Download Latest Version of Java From Here: JAvA WEBSITE.
    2. Install the Java.
    3. Setting up Environment Variables:

      For Windows XP

    5. Java Creating Objects

    Syed Masoom Rizvi

    How to create object in Java & what its benifit.

    As i said in early lesson that objects is a instance of a class. Each instance have its own unique attribute.

    In this lesson we make two classes. First for the main method and another for a object car.
    Car have the following property:
    Its name in string. Example: "Alto", "Scorpio", " Tavera", "Audi" etc.....
    Its fuel in double. Example: 34.4 , 12.0. 839.343 etc....
    Its fuelLimit in double. Example 100.00 etc...

    It have one method which give the available fuel in that car.

    Let's begin.

    Sunday, August 31, 2014

    4 Java - Basic about Java Classes, Objects and Instance.

    Syed Masoom Rizvi

    JAVA Classes, Java Objects and its Instance

    Java Classes
    In Java, codes are written under a body called class.

    Example: a class with name "MyClass

    class MyClass



    Objects and Instance

    Objects are the real world character created in Java.

    Saturday, August 30, 2014

    3. Java- A HelloWorld Example

    Syed Masoom Rizvi
    Firstly read out few basic rules for java:
    • A class name should be started with a capital letter. Example: HelloWorld.
    • A variable started with small letter. If variable is create by joining two word example : fuel and available then it should be written as fuelAvailable. Same case with function also.
    • Function must have a written type like: void or int or String.... Example: int getFuel(){}, void destroy(){}.
    • In Java, there is no value of new line. You can write all the codes in single line. 

    Now we start a HelloWorldExample:

    2. Learn Java Basics for Beginners

    Syed Masoom Rizvi

    Java Basics

    Java is object oriented programming language, which is easy to learn, compile and run on any Operating System. Java Programs are run by Java Virtual Machine(JVM).

    Every Java Program have a class. Basically a class is a set of variable and functions.

    A car of blue color having functions like blow horn, turn light on or off, drive, show Fuel Available.
    In java this can be written as:

    Sunday, July 20, 2014

    PHP, MYSQL Login Page

    Syed Masoom Rizvi
    Making login page with PHP and MYSQL

    1. Optional (if u dont create any table for login purpose) Create a table "users" with fields "u_id","u_name","u_pass", MYSQL query:

      create table `users`(


      u_name VARCHAR(30),

      u_pass VARCHAR(30),

      PRIMARY KEY(u_id)); 


    Tuesday, June 17, 2014

    [VB6] Using Winsock Basic

    Syed Masoom Rizvi
    Winsock is a socket component which is used for making a tcp connection as well as udp connection.
    This socket is used in many purpose....

    Let's Start

    Create a New Project and add a winsock component, command button, textbox.

    • Create a Standard EXE Project.
    • Goto Project Menu -> Components

    VB6:How to Encrypt/Decrypt string or text.

    Syed Masoom Rizvi
    You can use this function for encrypt or decrypt string... One time it encrypt and another time it decrypt.

    Private Function encdec(str As String) As String

    Dim a As String, b As Integer, c As String
    For i= 1 To len(str)
      a = mid(str, i, 1)
      b = Asc(a) Xor 63 'You can use any number for encrypt from 1 to 255
      c =  c & Chr(b)
    Next i
    encdec = c
    End Function

    Tuesday, April 8, 2014

    Learn Programming Basice with Fun...!!!!

    Syed Masoom Rizvi
    Easy to learn languages
    The first entries I want to mention are really simple. In fact they are not really programming languages at all. They are online games in which you have to control a robot and help it light up all the blue tiles by giving it correct set of commands. All you need is an internet connection, a browser, a mouse and a couple of minutes of your time. Do check them out: Light bot and Light Bot 2.
    Manufactoria is a puzzle game about putting robots in their proper place. With the help of the conveyor-belts, ‘pullers’ and ‘pushers’ you have to build a machine. If you liked the game, you can also try Tile Factory.
    Bug Brain (biologic[DOT]com[DOT]au/bugbrain/) is a game where you build brains to run a bug. You start in the lab where you experiment with the neurons and nodes that make up a brain. After you successfully finish the lab levels, you move out into the field to build a brain for a Lady Bug to help it feed and survive. Bug Brain was tested on Windows XP and it works fine.
    Hello Code (societygames[DOT]com/codealong/) teaches the basics of code (ActionScript 3.0) and the fundamentals of good programming through interactive missions, which can be solved by codes. Just try it out. As the author said:"It is free! If you're not satisfied, money back guaranteed."
    Fantastic Contraption and Fantastic Contraption 2 are online games which teach a user some fundamental programming lessons. For example, this games teach you that there are more than one solutions to the problem and that if you failed to finish the level, you have to go back to the drawing board and find where you did make a mistake. This is similar to programming where you have to find errors in your program. If you want to try them out, you should know that first 21 levels of both games are free, while additional levels and making your own levels are not.
    Merlin Programmer for Kids is a software, which allows 5- to 8- years old children to learn sequential programming by allowing them to make Merlin or any of the other Microsoft Agent characters perform actions, move, speak, listen for and make sounds in a predetermined manner. It is available for Windows only.
    In A. I. Wars 3D: The Insect Mind your goal is to develop a competent reflexes, plus offensive and defensive strategies for your six legged fighting machines code named Cybugs to ensure the survival of your Cybug or your team of Cybugs in a battle simulation. The software is available for Windows only (You need to have Java 5 version or higher installed to the software).
    RoboZZle is a online game, where you must develop a program for a small robot to help it collect all the stars on the screen using specialized programming language (You can play full version if you have Silverlight installed. If you don't have it installed, you can use limited version instead).
    Toontalk is not just a programming language or just a video game. Actually, it is both. Children can build and run all sorts of computer programs inside of it's animated world. While learning how to program they will face challenging puzzles, express their creativity and learn new ways to solve problems. And what is probably the most important thing of all: they will have loads of fun. Toontalk is available for Windows ME, Windows 2000, Windows XP, Vista and Windows 7.
    The last game on my list is the The Codex of Alchemical Engineering. As an Alchemical Engineer, you must build machines out of mechanical arms and magical glyphs that transform and combine atoms in order to create the compounds required so you can pass the level. If you don't want to play the game, but would want to see how it looks like or if you do not know how to start, look at the tutorial for first two levels here. But beware, this game is certainly not easy to play.
    With Alice which is an educational programming language with an IDE, you can easily create an animation for telling a story, play an interactive game, or a video which you can share it on the web. It was designed to be a student's first exposure to object-oriented programming. Alice is available for Windows (XP, Vista, Windows 7), Linux and Mac.
    FMSLogo is a free implementation of a computing environment called Logo and provides support for exploring diverse disciplines, including mathematics, engineering, art, music, and robotics for children in elementary schools. It has a simple GUI and runs fine even on 10-years old computers. FMSLogo is available only for Windows.
    NetLogo is a multi-agent programmable modeling environment which is used by students, teachers and researchers worldwide. It comes with a large library of sample models which cover a large part of natural and social science (Art, biology, Chemistry & Physics, Computer ans Earth Science, Games, mathematics, Network, Social Science and System Dynamics). NetLogo runs on Windows (2000, Windows XP, Vista, Windows 7), Linux and Mac (You need to have at least Java 5 installed to run this software. Java 6 or later is strongly recommended by authors, though.).
    Hackety Hack can help you learn how to make software using Ruby programming language. The solution that Hackety Hack pursues is by teaching with a more traditional programming language, but adding libraries that make it easy to do complicated tasks in one line. It is available for both Windows and Linux. You can visit web sites like Rubymonk.com (interactive book) or TryRuby.com (15 minute interactive tutorial) to see what Ruby is all about.
    Ruby4Kids can help user learn how to make games using Ruby programming language. What makes it easy is the fact that the user can see, run the code and see what its output looks like all at the same time. The programm can do everything that previously mentioned Hackety Hack can (In fact, you can run many of the same code samples from Hackety Hack in KidsRuby.). To access help file, you don't have to have a internet connection, since the file is built into the programm itself. KidsRuby is available for Windows and Mac.
    Kojo is a learning environment which enables the user to play, explore, and learn in diverse areas such are: computer programming, computer and internet literacy, math and science, systematic and computational thinking and also art, music, and creative thinking. Features like syntax highlighting, code completion, and code templates make programming friendlier. Kojo is available for Windows, Linux and Mac (You need to have Java 6 installed on your machine to be able to run Kojo.).
    Scratch is an educational programming language in which user by snapping together visual programming blocks controls images, music and sound. While it is intended especially for 6- to 16-year-olds, who can create projects with their parents or older siblings, people of all ages actually use it. Scratch is available for Windows (2000, XP, Vista, Windows 7), Linux and Mac.
    Children can use Etoys to make their own models, stories and games, which keeps them engaged because it's a lot of fun. It is also a highly effective way to teach math, science, and language arts. Etoys is available for Windows, Linux and Mac.
    Löve is a framework for making 2D games in the Lua programming language. If you want to make a game, you need to create a folder and open up your favorite code editor (it must have Lua support built in). Create a new file in the folder you just created, and name it main.lua. Put the following code in the file, and save it. All that is left for you to do is to drag the folder to love.exe. Löve is available for Windows, Linux and Mac.
    Sploder will allow you to create and edit a platformer, physics puzzle, 3D space mission and classic shooter games. If you want to save the games you made and share them with others, you will have to register (only a username, password and valid e-mail address are needed.)
    Game Develop allows you to create simply and quickly your own video games. Creation process is elaborated through the editor, and no previous knowledge is needed in order to use it. Game Develop is available for both Windows and Linux.
    Processing is a programming language for people who want to create images, animations, and interactions. The language builds on the Java programming language, but uses a simplified syntax and graphics programming model. It is available for Windows, Linux and Mac.
    GameKit is as a full integrated development environment for new programmers to play with high level game programming concepts without needing to know about C++ or OpenGL. It uses a group of custom utilities for creating graphics and sound, and a programming language called Game Kit Language (GKL) for writing code. Because GKL is event-driven, object-oriented, and state-based, it is extremely easy to use once you learn it, and many games can be written in only a page or two of code. GameKit is available for all versions of Windows ranging from Windows 95 to Windows XP.
    With an Adventure Game Studio you can make your own point-and-click adventure game (For other types of games you will have to use some other game making software.). It consists from an editor to create games and a run-time engine to run them. The help file and tutorial for beginners are both included in the package. Adventure Game Studio is available for Windows (2000, XP and Vista), Linux and Mac (You need to have the .NET Framework 2.0 (or later) installed in order to run it.).
    With RPGToolkit you will be able to make a 2D role playing games. It comes with its own simple coding language and also with advanced features such as objects and threading for those with a little programming experience. RPGToolkit is available for Windows XP, Vista and Windows 7.
    Graphical scripter inside 001 Game Creator allows you to easily implement events in the form of a flowchart with simple point and click method. When you will develop a better programming skills, you will be able to make games with text scripting, which is harder than graphical scripting, but allows you to script some things faster. Beginner's, platformer and scripting tutorial are all included in the package. 001 Game Creator is available for Windows XP, Vista and Windows 7.
    Construct Classic is a DirectX 9 game creator for Windows, designed for making 2D games. Indie game designers and hobbyists can use it to enter the world of game creation. Artists can produce games without having to use any programming. Teachers and students can use Construct to teach the principles of logic in a fun way. Developers can use it to rapidly create mockups and prototypes — or simply as a faster alternative to coding. With it's successor, Construct 2, you can also make all sort of games which can run on all modern desktops, mobiles and tablets (Construct Classic is free while Construct 2 Free version offers limited sounds, events and layers). Both software are available for Windows XP, Vista and Windows 7.
    With the help of Kodu, children can make many different types of games, such as racing, strategy, RPGs, adventure, platform, puzzle, 1st person shooters, and others. It is different that some other projects because it avoids typing code by having users construct programs using visual elements via a game controller and also because programs are executed in a 3D simulation environment, rather a bitmapped or 2D display. Kodu is available for Windows XP, Vista and Windows 7 (To run Kodu, you need a graphics card that supports DirectX 9.0c and Shader Model 2.0 or higher, .NET Framework 3.5 or higher and XNA Framework 3.1 Redistributable).
    Robomind is a simple educational programming environment that will familiarize users with the basics of computer science by letting them program their own robot. In addition to an introduction to popular programming techniques, they will also gain insight into areas such as robotics and artificial intelligence. RoboMind is available for Windows, Linux and Mac.
    SOLE 64 (a Google Chrome extension) uses a programming language that is an extension of the Java programming language. With it you can make games and other applications that use text and graphics. There are lessons available inside SOLE 64 to help you get started (You need internet connection to download them from the net and also if you want to save your programms online and share them with others.). If you do not know what to do, just type help and hit Enter to invoke the User Guide.
    Greenfoot is an interactive Java development environment, designed primarily for educational purposes at the high school and undergraduate level. It allows easy development of two-dimensional graphical applications, such as simulations and interactive games. It is available for Windows (XP, Vista, Windows 7), Linux and Mac. (You need to have Java 6 or Java 7 JDK installed on your machine to be able to run Greenfoot.).
    Lazarus is a development tool for the Free Pascal compiler. It's IDE is a stable and feature rich programming environment for creating standalone graphical and console applications. Although it is set up for professional developers, you can set it up for beginners by using package EducationLaz. This package adds some extra option pages to the IDE (Click here to see how this can be made). Lazarus is available for Windows, Linux and Mac (You don't need to have Free Pascal installed on your computer to run this software).
    Python is an easy to learn programming language, which has efficient high-level data structures and a simple but effective approach to object-oriented programming. If you need help, you can either open built-in help file or the online Beginners Guide for Non Programmers which you can get here. Python is available for Windows, Linux and Mac. If you are interested in making games with Python, than you should download Pygame, which is a set of Python modules designed for writing games. It also is available for Windows, Linux and Mac (You have to have Python istalled in order to run Pygame). If you want to see what Python is all about, but you don't want to have it installed on your computer, you can visit web site Learnpython.org, where both tutorial for beginners and advanced users are available. All you have to do is to click on the chapter you wish to begin from, and follow the instructions.
    Just BASIC is a programming language for the Windows operating system. Since it is based on on the classic BASIC programming language it is easy to learn (the detailed tutorial is included in the package), and it has been extended with structured programming facilities and with easy to use GUI commands so you can create your own Windows programs without needing to learn all the underlying details of the Windows operating system. It is available for Windows only (If you need Just Basic for Linux, look here). If web programming is what interest you, than take a look at Run Basic Free Edition. It is available for both Windows (Windows 2000, XP, Vista) and Linux.
    ThinBasic is a Basic Programming Language Interpreter. It is fast and has a lot of features. If you want to learn it, you can execute more than 400 samples provided inside \thinBasic\SampleScripts\. You can also take a look at tutorial for beginners, which you can find inside \thinBasic\Tutorial\. Everything you have to do is to double-click the Tutorial_Intro.tBasic script with your mouse. There are two versions of ThinBasic available: a Windows-based version and a command-prompt-based one.
    The Gentee programming language can be classified as a procedure-oriented language with some features typical of object-oriented programming. While it is true that it has no complicated constructions and is easy to use, this on the other hand doesn't mean that it can't be used for making more complex applications. The Gentee is available for Windows only (older versions are available for both Windows and Linux).
    BlueJ is an IDE for the Java programming language. The features of BlueJ are designed as an aid to learning object-oriented programming concepts, as well as an aid to program development itself. As a result, some commonly available tools differ from other environments, some tools are absent, and other tools are provided not commonly found in development environments. BlueJ is available for Windows (XP, Vista, Windows 7), Linux ans Mac. (You need to have Java 6 or java 7 installed on your computer to be able to run BlueJ.). If you like BlueJ, you can also try Unimozer, which implements mostly the same functionalities as BlueJ does. (If you don't have Java 6 JDK installed, you can still run the software, but it's compiling capability will be limited.) Unimozer is available for Windows and Mac.
    Suneido is a system for developing and deploying applications without the frustrations of integrating multiple different products. It incorporates an object-oriented programming language, client-server relational database software, and application frameworks and components. It includes the integrated development environment used to create applications as well as the client and server required to run applications across networks. The mission of the authors is to provide a simple and lightweight alternative to larger, complex, expensive and closed programming software. Suneido is available for all Windows versions from Windows NT to Windows 7.
    Easy Code is the visual assembly programming environment made to build 32-bit Windows applications. Its interface, looking like Visual Basic, allows the user to program Windows assembler applications in an easy way. Source code of a nice CD player, a complete and fast text editor in a dll file, a complete text editor ready to use, a file shredder, a MIDI player and many other applications are all included in the installer package. If you can't find an answer to your problem in built-in help, you can ask other users in three different forums for advice. There are two versions of Easy Code available - Masm version (using the Microsoft Macro Assembler) and GoAsm version (using the Jeremy Gordon's Go tools). Easy Code is available for all versions of Windows ranging from Windows 95 to Windows 7.
    Racket is a programming language in the Lisp/Scheme family. It distribution features an extensive library that covers systems and network programming, web development, a uniform interface to the underlying operating system, a dynamic foreign function interface, several flavours of regular expressions, lexer/parser generators, logic programming, and a complete GUI framework. It is available for Windows, Linux and Mac.
    Limnor Studio is a generic purpose visual codeless programming system, which opens the door of computer programming to a much broader population. If you are going to use it, you will be able to easily create multimedia interactive kiosks, generate your own CD-ROM presentations, from yearbooks to conferences and trade-shows or make your own data/information management program with databases. There are two versions of Limnor Studio available: Limnor Studio VS (You have to have Microsoft Visual Studio 2008 Shell (Isolated mode) and .Net 3.5 installed on your computer.) and Limnor Studio 5 (You have to have just .Net 3.5 installed). Limnor Studio is available for Windows XP SP3 and Windows 7.
    Programming Without Coding Technology (PWCT) is a visual programming languages framework to create and use general-purpose visual programming languages where the programmer don't need to write the code but can visually specify every functional aspect of the program similar to flowcharts and algorithms. It uses a visual programming method called coding simulation method (CSM) rather than drag-and-drop approach. The author recommends using keyboard shortcuts rather than mouse because you can work faster that way. PWCT is available for Windows only (During installation process you can't change the install directory.).
    Pelles C is a complete lightweight development kit for Windows. It contains (among other things) an optimizing C compiler, a linker, a resource compiler, a message compiler, a make utility and install builders. It also contains an integrated development environment with project management, debugger, source code editor and resource editors for dialogs, menus, string tables, accelerator tables, bitmaps, icons, cursors, animated cursors, animation videos (AVI's without sound), versions and XP manifests. Pelles C is available for Windows 2000, Windows XP, Vista and Windows 7.
    Web page Codecademy Labs allows you to programm online in folowing programming languages: Ruby, Python, and JavaScript. If you sign up (You can sign-in by either giving valid e-mail address and password or with Facebook.), you will be allowed to take lessons in JavaScript (Also, you will be notified when Python and Ruby lessons are going to be put online). If you don't want to take lessons, you can visit web page Learn Programming, where you can learn how to program in C, C++, Java, Pascal, etc..

    SRC:  http://www.techsupportalert.com/content/best-free-ways-learn-programming.htm

    Sunday, March 2, 2014

    [VB6] Making a simple Hello World Program with Command Button

    Syed Masoom Rizvi
    Let's Start

    Step1: Open Visual Basic 6.0

    Step2: Choose "Standard Exe" and click Open

    Step3: Choose Command Button from ToolBar. And then click on your form.

    [VB6] Making a simple text or data encryption and decryption function.

    Syed Masoom Rizvi
    Making a simple text or data encryption and decryption function.

    An encryption and decryption function.
    1. Private Function Enc(eStr as string) as string
    2. Dim a As String, b As Integer, c As String
    3. c = ""

    Friday, February 28, 2014

    VB6: How to get all including hidden, system folders and files?

    Syed Masoom Rizvi
    There is a very easy way of getting all folders and files from a folder, drive including hidden and system files/folders..

    Step1: Create a new project
    Step2: Add a command button
    Step3: Add a listbox
    Step4: Copy and paste this code in your project

    1. Private Sub Command1_Click()
    2. Dim myfiles As String, mypath As String
    3. mypath = "C:\"
    4. myfiles = Dir(mypath, vbNormal + vbDirectory + vbHidden + vbSystem)
    5. Do While myfiles <> ""
    6. List1.addItem myfiles
    7. myfiles = Dir()
    8. Loop
    9. End Sub

    JQuery $.post function - jquery to load data from the server using HTTP POST

    Syed Masoom Rizvi
    POST is basically used for sending form data to server and recive output from the server.
    jQuery $.post() function sends and request data from the server using HTTP POST.

    Syntax: $.post(url,postData,CallBack);

    url: A string contains the url, to which request is send.

    postData: Form data for sending.....

    CallBack: a function which execute when the request succeeds.


    How to set attribute of file/folder in visual basic 6

    Syed Masoom Rizvi
    To set attribute use this:

    1. Private Declare Function SetFileAttributes Lib "kernel32" Alias _
    2. "SetFileAttributesA" (ByVal lpFileName As String,_
    3. ByVal dwFileAttributes As Long) As Long
    5. Private Sub cmd_Click()
    6. SetFileAttributes "c:\a.txt", vbArchive
    7. End Sub

    Where "c:\a.txt" is a filename, you can replace it by directory name or filename.
    Instead of vbAchrive you use:

    How to detect drive types in Visual Basic 6 (VB6)

    Syed Masoom Rizvi
    Here is an idea to detect Drive Type in VB6....

    Goto Project Menu -> References
    Tick on Windows Script Host Modal Object (scroll at last to get)
    Click Ok
    Now, Copy this function and paste in your form:

    private function mDriveType(DriveLetter as string)

    Thursday, February 27, 2014

    JQuery $.get function - jquery to load data from the server using HTTP GET

    Syed Masoom Rizvi
    GET is basically used for getting your data from the server.
    jQuery $.get() function request data from the server using HTTP GET.

    Syntax: $.get(url,CallBack);

    url: A string contains the url, to which request is send.

    CallBack: a function which execute when the request succeeds.


    Wednesday, February 26, 2014

    Check IF file exists or not - C, C++ Programming Language

    Syed Masoom Rizvi
    This may be the best way for checking if a file exists or not. 

    Saturday, February 22, 2014

    Presentation on Internet Security

    Syed Masoom Rizvi
    Project For Computer Science Students on Internet Security.

    1. Introduction

    Internet security is a branch of computer security specifically related to the Internet, often involving browser security but also network security on a more general level as it applies to other applications or operating systems on a whole. Its objective is to establish rules and measures to use against attacks over the Internet. The Internet represents an insecure channel for exchanging information leading to a high risk of intrusion or fraud, such as phishing. Different methods have been used to protect the transfer of data, including encryption.

    Saturday, February 8, 2014

    Learn PHP - Variables

    Syed Masoom Rizvi

    Variables are those words whose value varies and use to store constants like 5,6,"hello" etc..

    In PHP variabes are declared by $(dollar sign).

    Syntax: $variable_name

    Variable may be anytype. There is no need to define variable for any data type, PHP auto define it when the first value passes to variable.


    $x = 5; //Integer type variable

    $m = "hello"; //string type variable

    $x = 5;
    $y = 8.5; // float type variable.
    $z = $x + $y; //float type variable.
    echo $z;
    //Output: 13.5

    Rules for defining variables:
    * Variable start with alphabets.
    * It can be alphanumeric with special symbol _ .

    Learn PHP - Syntax

    Syed Masoom Rizvi
    PHP script can be placed everywhere in the php file. PHP script starts with <?php and ends with ?>.

    Learn PHP - Introduction

    Syed Masoom Rizvi

    PHP is a server side scripting language, and is a powerful tool for making dynamic and interactive Web pages quickly.PHP is a widely-used and it it is free.
    Official PHP website has installation instructions for PHP
    @ http://php.net/manual/en/install.php
    <!DOCTYPE html>
    echo "My first Php Page";

    Thursday, January 23, 2014

    Learn C Programming in 7 Days only

    Syed Masoom Rizvi
    Learn C Programming in 7 Days only

    Lets Start......
    First we have to know what is C??
    Ans: C is a programming language developed by  Dennis Ritchie between 1969 & 1973 at AT&T Bell Laboratory.
    • It is structured programming language.
    • It allow recursion and lexical variable scope.
    • It is portable language i.e. It available on all platform like Mac,Windows, Unix.
    • User-defined types are allowed in C by a typedef function.
    • There is small fixed number of keywords i.e. if,else, while, do etc.
    • There are large number of arithmetic and logical operators.

    Now we make a first hello world application.