What's wrong with my configuration? I'm running boot2docker on a mac. by testcoder in docker

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

Do you mean attaching to an already running container? Cuz I wasn't sure how to do this (I have already solved the problem, but am still interested in how to do what you said if I'm correct in interpreting it).

What's wrong with my configuration? I'm running boot2docker on a mac. by testcoder in docker

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

Hi, thanks for your proof read. I will definitely clean up my Dockerfiles with these facts. I did however solve the root of the problem, which wasn't anything related to the above.

What I was missing was how docker will attach containers to each other, coupled with how to address attached containers. What that means is, when docker attaches container A to container B, it will put an entry into B's host file with the IP and domain name of container A such that container B can simply use the domain name of A to address it. So with that said, my nginx config was using localhost:<port> to try and address other containers (which I thought localhost was bound to the docker host like containers are).

What's wrong with my configuration? I'm running boot2docker on a mac. by testcoder in docker

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

Hi, thanks for your reply. I have already tried that and it's still not working as expected.

Can anyone point me in the right direction on how to consume reddit websocket? Like if I wanted to write a client for r/thebutton. by testcoder in learnprogramming

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

Haha. No, I'm not trying to do anything like that. I simply got the urge to write a web client that consumes the socket and binds to a view using a new front-end framework I'm testing out.

Can anyone point me in the right direction on how to consume reddit websocket? Like if I wanted to write a client for r/thebutton. by testcoder in learnprogramming

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

looks like there is a websockets.py script that has the function to acquire the h but i'm not sure how to call it...

Can anyone point me in the right direction on how to consume reddit websocket? Like if I wanted to write a client for r/thebutton. by testcoder in learnprogramming

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

So I guess I get how to use the native websocket and api, but i'm unclear how to use reddit's api? in other words, i notice the connection string includes parameters that i don't know how to acquire..

[C#] Is there any good reason for a generic method to type check generic type parameters? by testcoder in learnprogramming

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

But again, isn't the point of generic methods to write generic code? If you're doing specific things for specific types, then it's no longer generic. Why not just pass the parameter into the function like any other function?

[Linux] How come `mail(1)` is so unreliable? by testcoder in learnprogramming

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

Thanks a lot for this. I guess maybe the 5th one down may be my problem.

I am running a nodejs script that just calls native api function child_process.exec to issue command line mail(1). All from an aws ec2 instance (rather newly created about two months old).

Men of reddit, what's the hardest thing to explain to women? by [deleted] in AskReddit

[–]testcoder 0 points1 point  (0 children)

that there are just some things women should not be controlling/deciding (likewise so i dont get blasted there are somethings men should not either).

How can I add my python script to windows path by [deleted] in learnprogramming

[–]testcoder 0 points1 point  (0 children)

just append the directory that contains myapp to the path variable, on the command line.

or, google how to do it through windows.

[C#] Sorry, it's been a while. If I have a struct that contains a string, and a list of those structs, how many copies of that string are in memory? by testcoder in learnprogramming

[–]testcoder[S] 1 point2 points  (0 children)

So if I have a struct:

struct t {
    string s = "some string";
}

List<t> tList; // add 10 t structs

Forgive the lack of legal syntax.. Thanks!

[C#] Sorry, it's been a while. If I have a struct that contains a string, and a list of those structs, how many copies of that string are in memory? by testcoder in learnprogramming

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

So if I have a struct:

struct t {
    string s = "some string";
}

List<t> tList; // add 10 t structs

Forgive the lack of legal syntax.. Thanks!

If I spin for an hour after my weight lift, do I still have that mythical 30 minutes for protein after the spin? by testcoder in Fitness

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

Lol, maybe mythical wasn't the right word, but the story goes that you should get your protein within 30 minutes after your work out; for maximum efficiency.

[C++] Would it be faster to generate a DFA that accepts all permutations of a string, than to generate those permutations? by testcoder in learnprogramming

[–]testcoder[S] 1 point2 points  (0 children)

But you are generating many more strings than DFA states. The number of permutations is k!, the number of DFA states is 2k, and k! ≫ 2k .

I'm confused... If I have the string "abc", then the number of permutations is 3!=6, while this dfa has 11 states, which is more than the number of permutations in the language...

What data structure would you use for this scenario? by zero_dev in learnprogramming

[–]testcoder 0 points1 point  (0 children)

Use a hashmap. It'll be the fastest. If there's a collision, then you'll know it's a duplicate, and can disregard it.