It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
low rated
Here's another little quiz:

What does the following Python code print?

from __future__ import print_function
x = 3
y = [x for x in range(3)]
print(x, y)
avatar
dtgreene: Here's another little quiz:

What does the following Python code print?

from __future__ import print_function
x = 3
y = [x for x in range(3)]
print(x, y)
I really want to say the sheet music for Back to the Future. But not knowing python, it'll likely be a series of numbers which might turn out to be nuclear launch codes.
avatar
dtgreene: Here's another little quiz:

What does the following Python code print?

from __future__ import print_function
x = 3
y = [x for x in range(3)]
print(x, y)
Normally, I would expect:
(3, [0, 1, 2])

But since you're asking, perhaps it's:
(2, [0, 1, 2])

But frankly anyone using the same variable name for two things in the same function does not deserve any output.

P.S. The output may look different because of the future print function. Never tried it. The only __future__ I import is division.
avatar
dtgreene: Here's another little quiz:

What does the following Python code print?
Depends on the version of Python?
low rated
avatar
dtgreene: Here's another little quiz:

What does the following Python code print?

from __future__ import print_function
x = 3
y = [x for x in range(3)]
print(x, y)
avatar
mrkgnao: Normally, I would expect:
(3, [0, 1, 2])

But since you're asking, perhaps it's:
(2, [0, 1, 2])

But frankly anyone using the same variable name for two things in the same function does not deserve any output.

P.S. The output may look different because of the future print function. Never tried it. The only __future__ I import is division.
The future print function makes it so that the parenthesis don't appear in the output. Basically, it gives Python 2 the print function that Python 3 has. (In Python 3, this does nothing.)

This means that the following code is actually illegal in both versions of Python:
from __future__ import print_function
print 0
avatar
dtgreene: Here's another little quiz:

What does the following Python code print?
avatar
Maighstir: Depends on the version of Python?
That is actually correct.

In Python 2 it prints
2 [0, 1, 2]

(The variable "x" from the list comprehension leaks into the outer scope.

In Python 3, this does not happen, so you get
3 [0, 1, 2]

Of note, if we replace the list comprehension with a generator expression, then the variable no longer leaks out, regardless of Python version.
Post edited December 09, 2015 by dtgreene
Some times I hate computers...

Just managed to motivate myself to try and do something, and Eclipse won't start... not the usual mismatched Java versions error (which I usually get), something to do with not resolving modules...

!SESSION 2015-12-09 21:15:04.950 -----------------------------------------------
eclipse.buildId=4.6.0.I20150916-2000
java.version=1.7.0_21
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

!ENTRY com.python.pydev 4 0 2015-12-09 21:15:07.412
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: com.python.pydev [15]
Unresolved requirement: Require-Bundle: org.eclipse.ui
-> Bundle-SymbolicName: org.eclipse.ui; bundle-version="3.107.0.v20150914-1638"; singleton:="true"
org.eclipse.ui [459]
Unresolved requirement: Require-Bundle: org.eclipse.core.runtime; bundle-version="[3.2.0,4.0.0)"
-> Bundle-SymbolicName: org.eclipse.core.runtime; bundle-version="3.12.0.v20150912-0621"; singleton:="true"
org.eclipse.core.runtime [122]
Unresolved requirement: Require-Bundle: org.eclipse.core.jobs; bundle-version="[3.2.0,4.0.0)"; visibility:="reexport"
-> Bundle-SymbolicName: org.eclipse.core.jobs; bundle-version="3.8.0.v20150911-1658"; singleton:="true"
org.eclipse.core.jobs [117]
Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.8))"

at org.eclipse.osgi.container.Module.start(Module.java:429)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533 )
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
And there are lots of those (a few hundred I would say) for lots of various modules.


Anyone know anything about Eclipse?
I've tried a couple of the suggestions online (deleting .snap files and deleting metadata folders) but no luck so far.. I don't really want to reinstall completely if I can as that would (presumably) mean redownloading and configuring all the various plug ins etc..
avatar
adaliabooks: Anyone know anything about Eclipse?
I've tried a couple of the suggestions online (deleting .snap files and deleting metadata folders) but no luck so far.. I don't really want to reinstall completely if I can as that would (presumably) mean redownloading and configuring all the various plug ins etc..
Don't know anything about Eclipse, but two things I do regularly when all hell breaks loose and surprisingly often help:
1) Reboot
2) Check the antivirus's vault to see whether it might have quarantined some vital component
avatar
adaliabooks: Anyone know anything about Eclipse?
I've tried a couple of the suggestions online (deleting .snap files and deleting metadata folders) but no luck so far.. I don't really want to reinstall completely if I can as that would (presumably) mean redownloading and configuring all the various plug ins etc..
avatar
mrkgnao: Don't know anything about Eclipse, but two things I do regularly when all hell breaks loose and surprisingly often help:
1) Reboot
2) Check the antivirus's vault to see whether it might have quarantined some vital component
I'll try rebooting, it may help, but I don't use anti virus so I doubt that's a problem...
Thanks for the suggestions :)
I'm in a strange situation. My boss want to give up the project I'm currently working on. The customer wants to hire me directly. I would say yes in a blink if they were in-town. But they're not. They are pretty forthcoming regarding working hours in-house. And they don't seem to cheap about the salary (though that is to be negotiated still). Buy they have pretty (for me) bad holiday rules. And that's something I really have problem to accept - would probably be different if I was single without children.

My wife hates the proposal for that reason - no matter what the money. Now what to do.
avatar
toxicTom: My wife
I have edited your post, leaving only the words that really matter to making the decision.
Post edited December 12, 2015 by mrkgnao
avatar
adaliabooks: Some times I hate computers...

