|
gariig posted:Sublime Text 2 is my other favorite right now. It is $60 but you don't have to purchase a license it just nags you occasionally. I'm with this guy, minus Emacs. I use Sublime Text 2 at home, VIM at work. VIM did take some tinkering/tweaking/looking up stuff to get it configured how I like it, but it's good. The only down side is that it's trained me to hit esc :w enter a lot.
|
# ? Oct 9, 2012 02:15 |
|
|
# ? May 15, 2024 04:08 |
|
Sizzler Manager posted:I've never tried emacs, but vim is great, and I wish I could do all of my text editing using it. The initial learning curve isn't even really that steep - you start by learning how to move around in a file and enter insert mode, and that gets you basically productive, and then you learn all the other cool poo poo it can do as you go. Scaramouche posted:For Linux I've joined the dark side and actually kinda like vim now. Ok, so what is it that you like about it? What is the "other cool poo poo"? vim has so many adherents that I keep feeling like I must be missing something, but every time I try actually asking I get responses like "you can do everything without taking your hands off the keyboard" and "it has multi-file regex-based search and replace". E: that is to say, features that have been considered standard in any programmer's editor worth using for years, not just vim. ToxicFrog fucked around with this message at 03:05 on Oct 9, 2012 |
# ? Oct 9, 2012 02:44 |
|
ToxicFrog posted:Ok, so what is it that you like about it? What is the "other cool poo poo"? It's Stockholm Syndrome. It's an rear end-backwards pain in the neck to use, but once you finally figure it out, you start liking it because you put so much effort into using the goddamn thing to begin with. I really do enjoy being able to do everything from the keyboard, but gently caress me with a pineapple if the programmers did not have their own arbitrary and frustrating ideas for shortcuts/commands -- I guess because they worked before we standardized things like "save" as opposed to "write."
|
# ? Oct 9, 2012 02:49 |
|
Doing everything without taking your hands off the keyboard is pretty neat. It's hard to appreciate how much time you lose to mousing or hammering on the arrow keys unless you're actually fluent in an alternative. The downside is that it really is a total-immersion editor, and there's not a lot of point in just dabbling in it. Go big or don't bother.
|
# ? Oct 9, 2012 02:57 |
|
Jabor posted:Doing everything without taking your hands off the keyboard is pretty neat. It's hard to appreciate how much time you lose to mousing or hammering on the arrow keys unless you're actually fluent in an alternative. Oh, I totally agree; thing is, this is also something you can do in good non-vim editors. It's not that I consider this an unimportant feature, but nor is it a vim-exclusive one. ToxicFrog fucked around with this message at 03:05 on Oct 9, 2012 |
# ? Oct 9, 2012 03:02 |
|
ToxicFrog posted:Ok, so what is it that you like about it? What is the "other cool poo poo"? I don't know what it is really. Vim is really counter-intuitive in a lot of ways but I also found it easy to remember because dumbass things like ':wq' aren't done by other programs. So it was easy to remember because it didn't make sense, if that makes sense. Back in the 90s I used mostly emacs and I never really liked it. I'd use it, and I'd put it in my shell because I knew how to use it, but never really liked it.
|
# ? Oct 9, 2012 03:11 |
|
Something I can't stress enough with Vim is to use a good .vimrc. The one you get from Googling "vimrc" is a solid starting point, and is well commented so you can make modifications if you like. At the very least, you should skim over the file and see if there is anything you don't want (e.g., I hate smartcase on searches).
|
# ? Oct 9, 2012 03:16 |
|
ToxicFrog posted:Oh, I totally agree; thing is, this is also something you can do in good non-vim editors. It's not that I consider this an unimportant feature, but nor is it a vim-exclusive one. Well yeah, I guess emacs works too. But I think that looking for one "killer feature" that's exclusive to a single editor is a bit of a distraction - you could point to any feature of any other text editor, and I could point out that other editors have that feature as well. The strength of vim is essentially the extensibility - you start with a bare bones editor for very quick plain text editing, and it's very easy to build that up into something optimized for what you use it for. Other editors have similar ecosystems, of course - there's a reason vi/emacs is a traditional flame war topic - but that doesn't mean that they're "better" than vim, just "different".
|
# ? Oct 9, 2012 03:20 |
|
Jabor posted:Well yeah, I guess emacs works too. But I think that looking for one "killer feature" that's exclusive to a single editor is a bit of a distraction - you could point to any feature of any other text editor, and I could point out that other editors have that feature as well. It's not just emacs, but any other programmer's editor made in the last five years, if not the last ten. The bit that I keep returning to, and that keeps confusing me, is that both vim and emacs (vim more so, it seems) have a huge number of adherents that do say vim/emacs is better - not just better than emacs/vim, but better than all of the other editors, unquestionably the best programmer's editor that exists. But when I try to pin down why vim/emacs users think this, I always end up going in circles.
|
# ? Oct 9, 2012 03:41 |
|
ToxicFrog posted:It's not just emacs, but any other programmer's editor made in the last five years, if not the last ten. Basically, if Sublime or emacs or textmate or whatever else floats your boat, then use that, but I recommend Vim because I like using it and I am productive with it. Really, choosing a programmer's editor is pretty subjective.
|
# ? Oct 9, 2012 04:14 |
|
Vi does have the advantage of being usable over SSH and also being preinstalled literally just about everywhere you'd ever want to SSH to.
|
# ? Oct 9, 2012 04:27 |
|
From someone who has used both and likes both equally and has issues with both: vim is a language, emacs is an operating system And I mean that in the most endearing way possible. vim has a vocabulary full of verbs like "append", "insert", "change", and nouns like "end of word", "start of buffer", "the next appearance of the regex 'foo'", "register A", and more. You phrase your editing in terms of these sentences: "change everything up until the end of the word to 'eggs'" => c e eggs<esc> "change everything up until the nearest appearance of the regex 'foo' to 'bar'" => c /foo<ret> bar<esc> My gripes with it are minor UI inconsistencies, like not having a story for whether the "default" mode is "insert" and "append": "insert" seems to be implemented as "move left", "append", as evidenced by it moving back if you do nothing but exit insert mode after you enter it. But all anchors for things like "change" are taken from the "insert" position. emacs, on the other hand, is a LISP environment, with an editor too. emacs implements a lot of things that you wouldn't think an editor would (should?) have, like sockets, an HTTP client, and more. emacs as an editor is pretty powerful. I like emacs more for its multi-buffer control, which I've always thought was secondary. The ability to define complex operations and custom functions and keybindings in full lisp is nice, and allows you do things like templates that are smart and introspect from the environment. Or things like auto-complete that's implemented by talking over a pipe to another process that's running the host language (python, ruby, javascript), or marking text up based on the output of jslint. These things are probably possible in vimscript, but vim isn't an operating system (yet), so it can't talk over sockets. If you get used to macros, and get used to emacs, I've found it perfectly adequate for editing. It's nowhere near the cleanliness and beauty of vim, but it works. My issues with it are more about the various functions it's installed with, and the lack of simple documentation (it has over-comprehensive, useless to newbies documentation). It also isn't coherent as a project, as there's lots of people touching different subsystems: it doesn't have a clear goal or mission statement, so it's impossible to get a cohesive vision in there, too. There's also the bad scrolling by default, and a big lack of debugability if something goes wrong. The infrastructure for distributing emacs files isn't the greatest right now, although that's changing with things like package.el and marmalade (it used to be the de facto "emacs wiki", which had no version control, or even loving authentication. You could rootkit someone's emacs installation by secretly changing a file on the wiki that you didn't own, as a lot of scripts simply wget'd from that) Suspicious Dish fucked around with this message at 04:36 on Oct 9, 2012 |
# ? Oct 9, 2012 04:31 |
|
Right then you lot, riddle me this.... I am writing a software sampler Audio Unit/VST for my final university project, and I am stuck. My research has led me to this paper about an algorithm to find the greatest common divisor between two integers called the Eucledean Algorithm and how it can be used to generate rhythms. I have the algorithm working correctly, but I am having trouble seeing how the results relate to the Binary representations depicted in section 2 of this paper; http://www-cgrl.cs.mcgill.ca/~godfried/publications/banff.pdf In other words how the numbers; 8 = (1)(5) + 3 5 = (1)(3) + 2 3 = (1)(2) + 1 2 = (1)(2) + 0 transform 1 1 1 1 1 0 0 0 0 0 0 0 0 into 1 0 0 1 0 1 0 0 1 0 1 0 0 If anyone can explain to me how the integer output represents the binary sequence, you get a point. Well done! I am stumped. Here is the algorithm as a C++ class - code:
|
# ? Oct 9, 2012 12:49 |
|
As I understand it at first glance. For E(5, 8): 8 = (1)(5) + 3 -> 5 ones and 3 zeroes: [1 1 1 1 1 0 0 0] 5 = (1)(3) + 2 -> take from the zeroes and apply them to the ones, resulting in 5 sequences containing 3 [10]s and 2 untouched [1]s : [10] [10] [10] [1] [1] no more zeroes so we stop here. [1 1 1 1 1 0 0 0] => [1 0 1 0 1 0 1 1] Carthag Tuek fucked around with this message at 13:16 on Oct 9, 2012 |
# ? Oct 9, 2012 13:13 |
|
jiggerypokery posted:Right then you lot, riddle me this.... The observation appears simply to be that the numbers involved in the steps of the algorithm correspond to the numbers appearing in the Euclidean Algorithm calculations. The first step is to go from [(1) (1) (1) (1) (1) (0) (0) (0) (0) (0) (0) (0) (0)] to [(10) (10) (10) (10) (10) (0) (0) (0)]. You start with 5 (1)s and 8 (0)s. I haven't read far into the paper so I don't know if they introduce terminology for these, but I am going to call the left-hand part of the sequence at each step the primary part of the sequence, and the right-hand part the remainder part. Here the primary part is the 5 (1)s and the remainder part is the 8 (0)s. At each step, the remainder part is divided up among the subsequences in the primary part, with the remaining bits being left as the new remainder. So you divide up the 8 (0)s of the remainder part among the 5 (1)s of the primary part as evenly as you can. This leads you to the new sequence: [(10) (10) (10) (10) (10) (0) (0) (0)]. You now have a primary part consisting of 5 (10)s and 3 (0)s. This corresponds to the calculation 8 = 1 x 5 + 3 because whereas before you had the problem of finding the highest common factor of 8 and 5, now you have the problem of finding the highest common factor of 5 and 3. This is mirrored in the sizes of the primary and remainder parts of the before and after sequences. Do you see what I am getting at?
|
# ? Oct 9, 2012 13:23 |
|
Suspicious Dish posted:My gripes with it are minor UI inconsistencies, like not having a story for whether the "default" mode is "insert" and "append": "insert" seems to be implemented as "move left", "append", as evidenced by it moving back if you do nothing but exit insert mode after you enter it. But all anchors for things like "change" are taken from the "insert" position. Suspicious Dish posted:If you get used to macros, and get used to emacs, I've found it perfectly adequate for editing. It's nowhere near the cleanliness and beauty of vim, but it works. My issues with it are more about the various functions it's installed with, and the lack of simple documentation (it has over-comprehensive, useless to newbies documentation).
|
# ? Oct 9, 2012 13:24 |
|
ToxicFrog posted:Ok, so what is it that you like about it? What is the "other cool poo poo"? I think for me it's modality and Normal commands, mostly. It makes the editing just feel better than in non-modal editor. Most editors I've seen are relying on complex multi-modifier shortcuts to provide features like that, and I hate those. Plus the little gems, like the undo tree. That's really neat. Suspicious Dish posted:My gripes with it are minor UI inconsistencies, like not having a story for whether the "default" mode is "insert" and "append": "insert" seems to be implemented as "move left", "append", as evidenced by it moving back if you do nothing but exit insert mode after you enter it. But all anchors for things like "change" are taken from the "insert" position. Cursor moving back is some compatibility crap, I use inoremap <Esc> <Esc>g`^ to get rid of that.
|
# ? Oct 10, 2012 00:27 |
|
PiotrLegnica posted:Cursor moving back is some compatibility crap, I use inoremap <Esc> <Esc>g`^ to get rid of that. My understanding is that a big pro of vim is that it works everywhere without your special keybindings and customizations. So I tried hard to work within the constraints of vim, because I can't install my random remapped keybindings on everybody's machine.
|
# ? Oct 10, 2012 01:38 |
|
Suspicious Dish posted:My understanding is that a big pro of vim is that it works everywhere without your special keybindings and customizations. So I tried hard to work within the constraints of vim, because I can't install my random remapped keybindings on everybody's machine. I really disagree with this. The stock vim would drive me nuts if I had to use it for anything sizable. I just download a copy of my vimrc (that I host) whenever I use a new computer and it has worked great. The one I linked a few posts ago is solid and easy to find.
|
# ? Oct 10, 2012 02:42 |
|
Suspicious Dish posted:My understanding is that a big pro of vim is that it works everywhere without your special keybindings and customizations. So I tried hard to work within the constraints of vim, because I can't install my random remapped keybindings on everybody's machine. code:
|
# ? Oct 10, 2012 03:07 |
|
This may sound like an odd question, but does anyone know of an open source library for chess AI in C#?
|
# ? Oct 10, 2012 21:02 |
|
mmm11105 posted:This may sound like an odd question, but does anyone know of an open source library for chess AI in C#? You could try asking the .NET thread.
|
# ? Oct 10, 2012 21:34 |
|
mmm11105 posted:This may sound like an odd question, but does anyone know of an open source library for chess AI in C#? Are you looking to write your own chess playing AI leveraging a toolkit library or do you want to embed a complete chess AI? Would wrapping something like Crafty or another open source chess program that is written in C work?
|
# ? Oct 10, 2012 22:58 |
|
Hammerite posted:Do you see what I am getting at? Yeah I think so! Most helpful, Thanks!
|
# ? Oct 11, 2012 01:48 |
|
taqueso posted:Are you looking to write your own chess playing AI leveraging a toolkit library or do you want to embed a complete chess AI? Would wrapping something like Crafty or another open source chess program that is written in C work? Preferably a whole chess AI I could embed. It's for a small bit of a very low time allowance project. Also it's in Unity, so I'm not sure about wrapping C
|
# ? Oct 11, 2012 03:19 |
|
mmm11105 posted:Preferably a whole chess AI I could embed. It's for a small bit of a very low time allowance project. Also it's in Unity, so I'm not sure about wrapping C http://chessforeva.blogspot.com/2012/01/c-chess-engines.html http://www.codeproject.com/Articles/290931/My-Csharp-chess-engine-on-BitBucket http://archive.msdn.microsoft.com/cshuochess http://stackoverflow.com/questions/759664/anyone-know-of-a-good-net-chess-engine
|
# ? Oct 11, 2012 19:22 |
|
I didn't see a MongoDB thread anywhere and was curious if anyone has any real experience with optimizing it? In my use case we store a JSON object that can vary widly per user. Each user can customize the fields of their "survey" and this collection stores a result of that survey. Example insert: { _id: ObjectId(), owner_id: ObjectId, survey_id: ObjectId, survey_results: { key1: 'Friendly', key2: 'Not Friendly', key3: 'Likes Cats' } } The keys change because the surveys can also vary wildly. Now adding searching on to this survey has been painful. Without a proper index it is EXTREMELY slow. Even with queries like (unindexed, this is indexed now but its just an example): { owner_id: ObjectID(), survey_id: ObjectId() } The default searching is sortAndScan. The collection of these documents just hit over 600k and it is insanely slow when the nsscanned objects is over 10k. Anyone with way more experience with Mongo have any ideas of how to optimize this?
|
# ? Oct 11, 2012 22:38 |
flare posted:{ _id: ObjectId(), owner_id: ObjectId, survey_id: ObjectId, survey_results: { key1: 'Friendly', key2: 'Not Friendly', key3: 'Likes Cats' } } I can't say I have any real experience, but depending on the number of surveys you have active at a time, maybe consider doing some sort of clustering based on whether surveys are active or archived. Put results from active surveys into their own collections (one collection per survey) and add survey-appropriate keys to each of those collections. After a period of inactivity, a survey then gets moved into archive, which is a basic collection like you have now, indexed only on the id's of survey and responder. If you need to do analysis on an archived survey later again, you could pull the results back out to the indexed storage. One more idea, if some surveys are small and gets a low number of responses, you may want to cluster all of those together as well. Then you'd have two basic classes of response collections: Specially indexed and generally indexed. There would then only ever be two generally indexed collections, the archive and the "small surveys" one.
|
|
# ? Oct 11, 2012 22:57 |
|
Somewhere I remember someone linking to a method which was more like: survey_results:[{key:"key1", value:"Friendly"}, {key:"key2", value:"Not Friendly"}, {key:"key3", value:"Likes Cats"}] A key on survey_results would be over the pairs, which I guess would work so long as you're looking for exact matches. Also for shits and grins you could try using self organizing maps to classify large groups of questions into two dimensional vector spaces then use a geographic index.
|
# ? Oct 12, 2012 02:02 |
|
Also since this thread reminded me, what's the canonical way to decorate a deserialized JSON object with methods and whatnot? Setting __prototype__ seems the most straightforward but I didn't know if people have settled on something else like using it as a constructor parameter, some sort of reviver or what. It seems like the sort of idiom that should be common enough for people to settle on 'the right way'.
|
# ? Oct 12, 2012 02:36 |
|
__prototype__ is non-standard. You can just use Object.create() instead.
|
# ? Oct 12, 2012 02:56 |
|
I looked at that but the fields of the object that you pass to Object.create() are treated as property descriptors. Is there something I'm missing about it?
|
# ? Oct 12, 2012 03:23 |
|
In Excel, how do you search for all cells with errors (#VALUE!) within a workbook?
|
# ? Oct 12, 2012 12:07 |
|
Why is everything suddenly being pushed to "the cloud"? I understand storing media such as mp3's in a cloud so your devices can access them from anywhere. That makes sense. But I've seen managers asking or pushing this buzzword in areas it perhaps doesn't belong. I've seen technologies rebrand their already existing data colocation/rollover as now Cloud enabled (such as Apache Solr sharding which is now SolrCloud). Hardware is cheaper these days and the majority of companies tend to like their data onsite rather than at some storage cloud company...and the companies that like that type of service already use such a service before it was called a cloud. Will this poo poo die down or is there some grand thing I'm not understanding?
|
# ? Oct 16, 2012 03:05 |
|
Buzzword compliance.
|
# ? Oct 16, 2012 03:09 |
|
"Cloud computing" is essentially a meaningless term and can be used to refer to almost anything that involves a network connection. Consider your paradigm rightsized.
|
# ? Oct 16, 2012 03:11 |
|
Internet Janitor posted:"Cloud computing" is essentially a meaningless term and can be used to refer to almost anything that involves a network connection. Consider your paradigm rightsized. Or not. There's this thing called "ownCloud", which is a giant PHP script that emulates Dropbox. It's designed to run on your local machine, so there is software out there that has cloudwords that doesn't run over the network. So yeah, cloud computing is nothing more than vaporware. I don't know why it's picking up steam. Out of all this, the thing that I'm most surprised about is that more people haven't come up with more weather related puns.
|
# ? Oct 16, 2012 04:59 |
|
mister_gosh posted:Hardware is cheaper these days and the majority of companies tend to like their data onsite rather than at some storage cloud company...and the companies that like that type of service already use such a service before it was called a cloud. Maybe if you already have the infrastructure in place, but a lot of services like Amazon's EC2 and Heroku didn't become popular IMO until the cloud buzzword took off. Also there is no end of web 2.0 startups hosting their poo poo in the cloud to cut capex costs. At least not until this second bubble bursts
|
# ? Oct 16, 2012 05:35 |
|
mister_gosh posted:Why is everything suddenly being pushed to "the cloud"? It won't die down. The cloud is a rehash of everything that came before it with one major difference: elasticity (hence the E in EC2). It can be used to:
Nothing you couldn't do before is impossible without a cloud; it just costs money up front and has setup costs and upkeep. As mentioned by Hard NOP Life, it cuts capital expenditures. Imagine if everyone originally shopped at Costco, then grocery stores and bodegas were invented. --- There is one thing, though, that the cloud sucks at - video encoding. Virtualization fucks with the CPU and I/O dramatically, so if you need the latency you are either going to provision physical servers for it or pay out the nose for a VM which approaches the specs of a full physical server (and will still be slower).
|
# ? Oct 16, 2012 06:13 |
|
|
# ? May 15, 2024 04:08 |
|
Doctor w-rw-rw- posted:There is one thing, though, that the cloud sucks at - video encoding. Virtualization fucks with the CPU and I/O dramatically, so if you need the latency you are either going to provision physical servers for it or pay out the nose for a VM which approaches the specs of a full physical server (and will still be slower). You could conceivably do GPU encoding on Amazon's service if you can find the special snowflake of a GPU encoder that actually works and handles the format(s) you target. Still, probably less cost/effort to buy a Xeon server with 32 cores and spend an hour configuring it.
|
# ? Oct 16, 2012 14:49 |