Salman Akhtar, Immigration and Identity (1999)

Akhtar_Immigration_and_Identity_1999Salman Akhtar, Immigration and Identity (1999)

Akhtar gives a surface level overview of immigration specific psycho-analytical therapy. The core of Identity problems for immigrants lies in the cultural and social separation and individuation process, that causes responses of loss and idealization, depending if the immigration occurred voluntary or was forced. The psychological response should be one of rapprochement.

Akhtar in general does a very nice job in sketching the main issues in immigration psychology. He oversteps his own rule of cultural neutrality only where he feels compelled to distinguish between western and eastern culture. Notibly, Akhtar is of eastern descend, so it’s no surprise he characterizes the eastern psyche as a mind of heart and love, while describing the western mind as the mind of time and money. This distinction is not only obviously placing Akhtar in the position of patient instead of analyst, but is also so blatant that it instantly makes one doubt his analytical capacity. In the end, I choose to oversee this pillar of his therapeutical theory, because the rest of his book is fairly solid, although not particularly shocking in insight.

His insertions of his own poetry are a little bit unprofessional, but that too I can oversee and find in a childish way entertaining, though by all means, they have no place in an academic publication, and I would have to disqualify the book as being a non-scientific work for those last two criticisms. Still, it will offer any immigrant a few basic insights into the psychology of immigration, and is an entertaining work.

Cordova: Install or Update Cordova on Windows with Visual Studio

To install Apache Cordova on Windows and to use it with Visual Studio 2010 Express for Windows Phone, follow these steps:

  1. Get the source code for the latest version from the Cordova project page or for older versions go to the Cordova distribution archive.
  2. Unzip the source archive cordova-3.4.0-src.zip.
    C:/>unzip cordova-3.4.0-src.zip
  3. Locate the file cordova-wp8.zip in the extracted directory, and unzip the archive.
    C:/>cd cordova-3.4.0
    C:/cordova-3.4.0>unzip cordova-wp8.zip
  4. Change directory to cordova-wp8 and run the createTemplates.bat script.
    C:/cordova-3.4.0>cd cordova-wp8
    C:/cordova-3.4.0/cordova-wp8>createTemplates.bat
  5. Copy the generated template files CordovaWP7_3_4_0.zip and CordovaWP8_3_4_0.zip to the Visual Studio Templates directory in the users My Documents folder ~/Document
    s\Visual Studio 2010\Templates\ProjectTemplates.
    C:\cordova-3.4.0\cordova-wp8>copy CordovaWP8_3_4_0.zip "C:\Users\user1\Document
    s\Visual Studio 2010\Templates\ProjectTemplates"

Now, start Visual Studio 2010 Express for Windows Phone, and in the File menu, select New Project…. In the Installed Templates select the Cordova template you just copied.

To add Cordova plugins on Windows with Visual Studio, go here.

Cordova: adding camera plugin to wp7 in Visual Studio Express on Windows 7 Pro

To see how to install Cordova on Windows with Visual Studio, go here.

After you created the Cordova app using the generated Template in Visual Studio, you must use the plugman package instead of the cordova tool to install plugins. If you didn’t install plugman, first install plugman using npm.
>npm install -g plugman

To add the plugin camera use the following code inside the root of the solution.
C:\>cd \dev\mobile\CordovaWP7_3_4_0_App1
C:\dev\mobile\CordovaWP7_3_4_0_App1>plugman install --platform wp7 --project CordovaWP7_3_4_0_App1 --plugin org.apache.cordova.camera
Fetching plugin "org.apache.cordova.camera" via plugin registry
Starting installation of "org.apache.cordova.camera" for wp7
Preparing wp7 project
org.apache.cordova.camera installed on wp7.

Faces (51)

With a pair of black, fleece ear warmers clipped onto his ears, closely fitting around his small head, his shiny, black haired skull topped by a wool, camel, flat cap, his large, falling nose mounted by metal rimmed, aviator glasses and his face colored by a dark brown, Indian tan, and the collar of his winter jacket pulled up high around his neck against the icy cold, the man appeared diminished to a suppressed, reprieved expression.

Cordova: submit multipart form with additional parameters

With the Cordova plugin File-Transfer you can submit a multipart form with additional parameters. To read an image file as a binary string, you can use the HTML5 FileReader syntax from the File API by using the Cordova plugin File.

For instance, the following example uses Idol On Demand‘s APIs to analyze images for barcodes.

Add the required plugins.
$cordova plugin add org.apache.cordova.console
$cordova plugin add org.apache.cordova.file
$cordova plugin add org.apache.cordova.file-transfer

This is the code to submit a multipart form in Cordova. Note that the additional parameters are added to the form by using the options.params property with an associative array of parameters.

var formURL = "https://api.idolondemand.com/1/api/sync/readbarcode/v1";
var encodedURI = encodeURI(formURL);
// add additional parameters 'file' and 'apikey' to the multipart form
var options = new FileUploadOptions();
options.fileKey = "file";
// strip the filename from the full path
options.fileName = fileURI.substr(fileURI.lastIndexOf('/') + 1);
var imgData = readFileAsBinaryString(fileURI);
options.params = { 'apikey': apikey, 'file': imgData };
// create the FileTransfer object
var ft = new FileTransfer();
// submit the multipart form
ft.upload(fileURI, encodedURI, fnOnSuccess, fnOnError, options, false);

The readFileAsBinaryString(file) is implemented like this:

function readFileAsBinaryString(file) {
 console.log("readFileAsBinaryString(: "+file+")");
 var reader = new FileReader();
 reader.onloadend = function(e) {
  console.log("Successfully read file as binary string");
  var imgData = e.target.result;
  return imgData;
 };
 reader.onerror = function(e) {
  console.log("Error while reading file as binary string: "+e.target.error.code);
 };
 reader.readAsBinaryString(file);
}

Drupal: Cross-Linking Custom Content-Types via Custom Fields using Entity API and Field API

Scenario: a book where pages have multiple subpages as tabs, e.g. a Drupal Book content-type with documentation of RESTful API Resources, where each API Resource Book page is linked to multiple Code Example content-types, ordered in a tabbed page with one Code Example per language tab.

drupal_crosslinks_entity_reference

Drupal 7 and 8 has a set of abstraction layers, abstracting nodes to Entity Type, Bundle, and Field. A Node is an Entity Type, just like Taxonomy, Comment or User, or Book, Article, Blog Post etc. An Entity is an implementation instance of an Entity Type. An Entity Type is defined in a Bundle that has a collection of Fields.

Create a new ‘Entity Type’ named ‘Code Example’. Install the Entity Reference module. On the Book page, click Manage Fields, add a Field to the Book page Entity Type of type Entity Reference with multiple selections. Create a few Code Examples for the Book page node. On the instance or node of the Book page, select the Entity References of type Code Examples.

Create a Taxonomy with a hierarchy of coding languages. In the Code Example entity type, click Manage Fields and add a field based on the coding languages taxonomy. The tabs in the Book page will be labeled by code language, e.g. Java, JavaScript, Objective-C, etc.

Then, to use JQuery UI.tabs we can create a tabular page with Code Examples per language, crosslinked to entities or nodes of type Book Page.

<?php
drupal_add_library('system', 'ui.tabs');
drupal_add_js('jQuery(document).ready(function(){jQuery("#codeexamples-tabs").tabs();});', 'inline');
?>
<div id="codeexamples-tabs">
<?php
$node = menu_get_object();
if($node){
 $field = field_get_items('node', $node, 'field_codeexampleentityreference');
 if($field){
  $listtabs = '<ul>';
  $tabcontents = '';
  foreach ($field as $codeexampleentityreference)
  {
    $nid = $codeexampleentityreference['target_id'];
    $tabname = $nid;
    $codeexample = node_load($nid);
    $codeexample_output = node_view($codeexample);
    $field2 = field_get_items('node', $codeexample, 'field_language');
    if($field2){
     $tabname = $field2[0]["taxonomy_term"]->name;
    }
    $listtabs = $listtabs . '<li><a href="#codeexamples-tab-'.$nid.'">'.$tabname.'</a></li>';
    $tabcontents = $tabcontents . '<div id="codeexamples-tab-'.$nid.'">'.render($codeexample_output).'</div>';
   }
   $listtabs = $listtabs.'</ul>';
   print $listtabs;
   print $tabcontents;
  }
 }
?>
</div><!-- /.codeexamples-tabs -->