Showing posts with label 8. Show all posts
Showing posts with label 8. Show all posts

Wednesday, February 26, 2014

Musing Journal #8


On Being a Writer

So many people want to be a writer. Why not? After all, all you have to do is sit in coffee shop everyday for a couple hours writing and you're a writer. But is that a professional writer or a hobbyist?

Stephen King wrote that he maintains 4 pages per day work load. Sometimes it comes easy for him. Other times, not so easy. But he wrote those 4 pages every day.

If you consider that, considering standard submission formatting, each page would count for 250 words, then you understand that professional writers write 1000 words per day. That's every day.

One week, then, equals 7000 words. That's enough for a whole chapter (or two). One chapter per week means 50 chapters per year. Or about 2 books per year. 350,000 words per year or 175,000 words per book.

Of course, that's assuming Dictionary size book. Normal book length is only about 100,000 words give or take. So, if you are a real "professional" book writer, then you should be publishing 3 books per year.

That is what doing 1000 words per day will give you.

Consider that. 1000 words per day. Is that so hard? If you have jobs, and other responsibilities in life, then yes, it's hard. There are people who just cannot do that much work per day. However, there is a difference between a dedicated writer and a hobbyist. A dedicated writer, will write, at the very least, one page per day. And at the end of the year, they will have the next great American novel. Think about it: one page a day. 250 words per page, and you're a writer.

The most important thing is to make a schedule and keep at it. If you're doing it every day, fulfilling the minimum required word count, everyday, then you are a writer. If, on the other hand, you like to just chat, browse the internet, and maybe write something, then I'm afraid, you're not a writer.

Unless you are keeping up schedule, you're not a writer. A true writer will keep up his schedule every day. And to that end, I recommend Nanowrimo for every one who dreams of being a writer.

Nanowrimo basically forces you to write an average 1667 words per day. This, on the month where you are guaranteed to be busy, dealing with holiday activities. Having participated twice, I can tell you that it is not at all easy. Sometimes, I just have to force things out.

The neat thing about it is that at the end of the month, when I fall back to normal workload, my normal workload seems easy in comparison! So, yes, Nanowrimo was painful, but it's a good pain. Growing pains. Once I went through the exercise, my productivity improved. And so, I will keep on participating. I like to improve my productivity. And I am keeping up with my schedule. I am a writer!

Note: I have written 1896 words today, not including blog updates. :)

Thursday, October 31, 2013

Book Review #8


Easy Sushi
Emi Kazuko

Easy Sushi is one of the numerous sushi book I have. Even though I rarely eat raw meat, being too cheap to spring for sushi grade, I nevertheless enjoyed the pictures and presentation of the materials. There is nothing fancy about preparing for sushi. This being vinegared rice, some nori seaweed sheets, and some meat (usually raw) on top. That's about it.

Nothing much in regard to secret ingredient as well. The recipe for sushi is well-known. The book does have simplistic elegant presentation which I like, and there's some materials near the end of the book that updates the recipes somewhat. As far as sushi book, this is average. But as coffee table book, I really like this one. So, think less of a cooking book, more of an art book. If you think your food should be artistic, then give this book a try. You may like what you see.

Monday, October 14, 2013

Cooking Journal #8

Chicken Legs


Now I can get used with this. I like chicken legs, especially deep fried! There is only one problem: Tremendous amount of oil is being used. As it is, I don't want to use too much oil, and as you can see, the legs are only half submerged. This means that I cannot leave the cooking alone. I have to watch the legs being fried and keep turning them around.

On my previous posts, I mentioned how I never use condiment, or spices on all my chicken. Since this cooking method is so time consuming anyway, I decided to bread my chicken. Simply wash the chicken legs, and shake them around in cooking flour.

The result is that the wetness is somewhat contained, and the chicken becomes softer and juicier. Definitely tastier than simple frying without flour. Another thing: The wok will have to be cleaned thoroughly after this. So, good eating, yes, but tremendous amount of work, not only in cooking, but also in cleaning up afterwards.

