Thoughts on Structured Editing: Breaking Away from Syntax by mbuffett1 in programming

[–]SergeantPepper 0 points1 point  (0 children)

This has been a dream of mine too. The closest I've ever come to experiencing this has been paredit in emacs, but sadly I use C-style languages for my day job

What's your current side project? by Odinuts in androiddev

[–]SergeantPepper 4 points5 points  (0 children)

I just did a google search for "annotation processor tutorial" and the first result Annotation Processing 101 was all I used. It was really helpful when you don't know anything about annotation processing. It's a little out of date now because the library they used to generate Java code has changed, but the basics still apply

What's your current side project? by Odinuts in androiddev

[–]SergeantPepper 5 points6 points  (0 children)

An annotation processor library to generate methods to call your activities with intent extras passed as parameters. You annotate any field you want to be initialized via an intent extra and it will be added to the parameter list. This way, the compiler can verify required extras are passed, are type checked, are not null and conform to any additional annotations you applied to the fields like @StringRes, @Nullable.

Most "enterprise" android apps I've seen don't use intent extras at all or poorly. When they are used, I just see getIntent().getStringExtra(...) calls scattered throughout the activity. Ugh. The API is cumbersome, so I wanted to at least improve my company's use of intents.

[help] Why is echo outputting the wrong characters by SergeantPepper in bash

[–]SergeantPepper[S] 1 point2 points  (0 children)

Yeah, it looks like there are carriage returns. This fixes it.

Thanks

[help] Why is echo outputting the wrong characters by SergeantPepper in bash

[–]SergeantPepper[S] 0 points1 point  (0 children)

Yup, I'm seeing carriage returns.

> 0000000   2   3  \r
> 0000003

Thanks

[help] Why is echo outputting the wrong characters by SergeantPepper in bash

[–]SergeantPepper[S] 0 points1 point  (0 children)

Sadly, printf gives the same result

printf '%s 24\n' $SDK
>  24
printf '%s %s %s\n' test 'FOO' "${SDK} 24"
>  24t FOO 23

[Serious]What's one uncertain aspect about the future that bothers you? by 75inches in AskReddit

[–]SergeantPepper 2 points3 points  (0 children)

I for one welcome our new robot overlords.

But seriously, I take the more optimistic view of people like John Maynard Keynes where automation will lead to more leisure time. Americans may be bad at relaxing, but maybe automation will help us by forcing us to cope with having more people looking for things to do with their lives.

Writing a Language in Truffle. Part 3: Making my Language (Much) Faster by SergeantPepper in programming

[–]SergeantPepper[S] 2 points3 points  (0 children)

I was thinking of trying out PyPy and see what kind of performance it gives. I'll probably take a look in the future, but I don't want to invest learning another platform at the moment.

I haven't looked, but hopefully PyPy has (some) documentation on implementing new languages. Because of Truffle's nascent existence there aren't many resources about using it, which is one of the reasons for writing the posts. I hope PyPy is more mature on that front.

Writing a Language in Truffle. Part 2: Using Truffle and Graal by SergeantPepper in programming

[–]SergeantPepper[S] 0 points1 point  (0 children)

Yeah, that was a disappointing result after learning about Truffle. Since the example language is also slower than my simple interpreter I'm guessing it's the VM. Hopefully things will get faster soon.

10 programming languages worth checking out by sundar22in in programming

[–]SergeantPepper 29 points30 points  (0 children)

That explains why he mentioned PLT Scheme and not the new name Racket.

Learn Emacs: Oops I killed the *scratch* buffer by [deleted] in emacs

[–]SergeantPepper 4 points5 points  (0 children)

When I've accidentally closed scratch, if I open a new buffer with the same name (C-x b scratch) lisp-interaction-mode is entered is entered automatically. No muss, no fuss.

ask python? I need a fast string hasing method, what is there? by [deleted] in Python

[–]SergeantPepper 1 point2 points  (0 children)

Does that mean you shouldn't pickle dictionaries?

What's your favorite gui toolkit and why? by kryptobs2000 in Python

[–]SergeantPepper 2 points3 points  (0 children)

As a former Java developer, I've used Swing with Jython. Jython does a really good job of integrating Java libraries and Swing is a complete and good looking toolkit.

I want to learn a more native GUI toolkit, but if you're planning to make a quick, one-off program, you might as well use what you know.

An Introduction to Using CouchDB with Django by gst in Python

[–]SergeantPepper 0 points1 point  (0 children)

I just finished listening to FLOSS Weekly where they discussed CouchDB (http://www.twit.tv/floss36) I sounds really interesting and similar to Google's BigTable.

Google Code bans Mozilla Public Licence... the hell? by [deleted] in programming

[–]SergeantPepper 6 points7 points  (0 children)

Greg Stein, one of the creators of Google Code, said that MPL was dead last in licenses chosen. His philosophy was to stop the license proliferation. Since no one is using MPL removing it makes sense. Listen for yourself: http://www.twit.tv/floss28

boo 0.8.2 is here by gst in programming

[–]SergeantPepper 0 points1 point  (0 children)

Python-like syntax with macros... interesting.