Daily Archives

Articles indexed Monday March 8 2010

Page 15/124 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • how to use spinner

    - by corotana
    I am very new to android. I want to use 2 spinners in my application, one shows the countries list, when any country is selected the other spinner should show the list of cities of that country. when city is selected some action is performed. plz help me with some sample code. thanks in anticipation

    Read the article

  • How to sort a list so that managers are always ahead of their subordinates (How do I do a topologica

    - by James Black
    I am working on a project using Groovy, and I would like to take an array of employees, so that no manager follows their subordinates in the array. The reason being that I need to add people to a database and I would prefer not to do it in two passes. So, I basically have: <employees> <employee> <employeeid>12</employeeid> <manager>3</manager> </employee> <employee> <employeeid>1</employeeid> <manager></manager> </employee> <employee> <employeeid>3</employeeid> <manager>1</manager> </employee> </employees> So, it should be sorted as such: employeeid = 1 employeeid = 3 employeeid = 12 The first person should have a null for managers. I am thinking about a binary tree representation, but I expect it will be very unbalanced, and I am not certain the best way to do this using Groovy properly. Is there a way to do this that isn't going to involve using nested loops?

    Read the article

  • Horrible eclipse performance on macbook pro running 10.5.8

    - by user246114
    Hi I am using eclipse galileo on my macbook pro. After a few minutes it starts dragging really badly, like it takes 8 seconds to open a file. I don't have many files open at all. I already modified the config file to increase ram and all that stuff. Is there something wrong with this version of eclipse, never had it run so poorly on here, Thanks

    Read the article

  • PHP Array in MySQL IN() function?

    - by Trez
    Is it possible to assign php array in MySQL IN() function? for example, $numbers = array('8001254656','8886953265','88864357445','80021536245'); $sql = mysql_query("SELECT * FROM `number_table` WHERE `number` IN ($numbers)"); Any Ideas? Thanks,

    Read the article

  • Footer getting jammed into a column

    - by chief
    I have a three column layout. The last column on the right is: #right_column { float: left; width: 7em; border: 1px solid #ccc; padding: 5px; } My footer is going into the bottom of my right column. If I remove the right column the footer is still misplaced in the page. I presume it is something related to the float.

    Read the article

  • Updating the launcher icon at run-time

    - by david
    Is it possible to update the launcher icon dynamically? Currently it seems that it can only be set statically at build time using the android:icon attribute in the AndroidManifest.xml file. For example, to display a unique icon based on the device's location? Is this something that can be achieved using aliases? If so, can an alias's launcher icon be enabled/disabled dynamically?

    Read the article

  • C++ question on prime numbers.

    - by user278330
    Hello. I am trying to make a program that determines if the number is prime or composite. I have gotten thus far. Could you give me any ideas so that it will work? All primes will , however, because composites have values that are both r0 and r==0, they will always be classified as prime. How can I fix this? int main() { int pNumber, limit, x, r; limit = 0; x = 2; cout << "Please enter any positive integer: " ; cin >> pNumber; if (pNumber < 0) { cout << "Invalid. Negative Number. " << endl; return 0; } else if (pNumber == 0) { cout << "Invalid. Zero has an infinite number of divisors, and therefore neither composite nor prime." << endl; return 0; } else if (pNumber == 1) { cout << "Valid. However, one is neither prime nor composite" << endl; return 0; } else { while (limit < pNumber) { r = pNumber % x; x++; limit++; } if (r == 0) cout << "Your number is composite" << endl; else cout << "Your number is prime" << endl; } return 0; }

    Read the article

  • PHP templating challenge (optimizing front-end templates)

    - by Matt
    Hey all, I'm trying to do some templating optimizations and I'm wondering if it is possible to do something like this: function table_with_lowercase($data) { $out = '<table>'; for ($i=0; $i < 3; $i++) { $out .= '<tr><td>'; $out .= strtolower($data); $out .= '</td></tr>'; } $out .= "</table>"; return $out; } NOTE: You do not know what $data is when you run this function. Results in: <table> <tr><td><?php echo strtolower($data) ?></td></tr> <tr><td><?php echo strtolower($data) ?></td></tr> <tr><td><?php echo strtolower($data) ?></td></tr> </table> General Case: Anything that can be evaluated (compiled) will be. Any time there is an unknown variable, the variable and the functions enclosing it, will be output in a string format. Here's one more example: function capitalize($str) { return ucwords(strtolower($str)); } If $str is "HI ALL" then the output is: Hi All If $str is unknown then the output is: <?php echo ucwords(strtolower($str)); ?> In this case it would be easier to just call the function (ie. <?php echo capitalize($str) ?> ), but the example before would allow you to precompile your PHP to make it more efficient

    Read the article

  • why gcc 4.x default reserve 8 bytes for stack on linux when calling a method?

    - by nikcname
    as a beginner of asm, I am checking gcc -S generated asm code to learn. why gcc 4.x default reserve 8 bytes for stack when calling a method? func18 is the empty function with no return no param no local var defined. I can't figure out why 8 bytes is reserved here (neither any forum/site mention for the reason, ppl seems take it for granted) is it for the %ebp just push? or return type?! many thx! .globl _func18 _func18: pushl %ebp movl %esp, %ebp subl $8, %esp .text

    Read the article

  • How do you retrieve the array adapter currently set for a spinner? Android OS, Droid

    - by Sean
    Looking to create a menu toggle that switches between two possible arrays for a spinner. For example, if the spinner is set to show array A, then when I press this menu button, I want the spinner to be set to array B. If I press it again, I want it to be set back to array A. I can handle the if/then statements and all, but how do I call the spinner's array adapter? I know how to call its value using getSelectedItemPosition(); but is there a similar method for retrieving WHICH array it is currently set to?

    Read the article

  • RIA Services vs ADO.NET Data Services

    - by Cody C
    I'm currently in the process of creating a Silverlight 3 data driven application. To access the database, 2 common approaches are used: RIA Services and ADO.NET Data Services. Does anyone have any guidance on when/why to choose each approach? Here is what I've gathered from my research / experience. Any thoughts? ADO.NET seems to be only useful for strictly database calls. If you need to expose the data services to other applications (ignoring Silverlight 3's domain restriction), this is a good approach. Also, if the URL/Query syntax can be useful in your application, this is another advantage RIA Services seem to be a more flexible, accepted framework. It seems to give you more than strictly database access. It does have a limitation of only being used for the Silverlight / Web application as it is not exposed via a service. Thoughts? Ideas? Comments?

    Read the article

  • c++ use of winmain()

    - by Jack
    Hi, I just started learning programming for windows in c++. I had this crazy image, that win32 programming is based on calling windows functions and sending parameters to and from them. Like, when you want to create window, you call some win32 function that handles windows GUI and say "Hi, please, create me new window, 100 x 100 px, with two buttons", and that GUI function says "Hi, no problem, when something happends, like user clicks one button, I will change this variable xy located in this location". So, I thought that it will be very similiar to console programming. But the very first instruction surprised me. I always thought that every program executes main() function first. So, when I launch app, windows stores some parameters on top of stack and run that application. So I assumed that initializing main() is just a c++ way to tell the compiler where the first instruction should be. But in win32 programming, there is function called winmain() which starts first. So I am little confused. I thought it´s rule that compiler must have main() to start with, that main just defines where ti start, like some start point identifier. So, please, why is there winmain() function instead of main()? When I thought that C++ programming is as logical as assembler, it confuses me once again.

    Read the article

  • how to pass values from one page to another on jquery form submit

    - by andy787899
    I'm trying to build a form using php & jquery, but I'm a little confused as to what to do with the jquery portion of it... Basically, when the user submits the first form, I want to direct them to the "next step" form, but I want to retain the values submitted from the first one in a hidden input field... If someone can either show me how or point me to a good tutorial, I'd appreciate it... I don't have any of the php or jquery yet, and this is just a simplified version of the html markup... //first.php <form name="form1" method="post" action="second.php"> <input type="text" name="name" value="" />Name <input type="submit" name="step1" value="Next" /> </form> //second.php <form name="form2" method="post" action="process.php"> <input type="hidden" name="name" value="{$_POST['name']}" /> <input type="text" name="message" value="" />message <input type="submit" name="step2" value="Finish" /> </form>

    Read the article

  • Can&rsquo;t eject external USB or Firewire drive in Windows 7

    - by Kelly Jones
    As a SharePoint developer, I work a lot with Virtual Machines (presently using Windows Virtual PC, with Windows 7).  I’m using these VMs with my laptop, and in order to get better performance, I’ve moved them to external hard drives.  (These drives have faster RPMs, larger caches, and a larger capacity, than the internal drive.)  I have one large external drive at home, another similar drive at the office, and a small, slow portable drive that I carry with me. So, at the end of each day at the office, I copy the files from the external drive to my portable drive and then once I get home, I copy them from the portable to the larger external drive I leave at home.  I do this for a couple of reasons: so I can work at home and secondly, so I have backup copies.  (Often, I feel like I’m in the movie “Office Space” when copying the files before I leave the office). Anyway, after the files are copied, I safely eject the external drives, and then hibernate my laptop.  I’ve been doing this for over a year now, but within the last couple of months I started to have issues disconnecting the drives.  Intermittently, some application/process would have a lock on some file on the drive that would keep Windows from safely ejecting it. After looking into it, I found that it was actually the Windows search service that was accessing the drive! Since I wasn’t using Windows search to look for stuff on these drives, I removed them as locations to index. To do this in Windows 7, you need to go to Indexing Options (just type “Indexing” into the search box in the Start menu…).  One of the choices displayed will then be Indexing Options, so click on it and you should then see a window similar to this:   Click on the Modify button and you’ll see this window: Notice the different drives listed above.  My “FreeAgent XTreme (F:)” drive was checked for some reason, which was causing the indexing service to scan the drive looking for new files to make available in the search results.  Ever since I unchecked this box, I’ve been able to safely eject the drive.

    Read the article

  • First Post

    - by GeekAgilistMercenary
    This is the beginning of a new blog, which is primarily going to be code bits and the like.  My idea behind this blog is to increase my breadth of blogging by providing a code centric blog space.  Some of these posts will be cross-posts, some of them will be code specific collations of blogs from all the other various places I post. Basically, this is my code blog repository.  Thanks for reading.

    Read the article

  • Pyton, print delimited list

    - by Mike
    Consider this Python code for printing a list of comma separated values for element in list: print element + ",", What is the preferred method for printing such that a comma does not appear if element is the final element in the list. ex a = [1, 2, 3] for element in a print str(element) +",", output 1,2,3, desired 1,2,3

    Read the article

  • How do you hyperlink to Word 2007 help pages?

    - by Jeremy Rudd
    I want to hyperlink to a page within the Word 2007 Object Model Reference documentation, that ships with Word 2007. These are webpages that use the ms-help:// protocol that Firefox cannot understand. So I wanted to specify the ms-help:// path of the help page as a command line argument to the viewer, CLVIEW.EXE. C:\Program Files\Microsoft Office\Office12\CLVIEW.EXE Anybody know the command line syntax for this?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >