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.
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
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?
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
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.
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.
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
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.
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"
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 ?
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
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.
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.
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).
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.
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?
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?
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.
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?
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!!
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
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.