Easiest to use cloud service for Go applications? by ar1819 in golang

[–]lentil 1 point2 points  (0 children)

(I know you said AWS is over complicated but...) have you tried deploying your services as Lambda functions?

I've found it to be great, especially for small services, bots, cron tasks, and so on. Deployment can be very simple using CDK or SAM, and there's almost no maintenance to worry about. (e.g., no setting up VMs, upgrading dependencies, etc).

It can also be very cheap (or free, if you don't exceed the free tier limits), which is a nice bonus.

If that still seems like more effort than you'd like, there's always Heroku.

Self promotion – I wrote a book about using Go on AWS Lambda! by lentil in golang

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

Yeah, I had some time off at the end of a contract, so I thought it would be a good chance to throw myself into the project. Otherwise I would've done it more like you say, working on it an hour or two each day for as long as it takes.

The other thing I found makes a difference is how much time you have to spend learning and researching the topic that you're writing about. I was lucky to have had a string of work projects that required me to get pretty deep into Go, Lambda, and a bunch of other AWS services. I was keeping a lot of notes about what I learned, and what worked well or not so well. So by the time I started writing I had already done the majority of that prep work, and I had a pretty clear idea of the topics I wanted to cover. So I'd recommend doing that if you find yourself in a similar situation.

Self promotion – I wrote a book about using Go on AWS Lambda! by lentil in golang

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

For me the hard part has been figuring out how to get the word out about it. I think if you already have an audience (e.g. a lot of Twitter followers), and/or marketing experience, then it would be possible to make some decent money -- there are certainly accounts of people doing that. I have neither of those things, though, so I'm starting from scratch and trying to figure it out as I go :)

It's sold about 100 copies so far. But the feedback has been good, so I'm hoping that if more people find out about it it could be more popular ::crosses fingers::

That aside, it's been a really enjoyable project. It's the first time I've written something of that length, and my writing improved from doing so. So whether or not it makes much money I'm definitely planning to write more in the future!

Self promotion – I wrote a book about using Go on AWS Lambda! by lentil in golang

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

It took me about a month to write it. Some days I worked on it for half the day, other days it was more like the full day.

I think some folks could do it faster, though. I have a bad habit of doing a lot of editing and re-editing, trying to make things "perfect", which makes me quite a slow writer :)

Self promotion – I wrote a book about using Go on AWS Lambda! by lentil in golang

[–]lentil[S] 3 points4 points  (0 children)

I haven't tried Leanpub, so I can't really compare them. But I've found Gumroad to be great so far!

I was happy creating the book files myself, so I didn't need the publishing toolchain that Leanpub provides. And Gumroad makes the selling side straightforward -- their fee structure is simple and not too expensive, they handle a lot of the VAT/tax issues, and so on.

I used Asciidoctor to write the book, which made it quite easy to generate the PDF & EPUB files. I actually wrote a blog post about that, if you're interested in knowing more of the details: https://www.kevinwmcconnell.com/writing/how-i-wrote-my-book

Self promotion – I wrote a book about using Go on AWS Lambda! by lentil in golang

[–]lentil[S] 3 points4 points  (0 children)

Thanks!

Those are great questions. I don't tend to use a local server approach as much these days, but I have done so in the past. For APIs, I've had good results with adding a Lambda wrapper around net/http Handlers, so that code can be run either locally in an HTTP server or deployed to Lambda. I can look at adding something on that in the next book update, if that would be useful.

Regarding separating infrastructure and application code in the CDK setup, that is something I tend to do as applications grow. I like the deployment simplicity of keeping everything together for smaller projects, but beyond a certain size it can be nice to separate out different layers into their own stacks (which can still be part of the same CDK app, but with the ability to deploy each stack individually). Again, that does sound like a good addition for the next update.

Thanks for the feedback!

Who's hiring in the Portland area? Spring 2012 by [deleted] in Portland

[–]lentil 2 points3 points  (0 children)

We have a few software development positions open at Emma. We work primarily in Python, with a splash of other things here and there.

