Search Results

Search found 185 results on 8 pages for 'mohit deshpande'.

Page 3/8 | < Previous Page | 1 2 3 4 5 6 7 8  | Next Page >

  • 'object' undeclared <first use in this function>

    - by Mohit Deshpande
    I am using Winchain to develop on my Windows 7 machine. Here is my code: iPhoneTest.h #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface iPhoneTest : UIApplication { UITextView *textview; UIView *mainView; } @end iPhoneTest.m #import "iPhoneTest.h" #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import <CoreFoundation/CoreFoundation.h> @implementation iPhoneTest -(void)applicationDidFinishLaunching:(id)unused { UIWindow *window; struct CGRect rect = [UIHardware fullScreenApplicationContentRect]; rect.origin.x = rect.origin.y = 0.0f; window = [[UIWindow alloc] initWithContentRect: rect]; mainView = [[UIView alloc] initWithFrame: rect]; textView = [[UITextView alloc] init]; [textView setEditable:YES]; [textView setTextSize:14]; [window orderFront: self]; [window makeKey: self]; [window _setHidden: NO]; [window setContentView: mainView]; [mainView addSubview:textView]; [textView setText:@"Hello World"]; } @end main.m #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "iPhoneTest.h" int main(int argc, char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; int ret = UIApplicationMain(argc, argv, [iPhoneTest class]); [pool release]; return ret; } Makefile INFOPLIST_FILE=Info.plist SOURCES=\ main.m \ iPhoneTest.m CC=/usr/local/bin/arm-apple-darwin-gcc CFLAGS=-g -O2 -Wall LD=$(CC) LDFLAGS=-lobjc -framework CoreFoundation -framework Foundation -framework UIKit -framework LayerKit PRODUCT_NAME=iPhoneTest SRCROOT=/iphone-apps/iPhoneTest WRAPPER_NAME=$(PRODUCT_NAME).app EXECUTABLE_NAME=$(PRODUCT_NAME) SOURCES_ABS=$(addprefix $(SRCROOT)/,$(SOURCES)) INFOPLIST_ABS=$(addprefix $(SRCROOT)/,$(INFOPLIST_FILE)) OBJECTS=\ $(patsubst %.c,%.o,$(filter %.c,$(SOURCES))) \ $(patsubst %.cc,%.o,$(filter %.cc,$(SOURCES))) \ $(patsubst %.cpp,%.o,$(filter %.cpp,$(SOURCES))) \ $(patsubst %.m,%.o,$(filter %.m,$(SOURCES))) \ $(patsubst %.mm,%.o,$(filter %.mm,$(SOURCES))) OBJECTS_ABS=$(addprefix $(CONFIGURATION_TEMP_DIR)/,$(OBJECTS)) APP_ABS=$(BUILT_PRODUCTS_DIR)/$(WRAPPER_NAME) PRODUCT_ABS=$(APP_ABS)/$(EXECUTABLE_NAME) all: $(PRODUCT_ABS) $(PRODUCT_ABS): $(APP_ABS) $(OBJECTS_ABS) $(LD) $(LDFLAGS) -o $(PRODUCT_ABS) $(OBJECTS_ABS) $(APP_ABS): $(INFOPLIST_ABS) mkdir -p $(APP_ABS) cp $(INFOPLIST_ABS) $(APP_ABS)/ $(CONFIGURATION_TEMP_DIR)/%.o: $(SRCROOT)/%.m mkdir -p $(dir $@) $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ clean: echo rm -f $(OBJECTS_ABS) echo rm -rf $(APP_ABS) When I try to compile it with make, I get iPhoneTest.m: In fucntion '-[iPhoneTest applicationDidFinishLaunching:]' iPhoneTest.m:15: error: 'testView' undeclared <first use in this function> iPhoneTest.m:15: error: <Each undeclared identifier is reported only once for each function it appears in> Can anyone spot the problem?

    Read the article

  • Direct invocation vs indirect invocation in C

    - by Mohit Deshpande
    I am new to C and I was reading about how pointers "point" to the address of another variable. So I have tried indirect invocation and direct invocation and received the same results (as any C/C++ developer could have predicted). This is what I did: int cost; int *cost_ptr; int main() { cost_ptr = &cost; //assign pointer to cost cost = 100; //intialize cost with a value printf("\nDirect Access: %d", cost); cost = 0; //reset the value *cost_ptr = 100; printf("\nIndirect Access: %d", *cost_ptr); //some code here return 0; //1 } So I am wondering if indirect invocation with pointers has any advantages over direct invocation or vice-versa. Some advantages/disadvantages could include speed, amount of memory consumed performing the operation (most likely the same but I just wanted to put that out there), safeness (like dangling pointers) , good programming practice, etc. 1Funny thing, I am using the GNU C Compiler (gcc) and it still compiles without the return statement and everything is as expected. Maybe because the C++ compiler will automatically insert the return statement if you forget.

    Read the article

  • Fixed footer not displaying the bottom-most list item

    - by Mohit Deshpande
    Here is my XML layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> </ListView> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentBottom="true"> <EditText xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1" /> <Button xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="2" /> </LinearLayout> </RelativeLayout> Which causes this problem: The listview item (outlined in red) is behind the fixed footer and cannot be used. Any solutions?

    Read the article

  • Create Silverlight application in Blend then migrate to Visual Studio

    - by Mohit Deshpande
    I want to make a Silverlight application in Expression Blend because of the rich UI and navigation of Blend. But I want to store the Silverlight application in an ASP.NET MVC web project. When I try to make a new Silverlight application, the default web application is an ASP.NET Web application (or web site, if I'm wrong). Can I make a single Silverlight application (no web project) then import in an ASP.NET MVC application? How can I do this?

    Read the article

  • Persist changes in C

    - by Mohit Deshpande
    I am developing a database-like application that stores a a structure containing: struct Dictionary { char *key; char *value; struct Dictionary *next; }; As you can see, I am using a linked list to store information. But the problem begins when the user exits out of the program. I want the information to be stored somewhere. So I was thinking of storing the linked list in a permanent or temporary file using fopen, then, when the user starts the program, retrieve the linked list. Here is the method that prints the linked list to the console: void PrintList() { int count = 0; struct Dictionary *current; current = head; if (current == NULL) { printf("\nThe list is empty!"); return; } printf(" Key \t Value\n"); printf(" ======== \t ========\n"); while (current != NULL) { count++; printf("%d. %s \t %s\n", count, current->key, current->value); current = current->next; } } So I am thinking of modifying this method to print the information through fprintf instead of printf and then the program would just get the infomation from the file. Could someone help me on how I can read and write to this file? What kind of file should it be, temporary or regular? How should I format the file (like I was thinking of just having the key first, then the value, then a newline character)?

    Read the article

  • Problem with list activity

    - by vikram deshpande
    I have implmented pagination and it display 5 records per page. Now suppose I am on page 3 and click 3'rd element then 3'rd element of page-1 is selected. I am not able to figure out problem as I always create new list object while setting data. I used below code temp = new ArrayList(); this.someListAdapter = new SomeListAdapter(this, R.layout.row_facet,temp); setListAdapter(this.someListAdapter ); Below is signature of SomeListAdapter class. public class SomeListAdapter extends ArrayAdapter<VoNeighborhood> { } Please help....

    Read the article

  • Finding intersection of two spheres

    - by Onkar Deshpande
    Hi, Consider the following problem - I am given 2 links of length L0 and L1. P0 is the point that the first link starts at and P1 is the point that I want the end of second link to be at in 3-D space. I am supposed to write a function that should take in these 3-D points (P0 and P1) as inputs and should find all configurations of the links that put the second link's end point at P1. My understanding of how to go about it is - Each link L0 and L1 will create a sphere S0 and S1 around itself. I should find out the intersection of those two spheres (which will be a circle) and print all points that are on the circumference of that circle. I saw gmatt's first reply on the http://stackoverflow.com/questions/1406375/finding-intersection-points-between-3-spheres but could not understand it properly since the images did not show up. I also saw a formula for finding out the intersection at mathworld[dot]wolfram[dot]com/Sphere-SphereIntersection[dot]html . I could find the radius of intersection by the method given on mathworld. Also I can find the center of that circle and then use the parametric equation of circle to find the points. The only doubt that I have is will this method work for the points P0 and P1 mentioned above ? Please comment and let me know your thoughts.

    Read the article

  • Enter Password in C

    - by Mohit Deshpande
    I am aware that it is not possible to echo the * while you type in standard ANSI C. But is there a way to display nothing while someone is typing their password in the console. What I mean is like the sudo prompts in a Unix/Linux terminal. Like if you type in the command: sudo cp /etc/somefile ~/somedir. You are usually prompted for the root password. And while you type it in, the terminal displays nothing. Is this effect possible in C? If it is, how?

    Read the article

  • Representing robot's elbow angle in 3-D

    - by Onkar Deshpande
    I am given coordinates of two points in 3-D viz. shoulder point and object point(to which I am supposed to reach). I am also given the length from my shoulder-to-elbow arm and the length of my forearm. I am trying to solve for the unknown position(the position of the joint elbow). I am using cosine rule to find out the elbow angle. Here is my code - #include <stdio.h> #include <math.h> #include <stdlib.h> struct point { double x, y, z; }; struct angles { double clock_wise; double counter_clock_wise; }; double max(double a, double b) { return (a > b) ? a : b; } /* * Check if the combination can make a triangle by considering the fact that sum * of any two sides of a triangle is greater than the remaining side. The * overlapping condition of links is handled separately in main(). */ int valid_triangle(struct point p0, double l0, struct point p1, double l1) { double dist = sqrt(pow((fabs(p1.z - p0.z)), 2) + pow((fabs(p1.y - p0.y)), 2) + pow((fabs(p1.x - p0.x)), 2)); if((max(dist, l0) == dist) && max(dist, l1) == dist) { return (dist < (l0 + l1)); } else if((max(dist, l0) == l0) && (max(l0, l1) == l0)) { return (l0 < (dist + l1)); } else { return (l1 < (dist + l0)); } } /* * Cosine rule is used to find the elbow angle. Positive value indicates a * counter clockwise angle while negative value indicates a clockwise angle. * Since this problem has at max 2 solutions for any given position of P0 and * P1, I am returning a structure of angles which can be used to consider angles * from both direction viz. clockwise-negative and counter-clockwise-positive */ void return_config(struct point p0, double l0, struct point p1, double l1, struct angles *a) { double dist = sqrt(pow((fabs(p1.z - p0.z)), 2) + pow((fabs(p1.y - p0.y)), 2) + pow((fabs(p1.x - p0.x)), 2)); double degrees = (double) acos((l0 * l0 + l1 * l1 - dist * dist) / (2 * l0 * l1)) * (180.0f / 3.1415f); a->clock_wise = -degrees; a->counter_clock_wise = degrees; } int main() { struct point p0, p1; struct angles a; p0.x = 15, p0.y = 4, p0.z = 0; p1.x = 20, p1.y = 4, p1.z = 0; double l0 = 5, l1 = 8; if(valid_triangle(p0, l0, p1, l1)) { printf("Three lengths can make a valid configuration \n"); return_config(p0, l0, p1, l1, &a); printf("Angle of the elbow point (clockwise) = %lf, (counter clockwise) = %lf \n", a.clock_wise, a.counter_clock_wise); } else { double dist = sqrt(pow((fabs(p1.z - p0.z)), 2) + pow((fabs(p1.y - p0.y)), 2) + pow((fabs(p1.x - p0.x)), 2)); if((dist <= (l0 + l1)) && (dist > l0)) { a.clock_wise = -180.0f; a.counter_clock_wise = 180.0f; printf("Angle of the elbow point (clockwise) = %lf, (counter clockwise) = %lf \n", a.clock_wise, a.counter_clock_wise); } else if((dist <= fabs(l0 - l1)) && (dist < l0)){ a.clock_wise = -0.0f; a.counter_clock_wise = 0.0f; printf("Angle of the elbow point (clockwise) = %lf, (counter clockwise) = %lf \n", a.clock_wise, a.counter_clock_wise); } else printf("Given combination cannot make a valid configuration\n"); } return 0; } However, this solution makes sense only in 2-D. Because clockwise and counter-clockwise are meaningless without an axis and direction of rotation. Returning only an angle is technically correct but it leaves a lot of work for the client of this function to use the result in meaningful way. How can I make the changes to get the axis and direction of rotation ? Also, I want to know how many possible solution could be there for this problem. Please let me know your thoughts ! Any help is highly appreciated ...

    Read the article

  • Program execution stop at scanf???

    - by Mohit Deshpande
    main.c (with all the headers like stdio, stdlib, etc): int main() { int input; while(1) { printf("\n"); printf("\n1. Add new node"); printf("\n2. Delete existing node"); printf("\n3. Print all data"); printf("\n4. Exit"); printf("Enter your option -> "); scanf("%d", &input); string key = ""; string tempKey = ""; string tempValue = ""; Node newNode; Node temp; switch (input) { case 1: printf("\nEnter a key: "); scanf("%s", tempKey); printf("\nEnter a value: "); scanf("%s", tempValue); //execution ternimates here newNode.key = tempKey; newNode.value = tempValue; AddNode(newNode); break; case 2: printf("\nEnter the key of the node: "); scanf("%s", key); temp = GetNode(key); DeleteNode(temp); break; case 3: printf("\n"); PrintAllNodes(); break; case 4: exit(0); break; default: printf("\nWrong option chosen!\n"); break; } } return 0; } storage.h: #ifndef DATABASEIO_H_ #define DATABASEIO_H_ //typedefs typedef char *string; /* * main struct with key, value, * and pointer to next struct * Also typedefs Node and NodePtr */ typedef struct Node { string key; string value; struct Node *next; } Node, *NodePtr; //Function Prototypes void AddNode(Node node); void DeleteNode(Node node); Node GetNode(string key); void PrintAllNodes(); #endif /* DATABASEIO_H_ */ I am using Eclipse CDT, and when I enter 1, then I enter a key. Then the console says . I used gdb and got this error: Program received signal SIGSEGV, Segmentation fault. 0x00177024 in _IO_vfscanf () from /lib/tls/i686/cmov/libc.so.6 Any ideas why?

    Read the article

  • Iterate through main function in C?

    - by Mohit Deshpande
    Here is my main function: int main(int argc, char **argv) { LoadFile(); Node *temp; char *key; switch (GetUserInput()) { case 1: temp = malloc(sizeof(Node)); printf("\nEnter the key of the new node: "); scanf("%s", temp->key); printf("\nEnter the value of the new node: "); scanf("%s", temp->value); AddNode(temp); free(temp); break; case 2: key = malloc(sizeof(char *)); printf("Enter the key of the node you want to delete: "); scanf("%s", key); DeleteNode(key); free(key); break; case 3: PrintAll(); break; case 4: SaveFile(); break; case 5: return 0; break; default: printf("\nWrong choice!\n"); break; } return 0; } The only problem with it is that after any case statement breaks, the program just exits out. I understand why, but I don't know how to fix it. I want the program to repeat itself each time even after the case statements. Would I just say: main(argc, argv); before every break statement?

    Read the article

  • Black berry: Getting NULL string for exception message.

    - by vikram deshpande
    I used code given but I am getting "IOCancelledException" and "IOException". And IOCancelledException.getMessage() / IOException.getMessage() giving null string, it does not give error message. Please help me understaing reason. class SMSThread extends Thread { Thread myThread; MessageConnection msgConn; String message; String mobilenumber; public SMSThread( String textMsg, String mobileNumber ) { message = textMsg; mobilenumber = mobileNumber; } public void run() { try { msgConn = (MessageConnection) Connector.open("sms://+"+ mobilenumber); TextMessage text = (TextMessage) msgConn.newMessage(MessageConnection.TEXT_MESSAGE); text.setPayloadText(message); msgConn.send(text); msgConn.close(); }catch (IOCancelledException ioce){ System.out.println("IOCancelledException: " + ioce.getMessage()); }catch(IOException ioe){ System.out.println("IOException: " + ioe.getMessage()); } catch (Exception e) { System.out.println("Exception: " + e); } } }

    Read the article

  • Arrow operator (->) usage in C

    - by Mohit Deshpande
    I am currently learning C by reading a good beginner's book called "Teach Yourself C in 21 Days" (I have already learned Java and C# so I am moving at a much faster pace). I was reading the chapter on pointers and the - (arrow) operator came up without explanation. I think that it is used to call members and functions (like the equivalent of the . (dot) operator, but for pointers instead of members). But I am not entirely sure. Could I please get an explanation and a code sample?

    Read the article

  • Imitate database in C

    - by Mohit Deshpande
    I am fairly new to C. (I have good knowledge of C# [Visual Studio] and Java [Eclipse]) I want to make a program that stores information. My first instinct was to use a database like SQL Server. But I don't think that it is compatible with C. So now I have two options: Create a struct (also typedef) containing the data types. Find a way to integrate SQLite through a C header file Which option do you think is best? Or do you have another option? I am kind of leaning toward making a struct with a typedef, but could be pursuaded to change my mind.

    Read the article

  • The concept of an Intent in Android?

    - by Mohit Deshpande
    I don't really understand the use and concept of an Intent. I DO understand that an activity are one visual interface and one endeavour that the user can partake in. I THINK an intent is used to launch and communicate between different activities. If so, then how would you accomplish that? A code sample would be helpful.

    Read the article

  • Learning MVVM for WPF

    - by Mohit Deshpande
    I am now very comfortable with WPF, but I read some articles about MVP and MVVM that find the default project solution ineffective. Then I realized how ineffective it was and how the MVVM pattern is much better. So I want to really learn this pattern. Can I be directed to some resources like maybe a tutorial or a video or something?

    Read the article

  • Query Returning value as 0

    - by NIMISH DESHPANDE
    I am trying to execute following PL/SQL script in SQL Developer. The loop should return count of nulls but somehow everytime it is returning 0. set serveroutput on DECLARE --v_count number; v_count_null number; BEGIN execute immediate 'select count(*) from SP_MOSAIX' into v_count; FOR i in (select column_name from all_tab_COLUMNS where table_name = 'SP_MOSAIX') LOOP select count(*) into v_count_null from SP_MOSAIX where i.column_name IS NULL ; dbms_output.put_line(v_count_null); END LOOP; END; So when I run this, following output is what i get: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 But if I manually execute the query subsituting column_name I get the result. select count(*) into v_count_null from SP_MOSAIX where i.column_name IS NULL; Can anybody help on this?

    Read the article

  • What version of the .NET framework is installed on Windows XP, Vista, and 7?

    - by Mohit Deshpande
    I have an application that uses the .NET framework 3.5. I am building this application for a college to help students to study. Most students usually have Windows XP SP2, Windows Vista, or Windows 7. (Sorry Mac users! The Mac version will come out in about 6 months) What version of the .NET framework is installed on Windows XP, Vista, and 7; and will my application run on all of those platforms?

    Read the article

  • What kind of events should be created for a CRUD application?

    - by Mohit Deshpande
    I have an application that is centered around a database (ORM is LINQ-SQL) that has a table called Assignment. I am using the repository pattern to manipulate the database. My application is basically going to perform CRUD operations. I am new to delegates and events and I am asking you what events I should create (like maybe AssignmentCreating, AssignmentCreated) and what kind of delegate to use (like maybe a custom delegate or just an EventHandler)?

    Read the article

  • Declare variable as exern if initialized in header?

    - by Mohit Deshpande
    Say I declare a header file with a variable: int count; Then in the source file, I want to use count. Do I have to declare it as: extern int count Or can I just use it in my source file? All assuming that I have #include "someheader.h". Or should I just declare it in the source file? What is the difference between putting count in the header file vs the source file? Or does it not matter?

    Read the article

  • BlackBerry - Exception with null message when sending sms using Connector

    - by vikram deshpande
    I used code given but I am getting "IOCancelledException" and "IOException". And IOCancelledException.getMessage() / IOException.getMessage() giving null string, it does not give error message. Please help me understaing reason. class SMSThread extends Thread { Thread myThread; MessageConnection msgConn; String message; String mobilenumber; public SMSThread(String textMsg, String mobileNumber) { message = textMsg; mobilenumber = mobileNumber; } public void run() { try { msgConn = (MessageConnection) Connector.open("sms://+" + mobilenumber); TextMessage text = (TextMessage) msgConn .newMessage(MessageConnection.TEXT_MESSAGE); text.setPayloadText(message); msgConn.send(text); msgConn.close(); } catch (IOCancelledException ioce) { System.out .println("IOCancelledException: " + ioce.getMessage()); } catch (IOException ioe) { System.out.println("IOException: " + ioe.getMessage()); } catch (Exception e) { System.out.println("Exception: " + e); } } }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8  | Next Page >