More coming soon ….

Our bad….we’ve been terribly busy w/ “side s#it” Rest assured dear reader. We ain’t stoppin’ …. once we get back up on that pony we’re gonna ride ‘er into the ground…and you can take THAT to the [federal reserve] bank! lolzorz. much love, -c [publisher, TSP]

Please support our generous sponsors so we have more time to devote to the content you love to hate..err…hate to love …you get the idea ….


Let’s play…I mean…create a prototype ’13’ deck aka Korean Poker!

If you are like me you played this addictive game at lunch, on the bus, during class…whatever you played it constantly because it’s seriously fun and a great way to pass the time. At Capo Valley, we loved this game because it was winnable even if you were dealt a shitty hand, the game encouraged a great deal of shit-talking and merriment. We’d also enhanced it with “insult rules” such as, while dealing, you throw a few of them face-up, just to piss off whoever you want to piss off. It also lended itself to so much cheating that we overlayed a rule; “If no one saw it, it wasn’t cheating.” Technically that is true in the absolute…the difference is that we encouraged cheating because it added more layers of fun, strategy, dexterity, options to win…the perfect game for college-prep band geeks who think to much and are fiercely competitive.

Common ways to cheat when you re the dealer is place a card you want on the bottom of the deck, dealing, 13 cards to each player beginning with west, you get the final card. Desirable cards include the 3 of clubs (whomever holds this card goes 1st…it is much like other games where whomever runs out 1st wins, going 1st on a good hand could end it). The ace of hearts is valued – any run ending in this card is unbeatable (thus you get to go again). Likewise, the 2 of hearts is valued for being the highest card – it is not unbeatable (a two-killer is a double-run-of-three such as 4,4,5,5,6,6) but it’s always nice to have, especially late in the game when most pairs and runs are likely to be all down. Another great way to cheat it to simply hide a card (or two, or more…) wherever you can hide it. The best place seemed to be under the left thigh or up my right sleeve. Another “layered” rule is that if you are caught cheating you forfeit the game (and winning if gambling is involved) – simply trying to look at other people’s cards is another surprisingly easy way cheat.

I won’t waste time with any more specific rules…most of you have never played it…still, the f-ed up ways to mess with the game applies to all of them (and that only scratches the surface) and you can apply the tenets and ideas in this post to YOUR preferred card game.

On topic – I’ve been brushing up on mu Java programming again so as a thought experiment I began to build a “Card” class (ADT, data-type, etc). Once I got that to work I decided to test it by creating an array (a list) of them and ordering them in the exact order they would go in 13. On higher level of this project are the following:

  1. A Deck Class
  2. A 13 Class
  3. A user-interface for the game itself