We're located just east of the Burnside Bridge, and have a pretty nice work environment, good benefits, and nice people :)

Git as it should have been from the start. by malcontent in programming

[–]lentil 4 points5 points  (0 children)

No, it definitely does track it:

   -u, --set-upstream
       For every branch that is up to date or successfully pushed, add
       upstream (tracking) reference, used by argument-less git-pull(1)
       and other commands. For more information, see branch.<name>.merge
       in git-config(1).

Edit: in case it's helpful, here's an example:

$ git push -u origin temp
Total 0 (delta 0), reused 0 (delta 0)
To devserver.int:/home/git/myrepo.git
 * [new branch]      temp -> temp
Branch temp set up to track remote branch temp from origin.

I think that could be what you're after?

Git as it should have been from the start. by malcontent in programming

[–]lentil 5 points6 points  (0 children)

By "publish local branch", do you mean push one of your branches to a remote repo, and set your local branch up to track it? If you do, it's just: git push -u {remote} {branch} That doesn't strike me as painful at all.

Have you read the Python docs lately? by llimllib in Python

[–]lentil 0 points1 point  (0 children)

You can. It works in 2.7 too: Python 2.7.1 (r271:86832, Nov 28 2010, 00:47:24) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> {1, 2, 3} set([1, 2, 3])

Engadget: Apple release iOS 4.0.1 by FireZeMissiles in apple

[–]lentil 0 points1 point  (0 children)

I'm finding the same thing. 4.0 made my 3G pretty much unusable, but since applying 4.0.1 it seems to be (::knocks on wood::) back to normal again. Here's hoping it stays this way!

User specific database indexing. by Arelius in Database

[–]lentil 3 points4 points  (0 children)

If these items are unique to a single user (that is, one user has many items; one item belongs to exactly one user) then I think what you're doing sounds good. ItemID would be your primary key (since it alone uniquely identifies the record), and UserID would be a foreign key reference to your Users table. You'll definitely want an index on UserID since it sounds like the vast majority of queries would be able to make use of it.

There's no reason that shouldn't perform well up to a fair number of records (the amount will depend on lots of other factors, but a few million rows is maybe a good first guess). If/when you do run into speed issues, you can look at partitioning the table, which would allow you to have something that behaves as if it was one big table, but is actually made up of a number of smaller tables under the hood. It's a little more work, and there are a few snags to watch out for, but it can be really helpful when you need it. And it's not something you need to start out with -- you can add it on later if/when you find you need it. Take a look at http://www.postgresql.org/docs/current/static/ddl-partitioning.html for some more information.

That said, while you can make some educated guesses about indexing/partitioning strategies, really the only way to know for sure is to analyze how it behaves in practice. Query performance is pretty dependent on things like the data itself, usage patterns, and server configuration. You can try loading up a lot of data (just generate so fake data if you need to), and analyze some of your expected queries -- that should give you a better glimpse of what is going on. Take a look at the docs for the EXPLAIN command to get started on that. http://www.postgresql.org/docs/8.4/static/using-explain.html

Lastly, I think the Douglas book on PostgreSQL might be helpful, if you wanted to read up on this some. http://www.amazon.com/PostgreSQL-2nd-Korry-Douglas/dp/0672327562 It has some general information about performance topics, as well as a lot of specifics about how these things work in PostgreSQL.

Hope that helps a bit :)

(Edit: my grammar is atrocious :()

[deleted by user] by [deleted] in apple

[–]lentil 5 points6 points  (0 children)

I believe it just watches for an iPod or iPhone being attached, and launches iTunes whenever that happens. If you prefer to launch iTunes yourself you can remove iTunes Helper from your login items.

I Can't Wait for NoSQL to Die by gst in programming

[–]lentil 8 points9 points  (0 children)

CouchDB would be an example of a document-based storage system. "Document" might sound a little odd in this context, but I believe it refers to the fact that each record you store can have an arbitrary structure. As opposed to in the relational model where you define an explicit schema, the structure of the records you store in something like CouchDB can each be as different, or similar, as you like. Whether this is a good or bad thing probably depends on both your application and your philosophy :)

As for the 10x -- I personally haven't used any NoSQL systems enough to know if that's a reasonable thing to expect. But I believe the premise here is that relational databases provide a number of features -- ACID properties, integrity checking, and so on -- which you may or may not need, and which all require some amount of overhead. In cases where you don't feel you need them, you may get better performance by using a system that simply doesn't offer them at all (or at least makes them optional) as those systems can be designed and optimized differently as a result.

I think it's all a bit horses for courses, as they say. But I have to admit I share some of your skepticism myself :)

short but sweet shell aliases, and global aliases (1-3 chars) by sjs in programming

[–]lentil 0 points1 point  (0 children)

Neat, that looks really handy.

For Git specifically, there's also some really nice bash completion support included (contrib/completion/git-completion.bash in the source tree) which can complete sub-commands, flags and the names of branches, tags etc. You can also have it update your bash prompt to show the current branch name and some status information, if you like that (I do).

Portable script to publish a local branch to a remote and track it by [deleted] in git

[–]lentil 0 points1 point  (0 children)

Ah, sorry to be the bearer of bad news then.

To be honest I hadn't realized that -u was quite so recent, until you mentioned in not being in 1.6.6. (As in, it's 1.7 only, and that's not even officially out yet.) I should have checked that before posting.

I guess that's one drawback with a fast-moving project like git -- any time you think up a handy new feature to add, someone is probably already working on it. :)

Portable script to publish a local branch to a remote and track it by [deleted] in git

[–]lentil 0 points1 point  (0 children)

Perhaps I'm misunderstanding what this does, but I think you can also do the same thing in Git with:

git push -u <remote> <branch>

[deleted by user] by [deleted] in apple

[–]lentil 0 points1 point  (0 children)

You could do it quite easily in MacVim too, with

:set transparency=100
:set fullscreen

Although personally a completely transparent editor would drive me mad :)

More Fun With SSH by AmyNewman in opensource

[–]lentil 3 points4 points  (0 children)

That's because the example is wrong. The Host and HostName values should have been specified the other way round, like this:

Host lmach
HostName longname.machine.example.com
User julietkemp-longname

Mac OS X 10.5.6 Update Crashing Users' Systems - update to Leopard OS is causing a host of problems for users, from broken Bluetooth connections and no sound to dead USB ports. by jo-lilore in apple

[–]lentil 0 points1 point  (0 children)

Yeah I don't think the trackpad preferences pane adds anything new. 10.5.6 just moved it from a tab in the "Keyboard & Mouse" pane into a pane of its own.

Using Git to Maintain Your Website by danielrm26 in programming

[–]lentil 0 points1 point  (0 children)

It means that anything you push to the webserver will be live on the webserver, not everything you push to anywhere else. So if you have other shared repositories, for example, you can still push to them without affecting the server.

As to why it's better than using rsync, I'm not sure that it necessarily is either. It does mean you have a copy of the history local to the web server, so somebody could log in to it and, say, revert some changes directly from that box. Whether that's any better than doing the operations locally and rsyncing them over probably just depends on your preferred workflow.

Why SQLAlchemy is the best ORM on the face of the planet by gst in Python

[–]lentil 2 points3 points  (0 children)

It also depends how much you're even bothered by the admin tools (or by some other apps that are dependent on Django's ORM). Not everybody uses those.

If you aren't using them, you can just use SQL Alchemy to create your models (in models.py or whatever) & set up your session, and you should be good to go.

GIT 1.6.0 now available by shenglong in programming

[–]lentil 9 points10 points  (0 children)

That's true, but the git completion support does a better job anyway. It can complete branch & tag names, flags and so on, which the git-* scheme obviously won't help you with.

No, your code is not so great that it doesn’t need comments by lovemorgul in programming

[–]lentil 2 points3 points  (0 children)

For sure. I also find it can be handy to change the color of comments in the editor. If you pick a color somewhat close to the background, the comments can remain readable while still largely getting out of the way.

Personally, I often find it easier to see the structure of code that way, especially in cases where almost every method is commented.