I’ve known about tries for sometime. They’re a pretty neat data-structure for storing and looking-up strings.I decided to try and implement one in Java so that I can learn more about them. I’ll post another article later that goes into some more detail about this implementation, but for now you can check out the source here. It’s not production-ready by any means; it’s just me playing around.
My wife and I found a dog that was wandering Hunt Highway between Lindsay and Val Vista. He was pretty scared and shy and after chasing him for about .5 mi we eventually caught up with him at the ranch on Val Vista and Hunt Highway. The folks at the ranch said that they have been seeing him for the past few days but weren’t able to catch him. After spending almost 30 minutes coaxing him with treats, I was finally able to get him into the car. My wife works for a no-kill shelter and we were hoping to get him in there but they can’t take him because they are full. My wife is looking for other shelters in the area, but we’re not sure what we can do.
He’s a normal-sized dog and is probably at most a year old. He’s very much a puppy and a very sweet boy. He was scared at first but then warmed up to us very quickly. He’s very friendly and seems to be at most a year old, but quite possibly younger (maybe 9-10 months) because his adult teeth are just coming out.
He’s either a bulldog/dane mix or a pit/dane mix. He hasn’t displayed any signs of aggression and seems to be in good health. Not sure how he is around kids.
He didn’t have a collar on and we’re taking him in today to see if he is chipped. If this is your dog, please let us know!
We would love to adopt him, but we already have two dogs of our own and can’t afford to keep another one. If anyone is interested in a good family dog, please let us know!
Or, if you know a no-kill shelter or a rescue that has room and can take him, please let me know also!
1995 was a difficult year for me. I had finished the 8th grade at Indian School Muscat. However, instead of joining the 9th grade with my friends, I had to move to an entirely new school, Indian School Al-Ghubra, which was much further away and worse, was our arch-rival. My first few weeks at the new school were horrible. I missed my friends terribly; everyone was a stranger and I had a hard time adjusting to the way things were done at the new school. My first mid-terms were a disaster. While I had consistently scored in the 80′s to 90′s in my old school, here it was a different story. My grades were pretty bad. Looking back, I think it was mainly due to the stress of moving to a completely new environment. I was unsure of myself and I simply wasn’t used to the way things were done.
I still remember when I got my Math paper. I had scored a dismal 37.5 out of a 100. I was shell-shocked. I had never scored that low on a math paper. As I stared at the paper, tears welling up in my eyes, I heard a gentle voice tell me, “It’s only the first exam. You’re new here and I’m sure you’ll do better next time…” I looked up to see my Math teacher, Mr. Vida, looking at me with a little smile on his face. I didn’t believe him then, of course. More urgent things were at hand, namely soon-to-be irate Indian parents whom I would have to answer to, at home. It seemed rather insignificant and pointless to me at the time. But looking back, I can see it for what it truly was: a concerned and kind teacher taking the time to comfort an obviously-distraught student.
Over the next few years I became very familiar with Mr. Desmond Vida, and his wife Mrs. Pushpa Vida, or as they were known around ISG, “The Vidas”. I used to go to after-school tutoring sessions for Math at his place, which in addition to being extremely helpful were also quite simply, fun. A lot of my classmates were there and our study sessions regularly had less-serious interjections were we all laughed and joked, along with Mr. Vida. Those four years at ISG were formative and extremely important since they played a huge part in molding me and shaping me into the person I am today, and the Vidas were a huge part of that.
Mr. Vida didn’t simply teach us Math. He did more than that. He was a mentor and a guide who helped his students realize their potential. He consistently encouraged us. This was especially poignant to me, a student who never really fit in with the “learn-by-rote” mentality of the Indian system of education. Oftentimes while I was wondering if something was wrong with me, he would remind me that no, there was nothing wrong, I was a smart kid, and that I was simply better at applying knowledge than regurgitating it (an opinion that was vindicated years later when I finally moved to the US for college and started acing my Math classes).
After 10th grade, Mr. Vida taught us English. He was as effective in English, as he was in Math. He didn’t limit himself to the syllabus, but deliberately went outside it. We would hold long discussions in class about the subtleties and nuances of the prose or poem we were examining. To help us understand our lessons better, he had us present plays on some of the subject matter. I fondly recall those after-school rehearsals, still.
I graduated high school in 1999 and Mr. Vida was there to congratulate me and everyone else. He told us how proud he was of us and that we would all go on to do great things. That was over 13 years ago. Over the years we kept in touch intermittently through email and eventually, Facebook. Mr. and Mrs. Vida moved to Australia and continued doing what they do best: teaching.
Then this morning I found out that Mr. Vida had passed away due to an accident. I read the words, but they didn’t register. The kind, intelligent, jovial man in my mind’s eye didn’t jive with what I was reading. I was shocked. Fate snatched an exceptional man away from us, before his time. Like I said before, Mr. Vida wasn’t just a teacher. He was an exceptional human being. He guided us without telling us what to do. He encouraged us and helped us along when we faltered. He was never one to patronize either. Even though we were still somewhat childish, he understood that we were on the cusp of young adulthood and treated us with respect, and without passing judgement. He was always there for us to turn to if we needed help. When I heard the news, long-dormant memories came flooding back: the laughs, the jokes, late-night Math tutoring sessions before exams, and especially before the 10th grade board-exams. The play rehearsals where we’d end up fooling around (much to Mr. Vida’s consternation) rather than doing anything useful. Cruel irony then, that these fond memories were now tinged with sorrow.
Mr. Vida, you were a wonderful teacher and you were an inspiration. I am honored to have been taught by you. You will be missed, but not forgotten. Our thoughts and prayers are with Cruz and Mrs. Vida in this difficult time.
Guru Brahma Gurur Vishnu
Guru Devo Maheshwaraha
Guru Saakshat Para Brahma
Tasmai Sree Gurave Namaha
Guru is verily the representative of Brahma, Vishnu and Shiva.
He creates, sustains knowledge and destroys the weeds of ignorance.
I salute such a Guru.
The master was meditating when a priest respectfully entered his chamber. The master opened his eyes. The priest bowed respectfully and said, “Master, I would like you to look at the code of a young disciple of mine”. The master nodded and followed the priest to a computer. On the screen, was a code listing. The priest pointed to the code and said:
“My disciple created an abstract class and another class that extends the abstract class. However, he has a method that should be of use to all future derivations of the abstract class.”
The master furrowed his brow and looked at the code. “Indeed.”, he said. The priest continued, “I pointed this fact out to him and mentioned that it would be better to define it in the abstract class”. “I see; what did he say?”, asked the master.
The priest sighed and said, “He said ‘You Ain’t Gonna Need It’ and that he could simply copy the method into each new derivation when the time comes”. The master then asked the priest to bring the disciple to him at once. The priest bowed and went away to fetch the young disciple.
A few minutes later, the young disciple respectfully entered the master’s chamber. “You sent for me, master?”, he said. “Yes. I have a task for you”, said the master. The disciple bowed, indicating that he was ready to perform whatever task the master required. The master looked at the disciple and said: “Tomorrow, we will have monks visiting from a neighboring monastery. In their honor, our monastery is providing a feast for them. I need you to report to the dining hall tomorrow. The cook will give you further instructions”. The disciple bowed and left the master’s chamber.
The next morning the disciple arrived at the dining hall as he was asked. He looked around and noticed a large number of seats. He assumed, correctly, that these seats were for the visiting monks. He then noticed the monastery’s cook approaching him. The cook was holding a bowl that was filled with a white substance. As the cook got closer, the disciple realized that it was salt. Once the cook reached the disciple, he held out the bowl to him and said, “Master has asked you to give salt to any of the monks who desire it”. The disciple took the bowl and the cook left. The disciple was puzzled, but smiled thinking that this was going to be an easy task. After all, how many monks would require more salt in their food? He estimated only a few; not much more than that.
In a few minutes, the visiting monks arrived and sat at their places. Other monks from the hosting monastery brought out steaming bowls of soup for the visitors. The head visiting-monk took a spoonful of soup, sipped it and wrinkled his nose. “This soup does not have any salt!” he said, rather loudly. The disciple quickly ran up to the head visiting-monk and bowed and said “Master, I apologize that there is not enough salt in your soup, please allow me to offer you some!” The head monk nodded and the disciple quickly added salt until the monk motioned him to stop. He had barely finished when he heard another monk complaining that there was no salt in his soup either, then another, and another. Soon he was running around the hall at full speed, bringing salt to each of the visiting monks, trying his best to make sure that everyone was happy. The hall was big, and the number of visiting monks was many. When he was done, he sat down exhausted, in the corner of the hall.
He closed his eyes and tried to catch his breath. When he opened his eyes, he noticed that the next course was being brought in. “Surely the cook wouldn’t have forgotten to add salt this time!”, he thought. Unfortunately, it was not so! “There is no salt in my meal!”, thundered the head visiting-monk. The disciple got up and ran to the head monk to add salt his meal. Soon other monks started complaining and the disciple was running around the hall as he had done before, offering salt to all the visiting monks. The disciple hoped that this would be the last time he would have to do this, but alas, there were three more courses! The rest of the courses passed by in a blur for the disciple. All he could remember was that he was running around the entire hall, bringing salt to the visiting monks. The monks didn’t all finish their meals at the same time and so the later courses were continuously being brought out. Hence, he was always on his feet and didn’t get a chance to rest.
Finally, the monks stopped asking for salt and the disciple wearily went back to his corner. Dessert would be next, and there would be no need for salt then. He had barely sat down when he saw the cook approaching him. This time he had another bowl, also filled with a white substance. When the cook got close, he offered the bowl to the disciple and said a single word: “Sugar”. The disciple was almost in tears. He knew was was coming and prepared himself for the endless rushing around that he would have to do. Luckily there was only one course of dessert. When the feast was done, the disciple collapsed in the corner. He opened his eyes and noticed the cook walking towards him again. “What more will he want me to do?”, thought the disciple frantically. He noticed with some relief however, that the cook’s hands were empty. “Master will see you now”, said the cook as he got closer to the disciple. The disciple wearily got up to his feet and walked to the master’s chambers.
After a few minutes, the disciple arrived at the master’s chambers. He walked in and bowed in front of the master, his legs burning with fatigue. “How was your task?” asked the master with his eyes still closed. “It was exceedingly difficult master! There was no salt in the soup or the meals, and no sugar in the desserts! I had to run around the whole hall bringing salt and sugar to the visiting monks!”, said the disciple. “It must have been exceedingly tiring…”, said the master. “Yes, master! It was!”, said the disciple nodding his head. The master opened his eyes and said, “One could say that your task would have been much easier had the salt and sugar been added to the meals at the source, and thus before they were brought out to our honored visitors.”
In that moment, the disciple was enlightened.
A novice monk had just started learning assembly programming when he was troubled by doubt. He approached his master and asked:
“Master, how do I know which is code and which is data?”
The master who was meditating, opened his eyes, smiled, and said:
“Each is the other, yet neither is either.”
“Master, I do not understand.”, said the disciple.
The master then brought out two identical pots and said. “Take these. Fill one with the water from the lake, and fill the other with water from the stream that flows into the lake. Then bring them to me.”
The monk bowed and took the pots. He walked to the lake, which was some distance away and filled it with water from the lake. Then he walked around the side of the lake until he found the stream that fed water into the lake. He used this water to fill the second pot and then brought both pots back to his master and set them at his feet. The master looked at the pots, and then back to his disciple and said “Now go. You may come back tomorrow morning.”
The disciple came back the next morning to find his master standing with the two pots. He held up both the pots and then threw them to the opposite sides of the room. The pots smashed, and the water from both pots flowed towards the center of the room, forming a puddle.
The master then said, “Which pot contained water from the stream? Which pot contained water from the lake?” He then pointed to the growing puddle that was forming in the middle of the room. “Which part of the puddle contains water from the stream? Which part contains water from the lake?”
In that moment, the novice was enlightened.
I booked a balloon-ride for my wife and I for our second anniversary. It was the first time that both she and I had even been on a balloon. It was an awesome experience and a whole lot of fun. These are a few pictures from that trip. I’ve touched up some of these pictures with Picasa. I’m still learning and so I occasionally I’ll shoot something where the composition is ok, but the colors are all off. Still figuring out how to shoot things in different lighting conditions!
vim has an awesome feature, using which you can pipe a range through an external command. This is pretty useful if you’re opening up an un-indented or poorly-indented XML or HTML file. If you want to indent your entire file, simply do the following:
:%!tidy -i -xml -q
The -i option tells tidy that it needs to indent the content, -xml tells tidy that the content is well-formed XML, and -q puts tidy into “quiet mode” where extraneous information is suppressed. You can also specify ranges like so:
:40, 74!tidy -i -xml -q
This indents content between lines 40 and 74 (both lines inclusive). You can also do:
:., .+50!tidy -i -xml -q
This indents the current line and the next 50 lines. You can also do the same for HTML:
:%!tidy -i -xml -q
You can of course, supply additional parameters to tidy to customize the indenting.
:%!tidy -i -q