For now, I simply used my Card data-type to see if I could use a nested-for loop to populate the deck with cards as they from low to high in the game of 13. Software Engineers know that regardless of language, arrays begin at zero. In an object-oriented mode, I decided that “zero” had so little to do with cards/decks/card-games that I would use a place-holder for it. What else is not used…I mean…in actual card games? For most; the Joker(s), so in the interest of something w/in striking distance of elegant design; (in pseuodocode) 0=(string)”joker”
The following is the output from a Deck prototype, which hints at an actual 13 prototype, which is a thought rxp[eriment for the future…particularly the design of three players who can strategize against me…and..on an absurd level of abstraction…try to cheat me if the opportunity comes up and allow me to cheat the non-player-characters.

Below is the successful output from the v0 prototype of a 13-Deck
run:
whomever gets the 3 of spades goes first.
The following list will create a deck of 52 cards in ’13’ order
1. created the 3 of spades
2. created the 3 of clubs
3. created the 3 of diamonds
4. created the 3 of hearts
5. created the 4 of spades
6. created the 4 of clubs
7. created the 4 of diamonds
8. created the 4 of hearts
9. created the 5 of spades
10. created the 5 of clubs
11. created the 5 of diamonds
12. created the 5 of hearts
13. created the 6 of spades
14. created the 6 of clubs
15. created the 6 of diamonds
16. created the 6 of hearts
17. created the 7 of spades
18. created the 7 of clubs
19. created the 7 of diamonds
20. created the 7 of hearts
21. created the 8 of spades
22. created the 8 of clubs
23. created the 8 of diamonds
24. created the 8 of hearts
25. created the 9 of spades
26. created the 9 of clubs
27. created the 9 of diamonds
28. created the 9 of hearts
29. created the 10 of spades
30. created the 10 of clubs
31. created the 10 of diamonds
32. created the 10 of hearts
33. created the J of spades
34. created the J of clubs
35. created the J of diamonds
36. created the J of hearts
37. created the Q of spades
38. created the Q of clubs
39. created the Q of diamonds
40. created the Q of hearts
41. created the K of spades
42. created the K of clubs
43. created the K of diamonds
44. created the K of hearts
45. created the A of spades
46. created the A of clubs
47. created the A of diamonds
48. created the A of hearts
49. created the 2 of spades
50. created the 2 of clubs
51. created the 2 of diamonds
52. created the 2 of hearts
*QA test* The highest ranking card in 13 is the 2 of hearts
BUILD SUCCESSFUL (total time: 0 seconds)

It works! Created using the Netbeans IDE 8.0.2 on a win8.1 box using the Java SE 8 or Java 1.8 as I call it. SRC follows:

package card;
/** WIP - create a card ADT and enumerate it into a deck
* per "13" rules aka Korean Poker
* @author Tapper7.com last stable build - 12/15 &c ssstudios, los angeles, ca
*/
public class Card{
int suit;
int rank;
Card(){
this.suit = 0;
this.rank = 0;
}//null constr
Card(int suit, int rank){
this.suit = suit;
this.rank = rank;
}//fully-formed constructor to be used when a new card is instantiated
public static void showCard(Card theCard){
//cards are ranked as they are in 13 aka korean poker
//"jokers" hold null memory space so we arent using zeroes
String[] s = {"joker", "spades", "clubs", "diamonds", "hearts"};
String[] r = {"joker", "3", "4", "5", "6", "7", "8",
"9", "10", "J", "Q", "K", "A", "2"};
System.out.println(r[theCard.rank] + " of " + s[theCard.suit]);
}

public static void main(String[] args){
//create an array of cards
Card[] mydeck = new Card[54]; //array is oversized for debug
mydeck[0] = new Card(1,1);       //initialize
//test that the lowest card is created correctly
System.out.print(“whomever gets the “);
Card.showCard(mydeck[0]);
System.out.println(“goes first.”);
//populate the 13 deck in order fro m low to high
int currentCard = 1;
int suits = 1;
int ranks = 1;
System.out.println(“The following list will create a deck of 52 cards in ’13’ order”);
for(ranks = 1; ranks < 14; ranks++){//outerloop the ranks from 3 to 2
for(suits = 1; suits < 5; suits++){
mydeck[currentCard] = new Card(suits, ranks);
System.out.print(currentCard+”. “);
System.out.print(” created the “);
Card.showCard(mydeck[currentCard]);
currentCard++; //increment deck position
}//end inner loop
}//end outer loop
//test that the algorithm put the highest card in the correct index:
System.out.print(“*QA test* The highest ranking card in 13 is the “);
Card.showCard(mydeck[52]);
}//end mn
}//end prototype
thanks for stopping by! and now [below], a word form one of our sponsors

fb compatibility test….

a picture of paris at dawn or dusk with the words hashtag pray for paris inscribed over the skyline and signed by chris welke

as we cycle through the changes to style and funtion; dear reader; I wanted to share with you an editorial I piced together in the immediate aftermath of the tragedies in Paris. I snapped 15-odd shots from around social media to show how quickly/disturbingly hateful invective against Muslims was growing. At the moment I put this commentary together and shared it on fb; HATE itself was going viral. My intent was alert my “real-life” friends…ask them to keep an opn mind that they not fall prey to the fear-mongering, hate-mongering, monger-mongering…u get the idea. as much as “dislike” (note — didn’t take bait to be hypocrite and say I “hate” fb; even though technically I do and technically that’s ok w/ this writer morally because fb is a corporate-adevertising-agency-subdivision-og-google-and-not-a-person;….there ok to hate fb) Facebook, I like the way they package prose that has a great deal of pics to illustrate it.

What i’m getting at is…as long as we are “under-construction” I will audit my privacy level on fb, so how well MY fb page can communicate to you VIA The SoCal Picayune…and as always, give the “handshake” between my fb & my wp a check-up.

<h2>wp post: fb–we’re going start with the usual checkup, just cough while I put my finger here…

your browser: *coughs* link to post that may or may not be public–coughing from

“fb Chris Welke #9” aka /facebook.com/chris.welke.9/* TEST!

Coughing TO: you@your_ip using your device, os & browser.

prediction – you will not be able to read (10/18) due to privacy setting on fb

WIP – find a way to embed or mimck a fb “story” of this nature in WP & || customize privacy setting to make stories initially written in fb jive with the site, so there is no rework when creative energy strikes, news breaks, or both</h2>

Ok my browser says you are using an older-model desktop PC, so go back to work dummy! This site is #nsfw, labeled “mature” in the meta-data and contains graphic depictions of truth; reality and (God forgive me) the above FB post; once you are able to read it; is political in nature. You’v beean warned 😉 –ed []

below is a test of another “mobile-freindly” multi-media-enabled advert, this once


Under construction alert ….

FROM THE PUBLISHER’S DESK — FOR IMMEDIATE RELEASE

Anonymous Reader, thank you for the bug report. It seems my .post style (the WordPress “text/css”) style— or the PHP… has an issue drawing content frames as of 10/18/15--column 1 is truncating on side two. If you are not one of my fellow code-geeks; plz ignore the geek-speak and just take note of the following:

DUE TO THIS BUG WE WILL BE FISHING AROUND FOR THE
OFFENDING LINE OF CODE THAT IS CAUSING COLUMN ONE
TO TRUNCATE PROSE AND CONTENT ON THE LEFT-HAND SIDE. APOLOGIES!

style.css & functions.php (& etc.php …er…etc…uh … are going to have the hood removed again; but I assure you the site is as secure, functional and jam-packed with original content as it ever was.
The Art Producer/Director of Self-Similarity Studios, Chris “Tapper” Welke; wants you to know that

“….the car still runs but the she may look like s#it while we are
under construction”>

Lonely Faction Production and SSStudios retain a policy, if you were not aware-
(From our SOP’s ref# ch.2_sub_sxn_5_article19_volume_7)–

Tapper7.com aka The SoCal Picayune remains open during construction. No exceptions.

typesetting, fonts, pictures, background colors, colors in general, text-boxes, titles, widths & heights…they are all subject to change and may in some cases. look “bad.” or “weird.”
if I learn anything new while I publicly make changes (no worries about the content itself– the site is backed-up frequently) I will report any tips, tricks, how-to’s & hacks ‘should any present themselves,’ we find a gem or just find dumb luck

    Bottom line

Tapper7.com and all associated sub-categories of this site are subject to looking weird, then bad, then worse, then bad again, then ok, then sorta “meh,” then “; ok that looks original and is readable regardless of the reader’s manufacturer(HP, IBM, Apple….), device type (desktop, laptop, tablet, phone, ipod) OS (MAC OohSX.?, Windows, Chrome, Unix, Linux) or browser(Chrome, Safari, Firefox, Opera….)
Please excuse our “dust” — by dust I mean – a live site that isn’t as aesthetically pleasing as you….treasured reader, are used to it being.

along those lines; it is important to keep all my content up 24/7/365(6) (shutout to host sponsor: (mt)) because we get waves of readers here at the home office. For some reason; a few thousand extra of you guys stopped by yesterday, what were you all reading? perhaps one of my diatribes made it to fb, digg, pinterest or some other sm nonsense page. my analytics will get to the bottom of this (shoutout to analytic & ad-serving, legitimacy-proiding sponsor Google)

In honor of the ‘praised advertising behemoth;’ (yeah right…this just a test–period).  here is one of their approved ads – it may or may not display correctly or at all, who knows….we’re under-construction, man! *ahem* “test footer-style, multi-media-enabled-modile-friendly ad in the frame provided; thk you that is all” – t

Another full redesign is in-process *Caution* Man working ….

I’ve decided to strip down the style and design of the site again. I’ve only just now (after a week on & off) felt satisfied with the new albeit temporary…presentation of this particular node on the Web.
I’ve written a heavy amount of PHP and CSS again, though they are not technically “programming languages” per se, they ARE subject to almost as many quirky dependencies, rules unique unto themselves; which are inviolable and require extensive research and testing to deploy. Hopefully you will find the site a bit more pleasing to the eye, faster, more secure, more responsive and easier to navigate.
In the meantime it is only fair to announce that we are officially “under construction,” so if you see something strange over the next few days, that’s my fault…. I’ve tested about half the “use cases” (things you might do, read, watch, listen to, click on or use in some form or another). Earlier today, the music uploaded to the private section of the site and the archived prototype podcasts vanished, they were unplayable due to bad PHP writing on my part.
I’m 90 percent sure you can watch all videos, listen to all music, podcasts, read all posts, view all artwork/snaphots/pix, read my stories, search the site, click on links and find the content you are looking for easily, quickly and regardless of device, OS, browser, ISP and service type (4g, 3g, WiFi, Ethernet, Cable, DSL …..). Before I drift off tonite, You can be certain that all of the “common use cases” are functional and that within a week, the lesser-used functions (commenting, guest-posting, all sidebar tools) work exactly as you’d expect them to.
Still on the to-do list is MORE formatting and design of the 2015 style and theme…. an audit of all media on the site (delete unused pictures, audio, video, dead links and raw text-data) an audit of all advertisers being served via Google AdWords to ensure compliance with our ethics and MY morals plus an audit of page-load speed. This will include a further dress-down and rewrite of JS, CSS, HTML and PHP. *Phew*
Thank you for hanging with me throughout your tenure as a reader! I’m working on some devastatingly interesting podcasts, stories, news, editorials….and maybe even a decent joke. No promises about bringing the funny, but you KNOW I always try!
For those about to waste time on the Web at The SoCal Picayune (or whatever sites you’d rather NOT acknowledge… “WE SA-LOOOOOT YOU!!!!!!!!!” -Ed

In the meantime, for testing and shameless promotion why not check out one of my soon-to-be-audited, yet generous sponsors? If the redesign is going well, an advertisement will display below, if you visit them, you help to support the site and me personally a great deal–no obligation to do so, or even to LOOK at one of my ads. As part of a long-term promise, there is nothing for sale on this site, so when I hint-hint-wink-wink-wink-nudge-nudge ask you to check out a sponsor I am NOT endorsing their product or suggesting that you spend a penny. A few seconds of your time however…I must confess, I do suggest as an easy way to support those who keep the site running, the hardware it runs on and the crazy publisher that does WAY more work on it than he should. *Ahem* wink-wink-nudge-nudge -From the Publisher’s desk with love, C “T” W


How to remove unwanted footer display and links in WP (and PHP, HTML) ….

This is a rehash of a previous how-to, but now that us WP “developers” have updated to v4.3….some of the unwanted PHP scripts and other junk may have returned to our sites. Let’s fix it fast–right now! In my case I prefer to get rid of the footer materiel that plugs a) the theme OP creator and b) WordPress itself. Why do we ditch PHP scripts that form the backbone of what the audience sees when they go to our-self-aggrandizing-website.com?

  1. Personalization – my site should contain MY approved content, especially links to 3rd parties
  2. Ownership– no one needs to know that my site is “powered by” ANYONE except ME, my associates and (mt)
  3. Control – anything viewed on my site NOT expressly approved by the publisher is unprofessional
  4. Anonymize – no one needs to know (or cares) that The Picayune runs WP or it’s reliance on a PHP template

Let me elaborate on Ownership – this is MY SITE! MINE MINE MINE! Pride is NOT a sin in the creative and technical world, 3rd party link-stingers at the bottom of my pages say, “you may enjoy this site but REAL credit goes to the open-source Web development firms that wrote some code running in the background.”
^^^^ F— them. The publisher built this site from nothing, the publisher
bashes his head in over every post and pixel, the publisher marketed the content and developed a loyal audience….THE PUBLISHER obeys all US Media Law and applicable media ethics…THE PUBLISHER creates original, rich, deep, informative, occasionally funny content… THE PUBLISHER was approved for Google Adsense almost a year ago. NOT WORDPRESS and certainly not a theme developer who’s code only loosely applies to what I still call “The Socal Picayune WP Theme 2015.”….so now that we’ve made updates, let’s try a quick how-to on what I call “WordPress footer anonymization.” Last time we had to re-write the “<>” (HTML & PHP browser directives) to “[]” as the “code” markup in WP 4.1 (or was it 4.0?) would glitch out, the WYSYWIG interpreting the brackets inside as real, despite the fact that the “code” (I’m still weary of using brackets for that word till the following test….) ostensibly tells your browser – “The following characters are all plain text – display them AS WRITTEN” — return to normal HTML when “/code” appears. For HTML beginners, this is the same as a bold command in a word processor. In a markup language a directive tells the browser what to do with incoming strings of text. Here is the simple example:

BOLD
— the rough equivalent of [strong] BOLD [/strong] –or– (b) BOLD (/b) ….again I’m using arbitrary beginning and ending brackets instead of “<” and “>” so as not to confuse the post the site will generate. Essentially in markup symantics, the directive %strong% indicates a change to the input string; the %/strong% (<—note the fwd-slash) indicates it is over. Ok…let’s give this a try… If WP 4.3’s WYSYWIG editor STILL bugs out on the “code” markup, I will post a snapshot this time instead of replacing all the greater-than & less-than symbols with ‘[‘ & ‘]’sTEST! 

  1. Dashboard –> Appearance –> Editor –> open footer.php
  2. Make a local backup copy of “footer.php” in case you screw it up
  3. delete or comment out the code snippet pictured below
  4. Update file (this will recompile the site with updated PHP script)
  5. Visit site – (for QA/QC)

*UPDATE* “code” does not work w/in a WP post – It’s likely that the markup itself is followed by another markup using the less-than ‘<‘ sign – this exception is either not coded into WordPress’ WYSYWIG editor or fails on the front-end of common browsers. I really don’t have the interest to solve this, so here is a snapshot of the code I removed:

//coment_out or delete

Let’s note what I removed in ditching the above:

  • A banner link to WP.com (or .org….)
  • A banner link to another webdev’s site

Let’s note what I DID NOT remove* (you won’t want to either. Directly above the call to a footer class, there is this command – “…do_action(‘generate_after_footer_widgets’);?> This fuction will return widgets embedded at the bottom of the page; MY content, so it stays. In my case, currently there are three footer widgets here– a plug for my fledgling podcast, links to other pages on the site and a calendar.

This test was successful on previous versions of WP v4 and is currently working no problemo on WP v4.3 running on a reliable server courtesy of Media Temple.
If you find the content here informational, entertaining, laughable or get SOME form of enjoyment out of it, you’d be doing us all a great big favor by checking out one of our generous sponsors. As always, there is no need to buy anything…not from me or any site plugged by me ever, but browsing Google Adwords-audited sponsors is of no danger to anyone. A banner ad may or may not appear below – the WP 4.3 testing continues….

Here is a less Object-Oriented example…this Stylesheets’s “original” author, or OP as I called one above, wrote so much unwanted junk AND script-kittied (nee plagiarized) so much of other’s that he mentions it’s “OK not to link to my site in the footer, but credit appreciated.” Sorry…. f— his “credit” take a look at the code:another footer removal example

Ok so as a courtesy you can see some names were changed and the Web site is bogus. Exercise: What PHP and HTML can we safely comment-out or outright delete?  To give you a hint this code will generate the following at the bottom of your page:

BlahBlahhoohooblahh 2015 WordPress Theme by www.someUnwantedBacklink.com Another Boring Theme

(another thing worth noting is that function ‘.date(“Y”)’ in this case will read the date from your computer, extract the year as a 4-digit integer and print it using the style defined for <p> in the stylesheet, I say this because it may not be 2015 when you read this and I don’t want to confuse anybody)

Ok…..ready? Here is a KISS-simple solution to wipe out all that nonsense (or rewrite/replace it with your own…link to an associated page or your client, whatver’s clever, You strip this down to:

</footer> </body> </html>

TaDaaa!

Is any of my content helping? If so…could do me a solid and visit one of my generous sponsors? I could really use the help. You don’t have to buy anything….that is part of The SoCal Picayune, Self-Similarity Studios and Tapper7.com promise: ads are clearly labeled, separated from site content and no financial obligation is ever expected of audience members. That said ….

*A note for beginning front-end developers: If I need to tell you why >? was not deleted, this is perhaps too advanced a tutorial – be careful not to remove /body or /html at the end of the file — again — make a BACKUP before changing HTML/JS/PHP etc. inside your page or it could be kablammo; you won’t destroy the site, but you WILL take it down and need to FTP as an administrator and swap out the PHP file to get your site back up. Unless you have unrestricted access to the backbone of your site … this will lead to a call for tech support from GoDaddy or whomever you use…and who the hell knows how long that will take? Learn as much about PHP, FTP, mySQL, HTML, CSS, JS and common contruction tools like Website Builder, cPanel and WordPress if you are a small operation – it will save you time, $ –and trust me it’s NOT COMPLICATED. These are not programming languages, they are scripts and applications – if you can put together a mean-looking Power-Point; you can do this!).
More posts, stories and podcasts coming soon, -t. []

Tapper “goes live” on MuseScore.com ….

Tapper's arr. of F Tuning...likely by Jack Meehan originally.

On a whim; we whipped up a quick and dirty transcription of Larry Shane’s epic Soprano lick from Concord’s 1991 program “Conversations in Jazz” —- used MuseScore v1.3 to create it not just for Bb trumpet but for Soprano Bugle in G for historical and nostalgic reasons. We were satisfied enough with the transcript to publish it live on the open-source software project’s official website . The file unexpectedly began trending immediately, despite it being essentially just five or six bars of only two voices IN UNISON, so an executive decision was made to arrange a longer, more fun to listen to track with at least a seven part harmony and an obscure key. “Relm’s Theme” from Final Fantasy III on the Super Nintendo was chosen, again, for nostalgic and historical reasons. We put a great deal of time into that arrangement and it is trending as I write this. Tomorrow people will listen to it in their cars on their way to work, In the park or on the Metro – or maybe with their favorite beverage. More iTunes playlists will include the work of this writer than ever before — so another executive decision was made to release “Lux Aeterna” which is VERY VERY MUCH an experimental WIP AND an innovative from-memory transcription-reboot of “SCV” the Bass Line beat The Santa Clara Vanguard plays as they “troop the line” on the track following a show. It is unknown to me whom actually composed “SCV” so default credit was given Ralph Hardimon and shoutouts to Murray Gussack, Jim Casella, (you can find them @Tapspace — total coincidence about the “Tap” thing — funny how things work out, Thanks again Skare ol’ buddy! Your gifts to my life are truly boundless) Mike “Eppy” Apodaca, Myron, Gail and every SCV Bass Line Veteran in existence.

Due to the unexpected and humbling success of taking these tracks live (listens and downloads are growing geometrically giving them potential to go viral) I dug around for my “Thumbs Up” arrangement which you can easily locate, read and listen to in 33-part harmony here on this site, but the original project file is toast, so I’ll have to rebuild it from scratch — we upgraded to version 2.0.1 today which contains tons of enhanced functionality so my arrangement of Jack Meehan’s famous on-field warm-up “F Tuning” (which is technically C tuning C-C5-Ctriad-FM-GM-CM rpt 3x …crescendo, layer and build from downbeat to cutoff + an “amen” double C’s and at least one triple E …hehheh…you know….)

Anyhoo, srsly check this shit out you guys! I’m really proud of the Relm arrangement and confidant I put enough legwork in to make it legally AND ethically ok to publish (if it were not – I WOULD NOT; per SPJ Ethics Code and applicable US Copyright Laws) In this writers legal opinion, as the track goes through CPI and if it continues to trend, I may be asked to monetize on behalf of SQUARE-ENIX and the original composer – Nobuo Uematsu. I’m happy to do that. I worship their games and his music. I seek no financial gain in this venture. I’m arranging and transcribing music because it is intellectually and artistically fulfilling + I remain an insatiable attention whore…hence “we” are quite optimistic and excited to explore the potential of MuseScore v2.0.1 tomorrow and hopefully upload v2 of “Relm” w/in the next two days. If the html they gave me works – it will embed below. If not, just go to MuseScore.com and look me up – you know what to search for – v2 will also be featured in the next Tapcast (also doing unexpectedly well on iTunes) along with a true story that will either fascinate you or convince you beyond reasonable doubt that I have officially lost my fucking mind. Much love to my regulars and visitors…now put your damn headphones on, listen to the track and get back to work, ok?….and try the veal – don’t forget to tip your waitress. Srsly lolzorz, -t

Relm’s Theme from Final Fantasy III arr. Tapper by Tapper7

Postscript: since the embedding does in fact work – plz forgive the typo A-relative minor, NOT A# –as much qualms as I have about B-flat, A-sharp does not completely exist in my world. #AMIRITE?

More fun with Java 1.8 -ASCII “Art” 101 using Arrays….

This is the type of assignment I would hand out to first year programming students. After introducing the idea of lists, I implore them to solve the following:
Use a list to build an ASCII pyramid using the character of your choice and make it: a) appear “pyramidal” that is, no leaning, no right-angles at the base and give it some semblance of aesthetic quality b) your logic should generate EVERY level of the pyramid, that is, no coding “special cases” for the top, middle or bottom rows. The logic must hold sound to construct the entire pyramid as a stand-alone algorithm. c) print your src (source code) and the output of your program to prove to peers that it works.

    This task requires careful dissection of the elements involved:

  • variable number of rows
  • each row knows how many spaces to print and how many characters
  • this involves logical analysis for the left spaces, the chars AND the right spaces
  • The algorithm must know when to “endline”/”newline”/
  • Careful analysis and monitoring (QA/QC) of the variables during runtime may be needed

For the seasoned programmer this is fairly basic, but involves core mathematical concepts, an element of basic aesthetic design and a good grip on list variable storage; how they are both computed and sent to an output stream (System.out in this case) This is the rough equivalent of “cout <<” for you C/C++ guys

    For extra credit:

  • Add a user-interface to ask the user how big to build the pyramid. Include exception-handling for pyramid sizes that are not technically “pyramids” (height = 1 is not a pyramid) heights too large will lose their aesthetic, or their pyramidal structure entirely if built too large or too impractical for the user’s display. (I capped mine at 50 rows) – add warnings depending on the user interface).
  • Decorate the pyramid with one or more random characters in addition to your “foundation” block (I used hashtags for my foundation block).
  • Invert the pyramid.
  • Stack the pyramid atop the inverted one to make a diamond shape…make sure it lines up evenly. No bumps or other strangeness in the middle.

Here is a sample solution; note that I carefully tracked line size, space, building-block-count, row-count & the storage of each…this is crucial to accuracy and QC testing during development time.
This is an acceptable output:

a snap of the pyramid program in-process using the Netbeans IDE
seen w/in the Netbeans Integrated Development Environment. “I design them.”

 

Here is the source code – note brevity in my solution– ~20 lines-ungolfed!:
/*
author: Chris "Tapper" Welke
This program generates an ASCII-art 50 row pyramid using hashtags as a building block.
Solution provided for instructional/informational purposes in the areas of lists,
integers, type-casting, dynamic memory allocation, and open-source programming. If you
are new to Java, this is an excellent trial pgm to get you started.
Dist. under the GNU Public License. Free to distribute: please attribute though, ok?:
Last Stable Build: 5/23/15 at Tapper7.com and Self-Similarity Studios courtesy
The Netbeans (Netbeans.org) IDE, Java 1.8 and the std. javac compiler
OS: Win 8.1, Chipset by Intel. Laptop by Hewlett-Packard. Website provided by Media Temple
*/
package learn;
import java.util.Arrays;
public class HashTagASCIIPyramid{
protected static int charlinelength = 100;
public static void main(String[] arg){
float[] asciiStorage = new float[HashTagASCIIPyramid.charlinelength];
int totalHashtags = 1; //initialize builing block total
int charCount = 0; //count building blocks for QC testing
int[] cclist = new int[100]; //record the char generation as it happens
int leftspaces = (int)asciiStorage.length/2;
int rightspaces = (int)asciiStorage.length/2;
int height = 1;
for(int i = 0; i < asciiStorage.length/2; i++){
for (int l = 0; l < leftspaces; l++){
System.out.print(" "); charCount++;
}
for (int t = 0; t < totalHashtags; t++){
System.out.print("#"); charCount++;
}
for (int r = 0; r < rightspaces; r++){
System.out.print(" "); charCount++;
}
System.out.print('\n');
/*QC Tracking: height++; cclist[i] = charCount;*/
leftspaces--; totalHashtags +=2;rightspaces--;
}//end mn loop
}//end mn
}//end class #asciipyramid

