Tuesday, May 25, 2010

Set interface to prevent duplicating items

package test;
import java.util.*;

class Vertex {
int number;

public Vertex(int number) {
this.number = number;
}

public String toString() {
return number + "";
}

@Override
public boolean equals(Object obj) {
return this.number == ((Vertex) obj).number;
}

}

public class SetTest {
public static void main(String[] args) {
Set vertices = new HashSet();

Vertex a = new Vertex(2);
Vertex b = new Vertex(3);
Vertex c = new Vertex(3);

System.out.println(b.equals(c));

vertices.add(a);
vertices.add(b);
vertices.add(c);

System.out.println(vertices);
}
}


Class HashSet
Interface Set
A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1 and e2 such that e1.equals(e2), and at most one null element. As implied by its name, this interface models the mathematical set abstraction.

Equals method is overriden but it doesn't work!
true
[3, 2, 3]


groups.google.com/group/comp.lang.java.programmer/browse_thread/thread/5abcb183daa74336#

Monday, May 24, 2010

Sunday, May 23, 2010

Who want to be a programmer?

I know I will work for Google one day. Right now I'm about to finish my master thesis and in the meantime look what I've found a moment ago: Software Engineer - New Grad - Krakow

Sounds like a perfect spot for me!

The amazing final of a 1 millions dollars winnner, it's just a matter of time when I earn my first million. Just look at this interview with CEO of Asseco, his stock share are worth about 500m (I trust people who own 500m). It's worth to translate:
Constantly we say we have great programmers. This is not true. With all due respect for the profession of a programmer, decide about the success of analysts, who describe the IT processes. And, unfortunately, not educated good analysts. If they have, thanks to the companies for which they worked, and not Polish schools that would prepare them. The average university lecturer in computer science had the chance to achieve a major IT project, so it's hard to pass the knowledge relevant to business.

Honestly I'm not top programmer (one day I'll) but having at least one better person in each proffesion in my contacts and wide knowledge is undoubtfully an advantage.

Friday, May 21, 2010

brief receiving

emptypage has received a brief! I wish I could publish it but I guess it isn't in a good taste. Anyway I've started preparations, it's actually a very good training.

Right now I'm trying to put SWF uploader into work:


That's the sole of developer's job!

Previously I was trying to get image uploader plugin from CKeditor but the code was a lite bit obfuscated while SWF uploader seems to be dedicated tool for this.

Wednesday, May 19, 2010

facebook client library

If you are looking for facebook-platform.tar.gz here is the answer:

(look at the recent date)

Old REST API says: If you are new to the Facebook Platform, we recommend you use our new Graph API instead.

It's a terrible mess, I'm unable to log in to even the simpliest application because recent SDK version doesn't include methods every tutorial I encounter uses.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>stefan_test</title>
</head>
<body>
<h1>stefan_test</h1>
<p><fb:login-button autologoutlink="true"></fb:login-button></p>
<p><fb:like></fb:like></p>

<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: '100475266666223', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_GB/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
</body>
</html>


Now is 3AM, tommorow I'm gonna try this tutorial part 1 and 2 (a lot of code included encourages me to do so)

Tuesday, May 18, 2010

Thursday, May 13, 2010

Twitter keyphrases

My collegues have very similiar topic. I've listeded to their presentation and here is the of the keyphrases that seemend useful to me:
- collaborative filtering
- latent semantic analysis
- singular value decomposition
- item based collaborative filtering recommendation
- robust collaborative filtering
(and the last term with a paper covering this topic)
- Short and Tweet: Experiments on Recommending Content from Information Streams (PDF)

Two more links on Twitter advertising:
- Will Twitter’s advertisers be severely let down?
- http://www.wallblog.co.uk/2010/04/13/users-divided-on-twitter-ads/

youtube income, youtube monetization

I realized that every letter I would send to an employeer I would have to end with a disclaimer: "I will for google one day so this is only temporary job"

10 Insights From 11 Months Of Working At Google (91 comments)

Why Google Employees Quit (345 comments)

On a conference about video there was a discussion about 10 minutes limitation on YouTube. They say there are some law cases anyway extending this limit can be an easy way to get some revenue.

Tuesday, May 11, 2010

hosting code

I've created github repository here.

Even following instructions is not a piece of cake, even getting installer, even installing... "Social coding" is a nice thing but it doesn't work that way. Decent client is a must if want to gain wider audience.

I've created google repository here.

Right now I'm installing SVN plugin to Eclipse.

Getting Started with Google Code Hosting, Subversion, and TortoiseSVN without feeling like an Idiot - explained really simple!

Sunday, May 9, 2010

Saturday, May 8, 2010

Friday, May 7, 2010

it's been a long time

In the meantime there was a new release of the library - download.


(logged to my test account to find out that the last activity was 4 months ago)

Another question posted to newsgroup here and here.

Just basic stuff, learning the API:

public class Main {
public static void main(String[] args) {
Twitter twitter = new TwitterFactory().getInstance(XXX, XXX);
try {
Query query = new Query("obama");
query.setGeoCode(new GeoLocation(50.0, 10.0), 1000.0, Query.KILOMETERS);
QueryResult result = twitter.search(query);

for (Tweet tweet : result.getTweets()) {
System.out.println(
tweet.getCreatedAt() +
" user: " + tweet.getFromUser().substring(0, 2) +
" text: " + tweet.getText().substring(0, 2) +
" loc: " + tweet.getGeoLocation()
);
}

} catch (TwitterException e) {
e.printStackTrace();
}
}
}


