Skip to content

Instantly share code, notes, and snippets.

View cray0000's full-sized avatar
🚀

Pavel Zhukov cray0000

🚀
View GitHub Profile
@cray0000
cray0000 / sample1.sql
Created October 1, 2012 23:47
L1. Выбор конкретного пользователя с ID равным 5.
SELECT * FROM users WHERE id=5;
@cray0000
cray0000 / l2.sql
Created October 2, 2012 05:08
L2. Выбор имени и фамилии всех работников с именем "Вася".
SELECT name, surname FROM employees WHERE name='Вася';
@cray0000
cray0000 / l4.sql
Created October 2, 2012 05:20
L4. Выбрать всех школьников, старше 16 лет, проживающих на улице Гоголя
SELECT * FROM students WHERE age>16 AND address LIKE '%Гоголя%';
@cray0000
cray0000 / l3.sql
Created October 2, 2012 05:29
L3. Выбрать студентов старше 18-ти лет, либо 2-го курса и выше.
SELECT * FROM students WHERE age>18 OR year>=2;
@cray0000
cray0000 / l5.sql
Created October 2, 2012 07:31
L5. Сортировка по убыванию
SELECT * FROM Persons
ORDER BY LastName DESC
@cray0000
cray0000 / l6.sql
Created October 2, 2012 07:40
L6. Вставка новых строк в таблицу.
INSERT INTO users (name, age)
VALUES ('Вася', 20), ('Петя', 30);
@cray0000
cray0000 / l7.sql
Created October 2, 2012 07:45
L7. Изменение необходимых строк.
UPDATE Persons
SET Address='Nissestien 67', City='Sandnes'
WHERE LastName='Tjessem' AND FirstName='Jakob'
@cray0000
cray0000 / l8.sql
Created October 2, 2012 07:48
L8. Удаление выбранных строк.
DELETE FROM Persons
WHERE LastName='Tjessem' AND FirstName='Jakob'
[20:54] <cray0000> Hi, guys! Could you help me with a noob question please? I've added derby-auth to default console project and now I'm getting error "Unauthorized: No access control declared for path rooms.home"
[20:56] == smtudor [~smtudor@static-71-185-69-210.phlapa.fios.verizon.net] has quit [Quit: Leaving...]
[20:57] <cray0000> I've read AccessControl readme at /lib/AccessControl, but it says that security is off by default
[20:59] <switz213> yeah I can help you
[20:59] <cray0000> thanks a lot
[20:59] <switz213> so you've enabled security
[20:59] <cray0000> I've tried both ways
[20:59] <switz213> but you haven't added an access control for rooms.*
[20:59] <cray0000> yea, think that is the problem
[21:00] <cray0000> could you give me a hint please?
@cray0000
cray0000 / gist:5668031
Created May 29, 2013 04:51
hasParam JS
var toParam,
__hasProp = {}.hasOwnProperty;
toParam = function(object) {
var key, params, val;
params = [];
for (key in object) {
if (!__hasProp.call(object, key)) continue;
val = object[key];