Search Results

Search found 100 results on 4 pages for 'casebash'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Display custom title bar for Android with XML

    - by Casebash
    In Android documentation describing "Configuring General Window Properties", it is suggested that specifying properties via XML is preferable whenever possible to avoid seeing the title bar flash. As an example, instead of setting Window.FEATURE_NO_TITLE with requestWindowFeature, they set it to @android:style/Theme.NoTitleBar. Is there a similar way to set a custom title bar to be used in the XML? Update: I just found this article, according to which this article, the best way to draw a title bar is to ignore FEATURE_CUSTOM_TITLE and instead just draw the title bar as part of your main view. This would not only avoid the flashing, but also problems caused by padding.

    Read the article

  • Storing callbacks in a dictionary (Objective C for the iPhone)

    - by Casebash
    I am trying to store callbacks in a dictionary. I can't use blocks as the iPhone doesn't support this (unless you use plblocks). I tried using functions, but apparently NSMutableDictionary doesn't allow these pointers (wants an id) I tried using class methods, but I couldn't find a way to obtain a pointer to these I could try using functions with the c++ stl hashmap (if it is supported in Objective C++), but apparently this can slow compilation times. I could try storing both a class and a selector, but that seems rather messy. What would be the best way to do this?

    Read the article

  • Creating an Android View with a particular style programmatically

    - by Casebash
    How can I create a view with a particular style programmatically (not in XML)? I tried using this [View (Context context, AttributeSet attrs, int defStyle)][1], but I don't know what to parse in for the second argument. Passing in null results in the View not being displayed [1]: http://developer.android.com/reference/android/view/View.html#View(android.content.Context, android.util.AttributeSet, int)

    Read the article

  • Programming language shootout: code most like pseudocode for Dijkstra's Algorithm

    - by Casebash
    Okay, so this question here asked which language is most like executable pseudocode, so why not find out by actually writing some code! Here we have a competition where I will award a 100 point bounty (I know its not much, but I am poor after the recalc) to the code which most resembles this pseudocode. I've read through this a few times so I'm pretty sure that this pseudocode below is correct and about as unambiguous as pseudocode can be. Personally, I'm going to have a go in Python and probably Haskell as well, but I'm just learning the later so my attempt will probably be pretty poor. Note: Obviously to implement anything looking like this you'll have to define quite a few library functions. define DirectedGraph G with: Vertices as V, Edges as E define Vertex A, Z declare each e in E as having properties: Boolean fixed with: initial=false Real minSoFar with: initial=0 for A else infinity define PriorityQueue pq with: objects=V initial=A priority v=v.minSoFar create triggers for v in V: when v.minSoFar event reduced then pq.addOrUpdate v when v.fixed event becomesTrue then pq.remove v Repeat until Z.fixed==True: define Vertex U=pq.pop() U.fixed=True for Edge E adjacentTo U with other Vertex V: V.minSoFar=U.minSoFar+length(E) if reducesValue return Z.name, Z.minSoFar

    Read the article

  • Examples for Android Launch modes

    - by Casebash
    I am finding it hard to understand the exact circumstances in which each the various launch modes would be used in Android. Could anyone provide me with some examples to help understand when the various modes are appropriate?

    Read the article

  • Custom title bar without padding (Android)

    - by Casebash
    So I am using the techniques in this thread to use a custom background for my titlebar. Unfortunately the framework places my layout inside a FrameLayout which has padding and so the image doesn't cover the whole bar, but instead has gray borderes. Is there anyway to remove this padding? I can't just set the padding attributes because I do not create the frame layout.

    Read the article

  • Is url.openStream harmful?

    - by Casebash
    I was using the java.net.URL.openStream() method to retrieve content from the server. I recently ran into an issue where the HTTP Response code indicated an error, but instead of throwing an exception, the stream still was read anyway. This caused the error to appear much later in the execution and proved to be a red herring. As far as I can see, when you have opened a stream using this method, there is no way to check the HTTP response code. The only way I could find to handle this properly was to use code such as: HttpURLConnection conn=(HttpURLConnection) url.openConnection() if(conn.getResponseCode()!=HttpStatus.SC_OK) //Raise Exception; InputStream in=conn.getInputStream() So do you agree? Is it possible to use openStream safely, or is it a method that should be avoided at all costs. It is worth noting that Sun uses the method in their tutorial code for reading directly from a URL. Then again, the code throws Exception so it isn't exactly a bastion of good coding practices.

    Read the article

  • Implementing __concat__

    - by Casebash
    I tried to implement __concat__, but it didn't work >>> class lHolder(): ... def __init__(self,l): ... self.l=l ... def __concat__(self, l2): ... return self.l+l2 ... def __iter__(self): ... return self.l.__iter__() ... >>> lHolder([1])+[2] Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for +: 'lHolder' and 'list' How can I fix this?

    Read the article

  • Why must recursion be in a separate file in hugs?

    - by Casebash
    In Haskell in 5 steps the factorial function is defined as follows: let fac n = if n == 0 then 1 else n * fac (n-1) But for hugs, it says that fac needs to be in fac.h. Can anyone explain why this is the case - missing the ability to define recursion seems like a massive limitation for an interpreter.

    Read the article

  • HTTPS connection in BlackBerry Java Midlet

    - by Casebash
    My Java ME Midlet works fine on Java phones and the BlackBerry simulator, but I can't receive a connection on a BlackBerry. I see a message that asks for permissions to connect, but when I select yes, it doesn't connect. I even checked on the server, but no connection was provided. My application isn't signed. Does anyone know why this might be failing?

    Read the article

  • Apply an Animation on a Drawable in Android

    - by Casebash
    I am adding a glow animation effect to a logo. So far, I have managed to get the glow image behind the logo, using a LayeredDrawable, but I can't figure out how to animate it. I have found that AlphaAnimation would achieve the desired effect, but unfortunately I can only apply it on Views, not Drawables. How can I achieve this effect?

    Read the article

  • Supporting multiple versions without separate builds in JavaME

    - by Casebash
    I want to be able to support multiple versions of Java ME without having to have multiple builds. I already know how to detect the profile/configuration/supported JSRs. My problem is that knowing whether the JSR is supported at run time doesn't allow me to use all the features. For if I call a function added in a later version anywhere in the code - even a location that will never be run, then this will be a compilation error due to static typing. Is there any way round this?

    Read the article

  • Peformance of f#

    - by Casebash
    What is the performance of f# like in terms of both memory and speed? I am particularly interested in your thoughts about what real world applications are viable. Benchmarks would be particularly relevant.

    Read the article

  • Power of programming languages

    - by Casebash
    Are there any objective measures for measuring the power of programming languages? Turing-completeness is one, but it is not particularly discriminating. I also remember there being a few others measures of power which are more limited versions (like finite-state-autonoma), but is there any objective measure that is more powerful?

    Read the article

  • mainframe in Joomla

    - by Casebash
    The hello world tutorial for Joomla states: $mainframe is a global variable in Joomla that has lots of useful methods attached to it. How do I find out what these methods are? I tried searching through their documentation, but I couldn't find any clues.

    Read the article

  • Automatically generating better views for ASP.NET MVC

    - by Casebash
    I am currently watching the 80 minute ASP.NET MVC introduction. Automatically generating views from a model is pretty neat, but it seems to me that that the automatically generated views could be much better. For a start, instead of inputing dates with text boxes, there could be a date control. Additionally, number inputs could be verified client side. There are probably other improvements that could be made as well. Is it possible to automatically generate better views?

    Read the article

< Previous Page | 1 2 3 4  | Next Page >