programming projects
I don't know about a project but if we were to take part in one, I know a lot of languages.
I'll attempt to list the ones I have a fair amount of knowledge in:
PHP,HTML,CSS,JS,Lua,Java,C# and some C++.
PHP is probably the strongest of my knowledge.
_________________
You must sleep now, Uncle Sempi!
-
Trouble finding the WP IRC chatroom on the new site?
You can find it here: http://webchat.freenode.net/?channels=wrongplanet
Well I have decided to write an FTP server. I have most of the base finished. The base being able to send and receive a file. I have to add to it. If all goes well I might add a UI with GTK.
If anyone wants to join let me know and ill post the code I have so far. I am writing it In C. As for the UI, that will be with GTK.
If anyone wants, we could code a synchronous client/server chat and add a UI or take out the UI and add a poll or epoll function to make the server asynch instead.
Anywho, I am going to bed and starting back up tomorrow night... Or afternoon. Depemding if I will be accompanied by someone.
BTW, I develop on Linux and wont touch a Windows box with a 1000 foot pole.
Amboxer, please reconsider using GTK for your GUI. You may have a very strong opinion about Windows (or OSX or whatever) but your users may feel differently. If it's portable, and you tie off every loose end, it could become popular.
People seem to have done a number of good-looking apps with Qt. The only problem with Qt being I believe it's a heavy layer, and your app sounds pretty light. That and licensing issues should you decide to go commercial. But Qt is available almost everywhere, even Android.
I've seen other server software just provide a browser based UI where you can point the browser to localhost:port and admin it from there. This is good because you can open the port and admin remotely with the same panel you use locally.
If I were doing your project, I would probably do a hybrid solution. A browser based admin panel, but an admin app that does very little other than display the browser admin panel in an embedded browser window. This will avoid confusing users who are used to using "apps" and don't understand the browser admin panel concept, while providing the flexibility.
Some OSes (e.g. Windows) may want server type software to be compatible with the OS's own concept of admin panels. You should account for this even if you aren't porting to that OS in the forseeable future.
People seem to have done a number of good-looking apps with Qt. The only problem with Qt being I believe it's a heavy layer, and your app sounds pretty light. That and licensing issues should you decide to go commercial. But Qt is available almost everywhere, even Android.
I've seen other server software just provide a browser based UI where you can point the browser to localhost:port and admin it from there. This is good because you can open the port and admin remotely with the same panel you use locally.
If I were doing your project, I would probably do a hybrid solution. A browser based admin panel, but an admin app that does very little other than display the browser admin panel in an embedded browser window. This will avoid confusing users who are used to using "apps" and don't understand the browser admin panel concept, while providing the flexibility.
Some OSes (e.g. Windows) may want server type software to be compatible with the OS's own concept of admin panels. You should account for this even if you aren't porting to that OS in the forseeable future.
QT is for CPP kind of like GTKMM. The most popular Linux WM is GNOME at the moment which is built with GTK.
Believe me GTK is my best option! I could care less about windows users and portability! Mac OSX is OK. I don't have a problem with that OS except I don't know obj-C lol
I don't plan on making my project more than... a project. Its a hobby and passion. Nothing more.
Bit late and it sounds like you've already picked an idea but I'd still like to say an idea...
(My knowledge of website code is very limited though, I'm more of a self taught game maker with java and C++ so I also don't know how to explain stuff very well in a technical and interpret-able form)
An app(Or preferably a website) that had the 'community, info and media, contact me, shop' links at the top and the 'new posts' table covering the rest of the page could be cool. So the links are all at the top of the page and then there would be a list of new topics. (The code that has the summary/title of new topics and the link to it is view-able so I would assume you'd be able to use something that reads that and puts it into the app.)
Then again that idea is based around what I like of this website, so it probably wouldn't appeal to all... And I like this idea mostly because currently accessing this website from mobile is a bit of a 'cluster ****' tiny screen, tons of info... And also the problem that I don't know if this is possible... And I doubt programming this into a website would work because it'd have to be a different website(If it wasn't accepted by the devs here...)
m.wrongplanet.com/condensed Would be cool... >.<
_________________
Play sims - Get bored - Kill sims - Understand God.
(My knowledge of website code is very limited though, I'm more of a self taught game maker with java and C++ so I also don't know how to explain stuff very well in a technical and interpret-able form)
An app(Or preferably a website) that had the 'community, info and media, contact me, shop' links at the top and the 'new posts' table covering the rest of the page could be cool. So the links are all at the top of the page and then there would be a list of new topics. (The code that has the summary/title of new topics and the link to it is view-able so I would assume you'd be able to use something that reads that and puts it into the app.)
Then again that idea is based around what I like of this website, so it probably wouldn't appeal to all... And I like this idea mostly because currently accessing this website from mobile is a bit of a 'cluster ****' tiny screen, tons of info... And also the problem that I don't know if this is possible... And I doubt programming this into a website would work because it'd have to be a different website(If it wasn't accepted by the devs here...)
m.wrongplanet.com/condensed Would be cool... >.<
That would be cool but we need more than just me and you! I'm pretty sure we would need a server. I have one so that's not an issue. We would need someone who's great with Java. Someone who's great with JavaScript. I'm decent but I'm not a pro. Then we would have to figure out how this is all done.
I am all for making wrong planet, mobile. I will put my ftp server and client aside to do this, if everyone is serious! How good are you with Java?
The main concern I have is, does anyone know how to mobilize a website, because I don't. Would we have to take the sites source and tweak it. Then host it on my server? If so then the next concern I would have is traffic. If this site gets a lot of traffic, my bandwidth would probably be exceed rather quick, no?
Here is the client code
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
int main(int argc, char *argv[]) {
int sockfd, portno;
ssize_t /*bytes_read,*/ bytes_written;
struct hostent *server;
struct sockaddr_in serv_addr, cli_addr;
char buffer[4096];
if(argc < 4)
{
fprintf(stderr, "Ussage: %s + IP Address + port number + file path.\n", argv[0]);
exit(0);
}
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if(sockfd < 0) {
printf("SOCKET(-1) error ---> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
bzero((char *) &serv_addr, sizeof(serv_addr));
server = gethostbyname(argv[1]);
if(server == NULL) {
fprintf(stderr, "No such host.\n");
printf("%s\n", strerror(errno));
exit(EXIT_FAILURE);
}
portno = atoi(argv[2]); //Grabbing the port number from the command line
serv_addr.sin_family = AF_INET;
memcpy(&serv_addr.sin_addr.s_addr, server->h_addr, server->h_length);
serv_addr.sin_port = htons(portno);
if(connect(sockfd, (const struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) {
fprintf(stderr, "%s. CONNECT()\n", strerror(errno));
exit(EXIT_FAILURE);
}
else {
printf("Made a connection to %s\n", inet_ntoa(serv_addr.sin_addr));
}
for( ; ; )
{
FILE *file = fopen(argv[3], "rb+");
if(file == NULL) {
printf("! FOPEN(NULL) error --> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
if(file < 0) {
printf("! FOPEN(-1) error --> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
else if(file) {
fseek(file, 0, SEEK_END);
int32_t size = ftell(file);
//printf("=> File size is %d.\n", size);
rewind(file);
int file2buffer = fread(buffer, sizeof(size), 1, file);
if(file2buffer < 0) {
printf("! FREAD(-1) error --> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
if(file2buffer == 0) {
printf("! FREAD(0) error --> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
}
printf("%s", buffer);
bytes_written = write(sockfd, buffer, strlen(buffer));
if(bytes_written < 0) {
printf("! WRITE(-1) error --> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
if(bytes_written == 0) {
printf("! WRITE(0) error --> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
}
close(sockfd);
return 0;
}
Unless a few of yall want to redo Wrong Planet and make it mobile.
And the server
#include <netdb.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main(int argc, char *argv[]) {
int sockfd, newsockfd, portno, binder, listener;
ssize_t bytes_read, bytes_written;
struct sockaddr_in serv_addr, cli_addr;
struct hostent *server;
socklen_t clilen;
char data[4096];
if(argc < 3) {
printf("Usage: %s ip address + port number.\n", argv[0]);
exit(EXIT_FAILURE);
}
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if(sockfd < 0) {
printf("SOCKET(-1) error ---> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
bzero((char *) &serv_addr, sizeof(serv_addr));
server = gethostbyname(argv[1]);
if(server == NULL) {
fprintf(stderr, "No such host.\n");
printf("%s\n", strerror(errno));
exit(EXIT_FAILURE);
}
bzero((char *)&serv_addr, sizeof(serv_addr));
portno = atoi(argv[2]);
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
serv_addr.sin_port = htons(portno);
binder = bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr));
if(binder < 0) {
printf("BIND(-1) error ---> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
else if(socket) {
do {
{
printf("Waiting for a connection.\n");
}
}while(!accept);
}
listener = listen(sockfd, 20);
if(listener < 0) {
printf("LISTEN(-1) error ---> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
clilen = sizeof(cli_addr);
newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen);
if(newsockfd == 0) {
printf("ACCEPT(0) error ---> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
if(newsockfd < 0) {
printf("ACCEPT(-1) error ---> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
if(accept) {
{
printf("Received connection from %s.\n", inet_ntoa(cli_addr.sin_addr));
}
}
for( ; ; ) {
FILE *file = fopen("file_in.txt", "wb+");
if(file == NULL) {
printf("FOPEN(NULL) error --> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
bytes_read = read(newsockfd, data, sizeof(data));
if(bytes_read < 0) {
printf("READ(-1) error ---> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}
if(bytes_read == 0) {
printf("READ(0) error ---> %s.\n", strerror(errno));
exit(EXIT_SUCCESS);
}
else {
fprintf(file, "%s", data);
}
/*printf("message: ");
fgets(data, sizeof(data), stdin);
bytes_written = write(newsockfd, data, strlen(data));
if(bytes_written < 0) {
printf("WRITE(-1) error ---> %s.\n", strerror(errno));
exit(EXIT_FAILURE);
}*/
}
close(newsockfd);
close(sockfd);
return 0;
}
Feel free to Join. I am watching a bunch of movies tonight. So i will not be working on it. Unless someone wants to pair up tonight.
The server is a nice start, but you've got a long way to go. Betta get crackin
Yeah I have a domain that I could host on is what I was saying. But yeah the server I'm writing is at the bare minimum at the moment. I am having trouble with fread at the moment. I think I am going to use a loop to send the data. After I have that issue solved, I will work on asking if you want to send another file or exit. Just build it up. I might add the GUI, depending on if I find a more interesting project.
The server is a nice start, but you've got a long way to go. Betta get crackin
Here was my last project. What do you think?
http://www.wrongplanet.net/postp4693726.html#4693726