Search Results

Search found 4 results on 1 pages for 'bigdave'.

Page 1/1 | 1 

  • Would a cut and paste coder ever get past a job interview?

    - by bigdave
    As a long time cut and paste coder I never committed much of the syntax of a language to memory. Even worse, I now use google to solve many of the coding problems which are of the type typically used in job interviews. This has greatly increased my productivity, the quality of the end result and stops me perpetuating the same bugs across all my code. However it means I don't actually remember the detail of the solution. For some reason in a job interview "I would look that up on google" does not seem to be the right answer. Am I better off in the interview to pass no comment on my coding style and simply pull out an iPad and produce the solution?

    Read the article

  • iPhone SDK: How to generate a random time of day

    - by bigdave
    Hello all, I am having some problems trying to figure out the best way of generating a random time of day. For instance, if I want to choose a random time between the hours of 9am and 5pm, what would be the best way with the least amount of overhead on the device? I guess I need someone to point me in the right direction. Thanks!

    Read the article

  • How do you detect a website visitor's country (Specifically, US or not)?

    - by BigDave
    I need to show different links for US and non-US visitors to my site. This is for convenience only, so I am not looking for a super-high degree of accuracy, and security or spoofing are not a concern. I know there are geotargeting services and lists, but this seems like overkill since I only need to determine (roughly) if the person is in the US or not. I was thinking about using JavaScript to get the user's timezone, but this appears to only give the offset, so users in Canada, Mexico, and South America would have the same value as people in the US. Are there any other bits of information available either in JavaScript, or PHP, short of grabbing the IP address and doing a lookup, to determine this?

    Read the article

  • TypeError: unbound method make_request() must be called with XX instance, but how?

    - by Dave
    Running the code below I get E TypeError: unbound method make_request() must be called with A instance as first argument (got str instance instead) I dont want to set make_request method as static, I want to call it from an instance of an object. The example http://pytest.org/latest/fixture.html#fixture-function # content of ./test_smtpsimple.py import pytest @pytest.fixture def smtp(): import smtplib return smtplib.SMTP("merlinux.eu") def test_ehlo(smtp): response, msg = smtp.ehlo() assert response == 250 assert "merlinux" in msg assert 0 # for demo purposes My code """ """ import pytest class A(object): """ """ def __init__(self, name ): """ """ self._prop1 = [name] @property def prop1(self): return self._prop1 @prop1.setter def prop1(self, arguments): self._prop1 = arguments def make_request(self, sex): return 'result' def __call__(self): return self @pytest.fixture() def myfixture(): """ """ A('BigDave') return A def test_validateA(myfixture): result = myfixture.make_request('male') assert result =='result'

    Read the article

1