Just managed to motivate myself to try and do something, and Eclipse won't start... not the usual mismatched Java versions error (which I usually get), something to do with not resolving modules...

!SESSION 2015-12-09 21:15:04.950 -----------------------------------------------
eclipse.buildId=4.6.0.I20150916-2000
java.version=1.7.0_21
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

!ENTRY com.python.pydev 4 0 2015-12-09 21:15:07.412
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: com.python.pydev [15]
Unresolved requirement: Require-Bundle: org.eclipse.ui
-> Bundle-SymbolicName: org.eclipse.ui; bundle-version="3.107.0.v20150914-1638"; singleton:="true"
org.eclipse.ui [459]
Unresolved requirement: Require-Bundle: org.eclipse.core.runtime; bundle-version="[3.2.0,4.0.0)"
-> Bundle-SymbolicName: org.eclipse.core.runtime; bundle-version="3.12.0.v20150912-0621"; singleton:="true"
org.eclipse.core.runtime [122]
Unresolved requirement: Require-Bundle: org.eclipse.core.jobs; bundle-version="[3.2.0,4.0.0)"; visibility:="reexport"
-> Bundle-SymbolicName: org.eclipse.core.jobs; bundle-version="3.8.0.v20150911-1658"; singleton:="true"
org.eclipse.core.jobs [117]
Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.8))"

at org.eclipse.osgi.container.Module.start(Module.java:429)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533 )
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
avatar
adaliabooks: And there are lots of those (a few hundred I would say) for lots of various modules.

Anyone know anything about Eclipse?
I've tried a couple of the suggestions online (deleting .snap files and deleting metadata folders) but no luck so far.. I don't really want to reinstall completely if I can as that would (presumably) mean redownloading and configuring all the various plug ins etc..
I tried using Eclipse. I tried hard to love it. I just can't. Netbeans for me just works. Eclipse takes a million things to do just to get the editor to do something and then after all that effort, the IDE can just decide to break down. Switched and never looked back.
avatar
mrkgnao: I have edited your post, leaving only the words that really matter to making the decision.
LOl and +1

You're probably right...

But then...


I don't know... my head is spinning. And has been for a week.
I would own a lot of money. I could build up my own team. I would really be lead software developer/architect/senior/whatever... which I think I was born to be. But it's totally incompatible to "family".

Fuck.

Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck.
avatar
niniendowarrior: I tried using Eclipse. I tried hard to love it. I just can't. Netbeans for me just works. Eclipse takes a million things to do just to get the editor to do something and then after all that effort, the IDE can just decide to break down. Switched and never looked back.
I just love Eclipse, used quite a few different IDE's before finding it but it works for me. Plus the fact that you can do anything in it appeals (I do Python, Java and C++ programming all from the same IDE which is handy and means I don't forget where things are.. even my PHP / Javascript editor is based off Eclipse)

But it does frequently not work for no apparent reason...
Incidentally, I got it working again and it was the same Java problem it usually is, just in a different format this time...

I think I've used Netbeans, or a variant of it (I believe the jMonkeyEngine's IDE is based off Netbeans), and it's all right, but I prefer Eclipse..

avatar
toxicTom: LOl and +1

You're probably right...

But then...

I don't know... my head is spinning. And has been for a week.
I would own a lot of money. I could build up my own team. I would really be lead software developer/architect/senior/whatever... which I think I was born to be. But it's totally incompatible to "family".

Fuck.

Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck. Fuck.
That sucks... but I have to agree with mrkgnao...
Happy wife, happy life ;)

Is there any chance of negotiating things to make the job more compatible? Or is it just the nature of what you would be doing that makes it not work with family?
avatar
niniendowarrior: I tried using Eclipse. I tried hard to love it. I just can't. Netbeans for me just works. Eclipse takes a million things to do just to get the editor to do something and then after all that effort, the IDE can just decide to break down. Switched and never looked back.
avatar
adaliabooks: I just love Eclipse, used quite a few different IDE's before finding it but it works for me. Plus the fact that you can do anything in it appeals (I do Python, Java and C++ programming all from the same IDE which is handy and means I don't forget where things are.. even my PHP / Javascript editor is based off Eclipse)

But it does frequently not work for no apparent reason...
Incidentally, I got it working again and it was the same Java problem it usually is, just in a different format this time...

I think I've used Netbeans, or a variant of it (I believe the jMonkeyEngine's IDE is based off Netbeans), and it's all right, but I prefer Eclipse..
Netbeans is decent and straight to the point. However, I've only really used it extensively for Java, JSP, Servlets, JSTL and JSEL and not much else.

Eclipse was such a pain to get to behave where as Netbeans was relatively straightforward. I really love the SQL integration plugin in Eclipse but if the entire IDE is at odds with me, I can do with some commandline SQL.
Post edited December 12, 2015 by niniendowarrior
Someone here may be able to help me with this..

I need a secure HTTPS connection to properly implement the covers for the legacy shelf in my script, to this end I applied for the Beta of Let's Encrypt and got accepted.

But now I don't really know what to do.. I tried following the commands (on my own computer) but this didn't work. I assume I need to actually run it on the server, but I don't think that's possible (it's just a hosting package I use for my business website, it runs on cPanel and from what I could find I can't use Git with cPanel, not easily anyway).

These are the three installation instruction pages from their website explaining what to do: , [url=https://letsencrypt.readthedocs.org/en/latest/intro.html]two, three.

It does say something about Unix-ish OSes (but I thought that included Windows) so that might be my problem... I'm just not really sure what I'm doing wrong and really haven't a clue what I'm doing anyway..

Any ideas?
Thanks :)