Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Nickelob Ultra

Pages: [1] 2 3 4 5
1
Off Topic / Need help w/ Java
« on: September 22, 2015, 02:24:06 PM »
Hey guys, I'm partially really stupid if you can't remember, and I need help with figuring out what exactly my documentation provided for a code lab is specifying for me to do.  I figured some of you have some knowledge in coding and computer science and all that and I might as well ask here while I'm scratching my head trying to figure it out.

We're forming a primitive array that will store objects while keeping track of a class-level boolean that determines whether or not nulls are allowed in the array, and there are four constructors to implement.
Quote
Code: [Select]
DynArray ( boolean allowNulls )
Creates a DynArray object that may allow or disallow its elements to be null values, depending on the value provided for the allowNulls parameter.  The internal array created by this constructor is a small power of two that is provided by the implementor.

I'm confused about what it means in the bold.  The class implements RandomAccess and Iterable.  Where am I getting a small power of two from?  Am I just putting in whatever small power of two I feel like?  The default constructor of DynArray() also says "the internal array is a small power of two determined by the implementation."

2
Off Topic / Need Java Help
« on: April 01, 2015, 02:51:22 PM »
Hey so I'm clinically retarded and I'm trying to do this lab for my intro to object oriented programming class.  I figure a good majority of you are familiar with code including Java, so I came to you guys for advice because most if not all of my friends are clueless as well.

There are three .java files in this project.  ProvidedCode was given and is not modified in any way, shape, or form.  StudentCode is where we write our methods.  StudentTests is provided and unmodified like ProvidedCode and runs Junit tests.



ProvidedCode.java
Code: [Select]
/**
 *This code is provided to you
 *YOU MAY NOT CHANGE ANYTHING IN THIS FILE
 *
 * @author  Jan Plane
 */
public class ProvidedCode {

private final static int HIGH_VAL = 100;
private final static int LOW_VAL = 10;
private int myVal;

/** Constructs an object with the value 0 */
public ProvidedCode(){
this(0);
}
/** Constructs an object with the value passed */
public ProvidedCode(int inVal){
myVal = inVal;
}
/** Returns "yes" if the value of the instance variable is
* between the HIGH and the LOW or the value "no" if it is not.
* @throws ArithmeticException if it matches the HIGH_VAL
* @throws NullPointerException if it matches the LOW_VAL
* @return true or false
*/
public String between(){
if (myVal == HIGH_VAL){
throw new ArithmeticException("matches");
}
if (myVal == LOW_VAL){
throw new NullPointerException("matches");
}
if (myVal < HIGH_VAL && myVal > LOW_VAL){
return "yes";
}else{
return "no";
}
}
/** Returns "yes" if the value of the parameter is
* between the HIGH and the LOW or the value "no" if it is not.
* @throws RuntimeException if it matches the instance variable
* @throws ArithmeticException if it matches the HIGH_VAL
* @throws NullPointerException if it matches the LOW_VAL
* @return "yes" or "no"
*/
public String between(int inVal){
if (inVal == myVal){
throw new RuntimeException("matches");
}
if (inVal == HIGH_VAL){
throw new ArithmeticException("matches");
}
if (inVal == LOW_VAL){
throw new NullPointerException("matches");
}
if (inVal < HIGH_VAL && inVal > LOW_VAL){
return "yes";
}else{
return "no";
}
}
}

StudentCode.java
Code: [Select]
/*Students must implement these methods
 * to do the task described WITHOUT USING
 * EVEN ONE CONDITIONAL STATEMENT OF ANY KIND
 * (no loops, no ifs, no switches, no
 * conditional operators)!!!
 * You must get the correct result in the method
 * by catching an exception thrown in the code provided.
 */
public class StudentCode {

/*Returns one of the following Strings after
* comparing the instance data member
* from the class passed to its High and
* Low Values:
* - "yes" if the value of the instance data member
* is between the HIGH and LOW
* - "no" if it is not between the HIGH and LOW
* - "matches Higher Value" if it is the same the high
* -  or "matches Lower Value" if it is the same as the low
*/
public static String getBetween(ProvidedCode myParam){
ProvidedCode checkCode = new ProvidedCode();
String result = "";
try {
result = checkCode.between();
System.out.println(result);
} catch (ArithmeticException e) {
System.out.println(e.getMessage() + " Higher Value");
} catch (NullPointerException e) {
System.out.println(e.getMessage() + " Lower Value");
}
return result;
}
/*Returns one of the following Strings after
* comparing the instance data member
* from the class passed to its High and
* Low Values:
* - "yes" if the value of the parameter
* is between the HIGH and LOW
* - "no" if it is not between the HIGH and LOW
* - "matches Higher Value" if it is the same the high
* - "matches Lower Value" if it is the same as the low
* - "matches Parameter" it the instance value matches the parameter
*/
public static String getBetween(ProvidedCode myParam, int param){
ProvidedCode checkCode = new ProvidedCode();
try {
System.out.println(checkCode.between(param));
} catch (ArithmeticException e) {
System.out.println(e.getMessage() + " Higher Value");
} catch (NullPointerException e) {
System.out.println(e.getMessage() + " Lower Value");
} catch (RuntimeException e) {
System.out.println(e.getMessage() + " Parameter");
}
return checkCode.between();
}
}

StudentTests.java
Code: [Select]
import static org.junit.Assert.*;

import org.junit.Test;


public class StudentTests {

@Test
public void testInstanceBetween() {
{
ProvidedCode myObj = new ProvidedCode(4);
String actualOutput = StudentCode.getBetween(myObj);
String expectedOutput = "no";
assertTrue(actualOutput.equals(expectedOutput));
}
{
ProvidedCode myObj = new ProvidedCode(50);
String actualOutput = StudentCode.getBetween(myObj);
String expectedOutput = "yes";
assertTrue(actualOutput.equals(expectedOutput));
}
{
ProvidedCode myObj = new ProvidedCode(10);
String actualOutput = StudentCode.getBetween(myObj);
String expectedOutput = "matches Lower Value";
assertTrue(actualOutput.equals(expectedOutput));
}
{
ProvidedCode myObj = new ProvidedCode(100);
String actualOutput = StudentCode.getBetween(myObj);
String expectedOutput = "matches Higher Value";
assertTrue(actualOutput.equals(expectedOutput));
}
}
@Test
public void testParamBetween() {
{
ProvidedCode myObj = new ProvidedCode(4);
String actualOutput = StudentCode.getBetween(myObj,7);
String expectedOutput = "no";
assertTrue(actualOutput.equals(expectedOutput));
}
{
ProvidedCode myObj = new ProvidedCode(4);
String actualOutput = StudentCode.getBetween(myObj,50);
String expectedOutput = "yes";
assertTrue(actualOutput.equals(expectedOutput));
}
{
ProvidedCode myObj = new ProvidedCode(4);
String actualOutput = StudentCode.getBetween(myObj,10);
String expectedOutput = "matches Lower Value";
assertTrue(actualOutput.equals(expectedOutput));
}
{
ProvidedCode myObj = new ProvidedCode(4);
String actualOutput = StudentCode.getBetween(myObj,100);
String expectedOutput = "matches Higher Value";
assertTrue(actualOutput.equals(expectedOutput));
}
{
ProvidedCode myObj = new ProvidedCode(4);
String actualOutput = StudentCode.getBetween(myObj,4);
String expectedOutput = "matches Parameter";
assertTrue(actualOutput.equals(expectedOutput));
}
}
}



For some reason when I run it (running StudentTests.java), I run into failures on the second test for both testInstanceBetween() and testParamBetween().

What am I doing wrong here?  I'm open to hear advice and learn.

4
Off Topic / The Great Gatsby (2013)
« on: May 10, 2013, 01:30:44 AM »
WARNING spoilers.
Proceed with caution unless you've read the book/seen the movie.






I just got back from seeing the Great Gatsby movie.

Honestly, I feel like it was really great in some unique ways, and yet it was slightly dumbed down from the novel.  The soundtrack, like the movie overall, was great and yet sometimes not fitting.  I was really open to the whole Jay-Z thing, just because why the forget not, but then flux pavilion and it's like... why.  Then they kept repeating the rhythm/main verse of that Lana Del Rey song and it gets annoying a bit.  My only main gripes with the novel include ((the fact that Daisy/Tom's child was only mentioned and didn't appear until the end and for only a brief moment (which is weird because the child's appearance is supposed to hit Gatsby mentally), and there were too many points in the movie where it had fade ins/outs of Tobey Maguire/Nick Carraway typing out the story on a typewriter to his psychologist (but I guess you don't have much else to fill in the gaps as with the novel...).  The movie also seemed too CGI at times.  Also Myrtle's breast isn't exposed and flapping but I'm only complaining cause my teacher kept bringing up that detail ("flapping") at least 200 times when we read it.)).

I don't imagine many others have seen it right now at 2:30 in the morning unless you saw it at midnight but feel free to discuss, please try to keep plot details in transparent text.

5
Games / Age of Empires II returns on Steam in HD
« on: March 07, 2013, 06:12:06 PM »
The classic and famous medieval game Age of Empires II (including The Conquerors expansion) returns for $19.99 (10% off for a limited time) on Steam, the leading PC DRM platform.

http://store.steampowered.com/app/221380/

New features:
 - Compatibility with modern Operating Systems (i.e. Windows Vista and later)
 - Widescreen capability

6
Original article:  http://www.buddytv.com/articles/glee/glee-roundup-baby-got-back-sca-48991.aspx
thanks to Rob DenBleyker of C&H for bringing this up in my Facebook feed

Baby Got Back - Jonathan Coulton vs. Baby Got Back - Glee Cast Version

