Programming :: Generic Case In C ?

May 14, 2010

As you know that GNU-C provides qsort() function in <cstdlib> in this prototype

Code:

You may know about Selection Sort Algorithm already, I want to write a function to perform Selection Sort but it can apply generally for many type: int, long, float, double... like qsort() above.

View 14 Replies


ADVERTISEMENT

Programming :: Perl Switch Statement Throwing Error Like Bad Case Statement (invalid Case Value)?

Oct 6, 2010

I've written a simple perl code to learn switches in perl.My code is pasted below,

#!/usr/bin/perl
$opt = 1;
switch($opt) {

[code]...

View 3 Replies View Related

Slackware :: Mkisofs -iso-level 1 Converts To Lower Case Instead Of Upper Case?

Oct 28, 2010

Kernel 2.6, Slackware 12.0
mkisofs 2.01

I do 'mkisofs -iso-level 1 -o image John Smith.txt'. Only an example. When I mount image, ls outputs john_smi.txt. So it has shorten to 8.3 and translated ' ' into '_'. This is in accordance with the manual, although it doesn't say the conversion will be done.

Quote:

-iso-level level
.........................
With all iso9660 levels from 1..3, all filenames are restricted to upper case letters, numbers and the underscore (_).
...........................

However, as it did not reject the file name, it should have converted it to all upper case, it seems to me. And -iso-level 2|3 does the same thing.

Code:

root@darkstar:~# mkisofs -iso-level 1 -o image John Smith.txt
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 0

[code]....

View 5 Replies View Related

Programming :: Setting No Case Sensitivity In As?

Jul 9, 2011

GNU assembler 2.17 (invoked as 'as').

Is there a way of setting no case sensitivity in as?

View 3 Replies View Related

Slackware :: Setting Up Initrd - Generic Kernel In Grub2 - Can't Load Generic

Jan 4, 2011

I am trying to figure out how to load the generic kernel in Grub2.

I have run the /usr/hare/mkinitrd/mkinitrd_command_generator.sh and ran the output:

Code:

Why this will not load.

View 10 Replies View Related

Programming :: BASH - Regex In A Case Statement?

Jun 9, 2010

the following works and BASH doesn't complain, but VIM highlights the closing square bracket is if it sees a syntax error. Is there a better way to express regex in a case statement or is this an issue with VIM?

Code:
#!/bin/bash
case $1 in

[code]...

View 3 Replies View Related

Programming :: C# Control Cannot Fall Through From One Case Label To Another?

Feb 27, 2011

I'm having this problem with this piece of code, and i don't really get what the problem is, maybe is because i am already too sleepy to concentrate enough but maybe

switch(plazo){
case 1:
plazo = 12;

[code]....

View 3 Replies View Related

Programming :: Change Variable In Case Command?

Aug 7, 2010

I want to display 4 options using the case command and refresh the screen when options 1 and 2 are chosen (no changes to the options and you get asked again to chose option), but give a message for option 3 and exit on option 4. I set this up with the script below, but choosing option 1 works and choosing option 2 exits the script.

Code:

#!/bin/bash
#testing options
Option="0"

[code]....

View 7 Replies View Related

Programming :: Escape '*' In Case Statement Bash

Jan 23, 2010

Does it possible to escape * in the case statement

Code:

View 2 Replies View Related

Programming :: Any Option To Make GCC Case Insensitive

Jul 11, 2010

I am working with a third party that use windows to compile. When we port that code I am running into a lot of case issues where the includes are not case sensitive. Is there any option in GCC to make it case insensitive. I know its a long shot, as I have done reading and does not seem so.

View 1 Replies View Related

Programming :: Change To Lower Case And Concatenate The First And Last Names?

Nov 28, 2010

I have a file like below. For all the lines (except for the ones listed as 'Unknown Owner' and N/A') I would like to change to lower case and concatenate the first and last names.Before:

Code:
aaa.bbb.ccc.ddd,Unknown Owner
ddd.eee.fff.ggg,N/A
hhh.iii.jjj.kkk,John Doe
aaa.bbb.ccc.ddd,Mary Jane

[Code]...

View 4 Replies View Related

Programming :: Case Statement Passing Multiple Arguments?

Aug 7, 2010

I've started dabbling with the case statement in order to pass some option's arguments into variables. I do not think I am doing this right.

Code:

usage() {
echo "Usage: $0 [-z|--snooze] [-c|--channel] [-p|--playlist]
[-m|--message] [-v|--mpcvolume]"

[code]....

As you can see, I want to pass arguments depending on the option(s) chosen by the user; ie. --snooze, or --channel. By default, if no options are chosen, I'll display a usage message; though in the future I'll provide some sane defaults. I'd like to create a case statement to handle passing arguments to any number of options; something like:

Code:

wakethehellup.sh --snooze 20 --message 'wake up!'

and for the other arguments, it would have a default set. The case statement I provided fails with a syntax error "syntax error near unexpected token `$2'" near the '--snooze' in the statement, so I take it you can't pass a parameter in this way; but I'm confused as to how I'm supposed to pass different parameters to different options without the options being confused as parameters.

View 2 Replies View Related

Programming :: Certain Book Search - Checking Of Case Insensitive

Jan 19, 2010

I am trying to do a search for the certain books, and I am trying to make it case insensitive. what I have come up with so far is this :

Code:
Database.txt
RETARDED MONKEY:RACHEAL ABRAHAML:30:30:20
GOLD:FATIN:23.20:12:3
StUPiD:JERLYN:20:40:3

Code:
echo -n "Title: "
read Title
echo -n "Author:"
read Author
echo ""
valuecheck='grep -i "$Title" Database.txt | grep -i "$Author" | awk -F":" '{ print $1}''
echo $valuecheck
if [ $Title = $valuecheck ] ; then
echo "HOHOHO"
else
echo "too bad"
fi

The issue which I am having is that, when it does the search for the correct row to be inputted into valuecheck, it will input the value as written in the database, which is in Uppercase. For this case, if I type in stupid for $Title and jerlyn for $Author, it searches the correct row, but the awk will print "STUPID" into the variable as that is what is written in the database. So how can I make my if statement case insensitive? Currently it reads like this:

Code:
if [ $Title = $valuecheck ] ; then
which means
if [stupid = StUPiD ] ; then

How can I make the if statement it case insensitive to allow it to display "HOHOHO"

View 5 Replies View Related

Programming :: Do Not Miss Any Cases While Making The Test Case Doc?

Jul 28, 2010

Few months back I learnt a *few* concepts about bits/bytes and started writing a program for bit packing in C++. Now that program has grown upto 600 lines and I am still working on it. Yesterday I realized I missed some special cases due to which the program was malfunctioning. Now I have modified the program and it is working properly but I think If I would have designed all the possible test cases before writing the code, I would have finished the program long ago.

I. What is proper way to design the test cases before coding?

II. How should I make sure that I do not miss any cases while making the test case doc. ?

III. Does writing test cases prior to coding solve messy code issues or should I consider something else ?

View 8 Replies View Related

Programming :: Ignore Case In If Statement Shell Scripting

Feb 3, 2010

How do i make my strings case-insensitive while comparing them with an if statement?

View 2 Replies View Related

Programming :: No Debugging Symbols Found (not The Simple Case)?

Jan 6, 2011

I wasn't sure where to put this so if I need to move it just let me know.I have a strange problem that I cannot figure out. When I use gdb to debug our rpm-installed program, it says (no debugging symbols found) when it loads. Thing is, when I use nm on the program it can print the symbols, and even stranger is if I use gdb on the program before it is packed up by rpmbuild it loads the debug symbols just fine.Our program is built via the standard make using:GS=-g -Wall-pedantic and as I mentioned I can debug the resulting program. After the build, I package it up using:

cmd="rpmbuild -v -bb ptsnmp.spec --define "ver ${cmvc_release}" --define "rel ${cmvc_level}" --define "_topdir $rpmdir""When this package is installed via rpm, the binary on the machine shows all the debug info via nm, file shows it is not stripped:pt_snmp: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not strippedyet when I try to debug it I get the no debugging symbols found.This is really taxing my brain and I am sure I am just missing something

View 4 Replies View Related

Programming :: Access Generic Netlink From Userspace?

Jun 7, 2010

I am trying to access a generic netlink family to send messages from user-space to the kernel. I am using libnl example here [URL].. The problem is that I keep getting

Code:
error: netlink/genl/genl.h: No such file or directory
error: netlink/genl/ctrl.h: No such file or directory
You would think I have not installed libnl and libnl-devel but I have.

[Code]...

View 1 Replies View Related

Ubuntu :: Error - Set A Valid User Name Consisting Of A Lower Case Letter Followed By Lower Case Letters And Numbers

Mar 12, 2010

I tried to add my wife , and when I put in a password for her, this error comes up."Please set a valid user name consisting of a lower case letter followed by lower case letters and numbers." I did all that and I still can't set a password for her.

View 3 Replies View Related

Programming :: Use Generic Netlink Receive Function - Error "sendmsg(); If(recvmsg() < 0)"

Jan 2, 2010

i'am tring to use generic netlink and can't find function for blocking not busy waiting receive. I'll try to explain myself. Generic netlink receive mechanism based on callback function - when module receives something,this function invoked. But this is not so good if you need to send something and receive answer. I mean something like that :

sendmsg(); if(recvmsg() < 0) goto err; I need generic netlink recv() function, or some mechanism to implement it. I just want to stay in "recvmsg()" function until i have answer(until call_back function invoked).

View 1 Replies View Related

Ubuntu :: Generic And Generic-pae ?

Jul 2, 2010

I switched to the generic-pae kernal image, which works great, but update now wants to update both generic and generic-pae.

How can I set it up so that it only uses generic-pae?

If I try to deselect generic in synaptic it just wants to mark it again.

View 2 Replies View Related

Programming :: Error 4 Which (according To /usr/include/asm-generic/errno-base.h) Means "interrupted System Call"

Aug 1, 2010

I'm using gmake (v3.81) to build some c executables. As the first step in the process I run the files through a preprocessor (for embedded SQL). The preprocessor completes successfully, but the gmake reports an error and discontinues buiding the remaining dependencies...

make *** [myfile.c] Error 4

which (according to /usr/include/asm-generic/errno-base.h) means "interrupted System Call". My preprocessor doesn't raise any signals, so I'm not sure what's causing this error.

View 2 Replies View Related

Ubuntu :: Use Case For EC2 In Server 9.10?

Jan 22, 2010

I do have one question about the latest Ubuntu server edition 9.10. Currently I am using 8.04 on a server at home and have nothing but great things to say about it.

With that being said, what would be the use case for an average joe like me to harness the new capabilities in 9.10, more specifically in regards to the new EC2 features?

I am a web designer and video geek...I was wondering if this would take some of the workload off my Macs. For example video rendering, etc. Should I uprgrade and try this out?

View 1 Replies View Related

General :: One Drive Bay PC Case?

Sep 17, 2010

I know this is a rather odd question, but like in the old days you can get one drive bay desktop cases.

View 4 Replies View Related

Hardware :: Measuring A Case Fan?

Mar 30, 2011

This is probably a simple question but I really don't know!How do you measure a case fan to know it's true deminsions whe one is talking about them or whatever?For an example lets use an 80 mm fan, is it measured from the "Frame" size witch is the total size of the fan or what?

View 14 Replies View Related

General :: GNU Sort By Case-sensitive?

Aug 20, 2010

The sort utility in Ubuntu 10.04 (Lucid) always sort by case-insensitive, just like if you specify --ignore-case to it. The two sort just give the same result:

[Code]....

But sometimes I want to sort by case-sensitive, so the upper-case letters come first, then lower-case letter.

View 2 Replies View Related

Ubuntu :: Case Of Missing Icons

Feb 16, 2010

I have a My book usb drive that in the provious install would show up with a My book icon as a "drive" on my desk top, in PLaces it shows as a blank icon.. for some reason the icon does not appear on my desktop, like normal, examples plug in ipod, ipod icon shows up, usb mini drive, that shows up?Also this could be related .. but my Pidgen icon on the tack bar does not show anymore... it used to be that I opened it and a little green icon sat by the clock?

View 1 Replies View Related

Hardware :: Internal HDD Through USB Case Not Detected?

Nov 15, 2010

I recently upgraded my HDD to 160 GB ..I actually wanted to exchange the old HDD (40GB) and adjust with the price of the new one..The comp service guy said that the internal HDD could be used as a USB disk if I purchase a CASE for this..I bought a case thro which I attached the old IDE HDD... The LED is on when I connect (The USB cable had 2 leads which I had to connect it in 2 USB slots- Direct in my cabinet (not thru Hub),,, Ubuntu 10.04 is recognizing the disk in "System Info" as "USB - Generic HDD"...But that's it, I am not able to run Gparted or anything...Even in win7 , it said "Installing software for devices" and later on nothing happens...This is not shown in File Manager I would like to know how to format and make it usable..

Also , since HDDs involve some amount of power , is it wise to connect it to another computer, I mean there wont be an overload or spike or something like that?? We have 220 Volt electricity in my country... Aso logically speaking there has to be a limit I mean, you cant keep "chain loading" multiple HDD through USB Hubs ,right!!

View 5 Replies View Related

General :: Case Sensitive Directory

Dec 14, 2010

i am trying to set up a couple of pages in some special directories URL...but i need it that if they type URL... for them also to go to the site and not to a 404

View 2 Replies View Related

Debian :: Copying Files To USB Stick Changes Case

Nov 30, 2010

I've observed that if I copy a directory containing some files to an USB stick, files whose names are all upper-case are copied with all lowercase names. Is this expected behavior? The USB stick is shared with a Windows box.

View 13 Replies View Related

Fedora :: Sort Is No Longer Case Sensitive?

Dec 16, 2009

I recently upgraded to Fedora release 12 (Constantine) and noticed that sort is no longer case insensitive.

echo -e "ba
a
A" | sort
a
A
ba

I think it should be:

a
ba
A

The -f flag does not change anything. I have sort (GNU coreutils) 7.6.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved