Best of Aberystwyth

A few (actually 189) pictures I made in Aberystwyth.


Page views/odsłony: 35

Posted in English | | Leave a comment

Solution to SQLException: No suitable driver found for jdbc:mysql

Just a quick fix.

Instead of:

Connection con = null;
 
String url = "jdbc:mysql://localhost:3306/mysql";
String user = "user";
String password = "password";
con = DriverManager.getConnection(url, user, password);

You should have:

Connection con = null;
 
String url = "jdbc:mysql://localhost:3306/mysql";
String user = "user";
String password = "password";
 
try {
    Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (Exception ex) {
    System.err.println(ex.getMessage());
}
con = DriverManager.getConnection(url, user, password);

Continue reading
Page views/odsłony: 17

Posted in English, Java, Programming | Leave a comment

ERROR: clGetPlatformIDs() -1001

Many people have problem like this one above, even if they configured and installed ATI SDK + OpenCL + ATI Catalyst correctly, without any errors or warnings. But they still cannot run any application which uses their GPU. So here I’ll show you how to fix it and we will try to run oclHashcat to check if the driver is OK after the fix.

At the beginning after installation, I had this error:

$ ./oclHashcat-lite64.bin 9fe8bcafcd86d85172097bd41abc29c0 ?d?d?d?d?d?d?d?d
oclHashcat-lite v0.4 starting...
ERROR: clGetPlatformIDs() -1001

Continue reading
Page views/odsłony: 43

Posted in English, Linux | 1 Comment

Problem with camera’s up-side-down view on Linux

This problem is known for everyone who has ASUS or Acer notebook and uses its webcam.

Provided default library to use camera gives us up-side-down view.

I wrote a post how to permanently fix this bug on Skype, but the fix doesn’t work for all applications. You can still meet this bug in Firefox, Chromium and any other application which can use your web-cam.

Continue reading
Page views/odsłony: 41

Posted in English, Linux | Leave a comment

[Prolog] Logical Voting Assistant

I had to write a voting assistant in Prolog as a part of my module – AI.  I really enjoyed programming in Prolog and you can see my code in its repository.

The code is fully documented and it shouldn’t be hard to follow. It was my first application in Prolog, so don’t be mad at me when you see some crap there…

Continue reading
Page views/odsłony: 44

Posted in English, Programming | | 1 Comment

[Prolog] proste przykłady

Niewiele w Internecie prostych, krótkich i działających za pierwszym razem snippetów z Prologa, zatem podaje kilka swoich, które napisane i używane zostały podczas wykładów na AU.

% poniży kod doda liczby, niezależnie od tego w jakiej kolejności zostały podane
add(A,B,R):- A = R - B.
add(A,B,R):- R = A + B.
add(A,B,R):- B = R - A.
 
% silnia z 0 to z definicji 1 
factorial(0, 1).
 
% rekurencyjnie oblicza silnię z podanej liczby X
% zmniejsza wartość X co każde wywołanie.
% liczy silnię, aż wywoła definicję powyżej
 
factorial(X, RESULT) :- R1 is X-1,
                       factorial(R1, R2),
                       RESULT is R2 * X.
 
male(mark). % fact
male(jonah). % fact
female(marie).
female(sophie).
female(marcie).
parent_of(jonah, mark).
parent_of(marcie, mark).
parent_of(sophie, mark).
parent_of(jonah, marie).
parent_of(marcie, marie).
parent_of(sophie, marie).
mother_of(X,Y) :- parent_of(X,Y), female(Y). % rule
father_of(X,Y) :- parent_of(X,Y), male(Y).

Continue reading
Page views/odsłony: 84

Posted in Polskie, Programowanie | | Leave a comment

WordPress – remove tags from posts

Today I want to show you how to remove tags from posts in WordPress, and this is not a way of changing visibility in CSS of your theme, but turning them of from view at all.

Login as administrator to your blog, go to Appearance -> Editor -> loop.php (you will find this entry on your right)

Continue reading
Page views/odsłony: 80

Posted in English, web | | Leave a comment

Pachnący kod

A dokładniej to śmierdzący kod.

Określenie śmierdzący kod nie jest obraźliwe, jest jedynie wskazówką (sugestią), że coś w kodzie jest źle.

Szybko zauważysz kiedy kod zacznie śmierdzieć, możesz to zignorować (smród nie zniknie, a natęży się), poprawić jakość kodu, lub unikać źródła zapachu w przyszłości.

Continue reading
Page views/odsłony: 87

Posted in Inżynieria oprogramowania, Polskie | | Leave a comment