source-code

agglomerative clustering java

Is there any java file that I can use to perform "agglomerative clustering" Result should provide me every level nodes id help................. ...

sed: toupper a character on a location

This sed "s/public \(.*\) get\(.*\)()/\1 \2/g" will transfor this public class ChallengeTO extends AbstractTransferObject { public AuthAlgorithm getAlgorithm(); public long getCode(); public int getIteration(); public String getPublicKey(); public String getSelt(); }; into this public class ...

"using" directive in Java

When the type name is too long, in C# i can create alias like this: using Dict = System.Collections.Generic.Dictionary<string, string>; And I can use it like this: Dict d = new Dict(); d.Add("key", "value"); Can I create an alias similar to this in Java? ...

Searching for an implementation (source code or executable) for binarization method

I am searching for an implementation of a locally adaptive method of binarization: Yankowitz/Bruckstein. It is complicated to make it by myself and I don't have much time right now, but hope to find it's realization. So if anybody knows please tell me. ...

Design/Code Problem - From Apress's book on Spring

I was reading Apress "Beginning Spring 2 From Novice to Professional", and I found this one section that discusses usage of DAOs. The example is pretty simple and I have pasted the src here: UserAcccount.java - UserAccount Entity UserRole.java UserRole Entity UserAccountDao.java - UserAccount DAO JdbcUserAccountDaoImpl.java - JDBC Imp...

How do I get VB6 to integrate with Visual Source Safe 6.0?

We use Visual Source Safe 6.0 at work and VB6 is supposed to integrate smoothly with Source Safe. Both applications are installed on my PC, but VB6 is not showing the options to integrate with Source Safe (e.g. checking out a file, seeing if a file is shared, etc.). What do I need to do to get VB6 to integrate with Source Safe 6.0? ...

How do I begin reading source code?

I understand the value of reading source code, and I am trying my best to read as much as I can. However, every time I try getting into a 'large' (i.e. complete) project of sorts, I am overwhelmed. For example, I use Anki a lot when revising languages. Also, I'm interested in getting to know how an audio player works (because I have so...

How to protect compiled Java classes?

I know, many similar questions has been asked here. I am not asking if I can protect my compiled Java class - because obviously you will say 'no you can't'. I am asking what is the best known method of protecting Java classes against de-compiling? If you aware of any research or academic paper in this field please do let me know. Also if...

What is the right license for tutorial source code ?

Putting sourcecode from tutorials or books online requires the author to add some kind of disclaimer or license (otherwise people would use it make lots of $$$ or break a power plant IT control system and sue you as author). But what is the right license or disclaimer statement ? Can I use BSD license with ... IN NO EVENT SHALL THE CO...

Use this. to access internal class members?

On the internet I see a lot of code which uses this. to access local members of a class, like this: private String _whatever; public String Whatever { get { return this._whatever; } set { this._whatever = value; } } public void DoSomething() { String s = this.Whatever; this.DoSomething(); } (don't expect the c...

How to Format Code in Research Reports

I am currently writing a formal research report, and I'll be including code with this report. Question: Is there an accepted way of displaying code in research reports? I'm thinking both in terms of font, spacing, et cetera, and whether the code should be displayed inside the document, or in an appendix. The code will be JavaScript and...

Finding magic numbers using NDepend

Does anyone know how I could find magic numbers in the source code using the CQL queries in NDepend? This is the same problem as this question, but I don't want to use regex if possible. So I want to find all statements like Int32 someValue = 23; Double anotherValue = 1; but not for (int i = 0; i < array.length; i++) ...

What's the best way to format long strings of HTML in PHP?

I know it's really a subjective question, but for best-practices (and readability), I can't seem to get a fix on the best way to format long strings of HTML. I typically do it like this: echo ' <div> <p>Content Inside</p> <div class="subbox"> <ul> <li>etc.</li> <li>etc.</li> <li>etc.</...

Automated Java to Scala source code conversion?

(Yes I know I can call Java code from Scala; but that is pointless; I want to DELETE the Java code, not keep it around and have to look at it and maintain it forever!) Are there any utilities out there to convert Java source to Scala source? I believe theoretically it should be possible to accomplish with minimal lossage. I have found...

Is there any alternative to obfuscation to make it harder to get any string in javascript?

I use DropBox and I've had some trouble reaching to my files from other computers: I not always want to login to anything when I'm in a public computer, but I like being able to reach my stuff from wherever I am. So I've made a simple application that when put in the public folder, ran and given the right UID, creates (still in your pub...

Anyone know of a Snippet or File Repository Application in PHP?

I am looking to start a community based on user posted scripts such as bashrc, screenrc, aliases, etc. Does anyone know of a web application in PHP that would do that? I am not looking for a snippet program, or a link directory. Users can store linux/UNIX/Windows configuration files, as well as maybe an option to attach a screenshot....

How do I edit error messages in GCC source

Hi, I am trying to create a C Compiler in my native language which I intend to put up as open source. I want to do this by downloading the GCC source code and then manually translating the error messages and warnings into my target language. I am a beginner to GCC. Any idea where the error messages are located in the source code and how ...

How to format long strings in arrays

How should I format very long strings in my source code? I follow the rule, that line of code should not be longer than 80 characters. (The other rules are Zend Framework formatting standard) e.g. protected $_messages = array( 'key1' => 'very, very long string lorem ipsum dolor sit amet…', 'key2' => 'this one it very long too,...

Code Explanation (MPICH)

#include "mpi.h" #include <stdio.h> #include <math.h> double f(double a) { return (4.0 / (1.0 + a*a)); } void main(int argc, char *argv[]) { int done = 0, n, myid, numprocs,i; double PI25DT = 3.141592653589793238462643; double mypi, pi, h, sum, x; double startwtime, endwtime; int namelen; char processor_na...

What's wrong with the Java source code?

In the Java source from http://download.java.net/jdk6/source/ I get a jar of size ~130mb. The jar don't attach to Eclipse, and inside it has a file called "X_X" of size ~130mb. Does anyone know what's happening? --update Thanks Gerco Drie, now, about this README file: JDK requires a high level of technical expertise. (...) If yo...