The “European Knowledge” experiment

I have just started a very small poll that is part of a small experiment i am conducting. If you’re interested please check it out and vote here. Please do not lookup the answer online. It will only take a minute to complete. The results of the experiment will be revealed once i close the survey, in about a week or so. I would like to thank anyone that participates in advance.

Stop joining spam meaningless Facebook groups

I’ve seen this trend taking off the last year or so. Every spammer out there has included Facebook in their plans. Here is how it works:

  1. I have a stupid site i want to promote or a stupid product or anything that you wouldn’t actually even pay attention to.
  2. I go to Facebook and create a new group. I give it a smart, funny, witty, inviting name such as “I am always right and when i’m not i’m rightfully wrong”. How funny.
  3. I spam invite all my friends to join. They find it funny enough and do join.
  4. The group shows up in their “Info” box.
  5. More users notice it and join. Moreover users that already join suggest to their friends to join as well.
  6. The group shows up slowly in many walls as “Dumbass join the group “I’m always right and when i’m not i’m rightfully wrong”“.
  7. Facebook also starts suggesting it to other users because people in their contact list are member. You must have seen them “”I’m always right and when i’m not i’m rightfully wrong” Dumbass is a fan. Become a fan.
  8. In no time this shitty thing goes viral. Thousands of users actually are members of the group in a matter of days/weeks.

Now one would ask “Why is that spam? It’s fun!”. Ok count with me:

  • The group administrator, a very clever spammer if i might add, has indirect access to our timeline. This means that whatever he posts on the group’s wall, ends up in our timeline. Thus, we are actually subjected to “free ads” if i might use the term.
  • Since Facebook will list this in your Info box and moreover suggest it to your friends (if you haven’t done that already) it will just keep on going viral. Which means even more free advertising.

In most cases those groups promote or will try to promote something at some point or the other. The thing is why should you join? You like a quote? Freakin post it on your wall as a quote. Don’t join the stupid group so i can be bugged as well. You need to consider two things:

  1. Facebook groups were created to group people and their activities. You like a blog? Join their group. You are in a community (for instance your local basketball team)? Join the group. That’s the idea. RTFM!
  2. In Facebook we are a network. That’s the original idea. Which means that if you’re my friend i get all your posts on my timeline. Don’t spam me!

And since i’m in the topic, as a side note, i want to say this. Stop freakin posting your farmville, mafia wars or any other stupid game’s achievements  on your wall. Lord! Do i really need to know that you found a stupid virtual cow in your so called farm?

That’s it. I vented. Thanks for listening and God bless :)

Hook up C# with Windows Sharepoint Services (WSS) tutorial

In this small tutorial i shall demonstrate how to hook up C# to use the Windows Sharepoint Services API (WSS). It’s fairly simple and straightforward. You need the following:

  1. A machine running Windows server 2003/08 with Sharepoint installed.
  2. Microsoft Visual Studio 2005.
  3. About 15 minutes.

For the purposes of this example, we will create a small console application that will list all the sites of a Sharepoint site. First of open Visual Studio and create a new Visual C# console application. Next step is adding the reference to the WSS API on our project. To do so, you can go on the explorer window, right click on the “References” and click “Add Reference…”. On the window that will show up choose “Windows Sharepoint Services” dll from the .NET packages.

Once this step is done, off to the code:

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Microsoft.SharePoint;
  5.  
  6. namespace TestApp
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             SPSite root = new SPSite("http://testsite");//this is the URL to the sharepoint site we want to connect to
  13.             foreach (SPWeb site in root.AllWebs)//looping through the collection of the sites
  14.             {
  15.                 Console.WriteLine(site.Name);
  16.             }
  17.             Console.ReadLine();
  18.         }
  19.     }
  20. }

From here on, sky is the limit! You can view a documentation of the WSS API here.

How to use bindings in the backing beans in ADF 10g

This is a follow up to the original post about acquiring a bindings object in backing beans in ADF. Some have had the question, how to use the bindings for standard operations in the backing beans. Hence this post!

The answer is – easy. As soon as you’ve got the bindings (oracle.binding.BindingContainer object) instance, you can do a lot of interesting stuff with it.

Always keep in mind, that it represents the page definition, meaning that it “contains” whatever the pageDef does.

