Thursday, May 12, 2011

jQuery Tree Traversal Performance Testing

The other day on Twitter I was wondering if anyone had compared the performance on jQuery's Tree Traversal functions as often you are able to locate an element more than one way and are faced with a choice. I put this together on jsPerf, the tests are all similar, if you could run it on your browser that would be wonderful, so we can compare. 


If you have any suggestions on how to make these tests more accurate that would be better, I tried to make them all similar, this is my first experience with jsPerf. 


Screen shot 2011-05-12 at 6.57.03 PM


 


EDIT: changed some of the tests to make sure they are doing the same thing, thanks Rick!


http://jsperf.com/jquery-tree-traversing/4



Friday, April 22, 2011

This Seat's Empty

Empty Seat


 


If you haven't already, listen to "This Developer's Life." When it came out last year it quickly jumped to the top of my favorite podcasts list along with "Herding Code" and "Science Friday." Rob Conery started it, and now he and Scott Hanselman sit and weave stories shared by other developers in a riveting way accompanied by music and brief glimpses into their own lives. The real value of the series is the production and the way it captures your imagination and emotion as you journey into the lives of other developers.


Rob and I are Skype pals, and a little while after the show started he came to me with a proposition. He had been having trouble finding ladies to be on the show. Being that I am a woman (I don't know if you knew that, I try not to advertise it), he thought I would have better luck finding some who would share their stories. He and Scott both feel powerfully that bringing out female rolemodels in this industry is one of the first steps toward closing the gender gap in software development.


I jumped at the chance to work with these awesome guys and be part of something that I admire. Rob and Scott bought me a whole setup (seen above) to interview folks with and mailed it to New York. It took me forever to figure out how to set it up, but as you can tell we now have a great podcasting room at New Work City (where I work), someone even soundproofed the walls.


I know a lot of kickass women programmers here in New York, so I sent out some emails right away. I sent out 13 emails. I emailed women I have great respect for, most of them have been in this field much longer than I (or are way more qualified), and work in positions that come with much respect. They have built amazing things, and work with incredible people. These, every one of them, are stories that need to be heard. If you lined them up next to the men that have been on "This Developer's Life" thus far they would be exactly on par.


From all but one of the emails I got the exact same reply: "I'm sorry, I just don't feel like I'm at the point in my career that I'm ready to talk about it publicly yet."


The one person that I got a "yes" from is Danielle Banks, she is a great student that is teaching herself how to be a developer. She's in the process of learning, and she was brave enough to come forward and share her experience with others. She was also the only one on the list that didn't have an established career in development (but will someday, believe me. You can hear her story here.)


I don't really understand what is happening here. Possibly, it's something that someone can explain. This is an extremely popular podcast and people all over the world are listening to it. Girls all over the world are listening to it. They are learning that there truely are no women in software, the statistics are right, they will have to break this ground alone if it is something they want to pursue.


It may be that these particular ladies don't like me that much, or they don't want to be around me for more than an hour, or there is some other reason they don't want to do this. It can be really scary sharing a story that you know people are judging you on, especially in this field where we're all competing to inject the most "Well actually...."s. However, I know there is a woman (are women) in the tri-state NYC metro area that want to sit and talk to me about this great industry and their experiences. I will buy you dinner, I will make you coffee, and I promise I will make you laugh at least once.


If this is you, or you know this woman please email me (contact link above). I would really appreciate you joining me in bringing some XX chromosomes to the airwaves. 


Also, suggestions on how to go abou this in a better way would be welcomed. It's possible I'm using the wrong approach by cold emailing, and I would like to be better at this. 



Sunday, March 20, 2011

You're not going to land dates at a hackathon

I, if you don't already know, am a huge fan of alternative ways of getting women into this amazingly exciting field. I had a great lunch the other day with a woman named Elena Silonok, she's pretty much what I want to be when I grow out of my eight colored hair and little kid hands. Not only is she beautiful, but she's brilliant and making the world a better place. Meeting women like her gets me all inspired again and reminds me why I do this in the first place (besides, you know, loving it).



I got this article sent to me in a DM from my friend Amrit Richmond (dropping names like it's my job). I appreciate the attempt by Fast Company to get ladies interested in hackathons, lord knows that we can use it. In the past, even I have expressed the overwhelming abundance of hot guys in software development. However, I need to clear up, that a hackathon is the last place you want to go if you are looking for developers that share your love of ST:TNG (don't judge me, I didn't grow up on the original).



Breadpig

This is a picture of me from the last hackathon I did. Breadpig had an awesome event where we all got to play with legos overnight, and our legos battled each other in the morning. Wait, what, you can't see me you say? Oh, well that's because at this point my eyes are pretty red, my hair looked like something the cat threw up, and to be honest I probably wasn't smelling all that great either. See, I had just been working on this dang little feisty robot for 12 hours in a row. From 7pm to pretty much 7 in the morning. I showed up dead serious, and ready to work.



If you try to show up at one of these things all "heeeeeey, I'm here for the drinks and the small talk" no one will want to work with you. No one else is there to meet people (especially the guys, if they are there to meet anyone it's other guys, or they are extremely illogical in nature). They will smell it on you if you are, and no one wants dead weight on their team.



Why go to a hackathon if you are just going to get smelly and gross and you aren't able to make guys take your Myers-Briggs to see if you're compatible? I can only tell my story. About 3am at the Breadpig Hackathon I took a look up from my laptop to see a bunch of girls that weren't competing talking and giggling with some guys in the corner (this is not a knock on giggling girls, I have been one a few times in my life). I then looked around to see my friend Alexis (and my new friend Danielle) working on their bots, and a whole bunch of guys around them cranking away at theirs. I was super proud and in my mind I said "We're fucking awesome."



That's why you go to a hackathon, for the pride that you can hang, and to be happy in what you built. Now, go forth! Build cool shit! Tell people about it!




Wednesday, January 5, 2011

Using JQuery AJAX Calls in a Chrome Plugin

Chrome really fights cross site scripting like the plague, whether you are building a plugin or not. Some of us love the simplicity of the JQuery AJAX functions and want to use them in our content scripts instead of the ugly XMLHttpRequests. If you throw one in, you will get a "Origin https://mail.google.com is not allowed by Access-Control-Allow-Origin" error.Use the code below to enable $.post, $.get, $.ajax, and $.post. 



In your background page, include the following JS. What this is doing is adding a listener for the partiular functions (you specify which in your request), and funneling the request through your jquery libarary (notice, we add it in the beginning). 



 








Then to the top of your content scripts, add these functions that work as proxies:




_getJSON = function(url, callback) {
console.log("calling JSON");
chrome.extension.sendRequest({action:'getJSON',url:url}, callback);
}
_ajax = function(url, callback, type, async) {
console.log("calling ajax");
chrome.extension.sendRequest({action:'ajax',url:url, type:type, async:async}, callback);
}

_get = function(url, callback) {
console.log("sending get");
chrome.extension.sendRequest({action:'get',url:url}, callback);
}

_post = function(url, data, callback) {
console.log("sending post");
chrome.extension.sendRequest({action:'post', data: data, url:url}, callback);
}



 



If you would like more of the functionality from the functions, you need to pass them from your content script. Add them as parameters in the proxy functions. 



That's it, enjoy plugin development!




Thursday, November 18, 2010

Your Idea Isn't Good Enough

I've been hesitant to write this post for a while. I'm a true idealist, and I know that the littlest bit of discouragement can hurt a dream. However, this has been a long time coming, I'm going to try and do it with kid gloves. 



A good idea is not enough. I know no one has thought of a way to network single nurses to doctors who want to have affairs and large payrolls (if you know what I mean). Yes, you are the first one who came up with the concept of sharing only children's birthday parties on a network of school aged children that enjoy horseback riding. While all your friends wouldn't shut up about the new twitter API changes, you were home working on your business plan for the SMS driven app that links construction workers standing on corners with guys in pickup trucks and questionable ethics. None of these things have been done, you are a genius, bravo. 

I can't tell you the horrors I've seen of people getting ripped off playing the start up game. I am not going to bore you with stories about developers who were in the midst of deploying apps they worked months on only to go unpaid and never rewarded. I don't know if it is the Facebook movie, or the amount of capital getting thrown around the market, but every developer I know is getting bombarded with opportunity. I can't tell you the golden ratio of making a Gmail Killer. I can tell you what I've seen, and how best to avoid becoming a roadkill on the superhighway. Buckle up.


The person that will be your CTO for mostly sweat equity is not someone you want building your application. I now live in a world where "CTO" or "Technical Cofounder" is a fancy way of saying "someone in this relationship is being had." On one end you have a person that is investing all the money that they got from selling their grandmother's minivan in a single person that is telling them they are a developing machine that is going to bring them from zero to Mashable with $10,000. On the other hand you have a founder who has happened upon a recent grad who wants to prove themselves, and will work 90 hour weeks until it's obvious to everyone involved that they are in over their heads. 


Founders, the odds are against you that you've found the perfect person to create your app. The developer that is qualified to build an app from the ground up is not running around tech events handing out business cards. They are working for funded companies that respect their knowledge and education enough to give them a full team of people support them.


Developers, someone with a marketing and PR background doesn't know anything about managing a software project. They have no concept of what goes into it, and what is neccessary to make it successful. They don't care that you're architecting, or iterating, or writing unit tests. They want to click the button and see the magic, anything else is overhead and costly. 


 


The developer that tells you "no" is the one you should believe. There is no incentive for us to say "no" or "not possible" or "this will take a very long time" besides saving both of us a lot of headache. The easiest way for me to get you to part with your hard earned cash is to say "This is a fabulous idea! It should take me 6-8 weeks. I will need half up front." If a developer telling you it's a bad idea, or it will take longer than you think,  it's because they are being honest. In all likelyhood they've done this a few times, and they don't want you to get burned. If you are hearing this, instead of moving on to the next developer ask for some feedback on how to make it more feasible. We'd love to tell you. 


No individual is going to have your best interest in mind. Except your mom, and I don't think that's who we're talking about here. The odds of you finding the perfect person to build your empire in this market are akin to your odds of being hit by lighting, at a Tumblr party, while checking into Foursquare. Sometimes there is magic, sometimes there are sparks, but remember what you are asking this person to do. We don't come to your job and say things like "I think it would be great if you could create this ad campaign for 10% of your usual price. If it makes me money I will share it with you! If not, eeeh, at least we tried." or "Can you give me these implants for free? If I make it as a huge Hollywood celebrity I will give you 40% of my royalties and 9% of my groupies." No, we respect what you do and ask you to do the same. 


 


There are teams of people that build applications from the ground up and that's all they do. You need to find them, vet them, talk to the people they've made happy, and pay them to do what they have done many times. Maybe you will hire a firm, maybe you will find a proven, experienced developer and give them the resources to do so. They are used to talking to people with no tech background, holding their hands through the process, and giving them quality products. Check their previous projects, talk to former clients. If you don't have the money to pay a team to build your application, you don't have an application. Maybe you need to cut some features and be realistic about your budget. Maybe you need to start hitting the streets and talking to VCs. Maybe the nest egg you have would be better invested elsewhere. 


 I hope I haven't burst any bubbles, I am not here to tell you not to follow your dreams (both founder and developer). I just think there is a real void in communication here, and a lot of people getting burned. If you want to make your vision a reality don't let anything stop you, just educate yourself on what is out there, and make sure your feet are firmly planted in soil. 


 


Oh yeah, and try to get one of those domains that are a real word but have the dot in a funny place. Like port.ly or stalk.me. I hear those are cool now. 



Friday, October 8, 2010

About Sara

Techcrunch


Sara is a developer living in NYC specializing in web applications with a focus on JavaScript and Startups. In her spare time she Wrangles Nerds. 


She likes speaking to and meeting with diverse groups from the Girl Scouts to straight up code junkies. Her goal is to inspire more females to see that being a developer is fun and glamorous.


She is best reached via email, twitter, or on her cell at (862) 201-3065


Current Projects:


Girl Develop It


Add Blocker


Elizabeth & Clarke


New Work City


This Developers Life



Monday, October 4, 2010

The Girls are Back In Town

There is something I’ve gotten really excited about lately and it is only just beginning. I’m talking about the new wave of awesome girl tools to hit the web. I’m in the middle of the the biggest petrie dish for startups in the world, New York City (oh yeah, I moved, I love it!). I’ve been watching new ones pop up monthly, companies like FashismBirchbox  and ToVieFor. Conceived by girls, run by girls, built for a mostly female demographic .


My life's dream knocked me full in the face when I saw this (omg, that google search made me find this  I <3  you, Microsoft). I was 17 years old and I knew exactly what I wanted to do with the rest of my life: be a part of the community that creates applications like that. However, I learned quickly that apps like that didn’t actually exist. I dreamed of the days when women figured out how to leverage software for their needs and wants. For a long time we’ve had fantasy football apps, miniature train forums, and ways to randomly put your friends into intermural sports teams online. Guys have been doing this for a decade, but now FINALLY, we are tinkering too!


Proud of you, ladies, can’t wait to see what else is in store.