Monday, November 28, 2011

How to make VLC video as desktop background

Hi guys today i was searching for how to make a VLC video as your desktop background. Its very easy just few simple steps and your are done.

Note: - If you are using windows 7. And you wallpaper changes after a certain period of time just disable it so as  to run the video as your wallpaper.

Now the process of making the video as wallpaper is
1. Open VLC media player. And press Ctrl + P. It will open preferences.

2. Go to Video tab in the preferences. And there change the setting of output from DEFAULT to DirectX video output.As shown in fig.

3. Now restart your VLC and right click on the VLC screen go into video menu and click on DirectX Wallpaper. Your video is now running as your desktop background . Enjoy.


One more thing i forgot to tell. Whenever you want to remove the video from your background just refresh your screen and you are done.                                                                                     

Thursday, November 17, 2011

Using sleep in dev cpp

Sometime we require a screen to stay for a while and moreover we don't want to use key pressing to move, we just want to use the concept of sleep for a while then its quite easy in dev we just need to write the code :


#include <time.h>
 
time_t now, later;
 
void sleep(int delay)
{
 now=time(NULL);
 later=now+delay;
 while(now<=later)now=time(NULL);
}
 

"TIME.H" comes pre installed with dev cpp. So need not worry about it.

Wherever you want ot use sleep now just call

sleep(2);
here 2 denotes the number of seconds it will sleep for. Keep in mind its seconds not milliseconds.
Now a screen can stay and move whenever you want without using keyboard.

Wednesday, November 16, 2011