I managed to load them at the exact same time and managed to sync them up so that they were playing the exact same notes at the exact same time at the exact same rate.  Let me tell you, it's very clear that the Glee developers have blatantly ripped from this, not just in the song style itself, but apparently even tidbits of Jonathan's cover are still present!
Quote from: Jonathan's Twitter
After listening, I think that @GLEEonFOX may have even used parts of my recording. Do I hear a duck quack? And of course they say 'Johnny C'
EDIT:  The "Johnny C" line is at 2:17 in the Glee video above.  And the original.

What do you guys think though?  I mean normally most people tend to just bash Glee for being an overrated show to begin with and for causing tweeny bopper girls to say stupid stuff like "why are these old 70s bands covering Glee songs?!?!"... but whatever.

another edit:  NPR also threw in some thought into this little thing as well

7
Off Topic / URGENT: need add'l help with Android flashing
« on: December 24, 2012, 04:10:53 PM »
long story short:  I have an AT&T Galaxy S2 (SGH-i777).  A few days ago they rolled out Android 4.0.4 for the Galaxy S2 and it's an absolute failure of an update, causing my phone as well as many others to simply "freeze" while the screen is off, requiring a hard restart to work again.  Normally this only happened maybe once a week with 4.0.3, which I was okay with, but now it's an hourly thing.

I have rooted my phone already.  I don't have any warranty to begin with because I bought the S2 refurbished.  My phone is now magically on Gingerbread 2.3.4 (this isn't even the version of Android they shipped this phone with, it came with GB 2.3.6).

I need help on what to do next.  I'm supposed to install some kind of kernal with ClockworkMod Recovery but I'm lost here.

EDIT:  nevermind.  I know what I'm doing (I hope).



NEW UPDATE:  successfully installed a gingerbread kernal with ClockworkMod Recovery.  can I just throw on an ICS ROM and flash that?

8
Off Topic / Which of these toothpick bridge designs would work best?
« on: November 19, 2012, 04:28:41 PM »
http://www.toothpickdesign.com/trusstoothpickbridges.htm

I'm curious to see your guys thoughts, and I want to know from any good engineers here what might be the best option.

EDIT:  The Howe design has been ruled out.

9
Games / THQ defaulting on $50 million with Wells Fargo
« on: November 11, 2012, 02:56:32 PM »
http://www.ripten.com/2012/11/10/thq-defaults-on-50-million-line-of-credit/

Quote
The document goes on to indicate that THQ is in negotiations to repair the credit line. Were it to disappear, the publisherís cash flow would be severely impacted. Additionally, they donít have the funds to repay the credit right now. No other lender is going to bail them out, either. Were this to happen, bankruptcy seems like the only reasonable outcome.

THQ is responsible for publishing many well received titles, including those from the Saints Row and Red Faction series, and also hold agreements with other franchises such as Games Workshop and Nickelodeon.  THQ going out would be a big hit for many fans of these series :(

11
Off Topic / Plague Inc.
« on: October 11, 2012, 05:00:38 PM »
Does anyone else find this game incredibly fun?  I enjoy the naming of your disease mostly for things like this, but I guess the game's fun too.

iOS version / Android version







Personally I find this to be a much more enjoyable "successor" (in design at least) to Pandemic/2.  The game is free, but can be unlocked for $1.06 which allows for fast forward speed, no advertisements and inserting bonus genes (personally I just think ads can burn your battery more).  Madagascar, Greenland, Iceland, etc. "invincible countries" are actually capable of being infected without preemptively shutting borders/seaports too, you are also given the choice of starting country, and there are MUCH more countries to infect..  It heats my Galaxy S2 up like a bitch though and definitely can chew on your battery life if you aren't proper with brightness/etc.

12
Games / Amazon's "Best Deals of July"
« on: July 02, 2012, 12:59:13 AM »
http://www.amazon.com/gp/feature.html/ref=tsm_1_tw_s_vg_m6cx0y?docId=1000812791

For the month of July they're doing great deals on PC games, making games like the new Max Payne 3 50% off at $30 and the new Spec Ops: The Line also at 50% off for $25.  Many of the games also can likely be registered on Steam if they cite requiring Steam in the system requirements.

This is probably the only Amazon email I've ever read too.

13
Off Topic / Interactive Daft Punk Keyboard!
« on: June 25, 2012, 06:54:34 PM »
http://www.najle.com/idaft/

Now you too can work it harder, make it better, do it faster, makes us stronger.

14
Games / CiV Gods & Kings released
« on: June 18, 2012, 10:56:26 PM »


I'm pretty excited.  Anyone else bought it?  Feel free to post your initial thoughts, thorough reviews, problems, concerns, etc.

15
Off Topic / "Aussie web store applies IE7 tax" - PC Gamer article
« on: June 14, 2012, 11:03:54 AM »
http://www.pcgamer.com/2012/06/14/aussie-web-store-applies-internet-explorer-7-tax-to-help-make-the-internet-a-better-place/

Basically, they apply an extra charge simply for using IE7.  I think this is the funniest thing I've seen to stop usage of IE7, lol.

Pages: [1] 2 3 4 5