Hints: I used space-fillers for the spaces (” “); – left and right brackets plus lots of variable outputs to see what was going on during run-time, my initial design yielded the following output:
run:
pyramid test1
WHOOPS!
Heh…so clearly there were multiple logic faults, (and I started with tildas, not hashtags….) but it was easy to track the movement of the left and right brackets that debugged the left and right SPACES and not shown are my debugging outputs that checked the length of each row for consistency(it was going over and under 100 – keeping the length of each row equivalent was key to my particular legitimate solution)— also that my iterators and arrays were misplaced and thus not controlling and the output correctly.

    Keys to victory:

  1. increment blocks by TWO; not one
  2. decrement spaces and increment blocks OUTSIDE the main loop rightSpaces--;leftSpaces--totalHashtags+=2;

Coming soon: Bill’s adventures at Los Alamos, More Netbeans experiments, tutorials and anything interesting that happens when I have my camera on me.

Lots of great ideas in the works…and let us not forget: Summer is Coming …. Go Santa Clara and Concord! Support your local drum corps by playing bingo, going to shows, donating your time, tailgating at shows and screaming your lungs out when corps brings you to it on the Field of Honor. All signs point to a another stellar season for Red and Blue Banners both; and I wouldn’t have it any other way (scratch that….I’d resurrect Bridgemen, Suncoast, Big 27, Star, Kingsmen, The Freelancers and The Velvet Knights) THEN it’d be roll-out time.
Under the circumstances, putting all politics aside; Thank God for Rosemont, Rockford, Madison, Garfield, Bloooooo, SCV/BD, Cru, Spirit and all other remamining “Big Time DCI” corps still in the hunt, still rockin’ it…gettin ready for the only kickoff I really care about: Memorial Day Weekend. A trial by fire where those who make it through will be ready for the best summer of their lives. Hang in there kids, you got this!
Music, Tech, Art, Love and Life; find it all right here at The SoCal Picayune. Your LA/OC home for Drum Corps, Culture, tech-security, experiments and solutions, the occasional off-color joke, scam-hunting, YT highlights and the best (and worst) direct from the minds of this writer, Tapper and Bill Feynman.
Maybe a Memorial Day Anecdote will inspire itself as we begin the approach. hmmmmm…..
[] Support my sponsors! All are reviewed regularly for legitimacy by the Senior Ethics Auditor: moi

