Search Results

Search found 99 results on 4 pages for 'onkar deshpande'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Parse values from a text file in C

    - by Mohit Deshpande
    Say I have written to a text file in this format: key1/value1 key2/value2 akey/withavalue anotherkey/withanothervalue I have a linked list like: struct Node { char *key; char *value; struct Node *next; }; to hold the values. How would I read key1 and value1? I was thinking of putting line by line in a buffer and using strtok(buffer, '/'). Would that work? What other ways could work, maybe a bit faster or less prone to error? Please include a code sample if you can!

    Read the article

  • Null Reference Exception on MVVM pattern

    - by Mohit Deshpande
    System.NullReferenceException Object reference not set to an instance of an object. at Microsoft.Windows.Design.DocumentModel.Trees.MarkupDocumentTreeManager.<FindMarkupNodePath>d__0.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source) at MS.Internal.Services.DocumentInformationServiceImpl.get_Root() at MS.Internal.Designer.VSDesigner.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.Load() at MS.Internal.Designer.DesignerPane.LoadDesignerView() I keep getting this exception and then intellisense stops working in a XAML text editor. Any ideas why?

    Read the article

  • '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

  • Android Apps not working in emulator

    - by Mohit Deshpande
    None of my apps work in the emulator. I am running Ubuntu 9.10 and everytime I try to access my UI, the app crashes. All I get is an "Sorry! The application ... has stopped unexpectedly". For EVERY app this happens. package com.mohit.helloandroid; import android.app.TabActivity; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.widget.TabHost; public class HelloAndroid extends TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Resources res = getResources(); //Resource object to get drawables TabHost tabHost = getTabHost(); //The activity tabhost TabHost.TabSpec spec; //Reusable tab spec Intent intent; intent = new Intent().setClass(this, HelloAndroid.class); spec = tabHost.newTabSpec("artists").setIndicator("Artists", res .getDrawable(R.drawable.tab_artists)) .setContent(intent); tabHost.addTab(spec); } } I don't know how this code could possibly throw a message like that.

    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

  • Running DOS command through C# just opens blank cmd window

    - by Mohit Deshpande
    I was trying to execute a command through C#, but when I run the following code, a blank cmd window just opens up. The code: string command = string.Format(@"adb install C:\Users\Mohit\Programming\Android_Workspace\{0}\bin\{0}.apk", appName); ProcessStartInfo cmdsi = new ProcessStartInfo("cmd.exe"); cmdsi.Arguments = command; Process cmd = Process.Start(cmdsi); What could be wrong? I am sure the syntax is right.

    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

  • 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

  • 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

< Previous Page | 1 2 3 4  | Next Page >