[freenet-dev] Coding standards

2012-03-21 Thread Martin Nyhus
On Tue, 20 Mar 2012 12:07:06 +0100
Nicolas Hernandez  wrote:
> Could it be possible to have a checktsyle file ?

I've played around with Checkstyle a bit and it looks like it could be
configured to detect quite a lot of stuff. You can find what I've done
here[0] if you are interested (config, Ant target and a script for
checking commits). The main problem I see is that there is a lot of
code that should be fixed, so checks have to be added slowly so people
won't just ignore it.

Having at least a subset of the checks being run on each build would be
nice, even if it would only catch simple things.

Disclamer: the full config currently in my tree produces 104k warnings
and is probably poorly suited to Freenet, so some tweaking is needed :)


[0] https://github.com/zidel/fred-staging/tree/checkstyle



Re: [freenet-dev] Website Redesign?

2012-03-21 Thread David ‘Bombe’ Roden
On Tue, 2012-03-20 at 23:02 +, Matthew Toseland wrote:

> There was a statistic a long time ago - put an unpatched windows PC on the 
> internet and it will be compromised within N minutes.

From personal experimentation I can say that N = 18.


Greetings,

David
-- 
David ‘Bombe’ Roden 


signature.asc
Description: This is a digitally signed message part
___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Logging in Fred

2012-03-21 Thread David ‘Bombe’ Roden
On Tue, 2012-03-20 at 22:44 +, Matthew Toseland wrote:

> I am speaking from experience. write() is supposed to either succeed or 
> throw. PrintWriter busy-loops on disk full when stderr is redirected to a 
> file. Feel free to test it, it may be that it doesn't happen with modern 
> JVMs. But it's unacceptable.

I have just checked PrintWriter’s source code (OpenJDK 6). There’s no
sign of it busy-looping anywhere. I have also checked PrintStream: no
busy-looping.

And just for the hell of it I downloaded JDK 1.1.8… and I wasn’t able to
find any busy-looping in there, either. So whatever it was that bit you
back then it must have been something different and you just
mis-diagnosed it. :/


Greetings,

David
-- 
David ‘Bombe’ Roden 


signature.asc
Description: This is a digitally signed message part
___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

[freenet-dev] Coding standards

