Archyvas

‘Studijos KTU’ 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:,

Aš jau Informatikos bakalauras

Birželis 24th, 2010 Ernestas Kardzys 12 komentarai

Na va – baigėsi 4-i metai studijų KTU Informatikos fakultete :) Studijas baigiau 15-as kurse (vidurkis: 8,91) iš 216 studentų :) Smagu.

Ačiū už sveikinimus ir gėles savo šeimai, Justei, Donatai ir Karolinai :) Ačiū labai :*

Studijos nebuvo lengvos, Informatikos fakultete “durniaus nepavoliosi”. Kita vertus – grupė buvo gera ir draugiška, tad buvo smagu studijuoti.

Dabar lauksiu liepos 2-os dienos: tą dieną sužinosiu, ar įstojau į Programų sistemų inžinerijos magistrantūrą ;]

P.S. O visų smagiausia tai, kad dabar visokiausių anketų grafoje “Išsilavinimas” galėsiu drąsiai rašyti: “aukštasis” :D He he ;D

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 :)

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 ;)

Drupal. check_url() & MMS protocol

Balandis 24th, 2010 Ernestas Kardzys Nėra komentarų

I was coding a small dialog for my bachelor theses. There is a text box where you can enter an URL address. So, before submitting the form I validate that text box with check_url() function.

The problem is, that my address starts with MMS. It’s something like that: mms://www.server.lt/directory/file. So, after check_url() function the result is: //www.server.lt/directory/file. I was googling for the solution and I’ve finally found it.

The problem is in file modules/filter/filter.module file, line 1182. “MMS” is not in the list of allowed protocols. So, there are two posable  solutions:

  1. Edit that line and add “mms”. Well, this is not recommended, because by doing that you’re hacking the Drupal core. So, forget this.
  2. The other solution is to download the module “Filter protocols” (http://drupal.org/project/filter_protocols) and add “mms” (or any other) protocol. This can be done by selecting Site configuration->By module->Input formats. The tab “Allowed protocols”.

Good luck!

Howto. Execute MS SQL Stored Procedure With C#

Balandis 5th, 2010 Ernestas Kardzys 2 komentarai

At the moment I’m coding a small project for my university. I have to create a simple system on C# and Microsoft SQL Server 2005. So, I need a way (and code) to execute MS SQL Server’s Stored Procedures from my C# program. How to do that?

Suppose we have a Stored procedure:

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
– =============================================
– Author: Ernestas Kardzys
– Create date: 2010.03.16
– Description: Inserts new client into Client table
– =============================================
ALTER PROCEDURE [dbo].[client_insert]
@Name nvarchar(50) = null,
@Address nvarchar(50) = null,
@PhoneNumber nvarchar(50) = null,
@SecurityAccountID int = 0
AS
BEGIN
– SET NOCOUNT ON added to prevent extra result sets from
– interfering with SELECT statements.
SET NOCOUNT ON;

— Insert statements for procedure here
INSERT INTO Client (Name, Address, PhoneNumber, SecurityAccountID) VALUES (@Name, @Address, @PhoneNumber, @SecurityAccountID);
END

Then we need a C# method:

private static SqlConnection sqlConnection = new SqlConnection(“user id=sa;” +
“password=sa;server=ERNESTAS-PC\\SQLEXPRESS;” +
“Trusted_Connection=yes;” +
“database=Investments; ” +
“connection timeout=30″);
public void Connect()
{
sqlConnection.Open();
}
///
/// Description: Executes a Stored procedure
///
/// First parameter: The name of Stored procedure
/// The second parameter: The parameters pf Stored Procedure
/// Throws: SQLException
/// Returns: DataTable with results
public static DataTable ExecuteProcedure(string query, List<KeyValuePair> parameters)
{
SqlDataAdapter dataAdapter = new SqlDataAdapter();
DataTable dataTable = new DataTable();
SqlCommand sqlCommand = new SqlCommand(query, sqlConnection);
sqlCommand.CommandType = CommandType.StoredProcedure;
dataAdapter.SelectCommand = sqlCommand;

if (parameters != null)
{
foreach (KeyValuePair cmd in parameters)
{
sqlCommand.Parameters.Add(new SqlParameter(cmd.Key, cmd.Value));
}
}

dataAdapter.Fill(dataTable);

return dataTable;
}

And use it:

List<KeyValuePair> dbRecord = new List<KeyValuePair>();
dbRecord.Add(new KeyValuePair(“@SecurityAccountID”, comboBoxSecurityAccount.SelectedIndex.ToString()));
dbRecord.Add(new KeyValuePair(“@Address”, textBoxAddress.Text.Trim()));
dbRecord.Add(new KeyValuePair(“@Name”, textBoxName.Text.Trim()));
dbRecord.Add(new KeyValuePair(“@PhoneNumber”, textBoxPhoneNumber.Text.Trim()));

SQLClient.ExecuteProcedure(“client_insert”, dbRecord);

Good luck!

Drupal – White Page of Death

I was programming with Drupal and got a very ugly mistake – totally blank (white) screen. After some Googling I found that this can be fixed by increasing PHP memory size. Nope, it didn’t helped.

Then I tried some other tricks, like making a redirection to other page. But no.

The solution was very simple: I had to change text encoding to “UTF-8 without BOM” (I used Notepad++ for that). It worked – no white screen ;)

