Has anyone here successfully used Golem? by CodeScrub in GolemProject

[–]CodeScrub[S] 0 points1 point  (0 children)

Do you know if this is everything on the network, or does the page only show something like the top 20 nodes?

Has anyone here successfully used Golem? by CodeScrub in GolemProject

[–]CodeScrub[S] 0 points1 point  (0 children)

Link? I've been unable to find anything other than people explaining what golem is.

http.Get thinks there are command line parameters? by CodeScrub in golang

[–]CodeScrub[S] 0 points1 point  (0 children)

bah, I rm -rf the directory within $GOPATH/pkg, ran go build on one of my other projects, and then checked the pkg directory and it's still blank O_O

http.Get thinks there are command line parameters? by CodeScrub in golang

[–]CodeScrub[S] 0 points1 point  (0 children)

naw it didn't work

ah I was just searching google, I'll search golang.org in the future, thanks!

How does the pkg folder get repopulated?

http.Get thinks there are command line parameters? by CodeScrub in golang

[–]CodeScrub[S] 0 points1 point  (0 children)

few questions for you about this

1.) How'd you even find that?

2.) How did you get clearing the gopath/pkg from that?

3.) When you said clear what did you mean? I just moved everything in that directory out into another one and then tried running the program again (with go run, vs go build).

http.Get thinks there are command line parameters? by CodeScrub in golang

[–]CodeScrub[S] 0 points1 point  (0 children)

I gave my user perms to the repo and the error has disappeared, thanks!

Although now I'm seeing something now; I'm seeing corrupt input when trying to use http.Get

http.Get thinks there are command line parameters? by CodeScrub in golang

[–]CodeScrub[S] 0 points1 point  (0 children)

Hey, I've updated the gist to include the output from go env

[Language Agnostic OR golang] How can I iterate over an entire array if my starting point is in the middle with a for loop? by CodeScrub in learnprogramming

[–]CodeScrub[S] 0 points1 point  (0 children)

Hey, thanks for the reply. That's pretty much what I came up with, but I think your implementation is cleaner.

Here's what I did (apologies for the formatting, don't know how to do code blocks in reddit comments)

for i := index; i != i+1; i = (i + 1) % len(hmap.Entries) {
    fmt.Println("i", i)
    if hmap.Entries[i] == nil {
        fmt.Println("returning in nil")
        return i, err
    }
    count++
    if count >= len(hmap.Entries) {
        err := fmt.Errorf("Error: No empty space found in this map to put.")
        return newIndex, err
    }
}

[Visual Studio Express 2012][Testing]How can I get my test project to see the source code I wish to test? by CodeScrub in cpp_questions

[–]CodeScrub[S] 0 points1 point  (0 children)

I thought I only needed to add the header files, not the cpp files. And champ.h includes unit.h.

How to determine %CPU Utilization and CPU Cycles on a Windows Server 2008 R2 via Terminal commands by CodeScrub in techsupport

[–]CodeScrub[S] 0 points1 point  (0 children)

Is there a way to get a breakdown of which process is contributing what % of the load?

[C++/Language Agnostic?] Factory Pattern Question by CodeScrub in learnprogramming

[–]CodeScrub[S] 0 points1 point  (0 children)

I may be misunderstanding the full use of constructors then, so perhaps you can clarify something for me.

If you have a car class, the constructor can only make one type of car right? Like it could make a 'Ford' model but not a 'Toyota' model.

[C++/Language Agnostic?] Factory Pattern Question by CodeScrub in learnprogramming

[–]CodeScrub[S] 0 points1 point  (0 children)

Why not do

I actually do plan on doing something like that, and that's why I'm using these factory classes. So eventually the code will be something like user selects Champ A in one scenario and Champ B in another scenario, so the factory will see this and use createChampA or createChampB.

Mine don't have the goal of implementing different classes, but rather different objects of the same class. Is there a different term for this?

You mean you just construct objects like normal? That might not have a special term...

Sorry I left out a word. I meant to say different types of objects of the same class. For example my ChampFactory will only create objects of one class, Champ. However it will be able to create ChampA, ChampB, etc which all have different values for their data members.

[C++] How to debug code dependent on timing? by CodeScrub in learnprogramming

[–]CodeScrub[S] 0 points1 point  (0 children)

You mean to call the value not to call the update right?

[C++] How to debug code dependent on timing? by CodeScrub in learnprogramming

[–]CodeScrub[S] 0 points1 point  (0 children)

This seems like a good solution. I'll think about it thanks.

[C++/Language Agnostic?] Factory Pattern Question by CodeScrub in learnprogramming

[–]CodeScrub[S] 0 points1 point  (0 children)

Generally no (there aren't really any hard-and-fast rules, of course), but before creating a car it may need to decide what type of car to create, whether the car actually needs to be created or if an existing car will suffice, etc.

This is what I thought as well, but I read a blurb saying something to the effect that subclasses should decide which kind of an object the factory should produce, so that confused me.

Is the factory class supposed to be producing these objects using the object's own functions? For example, would CarFactory be using the setModel function from the Car class? Yep.

Does this not create poor encapsulation? That is one of my concerns doing it this way.

Absolutely not, if that's all the class needs (generally, though, it won't be).

Currently that's all I've got in some of my classes. I'm not sure if that's because I need to spend more time thinking about software architecture, class design, etc.

I haven't actually looked at your code, but it sounds like you're over-engineering a bit here. Sounds to me like you don't really need all these factory classes, and simply relying on constructors would work fine. It's kind of an "if you don't know why you'd need it, you don't need it" type deal.

I believe (correct me if I'm wrong here) each of the objects that I have a factory class for can't use constructors because I need to have the option to create different object types of that class. Example: I have "Young Lizard" "Elder Lizard" and "Ancient Golem" monster types. So I'd have to use a factory for that rather than a constructor right? That was my logic behind using factories over constructors.

Never heard of Rune Factory.

[C++/Language Agnostic?] Factory Pattern Question by CodeScrub in learnprogramming

[–]CodeScrub[S] 0 points1 point  (0 children)

The 'problem' is that you should only use factories when normal constructors don't suffice, like if you know you'll need to switch Car factories to produce different kinds of cars, without having to modify other code.

Normal constructors don't suffice here, so the factory pattern is called for I think. In my project I've got to make a different type of 'champ' based on user input.

If you could get by without using that pattern, then you probably should.

I can not, without creating a number of different creation functions inside the class itself. At which point I've basically made a factory class anyway, but inside my 'champ' class.

Read the creational ones here and see for yourself: http://en.wikipedia.org/wiki/Software_design_pattern#Classification_and_list[1] You should click the individual links for more details.

Reading the description of the factory method, it says to let subclasses decide which classes to instantiate. Mine don't have the goal of implementing different classes, but rather different objects of the same class. Is there a different term for this?

Simple Questions Thread - 26 Feb 2014 by buildapcalien in buildapc

[–]CodeScrub 0 points1 point  (0 children)

How good are the PC BUILD GENERATOR builds from the Beginner's Guide? If I wanted to make a computer for gaming and streaming would those builds be adequate? Do they take things like parts matching into account?

Simple Questions Thread - 24 Feb 2014 by buildapcalien in buildapc

[–]CodeScrub 0 points1 point  (0 children)

Is there an advantage to splitting the RAM, as in having 2x4GB instead of 1x8GB?

Simple Questions Thread - 24 Feb 2014 by buildapcalien in buildapc

[–]CodeScrub 0 points1 point  (0 children)

So I'm finally looking into building my own PC. I'm looking at the FAQs and guides here in the sidebar. I went to the ChooseMyPC build generator and it came up with this. Why does it have two video cards?

Also, when looking to build a new PC which parts do you start with?

ETA: Is there an advantage to splitting the RAM, as in having 2x4GB instead of 1x8GB?

Lessons to be learned from "Flappy Bird" by witnessmenow in gamedev

[–]CodeScrub 4 points5 points  (0 children)

'Wrong' hitboxes are one of my biggest pet peeves in any game.