These are chat archives for pybee/general

2nd
Mar 2017
Sanjeev
@Sanjeev-S
Mar 02 2017 00:05
Should the python code be calling that file? time.js
Sanjeev
@Sanjeev-S
Mar 02 2017 00:14
I'm not getting how any python code would result in time.js code appearing in web inspector.
Russell Keith-Magee
@freakboy3742
Mar 02 2017 00:16
Put the following code into the text box:
import time
time.mktime((1970, 4, 1, 0, 0, 0, 0, 0, 1))
That is python code.
You hit submit, it sends it to the server, where it is compiled to Python Bytecode, then sent back to the browser.
In the browser, the bytecode is execute - by Javascript.
When “import time” runs, it loads a javascript module - the time.js file, implementing the Python time API.
Does that make sense?
Sanjeev
@Sanjeev-S
Mar 02 2017 00:18
Yes :)
Abhidnya Andraskar
@gEt-rIgHt-jR
Mar 02 2017 01:21
the link given for __mul__() implementation is incorrect
Elias Dorneles
@eliasdorneles
Mar 02 2017 01:23
Alright, I've just got working my first Android game powered by VOC =)
Screenshot_1488417799.png
for the curious, code is here: https://github.com/eliasdorneles/tictactoe-voc
Sanjeev
@Sanjeev-S
Mar 02 2017 01:25
@gEt-rIgHt-jR Yes, it is incorrect. But I think it is the problem as code changes when pointing to a line number.
@eliasdorneles Oooh, nice :)
Russell Keith-Magee
@freakboy3742
Mar 02 2017 01:25
@eliasdorneles WOOHOO!!! never have I been so excited by a game of tic tac toe! :-)
Abhidnya Andraskar
@gEt-rIgHt-jR
Mar 02 2017 01:25
ya
Russell Keith-Magee
@freakboy3742
Mar 02 2017 01:26
@gEt-rIgHt-jR Yeah - unfortunately, the link will drift with time as other code is added to the file...
Elias Dorneles
@eliasdorneles
Mar 02 2017 01:27
@freakboy3742 yeaaah, same here! :D
it's working around a few bugs that I couldn't quite reproduce nicely in a test case yet (there are XXX comments in the code), will dig deeper later
Russell Keith-Magee
@freakboy3742
Mar 02 2017 01:28
Awesome - fantastic work, mate!
Elias Dorneles
@eliasdorneles
Mar 02 2017 01:28
Thanks! =)
Elias Dorneles
@eliasdorneles
Mar 02 2017 01:35

The bugs that are making the code look weird:

  • KeyError is the only builtin exception that takes argument and I can't raise a custom exception (pybee/voc#352 and pybee/voc#255 )
  • can't nest loops through the results of the same generator function (pybee/voc#376)
  • some kinds of list comprehensions fail (haven't put my finger on what's causing that, yet) (pybee/voc#369)

I think I'll put those in my priority, but I'm also willing to coach anyone else willing to dig deeper on them. :)

