Tuesday, March 10, 2015
For shipping jewelry Apps Script is golden
Editor’s Note: Guest author Jason Gordon is a co-founder of Beth Macri Designs — Arun Nagarajan
Beth Macri Designs creates jewelry from the point of view of a structural engineer. The forms are designed using generative 3D software systems and materialized using 3D printing technologies. Our company understands that to make beautiful fine jewelry, 3D printing is only the first step; traditional jewelry craft is then employed for final production. After our first product, The Hidden Message Necklace, was recently featured on The View as part of its Valentines Day Gift Guide, we had a lot of orders to ship out. As soon as the mail leaves the building, though, the process is literally out of our hands: something unexpected was bound to happen to at least one or two packages. Several package-tracking services exist, but getting the names and tracking numbers into them was a cut-and-paste operation.
I knew that all of the tracking numbers were being delivered by email and I had already set up a Gmail filter to archive them and apply a label. With a little help from Google Apps Script, I knew I could automatically parse those emails and add them to my account on PackageTrackr (which syncs to their newer service, Fara).
The script supports reading emails from multiple shipping providers and is set up so one could easily add more. Every 30 minutes on a time-driven trigger, using the Gmail service, the script runs and looks through unread emails from the shipping provider label, then parses the name and tracking number out of each one. The provider, tracking number, and recipient are stored in a JavaScript array.
function getUSPSConversations(){
return GmailApp.search("in:usps is:unread subject:(Click-N-Ship)");
}
function matchUSPSHTML(data){
var out = [];
var track_num = data.match(
/TrackConfirmActionWinput.actionWtLabels=(d+)/g);
var to = data.match(/Shipped.to.*[
]*.*>([a-zA-Zs-_]*)<br>/g);
for(i in track_num){
var o = new Object();
var track = track_num[i].match(/(d+)/g);
var person = to[i].match(/>([a-zA-Zs-_]+)<br>/);
var myPerson = person[1].replace(/(
|
| )/gm,"")
o["number"]=track[0];
o["carrier"]="USPS";
o["person"]=myPerson;
out.push(o);
}
return out;
}
You can parse all of your different shipping providers in one run of the script. After all of the shipment emails are read, it composes an email to PackageTrackr to give it all of the tracking numbers it just harvested.
var user = Session.getActiveUser().getEmail();
if(data.length > 0){
for(d in data){
body += this["formatForPackageTrackr"](data[d]["number"],
data[d]["carrier"], data[d]["person"]);
}
GmailApp.sendEmail("track@packagetrackr.com", "Add Packages",
body, {bcc: user});
}
function formatForPackageTrackr(tracking_num, service, person){
return "#:" + tracking_num + " " + service + " " + person + "
";
}
Down the line, other shipping providers could be added such as UPS and Fedex. Additionally, more tracking services could be added instead of just PackageTrackr.
![]() | Jason Gordon profile Jason Gordon is a co-founder at jewelry startup Beth Macri Designs. He is responsible for software development, logistics and e-commerce. While working at Beth Macri Designs, Jason gets to find creative ways to put his software development skills to work to improve logistics and user experience. |
Tuesday, February 10, 2015
C program to check whether a number is prime or not
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,flag=1;
clrscr(); //to clear the screen
printf("Enter any number:");
scanf("%d",&n);
for(i=2;i<n/2;++i)
if(n%i==0)
{
flag=0;
break;
}
if(flag==1)
printf("
The given number is prime");
else
printf("
The given number is not prime");
getch(); //to stop the screen
}
Friday, January 23, 2015
How to fix VT x is not available
Hai guys now im going to teach how to fix VT-x is not available. When you are installing any x64 bit guest operating system on vmware workstation or virtual box which is installed in x32 bit host operating system it alerts the following errors.
Error message in VMware Workstation
Error message in Virtual Box



I faced these problems while installing xenserver on VMware workstation and i also get ‘VT-x is not available’ while starting the VM. So I decided to get rid of these errors. I have done only one change in BIOS settings that’s it my all problems are solved.
Read the below points carefully to fix your errors. To have a clear idea i’m explaining some basic terminology.
Virtualization : Virtualization is nothing but installing and running the multiple operating systems in a single physical system simultaneously is called as virtualization.
Server Virtualization : Simply we can say installing and running the multiple servers in a single physical system simultaneously is known as server virtualization.
Examples of Virtualization Softwares :
2) Vmware esx or Vmware esxi
3) Hyper-V.
4) VirtualBox.
5) Vmware Workstation.
6) Virtual PC.
Note 3 : If your system contains virtualization technology go to bios settings and enable it.
Guest os : Guest os means which is installing on virtual box. Guest os is also called VM (Virtual Machine).
Host os : Host os means our main or base operating system.
Procedure to enable VT in BIOS:

Check Your Antivirus Is Working Or Not