The Binary Power Series and Java 1.8 ….

A numeric depiction of 18.44 Quintillion

Series follow a specific pattern and obey explicit, ineffable rules, like prime numbers….
1, 3, 5, 7, 11, 13, 17, 19, 23…. Or a times-table such as 9…. 18, 27, 36, 45, 54, 63, 72, 81, 90, 99. You get the idea, right? (I hope so or you’ll find this post incredibly boring).
Computers store information in bits. A bit is one memory cell that is known by the CPU to be TRUE or FALSE, one or zero. In the parlance of electrical engineering, this equates to either “very very low voltage” or “hardly any voltage at all.”
A byte is eight bits: 0000 0000 thru 1111 1111; 1-256

Consider 0000, 0001, 0010, 0011, 0100, 0101, 0111, 1111 -OR- (in English) one, two, three, four five six, seven, eight. To be literal, it’s actually zero through seven, but let’s not get muddy the waters or scare off any readers due to the “maths.” You don’t need to know much math to understand this information…. So a computer needs half of one byte in order to express “seven” to the world “1111.”

Eight bits comprises two to the eighth power (256) possible binary combos. That’s enough to create a color palette acceptable to the human eye, In RGB-space, three eight-bit numbers (0,0,0) being “K” or Black and (255,255,255) being White – or is it vice-versa? You can always go to www.org for quick reference on non-abstract, “code flavors” such as the above assertion. Ok, so three SETs of 256 bits can broadcast “Game of Thrones” on your laptop screen adequaetely. This is what makes 64-bit machines so exciting…64 is a small number….2^64 (which is the definition of a 64-bit sys) ACTUALLY equals about 18.5 QUINTILLION, or 18.5 x a trillion x a trillion. To give you an idea of size…if you started counting as fast as you could from the time you could speak…or comprehend it and count in your head; if you lived an avg. lifespan (~72.9 yrs) you’d be spitting out “one billion” with your last dying breath. A 64-bit system can express and count to a billion in fractions of a millisecond. So what concerns us about this TODAY?
With big data (all the rage) comes big numbers, so I’ve been thinking about them and toying with the limits of large number calculation and output using my laptop’s on-board calculator…it can express a google correctly using a semi-correct scientific notation: “1.e+100” –by that, Microsoft means to say “a one followed by 100 zeroes.” I have no way of knowing HOW they arrive at a correct answer to 10^100 considering that the largest unsigned long integer that can be stored in one memory cell by a 64-bit system is stated above..”a 1 followed by 19 numbers” … this means the Calculator App you use combines multiple long integers and uses extra memory to store anything above 2^64 = 18,446,744,073,709,551,616.

