#foswiki 2015-08-14,Fri

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)

WhoWhatWhen
gac410The RevCommentPlugin has some more issues. It's not going to work as is on Foswiki 2.0. The META serializer is strict and *enforces* the allow / require options for registered meta. [02:58]
...... (idle for 27mn)
It looks like there is a simple fix. [03:25]
................... (idle for 1h34mn)
anyway, this really ought to be all untangled. Core / default templates should not be conditionally pulling in a non-default extension. [04:59]
***gac410 has left [04:59]
............................ (idle for 2h19mn)
LavrI am trying to optimize my plugin for interval sorting and want to change my structure. It used to be $valueIndex{$indexText}[$i]{$webTopic} and I could do keys %{@valueIndex}
Now I want to change to $valueIndex[$i]{$indexText}{$webTopic} and I want the keys of $valueIndex[anything]. Is that possible without making a ton of looping?
Ie I want all the $indexText keys of all values of $i
[07:18]
keys %{$valueIndex[1..2] but that only returns keys of 2nd array. [07:32]
......................... (idle for 2h3mn)
***ChanServ sets mode: +o MichaelDaum
MichaelDaum changes topic to: Foswiki 2.0.1 - http://foswiki.org/Download/FoswikiRelease02x00x01 Channel logs at http://irclogs.foswiki.org/bin/irclogger_log/foswiki Release Meeting, Monday Aug 24, 1300Z
[09:35]
.................... (idle for 1h38mn)
ChanServ sets mode: +o gac410 [11:14]
............ (idle for 59mn)
ChanServ sets mode: +o CDot [12:13]
........... (idle for 52mn)
LavrHi. I am again stuck with a complex perl structure syntax problem.
I have an array of arrays of a hash
I am trying to sort the inner arrays 1 by 1
@sortedIndexes[$i] = sort { $a->{indexvalue} <=> $b->{indexvalue} } ( @sortedIndexes[$i] );
I get view: Scalar value @sortedIndexes[$i] better written as $sortedIndexes[$i] at /var/www/foswikidev/core/lib/Foswiki/Plugins/MultiSearchPlugin.pm line 378., referer: http://10.172.3.71/foswikidev/bin/view/Sandbox/MultiTopicSearchTest
It is not supposed be a scalar value. @sortedIndexes[$i] is supposed to be an array
So how do I get the syntax for that?
[13:05]
***ChanServ sets mode: +o MichaelDaum [13:10]
MichaelDaumwelcome back CDot
hope you had a nice time
[13:12]
gac410wow I didn't notice... Yay... CDot returns. [13:12]
Lavrmy @temparray = @sortedIndexes works but not what I want. my @temparray = @sortedIndexes[1] warns about being a scalar. [13:17]
MichaelDaumtry @temp = @{$sortedIndexes[1]} [13:17]
LavrThanks the simple @temp = @{$sortedIndexes[1]} works. NOw I need to see if I can sort it
Nope. Modification of a read-only value attempted at....
I tried @{$sortedIndexes[$i]} = sort { $a->{indexvalue} <=> $b->{indexvalue} } @{$sortedIndexes[$i]};
I guess the left and right of = needs to be done differently
It is the left of = that fails
[13:18]
CDotHi all, yes, had a lovely time in Slovenia. Can really recommend it, lovely country. [13:26]
LavrHi CDot. And Hi everyone. [13:27]
CDotLavr: if you want to sort the array in place, use refererences
so, let's say you have my @a
another way of saying that is my $a = []
each member of $a[] is a reference to another array
so to sort $a[$i], you'd say $a->[$i] = [ sort @{$a->[$i]} ]
it's a bit sordid, but it'll work, and the syntax becomes easier with practice
[13:28]
LavrThanks. I have tried with some \@ syntax. I will try this. I need to sort by a member of a hash. it is an array of arrays of a hash with two members.
OK I tried this
$sortedIndexes->[$i] = [ sort { $a->{indexvalue} <=> $b->{indexvalue} } @{$sortedIndexes->[$i]} ];
and it fails with Global symbol "$sortedIndexes" requires explicit package name
[13:32]
CDothow did you declare $sortedIndexes? [13:38]
Lavrmy @sortedIndexes; [13:39]
CDotok, that's decalring a different variable
specifically, an array called @sortedIndexes, which is (sadly) different to $sortedIndexes
so, change it to my $sortedIndexes
any references to $sortedIndexes[$i] need to be changed to $sortedIndexes->[$i] too
perl is pretty horrible: $sortedIndexes[$i] is actually how you refer to a member of @sortedIndexes
whereas $sortedIndexes->[$i] refers to the i'th member of the array pointed at by the reference $sortedIndexes
[13:39]
LavrI have the array of arrays of hash working fine in the code until the point where I need to sort the arrays one level down. [13:42]
CDot(if you avoid using @sortedIndexes type arrays, you can pretty much forget about this difference)
if you pastebin the code, I can take a look and advise the best approach
[13:42]
GithubBot[MultiSearchPlugin] KennethLavrsen pushed 1 new commit to master: http://git.io/v3MlV
MultiSearchPlugin/master b1d3029 KennethLavrsen: Item13616: Pushing up broken code to get help
[13:45]
***GithubBot has left [13:45]
FoswikiBothttp://foswiki.org/Tasks/Item13616 [ Item13616: <Development of initial version of MultiSearchPlugin ] [13:45]
LavrI just pushed the broken code to git.
it is around line 377 that I try to sort the array of arrays
The commented out Dumper print at line 371 shows me that I have the right content in my array
[13:46]
foswiki_irc0how would i put the follow code into a topic? i tried putting <literal> around it but it just displays the text
$(document).ready(function() { $('#calendar').fullCalendar({ }) });
[13:47]
CDotoic; ok, you are trying to sort the array @sortedIndexes which is a multi-dimensional array of hashes [13:49]
LavrYes. The reason I have the array of arrays is that I cannot know how many I will end up with. it depends on the number of searches you put in the macro.
The whole purpose of this part of code is to load data in a few efficient searches. And in the "interval" mode it is going to list the found data in date or number intervals.
[13:51]
CDotok. So $sortedIndexes[$i] = sort { $a->{index} <=> $b->{index} } $sortedIndexes[$i] ought to work
my @sortedIndexes for that
since $sortedIndexes[$i] is itself an array, you can feed it straight to sort()
[13:52]
LavrTrying that one right away... [13:54]
gac410Lavr, I pasted in fixes for RevCommentsPlugin in your task. I've kept going and am close to untangling the revcomment stuff from the default/core templates.
It's not just the template problem. The 2.0 Meta searalizer (?) is much more strict. So if the code says to allow 'comment' then 'comment_1' is NOT allowed and the meta ignored
[13:54]
LavrGeorge. I saw that. I like the code fix. I am a bit worried about yet another layer of skinning needed. [13:55]
gac410that can be fixed by removing the allow, so that any field is permitted in the META ... [13:55]
LavrI also understand the counter argument. it would be nice with a more generic way a plugin that add additional fields to the UI [13:56]
gac410RevComment is not a "default" plugin ... I can't see how it ever should have been stuffed into the other templates ... Other than historical from T* days
Regarding the META fields, probably the preferred way would be to allow multiple, so each comment gets a separate META::REVCOMMENT{} instance
[13:56]
LavrThe history is that HistoryPlugin, Compare..., and RevComment were originally made by the same person and were supposed to go hand in hand [13:57]
gac410ah [13:57]
LavrWe agreed though not to put in the RevComment by default.
But we took in History and Compare because they are cool. And Arthur provided the "skin hooks" needed
[13:58]
gac410Even though extra skinning is annoying, it's probably the cleaner approach. Esp. if anyone ever updates to a more modern RevComment. [13:58]
LavrThe problem with the skin is that one day the Nat Edit changes so ever slightly and everything is broken again. That is why some more official API like way to add things like this would be nice. [14:00]
gac410It's really not all that onerous to include a single template and override it with the additional info. The oopshistory is probably the more complex one, but still not a huge challenge.
y. that needs thinking above my paygrade :)
[14:00]
LavrWe will double your salary as release manager :-) [14:01]
gac410I've already proven that modifying javascript & jquery is way over my paygrade :) [14:01]
jastlet's be generous and triple it [14:02]
gac410gac410 leaves cdot with yet another configure mess ... with his Plugins::merge() wizard which can't get the darn {Module} and {Enabled} settings to stick. [14:02]
LavrI wonder how difficult it would be to enable a plugin to add an extra tab to the natedit. I have not studies how that all works [14:03]
gac410Y I was thinking about that ... if the Rev comment ought to be in a [HISTORY] tab maybe ... but that became too much like work :D [14:03]
MichaelDaumrev comments should be part of the revs ... in the core [14:04]
LavrCDot. I tried the $ syntax you suggested. Now I get Useless use of sort in scalar context at /var/www/foswikidev/core/lib/Foswiki/Plugins/MultiSearchPlugin.pm line 382 [14:04]
CDotdid you declare @sortedIndexes? [14:05]
MichaelDaumall VCSes allow comments per checkin
having them in the net data is not really cutting it
[14:05]
LavrMichael. I never liked RevComment plugin for several reasons. But it is difficult to get rid of it once people have used it [14:05]
MichaelDaumone META:REVCOMMENT{} would be already a huge improvement for RevCommentPlugin. as well as a conversion script needed then of course. [14:06]
LavrCDot - I declared @sortedIndexes again yes [14:06]
MichaelDaummediawiki has got rev comments part of the core as far as I know ... and it is indeed quite useful for authors to summarize what they did! [14:07]
gac410jast, I shouldn't tell this story. But back in college, in "Applied Advanced Calculus" our first exam, scores were awful. The prof. announced he was scaling everyone up by 200%.
I was the only one who's score didn't change. It became known as "Clark's constant" ... :P (I still passed the course, but it was a tough slog)
[14:07]
LavrOne problem with RevComment is that if you type something wrong and save you are done. You cannot edit it even within the current revision. [14:07]
gac410I'll probably consider "deprecating" the embedded "if enabled..." templates in 2.0.x Releasing a RevCommentPlugin which provides all it's skin changes via templates. (there are only 3) and dropping them from the core templates in 2.1
gac410 needs a proposal I guess.
[14:09]
MichaelDaumadding extra tabs to NatEdit is a matter of writing a custom EditTemplate ... doing this a lot [14:09]
gac410a "History" tab, in both a view template, and an Edit template, would be quite nice. [14:10]
CDotfor (my $i = 0; $i < scalar(@sortedIndexes); $i++) {
@{$sortedIndexes[$i]} = sort { $a->{a} <=> $b->{a} } @{$sortedIndexes[$i]};
}
horrible, I know, but it does make a certain amount of sense
[14:11]
MichaelDaume.g. add this to your edit template: %TMPL:DEF{"formfields"}%TMPL:P{"historytab"}%%TMPL:P{"categorytab"}%%TMPLP{"tagstab"}%%TMPL:END% .... %TMPL:DEF{"historytab"}%%TAB{"History"}% ...... %ENDTAB%%TMPL:END% [14:11]
LavrI will try anything now CDot :-) [14:11]
gac410MichaelDaum: I think that there IS only one META:REVCOMMENT{} today. It grows history by indexing the variables in the template. [14:11]
CDotLavr: I know that works, I just tried it :-) [14:12]
MichaelDaumcategorytab ... tagstab optional ... just to make the example a bit more interesting [14:12]
LavrCDot. Cheater! [14:12]
MichaelDaumgac410, yes. awful. [14:12]
jastgac410: I've scored Clark's constant a number of times, too... [14:12]
CDotLavr: http://pastebin.com/3CFQ2j8a [14:12]
gac410Lavr: You were listed as an author on RevComment. I know it says feel free to modify, but do you want me to go ahead and fix up the compatibiliyt for foswiki 2.0? [14:13]
LavrOh yes. I was just the one that ported it over from the old project. [14:14]
gac410oh ... okay great. Gradually we'll get the popular plugins running on Foswiki 2.0. Probably a bunch more to deal with. I don't know what to do with DavidPatterson's plugins. those are dead now. :( [14:15]
LavrCDot. No luck. Now I get Modification of a read-only value attempted at /var/www/foswikidev/core/lib/Foswiki/Plugins/MultiSearchPlugin.pm line 377
Wait 377????
[14:22]
CDotLavr: there's probably some syntax problem. What I described in the pastebin deffo works. [14:22]
Lavr3 lines
for ( my $i = 1 ; $i <= $searchCounter ; $i++ ) {
@{$sortedIndexes[$i]} = sort { $a->{indexvalue} <=> $b->{indexvalue} } @{$sortedIndexes[$i]};
}
[14:24]
CDotand which line is 377? [14:25]
LavrThe for
I jump from 1 to 2 in my example. Not from 0. I don't use the my $sortedIndexes[0].
[14:27]
CDotand the indexes of the array run from what to what? [14:29]
LavrInner from 0 [14:29]
CDotand outer? [14:29]
Lavrouter from 1 to 2 [14:29]
CDotand what is $searchCOunter?
the value, I mean?
[14:29]
LavrLet me dump that
2 as expected It is set early as the number of search parameters in the macro.
And I know the big hash has only values 1 and 2. I have Data Dumped that
[14:29]
CDotok, and $sortedIndexes definitely has values at locations [1] and [2]? [14:32]
LavrYes. [14:33]
CDotand are there any gaps (undef values) in any of the arrays being sorted? [14:34]
LavrI need to examine that [14:35]
CDothttp://www.perlmonks.org/?node_id=570712 has other possible causes, but none of the others seem to apply here [14:35]
LavrWhen I data dump the Dumper($sortedIndexes[$i]) then I see some strange undefs that should not be there. Maybe I have garbage in the data anyway. I need to look at that. But that will be Sunday. I have a guest in 1 hour. And going to a wedding (family) tomorrow.
Thanks anyway. At least I have a new failure mode now and the pastebin example to fall back to
[14:41]
foswiki_irc0how can i include a .js that is external to my foswiki installation? im trying to manually get the fullcalendar working. - i tried wrapping it in the <literal> tag but i get the following error according to firebug: SyntaxError: expected expression, got '<' <!DOCTYPE html> [14:44]
jastyour link or script tag is probably incorrect [14:47]
foswiki_irc0is this correct - <script src='pub/System/FullCalendar/fullcalendar.js'></script> [14:49]
Lavrreplace pub with %PUBURL%
I am off CU and thanks again for the help.
[14:50]
jastthe first part, 'pub', isn't correct. if you're on .../Main/WebHome, for instance, your browser would try to fetch .../Main/WebHome/pub/System/FullCalendar/fullcalendar.js, which of course isn't quite right
if you have foswiki at the top level of the URL, i.e. the normal topic URLs are http://example.org/bin/view/Main/WebHome or http://example.org/Main/WebHome, using '/pub' instead of 'pub' is fine. %PUBURL% (or %PUBURLPATH%) figures out the right path prefix automatically for you
[14:51]
FoswikiBot[ 404 - Not Found ] [14:52]
foswiki_irc0%PUBURL% worked, i see a calendar now.
thank you
now in the fullcalendar basic usage example, he is including a jquery.min.js file, thats not needed since we have jquery plugin already correct?
[14:53]
jastcorrect [14:57]
gac410foswiki_irc0: The ObjectPlugin and HijaxPlugin required to update calendars might have issues on Foswiki 2.0. One of them has REST handlers, and we've tightened up the security of them significantl. [15:00]
....... (idle for 32mn)
Anyone know if other than wasting space, it hurts to double define some CSS: .historyRevComment li {...} might appear twice in the head until core catches up with my plugin changes?
I'm not seeing any errors, but that's only one browser,.
[15:32]
jmk0afaik it doesn't matter if you define css tags twice
though i'm not sure what happens if the definitions are different
[15:33]
gac410In this case they are identical ... unless someone modifies the CSS. I'll remove them from the core template in 2.0.2, Since the plugin doesn't work anyway without the changes, it would only be a short window of duplication.
Lavr: I'm going to check in my changes to RevCommentPlugin ... I've tested it here, but it would be best if you could give it a workout on 2.0.1. then 2.0.2 will untangle the templates a bit more.
[15:34]
jastduplicate CSS definitions are fine
the second one overwrites the first
[15:36]
gac410great. Thanks jast. [15:36]
jmk0actually yeah that makes perfect sense ... "cascading style sheets"
kinda the whole point, isn't it? :)
[15:38]
GithubBot[RevCommentPlugin] gac410 pushed 1 new commit to master: http://git.io/v3DmP
RevCommentPlugin/master e7c9e8f George Clark: Item13619: Make RevCommentPlugin work with Foswiki 2.0...
[15:41]
***GithubBot has left [15:41]
FoswikiBothttp://foswiki.org/Tasks/Item13619 [ Item13619: RevCommentPlugin not compatible with Foswik 2.0 ] [15:41]
................................................................................ (idle for 6h38mn)
jmk08 printed pages of test graphs and that's just scratching the surface of testing DirectedGraphPlugin... but it's time for the weekend to start. /me waves [22:19]

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)