К основному контенту

Сообщения

Сообщения за декабрь, 2013

Программное отключение ctrl+alt+del, at+tab и тому подобного

I wrote an article back in 2007 that is still around the web, in various discussions including  StackOverflow  and  DotNetSpider , so I have decided to re-publish the article. This article was relevant back then - and it wasn't tested on a Windows 7 environment purely due to the fact that it did not exist and please also note that comments are disabled for this post. Before continue reading please note that this article doesn’t intend to call upon you to create nasty applications. If you use this code it should be for your own fun or for learning purposes. After doing some research on disabling keys or key combinations I found out that there are several ways of achieving the before mentioned key combos. CTRL-ALT-DEL combo is part of the SAS ( Secure Attention Sequence) thus the solution to disable this is to write your own gina.dll ( Graphical Identification and Authentication ). Don’t worry, I’m not looking into that as for now, I’m going to show you the work arou...

Сравнение дат в MySQL

Поскольку пишу сейчас программу для библиотеки, пришлось создать такой вот запрос: select (select date_format((current_date),'%m'))-(select date_format((select birthday from users where id = 1),'%m'))+(select date_format((current_date),'%d'))-(select date_format((select birthday from users where id = 1),'%d')); Он нужен для того, чтобы понять, День Рождения сегодня у человека, или нет. С тем же успехом можно использовать его и в других случаях. Думаю, что для человека знающего MySQL пояснения не нужны. Но если что, то пишите. Ну, и если я не прав, используя такой запрос, то предложите лучший.

Базостроение

Как говорится, я просто оставлю это здесь. CREATE TABLE ALLITEMS ( itemid INT ( 10 ) UNSIGNED , itemname VARCHAR ( 50 ) ); ALTER TABLE ALLITEMS CHANGE itemid itemid INT ( 10 ) AUTO_INCREMENT PRIMARY KEY ; DESC ALLITEMS ; INSERT INTO ALLITEMS ( itemname ) VALUES ( 'Apple' ), ( 'Orange' ), ( 'Banana' ); SELECT * FROM ALLITEMS ; I was confused with CHANGE and MODIFY keywords before too : ALTER TABLE ALLITEMS CHANGE itemid itemid INT ( 10 ) AUTO_INCREMENT PRIMARY KEY ; ALTER TABLE ALLITEMS MODIFY itemid INT ( 5 ); While we are there, also note that AUTO_INCREMENT can also start with a predefined number : ALTER TABLE tbl AUTO_INCREMENT = 100; Взято с  http://stackoverflow.com/questions/6957370/alter-table-adding-autoincrement-in-mysql