Behavior, Content, Money – 3 Things you should never give away for free!!!

BCmoney MobileTV

A closer look at Apache Mahout (JAVA Recommendation library)

Posted by bcmoney on April 5, 2021 in Java, Semantic Web, Web Services with No Comments


No Gravatar

There’s been a lot of changes to the Mahout library since it was first introduced through the Apache software foundation back in 2009.

I first looked at this project through the excellent tutorial on classifying and recommending Seinfeld episodes (perhaps not the easiest task of differentiating episodes, keeping in mind it was a show that prided itself on being “about nothing”). This really showed the strength of the suite of libraries and algorithms, which can be ranked and compared for performance and relevance more easily than ever in its current release.

Unfortunately, the folks involved in that project got a takedown notice to no longer provide the Seinfeld episodes’ full scripts that were being used to classify the episodes.

https://blog.trifork.com/2011/04/04/how-to-cluster-seinfeld-episodes-with-mahout/

Looking for another alternative interesting dataset, I’ve looked through the following commonly used public data sources:

Seems like I’ve settled on just “” for now, but will likely look at unique ways to combine all of the above at a later date.

The scope of the problem will start out fairly modest; given a list of 10 users with very distinct tastes, can we recommend relevant new music to them (either by specific song, or, artist) that they’re likely to enjoy. It’s not like this is a new problem area, but I do feel there’s not been much innovation in this space for a while since the early days of WebJay, RACOFI & MyStrands to the “middle ages” of Songza, LastFM & Pandora and now into the modern era of Apple’s iTunes/Music offerings along with Spotify & YouTube pretty much having a three-party oligopoly on both ad-supported streaming and paid digital music (whether pay-to-download/own or subscription-to-stream).

The premise of this effort will be, given minimal inputs about a user, try to chart out

Taking over a large-scale Adobe Experience Manager (AEM) project

Posted by bcmoney on April 19, 2017 in AJAX, CSS, Java, JavaScript, JSON, Multimedia, Web Services with No Comments


No Gravatar

Integrate PHP based SOAP RPS game server in another language, JAVA desktop GUI

Posted by bcmoney on February 23, 2017 in Gaming, Java, PHP, Web Services with No Comments


No Gravatar

Rock-paper-scissors chart

Rock-paper-scissors chart (Photo credit: Wikipedia)

Now that we have a Web Service ready to consume (even though it is SOAP based), it should be pretty easy to extend to Java, which also means it should be possible with a little bit of effort to create a Desktop GUI.

For more on creating a Java-based SOAP server to have an all-Java version of this solution, see:
https://netbeans.org/kb/docs/websvc/jax-ws.html

 

 

See the other parts here:

Exposing your PHP Rock Paper Scissors game via SOAP Web Services

Posted by bcmoney on January 14, 2017 in Gaming, PHP, Web Services with No Comments


No Gravatar

Rock-paper-scissors chart

Rock-paper-scissors chart (Photo credit: Wikipedia)

So why SOAP? Well quite simply this was what I used back when I was first working through PHP and learning the hard way how to expose some server-side “business logic” as a Web Service. This was over a decade ago (late 2006 through 2007), and Google’s SOAP Search API had yet to be phased out, and was still one of the biggest reference implementations of SOA principles. In all truth I’d almost never use SOAP for creating Web Services from scratch anymore, but it does have a few minor advantages in niche cases thanks to ws-security, SAML integration, well-formed response guarantee via schema validation, contract-first development for more stability amongst separate inter-dependent departments/organizations, etc.

I decided to dust this example off simply to have a historical reference of traditional SOA while moving a number of legacy APIs I support to RESTful architecture (since REST is the clear winner and most APIs I need to work with today are REST based anyway).

So this example will serve as a useful tool to go back and review every now and then, especially if your consulting ever takes you to an enterprise gig that still uses legacy SOA technologies (and yes despite REST taking over 6 years ago followed shortly by JSON replacing XML, there are still a decent amount of SOAP-based WS deployments out there at big companies, the kind of big enterprises with big budgets at stake and/or political reasons to keep their legacy technology stacks running). REST/JSON may have won the internet thanks to its simplicity, but there’s something to be said about what the various organizations that came up with SOAP and the ws-* stack had in mind (aside from complexity and lucrative implementation contracts/tooling sales), namely robustness and predictability. Take Netflix and YouTube for example, two of the most frequently called APIs on the web, both “RESTful-ish” but each taking their own liberties with Fielding’s original REST thesis in unique ways, particularly around Auth mechanisms and Usage Policies required to work with the data, DRM, Advertising, somewhat creative usage-restricting API metering, and/or pay-per-use schemes that come into play as soon as you want to do anything serious with the data, and both have suffered their developer communities significant amounts of non-backwards-compatible disruptive versioning, changes and feature deprecation.

Endpoint
The following enpoint is where you can make requests to initiate and get responses from specific operations being exposed by the SOAP Web Service:
http://bcmoney-mobiletv.com/widgets/games/rps/soap

In our case just a ServerTime check, GameScore check, GamePlay to initiate a game (but lots of other operations could potentially be added to this such as Leaderboard tracking by username or region, Multiplayer game listings to show available competitors, etc).

 

Web Service Description Language (WSDL)
This is the “contract” part of SOAP that tells SOAP clients how to interact with our Web Service. In general, you can reach the WSDL of a SOAP-based Web Service:
http://bcmoney-mobiletv.com/widgets/games/rps/soap?wsdl

A useful tool for validating your WSDL is the W3C WSDL Validator service.


XML Schema (XSD)

I’m a big fan of keeping the same basic format between requests and responses rather than many Web Services out there with vastly different request and response formats. This just creates unnecessary work writing (or annotating/generating) distinct XML parsers.

Request format:

 <rps>
  <game id="1234">
    <player id="1234#p1">
      <choice>PAPER</choice>
    </player>
    <player id="1234#p2">
      <choice="SCISSORS</choice>
    </player>
   </game>
 </rps>

Response format:

<rps>
    <game id="1234">
        <player id="1234#p1" outcome="WON">
            <wins>5</wins>
            <losses>4</losses>
            <draws>2</draws>
        </player>
        <player id="1234#p2" outcome="LOST">
            <wins>4</wins>
            <losses>5</losses>
            <draws>2</draws>
        </player>
    </game>
</rps>

Notice how only the data underneath the player element changes between request and response, and the two formats are virtually identical.

For more easily visualizing WSDL’s available operations and the data formats within each operation’s response check out the XML Grid – XSD/WSDL Viewer service.

Check some of the classic SOAP API examples that are still around today including Amazon’s Product Adveristing API (WSDL) which I’ve previously used as a product data source in my XmasListz Facebook App or the WebServiceX Currency Exchange API (WSDL) which was used in my post on how to work with SOAP in JavaScript & jQuery.

See the other parts here:

Raspberry PI – Alexa PI experiment

Posted by bcmoney on September 3, 2016 in IoT, Mobile, Web Services with No Comments


No Gravatar

Turn your Raspberry PI into a fully functioning Alexa (either by literally calling Amazon’s Alexa APIs, or, calling a variety of services in specialized areas as a stand-in).

BC$ = Behavior, Content, Money

The goal of the BC$ project is to raise awareness and make changes with respect to the three pillars of information freedom - Behavior (pursuit of interests and passions), Content (sharing/exchanging ideas in various formats), Money (fairness and accessibility) - bringing to light the fact that:

1. We regularly hand over our browser histories, search histories and daily online activities to companies that want our money, or, to benefit from our use of their services with lucrative ad deals or sales of personal information.

2. We create and/or consume interesting content on their services, but we aren't adequately rewarded for our creative efforts or loyalty.

3. We pay money to be connected online (and possibly also over mobile), yet we lose both time and money by allowing companies to market to us with unsolicited advertisements, irrelevant product offers and unfairly structured service pricing plans.

  • Archives