P.S. It took about 5 hours to understand that :)

Šiemetiniai stojimai į bakalauro studijas

Skaičiau Delfi.lt straipsnį apie būsimus stojimus į bakalauro studijas. Ten yra įdomi švietimo viceministrės frazė:

Mes matome, kad darbo rinkoje nėra tokio poreikio socialinių mokslų specialistų. Mes taip pat tikimės, kad lėšos, kurias skiriame technologinių mokslų reklamai, propagavimui taip pat duos rezultatų ir daugiau gabių, motyvuotų abiturientų stos į technologinius mokslus

Švietimo ir mokslo ministerijos viceministrė Nerija Putinaitė

Dėl pirmo sakinio nelabai turiu ką pasakyti. O štai dėl antro – turiu :)

Praeitais ar užpraeitais metais skaičiau straipsnį, kuriame paminėtas ES atliktas tyrimas. Bėda tame, kad visoje ES studentai nenori stoti į techninius ir fizinius mokslus. Klausimas: kodėl? Atsakymas: sunku mokintis :)

O dabar grįžtam prie lietuviškų realijų. Tarkim, pasirenkam KTU universitetą ir pasižiūrim šio universiteto studijų kainas (jeigu pats moki už studijas). Šį universitetą pasirinkau todėl, kad pats jame studijuoju. :)

Straipsnis senokas, bet mano mintį iliustruos: http://www.technologijos.lt/n/svietimas/kurstoti/mokymo_istaigos_lt/straipsnis?name=straipsnis-7642

Tarkim, pasirenkam vadybos arba verslo administravimo studijas. Kaina – 4030 LTL. O dabar pasirenkam fizinius mokslus – kaina 7920 LTL. Taigi – 1,96 karto brangesnė :)

Be abejo, yra ir brangesnių studijų – pavyzdžiui, medicinos. Kauno medicinos universitetas turbūt geriausias Lietuvoje, tad pasižiūrėkime, kiek jame kainavo studijų metai (http://naujas.kmu.lt/doc/priemimas/KMU%20%20priemimo%202009m%20taisykles.doc). 10373 LTL. 2,57 karto daugiau.

Ką aš norėjau pasakyti šiuo skaičių rinkiniu? Jeigu norima, kad žmonės stotų į techninius mokslus – galbūt reikėtų sumažinti studijų kainą? Kaip manot? Nes kai socialinių ir techninių studijų kaina skiriasi dvigubai, tai nenuostabu, kad studentai renkasi pigesnes studijas. Ir jokia čia reklama nepadės. Būsimi studentai patys pasiskaičiuos.

Ir apie reklamą. Sakote, pareklamuoti pigiau? Na, aišku :D Tik vistiek: ar metinės studijų kainos sumažinimą, ar raginimą-reklamą stoti į techninius mokslus apmokate mes visi, Gerbiami Mokesčių Mokėtojai :)

P.S. Įdomumo dėlei pasižiūrėkite kainas stojant į skirtingų sričių magistrantūros studijas.

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