Well, you are certainly free to contribute.
Heuristic interpretation of data could be useful, but looks like an addition on top, the core library should be fast and efficient.
> On 18 Feb 2015, at 10:35, Andrea Ferretti <ferrettiandrea(a)gmail.com> wrote:
>
> For an example of what I am talking about, see
>
> http://pandas.pydata.org/pandas-docs/version/0.15.2/io.html#csv-text-files
>
> I agree that this is definitely too much options, but it gets the job
> done for quick and dirty exploration.
>
> The fact is that working with a dump of table on your db, whose
> content you know, requires different tools than exploring the latest
> opendata that your local municipality has put online, using yet
> another messy format.
>
> Enterprise programmers deal more often with the former, data
> scientists with the latter, and I think there is room for both kind of
> tools
>
> 2015-02-18 10:26 GMT+01:00 Andrea Ferretti <ferrettiandrea(a)gmail.com>:
>> Thank you Sven. I think this should be emphasized and prominent on the
>> home page*. Still, libraries such as pandas are even more lenient,
>> doing things such as:
>>
>> - autodetecting which fields are numeric in CSV files
>> - allowing to fill missing data based on statistics (for instance, you
>> can say: where the field `age` is missing, use the average age)
>>
>> Probably there is room for something built on top of Neo
>>
>>
>> * by the way, I suggest that the documentation on Neo could benefit
>> from a reorganization. Right now, the first topic on the NeoJSON
>> paper introduces JSON itself. I would argue that everyone that tries
>> to use the library knows what JSON is already. Still, there is no
>> example of how to read JSON from a file in the whole document.
>>
>> 2015-02-18 10:12 GMT+01:00 Sven Van Caekenberghe <sven(a)stfx.eu>:
>>>
>>>> On 18 Feb 2015, at 09:52, Andrea Ferretti <ferrettiandrea(a)gmail.com> wrote:
>>>>
>>>> Also, these tasks
>>>> often involve consuming data from various sources, such as CSV and
>>>> Json files. NeoCSV and NeoJSON are still a little too rigid for the
>>>> task - libraries like pandas allow to just feed a csv file and try to
>>>> make head or tails of the content without having to define too much of
>>>> a schema beforehand
>>>
>>> Both NeoCSV and NeoJSON can operate in two ways, (1) without the definition of any schema's or (2) with the definition of schema's and mappings. The quick and dirty explore style is most certainly possible.
>>>
>>> 'my-data.csv' asFileReference readStreamDo: [ :in | (NeoCSVReader on: in) upToEnd ].
>>>
>>> => an array of arrays
>>>
>>> 'my-data.json' asFileReference readStreamDo: [ :in | (NeoJSONReader on: in) next ].
>>>
>>> => objects structured using dictionaries and arrays
>>>
>>> Sven
>>>
>>>
>
> On 18 Feb 2015, at 10:26, Andrea Ferretti <ferrettiandrea(a)gmail.com> wrote:
>
> Thank you Sven. I think this should be emphasized and prominent on the
> home page*. Still, libraries such as pandas are even more lenient,
> doing things such as:
>
> - autodetecting which fields are numeric in CSV files
> - allowing to fill missing data based on statistics (for instance, you
> can say: where the field `age` is missing, use the average age)
>
> Probably there is room for something built on top of Neo
>
>
> * by the way, I suggest that the documentation on Neo could benefit
> from a reorganization. Right now, the first topic on the NeoJSON
> paper introduces JSON itself. I would argue that everyone that tries
> to use the library knows what JSON is already. Still, there is no
> example of how to read JSON from a file in the whole document.
These libraries (NeoCSV, NeoJSON, STON) were all written with only a dependency on a limited character stream API. It was a design decision not to depend on a File API, because at the time we were transitioning from the old FileStreams to FileSystem.
And I disagree about the JSON introduction ;-) You might know it, but that is not the case for everyone. Like not everyone knows CSV, HTTP, ...
But I do agree that sometimes I too would like a convenience method here or there ;-)
> 2015-02-18 10:12 GMT+01:00 Sven Van Caekenberghe <sven(a)stfx.eu>:
>>
>>> On 18 Feb 2015, at 09:52, Andrea Ferretti <ferrettiandrea(a)gmail.com> wrote:
>>>
>>> Also, these tasks
>>> often involve consuming data from various sources, such as CSV and
>>> Json files. NeoCSV and NeoJSON are still a little too rigid for the
>>> task - libraries like pandas allow to just feed a csv file and try to
>>> make head or tails of the content without having to define too much of
>>> a schema beforehand
>>
>> Both NeoCSV and NeoJSON can operate in two ways, (1) without the definition of any schema's or (2) with the definition of schema's and mappings. The quick and dirty explore style is most certainly possible.
>>
>> 'my-data.csv' asFileReference readStreamDo: [ :in | (NeoCSVReader on: in) upToEnd ].
>>
>> => an array of arrays
>>
>> 'my-data.json' asFileReference readStreamDo: [ :in | (NeoJSONReader on: in) next ].
>>
>> => objects structured using dictionaries and arrays
>>
>> Sven
>>
>>
>
> On 18 Feb 2015, at 09:52, Andrea Ferretti <ferrettiandrea(a)gmail.com> wrote:
>
> Also, these tasks
> often involve consuming data from various sources, such as CSV and
> Json files. NeoCSV and NeoJSON are still a little too rigid for the
> task - libraries like pandas allow to just feed a csv file and try to
> make head or tails of the content without having to define too much of
> a schema beforehand
Both NeoCSV and NeoJSON can operate in two ways, (1) without the definition of any schema's or (2) with the definition of schema's and mappings. The quick and dirty explore style is most certainly possible.
'my-data.csv' asFileReference readStreamDo: [ :in | (NeoCSVReader on: in) upToEnd ].
=> an array of arrays
'my-data.json' asFileReference readStreamDo: [ :in | (NeoJSONReader on: in) next ].
=> objects structured using dictionaries and arrays
Sven
GT Tools are awesome!!! I'm molding some inspectors right now ;)
Two things...
Bug (I think):
1. Type in Playground: "1 printString"
2. Place cursor between "print" and "String"
3. PrintIt
4. Press enter to paste PrintIt as comment
-> The comment appears at cursor position. I encountered this when I clicked
at a random place in the selector to move the cursor to that line to
PrintIt. At minimum, if nothing is selected, IMHO it should paste the
comment after a word boundary, if not at the end of or line - not sure...
Suggestion: now that Pharo 4.0 has horizontal scrolling, it would be
interesting to scroll between the Miller Columns of the Playground that way
(if a scrollable panel doesn't have focus)
-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/GTTools-A-bug-and-a-suggestion-tp4806061.html
Sent from the Moose mailing list archive at Nabble.com.
GT's browse icon does not match Pharo's (see the world menu), creating an
inconsistent feel. In fact, I eventually clicked on the button only out of
curiosity. Would it be possible to use whatever the underlying system uses
(in this case "Smalltalk tools browser taskbarIcon")?
Thanks!
-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/GT-Inspector-Browse-Icon-tp4806062.html
Sent from the Moose mailing list archive at Nabble.com.
In experimenting with creating a custom inspector for my domain object, I
came across the following intriguing method:
Float>>#gtInspectorFloatIn: composite
<gtInspectorPresentationOrder: 30>
^ composite table
title: 'Float';
display: [
...
{'binary' -> self binaryLiteralString.
'significand' -> self significand.
'exponent' -> self exponent} ];
column: 'Key' evaluated: #key;
column: 'Value' evaluated: #value;
send: #value
While it was easy enough to adapt this to my needs, I found the #display:
and #send: sends quite strange. #display: seems like a strange API - like
we're using an object designed to do something other than inspect objects;
and I wasn't sure what exactly #send: did, my presentation seemed to
function the same way with or without it...
-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/gtPresentation-display-tp4806066.html
Sent from the Moose mailing list archive at Nabble.com.
Hello,
I made something look likes hives plot that with RTMondrian.
For this, I create RTRectLineLayout and RTHivePlot.
How can I package this ?
Should I create one package Builder-HivePlot ?
What do you think about it ?
Cheers,
Jonathan.
#flatCollect:. In my case, the variable 'attributes' is of type
http://damiencassou.seasidehosting.st
FAMIXType>>incomingAccesses
^ self privateState
cacheAt: #incomingAccesses
ifAbsentPut: [ attributes flatCollect: [ :each | each
incomingAccesses ] ]
Hi,
in this method
when the cache is empty, it is initialized with the result of
FMMultivalueLink. When sending #flatCollect: to a
FMMultiValueLink, the result is an OrderedCollection (because
FMMultiValueLink>>#species returns OrderedCollection). This means
that it is no more possible to
update the list of incomingAccesses.
Is that the desired behavior?
In my case, this behavior triggers a bug. When the following
method is
FMMultiValueLink class>>on: element update: selector from: old
to: new
"refresh the other side of the relations to reflect change in
value"
old ~= new ifTrue: [
old notNil ifTrue: [ (old perform: selector) unsafeRemove:
element ].
new notNil ifTrue: [ (new perform: selector) unsafeAdd:
element ]].
^ new
executed while importing a mse, I get a DNU:
This is because the (new perform: selector) expression returns an
OrderedCollection that does not understand #unsafeAdd: (selector
equals
to #incomingAccesses).
Could somebody help me please?
-- Damien Cassou
"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
Hi,
I man ot sure if this is the right lists to ask such question please let
me know if there is a better one.
I am currently working my self through the moose book and Glamour chapter.
I have a REST interface here that I would like to test and analyze via
Moose.
I have a json specification of all the apis available.
So using a JSON parser in Pharo creates a Array/Dictionary based model
representation.
I wonder how you go from there? Do you implement the whole data model in
Pharo to have a nice NeoJSON support? Is there already a package that
genreates Smaltlak classes from Dictionaries?
Is there a tool the create MSE files from JSON?
Or are you just working with these Array/Dictionary structures?
I currently just try to learn to use the Glamour Editor and try to
represent the API in a useful way.
Any hint, link or advice is very welcome
Thanks
Sebastian
Hi all,
This mail will have two parts, a small first one where I share my
advances and little context on the project and the second one, with
details where I made specific questions regarding concepts and code and
how to make progress. I hope to be fluid and proper balanced and
interesting enough to get feedback soon.
Context
=======
I have made a small video at [1] showing my progress on Grafoscopio[2],
a tool for the creation of interactive notebooks for open/citizen/garage
science and research (for a better view I recommend to see the video in
full screen mode).
As you can see, I have a complete outline of the Agile Visualization
book stored as a single "ston document" [3], that can be exported to
pandoc's markdown [4] and from there to LaTeX, pdf, html, doc, etc.
It can contain special tagged nodes and the view and behaviour of them
change accordingly to the tag. In the video a node tagged as code is
showed as an interactive playground where you can execute an explore the
objects deeper.
My problem is that this kind of special nodes are not saved, as happens
with default nodes and the reason is that the special view (which is a
sub-browser) is not wired properly to the rest of the browser and that's
why I get a nill value after revisiting the code node in the video.
[1] https://archive.org/details/gfcp-alpha-code-exec-but-non-saving.mp4
[2]
http://mutabit.com/offray/static/blog/output/posts/grafoscopio-idea-and-ini…
[3]
http://mutabit.com/deltas/repos.fossil/grafoscopio/doc/tip/Docs/En/Books/Ag…
[4]
http://mutabit.com/deltas/repos.fossil/grafoscopio/doc/tip/Docs/En/Books/Ag…
Details
=======
The logic of what I'm doing is something like this:
i. When a node in tree at the left is selected, it shows the contents of
the selected tree.
ii. If something changes in the node content at the right, the changes
are automatically updated.
iii. If a node is tagged in a special way, a custom browser is called.
The code that select which sub-browser to show for a particular tagged
node is something like this:
==[a]==============================
UI>>buildBrowserNamed: aName
"Main method for building the interface for trees and its nodes. The
name of the browser corresponds to the name of the file
where tree is stored (or is named 'draft.ston' by default)"
"... snip"
(browser transmit)
from: #tree port: #selection;
to: #nodeBody;
when: [:selection | selection notNil];
andShow: [ :a :node |
self bodyIn: a for: node.
self body2ForCodeIn: a for: node.
self bodyForTransmediaIn: a for: node ].
"... snip"
"Creating a self updatable body pane"
(browser transmit)
from: #tree port: #selection;
to: #nodeBody;
when: [:selection | selection notNil];
andShow: [ :a :node |
self bodyIn: a for: node.
self body2ForCodeIn: a for: node.
self bodyForTransmediaIn: a for: node ].
(browser transmit )
from: #tree port: #selection;
from: #nodeBody port: #text;
when: [:node :text | text notNil & node notNil];
to: #nodeBody port: #neverland;
transformed: [:node :text | node body: text asString].
(browser transmit)
from: #tree;
to: #nodeHeader;
andShow: [ :h | self headerOn: h ].
(browser transmit )
from: #tree port: #selection;
from: #nodeHeader port: #text;
to: #nodeHeader port: #neverland1;
when: [:node :text | text notNil & node notNil];
transformed: [:node :text | node header: text asString]
===================================
The last part of the code is responsible for updating the tree contents
automatically with
The "body2ForCodeIn: for:" [b] is the responsible for showing the
playground by calling a custom browser that is called
"panelAsCodeFor:"[c]. Here is their code:
==[b]==============================
UI>> body2ForCodeIn: constructor for: aNode
"Shows the body of a selected node as executable code."
aNode tags = 'código'
ifFalse: [ ^self ]
ifTrue: [constructor custom: (self panelAsCodeFor: aNode)].
===================================
==[c]==============================
panelAsCodeFor: aNode
"Shows an interactive playground for Smalltalk code in a node body"
browser := GLMTabulator new.
browser title: 'Código'.
browser column: #code.
browser transmit
to: #code;
transformed: [ GTPlayPage new content: aNode body ];
andShow: [ :a | a custom: GTPlayground new ].
browser sendToOutside: #nodeBody from: #code -> #text.
^ browser.
===================================
So, wiring by "sendToOutside: from:" is not working and I don't know how
to tell my code browser to autosave its contents as part of the node
body where they belong.
Any help with this is appreciated.
Cheers,
Offray