132,726 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for RoyMicro

Hello There seems to be different methods to create a text file in C#. I am getting a byte array from USB device. I need to store this as text file which is to be read, updated, and saved for future usage. The data comes in different packets not in …

Software Development asp.net
Member Avatar for Geekitygeek
2
191
Member Avatar for lisedaton

hi all!!, can somebody help me?? I need to do a program that scan a decimal, transform it to binary and check if it is palindrome or not and print "palidrome" or "not palindrome".... i can only use functions and cant use arrays or anything else! can somebody help me??? …

Software Development c
Member Avatar for flipjoebanana
2
1K
Member Avatar for Ineedhelpplz

So everything in my program works except for the main itself. The program is supposed to take in a file provided through standard input and print out the descending order of words followed by the frequency that they occur. I can do this individually line for line but am having …

Software Development c
Member Avatar for Ancient Dragon
2
157
Member Avatar for confusedndazed

Pseudocode is still somewhat confusing and I've been reading and this assignment for the a while now and I wanted to make sure I am understanding what's being asked of me. Could someone please tell me if my pseudocodes are correct? Question: 1. Using pseudocode declare a Real number named …

Software Development c++
Member Avatar for Tales
2
102
Member Avatar for paddowan34

My teacher gave us an assignment where she wanted us to write a program that would read test score data from a text file,drop the lowest test score,average the other three test scores, and output the data to a text file. I've spent three days trying to figure out how …

Software Development c++
Member Avatar for StuXYZ
2
119
Member Avatar for userits

[CODE]include<stdio.h> void main() { int i=5; int c; c=i++ + ++i + i++ + --i; printf("\n%d",i++ + ++i + i++ + --i); printf("\n%d",c); }[/CODE] The o/p that I'm getting is 31 23 while my friend got 34 20. Also why are the 2 (printf ' c 'and printf 'expression') values …

Software Development c
Member Avatar for Aia
2
141
Member Avatar for rt.arti

Hello All! I have been working on a network design problem and am having a problem in the following part- What I am trying to do here -- { for every set of edges (a,b), { for all arcs (l,m) assign length of -- arc [l,m] = edge [a,b][l,m] shortest_path …

Software Development c
Member Avatar for dkalita
2
115
Member Avatar for aman rathi

hello i am a student of sgrrits dehradun doing bca now a days my pointers chapter is going on its difficult to understand but mostly i did it but i want to know that how it is use ful for us in the c. i only find its 1 benefit …

Software Development c
Member Avatar for jbennet
2
118
Member Avatar for leeba

I am trying to write a program that reads a string and shortens it if the letters are in a row. For instance abcdghigjhkhdf becomes a-dg-igkhkhdf. I want that it erases the ;etters it erases but it is not working. HEre is my code: [code] #include <stdio.h> #define MAXSTRING 100 …

Software Development c
Member Avatar for kommuru
2
67
Member Avatar for AuSsIeStOnE

[B]fseek()[/B] and [B]ftell()[/B] work only for files < 2,147,483,647 bytes [B]fseeko64()[/B] and [B]ftello64()[/B] from [B]<stdio.h>[/B] can deal with files up to 18,446,744,073,709,552,000 bytes the printf format for unsigned long long val is [B]%I64d[/B] eg. Obtaining the file dimension (this code was tested with [B]GNU GCC compiler[/B] (MinGW/Cygwin) from code::blocks)

Software Development c
2
488
Member Avatar for vampgirl13

Hi, I was wondering if anyone can help me translate this into java. Thanks [CODE]#include "Element.h" #include <stdlib.h> element * Element(int s1, int w1, double c1, int x1, int k1) { element * retval = malloc(sizeof(element)); retval->s = s1; retval->w = w1; retval->c = (float) s1 / (float) w1; retval->x …

Software Development algorithm c
Member Avatar for vampgirl13
2
112
Member Avatar for richman0829

I got not one but two good answers to my last question, which was how to make a function that would both create an array and fill it. I was surprised to find that the first one of them was so simple - I had been making it harder than …

Software Development c++
Member Avatar for richman0829
2
86
Member Avatar for power_computer

I have a linked list containing the following data struct node { string name; int hours; node* next; } I have all function I've made so far working, adding indiviual node, deleting node, printing data in nodes, Ive made the program to read from a file upon execution to create …

Software Development c++ linked-list
Member Avatar for power_computer
2
1K
Member Avatar for harshchandra

The famous Tower Of Hanoi with graphics and animations.

Software Development c
Member Avatar for akhil1989
2
2K
Member Avatar for Wong23

I am given the class definition of stack and queue classes where I have to write a templated function called reverseQueue(?) that takes a pointer to queue as a parameter and uses stack object to reverse the given queue. The function call to reverseQueue should reverse the data of the …

Software Development c++ queue
2
229
Member Avatar for pythopian

PlugIns in their simplest form can be just python modules that are dropped into some designated directory and dynamically loaded by the main application. This snippet can be used to do just that. [B][U]Usage[/U][/B] To load plugin modules: [CODE]>>> plugins = importPluginModulesIn('mypackage') >>> plugins {'foo': <module 'foo' from 'mypackage\foo.py'>, 'bar': …

Software Development python
Member Avatar for pythopian
2
828
Member Avatar for Ancient Dragon

This demonstrates how to get a list of your computer's logical drive letters under the MS-Windows operating system.

Software Development c operating-system
Member Avatar for Ancient Dragon
2
929
Member Avatar for pythopian

This is one simple way to emulate a singleton class on behalf of a normal class. (A singleton class is a class with at most one instance.) The implementation does not emulate a class 100% (for example it lacks the special attributes lile __dict__ or __bases__), but it should be …

Software Development python
2
235
Member Avatar for vinnijain

Hi!!!!!!! I have made a window application in which i am entering mathematical equations and side by side the corresponding math format is generated like we see in books. In this, I am using LATEX/MimeTEX for generating math format and it uses special symbols for generating math format. Like for …

Software Development
Member Avatar for Geekitygeek
2
555
Member Avatar for vinnijain

I have made a project and now when it comes to designing I could not find any better way. I searched google and found certain applications which have already made user controls like silver panel,navigation bar etc........ Now can anyone tell me how can I use these user controls from …

Software Development
Member Avatar for vinnijain
2
171
Member Avatar for Jx_Man

This is code for Encrypt and Decrypt. this a simple logic of encryption. Please leave comment or feedback if this code helps you. Thanks. Jery. :) the encrypt function place in a module. This Code needed : 1 Module 1 combo box (For input before encryption) text1 in this program …

Software Development encryption visual-basic
Member Avatar for MATRIX123456
2
1K
Member Avatar for Loved

Hi, I am fairly new to java and have been playing around with scanners and while trying to understand this problem I am running into an error "Non-static variable vacation cannot be referenced from a static context" Obviously this isn't quite a completed program, but I am not sure why …

Software Development java
Member Avatar for Loved
2
165
Member Avatar for Nitricity

Hi ive been experimenting with basic calculations and using scanf to be able to enter an integer, if i give numb_1 a value it will divide and calculate the remainder fine but i cant get it to work by being able to enter a number, it just sits on the …

Software Development c++
Member Avatar for Nitricity
2
151
Member Avatar for fortex

Hello everyone, right now I'm taking a java class, and I'm having one error in my app. Right now I have to .java files, one which calls the methods from another .java file. When I compile the first java file, it doesn't give me any error. But when compiling the …

Software Development gui java java-swing
Member Avatar for BestJewSinceJC
2
149
Member Avatar for ddanbe

Start a new Forms application. Drop a Panel and a Timer control on it. Set up a Timer_Tick, Form_Load and a Panel_Paint eventhandler and fill in the code. Run the app and watch the string rotate.

Software Development
Member Avatar for Diamonddrake
2
1K
Member Avatar for programmingnova

Hello, I've been programming with C++ for only several weeks now, but I have come across a practice problem that has given me trouble. The objectives: collect data from a student including: his major (CIS or Math), last name, number of credits completed, GPA, and tuition paid. Then calculate and …

Software Development c++ display
Member Avatar for programmingnova
2
134
Member Avatar for theo19

[CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Calc extends JFrame implements ActionListener{ JFrame frame; JPanel textfield1,textfield2,rowpanel,calcb,mainpanel; JTextField display; JButton[] b; public Calc(){ frame=new JFrame("Calculator"); textfield1=new JPanel(); textfield2=new JPanel(); display = new JTextField(16); mainpanel = new JPanel(); textfield1.setLayout(new GridLayout(4,6)); textfield1.add(display); textfield2.add(textfield1); //array String[] cbuttons = {"7","8", "9","/", "4", "5", …

Software Development java java-swing
Member Avatar for BestJewSinceJC
2
191
Member Avatar for DdoubleD

Quite a few people have been asking how they can get their applications to talk to each other. More specifically, they have been wanting to know how to access information from another running application using .NET Remoting. Not having done this before, I decided to take up the challenge and …

Software Development asp.net
Member Avatar for ddanbe
2
1K
Member Avatar for Daithi

I'm stuck on the very last part of a problem. [I] You've bought a square plot of land on ebay and you now want to plan how to develop this land. The trouble is, you've never been there. All you have is the engineer's terrain report which is an NxN …

Software Development c++
Member Avatar for VernonDozier
2
141
Member Avatar for gibson.nathan

alright here are my instructions: [QUOTE]Display a menu giving the user a choice of character sets to use to construct the password. (Note: Do not use the first range of punctuation symbols with ASCII values from 33--47). 4. Allow the user to select the number of characters in the password …

Software Development java
Member Avatar for VernonDozier
2
1K
Member Avatar for Gribouillis

This is a command line utility which lists the names of all functions defined in a python source file with a [icode]def <name>[/icode] statement

Software Development python
2
216
Member Avatar for vegaseat

Just bouncing a red ball within the frame of a window, the twist here is that the image is stored within the code as a base64 encoded string of the gif image. This way you only have to distribute one file. The Python code is heavily commented, so you can …

Software Development python
Member Avatar for Arkapravo
2
375
Member Avatar for vegaseat

The normal XOR crypting is used with a small base64 twist to produce printable crypted text.

Software Development python
2
350
Member Avatar for vegaseat

This shows you how to draw a colorful bar graph of a data set using the Tkinter canvas and rectangles. An attempt has been made to use most of the canvas area for the graph. The bars are spaced and labeled with the corresponding value. The x-axis is simply the …

Software Development python tkinter
2
4K
Member Avatar for vegaseat

Just a small Python program to calculate monthly payments and other costs. I have compared it with some of the calculators available from many of the online mortgage companies, and results seem to match.

Software Development python
2
1K
Member Avatar for G-Do

Suppose you are a medical researcher studying diabetes. Your boss has given you a big chart of data from diabetes patients. Each row of the chart has information for one patient. Each column of the chart is a health-related statistic, such as height, weight, age, blood pressure, cholesterol level, etc. …

Software Development algorithm python
2
1K
Member Avatar for vegaseat

Small image files can be embedded in Python code using the base64 encoded string of the image. If you have to present a number of small fixed images in your program, embedding might be easier than including a set of image files. Attached files can be lost, and than your …

Software Development image python
2
4K
Member Avatar for vegaseat

This code shows you how to build a multiline story string that should display similarly to way it shows in the code. It should be relatively easy to maintain.

Software Development c
Member Avatar for bumsfeld
2
115
Member Avatar for vegaseat

VPython's fame is with 3D animated modeling, but it's plotting abilities, while not flashy, are easy to understand and very useful. This program uses VPython to plot math functions y = sin(x) and y = cos(x) and y = sin(x)*cos(x).

Software Development python
2
306
Member Avatar for vegaseat

If you have a Windows computer you can play musical beeps through the internal speaker. In this case it will sound like a very tiny Big Ben, brought to you by the module winsound and its method Beep().

Software Development python
2
2K
Member Avatar for vegaseat

Did you ever want to know how how many square inches are in a square meter? This short Python code allows you to get the answer. It uses a dictionary to simplify the conversions. Could be the start of a nice GUI program using radio buttons.

Software Development gui python
Member Avatar for vegaseat
2
3K
Member Avatar for vegaseat

The Python list container can be used for many practical things. In this somewhat light-hearted introspection of modern day politics we are looking at two lists and attempt to clear out elements that shouldn't be in both lists. No offense to anyone is intended, the outcome with the sets was …

Software Development politics python
Member Avatar for vegaseat
2
227
Member Avatar for vegaseat

A while ago I created a code snippet in C for the same question. Solving this question with Python is a lot simpler, and on top of that Python takes care of impossible dates with the appropriate error message.

Software Development python
Member Avatar for Lingson
2
225
Member Avatar for vegaseat

While the calculation of the total resistance of two resistors in parallel is simple, this code shows you how to trap a number of potential errors that come with the entry of the required data. All is wrapped easily into a colorful GUI program, due to the simplicity of the …

Software Development gui os-x python tkinter
2
3K
Member Avatar for vegaseat

The module datetime allows you to call several functions that can do computation with dates and times. How many days since my birth? How many days till Xmas? What's the date 77 days from now? The code snippet should give you a flavor, enough to explore on your own.

Software Development python
2
823
Member Avatar for vegaseat

The wxPython library allows Python to create Windows GUI programs. Here is a look at the listbox component. Click a button to load the listbox with names, select the name by clicking on it on the list, and display it in the title bar of the window frame. Another button …

Software Development gui python
Member Avatar for vegaseat
2
3K
Member Avatar for vegaseat

This program uses WinApi function SetPixel() to plot math functions y = sin(x) and y = cos(x) and y = sin(x)*cos(x) along a y-axis centered on the console screen. Make sure that gdi32.lib is included in the libraries to be linked.

Software Development c
Member Avatar for brale
2
305
Member Avatar for vegaseat

The Simple DirectMedia Layer (SDL) library allows for manageable multimedia programming in console mode. Now you can mix graphics, animated or otherwise, with sound and make your game project more interesting. I am showing an example for Dev-C++ using math generated graphics, purloined from the NET, and give some instructions …

Software Development c++ multimedia
2
220
Member Avatar for vegaseat

An example how to line up your decimal points in a column like output of floating point numbers. Both C and C++ versions are shown. Thanks are given to Bud Tugly, my 77 year old senior student.

Software Development c++
Member Avatar for vegaseat
2
218
Member Avatar for vegaseat

Another application of the Python Image Library (PIL). This time we are loading an image and rotate it counterclockwise by a specified number of degrees. The image is shown rotated and then saved to the working folder. PIL handles a fair amount of image file formats easily.

Software Development image python
Member Avatar for vegaseat
2
5K

The End.