Sanjeev
@Sanjeev-S
Mar 02 2017 01:48
While debugging javascript in browser, how do I see the value of a variable? Say in this case sequence[0]. (Sorry if it's a slightly noob question, I haven't worked with projects this large)
https://drive.google.com/file/d/0B9j9MJrQhCt2bjdNQWIwWE5QWEU/view
Russell Keith-Magee
@freakboy3742
Mar 02 2017 01:50
@Sanjeev-S Over on the right - the “scope” section is all the variables currently in scope. Locals are just in the current function; globals are external; you may also have a closure section, depending on what is executing.
Sanjeev
@Sanjeev-S
Mar 02 2017 01:54
I had checked the locals section already actually. But it has a lot of other variables. I cant seem to find the variable from time.js
https://drive.google.com/open?id=0B9j9MJrQhCt2ck1JS0paTkZZU1U
Russell Keith-Magee
@freakboy3742
Mar 02 2017 01:55
Looks like you’re not actually at the breakpoint you’ve marked - you’re in a different scope. When you’re at the breakpoint, the whole line will be highlighted.
Sanjeev
@Sanjeev-S
Mar 02 2017 02:02
Yes, apparently. I don't know what I did different now, but I can see the variables now. I just removed and put the breakpoint again.
And yes, the whole line is highlighted now.
captaincrunch21
@captaincrunch21
Mar 02 2017 08:52
Hi I need help getting started can anyone suggest where to start
Sanjeev
@Sanjeev-S
Mar 02 2017 09:34
@captaincrunch21 Hey welcome :)
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 12:57
Hello Everyone. I am Deepanshu Thakur, Computer Science student and currently working as a Python Developer at Celebal Corp. I like the idea behind VOC and would love to contribute in the same project. I am here for GSoC. I have around 3+ years of experience working with Python.
Can anyone please suggest me the prerequisites to work on VOC project?
I would love to do a task/bug-fix/read to demonstrate my skills. :)
Ashwani Gupta
@ashwani99
Mar 02 2017 13:05
Welcome @Deepanshu2017 You can start here http://pybee.org/contributing/how/first-time/
:tada:
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:06
Thank you Ashwani I was already going through that link :)
Ashwani Gupta
@ashwani99
Mar 02 2017 13:06
Great
shim1998
@shim1998
Mar 02 2017 13:06
my VOC is not getting installed
someone please help?
Deepankar Agrawal
@deep110
Mar 02 2017 13:07
@shim1998 what problem r u facing, can you post the snippet of error here
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:07
@ashwani99 I couldn't find much information regarding the VOC there
shim1998
@shim1998
Mar 02 2017 13:08
i tried to run the setup it opens and then closes back again :/
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:08
I have skipped the virtual env part and python installation because I have already did that several time :)
shim1998
@shim1998
Mar 02 2017 13:08
Screenshot (140).png
wait the photo is getting uploaded
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:09
@shim1998 where did you found the codebase
shim1998
@shim1998
Mar 02 2017 13:09
somebody uploaded the link here
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:09
I would love to download the code and try to setup voc on my local system
Deepankar Agrawal
@deep110
Mar 02 2017 13:09
Ashwani Gupta
@ashwani99
Mar 02 2017 13:10
Its on github
shim1998
@shim1998
Mar 02 2017 13:10
@Deepanshu2017 I downloaded it and ran the setup but i am afraid it didn't work
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:10
Thank you @deep110
shim1998
@shim1998
Mar 02 2017 13:10
I downloaded this only
Ashwani Gupta
@ashwani99
Mar 02 2017 13:11
Hey can anyone help me with python 3.4 installation?
I'mm on ubuntu 16.04
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:11
@ashwani99 which kind of help you need
Deepankar Agrawal
@deep110
Mar 02 2017 13:11
@shim1998 its just the snippet of files, have you tried to run a test program
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:11
If you are on ubuntu you should already ahve python3 installed
shim1998
@shim1998
Mar 02 2017 13:11
I guess python 3.4 is available there
yes
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:12
VOC code is in Python3?
shim1998
@shim1998
Mar 02 2017 13:12
yup
Deepankar Agrawal
@deep110
Mar 02 2017 13:12
16.04 have 3.5+, u need a local distribution
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:12
need to setup my virtualenv accordingly
Thank you
Deepankar Agrawal
@deep110
Mar 02 2017 13:12
yep
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:12
which version of python3?
greater or equal3.5?
Ashwani Gupta
@ashwani99
Mar 02 2017 13:12
@deep110 Exactly. VOC needs 3.4+
Deepankar Agrawal
@deep110
Mar 02 2017 13:13
nope use 3.4, its not mentioned that all the things will work with 3.4+
Though project mentors can confirm this, I only got this info from the link, about voc history :)
Ashwani Gupta
@ashwani99
Mar 02 2017 13:14
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:14
@deep110 looks like I need python 3.4 as it says Compiles Python 3.4 source files into Java class files
Deepankar Agrawal
@deep110
Mar 02 2017 13:15
yep, exactly my point
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 13:15
Ahh finally a good doc to read Thank you @ashwani99 :)
Ashwani Gupta
@ashwani99
Mar 02 2017 13:15
:smile:
Ashwani Gupta
@ashwani99
Mar 02 2017 13:21
@deep110 how did you install python3.4?
Deepankar Agrawal
@deep110
Mar 02 2017 13:23
Ashwani Gupta
@ashwani99
Mar 02 2017 13:25
:+1:
shim1998
@shim1998
Mar 02 2017 14:40
Can this VOC work on windows or ubuntu is necessary
:'( i can't seem to make it work
Rachit Kansal
@RachitKansal
Mar 02 2017 15:20
I have built ouroboros and would like to know some beginner issues to fix
Elias Dorneles
@eliasdorneles
Mar 02 2017 15:21
@shim1998 it works on Windows, yes, as long as you have Java JDK and Python 3.4 installed
at least, it should. but I know that it works on Mac and Ubuntu
I can confirm that it requires 3.4+ :thumbsup:
I haven't tested much on 3.5, though
@Deepanshu2017 if you're interested in solving a VOC issue, there are a few of them marked with the label "up-for-grabs": https://github.com/pybee/voc/issues?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs
you can pick one, and try to figure out how to fix it -- feel free to ask any questions about it
captaincrunch21
@captaincrunch21
Mar 02 2017 15:26
@Sanjeev-S I did check out the article , It's my first open source project so I need some help going forward
Elias Dorneles
@eliasdorneles
Mar 02 2017 15:27
@shim1998 can you share the error that shows up? if you try to run python setup.py in the command line?
@shim1998 are you following the installation instructions here? http://voc.readthedocs.io/en/latest/intro/install.html
Damanpreet Singh
@fumblehool
Mar 02 2017 15:40
Hi everyone! My name is Damanpreet and I am currently pursuing Bachelor of Technology in Information Technology. I would like to contribute to Batavia. I have access to both Windows and Linux machines. I am just starting to setup Batavia on my machine. I would like to ask Should I use Linux or Windows for the same?
I read in some doc that contributions using Windows are required to fix incompatibility problems.
Elias Dorneles
@eliasdorneles
Mar 02 2017 15:49
@fumblehool I can't speak much about Batavia on Windows, but you can try both and see what works best for you
Damanpreet Singh
@fumblehool
Mar 02 2017 15:56
@eliasdorneles Thanks. I am currently testing on ubuntu.
satyam26
@Satyam26
Mar 02 2017 17:42
hello everyone ,I am Satyam Gaurav pursuing B.Tech Computer Science being in 3rd year. I show your idea of VOC through GSOC 2017. Your idea is very interesting and i really love to work and contribute. I am beginner to open source but very determined to work on your idea.I have got good knowledge in Java and Python. Please help me getting started.
Satrap Rathore
@etotientz
Mar 02 2017 17:45
@Satyam26 plz go through README file of https://github.com/pybee/voc
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 17:51