Some useful classes: Query, QueryResult

Thursday, May 6, 2010

google adwords dla agencji

I registered a few days ago:
Otrzymujesz tę wiadomość ponieważ zarejestrowałeś się w serwisie Google dla agencji.

Twoja rejestracja w serwisie Google dla agencji przebiegła pomyślnie.

Zaloguj się do serwisu Google dla agencji poprzez stronę www.google.com/googledlaagencji. Przejdź do Panelu Google dla agencji, aby zarejestrować się na bezpłatne szkolenie Google dla agencji, zdać test i przeglądać inne użyteczne informacje.


I took a test, in this case headline includes the answer:


It wasn't that easy, I checked some things on the internet, anyway that was the point - force people to get a quick review of the basics:


Some useful links I encountered on my way:
analytics tracking
webmaster tools
youtube on your site

Wednesday, May 5, 2010

How to start cyfrowy dorsz?

List of groups, groups of lists here:
16. System oceniania prowadzących
Prowadzący: dr inż. Jacek Dajda
Prowadzący PP: mgr inż. Witold Rakoczy
Zespół: Anna Leśniak, Marcin Nowak, Paweł Obrok Paweł Pierzchała

What do you need to start working on this project:
• VMware
• Ubuntu

Remember, linux is not for people, so you must be cautious when following instructions:
• update sources list
• sudo apt-get install ruby
rubygems (untar, setup.rb)

1. jezeli masz jakiekolwiek rubygemsy to zrob:

$ gem install rubygems-update # again, might need to be admin/root
$ update_rubygems # ... here too


2. jezeli nie, to zainstaluj jakiekolwiek (sudo apt-get install rubygems)
i zrob punkt 1.

• gem install rubygems-update
• update_rubygems
• sudo gem install bundler
• sudo apt-get install ruby1.8-dev
• sudo apt-get install libxml2-dev
• sudo apt-get install libxslt-dev
• sudo apt-get install libsqlite3-dev
• sudo apt-get install libopenssl-ruby
• cd cyfrowy_dorsz/frontend then sudo bundle install
• bin/merb
• localhost:4000

github.com
codegarden (login needed)

Actually none of my fellow developers were able to start it. That is why I copied virtual machine with working application. But it wasn't the last tricky part - I needed to clean public keys and learn how to use git.


git clone git@github.com:obrok/cyfrowy_dorsz.git
git pull origin master (sudo bundle install just to make no gems were added)
git add .
git commit
git push origin master


Remember to perform tests before each commit: rake spec

If some error occur update database: rake sequel:db:migrate

To add user:
bin/merb -i
User.create(:email => "aaa.aaa.pl", :password => "pass", password_confirmation => "pass")


To manage branches is also not my pair of shoes. As my excuse - this is my first experience with git.

Adobe Flash Builder

Unfortunale I've missed the event, nevertheless it's nice to get an email with these instructions:
https://freeriatools.adobe.com/flexevent?coupon=9u9bpdcUcp0L
'Program' 'Flash Builder 4 for event attendees'
9u9bpdcUcp0L

Thanks for Applying for a Free Copy of Adobe Flash Builder 4

Flex in a week (sounds like a challenge)

Tuesday, May 4, 2010

facebook application developer

This link is very useful: Apps on Facebook.com

This is my app (based on this tutorial) and here is the list - list of your own applications.

Actually it's easier than you think!

One day I might use google app engine and then this plugin might be useful. I created a brief presentation about it:


And here is the link to the sample aplication (reload if any error occurs).

Monday, May 3, 2010

working on master thesis

Later Today I'm gonna post my first draft to scribd:
Docelowo będzie ona opublikowana w języku angielskim a obecny dokument ma wyłącznie charakter roboczy.

Ultimately, it will be published in English and the current document is only for draft purpouses.

In worst case I'll use google translate.


Michał-Stefanów-Praca-Magisterska-2010-05-03

In the meantime I'll add some new link to this list (mashable):
- Twitter Research Tools
- Extraordinary Twitter Updates
- Twitter Badges
- Twitter Visualizations
- interia.pl

press acreditation

There are several rules | link:
1) Przy odbiorze akredytacji należy okazać oryginał legitymacji prasowej.
2) Brak podpisów, pieczęci lub ważnej legitymacji skutkuje odrzuceniem wniosku lub odmową wydania akredytacji.
3) Akredytacje będą wydawane TYLKO dziennikarzom w rozumieniu art. 7 ust. 2 pkt 1) ustawy z dnia 26 stycznia 1984 roku Prawo prasowe.
4) Wnioski przedstawicieli klubów, zespołów, sponsorów, agencji reklamowych i promocyjnych będą odrzucane.
5) Termin nadsyłania wniosków mija 1 maja 2010r.

Of course I don't meet any requirement, that is why I'm gonna send an inquiry. Honestly: no chance.

some more Facebook stuff

I've created a page for a president:


Understandably it was recategorized:


I've created another account and to my surprise my real account was the first suggestion:

(IP matching don't think so)

Created account becouse another one was blocked:


Honestly this is the weirdest group I've ever seen:

reklama na Facebooku: working on better offer, working on website, working on campaign for rozwój osobisty, working on master thesis that is actually my priority.

Sunday, May 2, 2010

Saturday, May 1, 2010