This file contains 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 class BadTickerException extends IllegalArgumentException { | |
private static final long serialVersionUID = 1L; | |
public BadTickerException() { | |
super(); | |
} | |
public BadTickerException(String s) { | |
super(s); |
This file contains 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 onItemClick(AdapterView<?> adapterView, View view, int i, long l) { | |
ChargePoint chargepoint = gson.fromJson(results.get(i).getJson(), | |
ChargePoint.class); | |
StationList slist = chargepoint.getStationList(); | |
List<Summary> summaries = slist.getSummaries(); | |
Summary summary = summaries.get(0); | |
long available = summary.getMapData().getLevel2().getPaid() | |
.getAvailable(); | |
String toSpeak = available + "! " + | |
((available == 1) ? "charger is" : "chargers are") + |
This file contains 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 class MainActivity extends AppCompatActivity implements SensorEventListener // class decl | |
SensorManager manager = (SensorManager) getSystemService(SENSOR_SERVICE); // oncreate | |
manager.registerListener(this, manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), // oncreate or onresume | |
SensorManager.SENSOR_DELAY_UI); | |
manager.unregisterListener(this); // ondestory or onpause | |
@Override |
This file contains 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
<!-- link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> | |
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> | |
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script --> | |
<link rel="stylesheet" href="lib/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css" /> | |
<script src="lib/jquery-2.1.4/jquery-2.1.4.min.js"></script> | |
<script src="lib/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.js"></script> | |
... | |
<div align="center"> |
This file contains 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
<resources> | |
<string name="app_name">Recipe</string> | |
<string name="hello_world">Hello world!</string> | |
<string name="action_settings">Settings</string> | |
<string name="tvTitle">Bruschetta</string> | |
<string name="description">Recipe Image</string> | |
<string name="btnRecipe">View Recipe</string> | |
<string name="tvIngredients">Ingredients</string> | |
<string name="tvIngredients1">4 plum tomatoes</string> |
This file contains 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 edu.ggc.lutz.pixabay; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.util.Log; | |
import com.google.gson.Gson; | |
import java.io.IOException; | |
import java.io.InputStream; |
This file contains 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 class ComputeArea { | |
public static void main(String[] args) { | |
double radius; // Declare radius | |
double area; // Declare area | |
// Assign a radius | |
radius = 20; // New value is radius | |
// Compute area | |
area = radius * radius * 3.14159; |
This file contains 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
// de-emphasize transient forces | |
private float lowPass(float current, float gravity) { | |
// ALPHA indicates the influence level of past observations | |
return current * (1-ALPHA) + gravity * ALPHA; | |
} | |
// de-emphasize constant forces | |
private float highPass(float current, float gravity) { | |
return current - gravity; | |
} |
This file contains 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
import java.util.Scanner; | |
public class AdditionQuiz { | |
public static void main(String[] args) { | |
int number1 = (int)(System.currentTimeMillis() % 10); | |
int number2 = (int)(System.currentTimeMillis() / 7 % 10); | |
// Create a Scanner | |
Scanner input = new Scanner(System.in); |
OlderNewer