Daily Archives

Articles indexed Saturday June 5 2010

Page 23/79 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • copy array from one class to another class array

    - by shishir.bobby
    hi all, i hv an array ("array A", which contains 3 objects, fox ex, to,from,message) in class "A". and in class "B",i m having another array ("array B"),which fills tableview,of class "B" only. i need to fill tableview,with the values of class A's array (i.e array A,with the object values, to,from,message). how can i do it?? how to copy array from another class ? i hope i m clear with my question regards shishir

    Read the article

  • Passing ArrayList<String> between tabs

    - by Christophe
    Hi all, I'm not very clear about the Intent object and how to use it to pass data between Activities. In my application I have several tabs between which I want to pass ArrayList. Here is a sample code I plan to use, but I'm missing the part where the main activity catches the Intent and passes it to the new activity on start : 1. myTabs.java == This is where I think I need to add some code to pass the data between TabOne and TabTwo. For now it is just using the sample code of the TabActivity sample. public class myTabs 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 TabSpec for each tab Intent intent; // Reusable Intent for each tab // Create an Intent to launch an Activity for the tab (to be reused) intent = new Intent().setClass(this, TabPeopleActivity.class); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("TabOne").setIndicator("TabOne", res.getDrawable(R.drawable.ic_tab_one)) .setContent(intent); tabHost.addTab(spec); // Do the same for the other tabs intent = new Intent().setClass(this, TabTransactionActivity.class); spec = tabHost.newTabSpec("TabTwo").setIndicator("TabTwo", res.getDrawable(R.drawable.ic_tab_two)) .setContent(intent); tabHost.addTab(spec); tabHost.setCurrentTab(0); } } 2. TabOne.java == I added a piece of code in the onStop procedure to fill in the Intent data with the array I want to pass to TabTwo. Not sure it is the right way to do though. public class TabOne extends Activity { [...] private ArrayList<String> arrayPeople; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tabone); arrayPeople = new ArrayList<String>(); [... here we modify arrayPeople ...] } /** Called when the activity looses focus **/ @Override public void onStop(){ Intent myIntent = new Intent(); myIntent.putStringArrayListExtra("arrayPeople", arrayPeople); this.setIntent(myIntent); } } 3. TabTwo.java == Here I am trying to fetch the ArrayList from the Intent that is supposed to be passed when the Activity starts. But how to do this? public class TabTwo extends Activity { private ArrayList<String> arrayPeople; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.transaction); Intent myIntent = new Intent(); myIntent = this.getIntent(); arrayPeople = myIntent.getStringArrayListExtra("arrayPeople"); } } Thanks for your ideas !

    Read the article

  • Return to AvAudioPlayer

    - by robmontesinos
    I can use some help with an AVAudioPlayer issue. My App is basically an interactive audio book. The RootViewController is a UITableView using a drill-down approach sitting on top of a Navigation Controller. The first level are the Chapters and the second level are the Topics. Each Topic goes to an audio file which plays in a SoundPlayerViewController utilizing AVAudioPlayer - standard stuff. If the user leaves the SoundPlayer to browse Chapters and Topics with the Back button(s), the audio continues playing - this is good. If the user selects a new Topic, the current audio file stops and the new audio file begins playing - this is good. What I have not been able to figure out is how to allow the user to go back to the current SoundPlayer so they can rewind, pause or whatever. This is not so good. Any help with an approach or pointing to some help would be greatly appreciated. Thanks so much in advance.

    Read the article

  • using structures with multidimentional tables

    - by gem
    I have a table of structures and this structures are 2 dimentional table of constants. can you teach me on how to get the values in the table of constants. (note following is just example) typedef struct { unsigned char ** Type1; unsigned char ** Type2; } Formula; typedef struct { Formula tformula[size]; } table; const table Values = { (unsigned char**) &(default_val1), (unsigned char**) &(default_val2) }; const unsigned char default_val1[4][4] = { {0,1,2,3}, {4,5,6,7}, {8,9,0,11}, {12,13,14,15} } const unsigned char default_val2[4][4] = { {15,16,17,13}, {14,15,16,17}, {18,19,10,21}, {22,23,24,25} }

    Read the article

  • How to find an element in an array in C

    - by gkaykck
    I am trying to find the location of an element in the array. I have tried to use this code i generated for(i=0;i<10;i++) { if (strcmp(temp[0],varptr[i])==0) j=i; } varptr is a pointer which points to array var[11][10] and it is by the definition *varptr[11][10]. I have assigned strings to var[i] and i want to get the "i" number of my element NOT THE ADRESS. Thanks for any comment. EDit: temp is also a pointer which points to the string that i want to check. Also i am using the 2D array for keeping variable names and their address. So yes i want to keep it inside a 2D array. The question is this code is not working at all, it does not assigns i to j, so i wonder where is the problem with this idea? writing a "break" does not change if the code works or not, it just optimizes the code a little. Full Code: #include <stdio.h> #include <string.h> #include <ctype.h> double atof(char*); int main(void) { char in[100], *temp[10],var[11][10],*varptr[11][10]; int i,j, n = 0,fullval=0; double val[11]; strcpy(var[11], "ans"); for(i=0;i<11;i++) { for(j=0;j<10;j++) varptr[i][j]=&var[i][j]; } START: printf("Enter the expression: "); fflush(stdout); for(i=0;i<10;i++) temp[i]=NULL; if (fgets(in, sizeof in, stdin) != NULL) { temp[0] = strtok(in, " "); if (temp[0] != NULL) { for (n = 1; n < 10 && (temp[n] = strtok(NULL," ")) != NULL; n++) ; } if (*temp[0]=="quit") { goto FINISH;} if (isdigit(*temp[0])) { if (*temp[1]=='+') val[0] = atof(temp[0])+atof(temp[2]); else if (*temp[1]=='-') val[0] = atof(temp[0])-atof(temp[2]); else if (*temp[1]=='*') val[0] = atof(temp[0])*atof(temp[2]); else if (*temp[1]=='/') val[0] = atof(temp[0])/atof(temp[2]); printf("%s = %f\n",var[11],val[0]); goto START; } else if (temp[1]==NULL) //asking the value of a variable { for(i=0;i<10;i++) { if (strcmp(temp[0],varptr[i])==0) j=i; } printf("%s = %d\n",var[j],val[j]); goto START; } if (*temp[1]==61) { strcpy(var[fullval], temp[0]); if ((temp[3])!=NULL) { } val[fullval]=atof(temp[2]); printf("%s = %f\n",var[fullval],val[fullval]); fullval++; goto START; } if (*temp[1]!=61) { } } getch(); FINISH: return 0; }

    Read the article

  • Flex Force Decimal

    - by babyangel86
    Hi, I'm looking for a regex or a way to format the NumberValidator so that only decimal places are allowed. The domain="real" allows you to put integer values, but I need to force the user to but in 2.0 if they want an integer. This is because they pass through a Castor mapping file, it complains if it gets an integer when it expects a decimal. I dont want to restrict the number of decimal places, just insist that there must be a point, and a number after it. Any help would be much appreciated.

    Read the article

  • Reloading the model of a TTTableViewController

    - by user341338
    My problem is that I have a Register Controller and a Login Controller. The Login Screen displays a Login Screen or a Logout Screen depending if a user is logged in. Now when a user registers, does not close the app, and then goes to the Login Screen it will still display a Login Screen, although there is a logged in user already. This is because the Screen is created when the application loads and does not change afterwards. I tried doing this: - (id)init { if (self = [super init]) { [self invalidateModel]; [self reload]; but that did not work, since it is only called on the first init. then i tried: - (void)viewDidLoad { [self invalidateModel]; [self reload]; } But that method had the same problem. Then I found this method: - (TTNavigationMode)navigationModeForURL:(NSString*)URL; with the following options: typedef enum { TTNavigationModeNone, TTNavigationModeCreate, // a new view controller is created each time TTNavigationModeShare, // a new view controller is created, cached and re-used TTNavigationModeModal, // a new view controller is created and presented modally TTNavigationModeExternal, // an external app will be opened } TTNavigationMode; It seems like TTNavigationModeCreate would be the right thing to use, but I have no clue how to use it. Any help? Thnx.

    Read the article

  • move data from one table to another, postgresql edition

    - by IggShaman
    Hi All, I'd like to move some data from one table to another (with a possibly different schema). Straightforward solution that comes into mind is - start a transaction with serializable isolation level; INSERT INTO dest_table SELECT data FROM orig_table,other-tables WHERE <condition>; DELETE FROM orig_table USING other-tables WHERE <condition>; COMMIT; Now what if the amount of data is rather big, and the <condition> is expensive to compute? In PostgreSQL, a RULE or a stored procedure can be used to delete data on the fly, evaluating condition only once. Which solution is better? Are there other options?

    Read the article

  • Asp.net deployment with remote desktop

    - by Efe Kaptan
    Hi, i have a production server that does not have ftp access. Possible way to deploy files is connecting with remote desktop client and send files. As you know this approach is highly hard and time inefficient. Could you please provide me best practices to deploy in a more fast way? Thanks

    Read the article

  • Graph database for .NET

    - by Antonello
    I've been designing an application, based on .NET/Mono framework, which should make an heavy use of the shortest-path in a graph theories and I would like to use a native solution to traverse the nodes of the graph, instead of implementing surrogate solutions which would be hardly maintainable and would massively affect performances. I've found an application which would be perfect for my scope: neo4j. Unfortunately, this application is purely written in Java code and it's not portable to .NET, because of the massive differences between the two architectures. Is anyone out there knows if is it there any port of neo4j or a similar solution for .NET?

    Read the article

  • Pass parameter one time, but use more times

    - by Gabriel L. Oliveira
    I'm trying to do this: commands = { 'py': 'python %s', 'md': 'markdown "%s" "%s.html"; gnome-open "%s.html"', } commands['md'] % 'file.md' But like you see, the commmands['md'] uses the parameter 3 times, but the commands['py'] just use once. How can I repeat the parameter without changing the last line (so, just passing the parameter one time?)

    Read the article

  • Passing time from server to client

    - by gskoli
    Dear all, i am creating a digital clock using images & javascript but i want to pass a server time that time ... How to do that ... I am getting time from server and passing it to Date Following i have given snippet . var time_str = document.clock_form.time_str.value ; //alert (time_str); function dotime(){ theTime=setTimeout('dotime();',1000); //d = new Date(Date.parse(time_str)); d= new Date(time_str); hr= d.getHours()+100; mn= d.getMinutes()+100; se= d.getSeconds()+100; var time_str = document.clock_form.time_str.value ; //alert (time_str); alert(' TIME ---> '+hr+' :: '+mn+' :: '+ se); if(hr==100){ hr=112;am_pm='am'; } else if(hr<112){ am_pm='am'; } else if(hr==112){ am_pm='pm'; } else if(hr>112){ am_pm='pm';hr=(hr-12); } tot=''+hr+mn+se; document.hr1.src = '/flash_files/digits/dg'+tot.substring(1,2)+'.gif'; document.hr2.src = '/flash_files/digits/dg'+tot.substring(2,3)+'.gif'; document.mn1.src = '/flash_files/digits/dg'+tot.substring(4,5)+'.gif'; document.mn2.src = '/flash_files/digits/dg'+tot.substring(5,6)+'.gif'; document.se1.src = '/flash_files/digits/dg'+tot.substring(7,8)+'.gif'; document.se2.src = '/flash_files/digits/dg'+tot.substring(8,9)+'.gif'; document.ampm.src= '/flash_files/digits/dg'+am_pm+'.gif'; } dotime(); But it is not working Help me out Thanks in advance.

    Read the article

  • PHP Extended CHM Manual Gone?

    - by Alix Axel
    I'm sorry for maybe posting a question that may not be directly related to programming but where can I find an up to date version of the Extended PHP Manual (the one with the user comments) for download? The usual URL (http://www.php.net/docs-echm.php) seems to redirect to the (http://www.php.net/download-docs.php), was it discontinued?

    Read the article

  • SQL Server 2008 log issue

    - by George2
    Hello everyone, I am using SQL Server 2008 Enterprise. Under logs folder, in my machine it is C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log, there are three kinds of files, •ERRORLOG, ERRORLOG.1, ERRORLOG.2 ... ERRORLOG.6; •FDLAUNCHERRORLOG, FDLAUNCHERRORLOG.1, FDLAUNCHERRORLOG.2, ...FDLAUNCHERRORLOG.6; •log_207.trc, log_208.trc, ... My question is what are the differnet function of such log files? And why there are files ends with .1, .2, etc? thanks in advance, George

    Read the article

  • what's POST code 18 / can I run an ASRock P55 Pro + Core i3 530?

    - by Michael Borgwardt
    When I switch my newly built PC on, the fans start up, but I get nothing on the monitor, and the POST display on the motherboard runs quickly through various codes and then stops at code 18, which does not appear in the manual (the list there seems identical to this one). This lasts about 10 seconds, after which the machine shuts down. After a pause (also about 10 seconds) it starts up again, and this repeats until I cut the power. Interestingly, when I push the reset button, it stops at POST code 16 (which is also not listed in the manual). Does anyone have information about the meaning of those codes? Motherboard: ASRock P55 Pro CPU: Intel Core i3 530 Graphics Card: Sapphire HHD 5750 Does anyone have experience with that Motherboard/CPU combination? It says on the packaging and in the manual that it's only compatible with Core i5 and i7 (no mention of i3), but on the maker's product page, the i3 is listed as compatible as well.

    Read the article

  • Show milliseconds with Android Chronometer

    - by Matthew Steeples
    I'm looking for a way to make the Chronometer in Android (preferably 1.6 and upwards) show 10ths of a second while counting up. Is it possible to do this? If not, is there a free (and preferably open source) library that does the same? Failing that I'll write my own, but I'd rather use someone else's!

    Read the article

  • How to draw a full ellipse in a StreamGeometry in WPF?

    - by romkyns
    The only method in a StreamGeometryContext that seems related to ellipses is the ArcTo method. Unfortunately it is heavily geared to joining lines rather than drawing ellipses. In particular, the position of the arc is determined by a starting and ending point. For a full ellipse the two coincide obviously, and the exact orientation becomes undefined. So far the best way of drawing an ellipse centered on 100,100 of size 10,10 that I found is like this: using (var ctx = geometry.Open()) { ctx.BeginFigure(new Point(100+5, 100), isFilled: true, isClosed: true); ctx.ArcTo( new Point(100 + 5*Math.Cos(0.01), 100 + 5*Math.Sin(0.01)), // need a small angle but large enough that the ellipse is positioned accurately new Size(10/2, 10/2), // docs say it should be 10,10 but in practice it appears that this should be half the desired width/height... 0, true, SweepDirection.Counterclockwise, true, true); } Which is pretty ugly, and also leaves a small "flat" area (although not visible at normal zoom levels). How else might I draw a full ellipse using StreamGeometryContext?

    Read the article

  • Practicing buffer overflow attack in Ubuntu

    - by wakandan
    I am trying to learn to use buffer overflow attack in Ubuntu. Unfortunately, I cannot turn off Address Space Layout Randomization (ASLR) feature in this OS, which is turned on by default. I have tried some work around found in some fedora books: echo "0" > /proc/sys/kernel/randomize_va_space but for some reason the protection's still there. Please give me some suggestions. Thanks. [edit]Actually the above command was not successful, it said "Permission Denied", even with sudo. How can I fix that? [adding] I kept on getting segmetation fault error when it shows an address in stack. Is it related to non-executable stack in ubuntu :(?

    Read the article

  • Error handling in VS/C# build events.

    - by ProfK
    I have just written a small utility to be used in a pre-build event. The utilty works fine when run as standalone, but does nothing when used in the build event. Is there a standard way of noticing and dealing with error conditions in build events, or is that the domain of more advanced build control?

    Read the article

  • Autoplaynig video/image gallery - with a catch

    - by Ran
    Looking for a (jQuery) video/image gallery to implement on my website, I've found many freely available option. However, I need one that, when in "autoplay" mode and gets to a video file, automatically plays an entire file, and only then moves on to the next image/video. Similar to what Picasaweb are doing when you ask to autoplay an online gallery of your images/videos. I have found, for example, this plugin: http://www.yoxigen.com/yoxview/. Notice that images 6 & 8 are actually video feeds, but when in autoplay mode, are treated just like any other image, i.e. - displayed for a few seconds then moves on to the next file... not what I need. Thank you in advance.

    Read the article

  • Read binary data from a MDB-file running under LAMP

    - by BusterX
    I need to be able to connect to an MDB-file in a LAMP-environment (running on Linux) and ultimately insert converted data into a Mysql db. The data I need to access is stored as a BLOB (Long Binary Data according to Access) in the MDB file. I have not yet been able to actually have a look at the data but I have been told that the BLOB consists of byte strings. Something along the lines of: 0x1c 0x10 0x27 0x00 0x00 I need to parse the byte strings and convert these to a format that is human readable. I do have access to the documentation that explains the various byte strings. So this is really two questions: How do a get access to the MDB file via PHP* (running under LAMP) and read the BLOB (I do not have access to a Windows-platform)? What would be the best way to parse the binary data (in PHP*) once I am able to connect to the MDB-file? *Or are there other methods/languages that are more appropriate?

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >