Got a drawer that updates automatically with available data categories. I think at first I’ll just display all available results from each category in an expandable list.
A filter is still enticing, as is more of a backbone for storing data. So far the idea is to pull each time since there isn’t a real need to store all the data, that’s what the API is for.
I did learn the ADT come with JSON parsing included. It’s an old version but most of the functionality is there and I didn’t need to (nor should I) roll my own; one of the major tenants of software dev is to use tools that are already around; no need to reinvent the wheel every time you build a car.
The Star Wars API is out and it looks like a lot of fun. In my head this is what I want:
- Opening activity with each type of query that loads in the drawer on each app open
- Choose the type of search and a fragment opens to that type of search
- Since we know the schema of each data type (planet, person, ship, etc) we can filter if desired, otherwise everything is returned
- Can also search everything
Results are returned as JSON objects that can be expanded? Don’t know how I want to display that yet.
Mostly I want to play with a Star Wars API and new (to me) Android designs.
Since 2010 I’ve been in a fantasy football keeper league. Each year we draft new players and often keep three per team; in the past Yahoo hasn’t been able to handle our specific league needs so I’ve been using a Google spreadsheet to keep track of the draft.
The spreadsheet is useful because it’s online so anyone can access it anywhere, it’s designed to handle teams in each column and rounds in each row, and the functionality to sort players and maintain some semblance of order with the 500+ players that can be chosen. It does have some downside since I have to set everything up manually every year then make sure the league managers follow the procedure to keep the draft going smoothly. As an alternative I’ve been pondering making my own web app (that honestly is going to steal plenty from Yahoo, shh don’t tell them) to use instead of a Google doc.
Things I want:
- handle 500+ players including
- projected draft round
- projected season points
- bye week (more useful then you’d think)
- if they’re drafted or kept, by whom
- 14 league managers that have
- team owner
- kept players
- drafted players
- players listed by position
- no log-in (at least for now)
- players displayed in an easily sorted manner
- players drafted or kept are removed from the master list
- players can be easily located by name or team
- simple for managers to draft players
- overall draft sheet showing teams in columns and rounds in rows
- master player list showing their info
- players listed by position
In my head it’s three sections: master player list, draft display, search area. Ideally on one page so no one has to swap pages but it might be too cluttered for those that don’t live in a 1080+p display world (heathens).
The base data needs to be persistent so a SQL database is the easy choice.
- 2014 Keeper League draft (database name)
- Players (table name)
- Last Name (table rows)
- First Name
- Projected draft position
- Projected season points
- Drafted by
- Teams (table name)
- 1st round draft position
I’m unsure about how to go about changing the draft status of each player. Buttons? Drop-down list? Text box? Something to think about.
I’ve been sitting on this one for a while but I think it’s time. The idea is simple: sort the numbers so it looks like a pyramid: smaller numbers on the outside and alternating sides, the largest number in the middle.
Working with odd-numbered arrays seems the only way to make it work but any positive number should behave the same when sorting. I’m going to keep two markers, one for the left side and one for the right, that are going to keep moving inward as the array is sorted. Big-O notation is going to be slow since my initial idea is going to move through the array once per value in the array: 5 values needs 5 runs through the array. O(n^n)
The design is for a psort() class to do the work and a main() to send appropriate arrays to it. Someday I’ll have to learn how to use JUnit testing (in Java) to ensure it behaves as expected but for now I’ll do the hard way.
The pyramids of Egypt are some of the most fascinating structures in the world. To honor the great pyramids we’ll be introducing pyramid sort. Pyramid sort works so that the highest numbers are in the center of the array and the lowest are on the edges. When comparing 2 numbers the smaller number goes on the left. So if the array contains 1,2,3 then 1 goes on the left with 2 on the far right and 3 in the middle.
Here are 2 more examples:
I’ve started working on lifetime stats and it’s very time consuming. Did you know I used to half-ass my stat keeping? I too was shocked. SHOCKED I SAY. Now I have four seasons of stats to work through, updating them to our current standard. (this is very reminiscent of my time consuming endeavor to update Softball Stats Pro, almost like it’s something I need to do)
Oh well. One down, three to go.
Easy peasy, even got it on the first compile (honestly that’s not something to brag about). There’s an interesting wrinkle for today’s (the original problem is actually yesterday’s problem) version that is to minimize the character count by 25%. Eclipse doesn’t have a built-in character counter so I’m going to try to use the file size listed in WinExplorer. Current size is 1,168 bytes; my goal is 75% of that or 876 bytes. This is a neat addition since sometimes (embedded systems, mobile) size is a concern. Not as much as years ago when a computer only had 256kb of memory space but sure let’s be retro.
I removed all the white space I could (spaces, line breaks), the javadoc comments, the regular comments, and put all the if-statements on one line. This reduced the file size to 345 bytes! This puts the total at 30% of the original file size. Quite a shrink but some of the comments should probably be in there still and it’s more difficult for a human to read now. Ideally this could be minimized before compile time so the useful information sticks around somewhere so the next poor bastard who has to use the code has some idea of what was going on.
Building on yesterday’s problem, take your solution and cut the amount of code used by at least 25%. That means that if your solution was 100 characters your new one should be no more than 75 characters. New line, tab, and space characters all count towards your character total.
This is similar to the “FizzBuzz” problem that seems to be pretty popular in technical interviews. I think I used if-else statements when I did it. In this case it’d be very similar other than for “fizzbuzz” I checked higher-level multiples first; in order to print “problemoftheday” properly it has to go lower-to-higher multiples. But let’s see.
You’ve got an easy one for today. Create a program that iterates over the numbers [1-100] (inclusive). If a number is divisible by 1 print “problem”. If a number is divisible by 5 print “of”. If a number is divisible by 25 print “the”. If a number is divisible by 100 print “day”. Thus when you reach 100 your final line of output should be “problemoftheday”.
I’ve spent some time with Jquery Mobile and got a mobile specific version of the site up at m.insomnialtendencies.com. It contains all the same links and mostly of the same information; pages that won’t work on mobile are linked to the main site. There’s also a mobile friendly calculator of various things that my dad’s been looking for; when you can’t find what you want, make it!
I still need to implement the code to monitor the access hardware to switch from mobile to desktop versions, of course including a manual switcher because I hate when I can’t see the desktop version of a site from mobile. I found a PHP plug-in that’ll handle checking the user-agent, I’ve just gotta spend the time getting it hooked up. A friend of mine who does lots of website design spent a week fighting with the mobile/desktop change-over, but I think they weren’t using any external plug-ins. I’ll have to bug them about that tomorrow when they’re at work.
After nearly two years of not being updated, Softball Stats has gotten a well deserved update. Sacrifice flies are displayed properly and exporting the stats is a new feature. No longer are the stats stored on a mobile device, they can be put into a spreadsheet and shown to players or just kept as an archive of past seasons.
Softball Stats Market link
Alpha link APK has been pushed for all registered testers. With no problems and a few days it should appear on the Play Store for all normal users.
Export the database to CSV to share stats or create your own statistics
Sacrifice-flies are displayed correctly (previous was just “fly out, 1 RBI” now will display “sacRBI, 1RBI”)
Ad network reconfigured