This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# regexps found here http://www.seehuhn.de/blog/52 | |
import re | |
parts = [ | |
r'(?P<host>\S+)', # host %h | |
r'\S+', # indent %l (unused) | |
r'(?P<user>\S+)', # user %u | |
r'\[(?P<time>.+)\]', # time %t | |
r'"(?P<request>.+)"', # request "%r" | |
r'(?P<status>[0-9]+)', # status %>s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
#Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
#Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(value_list)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MagCloud upload limit: 300MB | |
Because of buggy Acrobat and/or PDF file, using just PDF Optimizer didn't quite work, here's the workaround: | |
1) Use ColorSync Utility to downsample images to 300 dpi using a custom Quartz filter. Using export in Preview did not show the extra Quartz filters. You have to use ColorSync Utility. | |
2) Flattening transparency is critical to reducing file size. | |
Use PDF Optimizer in Acrobat to do this. | |
However, if you use [High Resolution] some of the fonts get messed up -- The solution is to create a custom transparency flattener modeled after [High Resolution] setting but with the addition of "Convert all text to outlines." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<object id="doc_25915" name="doc_25915" height="1000" width="100%" type="application/x-shockwave-flash" data="http://d1.scribdassets.com/ScribdViewer.swf" style="outline:none;" > <param name="movie" value="http://d1.scribdassets.com/ScribdViewer.swf"> <param name="wmode" value="opaque"> <param name="bgcolor" value="#ffffff"> <param name="allowFullScreen" value="true"> <param name="allowScriptAccess" value="always"> <param name="FlashVars" value="document_id=29210722&access_key=key-7jfj5uhqas5sfdwsi1o&page=1&viewMode=list"> <embed id="doc_25915" name="doc_25915" src="http://d1.scribdassets.com/ScribdViewer.swf?document_id=29210722&access_key=key-7jfj5uhqas5sfdwsi1o&page=1&viewMode=list" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="1000" width="100%" wmode="opaque" bgcolor="#ffffff"></embed> </object> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== Epic Snow Leopard Upgrayyyyd Guide === | |
Son, you’re now living in the land of 64-bit systems. | |
That means that some of your 32-bit shit is now broken. | |
Not all is lost. | |
== Fixing MySQL weirdness |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section_179 = case 1) equip_cost if equip_cost < 250,000 | |
case 2) 250,000 if equip_cost > 250,000 and equip_cost >= 800,000 | |
case 3) 250,000 - (equip_cost - 800,000) if equip_cost > 800,000 and equip_cost < 1050,000 | |
case 4) 0 if equip_cost >= 1050,000 | |
bonus_50%_depreciation = (equip_cost - section_179) * 0.5 | |
regular_depreciation = (equip_cost - section_179 - bonus_50%_depreciation) * 1/7 | |
total_first_year_depreciation = section_179 + bonus_50%_depreciation + regular_depreciation |