Markov bot that degenerates over time
As the bot goes on, its algorithm degrades as elements of randomness are introduced.
As the bot goes on, its algorithm degrades as elements of randomness are introduced.
“A Ruby library for generating plain text x,y cartesian plots and histograms that can be displayed in a terminal session.” on GitHub
There is a lot of information out there on running tests for Angular using Jasmine + Karma. One thing that was tripping me up, though, was being able to access a mock JSON file, rather than trying to hit a server with an HTTP request every test. Working from this code sample, I injected the mock file with the beforeEach call. However, I wasn’t able to access the JSON response until I injected the defaultJSON directly into the specific test: ...
This took me a while to put together. Luckily, RTFM helped. By the way, the example is written in Jade, which I compile to HTML [with Mustache braces in place] using a Grunt task. index.jade has this thing: {{> header}} but it renders to a blank line. I had the header.mustache file in the same directory (mustache/) as index.mustache [which is the file to which the Jade template compiles]. That directory, however, was not the default location that the grunt-mustache-render task was using. So, in my Gruntfile, I simply added options: {directory: "mustache/"} to the mustache_render task. ...
I found it a bit baffling that this functionality was not built in, but from an archival perspective, it makes sense. If you need it for your project, there’s an easy workaround: Go to this GitHub repo and from the Extensions directory, copy the EditComments directory over to your installation’s Extensions directory. In your Bugzilla directory, from the command line, run ./checksetup.pl to build the necessary tables and extra columns and other magical things. Lastly, in template/en/default/bug/comments.html.tmpl, add the following line to your comment_text div: [% Hook.process('a_comment-end', 'bug/comments.html.tmpl') %]. This provides a link to turn on editing for that field. Since I don’t have memcaching enabled [yet!], I commented out line 229 from extensions/EditComments/Extension.pm. Once I get that memcache going, though, that pound sign is coming right out. ...
To see the effects of custom Bugzilla extensions, restart the server. Otherwise, they won’t render.
Resolving the $ conflict between jQuery and YUI… …and what YUI is. All sorts of Apache configuration business, which turned out to be a lot of setting file permissions. chmod g=rw myfile gives read and write permissions to all of the current group members for myfile 87% of the CSS being loaded on my current project aren’t being used Use Chrome Dev Tools to audit yourself Intro to vi commands! i to start typing, esc to stop [i for “insert mode”] Once done typing, :wq to save and quit Jump to line 34 when not in insert mode: :34
Trying to apply the instructions for the Vagrant tutorial to Ubuntu Server 14.04 Trusty Tahr and I ran into a problem when trying to load up the localhost in order to take a peek at my shared directory. I kept getting an Apache error, which meant that the web server was running locally, just nothing was getting served. Running down the error, I came across this Ask Ubuntu post. Rather than trying to mess with any conf files, I simply dropped an html directory to /var/www/ and voila - it worked.
Getting up to speed during my first week on the new job. My first task has been upgrading the versions of Ruby and Rails for the main website. To handle some of the common tasks across web applications, we use an in-house gem. While testing the upgrades, I noticed that some of the JavaScript libraries called in the web app weren’t being pulled out of the gem. It took some digging to discover why, but here’s what I found. ...
“Midway through development we decided to switch from private shared accounts to a corporate account. Switching local repos couldn’t be easier:” git remote rm origin #Removes old origin git remote add origin https://username@bitbucket.org/your.new.repo #Adds new origin pointing to BitBucket git push -u origin #Pushes commits to new repo [I love it when this stuff works so easily.] src