Skip to content

Instantly share code, notes, and snippets.

@navarr
Created January 2, 2012 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save navarr/1549079 to your computer and use it in GitHub Desktop.
Save navarr/1549079 to your computer and use it in GitHub Desktop.
HiGear Logs
Delivered-To: navarr@gtaero.net
Received: by 10.229.23.144 with SMTP id r16cs100259qcb;
Mon, 1 Aug 2011 11:32:41 -0700 (PDT)
Received: by 10.68.27.105 with SMTP id s9mr340411pbg.112.1312223561177;
Mon, 01 Aug 2011 11:32:41 -0700 (PDT)
Return-Path: <julia@higear.com>
Received: from homiemail-mx8.g.dreamhost.com (caiajhbdccac.dreamhost.com [208.97.132.202])
by mx.google.com with ESMTP id i16si3212155wfd.140.2011.08.01.11.32.39;
Mon, 01 Aug 2011 11:32:39 -0700 (PDT)
Received-SPF: neutral (google.com: 208.97.132.202 is neither permitted nor denied by best guess record for domain of julia@higear.com) client-ip=208.97.132.202;
Authentication-Results: mx.google.com; spf=neutral (google.com: 208.97.132.202 is neither permitted nor denied by best guess record for domain of julia@higear.com) smtp.mail=julia@higear.com
Received: from mail-ey0-f177.google.com (mail-ey0-f177.google.com [209.85.215.177])
(using TLSv1 with cipher RC4-SHA (128/128 bits))
(No client certificate requested)
by homiemail-mx8.g.dreamhost.com (Postfix) with ESMTPS id 3595D72C2F5
for <me@navarr.me>; Mon, 1 Aug 2011 11:32:39 -0700 (PDT)
Received: by eyh6 with SMTP id 6so5054293eyh.8
for <me@navarr.me>; Mon, 01 Aug 2011 11:32:37 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.213.16.144 with SMTP id o16mr845044eba.102.1312223556561; Mon,
01 Aug 2011 11:32:36 -0700 (PDT)
Received: by 10.213.4.143 with HTTP; Mon, 1 Aug 2011 11:32:36 -0700 (PDT)
Date: Mon, 1 Aug 2011 11:32:36 -0700
Message-ID: <CAN2KB0SQQRwcCWRGJVtQUxS+EsxVU83Nu8w6NfLZ8Rs+LXnQvg@mail.gmail.com>
Subject: HiGear
From: Julia Dadiomov <julia@higear.com>
To: me@navarr.me
Content-Type: multipart/alternative; boundary=0015174bf1c0f46cf304a975da1c
--0015174bf1c0f46cf304a975da1c
Content-Type: text/plain; charset=ISO-8859-1
Hello Navarr,
I spoke to you earlier regarding an interview with HIGear. Can we
push that Interview to 5pm PST? Let me know if that works for you.
--
*Julia Dadiomov **|** **Membership Director
*
*HIGEAR, Inc.* | 425 2nd St. Suite 250 | San Francisco, CA 94107 |
*P:* 925.360.4406
*www.Higear.com<http://www.higear.com/?utm_source=MISC&utm_medium=MISC&utm_campaign=Julia>
*
Facebook: <http://www.facebook.com/nomii>facebook.com/julia.dadiomov<https://www.facebook.com/julia.dadiomov>
.
*Skype name: Julia Dadiomov
*
--0015174bf1c0f46cf304a975da1c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hello Navarr, <br>=A0=A0=A0=A0=A0=A0=A0=A0=A0 I spoke to you earlier regard=
ing an interview with HIGear. Can we push that Interview to 5pm PST? Let me=
know if that works for you.<br clear=3D"all"><br>-- <br><div><br></div><di=
v style=3D"margin: 0px; color: rgb(71, 71, 71); font-family: Arial; font-si=
ze: 11px; font-weight: bold;">
<b>Julia Dadiomov </b><span style=3D"color: rgb(144, 145, 145);"><b>|</b></=
span><span style=3D"color: rgb(23, 55, 109);"><b> </b></span><b>Membership =
Director <br></b></div><div style=3D"margin: 0px; color: rgb(144, 145, 145)=
; font-family: Arial; font-size: 11px; font-weight: bold;">
<b>HIGEAR, Inc.</b>=A0=A0|=A0=A0425 2nd St. Suite 250 =A0|=A0 San Francisco=
, CA 94107 =A0|</div><div style=3D"margin: 0px; color: rgb(144, 145, 145); =
font-family: Arial; font-size: 11px; font-weight: bold;"><span style=3D"col=
or: rgb(0, 0, 0);"><b>P:</b></span> 925.360.4406<span style=3D"color: rgb(2=
3, 55, 109);">=A0</span> <br>
</div><div style=3D"margin: 0px; color: rgb(71, 71, 71); font-family: Arial=
; font-size: 11px; font-weight: bold;"><font color=3D"#ca2344"><b><span sty=
le=3D"color: rgb(71, 71, 71); font-weight: normal;"><a href=3D"http://www.h=
igear.com/?utm_source=3DMISC&amp;utm_medium=3DMISC&amp;utm_campaign=3DJulia=
" target=3D"_blank"><b><font color=3D"#ca2344"><span style=3D"text-decorati=
on: none;">www.Higear.com</span></font></b></a></span></b></font></div>
<div style=3D"margin: 0px; color: rgb(71, 71, 71); font-family: Arial; font=
-size: 11px; font-weight: bold;"><font color=3D"#909191"><span><span style=
=3D"color: rgb(0, 0, 0); font-weight: bold;">Facebook:</span>=A0</span></fo=
nt><a href=3D"http://www.facebook.com/nomii" target=3D"_blank"> </a><a href=
=3D"https://www.facebook.com/julia.dadiomov" target=3D"_blank">facebook.com=
/julia.dadiomov</a>.</div>
<div style=3D"margin: 0px; color: rgb(71, 71, 71); font-family: Arial; font=
-size: 11px; font-weight: bold;"><font color=3D"#000000"><b>Skype name: Jul=
ia Dadiomov<br><br><span style=3D"font-weight: normal; color: rgb(144, 145,=
145);"></span></b></font></div>
<br>
--0015174bf1c0f46cf304a975da1c--
MIME-Version: 1.0
Received: by 10.229.23.144 with HTTP; Mon, 1 Aug 2011 11:36:45 -0700 (PDT)
In-Reply-To: <CAN2KB0SQQRwcCWRGJVtQUxS+EsxVU83Nu8w6NfLZ8Rs+LXnQvg@mail.gmail.com>
References: <CAN2KB0SQQRwcCWRGJVtQUxS+EsxVU83Nu8w6NfLZ8Rs+LXnQvg@mail.gmail.com>
Date: Mon, 1 Aug 2011 14:36:45 -0400
Delivered-To: navarr@gtaero.net
Message-ID: <CAD4Vo+4ShhU7rxAgMr_2HD9LdSRQLgWe0RFg_wXgugDB+e9oSw@mail.gmail.com>
Subject: Re: HiGear
From: Navarr Barnier <navarr@gtaero.net>
To: Julia Dadiomov <julia@higear.com>
Content-Type: text/plain; charset=UTF-8
8pm est then? Tuesday right? Thats fine. I just have classes from 2:45
to 6:05 EST atm.
On 8/1/11, Julia Dadiomov <julia@higear.com> wrote:
> Hello Navarr,
> I spoke to you earlier regarding an interview with HIGear. Can we
> push that Interview to 5pm PST? Let me know if that works for you.
>
> --
>
> *Julia Dadiomov **|** **Membership Director
> *
> *HIGEAR, Inc.* | 425 2nd St. Suite 250 | San Francisco, CA 94107 |
> *P:* 925.360.4406
> *www.Higear.com<http://www.higear.com/?utm_source=MISC&utm_medium=MISC&utm_campaign=Julia>
> *
> Facebook:
> <http://www.facebook.com/nomii>facebook.com/julia.dadiomov<https://www.facebook.com/julia.dadiomov>
> .
> *Skype name: Julia Dadiomov
>
> *
>
--
-----
Navarr T. Barnier
navarr@gtaero.net
http://navarr.me/
Delivered-To: navarr@gtaero.net
Received: by 10.229.23.144 with SMTP id r16cs101639qcb;
Mon, 1 Aug 2011 12:39:35 -0700 (PDT)
Received: by 10.14.37.194 with SMTP id y42mr175462eea.46.1312227574341;
Mon, 01 Aug 2011 12:39:34 -0700 (PDT)
Return-Path: <julia@higear.com>
Received: from mail-ey0-f171.google.com (mail-ey0-f171.google.com [209.85.215.171])
by mx.google.com with ESMTPS id o6si896354eeb.84.2011.08.01.12.39.32
(version=TLSv1/SSLv3 cipher=OTHER);
Mon, 01 Aug 2011 12:39:33 -0700 (PDT)
Received-SPF: neutral (google.com: 209.85.215.171 is neither permitted nor denied by best guess record for domain of julia@higear.com) client-ip=209.85.215.171;
Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.215.171 is neither permitted nor denied by best guess record for domain of julia@higear.com) smtp.mail=julia@higear.com
Received: by eye22 with SMTP id 22so8519645eye.16
for <navarr@gtaero.net>; Mon, 01 Aug 2011 12:39:32 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.213.14.77 with SMTP id f13mr869221eba.64.1312227572246; Mon,
01 Aug 2011 12:39:32 -0700 (PDT)
Received: by 10.213.4.143 with HTTP; Mon, 1 Aug 2011 12:39:32 -0700 (PDT)
In-Reply-To: <CAD4Vo+4ShhU7rxAgMr_2HD9LdSRQLgWe0RFg_wXgugDB+e9oSw@mail.gmail.com>
References: <CAN2KB0SQQRwcCWRGJVtQUxS+EsxVU83Nu8w6NfLZ8Rs+LXnQvg@mail.gmail.com>
<CAD4Vo+4ShhU7rxAgMr_2HD9LdSRQLgWe0RFg_wXgugDB+e9oSw@mail.gmail.com>
Date: Mon, 1 Aug 2011 12:39:32 -0700
Message-ID: <CAN2KB0RidFk8acamqphA=7r+afsGhq=+S9s3EEuyjymdtAszVQ@mail.gmail.com>
Subject: Re: HiGear
From: Julia Dadiomov <julia@higear.com>
To: Navarr Barnier <navarr@gtaero.net>
Content-Type: multipart/alternative; boundary=0015174c13404ee93704a976cab0
--0015174c13404ee93704a976cab0
Content-Type: text/plain; charset=ISO-8859-1
Ok great talk to you then!
On Mon, Aug 1, 2011 at 11:36 AM, Navarr Barnier <navarr@gtaero.net> wrote:
> 8pm est then? Tuesday right? Thats fine. I just have classes from 2:45
> to 6:05 EST atm.
>
> On 8/1/11, Julia Dadiomov <julia@higear.com> wrote:
> > Hello Navarr,
> > I spoke to you earlier regarding an interview with HIGear. Can
> we
> > push that Interview to 5pm PST? Let me know if that works for you.
> >
> > --
> >
> > *Julia Dadiomov **|** **Membership Director
> > *
> > *HIGEAR, Inc.* | 425 2nd St. Suite 250 | San Francisco, CA 94107 |
> > *P:* 925.360.4406
> > *www.Higear.com<
> http://www.higear.com/?utm_source=MISC&utm_medium=MISC&utm_campaign=Julia>
> > *
> > Facebook:
> > <http://www.facebook.com/nomii>facebook.com/julia.dadiomov<
> https://www.facebook.com/julia.dadiomov>
> > .
> > *Skype name: Julia Dadiomov
> >
> > *
> >
>
>
> --
> -----
> Navarr T. Barnier
> navarr@gtaero.net
> http://navarr.me/
>
--
*Julia Dadiomov **|** **Membership Director
*
*HIGEAR, Inc.* | 425 2nd St. Suite 250 | San Francisco, CA 94107 |
*P:* 925.360.4406
*www.Higear.com<http://www.higear.com/?utm_source=MISC&utm_medium=MISC&utm_campaign=Julia>
*
Facebook: <http://www.facebook.com/nomii>facebook.com/julia.dadiomov<https://www.facebook.com/julia.dadiomov>
.
*Skype name: Julia Dadiomov
*
--0015174c13404ee93704a976cab0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Ok great talk to you then! <br><br><div class=3D"gmail_quote">On Mon, Aug 1=
, 2011 at 11:36 AM, Navarr Barnier <span dir=3D"ltr">&lt;<a href=3D"mailto:=
navarr@gtaero.net">navarr@gtaero.net</a>&gt;</span> wrote:<br><blockquote c=
lass=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px s=
olid rgb(204, 204, 204); padding-left: 1ex;">
8pm est then? Tuesday right? Thats fine. I just have classes from 2:45<br>
to 6:05 EST atm.<br>
<div class=3D"im"><br>
On 8/1/11, Julia Dadiomov &lt;<a href=3D"mailto:julia@higear.com">julia@hig=
ear.com</a>&gt; wrote:<br>
&gt; Hello Navarr,<br>
&gt; =A0 =A0 =A0 =A0 =A0 I spoke to you earlier regarding an interview with=
HIGear. Can we<br>
&gt; push that Interview to 5pm PST? Let me know if that works for you.<br>
&gt;<br>
&gt; --<br>
&gt;<br>
&gt; *Julia Dadiomov **|** **Membership Director<br>
&gt; *<br>
&gt; *HIGEAR, Inc.* =A0| =A0425 2nd St. Suite 250 =A0| =A0San Francisco, CA=
94107 =A0|<br>
&gt; *P:* <a href=3D"tel:925.360.4406" value=3D"+19253604406">925.360.4406<=
/a><br>
</div>&gt; *<a href=3D"http://www.Higear.com" target=3D"_blank">www.Higear.=
com</a>&lt;<a href=3D"http://www.higear.com/?utm_source=3DMISC&amp;utm_medi=
um=3DMISC&amp;utm_campaign=3DJulia" target=3D"_blank">http://www.higear.com=
/?utm_source=3DMISC&amp;utm_medium=3DMISC&amp;utm_campaign=3DJulia</a>&gt;<=
br>
&gt; *<br>
&gt; Facebook:<br>
&gt; &lt;<a href=3D"http://www.facebook.com/nomii" target=3D"_blank">http:/=
/www.facebook.com/nomii</a>&gt;<a href=3D"http://facebook.com/julia.dadiomo=
v" target=3D"_blank">facebook.com/julia.dadiomov</a>&lt;<a href=3D"https://=
www.facebook.com/julia.dadiomov" target=3D"_blank">https://www.facebook.com=
/julia.dadiomov</a>&gt;<br>
&gt; .<br>
&gt; *Skype name: Julia Dadiomov<br>
&gt;<br>
&gt; *<br>
&gt;<br>
<font color=3D"#888888"><br>
<br>
--<br>
-----<br>
Navarr T. Barnier<br>
<a href=3D"mailto:navarr@gtaero.net">navarr@gtaero.net</a><br>
<a href=3D"http://navarr.me/" target=3D"_blank">http://navarr.me/</a><br>
</font></blockquote></div><br><br clear=3D"all"><br>-- <br><div><br></div><=
div style=3D"margin: 0px; color: rgb(71, 71, 71); font-family: Arial; font-=
size: 11px; font-weight: bold;"><b>Julia Dadiomov </b><span style=3D"color:=
rgb(144, 145, 145);"><b>|</b></span><span style=3D"color: rgb(23, 55, 109)=
;"><b> </b></span><b>Membership Director <br>
</b></div><div style=3D"margin: 0px; color: rgb(144, 145, 145); font-family=
: Arial; font-size: 11px; font-weight: bold;"><b>HIGEAR, Inc.</b>=A0=A0|=A0=
=A0425 2nd St. Suite 250 =A0|=A0 San Francisco, CA 94107 =A0|</div><div sty=
le=3D"margin: 0px; color: rgb(144, 145, 145); font-family: Arial; font-size=
: 11px; font-weight: bold;">
<span style=3D"color: rgb(0, 0, 0);"><b>P:</b></span> 925.360.4406<span sty=
le=3D"color: rgb(23, 55, 109);">=A0</span> <br></div><div style=3D"margin: =
0px; color: rgb(71, 71, 71); font-family: Arial; font-size: 11px; font-weig=
ht: bold;">
<font color=3D"#ca2344"><b><span style=3D"color: rgb(71, 71, 71); font-weig=
ht: normal;"><a href=3D"http://www.higear.com/?utm_source=3DMISC&amp;utm_me=
dium=3DMISC&amp;utm_campaign=3DJulia" target=3D"_blank"><b><font color=3D"#=
ca2344"><span style=3D"text-decoration: none;">www.Higear.com</span></font>=
</b></a></span></b></font></div>
<div style=3D"margin: 0px; color: rgb(71, 71, 71); font-family: Arial; font=
-size: 11px; font-weight: bold;"><font color=3D"#909191"><span><span style=
=3D"color: rgb(0, 0, 0); font-weight: bold;">Facebook:</span>=A0</span></fo=
nt><a href=3D"http://www.facebook.com/nomii" target=3D"_blank"> </a><a href=
=3D"https://www.facebook.com/julia.dadiomov" target=3D"_blank">facebook.com=
/julia.dadiomov</a>.</div>
<div style=3D"margin: 0px; color: rgb(71, 71, 71); font-family: Arial; font=
-size: 11px; font-weight: bold;"><font color=3D"#000000"><b>Skype name: Jul=
ia Dadiomov<br><br><span style=3D"font-weight: normal; color: rgb(144, 145,=
145);"></span></b></font></div>
<br>
--0015174c13404ee93704a976cab0--
Delivered-To: navarr@gtaero.net
Received: by 10.229.23.144 with SMTP id r16cs144540qcb;
Tue, 2 Aug 2011 17:40:18 -0700 (PDT)
Received: by 10.42.97.68 with SMTP id m4mr4500854icn.292.1312332018148;
Tue, 02 Aug 2011 17:40:18 -0700 (PDT)
Return-Path: <dan@higear.com>
Received: from homiemail-mx7.g.dreamhost.com (caiajhbdcbef.dreamhost.com [208.97.132.145])
by mx.google.com with ESMTP id u8si1019302pbb.66.2011.08.02.17.40.16;
Tue, 02 Aug 2011 17:40:17 -0700 (PDT)
Received-SPF: neutral (google.com: 208.97.132.145 is neither permitted nor denied by best guess record for domain of dan@higear.com) client-ip=208.97.132.145;
Authentication-Results: mx.google.com; spf=neutral (google.com: 208.97.132.145 is neither permitted nor denied by best guess record for domain of dan@higear.com) smtp.mail=dan@higear.com
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com [209.85.210.43])
(using TLSv1 with cipher RC4-SHA (128/128 bits))
(No client certificate requested)
by homiemail-mx7.g.dreamhost.com (Postfix) with ESMTPS id 76FAFCF6EC
for <me@navarr.me>; Tue, 2 Aug 2011 17:40:16 -0700 (PDT)
Received: by pzk1 with SMTP id 1so442048pzk.2
for <me@navarr.me>; Tue, 02 Aug 2011 17:40:16 -0700 (PDT)
Received: by 10.142.66.12 with SMTP id o12mr4127052wfa.128.1312332016023;
Tue, 02 Aug 2011 17:40:16 -0700 (PDT)
Received: from [10.0.0.7] (c-24-5-83-126.hsd1.ca.comcast.net [24.5.83.126])
by mx.google.com with ESMTPS id i9sm396225pbk.20.2011.08.02.17.40.14
(version=TLSv1/SSLv3 cipher=OTHER);
Tue, 02 Aug 2011 17:40:15 -0700 (PDT)
From: Dan Gailey <dan@higear.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: Hi
Date: Tue, 2 Aug 2011 17:40:13 -0700
Message-Id: <13927C06-8997-4B26-9020-57F59748C555@higear.com>
To: me@navarr.me
Mime-Version: 1.0 (Apple Message framework v1084)
X-Mailer: Apple Mail (2.1084)
I'm on skype: dan.p.gailey@gmail.com
Add me so we can go over the challenges.
-Dan
20:43:36 Dan Gailey Hi Navarr
20:43:41 Navarr Barnier (熊軍平野) Hello.
20:44:27 Dan Gailey Ok
20:44:39 Dan Gailey So, the php challenge is really easy
20:45:05 Dan Gailey Let me dig it up for you
20:45:11 Navarr Barnier (熊軍平野) Alright. ^^;
20:45:27 Dan Gailey what's ^^; ?
20:45:35 Navarr Barnier (熊軍平野) just an emoticon. Its ignorable.
20:45:43 Dan Gailey Is that a cat sweating?
20:45:55 Navarr Barnier (熊軍平野) I've never thought that much about it, actually..
20:46:06 Dan Gailey what's it supposed to be?
20:46:20 Navarr Barnier (熊軍平野) same answer. Sorry. Its habbit, I guess ^^;
20:47:29 Dan Gailey Where did you pick it up at? :P
20:48:09 Navarr Barnier (熊軍平野) Other friends years ago online. I'm one of those anime freaks so, my emoticons are of the odder variety
20:48:40 Dan Gailey It's cool. My brother is really into anime. It missed me by a couple of years.
20:49:19 Navarr Barnier (熊軍平野) So this challenge, is it CLI, CGI, or just abstract coding?
20:49:32 Dan Gailey hold on.
20:49:34 Dan Gailey you'll see.
20:49:36 Dan Gailey I'm prepping it :)
20:49:39 Navarr Barnier (熊軍平野) alright :)
20:52:18 Navarr Barnier (熊軍平野) So, I didn't think about it during the interview, but what is your position at HiGear?
20:52:23 Dan Gailey I'm CTO.
20:52:31 Navarr Barnier (熊軍平野) Oh cool.
20:52:44 Dan Gailey We have another software engineer, and we just let another software engineer go.
20:53:12 Navarr Barnier (熊軍平野) Wow, so a really small team atm?
20:53:15 Dan Gailey But we're always on the hunt for good talented people.
20:53:22 Dan Gailey Yes, we just launched last week.
20:53:44 Navarr Barnier (熊軍平野) That explains it. Hope it goes well for y'all.
20:54:00 Dan Gailey Ok, so my challenges are going to get harder (or at least I think so)
20:54:11 Navarr Barnier (熊軍平野) Alright :)
20:54:18 Dan Gailey the first challenge is PHP
20:54:37 Dan Gailey This code isn't pretty, but it can be made prettier. It's your job to find out how to make it prettier.
20:54:47 Dan Gailey $weekday_price = $prices->weekdays;
$weekend_price = $prices->weekends;
$weekly_price = $prices->week;
$start_date = $reservations->start_date;
$end_date = $reservations->end_date;
$total = 0;
$fromDateTS = strtotime($start_date);
$toDateTS = strtotime($end_date)-(60*60*24);
$days = Array();
for ($currentDateTS = $fromDateTS; $currentDateTS <= $toDateTS; $currentDateTS += (60 * 60 * 24)) {
$days[] = $currentDateTS;
}
$day_count = count($days);
$number_of_weeks = floor($day_count/7);
if($number_of_weeks == 0) {
foreach($days as $day) {
$day_type = date("w", $day);
if(($day_type == 0) || ($day_type == 6)) {
$total += $weekend_price;
} else {
$total += $weekday_price;
}
}
} else {
// more than one week
$total = $number_of_weeks * $weekly_price;
for($i=$number_of_weeks*7; $i<count($days); $i++) {
$day_type = date("w", $days[$i]);
if(($day_type == 0) || ($day_type == 6)) {
$total += $weekend_price;
} else {
$total += $weekday_price;
}
}
}
20:56:51 Navarr Barnier (熊軍平野) okay. Do you need it right away, or?
20:57:08 Dan Gailey Sooner the better, but it's up to you.
20:57:12 Dan Gailey I'd like to know when you start/finish.
20:57:31 Dan Gailey you can take the evening. Then I'll give you your next challenge.
20:57:42 Navarr Barnier (熊軍平野) well, honestly i'd love to spend the next bit of time on it, but I have a final project thats really difficult that I'm working on thats due Thursday for one of my classes.
20:58:38 Dan Gailey Ok, like I said, just be honest with me and let me know when you start/finish and how long it took you.
20:58:52 Navarr Barnier (熊軍平野) alright, will do :)
20:58:57 Navarr Barnier (熊軍平野) Thank you for your time
20:59:23 Dan Gailey Thanks again, and I look forward to seeing your answer.
20:59:27 Dan Gailey :)
MIME-Version: 1.0
Received: by 10.68.56.41 with HTTP; Wed, 3 Aug 2011 20:45:20 -0700 (PDT)
In-Reply-To: <13927C06-8997-4B26-9020-57F59748C555@higear.com>
References: <13927C06-8997-4B26-9020-57F59748C555@higear.com>
Date: Wed, 3 Aug 2011 23:45:20 -0400
Delivered-To: navarr@gtaero.net
Message-ID: <CAD4Vo+4mWHNFae8GhgSdVH9h8bJP039XxTMX6d69FMXdTO332w@mail.gmail.com>
Subject: Re: Hi
From: Navarr Barnier <navarr@gtaero.net>
To: Dan Gailey <dan@higear.com>
Content-Type: multipart/alternative; boundary=f46d042fdec85bf58e04a9a5cf9d
--f46d042fdec85bf58e04a9a5cf9d
Content-Type: text/plain; charset=UTF-8
Hey Mr. Gailey,
I went over the challenge and I'm hoping I came up with the solution. I'm
sorry I had to postpone it to tonight, but I unfortunately had to prioritize
a ReversiAI over this coding sample.
Here is what I got. I didn't test it, so there might be a syntax error, but
I think the challenge was more about the logic?
Either way, what I saw didn't need much improvement, and probably won't make
too large a difference on the overall result, but it could be simplified and
so I did that (and added comments for my own understanding).
-----
// 11:35pm, EST
$weekday_price = $prices->weekdays;
$weekend_price = $prices->weekends;
$weekly_price = $prices->week;
$start_date = $reservations->start_date;
$end_date = $reservations->end_date;
$total = 0;
$fromDateTS = strtotime($start_date); // From Date Timestamp.. Get the Start
Dates Unix Timestamp
$todateTS = strtotime($end_date)-(60*60*24); // Get the End Date's
Timestamp.. and subtract a day from it.
$days = array();
// For Each Day
for($currentDateTS = $fromDateTS; $currentDateTS <= $toDateTS;
$currentDateTS += (60 * 60 * 24))
{
$days[] = $currentDateTS;
}
$day_count = count($days); // get the number of days
$number_of_weeks = floor($day_count/7); // get the number of weeks
$total = $number_of_weeks * $weekly_price; // Get the price per week.
for($i = $number_of_weeks*7; $i < count($days); $i++)
{
$day_type = date("w", $days[$i]);
if(($day_type == 0) || ($day_type == 6)) // If it is a Sunday or Saturday
{
$total += $weekend_price;
}
else
{
$total += $weekday_price;
}
}
// 11:40pm, EST.
/*
Maybe I missed something, or I was over-thinking it, but I didn't see much
that could be improved. From what I can tell, all that there was was the
slight repetition of day counting when it wasn't necessary.
I hope this is satisfactory and to your liking. The comments were to help
me understand the code as I went through it.
*/
-----
Navarr T. Barnier
navarr@gtaero.net
http://navarr.me/
On Tue, Aug 2, 2011 at 8:40 PM, Dan Gailey <dan@higear.com> wrote:
> I'm on skype: dan.p.gailey@gmail.com
> Add me so we can go over the challenges.
> -Dan
>
--f46d042fdec85bf58e04a9a5cf9d
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hey Mr. Gailey,<div><br></div><div>I went over the challenge and I&#39;m ho=
ping I came up with the solution. =C2=A0I&#39;m sorry I had to postpone it =
to tonight, but I unfortunately had to prioritize a ReversiAI over this cod=
ing sample.</div>
<div><br></div><div>Here is what I got. =C2=A0I didn&#39;t test it, so ther=
e might be a syntax error, but I think the challenge was more about the log=
ic?</div><div><br></div><div>Either way, what I saw didn&#39;t need much im=
provement, and probably won&#39;t make too large a difference on the overal=
l result, but it could be simplified and so I did that (and added comments =
for my own understanding).</div>
<div><br></div><div>-----</div><div><br></div><div><div>// 11:35pm, EST</di=
v><div><br></div><div>$weekday_price =3D $prices-&gt;weekdays;</div><div>$w=
eekend_price =3D $prices-&gt;weekends;</div><div>$weekly_price =3D $prices-=
&gt;week;</div>
<div><br></div><div>$start_date =3D $reservations-&gt;start_date;</div><div=
>$end_date =3D $reservations-&gt;end_date;</div><div><br></div><div>$total =
=3D 0;</div><div><br></div><div>$fromDateTS =3D strtotime($start_date); // =
From Date Timestamp.. Get the Start Dates Unix Timestamp</div>
<div>$todateTS =3D strtotime($end_date)-(60*60*24); // Get the End Date&#39=
;s Timestamp.. and subtract a day from it.</div><div><br></div><div>$days =
=3D array();</div><div><br></div><div>// For Each Day</div><div>for($curren=
tDateTS =3D $fromDateTS; $currentDateTS &lt;=3D $toDateTS; $currentDateTS +=
=3D (60 * 60 * 24))</div>
<div>{</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span>$days[] =3D $currentDateTS;</div><div>}</div><div><br></div><div>$da=
y_count =3D count($days); // get the number of days</div><div><br></div><di=
v>$number_of_weeks =3D floor($day_count/7); // get the number of weeks</div=
>
<div><br></div><div>$total =3D $number_of_weeks * $weekly_price; // Get the=
price per week.</div><div><br></div><div>for($i =3D $number_of_weeks*7; $i=
&lt; count($days); $i++)</div><div>{</div><div><span class=3D"Apple-tab-sp=
an" style=3D"white-space:pre"> </span>$day_type =3D date(&quot;w&quot;, $da=
ys[$i]);</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>if(($=
day_type =3D=3D 0) || ($day_type =3D=3D 6)) // If it is a Sunday or Saturda=
y</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </spa=
n>{</div><div>
<span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>$total +=
=3D $weekend_price;</div><div><span class=3D"Apple-tab-span" style=3D"white=
-space:pre"> </span>}</div><div><span class=3D"Apple-tab-span" style=3D"whi=
te-space:pre"> </span>else</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>{</di=
v><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>$t=
otal +=3D $weekday_price;</div><div><span class=3D"Apple-tab-span" style=3D=
"white-space:pre"> </span>}</div>
<div>}</div><div><br></div><div>// 11:40pm, EST.</div><div>/*</div><div><sp=
an class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>Maybe I misse=
d something, or I was over-thinking it, but I didn&#39;t see much</div><div=
>
<span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>that could=
be improved. =C2=A0From what I can tell, all that there was was the</div><=
div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>slight=
repetition of day counting when it wasn&#39;t necessary.</div>
<div><br></div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre=
"> </span>I hope this is satisfactory and to your liking. =C2=A0The comment=
s were to help</div><div><span class=3D"Apple-tab-span" style=3D"white-spac=
e:pre"> </span>me understand the code as I went through it.</div>
<div>*/</div></div><div><br clear=3D"all">-----<br>Navarr T. Barnier<br><a =
href=3D"mailto:navarr@gtaero.net" target=3D"_blank">navarr@gtaero.net</a><d=
iv><a href=3D"http://navarr.me/" target=3D"_blank">http://navarr.me/</a></d=
iv><br>
<br><br><div class=3D"gmail_quote">On Tue, Aug 2, 2011 at 8:40 PM, Dan Gail=
ey <span dir=3D"ltr">&lt;<a href=3D"mailto:dan@higear.com">dan@higear.com</=
a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0=
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I&#39;m on skype: <a href=3D"mailto:dan.p.gailey@gmail.com">dan.p.gailey@gm=
ail.com</a><br>
Add me so we can go over the challenges.<br>
<font color=3D"#888888">-Dan<br>
</font></blockquote></div><br></div>
--f46d042fdec85bf58e04a9a5cf9d--
18:12:48 Navarr Barnier (熊軍平野)
18:12:48 Navarr Barnier (熊軍平野) Good Afternoon. Just out of curiosity, did you get a chance to look at my answer?
18:13:11 Dan Gailey Yes, I did. I didn't have time to test it. Would you mind if I got back to you around 5pm Pacific?
18:13:29 Navarr Barnier (熊軍平野) Not at all. Thanks for your time :)
18:13:35 Dan Gailey No worries. Thanks. :)
04:26:06 Dan Gailey Hey Navarr, Sorry I'm getting back to you so late. I'll have to talk with you tomorrow. I've been working on the site.
----
13:37:56 Dan Gailey hm, you code in PHP right? Have you ever used SWFUpload?
13:42:33 Dan Gailey I also wanted to say that you nailed the first challenge. It was easy!
13:45:27 Dan Gailey 2. a JS/JQuery challenge that involves tracking down a bug,
3. given a set of parameters (knowns: zipcodes, lat, long, city, state, country), what's the quickest way to look up distances between zipcodes and give a quick calculation. Without giving away too much, you don't necessarily have to accept that the earth is oblate spheroid, so the distance doesn't have to be exact.
13:45:31 Dan Gailey those are your next challenges.
13:45:52 Dan Gailey Let me know when you're ready
15:20:00 Navarr Barnier (熊軍平野) Sorry, i was afk and forgot to set my away message. And no, I've never used SWFUpload (Never had a reason for multiple file uploads). And I guess I'm as ready as I'll ever be.
15:20:27 Dan Gailey Sure, so the second challenge is a little mysterious
15:20:45 Dan Gailey If you visit higear.com and login, you'll (hopefully) be redirected to our /browse/ page
15:21:08 Navarr Barnier (熊軍平野) alright
15:21:26 Dan Gailey One of our testers have found that sometimes their zipcode field in the search area on the right gets replaced with the dollar value of another hidden input.
15:22:03 Dan Gailey I haven't done any research, but I'd like you to inspect the JS and see if you can find out a reasonable suspect.
15:22:25 Navarr Barnier (熊軍平野) Will do :)
15:22:37 Dan Gailey Challenge #2 & #3 can be done in any order you would like.
15:23:11 Navarr Barnier (熊軍平野) I'll do #2 first, and start immediately. All of my classes are over now.
15:27:33 Navarr Barnier (熊軍平野) did the tester give any instructions on how to recreate?
15:27:59 Dan Gailey they don't know how to recreate the error.
15:28:50 Navarr Barnier (熊軍平野) okay..
15:29:20 Dan Gailey If you're not having any luck, I'll also show you a related bug on the page.
15:29:50 Navarr Barnier (熊軍平野) Please?
15:29:58 Dan Gailey sure, hold on.
15:32:28 Dan Gailey let me make sure I can reproduce it really quickly
15:33:08 Navarr Barnier (熊軍平野) okay
15:33:23 Dan Gailey Okay, I can reproduce it.
15:33:35 Navarr Barnier (熊軍平野) i actually just got the error on the browse page
15:33:51 Dan Gailey where your $1000 appears in the zipcode field?
15:33:59 Navarr Barnier (熊軍平野) yeah
15:34:06 Dan Gailey cool, here is a related bug
15:34:22 Dan Gailey login to http://alpha.higear.com/site/
15:34:29 Dan Gailey when you visit the browse page
15:34:46 Dan Gailey I've commented out a cheap workaround
15:34:49 Dan Gailey " <!-- script type="text/javascript">
$(document).ready(function() {
$("#settings_category").val("all");
$("#settings_make").val("all");
$("#settings_distance").val("50");
$("#settings_zipcode").val("<?=$zipcode;?>");
$("#settings_price").val("1000");
$("#settings_page").val("1");
});
</script-->"
15:35:19 Dan Gailey without this workaround, those hidden input fields will get overwritten, and if you have firebug open, they will get overwritten one by one.
15:35:25 Dan Gailey when you refresh the page
15:35:35 Dan Gailey <input id="settings_category" type="hidden" value="all">
<input id="settings_make" type="hidden" value="all">
<input id="settings_distance" type="hidden" value="50">
<input id="settings_zipcode" type="hidden" value="94080">
<input id="settings_price" type="hidden" value="all">
<input id="settings_page" type="hidden" value="all">
15:35:51 Navarr Barnier (熊軍平野) is the zip_code input box filled in via PHP? Because I don't think its a jQuery bug
15:35:55 Navarr Barnier (熊軍平野) it happens when you click a card, and then click back
15:35:58 Navarr Barnier (熊軍平野) car*
15:36:16 Dan Gailey It is.
15:36:43 Dan Gailey but check out the hidden input boxes
15:36:43 Navarr Barnier (熊軍平野) i think the car page may be overwriting a session variable thats then put in that box? Thats the first explanation i can come up with
15:36:50 Dan Gailey <input id="settings_category" type="hidden" value="all">
<input id="settings_make" type="hidden" value="all">
<input id="settings_distance" type="hidden" value="50">
<input id="settings_zipcode" type="hidden" value="<?=$zipcode;?>">
<input id="settings_price" type="hidden" value="<?=$slider_max->max;?>">
<input id="settings_page" type="hidden" value="1">
15:37:33 Dan Gailey that's the server side code for the hidden input boxes
15:37:37 Dan Gailey examine their behavior
15:37:42 Dan Gailey when you refresh the page
15:39:23 Navarr Barnier (熊軍平野) well.. disabling the workaround you did, the settings_ all keep the proper data for me
15:39:44 Navarr Barnier (熊軍平野) just the zip code box is different
15:39:56 Navarr Barnier (熊軍平野) and there isn't any javascript that I could find that sets its value
15:40:57 Navarr Barnier (熊軍平野) although there is code to set the settings_zipcode to the value of the .zip_code box on an enter keypress..
15:48:02 Dan Gailey <input id="settings_category" type="hidden" value="all">
<input id="settings_make" type="hidden" value="all">
<input id="settings_distance" type="hidden" value="50">
<input id="settings_zipcode" type="hidden" value="94080">
<input id="settings_price" type="hidden" value="999">
<input id="settings_page" type="hidden" value="1">
-----
After dragging the slider to some value and back to 1000 , then hitting refresh on the page, I get :
<input id="settings_category" type="hidden" value="all">
<input id="settings_make" type="hidden" value="all">
<input id="settings_distance" type="hidden" value="50">
<input id="settings_zipcode" type="hidden" value="94080">
<input id="settings_price" type="hidden" value="94080">
<input id="settings_page" type="hidden" value="1000">
15:50:10 Dan Gailey does that not happen for you? (I'm using firebug 1.7.3)
15:51:54 Navarr Barnier (熊軍平野) it doesn't anymore (I'm using Chrome and Dev Tools)
15:52:10 Dan Gailey hm. I'll check for this behavior in chrome.
15:52:14 Navarr Barnier (熊軍平野) ill open up firefox
15:53:33 Dan Gailey hm, you're right. I don't see this behavior in Chrome.
15:55:20 Navarr Barnier (熊軍平野) im not getting any bugs with the slider in my firefox either (5.0.1 with Firebug 1.7.3)
15:55:28 Navarr Barnier (熊軍平野) but it is happening when I click a car and back
15:55:53 Dan Gailey See, I don't see the bug when clicking car and back
15:56:51 Navarr Barnier (熊軍平野) you're right. Im not getting that in Firefox
15:57:28 Dan Gailey wow, I do see it in chrome.
15:57:31 Dan Gailey but not firefox.
15:58:23 Dan Gailey so the controller just has :
15:58:25 Dan Gailey $zips = $this->browse_model->get_user_zipcode($user_id)->row();
if(is_null($zips->last_search_zip)) {
$zipcode = $zips->zip;
} else {
$zipcode = $zips->last_search_zip;
}
$data['zipcode'] = $zipcode;
15:59:07 Dan Gailey but, we do use ajax to get other pages
15:59:25 Dan Gailey $zipcode = $this->input->post('zipcode', TRUE);
$price = $this->input->post('price');
$page = $this->input->post('page');
$this->load->model('browse_model');
$user_id = $this->session->userdata('user_id');
$this->browse_model->save_search_zipcode($user_id, $zipcode);
15:59:48 Dan Gailey so what might be happening is that the zipcode being sent is $1000 somehow
15:59:58 Dan Gailey and getting saved to the db
16:02:36 Dan Gailey +-----------------+---------+------------+-----------+
| last_search_zip | user_id | first_name | last_name |
+-----------------+---------+------------+-----------+
| $1000 | 57 | Zaki | Mahomed |
| $1000 | 99 | Vesselin | Tsukev |
| $1000 | 632 | larry | |
| $1000 | 662 | Joe | Simpson |
| $1000 | 714 | Adam | Jaffray |
| $1000 | 744 | Kyle | Garton |
| $1000 | 787 | Michael | Ostrovsky |
| $1000 | 884 | Tae | Kim |
| $1000 | 935 | Paul | Spiegel |
+-----------------+---------+------------+-----------+
16:02:44 Dan Gailey so that appears to to be the case
16:03:18 Dan Gailey can you tell me why it would be grabbing $1000 instead of post('zipcode'); ?
16:04:03 Navarr Barnier (熊軍平野) not yet.. Im still looking at the javascript. May I see the code that saves the last searched zipcode?
16:04:12 Dan Gailey sure
16:05:07 Dan Gailey function save_search_zipcode($user_id, $zipcode) {
$query = 'UPDATE user SET last_search_zip="'.$zipcode.'" WHERE user_id="'.$user_id.'"';
$this->db->query($query);
}
16:05:54 Dan Gailey Let me know if you'd like anymore info.
16:07:29 Navarr Barnier (熊軍平野) i still have a hunch that the PHP is setting $zipcode wrong somewhere. It's just the .zip_code box. I'm looking at browse.js and #settings_zipcode gets it from .zip_code so I'm still thinking its in the PHP, even though we get vastly different results in different browsers
16:07:57 Dan Gailey yep
16:08:17 Dan Gailey which makes me think it's jquery/js
16:09:00 Dan Gailey but you might be right, I haven't solved this problem. I'm just challenging your problem solving and communication skills right now.
16:10:14 Navarr Barnier (熊軍平野) Okay. Is someone working on the PHP code? Because there are some PHP errors messing with it now
16:15:00 Dan Gailey interestingly no.
16:15:05 Dan Gailey Can you paste the errors here?
16:15:30 Navarr Barnier (熊軍平野) i would, but they went away on their own. They were errors with a non-object iirc line 16 and 18. I'll send the details if i get them again
16:15:41 Navarr Barnier (熊軍平野) (of browse.php)
16:15:42 Dan Gailey It's because of the $1000 in zipcode
16:23:49 Navarr Barnier (熊軍平野) Well..
I've confirmed it doesn't happen when JavaScript is turned off.
However, I can't find the value that the input is being propagated with in the HTML received over the network. In fact, despite the input showing a price, the value in the Elements tab in developer tools shows that it has a value containing the zipcode, though the javascript pulls the price from it.
These were my results in Chrome, and I'll attempt it in Firefox now. Thought I'd share the strangeness with you.
16:24:52 Dan Gailey Yep. It's bizarre. I'm going to take a lunch now. I'll return in an hour or so.
16:25:05 Navarr Barnier (熊軍平野) okay. I'll report anything i find.
16:25:11 Dan Gailey great. :)
17:13:42 Navarr Barnier (熊軍平野) Well, I still can't recreate the bug in Firefox. In chrome I went through all of the javascript, running each piece individually (after changing it to 77388 but not pressing enter so it doesn't send) and none of the javascript changed it. Chrome's DOM however says that its default value was the expected value (the zip code) but still gives it a value of the price from the last slider value. As such it can't be in the PHP, but there is no javascript to cause it either. It could be an autocomplete bug in Chrome/Firefox thats causing it, but I can't pinpoint its origins to the javascript.
Additionally, I did the third challenge - but to be honest I looked up the formula. It didn't take long to look it up or to move it from C# to PHP, and the results are relatively close to those given by google maps
17:17:16 Navarr Barnier (熊軍平野) ^ thats because i was looking at driving distance. The results are
18:20:35 Dan Gailey ok. Email your php to me.
18:23:10 Navarr Barnier (熊軍平野) sent
18:24:36 Dan Gailey So you agree the second challenge.. is a challenge. :P
18:24:50 Navarr Barnier (熊軍平野) lol, definitely.
18:26:33 Dan Gailey yeah, it really is a mystery. I'll have to spend some time on that bug.
18:30:11 Navarr Barnier (熊軍平野) Yeah. Its not happening in Opera either so.. Its a really strange one
18:30:28 Dan Gailey What OS do you run?
18:30:33 Navarr Barnier (熊軍平野) Windows 7
18:30:46 Dan Gailey I'll try with Safari.
18:33:05 Dan Gailey Safari has the same problem.
18:33:41 Navarr Barnier (熊軍平野) Is your firefox still doing it? I can't recreate it in Safari for Windows as easily as i can in chrome
18:35:20 Dan Gailey uhm
18:35:27 Dan Gailey can you reproduce it now in chrome?
18:35:42 Dan Gailey double check for me
18:36:10 Navarr Barnier (熊軍平野) only by clicking a car and hitting the back button. Thats the only way I can get it to happen.
18:36:25 Dan Gailey I just changed something, can you check again?
18:36:32 Navarr Barnier (熊軍平野) sure
18:36:49 Navarr Barnier (熊軍平野) after a hard refresh, its still occuring
18:37:12 Dan Gailey really? hm. It's not occurring for me anymore. Let me clear my cache/cookies/etc.
18:37:52 Dan Gailey So how do you feel about working weekends?
18:38:15 Dan Gailey not like crazy hours, but sometimes I have the devs work some over the weekends if there is a ton of work.
18:38:27 Dan Gailey but for instance, we have today until monday off.
18:38:27 Navarr Barnier (熊軍平野) Well, atm i have very little personal life and I doubt i'd gain one magically if i relocated, so I'd be fine with it. I'm not religious so thats not an issue either.
18:38:59 Dan Gailey (But I work, regardless) I'm not saying you have to put in as many hours as I do, just that you're around if I need you.
18:39:12 Navarr Barnier (熊軍平野) Yeah, I can do that.
18:39:34 Dan Gailey That's cool. Our other developer is actually in Pakistan right now.
18:39:58 Dan Gailey so he stays up from 4am-6pm our time usually.
18:39:58 Navarr Barnier (熊軍平野) Oh cool.
18:40:33 Dan Gailey Yeah, it's not as bad as you would think. He's a decent developer and a hard worker. We're bringing him over on a visa. He's worked with the cofounders before.
18:41:08 Dan Gailey the cofounders are pretty cool guys too.
18:42:12 Navarr Barnier (熊軍平野) Nice. :)
18:43:37 Dan Gailey So how did you get into coding?
18:45:59 Navarr Barnier (熊軍平野) Heh. when I was in sixth grade I was obsessed with the Web and wanted to make a website. Started out with one of those crappy geocities webpages and picked up a few books on HTML and "DHTML" in an attempt to do better. I eventually ended up learning mIRC scripting (somehow I'd gotten pulled into the IRC world) and wanted to make it do neat things. I'm not sure how I started learning PHP, but it was definitely after learning mIRC. The rest is kind of blurry, and now I'm pretty decent at HTML, PHP, and JavaScript. I guess I got into it more as a hobby then as anything real, and it stuck.
18:46:55 Dan Gailey yeah, I started using the bX client on irc, eggdrops, etc
18:47:22 Dan Gailey except I got into more of the 'hp' scene.
18:47:42 Dan Gailey that got old pretty quick after I turned 18.
18:47:58 Dan Gailey Do you still go on irc?
18:47:58 Navarr Barnier (熊軍平野) heh.
18:48:17 Navarr Barnier (熊軍平野) occasionally. I don't use it for much anymore but to chat on rare occasion with a few twitter friends and older friends I can only find there
18:48:39 Navarr Barnier (熊軍平野) one of my acquaintances on twitter set me up an account on his amazon server so I could have a constant running irssi client
18:50:56 Dan Gailey wow, that's cool, so people are using amazon instances for irc clients, eh? interesting.
18:51:22 Dan Gailey what's your OS of choice?
18:51:28 Navarr Barnier (熊軍平野) he's probably using it for everything to. It acts just like a linux box.
18:51:49 Navarr Barnier (熊軍平野) Personally, I prefer Windows. I can get around it and hack around when needed, and almost any software I need can run on it. Debian is second place.
18:52:45 Dan Gailey Cool. I prefer OSX. I dig the pretty things, and bsd underbelly.
18:53:51 Navarr Barnier (熊軍平野) Ah. My mother and step-father like OSX. The entire house is filled with Macs & Apple products
18:54:11 Dan Gailey So do you think you can make challenge 3 faster if you only had lat/long? You don't have to assume the world is spherical.
18:54:20 Dan Gailey and we can live with a small margin of error
18:55:02 Navarr Barnier (熊軍平野) I can do some quick research. I assume lat long is based on distance, it should be pretty simple
18:55:38 Dan Gailey yep
19:00:01 Navarr Barnier (熊軍平野) well, i think i have it. Seems pretty simple. Let me test it
19:01:48 Dan Gailey yeah, and so basically we have all the lat/long of all the cars in the database
19:02:15 Dan Gailey if a user wants 94110, we look up the lat/long and just ask mysql to find us the ones within a range
19:02:34 Navarr Barnier (熊軍平野) got it
19:02:37 Navarr Barnier (熊軍平野) sqrt(pow($long2-$long1,2)+pow($lat2-$lat1,2))*69;
19:03:21 Navarr Barnier (熊軍平野) 69 miles per degree. It overestimates a little, it appears
19:08:19 Dan Gailey So here is what I did
19:08:42 Dan Gailey function get_binding_boxes($lat, $lng, $distance) {
// quick hack, experimental values
$delta = ($distance/50)*.91526;
$data['lat_upper'] = $lat-$delta;
$data['lat_lower'] = $lat+$delta;
$data['lng_upper'] = $lng-$delta;
$data['lng_lower'] = $lng+$delta;
return $data;
}
19:09:04 Dan Gailey in finding the upper and lower bounds, I just used that in the query
19:09:42 Dan Gailey where I asked the database to find me lat+long values contained within those bounds.
19:09:50 Dan Gailey It's not exact, but it works really quickly.
19:09:59 Navarr Barnier (熊軍平野) i see.
19:10:11 Dan Gailey What do you think of my solution versus your solution?
19:10:17 Navarr Barnier (熊軍平野) what is the signifance of /50 and .91526?
19:11:29 Dan Gailey Those are values I found while finding the distance between two coordinates with 50 miles between them.
19:11:56 Navarr Barnier (熊軍平野) your solution is more suited to the task of finding things within a distance. Mine simply found what the distance between two was. If querying SQL, yours would definitely be faster because you'd already know the bounds. With mine you'd have to calculate the distance for each set and then determine if its within bounds
19:12:23 Navarr Barnier (熊軍平野) If I understand correctly
19:13:01 Dan Gailey then, I took a new value, and found some constant I could multiply it by to get offsets for finding binding values.
19:13:33 Dan Gailey So, it's not perfect, but it's fast.
19:14:07 Navarr Barnier (熊軍平野) I see. Speed is also the most important thing for the use case of HiGear.
19:14:14 Dan Gailey Yep. always.
19:15:26 Dan Gailey Ok cool. It was nice chatting with you this afternoon. I've got a couple of errands to run. If I have anymore questions I'll contact you. Let me talk to murti tonight and then we'll chat again. cool?
19:15:52 Navarr Barnier (熊軍平野) Sounds great. Thanks for your time, as always :)
19:16:08 Dan Gailey Yes, It was great talking to you, Navarr. :)
19:16:23 Navarr Barnier (熊軍平野) Likewise.
12:48:53 Navarr Barnier (熊軍平野)
12:48:53 Navarr Barnier (熊軍平野) Good Morning Mr. Gailey. It's been a while since we last spoke, and I was just wondering where we stood since then, if there is anything else I can do for you, etc?
MIME-Version: 1.0
Received: by 10.229.79.138 with HTTP; Sat, 20 Aug 2011 09:18:16 -0700 (PDT)
Date: Sat, 20 Aug 2011 12:18:16 -0400
Delivered-To: navarr@gtaero.net
Message-ID: <CAD4Vo+5wNUm9kWxnFFgWFn21Kuk7Qo_=0tYwfrisU2LJsnHv+A@mail.gmail.com>
Subject: Re: HiGear
From: Navarr Barnier <navarr@gtaero.net>
To: Dan Gailey <dan@higear.com>
Content-Type: multipart/alternative; boundary=0016369c8f7386317404aaf23111
--0016369c8f7386317404aaf23111
Content-Type: text/plain; charset=UTF-8
Hey Mr. Gailey,
It's been awhile since we last spoke. You last told me you were going to
talk to Murti and that we'd chat again.
I was just wondering where we stood..
Thanks,
-----
Navarr T. Barnier
navarr@gtaero.net
http://navarr.me/
--0016369c8f7386317404aaf23111
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hey Mr. Gailey,<div><br></div><div>It&#39;s been awhile since we last spoke=
. =C2=A0You last told me you were going to talk to Murti and that we&#39;d =
chat again.</div><div><br></div><div>I was just wondering where we stood..<=
/div>
<div><br></div><div>Thanks,<br clear=3D"all">-----<br>Navarr T. Barnier<br>=
<a href=3D"mailto:navarr@gtaero.net" target=3D"_blank">navarr@gtaero.net</a=
><div><a href=3D"http://navarr.me/" target=3D"_blank">http://navarr.me/</a>=
</div>
<br>
</div>
--0016369c8f7386317404aaf23111--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment