May 25, 2013, 03:27:47 AM

News : LinuxSolved.com Linux Help Community Forum..


Recent Posts

Pages: 1 ... 7 8 [9] 10
81
Linux Development & Programming / Programming Help
« Last post by Chris4610 on November 09, 2012, 04:12:06 AM »
Hello,

    I am in need of some help with several programming questions, I am truly lost so if someone can please help me i'd be greatful.

Ty,

Chris

1. Declare a function that is called Compute_Avg. The function returns a float data, receives an integer parameter named “num”, and a float parameter named “Average”.

2.  x = 2, y =1, z =3, what is the value of x, y, z after executing the following codes?
   switch(x)
   {   
      case 0: x =2; y =3;
      case 1: x =3; break;
      default: x=3; y=2 ;
   }

3.  Find any errors in the following function declarations.
   a. int sun(int x, y);
   b. int sun(int x, int y)
   c. void sun(void, void) ;
   d void sun(x int, y float);

4.   What is the output of the code corresponding to the following pseudocode?
   (a)
 X = -5;
if  (X > 0)
   printf(“%d”,X);
if (!((X=0) && (X<0)))
   printf(“Not”);

(b)
      #include<stdio.h>
      #include<stdlib.h>
void print_message(void);
int main()
{
   print_message( );
   printf(“This is a new message.\n”);
   print_message( );
   print_message( );
   printf(“The end.\n”);
   system(“pause”);
   return 0;
}
void print_message( )
{
      printf(“Hello !\n”);
      return;
}


5. If num=5, determine whether each of the following expressions is true or false.
a.   (num*num)>=(2*num)
b.   (3*num-2)<=6


6.  A home mortgage authority requires a deposit on a home loan according to the following schedule:
   Loan$                  Deposit
   Less than $25000            6% of loan value
   $25000-$49000            $1000+10% of loan
   $49000-$100000            $2000+25% of loan
Loans in excess of $100000 are not allowed. Write a program that will read a loan amount and compute and print the required deposit.




7 Write a program that inputs one number, then display “yes” if num = 1, display “no” if num =2, displays “maybe” if num = 3, display “Error message” if num is not 1,2 or 3. Implement this program by a Switch statement.



8.  Write a function float Average(int, int, int, int) that finds the average of four numbers, and then write a main program that inputs four numbers from the user. You need to call the function and display the mean of the four numbers in the main.


The cost of renting a tool is $20 for the first day, $10 per day for the next 3 days and $8 per day thereafter. If the input is the number of days the tool was rented, compute the cost of renting the tool.


82
Os Talk / resolve the disk failiure
« Last post by kalaiselvan on November 07, 2012, 05:54:34 PM »
when i start the ubuntu machine it through the disk failiure error how can i trobleshoot that this kind of problem
83
Linux Kernel / Re: Linux sound. What to set in kernel. Why not buitlin / why module?
« Last post by dalek on November 03, 2012, 12:57:00 AM »
When I get a new system, or build one, I use this site to figure out what drivers I need for hardware:

http://kmuto.jp/debian/hcl/

There are two ways to work this.  Paste the results of lspci -n in the box or use the left side and look up by manufacturer.  First is the best if you have the system and second is best if you are looking to buy or build one. 

Hope that helps. 

 :)   :)
84
Linux Kernel / Linux sound. What to set in kernel. Why not buitlin / why module?
« Last post by xcislav on November 02, 2012, 04:40:41 PM »
What's the minimal in kernel?

alsaconf :
No supported PnP or PCI card found
Probe legacy - no legacy.

Code: [Select]
make menuconfig
Device Drivers > Sound card support * >
Preclaim OSS device numbers *
<*>   Advanced Linux Sound Architecture  --->

<*>   OSS Mixer API                                                         │ │ 
  │ │      <*>   OSS PCM (digital audio) API                                           │ │ 
  │ │      [*]     OSS PCM (digital audio) API - Include plugin system

 [*]   PCI sound devices  --->
<*>   (Creative) Ensoniq AudioPCI 1371/1373

What to set inside
Code: [Select]
< >   Intel HD Audio  --->
│ │      (64)  Pre-allocated buffer size for HD-audio driver (NEW)                   │ │ 
  │ │      [ ]   Build hwdep interface for HD-audio driver (NEW)                       │ │ 
  │ │      [ ]   Support digital beep via input layer (NEW)                            │ │ 
  │ │      [ ]   Support jack plugging notification via input layer (NEW)              │ │ 
  │ │      [ ]   Support initialization patch loading for HD-audio (NEW)               │ │ 
  │ │      [*]   Build Realtek HD-audio codec support (NEW)                            │ │ 
  │ │      [*]     Build static quirks for Realtek codecs (NEW)                        │ │ 
  │ │      [*]   Build Analog Device HD-audio codec support (NEW)                      │ │ 
  │ │      [*]   Build IDT/Sigmatel HD-audio codec support (NEW)                       │ │ 
  │ │      [*]   Build VIA HD-audio codec support (NEW)                                │ │ 
  │ │      [*]   Build HDMI/DisplayPort HD-audio codec support (NEW)                   │ │ 
  │ │      [*]   Build Cirrus Logic codec support (NEW)                                │ │ 
  │ │      [*]   Build Conexant HD-audio codec support (NEW)                           │ │ 
  │ │      [*]   Build Creative CA0110-IBG codec support (NEW)                         │ │ 
  │ │      [*]   Build Creative CA0132 codec support (NEW)                             │ │ 
  │ │      [*]   Build C-Media HD-audio codec support (NEW)                            │ │ 
  │ │      [*]   Build Silicon Labs 3054 HD-modem codec support (NEW)                  │ │ 
  │ │      [*]   Enable generic HD-audio codec parser (NEW)   