Saturday, October 12, 2013

Nintendo Journal 8


TopGun LCD game


I also picked up an old LCD games. TopGun by Konami. It's just a single board game with LCD screen. There's a small speaker on the back. It's amazing how simple these things are. I think games like these are perfect for Petit Computer projects. I will be rustling up a few.

I marvelled at how thin the LCD screen is. It's just a thin plastic, nothing more. I looked at the contacts, and they're sooo tiny! I really doubt that they can align it perfectly, and yet, when I reassembled the device, it works fine!

I don't know how they do it. As simple as it is, that's not something any rookie can do. There must have been some degree of experimentation in order to fit things just right.

Sunday, August 18, 2013

Raspberry Pi Journal #8

Too Many Failures

In order to learn something new, you must first admit that you are stupid. After all, if you are smart, then you already know whatever it is you're learning.

Raspberry Pi has gone so far, and it's a relatively stable system, now. Furthermore, with NOOBS, installing the operating system is as easy as selecting item from a menu. Unfortunately, that's not all there is.

I know the Foundation has decided on Scratch for beginners, and Python for everybody else. I will not question their decision. However, I am used to having BASIC programming language to teach beginners.

My view is strengthened by the fact that Nintendo DSi/3DS has an app called Petit Computer. I happen to think that it is the perfect system to learn computer programming: Portable, cheap, convenient, and relatively powerful. There are numerous games exists to stand as template for what to do. That is all you need to learn computer game programming, and the one I recommend to everybody.

Enter Python. Even assuming that people have no problem learning the keywords, there exists certain conventions that will trip up people. The fact that Python tutorials use lists concept quite a lot, and no compatibility in BASIC, will certainly trip up a lot of people. It certainly tripped me, and I'm used to doing Perl and Lisp. I have experience in dealing with recursive lists, but is that something you want to teach to beginners? I don't think so.

Then there is a reliance upon libraries. Some of these, are in fact, rather shallow. By that I mean if you just spend a little bit more time explaining the algorithm behind the scene, you could've taught people on how to roll your own. Alas, that knowledge is kept secret. I, for one, know that depending upon libraries will hurt you long term. I depended upon Linux OS to process my procedures. What happened when I moved to Windows? Yup, big fail.

The problem is, I have no satisfactory BASIC language for Raspberry Pi. BBC Basic is too old. SDL Basic seems buggy and underpowered. Doesn't seem to have array. BASIC256? I forgot what it was, but I'll do a wait and see. Will visit it later, maybe sometime next year.

Somebody in the forum suggested that Python is the new BASIC. I'm still investigating it, but so far, there's nothing to suggest that Python can be friendly to beginners. That is, if you do it right, and not insists upon using efficient, high-level construct in Python.

Perl has a friendly attitude: There's more than one way to do it. Since different people do it different, Perl has the reputation of being "write only". I admit that learning to program differently is not a skill other people can master easily. But you can learn to do great things with Perl easy, just as so long you don't have to deal with other people's program!

Python, on the other hand, has the attitude of: There can only be one way to do it: the right way! In theory, it sounds great. In practice, there is always somebody who did it the boneheaded way, anyway. While my Python skill has improved tremendously, there is the odd occasion when I'm stumped in reading somebody's Python program. Pseudocode-like? I don't think so.

Personally, I prefer Processing, which is a bad name due to the difficulty of searching it using search engine. "Processing" is a very common word! I like the language, though. There are two problems associated with Raspberry Pi. (1) It's not officially supported. (2) It runs very slow when it does run.

I can't vouch for non-supported slow poke as good introduction for beginner!

So that left us with Python. I don't like it, but assuming I stay away from more advance techniques, I guess it's workable. I will continue to study the language and we'll see what happens.