@Deepanshu2017 if you're interested in solving a VOC issue, there are a few of them marked with the label "up-for-grabs": https://github.com/pybee/voc/issues?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs

Thank you for the link. It's quite late here but I try to scratch my head on a bug. Thank you again :)

Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 18:29
@eliasdorneles can you or anyone else please explain me what term signature means in this link?
https://voc.readthedocs.io/en/latest/internals/signatures.html
is signatures here referring to how VOC converts a simple python function into internal voc signature so that it can be converted into java class file?
As I was reading the doc, it was mentioned that, VOC does not create intermediate java source file so I am assuming that these signatures are some intermediate code to create java class file
Kamal Mukkamala
@Kamalnrf
Mar 02 2017 19:00
My Build Failed while trying "ant build"
BUILD FAILED
I:\Projects\tutorial\voc\build.xml:8: Execute failed: java.io.IOException: Cannot run program "python" (in directory "I:\Projects\tutorial\voc"): CreateProcess error=2,
 The system cannot find the file specified
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at java.lang.Runtime.exec(Runtime.java:620)
        at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
        at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:426)
        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:440)
        at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:629)
        at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:670)
        at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:496)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:180)
        at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93)
        at org.apache.tools.ant.Main.runBuild(Main.java:832)
        at org.apache.tools.ant.Main.startAnt(Main.java:236)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:113)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
        at java.lang.ProcessImpl.start(ProcessImpl.java:137)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 21 more

