|
-
Favorite web development editors
Date: 01/02/11
(PHP Community) Keywords: php, programming, css, html, web, linux
Greets,
I am starting to dabble in web programming, again, after a long hiatus. I am a Debian/Linux guy, and am hoping some folks that do web development can recommend or share which web development editors and tools they have used, liked or disliked.
I tend to use vi/emacs for programming, but think to do web site development a 'dreamweaver' or other similar tool, that helps organize and edit pages and text files for PHP, HTML, CSS, and JS would probably be better than vi or emacs :)
Let me know, and thanka.
Source: http://php.livejournal.com/680974.html
-
Custom validator in a custom control
Date: 01/21/10
(C Sharp) Keywords: programming, java
I am programming a control that will have a custom validator in it. The control will be called on a page inside a repeater. I was hoping to have client validation on this custom validator. If I do this, when the page is rendered, won't the javascript function names be repeated and won't that cause an error? Is there a way around this and does anyone have any example code I can look at?
Source: http://csharp.livejournal.com/106272.html
-
Looking for music player with specific attributes
Date: 07/23/10
(Software) Keywords: programming
(x-posted to geekware)
I am looking for a music player (for Windows) that has certain features, but everything I can find lacks one or more features.
They are: - ability to tag songs with more than one genre (I have music that I want to mark as Celtic, and Folk, and Instrumental, and Soundtrack, for instance--I tend to be very specific about how I tag songs) - ability to filter songs based on combinations of genres (allowing for both AND and/or OR operations, not merely OR only or suchlike--in other words for those who don't know Boolean operators, I want to be able to control it so I can allow only songs that are both Instrumental AND Soundtrack, or to allow songs that are *either* Instrumental OR Soundtrack, depending on what I need right then--there is a big difference between the two!) - a playlist component separate from the library component (no queueing up a few files within the library for playback without being able to see a visible playlist of what's queued--in other words, trying to play anything from the library should automatically send it to a visible playlist separate from the library) - ability to "update" where a file is (for instance, if I rename a whole folder, the program will lose track of the songs, and rather than remove them and re-add them, I want to be able to "re-find" the song through a file dialog and redirect the program to its new location--this would then preserve all tagging, the number of times played, etc. so I don't have to do all sorts of editing when adding the song again) - ability to play a wide variety of file types, not just mp3 (wav, FLAC, ogg, wma, m4a, ape, etc.)
The only program I've found to be able to tag songs with multiple genres is dBpowerAMP, and it only allows OR when filtering (at times I need AND so songs have to fit both genres before being allowed). It does allow all sorts of files to be played if you install the needed codecs for it. It has an atrocious playlist system, however, though you can at least see queued songs separately somewhat. And it freaks out when a song is moved and I have to remove the song and re-add it, which is a big pain. Hence although I've used it extensively in the past, I've gotten so fed up with it that I haven't used anything but Windows Media Player 6.4 to play files for a long while (I set it as my default mp3 player, and it's so speedy to pop up and play a single track--but that doesn't help when I want to shuffle music or set up a playlist).
So I'm at my wit's end trying to find one that will do these things, if it indeed exists. (Personally, these requirements are so logical I'm surprised no one has created such a program yet, but maybe there's just not enough people who really care about managing their music to this level.) If it doesn't, is there anywhere I should post ideas for programming projects? I'm not a programmer, else I would have tackled this long ago. (I should mention I had a boyfriend who was, who started creating such a program for me, but when we broke up, that kinda stagnated. I've still got all his code, binaries, and such, on my computer, but it's in definite alpha stages so far, and he was trying to code it to work on both Ubuntu and Windows both, since he ran Ubuntu, so that made things a bit interesting for him.)
Source: http://software.livejournal.com/88098.html
-
Divide a circle
Date: 05/11/11
(Algorithms) Keywords: programming
Hi! I've been member of this community for quite time, and now I need some advise.
Question is how do I devide given circle with radius R into N vertical segments with same area? And by vertical I mean that devising lines should be parralell to the diametr line of that circle. One more thing - N is always even. Simple example is N = 2 : and we have circle divided vertically into two parts of equal area with deametr line.
I need this to speedup my litlle research on mathematical statistics with parallel GPU eval.
Any help In form of formula, or ref to the known algorithm (if it does exists) or some code on almost any programming language would be g8.
UPD Illustration added. Case: R=1 N=6, areas of all segments are equal. I need to know OX points marked with question marks.
Source: http://algorithms.livejournal.com/105444.html
-
Debugged
Date: 03/30/08
(Algorithms) Keywords: programming
Edit: Error was located and corrected. I love how programming can turn programmers temporarily blind :) I'll leave it here in the hope that perhaps others with the same problem can find it and think "OOOOooooOooh" before publically admitting to a community that they can't keep track of their pointers. :)
Thank you all for your help to my previous post! I've started to pick up C syntax really quickly since, and I've been integrating my two programs; the one with the functions to push, pop and create arrays, with the program lightning_rose suggested that I should write. So far my array seems to work and I'm sure that my push function is working, but when I ask it to print the contents of the stack, it prints 0. My aim isn't to iterate down the entire array, but to print that they've been pushed once they've been pushed.
Here is the buggy bit - where I expect the error is:
/* else, it will be an integer.*/
else
{
int temp = atoi(argv[i]);
push (temp);
//int i = 0;
printf("Stack: %d", stack[top]);
//printf("Integer: %d\n",atoi(argv[i]));
}
/*
* **** HISTORY *****
*
* Filename: test.c
* Synopsis: test
*
* This is a simple program that will take input from the keyboard and then
* print each line of input to screen.
* Version 0.1 - Program simply returned a string of characters that had been
* entered using printf.
* version 0.2 - program differentiated between a string of characters and an
* integer.
* version 0.3 - Fixed a bug in the code that caused a 0 integer to be printed
* after characters. Originally believed it to be a null byte, later discovered
* that it was, in fact, a flaw in my if statements since I hadn't used else.
* the use of else and else if in the testing area of the program are important
* so that characters aren't printed as characters then passed down to be converted
* into integers.
* version 0.4 - program began to differentiate between characters, an operand
* and the specific operators +, -, /, x and =. I was able to tell that the
* differentiation had been made by asking the program to print out which each
* was, for example: If I had entered: test 1 a + the program would output:
* Integer: 1, Character: a, Symbol +.
* version 0.5 - Array was defined from code that had been written in p3.c which was
* written at an earlier date. This is where p3.c and test.c began to merge as
* the final solution to p3.c with p3.c merging into test.c.
*/
#include
#include
/*
* define is used to make modification of each easier. It is also good for readability.
* Characters A - D will be assigned values that the user wishes to store so that they
* can later be used by, for example, 2 A +.
*/
#define stack empty
#define MemoryA A
#define MemoryB B
#define MemoryC C
#define MemoryD D
/*
* I need to define my array that will be used in a similar way to how I understand a
* stack. The type of array that I will use is a fixed-length array so that the program
* size will have a limit of 20 elements.
* See Page 112 - C In a Nutshell
*/
int top = 0; /*Pointer to keep track of where the top of the stack/array is*/
//int maxstack = 20; /*Allocates the maximum value of the stack-array */
int stack[50]; /*sets the array stack equal of the maximum value of the stack*/
void push(int x);
/*
* The push function will push a new entry onto the stack at the stack pointer "top".
* Once the entry (passed in as x) has been assigned as an element to the stack the
* "stack pointer" top will then increment by one so that it is pointing to the next
* free space.
*/
void push(int x)
{
stack[top] = x;
top ++;
}
int main (int argc, char *argv[])
{
int i;
int j = 0;
for (i = 1; i < argc; i++)
{
for(j=0; j < strlen(argv[i]); j++)
{
/*This is a test to see if a the input is a
* alphabetical number. If it is, then the
* program will then check to see if it is
* specifically A, B, C or D.
*/
if (isalpha(argv[i][j]))
{
printf("Character: %s\n", argv[i]);
}
/* These tests will test to see if input is an operand*/
else if (strcmp(argv[i], "+") == 0)
{
printf("Symbols: %s\n", argv[i]);
}
else if (strcmp(argv[i], "-") == 0)
{
printf("Symbols: %s\n", argv[i]);
}
else if (strcmp(argv[i], "/") == 0)
{
printf("Symbols: %s\n", argv[i]);
}
else if (strcmp(argv[i], "x") == 0){
printf("Symbols: %s\n", argv[i]);
}
/* else, it will be an integer.*/
else
{
int temp = atoi(argv[i]);
push (temp);
//int i = 0;
printf("Stack: %d", stack[top]);
//printf("Integer: %d\n",atoi(argv[i]));
}
}
}
}
Source: http://algorithms.livejournal.com/98764.html
-
C
Date: 03/28/08
(Algorithms) Keywords: programming, html, java
I'm finding C difficult to understand. I'm working using two books: C in a Nutshell and I'm referencing with Comprehensive C (which is old but it was free.) The problem I'm trying to solve is to create a Reverse Polish Notation calculator. I'm using an array as a stack and the basic principle is: for input (from command prompt) 2 1 + Push 2 on the stack. Push 1 onto the stack. Meet operator, pop two and then push answer onto the stack.
But I'm having problems with my main method, particularly with the C syntax. This is my main method so far:
/* * I need a way for the program to read input separated by space, where a space will * indicate the end of a value. For example: 23 3 is the input twenty three and three, * not: two, three, three. * * When an integer operand is encountered, it will be pushed onto the stack. An operator * will cause two items of the stack of be popped then a push of the answer. argc = SIZE OF THE ARRAY argv = Array of strings that represents the command line entered. */
int main (int argc, char *argv)
{ int i; for (i = 1; i < argc; i++) { if (x argv = int) { push(int x)
//http://www.cppreference.com/stdstring/isdigit.html //http://www.cppreference.com/stdstring/atoi.html } }
The hyperlinks are a link to two methods from the library that I need to use: isdigit() and atoi(). Because the input is being entered from the command prompt it's my understanding that a character and an integer cannot be differentiated simply by their bit pattern. What I need to do with the input is take the "string", convert it to an integer and then check to see if it is an integer or not.
Now, in Java I'd do something like x.isdigit().atoi() but... gah! There's a lot of true/false requirements in there and I don't think I actually fully understand exactly what I'm trying to do.
This is what I'm planning to do, in English:
If ( x is a character) { either return 0 as value or set next item to memory location [x] } if (x is an operator) { POP two from the stack use operator on two operands Push answer onto the stack again //error checking for condition that only one value has been pushed onto stack } //otherwise, fall through assuming that x is an integer convert x into an integer using atoi() Push (x)
TADA!
I'm planning on using if for error checking and converting everything else to case statements instead. I'm use to programming in java, though, so I'm scared that I'm java-ing too much :/
Advice? Kicks? Clarifications?
Source: http://algorithms.livejournal.com/98390.html
-
C
Date: 02/01/08
(Algorithms) Keywords: programming, java
Can anyone recommend a good beginners book on C?
In a few weeks time I will be using C for low level programming to solve problems. (Low level programming being the class.) C will be my second language, I already understand the basics of java objects and ADT's so preferably a book that defines clearly why C isn't object oriented...
Edit: I ended up buying "C in a Nutshell" because it is the course textbook and came highly recommended. It doesn't provide enough baby-step explanations for me, though, so I'm still finding C a damned difficult language to learn. Thank you all for your suggestions, I'm planning on buying the recommended book anyway in the hope that the developers of C will be better at explaining things.
Source: http://algorithms.livejournal.com/97535.html
-
ComboBoxes in two pages.
Date: 03/12/08
(Asp Dot Net) Keywords: programming, asp, web
Hi. I'm newbie both in ASP.NET and in web programming, so my question may be dumb. Sorry if so. I have two pages in my project and each page contains combo box. Comboboxes bind to one data source. I need to solve following task: if user select combo box item in one page, the same item must be selected in another page automatically. Is there any ways to do this or it's impossible?
Source: http://aspdotnet.livejournal.com/97019.html
-
microXMPP project
Date: 05/10/09
(See my site) Keywords: programming, web, linux
I started a new project, microXMPP. It's a lightweight implementation of Jabber/XMPP protocol, written in ANSI C. The idea is to make XMPP protocol support applications, not applications support the protocol. Because of this, microXMPP is made as easy to use as possible, and as compatible as it could be. The code can be compiled under both Windows and Linux, and callback-based architecture avoids complex programming. Great for making XMPP bots and other Jabber client stuff!
The microXMPP project web page is http://xmppmicro.110mb.com/. All the sources can be downloaded from that page, along with documentation. In order to make things easier, a minimalist Jabber client is provided as application example. Small updates appear almost every week.
Source: http://see-my-site.livejournal.com/119635.html
-
Social website Idea
Date: 06/25/08
(See my site) Keywords: programming, web
Inspiration: Everywhere I go I see posted signs advertising www.yourcityheresingles.com. It seems like no matter how remote your location or how minimal your local population, there now exist websites devoted to finding singles in your area. As someone who hasn't had so much experience being single, but LOTS of experience being "lonely" and seemingly "friendless" amongst a HUGE population of people my age, I feel that a website for networking is long overdue. Sure we may live in large cities but rarely do we venture outside our circles when we go out. If you're in a relationship, bar outings typically involve you, your significant other, and either your own or your significant other's friends and their partners. Rarely do we involve ourselves with new faces outside of work or school and even if we want to, rarely do we introduce ourselves to new strangers when faced with the comforting presence of our current friends. As a former member of various sub-cultures including punks and ravers, this "random" meeting of new people with similar interests is an almost guaranteed outcome of attending the various musical events associated with your "scene." I definitely took this for granted in college, meeting 2-a dozen new faces each evening without even trying. If you've been involved in a sub-culture you understand. Simply asking to bum a cigarette or paying someone a compliment on their wardrobe or dance technique is an easy enough way to find a new friend. Then I entered the "real world," full of business types and outgoing yet reserved people, social enough to find themselves in a bar trivia night yet frightened/uninterested enough to avoid social contacts beyond the group they arrived with. Unfortunately I place myself in this category as well; it's not that I don't want to meet new people but when you're already with 10 other people it just seems misplaced and sometimes desperate to strike up conversation with an unknown neighbor. And yet I'm willing to bet there are many like me who have friends and a relationship, and are relatively happy with their life....but still long for others out there with MORE similar interests, or at least a change of the rehearsed, overplayed interactions we're accustomed to. So, my idea is simply to build a site with a basic profile, available for free, to people living in the same zipcode, who aren't looking for anything more than a friend with similar interests. If you're interested and have programming knowledge, please reply so we can get something started.
Source: http://see-my-site.livejournal.com/115843.html
-
​FOSSA: Open-sourcing open-source license management
Date: 03/25/18
(Open Source) Keywords: programming
Senior developers know that one of the biggest problems with programming today isn't the coding itself, but keeping on the right side of all the base code's open-source licenses. FOSSA has an answer.
Source: https://www.zdnet.com/article/fossa-open-sourcing-open-source-license-management/#ftag=RSSbaffb68
-
Inkwell Creative Hiring Web Developer
Date: 02/11/11
(Web Development) Keywords: programming, css, html, technology, database, web, seo
Inkwell Creative, a growing Portland, Oregon company focusing on web design, graphic design, interactive media, video and branding, is looking to hire a web developer. We are seeking a hard working team player and someone who is forward thinking when it comes to technology. You must be able to work with us in a collaborative team setting, know many coding and web programming languages and have a strong portfolio. Requirements: 5+ years of experience Strong portfolio Must be collaborative Knowledge of many coding/web development languages Knowledge of CSS and HTML 5, Content Management Systems, Flash, SEO programming, Integration into Databases Knowledge of iPhone apps a plus Compensation: DOE. Benefits and paid-for parking. This is a salary position. TO APPLY: Email a cover letter, resume and link to your online portfolio to hr@inkwellgroup.com. Please include in your cover letter any outside hobbies, passions and interests. We kindly request no phone calls and no employment agencies. APPLICANTS WITHOUT A COVER LETTER, RESUME AND PORTFOLIO WILL NOT BE CONSIDERED
Source: https://webdev.livejournal.com/573896.html
-
N00blet soup
Date: 11/29/10
(Web Development) Keywords: programming, java, web
Hello! Long time lurker first time poster. I am just beginning my adventures with web programming, and am trying to make an application within the Netbeans IDE that says "Hello World!"
My code is package bigjava; public class HelloPrinter { public static void main(String[] args) { // Display a greeting in the console window
System.out.println("Hello, World!"); } }
I just created a project called BigJava after the textbook Big Java 3rd edition. Java is case sensitive and my subfolder is in all lower case. When I run it the application doesn't have any errors, but it also doesn't print out the "Hello, World" that I desire.
Any thoughts? If this isn't appropriate for the community let me know. Thanks for any advice or thoughts!
Source: https://webdev.livejournal.com/570056.html
-
Hello!
Date: 03/25/18
(PHP Community) Keywords: php, programming
I just started to use LJ, so i thought it would be nice to have some friends here. I'm into coding and programming. I recently started to practice PHP and now i found this community. So please don't judge me i'm just a kid.
Source: https://php.livejournal.com/683842.html
-
Inkwell Creative Hiring Web Developer
Date: 02/11/11
(PHP Community) Keywords: programming, css, html, technology, database, web, seo
Inkwell Creative, a growing Portland, Oregon company focusing on web design, graphic design, interactive media, video and branding, is looking to hire a web developer. We are seeking a hard working team player and someone who is forward thinking when it comes to technology. You must be able to work with us in a collaborative team setting, know many coding and web programming languages and have a strong portfolio. Requirements: 5+ years of experience Strong portfolio Must be collaborative Knowledge of many coding/web development languages Knowledge of CSS and HTML 5, Content Management Systems, Flash, SEO programming, Integration into Databases Knowledge of iPhone apps a plus Compensation: DOE. Benefits and paid-for parking. This is a salary position. TO APPLY: Email a cover letter, resume and link to your online portfolio to hr@inkwellgroup.com. Please include in your cover letter any outside hobbies, passions and interests. We kindly request no phone calls and no employment agencies. APPLICANTS WITHOUT A COVER LETTER, RESUME AND PORTFOLIO WILL NOT BE CONSIDERED
Source: https://php.livejournal.com/681768.html
-
Favorite web development editors
Date: 01/02/11
(PHP Community) Keywords: php, programming, css, html, web, linux
Greets,
I am starting to dabble in web programming, again, after a long hiatus. I am a Debian/Linux guy, and am hoping some folks that do web development can recommend or share which web development editors and tools they have used, liked or disliked.
I tend to use vi/emacs for programming, but think to do web site development a 'dreamweaver' or other similar tool, that helps organize and edit pages and text files for PHP, HTML, CSS, and JS would probably be better than vi or emacs :)
Let me know, and thanka.
Source: https://php.livejournal.com/680974.html
-
Custom validator in a custom control
Date: 01/21/10
(C Sharp) Keywords: programming, java
I am programming a control that will have a custom validator in it. The control will be called on a page inside a repeater. I was hoping to have client validation on this custom validator. If I do this, when the page is rendered, won't the javascript function names be repeated and won't that cause an error? Is there a way around this and does anyone have any example code I can look at?
Source: https://csharp.livejournal.com/106272.html
-
Looking for music player with specific attributes
Date: 07/23/10
(Software) Keywords: programming
(x-posted to geekware)
I am looking for a music player (for Windows) that has certain features, but everything I can find lacks one or more features.
They are: - ability to tag songs with more than one genre (I have music that I want to mark as Celtic, and Folk, and Instrumental, and Soundtrack, for instance--I tend to be very specific about how I tag songs) - ability to filter songs based on combinations of genres (allowing for both AND and/or OR operations, not merely OR only or suchlike--in other words for those who don't know Boolean operators, I want to be able to control it so I can allow only songs that are both Instrumental AND Soundtrack, or to allow songs that are *either* Instrumental OR Soundtrack, depending on what I need right then--there is a big difference between the two!) - a playlist component separate from the library component (no queueing up a few files within the library for playback without being able to see a visible playlist of what's queued--in other words, trying to play anything from the library should automatically send it to a visible playlist separate from the library) - ability to "update" where a file is (for instance, if I rename a whole folder, the program will lose track of the songs, and rather than remove them and re-add them, I want to be able to "re-find" the song through a file dialog and redirect the program to its new location--this would then preserve all tagging, the number of times played, etc. so I don't have to do all sorts of editing when adding the song again) - ability to play a wide variety of file types, not just mp3 (wav, FLAC, ogg, wma, m4a, ape, etc.)
The only program I've found to be able to tag songs with multiple genres is dBpowerAMP, and it only allows OR when filtering (at times I need AND so songs have to fit both genres before being allowed). It does allow all sorts of files to be played if you install the needed codecs for it. It has an atrocious playlist system, however, though you can at least see queued songs separately somewhat. And it freaks out when a song is moved and I have to remove the song and re-add it, which is a big pain. Hence although I've used it extensively in the past, I've gotten so fed up with it that I haven't used anything but Windows Media Player 6.4 to play files for a long while (I set it as my default mp3 player, and it's so speedy to pop up and play a single track--but that doesn't help when I want to shuffle music or set up a playlist).
So I'm at my wit's end trying to find one that will do these things, if it indeed exists. (Personally, these requirements are so logical I'm surprised no one has created such a program yet, but maybe there's just not enough people who really care about managing their music to this level.) If it doesn't, is there anywhere I should post ideas for programming projects? I'm not a programmer, else I would have tackled this long ago. (I should mention I had a boyfriend who was, who started creating such a program for me, but when we broke up, that kinda stagnated. I've still got all his code, binaries, and such, on my computer, but it's in definite alpha stages so far, and he was trying to code it to work on both Ubuntu and Windows both, since he ran Ubuntu, so that made things a bit interesting for him.)
Source: https://software.livejournal.com/88098.html
-
Divide a circle
Date: 05/11/11
(Algorithms) Keywords: programming
Hi! I've been member of this community for quite time, and now I need some advise.
Question is how do I devide given circle with radius R into N vertical segments with same area? And by vertical I mean that devising lines should be parralell to the diametr line of that circle. One more thing - N is always even. Simple example is N = 2 : and we have circle divided vertically into two parts of equal area with deametr line.
I need this to speedup my litlle research on mathematical statistics with parallel GPU eval.
Any help In form of formula, or ref to the known algorithm (if it does exists) or some code on almost any programming language would be g8.
UPD Illustration added. Case: R=1 N=6, areas of all segments are equal. I need to know OX points marked with question marks.
Source: https://algorithms.livejournal.com/105444.html
-
Debugged
Date: 03/30/08
(Algorithms) Keywords: programming
Edit: Error was located and corrected. I love how programming can turn programmers temporarily blind :) I'll leave it here in the hope that perhaps others with the same problem can find it and think "OOOOooooOooh" before publically admitting to a community that they can't keep track of their pointers. :)
Thank you all for your help to my previous post! I've started to pick up C syntax really quickly since, and I've been integrating my two programs; the one with the functions to push, pop and create arrays, with the program lightning_rose suggested that I should write. So far my array seems to work and I'm sure that my push function is working, but when I ask it to print the contents of the stack, it prints 0. My aim isn't to iterate down the entire array, but to print that they've been pushed once they've been pushed.
Here is the buggy bit - where I expect the error is:
/* else, it will be an integer.*/
else
{
int temp = atoi(argv[i]);
push (temp);
//int i = 0;
printf("Stack: %d", stack[top]);
//printf("Integer: %d\n",atoi(argv[i]));
}
/*
* **** HISTORY *****
*
* Filename: test.c
* Synopsis: test
*
* This is a simple program that will take input from the keyboard and then
* print each line of input to screen.
* Version 0.1 - Program simply returned a string of characters that had been
* entered using printf.
* version 0.2 - program differentiated between a string of characters and an
* integer.
* version 0.3 - Fixed a bug in the code that caused a 0 integer to be printed
* after characters. Originally believed it to be a null byte, later discovered
* that it was, in fact, a flaw in my if statements since I hadn't used else.
* the use of else and else if in the testing area of the program are important
* so that characters aren't printed as characters then passed down to be converted
* into integers.
* version 0.4 - program began to differentiate between characters, an operand
* and the specific operators +, -, /, x and =. I was able to tell that the
* differentiation had been made by asking the program to print out which each
* was, for example: If I had entered: test 1 a + the program would output:
* Integer: 1, Character: a, Symbol +.
* version 0.5 - Array was defined from code that had been written in p3.c which was
* written at an earlier date. This is where p3.c and test.c began to merge as
* the final solution to p3.c with p3.c merging into test.c.
*/
#include
#include
/*
* define is used to make modification of each easier. It is also good for readability.
* Characters A - D will be assigned values that the user wishes to store so that they
* can later be used by, for example, 2 A +.
*/
#define stack empty
#define MemoryA A
#define MemoryB B
#define MemoryC C
#define MemoryD D
/*
* I need to define my array that will be used in a similar way to how I understand a
* stack. The type of array that I will use is a fixed-length array so that the program
* size will have a limit of 20 elements.
* See Page 112 - C In a Nutshell
*/
int top = 0; /*Pointer to keep track of where the top of the stack/array is*/
//int maxstack = 20; /*Allocates the maximum value of the stack-array */
int stack[50]; /*sets the array stack equal of the maximum value of the stack*/
void push(int x);
/*
* The push function will push a new entry onto the stack at the stack pointer "top".
* Once the entry (passed in as x) has been assigned as an element to the stack the
* "stack pointer" top will then increment by one so that it is pointing to the next
* free space.
*/
void push(int x)
{
stack[top] = x;
top ++;
}
int main (int argc, char *argv[])
{
int i;
int j = 0;
for (i = 1; i < argc; i++)
{
for(j=0; j < strlen(argv[i]); j++)
{
/*This is a test to see if a the input is a
* alphabetical number. If it is, then the
* program will then check to see if it is
* specifically A, B, C or D.
*/
if (isalpha(argv[i][j]))
{
printf("Character: %s\n", argv[i]);
}
/* These tests will test to see if input is an operand*/
else if (strcmp(argv[i], "+") == 0)
{
printf("Symbols: %s\n", argv[i]);
}
else if (strcmp(argv[i], "-") == 0)
{
printf("Symbols: %s\n", argv[i]);
}
else if (strcmp(argv[i], "/") == 0)
{
printf("Symbols: %s\n", argv[i]);
}
else if (strcmp(argv[i], "x") == 0){
printf("Symbols: %s\n", argv[i]);
}
/* else, it will be an integer.*/
else
{
int temp = atoi(argv[i]);
push (temp);
//int i = 0;
printf("Stack: %d", stack[top]);
//printf("Integer: %d\n",atoi(argv[i]));
}
}
}
}
Source: https://algorithms.livejournal.com/98764.html
|