Another failure is my attempt to back up my SD card. Yes, it's still not backed up. Would you believe that I run into "Out-of-Space" error? Both cards are formatted blanks. How come I don't have enough space? My guess is that I need to either partition the card slightly less than 14 GB. Maybe 10 GB. That way, it gives a leeway for other stuff.

Then again, my flashdrive has "File too big" error when it reaches 4GB. Another guess is that FAT32 maxed out at 4GB. So, when saving images, I need to compress it to less than 4GB. Needless, to say, I'm not happy!

I will not repartition my SD card without back up. I will get a 32 GB card, and see if I can back up into that, then I will repartition that card into 4GB chunk partition. Then, I will write the script to back up with compression. Hopefully, that will work just fine.

I found out that there is no swap partition, though. There's NOOBS partition, boot partition, and main partition. There is something about 2 MB, but I don't know what it is. Never mind. My next card will have 4 GB partitions all around. I hope that I have enough space for /usr/bin. I'll be installing quite a bit of software. My Robo3D printer just came in, and I'll be hooking it up to Raspberry Pi, for sure!

Thursday, August 15, 2013

Petit Computer Journal #8


Petit Computer Journal #8

The Apple Picker Game part 2



The Apple Picker Game? We're going to finish it up proper! Actually, we're not going to really make it professional quality. But we'll put on some fancy dressing on it to make it really enjoyable!

Adding color:
It was later in the development cycle (fancy words for repeatedly finding and fixing numerous bugs) that I find myself squinting at the screen looking for that last apple among the many snakes. Adding colors solves this problem. I colored the apples pink because I find red is too strong among the snake green.

Adding music:
It makes a great game. Looking at the help menu, I see a list of ready made music. Use BGMPLAY N, where N is a number. BGMSTOP to stop the music. Remember that N is a number. If you do this: BGMPLAY FANCY. That means you're playing music as defined by variable FANCY, which would be zero if you haven't set it to anything.

I purposely did not add music for level playing. I found it to be too noisy. But if you want it, add this to @NEWLEVEL
BGMPLAY LEVEL+ADJ
This will launch a new background music with every new level, with ADJ as offset.

Adding Sound Effect:
Oh, this is a good one! I added scream, hit, and coin sounds immediately. Easy sound effects! It took me awhile to add steps sound, but once I did, I never want to go back! This is how you know what you did is good!

Adding walls:
This was a doozy! The program kept hanging up (a polite way to say unintended infinite loop) and I didn't know why! Obviously, I needed to work out the math on paper, and then do exhaustive analysis upon it. I did neither. I did hack-and-slash programming, so even now, I'm not sure the solution is correct.

I did test out this form:
FOR I=0 TO 0:T=RND(5)+5):I=ABS(MY-T)-1:NEXT:WX[0]=T
You probably wonder why I bothered to put the FOR loop in there. I use it as REPEAT loop, just so you know. Notice that I set the value of I everytime. When MY==T, the loop will repeat. That is, T of any value except WY.

The walls will erase snakes. That's fine. I also have to make sure that the walls will never form an enclosed space where the player cannot enter/exit. The easy way is to create some levels with array or DATA statements. I decided to create it dynamically, which isn't the easiest in the world, but I hate putting in DATA too much and results in repeat levels, making them boring.

Adding Lives:
I added this as I realize that the later levels may feature apples surrounded by snakes. I don't want the game to end immediately. Like any good design decision, once I put it in, I don't want to take it out.

Adding Time:
This comes in last. After a while, I started to add challenges. Can I finish 10 levels in 5 minutes? 20 levels in 10 minutes? Yes, I can! You can, too. Look at the levels and time completed. Major bragging rights, there!

Adding Alternative control:
It's not hard to do button controls. I simply extended the button readouts, and that's it! Noteworthy to mention is that I didn't put fast button where pushing L or R button results in faster movement. It's not hard to do, but I can pull the feature out after I put it in. Not a good design decision.

