Search found 104 matches

by blackeye
Mon Apr 05, 2010 12:01 am UTC
Forum: Computer Science
Topic: Algorithm: Huffman codes without a tree.
Replies: 10
Views: 3730

Re: Algorithm: Huffman codes without a tree.

Leibnix wrote:This is like asking: "Can I implement quicksort without an array?"

Trees are beautiful. Learn to love them! :D

just looking for a more efficient way of doing things. God forbid someone makes an advance in the CS field. Trees are easy but feel so clunky to me.
by blackeye
Fri Apr 02, 2010 12:55 am UTC
Forum: Individual XKCD Comic Threads
Topic: xkcd.com/unixkcd
Replies: 292
Views: 112824

Re: April Fools 2010 Discussion

petition to keep the site in this format? :D
by blackeye
Thu Mar 11, 2010 10:48 am UTC
Forum: Computer Science
Topic: Algorithm: Huffman codes without a tree.
Replies: 10
Views: 3730

Re: Algorithm: Huffman codes without a tree.

my ideal implementation is just an array sorted from max frequency to min frequency. Though the more I think about it I can make the heap in the array...
by blackeye
Thu Mar 11, 2010 1:47 am UTC
Forum: Computer Science
Topic: Algorithm: Huffman codes without a tree.
Replies: 10
Views: 3730

Algorithm: Huffman codes without a tree.

So my data structures teacher assigned us a project to generate the huffman codes for a file and I was thinking that I hate the implementation of trees. So I was wondering if it is even possible to generate huffman codes without using trees given the number the number of unique characters in a file ...
by blackeye
Tue Jun 02, 2009 10:24 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

Let me ask you again: Don't you have a debugger that allows you to step through the code? If you don't, why don't you try the following version of getstuff(): info getstuff(){ info Anon; if( fgets(Anon.Name,80,stdin) == NULL ){ printf("Reading Name failed!\n"); Anon.Name[0] = '\0'; } if( ...
by blackeye
Tue Jun 02, 2009 9:13 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

did that after the first time it returns null leaving me with only one address. changed the scanf to include a \n it runs again but didn't solve the problem. Don't you have a debugger that allows you to step through the code? What you are seeing now is probably because reading the first record does...
by blackeye
Tue Jun 02, 2009 8:52 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

did that after the first time it returns null leaving me with only one address. changed the scanf to include a \n it runs again but didn't solve the problem.
by blackeye
Tue Jun 02, 2009 10:01 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

Indeed what you have said is true and I have fixed it to test correctly. Sadly it did not fix the problem. getstuff works fine and returns the right things...its long after that [0]Address has been set that the program somehow erases it. Can you post what your code is like now? Are you sure that th...
by blackeye
Tue Jun 02, 2009 9:50 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

It may be that the error does have to do with this however. What does getstuff() do when it reaches the end of file before it reads all of its data, or even when it tries to read the very first bit of data? Does it ignore it, and try to allocate zero bytes to store nothing in? Or does it do somethi...
by blackeye
Tue Jun 02, 2009 9:32 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

while( allo<50 && !feof(stdin)){ charlie=getstuff();//get info if (feof(stdin)){ break; } ... } I don't see the corruption problem, but you should almost never use feof() in a loop condition of a while. A pretty good example can be found at: http://www.gidnetwork.com/b-58.html In your case ...
by blackeye
Tue Jun 02, 2009 8:20 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

on another note... I got it but I'm getting (*stru[0]).Address lost in this code. It seems to go null midway through the loop...which is weird because it is the only thing that is misbehaving.... brownie points if you find the error. while( allo<50 && !feof(stdin)){ charlie=getstuff();//get ...
by blackeye
Mon Jun 01, 2009 11:43 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

good thing this is in c then :lol:
by blackeye
Mon Jun 01, 2009 7:46 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

stephentyrone wrote:
blackeye wrote:array of pointers to structs...how would I write that?


Code: Select all

struct foo { int bar; int baz; };
struct foo *array[n];

i mean dynamically in context to my program that I posted.
by blackeye
Mon Jun 01, 2009 6:55 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

hey zabaron out of curiosity if I wanted to make it and array of pointers to structs like in your first example...how would I write that?
by blackeye
Wed May 27, 2009 10:30 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

the more I test this the more I bow to you! K I need to go brush up on my pointer arithmetic...because to be honest I feel damn right shameful! I guess it was one of those things that I never thought I would really need...lol
by blackeye
Wed May 27, 2009 12:41 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

it was segfaulting before that, I changed that line from a for loop however how should I initialize charlie? I know the segfault occurs on *thearray[(*ele)]=*object;
by blackeye
Tue May 26, 2009 10:24 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

Okay....I thought I had it...I thought all was good...but I'm still segfault tripping.... god help me. //main.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include "Funcs.h" int main() { info **stru; info charlie; int el=0; int allo=0; int count=0; while(*charli...
by blackeye
Thu May 21, 2009 8:55 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

I love you zabaron! you make my head not hurt as much!
by blackeye
Wed May 20, 2009 2:45 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

Here's what I've noticed: 1)My guess is you're trying to allocate an array of info structs and put them in the memory pointed to by the parameter strux. This is not what will happen. Note that you have 3 copies of the same pointer: the one in your calling code that you pass into getstuff(), strux, ...
by blackeye
Wed May 20, 2009 12:03 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 546183

Re: The "IT DOESN'T WORK!" thread

Hey all, I'm going crazy...I'm new to dynamic memory allocation and all that and now it appears I can't pass by reference... :shock: when I call Add() it gives me an address...or garbage for alloc, and ele it also segfaults like no other and I am clueless :x. void getstuff(info *strux){ info...
by blackeye
Tue May 12, 2009 7:49 pm UTC
Forum: Computer Science
Topic: Math for a computer scientist
Replies: 23
Views: 2514

Re: Math for a computer scientist

pppffffffft we don't need math! we have computer to do the math for us! :D
by blackeye
Fri Mar 27, 2009 2:50 am UTC
Forum: Your art and links
Topic: So I made my first website, help me make it better
Replies: 11
Views: 2316

Re: So I made my first website, help me make it better

got a 404 when I clicked on technical articles. If its not done yet disable the button or somethin. Besides that it looks fine.
by blackeye
Tue Mar 17, 2009 9:49 pm UTC
Forum: Coding
Topic: Trying to build up a string array? [ Java ]
Replies: 6
Views: 2439

Re: Trying to build up a string array? [ Java ]

you're missing an "implements Comparable" somewhere and then you need to make a compare to function as well.
by blackeye
Wed Mar 04, 2009 6:50 am UTC
Forum: Religious Wars
Topic: I thought you should all know the truth...
Replies: 14
Views: 3279

Re: I thought you should all know the truth...

dudes...in editor you can set the colors!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!the colors duke the colors!
by blackeye
Tue Mar 03, 2009 7:58 pm UTC
Forum: Religious Wars
Topic: I thought you should all know the truth...
Replies: 14
Views: 3279

I thought you should all know the truth...

dos editor> vi || emacs.


edit or gtfo.
by blackeye
Sat Apr 26, 2008 4:07 pm UTC
Forum: Gaming
Topic: How to play RTS games.
Replies: 33
Views: 5183

Re: How to play RTS games.

mmmm I'm still playing aoe2 these days. If you want to get good at any rts game you need to find the right balance between military and economy. This varies from game to game but once you find that you will at least be decent. Then you need to learn what counters what and various tactics to deal wit...
by blackeye
Fri Feb 08, 2008 12:34 am UTC
Forum: Fit Club
Topic: Post your workouts!!
Replies: 31
Views: 4447

Post your workouts!!

So everyone can compare and learn new ways of making our bodies teh hotness! I'll go first M/18/158lb (about 3 times a week) 25 floor swipers x2 150 push-ups 200 crunches 20 leg lifty thingys(you're on your back and you life each leg up for 1 rep) unfortunately I've been so exhausted with school and...
by blackeye
Tue Feb 05, 2008 1:21 am UTC
Forum: General
Topic: hitting the wall...
Replies: 17
Views: 1915

Re: hitting the wall...

Fossa wrote:I have hit the wall in Guitar Hero.

It is a sad, sad day.

sir you just made my jaw drop into a recursive algorithm!
(oh god that was cheesy)
by blackeye
Tue Feb 05, 2008 12:02 am UTC
Forum: General
Topic: hitting the wall...
Replies: 17
Views: 1915

Re: hitting the wall...

this is only going to get worse then lol... right now I got stuck making my first 2d game . The problem is that I've never done anything this big before. Going from being a crafty AP CompSci student who can create a myriad of useful functions to being an actual application designer is a little overw...
by blackeye
Mon Feb 04, 2008 9:19 pm UTC
Forum: General
Topic: hitting the wall...
Replies: 17
Views: 1915

