Archyvas

‘Programavimas’ Kategorijos archyvas

Internet Explorer does not load stylesheet files

Rugpjūtis 25th, 2010 Ernestas Kardzys 4 komentarai

I was creating a website with Drupal CMF and experiencedy a problem: the website is displayed perfectly in Opera, Google Chrome, Mozilla Firefox BUT NOT IN Internet Explorer (both versions 7 and 8) . It looked like that Internet Explorer did not load my custom style.css file.

After some googling I found out that Internet Explorer CAN NOT LOAD MORE THEN 31 CSS FILES FOR SINGLE WEBPAGE. Funny thing, huh? And I had 37 for a webpage. Well, it looks like that the solution is quite simple: to reduce the number of CSS files by copying content of one CSS file to another.

MySQL C++ Connector & my MySQL server

Rugpjūtis 19th, 2010 Ernestas Kardzys Nėra komentarų

Today I’ve tried to install MySQL C++ Connector for Windows (http://www.mysql.com/downloads/connector/cpp/ also check this website: http://forge.mysql.com/wiki/Connector_C%2B%2B and this one: http://dev.mysql.com/tech-resources/articles/mysql-connector-cpp.html).

Ok, but lets get back to my experience with MySQL C++ Connector. The problem is that I couldn’t make it work on Windows. I’ve copied mysqlcppconn.lib & mysqlcppconn.dll to my project’s directory. Those files were included into my project. I’ve successfully compiled the project.

But when I tried to run the program I got an exception – my program can not connect to MySQL web server. And I don’t know why :/

So, I used MySQL C API functions in my C++ application. It worked ;)

Kategorijos:Programavimas, SQL, Studijos KTU Raktažodžiai:,

Drupal. RSS feeds

The RSS feeds for your Drupal website can be located at: http://<the_url_of_your_website/rss.xml :)

Kategorijos:Programavimas Raktažodžiai:,

ELGG. How to get group by its group name?

ELGG has method get_user_by_username(), which returns the object ElggUser. Unfortunately, there is no method called get_group_by_groupname(). So, I made one :)

/**
* Returns a group specified by its name
* @param string $groupname The name of the group
* @return mixed ElggGroup – if ElggGroup exists, false – otherwise
*/
function get_group_by_groupname($groupname) {
global $CONFIG;

$groupname = sanitise_string($groupname);
$access = get_access_sql_suffix(‘e’);

$row = get_data_row(“SELECT e.* from {$CONFIG->dbprefix}groups_entity g join {$CONFIG->dbprefix}entities e on e.guid=g.guid where g.name=’$groupname’ and $access “);
if ($row) {
return new ElggGroup($row);
}

return false;
}

Good luck ;)

Kategorijos:Programavimas Raktažodžiai:,

ELGG. Howto disable email verification

Last Friday I was working with the ELGG framework. I registered a user. Then the confirmation email was sent to the user, saying “press on the link below to confirm your email account”. Unfortunately I didn’t want to have that email. So, the question is: How to disable the email validation?

The answer is very simple, just three lines of code:

$user = get_user_by_username($username_as_string);
$user->enable();
set_user_validation_status($user->getGUID(), true);

After those three lines of code – the user is automatically validated :)

Keep in mind: it’s not secure to do like that :) So, if you know what you’re doing – do it ;)

Kategorijos:Programavimas Raktažodžiai:,

Symbian SDK and Windows Vista

Birželis 30th, 2010 Ernestas Kardzys 5 komentarai

Last two or three days I’ve tried to install Symbian SDK && Carbide.c++ (get those from: http://www.symbian.org/) into my laptop with Windows Vista. So, here are some impressions about that:

  1. Leave the default paths. So, install Perl to: C:\Perl, Carbide.c++ to C:\Symbian, and SDK to C:\S60. Because otherwise you might expierence a lot of problems.
  2. Work as administrator while developing the software. Because Carbide.c++ likes that. :)
  3. DO NOT use Windows Vista, USE Windows XP instead. There is a patch for Windows Vista available, but I could not make my system work with the patch. Windows XP works better. I’ve tried to reinstall Symbian SDK twise in Windows Vista. Both times it failed to work.

Reikia idėjos

Birželis 8th, 2010 Ernestas Kardzys 2 komentarai

Sveiki ;)

Gal turite idėją, ką galima suprogramuoti mobiliesiems telefonams? Ieškau temos magistro darbui :)

Cool Video Streeming Quality

Birželis 4th, 2010 Ernestas Kardzys Nėra komentarų

Check cool quality of video conference: http://distance.ktu.lt/terena/

:)

Kategorijos:Programavimas Raktažodžiai:

How to get node information in block?

Gegužė 16th, 2010 Ernestas Kardzys Nėra komentarų

I am coding a system for my bachelor theses. And I had & solved a small problem.

The problem. I have to types of content types – Record and Group of Records. If I navigate to Group of Records there should be a block with a link saying “Create a record”. The problem is that I need to pass some additional argument to the form Record (the node ID of Group of Records). So, my link looks like that: node/add/record?groupid=1001. The question: how to get the node ID of Group of Records?

The solution: small if() :)

if ( arg(0) == ‘node’ && is_numeric(arg(1)) ) {
$node = node_load(arg(1));
// Your code here…
}

Kategorijos:Drupal, Programavimas, Studijos KTU Raktažodžiai:, ,

Nedidelis “InvReport” projektėlis Informacinių sistemų paskaitai

Gegužė 6th, 2010 Ernestas Kardzys Nėra komentarų

Mano Informacinių sistemų projektas. Nebaigtas, negalutinis, turintis klaidų. Kai kurios dalys programuotos greitai :)

www.ernestas.info/ktu/is/InvReport.zip

Gal kam pravers ;)