This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Class; | |
use Moose; | |
has "foo" => ( | |
isa => 'Str' | |
, is => 'ro' | |
, predicate => '_has_foo' | |
); | |
has "bar" => ( | |
is => 'ro' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16:18 -!- Irssi: #catalyst: Total of 271 nicks [39 ops, 0 halfops, 4 voices, 228 normal] | |
16:18 -!- Channel #catalyst created Thu Mar 10 12:31:50 2005 | |
16:18 -!- Irssi: Join to #catalyst was synced in 1 secs | |
16:19 < EvanCarroll> I ported the test suite for Catalyst::Plugin::Params::Nested to use Catalyst::Test from | |
Test::MockObject (which is removed from Catalyst proper, and doesn't currently build properly) | |
16:19 < EvanCarroll> However, I'm having one problem wit Catalyst::Test remaining: [error] No default action defined | |
16:19 < EvanCarroll> anyone know how to kill that silly warning | |
16:19 < EvanCarroll> I've ensured the namespace in my root controller is '' | |
16:20 < EvanCarroll> still no joy. | |
16:23 <@dhoss> anyone seen this? Use of uninitialized value $storedpassword in string eq at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyClass; | |
use Moose; | |
use MyTypes qw( MyDate ); | |
use namespace::clean -except => 'meta'; | |
has bday => (isa => MyDate, is => 'ro', coerce => 1); | |
__PACKAGE__->meta->make_immutable; | |
1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature ':5.10'; | |
my $copy = do { | |
use Regexp::Grammars; | |
qr{ | |
<ACTION=(\\COPY)> <from> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10:46 -!- Irssi: Join to #postgresql was synced in 1 secs | |
10:46 < EvanCarroll> if you do UPDATE foo SET bar = bar+1, on a table with a trillion rows, will you be able to insert into that table before that update txn completes? | |
10:46 < RhodiumToad> yes | |
10:46 < orion> RhodiumToad: I guess it might make sense to create a rule to prevent updates to the table... to force the application to delete and insert a new event using the inserter function. | |
10:46 < EvanCarroll> does an update on a large table, lock the table? or all rows in it? | |
10:46 < RhodiumToad> orion: trigger, not rule | |
10:47 < RhodiumToad> EvanCarroll: each updated row individually | |
10:47 < EvanCarroll> and if so, is there an overhead on locking all of the rows in a very large table -- and can you get around that overhead by locking the /whole/ table | |
10:47 < RhodiumToad> EvanCarroll: and no, there's no overhead, because the simple fact that the old row version now has xmax set is what makes it "locked" | |
10:47 < johto> as long as there are no BEFORE trigge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dealermade=# EXPLAIN ANALYZE select * from inventory.vehicles where vin = coalesce ( '1FTYR10C6YPB35818', vin ); | |
QUERY PLAN | |
------------------------------------------------------------------------------------------------------------------------------------- | |
Bitmap Heap Scan on vehicles (cost=4.29..12.18 rows=2 width=834) (actual time=0.035..0.037 rows=1 loops=1) | |
Recheck Cond: ((vin)::text = '1FTYR10C6YPB35818'::text) | |
-> Bitmap Index Scan on vehicles__vin_textpatternops (cost=0.00..4.29 rows=2 width=0) (actual time=0.024..0.024 rows=1 loops=1) | |
Index Cond: ((vin)::text = '1FTYR10C6YPB35818'::text) | |
Total runtime: 0.155 ms | |
(5 rows) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If three runners join a race and the first two runners tie, is the third runner to cross the finish line in second place or in third? This is the difference between `rank()`, and `dense_rank()`. Both of these functions agree that the first and second runners are in a tie for first place, but `rank()` will assign the third runner to the third place. In this configuration you would say two runners tied for first place and the third runner came in third place. Conversely, dense_rank() will say the first two runners tied for first place, and the third runner came in second place. In SQL parlance, the `dense_rank()` has no *gaps* you can not skip a second place because two of the runners preceding it were tied. In comparison, `rank()` will have gaps anytime two consecutive rows preceding it tied by the **ORDER BY** clause. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE inventory.vehicles AS v | |
SET date_sold = 'NOW' | |
WHERE v.date_sold IS NULL | |
AND EXISTS ( | |
SELECT * FROM temp_vehicles AS t | |
WHERE v.lot_id = t.lot_id | |
) | |
AND NOT EXISTS ( | |
SELECT * FROM temp_vehicles AS t | |
WHERE v.lot_id = t.lot_id AND v.vin = t.vin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM "contacts" | |
WHERE ( | |
id IN ( | |
SELECT contact_id FROM customer_contacts | |
WHERE customer_id IN ( | |
SELECT id FROM customers c WHERE is_potential = false | |
) | |
) | |
AND f_contact_acl(184, id) |