Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

02-10-2013 , 06:50 AM
innodb is mysql so i don't take your point.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 06:53 AM
You said the substring queries don't scale well:

http://www.youtube.com/watch?v=b2F-DItXtZs

Excuse me while I grab my coat and leave the room now. Might be time for bed.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 06:59 AM
I probably do it as one table (but I've also been in Mongo-land for awhile and we like to keep data you query for together).

If you want to keep the user table simple I'd go with a user_contacts (or similar) table that has your user pk and two columns for your contact methods. I can't imagine this has any meaningful performance impact.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 07:43 AM
Part of the reason I did the phone numbers like that is to allow searching for users by area code.

The ph columns are integers so it can't store non-digit characters like parenthesis, but that's not really a big deal. MySQL is considerably faster when comparing integer values than it is for ordinary strings. Tyler is right, substring queries are expensive, at least compared to queries that only compare integers.

The main reason I'm storing phone numbers that way is they'll be formatted in a few different ways throughout the application so it's just easier to store as 3 different fields and handling each case.

jjshabado, I'm kinda leaning towards that as well. I don't see any sort of big performance boost either. And actually, I would guess that one table would be faster since fewer table joins would be needed.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 08:44 AM
When you say message marketing system does this involve sending newsletter style e-mails out?

If so, do you have things setup to handle incomplete blasts? It's an edge case but really important for such a tool. You don't want to send out duplicate e-mails if you restart the process.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 10:34 AM
Quote:
Originally Posted by Shoe Lace
When you say message marketing system does this involve sending newsletter style e-mails out?

If so, do you have things setup to handle incomplete blasts? It's an edge case but really important for such a tool. You don't want to send out duplicate e-mails if you restart the process.
Yeah, it's for newsletter style emails. I have something in place to help that. Well...kind of. But not really. It's PHP (of course), and the script that actually sends blasts has this at the top:

[PHP]ignore_user_abort(true);
set_time_limit(0);[/PHP]

If a user closes their browser mid-blast, the script will continue executing. Also, if there are a ton of emails, it won't timeout like scripts ordinarily would do after like 30 seconds or whatever the default is. Hopefully that will handle a lot of the issue.

At the moment, it records each individual email that's sent, but it doesn't insert into the database each time. A database query for every single e-mail sent would be very slow for lots of emails. For 1000 people, each blast would require 1000 separate DB queries, minimum.

That didn't seem like a good idea, so I'm doing multiple inserts within single queries like:

INSERT INTO msg_history (a, b) VALUES (x, y), (c, d), (d, e)

I did a bit of reading, and there are varying limits on the number of records that can be inserted in a single statement. Since a very large insert statement could also be slow/resource intensive, I came up with something like this (trimmed for space):

[PHP]$query = "INSERT INTO msg_history (user_id, email_id) VALUES ";
$total = 0; // for counting to 100 DB inserts

for ($i=0; $i<$num_recipients; $i++) { // e-mail blast loop
$mail->Send(); // prepare and send email

// add to insert query, increment counter
$query .= "($user_id, $email_id),";
$total++;

if ($total >= 100) {
$query = substr($query, 0, -1); // remove last comma
mysqli_query($link, $query);

// create new query and reset counter
$query = "INSERT INTO msg_history (user_id, email_id) VALUES ";
$total = 0;
}

}

if ($total > 0) {
// insert remaining e-mails
}
[/PHP]

This way, the total # of DB queries are reduced, and there are never more than 100 records inserted at once, so we'll be safely within the limits (which vary from server to server).

I'm assuming the only way to accurately handle incomplete blasts would be to insert each e-mail separately though, right?

Last edited by sdturner02; 02-10-2013 at 10:43 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 10:51 AM
Is the email code executed on a random visitors page load?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 10:55 AM
So a company wants to automate a form-filling task. Currently the forms are filled out by hand (which include the person's email, name, other basic info.) by the costumer, and later a data entry clerk manually types these into an Excel spreadsheet.

The company wants the process to be automated with an iPad, so that the customer can fill out the form and the iPad will automatically enter the data into an Excel spreadsheet.

What is the best way to go about doing this? More specifically, I'm curious whether you would try to make an iOS app and get it into the App Store, or do it through the company's mobile site, or...?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 11:10 AM
Quote:
Originally Posted by Gullanian
Is the email code executed on a random visitors page load?
Oh no, there's a simple application that the admin logs into to send emails. Looks kinda like this:



They can select who will receive the email, view a preview of the message inside the HTML email template, etc.

If you're wondering b/c of the code above, it's been edited down quite a bit. A lot of the code for sending the email, checking addresses, database stuff, etc. is not there. I actually just typed out what it looks like instead of pasting it in.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 11:56 AM
On a related note, if any of you need to send emails using PHP, I highly recommend checking out PHPMailer:

https://code.google.com/a/apache-ext...g/p/phpmailer/

I've used both PHPMailer and Swiftmailer quite a bit, and I'm sold on PHPMailer. Just one single PHP file to include, easily handles HTML messages, attachments, images, pretty much everything. The version hosted at Google is the new revamped version that's actively maintained.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 12:03 PM
Quote:
Originally Posted by Urinal Mint
So a company wants to automate a form-filling task. Currently the forms are filled out by hand (which include the person's email, name, other basic info.) by the costumer, and later a data entry clerk manually types these into an Excel spreadsheet.

The company wants the process to be automated with an iPad, so that the customer can fill out the form and the iPad will automatically enter the data into an Excel spreadsheet.

What is the best way to go about doing this? More specifically, I'm curious whether you would try to make an iOS app and get it into the App Store, or do it through the company's mobile site, or...?
I don't have a ton of experience with these things but I'd almost certainly go with a mobile site instead of getting stuff into the App Store.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 12:42 PM
I would just store the state of the newsletter queue in redis. That gives you a good balance of performance and safety.

Once the queue is empty or has entries that were undeliverable due to a bad e-mail address then you can store things at a slower pace in your persistent db with any relevant info to your service.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 02:27 PM
Quote:
Originally Posted by jjshabado
I don't have a ton of experience with these things but I'd almost certainly go with a mobile site instead of getting stuff into the App Store.
Yep. Use jqmobi (or similar) and make a browser based app
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 02:39 PM
sup, hopefully one of you has done an android app before

im stuck, im trying to do my own custom action bar at the top (which has logo, and search bar), which i have done. But i need a bottom action bar which has buttons for like, home, my account, advanced search etc. But i dont want to use "android:uiOptions="splitActionBarWhenNarrow". Is there anyway of doing this?

Do i need to put the bottom action bar in every activity xml or is there an easy way to do it like ive done for the top action bar?

im a noob with android

ty
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 07:34 PM
Someone with way too much time on their hands...

traceroute -m 100 216.81.59.173
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 08:49 PM
Thanks. Is it standard / possible to take input and put it into an Excel spreadsheet?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 09:31 PM
Quote:
Originally Posted by Urinal Mint
Thanks. Is it standard / possible to take input and put it into an Excel spreadsheet?
I just did this with a Ruby gem the other day, was very easy
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-10-2013 , 09:54 PM
Awesome. I don't think it would be much more than putting such and such input into its corresponding column.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-11-2013 , 05:39 AM
Quote:
Originally Posted by n00b590
I want to bookmark it, but fml.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-11-2013 , 01:12 PM
I wish one of those coursera or edx classes covered database design. Given a database already set up, I know how to query what I want, but I have a hard time designing the tables from scratch.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-11-2013 , 02:59 PM
The stanford db class covers database design / normalization: http://class2go.stanford.edu/db/Winter2013
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-11-2013 , 03:28 PM
relatively interesting. Bill Gates does an AMA

http://www.reddit.com/r/IAmA/comment...melinda_gates/
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-11-2013 , 03:28 PM
Install went well, decided to go for a LVM joining the two SSD. I'm using the HDD for backup and have the swap partition on it and also the browser cache.
Never changed the scheduler before but did that for the SSDs as well.

Obviously I'm dumb and borked /etc/fstab on the first go sure no problem boot a liveCD, mount and edit..gg.
Except that it's a LVM and I have no clue how to do that gj,ge...thankfully I had my netbook around and could google it.

Now installing Win7 in the VM, Only 101 updates on the first go. Nice that's nice. I think the Ubuntu had more but then again you're not sweating every second because your box will have a trojan by default if you're not fast enough.

I have no clue if my elaborate swap and cache setup will work out or not. Wait and see I guess.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-11-2013 , 03:34 PM
My mind is officially blown. Virtual box has support for multi-monitors where the second monitor is launched in a new VBox window with its own size control. Couple that in with discovering seamless mode and it's the holy grail for development.

Seamless mode removes all of the window borders and desktop background so it just looks like you're running apps natively in your host OS except with the style of the guest OS's shell.

Now I can finally develop with 2 monitors in peace and have a browser open in the guest so I can use browser extensions that auto-reload on certain file changes to have live feedback.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m