source-code

Where to find beautiful PHP code to read?

As a way to find inspiration and improve my PHP skills, I am looking for some beautiful PHP source code to read, preferably an open source "standard" web site rather than a more tool-like project such as phpMyAdmin. So, where can I find some beautiful PHP code? ...

How many lines of debugged code do you produce in a day's work?

How many lines of debugged code do you produce in a day's work and what language would that be? I know some languages are a little more difficult to work with but on average, how many? ...

How to get JRE/JDK with matching source?

I'd like to get at least one JRE/JDK level on my Windows machine where I have the JRE/JDK source that matches the exact level of the JRE/JDK. My purpose is to be able to go into the system classes while debugging. Any suggestions about how to do this? Thanks in advance. ...

JDK/JRE source code with matching JSSE (SSL) source code and matching runnable JDK / JRE?

I have seen Where to find Java 6 JSSE/JCE Source Code? and asked the question myself How to get JRE/JDK with matching source? but I don't either of these was specific enough to get the answer I was really after, so I'm going to try a way more specific version of the question. Basically the problem that I am trying to solve is that I wou...

Can you improve this 'lines of code algorithm' in F#?

I've written a little script to iterate across files in folders to count lines of code. The heart of the script is this function to count lines of whitespace, comments, and code. (Note that for the moment it is tailored to C# and doesn't know about multi-line comments). It just doesn't look very nice to me - has anyone got a cleaner ve...

What is the most hard to understand piece of C++ code you know?

Today at work we came across the following code (some of you might recognize it): #define GET_VAL( val, type ) \ { \ ASSERT( ( pIP + sizeof(type) ) <= pMethodEnd ); \ val = ( *((type *&)(pIP))++ ); \ } Basically we have a byte array and a pointe...

UTM and MGRS to Latitude/Longitude conversion source-code?

What open-source / public domain software is there "out there" for conversion between Latitude/Longitude, UTM (Universal Transform Mercator) and MGRS (Military Grid Reference System)? We're using a VB6 library at the moment and would prefer to use something in another language and with a longer pedigree. ...

How do I start reading the PHP source code?

The source code for the PHP interpreter is absolutely mystifying to me. The thing is, I'd like to learn more about it, so I can avoid making Schlemiel-style mistakes. This is a huge project, some nearly sixty megs in size. How do I go about reading it? Is there an article or a book out there somewhere to help me begin to make some se...

Do you put copyright notices in your (proprietary) code?

I'm wondering if, when working on source for your employer, people include a copyright notice. For example /* * Developer : Developer Name ([email protected]) * Date : xx/yy/zzzz * All code (c)2008 company name inc. all rights reserved */ or anything similar? ...

Web Apps for Source Code Discussion

Are there any web apps that allow for source code collaboration? I'm thinking of something that could look at an SVN repo/local folder/etc. and publish the code with support for threaded discussions under each file or class. Ideally I want to find something that I could deploy/host myself, so being based in PHP would be a huge plus. ...

Best Application for storing code snippets

Hi all, Just wondering if you can point me in the direction of a simple, fast program which stores code snippets. I have been using a local wiki up to now, but I find it a little annoying at times. Ideally I would like this application to be portable - i.e. it could run off of a USB stick on multiple machines with no installation. What...

Help finding C++ interval tree algorithm implementation

I'm trying to find an efficient C++ interval tree implementation (mostly likely based on red black trees) without a viral or restrictive license. Any pointers to a clean lightweight standalone implementation? For the use case I have in mind, the set of intervals is known at the outset (there would be say a million) and I want to be able ...

How can I sort members by name in Java?

I want to sort members by name in the source code. Is there any easy way to do it? I'm using NetBeans, but if there is another editor that can do that, just tell me the name of it. ...

Putting Copyright Symbol into a Python File

I need to include a copyright statement at the top of every Python source file I produce: # Copyright: © 2008 etc. However, when I then run such a file I get this message: SyntaxError: Non-ASCII character '\xa9' in file MyFile.py on line 3, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details. Apparen...

Really useful VB6 source code

This isn't a question but I thought I'd start a thread where links to exceptionally useful (and widely applicable) vb6 code could be placed. My choice is by someone called John Korejwa and is located on planet sourcecode at http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=50065&amp;lngWId=1 Basically what it does i...

Could "attach source" be made easier for popular Java libraries?

I run into this obstacle when my debugger steps into some classfile without corresponding source. Finding it is often difficult: You have to search for the site hosting the respective project, and find its ``download source'' page (for instance, last time I searched for the JPA API, and it took me hours to obtain the sources). Or, yo...

SVN Repository Search

Is there any good software that will allow me to search through my SVN respository for code snippets? I found 'FishEye' but the cost is 1,200 and well outside my budget. ...

What license should I use for code snippets released on my blog?

How should I license the code snippets used in my blog posts so that people feel free to use it without painful restrictions? My (very limited) understanding of copyright tells me that without any defined license that everything is protected as copyrighted which would have severe limitations on other's use. There's a good discussion ab...

What's the best way to generate a UML diagram from Python source code?

A colleague is looking to generate UML class diagrams from heaps of Python source code. He's primarily interested in the inheritance relationships, and mildly interested in compositional relationships, and doesn't care much about class attributes that are just Python primitives. The source code is pretty straightforward and not tremend...

How do you approach code when reading for educational purposes

Continuing my quest for enlightenment I was curious to see how others approach examining projects from an educational standpoint. How do you determine the quality of the code you are reviewing? How do you decide if a design/technique is worthy of adoption in your own development? ...