Showing posts with label Computer Science. Show all posts
Showing posts with label Computer Science. Show all posts

Saturday, February 5, 2011

Creative & Productive Computing Desk Setting

I always think about improving my productivity.
And I love being creative.

So I quite often think about and seeks to ways of improving my productivity & creativity,
and this time I'll write about setting the computing workplace.

I believe one great way of discovering something new is to be inspired by others.

First, about more on being productive:
I searched for some workplaces of some well-known "cool" "new" "geeky" software companies.
Here are some pictures of workplaces of those companies:

Twitter
















(image from here)




Facebook















(image from here)



Google















(image from here)



So, what did I learn & tried & learnt from those pics? What are the lessons?

1. big screens are good.
2. dual monitors can be quite helpful while in programming.Bold
(you're probably already aware of those things already)

3. it's really comfortable and helpful for programming when you put yourself to the corner of 'L' shaped desk.
(man, this really is!)


Now about being creative as well:
I searched for how Pixar's workplace look like:

Pixar


























(this is John Lasseter's office. Image from here.)














(this is Lee Unkrich's office. Image from here.)

Lessons?

4. put something which can inspire you.
5. make it comfortable and your style.
(boring?)


Then I read about Facebook's Mark Zuckerberg's day life (from here), that
"Zuck would come into the office and, seeing every chair full, just lie down on the thin carpet on his belly, sandals flapping, and start typing into his little white Mac iBook."
Yeah, how is it? I tried. And it's nice to make myself comfortable during computing.
But not always, you know.










(image from here.)


They say, to be creative and inspiring, you need to make yourself the most comfortable.
Some "top-thinkers" of some design companies etc., say they need absolute comfortable chairs to make themselves think properly.
And lying down with computer is one way of making yourself comfortable, change from the desk-sitting, refresh and be inspired --- may be.

Now I'm quite a believer in working on laptop, like the Zuck --- maybe.












(image from here)


oh, the lesson:

6. make yourself most comfortable - bring your laptop with you to the most comfortable place and position.


So, how do I combine all of those lessons learned to maximize the productivity & creativity?

I. set the computer to the corner of the 'L' shaped desk and sit there
II. set your big monitor on top position of your laptop (like in the pic of Facebook office above).

In doing so, you can bring your laptop with you to the whatever comfortable place & position and work with your laptop,
and when you'll need a desk and/or big monitor, you can very easily & quickly connect your laptop to the monitor & etc, not changing too much of your working environment.

And programming at the corner of the 'L' shape is very comfortable.


And a blog post about finding a perfect office chair: here.

Thursday, January 13, 2011

ssh: connect to host xxxx port 22: Connection refused

Sometimes, in this complex built world,

(TEDTalks: Thomas Thwaites: How I built a toaster -- from scratch)


you forget about something, you took it for granted for a long while and when something doesn't work for you, you try to find the cause of the error, but cannot find it,
you delve deeper into the problem, and then,










(image from here.)


realise, what an obvious cause it was and you just didn't even think of it...!

Like,

1) in one of my digital circuit experiments, we thought we did everything right, but our circuit board didn't just work. We tried to find the problem for a long while and, D'OH!!! the power supply was not connected!!!

2) you started to use or moved into a house with one of the modernised kitchen equipments, and you wonder why the water on your electric cooker doen't cook!









(Image from here.)



and you realise, you didn't notice there's an energy-saver power-timer you needed to rotate!






(Image from here.)



3) and here's another one.











(Image from here.)



I wanted to SSH connect to my Linux virtual machine, but kept seeing the

ssh: connect to host xxxx port 22: Connection refused

message.
I checked everything else, like firewall settings and virtualisation software settings etc.
And realised, I didn't install SSH server on the virtual machine...

D'OH!!!

(p.s. does anyone have any other good examples of those common cases?)

Sunday, December 12, 2010

Review of some cloud computing service providers

When considering about porting your app to the cloud for all those good reasons, the first thing you might encounter is: which platform you should go for?

After having tried some of the major ones here are some brief reviews:


1. Google App Engine

PaaS (Platform as a Service)

- Ease of use
yeah, it's for me by far the most easiest cloud computing platform with full functionalities provided right out of the box.
PaaS means, it's already thought that you'll develop something on the cloud to provide your application to the wide variety of users on the web.
User authentication, some nice Google APIs, easy to use database, and straight away ready to go IDE (Eclipse based for Java) and App Engine Launcher (for Python).
Nothing to really configure, build, learn, etc... Can't really complain.

- Easy to use, an excellent non-relational database
one of the plus in this might be, that we can just use the Google's excellent non-relational database. It's straight away to go, so easy to use.
Though this might be a minus, when people want to stick with traditional relational database with SQL. Though with paid-option, with the App Engine for Business, you can use the traditional SQL database.

- Pricing
pricing is very reasonable. Even excellent should I say? It's free up to some stage of usage, and we use it free until we have enabled the "paid usage" option.
Still with free-option we get the full functionality.

- Programming language limitations
programming language of choice is limited to Python and Java.

- Any external libraries?
well, it's one of the main issues for me and probably for most of the scientists and engineers who'd like to port their scientific and engineering applications to the cloud in choosing the Google App Engine.
Usage of external libraries is limited to pure Java or pure Python package. In this sense, Java seems to be a better choice for development with some external libraries (see my previous post "Java or Python"). Yeah, that means no Numpy or Scipy for Python... You might consider using Java with Apache Commons Math library instead when you're looking for an option to use any mathematic library with Google App Engine.
And further, the number of files you can upload to your cloud computing instance is limited to 3000 files (for both Python and Java). That means, you can't just dump any arbitrary files of libraries on the cloud.

- Summary
I think it's definitely the first thing to try out when you want to try out cloud computing development. Though when thinking your application might become complicated, consider about using something else.


2. Microsoft Windows Azure Platform

PaaS (Platform as a Service)

- Ease of use
not quite much so. It's also a PaaS service, designed with the thought that you'll service your app on the cloud, but, the approach is quite transitional or even traditional.
The web service approach is very much taken as the ASP.NET framework, and you need to have all those things to develop something like ASP.NET, MS application things on Windows (Windows Vista or higher, MS Visual Studio 2010, Windows Azure SDK, etc...).
Not so easy thing like the Google App Engine, where all those things for webapp development is provided straight away, you need to implement by yourself. Oh, yeah... Not so much recommended for the beginners...

- MS SQL Server database
MS SQL Server is the default database system provided.

- Pricing
Similar to the Google App Engine. Though you need to provide all your credit card information and so on when you register. Scary? Well, I registered, tried a simple development, haven't done anything on Azure since then, and I've not been charged since.

- Programming language limitations
they say almost any language can be use to develop your Azure application (this is a big plus!). Though some tweaks would be needed. The default programming language of choice, with nice samples and examples provided, is C#.

- Any external libraries?
again, they say you can install and use almost any external libraries for your Azure application (again, this is a big plus!), as long as it doesn't conflict the Web Role and various other Roles... (somewhat complicated here with those various roles...) And some tweaks would be needed.
But unlike Google App Engine, it seems like MS Azure team is quite interested in attracting scientists and engineers to their cloud computing platform, and quite a few cool things are provided or planed to be provided (Web N-gram Services, Matlab support, etc... look here).

- Summary
it would be a good choice when you're already very serious about porting your application to the cloud and have already some working set, with some library dependencies. Limited to MS Windows platform, but good support for scientific & engineering application development is expected. Not quite suitable for beginners or someone who just want to try out cloud computing PaaS.


3. Amazon EC2

IaaS (Infrastructure as a Service)

- Ease of use
it's easy to use in the sense that you get the familiar computing instance (on the cloud, of course) as you're used to using your own personal computer.
It's not easy to use in the sense that you need to develop all the applications and services to serve your application on the cloud (no straight to go user authentication and database connection as in the Google App Engine).
Yes, it's a IaaS, unlike those Google App Engine and Windows Azure. You kind of get a machine... on the cloud. Then you remote connect to it, and you develop your application... remotely. As a machine you can choose Linux or Windows. And they take all the goodies of the cloud computing (scalability etc...)
And you can copy your virtual machine instance to give it to anyone, or make a branch.