hitting the wall...

Have you ever felt that you found your true talent and that anything is possible because you are so great at x... and then a week or two later you hit that wall were natural talent ends and everything seems big, confusing, pointless, and hard (your face constantly looks something like this :shock: )...
by blackeye
Thu Jan 17, 2008 3:42 pm UTC
Forum: Gaming
Topic: Halo: The Future of Gaming? (Let's bitch about FPSs)
Replies: 335
Views: 34132

Re: Halo: The Future of Gaming

Halo is boring as hell to me. You can make a game perfectly balanced but that doesn't make it a good game. Halo just seems really bland to me, I mean there are no new or innovative gameplay features that scream play me!! I'd rather play UT or call of duty any day...speaking of which anyone know when...
by blackeye
Sat Jan 12, 2008 3:51 am UTC
Forum: Gaming
Topic: DeathSpank becomes a reality!
Replies: 0
Views: 810

DeathSpank becomes a reality!

As some of you may remember Ron Gilbert was the mastermind behind the first two Monkey Island games. That said I am totally stoked...http://grumpygamer.com/8519854#comment
by blackeye
Thu Jan 10, 2008 12:26 am UTC
Forum: Gaming
Topic: mmmmm anyone wanna help me make my metal slug clone??
Replies: 4
Views: 1359

Re: mmmmm anyone wanna help me make my metal slug clone??

Ideas that sound pretty damn neat! I like the mad dash idea!
by blackeye
Wed Jan 09, 2008 7:39 am UTC
Forum: Gaming
Topic: mmmmm anyone wanna help me make my metal slug clone??
Replies: 4
Views: 1359

mmmmm anyone wanna help me make my metal slug clone??

Well I just got my grubby lil hands on pygame and the book about it , so I decided I'm going to code myself a metal slug clone(since I'm still an amateur coder at best this might take a couple of months)! However I doubt I can really do all the artwork on my own... actually I'm sure it would suck ma...
by blackeye
Tue Jan 08, 2008 5:45 am UTC
Forum: Music
Topic: Favorite Band that no one has heard of!
Replies: 360
Views: 47032

Re: Favorite Band that no one has heard of!

I love b&s but of late all their songs are sounding the same to me, but i will most likely get back into them in about a month(I go through cycles). Probably it's because of this. And if you've ever studied art history, the links at the bottom are almost painfully funny :) actually I could care...
by blackeye
Mon Jan 07, 2008 3:33 pm UTC
Forum: Music
Topic: Favorite Band that no one has heard of!
Replies: 360
Views: 47032

Re: Favorite Band that no one has heard of!

Mock Orange. No one knows who they are. No one. And they fantastic. Belle & Sebastian aswell. They're so radio friendly it should be illegal. Unfortunately, it seems like it is. Mock Orange ftw!!! I love b&s but of late all their songs are sounding the same to me, but i will most likely get...
by blackeye
Mon Jan 07, 2008 9:33 am UTC
Forum: Serious Business
Topic: Transhumanism
Replies: 461
Views: 44887

Re: Transhumanism

We would simply be replacing sleep as we know it with a different version: Sleep 2.0, as it were, and so on as we get better at that. If it's a process we run in the background while conscious, though, is it really sleep anymore? To answer that, I think we'd need to know precisely why we sleep. If ...
by blackeye
Sat Jan 05, 2008 8:16 am UTC
Forum: Your art and links
Topic: (Post Your) Incredible Poems (Here!)
Replies: 544
Views: 251656

Re: (Post Your) Incredible Poems (Here!)

:shock: I feel like Einstein staring at finite space for the first time.
by blackeye
Sat Jan 05, 2008 6:51 am UTC
Forum: Mathematics
Topic: Math Websites
Replies: 125
Views: 175101

Re: Mathematics Resources (Website links)

thank you good sir! That sounds like just what I am looking for!
Hopefully I can scrounge up enough money to buy it in the next couple of weeks. :lol:
by blackeye
Tue Jan 01, 2008 9:19 am UTC
Forum: Mathematics
Topic: Math Websites
Replies: 125
Views: 175101

Re: Mathematics Resources (Website links)

I know this thread is about web links and not books... but I didn't think it was worth an entirely new topic. Is there a really good book(s) that covers everything from complicated algebra to the really complex stuff? I don't wanna derail the thread or anything so you can pm me links to awesome book...

Go to advanced search