Running C / C++ in Ubuntu


  1. Install the build-essential package by typing the following command in the terminalsudo apt-get install build-essential
  2. Now create a file that has the extension .c (if you plan to write a C program) or .cpp (for a C++ program).
  3. Write the code in that file.
  4. Now open a terminal and go to the place where you saved that file using the cd command (e.g. cd Desktop).
  5. If you have a C program type in the terminal 
    • gcc -Wall -W -Werror hello.c -o hello.c
    • The first line will invoke the GNU C compiler to compile the file hello.c and output (-o) it to an executable called hello.
    • The options -Wall -W and -Werror instruct the compiler to check for warnings.
    • If you have a C++ program simply replace gcc with g++ and hello.c with hello.cpp. The options do the same things.
    • If you get a permissions error, you need to make the file executable. You can do this with chmod +x hello.cpp
    • Now type in the terminal ./hello and the program will run.

    Tuesday, November 15, 2011

    Installing Wine on Ubuntu

    Type sudo apt-get install wine on the terminal. It will download the whole package required for wine and then it will install it.
    Next you need to change every exe to executable using the command on the terminal chmod 755 ~/Downloads/INSTALL.EXE. ~/Downloads/ denote the path and INSTALL.EXE is the name of the file.
    Now to run the exe using wine just type wine ~/Downloads/INSTALL.EXE on the terminal it will execute the required exe on your system.



    Creating Bootable flash drive for Ubuntu

    When hard disk of my system crashed i faced a lots of problem searching for some thing that will get my system running until i get the new one. So i thought of several things but one thing that suited me the best was having a boot-able flash drive for Ubuntu. That's easy to make and you can run live Ubuntu very easily.
    Just you need to have items mentioned in the check list
    Check List:-
    1. Flash Drive (Minimum 1 GB) but recommended from my side is 2 GB (Note : Format the flash drive ).
    2. An internet connection with reasonable speed.

    Just follow the below mentioned steps
    1. Download Universal USB installer from Here.

    Select the circled link.
    2. Insert your Flash drive in the USB port.
    3. Download latest Ubuntu from Here

    Download Ubuntu from highlighted option.
    4. run the Downloaded Universal USB installer as Administrator. And Click On I Agree when asked about Licensed Agreement.
    5. You will see the following screen. Do as directed in the image.

    6. When you select your flash drive you will see Persistence level bar below the combo box where you selected drive. Just set some persistence level so that changes you made when you are running live Ubuntu can be stored. You will also get a check box asking you want top format the drive just beside the combo box. Don't check that as our drive is already formatted.
    7. Than just click on create and click on yes when it ask for yes or no.
    8. wait for around about 10 minutes. Your Flash Drive is ready.

    Restart the system And in Your BIOS setting make USB as the top Boot priority.

    Now when you exit the BIOS setting you can Either Install Ubuntu From USB for you can run Live Ubuntu also.



    LINQ (Language Integrated Query) in c#

    It is very common for applications to use data in SQL databases or XML documents. Traditionally, developers had to learn a primary programming language, such as C#, and a secondary language, such as SQL or XQuery. Language-Integrated Query (LINQ) brings query capabilities into the C# language itself. Now, instead of learning a separate query language, you can use your knowledge of C#, together with some additional keywords and concepts, to query SQL databases, ADO.NET datasets, XML documents, and any .NET collection class that implements the IEnumerable interface.


    Advantages :-

    • Familiar syntax for writing queries.
    • Compile-time checking for syntax errors and type safety.
    • Improved debugger support.
    • IntelliSense support.
    • Ability to work directly with XML elements instead of creating a container XML document, as required with W3C DOM.
    • In-memory XML document modification that is powerful, yet simpler to use than XPath or XQuery.
    • Powerful filtering, ordering, and grouping capabilities.
    • Consistent model for working with data across various kinds of data sources and formats.

      For Examples of Linq Go to THIS.

    Connect to wireless network in ubuntu


    Connecting using Network Manager

    Network Manager (System → Administration → Network) supports Roaming mode. This allows you to connect to any available wireless network in range.
    1. In the Taskbar click the Network Manager icon.
    2. Select your wireless network from the list.
    3. Enter your Network Key.
    4. Click Connect.

    Manually connecting

    1. Select the connection and press Properties.
    2. From the Network Name drop down box choose your router. If it is not shown your router may not broadcast its ID. In this case manually enter the ESSID.
    3. Select the Password Type and enter your password.
    4. If your ISP gave you a static IP address then select Static IP Address from the Configuration box.
    5. If your router assigns IP addresses then leave the Configuration as Automatic Configuration (DHCP).
    6. Click OK.

    Monday, November 14, 2011

    extract methods from a cs or vb code file without reflection

    We have a third party dll which can be used to extract the namespace, class and methods(anything) from a cs or vb code file. Simply we just need to use the dll in our code and run some of its functions. I have given a screen shot of what can be the way to extract the methods you can download the dll from this. And the name of the dll is NReFactory its open source.

    Useful Links for placement preparation

    http://www.geeksforgeeks.org/

    www.twenty19.com

    Wanna check where you stand

    try

    www.gild.com

    Create Windows 7 AIO(All in One Disk)


    Requires:
    • Windows 7 DVD/ISO (x86 & x64) – You can choose any edition, because the DVD holds the all editions i.e. Starter, Home Basic, Home Premium, Professional and Ultimate.
    • Windows 7 Enterprise DVD/ISO (x86 & x64) – Windows 7 Enterprise is not available through retail channels.
    • Windows Automation Installation Kit (WAIK for Windows 7)
    • Blank DVD (DVD5 – 4GB in size) compatible DVD Burner and CD/DVD burning software (like Nero,ImgBurn)
    How To:
    (We have merged all x64 editions one by one into x86 DVD, because x64 DVD has 64-bit contents that can’t run under Win32 mode but Vista x86 content can run under 64-bit environment easily under SYSWOW64 and x64 DVD has only less editions than x86 DVD)
    1. Install WAIK and the burning program & create folders as shown in figure:





















    We created a folder named AIO on the root of E: drive and then two subfolders named DVD and WIMs in AIO.
    2. Now copy/extract the content of Windows 7 x86 edition into DVD folder and copy/extract all WIM image file (install.wim, located under sources folder) into WIMs folder.
    We extracted and renamed all WIM images like that.
    3. First of all unlock the x86 editions, delete ei.cfg file from AIO\DVD\Sources folder. For more information:Unlock all editions from Windows 7 ISO image (x86 and x64)

    4. Run WAIK command prompt (Deployment Tools Command Prompt) As Administrator
    Start > All Programs > Microsoft Windows AIK > Deployment Tools Command Prompt












    Each edition has an unique INDEX NO. in the install.wim (WIM file), you can check using the following command.
    Windows 7 x86        Windows 7 x64    Windows 7 Enterprise x86     Windows 7 Enterprise x64
    Starter – 1               Home Basic – 1   Enterprise – 1                       Enterprise – 1
    Home Basic – 2       Home Premium – 2
    Home Premium – 3  Professional – 3
    Professional – 4       Ultimate – 4
    Ultimate – 5


    These INDEX NOS will be needed, when we export one edition from an WIM file to another one.
    5. Now execute the following command with appropriate INDEX NO to export a copy of the specified edition to another WIM file.




    For Us, the commands will be as follows:
    For Windows 7 Enterprise x86
    Imagex /export “E:\AIO\WIMs\Windows_7x86_ENT.wim” 1 “E:\AIO\DVD\sources\install.wim” “Windows 7 ENTERPRISE”
    For Windows 7 Home Basic x64
    Imagex /export “E:\AIO\WIMs\Windows_7x64_ULT.wim” 1 “E:\AIO\DVD\sources\install.wim” “Windows 7 HOMEBASIC (x64)”
    For Windows 7 Home Premium x64
    Imagex /export “E:\AIO\WIMs\Windows_7x64_ULT.wim” 2 “E:\AIO\DVD\sources\install.wim” “Windows 7 HOMEPREMIUM (x64)”
    For Windows 7 Professional x64
    Imagex /export “E:\AIO\WIMs\Windows_7x64_ULT.wim” 3 “E:\AIO\DVD\sources\install.wim” “Windows 7 PROFESSIONAL (x64)”
    For Windows 7 Ultimate x64
    Imagex /export “E:\AIO\WIMs\Windows_7x64_ULT.wim” 4 “E:\AIO\DVD\sources\install.wim” “Windows 7 ULTIMATE (x64)”
    For Windows 7 Enterprise x64
    Imagex /export “E:\AIO\WIMs\Windows_7x64_ENT.wim” 1 “E:\AIO\DVD\sources\install.wim” “Windows 7 ENTERPRISE (x64)”
    6. Once you are done! The WIM image in AIO folder will be an Universal WIM file, which will have all editions of Windows 7. The size of WIM file would be approx 3.41GB. Now DVD folder is ready and you can make bootable DVD and UFD to take a shot.
    How to make bootable UFD: Install Windows Vista and Windows 7 using bootable USB storage device.
    How to make bootable ISO or DVD: Create bootable Windows Vista and Windows 7 DVD or Create bootable Windows 7 DVD using Nero.
    7. Windows 7 AIO is ready now! You have followed simple 7 steps to create Windows 7 All-In-One DVD, that includes total 11 editions and fit into a single layer DVD.



    Apart from all these things, it save your 3 blank DVDs and lots of bandwidth, which could be used to download different editions of Windows7. So install it and have fun…
    Applies To:
    • Windows 7 family (It also works with Windows 7 SP1)
    • Windows Vista family
    • Windows Server 2008


    How to make a bootable pen drive for windows 7 or windows 8

    Hey,
    You dont require any extra toll no need to download anything you just need to have command prompt and windows cd/dvd
    Now perform the following steps to reach the goal
    1. Insert your pen drive and start command prompt.
    2. On command prompt type DISKPART
    3. Then you will get diskpart command prompt isntead of the users one. Type there LIST DISK.
    4. Next step is you need to type SELECT DISK # (here # is the number of disk given to ur flash drive from list disk).
    5. now type CLEAN on the prompt.
    6. now CREATE PARTITION PRIMARY.
    7. ACTIVE
    8. FORMAT FS = NTFS it will take some time.
    9.  Type ASSIGN to assign a drive to the disk.
    10. EXIT to exit from diskpart prompt.


    The on normal prompt go to the BOOT folder inside ur cd/dvd using prompt.


    then type  BOOTSECT /NT60 E: here E: is the drive assign to ur flash drive.

    Now just copy whole content of your disk to the flash drive.

    And reboot the system and make the boot priority of USB drive as top most.

    And enjoy you can install windows using Flash drive now.