i am reviving this blog.
So far, I have quite a good experience with Python and with the mailing list. I think it actually speeds up learning process. For one, I didnt bother with the data types and with memory management, as I did with C++. It kindof diverts the time used to thinking about memory management to making the syntax or the logic. And once you cover the basics, loops, conditionals, functions, classes, and the combination of tuples, lists, and dictionaries, I think you’re kindof set for the other more interesting things that you can do. Things like file manipulation, client-server programming, regular expressions, threads, and a lot more. Although I havent tried all those advanced stuff, I could say that I learned about how to derive classes from base classes in a total of only a few hours. I say total because, I only use about an hour or 2 for Python in a day. And the mailing list was very very helpful. I get to ask questions and people probably halfway around the world take their time answering my queries.
I also found it helpful to have a certain project because you retain stuff that you’ve learned since you are applying it to something relevant to you. For my case, my project was controlling a circuit with 32 LEDs using the parallel port. Now, I was already able to do that (as I’ve posted sometime before) but the Parallel class was still not “modeled” to how I want it to work. So I derived another class from the Parallel() and I got to learn that I can still access the methods of the base class. That I need to bind my methods. And it can be done by passing self. Stuff like those. I think this is still a bit basic but I think my understanding of object orientation was deepened because of this.
Posted in Programming, Python | 4 Comments »
I wish that someday I could quote Robert Frost. That I took the road less travel by. And that made all the difference.
Of course you might get into thickets and bushes and other smaller roads, but that might be different story.
Posted in Uncategorized | Leave a Comment »
Whew! Long title. Haha.
And it has been quite some time since my last post. I have been “reviewing” for the ECE Board Exams and reading “Greg-books”. Blink. Tipping Point. Innovator’s Dilemma. Innovator’s Solution. Of course, before that, I’ve read Long Tail, Google Story, and The World Is Flat. Now I’m into Crossing the Chasm. And later will be Art of the Start and Open Innovation. (Of coure Core Python is still in progress and a data mining book too.)
The post below is a means to chronicle what were the things I tried.
Aside from reading and “reviewing”, I’ve also been googling how to do this parallel port interface. And the answers and results have not always worked out. From C/C++ based codes to Python codes. I tried various stuff. When I stumbled to pyparallel which was at sourceforge, I thought that since it would be in Python, my worries were over. So I downloaded the whole thing, unziped and as the README says input “python setup.py install” on the command line. Then I got a barrage of messages I really couldn’t get make sense of.
running install
running build
running build_py
Traceback (most recent call last):
File “setup.py”, line 19, in <module>
package_data = data_files
File “/usr/lib/python2.5/distutils/core.py”, line 151, in setup
dist.run_commands()
File “/usr/lib/python2.5/distutils/dist.py”, line 974, in run_commands
self.run_command(cmd)
File “/usr/lib/python2.5/distutils/dist.py”, line 994, in run_command
cmd_obj.run()
File “/usr/lib/python2.5/distutils/command/install.py”, line 506, in run
self.run_command(‘build’)
File “/usr/lib/python2.5/distutils/cmd.py”, line 333, in run_command
self.distribution.run_command(command)
File “/usr/lib/python2.5/distutils/dist.py”, line 994, in run_command
cmd_obj.run()
File “/usr/lib/python2.5/distutils/command/build.py”, line 113, in run
self.run_command(cmd_name)
File “/usr/lib/python2.5/distutils/cmd.py”, line 333, in run_command
self.distribution.run_command(command)
File “/usr/lib/python2.5/distutils/dist.py”, line 993, in run_command
cmd_obj.ensure_finalized()
File “/usr/lib/python2.5/distutils/cmd.py”, line 117, in ensure_finalized
self.finalize_options()
File “/usr/lib/python2.5/distutils/command/build_py.py”, line 60, in finalize_options
self.data_files = self.get_data_files()
File “/usr/lib/python2.5/distutils/command/build_py.py”, line 123, in get_data_files
file[plen:] for file in self.find_data_files(package, src_dir)
File “/usr/lib/python2.5/distutils/command/build_py.py”, line 130, in find_data_files
globs = (self.package_data.get(”, [])
AttributeError: ‘NoneType’ object has no attribute ‘get’
Googled the last statement. Didnt find anything relevant. So I switched to root, moved the parallelppdev.py to /usr/lib/python2.5/ and changed the permissions so that maybe, I can import the file from there and make it to run somehow. And I did. It loaded the file when I used entered “import parallel” in the Python environment. So I tried the next few commands found in the README.
>>p = parallel.Parallel()
and it gave errors
Exception exceptions.AttributeError: “Parallel instance has no attribute ‘_fd’” in <bound method Parallel.__del__ of <parallel.parallelppdev.Parallel instance at 0x838e40c>> ignored
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “parallel/parallelppdev.py”, line 186, in __init__
self._fd = os.open(self.device, os.O_RDWR)
OSError: [Errno 13] Permission denied: ‘/dev/parport0′
So I changed the permissions of parport0. Tried the statement again. And gave out a different set of errors.
Exception exceptions.AttributeError: “Parallel instance has no attribute ‘_fd’” in <bound method Parallel.__del__ of <parallel.parallelppdev.Parallel instance at 0x8384dcc>> ignored
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “parallel/parallelppdev.py”, line 188, in __init__
self.PPCLAIM()
File “parallel/parallelppdev.py”, line 215, in PPCLAIM
fcntl.ioctl(self._fd, PPCLAIM)
IOError: [Errno 6] No such device or address
Googled again. Search term: File “parallel/parallelppdev.py”, line 188, in __init__
self.PPCLAIM()
And I got quite a useful result. It turned me over to a blogger fayaz and it turns out that he/she had the same problem with the “python setup.py install”. So this took me back to the original problem I had. Haha. So fayaz recommended that you change the setup.py code. Remove “package_data = data_files” and add “if os.name == ‘nt’: args["package_data"] = {‘parallel’: ['simpleio.dll']}
setup(**args)” after the last parenthesis. Now, I didn’t do all of that. I just removed the “package_data = data_files” because the terminal complained/gave-errors if I added the last set.
Now, I didn’t understand it fully. And I also didn’t understand the last step, which was with the ppdev and lp. When I got the “python setup.py install” in order, I tried the python code
>>import parallel
>>p = parallel.Parallel()
and it gave some more errors.
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “parallel/parallelppdev.py”, line 188, in __init__
self.PPCLAIM()
File “parallel/parallelppdev.py”, line 215, in PPCLAIM
fcntl.ioctl(self._fd, PPCLAIM)
IOError: [Errno 6] No such device or address
Turns out, I had to do “rmmod lp” as dagidag (someone who commented) suggested. Now, I still dont fully understand it. The relation between ppdev and lp and why I couldnt get it to run when I didnt do the “rmmod lp”. I dont also know the ramifications of my actions.
Hopefully, I didnt wreck my PC that much. And hopefully I find answers soon.
Anyway, things are working for now. The LEDs are glowing well. So I guess I’ll just leave it be. For now.
Posted in hobby, Linux, Programming, Python | 2 Comments »
For the simple reason that I can relate. I reposted this from xkcd. Crap.
Posted in Uncategorized | Leave a Comment »
This roughly means having a set time for everything everyday. And it is quite difficult to come up with a new one especially when in the past 16 years (didnt have nursery), your routine is mostly governed (or dictated, if you take it to the extreme) by academics, classes, and the like. Added to that is the fact that I am currently unemployed because I am “reviewing” because I am suppose to take the board exam this October. Of course you can always be employed and review for the board exam but they usually say that you’ll loose focus if that’s the case. So anyway, since I am reviewing, that only means I am bumming around. And that bumming around makes me loose time. Wasted time. Time that working people value so much since they are (or most of them are) stuck to their work and thereby reduced of the time to pursue other passions.
So in the that event, I was compelled to make a schedule. Even before entering review. And honestly, in the past one and a half months, it was actually was still in a wreck. I did have schedules. I did have the charts but the times of execution wasnt as done as it usually is. I thought that it was because I wanted to to tons of things and squeezed all those to that schedule. Since some of the things I wanted to do isnt feasible yet, I had to drop those and worked with what I have. And the with that, I should say that the past few days have been productive.
Regularly waking up at around 6-7. Doing some exercise. Reading non-review books. I finished about 3 chapters of Core Python from some hours last night and some early today. Doing some review practice. Linux fiddling. Regularly sleeping at around 12-1. All those.
I just hope I keep doing this for quite some time so that I would improve on linux, Python scripting/programming, and get fit.
Posted in Uncategorized | Leave a Comment »
And because I want to hone my writing skills…
And because I want to be part of the whole Web 2.0 network…
And because I basically just want to write my thoughts down..
I am writing right now.
Just kick back the old habit.
Just to work up my brain.
My only worry is that I might grow content on this blog while I learn to host my own wordpress blog and I dont get to import the stuff I’ve written here. And I dont know how to crosspost this on Multiply yet.
That’s all for now. Will start writing back. Little by little.
Posted in Uncategorized | Leave a Comment »
I know it is done. I know we will graduate. But somehow, I feel the work was inadequate and that my efforts were in vain.
I know I dried my eyes out. I know I toiled for days. Or should I say nights. I know I made a dorm out of Faura. But somehow, I feel 9 month’s time wasn’t spent well and I only felt 3 months of it.
I know you toiled as well. I’ve seen it. I just wished we coordinated more.
I know you had failings. I too had failings. I know we were aware of it. But I wished we just didn’t leave it be but talked and worked through it.
What’s done is done. It can never be undone. But the question is, what do we do now? We still have time you know. Or is it my call?
Posted in Uncategorized | Leave a Comment »
What’s not?
Graduation. That’s what’s not yet sinking in. The whole “we’re no longer students”, “we’ll be assimilated to the workforce (hopefully)”, “we’ll be parting ways”, “we wont see each other that much anymore”, and “we’ll miss the school, the people, and the whole student life in general”.
I dont know why though. I dont know why it isnt sinking in. Maybe because I have some unfinished business? Maybe because I look forward to some plans? Maybe because I’m caught up in the plans and the things I want to do after graduation that I couldn’t think about the moment? Maybe because I think that if we will it to be, we can still meet up with the people around us (save for the people in another continent).
I don’t know. Honestly. I don’t know. This honestly.
I don’t even know if it’s a good thing or a bad thing.
Posted in Uncategorized | 2 Comments »
I have recently been sleeping at F308. Not that it was mandated. But it’s just that I feel that I can get more things done here. Less temptations. And the silence is conducive to productivity. I dont have the bed calling me to enter Morpheus’ realm. And I most certainly dont have to hear my roommate’s songs playing in the background.
Hope everything gets done in the next 2 weeks..
Posted in daily activities | 3 Comments »