Create a class like the following one:

  1. import oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding;
  2. import javax.faces.application.FacesMessage;
  3. import javax.faces.context.FacesContext;
  4. import javax.faces.el.ValueBinding;
  5. import oracle.adf.model.binding.DCBindingContainer;
  6. import oracle.binding.BindingContainer;
  7. import oracle.jbo.Transaction;
  8. import oracle.jbo.domain.Number;
  9. import oracle.jbo.server.ApplicationModuleImpl;
  10. import oracle.jbo.uicli.binding.JUIteratorBinding;
  11.  
  12. public class ADFUtils {
  13.  
  14. private BindingContainer bindings; //this is mainly used to store bindings, but in fact its just an implementation of java.util.Map
  15. private DCBindingContainer dcBindings; //whilst this class gives much more control over the bindings
  16. private FacesContext ctx;
  17. private static Utils instance;
  18. private Transaction transaction;
  19.  
  20. public ADFUtils(BindingContainer bindings) {
  21. this.bindings = bindings;
  22. this.ctx = FacesContext.getCurrentInstance();
  23. ValueBinding vb = this.ctx.getApplication().createValueBinding("#{bindings}");
  24. this.dcBindings = (DCBindingContainer) vb.getValue(this.ctx);
  25. this.transaction = dcBindings.getDataControl().getApplicationModule().getTransaction();
  26. }
  27.  
  28. public Object resolveExpresssion(String expression) {
  29. Object obj = this.bindings.get(expression);
  30. return obj;
  31. }
  32.  
  33. public JUIteratorBinding resolveIterator(String iterName) {
  34. JUIteratorBinding iter = (JUIteratorBinding)this.getBindings().get(iterName);
  35. return iter;
  36. }
  37.  
  38. public FacesCtrlActionBinding resolveAction(String actionName) {
  39. FacesCtrlActionBinding action = (FacesCtrlActionBinding) this.getBindings().get(actionName);
  40. return action;
  41. }
  42.  
  43. public void resolveActionAndExecute(String actionName) {
  44. FacesCtrlActionBinding action = resolveAction(actionName);
  45. action.execute();
  46. }
  47.  
  48. public JUIteratorBinding executeActionAndGetIterator(String actionName) {
  49. FacesCtrlActionBinding action = resolveAction(actionName);
  50. action.execute();
  51. JUIteratorBinding iter = action.getIteratorBinding();
  52. return iter;
  53. }
  54.  
  55. /*
  56. * This affects only the application module the bindings object belongs to.
  57. */
  58. public void globalCommit() throws Exception {
  59. if (transaction.isDirty()) {
  60. transaction.commit();
  61. System.out.println("Changes have been committed");
  62. }
  63. else {
  64. System.err.println("No unmodified data to commit");
  65. }
  66. }
  67.  
  68. /*
  69. * This affects only the application module the bindings object belongs to.
  70. */
  71. public void globalRollback() {
  72. if (transaction.isDirty()) { //and transaction has modified data
  73. transaction.rollback();
  74. System.out.println("Changes have been rollbacked");
  75. }
  76. else {
  77. System.err.println("No unmodified data to rollback");
  78. }
  79. }
  80.  
  81. //MESSAGES
  82.  
  83. public boolean hasErrors() {
  84. FacesMessage.Severity maxSeverity = this.ctx.getMaximumSeverity();
  85. return (maxSeverity != null? maxSeverity.compareTo(FacesMessage.SEVERITY_ERROR) == 0 || maxSeverity.compareTo(FacesMessage.SEVERITY_FATAL) == 0 : false);
  86. }
  87.  
  88. public void inform(String messageText) {
  89. FacesMessage message = new FacesMessage(messageText);
  90. message.setSeverity(FacesMessage.SEVERITY_INFO);
  91. this.ctx.addMessage(null, message);
  92. }
  93.  
  94. public void setBindings(BindingContainer bindings) {
  95. this.bindings = bindings;
  96. }
  97.  
  98. public BindingContainer getBindings() {
  99. return bindings;
  100. }
  101.  
  102. public Transaction getTransaction() {
  103. return transaction;
  104. }
  105.  
  106. public DCBindingContainer getDcBindings() {
  107. return dcBindings;
  108. }
  109.  
  110. public ApplicationModuleImpl getAppModuleImpl(String dataControlName){
  111. javax.faces.context.FacesContext ctx = javax.faces.context.FacesContext.getCurrentInstance();
  112. javax.faces.el.ValueBinding bind = ctx.getApplication().createValueBinding("#{data}");
  113. oracle.adf.model.BindingContext bindingContext = (oracle.adf.model.BindingContext) bind.getValue(ctx); //resolve binding context
  114. oracle.adf.model.binding.DCDataControl dataControl = bindingContext.findDataControl(dataControlName);//find data control by name (defined in DataBindings.cpx) from BindingContext
  115. /*
  116. * finally get the View Object instance which the iterator is bound to (see the attribute Binds in the iterator definition in the pageDef)
  117. * then invoke the magic method executeEmptyRowSet on it
  118. */
  119. return (ApplicationModuleImpl) dataControl.getDataProvider();
  120. }
  121.  
  122. }

So now all you have to do is instantiate the ADFUtil class and invoke its methods!

The all wrong story about comments

It’s been a seriously long time since i wrote here. But i can’t remember the last time i felt this urge, this itch to write about something. All this time that i haven’t updated my blog and i seldom comment on blogs i haven’t been all away. I’ve been reading the usual blogs i always read. Then why didn’t i comment? Because i had nothing to say!

One would ask, why do i say this? Well, i am sick of reading blog posts saying “how commenting can improve your traffic”, or “comment on do-follow blogs” and the such. You won’t believe how much annoyed i am when i read those kind of posts. Just today i read this post where someone was explaining what makes him comment or stops him from commenting on a blog. None of the reasons he mentioned was about the content and the article he was actually reading! This tipped me of. I wanted to write this a long time ago but this just made the cut.

What he basically said was that if it doesn’t have commentluv, it is a do-follow blog or it has a CAPTCHA, it doesn’t make him want to comment. And here is what i say. Commentluv, in my humble opinion, is one of the worst plugins out there. Why? Because an article on your blog has links to other articles on other blogs that are irrelevant with that content you are writing about! They call this link love. It’s all bullshit! Why? Because it would be link love if you posted in your article “blah blah blah here is an excellent example of what i am talking about [link] blah blah blah”. That is link love. On the other hand this:

SomeStupidPrick wrote:

Man this is a great article!

SomeStupidPrick’s latest blog post “How to have an irrelevant link on someone else’s blog”

This is not link love. It’s disguised spam comment.

Now, i don’t want to be unfair. I know a lot of my readers who have blogs, are commentluv enabled and i still like their blogs. But, i believe, they have been tricked into some stupid marketing useless idea. And let me put it this way. If you will comment only if i am commentluv enabled then guess what. Get the heck out! (besides i don’t have commentluv and i appreciate people leaving comments just for the pure purpose of it).

On the do-follow part. Things are pretty much the same as above. The purpose search engines rank your content in a certain way is to make it easier to be discoverable on relevant search queries. If you go ahead on a spree and start planting your link everywhere you will definitely get results but they won’t be quality results. Think as a user for crying out loud! How many times have you been searching for something and you stumble on completely irrelevant posts just because of these kind of stuff? So, once more, if you comment here after checking if this is a do-follow blog, get the heck out!

Finally, once and for all, let’s tackle the CAPTCHA thing. I want to make things easier to my readers to drop a line. On the other hand i want to make things easier for me to moderate. I hate all this wise-ass people/bots trying to plant their links on my blog. So, if this is what i have to do then i’ll do it. Besides, you fill up so many CAPTCHA’s a day for useless things and registration forms, and you are too lazy to fill an easy one here ti have your say? Get the heck out!

And what do i mean by “The all wrong story about comments”? Well, comments where named comments and not “advertise here”, because they are intended to serve as a way to give feedback or thank someone. They where not intended to boost or promote your own stuff.

I know that after a long time, writing with such hatred is not such a good idea. On the other hand, i think it perfectly explains my absence. The blogosphere has been contaminated with people trying to make money writing crappy blogs. I fear that that will drive quality blogging to a halt.

I have been disappointed on the majority of the content posted these days. So little things are informative or worth a read. Most of the stuff are junk. And don’t get me wrong here loyal readers. I love your blogs. I have been following you and “you” know who you are.

« Previous Entries Next Entries »