Search Results

Search found 167 results on 7 pages for 'eva dias'.

Page 2/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • Problem with urllib

    - by Eva
    I wrote this code: import urllib proxies = {'http': 'http://112.65.135.54:8080/'} opener = urllib.FancyURLopener(proxies) r = opener.open("http://www.python.org/") print r.read() and when I execute it this program works fine, and send for me source code of python.org But when i use this: import urllib proxies = {'http': 'http://80.176.245.196:1080/'} opener = urllib.FancyURLopener(proxies) r = opener.open("http://www.python.org/") print r.read() this program does not send me the source code of python.org What am I going to do?

    Read the article

  • Should I use a collection here?

    - by Eva
    So I have code set up like this: public interface IInterface { public void setField(Object field); } public abstract class AbstractClass extends JPanel implements IInterface { private Object field_; public void setField(Object field) { field_ = field; } } public class ClassA extends AbstractClass { public ClassA() { // unique ClassA constructor stuff } public Dimension getPreferredSize() { return new Dimension(1, 1); } } public class ClassB extends AbstractClass { public ClassB() { // unique ClassB constructor stuff } public Dimension getPreferredSize() { return new Dimension(42, 42); } } public class ConsumerA { public ConsumerA(Collection<AbstractClass> collection) { for (AbstractClass abstractClass : collection) { abstractClass.setField(this); abstractClass.repaint(); } } } All hunky-dory so far, until public class ConsumerB { // Option 1 public ConsumerB(ClassA a, ClassB b) { methodThatOnlyTakesA(a); methodThatOnlyTakesB(b); } // Option 2 public ConsumerB(Collection<AbstractClass> collection) { for (IInterface i : collection) { if (i instanceof ClassA) { methodThatOnlyTakesA((ClassA) i); else if (i instanceof ClassB) { methodThatOnlyTakesB((ClassB) i); } } } } public class UsingOption1 { public static void main(String[] args) { ClassA a = new ClassA(); ClassB b = new ClassB(); Collection<AbstractClass> collection = Arrays.asList(a, b); ConsumerA consumerA = new ConsumerA(collection); ConsumerB consumerB = new ConsumerB(a, b); } } public class UsingOption2 { public static void main(String[] args) { Collection<AbstractClass> collection = Arrays.asList(new ClassA(), new ClassB()); ConsumerA = new ConsumerA(collection); ConsumerB = new ConsumerB(collection); } } With a lot more classes extending AbstractClass, both options get unwieldly. Option1 would make the constructor of ConsumerB really long. Also UsingOption1 would get long too. Option2 would have way more if statements than I feel comfortable with. Is there a viable Option3? If it helps, ClassA and ClassB have all the same methods, they're just implemented differently. Thanks for slogging through my code!

    Read the article

  • perl code to python code

    - by Eva
    can you convert this perl code to python code : $list = $ARGV[0]; open (PASSFILE, "$list") || die "[-] Can't open the List of password file !"; @strings = ; close PASSFILE; Thanks

    Read the article

  • sum not working properly abap

    - by Eva Dias
    I'm trying to sum up some values but it keeps giving me weird values. I'm posting the code to help, and an image too of what is happening. at end of kunnr. soma-waers = <fs_main-waers. soma-wrbtr = <fs_main-wrbtr. soma-fwste = <fs_main-fwste. soma-hwaer = <fs_main-hwaer. soma-dmbtr = <fs_main-dmbtr. soma-hwste = <fs_main-hwste. APPEND soma TO it_soma. LOOP AT it_soma INTO soma. IF sy-tabix = 1. FORMAT COLOR COL_TOTAL INTENSIFIED OFF. SUM. WRITE: "/ sy-uline(137), / sy-vline NO-GAP, 'Subtotal' NO-GAP, '-' NO-GAP, soma-waers, 63 sy-vline NO-GAP, 64 soma-wrbtr NO-GAP, sy-vline NO-GAP, soma-fwste NO-GAP, sy-vline NO-GAP, soma-hwaer NO-GAP, sy-vline NO-GAP, soma-dmbtr NO-GAP, sy-vline NO-GAP, soma-hwste NO-GAP, sy-vline NO-GAP, / sy-uline(137). ELSE. ENDIF. ENDLOOP. ENDAT.

    Read the article

  • how to create a home server ? [closed]

    - by Eva
    i download appserv and install on my computer and set the default ip in my Default Gateway but when other people want to connect to my home server , they get the error of time out ! what am i going to do ? my server address : http://192.168.210.230/ and my firewall is now off ! also my antivirus pls help me . Thanks in advance

    Read the article

  • How to make Windows 7 write to Samba shared folder?

    - by Jader Dias
    I can access and read a Samba folder from Windows 7. I've been following some sites instructions: My Windows 7 is configured like told below: http://www.tomshardware.com/forum/75-63-windows-samba-issue http://www.linuxquestions.org/questions/linux-server-73/windows-7-beta-1-and-samba-696990/ And my smb.conf has a shared folder, configured for do not require authentication, as the following site says so: http://ubuntuforums.org/showthread.php?t=658056 I also tried the following: chmod -R 775 sharedfolder chown -R someuser:somegroup sharedfolder in smb.conf : create mask = 0775 But I still get the message that I have no permission to write.

    Read the article

  • How to configure basic authentication in Apache httpd virtual hosts?

    - by Jader Dias
    I'm trying to configure mercurial access using Apache http. It requires authentication. My /etc/apache2/sites-enabled/mercurial looks like this: NameVirtualHost *:8080 <VirtualHost *:8080> UseCanonicalName Off ServerAdmin webmaster@localhost AddHandler cgi-script .cgi ScriptAliasMatch ^(.*) /usr/lib/cgi-bin/hgwebdir.cgi/$1 </VirtualHost> Every tutorial I read on the internet tells me to insert these lines: AuthType Basic AuthUserFile /usr/local/etc/httpd/users But when I do it I get the following error: # /etc/init.d/apache2 reload Syntax error on line 8 of /etc/apache2/sites-enabled/mercurial: AuthType not allowed here My distro is a customized Ubuntu called Turnkey Linux Redmine

    Read the article

  • How to run a Turnkey Linux virtual machine on XenServer?

    - by Jader Dias
    Turnkey Linux distributes Linux virtual machines in a Xen compatible format. I have a XenServer instance running and I would like to run a recently downloaded Turnkey Linux virtual machine on it. But I have never used XenServer before. Can you point me a tutorial specific for this case, since the manual doens't seem to cover it very well?

    Read the article

  • How to add another application to apache?

    - by Jader Dias
    I was following the Zabbix installation tutorial for Ubuntu and it requested that I added a file /etc/apache2/sites-enabled/000-default containing Alias /zabbix /home/zabbix/public_html/ <Directory /home/zabbix/public_html> AllowOverride FileInfo AuthConfig Limit Indexes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec <Limit GET POST OPTIONS PROPFIND> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS PROPFIND> Order deny,allow Deny from all </LimitExcept> </Directory> But I already have /etc/apache2/sites-enabled/railsapp NameVirtualHost *:80 NameVirtualHost *:443 <VirtualHost *:80> UseCanonicalName Off Include /etc/apache2/conf/railsapp.conf </VirtualHost> <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/ssl/certs/cert.pem Include /etc/apache2/conf/railsapp.conf RequestHeader set X_FORWARDED_PROTO 'https' </VirtualHost> and /etc/apache2/sites-enabled/mercurial NameVirtualHost *:8080 <VirtualHost *:8080> UseCanonicalName Off ServerAdmin webmaster@localhost AddHandler cgi-script .cgi ScriptAliasMatch ^(.*) /usr/lib/cgi-bin/hgwebdir.cgi/$1 </VirtualHost> I think that it is because of the already existing virtual hosts that my I can't access the zabbix page. How to circumvent this?

    Read the article

  • 2 nics. 2 Defaults Gateways

    - by andre.dias
    Here is my scenario: i have this server with 2 nics, each one with different IPs, connected to differents routers. Almost everything is configured whe way i need. Traffic coming from eth0 exits using eth0, traffic coming from eth1 exits using eth1. And there is a default gateway configured. $route: default IP 0.0.0.0 UG 0 0 0 eth0 With this configuration, the traffic generated in the server is going out using eth0 (lynx www.google.com for example). The problem is: the Internet link from eth0 went down today. The traffic coming from eth1 was ok...no problem. But the traffic generated in the server was a problem...the default gateway was out...no access do the Internet anymore (no more lynx www.google.com) So i added a new default gateway configuration, pointing to eth1. For 30 minutes i kept that way...2 default gateways, but just one was "working"...and everything was working just fine. But then i removed de eth0 gateway entry because, well, 2 default gateways is kind of weird. My question: is there any problem on keeping these 2 default gateways, one for each? So i don´t need to do nothing when one link go down again? $route: default IP1 0.0.0.0 UG 0 0 0 eth0 default IP2 0.0.0.0 UG 0 0 0 eth1

    Read the article

  • How to manage service failover?

    - by Jader Dias
    I am using Windows Network Load Balancing to keep my apps available even when one of the servers is down. But when all servers are up, but one instance of a service in one of them is down, I would like to not send requests to it, because those requests will be lost. Is there any solution that addresses this problem?

    Read the article

  • In Zabbix how to zero data when it doesn't comes?

    - by Jader Dias
    If a variable is expected to be fetched every minute, and it doesn't happen, the graph shows the last known value for all the timespan until the next known value. The expected behavior for me is that the graph showed no line, or a line next to the zero, where there is no data. How to achieve this with Zabbix?

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >