Hackers or Criminals

In response to the most excellent writer Nick Bilton of NY Times and his splendid though cautious article here

Please consider these points

  •  jail breaking phones was once illegal , then became legal, and now is questionable again. Rooting your Android tablet is now frowned upon. The question is how do you teach the next generation of hackers to explore hardware and software and yet respect laws in their own self interest. Exploring means pushing the boundaries of what can be done and what can not be done. Inter racial marriage was illegal too, once.
  • what damage have hackers caused to society in past 5 years  (lost revenues in Digital content) versus what benefits have they brought about ( Arab Spring catalyst)
  • Consider the past history of hackers who turned entrepreneurs because they didn’t go to jail and were mentored into diverting their energy to startups that created jobs.

No hackers, bam, no Apple, no Microsoft, no Google, and yes no Facebook because the founders would be too busy in a court of law.Probably not much NASA, DARPA or NSA given that almost everyone tests the limits of exploration in young age.

  • Consider the historic legality of protests as done by Gandhi, Martin Luther King , and the legal treatment of hacker activists recently. Civic rights in 60s and cyber rights in the 2010s. Do they have something in common?
  • Is law enforcement adequately trained to understand hacking , and what steps are being done for enhancing cyber law training and jurisprudence. I don’t think the cyber law enforcement is adequately manned with resources. When law enforcement is denied resources, it takes short cuts and questionable tactics including intimidation and making examples of people.

My father , a decorated police officer , always said that , if you are not a part of the solution, you are part of the problem.As a technical writer , I sometimes know how to solve technical problems but these laws create fear in the minds of future problem solvers.

  • Who is a hacker. Who is a criminal .Is a hacker ~= a criminal or Is a hacker == a criminal ?

Lets get some common sense back in the game before we turn more kids int rebels without a cause, or without a case.

(continued from the series)

 

Data Frame in Python

Exploring some Python Packages and R packages to move /work with both Python and R without melting your brain or exceeding your project deadline

—————————————

If you liked the data.frame structure in R, you have some way to work with them at a faster processing speed in Python.

Here are three packages that enable you to do so-

(1) pydataframe http://code.google.com/p/pydataframe/

An implemention of an almost R like DataFrame object. (install via Pypi/Pip: “pip install pydataframe”)

Usage:

        u = DataFrame( { "Field1": [1, 2, 3],
                        "Field2": ['abc', 'def', 'hgi']},
                        optional:
                         ['Field1', 'Field2']
                         ["rowOne", "rowTwo", "thirdRow"])

A DataFrame is basically a table with rows and columns.

Columns are named, rows are numbered (but can be named) and can be easily selected and calculated upon. Internally, columns are stored as 1d numpy arrays. If you set row names, they’re converted into a dictionary for fast access. There is a rich subselection/slicing API, see help(DataFrame.get_item) (it also works for setting values). Please note that any slice get’s you another DataFrame, to access individual entries use get_row(), get_column(), get_value().

DataFrames also understand basic arithmetic and you can either add (multiply,…) a constant value, or another DataFrame of the same size / with the same column names, like this:

#multiply every value in ColumnA that is smaller than 5 by 6.
my_df[my_df[:,'ColumnA'] < 5, 'ColumnA'] *= 6

#you always need to specify both row and column selectors, use : to mean everything
my_df[:, 'ColumnB'] = my_df[:,'ColumnA'] + my_df[:, 'ColumnC']

#let's take every row that starts with Shu in ColumnA and replace it with a new list (comprehension)
select = my_df.where(lambda row: row['ColumnA'].startswith('Shu'))
my_df[select, 'ColumnA'] = [row['ColumnA'].replace('Shu', 'Sha') for row in my_df[select,:].iter_rows()]

Dataframes talk directly to R via rpy2 (rpy2 is not a prerequiste for the library!)

 

(2) pandas http://pandas.pydata.org/

Library Highlights

  • A fast and efficient DataFrame object for data manipulation with integrated indexing;
  • Tools for reading and writing data between in-memory data structures and different formats: CSV and text files, Microsoft Excel, SQL databases, and the fast HDF5 format;
  • Intelligent data alignment and integrated handling of missing data: gain automatic label-based alignment in computations and easily manipulate messy data into an orderly form;
  • Flexible reshaping and pivoting of data sets;
  • Intelligent label-based slicing, fancy indexing, and subsetting of large data sets;
  • Columns can be inserted and deleted from data structures for size mutability;
  • Aggregating or transforming data with a powerful group by engine allowing split-apply-combine operations on data sets;
  • High performance merging and joining of data sets;
  • Hierarchical axis indexing provides an intuitive way of working with high-dimensional data in a lower-dimensional data structure;
  • Time series-functionality: date range generation and frequency conversion, moving window statistics, moving window linear regressions, date shifting and lagging. Even create domain-specific time offsets and join time series without losing data;
  • The library has been ruthlessly optimized for performance, with critical code paths compiled to C;
  • Python with pandas is in use in a wide variety of academic and commercial domains, including Finance, Neuroscience, Economics, Statistics, Advertising, Web Analytics, and more.

Why not R?

First of all, we love open source R! It is the most widely-used open source environment for statistical modeling and graphics, and it provided some early inspiration for pandas features. R users will be pleased to find this library adopts some of the best concepts of R, like the foundational DataFrame (one user familiar with R has described pandas as “R data.frame on steroids”). But pandas also seeks to solve some frustrations common to R users:

  • R has barebones data alignment and indexing functionality, leaving much work to the user. pandas makes it easy and intuitive to work with messy, irregularly indexed data, like time series data. pandas also provides rich tools, like hierarchical indexing, not found in R;
  • R is not well-suited to general purpose programming and system development. pandas enables you to do large-scale data processing seamlessly when developing your production applications;
  • Hybrid systems connecting R to a low-productivity systems language like Java, C++, or C# suffer from significantly reduced agility and maintainability, and you’re still stuck developing the system components in a low-productivity language;
  • The “copyleft” GPL license of R can create concerns for commercial software vendors who want to distribute R with their software under another license. Python and pandas use more permissive licenses.

(3) datamatrix http://pypi.python.org/pypi/datamatrix/0.8

datamatrix 0.8

A Pythonic implementation of R’s data.frame structure.

Latest Version: 0.9

This module allows access to comma- or other delimiter separated files as if they were tables, using a dictionary-like syntax. DataMatrix objects can be manipulated, rows and columns added and removed, or even transposed

—————————————————————–

Modeling in Python

Continue reading

Can Microsoft buy Facebook

At $39.23 Billion , Facebook is now cheaper than what Steve Ballmer was prepared to pay for Yahoo (when Yahoo CEO Jerry Yang famously turned him down). Can Microsoft buy Facebook? or Can Apple buy Facebook?

Both would be okay from an anti trust perspective- and both have the cash. Note you need only to buy 51% of shares for controlling and Mark Zuckerberg seems a bit down (never mind Sean Parker’s voting arrangement).

Can Google plunk 20% of FB for 8 billion – less than they paid for Motorola, so they can sell Ads there while FB concentrates on thee social aspects.

FB has innovated with good UI, apps, cassandra,the like button, the FB connect network, and of course socially targeted ads. I dont think it’s stock price deserves to be dog with fleas.

See http://finance.yahoo.com/q?s=FB

Where is a good leveraged buy out (LBO) or hedge fund when you need one?

But, Seriously.