The Big Programming Thread - Page 62
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
Frigo
Hungary1023 Posts
| ||
RoTaNiMoD
United States558 Posts
| ||
AcrossFiveJulys
United States3612 Posts
On June 29 2011 09:51 RoTaNiMoD wrote: I once challenged myself to write a program that would output its own source code exactly. Also known as a quine. It was a lot of fun and a very unique challenge, and anyone looking for a programming mindbender I recommend to try the same. Here's my C++ solution: http://codepad.org/05NiPewP Why can't you just open the source code file and print it out line by line? As long as the code knows the path where it is stored this should be easy. | ||
Kambing
United States1176 Posts
On June 29 2011 09:57 AcrossFiveJulys wrote: Why can't you just open the source code file and print it out line by line? As long as the code knows the path where it is stored this should be easy. Because that's not the point. See: http://en.wikipedia.org/wiki/Quine_(computing) | ||
RoTaNiMoD
United States558 Posts
On June 29 2011 09:57 AcrossFiveJulys wrote: Why can't you just open the source code file and print it out line by line? As long as the code knows the path where it is stored this should be easy. The program you described is a file outputter -- it takes as input a filename (and thus a file) and outputs that file's contents. The quine program is a self-outputter. It takes nothing as input and outputs itself. | ||
Pawsom
United States928 Posts
On June 29 2011 09:57 AcrossFiveJulys wrote: Why can't you just open the source code file and print it out line by line? As long as the code knows the path where it is stored this should be easy. Try it with file I/O it'll be much harder than you think. | ||
icystorage
Jollibee19343 Posts
| ||
![]()
tofucake
Hyrule18968 Posts
| ||
Rannasha
Netherlands2398 Posts
On July 01 2011 22:28 icystorage wrote: my classmate and i are trying to make a website and i was thinking of making ourselves our own server. can you guys suggest distros of linux best used as servers? If you don't have much Linux experience, then the Ubuntu server edition may be a good starting point. Ubuntu is easy to setup and use and has a very large community behind it. If you're looking to maximize the efficiency of your server and have decent Linux knowledge already, then there are other distros that allow for more control, but take more effort to setup, such as Slackware and Debian. | ||
icystorage
Jollibee19343 Posts
| ||
fabiano
Brazil4644 Posts
| ||
icystorage
Jollibee19343 Posts
| ||
catamorphist
United States297 Posts
On July 02 2011 01:46 icystorage wrote: we're planning on a postgresql (probably gonna use LAPP) and a dedicated web server. but we are using an old unused computer (pentium d). so we want to use the most efficient linux as server to compensate for the old computer. If that's what you're worrying about, don't. There are not general performance differences between how different distributions will run your server out-of-the-box that will be noticable and which you will be able to identify, and a Pentium D is by far modern enough that it is just not at all a concern. Until a year ago I was running Apache serving up my music collection into a web app on a 300MHz Pentium II. Pick at random, or pick whatever you like the name of best, or pick whatever you think is easiest, but don't pick a distribution because you think it will be fast. | ||
icystorage
Jollibee19343 Posts
On July 02 2011 05:26 catamorphist wrote: If that's what you're worrying about, don't. There are not general performance differences between how different distributions will run your server out-of-the-box that will be noticable and which you will be able to identify, and a Pentium D is by far modern enough that it is just not at all a concern. Until a year ago I was running Apache serving up my music collection into a web app on a 300MHz Pentium II. Pick at random, or pick whatever you like the name of best, or pick whatever you think is easiest, but don't pick a distribution because you think it will be fast. ill take your word on it and thanks! | ||
tec27
United States3690 Posts
On July 02 2011 01:46 icystorage wrote: we're planning on a postgresql (probably gonna use LAPP) and a dedicated web server. but we are using an old unused computer (pentium d). so we want to use the most efficient linux as server to compensate for the old computer. Apache, Lighttpd, and nginx are all good. If you're just starting out though, Apache or Lighttpd are probably your best bets. Apache is more configurable, but (as the name suggests) Lighttpd is more lightweight. Just starting out though, I'd probably go with Apache, as you're going to be able to find more easy information on how to get it configured to do whatever you want. | ||
mmp
United States2130 Posts
On July 02 2011 01:46 icystorage wrote: we're planning on a postgresql (probably gonna use LAPP) and a dedicated web server. but we are using an old unused computer (pentium d). so we want to use the most efficient linux as server to compensate for the old computer. I don't think efficiency is a big deal here for runtime since "Server" editions for a distro typically only amount to default packages while running on the same kernel. As long as you aren't running a desktop manager in the background you should be fine. I would recommend RHEL or Fedora for security reasons. If you're hardcore about uptime, you should check out KSplice (shameless plug for friends). Other folks in this thread may be interested in the paper. Edit: None of this advice should matter for a school project... :p | ||
One Student
73 Posts
So after I'm done I want to get into socket programming in windows and also gui programming in c++ (again only familiar with gui in java :| ). So thought I'd ask some experienced TL'ers for some recommended books or sites. I tried looking for some socket programming guides online, but most of 'em were done on Linux. I know there won't be much difference between that and windows except for the methods and libraries, but I want a guide that explains to me the whole process from A to Z. I'm talking about the libraries available, functions, structs, the whole shabang. I have taken a networking course so I am familiar with the networking accept involved just not the classes and how to use them. Thanks for the help in advance. ;D | ||
Frigo
Hungary1023 Posts
| ||
KaiserJohan
Sweden1808 Posts
I would advise you write the core of your program in C++ and then all the GUI in C#. That's how we do alot of stuff at work and its pretty solid, it just takes way too long time with c++ for windows GUI. | ||
Patriot.dlk
Sweden5462 Posts
My education in informatics had about 10 weeks of java. Now I'm a developer since about 6 weeks and man I have a blast. So far it's been java only. My department develops this ERP system and I have mostly been doing adaptations and integrations that customers bought. Basically handle input/output to our ERP and other systems. But this Friday my scrummaster approached me asking if I would mind being assigned doing a new feature. It's about logic regarding if it's a swedish holliday or not and if so determining the closest work day. Basically I will have to use mathematical algorithms works out the next occurrence. This will be implemented in this big ERP through a jsf layer. Our system has huge customers so it's going to be many users using this and it my question is how you know that you don't write huge bottlenecks in your code? Another specific program I wrote yet I questioned the effectiveness of my code is this example: My java program receive a path to a file and you are to copy it onto another directory but you need to make sure it don't override anything so it should get an incremental number. So how do you determine the next number in an efficient way? the directory looks like this: yourfile1, yourfile2, yourfile7, yourfile3, yourfile5, other file, other file, other file. | ||
| ||