search
top
Currently Browsing: Others

AC/BC – a religious programmer

Just this morning I have realized that most of us programmers have our own religion. A very simple one however some of us tend to be quite fanatic about it.

AC/BC – After coffee/Before coffee

So, don’t talk with me BC.

Time travel

I am a SF fun and one thing has puzzled me over the time: time traveling. I am sure that time traveling is either impossible to be done or we as the human race will never discover it.

Aside from various moral discussions or paradoxes involved with this concept, there is one thing that is obvious. Nobody have come from the future to visit us.

Why?

Because:

  1. it is impossible to travel through time.
  2. the travelers are very careful not to leave any marks in the past.
  3. the human race will gone extinct before the technology will enable us to travel through time.

As option (2) is highly unlikely I am hoping for (1) as (3) is not quite pleasant even if this is the most probable one.

Master of science in Web Services development

I have just finished my last exam for the master. Right now is the last sprint to the end, I have to make a paper and an application on Web services for a modern educational system.

I have decided to make a challenge out of this paper and write the application in C#. I’m a Java developer mostly and making it in JSP would render in me learning almost nothing out of it. So as the paper will start to progress I will try to post all my findings, all that I learn in this blog or maybe writing longer articles in the article section of this site.

JSP/Java – strip_tags() PHP like function

Another PHP function that is very used is strip_tags.
This function tries to return a string with all HTML tags stripped from a given string.

   1:      public static String strip_tags(String text, String allowedTags) {
   2:          String[] tag_list = allowedTags.split(",");
   3:          Arrays.sort(tag_list);
   4:   
   5:          final Pattern p = Pattern.compile("<[/!]?([^\\\\s>]*)\\\\s*[^>]*>",
   6:                  Pattern.CASE_INSENSITIVE);
   7:          Matcher m = p.matcher(text);
   8:   
   9:          StringBuffer out = new StringBuffer();
  10:          int lastPos = 0;
  11:          while (m.find()) {
  12:              String tag = m.group(1);
  13:              // if tag not allowed: skip it
  14:              if (Arrays.binarySearch(tag_list, tag) < 0) {
  15:                  out.append(text.substring(lastPos, m.start())).append(" ");
  16:   
  17:              } else {
  18:                  out.append(text.substring(lastPos, m.end()));
  19:              }
  20:              lastPos = m.end();
  21:          }
  22:          if (lastPos > 0) {
  23:              out.append(text.substring(lastPos));
  24:              return out.toString().trim();
  25:          } else {
  26:              return text;
  27:          }
  28:      }

How smart a book character can be.

I was watching the other day a movie. It’s not important what movie it was, what is important is the movie pictured a smart and cool character. Well… the problem was that I did not consider him to be quite so smart. There were certain situations where I thought he could have behaved better. :D Now I’m just bragging.

OK. But now let’s be serious about it. How smart a book character can be. Well, I guess, not smarter then the author who portray him. But a good book is not required to have a smart character. There are books written to be funny, to inspect the human mind or soul or whatever. But there are books in which the action revolves around a character, a strong character, a smart character. He defines the book.

I’m a S.F. fan and one of the characters that have impressed me is was Hari Sheldon from the Foundation series written by the Isaac Asimov. But hey, he was a university professor with a PhD in chemistry and with over 500 volumes written. So, I may say, quite a smart man. No wander his characters are very well written. And the list can continue.

Copyright

Today I have searched for a license for a product I’m doing at work. This product is free but in the same time it is not open source so I can not assign any of the GPL licenses type.

So in search for a proper license I have found (in fact a colleague of mine told me about it) a site that is proposing licenses for the work you are doing. This site is http://creativecommons.org/ and I’ve decided to add one of their licenses to this blog.

Nice..

Next Entries »

top