Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #7316 > unrolled thread

code base(not a technical question)

Started byAsit Dhal <lipun4u@gmail.com>
First post2011-08-23 10:54 -0700
Last post2011-08-25 22:21 +0000
Articles 19 — 10 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  code base(not a technical question) Asit Dhal <lipun4u@gmail.com> - 2011-08-23 10:54 -0700
    Re: code base(not a technical question) Robert Klemme <shortcutter@googlemail.com> - 2011-08-23 21:52 +0200
      Re: code base(not a technical question) Asit Dhal <lipun4u@gmail.com> - 2011-08-23 13:48 -0700
        Re: code base(not a technical question) Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-08-23 18:05 -0300
          Re: code base(not a technical question) Arne Vajhøj <arne@vajhoej.dk> - 2011-08-23 18:58 -0400
            Re: code base(not a technical question) Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-08-23 20:24 -0300
        Re: code base(not a technical question) markspace <-@.> - 2011-08-23 14:52 -0700
        Re: code base(not a technical question) Arne Vajhøj <arne@vajhoej.dk> - 2011-08-23 18:57 -0400
    Re: code base(not a technical question) Jeff Higgins <jeff@invalid.invalid> - 2011-08-23 16:53 -0400
      Re: code base(not a technical question) Jeff Higgins <jeff@invalid.invalid> - 2011-08-23 16:59 -0400
    Re: code base(not a technical question) Jeff Higgins <jeff@invalid.invalid> - 2011-08-23 19:06 -0400
      Re: code base(not a technical question) Jeff Higgins <jeff@invalid.invalid> - 2011-08-23 19:47 -0400
        Re: code base(not a technical question) Asit Dhal <lipun4u@gmail.com> - 2011-08-24 12:03 -0700
          Re: code base(not a technical question) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-08-24 19:21 +0000
          Re: code base(not a technical question) "Charles Hottel" <chottel@earthlink.net> - 2011-08-24 15:50 -0400
          Re: code base(not a technical question) markspace <-@.> - 2011-08-24 13:09 -0700
          Re: code base(not a technical question) Robert Klemme <shortcutter@googlemail.com> - 2011-08-25 10:49 +0200
    Re: code base(not a technical question) Roedy Green <see_website@mindprod.com.invalid> - 2011-08-25 13:07 -0700
      Re: code base(not a technical question) Martin Gregorie <martin@address-in-sig.invalid> - 2011-08-25 22:21 +0000

#7316 — code base(not a technical question)

FromAsit Dhal <lipun4u@gmail.com>
Date2011-08-23 10:54 -0700
Subjectcode base(not a technical question)
Message-ID<de8aae6f-9506-41cf-aaca-1e7492a1764d@glegroupsg2000goo.googlegroups.com>
I have a lot of code snippets in my system which I mostly use during development. Is there any tool(like VSS though I don't need version control) in which I can store them and later get whenever I need ?

[toc] | [next] | [standalone]


#7318

FromRobert Klemme <shortcutter@googlemail.com>
Date2011-08-23 21:52 +0200
Message-ID<9bienlF1lpU1@mid.individual.net>
In reply to#7316
On 08/23/2011 07:54 PM, Asit Dhal wrote:
> I have a lot of code snippets in my system which I mostly use during
> development. Is there any tool(like VSS though I don't need version
> control) in which I can store them and later get whenever I need ?

I don't quite understand: if you do not need revision control, you can 
store them anywhere - or put them into an archive.  You could even 
compile them and package sources and class files into a JAR.

Kind regards

	robert

[toc] | [prev] | [next] | [standalone]


#7320

FromAsit Dhal <lipun4u@gmail.com>
Date2011-08-23 13:48 -0700
Message-ID<db46d503-d72b-4ec9-b700-77c1617f435f@glegroupsg2000goo.googlegroups.com>
In reply to#7318
This is like thousands of text files containing code and explanation. This is impossible to retrieve efficiently.

I need something which will tag something in a text file and store it. By searching in, I will get the code.

[toc] | [prev] | [next] | [standalone]


#7324

FromArved Sandstrom <asandstrom3minus1@eastlink.ca>
Date2011-08-23 18:05 -0300
Message-ID<RCU4q.42537$kI4.15865@newsfe02.iad>
In reply to#7320
On 11-08-23 05:48 PM, Asit Dhal wrote:
> This is like thousands of text files containing code and explanation. This is impossible to retrieve efficiently.
> 
> I need something which will tag something in a text file and store it. By searching in, I will get the code.

You're basically talking about an (enterprise) content management
system, or (E)CMS. One of the main things they do is store documents for
efficient search and retrieval by metadata (properties or keywords) and
content. There are a large number of free (and often open-source) CMSs
out there - you've probably heard of Drupal and Alfresco, to mention two
out of dozens.

AHS

[toc] | [prev] | [next] | [standalone]


#7327

FromArne Vajhøj <arne@vajhoej.dk>
Date2011-08-23 18:58 -0400
Message-ID<4e5430a3$0$305$14726298@news.sunsite.dk>
In reply to#7324
On 8/23/2011 5:05 PM, Arved Sandstrom wrote:
> On 11-08-23 05:48 PM, Asit Dhal wrote:
>> This is like thousands of text files containing code and explanation. This is impossible to retrieve efficiently.
>>
>> I need something which will tag something in a text file and store it. By searching in, I will get the code.
>
> You're basically talking about an (enterprise) content management
> system, or (E)CMS. One of the main things they do is store documents for
> efficient search and retrieval by metadata (properties or keywords) and
> content. There are a large number of free (and often open-source) CMSs
> out there - you've probably heard of Drupal and Alfresco, to mention two
> out of dozens.

I am sure that they can do it.

But using Alfresco to be able to search a few thousand text
files may be a bit of an overkill.

Arne

[toc] | [prev] | [next] | [standalone]


#7331

FromArved Sandstrom <asandstrom3minus1@eastlink.ca>
Date2011-08-23 20:24 -0300
Message-ID<zEW4q.31826$%f4.11058@newsfe16.iad>
In reply to#7327
On 11-08-23 07:58 PM, Arne Vajhøj wrote:
> On 8/23/2011 5:05 PM, Arved Sandstrom wrote:
>> On 11-08-23 05:48 PM, Asit Dhal wrote:
>>> This is like thousands of text files containing code and explanation.
>>> This is impossible to retrieve efficiently.
>>>
>>> I need something which will tag something in a text file and store
>>> it. By searching in, I will get the code.
>>
>> You're basically talking about an (enterprise) content management
>> system, or (E)CMS. One of the main things they do is store documents for
>> efficient search and retrieval by metadata (properties or keywords) and
>> content. There are a large number of free (and often open-source) CMSs
>> out there - you've probably heard of Drupal and Alfresco, to mention two
>> out of dozens.
> 
> I am sure that they can do it.
> 
> But using Alfresco to be able to search a few thousand text
> files may be a bit of an overkill.
> 
> Arne
> 
Granted. I wouldn't necessarily recommend IBM FileNet either. :-)

Still, my general observation stands: Asit is basically asking for CMS
functionality. He can get that by writing his own, or by locating a
minimal existing CMS solution.

AHS

[toc] | [prev] | [next] | [standalone]


#7325

Frommarkspace <-@.>
Date2011-08-23 14:52 -0700
Message-ID<j317en$7d1$1@dont-email.me>
In reply to#7320
On 8/23/2011 1:48 PM, Asit Dhal wrote:
> This is like thousands of text files containing code and explanation.
> This is impossible to retrieve efficiently.
>
> I need something which will tag something in a text file and store
> it. By searching in, I will get the code.


When I need to locate some code I've already written, I use grep.

[toc] | [prev] | [next] | [standalone]


#7326

FromArne Vajhøj <arne@vajhoej.dk>
Date2011-08-23 18:57 -0400
Message-ID<4e543052$0$305$14726298@news.sunsite.dk>
In reply to#7320
On 8/23/2011 4:48 PM, Asit Dhal wrote:
> This is like thousands of text files containing code and explanation. This is impossible to retrieve efficiently.
>
> I need something which will tag something in a text file and store it. By searching in, I will get the code.

Write a little Java app that can generate and search a full
text index of the files content in a database.

Optionally the files themselves can be stored in the database
as well.

I use such a tool for all the example code I have written over the
years.

Arne

[toc] | [prev] | [next] | [standalone]


#7321

FromJeff Higgins <jeff@invalid.invalid>
Date2011-08-23 16:53 -0400
Message-ID<j313pn$doc$1@dont-email.me>
In reply to#7316
On 08/23/2011 01:54 PM, Asit Dhal wrote:
> I have a lot of code snippets in my system which I mostly use during development. Is there any tool(like VSS though I don't need version control) in which I can store them and later get whenever I need ?
>

Web search terms code+snippet+storage
This blog:
<http://blog.programmableweb.com/2011/08/16/access-pastebins-code-snippets-and-hacker-rants-via-api/>
suggests Snipt, Pastebin, Evernote.

[toc] | [prev] | [next] | [standalone]


#7322

FromJeff Higgins <jeff@invalid.invalid>
Date2011-08-23 16:59 -0400
Message-ID<j3144t$fc8$1@dont-email.me>
In reply to#7321
On 08/23/2011 04:53 PM, Jeff Higgins wrote:
> On 08/23/2011 01:54 PM, Asit Dhal wrote:
>> I have a lot of code snippets in my system which I mostly use during
>> development. Is there any tool(like VSS though I don't need version
>> control) in which I can store them and later get whenever I need ?
>>
>
> Web search terms code+snippet+storage
> This blog:
> <http://blog.programmableweb.com/2011/08/16/access-pastebins-code-snippets-and-hacker-rants-via-api/>
>
> suggests Snipt, Pastebin, Evernote.
>
And then there's "Dude! Where's My Code! 1.1.6.0".

[toc] | [prev] | [next] | [standalone]


#7329

FromJeff Higgins <jeff@invalid.invalid>
Date2011-08-23 19:06 -0400
Message-ID<j31bjj$vnu$1@dont-email.me>
In reply to#7316
On 08/23/2011 01:54 PM, Asit Dhal wrote:
> I have a lot of code snippets in my system which I mostly use during development. Is there any tool(like VSS though I don't need version control) in which I can store them and later get whenever I need ?
>

Depending upon your development environment, you could search <my 
development environment>+code+snippet.
When I search Eclipse+code+snippet, I get references to Snippet View and 
Template View. Thanks, I wasn't even aware of them.
When I search emacs+code+snippet, I get yasnippet and Textmate.

[toc] | [prev] | [next] | [standalone]


#7332

FromJeff Higgins <jeff@invalid.invalid>
Date2011-08-23 19:47 -0400
Message-ID<j31e0l$gdt$1@dont-email.me>
In reply to#7329
On 08/23/2011 07:06 PM, Jeff Higgins wrote:
> On 08/23/2011 01:54 PM, Asit Dhal wrote:
>> I have a lot of code snippets in my system which I mostly use during
>> development. Is there any tool(like VSS though I don't need version
>> control) in which I can store them and later get whenever I need ?
>>
>
> Depending upon your development environment, you could search <my
> development environment>+code+snippet.
> When I search Eclipse+code+snippet, I get references to Snippet View and
> Template View. Thanks, I wasn't even aware of them.
> When I search emacs+code+snippet, I get yasnippet and Textmate.
>
>
Another Eclipse feature you're post reminded me of is the Java Scrapbook 
Page. Thanks I had forgotten it.

[toc] | [prev] | [next] | [standalone]


#7349

FromAsit Dhal <lipun4u@gmail.com>
Date2011-08-24 12:03 -0700
Message-ID<5a3429f6-8b58-423a-a51b-13c66e5db4ac@glegroupsg2000goo.googlegroups.com>
In reply to#7332
Thank you everybody for reading my query and suggesting me.

This is what I do now.
I have a folder named Java. In this folder code snippets are stored in small text files. File name is what the snippet is about. 
e.g.:-
CounDownLatch.java
HorseRace.java
SingletonThreaSafe.java

What I need is every file should be associated with some index string, which is search able.

Again grep can't help me as I use Windows 7 for development environment.

 

[toc] | [prev] | [next] | [standalone]


#7350

FromAndreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date2011-08-24 19:21 +0000
Message-ID<slrnj5ajqd.6gl.avl@gamma.logic.tuwien.ac.at>
In reply to#7349
Asit Dhal <lipun4u@gmail.com> wrote:
> This is what I do now.
> I have a folder named Java. In this folder code snippets are stored
> in small text files. File name is what the snippet is about. 
> e.g.:-
> CounDownLatch.java
> HorseRace.java
> SingletonThreaSafe.java
> What I need is every file should be associated with some index string,
> which is search able.
> Again grep can't help me as I use Windows 7 for development environment.

I'm sure, there's also "grep" for Windows (7, like any other).

But then, grep wouldn't satisfy your needs, anyway, as you'd better 
find some kind of fuzzy-search-engine.  A non-fuzzy search wouldn't
find anything for "Count" or "Thread" among the snippets you named...

PS: I'm being serious here. If your spelling isn't all that good,
  then you're going to have a hard time later, trying to figure
  out with what spelling errors you might have stored a particular
  snippet some time ago. A fuzzy search may then be a big help.

[toc] | [prev] | [next] | [standalone]


#7351

From"Charles Hottel" <chottel@earthlink.net>
Date2011-08-24 15:50 -0400
Message-ID<E6-dnQj3v5ghyMjTnZ2dnUVZ_rydnZ2d@earthlink.com>
In reply to#7349
"Asit Dhal" <lipun4u@gmail.com> wrote in message 
news:5a3429f6-8b58-423a-a51b-13c66e5db4ac@glegroupsg2000goo.googlegroups.com...
> Thank you everybody for reading my query and suggesting me.
>
> This is what I do now.
> I have a folder named Java. In this folder code snippets are stored in 
> small text files. File name is what the snippet is about.
> e.g.:-
> CounDownLatch.java
> HorseRace.java
> SingletonThreaSafe.java
>
> What I need is every file should be associated with some index string, 
> which is search able.
>
> Again grep can't help me as I use Windows 7 for development environment.
>
>

For this kind of thing I have created text files and imported them in Access 
which I can then search with a query.  Typically my text file is text in the 
first 75 columns and a page number in  columns 77 to 80.  Later on I filled 
in the book title so I could combine all the text files into one DB.  I did 
this because I found the indexes in books to be inadequate. 

[toc] | [prev] | [next] | [standalone]


#7352

Frommarkspace <-@.>
Date2011-08-24 13:09 -0700
Message-ID<j33lps$hch$1@dont-email.me>
In reply to#7349
On 8/24/2011 12:03 PM, Asit Dhal wrote:
> code snippets are stored in small text files. File name is what the
> snippet is about. e.g.:- CounDownLatch.java HorseRace.java
> SingletonThreaSafe.java
>
> What I need is every file should be associated with some index
> string, which is search able.


grep and other unix tools are of course available for Windows.

I don't understand what you think you're going to build the index string 
with.  What goes in the index string?  All symbols in the file?  Just 
the file names?  Please be as specific as possible.


For example, here's a code snippet:

hw.java:
package simple;
public class Hello {
   public static void Main( String... args ) {
     System.out.println( "Hello world" );
   }
}

What precisely would go in your index string for this example?

[toc] | [prev] | [next] | [standalone]


#7367

FromRobert Klemme <shortcutter@googlemail.com>
Date2011-08-25 10:49 +0200
Message-ID<9bmgliF9erU1@mid.individual.net>
In reply to#7349
On 24.08.2011 21:03, Asit Dhal wrote:
> Thank you everybody for reading my query and suggesting me.
>
> This is what I do now.
> I have a folder named Java. In this folder code snippets are stored in small text files. File name is what the snippet is about.
> e.g.:-
> CounDownLatch.java
> HorseRace.java
> SingletonThreaSafe.java
>
> What I need is every file should be associated with some index
> string,  which is search able.
>
> Again grep can't help me as I use Windows 7 for development
> environment.

You can use "find" for that in the Windows shell.

However, I would just create an Eclipse project where I put all those 
files and use Eclipse's text search (which is pretty fast).  You could 
even do something like

/*
  * Search index
  *
  * keyword: thread
  * keyword: list
  */

somewhere in the file and then do a regexp search for "keyword:\s*thread"

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#7386

FromRoedy Green <see_website@mindprod.com.invalid>
Date2011-08-25 13:07 -0700
Message-ID<urad57p6brbhi8aqfb1g24143qbbe8getj@4ax.com>
In reply to#7316
On Tue, 23 Aug 2011 10:54:35 -0700 (PDT), Asit Dhal
<lipun4u@gmail.com> wrote, quoted or indirectly quoted someone who
said :

>I have a lot of code snippets in my system which I mostly use 
>during development. Is there any tool(like VSS though I don't
> need version control) in which I can store them and later get whenever I need ?

You could just store them as files in a directory tree. What other
service do you need?
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
The modern conservative is engaged in one of man's oldest exercises in moral philosophy; that is, 
the search for a superior moral justification for selfishness.
~ John Kenneth Galbraith (born: 1908-10-15 died: 2006-04-29 at age: 97) 

[toc] | [prev] | [next] | [standalone]


#7390

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2011-08-25 22:21 +0000
Message-ID<j36htq$6h3$1@localhost.localdomain>
In reply to#7386
On Thu, 25 Aug 2011 13:07:40 -0700, Roedy Green wrote:

> On Tue, 23 Aug 2011 10:54:35 -0700 (PDT), Asit Dhal <lipun4u@gmail.com>
> wrote, quoted or indirectly quoted someone who said :
> 
>>I have a lot of code snippets in my system which I mostly use during
>>development. Is there any tool(like VSS though I don't
>> need version control) in which I can store them and later get whenever
>> I need ?
> 
> You could just store them as files in a directory tree. What other
> service do you need?

I converted my snippets onto a set of classes in a private package/jar 
file, documented it using Javadoc and put the lot under CVS to provide a 
bit of fat-finger protection. I thought that was what most programmers do.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web