Programming :: Making An Awk Script ?
Sep 29, 2010
Making an awk script. If you tell me to read the documentation.. I know.. you're right.
By the way, here is some input
Code:
My awk program has to work in this way:
until the end of the document if the beginning of the line is "START11" while the beginning of the line is different form "END11" print the whole line (print the "END11" line too)
View 1 Replies
ADVERTISEMENT
Dec 1, 2010
I am trying to understand how can I make a graph in C. So I wrote some program.
Code:
#include "declarations.h"
graph root = NULL;
int main()
{
[Code]....
View 6 Replies
View Related
Apr 10, 2010
How can one draw a circle in c++ without making use of BGI.
View 4 Replies
View Related
May 3, 2011
I'm trying to create something like this:[URL]...when you press "fire" you see the graphic.My program already does all the math, but what i want is that animation of the projectile moving depending on the entered data.i really don't know how to accomplish that.I'm using Gtk#.what would i need to create something like that??
View 1 Replies
View Related
Jul 28, 2011
was making a scrambler from python and this is what i have
# Scramble word re-arrange characters
import random
scrambler= raw_input("put a word and i will unscramble:")
[code]....
View 9 Replies
View Related
Jun 8, 2010
I need to write a script that will take 1 command line argument. The argument will be a username. The script will determine if the user exists on the system and will print an error if it does not. If the user does exist it will determine if the user is currently logged in, if the user is not logged in it will determine the last time the user logged in and display the file in the users home directory that was most recently modified.
View 2 Replies
View Related
Mar 22, 2011
This is probably hopelessly ambitious as I'm not a C or C++ programmer (I normally like to stick to scripting languages like BASH or Perl). Basically I'm looking on good advice to get me started with writing a Application Dock with the functionality of the OSX dock but without the overly flamboyant graphics that have characterised the Linux versions.At the moment the closest I've found to what I would like is bbdock. However it falls well short of the functionality of what I would like.
What bbdock does is read a file to create an icon for the openbox dock/fluxbox slit/wmaker whatever that launches an application when first clicked, shows an little arrow when the application is running, and brings the application to the fore when clicked once running.Here's a screenshot of it doing just that.The drawback to bbdock is that it doesn't really look for running applications, only those launched from bbdock. So for example it wont notice if I've launched an instance of pcmanfm from the openbox menu. And therefore it obviously also doesn't add icons for other applications that are running.
What I would like to be able to do is detect new running applications and add a bbdock icon for them. Also to detect if an application already with a shortcut has been run and update it's status to show it's open. Probably have an up and down arrow to move the icons up and down when there are too many to fit on the screen. None of the above needs fancy animation. The fade to gray effect used by bbdock is quite nice and could probably be augmented with a fade in and out to grey to represent another action, say fading to grey and back when launching and greyed when iconified.So, my question is what do I need to get started doing this? Am I best using the pretty outdated bbdock wmaker dockapp style? What functions and libraries am I likely to need to achieve the effects I want? Are there any examples of how to monitor running applications (well windows and figure out what constitutes a new application) that I could look at for inspiration. Is there anyone who's into C++ for linux who would be interested in helping me out to get this small project working?
View 8 Replies
View Related
Mar 18, 2010
I need to find the value of:
Code:
$Namenumber
My script asks for the name you want to look up and I want it to return the value of $Namenumber
I was thinking:
Code:
number=$"$name"number
but this returns
Code:
$Namenumber
but does not actually resolve what the variable $Namenumber is equal to.
View 4 Replies
View Related
Jun 7, 2010
I have a LAMP based web hosting account (BlueHost). I have an existing simple MS Excel application which I would like to make it web based. However I am not sure what tools or features of PHP are out there that will aid me with this task. Here are some details:
1. I don't want to create an entire Excel program online. For that there are plenty of existing applications like Google Docs, MS's own online version of Excel, etc.
2. My current excel file uses some of the following excel functions:
a) SUM
b) Product Sum
c) Conditional Formatting (like changing font color if an amount is below a threshold, etc.)
d) Sorting (Date, Amount)
e) Drop Down Box to select pre-defined values
3. Ability to add/delete/modify a entry (row)
4. I don't care whether the application has the same look-n-feel as MS Excel.
As you can see it is a very simple home grown excel application with few basic mathematical functions. Here are some few thoughts that I have currently in my mind:
i) Just start coding intuitively as you would develop a normal web based application.
ii) Do (i) but use some of the PHP's excel oriented helper functions (COMs?) if there are any
iii) Use completely a different set of tools permitting that they run on LAMP environment.
I could have started with (i) but before making a costly mistake I thought I would get some opinion from the community to see if this is the right approach.
View 1 Replies
View Related
Jan 14, 2011
I'm building a debian source package to upload on my launchpad PPA. Does anyone know what file I should create or edit to make a menu entry for the app? Or a link to some *specific* doc? (The debian doc is quite overwhelming...)
View 2 Replies
View Related
Jun 25, 2010
I'm trying to make my first c project (a simple tic tac toe console game), and I am wondering how to make a final product (copy all source code files to a distribution folder upon compilation). Should I use a bash script or should I use a makefile to make the distribution folder? I'm not terrible familiar with either; I have a basic makefile to make an executable, and that's about all I know of make.
And if I do use a bash script, how do I copy over source code files? I tried cp ./*.c and cp ./*.h, but I think the script read it literally as moving a file named ./*.c (and ./*.h), and couldn't find it.
My makefile is pretty much this:
Code:
objectFiles = main.o io.o board.o game.o
ttt : $(objectFiles)
cc -o ttt $(objectFiles)
View 2 Replies
View Related
Jun 6, 2010
GNU/Linux kernel 2.6, Slackware 12.0
MPlayer 1.0rc2-4.1.2
GNU Bash 3.1.17
I've got a set of MP3 files on dir .../foo/ and I want mplayer to play them sequencely but skipping some of them. If I run 'mplayer *' this will do but ofcourse won't skip any files. I think a shell script could be written to do that. It would be something like this (using some pseudocode):
#!/bin/bash
#After an example from Intro_Linux by M. Garret.
LIST=$(ls *.mp3)
[code]....
View 3 Replies
View Related
Feb 15, 2011
is this a good way of doing it? Shall I use & when starting the new process? Itested in bash and dash.
testbash=$(ps -e | grep $$ | grep bash)
if [ 0 = ${#testbash} ]; then
echo "new process"
[code]...
View 11 Replies
View Related
Jul 27, 2011
I have an odd issue that I am running into. My objective is to insert the following lines at the end of /etc/inputrc on an RHES box:
Code:
# alternate mappings for "page up" and "page down" to search the history
"e[5~": history-search-backward
"e[6~": history-search-forward
I would like this sed snippet to be portable and thus far it's worked. However, I ran into one box where after I ran the snippet, Subsequent sessions lost the ability to use the letter "e". The original version I was using looked like this:
Code:
mv /etc/inputrc /tmp/inputrc.orig
sed 's/'$endif'/
# alternate mappings for "page up" and "page down" to search the history
"e[5~": history-search-backward
"e[6~": history-search-forward
&/' /tmp/inputrc.orig > /etc/inputrc
Then instead of using s/ I thought perhaps i/ would be better so I re-did it as:
Code:
mv /etc/inputrc /tmp/inputrc.orig
sed '/'$endif'/ {
i
i
# alternate mappings for "page up" and "page down" to search the history
i
"e[5~": history-search-backward
i
"e[6~": history-search-forward
}' /tmp/inputrc.orig > /etc/inputrc
Both of these produce the expected result BUT they both resulted in the loss of the letter "e". As I mentioned earlier in the post, this was working on 'newer' RHES 5 and up but I have the misfortune of having to support some older RHES 4 boxes in a closed lab. This particular box is an RHES 4u6.
View 4 Replies
View Related
Dec 17, 2008
I have list of programs which I have created during the past few days, all the programs are attached in txt files, and if anyone can do favor, and double check if they work, and what changes I can make to make it look different, or to improve it.
View 9 Replies
View Related
Dec 11, 2010
I need to write a shell script that will be run from cron every minute or so. The script will use rsync to keep some folders across several machines in sync. I am very new to shell scripting so some answers might seem obvious but they are not to me:
1. How do I check at the beginning of the script if the script is already running and abort if it is? I saw that most processes use a PID file for that but I am not sure this is the right case for that and in fact how to do it exactly
2. Assuming the list of target machines/dirs to sync are supposed to come from some config file. How should I code that? Just use the normal shell tools that I already know (cut etc) or is there a better way?
View 6 Replies
View Related
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
Jan 30, 2010
I was windering, if you are writing a C program, I don't think you are supposed to commit the .o files and executables. How can you test your program without making a copy outside the git working dir?
View 3 Replies
View Related
Oct 14, 2010
I've got an error with compiling a program: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/python2.5/config/libpython2.5.a: could not read symbols: Bad value collect2: ld a retourn 1 code dtat d'excution make[2]: *** [bindings/_yafqt.so] Erreur 1.
View 1 Replies
View Related
Aug 17, 2010
I doing malloc and getting the chunk of dynamic memory. Now I want it to align that memory to 64KB. This means that the address of the memory starts from 64KB or multiple of 64KB.
View 3 Replies
View Related
Sep 2, 2010
I'm making a multimedia library to speedup vector and matrix computation. But I'm getting a strange error, in this code
[Code]....
View 4 Replies
View Related
Feb 23, 2010
I've installed mono developer, but when I want to make debug I got this message : Build failed. ApplicationName='/usr/bin/gmcs', CommandLine='"@/tmp/tmp17a7a5e2.tmp"', CurrentDirectory= ...
View 1 Replies
View Related
Oct 7, 2010
i'm a college student studying pc programing, and i was given today a special work and i have to program using miranda... which i've never used it >.< can anyone give me a hand to where to download, how to compile, and a simple tutorial for making a simple program or something?
View 3 Replies
View Related
May 20, 2011
Just wondering if it is possible to make use of the Windows keys on keyboards - the ones with MS logo.In Vista - the action is to invoke the Start Menu.In Linux, there is no action when you press these keys - can this be changed?
View 10 Replies
View Related
Feb 14, 2010
I am trying to install a DB application on my desktop which runs on OpenSuse 11.2 64bit.
Unfortunately the application supports only SUSE Enterprise Linux V10 or V11 or Red Hat Enterprise Linux. Is there a way to add certain packages to 'simulate' an SEL Server? I found some packages name SEL something which I installed, however no changes here, I still can't install the DB.
View 9 Replies
View Related
Jan 18, 2010
I have a local mirror at my server. How I can create mirror on DVD's for people without network connections?
View 1 Replies
View Related
May 2, 2010
I want to make an iso for some friends [and maybe friends of friends] that aren't all that tech savvy, so I want to change a few things to the original Lucid iso. First, I want the option to install Lucid out of the boot menu [but the other options should ideally stay]. Second, I want to include the ubuntu-restricted-extras so they can immediately try it out and see that it also plays video/audio etc.
View 9 Replies
View Related
Sep 26, 2010
I'm running relatively overpowered server right now, that all it really does is host files and download movies/music that I might enjoy. I'm just seeking to expand it's capabilities to make life in the house more simple. The first thing I'd like to do is create a kind of automatic grocery list generator concept. Here's how I envision it working.
We create a list of recipes for meals we enjoy, specifically an ingredient list. From this list, we create bi-monthly meal lists; what do we want to have for the next two weeks. The server chews through the two lists, compiles a list of ingredients and how much of each we'd need.. and emails this off to our smart phones for us to refer to while shopping. What equipment do I have? I have a headless Ubuntu server running 10.04 and administered via a GUI and NX Client. Two blackberries (both 9700 Bolds) as portable smart clients that would need to at least receive the list, tho ability to add in would be great.
Home network is a mix of wired and wireless, so no issues there for connectivity. So why post this here? Because I'm at a loss as to the software/configuration part. Doing an automated email daemon is easy to send the list out. And a list of recipes or such is easy to get (dozens of cookbooks in the house, plus a small army of them available online).. the issue I'm having with is how to create/manage the database. I'm not familiar with SQL or any database programming at all. Is there something akin to this already in the repositories? Or is there someone who could point me in the right direction so I can do this?
View 2 Replies
View Related
May 29, 2011
Is it possible to disable the run/display/cancel dialog just for some selected files and keep it for others? I want to be able to just click on some files which would run them instantly yet still being asked what to do if I click on other files. Say, launching files a, b & c would make them execute but launching files d, e, f and all others would pop-up the dialog asking me what to do. So can it be done?
View 6 Replies
View Related
Jul 12, 2011
I want to make an rpm which when installed as an update causes another rpm to be removed. I'm fairly sure this is possible because I have seen LibreOffice rpms install as updates replacing OpenOffice rpms in the process without any interaction being required. However I'm unable to figure out how to do it, even after having looked at the spec file for such a LibreOffice rpm.
I have package gstreamer-0_10-ffmpeg installed. I have another package called multimedia installed. I've built a new version of multimedia which includes the gstreamer ffmpeg plugin so I don't need the gstreamer-0_10-ffmpeg package installed any more. I've tried using Provides and Obsolete in the spec file of the new multimedia package. E.g.
Code:
Provides: gstreamer-0_10-ffmpeg
Obsoletes: gstreamer-0_10-ffmpeg <= 0.10.10
(I've tried it with and without version numbers.) Whatever I put in the spec file, when I try and install the new multimedia package as an update zypper says
Code:
$ zypper up -y multimedia
Loading repository data...
Reading installed packages...
Resolving package dependencies...
Problem: multimedia-1.1-1.i586 obsoletes gstreamer-0_10-ffmpeg <= 0.10.10 provided by gstreamer-0_10-ffmpeg-0.10.10-0.i686
Solution 1: replacement of gstreamer-0_10-ffmpeg-0.10.10-0.i686 with multimedia-1.1-1.i586
Solution 2: do not ask to install a solvable providing multimedia > 1.0-2
Selecting an option manually is no good, I need the update to happen without user interaction.
View 3 Replies
View Related