Total time: 0 seconds
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 19:03
Hi! @Kamalnrf did you followed the installation steps as described Here
Kamal Mukkamala
@Kamalnrf
Mar 02 2017 19:03
yes
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 19:04
and also if you can please elaborate about your environment. Because according to my understanding error is due to some missing file
I followed the steps as described in the installation guide and it worked like charm.
Kamal Mukkamala
@Kamalnrf
Mar 02 2017 19:05
My python version is 3.4.3
Java - 1.8
ant - 1.10.1
Kamal Mukkamala
@Kamalnrf
Mar 02 2017 19:17
somehow magically it worked when I tried again...
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 19:18
haha I was pulling down java and python 3.4.3 in my windows laptop so that I can replicate the issue.
Thanks for the information :)
Kamal Mukkamala
@Kamalnrf
Mar 02 2017 19:18
Thank you
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 19:18
What you did to make it work?
Kamal Mukkamala
@Kamalnrf
Mar 02 2017 19:19
nothing
VarBat
@VarBat
Mar 02 2017 19:25
Hi
Iam varshith of IIT Madras first year I got to know that pybee has been selected for gsoc 2017 I wanted to contribute my part to open source . All I know is c language and Python what do I have to do
Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 19:42

BTW: The annotation is needed so that the right method prototype is rolled out in the bytecode. Without annotations, VOC assumes everything is an org.python.Object, which won’t meet the interface requirements.

Point taken here.

for the curious, code is here: https://github.com/eliasdorneles/tictactoe-voc

@eliasdorneles I am just curious here, why you have two python functions doing exactly the same thing in your code at line 63 and you are using them at line 151?

The bugs that are making the code look weird:

  • KeyError is the only builtin exception that takes argument and I can't raise a custom exception (pybee/voc#352 and pybee/voc#255 )
  • can't nest loops through the results of the same generator function (pybee/voc#376)
  • some kinds of list comprehensions fail (haven't put my finger on what's causing that, yet) (pybee/voc#369)
    I think I'll put those in my priority, but I'm also willing to coach anyone else willing to dig deeper on them. :)

Ahh now I know why you have exactly same function with different name. I would love to work on these issues. @eliasdorneles

Deepankar Agrawal
@deep110
Mar 02 2017 19:57

@freakboy3742 @eliasdorneles I was trying to implement right hand functions for mainly complex types, since CPython does

5.0+x; 5/x; etc... where x is complex type.

using them. But voc doesn't seem to be calling them. Can u point me out where to write the method to call them, or should we write operation code in add, or sub of respective datatypes of Int, Float, etc.

Deepanshu Thakur
@Deepanshu2017
Mar 02 2017 20:13

Hi, I found that there are no __r*__ (e.g. __radd__) methods in org.python.Object interface. Is it on purpose?

I have exactly same question @eliasdorneles as @leasunhy have

Elias Dorneles
@eliasdorneles
Mar 02 2017 20:42
Hi @Deepanshu2017: so, about the signatures in https://voc.readthedocs.io/en/latest/internals/signatures.html
Those are about mapping the way passing arguments work in Python to Java
Elias Dorneles
@eliasdorneles
Mar 02 2017 21:44
(sorry, started writing but got interrupted)
So, Python functions can define some positional arguments and keyword arguments
The signatures there are meant for defining how these will map to the objects received on the Java code
Elias Dorneles
@eliasdorneles
Mar 02 2017 22:06
about the __r*__ methods, I'm not sure, would have to look it up
@freakboy3742 can I have your greenlight to update the VOC description, from A transpiler that converts Python bytecode into Java bytecode. to A transpiler that converts Python code into Java bytecode.
essentially, s/bytecode/code/ :)
Russell Keith-Magee
@freakboy3742
Mar 02 2017 22:39
@eliasdorneles yes - agreed that change needs to be made.
Jonas Schell
@Ocupe
Mar 02 2017 22:56
@freakboy3742 Good Year 2017 for all of you. I was busy studying and working but now I’m back to work on toga for macOS and iOS.
Russell Keith-Magee
@freakboy3742
Mar 02 2017 22:56
@Ocupe Awesome! Welcome back!
Jonas Schell
@Ocupe
Mar 02 2017 22:57
Did anything big happening on the toga front?
Russell Keith-Magee
@freakboy3742
Mar 02 2017 22:57
Oh, we pivotted and turned into an ice cream delivery service. :-)
But seriously - nothing too drastic. Lots of building out formal interfaces, documentation, and so on. Android is almost working too.
Jonas Schell
@Ocupe
Mar 02 2017 22:58
That’s good news for the GSoC :D
Sommer and ice cream
Is there any chance of getting a toga project into the GSoC? Or is it VOC and Batavia first?
Russell Keith-Magee
@freakboy3742
Mar 02 2017 23:00
VOC and Batavia are the obvious candidates because the todo list is so well defined - but if you can pitch a good project for Toga, we’ll totally look at it.
Jonas Schell
@Ocupe
Mar 02 2017 23:00
Nice
Other question, do you know any recent Objective-C literature/tutorials that you can recommend? It’s all Swift nowadays.
related to app development of course.
Russell Keith-Magee
@freakboy3742
Mar 02 2017 23:03
Unfortunately, not really. The Apple guides are pretty good about their APIs though - they’re always available in both Swift and ObjC
Jonas Schell
@Ocupe
Mar 02 2017 23:04
That’s true but I was looking for something that was more an overview of how the pieces interact and work together than class specifics.
I’ll find something. Thank you :)
Russell Keith-Magee
@freakboy3742
Mar 02 2017 23:05
There’s two sources of docs though - there’s class references, and there are topic guides.
For example:
Jonas Schell
@Ocupe
Mar 02 2017 23:08
That’s nice!
Thank you
Deepankar Agrawal
@deep110
Mar 02 2017 23:11

Hi, I was trying to implement right hand functions for mainly complex types, since they are used in CPython.

5.0+x; 5/x; etc... where x is complex type.

But voc doesn't seem to be calling them. Can u point me out where to write the code to call them (I skimmed through ast.py but it mainly seems to be making javabytecode instructions). Should we write operation codes in add, sub, etc of respective datatypes of Int, Float, etc., but CPython doesn't do that. Any help regarding this? :confused:

Russell Keith-Magee
@freakboy3742
Mar 02 2017 23:13
@deep110 I’m confused - The Python statement 5.0 + x won’t invoke __radd__ - it will use regular add on the Float type.
(unless I’m mistaken)
Deepankar Agrawal
@deep110
Mar 02 2017 23:14
yes, it will but if we don't implement complex addition in Float.add() then it will
Russell Keith-Magee
@freakboy3742
Mar 02 2017 23:14
Sure… but that just means that the implementation of Float is incomplete
Deepankar Agrawal
@deep110
Mar 02 2017 23:14
I extended Complex class and overriden radd to check this
Russell Keith-Magee
@freakboy3742
Mar 02 2017 23:14
I mean, sure - we need to implement __radd__ et al, but Complex isn’t the place to test it.
Deepankar Agrawal
@deep110
Mar 02 2017 23:16
Yes, that's why I am asking you what to do :smile: I am also little confused here. And by complex I was just giving example
Russell Keith-Magee
@freakboy3742
Mar 02 2017 23:18
Ok - so you’re correct that ast.py doesn’t currently have any handling for right-hand operations.
My suggestion: Write a piece of Python code that will invoke __radd__, decompile it to bytecode, and see what operations need to be modified.
Deepankar Agrawal
@deep110
Mar 02 2017 23:21
Yes, will try that, I already wrote the code to invoke it.
Russell Keith-Magee
@freakboy3742
Mar 02 2017 23:22
IIRC, it will be modifications to visit_BinOp in ast.py - but I might be mistaken.
Deepankar Agrawal
@deep110
Mar 02 2017 23:30
Yes, most probably it will there, and one more thing, as @Deepanshu2017 and @leasunhy pointed out there are no r* methods in org.python.Object. Is it intentional, or we could add them.
Russell Keith-Magee
@freakboy3742
Mar 02 2017 23:32
Absolutely - the org.python.Object implemetnation isn’t complete - it’s a work in progress.
Deepankar Agrawal
@deep110
Mar 02 2017 23:33
Thanks
Sarthak Suri
@SarthakSuri
Mar 02 2017 23:56
So I'm running into a weird error while checking for whitespace
Capture.PNG
it works for '\t' but breaks on '\n' for some reason
Any suggestions for what I should look at or what I'm missing?
Deepankar Agrawal
@deep110
Mar 02 2017 23:59
@SarthakSuri you should use flake8, if not already using to get whitespace errors