Using the Netbeans IDE, I created a program that asks the user to provide a number to act as a power of two. It then calculates and prints the subsequent results to the screen. Integers are preffered because they are fast, accurate and take up very little memory: 16 bits or 2 bytes, which can express numbers on the range of (-32678 to +32678). Integers (or “ints”) can ONLY BE WHOLE NUMBERS, that is, 1.5 is not an int, nor is e or pie or the square root of two.

Program output for common cases:
How many iterations of the Binary Power Series would you like to see calculated and printed?
0
Ok - you're the boss. No iterations--> no output
How many iterations of the Binary Power Series would you like to see calculated and printed?
1
Binary Power Series 2 to the power of 0 = 1
BUILD SUCCESSFUL (total time: 6 seconds)
How many iterations of the Binary Power Series would you like to see calculated and printed?
2
Binary Power Series 2 to the power of 0 = 1
Binary Power Series 2 to the power of 1 = 2
BUILD SUCCESSFUL (total time: 4 seconds)
How many iterations of the Binary Power Series would you like to see calculated and printed?
4
Binary Power Series 2 to the power of 0 = 1
Binary Power Series 2 to the power of 1 = 2
Binary Power Series 2 to the power of 2 = 4
Binary Power Series 2 to the power of 3 = 8
BUILD SUCCESSFUL (total time: 6 seconds)
How many iterations of the Binary Power Series would you like to see calculated and printed?
8
Binary Power Series 2 to the power of 0 = 1
Binary Power Series 2 to the power of 1 = 2
Binary Power Series 2 to the power of 2 = 4
Binary Power Series 2 to the power of 3 = 8
Binary Power Series 2 to the power of 4 = 16
Binary Power Series 2 to the power of 5 = 32
Binary Power Series 2 to the power of 6 = 64
Binary Power Series 2 to the power of 7 = 128
BUILD SUCCESSFUL (total time: 15 seconds)

How many iterations of the Binary Power Series would you like to see calculated and printed?
16
Binary Power Series 2 to the power of 0 = 1
Binary Power Series 2 to the power of 1 = 2
Binary Power Series 2 to the power of 2 = 4
Binary Power Series 2 to the power of 3 = 8
Binary Power Series 2 to the power of 4 = 16
Binary Power Series 2 to the power of 5 = 32
Binary Power Series 2 to the power of 6 = 64
Binary Power Series 2 to the power of 7 = 128
Binary Power Series 2 to the power of 8 = 256
Binary Power Series 2 to the power of 9 = 512
Binary Power Series 2 to the power of 10 = 1024
Binary Power Series 2 to the power of 11 = 2048
Binary Power Series 2 to the power of 12 = 4096
Binary Power Series 2 to the power of 13 = 8192
Binary Power Series 2 to the power of 14 = 16384
Binary Power Series 2 to the power of 15 = 32768
BUILD SUCCESSFUL (total time: 3 seconds)
How many iterations of the Binary Power Series would you like to see calculated and printed?
32
Binary Power Series 2 to the power of 0 = 1
Binary Power Series 2 to the power of 1 = 2
Binary Power Series 2 to the power of 2 = 4
Binary Power Series 2 to the power of 3 = 8
Binary Power Series 2 to the power of 4 = 16
Binary Power Series 2 to the power of 5 = 32
Binary Power Series 2 to the power of 6 = 64
Binary Power Series 2 to the power of 7 = 128
Binary Power Series 2 to the power of 8 = 256
Binary Power Series 2 to the power of 9 = 512
Binary Power Series 2 to the power of 10 = 1024
Binary Power Series 2 to the power of 11 = 2048
Binary Power Series 2 to the power of 12 = 4096
Binary Power Series 2 to the power of 13 = 8192
Binary Power Series 2 to the power of 14 = 16384
Binary Power Series 2 to the power of 15 = 32768
Binary Power Series 2 to the power of 16 = 65536
Binary Power Series 2 to the power of 17 = 131072
Binary Power Series 2 to the power of 18 = 262144
Binary Power Series 2 to the power of 19 = 524288
Binary Power Series 2 to the power of 20 = 1048576
Binary Power Series 2 to the power of 21 = 2097152
Binary Power Series 2 to the power of 22 = 4194304
Binary Power Series 2 to the power of 23 = 8388608
Binary Power Series 2 to the power of 24 = 16777216
Binary Power Series 2 to the power of 25 = 33554432
Binary Power Series 2 to the power of 26 = 67108864
Binary Power Series 2 to the power of 27 = 134217728
Binary Power Series 2 to the power of 28 = 268435456
Binary Power Series 2 to the power of 29 = 536870912
Binary Power Series 2 to the power of 30 = 1073741824
Binary Power Series 2 to the power of 31 = 2147483648
BUILD SUCCESSFUL (total time: 4 seconds)

….now let’s see what happens when we get close to 64 iterations:

How many iterations of the Binary Power Series would you like to see calculated and printed?
63
Binary Power Series 2 to the power of 0 = 1
Binary Power Series 2 to the power of 1 = 2
Binary Power Series 2 to the power of 2 = 4
Binary Power Series 2 to the power of 3 = 8
Binary Power Series 2 to the power of 4 = 16
Binary Power Series 2 to the power of 5 = 32
Binary Power Series 2 to the power of 6 = 64
Binary Power Series 2 to the power of 7 = 128
Binary Power Series 2 to the power of 8 = 256
Binary Power Series 2 to the power of 9 = 512
Binary Power Series 2 to the power of 10 = 1024
Binary Power Series 2 to the power of 11 = 2048
Binary Power Series 2 to the power of 12 = 4096
Binary Power Series 2 to the power of 13 = 8192
Binary Power Series 2 to the power of 14 = 16384
Binary Power Series 2 to the power of 15 = 32768
Binary Power Series 2 to the power of 16 = 65536
Binary Power Series 2 to the power of 17 = 131072
Binary Power Series 2 to the power of 18 = 262144
Binary Power Series 2 to the power of 19 = 524288
Binary Power Series 2 to the power of 20 = 1048576
Binary Power Series 2 to the power of 21 = 2097152
Binary Power Series 2 to the power of 22 = 4194304
Binary Power Series 2 to the power of 23 = 8388608
Binary Power Series 2 to the power of 24 = 16777216
Binary Power Series 2 to the power of 25 = 33554432
Binary Power Series 2 to the power of 26 = 67108864
Binary Power Series 2 to the power of 27 = 134217728
Binary Power Series 2 to the power of 28 = 268435456
Binary Power Series 2 to the power of 29 = 536870912
Binary Power Series 2 to the power of 30 = 1073741824
Binary Power Series 2 to the power of 31 = 2147483648
Binary Power Series 2 to the power of 32 = 4294967296
Binary Power Series 2 to the power of 33 = 8589934592
Binary Power Series 2 to the power of 34 = 17179869184
Binary Power Series 2 to the power of 35 = 34359738368
Binary Power Series 2 to the power of 36 = 68719476736
Binary Power Series 2 to the power of 37 = 137438953472
Binary Power Series 2 to the power of 38 = 274877906944
Binary Power Series 2 to the power of 39 = 549755813888
Binary Power Series 2 to the power of 40 = 1099511627776
Binary Power Series 2 to the power of 41 = 2199023255552
Binary Power Series 2 to the power of 42 = 4398046511104
Binary Power Series 2 to the power of 43 = 8796093022208
Binary Power Series 2 to the power of 44 = 17592186044416
Binary Power Series 2 to the power of 45 = 35184372088832
Binary Power Series 2 to the power of 46 = 70368744177664
Binary Power Series 2 to the power of 47 = 140737488355328
Binary Power Series 2 to the power of 48 = 281474976710656
Binary Power Series 2 to the power of 49 = 562949953421312
Binary Power Series 2 to the power of 50 = 1125899906842624
Binary Power Series 2 to the power of 51 = 2251799813685248
Binary Power Series 2 to the power of 52 = 4503599627370496
Binary Power Series 2 to the power of 53 = 9007199254740992
Binary Power Series 2 to the power of 54 = 18014398509481984
Binary Power Series 2 to the power of 55 = 36028797018963968
Binary Power Series 2 to the power of 56 = 72057594037927936
Binary Power Series 2 to the power of 57 = 144115188075855872
Binary Power Series 2 to the power of 58 = 288230376151711744
Binary Power Series 2 to the power of 59 = 576460752303423488
Binary Power Series 2 to the power of 60 = 1152921504606846976
Binary Power Series 2 to the power of 61 = 2305843009213693952
Binary Power Series 2 to the power of 62 = 4611686018427387904

Sixty-four is the borderline on accuracy using unsigned long integers (as stated above) so I coded it’s calculation and warning appropriately:

