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 oracle.forms.gp; | |
import java.awt.datatransfer.DataFlavor; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.PrintStream; | |
import java.io.Reader; | |
/** |
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 final class Config{ | |
private Config(){} | |
private final static String configPath; | |
private final static File configFile; | |
private static Document document; | |
private static Element doc; | |
static | |
{ | |
configPath = System.getProperty("user.home") + File.pathSeparator +".PROGRAMNAME"+File.pathSeparator+"config.xml"; |
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
/** | |
* | |
* @author Ryupold | |
*/ | |
public class WaitDialog extends javax.swing.JDialog { | |
private static interface ProcessingListener { | |
void onProcess(double percent, String processingStep); | |
} |
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
private string GetImageFromURI(Uri contentURI) | |
{ | |
return MediaStore.Images.Media.GetBitmap(ContentResolver, contentURI); | |
} |
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
BitmapRegionDecoder decoder = BitmapRegionDecoder.newInstance(myStream, false); | |
Bitmap region = decoder.decodeRegion(new Rect(10, 10, 50, 50), null); |
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 Bitmap GetThumbnail(Uri uri, int thumbnailSize) | |
{ | |
var input = this.ContentResolver.OpenInputStream(uri); | |
BitmapFactory.Options onlyBoundsOptions = new BitmapFactory.Options(); | |
onlyBoundsOptions.InJustDecodeBounds = true; | |
onlyBoundsOptions.InDither = true; //optional | |
onlyBoundsOptions.InPreferredConfig = Bitmap.Config.Argb8888; //optional | |
BitmapFactory.DecodeStream(input, null, onlyBoundsOptions); | |
input.Close(); |
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
{ | |
"errors":["Failed to initialize the PowerShell host. If your PowerShell execution policy setting is set to AllSigned, open the Package Manager Console to initialize the host first."], | |
"solutions":[ | |
{ | |
"sources":["http://stackoverflow.com/questions/23353951/cant-install-nuget-package-because-of-failed-to-initialize-the-powershell-host"], | |
"description":"set execution policy to unrestricted", | |
"action":"PowerShell (as Admin): start-job { Set-ExecutionPolicy Unrestricted } -RunAs32 | wait-job | Receive-Job" | |
}, | |
{ | |
"sources":["http://stackoverflow.com/questions/23353951/cant-install-nuget-package-because-of-failed-to-initialize-the-powershell-host"], |
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 CheckHit : MonoBehaviour | |
protected Node CheckHit(Vector2 screenPos, int layer=-1) | |
{ | |
RaycastHit hitInfo; | |
var hit = layer == -1 ? | |
Physics.Raycast(Camera.main.ScreenPointToRay(screenPos), out hitInfo, 1000f): | |
Physics.Raycast(Camera.main.ScreenPointToRay(screenPos), out hitInfo, 1000f, layer); | |
lastRay = Camera.main.ScreenPointToRay(screenPos); | |
if (hit) |
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
$successTimeout = 5 | |
$failedTimeout = 60 | |
$command = "nunit3-console.exe --noresult "+$args[0] | |
if($args[0]) | |
{ | |
write-host "testing",$args[0] | |
write-host "NOTE: nunit3-console.exe needs to be in PATH" | |
echo "" | |
echo "" |
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 static class PropertyUtils | |
{ | |
public static DependencyProperty CreateProperty<TProperty, TOwner> (string propertyName, Action<TOwner, TProperty, TProperty> onChange, TProperty defaultValue=default(TProperty)) where TOwner : class | |
{ | |
return DependencyProperty.Register(propertyName, typeof (TProperty), typeof (TOwner), | |
new PropertyMetadata(defaultValue, (o, args) => | |
{ | |
onChange(o as TOwner, (TProperty)args.OldValue, (TProperty)args.NewValue); | |
})); | |
} |
OlderNewer