And where is PnP - it is not supported by emerged alsa

localhost xi # emerge --info | wgetpaste
Your paste can be seen here: http://bpaste.net/show/54833/
localhost xi # lspci -v | grep -i audio | wgetpaste
Your paste can be seen here: http://bpaste.net/show/54835/
localhost xi # cat /usr/src/linux/.config | wgetpaste
Your paste can be seen here: http://bpaste.net/show/54836/
85
Linux Servers Support / Wordpress multisite rewrite rules
« Last post by vv22 on October 26, 2012, 06:56:51 AM »
1) I have a Wordpress multisite subdomain installation with about 100 sites in the network.

Network Admin - Sites (All Sites) shows them like this:

main site: "www.domain-name.com"
all other sites: "subdomain-name.domain-name.com"

there is also a domain mapping plugin, so they all get access as separate urls:

http://domain-name1.com/
http://domain-name2.com/
...
http://domain-name100.com/

2) Currently urls on all blogs are set to:

http://domain-name.com/2012/10/26/post-name
http://domain-name.com/category/category-name

(I used today's date as an example)

This is also the way domains show in Google and Bing search results

3) I am going to remove "2012/10/26/" and "category/" from the urls, so they are gonna look like this:

http://domain-name.com/post-name
http://domain-name.com/category-name

...and I need to have a rewrite rule that takes care of redirecting people coming from serps to these new urls

4) I have something like this right now:

Code: [Select]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://domain.com/$4 [L,R=301]

Code: [Select]
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://domain.com/$4 [L,R=301]

but I am not sure if it is correct / if it is gonna work right, and also I need to have a rule for all 100 websites, and not just one. These versions (only one of them was meant to be used) dont include the "category/" part either.

5) If somebody would have an idea how to do that it would be great.

Thank you in advance for any info.
86
Linux Servers Support / Postfix - Send mails to specific domains only
« Last post by sunnysthakur on October 25, 2012, 04:02:46 PM »
Hello,

I am working on postfix server on CentOS 5.8 which will be send mails to a specific domain only.[i.e gmail.com]

All the things are nearly finished but i am not getting how to setup the postfix to send mails to specific domains.

Please help me out.

Thanks,
Sunny
87
Linux Development & Programming / Please Help
« Last post by bgriffeth on October 08, 2012, 06:48:26 AM »
I just start learning about linux. Here is a exercises of the lesson. Does anyone help me write down the command? I am having some problem.

1. Switch to root

2. Create new user called a6

3. Assign password to user created in step 2

4. Create new group called 1032

5. Create new file called permissions-test by using touch command

6. Display permissions of file you just created in step 5

7. Assign ownership of file permissions-test to user a6 and group 1032

8. Change the permissions of file permissions-test to match the following:

-Owner=Read,Write,Execute

-Group=Read,Execute

-Everyone Else=Execute

9. Display newly changed permissions of the file permissions-test

10. Display your default permissions level assigned by Linux

Please write a brief description of the purpose and the options of following network interface commands in Linux:

1. ifconfig

2. ping

3. nslookup

4. traceroute

5. netstat
88
Forum Talk / Please help
« Last post by bgriffeth on October 08, 2012, 06:22:09 AM »
So I'm trying to complete these steps and for some reason I can't get it to work. Could someone walk me through how to do it so I can see what I have either done wrong or maybe missed.

1. Create new user on your system with userid=operator and with your first and last name associated

2. Assign a password for the operator user

3. Create new group called administrators

4. Add operator user to the administrators group (make sure to use non-default group option)

5. Use yum to install finger command

6. Perform finger on operator user

7. Use cat in combination with grep command to list operator line only in /etc/passwd

8. Delete user operator from your system using an option to remove all it's files

9. List /home directory

Thank you
89
Linux Servers Support / Configure Samba with Remote LDAP for Authentications.
« Last post by sunnysthakur on October 01, 2012, 03:11:14 PM »
I am working on configuring Samba with Remote LDAP for Authentications but facing issue on the same.

I googled for the this but most of the setup is to connect local Samba and LDAP with samba-ldap tools [All are on the same machine] but in my case this is on a separate machines.

Please help me to configure this.

Thanks.
90
Linux Kernel / I have a problem
« Last post by travelocity on September 29, 2012, 06:30:35 AM »
Hi all,

I hope the post is right here.

I have the following problem:
Since last Saturday, my Mac Mini has become extremely slow. He is consumption determined 30 minutes before he started up. May, if he is ready then it takes forever to open, I mis a program. even off the screen saver out he need 10 min.

I still have a windows laptop. The two are on the same network. I moved a file from the Internet on the laptop down and on an external hard flap (which is connected to the Mac).
After that was a virus on the laptop and he did not even start.

Can it be that the virus is also on the Mac?
How do I get down there if only safari open an hour lasts?
What else can this be?


I hope you can help me fast

Moderator edit:  Removed commercial link.
Pages: 1 ... 7 8 [9] 10