I’m going to be migrating this blog to my personal site now that it exists, so redirect from here to blog.insomnialtendencies.com
Author Archives: insomnial
I’m starting to mess around with layouts and strings for the upcoming remote viewer app. I’m trying to mimic the layout of the web interface for conformity.
Refresh are always displayed and do what they say. I might make
Connect disappear once something is connected for a cleaner interface.
Refresh may not be necessary depending on the connection type, which I haven’t figured out yet.
Each drawer option displays the appropriate torrents, and I’m thinking of adding a set of choices for labels as well. They’re not an option on the web interface but that may be unrelated. We’ll see. Oh! And I’m going to add a admob banner so advertisers pay me and not the users.
I haven’t stopped doing these but I haven’t seen any this week that got my attention enough to do them. Not a mark against them, I’ll certainly keep checking them out, just a personal preference.
I finally got the Eclipse ADT reinstalled and started digging through the code for Softball Stats and Softball Stats Pro. I’ve since discovered:
- I’m a bunch of revisions behind of the AdMob API
- All the ad calls are different in the new JAR
- I have no idea how they work now
- Most of the UI techniques I built to work with AndroidOS 2.0+ are also horrendously behind and mostly deprecated
- Who still uses 2.1-3 anyway?
I was going to try modifying the old code to work on new platforms, AndroidOS 4.0+, but right now it seems like I’d be better off building it new from the ground-up with the modern design techniques. I’m dreading this though since it means I have to build the app again and it takes A LOT of time. Not that I don’t have it but damn that’s a lot of work to throw away. I’ll still keep up the old version and probably change the manifest so that it doesn’t show up in the market for devices running 4.0+. This does have some good points:
- New refreshed UI using much improved 4.0+ naviation
- Reconfigured databases that aren’t slow and overly complicated
- But I’d have to include an “upgrade” option to read in the old database into the new one
- Proper threading so as the database gets large it doesn’t hold up the UI from loading
- Additional stats to make it more useful for baseball players (increase the userbase)
- Include better export options to share the data with other people using CSV/spreadsheet files
This is going to take a while.
Whew. TicTacToe is quite the time suck. I made a new
TicTacToe class to handle creating a board, adding moves, checking for a winner, and printing the results. The board is still pretty dumb; each move attempt is started by getting a random integer [0-3), checking that it’s a legal move, then making the move and switching players. The entire board is always filled up but only prints out if there is a winner. Because “X” gets to go first every time it also wins a large percentage of the time, I check for “X” winning first to avoid a board having two win-conditions.
I did re-learn the ternary operation and figuring out how to teach a computer to play TicTacToe was a useful thought exercise. I might spend some time making the board smarter as far as choosing positions and checking for wins. Maybe.
Computers are great at repetitive tasks, and tic-tac-toe more often than not is very repetitive. Today’s problem is to make a Tic-Tac-Toe solver with or without an AI; to make things easy at first I’ll just make it play randomly.
- in the case of a draw, print an empty board and “Draw”
- in the case of a win, print out the completed board and who wins
- run until either player has 10 wins
Finding win conditions is the hardest part so far as the program has to watch each move and check for three matching pieces on each horizontal, vertical, and diagonal axis. Initially I’ll do the check manually after each move; it’d be much cooler for each piece to check for a win on its own by analyzing each adjacent piece. Mark that down for the second iteration and the AI for the third.
Today’s Problem of the Day is to implement an automated version of our favorite childhood game, tic-tac-toe. Your program can assign random moves for X and O or you can implement some AI to favor one over the other. When someone wins print out the board and who won. If the game is going to be a draw print out the board and print out that it will be a draw.
Based on these conditions your program should never print out a full board unless the final move is a game winning move. If a game is going to end in a draw just print out the board. The program should run until X or O has won 10 games.
I know I’ve been saying it for a while, but I swear eventually I’m going to un-tie the database query from the UI thread to stop the app from hanging on large imports. Honestly it’s on my To-Do List. Check it for yourself. See? Right there at number 4. When that day comes, hoo boy you’ll all love it. Also on that list is a UI refresh, turns out white letters on black background ISN’T the best for battery life. Heh, the more you know. Oh and a UI design for larger screens, which soon even phones are hitting (thanks Samsung and your fascination with phablets).
More importantly, I really need to get on that app that connects to the qBittorent web-UI so I don’t have to keep awkwardly using the Chrome browser to manipulate a screen that works best with a mouse. I’m sure a lot of other people could use it but really I tend to make apps that I want. So someday once I’m tired of the website on the mobile Chrome browser.
But in more important news, back to a new hardcore Minecraft world! So far I’ve gone through 12 of them, finding more and more stupid ways to die in each one. The worst was the 10th, where I was so desperate for diamonds I was digging up the world and didn’t notice the three creepers that were right behind me.