Programming :: Supposed To Print Shapes
Oct 10, 2010I've been working on it for over 20 hours and I'm stuck. It asks the user for input and then prints a shape of a certain length.
View 4 RepliesI've been working on it for over 20 hours and I'm stuck. It asks the user for input and then prints a shape of a certain length.
View 4 RepliesWhen I open program files in windows some of them are almost nothing but boxes and triangles. I was always curious what the hell it was.
View 2 Replies View RelatedHere is my program. It asks the user for input and then prints a shape of a certain length. The errors I get when I compile are:
shape.c: In function "main":
shape.c:22: error: expected identifier or "(" before "int"
shape.c:58: error: expected expression before "return"
shape.c:59: error: expected expression before "}" token
shape.c:59: error: expected expression before "}" token
#include<stdio.h> .....
Following on from my issues with QSplashScreen, I am wanting to investigate the QPainter class(es) some more.
Code:
How would I best achieve this:
- Draw some shapes and gradients with QPainter/QPen etc
- Create a splash screen out of it
- Display SplashScreen.
I cannot find anything that doesn't involve
Code:
I am comfortable making splash screens out of images, but now I want to try drawing one myself.
how am I supposed to use this guide. The doc states different messages lengths and formats, as a programmer, how should I utilize these information?Just fyi, my question is a general qns and does not necessarily target to just using netxms, but could be any other opensource as well.
View 4 Replies View RelatedIs it possible to get rid of the windowshapes in the desktop switcher application? I just want to see the square of the desktop an it's title, not the ugly shapes of all open windows on it.Or any alternatives?
View 2 Replies View RelatedFor example, if I fill in a circle with black (using the ellipse tool), then fill the surrounding with another color (a dark color) there will be a nearly white outline of the circle. I don't want there to be an outline. The whole canvas should be ALL black.
View 1 Replies View RelatedI have a Macbook Pro which i want to install Opensuse 11.2 64bit(Upgrades to 11.3) The problem is that once i install opensuse and then boot via rEFIt, it loads up till the desktop is supposed to appear. All i get at this stage is darkness with a few coloured shapes in the background (Video driver not loaded).I can however reboot and go in via the failsafe option. Once in here i can use the GUI. I am a total noob with linux, can some one give me the instructions on how to install this driver. Its driving me insane. When i run uname -r, the results are 2.6.33-6-default I have added the following http repository (download.nvidia.com/opensuse/11.2/)
View 3 Replies View RelatedI want to print NaN value in a file containing of 3600 rows and 7 columns.The illustration of output file which I want to is as follows :
NaN NaN NaN NaN NaN NaN NaN (the first row)
NaN .... NaN
.
.
.
NaN .... NaN (the 3600 rows)
I tried to use below command
awk 'BEGIN {for(i = 1; i <= 3600; i++); printf "%s", "NaN", $1" "$2" "$3" "$4" "$5" "$6" "$7}' > output
Unfortunately, I couldn't get what I want to.
I have this code:
How can I print &FARAchieved to a file? Or, printing the whole bioReturn would be fine too.
Say I have a line like such:
Code:
today 2010 Feb 21 test10, 12AM
How would I print everything AFTER "2010 Feb 21 "?
What I thought to do so far is to set a variable to the format used in the string like so:
Code:
date="$(date +%Y %b %e)"
So I know I have to use either awk, sed, or perhaps bash substrings to work with the variable $date, but as to how, I'm drawing a blank.
problem statement:
pattern_search="Exam Name"
sed -n "/$pattern_search/,/hello/"p tmp5 | awk '{if ( $4 != 0 && $4 ~ /[0-9]+.*[0-9]*/ ) print "$pattern_search" " " $0 }'
"tmp5" is a file. this is printing output as
$pattern_search value1
i.e value of $pattern_search is not getting substituted. i am expecting output as
Exam Name value1
I have a site which will have, for example, a login system where people have to enter their usernames and passwords, depending on which they'll be let in to the site. So, in code, I've got a line like:
if ($_POST['password'] == $password) {
then do whatever
}
else { print "Wrong password" ; )
My problem is, this "Wrong password" printing is just a solitary line, not keeping with the colours and style of the site, and it looks very bad. I want to ideally, output some HTML, which will have a picture, and print the "Wrong password" in the font and colours I desire. Do I have to put all the HTML in a print statement, and then deal with the nightmare of escaping all the quote marks in it with a ""? Or is there a cleaner method to the whole thing? Maybe something like this -
if ($_POST['password'] == $password) {
then do whatever
}
[code]....
I've just started programming at my university and I'm finding it a bit hard to get started. I've been given this for homework.Given 2 integers, a and b, print their sum. However, sums in the range 10..19 inclusive, are forbidden, so in that case just print 20The problem I'm having is that i don't know how to tell java to print 20 when the value is in that range.
View 14 Replies View RelatedAny one using php program to direct lpt port print command, now i am creating one programe for mini shope that system having citizen CT-S4000 model.
View 2 Replies View Relatedi want to print all ASCII characters kind of like a table, but i really don't have an idea of how to do it, i don't know if there is a built-in method or something to accomplish this, if not
View 2 Replies View RelatedI am trying to write a program that monitors when an lp or basically any sort of print command is issued. If a print command is detected I want to pause that job and ask the user if he / she wants to continue.
This program would run in the background all the time so it can't sit and eat up a lot of cpu. I tried a simple while loop that continuously monitored "ps" and that obviously boosted my cpu to 100%.
I want to write a script that returns me name of the files that begin with the specified characters. like
Script out should be
how do i combine these two lines to output all network interfaces on my machine?
View 1 Replies View RelatedI am just trying to run the following piece of awk code. But it doesn't print anything. where I am doing wrong?
[code]...
What's the difference between PHP echo() and PHP print(), especially in the execution time?
View 6 Replies View RelatedI need some direction on a small scripting question. I've been doing some development and storing the code on a network drive with multiple user access. My development is getting complex enough that it is time to set up a svn repo for it. I would like to set up a little script (if possible) that prints a message/reminder to whomever is accessing the code directory stating that the code is ultimately stored in svn and any changes need to be checked in, etc. Is there a way to have linux print a message to the screen based on a 'cd /specific_dir/' command? So far google is mum on the topic. Using Debian and bash shell.
View 5 Replies View Relatedwhy this code can't print in the while loop the content of the file ?
Code:
#include <stdio.h>
int main()
{
FILE *fp;
[code]...
I am using an awk command to print a line from a cvs file.the awk command includes an if statement that filter the output-lets say i want to print all the lines that the price field is greater than 30.i have it working when i put the parameters myself.. but when i try to send them with vars it wont work..i am sending the sign of the if statement - can only be: == , < , >it looks like this:
cat file.csv | awk -v sign=">" -v field="2000" '{if($3 sign field) printf "%-12s%-12s%-12s%-12s
",$1,$2,$3,$4}' FS=,
the bold part is the problem , because when i put the sign parameter myself t works great.. i guess its a chars issue but i cant spot it
I having the following awk line in a script, is it possible to modify the script so that it create a the directory if it dosnt exist (similar to mkdir -p) awk -v datum="$DATUM" -v workingdir="$workingdir" '{ sub("\[.*","",$5); print > workingdir"/"datum "/" $5;}' $1
View 1 Replies View RelatedHow to write a shell script the would search for a phone no using at the end text file using sed or awk and store it in a varaible or print it.
The text file is in this form
The first line may take any form but the last line will always be Firstname Lastname:KEN:+254456789
I would like to seach for the Phone and store it in a variable and print it.
The phone no will alway be preceeded by ":+"
I have a file with variable length lines containing fields separated by colons:
Code:
path/to/file0.c:4150:109:4151:142:4153:275
path/to/file1.c:4040:109
path/to/file2.c:4605:72:4606:109
path/to/file3.c:4380:54
The first field identifies the file name, the second is the search key, and the third is the line number of the file that the search key points to. Any subsequent fields are other key/line number pairs.
As an example, I can search for 4151 (key) from my bash script to identify the file I will have to access, but I also need to capture the line (142) as well, and I can't figure out how to do that using grep, awk or sed (or anything else).
I have a directory where there are folders and in them some .txt data files. I am trying to output a .txt file with the folder name and the number of .txt files in it using gawk. However, when I run my shell program, because print is nested in a "while" loop, gawk overwrites what's already saved in the output file. I want gawk to print "new" output in a new line without overwriting the already existing text in the output fil
#! /bin/sh
# getting the folder list and the number of folders
ls | gawk '{print}' > ../folder_list.txt
[code]...
As you know, in C++ you can use setfill(char c); and setwidth( int length) to fill a line of a character.
It's line making a line of a character for output
Code:
NAME DEPARTMENT LOCATION
==========================================
Pete R&D Chicago
...
==========================================
As you see, a line of a '=' character drawn to output.
I'm wondering, how can I draw this line in C using printf() to format?
( no loop or repetiton )
Can one of you point me towards a comprehensive print function tutorial in perl? I was under the impression that everything within quotes will get interpolated - but I am running into exceptions where it is not desirable to run some varaibles under quotes.
ordinal.pl
1 #!/usr/bin/perl
2 $idx = 1;
3 foreach $letter (a..z) {
4 print "Letter #",$idx++," is: $letter
";
5 #print "Letter # $idx++ is: $letter
[Code]...