This file contains hidden or 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
class dotdictify(dict): | |
marker = object() | |
def __init__(self, value=None): | |
if value is None: | |
pass | |
elif isinstance(value, dict): | |
for key in value: | |
self.__setitem__(key, value[key]) | |
else: | |
raise TypeError, 'expected dict' |
This file contains hidden or 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
// Collecting all unique affected app version for a given data set | |
var jsonStats = [ | |
{app_versions: ['1.2','1.2.3']}, | |
{app_versions: null}, | |
{app_versions: ['1.2','1.3']} | |
]; | |
var app_versions = _.uniq(_.flatten(_.compact(_.map(jsonStats, function(day){return day.app_versions })))); | |
// ["1.2", "1.2.3", "1.3"] | |
// Bye bye stupid for loops! |
This file contains hidden or 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
// test showing the map on website | |
function doGet() { | |
//var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('locations'); | |
var sheet = SpreadsheetApp.openById('0AmcViZZV0aRjdEZ0amxsQ2NERmthRWx6aF9MVlgyUHc').getSheetByName('locations'); | |
// Read out the data for my locations | |
var locations = sheet.getRange(2, 1, sheet.getLastRow() - 1, 3).getValues(); | |
This file contains hidden or 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
var db = ScriptDb.getMyDb(); | |
// ===== This script will post the data to itself and we can have another gs file to trigger posting another copy of the data =========== | |
// The idea is to post a payload with id and data | |
// var payload = {'id': id, | |
// 'data': data | |
// } | |
// data will be computed from RowUtilities | |
function readSpreadsheetAsJson(){ |
This file contains hidden or 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
public class SomeFragment extends Fragment { | |
MapView mapView; | |
GoogleMap map; | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View v = inflater.inflate(R.layout.some_layout, container, false); | |
This file contains hidden or 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
public TypeAdapterFactory getPipelineFactory() { | |
return getPipelineFactory(this); | |
} | |
private static PipelineFactory PIPELINE_FACTORY; | |
public static PipelineFactory getPipelineFactory(Context context) { | |
if (PIPELINE_FACTORY == null) { | |
PIPELINE_FACTORY = new PipelineFactory(context); | |
} | |
return PIPELINE_FACTORY; |
This file contains hidden or 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
*.aux | |
*.glo | |
*.idx | |
*.log | |
*.toc | |
*.ist | |
*.acn | |
*.acr | |
*.alg | |
*.bbl |
This file contains hidden or 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
curl http://packages.ubuntu.com/quantal/all/texlive-fonts-recommended/filelist | sed -En 's!/usr/share/texlive/texmf-dist/fonts/tfm/.*/([^/]+)/[^/]+\.tfm$!\1!p' |
This file contains hidden or 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
public void unrequestAllData2(DataListener listener){ | |
Map<IJsonObject,List<DataRequestInfo>> changedEntrySet = new HashMap<IJsonObject, List<DataRequestInfo>>(); | |
synchronized (dataRequests) { | |
for (Entry<IJsonObject,List<DataRequestInfo>> entry : dataRequests.entrySet()) { | |
IJsonObject probeConfig = entry.getKey(); | |
List<DataRequestInfo> dataRequestInfos = entry.getValue(); | |
This file contains hidden or 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
def get_loc_data(self): | |
return [x for x in self.numeric_lst if x[9] == 0] | |
def get_sit_data(self): | |
return [x for x in self.numeric_lst if x[9] == 1] | |
def get_bluetooth_data(self): | |
return [x for x in self.numeric_lst if x[9] == 2] | |
def get_location(self, idx): | |
return self.name_map['loc'][idx] |
NewerOlder