This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Let's implement turing machines in ruby arithemtic | |
| # we want to encode tape, state and position in a single integer and - given a turing machine - write | |
| # a function that emulates the turing machine. | |
| # We limit our selves to simple machines - 100 states tops, 100000 positions on the tape | |
| NSTATES = 100 | |
| NPOSITIONS=100000 | |
| # check for zero | |
| def d(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| c = {} | |
| def cached_collatz(n,c) | |
| c[1] = [1] | |
| i = n | |
| s = [] | |
| while c[i].nil? | |
| s.push(i) | |
| i = (i % 2 == 0 ? i/2 : 3*i+1) | |
| end | |
| while s.count > 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"error": 42716.2954, "samples": 506, "value": [22.532806324110698], "label": "RM <= 6.94", "type": "split", "children": [{"error": 17317.3210, "samples": 430, "value": [19.93372093023257], "label": "LSTAT <= 14.40", "type": "split", "children": [{"error": 6632.2175, "samples": 255, "value": [23.349803921568636], "label": "DIS <= 1.38", "type": "split", "children": [{"error": 390.7280, "samples": 5, "value": [45.58], "label": "CRIM <= 10.59", "type": "split", "children": [{"error": 0.0000, "samples": 4, "value": [50.0], "label": "Leaf - 4", "type": "leaf"}, {"error": 0.0000, "samples": 1, "value": [27.9], "label": "Leaf - 5", "type": "leaf"}]}, {"error": 3721.1632, "samples": 250, "value": [22.90520000000001], "label": "RM <= 6.54", "type": "split", "children": [{"error": 1636.0675, "samples": 195, "value": [21.629743589743576], "label": "LSTAT <= 7.57", "type": "split", "children": [{"error": 129.6307, "samples": 43, "value": [23.969767441860473], "label": "TAX <= 222.50", "type": "split", "children": [{"err |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'mechanize' | |
| require 'logger' | |
| require 'json' | |
| ROOT = "http://www.kmdvalg.dk/main" | |
| def get_agent | |
| agent = Mechanize.new | |
| agent.log = Logger.new "mech.log" | |
| agent.user_agent_alias = 'Mac Safari' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Getting Ruby above 1.8.7 up and running on Site 5 | |
| Start with http://kb.site5.com/ruby-on-rails/select-a-version-of-ruby-for-your-hosting-account/ is a little off | |
| For some reason - my .bashrc is not picked up - but I can just | |
| source .bashrc | |
| and that works then | |
| Check your Ruby is 1.9 something or 2.0 something | |
| Now you need to install bundler AFTER doing that | |
| verify your bundle command is now in ~/ruby/gems |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // på http://www.evm.dk/arbejdsomraader/vaekst-og-konkurrenceevne/redegoerlse-om-vaekst-og-konkurrenceevne | |
| // åben dev console | |
| data = [] | |
| $.ajaxSetup({complete: function(something) {obj = JSON.parse(something.response); data.push(JSON.parse(obj.d);}}) | |
| // og nu fanger man alle data hent på siden, i data - de kan så jsonificers og gemmes elsewhere | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Homebrew is fine | |
| but ALWAYS | |
| brew install octave --with-docs | |
| or no packages will install inside octave (if you don't need packages, never mind the docs) | |
| that in turn requires tex | |
| you can | |
| brew install Caskroom/cask/mactex | |
| which builds a text installer that you can then run | |
| - or download a binary, prolly much faster | |
| After that you should be pretty golden and packages should install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://github.com/wayneeseguin/rvm/issues/1975#issuecomment-20223263 fixede | |
| løste Error running requirements_osx_brew_libs_install openssl098 | |
| løsning på The requested url does not exist(22): 'http://production.cf.rubygems.org/rubygems/rubygems-2.0.15.tgz' | |
| er | |
| wget | |
| mv | |
| nu ka man installere de rigtige rubygems versioner også... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FORM_OPEN_DATE = "2014-03-14 08:00"; | |
| FORM_CLOSE_DATE = "2014-11-09 23:30"; | |
| RESPONSE_COUNT = "30"; | |
| /* Web tutorial: http://labnol.org/?p=20707 */ | |
| /* Initialize the form, setup time based triggers */ | |
| function Initialize() { | |
| deleteTriggers_(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| We're sorry to hear that you're experiencing problems with your data usage on your Nexus 5 device after updating to the latest Android version. | |
| Troubleshooting for Nexus 5 | |
| To try and resolve the issue at hand, I have some troubleshooting steps I would like you to try: | |
| Conduct a forced shut off by holding Power button and shutting phone down and restarting the device | |
| Then, try clearing the cache partition. Here's how: | |
| Hold power button for 2 seconds and select 'Power Off' | |
| Press and hold the Volume Up and the Volume Down and Power keys at the same time for about 10 seconds. | |
| An image of an Android lying on its back will appear. | |
| Press the Volume Down key twice until "Recovery mode" appears on the screen. |