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
| Categories below - after internal discussion we reduced the reparations as follows: | |
| Severe - sacrifice captial or other major city: | |
| Diablito (Swinging London) | |
| LauraChristine (Complete) | |
| Xandrosch | |
| Keeves (Almost complete) | |
| Sooner | |
| Wuzzel/Wuzzy |
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
| @Kroll.method | |
| public void getWirelessNetworks(KrollInvocation invocation) { | |
| if (Util.gEmulatorMode == false) { | |
| wifiMgr = (WifiManager) invocation.getTiContext().getActivity().getSystemService(Context.WIFI_SERVICE); | |
| receiver = new WifiReceiver(); | |
| invocation.getTiContext().getActivity().registerReceiver(receiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)); | |
| wifiMgr.startScan(); | |
| } | |
| } | |
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
| int[] x = [1,2,3,4,5] | |
| int[] y; | |
| for(int i = 0; i < x.length; i++) { | |
| y[i] = Math.exp(x[i], 2); | |
| } |
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
| x = 1...5 | |
| y = x.map {|n| n**2 } |
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
| class Device | |
| attr_accessor :measurements | |
| def initialize | |
| @measurements = [] | |
| end | |
| end | |
| class Measurement | |
| attr_accessor :frequency, :points, :magnitudes |
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
| last_file = Dir.open('.').select{|d| d.include?("output")}.sort.last | |
| current_session = last_file ? last_file.match(/[0-9]{1,}/).to_s.to_i + 1 : 0 | |
| File.open("output#{current_session}.txt", 'a') do |f| | |
| puts "Session: #{current_session}" | |
| while thought = gets != "that's all for now\n" | |
| print "\e[2J\e[f" # clear the screen. | |
| f.write(thought) | |
| end | |
| end |
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
| package com.button.radio; | |
| import android.app.Activity; | |
| import android.os.Bundle; | |
| import android.view.View; | |
| import android.view.View.OnClickListener; | |
| import android.widget.Button; | |
| import android.widget.RadioButton; | |
| import android.widget.RadioGroup; | |
| import android.widget.Toast; |
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 'rubygems' | |
| require 'json' | |
| SITE = "http://www.righttofoodindia.org/" | |
| links = JSON.parse(File.open("map.json").read) | |
| # links.each do |link| | |
| # filename = link["name"].downcase.gsub(" ", "_").gsub("'", "").gsub("/", "") | |
| # category = link["uri"].split("/").first |
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
| public void holdYaw(double target,double factor) throws FgException | |
| { | |
| // get current Heading degree | |
| // calculate the deviation in degree | |
| double aircraftHdg = a.getHeadingDeg(); | |
| double degreeToTurn = calcDegreeToTurn(); | |
| // Limit the potential for an integrator to accumulate ridicuously high values when | |
| // we cannot reach its target yaw for a period of time. |
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
| # http://en.wikipedia.org/wiki/Simple_linear_regression | |
| defmodule Exchange.Calc do | |
| def linear_regression(points) do | |
| n = length(points) | |
| # Average of sum of products | |
| sop_bar = sum_of_products(points) / n | |
| # Average of sum of x and y respectively |
OlderNewer