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
var u:Point2D = a.findBoundaryPoint(b.position, a.position); | |
var v:Point2D = b.findBoundaryPoint(a.position, b.position); | |
var l:Float = Math.sqrt(pointsLenSqr(u, v)); | |
content = [ | |
Path { | |
transforms: [ | |
Affine { | |
mxx: (v.x-u.x)/l |
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
<netflow.model.Model id="1"> | |
<nodes id="2"> | |
<netflow.model.MShape id="3"> | |
<flow>10.0</flow> | |
<capacity>10.0</capacity> | |
<name>node-1</name> | |
<type>SOURCE</type> | |
<x>171.0</x> | |
<y>142.0</y> | |
</netflow.model.MShape> |
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
File file = new File("110m_cultural\\110m_admin_0_countries.shp"); | |
FileDataStore store = FileDataStoreFinder.getDataStore(file); | |
SimpleFeatureSource featureSource = store.getFeatureSource(); | |
SimpleFeatureCollection c = featureSource.getFeatures(); | |
SimpleFeatureIterator featuresIterator = c.features(); | |
Coordinate[] coords; | |
Geometry polygon; | |
Point centroid; | |
Bounds bounds; | |
while (featuresIterator.hasNext()) { |
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
%{ | |
#include "calculator.tab.h" | |
using namespace std; | |
%} | |
%% | |
[ \t] ; | |
\+ { return PLUS; } | |
\- { return MINUS; } | |
\* { return MUL; } | |
\/ { return DIV; } |
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 void drawTree(RBNode n, float x1, float x2, float y1, float y2) { | |
if (n != null) { | |
if (n.left != null) { | |
drawConnection((x1 + x2)/2.0f, y1, (x2 - x1)*1.f/4.0f + x1, y2); | |
} | |
if (n.right != null) { | |
drawConnection((x1 + x2)/2.0f, y1, (x2 - x1)*3.f/4.0f + x1, y2); | |
} | |
drawNode("" + n.value, n.isBlack, (x1 + x2)/2.0f, y1); | |
drawTree(n.left, (x2 - x1)*0.f/4.0f + x1, (x2 - x1)*2.f/4.0f + x1, y2, y2 + (y2-y1)); |
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
#include <linux/fb.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <sys/mman.h> |
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 boolean filter(String sSearch, List<Object> list) { | |
if (sSearch.equals("")) { | |
return true; | |
} | |
return list.toString().contains(sSearch); | |
} | |
... | |
List<List<Object>> filteredList = new ArrayList<List<Object>>(); | |
for (int i = 0; i < myList.size(); i++) { |
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 static void transferStreams(Socket socket) throws IOException, | |
InterruptedException { | |
InputStream input1 = System.in; | |
OutputStream output1 = socket.getOutputStream(); | |
InputStream input2 = socket.getInputStream(); | |
PrintStream output2 = System.out; | |
Thread thread1 = new Thread(new StreamTransferer(input1, output1)); | |
Thread thread2 = new Thread(new StreamTransferer(input2, output2)); | |
thread1.start(); | |
thread2.start(); |