source-code

How to convince people that a single class with 11975 lines of code is bad? (isn't it?)

I have a dejavu feeling when reading [What to do about a 11000 lines C++ source file?] post, but I don't think I can start taking action on my own since I do not have the authority to take action. So I think the first step is to convince people in the organization that big lump of code is bad. I have a similar situation where there is a...

Are there any non-esoteric programming languages that use image files as program source?

I've seen Piet and perhaps some other esoteric programming languages that accept images as input. Is there any such language that's intended for real use? Other than the fact that it seems horrifically unreasonable to actually program this way, there is a certain allure to the idea that, as textual program source can be created in any ol...

Linux VM appliance - best way to edit source code from the Windows host?

I installed a Drupal 6 appliance in VMWare workstation for the development of a new site. I realize that I could have choosen a Windows-based VM that comes with its own GUI, and this problem wouldn't be one. I do prefer the lean and headless Linux VM, though, because it is much more efficient with resources of the host computer, and I ca...

How is it possible to work with 100,000+ lines of source code?

I'm amazed to see that Civilization IV has 200,000 lines of code just for its rules. I don't know how someone could reason about 100,000+ lines of code. Have you worked on a similar big project? How would you know that a new feature is not going to break something? A side note: The lead designer and AI programmer of Civ4 recently spoke...

Ruby on Rails source code security / obfuscation

I'm just getting started with Ruby on Rails development and I have a question concerning source code "privacy". From what I know so far (i have not done a deployment yet, only used RoR in a local development environment), that when a RoR application is deployed, all the source code is "visible" on the server? How can I protect my code;...

One function argument or instance variable [Clean Code book]

Hi everyone, I'm reading Uncle Bob's "Clean Code" book and constantly finding contradictory statements. Here is one of them. Book claims that we should use as few function arguments as possible, so it's more preferably to use function without any arguments to function with one argument and after this claiming there is suggestion how to r...

how to configure Android 2.2 phone as a Wi-Fi access point

How to configure Android 2.2 phone as a Wi-Fi access point?Any reference code? ...

j2ee : AuthenticationFilter and RequestContext : how do you do Auth

We're building a GWT+hibernate+spring web app that's deployed to tomcat and postgres. Looking at http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ and http://www.owasp.org/index.php/Hashing_Java#Complete_Java_Sample, We have a User table and a Role table(4-5 roles, to start with). Various layers of the app need...

Does HTML5 mean the end of "rich" closed source programs for the web?

Unlike Flash, if you develop an application in HTML5 using Canvas, since it uses JavaScript, doesn't that mean the code is wide open? Does using HTML5 mean the end of closed code on the web browser? Am I correct that a Flash application has a closed source? I know that HTML and JavaScript has been open for a while (just view source ri...

How do you examine the source code?

How do you examine the source code for a library you are using and want to modify. Eg. when you have downloaded a gem, I guess that you are forking the repo from GitHub and then cloning your forked repo. So now you have: the local repo's source code (which you open with IDE/text editor) the source code on GitHub (which you browse onl...

How to figure out the Linux kernel's source code?

There are some books about Linux developing, internals, managers and so on. but I'm thinking about a documentation that Linux developers write when the commit a patch on the kernel. Does something like that exist? I know there is a mailing list for kernel newbies and some stuff like this but I'm not a newbie and I don't want to be kernel...

Uncrustify, how to force opening braces to share the previous code line?

Using the Uncrustify tool I would like to apply the 1TBS style, which places braces like this: if (x < 0) { printf("Negative"); } How do I do this? I can't seem to find the right options. ...

Basic doubts about how "organize" my Android code

Hello. Im starting my first Android project so im still kind of n00b and not sure about how to organize some things to have a clean code :P I have my first screen with a spinner and a button. When you click the button i catch the spinner selection and the app will move to a new screen (Depending on the spinner selection). So now, i ha...

Multiple lines comments in Scheme (RnRS)

I created this solution: ; use like this: ; (/* content ... */ <default-return>) ; or ; (/* content ... */) => #f (define-syntax /* (syntax-rules (*/) ((/* body ... */) #f) ((/* body ... */ r) r))) But is it really the best or easy way? ...

Qt4 source code editor widget

Hi there, I want to provide a QtScript source code editor in my application. It would be great if this would have source code highlighting and auto completion. So I don't want to reinvent the wheel: Is there already a quite good widget for that? I could not find anything on Google... Cheers, Manuel ...

Find out which classes of a given API are used

In a Java Project of mine, I would like to find out programmatically which classes from a given API are used. Is there a good way to do that? Through source code parsing or byte code parsing maybe? Because Reflection won't be of any use, I'm afraid. To make things simpler: there are no wildcard imports (import com.mycompany.api.*;) anyw...

Can I license my Matlab code using the GPL?

That's basically it. I have some code in Matlab and I want to release it so anyone can make use of it. Also I'd like to prevent that the codes goes closed after me. Q: Can I choose the GPL to license it? If not, what are my choices? (Apart from stop using Matlab, which I'm already considering) EDIT I just edit it because this is mor...

FM radio source code on android

Hi, My HTC Wildfire has built in FM radio plus a application to listen to it. I wish to write a similar application that would stream this live FM radio over bluetooth. I currently cannot find any examples of accessing the tuner. Can anyone help? ...

How do you organize your class definitions and declarations?

I'm ending my first internship and my boss has shown me a few of his own programming techniques, but one bothers me some. When I write a class header, I like the corresponding source file to linearly list the functions in order that they were declared in the header file. Every time I add a function to the source file, I put it in the ord...

Erlang source code guide

I am interested in delving into Erlang's C source code and try to understand (at least at a moderate level) what is going on under the hood. Where can I find info on the design and structure of the code? ...