Search Results

Search found 19 results on 1 pages for 'soumya simanta'.

Page 1/1 | 1 

  • Python service using Upstart on Ubuntu

    - by Soumya Simanta
    I want to create to deploy a heartbeat service (a python script) as a service using Upstart. My understanding is that I've to add a /etc/init/myheartbeatservice.conf with the following contents. # my heartbeat service description "Heartbeat monitor" start on startup stop on shutdown script exec /path/to/my/python/script.py end script My script starts another service process and the monitors the processes and sends heartbeat to an outside server regularly. Are startup and shutdown the correct events ? Also my script create a new thread. I'm assuming I also need to add fork daemon to my conf file? Thanks.

    Read the article

  • How to connect Empathy to facebook

    - by Simanta Das
    I am a new user of Ubuntu and I want to connect empathy internet messaging with Facebook. So when I select Facebook from the list given in Online Accounts a window opens up for me to authorize access and a url opens saying: Success SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone. Although after this nothing happens... When I open the messenger nothing comes up and in Online Accounts it still asks: Please authorize Ubuntu to access your Facebook account... but I have already given permission... Please help me out. Thanks in advance.

    Read the article

  • Difference between ps output and top output?

    - by Soumya Prasad Ukil
    I find it difficult to understand the output produced by ps and top? This is the output by top: PID PSID USERNAME TID PRI NICE SIZE RES STATE TIME CPU COMMAND 26439 23712 soumyau 26439 15 0 7512M 5234M sleep 286:25 16.67% or_lse2 (18) 26523 23712 soumyau 26439 -2 0 7512M 5234M cpu9 143:10 8.33% or_lse2 26522 23712 soumyau 26439 -2 0 7512M 5234M cpu3 143:10 8.33% or_lse2 This is by ps (ps -L -p 26439 -o pcpu,psr,pid,user,tid): %CPU PSR PID USER TID 99.9 3 26439 soumyau 26522 99.9 9 26439 soumyau 26523 0.0 8 26439 soumyau 26439 Why are there differences in two result? Can you briefly explain the significance of the two CPU% ?

    Read the article

  • Android 2.1 GoogleMaps ItemizedOverlay ConcurrentModificationException

    - by Soumya Simanta
    Hi, I cannot figure out the origin of the ConcurrentModificationException. In my activity I'm calling updateMapOverlay(). I'm also calling updateMapOverlay() inside another Thread (a TimerTask) that is invoked on regular intervals. I'm taking the appropriate locks when invoking updateMapOverlay() from both the threads. Is this problem being caused because I'm invoking updateMapOverlay from inside a non-UI thread (i.e., TimerTask). Has anyone else faced a similar issue ? private void updateMapOverlay() { this.itemizedOverlay.refreshItems(createOverlayItemsList()); List<Overlay> overlays = mapView.getOverlays(); overlays.clear(); overlays.add(cotItemizedOverlay); this.mapview.invalidate(); } Thanks. Exception: W/dalvikvm(10641): threadid=3: thread exiting with uncaught exception (group=0x4001b180) E/AndroidRuntime(10641): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime(10641): java.util.ConcurrentModificationException E/AndroidRuntime(10641): at java.util.AbstractList$SimpleListIterator.next(AbstractList.java:64) E/AndroidRuntime(10641): at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:41) E/AndroidRuntime(10641): at com.google.android.maps.MapView.onDraw(MapView.java:494) E/AndroidRuntime(10641): at android.view.View.draw(View.java:6535) E/AndroidRuntime(10641): at android.view.ViewGroup.drawChild(ViewGroup.java:1531) E/AndroidRuntime(10641): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(10641): at android.view.ViewGroup.drawChild(ViewGroup.java:1529) E/AndroidRuntime(10641): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(10641): at android.view.View.draw(View.java:6538) E/AndroidRuntime(10641): at android.widget.FrameLayout.draw(FrameLayout.java:352) E/AndroidRuntime(10641): at android.view.ViewGroup.drawChild(ViewGroup.java:1531) E/AndroidRuntime(10641): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(10641): at android.view.ViewGroup.drawChild(ViewGroup.java:1529) E/AndroidRuntime(10641): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(10641): at android.view.View.draw(View.java:6538) E/AndroidRuntime(10641): at android.widget.FrameLayout.draw(FrameLayout.java:352) E/AndroidRuntime(10641): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830) E/AndroidRuntime(10641): at android.view.ViewRoot.draw(ViewRoot.java:1349) E/AndroidRuntime(10641): at android.view.ViewRoot.performTraversals(ViewRoot.java:1114) E/AndroidRuntime(10641): at android.view.ViewRoot.handleMessage(ViewRoot.java:1633) E/AndroidRuntime(10641): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(10641): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime(10641): at android.app.ActivityThread.main(ActivityThread.java:4363) E/AndroidRuntime(10641): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(10641): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime(10641): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) E/AndroidRuntime(10641): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) E/AndroidRuntime(10641): at dalvik.system.NativeStart.main(Native Method) I/Process ( 95): Sending signal. PID: 10641 SIG: 3

    Read the article

  • Building OpenSSL on Android NDK

    - by Soumya Simanta
    Hi, I want to use DTLS (on OpenSSL) using JNI on Android 2.1/2.2. Can someone help me get started (tutorials, howto, pointers etc) with building OpenSSL for Android (2.1/2.2) using the Android NDK? Anything important that I should be aware of before doing it. Thanks.

    Read the article

  • Dynamic Overlays slowing down Google Maps (Android 2.1) on Nexus One

    - by Soumya Simanta
    Hi, I'm trying to create a dynamic ItemizedOverylay (please see the code below) on Google Maps (Android 2.1) on a Nexus One. In my Activity (that extends MapActivity) I'm creating a data thread that is receiving data from the network. A 'handler' is used to communicate the data from the receiving thread to map activity. This data contains the locations (lat, lon) of the markers that I want to overlay on my map. The location of each marker is dynamic (i.e., it changes every time I receive new data from the network.) refreshItems(ArrayList<OverlayItem> newItems) method in invoked inside the handleMessage() of the handler. There are around 11 markers in the ArrayList that is passed to refreshItems I can see the markers overlayed on the map. However, I've two issues: The old markers are not removed from the map. After a while I see a trail of markers. The map doesn't respond to any touch commands. I cannot move the map or zoom in or zoom out. After a while I see a system warning that my app is not responding message. Any idea what's wrong here ? Thanks. public class MyItemizedOverlay extends ItemizedOverlay { private ArrayList<OverlayItem> overlayItems; public CoTItemizedOverlay(Drawable defaultMarker) { super(boundCenter(defaultMarker)); overlayItems = new ArrayList<OverlayItem>(); populate(); } public void addNewItem(GeoPoint location, String markerText, String snippet) { overlayItems.add(new OverlayItem(location, markerText, snippet)); populate(); } public void removeItem(int index) { overlayItems.remove(index); populate(); } public void refreshItems(ArrayList<OverlayItem> newItems) { // remove all existing items for (int i = 0; i < cotoverlayItems.size(); i++) { overlayItems.remove(i); } // copy all the times if (newItems != null && cotoverlayItems.size() == 0) { overlayItems.addAll(newItems); } populate(); } @Override protected OverlayItem createItem(int index) { return overlayItems.get(index); } @Override public int size() { return overlayItems.size(); } }

    Read the article

  • Android Multiple Handlers Design Question

    - by Soumya Simanta
    This question is related to an existing question I asked. I though I'll ask a new question instead of replying back to the other question. Cannot "comment" on my previous question because of a word limit. Marc wrote - I've more than one Handlers in an Activity." Why? If you do not want a complicated handleMessage() method, then use post() (on Handler or View) to break the logic up into individual Runnables. Multiple Handlers makes me nervous. I'm new to Android. Is having multiple handlers in a single activity a bad design ? I'm new to Android. My question is - is having multiple handlers in a single activity a bad design ? Here is the sketch of my current implementation. I've a mapActivity that creates a data thread (a UDP socket that listens for data). My first handler is responsible for sending data from the data thread to the activity. On the map I've a bunch of "dynamic" markers that are refreshed frequently. Some of these markers are video markers i.e., if the user clicks a video marker, I add a ViewView that extends a android.opengl.GLSurfaceView to my map activity and display video on this new vide. I use my second handler to send information about the marker that the user tapped on ItemizedOverlay onTap(int index) method. The user can close the video view by tapping on the video view. I use my third handler for this. I would appreciate if people can tell me what's wrong with this approach and suggest better ways to implement this. Thanks.

    Read the article

  • Android 2.1: Muliple Handlers in a Single Activity

    - by Soumya Simanta
    Hi, I've more than one Handlers in an Activity. I create all the handlers in the onCreate() of the main activity. My understanding is the handlerMessage() method of each handler will never be called at the same time because all messages are put in the same queue (the Activity thread MessageQueue). Therefore, they will be executed in the order in which are put into the Queue. They will also be executed in the main activity thread. Is this correct ? public void onCreate() { this.handler1 = new Handler() { @Override public void handleMessage(Message msg) { //operation 1 : some operation with instanceVariable1 super.handleMessage(msg); } }; this.handler2 = new Handler() { @Override public void handleMessage(Message msg) { //Operation 2: some operation with instanceVariable1 super.handleMessage(msg); } }; this.handler3 = new Handler() { @Override public void handleMessage(Message msg) { //Operation 3: some operation with instanceVariable1 super.handleMessage(msg); } }; }

    Read the article

  • Java URL("file://") doesn't work on Windows XP

    - by Soumya Simanta
    For some reason the following code doesn't work on Windows XP. new URL("file://" + tempfile.getAbsolutePath()); I'm using Java 1.6. Java(TM) SE Runtime Environment (build 1.6.0_31-b05) Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing) However, the same code just works fine in OS X (Lion) and Java 1.6 java version "1.6.0_29" Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527) Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode) Linux (Linux 2.6.32-38-generic #83-Ubuntu x86_64 GNU/Linux) with Java 1.6 java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03) Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode) Based on this the above code should work.

    Read the article

  • XML/SOAP attributes for a complextype in kSOAP

    - by Soumya
    Hi, I'm trying to parse a SOAP response that contains nested ComplexTypes using the kSOAP library on Android 2.1. <event att1="value1" att2="value2" att3="value3"> <tag2> ... </tag2> <tag3> ... </tag3> </event> I've implemented my own class Event that implements org.ksoap2.serialization.KvmSerializable to parse this response. It is not clear to me if and how I can parse the attributes (att1, att2 and att3) of the event node. Is it even possible with the current kSOAP implementation? Thanks.

    Read the article

  • Creating a dynamic (video) Overlay on Google Maps on Android 2.1

    - by Soumya
    I'm trying to create a map overlay for displaying a video stream (MJPEG) on top of a Mapview. Currently I've a standalone activity that creates a data thread for fetching MJPEG video frames. I'm using a handler to send a frame (as a Bitmap) from the data thread to the main activity which then updates the UI. I'm not sure how I can implement "refresh" for updating my "overlayed" video stream. EDIT: What I mean by "refresh" is - how can I update the video portion (not the mapview) of my UI whenever I get a new video frame. I plan to paint the video frame (bitmap) in the "draw method" of my implementation of the Overlay subclass. But the "draw" method is not invoked by me directly. Thanks.

    Read the article

  • Transferring data from 2d Dynamic array in C to CUDA and back

    - by Soumya
    I have a dynamically declared 2D array in my C program, the contents of which I want to transfer to a CUDA kernel for further processing. Once processed, I want to populate the dynamically declared 2D array in my C code with the CUDA processed data. I am able to do this with static 2D C arrays but not with dynamically declared C arrays. Any inputs would be welcome! I mean the dynamic array of dynamic arrays. The test code that I have written is as below. #include "cuda_runtime.h" #include "device_launch_parameters.h" #include <stdio.h> #include <conio.h> #include <math.h> #include <stdlib.h> const int nItt = 10; const int nP = 5; __device__ int d_nItt = 10; __device__ int d_nP = 5; __global__ void arr_chk(float *d_x_k, float *d_w_k, int row_num) { int index = (blockIdx.x * blockDim.x) + threadIdx.x; int index1 = (row_num * d_nP) + index; if ( (index1 >= row_num * d_nP) && (index1 < ((row_num +1)*d_nP))) //Modifying only one row data pertaining to one particular iteration { d_x_k[index1] = row_num * d_nP; d_w_k[index1] = index; } } float **mat_create2(int r, int c) { float **dynamicArray; dynamicArray = (float **) malloc (sizeof (float)*r); for(int i=0; i<r; i++) { dynamicArray[i] = (float *) malloc (sizeof (float)*c); for(int j= 0; j<c;j++) { dynamicArray[i][j] = 0; } } return dynamicArray; } /* Freeing memory - here only number of rows are passed*/ void cleanup2d(float **mat_arr, int x) { int i; for(i=0; i<x; i++) { free(mat_arr[i]); } free(mat_arr); } int main() { //float w_k[nItt][nP]; //Static array declaration - works! //float x_k[nItt][nP]; // if I uncomment this dynamic declaration and comment the static one, it does not work..... float **w_k = mat_create2(nItt,nP); float **x_k = mat_create2(nItt,nP); float *d_w_k, *d_x_k; // Device variables for w_k and x_k int nblocks, blocksize, nthreads; for(int i=0;i<nItt;i++) { for(int j=0;j<nP;j++) { x_k[i][j] = (nP*i); w_k[i][j] = j; } } for(int i=0;i<nItt;i++) { for(int j=0;j<nP;j++) { printf("x_k[%d][%d] = %f\t",i,j,x_k[i][j]); printf("w_k[%d][%d] = %f\n",i,j,w_k[i][j]); } } int size1 = nItt * nP * sizeof(float); printf("\nThe array size in memory bytes is: %d\n",size1); cudaMalloc( (void**)&d_x_k, size1 ); cudaMalloc( (void**)&d_w_k, size1 ); if((nP*nItt)<32) { blocksize = nP*nItt; nblocks = 1; } else { blocksize = 32; // Defines the number of threads running per block. Taken equal to warp size nthreads = blocksize; nblocks = ceil(float(nP*nItt) / nthreads); // Calculated total number of blocks thus required } for(int i = 0; i< nItt; i++) { cudaMemcpy( d_x_k, x_k, size1,cudaMemcpyHostToDevice ); //copy of x_k to device cudaMemcpy( d_w_k, w_k, size1,cudaMemcpyHostToDevice ); //copy of w_k to device arr_chk<<<nblocks, blocksize>>>(d_x_k,d_w_k,i); cudaMemcpy( x_k, d_x_k, size1, cudaMemcpyDeviceToHost ); cudaMemcpy( w_k, d_w_k, size1, cudaMemcpyDeviceToHost ); } printf("\nVerification after return from gpu\n"); for(int i = 0; i<nItt; i++) { for(int j=0;j<nP;j++) { printf("x_k[%d][%d] = %f\t",i,j,x_k[i][j]); printf("w_k[%d][%d] = %f\n",i,j,w_k[i][j]); } } cudaFree( d_x_k ); cudaFree( d_w_k ); cleanup2d(x_k,nItt); cleanup2d(w_k,nItt); getch(); return 0;

    Read the article

  • Permalink Ajax Issue Wordpress

    - by Soumya
    function AjaxRequest(section,divName) { var pageurl = fullPath+"/ajaxrequest.php?section="+section+"&divName="+divName; //alert(pageurl); var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById(divName).innerHTML=''; document.getElementById(divName).innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET",pageurl,true); xmlhttp.send(); } I have a Code like that in wordpress which is calling a page using ajax. It is working fine when the page are coming in ID like ?page_id=37 but stop working when I am activating Permalink like /overview/ajaxpage. I am getting 404 pafe error on xmlhttp.readyState. Can any one help me to solve it. I know its a permalink Problem probably this code of ajax is not sufficient for transmuting Permalink.

    Read the article

  • how to group data in a list

    - by prince23
    I need to group data of a list in c# ex: i have a data like this in a list c# i have a class called information.cs with these properties name,school, parent ex data name school parent kumar fes All manju fes kumar anu frank kumar anitha jss All rohit frank manju anill vijaya manju vani jss kumar soumya jss kumar madhu jss rohit shiva jss rohit vanitha jss anitha anu jss anitha now taking this as an input i wanted the output to be formated with a Hierarchical data when parent is all means it is the topmost level kumar fes All. what i need to do here is i need to create an object[0] and then check in list whether kumar exists as a parent in the list if it exista then add those items as under the object[0] as a parent i need to create one more oject under **manju fes kumar anu frank kumar** what i wanted do here is iterate through the list anD then check the parent level based on name school parent kumar fes All -->obj[0] manju fes kumar -->obj1[0] anu frank kumar -->obj1[1] for obj1-- obj[0] will be parent like this i need to genarte a list or observation class anitha jss All-->obj[1] vanitha jss anitha -->obj1[0] anu jss vanitha -->obj2[0] here obj2[0]--obj1[0]--obj[1] will be an parent like this i need to create a list or an observationclass hope my Question is clear what i am trying ask you people. i wanted to know how i can create an observationclass. any help would be really great. hope my question is clear

    Read the article

  • how to group data in a list c#

    - by prince23
    hi, i need to group data of a list in c# ex: i have a data like this in a list c# i have a class called information.cs with these properties name,school, parent ex data name school parent kumar fes All manju fes kumar anu frank kumar anitha jss All rohit frank manju anill vijaya manju vani jss kumar soumya jss kumar madhu jss rohit shiva jss rohit vanitha jss anitha anu jss anitha now taking this as an input i wanted the output to be formated with a Hierarchical data when parent is all means it is the topmost level kumar fes All. what i need to do here is i need to create an object[0] and then check in list whether kumar exists as a parent in the list if it exista then add those items as under the object[0] as a parent i need to create one more oject under **manju fes kumar anu frank kumar** what i wanted do here is iterate through the list anD then check the parent level based on name school parent kumar fes All -->obj[0] manju fes kumar -->obj1[0] anu frank kumar -->obj1[1] for obj1-- obj[0] will be parent like this i need to genarte a list or observation class anitha jss All-->obj[1] vanitha jss anitha -->obj1[0] anu jss vanitha -->obj2[0] here obj2[0]--obj1[0]--obj[1] will be an parent like this i need to create a list or an observationclass hope my Question is clear what i am trying ask you people. i wanted to know how i can create an observationclass any help would be really great thanks prince hope my question is clear

    Read the article

  • issue in ObservableCollection

    - by prince23
    hi, i have an lsit with these data i have a class called information.cs with these properties name,school, parent ex data name school parent kumar fes All manju fes kumar anu frank kumar anitha jss All rohit frank manju anill vijaya manju vani jss kumar soumya jss kumar madhu jss rohit shiva jss rohit vanitha jss anitha anu jss anitha now taking this as an input i wanted the output to be formated with a Hierarchical data when parent is all means it is the topmost level kumar fes All. what i need to do here is i need to create an object[0] and then check in list whether kumar exists as a parent in the list if it exista then add those items as under the object[0] as a parent i need to create one more oject under **manju fes kumar anu frank kumar** if you see this class file its shows how data is formatted. public class SampleProjectData { public static ObservableCollection GetSampleData() { DateTime dtS = DateTime.Now; ObservableCollection<Product> teams = new ObservableCollection<Product>(); teams.Add(new Product() { PDName = "Product1", OverallStartTime = dtS, OverallEndTime = dtS + TimeSpan.FromDays(3), }); Project emp = new Project() { PName = "Project1", OverallStartTime = dtS + TimeSpan.FromDays(1), OverallEndTime = dtS + TimeSpan.FromDays(6) }; emp.Tasks.Add(new Task() { StartTime = dtS, EndTime = dtS + TimeSpan.FromDays(2), TaskName = "John's Task 3" }); emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(3), EndTime = dtS + TimeSpan.FromDays(4), TaskName = "John's Task 2" }); teams[0].Projects.Add(emp); } return teams; }

    Read the article

  • convert the output into an list

    - by prince23
    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Linq.Expressions; using System.Xml.XPath; using System.Xml.Linq; namespace SampleProgram1 { class Program { static void Main(string[] args) { string xml = @"<people> <person><name>kumar</name><school>fes</school><parent>All</parent></person> <person><name>manju</name><school>fes</school><parent>kumar</parent></person> <person><name>anu</name><school>frank</school><parent>kumar</parent></person> <person><name>anitha</name><school>jss</school><parent>All</parent></person> <person><name>rohit</name><school>frank</school><parent>manju</parent></person> <person><name>anill</name><school>vijaya</school><parent>manju</parent></person> <person><name>vani</name><school>jss</school><parent>kumar</parent></person> <person><name>soumya</name><school>jss</school><parent>kumar</parent></person> <person><name>madhu</name><school>jss</school><parent>rohit</parent></person> <person><name>shiva</name><school>jss</school><parent>rohit</parent></person> <person><name>vanitha</name><school>jss</school><parent>anitha</parent></person> <person><name>anu</name><school>jss</school><parent>anitha</parent></person> </people>"; XDocument document = XDocument.Parse(xml); var people = (from person in document.Descendants("person") select new Person { Name = (string)person.Element("name"), School = (string)person.Element("school"), Parent = (string)person.Element("parent") }).ToList(); var parents = people.Where(p => p.Parent == "All"); Action<Person> findChildren = null; findChildren = person => { List<Person> children = people.Where(p => p.Parent == person.Name).ToList(); person.Children = children; foreach (Person p in children) findChildren(p); }; foreach (Person parent in parents) { findChildren(parent); } Action<Person, int> showChildren = null; showChildren = (person, tabs) => { //Console.WriteLine(new string('\t', tabs) + person.Name); if (person.Children != null) { foreach (Person p in person.Children) showChildren(p, tabs + 1); } }; foreach (Person parent in parents) { showChildren(parent, 0); } // Console.Read(); } } class Person { public string Name { get; set; } public string School { get; set; } public string Parent { get; set; } public List<Person> Children { get; set; } } } this my program where i need to put the output into a list an dthen bind the lsit into gridview can any one help me out in syntax achiveing this one. i am using c# 3.5

    Read the article

1