Re: Next step: running complex queries that return counts

2016-10-20 Thread CHRISTOPH WICK | i4innovation GmbH, Bonn
Hi Ken,

I'm using EOUtilities.rawRowsForSQL

Here's an example from my code

> public int numOfTotalMessages(EOEditingContext ec) {
>   String sqlTerm = "SELECT COUNT(*) FROM PMSMessage WHERE ownerUserID = 
> "+this.primaryKey();
>   NSArray resultsRows = EOUtilities.rawRowsForSQL(ec, "PMSModel", 
> sqlTerm, new NSArray("count"));
>   return ((Number) ((NSDictionary) 
> resultsRows.objectAtIndex(0)).objectForKey("count")).intValue();
> }

It takes 4 params:

1. an EOEditingContext. Take one you already have or create a new one.
2. the "name" of your model as String.
3. a SQL term. Just write plain SQL or even MySQL dialect (if you use MySQL 
only)
3. an array of key-names that are used in the dictionaries returned. In case of 
a count-query, it's pretty useless, since you get exactly one result row with a 
one-line dict.

OK?

C.U.CW
--
The three great virtues of a programmer are Laziness, Impatience and Hubris. 
(Randal Schwartz)

> On 20.10.2016, at 17:39, Ken Anderson  wrote:
> 
> All,
> 
> Now that I have a good idea about charting, I now need to build the values 
> that will be used for the charts.  Because of the volume of data, this will 
> be a new entity that will have a bunch of totals computed and stored.
> 
> To generate the values, I need to run SQL selects that will return counts for 
> me to store.  Something like this:
> 
> select count(distinct friendID) from MemberFriend where id in (select 
> distinct memberFriendID from Fitlove where occurredAt between '2016-10-19 
> 00:00:00' and '2016-10-19 23:59:59');
> 
> In searching around, it seems like 
> ERXSQLQueryWithBindingsUtilities.rawRowsForSqlWithBindings would be perfect, 
> but I have no idea how to generate the correct query and to setup the binding 
> properly (using mysql 5.5).
> 
> Can anyone point me to some resources for doing raw rows with bindings with 
> mysql?
> 
> Thanks!
> Ken
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/cw%40i4innovation.de
> 
> This email sent to c...@i4innovation.de



signature.asc
Description: Message signed with OpenPGP using GPGMail
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Slack is ....

2016-10-20 Thread David LeBer
Agreed,

Mailing lists may be old school and no longer (if ever) hip, but they do have a 
lot going for them:

- Data is retained.
- Threads are maintained, and often self contained - save the last message in a 
thread to archive the entire discussion.
- Searchable archives (usually) both online, and stored locally.
- Low investment - you can ignore the list until you need it, search for 
applicable stuff, and post if you cannot find anything.

Not as quick turnaround as a chat platform for kibitzing and building 
community, but for actual knowledge retention, much better IMHO.

-- 
D

On October 20, 2016 at 1:19:53 PM, Andrus Adamchik (and...@objectstyle.org) 
wrote:

> I tried to follow the threads but soon got lost. I strongly suggest that such 
> technical issues MUST NOT be discussed on Slack but must be CARRIED OUT ON 
> THE MAILING LIST. Slack is not searchable, the threads are not followable, 
> Google does not index Slack discussions (as far as I know). And most of all 
> the discussion thread is not easily archived.  

Good assessment. A few thousands people at the Apache Software Foundation would 
likely concur. Mailing lists may feel old, but so far are the best way of 
communication for distributed volunteer communities.  

Andrus



___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/dleber_wodev%40codeferous.com

This email sent to dleber_wo...@codeferous.com ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Slack is ....

2016-10-20 Thread Andrus Adamchik
> I tried to follow the threads but soon got lost. I strongly suggest that such 
> technical issues MUST NOT be discussed on Slack but must be CARRIED OUT ON 
> THE MAILING LIST. Slack is not searchable, the threads are not followable, 
> Google does not index Slack discussions (as far as I know). And most of all 
> the discussion thread is not easily archived. 

Good assessment. A few thousands people at the Apache Software Foundation would 
likely concur. Mailing lists may feel old, but so far are the best way of 
communication for distributed volunteer communities. 

Andrus



 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Next step: running complex queries that return counts

2016-10-20 Thread Ken Anderson
All,

Now that I have a good idea about charting, I now need to build the values that 
will be used for the charts.  Because of the volume of data, this will be a new 
entity that will have a bunch of totals computed and stored.

To generate the values, I need to run SQL selects that will return counts for 
me to store.  Something like this:

select count(distinct friendID) from MemberFriend where id in (select distinct 
memberFriendID from Fitlove where occurredAt between '2016-10-19 00:00:00' and 
'2016-10-19 23:59:59');

In searching around, it seems like 
ERXSQLQueryWithBindingsUtilities.rawRowsForSqlWithBindings would be perfect, 
but I have no idea how to generate the correct query and to setup the binding 
properly (using mysql 5.5).

Can anyone point me to some resources for doing raw rows with bindings with 
mysql?

Thanks!
Ken
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best charting

2016-10-20 Thread Ken Anderson
Thank you all for your excellent suggestions!!  It is much appreciated.

> On Oct 19, 2016, at 11:31 PM, Stavros Panidis  
> wrote:
> 
> Hi,
> 
> I use R project - Rserve.
> 
> Stavos
>> On 19 Oct 2016, at 22:00, webobjects-dev-requ...@lists.apple.com wrote:
>> 
>> Send Webobjects-dev mailing list submissions to
>>  webobjects-dev@lists.apple.com
>> 
>> To subscribe or unsubscribe via the World Wide Web, visit
>>  https://lists.apple.com/mailman/listinfo/webobjects-dev
>> or, via email, send a message with subject or body 'help' to
>>  webobjects-dev-requ...@lists.apple.com
>> 
>> You can reach the person managing the list at
>>  webobjects-dev-ow...@lists.apple.com
>> 
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Webobjects-dev digest..."
>> 
>> 
>> Today's Topics:
>> 
>>  1. Best charting? (Ken Anderson)
>>  2. Re: Best charting? (Morris, Mark)
>>  3. Re: Best charting? (Steve Peery)
>>  4. Re: Best charting? (Paul Hoadley)
>>  5. NPE in ERXObjectStoreCoordinatorSynchronizer (Paul Hoadley)
>> 
>> 
>> --
>> 
>> Message: 1
>> Date: Tue, 18 Oct 2016 15:37:51 -0400
>> From: Ken Anderson 
>> To: WebObjects-Dev 
>> Subject: Best charting?
>> Message-ID: <25eeeb59-53c8-4c99-8e17-75fbc5852...@anderhome.com>
>> Content-Type: text/plain; charset=utf-8
>> 
>> All,
>> 
>> I have some data that I’d like to be able to make HTML 5 charts from.  Are 
>> there any decent tools for doing this with WO?
>> 
>> Thanks!
>> Ken
>> 
>> 
>> --
>> 
>> Message: 2
>> Date: Tue, 18 Oct 2016 19:43:46 +
>> From: "Morris, Mark" 
>> To: Ken Anderson 
>> Cc: WebObjects-Dev 
>> Subject: Re: Best charting?
>> Message-ID: 
>> Content-Type: text/plain; charset=utf-8
>> 
>> Hi Ken,
>> 
>> A few years ago I used jFreeChart, which was very easy to integrate. it has 
>> factory methods for each type of chart that you throw your data at, lots of 
>> customization options, and a variety of output formats. So for instance you 
>> can just include a method that returns the image data and use that right in 
>> your WOImage binding.
>> 
>> Good luck!
>> Mark
>> 
>>> On Oct 18, 2016, at 2:37 PM, Ken Anderson  wrote:
>>> 
>>> All,
>>> 
>>> I have some data that I’d like to be able to make HTML 5 charts from.  Are 
>>> there any decent tools for doing this with WO?
>>> 
>>> Thanks!
>>> Ken
>>> ___
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/webobjects-dev/mark.morris%40experian.com
>>> 
>>> This email sent to mark.mor...@experian.com
>> 
>> 
>> 
>> 
>> --
>> 
>> Message: 3
>> Date: Tue, 18 Oct 2016 15:51:54 -0400
>> From: Steve Peery 
>> To: "Morris, Mark" 
>> Cc: WebObjects-Dev 
>> Subject: Re: Best charting?
>> Message-ID: 
>> Content-Type: text/plain; charset=utf-8
>> 
>> I have also used jFreeChart.  
>> 
>> If you want to try it, see ERPChart and its subclasses in Wonder.
>> 
>> https://jenkins.wocommunity.org/job/WonderIntegration/lastBuild/javadoc/er/plot/ERPChart.html
>> 
>> Wonder makes it easy!
>> 
>> Steve
>> 
>>> On Oct 18, 2016, at 3:43 PM, Morris, Mark  wrote:
>>> 
>>> Hi Ken,
>>> 
>>> A few years ago I used jFreeChart, which was very easy to integrate. it has 
>>> factory methods for each type of chart that you throw your data at, lots of 
>>> customization options, and a variety of output formats. So for instance you 
>>> can just include a method that returns the image data and use that right in 
>>> your WOImage binding.
>>> 
>>> Good luck!
>>> Mark
>>> 
 On Oct 18, 2016, at 2:37 PM, Ken Anderson  wrote:
 
 All,
 
 I have some data that I’d like to be able to make HTML 5 charts from.  Are 
 there any decent tools for doing this with WO?
 
 Thanks!
 Ken
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/webobjects-dev/mark.morris%40experian.com
 
 This email sent to mark.mor...@experian.com
>>> 
>>> 
>>> ___
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list 

Slack is ....

2016-10-20 Thread Markus Ruggiero
... a complete waste (at least for me).

Slack is great for chit-chat but not for anything seriously technical. Here is 
an example:

There was a message from josefv on October 5th with a question about object 
qualification during a fetch. This question resulted in a very interesting 
technical discussion on how to solve the problem. hugi and samuel chimed in and 
presented a solution including great background info. The discussion was 
interrupted by unrelated messages and another technical question. 

I tried to follow the threads but soon got lost. I strongly suggest that such 
technical issues MUST NOT be discussed on Slack but must be CARRIED OUT ON THE 
MAILING LIST. Slack is not searchable, the threads are not followable, Google 
does not index Slack discussions (as far as I know). And most of all the 
discussion thread is not easily archived. 

Any mailinglist posting defines a discussion thread that can be followed and 
archived. I often remember that there was some discussion about an issue I have 
during my work and most of the time I can find the relevant messages in my mail 
archive.

What do others think? Is it just me? I may not understand properly how to work 
with Slack. If that's the case, fine, please enlighten me.

Long live WO !
(yes, I know, but anyway. Long live WO ! )

---markus---
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com