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 - Taters343

Pages: [1] 2 3
1
Technology, Science & Alt Science / Construct a binary tree from a text file
« on: September 26, 2012, 09:00:50 PM »
I have a text file, and each line represents data in a node. I have to construct a binary tree of it. Also, I have to do it in C#.

The format of the text file is, I think, a preorder traversal or whatever.
Quote
Root
Root.left
Root.left.left
Root.left.right
Root.right
Root.right.left
Root.right.right

Each node will always have two children or no children, but the tree must be able to be any size and still be created using the same program.

So far I've managed to mostly just fuck up. I had something that I think was close, but that was several hours ago, and now I can't remember what I had done.

What I do still have is this:

Code: [Select]
Node root;

public void ReadFile()      //Puts every line of the file into an array.
        {
            String[] allLines = File.ReadLines("nodeFile.txt").ToArray();
            root = WriteTree(allLines, 0);
        }
        public Node WriteTree(String[] fileContents, int arrayItem)
        {
            Node node = new Node();
            if (fileContents.Length - 1 >= arrayItem)
            {
                node.Text = fileContents[arrayItem]; //Adds current string to current node.
                //Console.WriteLine(fileContents[arrayItem] + " added");
                // Need stuff here that adds node.Left and node.Right
               // I'm more or less entirely sure this method needs to be recursive
            }

            return node;
        }

I'm lost and can't keep my thoughts straight any more, so I figured I'd ask here.

2
Anyone know if these two products can be used together? I can't find anything about it online.

3
Technology, Science & Alt Science / Google Now
« on: July 03, 2012, 01:37:59 PM »
The promotional video:

#ws" class="bbc_link" target="_blank">Introducing Google Now

A comparison with Siri:

#ws" class="bbc_link" target="_blank">Siri vs. Google Search (Jelly Bean)


I think it's pretty damn awesome. Any thoughts?

4
Arts & Entertainment / I made some Art yesterday
« on: May 15, 2012, 09:18:39 PM »
And today I uploaded it into an album on imgur. Here it is: http://imgur.com/a/ynkn2

5
In C#, I'm creating an array of "Player" objects. Each player has two attributes, and name and a score, which are left blank when the player is created to be set later. The code compiles, but when it tries to set the name or score of a player in the array I get a null reference exception. The code looks something like this, substituting the variables I'm using with constants for the sake of simplification:

Code: [Select]
Player[] playerArray = new Player[5];
playerArray[0].Name = "hello";

I tried creating a Player object that wasn't in an array and it worked fine, but for some reason it won't work in the array. Am I just missing a step or something? I feel like it should be an easy fix and that I'm just missing something obvious.

Never mind, I figured it out. I tried deleting the thread, but it won't let me.

6
Arts & Entertainment / Animations I made
« on: May 03, 2012, 02:57:38 PM »
I made these for my 2D animation class this quarter.

Experimental Animation "Do anything that is 30 seconds long and looks cool.":

" class="bbc_link" target="_blank">

Rotoscope "You need a total of 20 seconds, some of it has to be a change of facial expression, and some of it has to be some sort of dynamic motion." My audio got a little bit out of sync on this one:

" class="bbc_link" target="_blank">

Character Narrative "Make a character, make a walk cycle, run cycle, and any other motion, then make a 30 second story using a combination of the movements and whatever else you want.":

" class="bbc_link" target="_blank">



I have one more assignment for the quarter, and it's to do whatever I want, but it has to be 45 seconds long. I'll post it in this thread when I'm done with it.

7
Technology, Science & Alt Science / My linked list code won't work
« on: April 17, 2012, 08:40:06 AM »
So I've been tasked with writing my own doubly linked list class. I've got most of it down, but when I try to delete the last element it crashes.

My code looks like this:
Code: [Select]
public DblNode Delete(string ToRemove)
        {
            DblNode current = new DblNode();
            current = Find(ToRemove);
            if (current == null)
                Console.WriteLine("PANIC!  Couldn't find " + ToRemove + " to delete it.");
            else if (current.Data == ToRemove)
            {
                if (current.Prev != null)
                    current.Prev.Next = current.Next;
                else
                    current.Prev.Next = null;

                if (current.Next != null)
                    current.Next.Prev = current.Prev;
                else
                    current.Next.Prev = null;

                nodeAmt--;
            }
                 
            return current;

        }

All of it works except for the bit that says "current.Prev.Next = null;" which doesn't make sense to me because the alternative, "current.Next.Prev = null;" works just fine.

I've tried all sorts of different things on it, all of which I diagrammed out on a whiteboard and they seemed like they should work, but none did. Any ideas?

8
Suggestions & Concerns / I'm banned on my phone, but not on my laptop.
« on: February 29, 2012, 07:09:39 AM »
Whhhhhhaaaaaaaaaaaaaat is this?



I can log into the forum from my laptop, but on my phone it tells me that I've been perma banned. Wat.

9
The Lounge / Werewolf ratios and stuff
« on: February 10, 2012, 03:45:57 AM »
I'm running a game of Werewolf for the kids on my floor (one of the not so bright ones insisted it is spelled Wearwolf, I'm pretty sure she isn't playing). The problem is, I don't know how the ratios work, and how winning works (I kind of get it, but not entirely).

We're playing with the following roles:
-Townspeople (obviously)
-Werewolves (of course)
-Protector
-Psychic
-Twins/lovers/whatever you want to call these two roles
-Serial Killer

I understand that the twins must be the last two alive, which means they win when it is them and one other person, but I don't understand how it works if all the werewolves die and both twins are left with multiple townspeople left. I get that the serial killer wants to be the last alive, but I have the same question I did with the twins. I'm not sure how to pick how many werewolves there will be, and I'm not sure at what point the werewolves win (I think it might be when the ratio of werewolves to people is 1:1, or something). Any help would be very appreciated.

Also, should I implement the rule that if the protector gets attacked at night he and the werewolf die, or should I have only the protector die?

10
Technology, Science & Alt Science / Help setting up file server
« on: January 26, 2012, 01:58:37 PM »
Pretty soon I'm planning on setting up a file server with a RAID 5. I plan on having 5 2TB drives, which would be 8 TB of storage space if I'm understanding this right. I'm going to build it in this case, because it is cheap and has 8 3.5" internal bays.

I haven't picked out a motherboard yet, but I'm going to go for the cheapest one that will do what I need it to do. What I can't find anywhere on the nets is how much RAM I will need for this system. I'm pretty sure I get free legit copies of Windows Server 2008 through school, if that factors into it. But I'm open to other suggestions on how to do this.

11
The Lounge / Got my wisdom teeth out yesterday
« on: November 22, 2011, 02:31:34 AM »
And it hurt. But today I feel fine. Hooray! My mouth hurts a little bit and my food tastes like blood, but otherwise I'm fine. I can even type just fine. My face is really swollen, too.

12
Technology, Science & Alt Science / Updating my BIOS
« on: November 02, 2011, 06:12:44 PM »
I got a 5 bay eSata multiplier and I was kind of hoping that it would just sort of work when I plugged it in, but sadly it does not. It came with eSata ports to plug into the motherboard, but I have a laptop with an eSata port, so not only do I want to use the one built in, I sort of have to. The multiplier came with a cd that has several folders in it, one of them called BIOS, which contains a bin file. How would I go about putting that bin file into my BIOS (or whatever it is that I have to do, because I honestly have no clue).

13
I am writing an if statement that essentially boils down to

if (x==1 || x==5 || x==17...)
      do something;

It's a bit more complicated than that, but that doesn't really matter. I was wondering if there was a way to write a single "x==..." that I can insert every value I'm checking for in. Something like

if (x==[1,5,17...])
     do something;


I've tried messing around with things like that, but nothing I've tried has worked. Does anyone know if/how I can do this?


Instead of doing that I'm going to just go back to the way I was originally trying to solve the actual problem. I gave up on it because I got pissed off and kept finding more and more complex ways to do it until eventually getting to the point at which I was when I ran into the above problem.

Basically, I have a character in a maze, I need the character to not pass through the walls of the maze.

The methods I used do what they seem like they would do.

Code: [Select]
if(getOneIntersectingObject(Block.class) != null){
            if (getRotation() == 0)
                setLocation(getX()-30, getY());
        }
        if(getOneIntersectingObject(Block.class) != null){
            if (getRotation() == 180)
                setLocation(getX()+30, getY());
        }
        if(getOneIntersectingObject(Block.class) != null){
            if (getRotation() == 90)
                setLocation(getX(), getY() - 30);
        }
        if(getOneIntersectingObject(Block.class) != null){
            if (getRotation() == 270)
                setLocation(getX(), getY() + 30);
        }
            move(30);

The character is checking to see if it is on the same space as a block(all objects are 30 pixels x 30 pixels), then, based on the rotation of the character (270 = up, 90 =  down, 0 = right, 90 = left), it moves the character back onto the space it previously was on (x or y coordinate minus or plus 30). Then it has the character move. A different portion of code loops this bit, that isn't really important.

The thing that is weird is that the code works perfectly for the one with rotation equaling 0, but doesn't work quite right for the other 3.

Rather than stopping it before the block (like the rotation of 0), they stop it inside of the block, thus making any more movement impossible.

I tried setting the change to be plus or minus 60 on the three that didn't work, all it did was make it move back and forth between the inside of the block and the space outside of the block.

14
Technology, Science & Alt Science / Storage Space
« on: October 13, 2011, 07:35:02 PM »
Over the next few months I'd like to get an additional 6 to 8 TB of additional storage space without having each as an individual drive that I have to plug in to its own port, etc. I'd like to find a combination of the most efficient(transfer speeds, also if I could easily switch or add drives that would be good), safest (as far as least likely to fail and lose data), and most cost effective (sacrificing efficiency, not safety). I've looked into RAID and it seems like better options are probably out there somewhere. If I do go with RAID it seems like level 5 would be the best, but I really don't understand it at all. Suggestions would be cool.

15
The Lounge / All of my stuff
« on: August 30, 2011, 11:33:22 AM »
Is in the trunk of my car, all ready to go to school in 15 and a half hours. Most of my friends are already at school, and the ones who stayed local have classes today, so I have nothing to do until tonight.

16
I went to the grocery store for a Lunchable and some pecan pinwheels. They didn't have any pecan pinwheels so I settled for honey buns, no big deal. I ended up leaving the store with my second choice Little Debbie Snack, two Lunchables, and a container of habanero peppers. I went into the entrance area of the store with my friend Colin and his girlfriend (they arrived at the store shortly after me), sat down on the bench, opened up the container of peppers, and ate an entire habanero in a single bite. At first I thought it wasn't too bad, but the heat began to get worse and worse, first causing me to salivate excessively, then sweat a bit, then cry, and eventually throw up the honey bun I had used in an attempt to numb the heat.

On the bright side, I learned that I do have a limit to how spicy my food can be before I no longer enjoy it, but habaneros are not quite there, because that experience was amazing.

17
Technology, Science & Alt Science / @Parsifal
« on: August 24, 2011, 06:42:08 PM »
This question is for Parsifal, but other people are welcome to provide input.

Would you say that proprietary software has impeded the overall progress of technology, and, if so, how?

18
The Lounge / Google+
« on: August 19, 2011, 04:53:50 PM »
Sorry if there is already a thread for this, but anyone here have a Google+ account? I just got one and I'd really like to start an FES circle.

19
The Lounge / First tattoo
« on: August 10, 2011, 11:43:10 AM »
I got my first tattoo today. I thought it would hurt, but I barely felt anything.



Eventually I'm going to get the words "Don't Panic" under it in big, friendly letters.

20
The Lounge / Got my schedule
« on: July 28, 2011, 11:18:46 AM »
I just got my schedule for the fall quarter of my first year of higher education. RIT makes the schedules for incoming freshman, so until today I had no idea what I am going to be taking. The very first class I'll be taking is Discrete Math. I don't know what the hell that means, but it sounds awesome.

21
Suggestions & Concerns / Hats in the store
« on: July 27, 2011, 03:42:22 PM »
Anyone else want hats in the flat earth shop? I want hats in the flat earth shop. That would be pretty cool. Like, caps, you know. "Baseball caps" as us Americans call them, I'm not sure what other people call them. And maybe beanies or something, too I guess.

22
Arts & Entertainment / Spore
« on: July 22, 2011, 07:55:40 AM »
I just got it, and it's really fun so far. Anyone else played it?

23
The Lounge / @Parsifal and anyone else.
« on: September 14, 2010, 01:10:56 PM »
I need to support as many text books at a height of at least 3 inches off the ground as I possibly can using only a sheet of 8.5"x11" paper (standard computer paper) and 12" of tape. Have any good ideas?

24
The Lounge / I am officially the coolest person ever.
« on: September 12, 2010, 07:27:32 PM »
I got a toy helicopter today. Discuss.

25
The Lounge / Current Events
« on: September 11, 2010, 08:21:46 PM »
Over the course of the next twenty weeks I will need a lot of current events for my government class. I decided that I'd like to use events that will get people to wat. So if anybody knows of any such events, feel free to link me to them in this thread. They have to be "generally within 3 or 4 days", but 5 days will probably be doable as well.

26
The Lounge / Sleep.
« on: September 06, 2010, 08:39:41 PM »
I needed a flashlight, so I grabbed my phone, then ended up back on FES. I really should be getting to sleep soon.

27
The Lounge / Is Taters being used in the wrong way?
« on: September 06, 2010, 07:57:39 PM »
In 2009, there were 59 deaths as a result of Taters in the United States. Should a Tater be used when other non-lethal means are available (e.g. a baton or other device), or should a Tater be seen as an alternative to a gun, only to be used when lives are threatened and other means are exhausted?

This thread mostly has to do with police use of Taters. If a suspect is unarmed, should a Tater be used?

Discuss.

28
Arts & Entertainment / Next August
« on: August 27, 2010, 09:36:13 PM »
Spy Kids 4 is coming out. Discuss.

29
Arts & Entertainment / The Official PlayStation 3 Thread
« on: August 26, 2010, 02:36:18 PM »
This thread is for people who own PlayStation 3's. Post your PSN ID, your favourite games, brag about trophies, ask about games you might want, talk about future releases, etc.

I'm Taters343 on PSN. I usually play Fallout 3, CoD:WaW, and Modern Warfare 2. I recently 100%ed Fallout 3 trophies, including DLC. Can't wait for New Vegas, I a already preordered the collector's edition, and completely paid for it.

30
Arts & Entertainment / Tremulous
« on: August 26, 2010, 07:22:28 AM »
I want to play it, but my computer won't let me. I used to play it a few years ago and I remember it being fun, but my parents made me stop because they thought it would mess up the computer. They were, of course, wrong, but I obliged in order to be able to use the computer at all. By now they have most likely forgotten about it and I should be able to play again, but this shitty computer stops responding every time I try to run it.

Pages: [1] 2 3