source-code

Where do custom build tools go, in your source tree?

On every project I've worked on, I have one or more tactical build tools. They do verification or checksumming or some specific build-time task. Often these tools are project-specific and written in the project's implementation language. Q1. Do you have such tools? Is this a project-smell that I have these tools? Q2. Where does t...

How to quote in HTML (not blockquote)?

I want to some sample code in a html page. How do I do it, for example I want to show a tag and image tag, in stackoverflow I use 4 spaces: A Tag example: <a href="your_url"></a> Image Tag example: <img...> ...

How to install and run (setup) reddit.com on windows environment?

Hi Everybody!! Reddit.com is providing their code as open source and free. I want to setup the reddit.com website at my local machine in Windows Environment. Could anybody please help me or guide me to the best approach. Also, i have apache (WAMP) installed in my machine. Kindly somebody help, I have searched everywhere but unable t...

Get source code with Chinese characters PHP

Well, I give up. I've been messing around with all I could think of to retrieve data from a target website that has information in traditional Chinese encoding (charset=GB2312). I've been using the simple_html_parser like always but it doesn't seem to return the Chinese characters, in fact all I get are some weird question marks embedde...

Could browsing the PHP source code help a PHP developer learn C?

I've started checking out the source code for PHP. I have just started trying to learn C, and since I have a good working knowledge of PHP, would dissecting typical functions I use daily be of great benefit? Or is this likely to be too in-depth for a C beginner? Also, where are most of the functions defined in that source I linked to a...

Sqlite source code reading. What the ids like F17025, U17032 are used for?

In SQLite source code comments I see identificators like F17025, U17032, etc. sqlite3.c: ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt ** to enter a mutex. {F17024} If another thread is already within the mutex, ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return ** SQLITE_BUSY. {F17025} Th...

How to organize Python source code files?

I am developing a Python App Engine app, where I want to split the content of a source code file Models.py into separate files for each model, but I want to put it all in a folder called Models. The problem is that when I do that, my app can't find the classes anymore. What should I do? This question is not about MVC but another questio...

How are arrays implemented in java?

Arrays are implemented as objects in java right? If so, where could I look at the source code for the array class. I am wondering if the length variable in arrays is defined as a constant and if so why it isn't in all capital letters LENGTH to make the code more understandable. EDIT: http://java.sun.com/docs/books/jls/second_edition/htm...

Silverlight HTML editor with WYSIWYG

We have a CMS system that we're currently taking the admin back end and converting to Silverlight 3 or possibly 4 by the time we go to production. We wrote a custom JS / DHTML editor to suit our needs, and will need to do the same now in Silverlight. Has anyone seen any clues to a base functionality that we could build upon for our own ...

Put it or not? Modeling classes from DataBase tables.-

Guys I have another "best practice question" For example I have this tables on my Sql Server: -------------- Table: Client -------------- (PK) clientID long, clientName varchar(50) --------------- Table: Training --------------- (PK) trainingID long, (FK) clientID long, trainingName varchar(50) Now Im us...

help me about this C# pointer code

I am posting a code. using System; using System.Runtime.InteropServices; class TestPointer { public static void Main(string[] args) { if (args.Length == 0) { unsafe { int t = 8; int* p = &t; IntPtr addr = (IntPtr)p; ...

Which text editor to add line break (not word wrap) at same column throughout source code file?

I'm preparing some documentation and need to format my source code with line breaks that need to appear in column 70 throughout the file. The text editors I have only seem to have features to word wrap the source at this column. I'm wondering whether I need to do this manually since - because of the varying length of the last word at t...

Applying source code changes directly to Root

Ok I am not sure if this has ever been asked since it seems like a complicated/contextual type question. If a development team works with several source branches from one main branch (root/trunk etc), would you always just want to make changes on your particular branch and then merge to (root/trunk etc) when the change has passed QA? I...

XQuery formatting tool

I need a tool for reformatting (indenting, long line split) of xquery scripts. My script started very small but now is almost 4000 lines long and quite messy and needs refactoring. Can someone help? ...

C++ template syntax question: No specialization needed (template<>)

Hi, I was reading the STL source code (which turned out to be both fun and very useful), and I came across this kind of thing //file backwards/auto_ptr.h, but also found on many others. template<typename _Tp> class auto_ptr //Questio...

What is a good way to sync code files between computer?

I have a need to code from two computers during the week. What is the best way to sync the two computers (mac)? I've started using source control, like SVN. It works pretty good, except sometimes I check in code that I want to sync but they don't compile and it interferes with other people on the team working on the same project. I don...

Getting ones code licensed

Hi, Wanted to know what are the steps involved in getting ones code licensed. Working on a freelancing PHP application and want to prevent the client from making any modications in the source code. Any suggestions about which licensing will be the best is appreciated. EDIT : In order to get my code licensed I just have to pick up any o...

java cosine similarity problem

Hi again :) I developed some java program to calculate cosine similarity on the basis of TF*IDF. It worked very well. But there is one problem.... :( for example: If I have following two matrix and I want to calculate cosine similarity it does not work as rows are not same in length doc 1 1 2 3 4 5 6 doc 2 1 2 3 4 5 6 7 8 5 2 4 9 if...

Tool to help clean up cut and paste code clones

I have a C# project with a large collection of cut-and paste cloned code. I have implemented a method that covers 90% of the usages (about 300 instances), but manually converting them by hand will probably introduce more errors than it fixes. Are there any (preferably free) tools that are designed to help with this? Basically the Code l...

Do you know of any search algorithms for searching through source code?

Hello everybody. My question regards the existence of a search algorithm for searching source code. In my project, I will have to implement an application that will search through a repository of source code (through a lot of source code files). All the files are from previous projects done within the company. We think that implementing...