Jump to content
xisto Community

abdo1405241556

Members
  • Content Count

    18
  • Joined

  • Last visited

About abdo1405241556

  • Rank
    Newbie [Level 1]
  1. i have two adsl line i need to load balance the two line and make them one line out
  2. // Program to check whether the given string is palindrome or not using library functions#include<iostream.h>#include<string.h>int main(){ char str[80],temp[80]; cout<<"Enter string to check \n"; cin>>str; strcpy(temp,str); strrev(temp); if(strcmp(str,temp)==0) cout<<"\n Given string is palindrome"; else cout<<"\n Given string is not palindrome"; return 0;} Test data 1 Enter string to check madam Output Given string is palindrome Test data 2 Enter string to check master Output Given string is not palindrome // program to check whether the string is palindrome or not If not make it a palindrome by adding to its end #include<iostream.h> int main() { char str[80],temp[80]; int i=0,n=0,flag; cout<<"Enter string to check \n "; cin>>str; while(str!='\') { ++n; ++i; } for(i=0;i<n/2;i++) { if(str!=str[n-i-1]) { flag=0; break; } else flag =1; } if(flag==1) cout<<"\n Given string is palindrome"; else { for(i=0;i<n-1;i++) str[n+i]=str[n-i-2]; str[n+i]='\'; cout<<"\n Given string is converted to palindrome"; cout<<str; } return 0; } Test data 1 Enter string to check madam output Given string is palindrome Test data 2 Enter string to check mouse Output Given string is converted to palindrome mousesuom // Program to find whether a given number is palindrome or not If not make it palindrome by adding to its end #include <iostream.h> int main(void) { long n,i,j,sum=0; cout<<"Enter any number \n"; cin>>n; j=n; while(j) { sum =sum*10+j%10; j /=10; } if(sum==n) cout<<"\n palindrome"; else { i=n; n/=10; while(n) { i= i*10+n%10; n /=10; } cout<<"\n new palindrome"<<i; } return 0; } Test data 1 Enter any number 121 Output palindrome Test data 2 Enter any number 123 Output new palindrome 12321 // Program to find the maximum sum of consecutive positive integers #include <iostream.h> #include<conio.h> int main() { int a[50]; int i,n; int sum=0,maxsum=0; clrscr(); cout<<"Enter how many numbers \n"; cin>>n; for(i=0;i<n;i++) cin >> a; for(i=0;i<n;i++) { if(a> 0) sum = sum + a; if(sum>maxsum) maxsum=sum; if(a<0) sum=0; } cout<<maxsum; return 0; } Test data Enter how many numbers 12 -5 1 2 3 -7 4 6 -1 1 1 1 1 Output 10 // Program to sort given names #include<iostream.h> #include<string.h> #include<conio.h> int main() { char name[5][20],temp[20]; int i,j; clrscr(); cout<<"Enter 5 names \n"; for(i=0;i<5;i++) cin>>name; for(i=0;i<4;i++) { for(j=i+1;j<5;j++) { if(strcmp(name,name[j])>0) { strcpy(temp,name); strcpy(name,name[j]); strcpy(name[j],temp); } } } cout<<"The sorted names are \n"; for(i=0;i<5;i++) cout<<name<<"\n"; return 0 ; } Test data Enter 5 names java oracle cplusplus perl cobol Output The sorted names are cobol cplusplus java oracle perl // Program to convert binary to decimal #include<iostream.h> #include<math.h> int main() { int m,i=0,sum=0,a[16],j,x=0; long no; cout<<"Enter Binary number:"; cin>>no; while(no>0) { m=no%10; a=m; ++i; no=no/10; } for(j=0;j<i;j++) { sum=sum+a[j] * pow(2,x); ++x; } cout<<"\n Decimal number : "<<sum; return 0 ; } Test data Enter Binary number : 100011 Output Decimal number : 35 // Example program for call by reference #include<iostream.h> void change(int &,int &); int main() { int a,b; cout<<"Enter values for a and b \n"; cin>>a>>b; change(a,; cout<<"\n The values of a and b after executing the function :"; cout<<a<<" "<<b; return 0 ; } void change(int & c, int & d) { c=c*10; d=d+8; cout<<"The values of a and b inside the function :"<<c<<" "<<d; } Test data Enter values for and b 2 3 The values of a and b inside the function : 20 11 The values of a and b after executing the function : 20 11 // Example program for call by value #include<iostream.h> void change(int,int); int main() { int a,b; cout<<"Enter values for a and b \n"; cin>>a>>b; change(a,; cout<<"\n The values of a and b after executing the function :"; cout<<a<<" "<<b; return 0 ; } void change(int c, int d) { c=c*10; d=d+8; cout<<"\n The values of a and b inside the function : "<<c<<" "<<d; } Test data Enter values for a and b 2 3 Output The values of a and b inside the function : 20 11 The values of a and b after executing the function : 2 3
  3. If you're running a fairly recent kernel, probably not. Older kernel versions required scsi-emulation to be set up for the drives, but recent versions support direct ATAPI/IDE access. If you're using a 2.6.x version kernel, you almost certainly are ready to go. An easy way to test if direct ATAPI access is available is to install cdrecord (mentioned below) and issue the command Code: $ cdrecord -dev=ATAPI -scanbusIf your drives are mentioned in the scan output, you're ready to go.2. How can I burn CDs/DVDs under linux?Burning Software:GUI:xcdroast: an easy to use graphical front end for the cdrtools and cdrecord-prodvd. Originally based on the SCSI emulation interface to IDE, so it can be a quite unresponsive interface at times. k3b: A KDE-based burning frontend, similar interface to Nero. Slightly more user friendly than xcdroast but has fewer options. However, in most cases it is much faster and more useful (uses dvd+rw-tools for dvd burning and ide-cd access). CLI:cdrtools: A helpful cd burning toolkit, includes mkisofs for creating images. Example commandlines:Code:# mkisofs -dvd-video -V MY_VOLNAME -o dvdvideo.iso /path/to/video/Creates a DVD-Video image called dvdvideo.iso with volume name MY_VOLNAME from the /path/to/video/ folder# cdrecord -dev=/dev/hdd -dao image.isoburns the imagefile image.iso in Disk-At-Once mode to the /dev/hdd drivecdrecord-proDVD: The DVD-enabled version of cdrtools, requires a (freely available) key for images over 1 gig. Syntax is similar to cdrtools. dvd+rw-tools: A DVD burning kit that includes support for both DVD+R and DVD-R and changing the booktype of DVD+ media. Example commandline: Code:# growisofs -Z /dev/hdd=image.isoburns the imagefile image.iso to the drive /dev/hdd2B. How can I get the media code (disc identifier) of a blank DVD+/-R?Once again the dvd+rw-tools are helpful in this regard - the command Code:$ dvd+rw-mediainfo /dev/dvdwhere /dev/dvd is your DVD drive containing the media in question will spit out among many other pieces of information the media identifier code of the DVD blank.3. What linux applications support dual layer DVD discs?Although I haven't personally tested it, the dvd+rw-tools mentioned above support dual layer discs (as well as k3b, which is a frontend for the dvd+rw-tools).4. What linux applications support booktype / bitsetting? Recent version of the dvd+rw-tools (mentioned above) support dvd-rom booktype modification for both DVD+R and DVD+RW media. Bitsetting command line examples: Code:# dvd+rw-booktype -dvd-rom -media /dev/hddSet the booktype of a DVD+RW disc to dvd-rom# dvd+rw-booktype -dvd-rom -unit+r /dev/hddif issued before burning, this command instructs the drive at /dev/hdd to set the booktype to dvd-rom (blank media must be in drive)5. How can I create / play XCDs?mode2cdmaker can be used to create 800MB xcd images from any media content. Make sure not to use the -s switch when creating XCD images (the default under some windows GUIs) because using only one track will render the XCD unreadable under current linux drivers. An example commandline is:Code:$ mode2cdmaker -m moviefile.mkv -v MY_TITLE -e DAT -o myimageCreates an imagefile with basename myimage and volume ID MY_TITLE adding moviefile.mkv as a form-2 file with an extension of .DAT for mode 2 files.To playback an XCD, simply issue the mplayer command:Code:$ mplayer vcd://2 -cdrom-device /dev/hdcwhere /dev/hdc is the device file of the CD-ROM drive that contains the XCD. Mplayer should auto detect the file format.
  4. cdparanoia is currently the most accurate native linux ripping tool available. Its commandline interface is fairly easy to use, but it is also available in several GUIs. grip is a fully featured graphical CD-ripper that has built-in cdparanoia support, ID3 tag support, and can be configured to encode virtually any format you want. 2. Is there a good audio editor available? audacity is an open source audio editor that supports recording, conversion, and editing of ogg vorbis, MP3, and WAV audio, and supports a vast array of audio filters and plugins. Source and binary packages are available on their homepage. 3. What tools can I use to extract an audio track from AVI/MKV/MP4? AVI: AVIdemux2: Graphical interface avi2raw: A tool included with the mpeg4ip package, use with the --audio switch mplayer: can be used for AVI and other formats with the -dumpstream option MKV: mkvextract: included with the mkvtoolnix package, can demux almost any matroska stream MP4: mp4creator: part of the mpeg4ip package, use with the -extract=trackid option MP4Box: included with the GPAC project, see 'MP4Box -h extract' for information 4. What encoders are available for various audio formats? Lossy Formats MP2: toolame MP3: lame: highest quality MP3 encoder Ogg Vorbis: vorbis-tools: available under most distributions AAC: FAAC: Freeware Advanced Audio Coder MPC: musepack-tools: the official MPC encoder AC3: libavcodec includes an AC3 encoder, available in ffmpeg and others Lossless formats Wavpack: Advanced lossless encoder featuring a unique hybrid mode. CLI encoder is available under *nix. FLAC: Free Lossless Audio Codec, one of the best and most supported lossy formats. CLI encoder builds under *nix, plugins available for xmms, amarok, and more. 5. How can I play AC3/DTS over S/PDIF (digital) output? All the popular players for linux (xine, mplayer, vlc) include AC3 decoding support 'out of the box'. For s/pdif output, your player will need must also be ALSA (advanced linux sound architecture) compatible. Steps to using alsa are as follows: 1. Make sure your sound card is supported by checking alsa-project.org. 2. Make sure your kernel has alsa support compiled in. ALSA is the default sound architecture in the 2.6.x kernels, and many 2.4 kernels shipping with distributions are compiled with alsa built-in. 3. Install software & set up your soundcard: make sure you have the alsa-driver, alsa-lib and alsa-utils installed (may be called something else in different distributions) and run alsaconf. You will be prompted to select your soundcard. If you have no error messages, then run alsasmixer to set your default levels. Make sure to activate the S/PDIF output if you wish to use it. On my card, this is referred to as "IEC958 output". 4. Install a player with alsa support. The simplest way to see if mplayer has alsa support is to type 'mplayer -ao help' and see if alsa is one of the choices. If your mplayer does not contain alsa support, simply build mplayer from source, and if you have alsa-lib (+ alsa-lib-devel on some platforms) mplayer will detect and compile in alsa audio out support. Then add a '-ao alsa' to your playback command or your mplayer.conf file, and the alsa output will be used. To playback AC3 over spdif, you'll also need to add a '-ac=hwac3' switch to your commandline. Alternatively you can add 'ac=hwac3,' to your mplayer.conf file (note the comma after hwac3), which will cause mplayer to try ac3 pass through first on any file and then other codecs. http://www.linuxdvb.tv/documentation/ac3sound.html http://forums.xisto.com/no_longer_exists/ http://liba52.sourceforge.net/ 6. How can I losslessly raise the volume of my MP3/OGG/WAV audio? MP3: MP3Gain supports analysis and lossless gain of MP3 files Ogg Vorbis: vorbisgain calculates a replaygain value and stores it in the header of OGG files WAV: normalize can be used to normalize WAV audio 7. How can I split my MP3/OGG/WAV audio? Try mp3splt for MP3 or OGG audio or wavsplit for WAV audio.
  5. What MPEG-4 codecs are available for encoding under linux?MPEG-4 ASP / MPEG-4 Part 2 codecsXviD - High-quality advanced GPL MPEG-4 ASP codec, included in many distributions, fast and excellent quality. Supported in mplayer, ffmpeg, transcode, dvd::rip, and many other applications libavcodec - MPEG-4 ASP is one of the codecs supported by the libavcodec library, very fast and highly configurable, good quality, the range of options can be a bit intimidating to linux newbies at first. Supported in mplayer, ffmpeg, transcode, and many other applications OpenDivx / ProjectMayo / divx4linux - various Early DivX codec implementations for linux, not nearly as good as xvid or libavcodec, supported in mplayer and others MPEG-4 AVC / H.264 / MPEG-4 Part 10 codecsx264 - GPL H.264 / AVC codec, probably the best open-source H.264 encoder, fast, early in development but becoming more advanced very quickly, available in mencoder, VLC, or its native commandline interface. 2. What's the easiest way to backup a DVD to mpeg-4?dvd::rip is a full featured GUI for DVD ripping and supports many different codecs and audio formats. Also see the 'General Encoding' section above for more GUI links.If you want to go through the process yourself, check out Mosu's DVD transcoding guide for a great walk through of all the steps involved. A quicker overview by Nico is available here. How can I mux and playback matroska (MKV, MKA) files?mkvtoolnix, the matroska toolkit builds natively under linux (both GUI and CLI interfaces), providing an easy way to create matroska files from many different codecs. See the mkvtoolnix homepage above for links to binaries and sources.Playback of matroska files is supported in mplayer, VLC, and other players.See the matroska FAQ for general matroska information.2. How can I mux and playback MP4 container format files?gpac provides an advanced MPEG-4 toolkit, including the MP4Box information and muxing tool and the Osmo4 MP4 player. ASP, AAC, and MP3 can be muxed using MP4Box. Note that MP4Box also removes packed bitstream and other AVI hacks from MPEG-4 in AVI.mpeg4ip provides open source encoding, muxing, playback, and streaming tools for MP4. AVC, HE-AAC, LC-AAC, ASP and other formats can be muxed using mp4creator included with mpeg4ip.MP4 playback is also supported in mplayer and VLC.See the MP4 FAQ for more information on the MP4 container format.3. How can I mux and playback OGM container format files?OGMTools is a native linux tool supporting creation of, extraction from, and information about OGM files.OGM is supported for playback in mplayer, VLC, and others.See the OGM FAQ for more information on the OGM container format.
  6. The basic libraries you'll want are libdv (DV-format decoding library), libraw1394(IEEE-1394/firewire hardware access library), and libavc1394 (AVC control library, so you can play and pause your camera via computer control). Please note that many broken libraw1394 packages do not properly setup the /dev/raw1394 device. If you encounter problems when running dvgrab, kino, or other DV capturing programs regarding the raw1394 interface, try the following commands to create the /dev/raw1394 device: Code: # /bin/mknod -m 600 /dev/raw1394 c 171 0 # /bin/chown root:root /dev/raw1394You can also create this device by running 'make dev' from the libraw1394 source tree. 2. What programs can I use to capture/edit DV video? After the above mentioned libraries are installed, you can use dvgrab to capture DV video via commandline or kino for a graphical interface (kino is a nice video editor as well). Using dvgrab from commandline is fairly easy and intuitive. A good way to start is to connect your camera to your IEEE1394 port and start by running Code: dvgrab -i --format dv2 output.aviThis will start dvgrab in interactive mode (type ? to see camera controls) using type-2 AVI as output. See 'man dvgrab' for more information. Kino is also a great choice for a graphical capturer/editor - its interface is rather intuitive and easy to use. 3. What programs can I use to further process / encode my DV video? The mjpegtools provide a set of useful command line apps for processing DV (and other) video. The tools are set up so that they can be used in a pipe sequence for video processing. For example you can use lav2yuv to decode DV video to YUV, yuvscaler to resize the video, and mpeg2enc to encode to mpeg-2 video (all these apps are part of the mjpeg suite). 'man mjpegtools' will give you a good tutorial for using the different utilities. mjpegtools also includes the lav2mpeg bash script utility to automate the encoding steps for you for different targets (vcd,svcd,mpeg1/2). Note that you'll need to make sure your version of mjpegtools is compiled with DV video support (using libdv) in order to encode DV. If you're compiling from source, you can add the '--with-dv' option to mjpegtools' configure script. See 'man mjpegtools' and http://mjpeg.sourceforge.net/ for more help. Additionally, when configured with libdv support, mplayer/mencoder can be used to play, filter, and transcode DV video to any of mplayer's supported codecs.
  7. The basic libraries you'll want are libdv (DV-format decoding library), libraw1394(IEEE-1394/firewire hardware access library), and libavc1394 (AVC control library, so you can play and pause your camera via computer control). Please note that many broken libraw1394 packages do not properly setup the /dev/raw1394 device. If you encounter problems when running dvgrab, kino, or other DV capturing programs regarding the raw1394 interface, try the following commands to create the /dev/raw1394 device: Code: # /bin/mknod -m 600 /dev/raw1394 c 171 0 # /bin/chown root:root /dev/raw1394You can also create this device by running 'make dev' from the libraw1394 source tree. 2. What programs can I use to capture/edit DV video? After the above mentioned libraries are installed, you can use dvgrab to capture DV video via commandline or kino for a graphical interface (kino is a nice video editor as well). Using dvgrab from commandline is fairly easy and intuitive. A good way to start is to connect your camera to your IEEE1394 port and start by running Code: dvgrab -i --format dv2 output.aviThis will start dvgrab in interactive mode (type ? to see camera controls) using type-2 AVI as output. See 'man dvgrab' for more information. Kino is also a great choice for a graphical capturer/editor - its interface is rather intuitive and easy to use. 3. What programs can I use to further process / encode my DV video? The mjpegtools provide a set of useful command line apps for processing DV (and other) video. The tools are set up so that they can be used in a pipe sequence for video processing. For example you can use lav2yuv to decode DV video to YUV, yuvscaler to resize the video, and mpeg2enc to encode to mpeg-2 video (all these apps are part of the mjpeg suite). 'man mjpegtools' will give you a good tutorial for using the different utilities. mjpegtools also includes the lav2mpeg bash script utility to automate the encoding steps for you for different targets (vcd,svcd,mpeg1/2). Note that you'll need to make sure your version of mjpegtools is compiled with DV video support (using libdv) in order to encode DV. If you're compiling from source, you can add the '--with-dv' option to mjpegtools' configure script. See 'man mjpegtools' and http://mjpeg.sourceforge.net/ for more help. Additionally, when configured with libdv support, mplayer/mencoder can be used to play, filter, and transcode DV video to any of mplayer's supported codecs.
  8. There are several simple dvd-ripping tools available. vobcopy can be used. First you'll want to mount your dvd (assuming the mount point is /mnt/dvd and is set up in your /etc/fstab): Code:$ mount /mnt/dvdThen you can rip the main title using vobcopy: Code:vobcopy -i /mnt/dvdThis will rip the main title only, similar to IFO-mode in DVD Decrypter. if you want to rip the entire disc preserving structure, use Code:vobcopy -i /mnt/dvd -m.You can also use dvdbackup from the dvd-create project to rip dvds in a similar fashion.2. How can I backup a DVD using fast (compressed-domain) transcoding, like DVDShrink?StreamDVD is a native linux application for transcoding DVDs on the fly. Its advantages are that it does not require the dvd to be ripped, demultiplexed, transcoded, and remultiplexed, rather it reads directly from the DVD and writes a valid DVD vob to standard out that can be piped to dvdauthor. It also has a good quality accurate transcoding engine. Its disadvantages are that it does not handle full discs or menus, but does single titles only. StreamDVD's usage is quite easy (as quoted from the documentation): When using dvdauthor to build the dvd structure, you can generate a new dvd with only one step. You can pass the complete streamdvd commandline (followed by a '|') to the -f switch in dvdauthor.i.e.: lets say your dvd drive is accessable at /dev/dvd, the saving directory is /movies/movie1 and you want to backup title 1, all chapters with 1st video and 1st audio track:Code:dvdauthor -t -o /movies/movie1 -f 'streamdvd -i /dev/dvd -t 1 -s 0xe0,0x80 |'After that, build the missing ifo files with:Code:dvdauthor -T -o /movies/movie1Note that this also requires dvdauthor to be installed, available in many distributions.At this time streamDVD does not internally support chapters or subtitles. However you can use spumux from the dvdauthor project to mux subtitles, but this will require a full copy of the DVD to your hard drive and more time. As far as chapters go if you extract the chapter points they can be specified in the dvdauthor step, but must be determined beforehand.You can also encode with streamdvd via the lxdvdrip script.Additionally, DVDShrink works fairly well under wine, see the section on wine and windows programs emulation for more information.3. How can I fully reencode a DVD, like DVD-RB under windows?Unfortunately there is currently no full-disc DVD reencoder comparible to DVD-RB under linux. As far as main movie only reencoding, there are two major mpeg2 encoding libraries (libavcodec and mpeg2enc from the mjpegtools) and many frontends for encoding with both (mencoder, transcode, lxdvdrip, avidemux2, dvd::rip).4. How can I manually reencode a DVD to DVD-5 or SVCD?If you're looking for a GUI application, dvd::rip is a great graphical frontend. It can perform the full encoding process for you and even burn SVCDs directly. It's also a good starting point if you want to encode via CLI to get an idea of the steps involved.For CLI reencoding, there are several steps, and a full guide is outside the scope of this FAQ. But here's a primer on the basic steps: first, rip the DVD to your hard drive as described in question 1 of this section. You can then use mencoder to reencode the video and audio simultaneously, using the -of mpeg switch to output to the MPEG container format. If you're encoding to SVCD remember to reencode the audio to MP2. If you're converting to DVD and want subtitles, demux them from the DVD by using spuunmux from the dvdauthor project, which can then be muxed with your MPG using spumux. Finally create your image file by using vcdimager for (S)VCD's or dvdauthor for DVDs.5. What options are there for authoring a DVD under linux?dvdauthor is a full featured dvd authoring toolkit supporting many different DVD options. The command line interface is fairly easy to use for simple authoring tasks and dvdauthor also supports XML configurations for advanced projects. There are also GUI frontends available, check out dvdstyler and qdvdauthor.6. Are there any advanced DVD/IFO editors available?PGCEdit by r0lZ is a Tcl/Tk IFO editor that runs natively under linux. The (very simple) installation instructions are available on r0lZ's homepage, and in recent versions the preview will be enabled if you have wine installed (make sure Preview > Use Preview is enabled).VobBlanker by jsoto, although a native windows program, emulates very well under wine. In recent versions, the preview will work correctly if the overlay is disabled (Settings > More Settings > Check "Do Not Use Overlay").
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.