Search Results

Search found 8 results on 1 pages for 'neutrino'.

Page 1/1 | 1 

  • Excel parsing (xls) date error

    - by tau-neutrino
    I'm working on a project where I have to parse excel files for a client to extract data. An odd thing is popping up here: when I parse a date in the format of 5/9 (may 9th) in the excel sheet, I get 39577 in my program. I'm not sure if the year is encoded here (it is 2008 for these sheets). Are these dates the number of days since some sort of epoch? Does anyone know how to convert these numbers to something meaningful? I'm not looking for a solution that would convert these properly at time of parsing from the excel file (we already have thousands of extracted files that required a human to select relevant information - re-doing the extraction is not an option).

    Read the article

  • Variable height header with scrollable content area filling remaining viewport area

    - by Neutrino
    I've seen versions of this simple problem raised a dozen times here and elsewhere on the web, but I haven't seen a solution that works for me yet so I'm asking it again. I want a webpage with a variable height full width header (height based on contents). Below that I want a content area that fills the rest of the browser viewport. If the content is larger than the remaining space in the viewport then I want the content area to scroll. I don't need this to work on IE6. I don't care whether the solution uses CSS, tables or a mixture of the two, just no frames and no Javascript. For a bonus point fix a variable height footer to the bottom of the page.

    Read the article

  • Disable autocomplete on textfield in Django?

    - by tau-neutrino
    Does anyone know how you can turn off autocompletion on a textfield in Django? For example, a form that I generate from my model has an input field for a credit card number. It is bad practice to leave autocompletion on. When making the form by hand, I'd add a autocomplete="off" statement, but how do you do it in Django and still retain the form validation?

    Read the article

  • Refresh layout while filling it

    - by neutrino
    Hi guys, I have an activity with a HorizontalScrollView. When it opens, I start filling this view (or rather, a container layout inside it) with another views. This is done from another thread by using handler.post. The views are added in bunches of 15, and when there are no more views to add, I start updating them with new data (this is a kind of streaming data from a server). The problem is that the scrollview is empty until all of the views are added. As soon as they are all added and start updating, the scrollview gets drawn. How do I refresh it in the process of adding views? I don't want the screen to be empty for 3 seconds while all of the views are added. Thanks a lot. UPDATE: turned out this problem is not specific for HorizontalScrollView, this is the case for any generic layout.

    Read the article

  • Should onSaveInstanceState save the "enabledness" of the views?

    - by neutrino
    Hi there, I have a preferences activity where I can change the language and the theme of my application. From there I return to the previous activity via the Back key, and I want to recreate the activity. I've managed to do that by reinitializing the layout in onResume and also calling onRestoreInstanceState from there. All the views are restored properly, with checkboxes checked if needed, edittexts filled with texts I left there previously. But I also have a button which is initially disabled, and becomes enabled only when a radiobutton is checked. The problem with it is the following: I check the radiobutton, the button becomes enabled. Then I go to settings, change the theme there, and return to the first activity. When I arrive there, the radiobutton is still checked, but the button is disabled. So it seems that the enabled/disabled state isn't being saved into the bundle, which seems counterintuitive. And I haven't found any code in the Android source that does this, too. Am I missing something, or do I have to write my own code for that?

    Read the article

  • How to vertically align text in a button with a background drawable?

    - by neutrino
    I had a simple button set up with a background image defined like android:background="?attr/button" where ?attr/button was a reference to a simple 9-patch png. Everything worked fine, text in the button was aligned correctly. Then I needed to have a different background for a pressed state of the button. So I changed that to android:background="@drawable/state_button" where @drawable/state_button is an xml with the following states <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/button_pressed" /> <!-- pressed --> <item android:state_focused="true" android:drawable="@drawable/button_pressed" /> <!-- focused --> <item android:drawable="@drawable/button" /> <!-- default --> </selector> And after that I can't align the text properly. If I put android:gravity="center_vertical" the text is drawn about 1/4 of the button height from the top. I double-checked my 9-patch images, everything seems fine with them. And I also tried having regular pngs for the background, it also doesn't change anything.

    Read the article

  • What is the preferred way to indent cases in a switch?

    - by neutrino
    Hey there, As I was writing another switch in Eclipse, I once again came across a rather weird (to me, at least) default indentation, which is applied to 'switch' statements: switch (i) { case 1: ... case n: ... } I tend to prefer another way: switch (i) { case 1: ... case n: ... } Which way is more readable and eye-pleasing for you? I'm still not hundred percent determined what's best for me, so I'd like to stick to what's best for other people who would read my code. BTW, you're free to close this question if this is too subjective. :)

    Read the article

  • User-customizable rails authorization

    - by neutrino
    Hello everyone, Seems there is an abundance of popular declarative-style authorization plugins, which allow you to somehow state in the code that, e.g., this controller action can be accessed by users with such-and-such roles. But what if I need a more dynamic scheme. I want to have an admin area, with a list of all authorizable actions and an ability to assign permissions on actions from the UI. I have ideas how to implement it from scratch, like to define a model corresponding to a controller and/or action and store the permissions via normal associations. Just wonder if there are any ready solutions to this. Thanks a lot

    Read the article

1