Vincent Janelle

Search


Calendar

« November 2008
SunMonTueWedThuFriSat
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
      
Today


Tag Cloud

bootstrap.groovy call_user_func dl180 drupal fail gentoo hook_validate hp php stdclass sucks

Letter to CDW's return department

October 20, 2008 by Vincent Janelle

CDW,

We recently placed an order online with your system, and your sales rep D*** P*** contacted us to confirm the purchase.  We were not informed at the time that the drives we had ordered were not compatible with the HP DL 180 system we had ordered (the machine itself does not come with empty drive trays, just blank plates) and after the last week of discussion with D*** and HP, we are apparently not able to purchase the trays themselves.

I contacted D*** to get refund information, but he has informed me that because we opened the machine the server came in to examine it, we would be unable to return it.  This is confusing since there is no software involved, and we were sold a product which isn't functional to our requirements without spending an additional $1200-$1700 of HP branded 1TB SATA-300 hard drives.  He has attempted to source third party drive rails for us but has not been successful.

Preferably I would want to return the server as it essentially non-functional to us for refund instead of relying on a third party to source something that should've come with the server, since I am now in doubt from HP's claims that we'd be able to purchase compatible drive + trays from them in the future.

If I'm unable to get this refund I will also bring this issue up with HP on their contact forms, and will likely never purchase from CDW again(now that I'm better informed about HP's practices, I will avoid these situations in the future where we cannot service parts ourselves).

Thanks,
Vincent Janelle
 

 

HP apparently doesn't want money

October 20, 2008 by Vincent Janelle

Ordered an HP DL180(on paper seems like a decent server considering price and features).

Get server on Monday.  Confused that CDW didn't ship us the disks we ordered (apparently they were shipped from Toronto,  and they arrived Friday).  Notice that the drive bays are just blanking plates to aid with cooling.  Call up CDW, ask if they can include drive trays with the servers.  A week of phone calls and emails with HP ensue.  HP eventually today told us that there was in no way possible that they were going to sell us the drive trays.  This is a classic example of bad customer service, both on the part of CDW and HP.  HP for not selling us the damn part, and CDW for not checking over the requested parts after talking to us about what we were looking for (we filled out the items from their web interface, but it had to go through some sales droid for approval).

Seagate WS ("Enterprise") drives cost $180~240.  The branded HP 1TB drives + chassis are over $860.

 

drupal node validation unique title with locks

August 19, 2008 by Vincent Janelle

/**
* Implementation of hook_validate().
*/

function hook_validate($node, &$form) {
$lock = "SELECT GET_LOCK('hook_validate_lock', 60)";

$result = 0;
$count = 0;

while ( $result != 1) {
$result = db_query($lock);
$result = db_result($result);
}

// Search for groups of the same title
$test = node_load(array("title" => $node->title));

if ($test) {
// We have a winner.
form_set_error("title", t("Duplicate node title"));
}

$unlock = "SELECT RELEASE_LOCK('hook_validate_lock')";
db_query($unlock);
}
[Read More]

 

Call_user_func microbench

August 08, 2008 by Vincent Janelle

Wrote this little microbench to test php class based implementations as a method of writing modular code.   No idea if it’s actually a valid test or not.

Results:

float(0.29755711555481)
float(0.87803196907043)

[Read More]

 

Merging objects in php

July 30, 2008 by Vincent Janelle

Merging classes in php without using built-ins[Read More]

 

Using services from bootstrap.groovy in grails

June 04, 2008 by Vincent Janelle

I’m currently writing an application for some upcoming strutta.com functionality using grails.  During development though, I have it setup to recreate my data everytime I restart the server, and then I repopulate from a seperate source.

I do have a controller setup to manually import specific ids from the head end server, but its useful if I didn’t have to do this everything I hit ctrl-c in the wrong window.  Using a services orientated design, you seperate out logic from controllers (and is recommended by the grails guys), but if you need to call this from the bootup, you could follow the instructions on http://grails.org/Services (which doesn’t work…) or you could do:

import org.codehaus.groovy.grails.web.servlet.GrailsApplicationAttributes

class BootStrap {

def init = { servletContext ->
def ctx = servletContext.getAttribute(
GrailsApplicationAttributes.APPLICATION_CONTEXT);
def ss = ctx.getBean("feedService");
ss.loadFromFeed();
}
def destroy = {
}
}