Tyrel Richey

+ Follow
since Oct 10, 2010
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tyrel Richey

Hello Everyone,

I don't know if this is the right place for this but I am trying to get some constructive criticism for my programming style and I made my first usefull...ish script.

I used to love fortune and I would always add it to .bashrc so I would get a cool greeting. However I am pretty sure I have memorized all of them and I wanted to make something similar for the new Unix world.

So I used my new ruby skills and made a script that downloads a random inspirational quote and displays it to standard output.

If any one is interested they can download it and give it try from https://github.com/tyrel86/Inspiring-Quotes

There are instructions on how to get it up and running please let me know what you think.

Please note you will need a ruby interpreter for it to work as well as ruby gems and the colorize gem.

Thank you every one
12 years ago
I hope its alright to make a new thread but the problem is different.
Alright I have been working on a chess clock of epic proportions and
almost have it up and running. But for the last and coolest part of
its functionality I have hit a wall and would appreciate some help.
The story so far:
The DatabaseHelper class can successfully add rows to the data base
which happens in an activity called add precept. I have pulled the db
file off the device and viewed it with SQLite viewer and all is well.
When I try to load one of the rows and use the data for the main
activities state things begin to go astray.
I have a method in the main activity called setClocks its a wrapper
class that uses the DatabaseHelper method getEntry to fill a MyObject
which has all the data I need to set the apps state. Please help me
figure out why a call of setClocks(1); results in an exception no row
Here is the code:

If I call setClocks(1); in the onCreate of the main activity the app
crashes with the could not find row exception. I know their is a row
with an _id of 1 I can see it on my desktop. I want to load the first
precet when the app loads and then in the onCreateOptionsMenu I have
an option to select a preset. When this is selected it displays a
dialog with a spinner and 2 buttons one for loading the selected
preset and one for removing the selected preset from the database.
Here is my attempt at that. It loads the dialog and the dialog is
populated by the database but when I press load it just goes back to
the main activity with the timers as they where.

And if you need it the setTime method for a ChessClock an inner class
of the main Activity which has its own inner class CountDownTimer

Thank you for reading hope all is well.
13 years ago
Alright I got the spinner working
13 years ago
In case you need the log cat:

01-02 04:20:57.169: INFO/ActivityManager(1238): Force stopping package org.lapus.chessclock uid=10107
01-02 04:20:57.169: INFO/ActivityManager(1238): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.lapus.chessclock/.play }
01-02 04:20:57.200: INFO/ActivityManager(1238): Start proc org.lapus.chessclock for activity org.lapus.chessclock/.play: pid=22395 uid=10107 gids={}
01-02 04:20:57.309: WARN/ActivityThread(22395): Application org.lapus.chessclock is waiting for the debugger on port 8100...
01-02 04:20:59.630: INFO/ActivityManager(1238): Displayed activity org.lapus.chessclock/.play: 2430 ms (total 2430 ms)
01-02 04:21:19.723: WARN/ActivityManager(1238): Force finishing activity org.lapus.chessclock/.play
01-02 04:21:20.230: WARN/ActivityManager(1238): Activity pause timeout for HistoryRecord{45b7a9e8 org.lapus.chessclock/.play}
01-02 04:21:21.223: INFO/ActivityManager(1238): Process org.lapus.chessclock (pid 22395) has died.
01-02 04:21:21.223: INFO/WindowManager(1238): WIN DEATH: Window{45c3f338 org.lapus.chessclock/org.lapus.chessclock.play paused=false}
01-02 04:21:21.231: INFO/WindowManager(1238): WIN DEATH: Window{45cc25f8 org.lapus.chessclock/org.lapus.chessclock.play paused=false}
01-02 04:21:30.333: WARN/ActivityManager(1238): Activity destroy timeout for HistoryRecord{45b7a9e8 org.lapus.chessclock/.play}
13 years ago
So I am making an app that has user created precepts. In the on create options menu their is an option to create the precept which loads a new activity with some forums then an apply button that writes the forums to a data base. I know this part works because I have read the data with an SQLite browser after pulling the file off the emulator. There is another option to load one of the precepts and this is where I am having issues. I am trying to populate a spinner with all of the rows of the Data Base and display it in a dialog. With the code as it is now it displays the dialog but the dialog has a spinner within a spinner its very strange. If you select the inner spinner it displays a blank spinner and if you select the outer spinner it crashes.

so here is the code in the activity class where I try and make the dialog:

Here is the DatabaseHelper classes getallEntries() method:

And finally the precetselector.xml file

Any help would be greatly appreciated this is the last thing I need to acomplish to feel good about realsing my first app the the Market.
Thank you thank you thank you
13 years ago
Does any one know how to make text upside down in android? I am working on a chess clock and would like to make the text for the top user readable by him. I already have the XML set up exactly how I want it so If its possible to keep my XML file for the rest of the content view I would greatly appreciate that method. Thank you every one.
13 years ago
So I was running updates while working on a project in eclipse. I should have looked but I didn't and eclipse was being updated as well. Then eclipse started acting very glitchy so I reinstalled it. I went then to reinstall the DDMS and android developer tools but eclipse said they were already installed. Cool so I went to make a new android project but my only options were the project templates that come with eclipse. So I uninstalled and reinstalled the DDMS and Developer tools but this did not help either. I am very lost if any one can help me I am completely out of ideas. Thank you.
13 years ago

Steve Luke wrote:This is a guess, I am not sure since I can't test right now,

When you do scanner.nextInt and you type in a value then hit the enter key so the input gets flushed to the scanner. My guess is the nextInt method is consuming the integer but not the new line. Then the next time you try to consume a line it gets the new line character still left in the buffer from when you entered the integer. Try consuming the nextLine one prior to the for loop.

That was exactly what happened thank you to all that helped. Here is the working code:
13 years ago
First off just signed up and I love the moose and the agreement...be nice right on I think I am in the right place.

I have recently started learning java in anticipation of developing for android. I was making a program that would ask the user how many lines they wanted to jibber jabber then take that many lines of input and add it to an array list. Then randomly go through and print those strings back. My code works except one little glitch which I don't under stand. On the first pass of the for loop where it take the user input and adds it to the ArrayList it just displays the System.out.print(); but does not get the user input then on the second and all passes thereafter it works the way I wanted it to. Any insights would be very appreciated.

Here is the code its just one class and all in main. I know its bad practice but I am not planning on reusing my Jibber Jabber lol:

Also let me know if there is some way I am suposed to display code I am new to this forum.
13 years ago