Daily Archives

Articles indexed Saturday March 20 2010

Page 3/89 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How can I get an Android TableLayout to fill the screen?

    - by Timmmm
    Hi, I'm battling with Android's retarded layout system. I'm trying to get a table to fill the screen (simple right?) but it's ridiculously hard. I got it to work somehow in XML like this: <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent"> <TableRow android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="1"> <Button android:text="A" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1"/> <Button android:text="B" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1"/> </TableRow> <TableRow android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="1"> <Button android:text="C" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1"/> <Button android:text="D" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1"/> </TableRow> However I can not get it to work in Java. I've tried a million combinations of the LayoutParams, but nothing ever works. This is the best result I have which only fills the width of the screen, not the height: table = new TableLayout(this); // Java. You suck. TableLayout.LayoutParams lp = new TableLayout.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT); table.setLayoutParams(lp); // This line has no effect! WHYYYY?! table.setStretchAllColumns(true); for (int r = 0; r < 2; ++r) { TableRow row = new TableRow(this); for (int c = 0; c < 2; ++c) { Button btn = new Button(this); btn.setText("A"); row.addView(btn); } table.addView(row); } Obviously the Android documentation is no help. Anyone have any ideas?

    Read the article

  • jQuery validation plugin - removing elements

    - by d3020
    I'm using the jQuery validation plugin. On most of my input type... tags I have class='required'. When I submit the page, via JavaScript, the controls on the page that have this class are found. However, there are a handful of checkboxes that I don't need to validate. I've tried removing the class code completely from the input tag, also tried class='cancel', and class='required:false. When doing any of those things though when the form submits it can't find the checkbox control. How do I still keep the ability to do Request.Form and find my checkbox object but at the same time when the form submits don't apply validation to this particular control. Thank you. Edit here. This is what I'm using without the "checked" code and ternary operator. In my input tag I'm calling a function like this... sb.Append(" " + crlf); Inside that function is where I check for the True or False coming back, like this. case "chkFlashedCarton": strResultValue = pst.FlashedCarton.ToString(); if (strResultValue == "True") { strResultValue = " checked"; } break; strResultValue is what is returned back. Does this help to see? Thank you.

    Read the article

  • Kubuntu is not Ubuntu

    <b>Apachelogger's Log:</b> "This post is supposed to make it clear why Kubuntu is what it is. Writing this down is necessary because people constantly get the wrong picture."

    Read the article

  • URL rewriting in .htaccess

    - by Steven
    Ugly URLs: www.domainname.com/en/piece/piece.php?piece_id=1 www.domainname.com/en/piece/piece.php?piece_id=2 www.domainname.com/en/piece/piece.php?piece_id=3 ... Friendly URLs: piece.domainname.com/en/1 piece.domainname.com/en/2 piece.domainname.com/en/3 ... I want to present website users only friendly URLs. How to do it? Do I have to use RedirectMatch, if so, how to do it?

    Read the article

  • The Alias directive ... will probably never match because it overlaps an earlier Alias.

    - by mmattax
    I'm getting this warning from Apache: The Alias directive in /etc/httpd/conf.d/foo.conf at line 10 will probably never match because it overlaps an earlier Alias. However the Alias overlaps on a completely different virtual host. Might this be caused because one alias is on a name-based virtual host while the other alias is on an IP-based virtual host? Everything is working fine, just the warning is a bit annoying...

    Read the article

  • If spambots are filling out forms on my website, should I mark the mail as spam?

    - by rob
    Apparently spambots have discovered the contact forms my website. I'm considering adding a CAPTCHA, but in the meantime I've been getting dozens of completed website forms in my Gmail account each day. I know I can configure a filter to always allow e-mails from my website to be delivered (i.e., "never send to spam"), but I'm wondering whether there are also larger implications. At first, I was marking the spam forms as spam because I figured it would block the sender's e-mail address from getting through again. But since then, I've given it some more thought. I know many spam filters use Bayesian filters and other techniques to identify spam based on its content. If I mark all these e-mails as spam, will legitimate e-mails from my website be marked as spam? Even if I stop marking the messages as spam, I can see another potential problem. My form is pretty standard (in fact, it's probably very similar to other online forms). If I mark my spambot-submitted website forms as spam, will Gmail begin to mark other people's similar-looking messages as spam?

    Read the article

  • Ubuntu bash command

    - by pedro
    List in long form files in the directory "/ etc" for the file "ETCDIR" and view them, while the monitor sequential manner. how i can do it? with commands tee and more

    Read the article

  • How to get around the event bubble using jQuery's: .live()

    - by Nick
    Hi there. Here is the code in question: $(".navItems>ul>li").live('click', function(){ var selectorID = $(this).attr('id'); $(".infoList").slideUp('fast', function(){ switchTabInfo(selectorID); }); function switchTabInfo(selectorID){ var actionID = selectorID.substring(4); actionID = "#" + actionID; $(actionID).slideDown(); } So in short i have a these .infoList classes with id names tied to back to the nav li id. That lists item's id might be nav_testsHistory for example. With all the content boxes hidden by class name this javascript makes a pleasing slide up, down effect. But the third content box flickers as will the second one after a third box push. It slides up and down a second unnecessary time. If I add an alert like this: $(".navItems>ul>li").live('click', function(){ var selectorID = $(this).attr('id'); $(".infoList").slideUp('fast', function(){ switchTabInfo(selectorID); alert('bubble'); }); The alert fires 3 times?! So my research took to reading about the event bubble. What I cannot find is how to check if it has been fired. I have not tried setting an input val and doing a tf test around the nested slider action. Cause that's crude. More info, all the code above is in a function, which is in an init() function, which is called on document ready. That's the only js file besides jquery 1.3.2. What do you guys think?

    Read the article

  • Linq-to-SQL: How to shape the data with group by?

    - by Cheeso
    I have an example database, it contains tables for Movies, People and Credits. The Movie table contains a Title and an Id. The People table contains a Name and an Id. The Credits table relates Movies to the People that worked on those Movies, in a particular role. The table looks like this: CREATE TABLE [dbo].[Credits] ( [Id] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY, [PersonId] [int] NOT NULL FOREIGN KEY REFERENCES People(Id), [MovieId] [int] NOT NULL FOREIGN KEY REFERENCES Movies(Id), [Role] [char] (1) NULL In this simple example, the [Role] column is a single character, by my convention either 'A' to indicate the person was an actor on that particular movie, or 'D' for director. I'd like to perform a query on a particular person that returns the person's name, plus a list of all the movies the person has worked on, and the roles in those movies. If I were to serialize it to json, it might look like this: { "name" : "Clint Eastwood", "movies" : [ { "title": "Unforgiven", "roles": ["actor", "director"] }, { "title": "Sands of Iwo Jima", "roles": ["director"] }, { "title": "Dirty Harry", "roles": ["actor"] }, ... ] } How can I write a LINQ-to-SQL query that shapes the output like that? I'm having trouble doing it efficiently. if I use this query: int personId = 10007; var persons = from p in db.People where p.Id == personId select new { name = p.Name, movies = (from m in db.Movies join c in db.Credits on m.Id equals c.MovieId where (c.PersonId == personId) select new { title = m.Title, role = (c.Role=="D"?"director":"actor") }) }; I get something like this: { "name" : "Clint Eastwood", "movies" : [ { "title": "Unforgiven", "role": "actor" }, { "title": "Unforgiven", "role": "director" }, { "title": "Sands of Iwo Jima", "role": "director" }, { "title": "Dirty Harry", "role": "actor" }, ... ] } ...but as you can see there's a duplicate of each movie for which Eastwood played multiple roles. How can I shape the output the way I want?

    Read the article

  • iPhone App IDs and Provisioning... Does App ID get used instead of provisioning ID if I decide to us

    - by Jann
    This is a question that has been bugging me for a while. I started my app (now submitted -- not yet approved) not wishing to get into the mess that is APNS (Push). I did the following: iPhone Developer Center: Provisioning Portal-Provisioning: Then I created a Development and a Distribution Provisioning Profile. I installed both in XCode. Everything hunky dory. The Development profile scares me a bit by expiring so soon (90 days) but I can remove it from the iPhone(s) and sign it with a new one later. I tested using the Development profile, and later to submitted it by signing it with the Distribution profile. I then uploaded the Distribution profile-signed app to iTunesConnect (app store). Okay, I understand that much. Now, what I don't understand is this: Now that I understand the theories and methods behind how Push works, I am wishing to add it to my app. I already went under: iPhone Developer Center: Provisioning Portal-App IDs: and created a Development Provisioning Profile and Distribution Provisioning Profile there (push & in-app purchase enabled). Here is where it gets confusing to me. All the books and docs I have read say that I have to sign the app with this "App ID" provisioning profile (push-enabled) from now on. Does that mean I no longer ever use the previously created provisioning profiles? If I were to import these "App ID" provisioning profiles into Xcode they will exist alongside my previously generated "non-push" profiles. ~/Library/Mobile Devices/Provisioning Profiles now has 2 files. One Devel and one Distrib. It will now have 4 even though for this app I will not use the "non-push" anymore right? (actually, since they are locked by using bundle-codes and app ids i will never use it again if all of my further versions of this app use Push?) Confused. Can anyone enlighten me? Why not use the "App ID" profiles in the first place for everyone -- even if you are not gonna use push? Would keep it simpler. Should I only generate "Push Enabled" profiles from now on -- even if i am not sure I am gonna use push (or for that matter in-app purchase)? Please give me some insight. I do not wanna do this wrong. Thanks! Jann

    Read the article

  • SQL Server 2008 Restore from Backup fails with error 3241 'cannot process this media family'

    - by pearcewg
    I am attempting to backup a database from a SQL Server instance on one machine and restore it to another, and I am encountering the frequently discovered 'SQL Server cannot process this media family' error. Each of my instances are SQL Server 2008, but with different patch levels Restore: 10.0.2531.0 Backup: 10.0.1600.22 ((SQL_PreRelease).080709-1414 ) The restore DB is express. Not sure about the backup version. The backup version is on a virtual private server. The restore is on my development box. When I restore to a different database on the source (backup) server, it restores fine. Lots of stuff on google about this issue, some on stackoverflow about this issue, but nothing which is this exact situation. Any thoughts? It should be straightforward to do a backup and restore from one machine to another (having done this thousands of times in with SQL 6.5,7,2000,2005).

    Read the article

  • Overriding !important style using Javascript

    - by Enrico
    Title pretty much sums it up. The external style sheet has the following code: td.EvenRow a{ display: none !important; } I have tried using: element.style.display = "inline"; and element.style.display = "inline !important"; but neither works. Is it possible to override an !important style using javascript. This is for a greasemonkey extension, if that makes a difference. Much appreciated, Enrico

    Read the article

  • Android: how to tell if a view is scrolling

    - by Dave
    in iPhone, this would be simple---each view has a scrollViewDidScroll method. I am trying to find the equivalent in Android. My code works, but it isn't giving me what I want. I need to execute code the entire duration that a view is scrolling. So, even though I use OnGestureListener's onScroll method, it only fires when the finger is on the screen (it's not really named correctly---it should be called "onSlide" or "onSwipe", focusing on the gesture rather than the UI animation). It does not continue to fire if the user flicks the view and it is still scrolling for a few moments after the user lifts his finger. is there a method that is called at every step of the scroll? public class Scroll extends Activity implements OnGestureListener { public WebView webview; public GestureDetector gestureScanner; public int currentYPosition; public int lastYPosition; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); webview = new WebView(this); setContentView(webview); webview.loadUrl("file:///android_asset/Scroll.html"); gestureScanner = new GestureDetector(this); currentYPosition = 0; lastYPosition = 0; } public boolean onTouchEvent(final MotionEvent me) { return gestureScanner.onTouchEvent(me); } public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { // I do stuff here. return true; }

    Read the article

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