« first day (1299 days earlier)      last day (3874 days later) » 

03:50
@AnttiHaapala Cabbage :)
04:28
I compiled the xcompiler (Thanks to your documentation :) ) But still
~/zsos$ make run
/bin/sh: 1: arm-none-eabi-gcc: not found
dirname: missing operand
Try 'dirname --help' for more information.
Makefile:56: *** missing separator (did you mean TAB instead of 8 spaces?).  Stop.
04:47
can i use to_dict on a dataframe to have a key with 2 other columns as values in form of list ??
like = {key1: [col1value,col2value] , key2: [ col1value,col2value] }?
Label1   label2          label3
key1      col1value    col2value
key2      col1value    col2value
df.set_index('Label1').to_dict()
this works when we have 2 columns..
no problem , i've asked it on SO . Anyone who knows could post an answer there
05:14
@thefourtheye here
@thefourtheye you didnt do git pull
@thefourtheye I wrote doc, AND fixed the makefile
You are correct, after git pull it tries to compile but not it fails with
  * G++    bitvector.cc
Assembler messages:
FATAL: can't create obj/bitvector.o: No such file or directory
make[1]: *** [obj/bitvector.o] Error 1
make: *** [always] Error 2
~/zsos$
hehe
@thefourtheye oops, that is bc of the git does not store empty dirs, wonder how I have overlooked that
I even tried after creating the obj directory, it still fails with the same error message
this is kernel/obj
wait:P
hem
there are .keep files in obj:P
except in libutil
@thefourtheye fixed
:">
=================================
  * GCC    kernel/arch/current/boot.S
  * LD     kernel.bin
i586-pc-zsos-ld: exe/example.zsx.tmp.o: No such file: No such file or directory
make: *** [kernel.bin] Error 1
~/zsos$
05:29
wait...
ah indeed,that is not in makefile:
cd exe
./create-object.sh
not as streamlined as i thought
hey guys
has anyone used ubuntu upstart feature
to start python script
define used
no
sorry, I should be more clear
I am seeing pretty strange behavior
we use supervisor
if I run python script directly
as compared to if I use ubuntu upstart feature
0
Q: executing python script directly vs using ubuntu upstart feature

WebbyI am working with Python and bash shell script. I am executing shell script from Python subprocess module. I am passing arrays from python into shell script using environment variables and then I am printing out that array in shell script. Below is my python script - jsonstr = json.dumps({"s...

05:33
@Webby is it a script or a program...?
upstart is a ubutnu feature
to start any of the script
it is just like crontab
ah script
so I am using ubuntu upstart to start my python script
pretty stange, I am scratching my head..
why it is not working see my above question
@AnttiHaapala Finally, I got kernel.bin :-)
@thefourtheye then make run
@Webby dont use putenv btw, there is a way to pass envvars to subprocess
05:36
:'(
make: tools/ifnewer: Command not found
make: *** [conditional-userlandimage] Error 127
~/zsos$
I see but that cannot be issue
I can see to avoid using that later on I guess.
another one is that you have your script in json needlessly
why make it so prone to errors
just have script="""fooo barr"""
however your problem is the silliest of all
the thing is in upstart your shell is not bash
Yeah, it is just for testing purpose..
meaning? I didn't understand
05:41
cabbage
do you know what wrong I am doing? It has to be silly mistake
I know what you are doing wrong
you are having a problem that no sane person would have
that is you are mixing shell scripting and python
when you ought to do that in python alone.
I got headache already.
I know it can be done in Python already
I have tried to simplify our setup
which is to invoke certain shell script from Python
In our setup, we are invoking shell script from python scriptt
so that is the reason I framed my question like that
I cannot do it in Python as our frameworrk is setup like that.
anw this question cannot pertain to any real world problem, so I do not answer
no real world problem has exactly that script with exactly its problems.
no script would have shell script embedded in json, damnit
exactly, we don't have shell script like that
05:47
if it is there then you can as well write it in python, period.
then why do you ask a problem that has it like that
Python script gets this json data from zookeeper
the all those that exporting a function is visible to parallel etc...
my suggestion is:
and json load it using python
and then pass to shell script
so I cannot show zookeeper stuff here
write the bash script to a file,
so to simplify that part I did like that
05:48
and run the bash script with the explicit shebang
do not rely on argument passing to work
or at least try to execute with explicit /bin/bash as the program
cbg
instead of shell=True
cbg
I guess in our situation I cannot do that, since our framework is setup like that. Our python framework is executing different shell script by passing parameter to it.
the python script can write the shell script to a file yes
if it works fine when I run directly
05:51
cbg jerry
why not it works when I start with upstart
I already have executable='/bin/bash'
in subprocess call
cbg flappy
06:22
@Jerry Could you please check the answers to this question? I believe they would be inefficient. Am I correct?
yea, it would be more efficient without relying solely on regex
I'd match all digits, count, all letters, count
and then ensure length is 6
@Jerry My answer tried to do something similar :)
I wonder how people come up with RegExes like this... Amazing...
And finally I understood how those RegExes work. Phew.
it's kind of inefficient though, in the sense that the regex is going 3 times over the string
it's like using 3 regex in a single one
Yes. I would rather have used a single for loop to count, like you said.
06:43
@thefourtheye did it run?
@AnttiHaapala Nope,
libutil:
========
=================================
make: tools/ifnewer: Command not found
make: *** [conditional-userlandimage] Error 127
~/zsos$
hmmmh
#!/bin/zsh
@thefourtheye apt-get install zsh for zshell (recommended for use too) ;)
Ah, why would I use that? :-(
actually those scripts would work with bash too
I don't want that
06:49
cbg
@thefourtheye are you sure?
anw you can replace the /bin/zsh shebang with /bin/bash
guys is there a way for two processes to share data?
configure-bochs.sh:#!/bin/zsh
createloop:#!/bin/zsh
grep: exe: On hakemisto
ifnewer:#!/bin/zsh
in tools
@Mirac7 yes
06:51
if i've got something like this:
import multiprocessing as mp

#array initialized

def func1():
    global array
    #populate the array with data from disk

def func2():
    global array
    #process data placed in array by func1

if __name__=="__main__":
    p1=mp.Process(target=func1)
    p2=mp.Process(target=func2)
    p1.start()
    p2.start()
img/disk.img: No such file or directory
make: *** [install] Error 32
~/zsos$
@thefourtheye make diskimage
heck I need to fix the makefile :D
it has been a year since i did clean checkout
~/zsos$ make diskimage
/bin/sh: 1: i586-pc-zsos-gcc: not found
dirname: missing operand
Try 'dirname --help' for more information.
Creating disk image, sudo needed for createloop
sudo tools/createloop img/disk.img 100
sudo: unable to execute tools/createloop: No such file or directory
make: *** [diskimage] Error 1
~/zsos$
Looks like I am helping you go over the steps again ;)
@thefourtheye the zsh shebang
that needs sudo bc it uses fdisk to run it on loopdevice
libutil:
========
=================================
make: /opt/zsos-bochs/bin/bochs: Command not found
make: *** [run] Error 127
06:55
you can fix the makefile to find your bochs installation
maybe it could use $(shell which) :D
@thefourtheye the keyblayout is Finnish only now
I ll try that when I find time... Work calls me now
the init code is actually in userland/init/ ;)
07:30
Cbg all
cbg
how do i pass bytes type through multiprocessing.Value?
@Mirac7 what actually are you trying to do?
what is this shared data?
08:00
@Ffisegydd STEWIE!!!!!
@Jon BRIIIIIIIIIIIIIIAN!!!!
what is cbg ?
thus cbg vasif, potato?
yam bananas
pears and peaches, should have a direct cabbage to the salad language cabbage in the room desc
@JonClements, @Ffisegydd anyone, link to the salad language in room desc too :P
08:09
Eh I dunno. I think it's quite nice as it is, short and sweet...like a chocolate goblin.
It'd be handy if we could markup the description... but it requires dropping the entire URL in or it doesn't link :(
ah... :(
i think its nice to have direct link as i went to the sopython.com but completely ignored the salad language tiny button across in the corner of the screen..
maybe the chatroom page should just mention the salad language there first :D
That isn't a bad idea. A small bit at the bottom saying something like "Don't be confused by all the vegetables! Look at this link..."
08:12
or like a auto welcome message the javascript room gives which has a cabbage message asking ppl to learn salad :P
@Ffisegydd or on top :D
@Ffisegydd I second that
I wouldn't put it on top, that page is primarily for the chatroom rules.
Salad does, after all, have it's own page to itself.
the chat room rules should say 4.
"use of <salad language> is allowed, even encouraged"
The *productive* programming cabbage. Please do other members the courtesy of reading sopython.com/chatroom. Don't be confused by all the vegetables! Look at this link...

as the description
maybe?
08:15
No because that requires having the full url which makes it look bulky, as Jon said previously
3 is Cute fluffy animals (especially puppies and rabbits) are cool, okay?
It's a very important rule
so i think rules can have 4th :P
"4. use of <salad language> is allowed, even encouraged"
then it will be noticed better :D
@AnttiHaapala i need two separate processes to perform tasks on the same bytes type variable... as far as i know, this can only be achieved through multiprocessing.Value
ofc there are many other alternatives, for example write to file etc...
08:24
actually first process is basically read from disk and store data in bytes variable, and the second process is actually process the data received... since the first process hogs the disk, but the cpu is mostly idle, and the second process is cpu intensive, it would be preferable to save time with one process reading from disk while the other is processing data. it is also important that the two are asynchronous.
Hello world. First time visiting chat.
cbg @IvanX
Hello Guys any help here trying to make install github.com/fukuchi/libqrencode ... but no luck in windows python26 getting unable to find vcvarsall.bat error
you need vs for that error
08:27
www.microsoft.com/visualstudio/eng/downloads#d-2010-express
install visual studio
Hello @IvanX welcome to the chat room!
Thanks!!
i think it will work, not sure though
I've updated sopython.com/chatroom slightly... I think that works...
@Mirac7 why dont you just mmap the data
it is more effective than anything you think
if the file is binary
08:29
@AppleDroid I'm pretty sure asked this last night and Kevin gave you a link to an SO question, have you tried that? Also have you googled this error? It's a quite well known error.
@Mirac7 anw you cannot share a "bytes" you need to share an array
New to python. Question for you all: I want to do things the "pythonic" way, but my OO experience is in Java and C# and so I'm of course bringing those paradigms in to my coding style. The question I have is...
i could make an array of bytes as ints...
omg
@Mirac7 what format is your file in?
yes i have tried everything since last night i gaved 6 hr to this error but no result i tried MinGW, Cygwin, they keep on needing some more and more files very very long getting errors @Ffisegydd ...
08:31
Now that I understand that variables defined outside of methods in classes are shared by all instances of the class, including the class object itself, my instinct is to never do that unless I really want that behavior. So I'm now putting instance variables in an _initVars() function, and use self.* to define them. Is this good Python practice, or am I missing the point?
.wav
and _initVars() is calld by __init__()
@IvanX yes and no
if you have a non-mutable default value, you can use it in class body too...
that is
@Ivan that is one way to do it, you know/understand that methods defined with a _ at the start are still viewable from the outside right? That's one thing you'll have to get your head around: there is no such thing as private in Python.
08:33
class X(object):
    foo = 42
then it works almost exactly the same as doing
class X(object):
     def __init__(self):
          self.foo = 42
@Ffisegydd Yes I do understand that, and I don't have a problem with it (that _ is convention, and private doesn't really exist)
including that if you later set the value with self.foo = 13, it will be set in that instance only.
but the upside is that it is a) faster to construct with defaults, and b) consumes less memory, downside is that it is slightly slower to use these values ;)
@IvanX where you will go wrong is to use:
@AnttiHaapala So as long as I stay away from assigning mutable objects outside of methods, that's a normal way of doing things? (It's weird to me that they still exist in the class object, but nothing says I have to use them, of course.)
so i think to remove the vcvarsall.bat is the only sol. now
@IvanX the attr lookup works so that: look for the attribute in the instance, if not found, then look for attr in the class
08:36
or can any one try to compile on mac see if it's working plz ?
@IvanX attr setting sets the attr in the instance by default.
@IvanX however if you do:
class X(object):
     foo = []
then you have a shared mutable object and you can go wrong ;)
@AnttiHaapala yup I get that. So I basically have nothing to fear when assigning immutable objects outside of methods, but should only assign mutable objects via self. (unless I really do want to share a single mutable object across instances).
(And by the way, thank you for your comments on my post yesterday about variable scope and whatnot. I realize it was a little windy and open-ended but it will still hepful to get everyone's feedback.)
So is assigning instance variables outside of methods considered more "pythonic" than assigning them via self so they don't exist as class variables, or is it really just a matter of coder preference?
well.........
preference methinks
k. thanks for the insight. I've still got a lot of Python to digest, but I'm already enjoying it. I'm amazed at how little time I spend having to fix the logic of my code once I've fixed up the syntax errors. A lot of it just seems to run right the first time, to my surprise.
btw pycharm ide community edition recommended,
you will not do syntax errors.
08:54
ok cool. I will try that out. I'm just using BBEdit on Mac now since it's been my editor of choice for the last 10+ years, but it has no special Python smarts beyond syntax coloring.
that looks awesome
can someone please explain this: pastebin.com/DKhxGYYq
@Mirac7 you are running windows
yes
and?
09:00
it is documented behavior
multiprocessing is broken in windows in that way
it is also unwanted behavior
is there a way around it?
2
Q: Multiprocessing on Windows breaks

BlenderI develop with Python on Linux and have never really seen this sort of problem with Windows. I'm using the multiprocessing library to speed up computations, which works very well for me on Linux. On Windows, however, things don't run as smoothly: * [INFO] Parsing 1 file using 2 threads Traceb...

no
you must put all your code in
`if __name__ == '__main__'`
that way
i think there is a way to avoid that on python 3.4
For an explanation of why (on Windows) the if name == 'main' part is necessary, see Programming guidelines.
when doing so, i get a series of nameerrors...
you need to pass the objects via the methods, no global data
I tell you: multiprocessing is not worth it like this :D
i though maybe i could do some hackery like:
try:
    runalready
except:
    runalready=0
before if name__=="__main" but no...
09:12
no
you cant do it like so
windows sucks...
+1
avocado
cbg
@Mirac7 in any case your assumption that reading the file is slow is false, you really want to use mmap, if this is pcm wav data :P
09:21
read file is wav, but processed data actually spits out pil image which is what should be shared between processes...
hang on... apparently using tkinter's delayed function calling works well... more research is needed before it can be confirmed though :)
it's almost good enough...
Since there aren't private class members in Python, is there a burning reason to use @property and @x.setter if they don't employ additional logic beyond returning and setting the variable, and the variable is unlikely to change (that is, it's not a subject-to-change implementation detail)?
Not really no. Unless you're going to perform some logic "behind the scenes" you don't really need to use @property
09:36
that's what it seemed to me. Thanks.
Another q: I've been of course raised to believe that "globals are to be avoided whenver possible". Is this maxim also true in the Python world, and should it apply to class variables as well? For example...
, say I've got a diskImage object, and I want to have multiple dataFile objects which represent individual files inside the same image. One way to do it would be to have a class variable inside dataFile for diskImage, which then would be available to all instances of dataFile.
oh the mysteries of the hot questions list.
That would be a quasi-global approach. Another approach would be to have a diskImage instance variable, and pass diskImage to whatever method requires it inside dataFile. Is one approach or the other preferred?
The 'depth of a dictionary' question is listed now, I was wondering why it got more-than-usual attention.
My inclination would be to use a class variable so every instance of dataFile could have the reference to diskImage, and be done with it.
Guys i am trying to install arelle and it need rdflib. Because i got Python 2.7 i need a 2.x version of rdflib to be compatible. However Python searches from Visual Studio 2008
Here is an answer that says that you can trick python27 depending on the VS version you have
297
Q: error: Unable to find vcvarsall.bat

okadaI tried to install the Python package dulwich: pip install dulwich But I get a cryptic error message: error: Unable to find vcvarsall.bat The same happens if I try installing the package manually: > python setup.py install running build_ext building 'dulwich._objects' extension error: Unab...

by typing some command.....
by my question is where do you type those commands???
Also i have two Visual Studio installations
should i remove one of them?
10:09
how do i get this to work in the same window: pastebin.com/tSxKca6d
under windows...
10:31
My new macbook just arrived...well that's my work for day over...
@thefourtheye: nice find of that dupe.
I see Raymond produced the exact same solution, albeit starting at 0 instead of 1.
10:46
cabbage, folks
i never understood what vegetables like cabbage have to do with our chat? :P
But anyways cabbage
11:03
@ExoticBirdsMerchant cabbage, potato? Salad language is bananas.
ohhhh it's the salad language...
i guess cabbage is a class :P
no, you can call any cabbage a cabbage.
cabbage is a general metasyntactic cabbage to substitute for any cabbage.
alright then
cbg all
11:28
@IvanX there is a corollary: if there is ever only 1 implementation and 1 instance of 1 class, it isn't a class.
while installing fukuchi.org/works/qrencode/index.html.en i am Encountering this error any one has any idea enthought.com/repo/pypi/logs/Windows/amd64/qrencode-1.0.txt
qr_encode.c(3) : fatal error C1083: Cannot open include file: 'qrencode.h': No such file or directory
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe"' failed with exit status 2
obviously it cannot find the required fiels
yes but files are their in one folder only
and it has #include "qrencode.h"
Installing libqrencode is becoming hack of a impossible challenge for me tried everything man ... just can make it work heads off for windows users who did this easily ...
11:49
Choo choo.
The Owatch-engine has arrived.
Brum brum!
CHOO CHOO
BRUM BRUM!
CHOO CHOO
Where is the font size setting?
from brum import Brum
brum = Brum('brum')
brum.output()
# BRUUUUUUUUUUUUUUUUUUUM BRUUUUUUUUUUUUUUUUM!!!!!!!!!
11:53
Meep
What..
_________ .__                    _________ .__                 ._.
\_   ___ \|  |__   ____   ____   \_   ___ \|  |__   ____   ____| |
/    \  \/|  |  \ /  _ \ /  _ \  /    \  \/|  |  \ /  _ \ /  _ \ |
\     \___|   Y  (  <_> |  <_> ) \     \___|   Y  (  <_> |  <_> )|
 \______  /___|  /\____/ \____/   \______  /___|  /\____/ \____/__
        \/     \/                        \/     \/              \/
Hurray!
Curses!
                                       ,----,
                                     ,/   .`|  ,----..
               ,---,  ,----..      ,`   .'  : /   /   \  ,-.----.
       ,---.,`--.' | /   /   \   ;    ;     //   .     : \    /  \        ,---,
      /__./||   :  :|   :     :.'___,/    ,'.   /   ;.  \;   :    \      /_ ./|
 ,---.;  ; |:   |  '.   |  ;. /|    :     |.   ;   /  ` ;|   | .\ :,---, |  ' :
/___/ \  | ||   :  |.   ; /--` ;    |.';  ;;   |  ; \ ; |.   : |: /___/ \.  : |
\   ;  \ ' |'   '  ;;   | ;    `----'  |  ||   :  | ; | '|   |  \ :.  \  \ ,' '
found the font size settings..
11:55
For sure.
For some reason, Adobe update keeps opening upon booting up.
It's very annoying. Especially since I already removed it from my list of startup programs.
There are some seriously cool fonts on this ASCII art text generator.
plz some one help me out in installing libqrencode .....
What a confusing name
@AppleDroid have you asked a question on the main Stack Overflow site?

« first day (1299 days earlier)      last day (3874 days later) »