2012-03-21 Thread Evan Daniel
And I see a checkstyle patch submitted. Is there an Eclipse patch?
(Speaking as someone who doesn't use Eclipse...)

Seems to me like both are worthy additions. Along with any other
similar tools, as long as they're maintained.

Evan Daniel

On Wed, Mar 21, 2012 at 8:33 PM, Ian Clarke  wrote:
> I know, and?
>
> On Mar 21, 2012 4:21 PM, "Marco Schulze"  wrote:
>>
>> Not everyone uses Eclipse.
>>
>> On 21-03-2012 13:45, Ian Clarke wrote:
>>
>> Or to commit the relevant Eclipse project to enforce these standards as a
>> "save action".
>>
>> Ian.
>>
>> On Tue, Mar 20, 2012 at 6:07 AM, Nicolas Hernandez
>>  wrote:
>>>
>>> Could it be possible to have a checktsyle file ?
>>>
>>> - Nicolas Hernandez
>>> a-n - aleph-networks
>>> associ?
>>> http://www.aleph-networks.com
>>>
>>>
>>>
>>>
>>> On Tue, Mar 20, 2012 at 11:47 AM, Matthew Toseland
>>>  wrote:

 On Monday 19 Mar 2012 23:12:15 Steve Dougherty wrote:
 > I'm all for it. The coding standard is rather clear on indenting with
 > tabs, so I guess all that would be required is a run with a
 > re-indenting/code style conformance tool. That's something for a
 > janitor tree, and would ideally be timed between releases and when all
 > known pull requests have been merged or rejected to minimize
 > whitespace-related disruption to existing work.

 Gigantic third party patches should come with some means to verify them.

 For example, converting all the spaces to tabs in a single commit is
 fine because then you can just do diff -uw.

 However, automated bulk indenting doesn't always makes things easier to
 read - e.g. devs may not like the style it produces.
 >
 > On 03/19/2012 06:13 PM, Marco Schulze wrote:
 > > May I add a vote to standardise indentation? This mess of spaces
 > > with tabs really bugs me.

 ___
 Devl mailing list
 Devl at freenetproject.org
 https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>>
>>>
>>>
>>> ___
>>> Devl mailing list
>>> Devl at freenetproject.org
>>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>
>>
>>
>>
>> --
>> Ian Clarke
>> Personal blog: http://blog.locut.us/
>>
>>
>> ___
>> Devl mailing list
>> Devl at freenetproject.org
>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>
>>
>> ___
>> Devl mailing list
>> Devl at freenetproject.org
>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>
>
> ___
> Devl mailing list
> Devl at freenetproject.org
> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl



[freenet-dev] Coding standards

2012-03-21 Thread Ian Clarke
I know, and?
On Mar 21, 2012 4:21 PM, "Marco Schulze"  wrote:

>  Not everyone uses Eclipse.
>
> On 21-03-2012 13:45, Ian Clarke wrote:
>
> Or to commit the relevant Eclipse project to enforce these standards as a
> "save action".
>
>  Ian.
>
> On Tue, Mar 20, 2012 at 6:07 AM, Nicolas Hernandez <
> nicolas.hernandez at aleph-networks.com> wrote:
>
>> Could it be possible to have a checktsyle file ?
>>
>> - Nicolas Hernandez
>> a-n - aleph-networks
>> *associ?*
>> http://www.aleph-networks.com
>>
>>
>>
>>
>>   On Tue, Mar 20, 2012 at 11:47 AM, Matthew Toseland <
>> toad at amphibian.dyndns.org> wrote:
>>
>>>  On Monday 19 Mar 2012 23:12:15 Steve Dougherty wrote:
>>> > I'm all for it. The coding standard is rather clear on indenting with
>>> > tabs, so I guess all that would be required is a run with a
>>> > re-indenting/code style conformance tool. That's something for a
>>> > janitor tree, and would ideally be timed between releases and when all
>>> > known pull requests have been merged or rejected to minimize
>>> > whitespace-related disruption to existing work.
>>>
>>>  Gigantic third party patches should come with some means to verify them.
>>>
>>> For example, converting all the spaces to tabs in a single commit is
>>> fine because then you can just do diff -uw.
>>>
>>> However, automated bulk indenting doesn't always makes things easier to
>>> read - e.g. devs may not like the style it produces.
>>>  >
>>> > On 03/19/2012 06:13 PM, Marco Schulze wrote:
>>> > > May I add a vote to standardise indentation? This mess of spaces
>>> > > with tabs really bugs me.
>>>
>>>  ___
>>> Devl mailing list
>>> Devl at freenetproject.org
>>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>>
>>
>>
>> ___
>> Devl mailing list
>> Devl at freenetproject.org
>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>
>
>
>
>  --
> Ian Clarke
> Personal blog: http://blog.locut.us/
>
>
> ___
> Devl mailing listDevl at 
> freenetproject.orghttps://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>
>
> ___
> Devl mailing list
> Devl at freenetproject.org
> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20120321/bc0bdfab/attachment.html>


Re: [freenet-dev] Coding standards

2012-03-21 Thread Evan Daniel
And I see a checkstyle patch submitted. Is there an Eclipse patch?
(Speaking as someone who doesn't use Eclipse...)

Seems to me like both are worthy additions. Along with any other
similar tools, as long as they're maintained.

Evan Daniel

On Wed, Mar 21, 2012 at 8:33 PM, Ian Clarke  wrote:
> I know, and?
>
> On Mar 21, 2012 4:21 PM, "Marco Schulze"  wrote:
>>
>> Not everyone uses Eclipse.
>>
>> On 21-03-2012 13:45, Ian Clarke wrote:
>>
>> Or to commit the relevant Eclipse project to enforce these standards as a
>> "save action".
>>
>> Ian.
>>
>> On Tue, Mar 20, 2012 at 6:07 AM, Nicolas Hernandez
>>  wrote:
>>>
>>> Could it be possible to have a checktsyle file ?
>>>
>>> - Nicolas Hernandez
>>> a-n - aleph-networks
>>> associé
>>> http://www.aleph-networks.com
>>>
>>>
>>>
>>>
>>> On Tue, Mar 20, 2012 at 11:47 AM, Matthew Toseland
>>>  wrote:

 On Monday 19 Mar 2012 23:12:15 Steve Dougherty wrote:
 > I'm all for it. The coding standard is rather clear on indenting with
 > tabs, so I guess all that would be required is a run with a
 > re-indenting/code style conformance tool. That's something for a
 > janitor tree, and would ideally be timed between releases and when all
 > known pull requests have been merged or rejected to minimize
 > whitespace-related disruption to existing work.

 Gigantic third party patches should come with some means to verify them.

 For example, converting all the spaces to tabs in a single commit is
 fine because then you can just do diff -uw.

 However, automated bulk indenting doesn't always makes things easier to
 read - e.g. devs may not like the style it produces.
 >
 > On 03/19/2012 06:13 PM, Marco Schulze wrote:
 > > May I add a vote to standardise indentation? This mess of spaces
 > > with tabs really bugs me.

 ___
 Devl mailing list
 Devl@freenetproject.org
 https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>>
>>>
>>>
>>> ___
>>> Devl mailing list
>>> Devl@freenetproject.org
>>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>
>>
>>
>>
>> --
>> Ian Clarke
>> Personal blog: http://blog.locut.us/
>>
>>
>> ___
>> Devl mailing list
>> Devl@freenetproject.org
>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>
>>
>> ___
>> Devl mailing list
>> Devl@freenetproject.org
>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>
>
> ___
> Devl mailing list
> Devl@freenetproject.org
> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


[freenet-dev] (no subject)

2012-03-21 Thread Marco Schulze
Freenet does make you think you are in 1996.

Joke aside, IMHO, the Freenet main page does not change enough to 
warrant a CMS.

On 21-03-2012 13:54, Ian Clarke wrote:
> On Sun, Mar 18, 2012 at 8:09 PM, Daxter  <mailto:xovatdev at gmail.com>> wrote:
>
> On Mar 18, 2012, at 8:04 PM, Leah Hicks wrote:
>> I have done my research, although I have to admit wordpress is
>> not perfect. If it is /really/ that big of an issue then we will
>> simply not use it. And yes I'm aware of the current
>> implementation however it uses javascript which will not run if
>> users have javascript disabled. If someone can find a workaround
>> for that I'm golden. 
> The problem with any CMS is that if/when Freenet gets a lot of
> publicity (e.g. something was leaked via Freenet) then it will
> undoubtedly be under attack. Allowing dynamic content at all is
> asking for trouble. I think it's best to keep the main site
> static, generated beforehand with a templating engine--my favorite
> being HAML (http://haml-lang.com).
>
>
> I think ruling out any dynamic content for security reasons is 
> excessive, there are plenty of secure dynamic websites.
>
> That being said, Wordpress does have a history of vulnerabilities, my 
> person blog has been hacked twice due to vulnerabilities in Wordpress, 
> although not in the last 2 years.
>
> I've heard from various people that Wordpress' source code is a total 
> mess, and they have a caviler attitude towards security holes 
> (basically their attitude is that if you don't upgrade the minute we 
> release a new version it's your own fault if you get hacked).
>
> Getting hacked would be far more damaging for us than most projects 
> given that people download and install software from our site.
>
> So I agree with the reluctance about using Wordpress, but it's going 
> to far to rule out any dynamic content.  This isn't 1996.
>
> Ian.
>
>
> -- 
> Ian Clarke
> Founder, The Freenet Project
> Email: ian at freenetproject.org <mailto:ian at freenetproject.org>
>
>
> ___
> Devl mailing list
> Devl at freenetproject.org
> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20120321/b8e1a801/attachment.html>


[freenet-dev] Coding standards

2012-03-21 Thread Marco Schulze
Not everyone uses Eclipse.

On 21-03-2012 13:45, Ian Clarke wrote:
> Or to commit the relevant Eclipse project to enforce these standards 
> as a "save action".
>
> Ian.
>
> On Tue, Mar 20, 2012 at 6:07 AM, Nicolas Hernandez 
>  <mailto:nicolas.hernandez at aleph-networks.com>> wrote:
>
> Could it be possible to have a checktsyle file ?
>
> - Nicolas Hernandez
> a-n - aleph-networks
> /associ?/
> http://www.aleph-networks.com
>
>
>
>
> On Tue, Mar 20, 2012 at 11:47 AM, Matthew Toseland
> mailto:toad at amphibian.dyndns.org>> 
> wrote:
>
> On Monday 19 Mar 2012 23:12:15 Steve Dougherty wrote:
> > I'm all for it. The coding standard is rather clear on
> indenting with
> > tabs, so I guess all that would be required is a run with a
> > re-indenting/code style conformance tool. That's something for a
> > janitor tree, and would ideally be timed between releases
> and when all
> > known pull requests have been merged or rejected to minimize
> > whitespace-related disruption to existing work.
>
> Gigantic third party patches should come with some means to
> verify them.
>
> For example, converting all the spaces to tabs in a single
> commit is fine because then you can just do diff -uw.
>
> However, automated bulk indenting doesn't always makes things
> easier to read - e.g. devs may not like the style it produces.
> >
> > On 03/19/2012 06:13 PM, Marco Schulze wrote:
> > > May I add a vote to standardise indentation? This mess of
> spaces
> > > with tabs really bugs me.
>
> ___
> Devl mailing list
> Devl at freenetproject.org <mailto:Devl at freenetproject.org>
> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>
>
>
> ___
> Devl mailing list
> Devl at freenetproject.org <mailto:Devl at freenetproject.org>
> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>
>
>
>
> -- 
> Ian Clarke
> Personal blog: http://blog.locut.us/
>
>
> ___
> Devl mailing list
> Devl at freenetproject.org
> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20120321/77f7f1cc/attachment.html>


[freenet-dev] Logging in Fred

2012-03-21 Thread Marco Schulze
There are basically two big concerns regarding logging in fred:

- Readability and code clutter, which was my original questioning;
- Raw throughput, as raised by toad.

Point 1 could mostly be solved by removing any traces of logMINOR and 
logDEBUG on all but the few places where generating messages to be 
logged brings noticeable slowdown. That'd be enough, but, personally, 
the mess that the logging backend is does warrant a replacement. 
According to toad, the current system needs log{MINOR,DEBUG} to function 
in a timely manner. Based on this, I think we all agree a replacement is 
desirable.

Logging has a few additional requirements:

- Log rotation (possibly live);
- Reentrant;
- Per-class filtering;
- Specific information in log (class-name, for example).

Now, _any_ library which fits would make me happy, as long as they agree 
to two points:

- Either lightweight or with optional features. Else, it would only 
transfer bloat to freenet-ext.jar. For example: log2socket, config 
management and multiple logging instances;
- Implementable in a few LoC. Specially, it shouldn't need specialized 
Formatter and Writer.

Plus, it should be fast.

 From the quick research I made (yep, too many lists):

- SLF4J already fails on point one: it is simply a wrapper;
- The Java logging API fails on point two: specialized classes would 
have to be written to deal with log rotation, per-class filtering and 
formatting, plus a wrapper for Logger.{info,warning,...}() methods. 
Exactly the same as a custom logger, with one more dependency and using 
more LoC;
- Log4J seems to fail on point one - it only lacks a button that brings 
back the dead. It seems interesting, and I haven't dropped this yet.

In either case (custom or external), log* would be banished. Forever.

On 21-03-2012 13:47, Ian Clarke wrote:
> Is there a good reason to roll our own logging framework?  What about 
> http://www.slf4j.org/ or one of the many other alternatives?
>
> Ian.
>
> On Sun, Mar 18, 2012 at 6:40 PM, Marco Schulze 
> mailto:marco.c.schulze at gmail.com>> wrote:
>
> One thing has been bothering me: those 'if (logMINOR)
> Logger.minor(...', and the mess that logging is inside fred. I've
> written a very simple replacement for Logger + associated classes
> with the following changes:
>
> - Log level (renamed to severity) filtering is done by Logging.log();
> - Specific writer classes are replaced by a simple OutputStream,
> which defaults to System.err. Formatting is also unified;
> - Severity cases are broadened (FATAL, ERROR, WARNING, INFO, DEBUG
> and TRACE), MINOR is mapped to DEBUG, and NORMAL is mapped to INFO;
> - No logging method accepts an Object parameter - hashCode() is
> not exactly useful.
>
> Additionally, log rotation will be moved outside (possibly inside
> Node).
>
> Currently, the log format is '\t'.
> ___
> Devl mailing list
> Devl at freenetproject.org <mailto:Devl at freenetproject.org>
> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>
>
>
>
> -- 
> Ian Clarke
> Personal blog: http://blog.locut.us/
>
>
> ___
> Devl mailing list
> Devl at freenetproject.org
> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20120321/4ec159d9/attachment.html>


Re: [freenet-dev] Coding standards

2012-03-21 Thread Ian Clarke
I know, and?
On Mar 21, 2012 4:21 PM, "Marco Schulze"  wrote:

>  Not everyone uses Eclipse.
>
> On 21-03-2012 13:45, Ian Clarke wrote:
>
> Or to commit the relevant Eclipse project to enforce these standards as a
> "save action".
>
>  Ian.
>
> On Tue, Mar 20, 2012 at 6:07 AM, Nicolas Hernandez <
> nicolas.hernan...@aleph-networks.com> wrote:
>
>> Could it be possible to have a checktsyle file ?
>>
>> - Nicolas Hernandez
>> a-n - aleph-networks
>> *associé*
>> http://www.aleph-networks.com
>>
>>
>>
>>
>>   On Tue, Mar 20, 2012 at 11:47 AM, Matthew Toseland <
>> t...@amphibian.dyndns.org> wrote:
>>
>>>  On Monday 19 Mar 2012 23:12:15 Steve Dougherty wrote:
>>> > I'm all for it. The coding standard is rather clear on indenting with
>>> > tabs, so I guess all that would be required is a run with a
>>> > re-indenting/code style conformance tool. That's something for a
>>> > janitor tree, and would ideally be timed between releases and when all
>>> > known pull requests have been merged or rejected to minimize
>>> > whitespace-related disruption to existing work.
>>>
>>>  Gigantic third party patches should come with some means to verify them.
>>>
>>> For example, converting all the spaces to tabs in a single commit is
>>> fine because then you can just do diff -uw.
>>>
>>> However, automated bulk indenting doesn't always makes things easier to
>>> read - e.g. devs may not like the style it produces.
>>>  >
>>> > On 03/19/2012 06:13 PM, Marco Schulze wrote:
>>> > > May I add a vote to standardise indentation? This mess of spaces
>>> > > with tabs really bugs me.
>>>
>>>  ___
>>> Devl mailing list
>>> Devl@freenetproject.org
>>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>>
>>
>>
>> ___
>> Devl mailing list
>> Devl@freenetproject.org
>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>
>
>
>
>  --
> Ian Clarke
> Personal blog: http://blog.locut.us/
>
>
> ___
> Devl mailing 
> listDevl@freenetproject.orghttps://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>
>
> ___
> Devl mailing list
> Devl@freenetproject.org
> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>
___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Coding standards

2012-03-21 Thread Martin Nyhus
On Tue, 20 Mar 2012 12:07:06 +0100
Nicolas Hernandez  wrote:
> Could it be possible to have a checktsyle file ?

I've played around with Checkstyle a bit and it looks like it could be
configured to detect quite a lot of stuff. You can find what I've done
here[0] if you are interested (config, Ant target and a script for
checking commits). The main problem I see is that there is a lot of
code that should be fixed, so checks have to be added slowly so people
won't just ignore it.

Having at least a subset of the checks being run on each build would be
nice, even if it would only catch simple things.

Disclamer: the full config currently in my tree produces 104k warnings
and is probably poorly suited to Freenet, so some tweaking is needed :)


[0] https://github.com/zidel/fred-staging/tree/checkstyle
___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] (no subject)

2012-03-21 Thread Marco Schulze

Freenet does make you think you are in 1996.

Joke aside, IMHO, the Freenet main page does not change enough to 
warrant a CMS.


On 21-03-2012 13:54, Ian Clarke wrote:
On Sun, Mar 18, 2012 at 8:09 PM, Daxter > wrote:


On Mar 18, 2012, at 8:04 PM, Leah Hicks wrote:

I have done my research, although I have to admit wordpress is
not perfect. If it is /really/ that big of an issue then we will
simply not use it. And yes I'm aware of the current
implementation however it uses javascript which will not run if
users have javascript disabled. If someone can find a workaround
for that I'm golden. 

The problem with any CMS is that if/when Freenet gets a lot of
publicity (e.g. something was leaked via Freenet) then it will
undoubtedly be under attack. Allowing dynamic content at all is
asking for trouble. I think it's best to keep the main site
static, generated beforehand with a templating engine--my favorite
being HAML (http://haml-lang.com).


I think ruling out any dynamic content for security reasons is 
excessive, there are plenty of secure dynamic websites.


That being said, Wordpress does have a history of vulnerabilities, my 
person blog has been hacked twice due to vulnerabilities in Wordpress, 
although not in the last 2 years.


I've heard from various people that Wordpress' source code is a total 
mess, and they have a caviler attitude towards security holes 
(basically their attitude is that if you don't upgrade the minute we 
release a new version it's your own fault if you get hacked).


Getting hacked would be far more damaging for us than most projects 
given that people download and install software from our site.


So I agree with the reluctance about using Wordpress, but it's going 
to far to rule out any dynamic content.  This isn't 1996.


Ian.


--
Ian Clarke
Founder, The Freenet Project
Email: i...@freenetproject.org 


___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Coding standards

2012-03-21 Thread Marco Schulze

Not everyone uses Eclipse.

On 21-03-2012 13:45, Ian Clarke wrote:
Or to commit the relevant Eclipse project to enforce these standards 
as a "save action".


Ian.

On Tue, Mar 20, 2012 at 6:07 AM, Nicolas Hernandez 
> wrote:


Could it be possible to have a checktsyle file ?

- Nicolas Hernandez
a-n - aleph-networks
/associé/
http://www.aleph-networks.com




On Tue, Mar 20, 2012 at 11:47 AM, Matthew Toseland
mailto:t...@amphibian.dyndns.org>> wrote:

On Monday 19 Mar 2012 23:12:15 Steve Dougherty wrote:
> I'm all for it. The coding standard is rather clear on
indenting with
> tabs, so I guess all that would be required is a run with a
> re-indenting/code style conformance tool. That's something for a
> janitor tree, and would ideally be timed between releases
and when all
> known pull requests have been merged or rejected to minimize
> whitespace-related disruption to existing work.

Gigantic third party patches should come with some means to
verify them.

For example, converting all the spaces to tabs in a single
commit is fine because then you can just do diff -uw.

However, automated bulk indenting doesn't always makes things
easier to read - e.g. devs may not like the style it produces.
>
> On 03/19/2012 06:13 PM, Marco Schulze wrote:
> > May I add a vote to standardise indentation? This mess of
spaces
> > with tabs really bugs me.

___
Devl mailing list
Devl@freenetproject.org 
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl



___
Devl mailing list
Devl@freenetproject.org 
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl




--
Ian Clarke
Personal blog: http://blog.locut.us/


___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Logging in Fred

2012-03-21 Thread Marco Schulze

There are basically two big concerns regarding logging in fred:

- Readability and code clutter, which was my original questioning;
- Raw throughput, as raised by toad.

Point 1 could mostly be solved by removing any traces of logMINOR and 
logDEBUG on all but the few places where generating messages to be 
logged brings noticeable slowdown. That'd be enough, but, personally, 
the mess that the logging backend is does warrant a replacement. 
According to toad, the current system needs log{MINOR,DEBUG} to function 
in a timely manner. Based on this, I think we all agree a replacement is 
desirable.


Logging has a few additional requirements:

- Log rotation (possibly live);
- Reentrant;
- Per-class filtering;
- Specific information in log (class-name, for example).

Now, _any_ library which fits would make me happy, as long as they agree 
to two points:


- Either lightweight or with optional features. Else, it would only 
transfer bloat to freenet-ext.jar. For example: log2socket, config 
management and multiple logging instances;
- Implementable in a few LoC. Specially, it shouldn't need specialized 
Formatter and Writer.


Plus, it should be fast.

From the quick research I made (yep, too many lists):

- SLF4J already fails on point one: it is simply a wrapper;
- The Java logging API fails on point two: specialized classes would 
have to be written to deal with log rotation, per-class filtering and 
formatting, plus a wrapper for Logger.{info,warning,...}() methods. 
Exactly the same as a custom logger, with one more dependency and using 
more LoC;
- Log4J seems to fail on point one - it only lacks a button that brings 
back the dead. It seems interesting, and I haven't dropped this yet.


In either case (custom or external), log* would be banished. Forever.

On 21-03-2012 13:47, Ian Clarke wrote:
Is there a good reason to roll our own logging framework?  What about 
http://www.slf4j.org/ or one of the many other alternatives?


Ian.

On Sun, Mar 18, 2012 at 6:40 PM, Marco Schulze 
mailto:marco.c.schu...@gmail.com>> wrote:


One thing has been bothering me: those 'if (logMINOR)
Logger.minor(...', and the mess that logging is inside fred. I've
written a very simple replacement for Logger + associated classes
with the following changes:

- Log level (renamed to severity) filtering is done by Logging.log();
- Specific writer classes are replaced by a simple OutputStream,
which defaults to System.err. Formatting is also unified;
- Severity cases are broadened (FATAL, ERROR, WARNING, INFO, DEBUG
and TRACE), MINOR is mapped to DEBUG, and NORMAL is mapped to INFO;
- No logging method accepts an Object parameter - hashCode() is
not exactly useful.

Additionally, log rotation will be moved outside (possibly inside
Node).

Currently, the log format is '\t'.
___
Devl mailing list
Devl@freenetproject.org 
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl




--
Ian Clarke
Personal blog: http://blog.locut.us/


___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

[freenet-dev] (no subject)

2012-03-21 Thread Ian Clarke
On Sun, Mar 18, 2012 at 8:09 PM, Daxter  wrote:

> On Mar 18, 2012, at 8:04 PM, Leah Hicks wrote:
>
> I have done my research, although I have to admit wordpress is not
> perfect. If it is *really* that big of an issue then we will simply not
> use it. And yes I'm aware of the current implementation however it uses
> javascript which will not run if users have javascript disabled. If someone
> can find a workaround for that I'm golden.
>
> The problem with any CMS is that if/when Freenet gets a lot of publicity
> (e.g. something was leaked via Freenet) then it will undoubtedly be under
> attack. Allowing dynamic content at all is asking for trouble. I think it's
> best to keep the main site static, generated beforehand with a templating
> engine--my favorite being HAML (http://haml-lang.com).
>

I think ruling out any dynamic content for security reasons is excessive,
there are plenty of secure dynamic websites.

That being said, Wordpress does have a history of vulnerabilities, my
person blog has been hacked twice due to vulnerabilities in Wordpress,
although not in the last 2 years.

I've heard from various people that Wordpress' source code is a total mess,
and they have a caviler attitude towards security holes (basically their
attitude is that if you don't upgrade the minute we release a new version
it's your own fault if you get hacked).

Getting hacked would be far more damaging for us than most projects given
that people download and install software from our site.

So I agree with the reluctance about using Wordpress, but it's going to far
to rule out any dynamic content.  This isn't 1996.

Ian.


-- 
Ian Clarke
Founder, The Freenet Project
Email: ian at freenetproject.org
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20120321/ab85ab6a/attachment.html>


[freenet-dev] Logging in Fred

2012-03-21 Thread Ian Clarke
Is there a good reason to roll our own logging framework?  What about
http://www.slf4j.org/ or one of the many other alternatives?

Ian.

On Sun, Mar 18, 2012 at 6:40 PM, Marco Schulze wrote:

> One thing has been bothering me: those 'if (logMINOR) Logger.minor(...',
> and the mess that logging is inside fred. I've written a very simple
> replacement for Logger + associated classes with the following changes:
>
> - Log level (renamed to severity) filtering is done by Logging.log();
> - Specific writer classes are replaced by a simple OutputStream, which
> defaults to System.err. Formatting is also unified;
> - Severity cases are broadened (FATAL, ERROR, WARNING, INFO, DEBUG and
> TRACE), MINOR is mapped to DEBUG, and NORMAL is mapped to INFO;
> - No logging method accepts an Object parameter - hashCode() is not
> exactly useful.
>
> Additionally, log rotation will be moved outside (possibly inside Node).
>
> Currently, the log format is '\t'.
> __**_
> Devl mailing list
> Devl at freenetproject.org
> https://emu.freenetproject.**org/cgi-bin/mailman/listinfo/**devl<https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl>
>



-- 
Ian Clarke
Personal blog: http://blog.locut.us/
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20120321/7d3d7673/attachment.html>


[freenet-dev] Coding standards

2012-03-21 Thread Ian Clarke
Or to commit the relevant Eclipse project to enforce these standards as a
"save action".

Ian.

On Tue, Mar 20, 2012 at 6:07 AM, Nicolas Hernandez <
nicolas.hernandez at aleph-networks.com> wrote:

> Could it be possible to have a checktsyle file ?
>
> - Nicolas Hernandez
> a-n - aleph-networks
> *associ?*
> http://www.aleph-networks.com
>
>
>
>
> On Tue, Mar 20, 2012 at 11:47 AM, Matthew Toseland <
> toad at amphibian.dyndns.org> wrote:
>
>> On Monday 19 Mar 2012 23:12:15 Steve Dougherty wrote:
>> > I'm all for it. The coding standard is rather clear on indenting with
>> > tabs, so I guess all that would be required is a run with a
>> > re-indenting/code style conformance tool. That's something for a
>> > janitor tree, and would ideally be timed between releases and when all
>> > known pull requests have been merged or rejected to minimize
>> > whitespace-related disruption to existing work.
>>
>> Gigantic third party patches should come with some means to verify them.
>>
>> For example, converting all the spaces to tabs in a single commit is fine
>> because then you can just do diff -uw.
>>
>> However, automated bulk indenting doesn't always makes things easier to
>> read - e.g. devs may not like the style it produces.
>> >
>> > On 03/19/2012 06:13 PM, Marco Schulze wrote:
>> > > May I add a vote to standardise indentation? This mess of spaces
>> > > with tabs really bugs me.
>>
>> ___
>> Devl mailing list
>> Devl at freenetproject.org
>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>
>
>
> ___
> Devl mailing list
> Devl at freenetproject.org
> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>



-- 
Ian Clarke
Personal blog: http://blog.locut.us/
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20120321/9032120d/attachment.html>


Re: [freenet-dev] (no subject)

2012-03-21 Thread Ian Clarke
On Sun, Mar 18, 2012 at 8:09 PM, Daxter  wrote:

> On Mar 18, 2012, at 8:04 PM, Leah Hicks wrote:
>
> I have done my research, although I have to admit wordpress is not
> perfect. If it is *really* that big of an issue then we will simply not
> use it. And yes I'm aware of the current implementation however it uses
> javascript which will not run if users have javascript disabled. If someone
> can find a workaround for that I'm golden.
>
> The problem with any CMS is that if/when Freenet gets a lot of publicity
> (e.g. something was leaked via Freenet) then it will undoubtedly be under
> attack. Allowing dynamic content at all is asking for trouble. I think it's
> best to keep the main site static, generated beforehand with a templating
> engine--my favorite being HAML (http://haml-lang.com).
>

I think ruling out any dynamic content for security reasons is excessive,
there are plenty of secure dynamic websites.

That being said, Wordpress does have a history of vulnerabilities, my
person blog has been hacked twice due to vulnerabilities in Wordpress,
although not in the last 2 years.

I've heard from various people that Wordpress' source code is a total mess,
and they have a caviler attitude towards security holes (basically their
attitude is that if you don't upgrade the minute we release a new version
it's your own fault if you get hacked).

Getting hacked would be far more damaging for us than most projects given
that people download and install software from our site.

So I agree with the reluctance about using Wordpress, but it's going to far
to rule out any dynamic content.  This isn't 1996.

Ian.


-- 
Ian Clarke
Founder, The Freenet Project
Email: i...@freenetproject.org
___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Logging in Fred

2012-03-21 Thread Ian Clarke
Is there a good reason to roll our own logging framework?  What about
http://www.slf4j.org/ or one of the many other alternatives?

Ian.

On Sun, Mar 18, 2012 at 6:40 PM, Marco Schulze wrote:

> One thing has been bothering me: those 'if (logMINOR) Logger.minor(...',
> and the mess that logging is inside fred. I've written a very simple
> replacement for Logger + associated classes with the following changes:
>
> - Log level (renamed to severity) filtering is done by Logging.log();
> - Specific writer classes are replaced by a simple OutputStream, which
> defaults to System.err. Formatting is also unified;
> - Severity cases are broadened (FATAL, ERROR, WARNING, INFO, DEBUG and
> TRACE), MINOR is mapped to DEBUG, and NORMAL is mapped to INFO;
> - No logging method accepts an Object parameter - hashCode() is not
> exactly useful.
>
> Additionally, log rotation will be moved outside (possibly inside Node).
>
> Currently, the log format is '\t'.
> __**_
> Devl mailing list
> Devl@freenetproject.org
> https://emu.freenetproject.**org/cgi-bin/mailman/listinfo/**devl
>



-- 
Ian Clarke
Personal blog: http://blog.locut.us/
___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Coding standards

2012-03-21 Thread Ian Clarke
Or to commit the relevant Eclipse project to enforce these standards as a
"save action".

Ian.

On Tue, Mar 20, 2012 at 6:07 AM, Nicolas Hernandez <
nicolas.hernan...@aleph-networks.com> wrote:

> Could it be possible to have a checktsyle file ?
>
> - Nicolas Hernandez
> a-n - aleph-networks
> *associé*
> http://www.aleph-networks.com
>
>
>
>
> On Tue, Mar 20, 2012 at 11:47 AM, Matthew Toseland <
> t...@amphibian.dyndns.org> wrote:
>
>> On Monday 19 Mar 2012 23:12:15 Steve Dougherty wrote:
>> > I'm all for it. The coding standard is rather clear on indenting with
>> > tabs, so I guess all that would be required is a run with a
>> > re-indenting/code style conformance tool. That's something for a
>> > janitor tree, and would ideally be timed between releases and when all
>> > known pull requests have been merged or rejected to minimize
>> > whitespace-related disruption to existing work.
>>
>> Gigantic third party patches should come with some means to verify them.
>>
>> For example, converting all the spaces to tabs in a single commit is fine
>> because then you can just do diff -uw.
>>
>> However, automated bulk indenting doesn't always makes things easier to
>> read - e.g. devs may not like the style it produces.
>> >
>> > On 03/19/2012 06:13 PM, Marco Schulze wrote:
>> > > May I add a vote to standardise indentation? This mess of spaces
>> > > with tabs really bugs me.
>>
>> ___
>> Devl mailing list
>> Devl@freenetproject.org
>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>
>
>
> ___
> Devl mailing list
> Devl@freenetproject.org
> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>



-- 
Ian Clarke
Personal blog: http://blog.locut.us/
___
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

[freenet-dev] Refactoring Freenet and Library was Re: Gun.IO and Freenet

2012-03-21 Thread Ximin Luo
ght be worth considering, but I doubt it would be worth it.
>>
>>>> Converting everything to use java.util.concurrent and/or
>>>> com.google.common.util.concurrent would help this a lot. Of course, 
>>>> Library can
>>>> and currently does implement this itself, but it's fairly sloppy, and other
>>>> plugins would benefit if such a framework were provided.
>>>
>>> If you simply mean replacing Ticker and Executor, that's fine by me.
>>>>
>>>> Some common tasks that plugins would like to do, which really should be
>>>> provided by the underlying application:
>>>> - run tasks in the background
>>>> - run tasks according to a particular schedule
>>>> - cancel running tasks
>>>
>>> How do you propose to cancel a task once it's started? I guess it depends 
>>> what sort of task it is. If it has a boolean and periodically checks it 
>>> then fine; this would require a subclass ...
>>
>> Depends on what the task is. The writer of the "task" will need to add code 
>> to
>> support cancellation, just like Future.cancel().
> 
> Okay.
>>
>>>> - handle dependencies between tasks, so that e.g. if A depends on B and I
>>>> cancel B, A is automatically cancelled.
>>>
>>> That's a nice bit of functionality yeah. Nothing in fred needs it at 
>>> present, although radical refactorings might make it more useful.
>>
>> Having this functionality would make Library's code a lot simpler. (The
>> dependency management that is, not necessarily the cancellation.) We talked
>> about it a while back but I never really sat down to solve the issue.
> 
> I have no problem with importing a small third party library or even having 
> such classes in freenet/support/.
>>
>>>> - group tasks into related categories so one group doesn't affect the 
>>>> other.
>>>> (e.g. tasks for the group "Library/b-tree-write/index-" won't starve 
>>>> the
>>>> resources of group "WoT/background-trust-calculation")
>>>
>>> If you are scheduling tasks in a limited pool this makes sense. Freenet 
>>> generally doesn't do this because most tasks are either CPU intensive and 
>>> complete quickly, or are blocking / I/O intensive and take ages but don't 
>>> use much resources. Also many tasks are latency sensitive. And on modern 
>>> JVMs, lots of threads are cheap, although memory is an issue, we do need to 
>>> keep it down if possible ...
>>
>> There is a thread limit. You don't want plugin A to hog 90% threads and leave
>> the other 10% to everything else.
> 
> It's different for plugins IMHO. Although there is only so much you can do to 
> guard against errant plugins.
>>
>>>>
>>>> ## config management
>>>>
>>>> Code for read/writing the config in embedded inside the classes they 
>>>> control,
>>>> which clutters up the code and makes it confusing. Config code should be
>>>> separated from the actual application. It would also be nice if this was
>>>> exposed to plugins.
>>>
>>> Separated how exactly? You want to call getters via reflection, like java 
>>> beans? It is always going to be the case that changing some settings on the 
>>> fly will be somewhat involved and require methods for it; the classes are 
>>> only one way to write such an interface, I'm open to other mechanisms given 
>>> that config happens very infrequently.
>>>>
>>>> Being a daemon is why the current config system is NOT SUFFICIENT. I need 
>>>> to be
>>>> able to lock certain config settings, such as where to keep the datastore /
>>>> run-time files themselves, to conform to the FHS. It's best that such 
>>>> settings
>>>> are kept in a separate read-only file. The current system only reads one 
>>>> file,
>>>> freenet.ini.
>>>
>>> Sounds to me like that could be achieved with some fairly small changes; I 
>>> still don't see what the problem is.
>>
>> Adding an "#include" mechanism for config files whilst supporting "write" at
>> the same time is not a "small change". Think about it.
> 
> There are several cheap and dirty options, for example, we could provide a 
> list of config files on the command line, with changes being written to the 
> first (or the last, possibly configurable with another command line option).
> 
> But yes, maybe we need something more elegant.
> 
> But *we need to be able to write to a config file*. Ease of use on the 
> majority platform (Windows) makes this an absolute requirement. We cannot get 
> rid of it, period.
>>
>> (This is why .gitconfig doesn't have #include whereas .hgrc does.)
>>
>>>> Updating its own binaries is not a problem if freenet knows where the 
>>>> binaries
>>>> are. The current installer puts them in a rigid place, however this is
>>>> incompatible with FHS.
>>>
>>> A rigid place? I don't follow. If you are doing FHS you are using a 
>>> package; the installer is never going to comply with FHS as, apart from 
>>> anything else, it shouldn't be run as root!
>>
>> The updater (UpdateDeployContext) makes some very specific assumptions as to
>> the locations of the jars, and this method doesn't generalise to non-jar 
>> files.
>> It also assumes wrapper.conf is in the current directory.
> 
> I believe we can ask the wrapper where the file is - and probably the jars 
> too.
> 
> However I thought you were expecting to just turn off auto-update in packaged 
> versions?
>>
>>> Updating its own binaries is incompatible with the standard unix way of 
>>> doing things, isn't it? Even if it's not technically a violation of FHS?
>>>
>>>
>>> ___
>>> Devl mailing list
>>> Devl at freenetproject.org
>>> https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


-- 
GPG: 4096R/5FBBDBCE
https://github.com/infinity0
https://bitbucket.org/infinity0
https://launchpad.net/~infinity0

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20120321/5b253554/attachment.pgp>