- Database
as you get a machine instance, you can install what ever database you want. Though you need to build the platform by yourself, like connecting the database to the webserver and application.
And Amazon provide all those "database for the cloud" services (Amazon SimpleDB, Amazon RDS, Amazon S3, Amazon EBS, Amazon Elastic MapReduce ...), which I haven't looked quite much in detail. Though it seems like they are not limited to be used only with Amazon EC2.

- Pricing
you pay by the usage hours of your machine instance. And pay extra when you use more then those are covered by the default allowance (see here).
Though you can turn your machine instance "off" when you're not using it, to prevent being charged for nothing.

- Programming language limitations
no limitations, of course. You use whatever you want... almost.

- Any external libraries
no limitations, of course. You use whatever you want... almost.

- Summary
it's good when you already have a working web application, which you want to deploy on the cloud computing infrastructure. You get a machine on the cloud!
Not quite much for beginners, or who want to try out cloud computing.
The pricing can become expensive, when you want to keep your web service always on. Unlike the Google App Engine, which is turned on by request, the machine is either always turned on or off by you. And when it's turned on, you pay for it.

Friday, October 22, 2010

t(good_idea) = bad_idea?

Sometimes you think something is such a good idea, and think, when you make a product out of this idea, it will be a big hit. (You don't? Well, I do...)

One of them was something like the 3D Timeline, a product of BEEDOCS.



I was thinking "managing my timeline in nice representable 3D form will be great!"
Then I noticed that there is a commercial product out there already, and I tried it.
Well, it was less then what I expected.
Or probably, there needs to be a lot of work, to make it really easy and intuitive to use.

Then I happened to use the MS Project.













Man, it's so much easier and intuitiver to use, and is so much more helpful and useful to me!
Don't really care about 3D representation of my timeline, when it's nice, easy and intuitive to use like this!

So now, after a while of time (with the function of time t(x)), my idea about 3D representation of timeline found out to be, it was not so much a good idea after all, I think.

Logging is your friend

Matt Welsh (a Harvard professor, working in Goolge for some months) posted this nice blog post about his experience working in Google.
Computing at scale, or, how Google has warped my brain

(Well, also a Berkeley professor Randy Katz did interview about his experience in Google, which was also very inspiring.
I guess working in Google is very inspiring isn't it?! I want to be inspired as well!!! >.< )

Anyway, apart from all those nice technologies he mentioned that he could use in Google (that we have no access to), the thing about having a cloud computing infrastructure and "Log first, ask questions later" is a really nice insight, I think.

Yeah, logging really is your friend, when you develop anything on cloud computing, even if you do on a small cloud computing infrastructure you've built (like me!).
I haven't quite realised until now the importance of loggin everything and also that of the unit testing.

They really are important because you have limited possibilities and options for debugging.
From now on, I'll insert logging code everywhere in my code, and keep doing unit testing...

Friday, September 24, 2010

The Little Prince - Programmer's Version - Chapter 12, 13, 14

---

The last post about this "The Little Prince - Programmer's Version",
which I saw originally in Korean version in here.
I contributed all of my translation to the Google Translate.

---

Chapter 12.

A debugger was living in the next planet.
It was a very short visit, but plunged the little prince into deep dejection.
"What are you doing?" said the little prince to the person who is typing with a bunch of code and comments.
"I'm debugging." He said somberly.
"Why do you debug?"
"To catch bugs." He said with his head bowed.
"Why do you catch bugs?"
"For a clean and beautiful program." he answered.
"Why do you code such a program?"
"That makes debugging easier!" answered the person and remained silent.
('Adults are very odd') told the little prince to himself.


Chapter 13.

In the 4th place the little prince visited, a file sharer was living.
He kept his head so close to the monitor so that he didn't raise his head as the little prince arrived.
"Hi, your noodle is overcooked." said the little prince watching the instant noodle on the desk.
"Those three files here and two files of torrent and adding the 10 files which I uploaded on rapidshare... hi. And 36 files to send to pirate bay... hu! So totally 512GB, and 1440 and one."
"What are 10000 pieces?"
"Oh, you're still there? I'm too busy ... when I add three to two"
"What are those million pieces?" asked the little prince again.
"The entrepreneur raised his head."
"I was disrupted only three times since I booted my computer in 25 December 2009. The first time was when the server was dead attacked from DDos, the second was because of my nerve aches, as I'm computing sitting in this position, and the third is... now!"
...
"What are you doing with those 10000 files?"
"What do I do?"
"Yes."
"I'm doing nothing. I own them."
"You own the files?"
"Yes."
"But according to the terms and conditions I saw before..."
"Companies don't own the contents. They . That's a very different story."
"But what is that good to you that you own those files?"
"My mileage raises."
"What is it good for that your mileage raises?"
"It's useful for downloading the other files in high-speed."
(He's talking like the debugger) thought the little prince.
...
"So, what do you do with those files?" asked the little prince.
"I keep those in my hard disk compressed. And then I do disk defragmentation continuously. That's a hard job".
The little prince was still not satisfied.
"I, I can do some calculations with Open Office, I can connect to the network with browser. But you can't do anything with your illegally obtained programs!"
"I won't. But I can share them."
"What does it mean?"
"I upload my files in file sharing sites compressed."
"And that's it?"
"That's it."
...
(Adults are very odd) mumbled the little prince to himself.


Chapter 14.

The fifth place he visited was a very interesting place.
There was a very huge computer and a programmer.
He was keeping making a patch of some game.
...
Approaching him, the little prince greeted him politely.
"Hi, that's a command." said the patch maker.
"What is a command?"
"That's creating a new patch. Here you go."
And then he handed over the overwritten USB.
"Why did you give me the USB again?"
"It's a command."
"I don't understand." said the little prince.
"Because command is a command. Here you go, the new version."
Then he wiped out his sweat and did coding hard.
"I've got a hard job. It was ok before. I just needed to redecorate some contents every month. Then the other times I needed to maintain them."
"Then did the game go wrong after that?"
"No, that it did not go wrong is the problem! Because the users are consuming contents faster and faster, my bosses wanted me to make patches continuously."
"So?"
"So the this game's contents change a little bit every minutes. For example the colour of the NPC changes a little bit.."
"That's odd! Your game is being patched continuously!"
"That's not odd at all. While we are talking, the new prototype of a new donjon was published." (That was because probably the computer was very good and there were a lot of those developers.)
"Already?"
...
The fact that he could not be in a blessed place was because 1440 version ups were possible in 24 hours, which was the little prince could not confessed even to himself.


Friday, September 3, 2010

Platform independence in Mac OS X

As OS, I'm using Mac OS X, Windows and Linux.
So, in choosing software programs, I prefer platform independence rather then any platform dependent software, as I do for choosing something for development.

And those platform-independent free or open-source programs are great in their features as well.
So, here are my platform independent software apps on my Mac OS X:

1) Picture management, import, viewing program:
I use Picasa instead of Mac OS X's iPhoto.


It's very good, with many extra features for photo editing, blogging, uploading on web albums, and further functionality like tagging, etc.
And it works very well on both Windows and Mac OS X.
I haven't tested it on Linux yet, but it is supposed to be working fine on Linux as well, as as far as I know it uses Wine to make the originally Windows program working on both Mac OS X and Linux.

2) Video playing, watching program:
As a Korean (mainly for reasons of subtitles for foreign movies), GOM Player was the (kind of - it would have been a lot better without all those adverts) best choice for video watching program, on Windows (only!).
Its very easy and intuitive user interface is very addictive!
And very good support for subtitles (of course especially Korean)!
But here is another option: MPlayer!
Works fine on Windows, Mac OS X and Linux.
On Mac OS X, I use MplaerX.

Nice, simple user interface with the convenient and intuitive interface (almost the same) as the GOM Player.
And no adverts!
The Korean subtitle just works!

3) Music playing program:
I don't quite like, or I didn't appreciate yet to this point, the complicated interfaces and functionalities of the iTunes.
On Windows, I very much liked the simple interface of the Winamp.
For OS-independence, and even better as an free-and-open-source program, there is:
VLC media player
It is actually a media player, not only for music but also for videos and streaming media, but I find MPlayer better for video and VLC media player better for music.
Well, MPlayer is also a media player, so that it plays music etc..., but that might be a personal preference.

4) Internet Browser
Firefox and Google Chrome.
I guess not so many words are needed for those.
There are pros and contras for each of those programs.
I quite like Google Chrome's extension sync function.

5) E-Mail and Contact management program
Thunderbird

There has been a time where it had some issues so that I preferred using Microsoft Outlook (Windows), Apple Mail (Mac OS X) and Evolution (Linux), but I think now it's so good that I'm using Thunderbird on all of those platforms.
And I think it's even better than the other e-mail and contact management programs mentioned above, because your contacts can be managed by one program for all.

6) IDE
Eclipse IDE.
I guess not so much word to say about it.
You can develop almost any language on it.
I've been posting about Eclipse IDE in this blog.

7) Virtualization
Quite often we need to run virtual machines, because there are some programs we need to run, which run only on specific OS.
I've posted about choices and aspects of virtualization programs in my previous post here.
I'm using VirtualBox.

7) Image editing program
Gimp is a very fine image editing program, runs on Windows, Mac OS X and Linux.
Some proprietary programs might be better, but it's free, open-source, and does the job for normal image editing use.

Thursday, August 26, 2010

PyDev unresolved import error!

Yeah, I spent this whole day, figuring out why PyDev cannot import modules of xml packages.
The standard ones like SAX, DOM, eTree, etc.
I almost gave up using PyDev for Python development and was about to go back to Emacs or try something else.
There was nowhere I could find the information on the web.
I did everything I could do in Eclipse Preferences, about Python-Interpreter SYSTEMPATH.
I erased Eclipse IDE and re-downloaded, re-imported the project, etc...

The problem was:
when you have a package in your project with the same name as you want to import from SYSTEMPATH, PyDev starts to load from the package in your project, doesn't look in the SYSTEMPATH, returns error and aborts running.

Sounds obvious?
Well, but when you don't have anywhere saying 'import xml.sax' in your code, and the PyDev returns error that it can't find 'xml.sax' or whatever, because somewhere in some package in your SYSTEMPATH calls 'xml.sax', it becomes a labyrinth.
Just executing it on the shell works fine, but PyDev returns error.

Tuesday, August 24, 2010

Virtualization for Cloud Computing on OS X

Virtualization of computing resource is one of a key concept for cloud computing.
But what would you select for your "virtualized computing resourse"?

VirtualBox
It is not the best, but is free for virtualization.
"Not the best" in the sense that:
- it doesn't support DirectX-3D acceleration
- frequent updates
- has more issues than the others (VMWare, Parallels)

VMware is known to be better, in the sense that it covers most of the points mentioned above.
And virtualization with VMware can be done free on Linux and Windows.
But not on Mac OS X.

I heard Parallels is even better then VMware on Mac OS X, but I have no experience at all with it.


Ubuntu
Using free-OS as your virtual OS means freedom of its deployment for you.
There are other free-OS options, I've tried several, but found out that Ubuntu is still the best option as:
- It has LTS (Long Term Support) version, which is supported up to about 2 years, compared to other free, open-source Linux distros (Fedora: 6 months, OpenSuse: 1 year, etc.)
- Easy to use (easier than the other free, open-source Linux distros like CentOS)
- Just works (Ubuntu just worked, whereas Kubuntu, OpenSuse with KDE didn't just worked smoothly)
- OpenSolaris will be discontinued by Oracle (ref. here)
- Other BSDs doesn't fully work on VirtualBox.

Friday, August 13, 2010

The Little Prince - Programmer's Version - Chapter 5, 6, 10, 11

...

Chapter 5.

The little prince asked all of a sudden.
"The code you wrote, doesn't have a memory leak, isn't it?"
"Yes, because in Java there is garbage collector. But why do you worry about memory leaks for such a simple program?"

The little prince answered: "Come on!" as it was so sure. So I had to think a lot about it.

The system, the little prince had, has many applications and programs running.
When they are really running, you need to leave them alone.

But when it's a bad program, you need to detach from the memory immediately.
The most scary ones were garbages (in case of C, those written to heap and not freed...), there is no way to remove them, when they are not freed immediately.
Unfortunately, the little prince's system is so small, that when a lot of garbages occupy the system, the actual important programs cannot be run.


Chapter 6.

...
At the fourth night, I knew a new fact. As you told me:
"I like releasing programs. Please distribute it to source-forge quickly."
"We need to wait..."
"Wait for what?"
"Until the program is composed completely".
You were surprised so much at first, but then soon you said laughing:
"I feel like I'm at home yet!"
Of course, it's hard to complete a program. Unfortunately, when a project is bigger or so, then it becomes harder to release a newer version. But you coded only simple programs so that you needed to compile only for a few minutes.

"One day I deed to revert 44 times!"
Then you said after a while,
"When I'm really sad, I recompile after modifying the code just a little bit".
"Were you so sad at the day you had to revert 44 times?"
But the little prince didn't answer.


Chapter 10.

...
So he decided to go to his neighbours first who had the same system.
The first network he visited was that of a chief programmer.
He was wearing a shirt and red tie, sat on the swivel Duoback chair.

"Oh, look, there comes a subordinate" the boss said seeing the little prince coming.
...
To the chief programmer everyone is subordinate.
The little prince yawned as he was very tired.
"So, little prince, you know that today you need to work late today as well, right?"
"But I'm too tired. It has been Monday, Tuesday, Wednesday, Thursday, Friday, Friday, Friday for ever"
"Then you can go home early today. I guess it has been a while that you had went home at the right time. It a very interesting thing to watch, that you go home when your chief programmer is still working. So, try go home at the right time~"
"I'm sacred to go home at the right time after you say so"
"Hmm! Then there's no problem. Then you could go home..."
Then he gobbled. He looked like angry.
Because the chief programmer cared so much about the deadline.
So, it appeared impossible to him to go home early in an important time. Of course he thought of time so important so that the overnight working exists.
"When an important bug happened during debugging, and we got claimed from our customers, so they insisted, the manager need to be punished, is it my fault or your fault?"
"Of course it's your fault" said the little prince carefully.
"That's right. A perfect programming is based on perfect debugging. The bugs we can't reach, we can't do anything for it, but we need to do what we can do."

...

"I guess I need to leave here!" said the little prince.
"No, don't leave. I'll give you a new work to do." said the chief programmer became desperate.
"What kind of work to do..." said the little prince in vain.
"Catching bugs"
"Well... I caught all the bugs I could see"
"There was a request to fix the bug for the internet chatting program"
...
The little prince made his way after he made a sigh.
"Oh, that will not be good for your performance rating when you do that!" yelled the chief programmer in dignity.
(Adults are very odd) said the little prince to himself.


Chapter 11.

The place he visited second was that of a so called a master programmer out in the field.
"Oh! There comes one who get my superior distribution!" said the master programmer.
Master programmer happen to look at those people who use his distribution version with pitty.
...
"Do you really worship me?"
"What does ' to worship' mean?"
"'To worship' means that you write a reply like 'It's the best!' or recommend, because my creation is very superior and beautiful that you can't imitate with your ability"
"But no one uses the creation, isn't it?"
"Please make me happy! Please worship me!"
"I worship you." said the little prince (as he had no other choice.)
Then he made his way. 'The adults are weird" thought the little prince.


TO BE CONTINUED ...

Friday, August 6, 2010

The Little Prince - Programmer's Version - Chapter 2, 3, 4

Translated from the original Korean version,
which I saw here.

I started with Google Translate first, but I had to modify almost everything.
I contributed my translation back to Google Translate.


===


Chapter 2.

.....
By sunrise, a strange voice woke me. The voice said.
"Show me a sheep!"
"What?"
.....
"Do me a favor ... Draw me a sheep ..."
So I showed the following code.

printf ("Sheep. \ n");

Then he looked at carefully,
"Oh, no, you need to know include the amount of stdio.h." Said.
So I kindly showed the following code.

putchar ('S'); putchar ('h'); putchar ('e'); putchar ('e'); putchar ('p');

".. The code is too dirty, I wanted the amount of neat."

I need to continue debugging, because I wrote more impatient as follows.
Class Box:
Object sheep;
void peek ();
....
"That's a box class. The sheep you want can be called with peek() method."
But my younger supervisor saw a light break over the face, I was surprised.
"That's what I wanted! The peek () needs a lot of memory?"
"Why do you ask?"
"Because my computer is very old ..."
"It will be enough with which I gave you there. Because I used a basic data structure."

So I came to know the little prince.


Chapter 3
...
It took me long time to figure out what kind of system the little prince was using.
I knew it by listening to some commands he was saying sometimes.

For example, as he saw my iPad for the first time (I can not draw in ipad because of copyright issues...)
He asked:

"What is this thing?"

"It is not a thing. It's my iPad. iPad."

I proudly demonstrated that I can connect to werless net.

....
Then he shouted out loud.

"So you're one of the system programmers too! From what kind of developing environment are you from?"

As I heard those words, I felt like I caught a clue about his mysterious career.

....

After a while of silence he replied:
"That's good. Your class could be used in other applications as well."
"Of course. And remember, when you behave well, I'll code a method for you so that you can iterate the peek()."

"Iterating? Think it is very odd!"
"That would be annoying when you peek() every time!"
...
Then said the little prince, solemnly.
"That's fine. My system is a very small system."
And added in a somewhat lonely voice.
"It's effortless to call the method several times, because I cannot even use so much memory ..."

Chapter 4
....
I had a proof, that the system the little prince used was B612.
The system model was suggested by a Turkish computer scientist in 1999.
At that time, he showed to be a model that works well. However, his paper was written in a very ugly font that no one had no interest in the paper. ...
In 2009 he wrote it again in nice-looking IEEE type of paper, and everybody respected it.

The reason I tell this in detail because the adults. Adults like numbers.
Talking about a newly written program, they never ask about essential matters.

They don't say:
"How does the program work? What does the chip do? How does the chip look like?"

They ask:
"What's the capacity of the program? How much is the chip's price? How many second does the program to run?"

Then they think they have understood.

If we had told adults:
"RAM are stacked on the mainboard very beautifully, it had a very slim case.", then they don't understand.
We need to tell them: "We saw a computer with quad-core with 1T hard-disk drive!". Then they shout: "Oh, a really nice computer!"


===

to be continued...

Monday, July 26, 2010

Eclipse IDE with PyDev too slow!

When Eclipse IDE is too slow while developing Python with PyDev,
and you've done already everything you could do (e.g. increase the -Xms, -Xmx, -XX:MaxPermSize, and change the -Dosgi.requiredJavaVersion to the latest etc...) and still is slow,
try turning down (not use) the Pylint and Code Analysis.
This might help...

Python development with Eclipse IDE on Mac OS X

I've been using Aquamacs Emacs and Bash Shell for Python development on my Mac OS X.
Though now I'm about to start develop a hybrid project with my PACS and ROI project (Python + BerkeleyDB ...) and XNAT (Java + PostgreSQL + Apache Tomact + XML ...), and it's good to have an IDE though when a project is composed of several different projects, programs and languages.
I had given up to use Eclipse IDE for my Python development because of several errors and issues with Numpy, unresolved imports and etc...
Now I've investigated further on this problem and I've almost resolved those problems:

  • Unresolved import errors (and warnings)
Manually add the source directories, .egg files or whatever which is containing the libraries with the 'unresolved import' errors and warnings in the PyDev PYTHONPATH.


Then try again.
When it's not resolved yet, then try modifying, adding more source folders, etc. to the project's PYTHONPATH.


Play around with those until it works.
You might need to examine, which libraries is loaded when you launch Python on Bash Shell, and which libraries you included in your PyDev preferences, when you have e.g. several other versions of a same library (e.g. Numpy) installed on your machine.

  • DYLD_LIBRARY_PATH problem
I use several bash variables to let my system know where I have libraries, binaries, header files, etc.
Though, when a program is launched as an Apple Mac .app, those apps don't see my bash path variables and configurations.
The solution is to edit the ~/.MacOSX/environment.plist file,
as is appearing in this blog post.

One might get the same result (for my case, just letting my Eclipse IDE to know my DYLD_LIBRARY_PATH) editing the app's Info.plist file as is appearing in Apple's Mac OS X Reference Library here, which might be a safer way to play around only with the app which matters, rather then to play around system-wide.

Though I haven't tried that, as editing the ~/.MacOSX/environment.plist just worked, and I didn't want to log out and log in and so on ...