Webkit's Array.sort() is implemented in c++ as selectionsort. For some variety (and a better time complexity in big arrays), I wrote up an implementation of quicksort:
(function(window){
function quicksort(func){| def toBin(s): | |
| # removes space characters, puts each ascii code on a new line | |
| print "\n".join(filter(lambda x:x!="100000",[bin(ord(c))[2:] for c in s])) | |
| if __name__ == "__main__": | |
| s = input("enter a string: \n") | |
| toBin(s) | |
| # or: |
| #!/bin/bash | |
| # author: nbjacob | |
| OUTLINE="===========================================" | |
| echo $OUTLINE | |
| echo $OUTLINE | |
| echo "STARTING AUTO TEST" | |
| for a in ${@}; do | |
| echo "TESTING DIR: $a" | |
| for f in $(ls $a/*.bl); do | |
| # read header of test |
| // App.js | |
| // the main logic of the application. | |
| // this handles pretty much everything that goes on | |
| // author: nickjacob | |
| // generate faux-guid | |
| function S4() { return (((1+Math.random())*0x10000)|0).toString(16).substring(1); }; | |
| function guid() { return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()); }; | |
| // actual app | |
| var Express = require('express') |
| <?php | |
| /** | |
| * Simple File server for php | |
| * this is in response to this: | |
| * http://stackoverflow.com/questions/8792871/using-custom-url-rewrite-in-drupal-for-static-files | |
| * --- | |
| * in the process of using it I found a lot of places to refactor/clean it up, and correct some things | |
| */ | |
| define('CHUNK_SIZE',1048576); |
| /** | |
| * Sometimes you're working with a script hosted on a server that you can't be sure is going to ever return/you don't know when | |
| * this script lets you make calls to the object it is eventually going to add to the window object before it's there. | |
| * this is (probably) very similar to the code behind google analytic's _gaq.push() | |
| */ | |
| (function(watch_list,future_obj,interval){ | |
| var noop = function(){}, _func_ = 'function'; | |
| var __asynch = function(list,obj,intr){ | |
| this.intr=(typeof intr==='number') ? intr : 500;this.loop=null;this.obj = obj; this.calls = [];var self = this; list = list || []; | |
| for(var i=0,l=list.length;i <l;i++) this.calls[i] = list[i]; |
| /*** | |
| * lil' ball | |
| * this isn't even a library. I just realized that I'd been using jQuery *only* because | |
| * I needed an easy way to do ajax. So I finally got my sh** together an just wrote smtng. | |
| * | |
| * author: @nickjacob | |
| ***/ | |
| ;(function(window,undefined){ | |
| window._o_ = window._o_ || {}; |
| /** | |
| * This is my own idea of how I wish all javascript files looked. I don't think it's probably the "best" way (is there a *best* way?), but I like it | |
| * and I think everyone should have some kind of style. | |
| */ | |
| // name the IIFE for debugging/organization if you want to use a concatenation build tool | |
| ;(function this_module(window,undefined){ | |
| var _public = {}, _private = {}; // if only it were real!!! Fun fact -- "public" is reserved! |
| # Lusty Data | |
| # A Computer Orgasm | |
| # @author nickjacob | |
| # | |
| .excitement | |
| movl $1, %eax | |
| .rising | |
| cmpl $0, %eax | |
| je .climax |
| :%s/\s\([_a-z]*\):\s/:\1 => /gi |