Daily Archives

Articles indexed Wednesday May 12 2010

Page 7/121 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Is choiceMode compatible with ExpandableListView?

    - by kostmo
    Is it possible to make a multiple choice list with android:choiceMode="multipleChoice" or setChoiceMode(ListView.CHOICE_MODE_MULTIPLE) on an ExpandableListView? I am able to do this with CheckBoxes on a plain ListView, but it doesn't seem to be working with ExpandableListView. In the latter, clicking the list item (either parent or child) does not affect the checkbox as it does in the former. I have noticed that it is possible to click exactly on the checkbox to make it toggle, but this is a very small target.

    Read the article

  • What's the easiest way to add Java servlets to a WAMP configured machine?

    - by Rhubarb
    I have WAMP installed on my local machine and am looking to serve up charts using jFree's Eastwood charting, which requires me to use servlets. So basically I will insert images with src tags that have URLs pointing to my servlet on the same machine. What's the easiest way to enable servlets on the same machine? Do I need to install a servlet server on a different port? Or is there a way to integrate it into WAMP?

    Read the article

  • What .gitignore I should use with QT projects? (QT Creator)

    - by Envek
    So, after little thinking I have wrote the following: # In repository we don't need to have: # Compiled object files *.o # Generated MOC, resource and UI files moc_*.cpp qrc_*.cpp ui_*.h # Built windows .exe and linux binaries # NOTE: PROJECT is a your project's name, analog of PROJECT.exe in Linux *.exe *.dll PROJECT # Windows-specific files Thumbs.db desktop.ini # Editors temporary files *~ # Debug and Release directories (created under Windows, not Linux) Debug/ Release/ Please ask, what needs to be added or fixed (especially for Windows - I haven't one under hand now. And Mac too [haven't work in it at all]). I want to keep my repository clear :-)

    Read the article

  • retrieving background image from div when dynamically set

    - by tixrus
    I am having an issue with setting the background-image of a #x to the background image of #y. Correct me if I am wrong but I think you would do this in a simple case by saying $('#x').css('background-image',$('#y').css('background-image')); The problem is that when y was initially set up, it was set up like this: <div id='y' style='background-image: url(./randomcolor.php?ibase=<?php echo $entity->name; ?>) .... So when it does it, it is getting the URL of the generator, and javascript is just regarding that as a string. Do I have to do an ajax get here, or is there some kind of eval I could use.

    Read the article

  • Rubygems on Debian: Gems won't load (LoadError)

    - by daswerth
    I've installed the development version of Crunchbang, a linux distro based off Debian. I got Ruby and Rubygems installed, but I can't get the gems I've installed to load. Here is a command-line session: $ ruby -v ruby 1.9.1p378 (2010-01-10 revision 26273) [i486-linux] $ gem env RubyGems Environment: - RUBYGEMS VERSION: 1.3.6 - RUBY VERSION: 1.9.1 (2010-01-10 patchlevel 378) [i486-linux] - INSTALLATION DIRECTORY: /usr/lib/ruby1.9.1/gems/1.9.1 - RUBY EXECUTABLE: /usr/bin/ruby1.9.1 - EXECUTABLE DIRECTORY: /usr/bin - RUBYGEMS PLATFORMS: - ruby - x86-linux - GEM PATHS: - /usr/lib/ruby1.9.1/gems/1.9.1 - /home/corey/.gem/ruby/1.9.1 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://rubygems.org/ $ echo $PATH /home/corey/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/corey/.gem/ruby/1.9.1:/usr/lib/ruby1.9.1/gems/1.9.1 $ gem list -d nokogiri `*** LOCAL GEMS ***` nokogiri (1.4.1) Authors: Aaron Patterson, Mike Dalessio Rubyforge: http://rubyforge.org/projects/nokogiri Homepage: http://nokogiri.org Installed at: /usr/lib/ruby1.9.1/gems/1.9.1 Nokogiri (?) is an HTML, XML, SAX, and Reader parser $ ruby -r rubygems -e "require 'nokogiri'" -e:1:in `require': no such file to load -- nokogiri (LoadError) from -e:1:in `' I've encountered similar problems on Ubuntu before, but they were easy to fix. I can't figure out what's wrong in this particular case, and Google didn't seem to know either. Any help would be greatly appreciated! By the way... this is my first submission to stackoverflow. I hope this question is relevant. :)

    Read the article

  • LVM, Soft RAID1, and Replication?

    - by mtkoan
    Hi all, I am practicing putting together a HA file server. It is a linux server with 2 1.5TB Hard drives. My plan is to use LVM to manage the physical volumes into logical volumes for /, /home, and /var. Then use md (soft RAID 1) to mirror the image onto the second HDD, THEN use DRDB to mirror the entire setup another server. Is this overkill? Would I just be okay with just md and DRDB? The system will serve user's homedirs (~100) and probably some groupware or other local intranet. On my own machines I've always separated root and /home partitions in case I break something, I can easily reinstall the OS. Should I follow that same theory here? If so I need LVM, because I really can't predict where we'll need more space, /var or /home.

    Read the article

  • How can I optimize this or is there a better way to do it?(HTML Syntax Highlighter)

    - by Tanner
    Hello every one, I have made a HTML syntax highlighter in C# and it works great, but there's one problem. First off It runs pretty fast because it syntax highlights line by line, but when I paste more than one line of code or open a file I have to highlight the whole file which can take up to a minute for a file with only 150 lines of code. I tried just highlighting visible lines in the richtextbox but then when I try to scroll I can't it to highlight the new visible text. Here is my code:(note: I need to use regex so I can get the stuff in between < & characters) Highlight Whole File: public void AllMarkup() { int selectionstart = richTextBox1.SelectionStart; Regex rex = new Regex("<html>|</html>|<head.*?>|</head>|<body.*?>|</body>|<div.*?>|</div>|<span.*?>|</span>|<title.*?>|</title>|<style.*?>|</style>|<script.*?>|</script>|<link.*?/>|<meta.*?/>|<base.*?/>|<center.*?>|</center>|<a.*?>|</a>"); foreach (Match m in rex.Matches(richTextBox1.Text)) { richTextBox1.Select(m.Index, m.Value.Length); richTextBox1.SelectionColor = Color.Blue; richTextBox1.Select(selectionstart, -1); richTextBox1.SelectionColor = Color.Black; } richTextBox1.SelectionStart = selectionstart; } private void pasteToolStripMenuItem_Click(object sender, EventArgs e) { try { LockWindowUpdate(richTextBox1.Handle);//Stops text from flashing flashing richTextBox1.Paste(); AllMarkup(); }finally { LockWindowUpdate(IntPtr.Zero); } } I want to know if there's a better way to highlight this and make it faster or if someone can help me make it highlight only the visible text. Please help. :) Thanks, Tanner.

    Read the article

  • Should old/legacy/unused code be deleted from source control repository?

    - by Checkers
    I've encountered this in multiple projects. As the code base evolves, some libraries, applications, and components get abandoned and/or deprecated. Most people prefer to keep them in. The usual argument is that the code does not really take any space, it can be left alone until needed again. So a repository slowly turns into a cesspool of legacy code, where it's hard to find anything. Some people delete old code, since it creates clutter, raises more questions for new people, and you can restore any old snapshot of the code base anyway. However you can't always find the old code if you don't know where to look, as none of the (common) VCS I know offer search over the entire repository including all historical revisions, and the only way to search the old files is to check out the revision where the deleted file exists. What would be a good approach to repository management?

    Read the article

  • Arrays of different types

    - by Tyler
    Hi - Is it possible to have an array that contains two different types of data? I want to have an array that contains a double and also a string. I attempted: ArrayList<double><String> array; But that didn't work. Sorry for the silly question, but it has been a while since I have used something like this.. Can you refresh my memory on how would I declare and populate such an array? And then to take it a step further, I would like to sort the array by the double if possible? Thanks!

    Read the article

  • Is this scatter-brained workflow realizable in Git?

    - by Luke Maurer
    This is what I'd like my workflow to look like at a conceptual level: I hack on my new feature for a while I notice a typo in a comment I change it Since the typo is completely unrelated to anything else, I put that change in a pile of comment fixes I keep working on the code I realize I need to flesh out a few utility functions I do so I put that change in its own pile Steps 2, 3, and 4 each repeat throughout the day I finish the new feature and put the changes for that feature in a pile I push nice patches upstream: One with the new feature, a few for the other tweaks, and one with a bunch of comment fixes if enough have accumulated Since I'm both lazy and a perfectionist, I want to be able to do some things out of order: I might correct a typo but forget to put it in the comment fix pile; when I prepare the upstream patches (I'm using git-svn, so I need to be pretty deliberate about these), I'll then pull out the comment fixes at that point. I might forget to separate things altogether until the very end. But I might /also/ have committed some of the piles along the way (sorry, the metaphor is breaking down …). This is all rather like just using Eclipse changesets with SVN, only I can have different changes to the same file in different piles (having to disentangle changes into different commits is what motivated me to move to git-svn, in fact …), and with Git I can have my full discombobulated change history, experimental branches and all, but still make a nice, neat patch. I've just recently started with Git after having wanted to for a good while, and I'm quite happy so far. The biggest way in which the above workflow doesn't really map into Git, though, is that a “bin” can't really be just a local branch, since the working tree only ever reflects the state of a single branch. Or maybe the Git index is a “pile,” and what I want is to have more than one somehow (effectively). I can think of a few ways to approximate what I want (maybe creative use of stash? Intricate stash-checkout-merge dances?), but my grasp on Git isn't solid enough to be sure of how best to put all the pieces together. It's said that Git is more a toolkit than a VCS, so I guess the question comes down to: How do I build this thing with these tools?

    Read the article

  • ActionMailer sent with body unavailable in view

    - by yelvert
    So ive got a ActionMailer mailer class ReportMailer < ActionMailer::Base def notify_doctor_of_updated_document(document) recipients document.user.email_id from "(removed for privacy)" subject "Document #{document.document_number} has been updated and saved as #{document.status}" sent_on Time.now body :document => document end end and the view is Document <%= @document.class %> but when running >> d = Document.last => #<Document id: "fff52d70-7ba2-11de-9b70-001ec9e252ed", document_number: "ABCD1234", procedures_count: 0, user_id: "630", created_at: "2009-07-28 18:18:07", updated_at: "2009-08-30 20:59:41", active: false, facility_id: 94157, status: "incomplete", staff_id: nil, transcriptionist_id: nil, job_length: nil, work_type: nil, transcription_date: nil, non_trans_edit_date: nil, pervasync_flag: true, old_id: nil> >> ReportMailer.deliver_notify_doctor_of_updated_document(d) => #<TMail::Mail port=#<TMail::StringPort:id=0x8185326c> bodyport=#<TMail::StringPort:id=0x8184d6b4>> from the console this is printed in the log Sent mail to (removed for privacy) Date: Tue, 11 May 2010 20:45:14 -0500 From: (removed for privacy) To: (removed for privacy) Subject: Document ABCD1234 has been updated and saved as incomplete Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=mimepart_4bea082ab4ae8_aa4800b81ac13f5 --mimepart_4bea082ab4ae8_aa4800b81ac13f5 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: Quoted-printable Content-Disposition: inline Document NilClass= --mimepart_4bea082ab4ae8_aa4800b81ac13f5--

    Read the article

  • Why is IE8 on XP not properly reading from XML using JQuery?

    - by dking
    Given this XML in data.xml <?xml version="1.0" encoding="utf-8"?> <data> <bar>100</bar> </data> I want to display the content from the "bar" element using the following code in test.html <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> </head> <body> <script type="text/javascript"> $.get('data.xml', function(xml) { var foo = $(xml).find('bar').text(); document.write("<span>foo: [" + foo + "]</span>"); }); </script> </body> </html> The output in webkit based browsers: foo: [100] The output in IE8 on XP: foo: [] Why do webkit browsers read the element's content correctly while IE8 interprets it as an empty string?

    Read the article

  • Eliminate full table scan due to BETWEEN (and GROUP BY)

    - by Dave Jarvis
    Description According to the explain command, there is a range that is causing a query to perform a full table scan (160k rows). How do I keep the range condition and reduce the scanning? I expect the culprit to be: Y.YEAR BETWEEN 1900 AND 2009 AND Code Here is the code that has the range condition (the STATION_DISTRICT is likely superfluous). SELECT COUNT(1) as MEASUREMENTS, AVG(D.AMOUNT) as AMOUNT, Y.YEAR as YEAR, MAKEDATE(Y.YEAR,1) as AMOUNT_DATE FROM CITY C, STATION S, STATION_DISTRICT SD, YEAR_REF Y FORCE INDEX(YEAR_IDX), MONTH_REF M, DAILY D WHERE -- For a specific city ... -- C.ID = 10663 AND -- Find all the stations within a specific unit radius ... -- 6371.009 * SQRT( POW(RADIANS(C.LATITUDE_DECIMAL - S.LATITUDE_DECIMAL), 2) + (COS(RADIANS(C.LATITUDE_DECIMAL + S.LATITUDE_DECIMAL) / 2) * POW(RADIANS(C.LONGITUDE_DECIMAL - S.LONGITUDE_DECIMAL), 2)) ) <= 50 AND -- Get the station district identification for the matching station. -- S.STATION_DISTRICT_ID = SD.ID AND -- Gather all known years for that station ... -- Y.STATION_DISTRICT_ID = SD.ID AND -- The data before 1900 is shaky; insufficient after 2009. -- Y.YEAR BETWEEN 1900 AND 2009 AND -- Filtered by all known months ... -- M.YEAR_REF_ID = Y.ID AND -- Whittled down by category ... -- M.CATEGORY_ID = '003' AND -- Into the valid daily climate data. -- M.ID = D.MONTH_REF_ID AND D.DAILY_FLAG_ID <> 'M' GROUP BY Y.YEAR Update The SQL is performing a full table scan, which results in MySQL performing a "copy to tmp table", as shown here: +----+-------------+-------+--------+-----------------------------------+--------------+---------+-------------------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+-----------------------------------+--------------+---------+-------------------------------+--------+-------------+ | 1 | SIMPLE | C | const | PRIMARY | PRIMARY | 4 | const | 1 | | | 1 | SIMPLE | Y | range | YEAR_IDX | YEAR_IDX | 4 | NULL | 160422 | Using where | | 1 | SIMPLE | SD | eq_ref | PRIMARY | PRIMARY | 4 | climate.Y.STATION_DISTRICT_ID | 1 | Using index | | 1 | SIMPLE | S | eq_ref | PRIMARY | PRIMARY | 4 | climate.SD.ID | 1 | Using where | | 1 | SIMPLE | M | ref | PRIMARY,YEAR_REF_IDX,CATEGORY_IDX | YEAR_REF_IDX | 8 | climate.Y.ID | 54 | Using where | | 1 | SIMPLE | D | ref | INDEX | INDEX | 8 | climate.M.ID | 11 | Using where | +----+-------------+-------+--------+-----------------------------------+--------------+---------+-------------------------------+--------+-------------+ Related http://dev.mysql.com/doc/refman/5.0/en/how-to-avoid-table-scan.html http://dev.mysql.com/doc/refman/5.0/en/where-optimizations.html http://stackoverflow.com/questions/557425/optimize-sql-that-uses-between-clause Thank you!

    Read the article

  • libmcrypt and MS Visual C++

    - by macki
    Has anyone tried using libmcrypt and visual c++? I was trying to use Crypto++ but it seems not fully compatible - and I need to decrypt data encrypted in PHP using linux libmcrypt. I found only cygwin version of libmcrypt but no .lib files or header. I'm using RIJNDAEL_128 - maybe there is easier way to decrypt it in Visual C++? Thanks

    Read the article

  • Cleaning up temp folder after long-running subprocess exits

    - by dbr
    I have a Python script (running inside another application) which generates a bunch of temporary images. I then use subprocess to launch an application to view these. When the image-viewing process exists, I want to remove the temporary images. I can't do this from Python, as the Python process may have exited before the subprocess completes. I.e I cannot do the following: p = subprocess.Popen(["imgviewer", "/example/image1.jpg", "/example/image1.jpg"]) p.communicate() os.unlink("/example/image1.jpg") os.unlink("/example/image2.jpg") ..as this blocks the main thread, nor could I check for the pid exiting in a thread etc The only solution I can think of means I have to use shell=True, which I would rather avoid: cmd = ['imgviewer'] cmd.append("/example/image2.jpg") for x in cleanup: cmd.extend(["&&", "rm", x]) cmdstr = " ".join(cmd) subprocess.Popen(cmdstr, shell = True) This works, but is hardly elegant, and will fail with filenames containing spaces etc.. Basically, I have a background subprocess, and want to remove the temp files when it exits, even if the Python process no longer exists.

    Read the article

  • MacBook (13 in. Aluminum late 08) power adapter starting to fail

    - by Mr. Man
    I have a MacBook (Late '08 13 In. Aluminum) with the Apple provided power adapter. I think it may be failing because It takes a little moving around with the cable nearest where it connects to the MacBook to get it to charge (small light turns on). The area of cable nearest the MacBook gets very hot, almost burning. Any ideas of how I could fix it? Hopefully without replacing the adapter. Thanks in advance!

    Read the article

  • Calling javascript method from from inside object

    - by John
    I am struggling with methods in JavaScript. obj = function(){ this.getMail = function getMail (){ } //Here I would like to run the get mail once but this.getMail() or getMail() wont work } var mail = new obj(); mail.getMail(); How do I make the method in a way that I can run it both inside the object and from the outside Thanks

    Read the article

  • Continue overflow:auto behavior when page is resized smaller, instead of shifting to the side?

    - by danielle
    Sorry if the title was confusing; I've included some screen shots to more clearly explain my problem. I have a page that has a side navigation menu on the left, and a main div (with the tables) on the right: When the page is resized to be smaller, the "overflow-x:auto" property of the "main" div brings up a horizontal scrollbar: However, when the window becomes narrow to the point that the "main" div reaches the border of the side navigation menu (with the title "Contents"), the "main" div ceases to continue producing the horizontal scrollbar and instead meshes with the menu: Here is the CSS for the "main" div: #main { height: 100%; width: 65%; min-width: 10%; float:right; overflow-y: auto; overflow-x: auto; padding: 0 20px 20px;} and the left side menu: #sidenav{ margin-left: 20px; float: left; overflow-x:auto; overflow-y:auto;} Both of those divs are encapsulated together in "container": .container { bottom: 20px; left: 0; position: absolute; right: 0; top: 50px; } How can I rewrite my code in such a way that the "main" div will continue to use its horizontal scrollbar, and never cross the boundary of the side navigation menu? Thanks in advance!

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >