Programming :: Making A Graph In C
Dec 1, 2010I 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]....
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]....
I need a script that takes data fom a file mydata.dat and create a graph. the content of mydata.dat is Bin Data1 Data2 Data3
Then it asks from the user to select which colums with use for x and which for y. the x and y titles must be generated automaticly by the names of each column from the first line of mydata.dat the limits must also be auto generated by the width of the column (for example for data2 is 12-45). in the end for graph title must shown the current time and date in this format:
So it asks for the user the columns and in the end it shows the graph with the above settings.
I am trying to build a 2D plot for my data and I have the code for it. However, I want to save it as a jpg/png file so that I can have a link to it for my webpage. Below is the code:
Quote:
import java.awt.*;
import java.awt.font.*;
import java.awt.geom.*;
import javax.swing.*;
[Code].....
How to plot graphs for trace files generated in ns2 using xgraph and gnuplot.
View 7 Replies View RelatedI wanted to implement a graph.By graph I mean to say that I am writing programs for BFS,DFS and other such stuff and want to see them in action. For this I started writing a program.The first entry point is to define a graph. I took a pen and paper and made a graph. Now to be able to code this in C.I defined a structure but I am finding problem in defining this structure. I looked into Google and came across incidence list and adjacency list representation [URL] after understanding that I am not able to understand how do I define my structure that would be a node in graph. Here is what my graph looks like
Quote:
|-----------31
| |
| 2---4---6---8
| |
[code]....
I am going to be creating some graph representations of neural networks for my thesis. I am trying to find a good method for drawing them, preferably in a scripting manner. I like NetworkX since I know python, but am also curious about GraphViz (though the documentation is sparse) or any other solutions anyone may know of. It is important that there is a decent ability to interface with LaTeX.
View 2 Replies View RelatedDoes any one know any software or utility that draw the graph or flow chart of an application (if application code is on multiple files)?
View 1 Replies View RelatedMaking 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)
How can one draw a circle in c++ without making use of BGI.
View 4 Replies View RelatedI'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 Relatedwas 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]....
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 RelatedThis 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?
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.
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.
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 RelatedI'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)
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]....
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]...
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.
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 RelatedI 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?
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 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 RelatedI'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 RelatedI 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 RelatedI'm making a multimedia library to speedup vector and matrix computation. But I'm getting a strange error, in this code
[Code]....
I am using Scilab5.2.2 in ubuntu9.10. Whenever I try to plot a graph, Scilab closes.
View 1 Replies View RelatedI have problem with make mrtg graph.
For example:
I use this Options for CPU:
Code:
Now use this command:
Code:
receive this message:
Code:
I have nagios and pnp4nagios installed and running fine. I have some snmp data that's monitoring an ASA5510.
I have the both the Data In and Data Out varibles, which go into individual graphs. Now I know that I can put the 2 data onto 1 graph, such as this graph: [URL]
I just don't know how to do it. I have in nagios the info here:
define host{
use WAN-devices ; Inherit default values from a template
host_name firewall ; The name we're giving to this host
alias firewall ; A longer name associated with the host
address 10.x.x.x ; IP address of the host
action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=_HOST_
}
[Code]....