Skip to content

Instantly share code, notes, and snippets.

@battleguard
battleguard / camera_problem.earth
Created August 5, 2015 15:46
OsgEarth Camera Problems
<map name="Boston Demo" type="geocentric" version="2">
<image name="world" driver="gdal">
<url>../data/world.tif</url>
</image>
<model driver="feature_geom" name="world">
<features driver="ogr">
<url>../data/world.shp</url>
</features>
<layout>
@battleguard
battleguard / README.txt
Last active August 29, 2015 14:24
OpenSceneGraph and OsgEarth automated build script
steps to build
1. download 3rd Party full or small for OSG from OSG's website
2. download OSG's source
3. download OsgEarth source
4. extract them all and setup directory structure as such (you can change this setup but this is the default way)
- osgEarthinstallfolder
-- 3rdParty
-- osg
-- osgearth
build-osg.bat
build-osgearth.bat
::third party location http://www.osgvisual.org/projects/osgvisual/wiki/Downloads#Dependencies
public class Links
{
[JsonProperty("self")]
public string Self { get; set; }
[JsonProperty("next")]
public string Next { get; set; }
[JsonProperty("featured")]
private static void FormatJsonFile()
{
string jsonText = File.ReadAllText("Modules.json");
string goodText;
string[] textSplits = jsonText.Split('[', ']');
goodText = textSplits[0];
for (int i = 1; i < textSplits.Length; i+=2)
{
@battleguard
battleguard / 1A_SimpleYieldReturn.cs
Last active August 29, 2015 14:21
Example Of Compiler Generated Code For Yield Return
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApplication5
{
public class SimpleYieldReturn
{
static void Run()
{
@battleguard
battleguard / App.xaml
Created January 23, 2015 05:16
Proper Style Inheritance in WPF
<Application x:Class="WpfApplication1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WpfApplication1.Controls"
StartupUri="MainWindow.xaml">
<Application.Resources>
<Style TargetType="{x:Type Control}" x:Key="MetroControl">
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/>
</Style>
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource MetroControl}"/>
public interface Predicate {
boolean check();
}
public class PredicateCallable implements Callable<Boolean> {
private final Predicate[] predicates;
public PredicateCallable(Predicate... predicates) {
this.predicates = predicates;
}
@battleguard
battleguard / DebugCondition.java
Created October 30, 2014 11:14
debugging conditions
package org.battleguard.scripts.testscript;
import org.powerbot.script.Condition;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicInteger;
public class DebugCondition extends Condition {
public static boolean wait(Callable<Boolean> condition, String text) {
return wait(condition, text, 600, 10);
@battleguard
battleguard / DoublePicker.xaml
Created October 29, 2014 03:52
Wpf touch friendly metro style Pickers
<UserControl x:Class="SmallTestbed.Pickers.DoublePicker"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:pickers="clr-namespace:SmallTestbed.Pickers"
x:Name="_self">
<pickers:TouchComboBox x:Name="_comboBox"
SelectedIndex="{Binding ElementName=_self, Path=SelectedIndex, Mode=TwoWay}"
SelectedItem="{Binding ElementName=_self, Path=SelectedItem, Mode=TwoWay}"/>
</UserControl>