Search Results

Search found 141 results on 6 pages for 'akash deshpande'.

Page 6/6 | < Previous Page | 2 3 4 5 6 

  • How to implement a unit converter in java

    - by Mohit Deshpande
    How could I possibly implement a unit converter in Java??? I was thinking of having a abstract base class: public abstract class Unit { ... public void ConvertTo(Unit unit); } Then having each class like Meter Kilometer Inch Centimeter Millimeter ... derive from that base Unit class. All the units of length would be in a package called com.unitconverter.distance, then a package, com.unitconverter.energy, for energy etc. etc. So is this the best way to implement a unit converter? Or is there a better or more easier way?

    Read the article

  • Setting up layout/events on iPhone

    - by Mohit Deshpande
    I am using Open Source toolchain to compile my iPhone apps. So I have no Interface Builder or XCode. How would I setup the layout of widgets like UIButton, UITextView, etc. Also, how would I add an event handler to those UI widgets? Please remember that I don't have Interface Builder or XCode.

    Read the article

  • Call C methods from C++/Java/C# code?

    - by Mohit Deshpande
    Many of today's programming languages are based on C; like C++, C#, Java, Objective-C. So could I call a C method from C++ code? Or call C from Java or C#? Or is this goal out of reach and unreasonable? Please include a quick code sample for my and everyone else's understanding.

    Read the article

  • Call other activities in an activity?

    - by Mohit Deshpande
    Say I have 2 activities (ActivityOne and ActivityTwo). How would I call ActivityTwo from ActivityOne? Then how would I return to ActivityOne from ActivityTwo? For example, I have a listview with all the contacts on the host phone. When I tap on a contact, another activity shows information and allows editing of that contact. Then I could hit the back button, and I would go back to the exact state that ActivityOne was in before I called ActivityTwo. I was thinking an Intent object, but I am not sure. Could someone post some code?

    Read the article

  • showDialog in Activity not displaying dialog

    - by Mohit Deshpande
    Here is my code: public class TasksList extends ListActivity { ... private static final int COLUMNS_DIALOG = 7; private static final int ORDER_DIALOG = 8; ... /** * @see android.app.Activity#onCreateDialog(int) */ @Override protected Dialog onCreateDialog(int id) { Dialog dialog; final String[] columns; Cursor c = managedQuery(Tasks.CONTENT_URI, null, null, null, null); columns = c.getColumnNames(); final String[] order = { "Ascending", "Descending" }; switch (id) { case COLUMNS_DIALOG: AlertDialog.Builder columnDialog = new AlertDialog.Builder(this); columnDialog.setSingleChoiceItems(columns, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { bundle.putString("column", columns[which]); } }); dialog = columnDialog.create(); case ORDER_DIALOG: AlertDialog.Builder orderDialog = new AlertDialog.Builder(this); orderDialog.setSingleChoiceItems(order, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String orderS; if (order[which].equalsIgnoreCase("Ascending")) orderS = "ASC"; else orderS = "DESC"; bundle.putString("order", orderS); } }); dialog = orderDialog.create(); default: dialog = null; } return dialog; } /** * @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem) */ @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case SORT_MENU: showDialog(COLUMNS_DIALOG); showDialog(ORDER_DIALOG); String orderBy = bundle.getString("column") + bundle.getString("order"); Cursor tasks = managedQuery(Tasks.CONTENT_URI, projection, null, null, orderBy); adapter = new TasksAdapter(this, tasks); getListView().setAdapter(adapter); break; case FILTER_MENU: break; } return false; } The showDialog doesn't display the dialog. I used the Debugger and it does executes these statements, but the dialog doesn't show. }

    Read the article

  • Must declare function prototype in C?

    - by Mohit Deshpande
    I am kind of new to C (I have prior Java, C#, and some C++ experience). In C, is it necessary to declare a function prototype or can the code compile without it? Is it good programming practice to do so? Or does it just depend on the compiler? (I am running Ubuntu 9.10 and using the GNU C Compiler, or gcc, under the Code::Blocks IDE)

    Read the article

  • Associate activity with database ID

    - by Mohit Deshpande
    I have a main ListView that is based on an adapter from my database. Each database id is "assigned" to an Activity via the ListView. And in my AndroidManifest, each activity has an intent filter with a custom action. Now with this, I have had to create this class: public final class ActivityLauncher { private ActivityLauncher() { } public static void launch(Context c, int id) { switch(id) { case 1: Intent intent = new Intent(); intent.setAction(SomeActivity.ACTION_SOMEACTIVITY); c.startActivity(intent); break; case 2: ... break; ... } } private static void st(Context context, String action) { Intent intent = new Intent(); intent.setAction(action); context.startActivity(intent); } } So I have to manually create a new case for the switch statement. This would get troublesome if I have to rearrange or delete an id. Is there any way to get around this?

    Read the article

  • Does Silverlight require the .NET framework to be installed?

    - by Mohit Deshpande
    I have been exploring the possibilities of Microsoft Silverlight and how it runs in web browsers. I just wonder if Silverlight requires the .NET framework? Meaning that Mac or Linux users cannot run Silverlight. I will be making the application using the .NET framework 3.5. Will this application run in any web browser, or just major ones like Internet Explorer, Firefox, or Safari?

    Read the article

  • Can i add some HTML in my SO Profile 'About me' text box to show some button from linkedin?

    - by goldenmean
    Hello, In my SO profile, i tried to do Edit profile and there in "About Me" text box, i tried to paste a HTML code as below provided by linkedin.com to display a button which would link to my profile on linkedin. But it does not seem to work on SO. This is the html code: <a href="http://in.linkedin.com/in/ajitsdeshpande" > <img src="http://www.linkedin.com/img/webpromo/btn_myprofile_160x33.png" width="160" height="33" border="0" alt="View Ajit Deshpande's profile on LinkedIn"> </a> 1] When i checked the html tags allowed by SO, i found i had only the whitelisted tags allowed. So does this kind of thing i am trying to do work on SO. 2] If yes how can i get it working? thanks, -AD.

    Read the article

  • How to keep a Generic list unmodified when its copy is modified?

    - by user1801934
    When I create a copy of the original list lstStudent in lstCopy and send the lstCopy to modification function, the lstStudent also gets modified. I want to keep this list unmodified. List<Student> lstStudent = new List<Student>(); Student s = new Student(); s.Name = "Akash"; s.ID = "1"; lstStudent.Add(s); List<Student> lstCopy = new List<Student>(lstStudent); Logic.ModifyList(lstCopy); // "Want to use lstStudent(original list) for rest part of the code" public static void ModifyList(List<Student> lstIntegers) { foreach (Student s in lstIntegers) { if (s.ID.Equals("1")) { s.ID = "4"; s.Name = "APS"; } } }

    Read the article

  • Issue in creating Zip file using glob.glob

    - by infosyssec
    Hi, I am creating a Zip file from a folder (and subfolders). it works fine and creates a new .zip file also but I am having an issue while using glob.glob. It is reading all files from the desired folder (source folder) and writing to the new zip file but the problem is that it is, however, adding subdirectories, but not adding files form the subdirectories. I am giving user an option to select the filename and path as well as filetype also (Zip or Tar). I don;t get any problem while creating .tar.gz file, but when use creates .zip file, this problem comes across. Here is my code: for name in (Source_Dir): for name in glob.glob("/path/to/source/dir/*" ): myZip.write(name, os.path.basename(name), zipfile.ZIP_DEFLATED) myZip.close() Also, if I use code below: for dirpath, dirnames, filenames in os.walk(Source_Dir): myZip.write(os.path.join(dirpath, filename) os.path.basename(filename)) myZip.close() Now the 2nd code taks all files even if it inside the folder/ subfolders, creates a new .zip file and write to it without any directory strucure. It even does not take dir structure for main folder and simply write all files from main dir or subdir to that .zip file. Can anyone please help me or suggest me. I would prefer glob.glob rather than the 2nd option to use. Thanks in advance. Regards, Akash

    Read the article

  • Flex XMLListCollection sort on nested tags

    - by gauravgr8
    Hi all, I have a requirement of sorting the <ename> in the XML with in the branch. The XML goes like this: <company> <branch> <name>finance</name> <emp> <ename>rahul</ename> <phno>123456</phno> </emp> <emp> <ename>sunil</ename> <phno>123456</phno> </emp> <emp> <ename>akash</ename> <phno>123456</phno> </emp> <emp> <ename>alok</ename> <phno>123456</phno> </emp> </branch> <branch> <name>finance</name> <emp> <ename>sameer</ename> <phno>123456</phno> </emp> <emp> <ename>rahul</ename> <phno>123456</phno> </emp> <emp> <ename>anand</ename> <phno>123456</phno> </emp> <emp> <ename>sandeep</ename> <phno>123456</phno> </emp> </branch> </company> I tried it with taking XML in XMLList: var xl:XMLList = new XMLList(branch.ename) var xlc:XMLListCollection = new XMLListCollection(xl); then applied sort to the <ename>. I am able to get the sorted but XMLListCollection but the problem is I got the <ename> collection sorted but I need the sorted <ename> in the XML. I tried with deleting the the item in Collection then adding the sorted list but in that case the <name> is lost. Please help me out in sorting <ename> or is there any way to specify nested tags in SortField name? Thanks in advance.

    Read the article

  • Xcode is not calling asp.net webservice

    - by vaibhav
    I have oracle database and using webservice i want to insert some records in to it So i created webservice in asp.net as follows public bool PickPill(string Me_id, string Mem_device_id, string Test_datetime, string Creation_id, string PillBayNo) { string Hed_seq_id = Hed_seq_Id(); bool ResultHED = InsHealthEData(Hed_seq_id, Mem_device_id, Me_id, Test_datetime, Creation_id); bool ResultHET = InsHealthETest(Hed_seq_id, PillBayNo, Test_datetime, Creation_id); if (ResultHED == ResultHET == true) return true; else return false; } this function did all data insertion trick for me i tested this service on the local mechine with ip address http:72.44.151.178/PickPillService.asmx then, I see an example on how to attach asp.net web service to iphone apps http://www.devx.com/wireless/Article/43209/0/page/4 then i created simillar code in xcode which has 2 files ConsumePillServiceViewController.m ConsumePillServiceViewController.h file Now, Using Designer of xcode i created 5 textboxes(Me_id,Mem_device_id,Test_datetime,Creation_id,PillBayNo) with all parameters hardcode as our service demands then modify my ConsumePillServiceViewController.h file as follows @interface ConsumePillServiceViewController : UIViewController { //---outlets--- IBOutlet UITextField *Me_id; IBOutlet UITextField *Mem_device_id; IBOutlet UITextField *Test_datetime; IBOutlet UITextField *Creation_id; IBOutlet UITextField *PillBayNo; //---web service access--- NSMutableData *webData; NSMutableString *soapResults; NSURLConnection *conn; } @property (nonatomic, retain) UITextField *Me_id; @property (nonatomic, retain) UITextField *Mem_device_id; @property (nonatomic, retain) UITextField *Test_datetime; @property (nonatomic, retain) UITextField *Creation_id; @property (nonatomic, retain) UITextField *PillBayNo; - (IBAction)buttonClicked:(id)sender; @end and ConsumePillServiceViewController.m as follows import "ConsumePillServiceViewController.h" @implementation ConsumePillServiceViewController @synthesize Me_id; @synthesize Mem_device_id; @synthesize Test_datetime; @synthesize Creation_id; @synthesize PillBayNo; (IBAction)buttonClicked:(id)sender { NSString *soapMsg = @"" "" "" ""; NSString *smMe_id= [soapMsg stringByAppendingString: [NSString stringWithFormat: @"%@",Me_id.text]]; NSString *smMem_device_id= [smMe_id stringByAppendingString: [NSString stringWithFormat: @"%@",Mem_device_id.text]]; NSString *smTest_datetime= [smMem_device_id stringByAppendingString: [NSString stringWithFormat: @"%@",Test_datetime.text]]; NSString *smCreation_id= [smTest_datetime stringByAppendingString: [NSString stringWithFormat: @"%@",Creation_id.text]]; NSString *smPillBayNo= [smCreation_id stringByAppendingString: [NSString stringWithFormat: @"%@",PillBayNo.text]]; NSString *smRestMsg= [smPillBayNo stringByAppendingString: @"" "" ""]; soapMsg=smRestMsg; //---print it to the Debugger Console for verification--- NSLog(soapMsg); NSURL *url = [NSURL URLWithString: //create a URL load request object using instances : @"http://72.44.151.178/PickPillService.asmx"];//of the NSMutableURLRequest and NSURL objects NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url]; //opulate the request object with the various headers, such as Content-Type, SOAPAction, and Content-Length. //You also set the HTTP method and HTTP body NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMsg length]]; [req addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"]; [req addValue:@"http://tempuri.org/PickPill" forHTTPHeaderField:@"SOAPAction"]; [req addValue:msgLength forHTTPHeaderField:@"Content-Length"]; //---set the HTTP method and body--- [req setHTTPMethod:@"POST"]; [req setHTTPBody: [soapMsg dataUsingEncoding:NSUTF8StringEncoding]]; conn = [[NSURLConnection alloc] initWithRequest:req delegate:self]; //establish the connection with the web service, if (conn) { //you use the NSURLConnection class together with the request object just created webData = [[NSMutableData data] retain];//webData object use to receive incoming data from the web service } }//End of button clicked event -(void) connection:(NSURLConnection *) connection //Recive response didReceiveResponse:(NSURLResponse *) response { [webData setLength: 0]; } -(void) connection:(NSURLConnection *) connection //Repeative call method and append data to webData didReceiveData:(NSData *) data { [webData appendData:data]; } -(void) connection:(NSURLConnection *) connection//If error occure error should be displayed didFailWithError:(NSError *) error { [webData release]; [connection release]; } -(void) connectionDidFinishLoading:(NSURLConnection *) connection { NSLog(@"DONE. Received Bytes: %d", [webData length]); NSString *theXML = [[NSString alloc] initWithBytes: [webData mutableBytes] length:[webData length] encoding:NSUTF8StringEncoding]; //---shows the XML--- NSLog(theXML); [connection release]; [webData release]; } (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } (void)dealloc { [Me_id release]; [Creation_id release]; [Mem_device_id release]; [Test_datetime release]; [PillBayNo release]; [soapResults release]; [super dealloc]; } @end I did all things as shown in the website and when i built application it successfully built but in the debuggin window i see (gdb) continue 2010-03-17 09:09:54.595 ConsumePillService[6546:20b] A00000004303101103/13/2010 07:34:38Hboxdata2 (gdb) continue (gdb) continue (gdb) continue 2010-03-17 09:10:05.411 ConsumePillService[6546:20b] DONE. Received Bytes: 476 2010-03-17 09:10:05.412 ConsumePillService[6546:20b] soap:ServerServer was unable to process request. ---> One or more errors occurred during processing of command. ORA-00936: missing expression It should return me true if all things are ok What is this ORA-00936 error all about as it is not releted with webservice Please help me solving this problem Thanks in advance, Vaibhav Deshpande

    Read the article

< Previous Page | 2 3 4 5 6