How many iterations of the Binary Power Series would you like to see calculated and printed?
64
Binary Power Series 2 to the power of 0 = 1
Binary Power Series 2 to the power of 1 = 2
Binary Power Series 2 to the power of 2 = 4
Binary Power Series 2 to the power of 3 = 8
Binary Power Series 2 to the power of 4 = 16
Binary Power Series 2 to the power of 5 = 32
Binary Power Series 2 to the power of 6 = 64
Binary Power Series 2 to the power of 7 = 128
Binary Power Series 2 to the power of 8 = 256
Binary Power Series 2 to the power of 9 = 512
Binary Power Series 2 to the power of 10 = 1024
Binary Power Series 2 to the power of 11 = 2048
Binary Power Series 2 to the power of 12 = 4096
Binary Power Series 2 to the power of 13 = 8192
Binary Power Series 2 to the power of 14 = 16384
Binary Power Series 2 to the power of 15 = 32768
Binary Power Series 2 to the power of 16 = 65536
Binary Power Series 2 to the power of 17 = 131072
Binary Power Series 2 to the power of 18 = 262144
Binary Power Series 2 to the power of 19 = 524288
Binary Power Series 2 to the power of 20 = 1048576
Binary Power Series 2 to the power of 21 = 2097152
Binary Power Series 2 to the power of 22 = 4194304
Binary Power Series 2 to the power of 23 = 8388608
Binary Power Series 2 to the power of 24 = 16777216
Binary Power Series 2 to the power of 25 = 33554432
Binary Power Series 2 to the power of 26 = 67108864
Binary Power Series 2 to the power of 27 = 134217728
Binary Power Series 2 to the power of 28 = 268435456
Binary Power Series 2 to the power of 29 = 536870912
Binary Power Series 2 to the power of 30 = 1073741824
Binary Power Series 2 to the power of 31 = 2147483648
Binary Power Series 2 to the power of 32 = 4294967296
Binary Power Series 2 to the power of 33 = 8589934592
Binary Power Series 2 to the power of 34 = 17179869184
Binary Power Series 2 to the power of 35 = 34359738368
Binary Power Series 2 to the power of 36 = 68719476736
Binary Power Series 2 to the power of 37 = 137438953472
Binary Power Series 2 to the power of 38 = 274877906944
Binary Power Series 2 to the power of 39 = 549755813888
Binary Power Series 2 to the power of 40 = 1099511627776
Binary Power Series 2 to the power of 41 = 2199023255552
Binary Power Series 2 to the power of 42 = 4398046511104
Binary Power Series 2 to the power of 43 = 8796093022208
Binary Power Series 2 to the power of 44 = 17592186044416
Binary Power Series 2 to the power of 45 = 35184372088832
Binary Power Series 2 to the power of 46 = 70368744177664
Binary Power Series 2 to the power of 47 = 140737488355328
Binary Power Series 2 to the power of 48 = 281474976710656
Binary Power Series 2 to the power of 49 = 562949953421312
Binary Power Series 2 to the power of 50 = 1125899906842624
Binary Power Series 2 to the power of 51 = 2251799813685248
Binary Power Series 2 to the power of 52 = 4503599627370496
Binary Power Series 2 to the power of 53 = 9007199254740992
Binary Power Series 2 to the power of 54 = 18014398509481984
Binary Power Series 2 to the power of 55 = 36028797018963968
Binary Power Series 2 to the power of 56 = 72057594037927936
Binary Power Series 2 to the power of 57 = 144115188075855872
Binary Power Series 2 to the power of 58 = 288230376151711744
Binary Power Series 2 to the power of 59 = 576460752303423488
Binary Power Series 2 to the power of 60 = 1152921504606846976
Binary Power Series 2 to the power of 61 = 2305843009213693952
Binary Power Series 2 to the power of 62 = 4611686018427387904
Binary Power Series 2 to the power of 63 = -9223372036854775808
The longest integer that can be expressed correctly is 4611686018427387904
appx. 4.61 QUINTILLION (4.61E18)
***Requests for over 64 iterations return bad data***
BUILD SUCCESSFUL (total time: 3 seconds)

Note that the 64th iteration (array in location 63 is NEGATIVE…this is obviously not the correct answer. I capped the size of the long int array at 65 memory cells, hence …while it WILL compile (using the std gcc compiler) it will throw an exception and kill the program for values OVER 64:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 65
Here is the source code I wrote if you’d like to try out my logic, tweak it, or scope-out my old-school design style (it is only lightly code-golfed; the abbreviations the kids use today make for confusing code. I try to use Object-Oriented variable identifiers to make definitive and concise use of comments as well as a style I learned from my days as a Cal Poly CSC Code-monkey:

/* Author: Chris "Tapper" Welke
* dist under the GNU Public License.
* This program tests the upper limit of numbers (long ints)
* of the NetBeans IDE v8.0.2 via the rapid geometric growth
* inherent to The Binary Power Series (BPS). 1, 2, 4, 8, 16 ....
* Two to the 64th power is the highest integer in the series
* it can calculate correctly unaided by extra memory/variables/logic
* Last stable build at Self-Similarity Studios & Tapper7.com,
* Los Angeles, CA 5/15/2015
*/
package series;
import java.util.Scanner;
class BPSeries{
protected static String Name = "Binary Power Series ";
protected static int Base = 2;
public static int gIN(){/**
* This fxn gets and sets the number of BPS iterations from the user
* a warning is displayed for n = 64 and an exception is thrown for n > 64
*/
int userInput;
System.out.println("How many iterations of the " + Name + "would you like to see calculated and printed?");
Scanner in = new Scanner(System.in);
userInput = in.nextInt();
return userInput;
}//end UI gIN
public static void main(String[] arg){
//getNset user-defined number of iterations:
int sIts = BPSeries.gIN();
//declare and allocate space for the cells
int cellKit = 65; //throw exception for >64 pwrs of 2
long[] sCells = new long[cellKit];
int pwr = 0; //initialize superscript
int i = 1; //initialize cell iterator
sCells[0] = 0; //null
sCells[1] = 1; //set cell one to 1 since n^0 = 1 for all n
switch(sIts){
case 0:
System.out.println("Ok - you're the boss. No iterations--> no output");
break;
case 1:
System.out.println(BPSeries.Name + BPSeries.Base + " to the power of " +pwr+ " = "+sCells[i]);
i++; pwr++;
break;
default:
System.out.println(BPSeries.Name + BPSeries.Base +" to the power of 0 = 1");
sCells[3]=(sCells[2]*BPSeries.Base);
i++; pwr++;
while (i<=sIts){ sCells[i]= (sCells[i-1] * BPSeries.Base); System.out.println(BPSeries.Name + BPSeries.Base + " to the power of "+pwr+" = "+sCells[i]); i++; pwr++; }//end while if(sIts>63){//exception notification/handling for 64 bit chipset
System.out.println("The longest integer that can be expressed correctly is "+ sCells[63]);
System.out.println("appx. 4.61 QUINTILLION (4.61E18)");
System.out.println("***Requests for over 64 iterations return bad data***");
}//endIF
}//end switch
}//end main
}//end BPS

A graphical analysis and more tests will follow this discussion; as well as highlights from
The Doheny Blues Festival, which begins tomorrow, I will review Boz Scaggs and hopefully Los Lobos too. Come get your tap on w/ me this weekend. Boz Scaggs!!! []

Today’s algorithm and number-musings sponsored by: