Posts

android - Replacing GCMBaseIntentService with GoogleCloudMessaging -

i new android development , had switch first project eclipse android studio finding library gcmbaseintentservice no longer supported. found googlecloudmessaging, not @ evident how port implementation got tutorial http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/ here listed, that. may help? this piece of code need replace: package com.example.taxiprofessional; import android.app.notification; import android.app.notificationmanager; import android.app.pendingintent; import android.content.context; import android.content.intent; import android.util.log; import com.google.android.gcm.gcmbaseintentservice; import static com.example.taxiprofessional.commonutilities.sender_id; import static com.example.taxiprofessional.commonutilities.displaymessage; public class gcmintentservice extends gcmbaseintentservice { private static final string tag = "gcmintentservice"; public gcmintentservice() { super(...

Unable to understand the error in a simple CUDA function -

recently started learning cuda. here simple code printing kernel. #include"cuprintf.cu" #include"cuprintf.cuh" #include<cuda.h> #include<stdio.h> __global__ void cuprint() { cuprintf("he he, printing here"); } main() { cuprint<<<1,1>>>cuprint(); } cuprintf.cu , cuprintf.cuh downloaded , kept in directory wrote program. getting following error. cuprint.cu(11): error: expected "(" cuprint.cu(13): error: expected declaration can 1 tell me why getting errors. you calling wrong way, should call cuprint<<<1,1>>>(); , according page: https://code.google.com/p/stanford-cs193g-sp2010/wiki/tutorialhelloworld need add more functions (for init() , stuff)), can not confirm because have no cuda pc here)

php - Entity metadata wrapper -

i'm getting error metadata wrapper. have field test => entity reference multiple selection list.i following error entitymetadatawrapperexception : invalid data value given. sure matches required data type , format. $account = entity_load_single('user', $user->uid); $acc_wrapper = entity_metadata_wrapper('user', $account); $list = $acc_wrapper->test->value(); $exists = false; if (!empty($list)) { foreach ($list $item) { if ($item->nid == $form_state['storage']['node']->nid) { $exists = true; break; } } } if (!$exists) { if (!$list) { $list = array(); $list[] = $form_state['storage']['node']->nid; } $acc_wrapper->test->set($list); $acc_wrapper->save(); 1rst quick tips $account = entity_load_single('user', $user->uid); $acc_wrapper = entity_metadata_wrapper('user', $account); you don't need load ent...

jquery - How to remove matching height of two divs javascript for small devices -

i've 2 divs named "a" , "b". height of both div isn't fixed. , want "b" same height "a" gets. so, put script this: setheight($('.a'), $('.b')); function setheight(elem1, elem2) { var height = elem1.height() elem2.css('height', height); } but small devices, don't want same height. so, i've put which not working : $(window).on(resize, function() { if ($(window).width() > 768) { setheight($('.a'), $('.b')); } else { elem2.css('height', 'auto'); } }); what's right script it? my fiidle work as others mentioned missing ' s around resize elem2 undefined in function. you need use pointer element: $(window).on('resize', function() { if ($(window).width() > 768) { setheight($('.a'), $('.b')); } else { $('.b').css('height', 'auto'...

javascript - angular data binding with passed params -

furthering project having hiccup databinding. the change in data not getting reflected on dom i've constructor function inside js function/object. constructor: function() { var self = this; var navigation = angular.module("navigation", []); navigation.controller("productidscontroller", function($scope) { $scope.productids = self.productids; }); angular.bootstrap(document.getelementbyid('navigation'), ['navigation']); } and product id's defined on same level productids: ["abc", "xyz", "test"], //dom gets populated array via angular init: function(productids) { console.log(this.productids); // displays ["abc", "xyz", "test"] this.productids.push("another item"); //this didn't work on dom either this.productids = productids; //i changed productid's passing array console.log(this.productids); //the array got cha...

java - Is it possible to monitor (detect, keep track etc) basic types of I/O activity inside the JVM? -

is there api or library allows user create kind of report actions performed program running inside jvm instance? mean jvm/system calls interception further classification according type of activity, example, diskwrite , diskread , networkwrite , networkread , wait (is activity?) , on. detecting periods of intensive cpu usage etc. useful too. if amount of writing native code required, detailed answers covering topic appreciated well. use sigar api hyperic . provides memory, cpu, disk, load-average, network interface info , metrics, process table information, route info, etc. and staff under apache license, version 2.0.

c++ - Use all available memory on iPad -

i'm trying make app uses available memory on ipad intentionally bog down can test few other things when there limited memory. currently i'm using code works, xcode stops me short error can't allocate region. (stops me @ 1.4/4 gb.) while(1) { void *m = malloc(1024*1024); memset(m,0,1024*1024); } i want use memory can, , hold onto memory until stop. there better way go this? try use mmap map_locked