Today's hack is up. It's to the flashlight app again; now the UI stays in portrait orientation no matter how you rotate the phone. This prevents the pause/resume/create cycle that was killing my Activity and causing the light to go out. Most of yesterday's code is no longer needed and has been taken out again, but that's a good thing, right? :-)
Sideload the app (if you care - HTC Sense has such a thing built-in) from here.
Anyway, the way you do this is by adding the attribute
By the way, does anyone use
Edit: and I've had a documentation patch accepted into Idris. Go me!
Sideload the app (if you care - HTC Sense has such a thing built-in) from here.
Anyway, the way you do this is by adding the attribute
android:screenOrientation="portrait"
to the activity
element in your manifest. This tip came from this StackOverflow post: I tried the more complicated "add a configChanges
attribute and override onConfigurationChanged
" approach described there, but that resulted in the LED wedging in whatever state it was in when you rotated the phone and not accepting any further changes. God knows what was going on there.By the way, does anyone use
git add -p
much? I tried the "edit this hunk" feature a couple of times, but it told me that it my patch wouldn't apply cleanly, and then rejected the whole thing. Also, I'm having trouble uploading files to GitHub's "download" section.Edit: and I've had a documentation patch accepted into Idris. Go me!
Tags:
I use add -p all the time...
I just checked with my co-worker:
I'll ask around and let you know if I find out anything.
Re: I use add -p all the time...
Re: I use add -p all the time...
I’m a huge fan of
git add -p
; in fact, I’ve gone so far as togit config alias.p 'add --patch'
. I also recommendgit config interactive.singlekey yes
, which means you don’t need to hit return after indicating the disposition for each hunk.I agree that the “edit patch” feature can be a little hard to get to grips with. But I use it frequently, and I estimate that my edited patches apply cleanly at least eight times out of ten. I don’t know that there’s a trick to it, but I find it helps to bear in mind the preimage that the patch will be applied to, and make sure the (edited) context matches it.
As it happens, I used the “edit patch” feature about ten minutes ago, and I got the “Your edited hunk does not apply” error. But once I’d hit
y
to reedit, it was clear where I’d garbled the context. Pozorvlak, feel free to ask me for help any time it isn’t behaving the way you want.Re: I use add -p all the time...
Re: I use add -p all the time...
You mean, the hunk header with the
@@
and the line numbers? If so, then no, but then I use Emacs’s diff-editing mode, which automatically keeps hunk headers correct as you edit. However, I’ve just triedenv EDITOR=vim git add -p
, and edited a patch in a way that changes the number of lines added and removed, and Git seems to have handled it fine.(Sorry to nitpick the terminology, but I think that’s what you mean, and for diffs, “context” usually means the space-prefixed lines that show surrounding unchanged code, and that can be used to apply patches even when the line numbers match only fuzzily.)
Re: I use add -p all the time...
no subject
no subject
1) they're really quite different under the hood,
2) they use similar terminology for different things,
3) they use different terminology for similar things.
Fortunately for you, I plan to write a Darcs/Git rosetta stone post soon (in preparation for my talk on this subject to Glasgow.pm next Tuesday... gulp!)
How complex is your project, by the way? I know they still use darcs for GHC, but then they're Haskell hackers, and probably don't mind the occasional enforced period of hard thinking :-)
[To be fair to the darcs team, the recently announced darcs 2.5 includes many speed improvements, including some which lower asymptotic complexity.]
no subject
The project was/is huge, in terms of total file size - I can't remember how huge, and I can't check it atm, due to job move chaos. But basically, it was too big for darcs, and I hit some sort of out-of-memory or infinite loop issue. That's why I went for git - my project was huge but not as huge as Linux ;)
no subject
What you need to do here is set the
origin
remote up so that git remembers the central repo for you. See here (http://help.github.com/creating-a-repo/) and here (http://help.github.com/remotes/).I think that git probably has equal ability to handle distributed repos, but darcs certainly makes it easier.
no subject
no subject
no subject
I have non-Market installations enabled on the phone, and I can install apps that I've compiled myself.
no subject
no subject
no subject
no subject
The Android app looks very cool indeed. I'll see if I can install it and give it a trial in a suitably dark place...
no subject
1) it looks a lot like Haskell,
2) but types can be parametrised by values, not just other types (think "vector of length n" or "kg^1 m^1 s^-2")
3) you can do the sort of low-level bit-twiddling necessary for network stacks or operating systems.
I've been wanting to learn about dependent typing for a while, but AFAICT most such languages are afterthoughts tacked on to proof assistants - when I asked some Epigram guys if their language could be used to write web apps, they reacted with horror and disgust. Whereas Idris is all about writing actual programs, to see how useful dependent typing actually is. Easy choice, as far as I'm concerned.
Plus, I know the author :-)
no subject
Is there a functional language you'd recommend for learning about the paradigm?
no subject
[As you probably know, the Curry-Howard isomorphisms mean that type-checking is equivalent to proving logical statements: the more sophisticated your type system, the more complex the logical language in which you're doing proofs. If your type system has dependent types, then the related logic is complex enough that finding proofs is no longer computable, so you need to provide some kind of human-directed proof assistant. But now you can use your programming language to write programs which calculate proofs, so the whole thing goes round in circles :-)]
Another interesting choice might be Epigram, though I've never tried it and the syntax looks frankly barking.
no subject
About four years ago, I won a Sony-Ericsson K750i in a competition. It was a lovely phone. The LED flashlight was one of about four features I actually used on it (the others being phone, text, and camera). Then it died, as all SE phones tend to (damn the physical joysticks!). I couldn't get another K750i, but there was an "upgraded" version - but it lacked the torch! It was also too big, pig-ugly, and not coincidentally the last SE phone I've used. So I've been jonesing for a torch on my phone ever since. When I discovered that the FroYo API supported such a thing, but that there was no built-in app for it on the N1, well...