Adding moving snake:
I decided not to. It's not that kind of game. The game evolves from taking apples (Path Finding/Travelling Salesman) problem, to maze game, to Least Cost finding. Along the way, you have to be able to control the person very well to avoid running into snakes.

Adding customized graphic:
I decided not to. The game benefits from seeing the whole level all at once. If I use same size sprites, the size of the game would have expanded radically, for little returns. If I use double size sprites, the game will look great, but play suffers. If I use smaller playfield, the game becomes boring really quickly. If I use big sprite on top screen, and normal size for bottom screen as map, then the player will constantly look at the bottom screen. In which case, why bother?

How to CHEAT:
Yes, you can cheat! You have the source code in front of you! Whenever you feel like you want some extra lives, hit BREAK, then type this:
LIVE=20:CONT
You'll continue no problem. Your live is now 20! You have to be careful to do it so the screen does not scroll, and no apple is overwritten. I recommend waiting until the last apple is on upper right corner.

You can also add more apples, by typing this:
SCORE=9:CONT
Since the level advances every 10 points, this will cause new apples to appear at the next apple taken.

Level select is no problem either. Can you guess how?
LEVEL=15:CONT
Yup. It's that easy!

Finally, you may want a puzzle game, instead of an action game. Not a problem! Do this at @GAMELOOP

From this: VSYNC 15:GOSUB @SETB2
To this: VSYNC 1:GOSUB @SETB3

And you got yourself a puzzle game!

Professional Quality?

This game is a good Hobbyist effort, but I wouldn't call it a professional quality. There are different things that I can do as a professional, but choose not to. I already mentioned the exhaustive testing of walls. Here are some other things that I need to do in order to be professionals:

1. Limit the number of lives to 30, as to not mess up the display.
2. Add option to set background music to the levels
3. Add faster speed button
4. Save/Load High scores
5. Refresh whole screen to prevent display corruption
6. Add variety of enemies. Maybe some will add apples, others fling you randomly to another part of the screen.
7. Add time limit, allowing for levels of difficulty.
8. Also adjust player speed according to level of difficulty.
9. Add Puzzle mode from Option
10. Add replay option, play as demo on splash screen.
11. Tune up the presentation, not necessarily fancy graphics, but I would experiment with different placements of elements.
12. Make sure adding apples, snakes will not hang the game.

If I want to put this out for sale, I will add these:
13. Multiplayer option. 2 players. One is using Dpad. The other, buttons. Photo Dojo style
14. Computer player, single, double. With good path finding algorithm.
15. Selectable number of player
16. Sound/Music selection. Volume adjustable individually.
17. Optional level editor. It's not that hard.
18. Optional sprite editor. It's not that hard.
19. Optional music editor. It's not that hard.
20. Optional 3D graphic. This one is hard, and not at all useful. It's great marketing tool, though.


Sunday, August 4, 2013

TheMagPi #8 has bad PDF format?


So, I was printing out TheMagPi magazine pdf files because, silly me, I didn't get the Kickstarter printed magazine offer. I can tell you that those books printed out thick! I bound three of them with staples. Interestingly, the Raspberry Pi went 100% CPU mode for quite a long time. Apparently, the codec or whatever is a complicated version. There was a time where I forgot to connect the printer, and it printed the pages one after another with no waiting, so I know it's not the printer. The bottleneck lies with RasPi!

The interesting about it is that on PDF#8 wouldn't print. Not even one page! I checked out the printer status on 127.0.0.1:631 and it said: "SpliX Cannot open job"

Huh? What exactly is SpliX? I know lp uses GhostScript, but SpliX? And only on number 8. The rest of the PDF printed out just fine. In the end, I had to use my Windows machine to print out TheMagPi #8. So, the problem isn't solved.

By the way, I'm using the command line lp because xpdf went into Segmentation fault every time it tried to print. Very disappointing. It took me a while to note that the printer defaults to A4 size, instead of US Letter size like I wanted. In the end, I scaled the page to 96% of the original size to good result.

lp -o scaling=96 filename